13
0

Plugin UI state should of course be saved per-session rather than globally.

git-svn-id: svn://localhost/ardour2/branches/3.0@7646 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-08-18 03:17:07 +00:00
parent 0d34f2487d
commit f9d0879e86
6 changed files with 31 additions and 2 deletions

View File

@ -2100,6 +2100,16 @@ ARDOUR_UI::snapshot_session (bool switch_to_it)
void
ARDOUR_UI::save_state (const string & name, bool switch_to_it)
{
XMLNode* node = new XMLNode (X_("UI"));
for (list<WindowProxyBase*>::iterator i = _window_proxies.begin(); i != _window_proxies.end(); ++i) {
if (!(*i)->rc_configured()) {
node->add_child_nocopy (*((*i)->get_state ()));
}
}
_session->add_extra_xml (*node);
save_state_canfail (name, switch_to_it);
}

View File

@ -676,7 +676,9 @@ ARDOUR_UI::save_ardour_state ()
XMLNode* window_node = new XMLNode (X_("UI"));
for (list<WindowProxyBase*>::iterator i = _window_proxies.begin(); i != _window_proxies.end(); ++i) {
window_node->add_child_nocopy (*((*i)->get_state ()));
if ((*i)->rc_configured()) {
window_node->add_child_nocopy (*((*i)->get_state ()));
}
}
/* tearoffs */

View File

@ -996,7 +996,7 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr<Processor> w)
ProcessorWindowProxy* wp = new ProcessorWindowProxy (
string_compose ("%1-%2-%3", loc, _route->id(), p->id()),
Config->extra_xml (X_("UI")),
_session->extra_xml (X_("UI")),
this,
w);

View File

@ -83,6 +83,9 @@ public:
ProcessorWindowProxy (std::string const &, XMLNode const *, ProcessorBox *, boost::weak_ptr<ARDOUR::Processor>);
void show ();
bool rc_configured () const {
return false;
}
boost::weak_ptr<ARDOUR::Processor> processor () const {
return _processor;

View File

@ -35,6 +35,10 @@ WindowProxyBase::WindowProxyBase (string const & name, XMLNode const * node)
, _width (-1)
, _height (-1)
{
if (!node) {
return;
}
XMLNodeList children = node->children ();
XMLNodeList::const_iterator i = children.begin ();

View File

@ -51,6 +51,12 @@ public:
/** Show this window */
virtual void show () = 0;
/** @return true if the configuration for this window should be
* global (ie across all sessions), otherwise false if it should
* be session-specific.
*/
virtual bool rc_configured () const = 0;
virtual Gtk::Window* get_gtk_window () const = 0;
private:
@ -124,6 +130,10 @@ public:
}
}
bool rc_configured () const {
return true;
}
private:
std::string _action;
};