mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-21 10:22:11 +00:00
do MIDI device lookup by lump index as well, for the same reasons as doing it for the volume.
This commit is contained in:
parent
eb2f263803
commit
51e014c858
3 changed files with 5 additions and 4 deletions
|
@ -716,7 +716,6 @@ bool S_ChangeMusic(const char* musicname, int order, bool looping, bool force)
|
|||
}
|
||||
|
||||
ZMusic_MusicStream handle = nullptr;
|
||||
MidiDeviceSetting* devp = MidiDevices.CheckKey(musicname);
|
||||
|
||||
// Strip off any leading file:// component.
|
||||
if (strncmp(musicname, "file://", 7) == 0)
|
||||
|
@ -751,6 +750,8 @@ bool S_ChangeMusic(const char* musicname, int order, bool looping, bool force)
|
|||
else
|
||||
{
|
||||
int lumpnum = mus_cb.FindMusic(musicname);
|
||||
MidiDeviceSetting* devp = MidiDevices.CheckKey(lumpnum);
|
||||
|
||||
auto volp = MusicVolumes.CheckKey(lumpnum);
|
||||
if (volp)
|
||||
{
|
||||
|
|
|
@ -68,7 +68,7 @@ struct MidiDeviceSetting
|
|||
FString args;
|
||||
};
|
||||
|
||||
typedef TMap<FName, MidiDeviceSetting> MidiDeviceMap;
|
||||
typedef TMap<int, MidiDeviceSetting> MidiDeviceMap;
|
||||
typedef TMap<int, float> MusicVolumeMap;
|
||||
|
||||
extern MidiDeviceMap MidiDevices;
|
||||
|
|
|
@ -1077,7 +1077,7 @@ static void S_AddSNDINFO (int lump)
|
|||
|
||||
case SI_MidiDevice: {
|
||||
sc.MustGetString();
|
||||
FName nm = sc.String;
|
||||
int lumpnum = mus_cb.FindMusic(sc.String);
|
||||
FScanner::SavedPos save = sc.SavePos();
|
||||
|
||||
sc.SetCMode(true);
|
||||
|
@ -1109,7 +1109,7 @@ static void S_AddSNDINFO (int lump)
|
|||
sc.RestorePos(save);
|
||||
sc.MustGetString();
|
||||
}
|
||||
MidiDevices[nm] = devset;
|
||||
if (lumpnum >= 0) MidiDevices[lumpnum] = devset;
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in a new issue