make send GUIs into ArdourDialogs; ensure that panner changes propagate into the GUI even when the number of panners is reduced

git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@4259 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2008-11-26 06:57:42 +00:00
parent 35b218b527
commit 14f4a42ab5
6 changed files with 35 additions and 15 deletions

View File

@ -210,14 +210,12 @@ PannerUI::get_controllable()
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());
}
@ -244,7 +242,7 @@ PannerUI::update_pan_linkage ()
bool x = _io->panner().linked();
bool bx = panning_link_button.get_active();
if (x != bx) {
ignore_toggle = true;
@ -313,6 +311,7 @@ PannerUI::panner_changed ()
{
ENSURE_GUI_THREAD (mem_fun(*this, &PannerUI::panner_changed));
setup_pan ();
pan_changed (0);
}
void

View File

@ -113,22 +113,20 @@ SendUI::fast_update ()
}
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 ()

View File

@ -22,6 +22,7 @@
#include "gain_meter.h"
#include "panner_ui.h"
#include "ardour_dialog.h"
namespace ARDOUR {
class Send;
@ -59,7 +60,7 @@ class SendUI : public Gtk::HBox
void outs_changed (ARDOUR::IOChange, void*);
};
class SendUIWindow : public Gtk::Window
class SendUIWindow : public ArdourDialog
{
public:
SendUIWindow(boost::shared_ptr<ARDOUR::Send>, ARDOUR::Session&);
@ -68,7 +69,6 @@ class SendUIWindow : public Gtk::Window
SendUI* ui;
private:
Gtk::VBox vpacker;
Gtk::HBox hpacker;
void send_going_away ();

View File

@ -2604,7 +2604,10 @@ void
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);

View File

@ -806,8 +806,14 @@ Panner::reset (uint32_t nouts, uint32_t npans)
{
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;
}
@ -825,6 +831,10 @@ Panner::reset (uint32_t nouts, uint32_t npans)
changed = true;
}
if (nouts < 2) {
goto send_changed;
}
switch (nouts) {
case 0:
break;
@ -926,6 +936,7 @@ Panner::reset (uint32_t nouts, uint32_t npans)
}
}
send_changed:
if (changed) {
Changed (); /* EMIT SIGNAL */
}

View File

@ -24,6 +24,7 @@
#include <ardour/send.h>
#include <ardour/session.h>
#include <ardour/port.h>
#include <ardour/panner.h>
#include "i18n.h"
@ -60,6 +61,7 @@ Send::Send (const Send& other)
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);
@ -73,10 +75,17 @@ Send::Send (const Send& other)
}
}
}
/* 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 */
}