├── ohSongcast ├── Windows │ ├── Driver │ │ ├── dirs │ │ ├── msvad.aps │ │ ├── readme.htm │ │ ├── drmsimp │ │ │ ├── readme.htm │ │ │ ├── OpenHome │ │ │ │ ├── OsTypes.h │ │ │ │ ├── Exception.h │ │ │ │ ├── Standard.h │ │ │ │ ├── OhNetTypes.h │ │ │ │ ├── Arch.h │ │ │ │ ├── Fifo.cpp │ │ │ │ ├── Fifo.h │ │ │ │ ├── Buffer.inl │ │ │ │ ├── Buffer.h │ │ │ │ └── Stream.h │ │ │ ├── oh.cpp │ │ │ ├── sources │ │ │ ├── makefile │ │ │ ├── drmsimp.h │ │ │ ├── mintopo.h │ │ │ ├── prop.h │ │ │ └── network.h │ │ ├── install.cmd │ │ ├── update.cmd │ │ ├── pack32.cmd │ │ ├── pack64.cmd │ │ ├── msvad.rc │ │ ├── kshelper.h │ │ ├── sources.inc │ │ ├── gsrootr1.crt │ │ ├── basetopo.h │ │ ├── hw.h │ │ ├── msvad.h │ │ └── common.h │ ├── driverinstall.bat │ ├── driveruninstall.bat │ ├── Installer │ │ ├── Header.bmp │ │ ├── ohLogo.ico │ │ ├── WelcomeFinish.bmp │ │ ├── UnwelcomeFinish.bmp │ │ └── License.txt │ ├── Wpf │ │ ├── ohSongcast │ │ │ ├── Resources │ │ │ │ ├── Icon.ico │ │ │ │ └── ohLogo.svg │ │ │ ├── Properties │ │ │ │ ├── Settings.settings │ │ │ │ ├── Settings.Designer.cs │ │ │ │ ├── AssemblyInfo.cs │ │ │ │ └── Resources.Designer.cs │ │ │ ├── App.xaml │ │ │ ├── App.xaml.cs │ │ │ ├── ohSongcast.sln │ │ │ ├── ExtendedNotifyIcon.cs │ │ │ └── MediaPlayerWindow.xaml.cs │ │ └── ohSongshark │ │ │ ├── PcapDotNet │ │ │ ├── PcapDotNet.Base.dll │ │ │ ├── PcapDotNet.Core.dll │ │ │ ├── PcapDotNet.Analysis.dll │ │ │ ├── PcapDotNet.Packets.dll │ │ │ ├── PcapDotNet.Core.Extensions.dll │ │ │ └── PcapDotNet.Analysis.xml │ │ │ ├── app.config │ │ │ ├── Properties │ │ │ ├── Settings.settings │ │ │ ├── Settings.Designer.cs │ │ │ ├── AssemblyInfo.cs │ │ │ └── Resources.Designer.cs │ │ │ ├── App.xaml │ │ │ ├── App.xaml.cs │ │ │ ├── PluginTimings.cs │ │ │ ├── Plugin.cs │ │ │ ├── ohSongshark.sln │ │ │ ├── MainWindow.xaml │ │ │ └── PluginUdp.cs │ ├── builddriver.bat │ ├── buildinstall.bat │ ├── buildinstall32.bat │ ├── buildinstall64.bat │ ├── make.bat │ ├── pkgdriver32.bat │ ├── pkgdriver64.bat │ └── SoundcardDriver.h ├── Mac │ ├── Prefs │ │ ├── Icon.png │ │ ├── red.tiff │ │ ├── green.tiff │ │ ├── IconLarge.png │ │ ├── Info.plist │ │ ├── Makefile │ │ └── SongcastPrefPane.h │ ├── BundleIcon.icns │ ├── App │ │ ├── MenuIconOff.png │ │ ├── MenuIconOn.png │ │ ├── SenderIcon.png │ │ ├── main.m │ │ ├── Receiver.h │ │ ├── ReceiverList.h │ │ ├── SubnetList.h │ │ ├── AutoUpdate.h │ │ ├── SongcastAppDelegate.h │ │ ├── CrashLogging.h │ │ ├── WindowUpdates.h │ │ ├── ModelSongcast.h │ │ ├── Model.h │ │ ├── Info.plist │ │ ├── Makefile │ │ ├── Receiver.mm │ │ └── SubnetList.mm │ ├── Driver │ │ ├── OpenHome │ │ │ ├── Exception.h │ │ │ ├── OsTypes.h │ │ │ ├── Standard.h │ │ │ ├── OhNetTypes.h │ │ │ ├── Fifo.cpp │ │ │ └── Fifo.h │ │ ├── AudioDeviceInterface.h │ │ ├── AudioDevice.h │ │ ├── KextInfo.c │ │ ├── AudioClip.cpp │ │ ├── AudioDevice.cpp │ │ ├── AudioEngine.h │ │ ├── Info.plist │ │ ├── AudioUserClient.h │ │ └── Songcast.h │ ├── LaunchAgent.plist │ ├── PkgInfo.plist │ ├── Scripts │ │ ├── uninstall.tool │ │ ├── preflight │ │ └── postflight │ ├── Makefile │ └── Preferences.h ├── Posix │ └── SoundcardDriver.cpp └── TestSongcastCs.cs ├── make.bat ├── Wireshark ├── plugins │ ├── ohm │ │ ├── plugin.rc.in │ │ ├── moduleinfo.h │ │ ├── moduleinfo.nmake │ │ ├── Makefile.common │ │ ├── CMakeLists.txt │ │ └── Makefile.nmake │ ├── ohz │ │ ├── plugin.rc.in │ │ ├── moduleinfo.h │ │ ├── moduleinfo.nmake │ │ ├── Makefile.common │ │ ├── CMakeLists.txt │ │ └── Makefile.nmake │ └── Custom.nmake └── README.txt ├── Docs ├── Songcast Receiver Unicast State Transition Diagram.png ├── Songcast Sender Multicast State Transition Diagram.png ├── Songcast Multicast Sender State Transition Diagram.zargo ├── Songcast Receiver Multicast State Transition Diagram.png ├── Songcast Unicast Receiver State Transition Diagram.zargo └── Songcast Multicast Receiver State Transition Diagram.zargo ├── .gitignore ├── Debug.h ├── License.txt ├── OhmSenderDriver.h ├── BsdLicense.txt ├── README ├── OhmSocket.h ├── Windows.mak ├── OhmSocket.cpp └── Makefile /ohSongcast/Windows/Driver/dirs: -------------------------------------------------------------------------------- 1 | DIRS= drmsimp -------------------------------------------------------------------------------- /make.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | nmake /f Windows.mak %* 3 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Prefs/Icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Mac/Prefs/Icon.png -------------------------------------------------------------------------------- /ohSongcast/Mac/Prefs/red.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Mac/Prefs/red.tiff -------------------------------------------------------------------------------- /ohSongcast/Mac/BundleIcon.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Mac/BundleIcon.icns -------------------------------------------------------------------------------- /ohSongcast/Mac/Prefs/green.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Mac/Prefs/green.tiff -------------------------------------------------------------------------------- /Wireshark/plugins/ohm/plugin.rc.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/Wireshark/plugins/ohm/plugin.rc.in -------------------------------------------------------------------------------- /Wireshark/plugins/ohz/plugin.rc.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/Wireshark/plugins/ohz/plugin.rc.in -------------------------------------------------------------------------------- /ohSongcast/Mac/App/MenuIconOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Mac/App/MenuIconOff.png -------------------------------------------------------------------------------- /ohSongcast/Mac/App/MenuIconOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Mac/App/MenuIconOn.png -------------------------------------------------------------------------------- /ohSongcast/Mac/App/SenderIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Mac/App/SenderIcon.png -------------------------------------------------------------------------------- /ohSongcast/Mac/Prefs/IconLarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Mac/Prefs/IconLarge.png -------------------------------------------------------------------------------- /ohSongcast/Windows/driverinstall.bat: -------------------------------------------------------------------------------- 1 | Build\Driver64\Install64.exe -i av.openhome.org Build\Driver64\ohSongcast.inf 2 | -------------------------------------------------------------------------------- /ohSongcast/Windows/driveruninstall.bat: -------------------------------------------------------------------------------- 1 | Build\Driver64\Install64.exe -d av.openhome.org Build\Driver64\ohSongcast.inf 2 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/msvad.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Driver/msvad.aps -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/readme.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Driver/readme.htm -------------------------------------------------------------------------------- /ohSongcast/Windows/Installer/Header.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Installer/Header.bmp -------------------------------------------------------------------------------- /ohSongcast/Windows/Installer/ohLogo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Installer/ohLogo.ico -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/readme.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Driver/drmsimp/readme.htm -------------------------------------------------------------------------------- /ohSongcast/Windows/Installer/WelcomeFinish.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Installer/WelcomeFinish.bmp -------------------------------------------------------------------------------- /ohSongcast/Windows/Installer/UnwelcomeFinish.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Installer/UnwelcomeFinish.bmp -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/Resources/Icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Wpf/ohSongcast/Resources/Icon.ico -------------------------------------------------------------------------------- /Docs/Songcast Receiver Unicast State Transition Diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/Docs/Songcast Receiver Unicast State Transition Diagram.png -------------------------------------------------------------------------------- /Docs/Songcast Sender Multicast State Transition Diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/Docs/Songcast Sender Multicast State Transition Diagram.png -------------------------------------------------------------------------------- /Docs/Songcast Multicast Sender State Transition Diagram.zargo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/Docs/Songcast Multicast Sender State Transition Diagram.zargo -------------------------------------------------------------------------------- /Docs/Songcast Receiver Multicast State Transition Diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/Docs/Songcast Receiver Multicast State Transition Diagram.png -------------------------------------------------------------------------------- /Docs/Songcast Unicast Receiver State Transition Diagram.zargo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/Docs/Songcast Unicast Receiver State Transition Diagram.zargo -------------------------------------------------------------------------------- /Docs/Songcast Multicast Receiver State Transition Diagram.zargo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/Docs/Songcast Multicast Receiver State Transition Diagram.zargo -------------------------------------------------------------------------------- /ohSongcast/Mac/App/main.m: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | return NSApplicationMain(argc, (const char **) argv); 8 | } 9 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Base.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Base.dll -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Core.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Core.dll -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Analysis.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Analysis.dll -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Packets.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Packets.dll -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/install.cmd: -------------------------------------------------------------------------------- 1 | %basedir%\tools\devcon\amd64\devcon.exe install C:\msysgit\msysgit\work\ohSongcast\ohSongcast\Windows\Build\Driver64\ohSongcast.inf av.openhome.org/Songcast 2 | 3 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/OpenHome/OsTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OS_TYPES 2 | #define HEADER_OS_TYPES 3 | 4 | typedef void* THandle; 5 | typedef unsigned TIpAddress; 6 | 7 | #endif // HEADER_OS_TYPES 8 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/update.cmd: -------------------------------------------------------------------------------- 1 | %basedir%\tools\devcon\amd64\devcon.exe update C:\msysgit\msysgit\work\ohSongcast\Build\Driver64\ohSoundcard.inf {D6BAC7AB-8758-43A9-917F-D702501F4DB0}\ohSoundcard 2 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Core.Extensions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openhome/ohSongcast/HEAD/ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Core.Extensions.dll -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/OpenHome/Exception.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_EXCEPTION 2 | #define HEADER_EXCEPTION 3 | 4 | # define THROW(aClass) ASSERTS() 5 | 6 | # define EXCEPTION(aClass) 7 | 8 | #endif //HEADER_EXCEPTION 9 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/oh.cpp: -------------------------------------------------------------------------------- 1 | #include "OpenHome\Ohm.cpp" 2 | #include "OpenHome\OhmMsg.cpp" 3 | #include "OpenHome\Buffer.cpp" 4 | #include "OpenHome\Stream.cpp" 5 | #include "OpenHome\Fifo.cpp" 6 | 7 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/OpenHome/Exception.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_EXCEPTION 2 | #define HEADER_EXCEPTION 3 | 4 | #define THROW(aClass) OHASSERTS() 5 | 6 | #define EXCEPTION(aClass) 7 | 8 | #endif //HEADER_EXCEPTION 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pdb 2 | *~ 3 | .*.swp 4 | *.ReSharper.user 5 | *.suo 6 | _ReSharper.* 7 | *.log 8 | /*.sbr 9 | /Build/ 10 | /vgout/ 11 | /hgout/ 12 | /xout/ 13 | bin/ 14 | obj/ 15 | .binaries/ 16 | .obj/ 17 | pkg32/ 18 | pkg64/ 19 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/OpenHome/OsTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OS_TYPES 2 | #define HEADER_OS_TYPES 3 | 4 | #include 5 | 6 | typedef void* THandle; 7 | typedef uint32_t TIpAddress; 8 | 9 | #endif // HEADER_OS_TYPES 10 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /Debug.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_SONGCAST_DEBUG 2 | #define HEADER_SONGCAST_DEBUG 3 | 4 | #include 5 | 6 | namespace OpenHome { 7 | 8 | #define kTopology kApplication0 9 | #define kMedia kApplication1 10 | 11 | } // namespace OpenHome 12 | 13 | #endif // HEADER_SONGCAST_DEBUG 14 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/sources: -------------------------------------------------------------------------------- 1 | 2 | # Copyright (c) 1995-2000 Microsoft Corporation. All rights reserved. 3 | 4 | !include ..\sources.inc 5 | 6 | TARGETNAME=vaddrms 7 | 8 | SOURCES=\ 9 | $(SOURCES) \ 10 | mintopo.cpp \ 11 | minwave.cpp \ 12 | network.cpp \ 13 | oh.cpp 14 | 15 | -------------------------------------------------------------------------------- /Wireshark/plugins/ohm/moduleinfo.h: -------------------------------------------------------------------------------- 1 | /* Included *after* config.h, in order to re-define these macros */ 2 | 3 | #ifdef PACKAGE 4 | #undef PACKAGE 5 | #endif 6 | 7 | /* Name of package */ 8 | #define PACKAGE "ohm" 9 | 10 | 11 | #ifdef VERSION 12 | #undef VERSION 13 | #endif 14 | 15 | /* Version number of package */ 16 | #define VERSION "0.0.2" 17 | 18 | -------------------------------------------------------------------------------- /Wireshark/plugins/ohz/moduleinfo.h: -------------------------------------------------------------------------------- 1 | /* Included *after* config.h, in order to re-define these macros */ 2 | 3 | #ifdef PACKAGE 4 | #undef PACKAGE 5 | #endif 6 | 7 | /* Name of package */ 8 | #define PACKAGE "ohz" 9 | 10 | 11 | #ifdef VERSION 12 | #undef VERSION 13 | #endif 14 | 15 | /* Version number of package */ 16 | #define VERSION "0.0.1" 17 | 18 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/pack32.cmd: -------------------------------------------------------------------------------- 1 | copy ohSoundcard.inf pkg32\ohSoundcard.inf 2 | copy drmsimp\objchk_win7_x86\i386\vaddrms.sys pkg32\ohSoundcard.sys 3 | inf2cat.exe /driver:pkg32 /os:Vista_X86,7_X86 /v 4 | Signtool sign /a /sm /t http://timestamp.verisign.com/scripts/timestamp.dll pkg32\ohSoundcard.cat 5 | Signtool verify /pa /v /c pkg32\ohSoundcard.cat pkg32\ohSoundcard.sys 6 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/App.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Data; 5 | using System.Linq; 6 | using System.Windows; 7 | 8 | namespace ohSongshark 9 | { 10 | /// 11 | /// Interaction logic for App.xaml 12 | /// 13 | public partial class App : Application 14 | { 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | Copyright 2011-14, Linn Products Ltd. All rights reserved. 2 | 3 | Unless otherwise stated, all code in this project is licensed under the 2-clause 4 | (Simplified) BSD license. See BsdLicense.txt for details. 5 | 6 | Files at the following locations are licensed under separate terms: 7 | 8 | 1. ohSongcast/Windows/Driver 9 | Microsoft Limited Public License - http://msdn.microsoft.com/en-us/cc300389.aspx#P 10 | -------------------------------------------------------------------------------- /ohSongcast/Windows/builddriver.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | echo. 3 | echo Making 32 bit driver 4 | echo ==================== 5 | echo. 6 | call cmd.exe /k "setenv.bat \WinDDK\7600.16385.1 chk x86 WIN7 && cd Driver && build && cd .. && pkgdriver32 && exit" 7 | echo. 8 | echo Making 64 bit driver 9 | echo ==================== 10 | echo. 11 | call cmd.exe /k "setenv.bat \WinDDK\7600.16385.1 chk x64 WIN7 && cd Driver && build && cd .. && pkgdriver64 && exit" 12 | -------------------------------------------------------------------------------- /ohSongcast/Windows/buildinstall.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | md Build >nul 2>nul 3 | md Build\Driver32 >nul 2>nul 4 | md Build\Driver64 >nul 2>nul 5 | md Build\Obj >nul 2>nul 6 | echo. 7 | echo Making Install32.exe 8 | echo ==================== 9 | echo. 10 | call cmd.exe /k ""%VCINSTALLDIR%\bin\vcvars32.bat" && buildinstall32 && exit" 11 | echo. 12 | echo Making Install64.exe 13 | echo ===================== 14 | echo. 15 | call cmd.exe /k ""%VCINSTALLDIR%\bin\amd64\vcvars64.bat" && buildinstall64 && exit" 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/PluginTimings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using PcapDotNet.Core; 7 | 8 | namespace ohSongshark 9 | { 10 | class PluginTimings : Plugin 11 | { 12 | public PluginTimings() 13 | : base("Timings") 14 | { 15 | } 16 | 17 | public override void Run(PacketDevice aDevice) 18 | { 19 | throw new NotImplementedException(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ohSongcast/Mac/LaunchAgent.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | RunAtLoad 6 | 7 | KeepAlive 8 | 9 | NetworkState 10 | 11 | 12 | Label 13 | org.openhome.av.songcast 14 | Program 15 | /Library/OpenHome/ohSongcast.app/Contents/MacOS/ohSongcast 16 | 17 | 18 | -------------------------------------------------------------------------------- /ohSongcast/Mac/PkgInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleIdentifier 6 | org.openhome.av.songcast 7 | IFPkgFlagDefaultLocation 8 | / 9 | IFPkgFlagRelocatable 10 | 11 | IFPkgFlagRestartAction 12 | RequiredRestart 13 | IFPkgFlagAllowBackRev 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/OpenHome/Standard.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_STANDARD 2 | #define HEADER_STANDARD 3 | 4 | #include 5 | #include 6 | 7 | namespace OpenHome { 8 | 9 | #define OHASSERT(x) if(!(x)) OHASSERTS() 10 | 11 | #define OHASSERTS() *((TUint32*)0) = 0 12 | 13 | class INonCopyable 14 | { 15 | protected: 16 | INonCopyable() {} 17 | private: 18 | INonCopyable(const INonCopyable &); 19 | void operator=(const INonCopyable &); 20 | }; 21 | 22 | } // namespace OpenHome 23 | 24 | #endif // HEADER_STANDARD 25 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/OpenHome/Standard.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_STANDARD 2 | #define HEADER_STANDARD 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | namespace OpenHome { 10 | 11 | #define ASSERT(expr) assert(expr); 12 | #define ASSERTS() ASSERT(false); 13 | 14 | class INonCopyable 15 | { 16 | protected: 17 | INonCopyable() {} 18 | private: 19 | INonCopyable(const INonCopyable &); 20 | void operator=(const INonCopyable &); 21 | }; 22 | 23 | } // namespace OpenHome 24 | 25 | #endif // HEADER_STANDARD 26 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/pack64.cmd: -------------------------------------------------------------------------------- 1 | copy ohSoundcard.inf pkg64\ohSoundcard.inf 2 | copy drmsimp\objchk_win7_amd64\amd64\vaddrms.sys pkg64\ohSoundcard.sys 3 | Signtool sign /v /a /sm /ac gsrootr1.crt /t http://timestamp.verisign.com/scripts/timestamp.dll pkg64\ohSoundcard.sys 4 | inf2cat.exe /driver:pkg64 /os:Vista_X64,7_X64 /v 5 | Signtool sign /v /a /sm /ac gsrootr1.crt /t http://timestamp.verisign.com/scripts/timestamp.dll pkg64\ohSoundcard.cat 6 | Signtool verify /pa /v /c pkg64\ohSoundcard.cat pkg64\ohSoundcard.sys 7 | Signtool verify /kp /v /c pkg64\ohSoundcard.cat pkg64\ohSoundcard.sys 8 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/App.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Configuration; 4 | using System.Windows; 5 | 6 | namespace OpenHome.Songcast 7 | { 8 | /// 9 | /// Interaction logic for App.xaml 10 | /// 11 | public partial class App : Application 12 | { 13 | protected override void OnDeactivated(EventArgs e) 14 | { 15 | base.OnDeactivated(e); 16 | 17 | MainWindow main = MainWindow as MainWindow; 18 | 19 | main.ApplicationDeactivated(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /ohSongcast/Windows/buildinstall32.bat: -------------------------------------------------------------------------------- 1 | cl /nologo /FoBuild/Obj/Install32.obj -c /W4 /WX /EHsc /Gd -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -D_CRT_SECURE_NO_WARNINGS -DDllExport=__declspec(dllexport) -DDllExportClass= Install.cpp -I..\..\..\ohNet\Build\Include -I..\..\..\ohNet\Build\Include\Cpp 2 | link /SUBSYSTEM:windows /ENTRY:mainCRTStartup /nologo /map Iphlpapi.lib /incremental:no /out:Build\Obj\Install32.exe Build\Obj\Install32.obj setupapi.lib 3 | copy Build\Obj\Install32.exe Build\Driver32\Install32.exe 4 | signtool sign /v /a /t http://timestamp.verisign.com/scripts/timestamp.dll Build\Driver32\Install32.exe 5 | copy Build\Obj\Install32.exe Build\Install32.exe 6 | -------------------------------------------------------------------------------- /ohSongcast/Windows/buildinstall64.bat: -------------------------------------------------------------------------------- 1 | cl /nologo /FoBuild/Obj/Install64.obj -c /W4 /WX /EHsc /Gd -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -D_CRT_SECURE_NO_WARNINGS -DDllExport=__declspec(dllexport) -DDllExportClass= Install.cpp -I..\..\..\ohNet\Build\Include -I..\..\..\ohNet\Build\Include\Cpp 2 | link /SUBSYSTEM:windows /ENTRY:mainCRTStartup /nologo /map Iphlpapi.lib /incremental:no /out:Build\Obj\Install64.exe Build\Obj\Install64.obj setupapi.lib 3 | copy Build\Obj\Install64.exe Build\Driver64\Install64.exe 4 | signtool sign /v /a /t http://timestamp.verisign.com/scripts/timestamp.dll Build\Driver64\Install64.exe 5 | copy Build\Obj\Install64.exe Build\Install64.exe 6 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/msvad.rc: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) 1997-2000 Microsoft Corporation All Rights Reserved 4 | 5 | Module Name: 6 | 7 | msvad.rc 8 | 9 | Abstract: 10 | 11 | 12 | --*/ 13 | 14 | #include 15 | 16 | #include 17 | 18 | #define VER_FILETYPE VFT_DRV 19 | #define VER_FILESUBTYPE VFT2_DRV_SOUND 20 | #define VER_FILEDESCRIPTION_STR "Songcast" 21 | #define VER_INTERNALNAME_STR "ohSongcast.sys" 22 | #define VER_ORIGINALFILENAME_STR "ohSongcast.sys" 23 | 24 | #define VER_LEGALCOPYRIGHT_YEARS "" 25 | #define VER_LEGALCOPYRIGHT_STR "" 26 | 27 | #include "common.ver" 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/AudioDeviceInterface.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_AUDIODEVICEINTERFACE 2 | #define HEADER_AUDIODEVICEINTERFACE 3 | 4 | 5 | enum EDriverMethod 6 | { 7 | eOpen, // () 8 | eClose, // () 9 | eSetActive, // (uint64_t aActive) 10 | eSetEndpoint, // (uint64_t aIpAddress, uint64_t aPort, uint64_t aAdapter) 11 | eSetTtl, // (uint64_t aTtl) 12 | eSetLatencyMs, // (uint64_t aLatencyMs) 13 | eResend, // (uint64_t aCount, byte[ResendMaxBytes] aFrames) 14 | eNumDriverMethods 15 | }; 16 | 17 | 18 | const uint64_t ResendMaxBytes = 1024; 19 | 20 | 21 | 22 | #endif // HEADER_AUDIODEVICEINTERFACE 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /ohSongcast/Windows/make.bat: -------------------------------------------------------------------------------- 1 | rd Build /s/q 2 | rd Driver\drmsimp\objchk_win7_x86 /s/q 3 | rd Driver\drmsimp\objchk_win7_amd64 /s/q 4 | md Build 5 | md Build\Driver32 6 | md Build\Driver64 7 | md Build\Obj 8 | call builddriver.bat 9 | call buildinstall.bat 10 | copy ..\..\Build\Obj\Windows\Release\ohSongcast.dll Build\ohSongcast.dll 11 | copy ..\..\Build\Obj\Windows\Release\ohSongcast.net.dll Build\ohSongcast.net.dll 12 | copy Driver\ohSongcast.inf Build\ohSongcast.inf 13 | msbuild Wpf\ohSongcast\ohSongcast.sln /target:ohSongcast /p:Configuration=Release 14 | "%ProgramFiles(x86)%\NSIS\makensis.exe" Installer\Installer.nsi 15 | Signtool sign /v /a /t http://timestamp.verisign.com/scripts/timestamp.dll Build\ohSongcastInstaller.exe 16 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/AudioDevice.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_AUDIODEVICE 2 | #define HEADER_AUDIODEVICE 3 | 4 | #include 5 | #include "AudioEngine.h" 6 | 7 | class Songcast; 8 | 9 | 10 | // Implementation of the main class for the audio driver. 11 | 12 | #define AudioDevice BRANDING_AUDIODEVICE_CLASSNAME 13 | 14 | class AudioDevice : public IOAudioDevice 15 | { 16 | OSDeclareDefaultStructors(AudioDevice); 17 | 18 | public: 19 | Songcast& GetSongcast() { return *iSongcast; } 20 | 21 | private: 22 | virtual bool initHardware(IOService* aProvider); 23 | virtual void free(); 24 | 25 | Songcast* iSongcast; 26 | AudioEngine* iEngine; 27 | }; 28 | 29 | 30 | #endif // HEADER_AUDIODEVICE 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/OpenHome/OhNetTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_TYPES 2 | #define HEADER_TYPES 3 | 4 | #include 5 | 6 | #define DllExport 7 | #define DllExportClass 8 | #define STDCALL __stdcall 9 | 10 | typedef char TChar; 11 | typedef bool TBool; 12 | typedef void TAny; 13 | 14 | typedef int8_t TInt8; 15 | typedef int16_t TInt16; 16 | typedef int32_t TInt32; 17 | typedef int64_t TInt64; 18 | 19 | typedef uint8_t TByte; 20 | typedef uint8_t TUint8; 21 | typedef uint16_t TUint16; 22 | typedef uint32_t TUint32; 23 | typedef uint64_t TUint64; 24 | 25 | typedef uint32_t TKey; 26 | typedef uint32_t TUint; 27 | typedef int32_t TInt; 28 | typedef int32_t TStatus; 29 | 30 | typedef void* THandle; 31 | 32 | typedef uint32_t TIpAddress; 33 | 34 | #endif //HEADER_TYPES 35 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/Receiver.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | #import "Preferences.h" 4 | 5 | 6 | // Declaration of a class to hold receiver data 7 | @interface Receiver : NSObject 8 | { 9 | NSString* udn; 10 | NSString* room; 11 | NSString* group; 12 | NSString* name; 13 | void* iPtr; 14 | NSObject* iLock; 15 | } 16 | 17 | @property (copy) NSString* udn; 18 | @property (copy) NSString* room; 19 | @property (copy) NSString* group; 20 | @property (copy) NSString* name; 21 | 22 | - (id) initWithPtr:(void*)aPtr; 23 | - (id) initWithPref:(PrefReceiver*)aPref; 24 | - (void) updateWithPtr:(void*)aPtr; 25 | - (PrefReceiver*) convertToPref; 26 | - (EReceiverState) status; 27 | - (void) play; 28 | - (void) stop; 29 | - (void) standby; 30 | 31 | @end 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /ohSongcast/Windows/pkgdriver32.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | copy Driver\ohSongcast.inf Build\Driver32\ohSongcast.inf >nul 3 | copy Driver\drmsimp\objchk_win7_x86\i386\vaddrms.sys Build\ohSongcast32.sys >nul 4 | copy Driver\drmsimp\objchk_win7_x86\i386\vaddrms.pdb Build\ohSongcast32.pdb >nul 5 | copy Driver\drmsimp\objchk_win7_x86\i386\vaddrms.sys Build\Driver32\ohSongcast.sys >nul 6 | Signtool sign /v /a /ac Driver\gsrootr1.crt /t http://timestamp.verisign.com/scripts/timestamp.dll Build\Driver32\ohSongcast.sys >nul 7 | inf2cat.exe /driver:Build\Driver32 /os:Vista_X86,7_X86 /v >nul 8 | Signtool sign /v /a /ac Driver\gsrootr1.crt /t http://timestamp.verisign.com/scripts/timestamp.dll Build\Driver32\ohSongcast.cat >nul 9 | Signtool verify /pa /c Build\Driver32\ohSongcast.cat Build\Driver32\ohSongcast.sys 10 | -------------------------------------------------------------------------------- /ohSongcast/Windows/pkgdriver64.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | copy Driver\ohSongcast.inf Build\Driver64\ohSongcast.inf >nul 3 | copy Driver\drmsimp\objchk_win7_amd64\amd64\vaddrms.sys Build\ohSongcast64.sys >nul 4 | copy Driver\drmsimp\objchk_win7_amd64\amd64\vaddrms.pdb Build\ohSongcast64.pdb >nul 5 | copy Driver\drmsimp\objchk_win7_amd64\amd64\vaddrms.sys Build\Driver64\ohSongcast.sys >nul 6 | Signtool sign /v /a /ac Driver\gsrootr1.crt /t http://timestamp.verisign.com/scripts/timestamp.dll Build\Driver64\ohSongcast.sys >nul 7 | inf2cat.exe /driver:Build\Driver64 /os:Vista_X64,7_X64 /v >nul 8 | Signtool sign /v /a /ac Driver\gsrootr1.crt /t http://timestamp.verisign.com/scripts/timestamp.dll Build\Driver64\ohSongcast.cat >nul 9 | Signtool verify /pa /c Build\Driver64\ohSongcast.cat Build\Driver64\ohSongcast.sys 10 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/OpenHome/OhNetTypes.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_TYPES 2 | #define HEADER_TYPES 3 | 4 | #include 5 | 6 | #define DllExport 7 | #define DllExportClass 8 | #define STDCALL __stdcall 9 | 10 | typedef char TChar; 11 | typedef bool TBool; 12 | typedef void TAny; 13 | 14 | typedef signed char TInt8; 15 | typedef short TInt16; 16 | typedef long TInt32; 17 | typedef long long TInt64; 18 | 19 | typedef unsigned char TByte; 20 | typedef unsigned char TUint8; 21 | typedef unsigned short TUint16; 22 | typedef unsigned long TUint32; 23 | typedef unsigned long long TUint64; 24 | 25 | typedef unsigned long TKey; 26 | typedef unsigned long TUint; 27 | typedef long TInt; 28 | typedef long TStatus; 29 | 30 | typedef void* THandle; 31 | 32 | typedef unsigned TIpAddress; 33 | 34 | #endif //HEADER_TYPES 35 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/KextInfo.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | // additional layer of macro to ensure that BRANDING_KEXTINFO_KMODNAME gets expanded - this is because the 5 | // KMOD_EXPLICIT_DECL macro uses the stringify operator (#) for the first argument 6 | #define KMOD_DECL_LAYER(KMODNAME, KMODVER, KMODSTART, KMODSTOP) KMOD_EXPLICIT_DECL(KMODNAME, KMODVER, KMODSTART, KMODSTOP) 7 | 8 | extern kern_return_t _start(kmod_info_t *ki, void *data); 9 | extern kern_return_t _stop(kmod_info_t *ki, void *data); 10 | 11 | __attribute__((visibility("default"))) KMOD_DECL_LAYER(BRANDING_KEXTINFO_KMODNAME, BRANDING_KEXTINFO_KMODVERSION, _start, _stop) 12 | 13 | __private_extern__ kmod_start_func_t *_realmain = 0; 14 | __private_extern__ kmod_stop_func_t *_antimain = 0; 15 | __private_extern__ int _kext_apple_cc = __APPLE_CC__ ; 16 | 17 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/ReceiverList.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | #import "Receiver.h" 4 | 5 | 6 | // Declaration of protocol for receiver list changes 7 | @protocol IReceiverListObserver 8 | 9 | - (void) receiverAdded:(Receiver*)aReceiver; 10 | - (void) receiverRemoved:(Receiver*)aReceiver; 11 | - (void) receiverChanged:(Receiver*)aReceiver; 12 | 13 | @end 14 | 15 | 16 | 17 | // Declaration of the receiver list class 18 | @interface ReceiverList : NSObject 19 | { 20 | NSObject* iLock; 21 | NSMutableArray* iList; 22 | NSObject* iObserver; 23 | } 24 | 25 | - (id) initWithReceivers:(NSArray*)aReceivers; 26 | - (NSArray*) receivers; 27 | - (void) setObserver:(NSObject*)aObserver; 28 | - (void) removeUnavailableUnselected:(NSArray*)aSelected; 29 | 30 | @end 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /OhmSenderDriver.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OHM_SENDER_DRIVER 2 | #define HEADER_OHM_SENDER_DRIVER 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace OpenHome { 9 | namespace Av { 10 | 11 | class IOhmSenderDriver 12 | { 13 | public: 14 | virtual void SetEnabled(TBool aValue) = 0; 15 | virtual void SetEndpoint(const Endpoint& aEndpoint, TIpAddress aAdapter) = 0; 16 | virtual void SetActive(TBool aValue) = 0; 17 | virtual void SetTtl(TUint aValue) = 0; 18 | virtual void SetLatency(TUint aValue) = 0; 19 | virtual void SetTrackPosition(TUint64 aSampleStart, TUint64 aSamplesTotal) = 0; 20 | virtual void Resend(const Brx& aFrames) = 0; 21 | virtual ~IOhmSenderDriver() {} 22 | }; 23 | 24 | } // namespace Av 25 | } // namespace OpenHome 26 | 27 | #endif // HEADER_OHM_SENDER_DRIVER 28 | 29 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/Plugin.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using PcapDotNet.Core; 7 | 8 | namespace ohSongshark 9 | { 10 | public interface IPlugin 11 | { 12 | string Name { get; } 13 | void Run(PacketDevice aDevice); 14 | } 15 | 16 | public abstract class Plugin : IPlugin 17 | { 18 | private string iName; 19 | 20 | protected Plugin(string aName) 21 | { 22 | iName = aName; 23 | } 24 | 25 | public string Name 26 | { 27 | get 28 | { 29 | return (iName); 30 | } 31 | } 32 | 33 | public abstract void Run(PacketDevice aDevice); 34 | 35 | public override string ToString() 36 | { 37 | return (iName); 38 | } 39 | 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Wireshark/README.txt: -------------------------------------------------------------------------------- 1 | Songcast Wireshark Plugins 2 | -------------------------- 3 | 4 | The plugins have been compiled and tested against Wireshark 5 | version 1.8.4. They may or may not work with older versions. 6 | 7 | The code needs to be built inside the Wireshark source tree. 8 | 9 | * Download the Wireshark source code from: 10 | http://www.wireshark.org/download.html 11 | 12 | * Unpack the source code archive. 13 | 14 | * Copy the contents of the 'ohSongacst/Wireshark/plugins' folder 15 | into the 'plugins' folder of the Wireshark source tree. 16 | 17 | * Build Wireshark as explained in the Developers Guide: 18 | http://www.wireshark.org/docs/wsdg_html_chunked/ 19 | 20 | * The plugin DLLs 'ohz.dll' and 'ohm.dll' can be added to an 21 | existing Wireshark installation by copying them in its plugin 22 | folder, which will be something like this: 23 | C:\Program Files\Wireshark\plugins\1.8.4\ 24 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/ohSongshark.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Visual Studio 2010 4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ohSongshark", "ohSongshark.csproj", "{D0F8668C-1F82-4C18-A65D-A2C1DFC927AE}" 5 | EndProject 6 | Global 7 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 8 | Debug|x86 = Debug|x86 9 | Release|x86 = Release|x86 10 | EndGlobalSection 11 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 12 | {D0F8668C-1F82-4C18-A65D-A2C1DFC927AE}.Debug|x86.ActiveCfg = Debug|x86 13 | {D0F8668C-1F82-4C18-A65D-A2C1DFC927AE}.Debug|x86.Build.0 = Debug|x86 14 | {D0F8668C-1F82-4C18-A65D-A2C1DFC927AE}.Release|x86.ActiveCfg = Release|x86 15 | {D0F8668C-1F82-4C18-A65D-A2C1DFC927AE}.Release|x86.Build.0 = Release|x86 16 | EndGlobalSection 17 | GlobalSection(SolutionProperties) = preSolution 18 | HideSolutionNode = FALSE 19 | EndGlobalSection 20 | EndGlobal 21 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/kshelper.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) 1997-2000 Microsoft Corporation All Rights Reserved 4 | 5 | Module Name: 6 | 7 | kshelper.h 8 | 9 | Abstract: 10 | 11 | Helper functions for msvad 12 | 13 | --*/ 14 | #ifndef _MSVAD_KSHELPER_H_ 15 | #define _MSVAD_KSHELPER_H_ 16 | 17 | #include 18 | #include 19 | 20 | PWAVEFORMATEX GetWaveFormatEx 21 | ( 22 | IN PKSDATAFORMAT pDataFormat 23 | ); 24 | 25 | NTSTATUS PropertyHandler_BasicSupport 26 | ( 27 | IN PPCPROPERTY_REQUEST PropertyRequest, 28 | IN ULONG Flags, 29 | IN DWORD PropTypeSetId 30 | ); 31 | 32 | NTSTATUS ValidatePropertyParams 33 | ( 34 | IN PPCPROPERTY_REQUEST PropertyRequest, 35 | IN ULONG cbValueSize, 36 | IN ULONG cbInstanceSize = 0 37 | ); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/OpenHome/Arch.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_ARCH 2 | #define HEADER_ARCH 3 | 4 | #include 5 | 6 | namespace OpenHome { 7 | 8 | #define SwapEndian16(x) (((x)>>8) | ((x)<<8)) 9 | 10 | #define SwapEndian32(x) ((((x)&0xFFul)<<24) | (((x)&0xFF00ul)<<8) | (((x)&0xFF0000ul)>>8) | (((x)&0xFF000000ul)>>24)) 11 | 12 | class Arch 13 | { 14 | public: 15 | inline static TUint16 BigEndian2(TUint16 x) {return (TUint16)(SwapEndian16(x));} 16 | inline static TUint32 BigEndian4(TUint32 x) {return (TUint32)(SwapEndian32(x));} 17 | inline static TUint64 BigEndian8(TUint64 x) { return (TUint64(BigEndian4(TUint32(x))) << 32) | BigEndian4(TUint32(x>>32)); } 18 | inline static TUint16 LittleEndian2(TUint16 x) {return x;} 19 | inline static TUint32 LittleEndian4(TUint32 x) {return x;} 20 | inline static TUint64 LittleEndian8(TUint64 x) {return x;} 21 | }; 22 | 23 | } // namespace OpenHome 24 | 25 | #endif // HEADER_ARCH 26 | 27 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/SubnetList.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | #import "Preferences.h" 4 | 5 | 6 | // Declaration of the subnet list class 7 | @interface Subnet : NSObject 8 | { 9 | void* iPtr; 10 | } 11 | 12 | - (id) initWithPtr:(void*)aPtr; 13 | - (void) dispose; 14 | - (PrefSubnet*) convertToPref; 15 | - (uint32_t) address; 16 | - (NSString*) name; 17 | 18 | @end 19 | 20 | 21 | // Declaration of protocol for subnet list changes 22 | @protocol ISubnetListObserver 23 | 24 | - (void) subnetAdded:(Subnet*)aSubnet; 25 | - (void) subnetRemoved:(Subnet*)aSubnet; 26 | - (void) subnetChanged:(Subnet*)aSubnet; 27 | 28 | @end 29 | 30 | 31 | // Declaration of the subnet list class 32 | @interface SubnetList : NSObject 33 | { 34 | NSObject* iLock; 35 | NSMutableArray* iList; 36 | NSObject* iObserver; 37 | } 38 | 39 | - (NSArray*) subnets; 40 | - (void) setObserver:(NSObject*)aObserver; 41 | 42 | @end 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /Wireshark/plugins/ohm/moduleinfo.nmake: -------------------------------------------------------------------------------- 1 | # 2 | # $Id: moduleinfo.nmake 20161 2006-12-19 22:24:40Z jake $ 3 | # 4 | 5 | # The name 6 | PACKAGE=ohm 7 | 8 | # The version 9 | MODULE_VERSION_MAJOR=0 10 | MODULE_VERSION_MINOR=0 11 | MODULE_VERSION_MICRO=2 12 | MODULE_VERSION_EXTRA=0 13 | 14 | # 15 | # The RC_VERSION should be comma-separated, not dot-separated, 16 | # as per Graham Bloice's message in 17 | # 18 | # http://www.ethereal.com/lists/ethereal-dev/200303/msg00283.html 19 | # 20 | # "The RC_VERSION variable in config.nmake should be comma separated. 21 | # This allows the resources to be built correctly and the version 22 | # number to be correctly displayed in the explorer properties dialog 23 | # for the executables, and XP's tooltip, rather than 0.0.0.0." 24 | # 25 | 26 | MODULE_VERSION=$(MODULE_VERSION_MAJOR).$(MODULE_VERSION_MINOR).$(MODULE_VERSION_MICRO).$(MODULE_VERSION_EXTRA) 27 | RC_MODULE_VERSION=$(MODULE_VERSION_MAJOR),$(MODULE_VERSION_MINOR),$(MODULE_VERSION_MICRO),$(MODULE_VERSION_EXTRA) 28 | 29 | -------------------------------------------------------------------------------- /Wireshark/plugins/ohz/moduleinfo.nmake: -------------------------------------------------------------------------------- 1 | # 2 | # $Id: moduleinfo.nmake 20161 2006-12-19 22:24:40Z jake $ 3 | # 4 | 5 | # The name 6 | PACKAGE=ohz 7 | 8 | # The version 9 | MODULE_VERSION_MAJOR=0 10 | MODULE_VERSION_MINOR=0 11 | MODULE_VERSION_MICRO=1 12 | MODULE_VERSION_EXTRA=0 13 | 14 | # 15 | # The RC_VERSION should be comma-separated, not dot-separated, 16 | # as per Graham Bloice's message in 17 | # 18 | # http://www.ethereal.com/lists/ethereal-dev/200303/msg00283.html 19 | # 20 | # "The RC_VERSION variable in config.nmake should be comma separated. 21 | # This allows the resources to be built correctly and the version 22 | # number to be correctly displayed in the explorer properties dialog 23 | # for the executables, and XP's tooltip, rather than 0.0.0.0." 24 | # 25 | 26 | MODULE_VERSION=$(MODULE_VERSION_MAJOR).$(MODULE_VERSION_MINOR).$(MODULE_VERSION_MICRO).$(MODULE_VERSION_EXTRA) 27 | RC_MODULE_VERSION=$(MODULE_VERSION_MAJOR),$(MODULE_VERSION_MINOR),$(MODULE_VERSION_MICRO),$(MODULE_VERSION_EXTRA) 28 | 29 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/AutoUpdate.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | 5 | 6 | @interface AutoUpdateInfo : NSObject 7 | { 8 | NSString* appName; 9 | NSString* version; 10 | NSString* uri; 11 | NSString* historyUri; 12 | } 13 | 14 | @property (copy) NSString* appName; 15 | @property (copy) NSString* version; 16 | @property (copy) NSString* uri; 17 | @property (copy) NSString* historyUri; 18 | 19 | @end 20 | 21 | 22 | 23 | @interface AutoUpdate : NSObject 24 | { 25 | NSString* iFeedUri; 26 | NSString* iAppName; 27 | NSString* iTarget; 28 | NSString* iCurrentVersion; 29 | NSString* iRelativeDataPath; 30 | bool iCheckForBeta; 31 | } 32 | 33 | - (id) initWithFeedUri:(NSString*)aFeedUri appName:(NSString*)aAppName currentVersion:(NSString*)aCurrentVersion relativeDataPath:(NSString*)aRelativeDataPath; 34 | - (void) setCheckForBeta:(bool)aCheckForBeta; 35 | - (AutoUpdateInfo*) checkForUpdates; 36 | - (bool) installUpdate:(AutoUpdateInfo*)aInfo; 37 | 38 | @end 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/sources.inc: -------------------------------------------------------------------------------- 1 | TARGETTYPE=DRIVER 2 | 3 | TARGETLIBS= \ 4 | $(DDK_LIB_PATH)\portcls.lib\ 5 | $(DDK_LIB_PATH)\netio.lib \ 6 | $(DDK_LIB_PATH)\stdunk.lib 7 | 8 | INCLUDES= \ 9 | $(DDK_INC_PATH); \ 10 | .. 11 | 12 | MSC_WARNING_LEVEL=-W4 -WX 13 | 14 | C_DEFINES= $(C_DEFINES) -D_WIN32 -DUNICODE -D_UNICODE -DPC_IMPLEMENTATION 15 | 16 | # 17 | # Different levels of debug printage. First is nothing but 18 | # catastrophic errors, last is everything under the sun. 19 | # 20 | #C_DEFINES= $(C_DEFINES) -DDEBUG_LEVEL=DEBUGLVL_ERROR 21 | C_DEFINES= $(C_DEFINES) -DDEBUG_LEVEL=DEBUGLVL_TERSE 22 | #C_DEFINES= $(C_DEFINES) -DDEBUG_LEVEL=DEBUGLVL_VERBOSE 23 | #C_DEFINES= $(C_DEFINES) -DDEBUG_LEVEL=DEBUGLVL_BLAB 24 | 25 | SOURCES=\ 26 | ..\adapter.cpp \ 27 | ..\basedma.cpp \ 28 | ..\basetopo.cpp \ 29 | ..\basewave.cpp \ 30 | ..\common.cpp \ 31 | ..\hw.cpp \ 32 | ..\kshelper.cpp \ 33 | ..\msvad.rc 34 | 35 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/SongcastAppDelegate.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | #import "Model.h" 4 | #import "WindowUpdates.h" 5 | 6 | 7 | @interface SongcastAppDelegate : NSObject 8 | { 9 | IBOutlet NSMenu* menu; 10 | IBOutlet NSMenuItem* menuItemStatus; 11 | IBOutlet NSMenuItem* menuItemOnOff; 12 | IBOutlet NSMenuItem* menuItemReconnect; 13 | IBOutlet NSMenuItem* menuItemPrefs; 14 | 15 | NSStatusItem* iStatusItem; 16 | Model* iModel; 17 | bool iSessionResigned; 18 | WindowUpdates* iWindowUpdates; 19 | } 20 | 21 | @property (assign) IBOutlet NSMenu* menu; 22 | @property (assign) IBOutlet NSMenuItem* menuItemStatus; 23 | @property (assign) IBOutlet NSMenuItem* menuItemOnOff; 24 | @property (assign) IBOutlet NSMenuItem* menuItemReconnect; 25 | @property (assign) IBOutlet NSMenuItem* menuItemPrefs; 26 | 27 | - (IBAction)menuItemOnOffClicked:(id)aSender; 28 | - (IBAction)menuItemReconnectClicked:(id)aSender; 29 | - (IBAction)menuItemPrefsClicked:(id)aSender; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/makefile: -------------------------------------------------------------------------------- 1 | ############################################################################# 2 | # 3 | # Copyright (c) 1998-2000 Microsoft Corporation 4 | # All Rights Reserved. 5 | # 6 | # Makefile for wdm\audio\msvad 7 | # 8 | ############################################################################# 9 | 10 | # 11 | # DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source 12 | # file to this component. This file merely indirects to the real make file 13 | # that is shared by all the components of NT. 14 | # 15 | !IF DEFINED(_NT_TARGET_VERSION) 16 | ! IF $(_NT_TARGET_VERSION)>=0x501 17 | ! INCLUDE $(NTMAKEENV)\makefile.def 18 | ! ELSE 19 | # Only warn once per directory 20 | ! INCLUDE $(NTMAKEENV)\makefile.plt 21 | ! IF "$(BUILD_PASS)"=="PASS1" 22 | ! message BUILDMSG: Warning : The sample "$(MAKEDIR)" is not valid for the current OS target. 23 | ! ENDIF 24 | ! ENDIF 25 | !ELSE 26 | ! INCLUDE $(NTMAKEENV)\makefile.def 27 | !ENDIF 28 | 29 | -------------------------------------------------------------------------------- /Wireshark/plugins/Custom.nmake: -------------------------------------------------------------------------------- 1 | # 2 | # $Id: Custom.nmake.example 45172 2012-09-27 11:39:54Z etxrab $ 3 | # 4 | 5 | include ..\config.nmake 6 | 7 | all: ohz ohm 8 | 9 | ohz:: 10 | cd ohz 11 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake 12 | cd .. 13 | 14 | ohz:: 15 | cd ohm 16 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake 17 | cd .. 18 | 19 | clean: 20 | cd ohz 21 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean 22 | cd .. 23 | cd ohm 24 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake clean 25 | cd .. 26 | 27 | distclean: clean 28 | cd ohz 29 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean 30 | cd .. 31 | cd ohm 32 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake distclean 33 | cd .. 34 | 35 | maintainer-clean: distclean 36 | cd ohz 37 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean 38 | cd .. 39 | cd ohm 40 | $(MAKE) /$(MAKEFLAGS) -f Makefile.nmake maintainer-clean 41 | cd .. 42 | 43 | install-plugins: 44 | !IFDEF ENABLE_LIBWIRESHARK 45 | xcopy ohz\*.dll ..\$(INSTALL_DIR)\plugins\$(VERSION) /d 46 | xcopy ohm\*.dll ..\$(INSTALL_DIR)\plugins\$(VERSION) /d 47 | !ENDIF 48 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/MainWindow.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.237 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ohSongshark.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.235 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OpenHome.Songcast.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/OpenHome/Fifo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace OpenHome; 4 | 5 | // FifoLiteBase 6 | 7 | FifoLiteBase::FifoLiteBase(TUint aSlots) : iSlots(aSlots), iSlotsUsed(0), 8 | iReadIndex(0), iWriteIndex(0) 9 | { 10 | } 11 | 12 | TUint FifoLiteBase::Slots() const 13 | { 14 | return iSlots; 15 | } 16 | 17 | TUint FifoLiteBase::SlotsFree() const 18 | { 19 | return iSlots - iSlotsUsed; 20 | } 21 | 22 | TUint FifoLiteBase::SlotsUsed() const 23 | { 24 | return iSlotsUsed; 25 | } 26 | 27 | TUint FifoLiteBase::Write() 28 | { 29 | ASSERT(iSlots > iSlotsUsed); 30 | TUint index = iWriteIndex++; 31 | if(iWriteIndex == iSlots) { 32 | iWriteIndex = 0; 33 | } 34 | iSlotsUsed++; 35 | return (index); 36 | } 37 | 38 | TUint FifoLiteBase::WriteBack() 39 | { 40 | ASSERT(iSlots > iSlotsUsed); 41 | if(iReadIndex == 0) { 42 | iReadIndex = iSlots - 1;; 43 | } 44 | else { 45 | iReadIndex--; 46 | } 47 | iSlotsUsed++; 48 | return (iReadIndex); 49 | } 50 | 51 | TUint FifoLiteBase::Read() 52 | { 53 | ASSERT(iSlotsUsed > 0); 54 | TUint index = iReadIndex++; 55 | if(iReadIndex == iSlots) { 56 | iReadIndex = 0; 57 | } 58 | iSlotsUsed--; 59 | return index; 60 | } 61 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Scripts/uninstall.tool: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | launchFile="/Library/LaunchAgents/org.openhome.av.songcast.plist" 5 | driver="/System/Library/Extensions/ohSongcast.kext" 6 | prefs="/Library/PreferencePanes/ohSongcast.prefPane" 7 | app="/Library/OpenHome/ohSongcast.app" 8 | pkgId="org.openhome.av.songcast" 9 | 10 | 11 | # stop the agent application 12 | 13 | echo 14 | echo Stopping application... 15 | echo 16 | 17 | if [ -e "$launchFile" ] 18 | then 19 | launchctl unload "$launchFile" > /dev/null 2>&1 20 | fi 21 | 22 | 23 | # unload the driver 24 | 25 | echo 26 | echo Unloading driver... 27 | echo 28 | 29 | if [ -e "$driver" ] 30 | then 31 | sudo kextunload "$driver" > /dev/null 2>&1 32 | if [ $? != 0 ] 33 | then 34 | sudo kextunload "$driver" > /dev/null 2>&1 35 | fi 36 | fi 37 | 38 | 39 | # remove installed files 40 | 41 | echo 42 | echo Removing files... 43 | echo 44 | 45 | sudo rm -rf "$launchFile" 46 | sudo rm -rf "$driver" 47 | sudo rm -rf "$prefs" 48 | sudo rm -rf "$app" 49 | 50 | 51 | # clean pkg install receipts 52 | 53 | sudo pkgutil --forget "$pkgId" > /dev/null 2>&1 54 | 55 | 56 | echo 57 | echo ------------------------------------------------------- 58 | echo Please restart you machine to complete the installation 59 | echo ------------------------------------------------------- 60 | echo 61 | 62 | 63 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/CrashLogging.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | 5 | // Declaration of the crash log 6 | 7 | @interface CrashLog : NSObject 8 | { 9 | NSString* iLog; 10 | } 11 | 12 | - (id) initWithLog:(NSString*)aLog; 13 | - (NSString*) string; 14 | 15 | @end 16 | 17 | 18 | // Declaration of interface for dumping crash logs 19 | 20 | @protocol ICrashLogDumper 21 | 22 | - (void) dump:(CrashLog*)aCrashLog; 23 | 24 | @end 25 | 26 | 27 | // Declaration of the crash monitor that detects crashes 28 | 29 | @interface CrashMonitor : NSObject 30 | { 31 | NSMutableArray* iDumpers; 32 | } 33 | 34 | - (void) addDumper:(NSObject*)aDumper; 35 | - (void) start; 36 | 37 | @end 38 | 39 | 40 | // Declaration of crash log dumper to display a dialog and send the crash report 41 | 42 | @interface CrashLogDumperReport : NSObject 43 | { 44 | NSString* iProductId; 45 | NSString* iUri; 46 | } 47 | 48 | - (id) initWithProductId:(NSString*)aProductId uri:(NSString*)aUri; 49 | - (void) dump:(CrashLog*)aCrashLog; 50 | 51 | @end 52 | 53 | 54 | // Declaration of the http crash reporter 55 | 56 | @interface CrashReporterHttp : NSObject 57 | 58 | + (bool) send:(NSString*)aReport productId:(NSString*)aProductId name:(NSString*)aName email:(NSString*)aEmail phone:(NSString*)aPhone comment:(NSString*)aComment url:(NSString*)aUrl; 59 | 60 | @end 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/WindowUpdates.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | #import "AutoUpdate.h" 4 | 5 | 6 | @interface UpdateCheck : NSObject 7 | { 8 | bool isManual; 9 | AutoUpdateInfo* updateInfo; 10 | } 11 | 12 | @property (assign) bool isManual; 13 | @property (retain) AutoUpdateInfo* updateInfo; 14 | 15 | @end 16 | 17 | 18 | @interface WindowUpdates : NSWindowController 19 | { 20 | IBOutlet NSProgressIndicator* progressChecking; 21 | IBOutlet NSProgressIndicator* progressDownloading; 22 | IBOutlet NSTextField* textAvailable; 23 | IBOutlet NSView* viewChecking; 24 | IBOutlet NSView* viewAvailable; 25 | IBOutlet NSView* viewUnavailable; 26 | IBOutlet NSView* viewDownloading; 27 | AutoUpdate* iAutoUpdate; 28 | UpdateCheck* iUpdateCheck; 29 | } 30 | 31 | @property (assign) NSProgressIndicator* progressChecking; 32 | @property (assign) NSProgressIndicator* progressDownloading; 33 | @property (assign) NSTextField* textAvailable; 34 | @property (assign) NSView* viewChecking; 35 | @property (assign) NSView* viewAvailable; 36 | @property (assign) NSView* viewUnavailable; 37 | @property (assign) NSView* viewDownloading; 38 | 39 | - (IBAction) buttonDetailsClicked:(id)aSender; 40 | - (IBAction) buttonInstallClicked:(id)aSender; 41 | - (IBAction) buttonNotNowClicked:(id)aSender; 42 | - (void) setAutoUpdate:(AutoUpdate*)aAutoUpdate; 43 | - (void) startAutomaticCheck; 44 | - (void) startManualCheck; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/drmsimp.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) 1997-2000 Microsoft Corporation All Rights Reserved 4 | 5 | Module Name: 6 | 7 | drmsimp.h 8 | 9 | Abstract: 10 | 11 | Node and Pin numbers for simple drm sample. 12 | 13 | --*/ 14 | 15 | #ifndef _MSVAD_DRMSIMP_H_ 16 | #define _MSVAD_DRMSIMP_H_ 17 | 18 | // Pin properties. 19 | #define MAX_OUTPUT_STREAMS 1 // Number of capture streams. 20 | #define MAX_INPUT_STREAMS 1 // Number of render streams. 21 | #define MAX_TOTAL_STREAMS MAX_OUTPUT_STREAMS + MAX_INPUT_STREAMS 22 | 23 | // PCM Info 24 | #define MIN_CHANNELS 2 // Min Channels. 25 | #define MAX_CHANNELS_PCM 2 // Max Channels. 26 | #define MIN_BITS_PER_SAMPLE_PCM 16 // Min Bits Per Sample 27 | #define MAX_BITS_PER_SAMPLE_PCM 16 // Max Bits Per Sample 28 | #define MIN_SAMPLE_RATE 44100 // Min Sample Rate 29 | #define MAX_SAMPLE_RATE 48000 // Max Sample Rate 30 | 31 | // Wave pins 32 | enum 33 | { 34 | KSPIN_WAVE_RENDER_SINK, 35 | KSPIN_WAVE_RENDER_SOURCE 36 | }; 37 | 38 | // Wave Topology nodes. 39 | enum 40 | { 41 | KSNODE_WAVE_DAC 42 | }; 43 | 44 | // topology pins. 45 | enum 46 | { 47 | KSPIN_TOPO_WAVEOUT_SOURCE, 48 | KSPIN_TOPO_LINEOUT_DEST, 49 | }; 50 | 51 | // topology nodes. 52 | enum 53 | { 54 | KSNODE_TOPO_WAVEOUT_MUTE 55 | }; 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/OpenHome/Fifo.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_FIFO 2 | #define HEADER_FIFO 3 | 4 | #include 5 | #include 6 | 7 | namespace OpenHome { 8 | 9 | // FifoLite provides lightweight thread unaware first in first out buffering 10 | // 11 | // Writes assert if the fifo is full (use SlotsFree() to check before writing) 12 | // Reads from an empty fifo assert (use SlotsUsed() to check before reading) 13 | 14 | class FifoLiteBase : public INonCopyable 15 | { 16 | public: 17 | TUint Slots() const; 18 | TUint SlotsFree() const; 19 | TUint SlotsUsed() const; 20 | protected: 21 | FifoLiteBase(TUint aSlots); 22 | TUint Write(); // return index of entry to write 23 | TUint WriteBack(); // return index of entry to write at rhs of fifo 24 | TUint Read(); // return index of entry to read 25 | private: 26 | TUint iSlots; 27 | TUint iSlotsUsed; 28 | TUint iReadIndex; 29 | TUint iWriteIndex; 30 | }; 31 | 32 | template class FifoLite : public FifoLiteBase 33 | { 34 | public: 35 | inline FifoLite() : FifoLiteBase(S) {} 36 | inline void Write(T aEntry) { iBuf[FifoLiteBase::Write()] = aEntry; } 37 | inline void WriteBack(T aEntry) { iBuf[FifoLiteBase::WriteBack()] = aEntry; } 38 | inline T Read() { return (iBuf[FifoLiteBase::Read()]); } 39 | private: 40 | T iBuf[S]; 41 | }; 42 | 43 | } // namespace OpenHome 44 | 45 | #endif //HEADER_FIFO 46 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/mintopo.h: -------------------------------------------------------------------------------- 1 | 2 | /*++ 3 | 4 | Copyright (c) 1997-2000 Microsoft Corporation All Rights Reserved 5 | 6 | Module Name: 7 | 8 | minitopo.h 9 | 10 | Abstract: 11 | 12 | Declaration of topology miniport. 13 | 14 | --*/ 15 | 16 | #ifndef _MSVAD_MINTOPO_H_ 17 | #define _MSVAD_MINTOPO_H_ 18 | 19 | #include "basetopo.h" 20 | 21 | //============================================================================= 22 | // Classes 23 | //============================================================================= 24 | 25 | /////////////////////////////////////////////////////////////////////////////// 26 | // CMiniportTopology 27 | // 28 | 29 | class CMiniportWaveCyclic; 30 | 31 | class CMiniportTopology : 32 | public CMiniportTopologyMSVAD, 33 | public IMiniportTopology, 34 | public CUnknown 35 | { 36 | public: 37 | DECLARE_STD_UNKNOWN(); 38 | DEFINE_STD_CONSTRUCTOR(CMiniportTopology); 39 | ~CMiniportTopology(); 40 | 41 | IMP_IMiniportTopology; 42 | 43 | void CreateWaveMiniport(); 44 | void DestroyWaveMiniport(); 45 | NTSTATUS PropertyHandlerWave(IN PPCPROPERTY_REQUEST PropertyRequest); 46 | void SetMiniportWave(CMiniportWaveCyclic* aMiniportWave) {iMiniportWave = aMiniportWave;} 47 | private: 48 | CMiniportWaveCyclic* iMiniportWave; 49 | }; 50 | 51 | typedef CMiniportTopology *PCMiniportTopology; 52 | 53 | extern NTSTATUS PropertyHandler_Jack(IN PPCPROPERTY_REQUEST PropertyRequest); 54 | 55 | #endif 56 | 57 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Prefs/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ohSongcast 9 | CFBundleIconFile 10 | Icon.icns 11 | CFBundleIdentifier 12 | org.openhome.av.songcast 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ohSongcast 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | NSHumanReadableCopyright 26 | © 2011 OpenHome 27 | NSMainNibFile 28 | SongcastPrefPane 29 | NSPrefPaneIconFile 30 | Icon.png 31 | NSPrefPaneIconLabel 32 | ohSongcast 33 | NSPrincipalClass 34 | SongcastPrefPane 35 | SongcastPreferencesId 36 | org.openhome.av.songcast 37 | SongcastManualUrl 38 | 39 | SongcastAboutText 40 | %@ 41 | Version %@ 42 | %@ 43 | 44 | 45 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Installer/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011, OpenHome 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * Neither the name of Linn Products Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | -------------------------------------------------------------------------------- /Wireshark/plugins/ohm/Makefile.common: -------------------------------------------------------------------------------- 1 | # Makefile.common for Songcast OHM plugin 2 | # Contains the stuff from Makefile.am and Makefile.nmake that is 3 | # a) common to both files and 4 | # b) portable between both files 5 | # 6 | # $Id:$ 7 | # 8 | # Wireshark - Network traffic analyzer 9 | # By Gerald Combs 10 | # Copyright 1998 Gerald Combs 11 | # 12 | # This program is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU General Public License 14 | # as published by the Free Software Foundation; either version 2 15 | # of the License, or (at your option) any later version. 16 | # 17 | # This program is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | # GNU General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License 23 | # along with this program; if not, write to the Free Software 24 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | # the name of the plugin 27 | PLUGIN_NAME = ohm 28 | 29 | # the dissector sources (without any helpers) 30 | DISSECTOR_SRC = \ 31 | packet-ohm.c 32 | 33 | # corresponding headers 34 | DISSECTOR_INCLUDES = 35 | 36 | # Dissector helpers. They're included in the source files in this 37 | # directory, but they're not dissectors themselves, i.e. they're not 38 | # used to generate "plugin.c". 39 | DISSECTOR_SUPPORT_SRC = 40 | -------------------------------------------------------------------------------- /Wireshark/plugins/ohz/Makefile.common: -------------------------------------------------------------------------------- 1 | # Makefile.common for Songcast OHZ plugin 2 | # Contains the stuff from Makefile.am and Makefile.nmake that is 3 | # a) common to both files and 4 | # b) portable between both files 5 | # 6 | # $Id:$ 7 | # 8 | # Wireshark - Network traffic analyzer 9 | # By Gerald Combs 10 | # Copyright 1998 Gerald Combs 11 | # 12 | # This program is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU General Public License 14 | # as published by the Free Software Foundation; either version 2 15 | # of the License, or (at your option) any later version. 16 | # 17 | # This program is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | # GNU General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU General Public License 23 | # along with this program; if not, write to the Free Software 24 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 25 | 26 | # the name of the plugin 27 | PLUGIN_NAME = ohz 28 | 29 | # the dissector sources (without any helpers) 30 | DISSECTOR_SRC = \ 31 | packet-ohz.c 32 | 33 | # corresponding headers 34 | DISSECTOR_INCLUDES = 35 | 36 | # Dissector helpers. They're included in the source files in this 37 | # directory, but they're not dissectors themselves, i.e. they're not 38 | # used to generate "plugin.c". 39 | DISSECTOR_SUPPORT_SRC = 40 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/OpenHome/Fifo.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | using namespace OpenHome; 4 | 5 | // FifoLiteBase 6 | 7 | FifoLiteBase::FifoLiteBase(TUint aSlots) : iSlots(aSlots), iSlotsUsed(0), 8 | iReadIndex(0), iWriteIndex(0) 9 | { 10 | } 11 | 12 | void* FifoLiteBase::operator new(size_t aBytes) 13 | { 14 | return (ExAllocatePoolWithTag(NonPagedPool, aBytes, '2ten')); 15 | } 16 | 17 | void FifoLiteBase::operator delete(void* aPtr) 18 | { 19 | ExFreePoolWithTag(aPtr, '2ten'); 20 | } 21 | 22 | TUint FifoLiteBase::Slots() const 23 | { 24 | return iSlots; 25 | } 26 | 27 | TUint FifoLiteBase::SlotsFree() const 28 | { 29 | return iSlots - iSlotsUsed; 30 | } 31 | 32 | TUint FifoLiteBase::SlotsUsed() const 33 | { 34 | return iSlotsUsed; 35 | } 36 | 37 | TUint FifoLiteBase::Write() 38 | { 39 | OHASSERT(iSlots > iSlotsUsed); 40 | TUint index = iWriteIndex++; 41 | if(iWriteIndex == iSlots) { 42 | iWriteIndex = 0; 43 | } 44 | iSlotsUsed++; 45 | return (index); 46 | } 47 | 48 | TUint FifoLiteBase::WriteBack() 49 | { 50 | OHASSERT(iSlots > iSlotsUsed); 51 | if(iReadIndex == 0) { 52 | iReadIndex = iSlots - 1;; 53 | } 54 | else { 55 | iReadIndex--; 56 | } 57 | iSlotsUsed++; 58 | return (iReadIndex); 59 | } 60 | 61 | TUint FifoLiteBase::Read() 62 | { 63 | OHASSERT(iSlotsUsed > 0); 64 | TUint index = iReadIndex++; 65 | if(iReadIndex == iSlots) { 66 | iReadIndex = 0; 67 | } 68 | iSlotsUsed--; 69 | return index; 70 | } 71 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/OpenHome/Fifo.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_FIFO 2 | #define HEADER_FIFO 3 | 4 | #include 5 | #include 6 | 7 | namespace OpenHome { 8 | 9 | // FifoLite provides lightweight thread unaware first in first out buffering 10 | // 11 | // Writes assert if the fifo is full (use SlotsFree() to check before writing) 12 | // Reads from an empty fifo assert (use SlotsUsed() to check before reading) 13 | 14 | class FifoLiteBase : public INonCopyable 15 | { 16 | public: 17 | TUint Slots() const; 18 | TUint SlotsFree() const; 19 | TUint SlotsUsed() const; 20 | void* operator new(size_t aBytes); 21 | void operator delete(void* aPtr); 22 | protected: 23 | FifoLiteBase(TUint aSlots); 24 | TUint Write(); // return index of entry to write 25 | TUint WriteBack(); // return index of entry to write at rhs of fifo 26 | TUint Read(); // return index of entry to read 27 | private: 28 | TUint iSlots; 29 | TUint iSlotsUsed; 30 | TUint iReadIndex; 31 | TUint iWriteIndex; 32 | }; 33 | 34 | template class FifoLite : public FifoLiteBase 35 | { 36 | public: 37 | inline FifoLite() : FifoLiteBase(S) {} 38 | inline void Write(T aEntry) { iBuf[FifoLiteBase::Write()] = aEntry; } 39 | inline void WriteBack(T aEntry) { iBuf[FifoLiteBase::WriteBack()] = aEntry; } 40 | inline T Read() { return (iBuf[FifoLiteBase::Read()]); } 41 | private: 42 | T iBuf[S]; 43 | }; 44 | 45 | } // namespace OpenHome 46 | 47 | #endif //HEADER_FIFO 48 | -------------------------------------------------------------------------------- /BsdLicense.txt: -------------------------------------------------------------------------------- 1 | Copyright 2012, OpenHome. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are 4 | permitted provided that the following conditions are met: 5 | 6 | 1. Redistributions of source code must retain the above copyright notice, this list of 7 | conditions and the following disclaimer. 8 | 9 | 2. Redistributions in binary form must reproduce the above copyright notice, this list 10 | of conditions and the following disclaimer in the documentation and/or other materials 11 | provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY OPENHOME ''AS IS'' AND ANY EXPRESS OR IMPLIED 14 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 15 | FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL OR 16 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 17 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 18 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 19 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 20 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 21 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 22 | 23 | The views and conclusions contained in the software and documentation are those of the 24 | authors and should not be interpreted as representing official policies, either expressed 25 | or implied, of OpenHome. -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/prop.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////// 2 | // This header file is only used if you compile the driver with the switch 3 | // INCLUDE_PRIVATE_PROPERTY defined. Additionally, this header file is 4 | // also used by the property page sample. 5 | // 6 | // This header file defines the private property (the GUID) and the 7 | // "messages" therin. It also defines the structure passed down. 8 | // 9 | 10 | // 11 | // The GUID was generated with guidgen.exe 12 | // 13 | 14 | // This is the GUID for the private property request. 15 | 16 | // This is the GUID for the private property request. 17 | #define STATIC_KSPROPSETID_Private \ 18 | 0x2685C863, 0x5E57, 0x4D9A, 0x86, 0xEC, 0x2E, 0xC9, 0xB7, 0xBB, 0xBC, 0xFD 19 | DEFINE_GUIDSTRUCT("2685C863-5E57-4D9A-86EC-2EC9B7BBBCFD", KSPROPSETID_Private); 20 | #define KSPROPSETID_Private DEFINE_GUIDNAMED(KSPROPSETID_Private) 21 | 22 | 23 | /* 24 | // {2685C863-5E57-4D9A-86EC-2EC9B7BBBCFD} 25 | DEFINE_GUID(KSPROPSETID_Private, 0x2685C863, 0x5E57, 0x4D9A, 0x86, 0xEC, 0x2E, 0xC9, 0xB7, 0xBB, 0xBC, 0xFD); 26 | */ 27 | 28 | // Define the method in the property. You can have multiple methods defined 29 | // for one private property ... 30 | 31 | const int KSPROPERTY_OHSOUNDCARD_VERSION = 0; 32 | const int KSPROPERTY_OHSOUNDCARD_ENABLED = 1; 33 | const int KSPROPERTY_OHSOUNDCARD_ACTIVE = 2; 34 | const int KSPROPERTY_OHSOUNDCARD_ENDPOINT = 3; 35 | const int KSPROPERTY_OHSOUNDCARD_TTL = 4; 36 | const int KSPROPERTY_OHSOUNDCARD_LATENCY = 5; 37 | const int KSPROPERTY_OHSOUNDCARD_RESEND = 6; 38 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/ohSongcast.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 11.00 2 | # Visual Studio 2010 3 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ohSongcast", "ohSongcast.csproj", "{4372073B-B7BE-47AF-93F6-EE6DF7206548}" 4 | EndProject 5 | Global 6 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 | Debug|Any CPU = Debug|Any CPU 8 | Debug|Mixed Platforms = Debug|Mixed Platforms 9 | Debug|x86 = Debug|x86 10 | Release|Any CPU = Release|Any CPU 11 | Release|Mixed Platforms = Release|Mixed Platforms 12 | Release|x86 = Release|x86 13 | EndGlobalSection 14 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 15 | {4372073B-B7BE-47AF-93F6-EE6DF7206548}.Debug|Any CPU.ActiveCfg = Debug|x86 16 | {4372073B-B7BE-47AF-93F6-EE6DF7206548}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 17 | {4372073B-B7BE-47AF-93F6-EE6DF7206548}.Debug|Mixed Platforms.Build.0 = Debug|x86 18 | {4372073B-B7BE-47AF-93F6-EE6DF7206548}.Debug|x86.ActiveCfg = Debug|x86 19 | {4372073B-B7BE-47AF-93F6-EE6DF7206548}.Debug|x86.Build.0 = Debug|x86 20 | {4372073B-B7BE-47AF-93F6-EE6DF7206548}.Release|Any CPU.ActiveCfg = Release|x86 21 | {4372073B-B7BE-47AF-93F6-EE6DF7206548}.Release|Mixed Platforms.ActiveCfg = Release|x86 22 | {4372073B-B7BE-47AF-93F6-EE6DF7206548}.Release|Mixed Platforms.Build.0 = Release|x86 23 | {4372073B-B7BE-47AF-93F6-EE6DF7206548}.Release|x86.ActiveCfg = Release|x86 24 | {4372073B-B7BE-47AF-93F6-EE6DF7206548}.Release|x86.Build.0 = Release|x86 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | EndGlobal 30 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/ModelSongcast.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | #import "ReceiverList.h" 4 | #import "SubnetList.h" 5 | 6 | 7 | @interface ModelSongcast : NSObject 8 | { 9 | void* iSongcast; 10 | ReceiverList* iReceivers; 11 | NSArray* iSelectedUdns; 12 | SubnetList* iSubnets; 13 | 14 | id iReceiversChangedObject; 15 | SEL iReceiversChangedSelector; 16 | 17 | id iSubnetsChangedObject; 18 | SEL iSubnetsChangedSelector; 19 | 20 | id iConfigurationChangedObject; 21 | SEL iConfigurationChangedSelector; 22 | } 23 | 24 | - (id) initWithReceivers:(NSArray*)aReceivers andSelectedUdns:(NSArray*)aSelectedUdns multicastEnabled:(bool)aMulticastEnabled multicastChannel:(uint32_t)aMulticastChannel latencyMs:(uint32_t)aLatencyMs subnet:(uint32_t)aSubnet; 25 | - (void) dispose; 26 | 27 | - (void) setReceiversChangedObserver:(id)aObserver selector:(SEL)aSelector; 28 | - (void) setSubnetsChangedObserver:(id)aObserver selector:(SEL)aSelector; 29 | - (void) setConfigurationChangedObserver:(id)aObserver selector:(SEL)aSelector; 30 | 31 | - (bool) enabled; 32 | - (void) setEnabled:(bool)aValue; 33 | - (void) setMulticastEnabled:(bool)aValue; 34 | - (void) setMulticastChannel:(uint32_t)aValue; 35 | - (void) setLatencyMs:(uint32_t)aValue; 36 | 37 | - (NSArray*) receivers; 38 | - (void) setSelectedUdns:(NSArray*)aSelectedUdns; 39 | - (void) refreshReceivers; 40 | 41 | - (void) stopReceiver:(Receiver*)aReceiver; 42 | - (void) stopReceivers; 43 | - (void) playReceiver:(Receiver*)aReceiver; 44 | - (void) playReceivers; 45 | 46 | - (NSArray*) subnets; 47 | - (uint32_t) subnet; 48 | - (void) setSubnet:(uint32_t)aAddress; 49 | 50 | @end 51 | 52 | 53 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/Model.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | #import "Preferences.h" 4 | #import "ModelSongcast.h" 5 | #import "AutoUpdate.h" 6 | 7 | 8 | @protocol IModelObserver 9 | 10 | - (void) enabledChanged; 11 | - (void) iconVisibleChanged; 12 | - (void) checkForUpdates; 13 | 14 | @end 15 | 16 | 17 | @interface Model : NSObject 18 | { 19 | Preferences* iPreferences; 20 | id iObserver; 21 | ModelSongcast* iModelSongcast; 22 | AutoUpdate* iAutoUpdate; 23 | } 24 | 25 | - (void) start; 26 | - (void) stop; 27 | - (void) setObserver:(id)aObserver; 28 | 29 | - (bool) iconVisible; 30 | - (bool) enabled; 31 | - (void) setEnabled:(bool)aValue; 32 | - (bool) hasRunWizard; 33 | - (bool) autoUpdatesEnabled; 34 | - (AutoUpdate*) autoUpdate; 35 | - (void) reconnectReceivers; 36 | 37 | - (void) preferenceEnabledChanged:(NSNotification*)aNotification; 38 | - (void) preferenceIconVisibleChanged:(NSNotification*)aNotification; 39 | - (void) preferenceSelectedUdnListChanged:(NSNotification*)aNotification; 40 | - (void) preferenceRefreshReceiverList:(NSNotification*)aNotification; 41 | - (void) preferenceReconnectReceivers:(NSNotification*)aNotification; 42 | - (void) preferenceMulticastEnabledChanged:(NSNotification*)aNotification; 43 | - (void) preferenceMulticastChannelChanged:(NSNotification*)aNotification; 44 | - (void) preferenceLatencyMsChanged:(NSNotification*)aNotification; 45 | - (void) preferenceSelectedSubnetChanged:(NSNotification*)aNotification; 46 | - (void) preferenceAutoUpdatesEnabledChanged:(NSNotification*)aNotification; 47 | - (void) preferenceBetaUpdatesEnabledChanged:(NSNotification*)aNotification; 48 | - (void) preferenceCheckForUpdates:(NSNotification*)aNotification; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | ohSongcast can be used to provide a virtual soundcard which sends a device's 2 | audio output to another device which implements the OpenHome Receiver service 3 | (http://wiki.openhome.org/wiki/Av:Developer:ReceiverService). 4 | 5 | Full versions exist for Windows (7 onwards) and Mac OSX (Lion onwards). 6 | Much of the code builds for other platforms but without integration their audio subsystems. 7 | 8 | The code can be built for Windows, Mac or Linux and requires: 9 | - Python v2.7 10 | - MSVC (Windows) 11 | - GCC (Linux) 12 | - Clang (Mac) 13 | - ohNet (https://github.com/openhome/ohNet.git) 14 | - ohdevtools (https://github.com/openhome/ohdevtools.git) 15 | - ohNetGenerated (https://github.com/openhome/ohNetGenerated.git) 16 | - ohNetmon (https://github.com/openhome/ohNetmon.git) 17 | - ohTopology (https://github.com/openhome/ohTopology.git) 18 | 19 | All code must be cloned to the same root directory and can then be built using: 20 | 21 | cd ohNet 22 | make ohNetCore proxies devices TestFramework ohNet.net.dll 23 | cd ../ohNetGenerated 24 | ./go fetch --all 25 | make 26 | cd ../ohNetmon 27 | ./go fetch --all 28 | ./waf configure --ohnet=../ohNet 29 | ./waf build 30 | cd ../ohTopology 31 | ./go fetch --all 32 | ./waf configure --ohnet=../ohNet 33 | ./waf build 34 | cd ../ohSongcast 35 | make release=1 36 | 37 | and for a debug build: 38 | 39 | cd ohNet 40 | make ohNetCore proxies devices TestFramework ohNet.net.dll debug=1 41 | cd ../ohNetGenerated 42 | ./go fetch --all ### note the missing '--debug' argument is intentional 43 | make debug=1 44 | cd ../ohNetmon 45 | ./go fetch --all --debug 46 | ./waf configure --ohnet=../ohNet --debug 47 | ./waf build 48 | cd ../ohTopology 49 | ./go fetch --all --debug 50 | ./waf configure --ohnet=../ohNet --debug 51 | ./waf build 52 | cd ../ohSongcast 53 | make debug=1 54 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ohSongcast 9 | CFBundleIconFile 10 | Icon.icns 11 | CFBundleIdentifier 12 | org.openhome.av.songcast 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ohSongcast 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSMinimumSystemVersion 26 | 10.6 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | LSUIElement 32 | 1 33 | SongcastPreferencesId 34 | org.openhome.av.songcast 35 | SongcastPreferencePane 36 | /Library/PreferencePanes/ohSongcast.prefPane 37 | SongcastDomain 38 | av.openhome.org 39 | SongcastManufacturerName 40 | OpenHome 41 | SongcastManufacturerUrl 42 | http://www.openhome.org 43 | SongcastModelUrl 44 | http://www.openhome.org 45 | SongcastProductId 46 | ohSongcast 47 | SongcastCrashLogUrl 48 | 49 | SongcastAutoUpdateUrl 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/AudioClip.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | 5 | // implementation of the floating point parts of the driver 6 | 7 | IOReturn AudioEngineClipOutputSamples(const void* aMixBuffer, void* aSampleBuffer, UInt32 aFirstSampleFrame, UInt32 aNumSampleFrames, UInt32 aNumChannels, UInt32 aBitDepth) 8 | { 9 | // The audio in the input buffer is always in floating point format in range [-1,1] 10 | uint8_t* inBuffer = ((uint8_t*)aMixBuffer) + (aFirstSampleFrame * aNumChannels * sizeof(float)); 11 | uint8_t* outBuffer = ((uint8_t*)aSampleBuffer) + (aFirstSampleFrame * aNumChannels * aBitDepth / 8); 12 | 13 | // convert the floating point audio into integer PCM 14 | int numSamples = aNumSampleFrames * aNumChannels; 15 | 16 | // calculate the maximum integer value for the sample - the output sample 17 | // will be in the range [-maxVal, maxVal-1] 18 | int maxVal = 1 << (aBitDepth - 1); 19 | float maxFloatVal = 1.0f - (1.0f / maxVal); 20 | int outSampleBytes = aBitDepth / 8; 21 | 22 | while (numSamples > 0) 23 | { 24 | float inSample = *((float*)inBuffer); 25 | 26 | // clamp the input sample 27 | if (inSample > maxFloatVal) { 28 | inSample = maxFloatVal; 29 | } 30 | else if (inSample < -1.0f) { 31 | inSample = -1.0f; 32 | } 33 | 34 | // convert to integer in range [maxVal-1, -maxVal] 35 | int32_t outSample = (int32_t)(inSample * maxVal); 36 | 37 | // copy the output sample into the buffer in big endian format 38 | for (int i=0 ; i> (8*(outSampleBytes - i - 1))) & 0xff; 41 | } 42 | 43 | inBuffer += sizeof(float); 44 | outBuffer += outSampleBytes; 45 | numSamples--; 46 | } 47 | 48 | return kIOReturnSuccess; 49 | } 50 | 51 | 52 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/gsrootr1.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFJjCCAw6gAwIBAgIKYSkVJwAAAAAAKjANBgkqhkiG9w0BAQUFADB/MQswCQYD 3 | VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe 4 | MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSkwJwYDVQQDEyBNaWNyb3Nv 5 | ZnQgQ29kZSBWZXJpZmljYXRpb24gUm9vdDAeFw0xMTA0MTUxOTU1MDhaFw0yMTA0 6 | MTUyMDA1MDhaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52 7 | LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxTaWduIFJvb3Qg 8 | Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZjc6j40+Kfvvx 9 | i4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6scTHAH 10 | oT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4 11 | bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVt 12 | bNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlw 13 | R5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N89iFo7+ryUp9/ 14 | k5DPAgMBAAGjgcswgcgwEQYDVR0gBAowCDAGBgRVHSAAMAsGA1UdDwQEAwIBhjAP 15 | BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzAf 16 | BgNVHSMEGDAWgBRi+wohW39DbhHaCVRQa/XSlnHxnjBVBgNVHR8ETjBMMEqgSKBG 17 | hkRodHRwOi8vY3JsLm1pY3Jvc29mdC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNy 18 | b3NvZnRDb2RlVmVyaWZSb290LmNybDANBgkqhkiG9w0BAQUFAAOCAgEAX/jQZXRq 19 | gcamylsDtpFK6Eu97yuhQvDvtKWtzTOJ7AuVhaxiUBEIqljSWqCDEOWmM3ryWvLF 20 | /nh88JyD3xkK2XOWAC3WLM3pFNQdneg/PBp295BO+wE1CmyTE6DDVutnoOTRepbe 21 | wmfxkPgKe/UyG5TsX3UfjRs02mxYp8stJ54iJrfJqjDMB3e4NuOCAbU5PMyN2adf 22 | fyOzh3/bV5iRi9fOJSDjnWRP3Yf3K2hJAxjgpd98X2hkTTaDjUeB8ungqGmr+nsW 23 | PAWkSeqIMBkKbHMFUXjf1B3dOtR/LeROVL6DQx56dDO0pOvXcHO8KgKYiWbu9ryP 24 | dJN44ykCWlpD4ljOfM+aytI2iTviX9omBU7I1OcskQ4Xl8W+7osTESMjKU/6g9BQ 25 | 9rr61T2zFz30/wNKoyXc5nVh0fo1CGvWJ0TQaLeNReDrhSzIoV1hRHQWDllYrtK1 26 | 7qW81tcHarYpeP2XZ2fdjU8XlE/S7QyvlyQ3w6Kcgdpr4UO2V3tM7L95Exnnn+hE 27 | 6UeBt15wHpH4PdF7J/ULcFZDSAXdqS+rhhAdCxLjGtBMbnXe1kWzC3SIh5NcVkpB 28 | Apr3rreZ2LZ/iPoR8kV89NcbkcAc8aD71AgKQRoUKs706zRIbmaHntVLejl/uw49 29 | OGHPc1cG5BIGa9lrUwjNcBjCLU+XRpG8qfA= 30 | -----END CERTIFICATE----- 31 | -------------------------------------------------------------------------------- /OhmSocket.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_OHM_SOCKET 2 | #define HEADER_OHM_SOCKET 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "Ohm.h" 10 | 11 | namespace OpenHome { 12 | class Environment; 13 | namespace Av { 14 | 15 | class OhmSocket : public IReaderSource, public INonCopyable 16 | { 17 | static const TUint kSendBufBytes = 16392; 18 | static const TUint kReceiveBufBytes = 16392; 19 | 20 | public: 21 | OhmSocket(Environment& aEnv); 22 | void OpenUnicast(TIpAddress aInterface, TUint aTtl); 23 | void OpenMulticast(TIpAddress aInterface, TUint aTtl, const Endpoint& aEndpoint); 24 | Endpoint This() const; 25 | Endpoint Sender() const; 26 | void Send(const Brx& aBuffer, const Endpoint& aEndpoint); 27 | void Close(); 28 | ~OhmSocket(); 29 | 30 | public: 31 | // IReaderSource 32 | virtual void Read(Bwx& aBuffer); 33 | virtual void ReadFlush(); 34 | virtual void ReadInterrupt(); 35 | 36 | private: 37 | Environment& iEnv; 38 | SocketUdpBase* iRxSocket; 39 | SocketUdpBase* iTxSocket; 40 | UdpReader* iReader; 41 | Endpoint iThis; 42 | }; 43 | 44 | class OhzSocket : public IReaderSource, public INonCopyable 45 | { 46 | static const TUint kSendBufBytes = 1024; 47 | 48 | public: 49 | OhzSocket(Environment& aEnv); 50 | 51 | const Endpoint& This() const; 52 | void Open(TIpAddress aInterface, TUint aTtl); 53 | void Send(const Brx& aBuffer); 54 | void Close(); 55 | 56 | // IReaderSource 57 | virtual void Read(Bwx& aBuffer); 58 | virtual void ReadFlush(); 59 | virtual void ReadInterrupt(); 60 | 61 | ~OhzSocket(); 62 | 63 | private: 64 | Environment& iEnv; 65 | SocketUdpMulticast* iRxSocket; 66 | SocketUdp* iTxSocket; 67 | Endpoint iEndpoint; 68 | UdpReader* iReader; 69 | }; 70 | 71 | 72 | } // namespace Av 73 | } // namespace OpenHome 74 | 75 | #endif // HEADER_OHM_SOCKET 76 | 77 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Scripts/preflight: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | launchFile="/Library/LaunchAgents/org.openhome.av.songcast.plist" 5 | driver="/System/Library/Extensions/ohSongcast.kext" 6 | 7 | launchFileOld="/Library/LaunchAgents/org.openhome.av.songcaster.plist" 8 | driverOld="/System/Library/Extensions/ohSongcaster.kext" 9 | prefPaneOld="/Library/PreferencePanes/ohSongcaster.prefPane" 10 | appOld="/Library/OpenHome/ohSongcaster.app" 11 | 12 | 13 | # stop the agent application - this script is run by the installer as root 14 | # whereas the agent application is being run in the user context - uses 15 | # sudo -u $USER to ensure that the agent is successfully unloaded from launchd 16 | 17 | if [ -e "$launchFile" ] 18 | then 19 | sudo -u "$USER" launchctl unload "$launchFile" 20 | fi 21 | 22 | 23 | # Do the above but for older versions that used the old name 24 | 25 | if [ -e "$launchFileOld" ] 26 | then 27 | sudo -u "$USER" launchctl unload "$launchFileOld" 28 | 29 | # remove the old file as this will not be overwritten 30 | rm -rf "$launchFileOld" 31 | fi 32 | 33 | 34 | 35 | # unload the driver - need to try it twice since the first time 36 | # usually gives errors due to a problem with the apple audio driver framework 37 | 38 | if [ -e "$driver" ] 39 | then 40 | kextunload "$driver" 41 | if [ $? != 0 ] 42 | then 43 | kextunload "$driver" 44 | fi 45 | 46 | # now delete the previous driver 47 | rm -rf "$driver" 48 | fi 49 | 50 | 51 | # Do the above but for older versions that used the old name 52 | 53 | if [ -e "$driverOld" ] 54 | then 55 | kextunload "$driverOld" 56 | if [ $? != 0 ] 57 | then 58 | kextunload "$driverOld" 59 | fi 60 | 61 | # now delete the old driver - this will not get overwritten 62 | rm -rf "$driverOld" 63 | fi 64 | 65 | 66 | # completely delete other old components that used the old name 67 | 68 | rm -rf "$prefPaneOld" 69 | rm -rf "$appOld" 70 | 71 | 72 | # if errors occurred, it will be because the app or driver is not loaded and running - that's fine 73 | exit 0 74 | 75 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/PcapDotNet/PcapDotNet.Analysis.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | PcapDotNet.Analysis 5 | 6 | 7 | 8 | 9 | Used to send PreEmptive Runtime Intelligence Data. 10 | 11 | 12 | 13 | 14 | Initializes the Runtime Intelligence and make sures it will be closed on ProcessExit. 15 | 16 | 17 | 18 | 19 | Counts a packet sent event. 20 | 21 | 22 | 23 | 24 | Counts a packet sent events according to the given . 25 | 26 | The number of packet sent event to count. 27 | 28 | 29 | 30 | Counts a packet received event. 31 | 32 | 33 | 34 | 35 | Counts a packet received events according to the given . 36 | 37 | The number of packet sent event to count. 38 | 39 | 40 | 41 | Choose whether to send PreEmptive Runtime Intelligence Data or not. 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /Wireshark/plugins/ohm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # CMakeLists.txt 2 | # 3 | # $Id: CMakeLists.txt 34243 2010-09-24 20:41:34Z guy $ 4 | # 5 | # Wireshark - Network traffic analyzer 6 | # By Gerald Combs 7 | # Copyright 1998 Gerald Combs 8 | # 9 | # This program is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License 11 | # as published by the Free Software Foundation; either version 2 12 | # of the License, or (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program; if not, write to the Free Software 21 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | # 23 | 24 | set(DISSECTOR_SRC 25 | packet-ohm.c 26 | ) 27 | 28 | set(PLUGIN_FILES 29 | plugin.c 30 | ${DISSECTOR_SRC} 31 | ) 32 | 33 | set(CLEAN_FILES 34 | ${PLUGIN_FILES} 35 | ) 36 | 37 | if (WERROR) 38 | set_source_files_properties( 39 | ${CLEAN_FILES} 40 | PROPERTIES 41 | COMPILE_FLAGS -Werror 42 | ) 43 | endif() 44 | 45 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 46 | 47 | register_dissector_files(plugin.c 48 | plugin 49 | ${DISSECTOR_SRC} 50 | ) 51 | 52 | add_library(ohm ${LINK_MODE_MODULE} 53 | ${PLUGIN_FILES} 54 | ) 55 | set_target_properties(ohm PROPERTIES PREFIX "") 56 | set_target_properties(ohm PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") 57 | 58 | target_link_libraries(ohm epan) 59 | 60 | install(TARGETS ohm 61 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP 62 | RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} 63 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} 64 | ) 65 | 66 | -------------------------------------------------------------------------------- /Wireshark/plugins/ohz/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # CMakeLists.txt 2 | # 3 | # $Id: CMakeLists.txt 34243 2010-09-24 20:41:34Z guy $ 4 | # 5 | # Wireshark - Network traffic analyzer 6 | # By Gerald Combs 7 | # Copyright 1998 Gerald Combs 8 | # 9 | # This program is free software; you can redistribute it and/or 10 | # modify it under the terms of the GNU General Public License 11 | # as published by the Free Software Foundation; either version 2 12 | # of the License, or (at your option) any later version. 13 | # 14 | # This program is distributed in the hope that it will be useful, 15 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | # GNU General Public License for more details. 18 | # 19 | # You should have received a copy of the GNU General Public License 20 | # along with this program; if not, write to the Free Software 21 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 22 | # 23 | 24 | set(DISSECTOR_SRC 25 | packet-ohz.c 26 | ) 27 | 28 | set(PLUGIN_FILES 29 | plugin.c 30 | ${DISSECTOR_SRC} 31 | ) 32 | 33 | set(CLEAN_FILES 34 | ${PLUGIN_FILES} 35 | ) 36 | 37 | if (WERROR) 38 | set_source_files_properties( 39 | ${CLEAN_FILES} 40 | PROPERTIES 41 | COMPILE_FLAGS -Werror 42 | ) 43 | endif() 44 | 45 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}) 46 | 47 | register_dissector_files(plugin.c 48 | plugin 49 | ${DISSECTOR_SRC} 50 | ) 51 | 52 | add_library(ohz ${LINK_MODE_MODULE} 53 | ${PLUGIN_FILES} 54 | ) 55 | set_target_properties(ohz PROPERTIES PREFIX "") 56 | set_target_properties(ohz PROPERTIES LINK_FLAGS "${WS_LINK_FLAGS}") 57 | 58 | target_link_libraries(ohz epan) 59 | 60 | install(TARGETS ohz 61 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} NAMELINK_SKIP 62 | RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} 63 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/@CPACK_PACKAGE_NAME@/plugins/${CPACK_PACKAGE_VERSION} 64 | ) 65 | 66 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Scripts/postflight: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | 4 | # define paths for setting permissions 5 | 6 | driver="/Library/OpenHome/ohSongcast.kext" 7 | 8 | folders=("/Library/OpenHome/ohSongcast.kext" 9 | "/Library/OpenHome/ohSongcast.app" 10 | "/Library/PreferencePanes/ohSongcast.prefPane") 11 | 12 | exefiles=("/Library/OpenHome/ohSongcast.app/Contents/MacOS/ohSongcast" 13 | "/Library/OpenHome/ohSongcast.app/Contents/MacOS/libohSongcast.so" 14 | "/Library/PreferencePanes/ohSongcast.prefPane/Contents/MacOS/ohSongcast") 15 | 16 | agent_path="/Library/LaunchAgents/org.openhome.av.songcast.plist" 17 | 18 | 19 | 20 | # ensure permissions for all files are correctly set 21 | 22 | for f in "${folders[@]}"; do 23 | chown -R root:wheel "$f" 24 | find "$f" -type d -exec chmod 0755 {} \; 25 | find "$f" -type f -exec chmod 0644 {} \; 26 | done 27 | 28 | for f in "${exefiles[@]}"; do 29 | chmod 0755 "$f" 30 | done 31 | 32 | chown root:wheel "$agent_path" 33 | chmod 0644 "$agent_path" 34 | 35 | 36 | # the kext is originally installed into a temporary location so that the permissions can be set 37 | # correctly before it is moved to the correct location - this is to get around problems with 38 | # packagemaker: 39 | # 1. using packagemaker without the "-m" option does not add the kext to the pkg with the correct 40 | # permissions (files have "rw-rw-r--" instead of "rw-r--r--") 41 | # 2. setting the permissions to be correct while the kext is in its correct place causes 42 | # occasional installer errors "System extension can not be used... installed improperly..." 43 | # 3. Using packagemaker with "-m" means that the files have to be set to the correct owner 44 | # and permissions before packagemaker is run - this means that files owned by root will 45 | # exist in the build tree and you have to enter passwords when building! No thanks. 46 | # 4. the solution to all this is to install the kext to a temporary location, change the permissions 47 | # to be correct in this script and then move it to the correct location 48 | mv "$driver" /System/Library/Extensions/ 49 | 50 | 51 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/PluginUdp.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using PcapDotNet.Core; 7 | 8 | namespace ohSongshark 9 | { 10 | class PluginUdp : Plugin 11 | { 12 | public PluginUdp() 13 | : base("Udp") 14 | { 15 | } 16 | 17 | public override void Run(PacketDevice aDevice) 18 | { 19 | using (PacketCommunicator communicator = aDevice.Open(100, PacketDeviceOpenAttributes.Promiscuous, 1000)) 20 | { 21 | // Compile and set the filter 22 | communicator.SetFilter("udp"); 23 | 24 | // Put the interface in statstics mode 25 | communicator.Mode = PacketCommunicatorMode.Statistics; 26 | 27 | // Start the main loop 28 | communicator.ReceiveStatistics(0, StatisticsHandler); 29 | } 30 | } 31 | 32 | private void StatisticsHandler(PacketSampleStatistics statistics) 33 | { 34 | // Current sample time 35 | DateTime currentTimestamp = statistics.Timestamp; 36 | 37 | // Previous sample time 38 | DateTime previousTimestamp = iLastTimestamp; 39 | 40 | // Set _lastTimestamp for the next iteration 41 | iLastTimestamp = currentTimestamp; 42 | 43 | // If there wasn't a previous sample than skip this iteration (it's the first iteration) 44 | if (previousTimestamp == DateTime.MinValue) 45 | return; 46 | 47 | // Calculate the delay from the last sample 48 | double delayInSeconds = (currentTimestamp - previousTimestamp).TotalSeconds; 49 | 50 | // Calculate bits per second 51 | double bitsPerSecond = statistics.AcceptedBytes * 8 / delayInSeconds; 52 | 53 | // Calculate packets per second 54 | double packetsPerSecond = statistics.AcceptedPackets / delayInSeconds; 55 | 56 | // Print timestamp and samples 57 | Console.WriteLine(statistics.Timestamp + " BPS: " + bitsPerSecond + " PPS: " + packetsPerSecond); 58 | } 59 | 60 | DateTime iLastTimestamp; 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | ifeq ($(release), 1) 4 | build_dir = Release 5 | else 6 | build_dir = Debug 7 | endif 8 | 9 | ifeq ($(mac-64),1) 10 | app_arch_dir = x86_64 11 | else 12 | app_arch_dir = i386 13 | endif 14 | 15 | 16 | 17 | export objdir = $(CURDIR)/Build/Obj/Mac/$(build_dir)/ 18 | export product_name = ohSongcast 19 | 20 | packagemaker=/Applications/Xcode.app/Contents/Applications/PackageMaker.app/Contents/MacOS/PackageMaker 21 | 22 | 23 | default : make_objdir_x86_64 make_objdir_i386 make_objdir_universal $(objdir)Installer/$(product_name).dmg 24 | 25 | 26 | .PHONY : clean 27 | clean : 28 | rm -rf $(objdir) 29 | 30 | make_objdir_x86_64 : 31 | mkdir -p $(objdir)x86_64/ 32 | 33 | make_objdir_i386: 34 | mkdir -p $(objdir)i386/ 35 | 36 | make_objdir_universal : 37 | mkdir -p $(objdir)Universal/ 38 | 39 | .PHONY : driver 40 | driver : 41 | $(MAKE) -C Driver arch=x86_64 42 | $(MAKE) -C Driver arch=i386 43 | $(MAKE) -C Driver arch=universal 44 | 45 | .PHONY : app 46 | app : 47 | $(MAKE) -C App 48 | 49 | .PHONY : prefs 50 | prefs : 51 | $(MAKE) -C Prefs 52 | 53 | $(objdir)Installer/$(product_name).pkg : driver app prefs 54 | mkdir -p $(objdir)Installer/Dst/Library/PreferencePanes/ 55 | mkdir -p $(objdir)Installer/Dst/Library/OpenHome/ 56 | mkdir -p $(objdir)Installer/Dst/Library/LaunchAgents/ 57 | cp -R $(objdir)Universal/Driver/$(product_name).kext $(objdir)Installer/Dst/Library/OpenHome/ 58 | cp -R $(objdir)x86_64/Prefs/$(product_name).prefPane $(objdir)Installer/Dst/Library/PreferencePanes/ 59 | cp -R $(objdir)$(app_arch_dir)/App/$(product_name).app $(objdir)Installer/Dst/Library/OpenHome/ 60 | cp LaunchAgent.plist $(objdir)Installer/Dst/Library/LaunchAgents/org.openhome.av.songcast.plist 61 | $(packagemaker) --root $(objdir)Installer/Dst --out $@ --scripts Scripts --info PkgInfo.plist --title ohSongcast --version 1.1.1 --no-relocate 62 | 63 | $(objdir)Installer/$(product_name).dmg : $(objdir)Installer/$(product_name).pkg Scripts/uninstall.tool 64 | mkdir -p $(objdir)Installer/DmgContents/ 65 | cp -R $(objdir)Installer/$(product_name).pkg $(objdir)Installer/DmgContents/Installer.pkg 66 | cp Scripts/uninstall.tool $(objdir)Installer/DmgContents/ 67 | hdiutil create -ov $@ -volname $(product_name) -fs HFS+ -srcfolder $(objdir)Installer/DmgContents/ 68 | 69 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/AudioDevice.cpp: -------------------------------------------------------------------------------- 1 | #include "AudioDevice.h" 2 | #include "AudioEngine.h" 3 | #include 4 | 5 | 6 | OSDefineMetaClassAndStructors(AudioDevice, IOAudioDevice); 7 | 8 | 9 | bool AudioDevice::initHardware(IOService* aProvider) 10 | { 11 | IOLog("Songcast AudioDevice[%p]::initHardware(%p) ...\n", this, aProvider); 12 | 13 | // initialise base class 14 | if (!IOAudioDevice::initHardware(aProvider)) { 15 | IOLog("Songcast AudioDevice[%p]::initHardware(%p) base class initHardware failed\n", this, aProvider); 16 | return false; 17 | } 18 | 19 | // set device names 20 | setDeviceName(BRANDING_AUDIODEVICE_NAME); 21 | setDeviceShortName(BRANDING_AUDIODEVICE_SHORTNAME); 22 | setManufacturerName(BRANDING_AUDIODEVICE_MANUFACTURERNAME); 23 | 24 | // create, initialise and activate the audio engine 25 | iEngine = new AudioEngine(); 26 | if (!iEngine) { 27 | IOLog("Songcast AudioDevice[%p]::initHardware(%p) failed to allocated engine\n", this, aProvider); 28 | return false; 29 | } 30 | 31 | if (!iEngine->init(0)) { 32 | IOLog("Songcast AudioDevice[%p]::initHardware(%p) failed to initialise engine\n", this, aProvider); 33 | iEngine->release(); 34 | iEngine = 0; 35 | return false; 36 | } 37 | 38 | // create the songcast socket 39 | iSongcast = new Songcast(); 40 | iEngine->SetSongcast(*iSongcast); 41 | iEngine->SetDescription(BRANDING_AUDIODEVICE_NAME); 42 | 43 | if (activateAudioEngine(iEngine) != kIOReturnSuccess) { 44 | IOLog("Songcast AudioDevice[%p]::initHardware(%p) failed to activate engine\n", this, aProvider); 45 | iEngine->release(); 46 | iEngine = 0; 47 | return false; 48 | } 49 | 50 | IOLog("Songcast AudioDevice[%p]::initHardware(%p) ok\n", this, aProvider); 51 | return true; 52 | } 53 | 54 | 55 | void AudioDevice::free() 56 | { 57 | IOLog("Songcast AudioDevice[%p]::free()\n", this); 58 | 59 | // release the engine 60 | if (iEngine) { 61 | iEngine->release(); 62 | iEngine = 0; 63 | } 64 | 65 | // destroy the songcast object 66 | if (iSongcast) { 67 | delete iSongcast; 68 | iSongcast = 0; 69 | } 70 | 71 | IOAudioDevice::free(); 72 | } 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/network.h: -------------------------------------------------------------------------------- 1 | /******************************************************************************** 2 | ** Copyright (c) 1998-2000 Microsoft Corporation. All Rights Reserved. 3 | ** 4 | ** Portions Copyright (c) 1998-1999 Intel Corporation 5 | ** 6 | ********************************************************************************/ 7 | 8 | #ifndef _NETWORK_H_ 9 | #define _NETWORK_H_ 10 | 11 | #pragma warning(push) 12 | #pragma warning(disable:4201) // nameless struct/union 13 | #pragma warning(disable:4214) // bit field types other than int 14 | 15 | #include 16 | 17 | #include 18 | #include 19 | 20 | #pragma warning(pop) 21 | 22 | #if (NTDDI_VERSION >= NTDDI_VISTA) 23 | 24 | /***************************************************************************** 25 | * Constants 26 | ***************************************************************************** 27 | */ 28 | 29 | /***************************************************************************** 30 | * Classes 31 | ***************************************************************************** 32 | */ 33 | 34 | class CSocketOhm; 35 | 36 | class CWinsock 37 | { 38 | friend class CSocketOhm; 39 | 40 | public: 41 | static CWinsock* Create(); 42 | static void Initialise(PSOCKADDR aSocket); 43 | static void Initialise(PSOCKADDR aSocket, ULONG aAddress, ULONG aPort); 44 | void Close(); 45 | 46 | private: 47 | static KSTART_ROUTINE Init; 48 | 49 | private: 50 | KEVENT iInitialised; 51 | WSK_CLIENT_DISPATCH iAppDispatch; 52 | WSK_REGISTRATION iRegistration; 53 | WSK_PROVIDER_NPI iProviderNpi; 54 | }; 55 | 56 | class CSocketOhm 57 | { 58 | static const ULONG kMediaLatencyMs = 100; 59 | 60 | public: 61 | static CSocketOhm* Create(CWinsock& aWsk); 62 | void SetTtl(TUint aValue); 63 | void SetMulticastIf(TUint aValue); 64 | void Send(WSK_BUF* aBuffer, SOCKADDR* aAddress, PIRP aIrp); 65 | void Close(); 66 | 67 | private: 68 | static IO_COMPLETION_ROUTINE CreateComplete; 69 | static IO_COMPLETION_ROUTINE BindComplete; 70 | static IO_COMPLETION_ROUTINE CloseComplete; 71 | static IO_COMPLETION_ROUTINE SetTtlComplete; 72 | static IO_COMPLETION_ROUTINE SetMulticastIfComplete; 73 | 74 | private: 75 | CWinsock* iWsk; 76 | KEVENT iInitialised; 77 | PWSK_SOCKET iSocket; 78 | }; 79 | 80 | #endif // (NTDDI_VERSION >= NTDDI_VISTA) 81 | 82 | #endif // _NETWORK_H_ 83 | 84 | 85 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Prefs/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | ifeq ($(release), 1) 4 | debug_specific_flags = -Os 5 | else 6 | debug_specific_flags = -O0 -mfix-and-continue 7 | endif 8 | 9 | 10 | arch_flags = -arch x86_64 11 | arch_linkflags = -arch x86_64 12 | outputdir = $(objdir)x86_64/Prefs/ 13 | contentsdir = $(outputdir)$(product_name).prefPane/Contents/ 14 | macosdir = $(outputdir)$(product_name).prefPane/Contents/MacOS/ 15 | resourcedir = $(outputdir)$(product_name).prefPane/Contents/Resources/ 16 | 17 | 18 | compiler = gcc 19 | compiler_flags = -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks $(debug_specific_flags) -Wreturn-type -Wunused-variable -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -gdwarf-2 -c -fobjc-gc -I../ 20 | objc_flags = -x objective-c -std=gnu99 $(compiler_flags) 21 | 22 | 23 | link = gcc 24 | linkflags1 = -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk 25 | linkflags2 = -mmacosx-version-min=10.6 -framework Cocoa -framework PreferencePanes 26 | 27 | ibtool = ibtool 28 | ibtool_flags = --errors --warnings --notices --output-format human-readable-text --sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk 29 | 30 | 31 | default : make_outputdir $(outputdir)$(product_name).prefPane 32 | 33 | 34 | make_outputdir : 35 | mkdir -p $(outputdir) 36 | mkdir -p $(macosdir) 37 | mkdir -p $(resourcedir) 38 | mkdir -p $(resourcedir)English.lproj/ 39 | 40 | 41 | $(outputdir)%.o : %.m 42 | $(compiler) $(arch_flags) $(objc_flags) $< -o $@ 43 | 44 | $(outputdir)Preferences.o : ../Preferences.m 45 | $(compiler) $(arch_flags) $(objc_flags) $< -o $@ 46 | 47 | objects = $(outputdir)SongcastPrefPane.o $(outputdir)Preferences.o 48 | 49 | $(outputdir)$(product_name) : $(objects) 50 | $(link) $(arch_linkflags) $(linkflags1) $(objects) $(linkflags2) -o $@ 51 | 52 | $(resourcedir)%.nib : %.xib 53 | $(ibtool) $(ibtool_flags) --compile $@ $< 54 | 55 | $(outputdir)$(product_name).prefPane : $(outputdir)$(product_name) $(resourcedir)English.lproj/SongcastPrefPane.nib Info.plist Icon.png IconLarge.png green.tiff red.tiff ../BundleIcon.icns 56 | cp $< $(macosdir) 57 | cp Icon.png $(resourcedir) 58 | cp IconLarge.png $(resourcedir) 59 | cp green.tiff $(resourcedir) 60 | cp red.tiff $(resourcedir) 61 | cp Info.plist $(contentsdir) 62 | cp ../BundleIcon.icns $(resourcedir)Icon.icns 63 | 64 | 65 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("ohSongshark")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("Microsoft")] 14 | [assembly: AssemblyProduct("ohSongshark")] 15 | [assembly: AssemblyCopyright("Copyright © Microsoft 2011")] 16 | [assembly: AssemblyTrademark("")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Resources; 3 | using System.Runtime.CompilerServices; 4 | using System.Runtime.InteropServices; 5 | using System.Windows; 6 | 7 | // General Information about an assembly is controlled through the following 8 | // set of attributes. Change these attribute values to modify the information 9 | // associated with an assembly. 10 | [assembly: AssemblyTitle("ohSoundcard")] 11 | [assembly: AssemblyDescription("")] 12 | [assembly: AssemblyConfiguration("")] 13 | [assembly: AssemblyCompany("OpenHome")] 14 | [assembly: AssemblyProduct("ohSoundcard")] 15 | [assembly: AssemblyCopyright("Copyright © OpenHome 2011")] 16 | [assembly: AssemblyTrademark("OpenHome")] 17 | [assembly: AssemblyCulture("")] 18 | 19 | // Setting ComVisible to false makes the types in this assembly not visible 20 | // to COM components. If you need to access a type in this assembly from 21 | // COM, set the ComVisible attribute to true on that type. 22 | [assembly: ComVisible(false)] 23 | 24 | //In order to begin building localizable applications, set 25 | //CultureYouAreCodingWith in your .csproj file 26 | //inside a . For example, if you are using US english 27 | //in your source files, set the to en-US. Then uncomment 28 | //the NeutralResourceLanguage attribute below. Update the "en-US" in 29 | //the line below to match the UICulture setting in the project file. 30 | 31 | //[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] 32 | 33 | 34 | [assembly: ThemeInfo( 35 | ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located 36 | //(used if a resource is not found in the page, 37 | // or application resource dictionaries) 38 | ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located 39 | //(used if a resource is not found in the page, 40 | // app, or any theme specific resource dictionaries) 41 | )] 42 | 43 | 44 | // Version information for an assembly consists of the following four values: 45 | // 46 | // Major Version 47 | // Minor Version 48 | // Build Number 49 | // Revision 50 | // 51 | // You can specify all the values or you can default the Build and Revision Numbers 52 | // by using the '*' as shown below: 53 | // [assembly: AssemblyVersion("1.0.*")] 54 | [assembly: AssemblyVersion("1.0.0.0")] 55 | [assembly: AssemblyFileVersion("1.0.0.0")] 56 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/AudioEngine.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_AUDIOENGINE 2 | #define HEADER_AUDIOENGINE 3 | 4 | #include 5 | #include 6 | #include "Songcast.h" 7 | 8 | 9 | 10 | // Class for the audio buffer - audio is sent over the network in blocks of fixed size 11 | class BlockBuffer 12 | { 13 | public: 14 | BlockBuffer(uint32_t aBlocks, uint32_t aBlockSamples, uint32_t aChannels, uint32_t aBitDepth); 15 | ~BlockBuffer(); 16 | 17 | void* Ptr() const { return iPtr; } 18 | uint32_t Bytes() const { return iBytes; } 19 | 20 | void* BlockPtr(uint32_t aBlockIndex) const { return (uint8_t*)iPtr + (aBlockIndex * iBlockBytes); } 21 | uint32_t BlockBytes() const { return iBlockBytes; } 22 | uint32_t Blocks() const { return iBlocks; } 23 | 24 | private: 25 | void* iPtr; 26 | const uint32_t iBytes; 27 | const uint32_t iBlockBytes; 28 | const uint32_t iBlocks; 29 | }; 30 | 31 | 32 | 33 | // Main class for the audio engine 34 | 35 | #define AudioEngine BRANDING_AUDIOENGINE_CLASSNAME 36 | 37 | class AudioEngine : public IOAudioEngine 38 | { 39 | OSDeclareDefaultStructors(AudioEngine); 40 | 41 | public: 42 | virtual bool init(OSDictionary* aProperties); 43 | virtual void free(); 44 | 45 | void SetSongcast(Songcast& aSongcast); 46 | void SetDescription(const char* aDescription); 47 | 48 | private: 49 | virtual bool initHardware(IOService* aProvider); 50 | virtual void stop(IOService* aProvider); 51 | 52 | virtual IOReturn performAudioEngineStart(); 53 | virtual IOReturn performAudioEngineStop(); 54 | virtual UInt32 getCurrentSampleFrame(); 55 | virtual IOReturn performFormatChange(IOAudioStream* aAudioStream, const IOAudioStreamFormat* aNewFormat, const IOAudioSampleRate* aNewSampleRate); 56 | virtual IOReturn clipOutputSamples(const void* aMixBuffer, void* aSampleBuffer, UInt32 aFirstSampleFrame, UInt32 aNumSampleFrames, const IOAudioStreamFormat* aFormat, IOAudioStream* aStream); 57 | 58 | static void TimerFired(OSObject* aOwner, IOTimerEventSource* aSender); 59 | void TimerFired(); 60 | 61 | uint32_t iCurrentBlock; 62 | 63 | // all timer related integers are 64-bit to avoid conversion errors between 32 and 64 bit 64 | IOTimerEventSource* iTimer; 65 | uint64_t iTimeZero; 66 | uint64_t iTimerFiredCount; 67 | uint64_t iTimerIntervalNs; 68 | uint64_t iTimestamp; 69 | bool iAudioStopping; 70 | 71 | BlockBuffer* iBuffer; 72 | Songcast* iSongcast; 73 | const SongcastFormat* iCurrentFormat; 74 | }; 75 | 76 | 77 | #endif // HEADER_AUDIOENGINE 78 | 79 | 80 | -------------------------------------------------------------------------------- /ohSongcast/Windows/SoundcardDriver.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_SOUNDCARDDRIVER 2 | #define HEADER_SOUNDCARDDRIVER 3 | 4 | #define INITGUID // For PKEY_AudioEndpoint_GUID 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "../../Ohm.h" 12 | #include "../../OhmSenderDriver.h" 13 | 14 | namespace OpenHome { 15 | namespace Av { 16 | 17 | class Songcast; 18 | 19 | class AudioEndpoint 20 | { 21 | public: 22 | AudioEndpoint(); 23 | explicit AudioEndpoint(LPCWSTR aId); 24 | AudioEndpoint(IMMDeviceEnumerator *aDeviceEnumerator); 25 | 26 | TBool operator==(const AudioEndpoint &aOther) const; 27 | TBool operator!=(const AudioEndpoint &aOther) const; 28 | TBool IsValid() const; 29 | 30 | void Set(LPCWSTR aId); 31 | void Set(const AudioEndpoint& aEndpoint); 32 | void SetAsDefault(); 33 | void SetEnabled(TBool aEnabled); 34 | 35 | private: 36 | WCHAR iId[100]; 37 | }; 38 | 39 | class OhmSenderDriverWindows : public IOhmSenderDriver, public IMMNotificationClient 40 | { 41 | public: 42 | OhmSenderDriverWindows(const char* aDomain, const char* aManufacturer, TBool aEnabled); 43 | void SetSongcast(Songcast& aSongcast); 44 | ~OhmSenderDriverWindows(); 45 | private: 46 | TBool FindDriver(const char* aDomain); 47 | TBool FindEndpoint(const char* aManufacturer); 48 | 49 | // IOhmSenderDriver 50 | virtual void SetEnabled(TBool aValue); 51 | virtual void SetEndpoint(const Endpoint& aEndpoint, TIpAddress aAdapter); 52 | virtual void SetActive(TBool aValue); 53 | virtual void SetTtl(TUint aValue); 54 | virtual void SetLatency(TUint aValue); 55 | virtual void SetTrackPosition(TUint64 aSampleStart, TUint64 aSamplesTotal); 56 | virtual void Resend(const Brx& aFrames); 57 | 58 | // IMMNotificationClient 59 | ULONG STDCALL AddRef(); 60 | ULONG STDCALL Release(); 61 | HRESULT STDCALL QueryInterface(REFIID aId, void** aInterface); 62 | 63 | HRESULT STDCALL OnDefaultDeviceChanged(EDataFlow aFlow, ERole aRole, LPCWSTR aDeviceId); 64 | HRESULT STDCALL OnDeviceAdded(LPCWSTR aDeviceId); 65 | HRESULT STDCALL OnDeviceRemoved(LPCWSTR aDeviceId); 66 | HRESULT STDCALL OnDeviceStateChanged(LPCWSTR aDeviceId, DWORD aNewState); 67 | HRESULT STDCALL OnPropertyValueChanged(LPCWSTR aDeviceId, const PROPERTYKEY akey); 68 | 69 | private: 70 | HANDLE iHandle; 71 | AudioEndpoint iSongcastEndpoint; 72 | AudioEndpoint iPreviousEndpoint; 73 | TBool iEnabled; 74 | ULONG iRefCount; 75 | Songcast* iSongcast; 76 | IMMDeviceEnumerator* iDeviceEnumerator; 77 | }; 78 | 79 | } // namespace Av 80 | } // namespace OpenHome 81 | 82 | #endif // HEADER_SOUNDCARDDRIVER 83 | 84 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/basetopo.h: -------------------------------------------------------------------------------- 1 | 2 | /*++ 3 | 4 | Copyright (c) 1997-2000 Microsoft Corporation All Rights Reserved 5 | 6 | Module Name: 7 | 8 | basetopo.h 9 | 10 | Abstract: 11 | 12 | Declaration of topology miniport. 13 | 14 | --*/ 15 | 16 | #ifndef _MSVAD_BASETOPO_H_ 17 | #define _MSVAD_BASETOPO_H_ 18 | 19 | //============================================================================= 20 | // Classes 21 | //============================================================================= 22 | 23 | /////////////////////////////////////////////////////////////////////////////// 24 | // CMiniportTopologyMSVAD 25 | // 26 | 27 | class CMiniportTopologyMSVAD 28 | { 29 | protected: 30 | PADAPTERCOMMON m_AdapterCommon; // Adapter common object. 31 | PPCFILTER_DESCRIPTOR m_FilterDescriptor; // Filter descriptor. 32 | PPORTTOPOLOGY m_Port; // Topology Port 33 | 34 | public: 35 | CMiniportTopologyMSVAD(); 36 | ~CMiniportTopologyMSVAD(); 37 | 38 | NTSTATUS GetDescription 39 | ( 40 | OUT PPCFILTER_DESCRIPTOR * Description 41 | ); 42 | 43 | NTSTATUS DataRangeIntersection 44 | ( 45 | IN ULONG PinId, 46 | IN PKSDATARANGE ClientDataRange, 47 | IN PKSDATARANGE MyDataRange, 48 | IN ULONG OutputBufferLength, 49 | OUT PVOID ResultantFormat OPTIONAL, 50 | OUT PULONG ResultantFormatLength 51 | ); 52 | 53 | NTSTATUS Init 54 | ( 55 | IN PUNKNOWN UnknownAdapter, 56 | IN PPORTTOPOLOGY Port_ 57 | ); 58 | 59 | // PropertyHandlers. 60 | NTSTATUS PropertyHandlerBasicSupportVolume 61 | ( 62 | IN PPCPROPERTY_REQUEST PropertyRequest 63 | ); 64 | 65 | NTSTATUS PropertyHandlerCpuResources 66 | ( 67 | IN PPCPROPERTY_REQUEST PropertyRequest 68 | ); 69 | 70 | NTSTATUS PropertyHandlerGeneric 71 | ( 72 | IN PPCPROPERTY_REQUEST PropertyRequest 73 | ); 74 | 75 | NTSTATUS PropertyHandlerMute 76 | ( 77 | IN PPCPROPERTY_REQUEST PropertyRequest 78 | ); 79 | 80 | NTSTATUS PropertyHandlerMuxSource 81 | ( 82 | IN PPCPROPERTY_REQUEST PropertyRequest 83 | ); 84 | 85 | NTSTATUS PropertyHandlerVolume 86 | ( 87 | IN PPCPROPERTY_REQUEST PropertyRequest 88 | ); 89 | 90 | NTSTATUS PropertyHandlerDevSpecific 91 | ( 92 | IN PPCPROPERTY_REQUEST PropertyRequest 93 | ); 94 | }; 95 | 96 | #endif 97 | 98 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ohSongcast 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | org.openhome.av.songcast 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ohSongcast 17 | CFBundlePackageType 18 | KEXT 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | IOKitPersonalities 26 | 27 | ohSongcast 28 | 29 | IOUserClientClass 30 | org_openhome_av_songcast_userclient 31 | IOResourceMatch 32 | IOKit 33 | IOMatchCategory 34 | org_openhome_av_songcast 35 | IOProviderClass 36 | IOResources 37 | IOClass 38 | org_openhome_av_songcast 39 | CFBundleIdentifier 40 | org.openhome.av.songcast 41 | 42 | 43 | OSBundleLibraries_x86_64 44 | 45 | com.apple.iokit.IOAudioFamily 46 | 1.8.3f2 47 | com.apple.kpi.bsd 48 | 10.8 49 | com.apple.kpi.iokit 50 | 10.8 51 | com.apple.kpi.libkern 52 | 10.8 53 | com.apple.kpi.mach 54 | 10.8 55 | 56 | OSBundleLibraries_i386 57 | 58 | com.apple.iokit.IOAudioFamily 59 | 1.8.3f2 60 | com.apple.kpi.bsd 61 | 10.8 62 | com.apple.kpi.iokit 63 | 10.8 64 | com.apple.kpi.libkern 65 | 10.8 66 | com.apple.kpi.mach 67 | 10.8 68 | 69 | OSBundleLibraries_ppc 70 | 71 | com.apple.kpi.bsd 72 | 10.8 73 | com.apple.kpi.iokit 74 | 10.8 75 | com.apple.kpi.libkern 76 | 10.8 77 | com.apple.kpi.mach 78 | 10.8 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/AudioUserClient.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_AUDIOUSERCLIENT 2 | #define HEADER_AUDIOUSERCLIENT 3 | 4 | #include 5 | #include 6 | #include "AudioDevice.h" 7 | 8 | 9 | // Implementation of the user client class for the audio driver. 10 | 11 | #define AudioUserClient BRANDING_AUDIOUSERCLIENT_CLASSNAME 12 | 13 | class AudioUserClient : public IOUserClient 14 | { 15 | OSDeclareDefaultStructors(AudioUserClient); 16 | 17 | private: 18 | virtual bool start(IOService* aProvider); 19 | virtual void stop(IOService* aProvider); 20 | virtual IOReturn clientClose(); 21 | virtual IOReturn clientDied(); 22 | virtual IOReturn externalMethod(uint32_t aSelector, IOExternalMethodArguments* aArgs, IOExternalMethodDispatch* aDispatch, OSObject* aTarget, void* aReference); 23 | 24 | typedef IOReturn (*Action)(AudioUserClient* aClient, void* aArg1, void* aArg2, void* aArg3); 25 | IOReturn DeviceOk(); 26 | IOReturn RunAction(Action aAction, void* aArg1 = 0, void* aArg2 = 0, void* aArg3 = 0); 27 | static IOReturn ActionCommandGate(OSObject* aOwner, void* aArg1, void* aArg2, void* aArg3, void* aArg4); 28 | 29 | IOReturn Open(); 30 | IOReturn Close(); 31 | IOReturn SetActive(uint64_t aActive); 32 | IOReturn SetEndpoint(uint64_t aIpAddress, uint64_t aPort, uint64_t aAdapter); 33 | IOReturn SetTtl(uint64_t aTtl); 34 | IOReturn SetLatencyMs(uint64_t aLatencyMs); 35 | IOReturn Resend(uint64_t aFrameCount, const uint32_t* aFrames); 36 | 37 | static IOReturn ActionOpen(AudioUserClient* aClient, void* aArg1, void* aArg2, void* aArg3); 38 | static IOReturn ActionClose(AudioUserClient* aClient, void* aArg1, void* aArg2, void* aArg3); 39 | static IOReturn ActionSetActive(AudioUserClient* aClient, void* aArg1, void* aArg2, void* aArg3); 40 | static IOReturn ActionSetEndpoint(AudioUserClient* aClient, void* aArg1, void* aArg2, void* aArg3); 41 | static IOReturn ActionSetTtl(AudioUserClient* aClient, void* aArg1, void* aArg2, void* aArg3); 42 | static IOReturn ActionSetLatencyMs(AudioUserClient* aClient, void* aArg1, void* aArg2, void* aArg3); 43 | static IOReturn ActionResend(AudioUserClient* aClient, void* aArg1, void* aArg2, void* aArg3); 44 | 45 | IOReturn DoOpen(); 46 | IOReturn DoClose(); 47 | IOReturn DoSetActive(uint64_t aActive); 48 | IOReturn DoSetEndpoint(uint64_t aIpAddress, uint64_t aPort, uint64_t aAdapter); 49 | IOReturn DoSetTtl(uint64_t aTtl); 50 | IOReturn DoSetLatencyMs(uint64_t aLatencyMs); 51 | IOReturn DoResend(uint64_t aFrameCount, const uint32_t* aFrames); 52 | 53 | friend class AudioUserClientDispatcher; 54 | AudioDevice* iDevice; 55 | IOWorkLoop* iWorkLoop; 56 | IOCommandGate* iCommandGate; 57 | }; 58 | 59 | 60 | #endif // HEADER_AUDIOUSERCLIENT 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/OpenHome/Buffer.inl: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_BUFFER_INL 2 | #define HEADER_BUFFER_INL 3 | 4 | //Bwx 5 | 6 | inline OpenHome::Brx::Brx(TUint aBytes) : iBytes(aBytes) 7 | { 8 | } 9 | 10 | inline OpenHome::Brx::Brx(const Brx& aBrx) : iBytes(aBrx.Bytes()) 11 | { 12 | } 13 | 14 | inline TUint OpenHome::Brx::Bytes() const 15 | { 16 | return iBytes; 17 | } 18 | 19 | inline const TByte& OpenHome::Brx::operator[](TUint aByteIndex) const 20 | { 21 | return At(aByteIndex); 22 | } 23 | 24 | inline TBool OpenHome::Brx::operator==(const Brx& aBrx) const 25 | { 26 | return Equals(aBrx); 27 | } 28 | 29 | inline TBool OpenHome::Brx::operator!=(const Brx& aBrx) const 30 | { 31 | return !Equals(aBrx); 32 | } 33 | 34 | //Brn 35 | 36 | inline OpenHome::Brn::Brn() : Brx(0), iPtr(0) 37 | { 38 | } 39 | 40 | inline OpenHome::Brn::Brn(const Brx& aBrx) : Brx(aBrx), iPtr(aBrx.Ptr()) 41 | { 42 | } 43 | 44 | inline OpenHome::Brn::Brn(const Brn& aBrn) : Brx(aBrn), iPtr(aBrn.Ptr()) 45 | { 46 | } 47 | 48 | inline OpenHome::Brn::Brn(const TByte* aPtr, TUint aBytes) : Brx(aBytes), iPtr(aPtr) 49 | { 50 | } 51 | 52 | inline void OpenHome::Brn::Set(const Brx& aBrx) 53 | { 54 | iPtr = aBrx.Ptr(); 55 | iBytes = aBrx.Bytes(); 56 | } 57 | 58 | inline void OpenHome::Brn::Set(const TByte* aPtr, TUint aBytes) 59 | { 60 | iPtr = aPtr; 61 | iBytes = aBytes; 62 | } 63 | 64 | //Bwx 65 | 66 | inline void OpenHome::Bwx::Append(TChar aChar) 67 | { 68 | Append(((TByte*)&aChar), 1); 69 | } 70 | 71 | inline void OpenHome::Bwx::Append(TByte aByte) 72 | { 73 | Append((&aByte), 1); 74 | } 75 | 76 | inline void OpenHome::Bwx::FillZ() 77 | { 78 | Fill(0); 79 | } 80 | 81 | inline TUint OpenHome::Bwx::MaxBytes() const 82 | { 83 | return iMaxBytes; 84 | } 85 | 86 | inline TByte& OpenHome::Bwx::operator[](TUint aByteIndex) 87 | { 88 | return At(aByteIndex); 89 | } 90 | 91 | //Bws 92 | 93 | template inline OpenHome::Bws::Bws() : Bwx(0, S) 94 | { 95 | } 96 | 97 | template inline OpenHome::Bws::Bws(const TChar* aStr) 98 | : Bwx(0,S) 99 | { 100 | Replace(aStr); 101 | } 102 | 103 | template inline OpenHome::Bws::Bws(const TByte* aPtr, TUint aBytes) 104 | : Bwx(0,S) 105 | { 106 | Replace(aPtr, aBytes); 107 | } 108 | 109 | template inline OpenHome::Bws::Bws(const Brx& aBuf) : Bwx(0,S) 110 | { 111 | Replace(aBuf); 112 | } 113 | 114 | template inline OpenHome::Bws::Bws(TUint aBytes) : Bwx(aBytes, S) 115 | { 116 | } 117 | 118 | template inline OpenHome::Bws::Bws(const Bws& aBuf) : Bwx(0,S) 119 | { 120 | Replace(aBuf); 121 | } 122 | 123 | template inline const TByte* OpenHome::Bws::Ptr() const 124 | { 125 | return iBuf; 126 | } 127 | 128 | 129 | #endif //HEADER_BUFFER_INL 130 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/hw.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) 1997-2000 Microsoft Corporation All Rights Reserved 4 | 5 | Module Name: 6 | 7 | hw.h 8 | 9 | Abstract: 10 | 11 | Declaration of MSVAD HW class. 12 | MSVAD HW has an array for storing mixer and volume settings 13 | for the topology. 14 | 15 | --*/ 16 | 17 | #ifndef _MSVAD_HW_H_ 18 | #define _MSVAD_HW_H_ 19 | 20 | //============================================================================= 21 | // Defines 22 | //============================================================================= 23 | // BUGBUG we should dynamically allocate this... 24 | #define MAX_TOPOLOGY_NODES 20 25 | 26 | //============================================================================= 27 | // Classes 28 | //============================================================================= 29 | /////////////////////////////////////////////////////////////////////////////// 30 | // CMSVADHW 31 | // This class represents virtual MSVAD HW. An array representing volume 32 | // registers and mute registers. 33 | 34 | class CMSVADHW 35 | { 36 | public: 37 | protected: 38 | BOOL m_MuteControls[MAX_TOPOLOGY_NODES]; 39 | LONG m_VolumeControls[MAX_TOPOLOGY_NODES]; 40 | ULONG m_ulMux; // Mux selection 41 | BOOL m_bDevSpecific; 42 | INT m_iDevSpecific; 43 | UINT m_uiDevSpecific; 44 | 45 | private: 46 | 47 | public: 48 | CMSVADHW(); 49 | 50 | void MixerReset(); 51 | BOOL bGetDevSpecific(); 52 | void bSetDevSpecific 53 | ( 54 | IN BOOL bDevSpecific 55 | ); 56 | INT iGetDevSpecific(); 57 | void iSetDevSpecific 58 | ( 59 | IN INT iDevSpecific 60 | ); 61 | UINT uiGetDevSpecific(); 62 | void uiSetDevSpecific 63 | ( 64 | IN UINT uiDevSpecific 65 | ); 66 | BOOL GetMixerMute 67 | ( 68 | IN ULONG ulNode 69 | ); 70 | void SetMixerMute 71 | ( 72 | IN ULONG ulNode, 73 | IN BOOL fMute 74 | ); 75 | ULONG GetMixerMux(); 76 | void SetMixerMux 77 | ( 78 | IN ULONG ulNode 79 | ); 80 | LONG GetMixerVolume 81 | ( 82 | IN ULONG ulNode, 83 | IN LONG lChannel 84 | ); 85 | void SetMixerVolume 86 | ( 87 | IN ULONG ulNode, 88 | IN LONG lChannel, 89 | IN LONG lVolume 90 | ); 91 | 92 | protected: 93 | private: 94 | }; 95 | typedef CMSVADHW *PCMSVADHW; 96 | 97 | #endif 98 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongshark/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.237 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace ohSongshark.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ohSongshark.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/msvad.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) 1997-2000 Microsoft Corporation All Rights Reserved 4 | 5 | Module Name: 6 | 7 | Msvad.h 8 | 9 | Abstract: 10 | 11 | Header file for common stuff. 12 | 13 | --*/ 14 | 15 | #ifndef _MSVAD_H_ 16 | #define _MSVAD_H_ 17 | 18 | #include 19 | #include 20 | #include 21 | #include "kshelper.h" 22 | 23 | //============================================================================= 24 | // Defines 25 | //============================================================================= 26 | 27 | // Pool tag used for MSVAD allocations 28 | #define OHSOUNDCARD_POOLTAG 'OHSC' 29 | 30 | // Debug module name 31 | #define STR_MODULENAME "OHSOUNDCARD: " 32 | 33 | // Debug utility macros 34 | #define D_FUNC 4 35 | #define D_BLAB DEBUGLVL_BLAB 36 | #define D_VERBOSE DEBUGLVL_VERBOSE 37 | #define D_TERSE DEBUGLVL_TERSE 38 | #define D_ERROR DEBUGLVL_ERROR 39 | #define DPF _DbgPrintF 40 | #define DPF_ENTER(x) DPF(D_FUNC, x) 41 | 42 | // Channel orientation 43 | #define CHAN_LEFT 0 44 | #define CHAN_RIGHT 1 45 | #define CHAN_MASTER (-1) 46 | 47 | // Dma Settings. 48 | #define DMA_BUFFER_SIZE 0x16000 49 | 50 | #define KSPROPERTY_TYPE_ALL KSPROPERTY_TYPE_BASICSUPPORT | \ 51 | KSPROPERTY_TYPE_GET | \ 52 | KSPROPERTY_TYPE_SET 53 | 54 | // Specific node numbers for vadsampl.sys 55 | #define DEV_SPECIFIC_VT_BOOL 9 56 | #define DEV_SPECIFIC_VT_I4 10 57 | #define DEV_SPECIFIC_VT_UI4 11 58 | 59 | //============================================================================= 60 | // Typedefs 61 | //============================================================================= 62 | 63 | // Connection table for registering topology/wave bridge connection 64 | typedef struct _PHYSICALCONNECTIONTABLE 65 | { 66 | ULONG ulTopologyIn; 67 | ULONG ulTopologyOut; 68 | ULONG ulWaveIn; 69 | ULONG ulWaveOut; 70 | } PHYSICALCONNECTIONTABLE, *PPHYSICALCONNECTIONTABLE; 71 | 72 | //============================================================================= 73 | // Externs 74 | //============================================================================= 75 | 76 | // Physical connection table. Defined in mintopo.cpp for each sample 77 | extern PHYSICALCONNECTIONTABLE TopologyPhysicalConnections; 78 | 79 | // Generic topology handler 80 | extern NTSTATUS PropertyHandler_Topology 81 | ( 82 | IN PPCPROPERTY_REQUEST PropertyRequest 83 | ); 84 | 85 | // Generic wave port handler 86 | extern NTSTATUS PropertyHandler_Wave 87 | ( 88 | IN PPCPROPERTY_REQUEST PropertyRequest 89 | ); 90 | 91 | // Default WaveFilter automation table. 92 | // Handles the GeneralComponentId request. 93 | extern NTSTATUS PropertyHandler_WaveFilter 94 | ( 95 | IN PPCPROPERTY_REQUEST PropertyRequest 96 | ); 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/Makefile: -------------------------------------------------------------------------------- 1 | 2 | 3 | ifeq ($(release), 1) 4 | debug_specific_flags = -Os -mdynamic-no-pic -fvisibility=hidden 5 | libohSongcast = ../../../Build/Obj/Mac-x86/Release/libohSongcast.so 6 | else 7 | debug_specific_flags = -O0 -mfix-and-continue 8 | libohSongcast = ../../../Build/Obj/Mac-x86/Debug/libohSongcast.so 9 | endif 10 | 11 | 12 | ifeq ($(mac-64),1) 13 | arch_flags = -arch x86_64 14 | arch_linkflags = -arch x86_64 15 | outputdir = $(objdir)x86_64/App/ 16 | else 17 | arch_flags = -m32 18 | arch_linkflags = -m32 19 | outputdir = $(objdir)i386/App/ 20 | endif 21 | 22 | contentsdir = $(outputdir)$(product_name).app/Contents/ 23 | macosdir = $(outputdir)$(product_name).app/Contents/MacOS/ 24 | resourcedir = $(outputdir)$(product_name).app/Contents/Resources/ 25 | 26 | 27 | compiler = gcc 28 | compiler_flags = -fmessage-length=0 -pipe -Wno-trigraphs -fpascal-strings -fasm-blocks $(debug_specific_flags) -Wreturn-type -Wunused-variable -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk -mmacosx-version-min=10.6 -gdwarf-2 -I../../../../ohnet/Build/Include -I../../../../ohTopology/build/Include -I../ -c 29 | objc_flags = -x objective-c -std=gnu99 $(compiler_flags) 30 | objcc_flags = -x objective-c++ -fvisibility-inlines-hidden $(compiler_flags) 31 | 32 | 33 | link = g++ 34 | linkflags1 = -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk 35 | linkflags2 = -mmacosx-version-min=10.6 -framework Cocoa -framework SystemConfiguration 36 | 37 | ibtool = ibtool 38 | ibtool_flags = --errors --warnings --notices --output-format human-readable-text --sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk 39 | 40 | 41 | default : make_outputdir $(outputdir)$(product_name).app 42 | 43 | 44 | make_outputdir : 45 | mkdir -p $(outputdir) 46 | mkdir -p $(macosdir) 47 | mkdir -p $(resourcedir) 48 | mkdir -p $(resourcedir)English.lproj/ 49 | 50 | 51 | $(outputdir)%.o : %.m 52 | $(compiler) $(arch_flags) $(objc_flags) $< -o $@ 53 | 54 | $(outputdir)%.o : %.mm 55 | $(compiler) $(arch_flags) $(objcc_flags) $< -o $@ 56 | 57 | $(outputdir)Preferences.o : ../Preferences.m 58 | $(compiler) $(arch_flags) $(objc_flags) $< -o $@ 59 | 60 | objects = $(outputdir)main.o $(outputdir)SongcastAppDelegate.o $(outputdir)WindowUpdates.o $(outputdir)Model.o $(outputdir)ModelSongcast.o $(outputdir)Preferences.o $(outputdir)ReceiverList.o $(outputdir)Receiver.o $(outputdir)SubnetList.o $(outputdir)CrashLogging.o $(outputdir)AutoUpdate.o 61 | 62 | $(outputdir)$(product_name) : $(objects) 63 | $(link) $(arch_linkflags) $(linkflags1) $(objects) $(libohSongcast) $(linkflags2) -o $@ 64 | 65 | $(resourcedir)%.nib : %.xib 66 | $(ibtool) $(ibtool_flags) --compile $@ $< 67 | 68 | $(outputdir)$(product_name).app : $(outputdir)$(product_name) $(resourcedir)English.lproj/MainMenu.nib $(resourcedir)English.lproj/WindowUpdates.nib Info.plist MenuIconOff.png MenuIconOn.png SenderIcon.png ../BundleIcon.icns $(libohSongcast) 69 | cp $< $(macosdir) 70 | cp $(libohSongcast) $(macosdir) 71 | cp MenuIconOff.png $(resourcedir) 72 | cp MenuIconOn.png $(resourcedir) 73 | cp SenderIcon.png $(resourcedir) 74 | cp ../BundleIcon.icns $(resourcedir)Icon.icns 75 | cp Info.plist $(contentsdir) 76 | 77 | 78 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/Resources/ohLogo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 38 | 40 | 42 | 43 | 45 | image/svg+xml 46 | 48 | 49 | 50 | 51 | 52 | 55 | 60 | 65 | 70 | 75 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Prefs/SongcastPrefPane.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | #import "Preferences.h" 4 | 5 | 6 | // Receiver class for data displayed in the table view 7 | @interface Receiver : NSObject 8 | { 9 | NSString* udn; 10 | NSString* title; 11 | bool selected; 12 | EReceiverState status; 13 | } 14 | 15 | @property (copy) NSString* udn; 16 | @property (copy) NSString* title; 17 | @property (assign) bool selected; 18 | @property (assign) EReceiverState status; 19 | 20 | - (id) initWithPref:(PrefReceiver*)aPref uniqueInRoom:(bool)aUnique; 21 | 22 | @end 23 | 24 | 25 | // Main class for the preference pane 26 | @interface SongcastPrefPane : NSPreferencePane 27 | { 28 | IBOutlet NSButton* buttonOnOff; 29 | IBOutlet NSTextField* textAbout; 30 | IBOutlet NSTextField* textDescription; 31 | IBOutlet NSButton* buttonShowInStatusBar; 32 | IBOutlet NSTableView* tableViewReceiverList; 33 | IBOutlet NSBox* boxGettingStarted; 34 | IBOutlet NSBox* boxMain; 35 | IBOutlet NSTextField* textStep1Text; 36 | IBOutlet NSMatrix* buttonSongcastMode; 37 | IBOutlet NSTextField* textMulticastChannel; 38 | IBOutlet NSTextField* textLatencyMs; 39 | IBOutlet NSSlider* sliderLatencyMs; 40 | IBOutlet NSPopUpButton* buttonNetworkAdapter; 41 | IBOutlet NSButton* buttonAutoUpdates; 42 | IBOutlet NSButton* buttonBeta; 43 | 44 | Preferences* iPreferences; 45 | NSArray* iReceiverList; 46 | NSArray* iSubnetList; 47 | } 48 | 49 | @property (assign) NSButton* buttonOnOff; 50 | @property (assign) NSTextField* textAbout; 51 | @property (assign) NSTextField* textDescription; 52 | @property (assign) NSButton* buttonShowInStatusBar; 53 | @property (assign) NSTableView* tableViewReceiverList; 54 | @property (assign) NSBox* boxGettingStarted; 55 | @property (assign) NSBox* boxMain; 56 | @property (assign) NSTextField* textStep1Text; 57 | @property (assign) NSMatrix* buttonSongcastMode; 58 | @property (assign) NSTextField* textMulticastChannel; 59 | @property (assign) NSTextField* textLatencyMs; 60 | @property (assign) NSSlider* sliderLatencyMs; 61 | @property (assign) NSPopUpButton* buttonNetworkAdapter; 62 | @property (assign) NSButton* buttonAutoUpdates; 63 | @property (assign) NSButton* buttonBeta; 64 | 65 | - (void) mainViewDidLoad; 66 | - (void) updateButtonOnOff; 67 | - (IBAction) buttonOnOffClicked:(id)aSender; 68 | - (IBAction) buttonRefreshClicked:(id)aSender; 69 | - (IBAction) buttonReconnectClicked:(id)aSender; 70 | - (IBAction) buttonShowInStatusBarClicked:(id)aSender; 71 | - (IBAction) buttonHelpClicked:(id)aSender; 72 | - (IBAction) buttonWizardClicked:(id)aSender; 73 | - (IBAction) buttonSongcastModeClicked:(id)aSender; 74 | - (IBAction) buttonMulticastChannelClicked:(id)aSender; 75 | - (IBAction) sliderLatencyMsChanged:(id)aSender; 76 | - (IBAction) buttonNetworkAdapterClicked:(id)aSender; 77 | - (IBAction) buttonAutoUpdatesClicked:(id)aSender; 78 | - (IBAction) buttonBetaClicked:(id)aSender; 79 | - (IBAction) buttonCheckForUpdatesClicked:(id)aSender; 80 | - (void) preferenceEnabledChanged:(NSNotification*)aNotification; 81 | - (void) preferenceReceiverListChanged:(NSNotification*)aNotification; 82 | - (void) preferenceSubnetListChanged:(NSNotification*)aNotification; 83 | 84 | @end 85 | 86 | 87 | // Declaration of custom table cell 88 | @interface CellReceiver : NSTextFieldCell 89 | { 90 | } 91 | 92 | @end 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /Windows.mak: -------------------------------------------------------------------------------- 1 | # Makefile for Windows 2 | # 3 | 4 | !if "$(release)"=="1" 5 | link_flag_debug = 6 | debug_specific_cflags = /MT /Ox 7 | debug_specific_csflags = 8 | build_dir = Release 9 | !else 10 | link_flag_debug = /debug 11 | debug_specific_cflags = /MTd /Zi /Od /RTC1 12 | debug_specific_csflags = /debug 13 | build_dir = Debug 14 | !endif 15 | 16 | # Macros used by Common.mak 17 | 18 | ar = lib /nologo /out:$(objdir) 19 | cflags = $(debug_specific_cflags) /W4 /WX /EHsc /FR$(objdir) -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE -D_CRT_SECURE_NO_WARNINGS 20 | ohnetdir = ..\ohNet\Build\Obj\Windows\$(build_dir)^\ 21 | ohnetgenerateddir = ..\ohNetGenerated\Build\Obj\Windows\$(build_dir)^\ 22 | ohtopologydir = ..\ohTopology\build^\ 23 | ohnetmondir = ..\ohNetmon\build^\ 24 | objdirbare = Build\Obj\Windows\$(build_dir) 25 | objdir = $(objdirbare)^\ 26 | inc_build = Build\Include 27 | includes = -I..\ohNet\Build\Include -I..\ohNetGenerated\Build\Include -I..\ohTopology\build\Include 28 | bundle_build = Build\Bundles 29 | osdir = Windows 30 | objext = obj 31 | libprefix = 32 | libext = lib 33 | exeext = exe 34 | compiler = cl /nologo /Fo$(objdir) 35 | link = link /nologo $(link_flag_debug) /SUBSYSTEM:CONSOLE /map Ws2_32.lib Iphlpapi.lib Dbghelp.lib /incremental:no 36 | linkoutput = /out: 37 | dllprefix = 38 | dllext = dll 39 | link_dll = link /nologo $(link_flag_debug) /map Ws2_32.lib Iphlpapi.lib Dbghelp.lib /dll 40 | link_dll_service = link /nologo $(link_flag_debug) /map $(objdir)ohNet.lib Ws2_32.lib Iphlpapi.lib Dbghelp.lib /dll 41 | csplatform = x86 42 | csharp = csc /nologo /platform:$(csplatform) $(debug_specific_csflags) 43 | publiccsdir = Public\Cs^\csharp 44 | dirsep = ^\ 45 | installdir = $(PROGRAMFILES)\ohNet 46 | installlibdir = $(installdir)\lib 47 | installincludedir = $(installdir)\include 48 | mkdir = Scripts\mkdir.bat 49 | rmdir = Scripts\rmdir.bat 50 | uset4 = no 51 | copyfile = copy /Y 52 | 53 | 54 | !if "$(nativeonly)"=="yes" 55 | all_common : all_common_native 56 | !else 57 | all_common : all_common_native all_common_cs 58 | !endif 59 | all: $(objdir)$(dllprefix)ohSongcast.$(dllext) $(objdir)TestSongcast.$(exeext) all_common 60 | 61 | 62 | # Include rules to build platform independent code 63 | include Common.mak 64 | 65 | $(objects_topology) : make_obj_dir 66 | $(objects_sender) : make_obj_dir 67 | $(objects_songcast) : make_obj_dir 68 | 69 | make_obj_dir : $(objdirbare) 70 | 71 | $(objdirbare) : 72 | if not exist $(objdirbare) mkdir $(objdirbare) 73 | 74 | clean: 75 | del /S /Q $(objdirbare) 76 | 77 | objects_songcast_dll = $(ohnetdir)$(libprefix)ohNetCore.lib $(objects_topology) $(objects_sender) $(objects_songcast) $(objdir)SoundcardDriver.$(objext) kernel32.lib setupapi.lib shell32.lib ole32.lib 78 | 79 | $(objdir)$(dllprefix)ohSongcast.$(dllext) : $(objects_topology) $(objects_sender) $(objects_songcast) ohSongcast\Windows\SoundcardDriver.cpp 80 | $(compiler)SoundcardDriver.$(objext) -c $(cflags) $(includes) ohSongcast\Windows\SoundcardDriver.cpp 81 | $(link_dll) $(linkoutput)$(objdir)$(dllprefix)ohSongcast.$(dllext) $(objects_songcast_dll) 82 | 83 | $(objdir)TestSongcast.$(exeext) : $(objdir)$(dllprefix)ohSongcast.$(dllext) ohSongcast\TestSongcast.cpp 84 | $(compiler)TestSongcast.$(objext) -c $(cflags) $(includes) ohSongcast\TestSongcast.cpp 85 | $(link) $(linkoutput)$(objdir)TestSongcast.$(exeext) $(objdir)TestSongcast.$(objext) $(objects_songcast_dll) $(ohnetdir)$(libprefix)TestFramework.$(libext) 86 | 87 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.237 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace OpenHome.Songcast.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("OpenHome.Songcast.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | internal static System.Drawing.Icon Icon { 64 | get { 65 | object obj = ResourceManager.GetObject("Icon", resourceCulture); 66 | return ((System.Drawing.Icon)(obj)); 67 | } 68 | } 69 | 70 | internal static byte[] ohLogo { 71 | get { 72 | object obj = ResourceManager.GetObject("ohLogo", resourceCulture); 73 | return ((byte[])(obj)); 74 | } 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Preferences.h: -------------------------------------------------------------------------------- 1 | 2 | #import 3 | 4 | 5 | // Enum for the receiver state 6 | typedef enum 7 | { 8 | eReceiverStateOffline, 9 | eReceiverStateDisconnected, 10 | eReceiverStateConnecting, 11 | eReceiverStateConnected 12 | 13 | } EReceiverState; 14 | 15 | 16 | 17 | @interface PrefReceiver : NSObject 18 | { 19 | NSString* udn; 20 | NSString* room; 21 | NSString* group; 22 | NSString* name; 23 | EReceiverState status; 24 | } 25 | 26 | @property (copy) NSString* udn; 27 | @property (copy) NSString* room; 28 | @property (copy) NSString* group; 29 | @property (copy) NSString* name; 30 | @property (assign) EReceiverState status; 31 | 32 | - (id) initWithDict:(NSDictionary*)aDict; 33 | - (NSDictionary*) convertToDict; 34 | 35 | @end 36 | 37 | 38 | 39 | @interface PrefSubnet : NSObject 40 | { 41 | uint32_t address; 42 | NSString* name; 43 | } 44 | 45 | @property (assign) uint32_t address; 46 | @property (copy) NSString* name; 47 | 48 | - (id) initWithDict:(NSDictionary*)aDict; 49 | - (NSDictionary*) convertToDict; 50 | 51 | @end 52 | 53 | 54 | 55 | @interface PrefMulticastChannel : NSObject 56 | { 57 | } 58 | 59 | + (uint32_t) generate; 60 | 61 | @end 62 | 63 | 64 | 65 | @interface Preferences : NSObject 66 | { 67 | CFStringRef appId; 68 | } 69 | 70 | - (id) initWithBundle:(NSBundle*)aBundle; 71 | 72 | - (bool) iconVisible; 73 | - (void) setIconVisible:(bool)aVisible; 74 | - (void) addObserverIconVisible:(id)aObserver selector:(SEL)aSelector; 75 | 76 | - (bool) enabled; 77 | - (void) setEnabled:(bool)aEnabled; 78 | - (void) addObserverEnabled:(id)aObserver selector:(SEL)aSelector; 79 | 80 | - (bool) hasRunWizard; 81 | - (void) setHasRunWizard:(bool)aHasRunWizard; 82 | 83 | - (bool) multicastEnabled; 84 | - (void) setMulticastEnabled:(bool)aEnabled; 85 | - (void) addObserverMulticastEnabled:(id)aObserver selector:(SEL)aSelector; 86 | 87 | - (uint32_t) multicastChannel; 88 | - (void) setMulticastChannel:(uint32_t)aChannel; 89 | - (void) addObserverMulticastChannel:(id)aObserver selector:(SEL)aSelector; 90 | 91 | - (uint32_t) latencyMs; 92 | - (void) setLatencyMs:(uint32_t)aLatencyMs; 93 | - (void) addObserverLatencyMs:(id)aObserver selector:(SEL)aSelector; 94 | 95 | - (bool) autoUpdatesEnabled; 96 | - (void) setAutoUpdatesEnabled:(bool)aEnabled; 97 | - (void) addObserverAutoUpdatesEnabled:(id)aObserver selector:(SEL)aSelector; 98 | 99 | - (bool) betaUpdatesEnabled; 100 | - (void) setBetaUpdatesEnabled:(bool)aEnabled; 101 | - (void) addObserverBetaUpdatesEnabled:(id)aObserver selector:(SEL)aSelector; 102 | 103 | - (NSArray*) receiverList; 104 | - (void) setReceiverList:(NSArray*)aReceiverList; 105 | - (void) addObserverReceiverList:(id)aObserver selector:(SEL)aSelector; 106 | 107 | - (NSArray*) selectedUdnList; 108 | - (void) setSelectedUdnList:(NSArray*)aSelectedUdnList; 109 | - (void) addObserverSelectedUdnList:(id)aObserver selector:(SEL)aSelector; 110 | 111 | - (NSArray*) subnetList; 112 | - (void) setSubnetList:(NSArray*)aSubnetList; 113 | - (void) addObserverSubnetList:(id)aObserver selector:(SEL)aSelector; 114 | 115 | - (PrefSubnet*) selectedSubnet; 116 | - (void) setSelectedSubnet:(PrefSubnet*)aSubnet; 117 | - (void) addObserverSelectedSubnet:(id)aObserver selector:(SEL)aSelector; 118 | 119 | - (void) refreshReceiverList; 120 | - (void) addObserverRefreshReceiverList:(id)aObserver selector:(SEL)aSelector; 121 | 122 | - (void) reconnectReceivers; 123 | - (void) addObserverReconnectReceivers:(id)aObserver selector:(SEL)aSelector; 124 | 125 | - (void) checkForUpdates; 126 | - (void) addObserverCheckForUpdates:(id)aObserver selector:(SEL)aSelector; 127 | 128 | - (void) synchronize; 129 | 130 | @end 131 | 132 | 133 | 134 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/Receiver.mm: -------------------------------------------------------------------------------- 1 | 2 | #import "Receiver.h" 3 | #include "../../Songcast.h" 4 | 5 | 6 | @implementation Receiver 7 | 8 | @synthesize udn; 9 | @synthesize room; 10 | @synthesize group; 11 | @synthesize name; 12 | 13 | 14 | - (id) initWithPtr:(void *)aPtr 15 | { 16 | [super init]; 17 | 18 | iLock = [[NSObject alloc] init]; 19 | iPtr = aPtr; 20 | ReceiverAddRef(iPtr); 21 | 22 | self.udn = [NSString stringWithUTF8String:ReceiverUdn(iPtr)]; 23 | self.room = [NSString stringWithUTF8String:ReceiverRoom(iPtr)]; 24 | self.group = [NSString stringWithUTF8String:ReceiverGroup(iPtr)]; 25 | self.name = [NSString stringWithUTF8String:ReceiverName(iPtr)]; 26 | 27 | return self; 28 | } 29 | 30 | 31 | - (id) initWithPref:(PrefReceiver*)aPref 32 | { 33 | [super init]; 34 | 35 | iLock = [[NSObject alloc] init]; 36 | iPtr = nil; 37 | 38 | self.udn = [aPref udn]; 39 | self.room = [aPref room]; 40 | self.group = [aPref group]; 41 | self.name = [aPref name]; 42 | 43 | return self; 44 | } 45 | 46 | 47 | - (void) dealloc 48 | { 49 | [udn release]; 50 | [room release]; 51 | [group release]; 52 | [name release]; 53 | [super dealloc]; 54 | } 55 | 56 | 57 | - (void) updateWithPtr:(void*)aPtr 58 | { 59 | // access to iPtr must be locked 60 | @synchronized(iLock) 61 | { 62 | if (iPtr != aPtr) 63 | { 64 | if (iPtr) 65 | ReceiverRemoveRef(iPtr); 66 | if (aPtr) 67 | ReceiverAddRef(aPtr); 68 | } 69 | 70 | iPtr = aPtr; 71 | 72 | if (aPtr) 73 | { 74 | self.udn = [NSString stringWithUTF8String:ReceiverUdn(iPtr)]; 75 | self.room = [NSString stringWithUTF8String:ReceiverRoom(iPtr)]; 76 | self.group = [NSString stringWithUTF8String:ReceiverGroup(iPtr)]; 77 | self.name = [NSString stringWithUTF8String:ReceiverName(iPtr)]; 78 | } 79 | } 80 | } 81 | 82 | 83 | - (PrefReceiver*) convertToPref 84 | { 85 | PrefReceiver* pref = [[[PrefReceiver alloc] init] autorelease]; 86 | 87 | [pref setUdn:udn]; 88 | [pref setRoom:room]; 89 | [pref setGroup:group]; 90 | [pref setName:name]; 91 | [pref setStatus:[self status]]; 92 | 93 | return pref; 94 | } 95 | 96 | 97 | - (EReceiverState) status 98 | { 99 | // access to iPtr must be locked 100 | @synchronized(iLock) 101 | { 102 | if (iPtr) 103 | { 104 | switch (ReceiverStatus(iPtr)) 105 | { 106 | case eDisconnected: 107 | return eReceiverStateDisconnected; 108 | case eConnecting: 109 | return eReceiverStateConnecting; 110 | case eConnected: 111 | return eReceiverStateConnected; 112 | default: 113 | return eReceiverStateOffline; 114 | }; 115 | } 116 | else 117 | { 118 | return eReceiverStateOffline; 119 | } 120 | } 121 | } 122 | 123 | 124 | - (void) play 125 | { 126 | // access to iPtr must be locked 127 | @synchronized(iLock) 128 | { 129 | if (iPtr) { 130 | ReceiverPlay(iPtr); 131 | } 132 | } 133 | } 134 | 135 | 136 | - (void) stop 137 | { 138 | // access to iPtr must be locked 139 | @synchronized(iLock) 140 | { 141 | if (iPtr) { 142 | ReceiverStop(iPtr); 143 | } 144 | } 145 | } 146 | 147 | 148 | - (void) standby 149 | { 150 | // access to iPtr must be locked 151 | @synchronized(iLock) 152 | { 153 | if (iPtr) { 154 | ReceiverStandby(iPtr); 155 | } 156 | } 157 | } 158 | 159 | 160 | @end 161 | 162 | 163 | 164 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/ExtendedNotifyIcon.cs: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------------------- 2 | // Based on code published at CodeProject by Murray Foxcroft - April 2009 3 | //----------------------------------------------------------------------------------------- 4 | using System; 5 | using System.Windows.Forms; 6 | using System.Drawing; 7 | 8 | namespace OpenHome.Songcast 9 | { 10 | /// 11 | /// An extension of the notifyIcon Windows Forms class, unfortunately its a 12 | // sealed class so it cannot be inherited. This class adds a timer and additional 13 | // methods and events to allow for monitoring when a mouse enters and leaves the icon area. 14 | /// 15 | /// 16 | public class ExtendedNotifyIcon : IDisposable 17 | { 18 | const int kMouseLeaveTimerDelayMilliseconds = 300; 19 | 20 | public EventHandler Click; 21 | public EventHandler RightClick; 22 | 23 | private NotifyIcon iTarget; 24 | private Timer iTimer; 25 | private Point iMousePosition; 26 | 27 | private bool iIsMouseOver; 28 | 29 | public ExtendedNotifyIcon(Icon aIcon) 30 | { 31 | iIsMouseOver = false; 32 | iTarget = new NotifyIcon(); 33 | iTarget.Icon = aIcon; 34 | iTarget.Visible = true; 35 | iTarget.Click += EventTargetClick; 36 | iTarget.DoubleClick += EventTargetClick; 37 | iTarget.MouseMove += EventTargetMouseMove; 38 | iTarget.MouseClick += EventTargetMouseClick; 39 | iTimer = new Timer(); 40 | iTimer.Tick += EventTimerTick; 41 | iTimer.Interval = 100; 42 | } 43 | 44 | void EventTargetMouseClick(object sender, MouseEventArgs e) 45 | { 46 | if (e.Button == MouseButtons.Left) 47 | { 48 | if (Click != null) 49 | { 50 | Click(this, EventArgs.Empty); 51 | } 52 | } 53 | else if (e.Button == MouseButtons.Right) 54 | { 55 | if (RightClick != null) 56 | { 57 | RightClick(this, EventArgs.Empty); 58 | } 59 | } 60 | } 61 | 62 | void EventTimerTick(object sender, EventArgs e) 63 | { 64 | // If the mouse position over the icon does not match the screen position, the mouse has left the icon (think of this as a type of hit test) 65 | if (iMousePosition != System.Windows.Forms.Control.MousePosition) 66 | { 67 | iIsMouseOver = false; 68 | iTimer.Stop(); // Stop the timer, no longer reqired. 69 | } 70 | } 71 | 72 | void EventTargetMouseMove(object sender, MouseEventArgs e) 73 | { 74 | iIsMouseOver = true; 75 | iMousePosition = System.Windows.Forms.Control.MousePosition; // Track the position of the mouse over the notify icon 76 | iTimer.Start(); // The timer counts down and closes the window, as the mouse moves over the icon, keep starting (resetting) this to stop it from closing the popup 77 | } 78 | 79 | public ContextMenu ContextMenu 80 | { 81 | set 82 | { 83 | iTarget.ContextMenu = value; 84 | } 85 | } 86 | 87 | public void EventTargetClick(object sender, EventArgs e) 88 | { 89 | } 90 | 91 | public bool IsMouseOver 92 | { 93 | get 94 | { 95 | return (iIsMouseOver); 96 | } 97 | } 98 | 99 | public void Dispose() 100 | { 101 | iTarget.Dispose(); 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/common.h: -------------------------------------------------------------------------------- 1 | /*++ 2 | 3 | Copyright (c) 1997-2000 Microsoft Corporation All Rights Reserved 4 | 5 | Module Name: 6 | 7 | Common.h 8 | 9 | Abstract: 10 | 11 | CAdapterCommon class declaration. 12 | 13 | --*/ 14 | 15 | #ifndef _MSVAD_COMMON_H_ 16 | #define _MSVAD_COMMON_H_ 17 | 18 | //============================================================================= 19 | // Defines 20 | //============================================================================= 21 | 22 | DEFINE_GUID(IID_IAdapterCommon, 23 | 0x7eda2950, 0xbf9f, 0x11d0, 0x87, 0x1f, 0x0, 0xa0, 0xc9, 0x11, 0xb5, 0x44); 24 | 25 | //============================================================================= 26 | // Interfaces 27 | //============================================================================= 28 | 29 | /////////////////////////////////////////////////////////////////////////////// 30 | // IAdapterCommon 31 | // 32 | DECLARE_INTERFACE_(IAdapterCommon, IUnknown) 33 | { 34 | STDMETHOD_(NTSTATUS, Init) 35 | ( 36 | THIS_ 37 | IN PDEVICE_OBJECT DeviceObject 38 | ) PURE; 39 | 40 | STDMETHOD_(PDEVICE_OBJECT, GetDeviceObject) 41 | ( 42 | THIS 43 | ) PURE; 44 | 45 | STDMETHOD_(VOID, SetWaveServiceGroup) 46 | ( 47 | THIS_ 48 | IN PSERVICEGROUP ServiceGroup 49 | ) PURE; 50 | 51 | STDMETHOD_(PUNKNOWN *, WavePortDriverDest) 52 | ( 53 | THIS 54 | ) PURE; 55 | 56 | STDMETHOD_(BOOL, bDevSpecificRead) 57 | ( 58 | THIS_ 59 | ) PURE; 60 | 61 | STDMETHOD_(VOID, bDevSpecificWrite) 62 | ( 63 | THIS_ 64 | IN BOOL bDevSpecific 65 | ); 66 | 67 | STDMETHOD_(INT, iDevSpecificRead) 68 | ( 69 | THIS_ 70 | ) PURE; 71 | 72 | STDMETHOD_(VOID, iDevSpecificWrite) 73 | ( 74 | THIS_ 75 | IN INT iDevSpecific 76 | ); 77 | 78 | STDMETHOD_(UINT, uiDevSpecificRead) 79 | ( 80 | THIS_ 81 | ) PURE; 82 | 83 | STDMETHOD_(VOID, uiDevSpecificWrite) 84 | ( 85 | THIS_ 86 | IN UINT uiDevSpecific 87 | ); 88 | 89 | STDMETHOD_(BOOL, MixerMuteRead) 90 | ( 91 | THIS_ 92 | IN ULONG Index 93 | ) PURE; 94 | 95 | STDMETHOD_(VOID, MixerMuteWrite) 96 | ( 97 | THIS_ 98 | IN ULONG Index, 99 | IN BOOL Value 100 | ); 101 | 102 | STDMETHOD_(ULONG, MixerMuxRead) 103 | ( 104 | THIS 105 | ); 106 | 107 | STDMETHOD_(VOID, MixerMuxWrite) 108 | ( 109 | THIS_ 110 | IN ULONG Index 111 | ); 112 | 113 | STDMETHOD_(LONG, MixerVolumeRead) 114 | ( 115 | THIS_ 116 | IN ULONG Index, 117 | IN LONG Channel 118 | ) PURE; 119 | 120 | STDMETHOD_(VOID, MixerVolumeWrite) 121 | ( 122 | THIS_ 123 | IN ULONG Index, 124 | IN LONG Channel, 125 | IN LONG Value 126 | ) PURE; 127 | 128 | STDMETHOD_(VOID, MixerReset) 129 | ( 130 | THIS 131 | ) PURE; 132 | }; 133 | typedef IAdapterCommon *PADAPTERCOMMON; 134 | 135 | //============================================================================= 136 | // Function Prototypes 137 | //============================================================================= 138 | NTSTATUS 139 | NewAdapterCommon 140 | ( 141 | OUT PUNKNOWN * Unknown, 142 | IN REFCLSID, 143 | IN PUNKNOWN UnknownOuter OPTIONAL, 144 | IN POOL_TYPE PoolType 145 | ); 146 | 147 | #endif //_COMMON_H_ 148 | 149 | -------------------------------------------------------------------------------- /Wireshark/plugins/ohm/Makefile.nmake: -------------------------------------------------------------------------------- 1 | # Makefile.nmake 2 | # nmake file for Wireshark plugin 3 | # 4 | # $Id: Makefile.nmake 42971 2012-06-01 14:08:12Z wmeier $ 5 | # 6 | 7 | include ..\..\config.nmake 8 | include moduleinfo.nmake 9 | 10 | include Makefile.common 11 | 12 | CFLAGS=$(WARNINGS_ARE_ERRORS) $(STANDARD_CFLAGS) \ 13 | /I../.. $(GLIB_CFLAGS) \ 14 | /I$(PCAP_DIR)\include 15 | 16 | .c.obj:: 17 | $(CC) $(CFLAGS) -Fd.\ -c $< 18 | 19 | LDFLAGS = $(PLUGIN_LDFLAGS) 20 | 21 | !IFDEF ENABLE_LIBWIRESHARK 22 | LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib 23 | CFLAGS=/D_NEED_VAR_IMPORT_ $(CFLAGS) 24 | 25 | DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj) 26 | 27 | DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj) 28 | 29 | OBJECTS = $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) plugin.obj 30 | 31 | RESOURCE=$(PLUGIN_NAME).res 32 | 33 | all: $(PLUGIN_NAME).dll 34 | 35 | $(PLUGIN_NAME).rc : moduleinfo.nmake 36 | sed -e s/@PLUGIN_NAME@/$(PLUGIN_NAME)/ \ 37 | -e s/@RC_MODULE_VERSION@/$(RC_MODULE_VERSION)/ \ 38 | -e s/@RC_VERSION@/$(RC_VERSION)/ \ 39 | -e s/@MODULE_VERSION@/$(MODULE_VERSION)/ \ 40 | -e s/@PACKAGE@/$(PACKAGE)/ \ 41 | -e s/@VERSION@/$(VERSION)/ \ 42 | -e s/@MSVC_VARIANT@/$(MSVC_VARIANT)/ \ 43 | < plugin.rc.in > $@ 44 | 45 | $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLUGIN_WITH) $(RESOURCE) 46 | link -dll /out:$(PLUGIN_NAME).dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \ 47 | $(GLIB_LIBS) $(RESOURCE) 48 | 49 | # 50 | # Build plugin.c, which contains the plugin version[] string, a 51 | # function plugin_register() that calls the register routines for all 52 | # protocols, and a function plugin_reg_handoff() that calls the handoff 53 | # registration routines for all protocols. 54 | # 55 | # We do this by scanning sources. If that turns out to be too slow, 56 | # maybe we could just require every .o file to have an register routine 57 | # of a given name (packet-aarp.o -> proto_register_aarp, etc.). 58 | # 59 | # Formatting conventions: The name of the proto_register_* routines an 60 | # proto_reg_handoff_* routines must start in column zero, or must be 61 | # preceded only by "void " starting in column zero, and must not be 62 | # inside #if. 63 | # 64 | # DISSECTOR_SRC is assumed to have all the files that need to be scanned. 65 | # 66 | # For some unknown reason, having a big "for" loop in the Makefile 67 | # to scan all the files doesn't work with some "make"s; they seem to 68 | # pass only the first few names in the list to the shell, for some 69 | # reason. 70 | # 71 | # Therefore, we have a script to generate the plugin.c file. 72 | # The shell script runs slowly, as multiple greps and seds are run 73 | # for each input file; this is especially slow on Windows. Therefore, 74 | # if Python is present (as indicated by PYTHON being defined), we run 75 | # a faster Python script to do that work instead. 76 | # 77 | # The first argument is the directory in which the source files live. 78 | # The second argument is "plugin", to indicate that we should build 79 | # a plugin.c file for a plugin. 80 | # All subsequent arguments are the files to scan. 81 | # 82 | !IFDEF PYTHON 83 | plugin.c: $(DISSECTOR_SRC) moduleinfo.h Makefile.common ../../tools/make-dissector-reg.py 84 | @echo Making plugin.c (using python) 85 | @$(PYTHON) "../../tools/make-dissector-reg.py" . plugin $(DISSECTOR_SRC) 86 | !ELSE 87 | plugin.c: $(DISSECTOR_SRC) moduleinfo.h Makefile.common ../../tools/make-dissector-reg 88 | @echo Making plugin.c (using sh) 89 | @$(SH) ../../tools/make-dissector-reg . plugin $(DISSECTOR_SRC) 90 | !ENDIF 91 | 92 | !ENDIF 93 | 94 | clean: 95 | rm -f $(OBJECTS) $(RESOURCE) plugin.c *.pdb *.sbr \ 96 | $(PLUGIN_NAME).dll $(PLUGIN_NAME).dll.manifest $(PLUGIN_NAME).lib \ 97 | $(PLUGIN_NAME).exp $(PLUGIN_NAME).rc 98 | 99 | distclean: clean 100 | 101 | maintainer-clean: distclean 102 | 103 | checkapi: 104 | $(PERL) ../../tools/checkAPIs.pl -g abort -g termoutput -build $(DISSECTOR_SRC) $(DISSECTOR_INCLUDES) 105 | -------------------------------------------------------------------------------- /Wireshark/plugins/ohz/Makefile.nmake: -------------------------------------------------------------------------------- 1 | # Makefile.nmake 2 | # nmake file for Wireshark plugin 3 | # 4 | # $Id: Makefile.nmake 42971 2012-06-01 14:08:12Z wmeier $ 5 | # 6 | 7 | include ..\..\config.nmake 8 | include moduleinfo.nmake 9 | 10 | include Makefile.common 11 | 12 | CFLAGS=$(WARNINGS_ARE_ERRORS) $(STANDARD_CFLAGS) \ 13 | /I../.. $(GLIB_CFLAGS) \ 14 | /I$(PCAP_DIR)\include 15 | 16 | .c.obj:: 17 | $(CC) $(CFLAGS) -Fd.\ -c $< 18 | 19 | LDFLAGS = $(PLUGIN_LDFLAGS) 20 | 21 | !IFDEF ENABLE_LIBWIRESHARK 22 | LINK_PLUGIN_WITH=..\..\epan\libwireshark.lib 23 | CFLAGS=/D_NEED_VAR_IMPORT_ $(CFLAGS) 24 | 25 | DISSECTOR_OBJECTS = $(DISSECTOR_SRC:.c=.obj) 26 | 27 | DISSECTOR_SUPPORT_OBJECTS = $(DISSECTOR_SUPPORT_SRC:.c=.obj) 28 | 29 | OBJECTS = $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS) plugin.obj 30 | 31 | RESOURCE=$(PLUGIN_NAME).res 32 | 33 | all: $(PLUGIN_NAME).dll 34 | 35 | $(PLUGIN_NAME).rc : moduleinfo.nmake 36 | sed -e s/@PLUGIN_NAME@/$(PLUGIN_NAME)/ \ 37 | -e s/@RC_MODULE_VERSION@/$(RC_MODULE_VERSION)/ \ 38 | -e s/@RC_VERSION@/$(RC_VERSION)/ \ 39 | -e s/@MODULE_VERSION@/$(MODULE_VERSION)/ \ 40 | -e s/@PACKAGE@/$(PACKAGE)/ \ 41 | -e s/@VERSION@/$(VERSION)/ \ 42 | -e s/@MSVC_VARIANT@/$(MSVC_VARIANT)/ \ 43 | < plugin.rc.in > $@ 44 | 45 | $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLUGIN_WITH) $(RESOURCE) 46 | link -dll /out:$(PLUGIN_NAME).dll $(LDFLAGS) $(OBJECTS) $(LINK_PLUGIN_WITH) \ 47 | $(GLIB_LIBS) $(RESOURCE) 48 | 49 | # 50 | # Build plugin.c, which contains the plugin version[] string, a 51 | # function plugin_register() that calls the register routines for all 52 | # protocols, and a function plugin_reg_handoff() that calls the handoff 53 | # registration routines for all protocols. 54 | # 55 | # We do this by scanning sources. If that turns out to be too slow, 56 | # maybe we could just require every .o file to have an register routine 57 | # of a given name (packet-aarp.o -> proto_register_aarp, etc.). 58 | # 59 | # Formatting conventions: The name of the proto_register_* routines an 60 | # proto_reg_handoff_* routines must start in column zero, or must be 61 | # preceded only by "void " starting in column zero, and must not be 62 | # inside #if. 63 | # 64 | # DISSECTOR_SRC is assumed to have all the files that need to be scanned. 65 | # 66 | # For some unknown reason, having a big "for" loop in the Makefile 67 | # to scan all the files doesn't work with some "make"s; they seem to 68 | # pass only the first few names in the list to the shell, for some 69 | # reason. 70 | # 71 | # Therefore, we have a script to generate the plugin.c file. 72 | # The shell script runs slowly, as multiple greps and seds are run 73 | # for each input file; this is especially slow on Windows. Therefore, 74 | # if Python is present (as indicated by PYTHON being defined), we run 75 | # a faster Python script to do that work instead. 76 | # 77 | # The first argument is the directory in which the source files live. 78 | # The second argument is "plugin", to indicate that we should build 79 | # a plugin.c file for a plugin. 80 | # All subsequent arguments are the files to scan. 81 | # 82 | !IFDEF PYTHON 83 | plugin.c: $(DISSECTOR_SRC) moduleinfo.h Makefile.common ../../tools/make-dissector-reg.py 84 | @echo Making plugin.c (using python) 85 | @$(PYTHON) "../../tools/make-dissector-reg.py" . plugin $(DISSECTOR_SRC) 86 | !ELSE 87 | plugin.c: $(DISSECTOR_SRC) moduleinfo.h Makefile.common ../../tools/make-dissector-reg 88 | @echo Making plugin.c (using sh) 89 | @$(SH) ../../tools/make-dissector-reg . plugin $(DISSECTOR_SRC) 90 | !ENDIF 91 | 92 | !ENDIF 93 | 94 | clean: 95 | rm -f $(OBJECTS) $(RESOURCE) plugin.c *.pdb *.sbr \ 96 | $(PLUGIN_NAME).dll $(PLUGIN_NAME).dll.manifest $(PLUGIN_NAME).lib \ 97 | $(PLUGIN_NAME).exp $(PLUGIN_NAME).rc 98 | 99 | distclean: clean 100 | 101 | maintainer-clean: distclean 102 | 103 | checkapi: 104 | $(PERL) ../../tools/checkAPIs.pl -g abort -g termoutput -build $(DISSECTOR_SRC) $(DISSECTOR_INCLUDES) 105 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/OpenHome/Buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_BUFFER 2 | #define HEADER_BUFFER 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | EXCEPTION(BufferFull); 9 | EXCEPTION(BufferOverflow); 10 | 11 | namespace OpenHome { 12 | 13 | class Brn; 14 | 15 | class DllExportClass Brx 16 | { 17 | public: 18 | inline TUint Bytes() const; 19 | inline const TByte& operator[](TUint aByteIndex) const; 20 | inline TBool operator==(const Brx& aBrx) const; 21 | inline TBool operator!=(const Brx& aBrx) const; 22 | DllExport TBool Equals(const Brx& aBrx) const; 23 | const TByte& At(TUint aByteIndex) const; 24 | virtual const TByte* Ptr() const=0; 25 | Brn Split(TUint aByteIndex) const; 26 | Brn Split(TUint aByteIndex, TUint aBytes) const; 27 | TBool BeginsWith(const Brx& aBrx) const; 28 | virtual ~Brx() {}; 29 | protected: 30 | explicit inline Brx(TUint aBytes); 31 | explicit inline Brx(const Brx& aBrx); 32 | TUint iBytes; 33 | private: 34 | Brx& operator=(const Brx& aBrx); 35 | }; 36 | 37 | class DllExportClass Brn : public Brx 38 | { 39 | public: 40 | inline explicit Brn(); 41 | inline explicit Brn(const Brx& aBrx); 42 | inline Brn(const Brn& aBrn); 43 | inline explicit Brn(const TByte* aPtr, TUint aBytes); 44 | DllExport explicit Brn(const TChar* aPtr); 45 | inline void Set(const Brx& aBrx); 46 | inline void Set(const TByte* aPtr, TUint aBytes); 47 | void Set(const TChar* aPtr); 48 | virtual const TByte* Ptr() const; 49 | protected: 50 | const TByte* iPtr; 51 | private: 52 | Brn& operator=(const Brn& aBrn); 53 | }; 54 | 55 | class DllExportClass Bwx : public Brx 56 | { 57 | public: 58 | void Clear(); 59 | void Replace(const Brx& aBuf); 60 | void ReplaceThrow(const Brx& aBuf); 61 | void Replace(const TByte* aPtr, TUint aBytes); 62 | void Replace(const TChar* aStr); 63 | inline void Append(TChar aChar); 64 | inline void Append(TByte aByte); 65 | void Append(const Brx& aB); 66 | void Append(const TChar* aStr); 67 | void Append(const TByte* aPtr, TUint aBytes); 68 | const TChar* PtrZ() const; 69 | void Fill(TByte aFillByte); 70 | inline void FillZ(); 71 | inline TUint MaxBytes() const; 72 | void SetBytes(TUint aBytes); 73 | inline TByte& operator[](TUint aByteIndex); 74 | TByte& At(TUint aByteIndex); 75 | protected: 76 | explicit Bwx(TUint aBytes, TUint aMaxBytes); 77 | TUint iMaxBytes; 78 | }; 79 | 80 | class DllExportClass Bwn : public Bwx 81 | { 82 | public: 83 | explicit Bwn(); 84 | explicit Bwn(const Bwx& aBwx); 85 | Bwn(const Bwn& aBwn); 86 | explicit Bwn(const TByte* aPtr, TUint aMaxBytes); 87 | explicit Bwn(const TByte* aPtr, TUint aBytes, TUint aMaxBytes); 88 | explicit Bwn(const TChar* aPtr, TUint aMaxBytes); 89 | explicit Bwn(const TChar* aPtr, TUint aBytes, TUint aMaxBytes); 90 | void Set(const Bwx& aBwx); 91 | void Set(const TByte* aPtr, TUint aMaxBytes); 92 | void Set(const TByte* aPtr, TUint aBytes, TUint aMaxBytes); 93 | virtual const TByte* Ptr() const; 94 | protected: 95 | const TByte* iPtr; 96 | private: 97 | Bwn& operator=(const Bwn&); 98 | }; 99 | 100 | template class DllExportClass Bws : public Bwx 101 | { 102 | public: 103 | inline Bws(); 104 | inline Bws(TUint aBytes); 105 | explicit inline Bws(const TChar* aStr); 106 | explicit inline Bws(const TByte* aPtr, TUint aBytes); 107 | explicit inline Bws(const Brx& aBuf); 108 | explicit inline Bws(const Bws&); 109 | inline const TByte* Ptr() const; 110 | protected: 111 | TByte iBuf[S]; 112 | private: 113 | Bws& operator=(const Bws&); 114 | }; 115 | 116 | /** 117 | * Custom comparison function for stl map keyed on Brn 118 | */ 119 | class BufferCmp 120 | { 121 | public: 122 | TBool operator()(const Brx& aStr1, const Brx& aStr2) const; 123 | }; 124 | 125 | #include 126 | 127 | } // namespace OpenHome 128 | 129 | #endif 130 | -------------------------------------------------------------------------------- /OhmSocket.cpp: -------------------------------------------------------------------------------- 1 | #include "OhmSocket.h" 2 | 3 | using namespace OpenHome; 4 | using namespace OpenHome::Av; 5 | 6 | // OhmSocket 7 | 8 | // Sends on same socket in Unicast mode, but different socket in Multicast mode 9 | 10 | OhmSocket::OhmSocket(Environment& aEnv) 11 | : iEnv(aEnv) 12 | , iRxSocket(0) 13 | , iTxSocket(0) 14 | , iReader(0) 15 | { 16 | } 17 | 18 | void OhmSocket::OpenUnicast(TIpAddress aInterface, TUint aTtl) 19 | { 20 | ASSERT(!iRxSocket); 21 | ASSERT(!iTxSocket); 22 | ASSERT(!iReader); 23 | iRxSocket = new SocketUdp(iEnv, 0, aInterface); 24 | iRxSocket->SetTtl(aTtl); 25 | iRxSocket->SetRecvBufBytes(kReceiveBufBytes); 26 | iRxSocket->SetSendBufBytes(kSendBufBytes); 27 | iReader = new UdpReader(*iRxSocket); 28 | iThis.Replace(Endpoint(iRxSocket->Port(), aInterface)); 29 | } 30 | 31 | void OhmSocket::OpenMulticast(TIpAddress aInterface, TUint aTtl, const Endpoint& aEndpoint) 32 | { 33 | ASSERT(!iRxSocket); 34 | ASSERT(!iTxSocket); 35 | ASSERT(!iReader); 36 | iRxSocket = new SocketUdpMulticast(iEnv, aInterface, aEndpoint); 37 | iRxSocket->SetRecvBufBytes(kReceiveBufBytes); 38 | iTxSocket = new SocketUdp(iEnv, 0, aInterface); 39 | iTxSocket->SetTtl(aTtl); 40 | iTxSocket->SetSendBufBytes(kSendBufBytes); 41 | iReader = new UdpReader(*iRxSocket); 42 | iThis.Replace(aEndpoint); 43 | } 44 | 45 | void OhmSocket::Send(const Brx& aBuffer, const Endpoint& aEndpoint) 46 | { 47 | if (iTxSocket) { 48 | iTxSocket->Send(aBuffer, aEndpoint); 49 | } 50 | else { 51 | iRxSocket->Send(aBuffer, aEndpoint); 52 | } 53 | } 54 | 55 | Endpoint OhmSocket::This() const 56 | { 57 | return (iThis); 58 | } 59 | 60 | Endpoint OhmSocket::Sender() const 61 | { 62 | ASSERT(iReader); 63 | return (iReader->Sender()); 64 | } 65 | 66 | void OhmSocket::Close() 67 | { 68 | ASSERT(iReader); 69 | delete (iReader); 70 | iReader = 0; 71 | ASSERT (iRxSocket); 72 | delete (iRxSocket); 73 | iRxSocket = 0; 74 | if (iTxSocket) { 75 | delete (iTxSocket); 76 | iTxSocket = 0; 77 | } 78 | iThis.Replace(Endpoint()); 79 | } 80 | 81 | void OhmSocket::Read(Bwx& aBuffer) 82 | { 83 | ASSERT(iReader); 84 | iReader->Read(aBuffer); 85 | } 86 | 87 | void OhmSocket::ReadFlush() 88 | { 89 | ASSERT(iReader); 90 | iReader->ReadFlush(); 91 | } 92 | 93 | void OhmSocket::ReadInterrupt() 94 | { 95 | ASSERT(iReader); 96 | iReader->ReadInterrupt(); 97 | } 98 | 99 | OhmSocket::~OhmSocket() 100 | { 101 | if (iRxSocket != 0) { 102 | Close(); 103 | } 104 | } 105 | 106 | 107 | // OhzSocket 108 | 109 | OhzSocket::OhzSocket(Environment& aEnv) 110 | : iEnv(aEnv) 111 | , iRxSocket(0) 112 | , iTxSocket(0) 113 | , iEndpoint(51972, Brn("239.255.255.250")) 114 | { 115 | } 116 | 117 | const Endpoint& OhzSocket::This() const 118 | { 119 | return (iEndpoint); 120 | } 121 | 122 | void OhzSocket::Open(TIpAddress aInterface, TUint aTtl) 123 | { 124 | ASSERT(!iRxSocket); 125 | iRxSocket = new SocketUdpMulticast(iEnv, aInterface, iEndpoint); 126 | iTxSocket = new SocketUdp(iEnv, 0, aInterface); 127 | iTxSocket->SetTtl(aTtl); 128 | iReader = new UdpReader(*iRxSocket); 129 | } 130 | 131 | void OhzSocket::Send(const Brx& aBuffer) 132 | { 133 | ASSERT(iTxSocket); 134 | iTxSocket->Send(aBuffer, iEndpoint); 135 | } 136 | 137 | void OhzSocket::Close() 138 | { 139 | ASSERT(iRxSocket); 140 | delete (iRxSocket); 141 | delete (iTxSocket); 142 | delete (iReader); 143 | iRxSocket = 0; 144 | iTxSocket = 0; 145 | iReader = 0; 146 | } 147 | 148 | void OhzSocket::Read(Bwx& aBuffer) 149 | { 150 | ASSERT(iRxSocket); 151 | iReader->Read(aBuffer); 152 | } 153 | 154 | void OhzSocket::ReadFlush() 155 | { 156 | ASSERT(iRxSocket != 0); 157 | iReader->ReadFlush(); 158 | } 159 | 160 | void OhzSocket::ReadInterrupt() 161 | { 162 | ASSERT(iRxSocket != 0); 163 | iReader->ReadInterrupt(); 164 | } 165 | 166 | OhzSocket::~OhzSocket() 167 | { 168 | if (iRxSocket != 0) { 169 | Close(); 170 | } 171 | } 172 | 173 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Wpf/ohSongcast/MediaPlayerWindow.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Windows; 6 | using System.Windows.Controls; 7 | using System.Windows.Data; 8 | using System.Windows.Documents; 9 | using System.Windows.Input; 10 | using System.Windows.Media; 11 | using System.Windows.Media.Imaging; 12 | using System.Windows.Shapes; 13 | 14 | namespace OpenHome.Songcast 15 | { 16 | public interface IRefreshHandler 17 | { 18 | void Refresh(); 19 | } 20 | 21 | /// 22 | /// Interaction logic for ReceiversWindow.xaml 23 | /// 24 | public partial class MediaPlayerWindow : Window 25 | { 26 | MediaPlayerConfiguration iMediaPlayerConfiguration; 27 | 28 | ReceiverList iReceiverList; 29 | 30 | IRefreshHandler iRefreshHandler; 31 | 32 | public MediaPlayerWindow(bool aEnabled, IRefreshHandler aRefreshHandler) 33 | { 34 | InitializeComponent(); 35 | 36 | iRefreshHandler = aRefreshHandler; 37 | 38 | buttonRefresh.Click += new RoutedEventHandler(EventButtonRefreshClick); 39 | 40 | iReceiverList = new ReceiverList(this.Dispatcher); 41 | 42 | iReceiverList.CollectionChanged += new System.Collections.Specialized.NotifyCollectionChangedEventHandler(EventReceiverListCollectionChanged); 43 | 44 | iMediaPlayerConfiguration = MediaPlayerConfiguration.Load(aEnabled); 45 | 46 | listBoxReceivers.ItemsSource = iMediaPlayerConfiguration.MediaPlayerList; 47 | } 48 | 49 | void EventButtonRefreshClick(object sender, RoutedEventArgs e) 50 | { 51 | iMediaPlayerConfiguration.Refresh(); 52 | iRefreshHandler.Refresh(); 53 | } 54 | 55 | 56 | void EventReceiverListCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) 57 | { 58 | switch (e.Action) 59 | { 60 | case System.Collections.Specialized.NotifyCollectionChangedAction.Add: 61 | foreach (object o in e.NewItems) 62 | { 63 | Receiver receiver = o as Receiver; 64 | iMediaPlayerConfiguration.ReceiverAdded(receiver); 65 | } 66 | break; 67 | case System.Collections.Specialized.NotifyCollectionChangedAction.Remove: 68 | foreach (object o in e.OldItems) 69 | { 70 | Receiver receiver = o as Receiver; 71 | iMediaPlayerConfiguration.ReceiverRemoved(receiver); 72 | } 73 | break; 74 | default: 75 | break; 76 | } 77 | } 78 | 79 | public ReceiverList ReceiverList 80 | { 81 | get 82 | { 83 | return (iReceiverList); 84 | } 85 | } 86 | 87 | private void EventPlayStopClick(object sender, RoutedEventArgs e) 88 | { 89 | Button button = sender as Button; 90 | ListBoxItem parent = button.FindVisualAncestor(); 91 | MediaPlayer player = listBoxReceivers.ItemContainerGenerator.ItemFromContainer(parent) as MediaPlayer; 92 | player.Click(); 93 | } 94 | 95 | public void SetEnabled(bool aValue) 96 | { 97 | iMediaPlayerConfiguration.SetEnabled(aValue); 98 | } 99 | 100 | public void SubnetChanged() 101 | { 102 | iMediaPlayerConfiguration.SubnetChanged(); 103 | } 104 | } 105 | 106 | public static class DependencyObjectExtensions 107 | { 108 | public static ancestorItem FindVisualAncestor(this DependencyObject obj) where ancestorItem : DependencyObject 109 | { 110 | DependencyObject dep = obj; 111 | do 112 | { 113 | dep = VisualTreeHelper.GetParent(dep); 114 | } while ((dep != null) && !(dep is ancestorItem)); 115 | return dep as ancestorItem; 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | 2 | # Makefile for linux and mac 3 | 4 | 5 | ifeq ($(release), 1) 6 | debug_specific_flags = -O2 7 | build_dir = Release 8 | else 9 | debug_specific_flags = -g -O0 10 | build_dir = Debug 11 | endif 12 | 13 | 14 | MACHINE = $(shell uname -s) 15 | ifeq ($(MACHINE), Darwin) 16 | 17 | ifeq ($(mac-64),1) 18 | platform_cflags = -DPLATFORM_MACOSX_GNU -arch x86_64 -mmacosx-version-min=10.7 -stdlib=libc++ 19 | platform_linkflags = -arch x86_64 -framework IOKit -framework CoreFoundation -framework CoreAudio -framework SystemConfiguration 20 | osdir = Mac-x64 21 | else 22 | platform_cflags = -DPLATFORM_MACOSX_GNU -m32 -mmacosx-version-min=10.7 -stdlib=libc++ 23 | platform_linkflags = -m32 -framework IOKit -framework CoreFoundation -framework CoreAudio -framework SystemConfiguration 24 | osdir = Mac-x86 25 | endif 26 | 27 | platform_dllflags = -install_name @executable_path/$(@F) 28 | platform_include = -I/System/Library/Frameworks/IOKit.framework/Headers/ 29 | else 30 | platform_cflags = -Wno-psabi 31 | platform_linkflags = 32 | platform_dllflags = 33 | platform_include = 34 | osdir = Posix 35 | endif 36 | 37 | 38 | # Macros used by Common.mak 39 | 40 | ar = ${CROSS_COMPILE}ar rc $(objdir) 41 | cflags = -fexceptions -Wall -Werror -pipe -std=c++11 -D_GNU_SOURCE -D_REENTRANT -DDEFINE_LITTLE_ENDIAN -DDEFINE_TRACE $(debug_specific_flags) -fvisibility=hidden -DDllImport="__attribute__ ((visibility(\"default\")))" -DDllExport="__attribute__ ((visibility(\"default\")))" -DDllExportClass="__attribute__ ((visibility(\"default\")))" $(platform_cflags) 42 | ohnetdir = ../ohNet/Build/Obj/$(osdir)/$(build_dir)/ 43 | ohnetgenerateddir = ../ohNetGenerated/Build/Obj/$(osdir)/$(build_dir)/ 44 | ohtopologydir = ../ohTopology/build/ 45 | ohnetmondir = ../ohNetmon/build/ 46 | objdir = Build/Obj/$(osdir)/$(build_dir)/ 47 | inc_build = Build/Include/ 48 | includes = -I../ohNet/Build/Include/ -I../ohNetGenerated/Build/Include/ -I$(ohtopologydir)Include/ $(platform_includes) 49 | objext = o 50 | libprefix = lib 51 | libext = a 52 | exeext = elf 53 | compiler = ${CROSS_COMPILE}g++ -fPIC -o $(objdir) 54 | link = ${CROSS_COMPILE}g++ -pthread $(platform_linkflags) 55 | linkoutput = -o 56 | dllprefix = lib 57 | dllext = so 58 | link_dll = ${CROSS_COMPILE}g++ -pthread $(platform_linkflags) $(platform_dllflags) -shared -shared-libgcc 59 | csharp = mcs /nologo 60 | dirsep = / 61 | copyfile = cp -f 62 | 63 | 64 | default : all 65 | 66 | # Include rules to build the shared code 67 | include Common.mak 68 | 69 | $(objects_topology) : | make_obj_dir 70 | $(objects_sender) : | make_obj_dir 71 | $(objects_songcast) : | make_obj_dir 72 | $(objects_driver) : | make_obj_dir 73 | 74 | make_obj_dir : 75 | mkdir -p $(objdir) 76 | 77 | clean : 78 | rm -rf $(objdir) 79 | 80 | ifeq ($(nativeonly), yes) 81 | all_common : all_common_native 82 | else 83 | all_common : all_common_native all_common_cs 84 | endif 85 | all : all_common $(objdir)$(dllprefix)ohSongcast.$(dllext) $(objdir)TestSongcast.$(exeext) 86 | 87 | 88 | ifeq ($(MACHINE), Darwin) 89 | objects_driver = $(objdir)SoundcardDriver.$(objext) 90 | 91 | $(objdir)SoundcardDriver.$(objext) : ohSongcast/Mac/SoundcardDriver.cpp 92 | $(compiler)SoundcardDriver.$(objext) -c $(cflags) $(includes) ohSongcast/Mac/SoundcardDriver.cpp 93 | else 94 | objects_driver = $(objdir)SoundcardDriver.$(objext) 95 | 96 | $(objdir)SoundcardDriver.$(objext) : ohSongcast/Posix/SoundcardDriver.cpp 97 | $(compiler)SoundcardDriver.$(objext) -c $(cflags) $(includes) ohSongcast/Posix/SoundcardDriver.cpp 98 | endif 99 | 100 | objects_songcast_dll =$(objects_topology) $(objects_sender) $(objects_songcast) $(objects_driver) $(ohnetdir)$(libprefix)ohNetCore.$(libext) 101 | 102 | $(objdir)$(dllprefix)ohSongcast.$(dllext) : $(objects_topology) $(objects_sender) $(objects_songcast) $(objects_driver) 103 | $(link_dll) $(linkoutput)$(objdir)$(dllprefix)ohSongcast.$(dllext) $(objects_songcast_dll) 104 | 105 | 106 | $(objdir)TestSongcast.$(exeext) : $(objdir)$(dllprefix)ohSongcast.$(dllext) ohSongcast/TestSongcast.cpp 107 | $(compiler)TestSongcast.$(objext) -c $(cflags) $(includes) ohSongcast/TestSongcast.cpp 108 | $(link) $(linkoutput)$(objdir)TestSongcast.$(exeext) $(objdir)TestSongcast.$(objext) $(objects_songcast_dll) $(ohnetdir)$(libprefix)TestFramework.$(libext) 109 | 110 | 111 | -------------------------------------------------------------------------------- /ohSongcast/Mac/Driver/Songcast.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_SONGCAST 2 | #define HEADER_SONGCAST 3 | 4 | #include 5 | #include 6 | 7 | 8 | // NOTE: This struct is __packed__ - this prevents the compiler from adding 9 | // padding to the struct in order to align data on 4 byte boundaries. This is 10 | // required because, when sending the audio packets a single buffer is allocated 11 | // that holds the header and the audio data. The start of this buffer is then cast 12 | // to an AudioHeader in order to fill in the appropriate data. If the compiler adds 13 | // padding to the struct, this will then screw the whole thing up. 14 | typedef struct SongcastAudioHeader 15 | { 16 | // common header fields 17 | uint8_t iSignature[4]; 18 | uint8_t iVersion; 19 | uint8_t iType; 20 | uint16_t iTotalBytes; 21 | 22 | // audio header fields 23 | uint8_t iAudioHeaderBytes; 24 | uint8_t iAudioFlags; 25 | uint16_t iAudioSampleCount; 26 | uint32_t iAudioFrame; 27 | uint32_t iAudioNetworkTimestamp; 28 | uint32_t iAudioMediaLatency; 29 | uint32_t iAudioMediaTimestamp; 30 | uint64_t iAudioStartSample; 31 | uint64_t iAudioTotalSamples; 32 | uint32_t iAudioSampleRate; 33 | uint32_t iAudioBitRate; 34 | uint16_t iAudioVolumeOffset; 35 | uint8_t iAudioBitDepth; 36 | uint8_t iAudioChannels; 37 | uint8_t iAudioReserved; 38 | uint8_t iAudioCodecNameBytes; 39 | uint8_t iAudioCodecName[3]; 40 | 41 | } __attribute__((__packed__)) SongcastAudioHeader; 42 | 43 | 44 | 45 | // Class defining format of audio sent by songcast 46 | class SongcastFormat 47 | { 48 | public: 49 | SongcastFormat(uint32_t aSampleRate, uint8_t aBitDepth, uint8_t aChannels, uint16_t aSampleCount); 50 | 51 | uint32_t Bytes() const; 52 | uint64_t TimeNs() const; 53 | 54 | const uint32_t SampleRate; 55 | const uint32_t BitDepth; 56 | const uint32_t Channels; 57 | const uint32_t SampleCount; 58 | }; 59 | 60 | 61 | 62 | // Class to wrap the data sent in an audio message 63 | class SongcastAudioMessage 64 | { 65 | public: 66 | SongcastAudioMessage(uint32_t aMaxAudioBytes, const SongcastFormat& aFormat); 67 | ~SongcastAudioMessage(); 68 | 69 | void* Ptr() const { return iPtr; } 70 | uint32_t Bytes() const; 71 | uint32_t Frame() const; 72 | 73 | void SetHeader(const SongcastFormat& aFormat, uint64_t aTimestampNs, uint64_t aLatencyMs, bool aHalt, uint32_t aFrame); 74 | void SetResent(); 75 | void SetData(void* aPtr, uint32_t aBytes); 76 | 77 | private: 78 | SongcastAudioHeader* Header() const { return (SongcastAudioHeader*)iPtr; } 79 | 80 | void* iPtr; 81 | uint32_t iAudioBytes; 82 | const uint32_t iMaxAudioBytes; 83 | }; 84 | 85 | 86 | 87 | // Class representing the songcast socket 88 | enum ESongcastState 89 | { 90 | eSongcastStateInactive, 91 | eSongcastStateActive, 92 | eSongcastStatePendingInactive 93 | }; 94 | 95 | class SongcastSocket 96 | { 97 | public: 98 | SongcastSocket(); 99 | ~SongcastSocket(); 100 | 101 | void SetEndpoint(uint32_t aIpAddress, uint16_t aPort, uint32_t aAdapter); 102 | void Send(SongcastAudioMessage& aMsg); 103 | void SetTtl(uint64_t aTtl); 104 | 105 | private: 106 | void SetSocketTtl(); 107 | 108 | socket_t iSocket; 109 | uint8_t iTtl; 110 | }; 111 | 112 | 113 | 114 | // Class defining the interface between the audio driver code and the songcast code 115 | class Songcast 116 | { 117 | public: 118 | Songcast(); 119 | ~Songcast(); 120 | 121 | static const uint32_t SupportedFormatCount = 1; 122 | static const SongcastFormat SupportedFormats[SupportedFormatCount]; 123 | 124 | void SetActive(uint64_t aActive); 125 | void SetEndpoint(uint32_t aIpAddress, uint16_t aPort, uint32_t aAdapter); 126 | void SetTtl(uint64_t aTtl); 127 | void SetLatencyMs(uint64_t aLatencyMs); 128 | 129 | void Send(const SongcastFormat& aFormat, uint64_t aTimestampNs, bool aHalt, void* aData, uint32_t aBytes); 130 | void Resend(uint64_t aFrameCount, const uint32_t* aFrames); 131 | 132 | private: 133 | static const uint32_t kHistoryCount = 100; 134 | 135 | SongcastSocket iSocket; 136 | ESongcastState iState; 137 | OpenHome::FifoLite iHistory; 138 | uint64_t iLatencyMs; 139 | uint32_t iFrame; 140 | }; 141 | 142 | 143 | 144 | #endif // HEADER_SONGCAST 145 | 146 | 147 | -------------------------------------------------------------------------------- /ohSongcast/Mac/App/SubnetList.mm: -------------------------------------------------------------------------------- 1 | 2 | #import "SubnetList.h" 3 | #include "../../Songcast.h" 4 | 5 | 6 | 7 | // Implementation of subnet class 8 | @implementation Subnet 9 | 10 | 11 | - (id) initWithPtr:(void*)aPtr 12 | { 13 | self = [super init]; 14 | 15 | iPtr = aPtr; 16 | SubnetAddRef(iPtr); 17 | 18 | return self; 19 | } 20 | 21 | 22 | - (void) dispose 23 | { 24 | SubnetRemoveRef(iPtr); 25 | iPtr = 0; 26 | } 27 | 28 | 29 | - (PrefSubnet*) convertToPref 30 | { 31 | PrefSubnet* pref = [[[PrefSubnet alloc] init] autorelease]; 32 | 33 | [pref setAddress:[self address]]; 34 | [pref setName:[self name]]; 35 | 36 | return pref; 37 | } 38 | 39 | 40 | - (uint32_t) address 41 | { 42 | return SubnetAddress(iPtr); 43 | } 44 | 45 | 46 | - (NSString*) name 47 | { 48 | return [NSString stringWithUTF8String:SubnetAdapterName(iPtr)]; 49 | } 50 | 51 | 52 | - (bool) matches:(void*)aPtr 53 | { 54 | return (iPtr == aPtr); 55 | } 56 | 57 | 58 | @end 59 | 60 | 61 | 62 | // Implementation of subnet list class 63 | @implementation SubnetList 64 | 65 | 66 | - (id) init 67 | { 68 | self = [super init]; 69 | 70 | iLock = [[NSObject alloc] init]; 71 | iList = [[NSMutableArray alloc] initWithCapacity:0]; 72 | iObserver = nil; 73 | 74 | return self; 75 | } 76 | 77 | 78 | - (void) dealloc 79 | { 80 | [iLock release]; 81 | [iList release]; 82 | [super dealloc]; 83 | } 84 | 85 | 86 | - (NSArray*) subnets 87 | { 88 | // lock the list and return a copy containing the same objects 89 | @synchronized(iLock) 90 | { 91 | return [NSArray arrayWithArray:iList]; 92 | } 93 | } 94 | 95 | 96 | - (void) setObserver:(NSObject*)aObserver 97 | { 98 | @synchronized(iLock) 99 | { 100 | iObserver = aObserver; 101 | } 102 | } 103 | 104 | 105 | - (void) subnetChangedCallback:(THandle)aPtr type:(ECallbackType)aType 106 | { 107 | // lock access to the subnet list 108 | @synchronized(iLock) 109 | { 110 | // get the subnet that has changed 111 | Subnet* subnet = nil; 112 | for (Subnet* s in iList) 113 | { 114 | if ([s matches:aPtr]) 115 | { 116 | subnet = s; 117 | break; 118 | } 119 | } 120 | 121 | // handle different callback types 122 | switch (aType) 123 | { 124 | case eAdded: 125 | if (!subnet) 126 | { 127 | subnet = [[[Subnet alloc] initWithPtr:aPtr] autorelease]; 128 | [iList addObject:subnet]; 129 | } 130 | 131 | // send notification in the main thread 132 | [iObserver performSelectorOnMainThread:@selector(subnetAdded:) withObject:subnet waitUntilDone:FALSE]; 133 | break; 134 | 135 | case eRemoved: 136 | if (subnet) 137 | { 138 | // removing the subnet from the list could cause the retain count to go to 0, so 139 | // manually retain it here to keep it alive 140 | [subnet retain]; 141 | [subnet dispose]; 142 | 143 | [iList removeObject:subnet]; 144 | 145 | // send notification in the main thread 146 | [iObserver performSelectorOnMainThread:@selector(subnetRemoved:) withObject:subnet waitUntilDone:FALSE]; 147 | 148 | // the subnet is retained when added to the performSelector method - safe to release it now 149 | [subnet release]; 150 | } 151 | break; 152 | 153 | case eChanged: 154 | if (subnet) 155 | { 156 | // send notification in the main thread 157 | [iObserver performSelectorOnMainThread:@selector(subnetChanged:) withObject:subnet waitUntilDone:FALSE]; 158 | } 159 | break; 160 | } 161 | } 162 | } 163 | 164 | 165 | @end 166 | 167 | 168 | // Callback from the ohSongcast code for a subnet event 169 | void SubnetListCallback(void* aPtr, ECallbackType aType, THandle aSubnet) 170 | { 171 | NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; 172 | 173 | SubnetList* subnetList = (SubnetList*)aPtr; 174 | 175 | [subnetList subnetChangedCallback:aSubnet type:aType]; 176 | 177 | [pool drain]; 178 | } 179 | 180 | 181 | -------------------------------------------------------------------------------- /ohSongcast/Posix/SoundcardDriver.cpp: -------------------------------------------------------------------------------- 1 | #include "../Songcast.h" 2 | 3 | #include 4 | #include 5 | 6 | #include "../../Ohm.h" 7 | #include "../../OhmSender.h" 8 | 9 | #include 10 | #include 11 | #define __STDC_FORMAT_MACROS 12 | #include 13 | 14 | 15 | namespace OpenHome { 16 | namespace Av { 17 | 18 | class OhmSenderDriverPosix : public IOhmSenderDriver 19 | { 20 | public: 21 | OhmSenderDriverPosix(); 22 | 23 | private: 24 | // IOhmSenderDriver 25 | virtual void SetEnabled(TBool aValue); 26 | virtual void SetEndpoint(const Endpoint& aEndpoint, TIpAddress aAdapter); 27 | virtual void SetActive(TBool aValue); 28 | virtual void SetTtl(TUint aValue); 29 | virtual void SetLatency(TUint aValue); 30 | virtual void SetTrackPosition(TUint64 aSampleStart, TUint64 aSamplesTotal); 31 | virtual void Resend(const Brx& aFrames); 32 | }; 33 | 34 | 35 | } // namespace Av 36 | } // namespace OpenHome 37 | 38 | 39 | using namespace OpenHome; 40 | using namespace OpenHome::Av; 41 | 42 | 43 | OhmSenderDriverPosix::OhmSenderDriverPosix() 44 | { 45 | } 46 | 47 | // IOhmSenderDriver 48 | void OhmSenderDriverPosix::SetEnabled(TBool aValue) 49 | { 50 | printf(aValue ? "OhmSenderDriverPosix: Enabled\n" : "OhmSenderDriverPosix: Disabled\n"); 51 | } 52 | 53 | void OhmSenderDriverPosix::SetEndpoint(const Endpoint& aEndpoint, TIpAddress aAdapter) 54 | { 55 | printf("OhmSenderDriverPosix: Endpoint %8x:%d, Adapter %8x\n", aEndpoint.Address(), aEndpoint.Port(), aAdapter); 56 | } 57 | 58 | void OhmSenderDriverPosix::SetActive(TBool aValue) 59 | { 60 | printf(aValue ? "OhmSenderDriverPosix: Active\n" : "OhmSenderDriverPosix: Inactive\n"); 61 | } 62 | 63 | void OhmSenderDriverPosix::SetTtl(TUint aValue) 64 | { 65 | printf("OhmSenderDriverPosix: TTL %d\n", aValue); 66 | } 67 | 68 | void OhmSenderDriverPosix::SetLatency(TUint aValue) 69 | { 70 | printf("OhmSenderDriverPosix: Latency %d\n", aValue); 71 | } 72 | 73 | void OhmSenderDriverPosix::SetTrackPosition(TUint64 aSampleStart, TUint64 aSamplesTotal) 74 | { 75 | printf("OhmSenderDriverPosix: TrackPosition %" PRIu64 " %" PRIu64 "\n", aSampleStart, aSamplesTotal); 76 | } 77 | 78 | void OhmSenderDriverPosix::Resend(const Brx& aFrames) 79 | { 80 | printf("OhmSenderDriverPosix: Resend"); 81 | 82 | ReaderBuffer buffer(aFrames); 83 | ReaderBinary reader(buffer); 84 | 85 | TUint frames = aFrames.Bytes() / 4; 86 | 87 | while (frames-- > 0) { 88 | printf(" %d", reader.ReadUintBe(4)); 89 | } 90 | 91 | printf("\n"); 92 | } 93 | 94 | 95 | // Soundcard - platform specific implementation of the C interface 96 | 97 | THandle SongcastCreate(const char* aDomain, uint32_t aSubnet, uint32_t aChannel, uint32_t aTtl, 98 | uint32_t aLatency, uint32_t aMulticast, uint32_t aEnabled, uint32_t aPreset, 99 | ReceiverCallback aReceiverCallback, void* aReceiverPtr, 100 | SubnetCallback aSubnetCallback, void* aSubnetPtr, 101 | ConfigurationChangedCallback aConfigurationChangedCallback, void* aConfigurationChangedPtr, 102 | MessageCallback aFatalErrorCallback, void* aFatalErrorPtr, 103 | MessageCallback aLogOutputCallback, void* aLogOutputPtr, 104 | const char* aManufacturer, const char* aManufacturerUrl, const char* aModelUrl, 105 | void* aImagePtr, uint32_t aImageBytes, const char* aMimeType) 106 | { 107 | // get the computer name 108 | struct utsname name; 109 | if (uname(&name) < 0) 110 | return 0; 111 | 112 | Brn computer(name.nodename); 113 | 114 | // create the driver 115 | OhmSenderDriverPosix* driver = new OhmSenderDriverPosix(); 116 | 117 | Songcast* songcast = new Songcast(aSubnet, aChannel, aTtl, 118 | aLatency, aMulticast, aEnabled, aPreset, 119 | aReceiverCallback, aReceiverPtr, 120 | aSubnetCallback, aSubnetPtr, 121 | aConfigurationChangedCallback, aConfigurationChangedPtr, 122 | aFatalErrorCallback, aFatalErrorPtr, 123 | aLogOutputCallback, aLogOutputPtr, 124 | computer, driver, aManufacturer, aManufacturerUrl, aModelUrl, 125 | Brn((TByte*)aImagePtr, aImageBytes), Brn(aMimeType)); 126 | return songcast; 127 | } 128 | 129 | 130 | 131 | 132 | -------------------------------------------------------------------------------- /ohSongcast/TestSongcastCs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | 4 | using OpenHome.Songcast; 5 | 6 | class Program : IReceiverHandler, ISubnetHandler, IConfigurationChangedHandler, IMessageHandler 7 | { 8 | public static void Main(string[] args) 9 | { 10 | Program program = new Program(); 11 | 12 | program.Run(); 13 | } 14 | 15 | public void Run() 16 | { 17 | bool enabled = true; 18 | 19 | try 20 | { 21 | Songcast songcast = new Songcast("av.openhome.org", 522, 1, 1, 100, false, enabled, 99, this, this, this, this, "OpenHome", "http://www.openhome.org", "http://www.openhome.org", new byte[] { }, String.Empty); 22 | 23 | while (true) 24 | { 25 | ConsoleKeyInfo key = Console.ReadKey(true); 26 | 27 | if (key.KeyChar == 'q') 28 | { 29 | break; 30 | } 31 | 32 | if (key.KeyChar == 'a') 33 | { 34 | songcast.SetSubnet(43200); 35 | } 36 | 37 | if (key.KeyChar == 'e') 38 | { 39 | if (enabled) 40 | { 41 | enabled = false; 42 | } 43 | else 44 | { 45 | enabled = true; 46 | } 47 | 48 | songcast.SetEnabled(enabled); 49 | 50 | continue; 51 | } 52 | } 53 | 54 | songcast.Dispose(); 55 | } 56 | catch (SongcastError e) 57 | { 58 | Console.WriteLine(e.Message); 59 | } 60 | } 61 | 62 | public void ConfigurationChanged(IConfiguration aConfiguration) 63 | { 64 | Console.WriteLine("Configuration changed: channel={0}, ttl={1}, multicast={2}, enabled={3}", aConfiguration.Channel(), aConfiguration.Ttl(), aConfiguration.Multicast(), aConfiguration.Enabled()); 65 | } 66 | 67 | public void ReceiverAdded(IReceiver aReceiver) 68 | { 69 | Console.WriteLine("Added {0}:{1}:{2}:{3}", aReceiver.Room, aReceiver.Group, aReceiver.Name, aReceiver.Status); 70 | } 71 | 72 | public void ReceiverChanged(IReceiver aReceiver) 73 | { 74 | Console.WriteLine("Changed {0}:{1}:{2}:{3}", aReceiver.Room, aReceiver.Group, aReceiver.Name, aReceiver.Status); 75 | } 76 | 77 | public void ReceiverRemoved(IReceiver aReceiver) 78 | { 79 | Console.WriteLine("Removed {0}:{1}:{2}:{3}", aReceiver.Room, aReceiver.Group, aReceiver.Name, aReceiver.Status); 80 | } 81 | 82 | public void ReceiverVolumeControlChanged(IReceiver aReceiver) 83 | { 84 | Console.WriteLine("VolumeControlChanged {0}:{1}:{2} {3} {4}", aReceiver.Room, aReceiver.Group, aReceiver.Name, aReceiver.Status, aReceiver.HasVolumeControl); 85 | } 86 | 87 | public void ReceiverVolumeChanged(IReceiver aReceiver) 88 | { 89 | Console.WriteLine("ReceiverVolumeChanged {0}:{1}:{2} {3} {4}", aReceiver.Room, aReceiver.Group, aReceiver.Name, aReceiver.Status, aReceiver.Volume); 90 | } 91 | 92 | public void ReceiverMuteChanged(IReceiver aReceiver) 93 | { 94 | Console.WriteLine("ReceiverMuteChanged {0}:{1}:{2} {3} {4}", aReceiver.Room, aReceiver.Group, aReceiver.Name, aReceiver.Status, aReceiver.Mute); 95 | } 96 | 97 | public void ReceiverVolumeLimitChanged(IReceiver aReceiver) 98 | { 99 | Console.WriteLine("ReceiverVolumeLimitChanged {0}:{1}:{2} {3} {4}", aReceiver.Room, aReceiver.Group, aReceiver.Name, aReceiver.Status, aReceiver.VolumeLimit); 100 | } 101 | 102 | public void SubnetAdded(ISubnet aSubnet) 103 | { 104 | Console.WriteLine("Added {0}:{1}", aSubnet.Address, aSubnet.AdapterName); 105 | } 106 | 107 | public void SubnetChanged(ISubnet aSubnet) 108 | { 109 | Console.WriteLine("Changed {0}:{1}", aSubnet.Address, aSubnet.AdapterName); 110 | } 111 | 112 | public void SubnetRemoved(ISubnet aSubnet) 113 | { 114 | Console.WriteLine("Removed {0}:{1}", aSubnet.Address, aSubnet.AdapterName); 115 | } 116 | 117 | public void Message(string aMessage) 118 | { 119 | Console.WriteLine("Message: " + aMessage); 120 | } 121 | } 122 | -------------------------------------------------------------------------------- /ohSongcast/Windows/Driver/drmsimp/OpenHome/Stream.h: -------------------------------------------------------------------------------- 1 | #ifndef HEADER_STREAM 2 | #define HEADER_STREAM 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | EXCEPTION(ReaderError); 9 | EXCEPTION(WriterError); 10 | 11 | namespace OpenHome { 12 | 13 | class IReader 14 | { 15 | public: 16 | virtual Brn Read(TUint aBytes) = 0; 17 | virtual Brn ReadUntil(TByte aSeparator) = 0; 18 | virtual void ReadFlush() = 0; 19 | virtual void ReadInterrupt() = 0; 20 | virtual ~IReader() {}; 21 | }; 22 | 23 | class IReaderSource 24 | { 25 | public: 26 | virtual void Read(Bwx& aBuffer) = 0; 27 | virtual void ReadFlush() = 0; 28 | virtual void ReadInterrupt() = 0; 29 | virtual ~IReaderSource() {}; 30 | }; 31 | 32 | class IWriter 33 | { 34 | public: 35 | virtual void Write(TByte aValue) = 0; 36 | virtual void Write(const Brx& aBuffer) = 0; 37 | virtual void WriteFlush() = 0; 38 | virtual ~IWriter() {}; 39 | }; 40 | 41 | class Sxx : public INonCopyable 42 | { 43 | friend class Swp; 44 | protected: 45 | Sxx(TUint aMaxBytes); 46 | virtual ~Sxx(); 47 | protected: 48 | virtual TByte* Ptr() = 0; 49 | protected: 50 | TUint iMaxBytes; 51 | TUint iBytes; 52 | }; 53 | 54 | class Srx : public Sxx, public IReader 55 | { 56 | public: 57 | virtual Brn Read(TUint aBytes); 58 | virtual Brn ReadUntil(TByte aSeparator); 59 | virtual void ReadFlush(); 60 | virtual void ReadInterrupt(); 61 | Brn Snaffle(); 62 | protected: 63 | Srx(TUint aMaxBytes, IReaderSource& aSource); 64 | protected: 65 | IReaderSource& iSource; 66 | TUint iOffset; 67 | }; 68 | 69 | template class Srs : public Srx 70 | { 71 | public: 72 | Srs(IReaderSource& aSource) : Srx(S, aSource) {} 73 | private: 74 | virtual TByte* Ptr() { return (iBuf); } 75 | private: 76 | TByte iBuf[S]; 77 | }; 78 | 79 | class Swx : public Sxx, public IWriter 80 | { 81 | public: 82 | virtual void Write(TByte aValue); 83 | virtual void Write(const Brx& aBuffer); 84 | virtual void WriteFlush(); 85 | private: 86 | void WriteDrain(); 87 | protected: 88 | Swx(TUint aMaxBytes, IWriter& aWriter); 89 | private: 90 | void Error(); 91 | virtual TByte* Ptr() = 0; 92 | protected: 93 | IWriter& iWriter; 94 | }; 95 | 96 | template class Sws : public Swx 97 | { 98 | public: 99 | Sws(IWriter& aWriter) : Swx(S, aWriter) {} 100 | private: 101 | virtual TByte* Ptr() { return (iBuf); } 102 | private: 103 | TByte iBuf[S]; 104 | }; 105 | 106 | class Swp : public Swx 107 | { 108 | public: 109 | Swp(Srx& aHost, IWriter& aWriter); 110 | virtual ~Swp(); 111 | private: 112 | virtual TByte* Ptr(); 113 | private: 114 | Srx& iHost; 115 | }; 116 | 117 | class ReaderBuffer : public IReader 118 | { 119 | public: 120 | ReaderBuffer(const Brx& aBuffer); 121 | void Set(const Brx& aBuffer); 122 | TUint Bytes() const; 123 | Brn ReadRemaining(); 124 | Brn ReadPartial(TUint aBytes); 125 | // IReader 126 | virtual Brn Read(TUint aBytes); 127 | virtual Brn ReadUntil(TByte aSeparator); 128 | virtual void ReadFlush(); 129 | virtual void ReadInterrupt(); 130 | private: 131 | Brn iBuffer; 132 | TUint iOffset; 133 | }; 134 | 135 | class WriterBuffer : public IWriter, public INonCopyable 136 | { 137 | public: 138 | WriterBuffer(Bwx& aBuffer); 139 | void Flush(); 140 | // IWriter 141 | virtual void Write(TByte aValue); 142 | virtual void Write(const Brx& aBuffer); 143 | virtual void WriteFlush(); 144 | private: 145 | Bwx& iBuffer; 146 | }; 147 | 148 | class ReaderBinary : private INonCopyable 149 | { 150 | public: 151 | ReaderBinary(IReader& aReader); 152 | const Brn Read(TUint aBytes); 153 | TUint ReadUintBe(TUint aBytes); 154 | TUint ReadUintLe(TUint aBytes); 155 | TUint64 ReadUint64Be(TUint aBytes); 156 | TUint64 ReadUint64Le(TUint aBytes); 157 | TInt ReadIntBe(TUint aBytes); 158 | private: 159 | IReader& iReader; 160 | }; 161 | 162 | class WriterBinary : private INonCopyable 163 | { 164 | public: 165 | WriterBinary(IWriter& aWriter); 166 | void Write(const Brx& aBuffer); 167 | void WriteUint8(TUint aValue); 168 | void WriteUint16Be(TUint aValue); 169 | void WriteUint24Be(TUint aValue); 170 | void WriteUint32Be(TUint aValue); 171 | void WriteUint64Be(TUint64 aValue); 172 | void WriteInt8(TInt aValue); 173 | void WriteInt16Be(TInt aValue); 174 | void WriteInt24Be(TInt aValue); 175 | void WriteInt32Be(TInt aValue); 176 | void WriteInt64Be(TInt64 aValue); 177 | private: 178 | IWriter& iWriter; 179 | }; 180 | 181 | } // namespace OpenHome 182 | 183 | #endif // HEADER_STREAM 184 | --------------------------------------------------------------------------------