Skip to content

Commit

Permalink
OS X|Audio: Use CoreAudio's DLS soundfont if no other specified
Browse files Browse the repository at this point in the history
If 'music-soundfont' is empty (the default), we will now try to load
the CoreAudio basic DLS soundfont.
  • Loading branch information
skyjake committed Oct 7, 2013
1 parent 4351e38 commit 8e75516
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions doomsday/client/src/audio/s_mus.cpp
Expand Up @@ -109,8 +109,7 @@ boolean Mus_Init(void)
}

// Tell the audio driver about our soundfont config.
AudioDriver_Music_Set(AUDIOP_SOUNDFONT_FILENAME,
de::NativePath(soundFontPath).expand().toString().toLatin1().constData());
Mus_UpdateSoundFont();

musAvail = true;
return true;
Expand Down Expand Up @@ -448,8 +447,18 @@ int Mus_Start(ded_music_t* def, boolean looped)

static void Mus_UpdateSoundFont(void)
{
de::NativePath path(soundFontPath);

#ifdef MACOSX
// On OS X we can try to use the basic DLS soundfont that's part of CoreAudio.
if(path.isEmpty())
{
path = "/System/Library/Components/CoreAudio.component/Contents/Resources/gs_instruments.dls";
}
#endif

AudioDriver_Music_Set(AUDIOP_SOUNDFONT_FILENAME,
de::NativePath(Con_GetString("music-soundfont")).expand().toString().toLatin1().constData());
path.expand().toString().toLatin1().constData());
}

/**
Expand Down

0 comments on commit 8e75516

Please sign in to comment.