Remove ALSA audio backend

This commit is contained in:
Jack Andersen
2018-08-18 12:08:58 -10:00
parent fe7f671c0b
commit 5e58e989a8
8 changed files with 171 additions and 463 deletions

View File

@@ -19,7 +19,7 @@ static inline double TimespecToDouble(struct timespec& ts)
struct LinuxMidi : BaseAudioVoiceEngine
{
std::vector<std::pair<std::string, std::string>> enumerateMIDIDevices() const
std::vector<std::pair<std::string, std::string>> enumerateMIDIInputs() const
{
std::vector<std::pair<std::string, std::string>> ret;
int status;
@@ -30,6 +30,9 @@ struct LinuxMidi : BaseAudioVoiceEngine
if (card < 0)
return {};
snd_rawmidi_info_t* info;
snd_rawmidi_info_malloc(&info);
while (card >= 0)
{
snd_ctl_t *ctl;
@@ -46,9 +49,9 @@ struct LinuxMidi : BaseAudioVoiceEngine
break;
if (device >= 0)
{
snd_rawmidi_info_t *info;
snd_rawmidi_info_alloca(&info);
snd_rawmidi_info_set_device(info, device);
if (snd_rawmidi_info_get_stream(info) != SND_RAWMIDI_STREAM_INPUT)
continue;
sprintf(name + strlen(name), ",%d", device);
ret.push_back(std::make_pair(name, snd_rawmidi_info_get_name(info)));
}
@@ -60,6 +63,8 @@ struct LinuxMidi : BaseAudioVoiceEngine
break;
}
snd_rawmidi_info_free(info);
return ret;
}