Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Frank-Friemel committed Nov 20, 2018
0 parents commit a897636
Show file tree
Hide file tree
Showing 92 changed files with 19,175 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Auto detect text files and perform LF normalization
* text=auto
32 changes: 32 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Prerequisites
*.d

# Compiled Object files
*.slo
*.lo
*.o
*.obj

# Precompiled Headers
*.gch
*.pch

# Compiled Dynamic libraries
*.so
*.dylib
*.dll

# Fortran module files
*.mod
*.smod

# Compiled Static libraries
*.lai
*.la
*.a
*.lib

# Executables
*.exe
*.out
*.app
Binary file added .vs/Shairport4w/v15/.suo
Binary file not shown.
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Shairport4w
An AirPlay Audio-Receiver for your Windows-PC

Play audio content from your iPhone, iPad, iPod or iTunes on your PC with Shairport4w.
AirPlay lets you wirelessly stream what's on your iOS device whenever you see the AirPlay symbol

Download pre compiled binaries from [`Releases`](https://github.com/Frank-Friemel/Shairport4w/releases)
When being asked by your Firewall you should grant access to your LAN if secure. Protect Shairport4w with a password
to be sure nobody is misusing this service

### Third party libraries
* [`WTL`](https://sourceforge.net/projects/wtl) Windows Template Library

### Thanks
* Thanks to James Laird who implemented the original version of "Shairport"

### License
GPL. Sources that deviate from this license are marked by a header

### Screen

![GUI](img/Sp4w.png)
![iOS](img/airplay.png)

31 changes: 31 additions & 0 deletions Shairport4w.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2036
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Shairport4w", "src\Shairport4w.vcxproj", "{08EF1AEC-E1A6-4836-A398-1281F0E0C242}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{08EF1AEC-E1A6-4836-A398-1281F0E0C242}.Debug|Win32.ActiveCfg = Debug|Win32
{08EF1AEC-E1A6-4836-A398-1281F0E0C242}.Debug|Win32.Build.0 = Debug|Win32
{08EF1AEC-E1A6-4836-A398-1281F0E0C242}.Debug|x64.ActiveCfg = Debug|x64
{08EF1AEC-E1A6-4836-A398-1281F0E0C242}.Debug|x64.Build.0 = Debug|x64
{08EF1AEC-E1A6-4836-A398-1281F0E0C242}.Release|Win32.ActiveCfg = Release|Win32
{08EF1AEC-E1A6-4836-A398-1281F0E0C242}.Release|Win32.Build.0 = Release|Win32
{08EF1AEC-E1A6-4836-A398-1281F0E0C242}.Release|x64.ActiveCfg = Release|x64
{08EF1AEC-E1A6-4836-A398-1281F0E0C242}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {CFC55654-29B1-4DD3-9CDD-4A2427941952}
EndGlobalSection
EndGlobal
Binary file added img/Sp4w.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/airplay.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
77 changes: 77 additions & 0 deletions src/AboutDlg.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/*
*
* AboutDlg.cpp
*
*/

#include "stdafx.h"
#include "resource.h"
#include "MyBitmapButton.h"

#include "aboutdlg.h"


typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL);

static bool _IsWow64()
{
LPFN_ISWOW64PROCESS fnIsWow64Process;

BOOL bIsWow64 = FALSE;

fnIsWow64Process = (LPFN_ISWOW64PROCESS)GetProcAddress(::GetModuleHandleA("kernel32"),"IsWow64Process");

if (NULL != fnIsWow64Process)
{
if (!fnIsWow64Process(GetCurrentProcess(), &bIsWow64))
{
bIsWow64 = FALSE;
}
}
return bIsWow64 ? true : false;
}

static BOOL BrowseForDirectory(HWND hWnd, LPCTSTR szTitle, LPTSTR szPath, UINT uiFlag /*=0*/)
{
BROWSEINFO bi;

memset(&bi, 0, sizeof(bi));

bi.hwndOwner = hWnd;
bi.pidlRoot = NULL;
bi.pszDisplayName = szPath;
bi.lpszTitle = szTitle;
bi.ulFlags = BIF_RETURNONLYFSDIRS | uiFlag;
bi.lpfn = NULL;
bi.lParam = NULL;

LPITEMIDLIST pidl = SHBrowseForFolder(&bi);

if (pidl)
return SHGetPathFromIDList(pidl, szPath);
return FALSE;
}


LRESULT CAboutDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
CenterWindow(GetParent());

// set icons
HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
SetIcon(hIcon, TRUE);
m_hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME),
IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
SetIcon(m_hIconSmall, FALSE);

DoDataExchange(FALSE);

return TRUE;
}

LRESULT CAboutDlg::OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
EndDialog(wID);
return 0;
}
32 changes: 32 additions & 0 deletions src/AboutDlg.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
*
* AboutDlg.h
*
*/

#pragma once

class CAboutDlg : public CDialogImpl<CAboutDlg>, public CWinDataExchange<CAboutDlg>
{
public:
enum { IDD = IDD_ABOUTBOX };

protected:
BEGIN_DDX_MAP(CAboutDlg)
DDX_TEXT(IDC_STATIC_VERSION, m_strVersion)
END_DDX_MAP()

BEGIN_MSG_MAP_EX(CAboutDlg)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
COMMAND_ID_HANDLER(IDOK, OnCloseCmd)
COMMAND_ID_HANDLER(IDCANCEL, OnCloseCmd)
END_MSG_MAP()

LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/);
LRESULT OnCloseCmd(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

ATL::CString m_strVersion;

private:
HICON m_hIconSmall;
};
Loading

0 comments on commit a897636

Please sign in to comment.