mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 15:25:01 +01:00
store void pointers to processor UIs in Processors, and reset ProcessorWindowProxy objects to use them, so that we can never create 2 windows (UIs) for the same processor
git-svn-id: svn://localhost/ardour2/branches/3.0@8638 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
deee47bcae
commit
b78d036aa0
3 changed files with 39 additions and 0 deletions
|
|
@ -1197,6 +1197,17 @@ ProcessorBox::maybe_add_processor_to_ui_list (boost::weak_ptr<Processor> w)
|
||||||
w);
|
w);
|
||||||
|
|
||||||
wp->marked = true;
|
wp->marked = true;
|
||||||
|
|
||||||
|
/* if the processor already has an existing UI,
|
||||||
|
note that so that we don't recreate it
|
||||||
|
*/
|
||||||
|
|
||||||
|
void* existing_ui = p->get_ui ();
|
||||||
|
|
||||||
|
if (existing_ui) {
|
||||||
|
wp->set (static_cast<Gtk::Window*>(existing_ui));
|
||||||
|
}
|
||||||
|
|
||||||
_processor_window_proxies.push_back (wp);
|
_processor_window_proxies.push_back (wp);
|
||||||
ARDOUR_UI::instance()->add_window_proxy (wp);
|
ARDOUR_UI::instance()->add_window_proxy (wp);
|
||||||
}
|
}
|
||||||
|
|
@ -2234,6 +2245,9 @@ void
|
||||||
ProcessorBox::set_processor_ui (boost::shared_ptr<Processor> p, Gtk::Window* w)
|
ProcessorBox::set_processor_ui (boost::shared_ptr<Processor> p, Gtk::Window* w)
|
||||||
{
|
{
|
||||||
list<ProcessorWindowProxy*>::iterator i = _processor_window_proxies.begin ();
|
list<ProcessorWindowProxy*>::iterator i = _processor_window_proxies.begin ();
|
||||||
|
|
||||||
|
p->set_ui (w);
|
||||||
|
|
||||||
while (i != _processor_window_proxies.end()) {
|
while (i != _processor_window_proxies.end()) {
|
||||||
boost::shared_ptr<Processor> t = (*i)->processor().lock ();
|
boost::shared_ptr<Processor> t = (*i)->processor().lock ();
|
||||||
if (t && t == p) {
|
if (t && t == p) {
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ class Processor : public SessionObject, public Automatable, public Latent
|
||||||
static const std::string state_node_name;
|
static const std::string state_node_name;
|
||||||
|
|
||||||
Processor(Session&, const std::string& name);
|
Processor(Session&, const std::string& name);
|
||||||
|
Processor (const Processor& other);
|
||||||
|
|
||||||
virtual ~Processor() { }
|
virtual ~Processor() { }
|
||||||
|
|
||||||
|
|
@ -99,6 +100,9 @@ class Processor : public SessionObject, public Automatable, public Latent
|
||||||
|
|
||||||
PBD::Signal0<void> ActiveChanged;
|
PBD::Signal0<void> ActiveChanged;
|
||||||
PBD::Signal2<void,ChanCount,ChanCount> ConfigurationChanged;
|
PBD::Signal2<void,ChanCount,ChanCount> ConfigurationChanged;
|
||||||
|
|
||||||
|
void set_ui (void*);
|
||||||
|
void* get_ui () const { return _ui_pointer; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual int set_state_2X (const XMLNode&, int version);
|
virtual int set_state_2X (const XMLNode&, int version);
|
||||||
|
|
@ -111,6 +115,7 @@ protected:
|
||||||
ChanCount _configured_output;
|
ChanCount _configured_output;
|
||||||
bool _display_to_user;
|
bool _display_to_user;
|
||||||
bool _pre_fader;
|
bool _pre_fader;
|
||||||
|
void* _ui_pointer;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ARDOUR
|
} // namespace ARDOUR
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,20 @@ Processor::Processor(Session& session, const string& name)
|
||||||
, _configured(false)
|
, _configured(false)
|
||||||
, _display_to_user (true)
|
, _display_to_user (true)
|
||||||
, _pre_fader (false)
|
, _pre_fader (false)
|
||||||
|
, _ui_pointer (0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Processor::Processor (const Processor& other)
|
||||||
|
: SessionObject(other.session(), other.name())
|
||||||
|
, Automatable (other.session())
|
||||||
|
, _pending_active(other._pending_active)
|
||||||
|
, _active(other._active)
|
||||||
|
, _next_ab_is_active(false)
|
||||||
|
, _configured(false)
|
||||||
|
, _display_to_user (true)
|
||||||
|
, _pre_fader (false)
|
||||||
|
, _ui_pointer (0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -279,3 +293,9 @@ Processor::set_pre_fader (bool p)
|
||||||
{
|
{
|
||||||
_pre_fader = p;
|
_pre_fader = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Processor::set_ui (void* p)
|
||||||
|
{
|
||||||
|
_ui_pointer = p;
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue