13
0

Rename panner member to twod_panner to avoid having _panner and panner member variables in the same class. Be sure to reconnect everything dropped at the top of set_panner() (fixes #3066)

git-svn-id: svn://localhost/ardour2/branches/3.0@6925 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Carl Hetherington 2010-04-17 22:51:22 +00:00
parent 0ec8383428
commit aed349f45b
2 changed files with 33 additions and 23 deletions

View File

@ -125,7 +125,7 @@ PannerUI::PannerUI (Session* s)
pack_start (pan_vbox, true, true); pack_start (pan_vbox, true, true);
panner = 0; twod_panner = 0;
big_window = 0; big_window = 0;
set_width(Narrow); set_width(Narrow);
@ -144,8 +144,8 @@ PannerUI::set_panner (boost::shared_ptr<Panner> p)
_panner = p; _panner = p;
delete panner; delete twod_panner;
panner = 0; twod_panner = 0;
if (!_panner) { if (!_panner) {
return; return;
@ -155,6 +155,10 @@ PannerUI::set_panner (boost::shared_ptr<Panner> p)
_panner->LinkStateChanged.connect (connections, invalidator (*this), boost::bind (&PannerUI::update_pan_linkage, this), gui_context()); _panner->LinkStateChanged.connect (connections, invalidator (*this), boost::bind (&PannerUI::update_pan_linkage, this), gui_context());
_panner->StateChanged.connect (connections, invalidator (*this), boost::bind (&PannerUI::update_pan_state, this), gui_context()); _panner->StateChanged.connect (connections, invalidator (*this), boost::bind (&PannerUI::update_pan_state, this), gui_context());
for (uint32_t i = 0; i < _panner->npanners(); ++i) {
connect_to_pan_control (i);
}
setup_pan (); setup_pan ();
pan_changed (0); pan_changed (0);
@ -309,7 +313,7 @@ PannerUI::~PannerUI ()
delete (*i); delete (*i);
} }
delete panner; delete twod_panner;
delete big_window; delete big_window;
delete pan_menu; delete pan_menu;
delete pan_astyle_menu; delete pan_astyle_menu;
@ -358,8 +362,8 @@ PannerUI::setup_pan ()
pan_adjustments.pop_back (); pan_adjustments.pop_back ();
} }
delete panner; delete twod_panner;
panner = 0; twod_panner = 0;
/* stick something into the panning viewport so that it redraws */ /* stick something into the panning viewport so that it redraws */
@ -379,8 +383,8 @@ PannerUI::setup_pan ()
pan_adjustments.pop_back (); pan_adjustments.pop_back ();
} }
delete panner; delete twod_panner;
panner = 0; twod_panner = 0;
while ((asz = pan_adjustments.size()) < npans) { while ((asz = pan_adjustments.size()) < npans) {
@ -409,8 +413,7 @@ PannerUI::setup_pan ()
/* now set adjustment with current value of panner, then connect the signals */ /* now set adjustment with current value of panner, then connect the signals */
pan_adjustments.back()->set_value(rx); pan_adjustments.back()->set_value(rx);
pan_adjustments.back()->signal_value_changed().connect (sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_adjustment_changed), (uint32_t) asz)); pan_adjustments.back()->signal_value_changed().connect (sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_adjustment_changed), (uint32_t) asz));
connect_to_pan_control (asz);
_panner->pan_control( asz )->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::pan_value_changed, this, (uint32_t) asz), gui_context());
bc->set_name ("PanSlider"); bc->set_name ("PanSlider");
bc->set_shadow_type (Gtk::SHADOW_NONE); bc->set_shadow_type (Gtk::SHADOW_NONE);
@ -448,26 +451,26 @@ PannerUI::setup_pan ()
} else { } else {
if (!panner) { if (!twod_panner) {
panner = new Panner2d (_panner, 61); twod_panner = new Panner2d (_panner, 61);
panner->set_name ("MixerPanZone"); twod_panner->set_name ("MixerPanZone");
panner->show (); twod_panner->show ();
panner->signal_button_press_event().connect twod_panner->signal_button_press_event().connect
(sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_button_event), (uint32_t) 0), false); (sigc::bind (sigc::mem_fun(*this, &PannerUI::pan_button_event), (uint32_t) 0), false);
} }
update_pan_sensitive (); update_pan_sensitive ();
panner->reset (npans); twod_panner->reset (npans);
if (big_window) { if (big_window) {
big_window->reset (npans); big_window->reset (npans);
} }
panner->set_size_request (-1, 61); twod_panner->set_size_request (-1, 61);
/* and finally, add it to the panner frame */ /* and finally, add it to the panner frame */
panning_viewport.remove (); panning_viewport.remove ();
panning_viewport.add (*panner); panning_viewport.add (*twod_panner);
panning_viewport.show_all (); panning_viewport.show_all ();
} }
} }
@ -477,7 +480,7 @@ PannerUI::pan_button_event (GdkEventButton* ev, uint32_t which)
{ {
switch (ev->button) { switch (ev->button) {
case 1: case 1:
if (panner && ev->type == GDK_2BUTTON_PRESS) { if (twod_panner && ev->type == GDK_2BUTTON_PRESS) {
if (!big_window) { if (!big_window) {
big_window = new Panner2dWindow (_panner, 400, _panner->npanners()); big_window = new Panner2dWindow (_panner, 400, _panner->npanners());
} }
@ -722,8 +725,8 @@ PannerUI::update_pan_sensitive ()
} }
break; break;
default: default:
if (panner) { if (twod_panner) {
panner->set_sensitive (sensitive); twod_panner->set_sensitive (sensitive);
} }
if (big_window) { if (big_window) {
big_window->set_sensitive (sensitive); big_window->set_sensitive (sensitive);
@ -900,4 +903,9 @@ PannerUI::set_mono (bool yn)
update_pan_sensitive (); update_pan_sensitive ();
} }
void
PannerUI::connect_to_pan_control (uint32_t i)
{
_panner->pan_control(i)->Changed.connect (connections, invalidator (*this), boost::bind (&PannerUI::pan_value_changed, this, i), gui_context ());
}

View File

@ -91,7 +91,7 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
static const int pan_bar_height; static const int pan_bar_height;
Panner2d* panner; ///< 2D panner, or 0 Panner2d* twod_panner; ///< 2D panner, or 0
Panner2dWindow* big_window; Panner2dWindow* big_window;
Gtk::VBox pan_bar_packer; Gtk::VBox pan_bar_packer;
@ -143,6 +143,8 @@ class PannerUI : public Gtk::HBox, public ARDOUR::SessionHandlePtr
bool pan_button_event (GdkEventButton*, uint32_t which); bool pan_button_event (GdkEventButton*, uint32_t which);
void connect_to_pan_control (uint32_t);
Gtk::Menu* pan_menu; Gtk::Menu* pan_menu;
Gtk::CheckMenuItem* bypass_menu_item; Gtk::CheckMenuItem* bypass_menu_item;
void build_pan_menu (uint32_t which); void build_pan_menu (uint32_t which);