bool
PannerUI::panning_link_button_press (GdkEventButton* ev)
{
- cerr << "link press\n";
return true;
}
bool
PannerUI::panning_link_button_release (GdkEventButton* ev)
{
- cerr << "link release\n";
if (!ignore_toggle) {
_io->panner().set_linked (!_io->panner().linked());
}
bool x = _io->panner().linked();
bool bx = panning_link_button.get_active();
-
+
if (x != bx) {
ignore_toggle = true;
{
ENSURE_GUI_THREAD (mem_fun(*this, &PannerUI::panner_changed));
setup_pan ();
+ pan_changed (0);
}
void
}
SendUIWindow::SendUIWindow (boost::shared_ptr<Send> s, Session& ss)
+ : ArdourDialog (string("Ardour: send ") + s->name())
{
ui = new SendUI (s, ss);
- vpacker.set_border_width (5);
-
hpacker.pack_start (*ui, true, true);
- vpacker.pack_start (hpacker);
+ get_vbox()->set_border_width (5);
+ get_vbox()->pack_start (hpacker);
- add (vpacker);
set_name ("SendUIWindow");
going_away_connection = s->GoingAway.connect (mem_fun (*this, &SendUIWindow::send_going_away));
signal_delete_event().connect (bind (ptr_fun (just_hide_it), reinterpret_cast<Window *> (this)));
-
}
SendUIWindow::~SendUIWindow ()
#include "gain_meter.h"
#include "panner_ui.h"
+#include "ardour_dialog.h"
namespace ARDOUR {
class Send;
void outs_changed (ARDOUR::IOChange, void*);
};
-class SendUIWindow : public Gtk::Window
+class SendUIWindow : public ArdourDialog
{
public:
SendUIWindow(boost::shared_ptr<ARDOUR::Send>, ARDOUR::Session&);
SendUI* ui;
private:
- Gtk::VBox vpacker;
Gtk::HBox hpacker;
void send_going_away ();
IO::set_gain (gain_t val, void *src)
{
// max gain at about +6dB (10.0 ^ ( 6 dB * 0.05))
- if (val>1.99526231f) val=1.99526231f;
+
+ if (val > 1.99526231f) {
+ val = 1.99526231f;
+ }
{
Glib::Mutex::Lock dm (declick_lock);
{
uint32_t n;
bool changed = false;
+ bool do_not_and_did_not_need_panning = ((nouts < 2) && (outputs.size() < 2));
- if (nouts < 2 || (nouts == outputs.size() && npans == size())) {
+ /* if new and old config don't need panning, or if
+ the config hasn't changed, we're done.
+ */
+
+ if (do_not_and_did_not_need_panning ||
+ ((nouts == outputs.size()) && (npans == size()))) {
return;
}
changed = true;
}
+ if (nouts < 2) {
+ goto send_changed;
+ }
+
switch (nouts) {
case 0:
break;
}
}
+ send_changed:
if (changed) {
Changed (); /* EMIT SIGNAL */
}
#include <ardour/send.h>
#include <ardour/session.h>
#include <ardour/port.h>
+#include <ardour/panner.h>
#include "i18n.h"
expected_inputs = 0;
/* set up the same outputs, and connect them to the same places */
+ no_panner_reset = true;
for (uint32_t i = 0; i < other.n_outputs (); ++i) {
add_output_port ("", 0);
Port* p = other.output (i);
}
}
}
+
+ /* setup panner */
- if (other.active()) {
- set_active (true, this);
- }
+ no_panner_reset = false;
+
+ /* copy state */
+
+ XMLNode& other_state (const_cast<Send*>(&other)->_panner->get_state());
+ _panner->set_state (other_state);
+
+ delete &other_state;
RedirectCreated (this); /* EMIT SIGNAL */
}