Commit d9c39e3d authored by sletz's avatar sletz
Browse files

JackWinMMEDriver working on Windows.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3499 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 34ff05a8
......@@ -33,7 +33,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include "JackDriverLoader.h"
/*
This is a simple port of the old jackdmp.cpp file to use the new Jack 2.0 control API. Available options for the server
This is a simple port of the old jackdmp.cpp file to use the new Jack 2.0 control API. Available options for the server
are "hard-coded" in the source. A much better approach would be to use the control API to:
- dynamically retrieve available server parameters and then prepare to parse them
- get available drivers and their possible parameters, then prepare to parse them.
......@@ -58,7 +58,7 @@ static void notify_server_start(const char* server_name)
static void notify_server_stop(const char* server_name)
{
// Send notification to be used in the JackRouter plugin
CFStringRef ref1 = CFStringCreateWithCString(NULL, server_name, kCFStringEncodingMacRoman);
CFStringRef ref1 = CFStringCreateWithCString(NULL, server_name, kCFStringEncodingMacRoman);
CFNotificationCenterPostNotificationWithOptions(CFNotificationCenterGetDistributedCenter(),
CFSTR("com.grame.jackserver.stop"),
ref1,
......@@ -95,7 +95,7 @@ static void usage(FILE* file)
"usage: jackdmp [ --realtime OR -R [ --realtime-priority OR -P priority ] ]\n"
" [ --name OR -n server-name ]\n"
" [ --timeout OR -t client-timeout-in-msecs ]\n"
" [ --loopback OR -X midi-driver ]\n"
" [ --midi OR -X midi-driver ]\n"
" [ --verbose OR -v ]\n"
" [ --replace-registry OR -r ]\n"
" [ --silent OR -s ]\n"
......@@ -196,13 +196,13 @@ int main(int argc, char* argv[])
union jackctl_parameter_value value;
copyright(stdout);
server_ctl = jackctl_server_create();
if (server_ctl == NULL) {
fprintf(stderr, "Failed to create server object\n");
return -1;
}
server_parameters = jackctl_server_get_parameters(server_ctl);
opterr = 0;
......@@ -215,20 +215,20 @@ int main(int argc, char* argv[])
seen_audio_driver = true;
audio_driver_name = optarg;
break;
case 'X':
seen_midi_driver = true;
midi_driver_name = optarg;
break;
case 'p':
port_max = (unsigned int)atol(optarg);
break;
case 'm':
do_mlock = 0;
break;
case 'u':
do_unlock = 1;
break;
......@@ -317,7 +317,7 @@ int main(int argc, char* argv[])
default:
fprintf(stderr, "unknown option character %c\n", optopt);
/*fallthru*/
case 'h':
usage(stdout);
goto fail_free;
......@@ -325,18 +325,18 @@ int main(int argc, char* argv[])
}
if (show_version) {
printf( "jackdmp version " VERSION
" tmpdir " jack_server_dir
printf( "jackdmp version " VERSION
" tmpdir " jack_server_dir
" protocol %d"
"\n", JACK_PROTOCOL_VERSION);
return -1;
}
if (!seen_audio_driver) {
usage(stderr);
goto fail_free;
}
// Audio driver
audio_driver_ctl = jackctl_server_get_driver(server_ctl, audio_driver_name);
if (audio_driver_ctl == NULL) {
......@@ -366,22 +366,22 @@ int main(int argc, char* argv[])
if (jackctl_parse_driver_params(audio_driver_ctl, audio_driver_nargs, audio_driver_args)) {
goto fail_free;
}
// Start server
if (!jackctl_server_start(server_ctl, audio_driver_ctl)) {
fprintf(stderr, "Failed to start server\n");
goto fail_free;
}
// MIDI driver
if (seen_midi_driver) {
midi_driver_ctl = jackctl_server_get_driver(server_ctl, midi_driver_name);
if (midi_driver_ctl == NULL) {
fprintf(stderr, "Unkown driver \"%s\"\n", midi_driver_name);
goto fail_free;
}
jackctl_server_load_slave(server_ctl, midi_driver_ctl);
}
......@@ -390,12 +390,12 @@ int main(int argc, char* argv[])
// Waits for signal
signals = jackctl_setup_signals(0);
jackctl_wait_signals(signals);
if (!jackctl_server_stop(server_ctl))
fprintf(stderr, "Cannot stop server...\n");
fail_free:
jackctl_server_destroy(server_ctl);
notify_server_stop(server_name);
return 1;
......
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="jack_winmme" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Win32 Release">
<Option output="Release\bin\jack\jack_winmme" prefix_auto="1" extension_auto="1" />
<Option object_output="Release" />
<Option type="3" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
<Add option="-Wall" />
<Add option="-DWIN32" />
<Add option="-DNDEBUG" />
<Add option="-D_WINDOWS" />
<Add option="-D_MBCS" />
<Add option="-D_USRDLL" />
<Add option="-DSERVER_SIDE" />
<Add directory="." />
<Add directory="..\windows" />
<Add directory="..\common\jack" />
<Add directory="..\common" />
<Add directory="winmme" />
</Compiler>
<Linker>
<Add directory="..\windows" />
<Add directory="Release\bin" />
</Linker>
</Target>
<Target title="Win32 Debug">
<Option output="Debug\bin\jack\jack_winmme" prefix_auto="1" extension_auto="1" />
<Option object_output="Debug" />
<Option type="3" />
<Option compiler="gcc" />
<Compiler>
<Add option="-W" />
<Add option="-g" />
<Add option="-DWIN32" />
<Add option="-D_DEBUG" />
<Add option="-D_WINDOWS" />
<Add option="-D_MBCS" />
<Add option="-D_USRDLL" />
<Add option="-DSERVER_SIDE" />
<Add directory="." />
<Add directory="..\windows" />
<Add directory="..\common\jack" />
<Add directory="..\common" />
<Add directory="winmme" />
</Compiler>
<Linker>
<Add directory="Debug\bin" />
<Add directory="..\windows" />
</Linker>
</Target>
<Target title="Win32 Profiling">
<Option output="Release\bin\jack\jack_winmme" prefix_auto="1" extension_auto="1" />
<Option object_output="Release" />
<Option type="3" />
<Option compiler="gcc" />
<Compiler>
<Add option="-O2" />
<Add option="-Wall" />
<Add option="-DWIN32" />
<Add option="-DNDEBUG" />
<Add option="-D_WINDOWS" />
<Add option="-D_MBCS" />
<Add option="-D_USRDLL" />
<Add option="-DJACK_MONITOR" />
<Add option="-DSERVER_SIDE" />
<Add directory="." />
<Add directory="..\windows" />
<Add directory="..\common\jack" />
<Add directory="..\common" />
<Add directory="winmme" />
</Compiler>
<Linker>
<Add directory="Release\bin" />
<Add directory="..\windows" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
</Compiler>
<Linker>
<Add library="kernel32" />
<Add library="user32" />
<Add library="gdi32" />
<Add library="winspool" />
<Add library="comdlg32" />
<Add library="advapi32" />
<Add library="shell32" />
<Add library="ole32" />
<Add library="oleaut32" />
<Add library="uuid" />
<Add library="odbc32" />
<Add library="odbccp32" />
<Add library="libjackserver" />
<Add library="winmm" />
</Linker>
<Unit filename="jackwinmme.rc">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="winmme\JackWinMMEDriver.cpp" />
<Extensions>
<code_completion />
<envvars />
<debugger />
<lib_finder disable_auto="1" />
<AutoVersioning>
<Scheme minor_max="10" build_max="0" rev_max="0" rev_rand_max="10" build_times_to_increment_minor="100" />
<Settings autoincrement="1" date_declarations="1" do_auto_increment="0" ask_to_increment="0" language="C++" svn="0" svn_directory="" header_path="version.h" />
<Changes_Log show_changes_editor="0" app_title="released version %M.%m.%b of %p" changeslog_path="ChangesLog.txt" />
</AutoVersioning>
</Extensions>
</Project>
</CodeBlocks_project_file>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_workspace_file>
<Workspace title="jack">
<Project filename="libjackserver.cbp" active="1" />
<Project filename="libjackserver.cbp" />
<Project filename="jackd.cbp">
<Depends filename="libjackserver.cbp" />
</Project>
......@@ -46,5 +46,6 @@
<Project filename="multiple_metro.cbp">
<Depends filename="libjack.cbp" />
</Project>
<Project filename="jack_winmme.cbp" active="1" />
</Workspace>
</CodeBlocks_workspace_file>
// Generated by ResEdit 1.4.3
// Copyright (C) 2006-2008
// http://www.resedit.net
#include "resource.h"
#include "afxres.h"
//
// Version Information resources
//
LANGUAGE LANG_FRENCH, SUBLANG_DEFAULT
1 VERSIONINFO
FILEVERSION 1,9,3,0
PRODUCTVERSION 1,9,3,0
FILEOS VOS_UNKNOWN
FILETYPE VFT_DLL
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040c04b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Grame\0"
VALUE "FileDescription", "Jackmp WinMMEo Driver for Windows\0"
VALUE "FileVersion", "1, 9, 3, 0\0"
VALUE "InternalName", "jack_portaudio\0"
VALUE "LegalCopyright", "Copyright Grame 2006-2009\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "jack_winmme.dll\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "jack_winmme\0"
VALUE "ProductVersion", "1, 9, 3, 0\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 1036, 1200
END
END
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="libjackserver" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Win32 Release">
<Option output="Release\bin\libjackserver" prefix_auto="1" extension_auto="1" />
<Option object_output="Release" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-O2" />
<Add option="-Wall" />
<Add option="-DWIN32" />
<Add option="-DNDEBUG" />
<Add option="-D_WINDOWS" />
<Add option="-D_MBCS" />
<Add option="-D_USRDLL" />
<Add option="-DLIBJACKDMP_EXPORTS" />
<Add option="-DREGEX_MALLOC" />
<Add option="-DSTDC_HEADERS" />
<Add option="-DSERVER_SIDE" />
<Add option="-D__SMP__" />
<Add directory="." />
<Add directory="..\windows" />
<Add directory="..\common\jack" />
<Add directory="..\common" />
</Compiler>
<Linker>
<Add directory="Release\bin" />
</Linker>
</Target>
<Target title="Win32 Debug">
<Option output="Debug\bin\libjackserver" prefix_auto="1" extension_auto="1" />
<Option object_output="Debug" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add option="-DWIN32" />
<Add option="-D_DEBUG" />
<Add option="-D_WINDOWS" />
<Add option="-D_MBCS" />
<Add option="-D_USRDLL" />
<Add option="-DLIBJACKDMP_EXPORTS" />
<Add option="-DREGEX_MALLOC" />
<Add option="-DSTDC_HEADERS" />
<Add option="-DSERVER_SIDE" />
<Add option="-D__SMP__" />
<Add directory="." />
<Add directory="..\windows" />
<Add directory="..\common\jack" />
<Add directory="..\common" />
</Compiler>
<Linker>
<Add directory="Debug\bin" />
</Linker>
</Target>
<Target title="Win32 Profiling">
<Option output="Release\bin\libjackserver" prefix_auto="1" extension_auto="1" />
<Option object_output="Release" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-O2" />
<Add option="-Wall" />
<Add option="-DWIN32" />
<Add option="-DNDEBUG" />
<Add option="-D_WINDOWS" />
<Add option="-D_MBCS" />
<Add option="-D_USRDLL" />
<Add option="-DLIBJACKDMP_EXPORTS" />
<Add option="-DREGEX_MALLOC" />
<Add option="-DSTDC_HEADERS" />
<Add option="-DSERVER_SIDE" />
<Add option="-D__SMP__" />
<Add option="-DJACK_MONITOR" />
<Add directory="." />
<Add directory="..\windows" />
<Add directory="..\common\jack" />
<Add directory="..\common" />
</Compiler>
<Linker>
<Add directory="Release\bin" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add directory="." />
<Add directory="..\common" />
<Add directory="..\common\jack" />
</Compiler>
<Linker>
<Add library="kernel32" />
<Add library="user32" />
<Add library="gdi32" />
<Add library="winspool" />
<Add library="comdlg32" />
<Add library="advapi32" />
<Add library="shell32" />
<Add library="ole32" />
<Add library="oleaut32" />
<Add library="uuid" />
<Add library="odbc32" />
<Add library="odbccp32" />
<Add library="ws2_32" />
</Linker>
<Unit filename="..\common\JackAPI.cpp" />
<Unit filename="..\common\JackActivationCount.cpp" />
<Unit filename="..\common\JackArgParser.cpp" />
<Unit filename="..\common\JackAudioDriver.cpp" />
<Unit filename="..\common\JackAudioPort.cpp" />
<Unit filename="..\common\JackClient.cpp" />
<Unit filename="..\common\JackConnectionManager.cpp" />
<Unit filename="..\common\JackControlAPI.cpp" />
<Unit filename="..\common\JackDriver.cpp" />
<Unit filename="..\common\JackDriverLoader.cpp" />
<Unit filename="..\common\JackEngine.cpp" />
<Unit filename="..\common\JackEngineControl.cpp" />
<Unit filename="..\common\JackEngineProfiling.cpp">
<Option target="Win32 Profiling" />
</Unit>
<Unit filename="..\common\JackError.cpp" />
<Unit filename="..\common\JackExternalClient.cpp" />
<Unit filename="..\common\JackFrameTimer.cpp" />
<Unit filename="..\common\JackFreewheelDriver.cpp" />
<Unit filename="..\common\JackGlobals.cpp" />
<Unit filename="..\common\JackGraphManager.cpp" />
<Unit filename="..\common\JackInternalClient.cpp" />
<Unit filename="..\common\JackLoopbackDriver.cpp" />
<Unit filename="..\common\JackMessageBuffer.cpp" />
<Unit filename="..\common\JackMidiAPI.cpp" />
<Unit filename="..\common\JackMidiPort.cpp" />
<Unit filename="..\common\JackNetInterface.cpp" />
<Unit filename="..\common\JackNetTool.cpp" />
<Unit filename="..\common\JackPort.cpp" />
<Unit filename="..\common\JackPortType.cpp" />
<Unit filename="..\common\JackRestartThreadedDriver.cpp" />
<Unit filename="..\common\JackServer.cpp" />
<Unit filename="..\common\JackServerAPI.cpp" />
<Unit filename="..\common\JackServerGlobals.cpp" />
<Unit filename="..\common\JackShmMem.cpp" />
<Unit filename="..\common\JackThreadedDriver.cpp" />
<Unit filename="..\common\JackTools.cpp" />
<Unit filename="..\common\JackTransportEngine.cpp" />
<Unit filename="..\common\JackWaitThreadedDriver.cpp" />
<Unit filename="..\common\ringbuffer.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="..\common\shm.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="JackNetWinSocket.cpp" />
<Unit filename="JackWinNamedPipe.cpp" />
<Unit filename="JackWinNamedPipeClientChannel.cpp" />
<Unit filename="JackWinNamedPipeNotifyChannel.cpp" />
<Unit filename="JackWinNamedPipeServerChannel.cpp" />
<Unit filename="JackWinNamedPipeServerNotifyChannel.cpp" />
<Unit filename="JackWinProcessSync.cpp" />
<Unit filename="JackWinSemaphore.cpp" />
<Unit filename="JackWinThread.cpp" />
<Unit filename="JackWinTime.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="getopt.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="getopt1.c">
<Option compilerVar="CC" />
</Unit>
<Unit filename="libjackserver.rc">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="regex.c">
<Option compilerVar="CC" />
</Unit>
<Extensions>
<code_completion />
<envvars />
<debugger />
<AutoVersioning>
<Scheme minor_max="10" build_max="0" rev_max="0" rev_rand_max="10" build_times_to_increment_minor="100" />
<Settings autoincrement="0" date_declarations="0" do_auto_increment="0" ask_to_increment="0" language="C++" svn="0" svn_directory="" header_path="version.h" />
<Changes_Log show_changes_editor="0" app_title="released version %M.%m.%b of %p" changeslog_path="ChangesLog.txt" />
</AutoVersioning>
</Extensions>
</Project>
</CodeBlocks_project_file>
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
<FileVersion major="1" minor="6" />
<Project>
<Option title="libjackserver" />
<Option pch_mode="2" />
<Option compiler="gcc" />
<Build>
<Target title="Win32 Release">
<Option output="Release\bin\libjackserver" prefix_auto="1" extension_auto="1" />
<Option object_output="Release" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-O2" />
<Add option="-Wall" />
<Add option="-DWIN32" />
<Add option="-DNDEBUG" />
<Add option="-D_WINDOWS" />
<Add option="-D_MBCS" />
<Add option="-D_USRDLL" />
<Add option="-DLIBJACKDMP_EXPORTS" />
<Add option="-DREGEX_MALLOC" />
<Add option="-DSTDC_HEADERS" />
<Add option="-DSERVER_SIDE" />
<Add option="-D__SMP__" />
<Add directory="." />
<Add directory="..\windows" />
<Add directory="..\common\jack" />
<Add directory="..\common" />
</Compiler>
<Linker>
<Add directory="Release\bin" />
</Linker>
</Target>
<Target title="Win32 Debug">
<Option output="Debug\bin\libjackserver" prefix_auto="1" extension_auto="1" />
<Option object_output="Debug" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-Wall" />
<Add option="-g" />
<Add option="-DWIN32" />
<Add option="-D_DEBUG" />
<Add option="-D_WINDOWS" />
<Add option="-D_MBCS" />
<Add option="-D_USRDLL" />
<Add option="-DLIBJACKDMP_EXPORTS" />
<Add option="-DREGEX_MALLOC" />
<Add option="-DSTDC_HEADERS" />
<Add option="-DSERVER_SIDE" />
<Add option="-D__SMP__" />
<Add directory="." />
<Add directory="..\windows" />
<Add directory="..\common\jack" />
<Add directory="..\common" />
</Compiler>
<Linker>
<Add directory="Debug\bin" />
</Linker>
</Target>
<Target title="Win32 Profiling">
<Option output="Release\bin\libjackserver" prefix_auto="1" extension_auto="1" />
<Option object_output="Release" />
<Option type="3" />
<Option compiler="gcc" />
<Option createDefFile="1" />
<Option createStaticLib="1" />
<Compiler>
<Add option="-O2" />
<Add option="-Wall" />
<Add option="-DWIN32" />
<Add option="-DNDEBUG" />
<Add option="-D_WINDOWS" />
<Add option="-D_MBCS" />
<Add option="-D_USRDLL" />
<Add option="-DLIBJACKDMP_EXPORTS" />
<Add option="-DREGEX_MALLOC" />
<Add option="-DSTDC_HEADERS" />
<Add option="-DSERVER_SIDE" />
<Add option="-D__SMP__" />
<Add option="-DJACK_MONITOR" />
<Add directory="." />
<Add directory="..\windows" />
<Add directory="..\common\jack" />
<Add directory="..\common" />
</Compiler>
<Linker>
<Add directory="Release\bin" />
</Linker>
</Target>
</Build>
<Compiler>
<Add option="-Wall" />
<Add directory="." />
<Add directory="..\common" />
<Add directory="..\common\jack" />
</Compiler>
<Linker>
<Add library="kernel32" />
<Add library="user32" />
<Add library="gdi32" />
<Add library="winspool" />
<Add library="comdlg32" />