mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 03:36:32 +01:00
statically allocate midi-options
fixes possible segfault when the data in the vector goes out of scope due to RVO.
This commit is contained in:
parent
371bf59a94
commit
fb51bdb892
4 changed files with 18 additions and 10 deletions
|
|
@ -38,6 +38,7 @@ using namespace ARDOUR;
|
||||||
|
|
||||||
static std::string s_instance_name;
|
static std::string s_instance_name;
|
||||||
size_t AlsaAudioBackend::_max_buffer_size = 8192;
|
size_t AlsaAudioBackend::_max_buffer_size = 8192;
|
||||||
|
std::vector<std::string> AlsaAudioBackend::_midi_options;
|
||||||
|
|
||||||
AlsaAudioBackend::AlsaAudioBackend (AudioEngine& e, AudioBackendInfo& info)
|
AlsaAudioBackend::AlsaAudioBackend (AudioEngine& e, AudioBackendInfo& info)
|
||||||
: AudioBackend (e, info)
|
: AudioBackend (e, info)
|
||||||
|
|
@ -403,11 +404,12 @@ AlsaAudioBackend::midi_device_info(std::string const name) const {
|
||||||
std::vector<std::string>
|
std::vector<std::string>
|
||||||
AlsaAudioBackend::enumerate_midi_options () const
|
AlsaAudioBackend::enumerate_midi_options () const
|
||||||
{
|
{
|
||||||
std::vector<std::string> m;
|
if (_midi_options.empty()) {
|
||||||
m.push_back (_("None"));
|
_midi_options.push_back (_("None"));
|
||||||
m.push_back (_("ALSA raw devices"));
|
_midi_options.push_back (_("ALSA raw devices"));
|
||||||
m.push_back (_("ALSA sequencer"));
|
_midi_options.push_back (_("ALSA sequencer"));
|
||||||
return m;
|
}
|
||||||
|
return _midi_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<AudioBackend::DeviceStatus>
|
std::vector<AudioBackend::DeviceStatus>
|
||||||
|
|
|
||||||
|
|
@ -302,6 +302,7 @@ class AlsaAudioBackend : public AudioBackend {
|
||||||
bool _freewheeling;
|
bool _freewheeling;
|
||||||
bool _measure_latency;
|
bool _measure_latency;
|
||||||
|
|
||||||
|
static std::vector<std::string> _midi_options;
|
||||||
std::string _audio_device;
|
std::string _audio_device;
|
||||||
std::string _midi_driver_option;
|
std::string _midi_driver_option;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ using namespace ARDOUR;
|
||||||
|
|
||||||
static std::string s_instance_name;
|
static std::string s_instance_name;
|
||||||
size_t DummyAudioBackend::_max_buffer_size = 8192;
|
size_t DummyAudioBackend::_max_buffer_size = 8192;
|
||||||
|
std::vector<std::string> DummyAudioBackend::_midi_options;
|
||||||
|
|
||||||
DummyAudioBackend::DummyAudioBackend (AudioEngine& e, AudioBackendInfo& info)
|
DummyAudioBackend::DummyAudioBackend (AudioEngine& e, AudioBackendInfo& info)
|
||||||
: AudioBackend (e, info)
|
: AudioBackend (e, info)
|
||||||
|
|
@ -249,15 +250,17 @@ DummyAudioBackend::systemic_output_latency () const
|
||||||
return _systemic_output_latency;
|
return _systemic_output_latency;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* MIDI */
|
/* MIDI */
|
||||||
std::vector<std::string>
|
std::vector<std::string>
|
||||||
DummyAudioBackend::enumerate_midi_options () const
|
DummyAudioBackend::enumerate_midi_options () const
|
||||||
{
|
{
|
||||||
std::vector<std::string> m;
|
if (_midi_options.empty()) {
|
||||||
m.push_back (_("1 in, 1 out"));
|
_midi_options.push_back (_("1 in, 1 out"));
|
||||||
m.push_back (_("2 in, 2 out"));
|
_midi_options.push_back (_("2 in, 2 out"));
|
||||||
m.push_back (_("8 in, 8 out"));
|
_midi_options.push_back (_("8 in, 8 out"));
|
||||||
return m;
|
}
|
||||||
|
return _midi_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
||||||
|
|
@ -292,6 +292,8 @@ class DummyAudioBackend : public AudioBackend {
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string _instance_name;
|
std::string _instance_name;
|
||||||
|
static std::vector<std::string> _midi_options;
|
||||||
|
|
||||||
bool _running;
|
bool _running;
|
||||||
bool _freewheeling;
|
bool _freewheeling;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue