Index: src/music/extmidi.cpp =================================================================== --- src/music/extmidi.cpp (revision 25077) +++ src/music/extmidi.cpp (working copy) @@ -28,6 +28,7 @@ #ifndef EXTERNAL_PLAYER /** The default external midi player. */ #define EXTERNAL_PLAYER "timidity" +#define EXTERNAL_PLAYER_TIMIDITY #endif /** Factory for the midi player that uses external players. */ @@ -79,7 +80,7 @@ void MusicDriver_ExtMidi::SetVolume(byte vol) { - DEBUG(driver, 1, "extmidi: set volume not implemented"); + this->volume = vol; } void MusicDriver_ExtMidi::DoPlay() @@ -87,13 +88,25 @@ this->pid = fork(); switch (this->pid) { case 0: { + #ifdef EXTERNAL_PLAYER_TIMIDITY + char strvol[] = "-A000"; + sprintf(strvol, "-A%i", this->volume * 6); + #endif close(0); int d = open("/dev/null", O_RDONLY); if (d != -1 && dup2(d, 1) != -1 && dup2(d, 2) != -1) { - #if defined(MIDI_ARG) - execlp(this->command, "extmidi", MIDI_ARG, this->song, (char*)0); + #ifdef EXTERNAL_PLAYER_TIMIDITY + #if defined(MIDI_ARG) + execlp(this->command, "extmidi", MIDI_ARG, this->song, strvol, (char*)0); + #else + execlp(this->command, "extmidi", this->song, strvol, (char*)0); + #endif #else - execlp(this->command, "extmidi", this->song, (char*)0); + #if defined(MIDI_ARG) + execlp(this->command, "extmidi", MIDI_ARG, this->song, (char*)0); + #else + execlp(this->command, "extmidi", this->song, (char*)0); + #endif #endif } _exit(1); Index: src/music/extmidi.h =================================================================== --- src/music/extmidi.h (revision 25077) +++ src/music/extmidi.h (working copy) @@ -19,6 +19,7 @@ char *command; char song[MAX_PATH]; pid_t pid; + byte volume; void DoPlay(); void DoStop();