git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3091 0c269be4-1314-0410-8aa9-9f06e86f4224tags/1.9.1
| @@ -1,6 +1,6 @@ | |||
| /* | |||
| Copyright (C) 2002 Anthony Van Groningen | |||
| This program is free software; you can redistribute it and/or modify | |||
| it under the terms of the GNU General Public License as published by | |||
| the Free Software Foundation; either version 2 of the License, or | |||
| @@ -21,7 +21,16 @@ | |||
| typedef jack_default_audio_sample_t sample_t; | |||
| const double PI = 3.14; | |||
| const double PI = 3.14; | |||
| static void JackSleep(int sec) | |||
| { | |||
| #ifdef WIN32 | |||
| Sleep(sec * 1000); | |||
| #else | |||
| sleep(sec); | |||
| #endif | |||
| } | |||
| int ExternalMetro::process_audio (jack_nframes_t nframes, void* arg) | |||
| { | |||
| @@ -88,7 +97,7 @@ ExternalMetro::ExternalMetro(int freq, double max_amp, int dur_arg, int bpm, cha | |||
| fprintf (stderr, "invalid duration (tone length = %" PRIu32 | |||
| ", wave length = %" PRIu32 "\n", tone_length, | |||
| wave_length); | |||
| */ | |||
| */ | |||
| return ; | |||
| } | |||
| if (attack_length + decay_length > (int)tone_length) { | |||
| @@ -136,7 +145,7 @@ int main (int argc, char *argv[]) | |||
| ExternalMetro* client3 = NULL; | |||
| ExternalMetro* client4 = NULL; | |||
| ExternalMetro* client5 = NULL; | |||
| printf("Testing multiple Jack clients in one process: open 5 metro clients...\n"); | |||
| client1 = new ExternalMetro(1200, 0.4, 20, 80, "t1"); | |||
| client2 = new ExternalMetro(600, 0.4, 20, 150, "t2"); | |||
| @@ -146,7 +155,7 @@ int main (int argc, char *argv[]) | |||
| printf("Type 'c' to close alls client and go to next test...\n"); | |||
| while ((getchar() != 'c')) { | |||
| sleep(1); | |||
| JackSleep(1); | |||
| }; | |||
| delete client1; | |||
| @@ -154,31 +163,31 @@ int main (int argc, char *argv[]) | |||
| delete client3; | |||
| delete client4; | |||
| delete client5; | |||
| printf("Testing quiting the server while a client is running...\n"); | |||
| client1 = new ExternalMetro(1200, 0.4, 20, 80, "t1"); | |||
| printf("Now quit the server, shutdown callback should be called...\n"); | |||
| printf("Type 'c' move on...\n"); | |||
| while ((getchar() != 'c')) { | |||
| sleep(1); | |||
| JackSleep(1); | |||
| }; | |||
| printf("Closing client...\n"); | |||
| delete client1; | |||
| printf("Now start the server again...\n"); | |||
| printf("Now start the server again...\n"); | |||
| printf("Type 'c' move on...\n"); | |||
| while ((getchar() != 'c')) { | |||
| sleep(1); | |||
| JackSleep(1); | |||
| }; | |||
| printf("Opening a new client....\n"); | |||
| printf("Opening a new client....\n"); | |||
| client1 = new ExternalMetro(1200, 0.4, 20, 80, "t1"); | |||
| printf("Type 'q' to quit...\n"); | |||
| while ((getchar() != 'q')) { | |||
| sleep(1); | |||
| JackSleep(1); | |||
| }; | |||
| delete client1; | |||
| return 0; | |||
| @@ -42,6 +42,9 @@ | |||
| <Project filename="jack_disconnect.cbp"> | |||
| <Depends filename="libjack.cbp" /> | |||
| </Project> | |||
| <Project filename="jack_test.cbp" active="1" /> | |||
| <Project filename="jack_test.cbp" /> | |||
| <Project filename="multiple_metro.cbp" active="1"> | |||
| <Depends filename="libjack.cbp" /> | |||
| </Project> | |||
| </Workspace> | |||
| </CodeBlocks_workspace_file> | |||
| @@ -0,0 +1,93 @@ | |||
| <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> | |||
| <CodeBlocks_project_file> | |||
| <FileVersion major="1" minor="6" /> | |||
| <Project> | |||
| <Option title="multiple_metro" /> | |||
| <Option pch_mode="2" /> | |||
| <Option compiler="gcc" /> | |||
| <Build> | |||
| <Target title="Win32 Release"> | |||
| <Option output="Release\bin\multiple_metro" prefix_auto="1" extension_auto="1" /> | |||
| <Option object_output="Release\" /> | |||
| <Option type="1" /> | |||
| <Option compiler="gcc" /> | |||
| <Compiler> | |||
| <Add option="-O2" /> | |||
| <Add option="-Wall" /> | |||
| <Add directory="..\example-clients" /> | |||
| <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\multiple_metro" prefix_auto="1" extension_auto="1" /> | |||
| <Option object_output="Debug\" /> | |||
| <Option type="1" /> | |||
| <Option compiler="gcc" /> | |||
| <Compiler> | |||
| <Add option="-g" /> | |||
| <Add directory="..\tests" /> | |||
| <Add directory="..\windows" /> | |||
| <Add directory="..\common\jack" /> | |||
| <Add directory="..\common" /> | |||
| </Compiler> | |||
| <Linker> | |||
| <Add directory="Debug\bin" /> | |||
| </Linker> | |||
| </Target> | |||
| <Target title="Win32 Monitor"> | |||
| <Option output="Release\bin\multiple_metro" prefix_auto="1" extension_auto="1" /> | |||
| <Option object_output="Release\" /> | |||
| <Option type="1" /> | |||
| <Option compiler="gcc" /> | |||
| <Compiler> | |||
| <Add option="-O2" /> | |||
| <Add option="-Wall" /> | |||
| <Add option="-DJACK_MONITOR" /> | |||
| <Add directory="..\tests" /> | |||
| <Add directory="..\windows" /> | |||
| <Add directory="..\common\jack" /> | |||
| <Add directory="..\common" /> | |||
| </Compiler> | |||
| <Linker> | |||
| <Add directory="Release\bin" /> | |||
| </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="libjack" /> | |||
| </Linker> | |||
| <Unit filename="..\tests\external_metro.cpp"> | |||
| <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="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> | |||