Skip to content

Commit

Permalink
Added piece of Haiku native MIDI source code that got lost for some r…
Browse files Browse the repository at this point in the history
…eason.

Thanks to scottmc for the patch!
  • Loading branch information
icculus committed Sep 8, 2011
1 parent 1312544 commit e8954e5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions native_midi/native_midi_haiku.cpp
Expand Up @@ -259,3 +259,23 @@ void native_midi_start(NativeMidiSong *song)
currentSong = song;
}
void native_midi_stop()
{
if (currentSong == NULL) return;
currentSong->store->Stop();
currentSong->store->Disconnect(&synth);
while (currentSong->store->IsPlaying())
usleep(1000);
currentSong = NULL;
}
int native_midi_active()
{
if (currentSong == NULL) return 0;
return currentSong->store->CurrentEvent() < currentSong->store->CountEvents();
}

const char* native_midi_error(void)
{
return lasterr;
}

#endif /* __HAIKU__ */

0 comments on commit e8954e5

Please sign in to comment.