mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
always save/keep audio/MIDI setup states so that they are available for use *after* instances where JACK was already running
This commit is contained in:
parent
1c49138e00
commit
bc1cc154dc
7 changed files with 46 additions and 40 deletions
|
|
@ -214,6 +214,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
|
||||||
}
|
}
|
||||||
|
|
||||||
ui_config = new UIConfiguration();
|
ui_config = new UIConfiguration();
|
||||||
|
_audio_midi_setup = new EngineControl;
|
||||||
|
|
||||||
editor = 0;
|
editor = 0;
|
||||||
mixer = 0;
|
mixer = 0;
|
||||||
|
|
@ -4145,3 +4146,19 @@ ARDOUR_UI::reset_route_peak_display (Route* route)
|
||||||
reset_peak_display ();
|
reset_peak_display ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EngineControl*
|
||||||
|
ARDOUR_UI::audio_midi_setup_widget ()
|
||||||
|
{
|
||||||
|
/* remove widget from any existing parent, since it is about
|
||||||
|
to be packed somewhere else.
|
||||||
|
*/
|
||||||
|
|
||||||
|
Gtk::Container* parent = _audio_midi_setup->get_parent ();
|
||||||
|
|
||||||
|
if (parent) {
|
||||||
|
parent->remove (*_audio_midi_setup);
|
||||||
|
}
|
||||||
|
|
||||||
|
return _audio_midi_setup;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ class BigClockWindow;
|
||||||
class BundleManager;
|
class BundleManager;
|
||||||
class ButtonJoiner;
|
class ButtonJoiner;
|
||||||
class ConnectionEditor;
|
class ConnectionEditor;
|
||||||
|
class EngineControl;
|
||||||
class KeyEditor;
|
class KeyEditor;
|
||||||
class LocationUIWindow;
|
class LocationUIWindow;
|
||||||
class MainClock;
|
class MainClock;
|
||||||
|
|
@ -288,6 +289,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
||||||
|
|
||||||
const std::string& announce_string() const { return _announce_string; }
|
const std::string& announce_string() const { return _announce_string; }
|
||||||
|
|
||||||
|
EngineControl* audio_midi_setup_widget();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class PublicEditor;
|
friend class PublicEditor;
|
||||||
|
|
||||||
|
|
@ -748,6 +751,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
|
||||||
|
|
||||||
std::string _announce_string;
|
std::string _announce_string;
|
||||||
void check_announcements ();
|
void check_announcements ();
|
||||||
|
|
||||||
|
EngineControl* _audio_midi_setup;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* __ardour_gui_h__ */
|
#endif /* __ardour_gui_h__ */
|
||||||
|
|
|
||||||
|
|
@ -647,11 +647,10 @@ ARDOUR_UI::save_ardour_state ()
|
||||||
window_node->add_child_nocopy (*tearoff_node);
|
window_node->add_child_nocopy (*tearoff_node);
|
||||||
|
|
||||||
Config->add_extra_xml (*window_node);
|
Config->add_extra_xml (*window_node);
|
||||||
|
Config->add_extra_xml (_audio_midi_setup->get_state());
|
||||||
|
|
||||||
if (_startup && _startup->engine_control() && _startup->engine_control()->was_used()) {
|
|
||||||
Config->add_extra_xml (_startup->engine_control()->get_state());
|
|
||||||
}
|
|
||||||
Config->save_state();
|
Config->save_state();
|
||||||
|
|
||||||
if (ui_config->dirty()) {
|
if (ui_config->dirty()) {
|
||||||
ui_config->save_state ();
|
ui_config->save_state ();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ EngineControl::EngineControl ()
|
||||||
#else
|
#else
|
||||||
, basic_packer (9, 2)
|
, basic_packer (9, 2)
|
||||||
#endif
|
#endif
|
||||||
, _used (false)
|
|
||||||
{
|
{
|
||||||
using namespace Notebook_Helpers;
|
using namespace Notebook_Helpers;
|
||||||
Label* label;
|
Label* label;
|
||||||
|
|
@ -471,31 +470,28 @@ EngineControl::get_state ()
|
||||||
XMLNode* root = new XMLNode ("AudioMIDISetup");
|
XMLNode* root = new XMLNode ("AudioMIDISetup");
|
||||||
std::string path;
|
std::string path;
|
||||||
|
|
||||||
if (_used) {
|
if (!states.empty()) {
|
||||||
|
XMLNode* state_nodes = new XMLNode ("EngineStates");
|
||||||
if (!states.empty()) {
|
|
||||||
XMLNode* state_nodes = new XMLNode ("EngineStates");
|
for (StateList::const_iterator i = states.begin(); i != states.end(); ++i) {
|
||||||
|
|
||||||
for (StateList::const_iterator i = states.begin(); i != states.end(); ++i) {
|
XMLNode* node = new XMLNode ("State");
|
||||||
|
|
||||||
XMLNode* node = new XMLNode ("State");
|
node->add_property ("backend", (*i).backend);
|
||||||
|
node->add_property ("driver", (*i).driver);
|
||||||
node->add_property ("backend", (*i).backend);
|
node->add_property ("device", (*i).device);
|
||||||
node->add_property ("driver", (*i).driver);
|
node->add_property ("sample-rate", (*i).sample_rate);
|
||||||
node->add_property ("device", (*i).device);
|
node->add_property ("buffer-size", (*i).buffer_size);
|
||||||
node->add_property ("sample-rate", (*i).sample_rate);
|
node->add_property ("input-latency", (*i).input_latency);
|
||||||
node->add_property ("buffer-size", (*i).buffer_size);
|
node->add_property ("output-latency", (*i).output_latency);
|
||||||
node->add_property ("input-latency", (*i).input_latency);
|
node->add_property ("input-channels", (*i).input_channels);
|
||||||
node->add_property ("output-latency", (*i).output_latency);
|
node->add_property ("output-channels", (*i).output_channels);
|
||||||
node->add_property ("input-channels", (*i).input_channels);
|
node->add_property ("active", (*i).active ? "yes" : "no");
|
||||||
node->add_property ("output-channels", (*i).output_channels);
|
|
||||||
node->add_property ("active", (*i).active ? "yes" : "no");
|
state_nodes->add_child_nocopy (*node);
|
||||||
|
|
||||||
state_nodes->add_child_nocopy (*node);
|
|
||||||
}
|
|
||||||
|
|
||||||
root->add_child_nocopy (*state_nodes);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
root->add_child_nocopy (*state_nodes);
|
||||||
}
|
}
|
||||||
|
|
||||||
return *root;
|
return *root;
|
||||||
|
|
@ -518,6 +514,7 @@ EngineControl::set_state (const XMLNode& root)
|
||||||
|
|
||||||
states.clear ();
|
states.clear ();
|
||||||
|
|
||||||
|
|
||||||
for (citer = clist.begin(); citer != clist.end(); ++citer) {
|
for (citer = clist.begin(); citer != clist.end(); ++citer) {
|
||||||
|
|
||||||
child = *citer;
|
child = *citer;
|
||||||
|
|
@ -653,13 +650,6 @@ EngineControl::setup_engine (bool start)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* we've used this dialog to configure the engine, which means
|
|
||||||
* that our state becomes relevant for saving (and thus
|
|
||||||
* implicitly, restoring.
|
|
||||||
*/
|
|
||||||
|
|
||||||
_used = true;
|
|
||||||
|
|
||||||
/* get a pointer to the current state object, creating one if
|
/* get a pointer to the current state object, creating one if
|
||||||
* necessary
|
* necessary
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,6 @@ class EngineControl : public Gtk::VBox {
|
||||||
static bool need_setup ();
|
static bool need_setup ();
|
||||||
int setup_engine (bool start);
|
int setup_engine (bool start);
|
||||||
|
|
||||||
bool was_used() const { return _used; }
|
|
||||||
XMLNode& get_state ();
|
XMLNode& get_state ();
|
||||||
void set_state (const XMLNode&);
|
void set_state (const XMLNode&);
|
||||||
|
|
||||||
|
|
@ -96,8 +95,6 @@ class EngineControl : public Gtk::VBox {
|
||||||
sigc::connection sr_connection;
|
sigc::connection sr_connection;
|
||||||
sigc::connection bs_connection;
|
sigc::connection bs_connection;
|
||||||
|
|
||||||
bool _used;
|
|
||||||
|
|
||||||
static bool engine_running ();
|
static bool engine_running ();
|
||||||
|
|
||||||
void driver_changed ();
|
void driver_changed ();
|
||||||
|
|
|
||||||
|
|
@ -314,7 +314,7 @@ ArdourStartup::session_folder ()
|
||||||
void
|
void
|
||||||
ArdourStartup::setup_audio_page ()
|
ArdourStartup::setup_audio_page ()
|
||||||
{
|
{
|
||||||
engine_dialog = manage (new EngineControl);
|
engine_dialog = ARDOUR_UI::instance()->audio_midi_setup_widget ();
|
||||||
|
|
||||||
engine_dialog->set_border_width (12);
|
engine_dialog->set_border_width (12);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -56,8 +56,6 @@ class ArdourStartup : public Gtk::Assistant {
|
||||||
bool use_session_template();
|
bool use_session_template();
|
||||||
std::string session_template_name();
|
std::string session_template_name();
|
||||||
|
|
||||||
EngineControl* engine_control() { return engine_dialog; }
|
|
||||||
|
|
||||||
// advanced session options
|
// advanced session options
|
||||||
|
|
||||||
bool create_master_bus() const;
|
bool create_master_bus() const;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue