allow manipulating midi files using midi_router

This commit is contained in:
derselbst 2018-06-11 17:50:35 +02:00
parent b3cb079b60
commit 5c83c9748b
1 changed files with 13 additions and 11 deletions

View File

@ -609,15 +609,6 @@ int main(int argc, char** argv)
}
}
/* start the midi router and link it to the synth */
#if WITH_MIDI
if (midi_in) {
/* In dump mode, text output is generated for events going into and out of the router.
* The example dump functions are put into the chain before and after the router..
*/
//sequencer = new_fluid_sequencer2(0);
router = new_fluid_midi_router(
settings,
dump ? fluid_midi_dump_postrouter : fluid_synth_handle_midi_event,
@ -627,7 +618,15 @@ int main(int argc, char** argv)
fprintf(stderr, "Failed to create the MIDI input router; no MIDI input\n"
"will be available. You can access the synthesizer \n"
"through the console.\n");
} else {
}
/* start the midi router and link it to the synth */
#if WITH_MIDI
if (midi_in && router != NULL) {
/* In dump mode, text output is generated for events going into and out of the router.
* The example dump functions are put into the chain before and after the router..
*/
//sequencer = new_fluid_sequencer2(0);
mdriver = new_fluid_midi_driver(
settings,
dump ? fluid_midi_dump_prerouter : fluid_midi_router_handle_midi_event,
@ -638,7 +637,6 @@ int main(int argc, char** argv)
"through the console.\n");
}
}
}
#endif
/* play the midi files, if any */
@ -652,6 +650,10 @@ int main(int argc, char** argv)
"Continuing without a player.\n");
break;
}
if (router != NULL)
{
fluid_player_set_playback_callback(player, fluid_midi_router_handle_midi_event, router);
}
}
fluid_player_add(player, argv[i]);