mirror of
https://github.com/AxioDL/boo.git
synced 2025-12-20 02:15:34 +00:00
Remove ALSA audio backend
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user