diff --git a/fluidsynth/src/config_macosx.h b/fluidsynth/src/config_macosx.h index d082886b..036c75d4 100755 --- a/fluidsynth/src/config_macosx.h +++ b/fluidsynth/src/config_macosx.h @@ -17,3 +17,5 @@ /* define to support DARWIN */ #define DARWIN + +typedef int socklen_t diff --git a/fluidsynth/src/config_macosx_pb.h b/fluidsynth/src/config_macosx_pb.h index e1b72fee..4b019163 100644 --- a/fluidsynth/src/config_macosx_pb.h +++ b/fluidsynth/src/config_macosx_pb.h @@ -1,5 +1,5 @@ -#define VERSION "0.2.4" +#define VERSION "1.0.x" #define MACINTOSH @@ -33,3 +33,5 @@ #define PORTAUDIO_SUPPORT 1 #define __Types__ */ + +typedef int socklen_t diff --git a/fluidsynth/src/fluid_adriver.c b/fluidsynth/src/fluid_adriver.c index 7624f893..773aed74 100644 --- a/fluidsynth/src/fluid_adriver.c +++ b/fluidsynth/src/fluid_adriver.c @@ -70,6 +70,7 @@ void fluid_core_audio_driver_settings(fluid_settings_t* settings); fluid_audio_driver_t* new_fluid_dsound_audio_driver(fluid_settings_t* settings, fluid_synth_t* synth); int delete_fluid_dsound_audio_driver(fluid_audio_driver_t* p); +void fluid_dsound_audio_driver_settings(fluid_settings_t* settings); #endif #if PORTAUDIO_SUPPORT @@ -128,7 +129,7 @@ fluid_audriver_definition_t fluid_audio_drivers[] = { new_fluid_dsound_audio_driver, NULL, delete_fluid_dsound_audio_driver, - NULL }, + fluid_dsound_audio_driver_settings }, #endif #if PORTAUDIO_SUPPORT { "portaudio", diff --git a/fluidsynth/src/fluid_alsa.c b/fluidsynth/src/fluid_alsa.c index d1ff9306..74e12d0d 100644 --- a/fluidsynth/src/fluid_alsa.c +++ b/fluidsynth/src/fluid_alsa.c @@ -508,7 +508,7 @@ static void* fluid_alsa_audio_run_s16(void* d) if (snd_pcm_nonblock(dev->pcm, 0) != 0) { /* double negation */ FLUID_LOG(FLUID_ERR, "Failed to set the audio device to blocking mode"); - goto error_recovery; + goto error_recovery; } if (snd_pcm_prepare(dev->pcm) != 0) { diff --git a/fluidsynth/src/fluid_dsound.c b/fluidsynth/src/fluid_dsound.c index acf4acc3..8f02d5d1 100644 --- a/fluidsynth/src/fluid_dsound.c +++ b/fluidsynth/src/fluid_dsound.c @@ -62,6 +62,20 @@ typedef struct { DWORD frame_size; } fluid_dsound_audio_driver_t; +static BOOL +fluid_dsound_enum_callback(LPGUID guid, LPCSTR description, LPCSTR module, LPVOID context) +{ + fluid_settings_t* settings = (fluid_settings_t*) context; + fluid_settings_add_option(settings, "audio.dsound.device", description); +} + +void fluid_dsound_audio_driver_settings(fluid_settings_t* settings) +{ + fluid_settings_register_str(settings, "audio.dsound.device", "default", 0, NULL, NULL); + fluid_settings_add_option(settings, "audio.dsound.device", "default"); + DirectSoundEnumerate((LPDSENUMCALLBACK) fluid_dsound_enum_callback, settings); +} + /* * new_fluid_dsound_audio_driver @@ -377,7 +391,7 @@ int fluid_win32_create_window(void) myClass.hCursor = LoadCursor( NULL, IDC_ARROW ); myClass.hIcon = NULL; myClass.lpszMenuName = (LPSTR) NULL; - myClass.lpszClassName = (LPSTR) "FLUIDSynth"; + myClass.lpszClassName = (LPSTR) "FluidSynth"; myClass.hbrBackground = (HBRUSH)(COLOR_WINDOW); myClass.hInstance = FLUID_HINSTANCE; myClass.style = CS_GLOBALCLASS; @@ -387,7 +401,7 @@ int fluid_win32_create_window(void) if (!RegisterClass(&myClass)) { return -100; } - fluid_wnd = CreateWindow((LPSTR) "FLUIDSynth", (LPSTR) "FLUIDSynth", WS_OVERLAPPEDWINDOW, + fluid_wnd = CreateWindow((LPSTR) "FluidSynth", (LPSTR) "FluidSynth", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 400, 300, (HWND) NULL, (HMENU) NULL, FLUID_HINSTANCE, (LPSTR) NULL); if (fluid_wnd == NULL) { @@ -402,8 +416,7 @@ int fluid_win32_destroy_window(void) if (fluid_wnd != NULL) { DestroyWindow(fluid_wnd); fluid_wnd = NULL; - - UnregisterClass((LPSTR) "FLUIDSynth",FLUID_HINSTANCE); + UnregisterClass((LPSTR) "FluidSynth", FLUID_HINSTANCE); } return 0; } diff --git a/fluidsynth/src/fluid_midishare.c b/fluidsynth/src/fluid_midishare.c index 2346cb6f..dcdbfa2e 100644 --- a/fluidsynth/src/fluid_midishare.c +++ b/fluidsynth/src/fluid_midishare.c @@ -27,6 +27,7 @@ * 21/12/01 : Add a compilation flag (MIDISHARE_DRIVER) for driver or application mode * 29/01/02 : Compilation on MacOSX, use a task for typeNote management * 03/06/03 : Adapdation for FluidSynth API + * 18/03/04 : In appplication mode, connect MidiShare to the fluidsynth client (fluid_midishare_open_appl) */ #include "config.h" @@ -139,7 +140,6 @@ new_fluid_midishare_midi_driver(fluid_settings_t* settings, MidiSetFilter(dev->refnum, dev->filter); dev->status = FLUID_MIDI_READY; - return (fluid_midi_driver_t*) dev; error_recovery: @@ -393,6 +393,7 @@ static int fluid_midishare_open_appl (fluid_midishare_midi_driver_t* dev) return 0; } MidiSetRcvAlarm(dev->refnum, fluid_midishare_midi_driver_receive); + MidiConnect(0,dev->refnum,true); #endif return 1; } diff --git a/fluidsynth/src/fluid_synth.c b/fluidsynth/src/fluid_synth.c index e6ec3827..faf9b337 100644 --- a/fluidsynth/src/fluid_synth.c +++ b/fluidsynth/src/fluid_synth.c @@ -1540,21 +1540,21 @@ fluid_synth_nwrite_float(fluid_synth_t* synth, int len, /* Then, run one_block() and copy till we have 'len' samples */ while (count < len) { - fluid_synth_one_block(synth, 1); + fluid_synth_one_block(synth, 1); - num = (FLUID_BUFSIZE > len - count)? len - count : FLUID_BUFSIZE; - bytes = num * sizeof(float); - - for (i = 0; i < synth->audio_channels; i++) { - FLUID_MEMCPY(left[i] + count, left_in[i], bytes); - FLUID_MEMCPY(right[i] + count, right_in[i], bytes); - } - for (i = 0; i < synth->effects_channels; i++) { - FLUID_MEMCPY(fx_left[i] + count, fx_left_in[i], bytes); - FLUID_MEMCPY(fx_right[i] + count, fx_right_in[i], bytes); - } - - count += num; + num = (FLUID_BUFSIZE > len - count)? len - count : FLUID_BUFSIZE; + bytes = num * sizeof(float); + + for (i = 0; i < synth->audio_channels; i++) { + FLUID_MEMCPY(left[i] + count, left_in[i], bytes); + FLUID_MEMCPY(right[i] + count, right_in[i], bytes); + } + for (i = 0; i < synth->effects_channels; i++) { + FLUID_MEMCPY(fx_left[i] + count, fx_left_in[i], bytes); + FLUID_MEMCPY(fx_right[i] + count, fx_right_in[i], bytes); + } + + count += num; } synth->cur = num; @@ -1747,15 +1747,17 @@ fluid_synth_one_block(fluid_synth_t* synth, int do_not_mix_fx_to_out) if (_PLAYING(voice)) { double prof_ref_voice = fluid_profile_ref(); - /* The output associated with a MIDI channel is wrapped around using the number of - * audio groups as modulo divider. - * This is typically the number of output channels on the 'sound card', as long as the - * LADSPA Fx unit is not used. In case of LADSPA unit, think of it as subgroups on a mixer. + /* The output associated with a MIDI channel is wrapped around + * using the number of audio groups as modulo divider. This is + * typically the number of output channels on the 'sound card', + * as long as the LADSPA Fx unit is not used. In case of LADSPA + * unit, think of it as subgroups on a mixer. + * * For example: Assume that the number of groups is set to 2. - * Then MIDI channel 1, 3, 5, 7 etc. go to output 1, channels 2, 4, 6, 8 etc to output 2. - * Or assume 3 groups: - * Then MIDI channels 1, 4, 7, 10 etc go to output 1; 2, 5, 8, 11 etc to output 2, - * 3, 6, 9, 12 etc to output 3. + * Then MIDI channel 1, 3, 5, 7 etc. go to output 1, channels 2, + * 4, 6, 8 etc to output 2. Or assume 3 groups: Then MIDI + * channels 1, 4, 7, 10 etc go to output 1; 2, 5, 8, 11 etc to + * output 2, 3, 6, 9, 12 etc to output 3. */ auchan = fluid_channel_get_num(fluid_voice_get_channel(voice)); auchan %= synth->audio_groups; diff --git a/fluidsynth/src/fluidsynth.c b/fluidsynth/src/fluidsynth.c index 39dbdacf..5fa90a30 100644 --- a/fluidsynth/src/fluidsynth.c +++ b/fluidsynth/src/fluidsynth.c @@ -682,7 +682,6 @@ print_welcome() "under certain conditions; see the COPYING file for details.\n" "SoundFont(R) is a registered trademark of E-mu Systems, Inc.\n\n" "Type 'help' to get information on the shell commands.\n\n", FLUIDSYNTH_VERSION); - } /*