#include <limits.h>
-#include "ardour/io.h"
-#include "ardour/dB.h"
#include <gtkmm2ext/utils.h>
#include <gtkmm2ext/barcontroller.h>
+
#include "midi++/manager.h"
#include "pbd/fastlog.h"
+#include "ardour/pannable.h"
+#include "ardour/panner.h"
+#include "ardour/panner_shell.h"
+#include "ardour/session.h"
+
#include "ardour_ui.h"
#include "panner_ui.h"
#include "panner2d.h"
#include "stereo_panner.h"
#include "mono_panner.h"
-#include "ardour/delivery.h"
-#include "ardour/session.h"
-#include "ardour/panner.h"
-#include "ardour/pannable.h"
-#include "ardour/panner_shell.h"
-#include "ardour/route.h"
-
#include "i18n.h"
using namespace std;
pan_astyle_menu = 0;
in_pan_update = false;
_stereo_panner = 0;
+ _mono_panner = 0;
_ignore_width_change = false;
_ignore_position_change = false;
delete _stereo_panner;
_stereo_panner = 0;
+ delete _mono_panner;
+ _mono_panner = 0;
+
if (!_panner) {
return;
}
pan_astate_menu->items().clear ();
}
- pan_astate_menu->items().push_back (MenuElem (_("Manual"), sigc::bind (
+ /** TRANSLATORS: this is `Manual' in the sense of automation not being played,
+ so that changes to pan must be done by hand.
+ */
+ pan_astate_menu->items().push_back (MenuElem (S_("Automation|Manual"), sigc::bind (
sigc::mem_fun (_panner.get(), &Panner::set_automation_state),
- (AutoState) Off)));
+ (AutoState) ARDOUR::Off)));
pan_astate_menu->items().push_back (MenuElem (_("Play"), sigc::bind (
sigc::mem_fun (_panner.get(), &Panner::set_automation_state),
(AutoState) Play)));
pan_astyle_menu->items().push_back (MenuElem (_("Abs")));
}
-boost::shared_ptr<PBD::Controllable>
-PannerUI::get_controllable()
-{
- assert (!pan_bars.empty());
- return pan_bars[0]->get_controllable();
-}
-
void
PannerUI::on_size_allocate (Allocation& a)
{
PannerUI::~PannerUI ()
{
- for (vector<MonoPanner*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
- delete (*i);
- }
-
delete twod_panner;
delete big_window;
delete pan_menu;
void
PannerUI::setup_pan ()
{
- if (!_panner) {
- return;
- }
+ int const nouts = _panner ? _panner->out().n_audio() : -1;
+ int const nins = _panner ? _panner->in().n_audio() : -1;
- uint32_t const nouts = _panner->out().n_audio();
- uint32_t const nins = _panner->in().n_audio();
-
- if (int32_t (nouts) == _current_nouts && int32_t (nins) == _current_nins) {
+ if (nouts == _current_nouts && nins == _current_nins) {
return;
}
twod_panner = 0;
delete _stereo_panner;
_stereo_panner = 0;
+ delete _mono_panner;
+ _mono_panner = 0;
- if (nouts == 0 || nouts == 1) {
+ if (!_panner) {
+ return;
+ }
- delete _stereo_panner;
- delete twod_panner;
+ if (nouts == 0 || nouts == 1) {
/* stick something into the panning viewport so that it redraws */
EventBox* eb = manage (new EventBox());
pan_vbox.pack_start (*eb, false, false);
+ delete big_window;
+ big_window = 0;
+
} else if (nouts == 2) {
if (nins == 2) {
nins) << endmsg;
}
+ delete big_window;
+ big_window = 0;
} else {
bypass_menu_item->signal_toggled().connect (sigc::mem_fun(*this, &PannerUI::pan_bypass_toggle));
items.push_back (MenuElem (_("Reset"), sigc::mem_fun (*this, &PannerUI::pan_reset)));
+ items.push_back (MenuElem (_("Edit..."), sigc::mem_fun (*this, &PannerUI::pan_edit)));
}
void
}
}
+void
+PannerUI::pan_edit ()
+{
+ if (_mono_panner) {
+ _mono_panner->edit ();
+ } else if (_stereo_panner) {
+ _stereo_panner->edit ();
+ }
+}
+
void
PannerUI::pan_reset ()
{
{
if (_stereo_panner) {
_stereo_panner->queue_draw ();
+ } else if (_mono_panner) {
+ _mono_panner->queue_draw ();
} else if (twod_panner) {
twod_panner->queue_draw ();
- } else {
- for (vector<MonoPanner*>::iterator i = pan_bars.begin(); i != pan_bars.end(); ++i) {
- (*i)->queue_draw ();
- }
- }
+ }
}
void
break;
}
- bool x = (pannable->automation_state() != Off);
+ bool x = (pannable->automation_state() != ARDOUR::Off);
if (pan_automation_state_button.get_active() != x) {
ignore_toggle = true;
string sstr;
switch (state) {
- case Off:
+ case ARDOUR::Off:
sstr = (shrt ? "M" : _("M"));
break;
case Play: