13
0

add a try-autostart-engine option (most recently used settings)

This commit is contained in:
Robin Gareus 2016-04-18 14:11:22 +02:00
parent db56a4da71
commit 652468a344
3 changed files with 24 additions and 2 deletions

View File

@ -5122,10 +5122,19 @@ ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate)
audio_midi_setup->set_desired_sample_rate (desired_sample_rate);
audio_midi_setup->set_position (WIN_POS_CENTER);
int response;
// TODO make this a preference.
// (engine state is parsed by the GUI, but currently saved
// in preferences: ARDOUR::Config->extra_xml
// soooo where should this option go?)
if (getenv("TRY_AUTOSTART_ENGINE")) {
audio_midi_setup->try_autostart ();
if (ARDOUR::AudioEngine::instance()->running()) {
return 0;
}
}
while (true) {
response = audio_midi_setup->run();
int response = audio_midi_setup->run();
switch (response) {
case Gtk::RESPONSE_OK:
if (!AudioEngine::instance()->running()) {

View File

@ -423,6 +423,18 @@ EngineControl::on_show ()
ok_button->grab_focus();
}
bool
EngineControl::try_autostart ()
{
if (!start_stop_button.get_sensitive()) {
return false;
}
if (ARDOUR::AudioEngine::instance()->running()) {
return true;
}
return start_engine ();
}
bool
EngineControl::start_engine ()
{

View File

@ -49,6 +49,7 @@ class EngineControl : public ArdourDialog, public PBD::ScopedConnectionList {
bool set_state (const XMLNode&);
void set_desired_sample_rate (uint32_t);
bool try_autostart ();
private:
Gtk::Notebook notebook;