use volume controller widget for monitor section, drop some now-unused code
git-svn-id: svn://localhost/ardour2/branches/3.0@8828 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
fe6ca1786f
commit
1a49bb9556
@ -17,6 +17,7 @@
|
|||||||
#include "gui_thread.h"
|
#include "gui_thread.h"
|
||||||
#include "monitor_section.h"
|
#include "monitor_section.h"
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
|
#include "volume_controller.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
@ -73,7 +74,7 @@ MonitorSection::MonitorSection (Session* s)
|
|||||||
|
|
||||||
/* Dim */
|
/* Dim */
|
||||||
|
|
||||||
dim_control = new MotionFeedback (little_knob_pixbuf, MotionFeedback::Rotary, "", &dim_adjustment, false, 30, 30);
|
dim_control = new VolumeController (little_knob_pixbuf, &dim_adjustment, false, 30, 30);
|
||||||
|
|
||||||
HBox* dim_packer = manage (new HBox);
|
HBox* dim_packer = manage (new HBox);
|
||||||
dim_packer->show ();
|
dim_packer->show ();
|
||||||
@ -137,7 +138,7 @@ MonitorSection::MonitorSection (Session* s)
|
|||||||
|
|
||||||
/* Solo Boost */
|
/* Solo Boost */
|
||||||
|
|
||||||
solo_boost_control = new MotionFeedback (little_knob_pixbuf, MotionFeedback::Rotary, "", &solo_boost_adjustment, false, 30, 30);
|
solo_boost_control = new VolumeController (little_knob_pixbuf, &solo_boost_adjustment, false, 30, 30);
|
||||||
|
|
||||||
HBox* solo_packer = manage (new HBox);
|
HBox* solo_packer = manage (new HBox);
|
||||||
solo_packer->set_spacing (12);
|
solo_packer->set_spacing (12);
|
||||||
@ -154,7 +155,7 @@ MonitorSection::MonitorSection (Session* s)
|
|||||||
|
|
||||||
/* Solo (SiP) cut */
|
/* Solo (SiP) cut */
|
||||||
|
|
||||||
solo_cut_control = new MotionFeedback (little_knob_pixbuf, MotionFeedback::Rotary, "", &solo_cut_adjustment, false, 30, 30);
|
solo_cut_control = new VolumeController (little_knob_pixbuf, &solo_cut_adjustment, false, 30, 30);
|
||||||
|
|
||||||
spin_label = manage (new Label (_("SiP Cut")));
|
spin_label = manage (new Label (_("SiP Cut")));
|
||||||
spin_packer = manage (new VBox);
|
spin_packer = manage (new VBox);
|
||||||
@ -237,7 +238,7 @@ MonitorSection::MonitorSection (Session* s)
|
|||||||
|
|
||||||
/* Gain */
|
/* Gain */
|
||||||
|
|
||||||
gain_control = new MotionFeedback (big_knob_pixbuf, MotionFeedback::Rotary, "", &gain_adjustment, false, 80, 80);
|
gain_control = new VolumeController (big_knob_pixbuf, &gain_adjustment, false, 80, 80);
|
||||||
|
|
||||||
spin_label = manage (new Label (_("Gain")));
|
spin_label = manage (new Label (_("Gain")));
|
||||||
spin_packer = manage (new VBox);
|
spin_packer = manage (new VBox);
|
||||||
@ -1012,14 +1013,15 @@ MonitorSection::assign_controllables ()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (_session) {
|
if (_session) {
|
||||||
solo_cut_control->set_controllable (_session->solo_cut_control());
|
boost::shared_ptr<Controllable> c = _session->solo_cut_control();
|
||||||
|
solo_cut_control->set_controllable (c);
|
||||||
|
solo_cut_control->get_adjustment()->set_value (c->get_value());
|
||||||
} else {
|
} else {
|
||||||
solo_cut_control->set_controllable (none);
|
solo_cut_control->set_controllable (none);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_route) {
|
if (_route) {
|
||||||
gain_control->set_controllable (_route->gain_control());
|
gain_control->set_controllable (_route->gain_control());
|
||||||
control_link (control_connections, _route->gain_control(), gain_adjustment);
|
|
||||||
} else {
|
} else {
|
||||||
gain_control->set_controllable (none);
|
gain_control->set_controllable (none);
|
||||||
}
|
}
|
||||||
@ -1038,13 +1040,11 @@ MonitorSection::assign_controllables ()
|
|||||||
dim_control->set_controllable (c);
|
dim_control->set_controllable (c);
|
||||||
dim_adjustment.set_lower (c->lower());
|
dim_adjustment.set_lower (c->lower());
|
||||||
dim_adjustment.set_upper (c->upper());
|
dim_adjustment.set_upper (c->upper());
|
||||||
control_link (control_connections, c, dim_adjustment);
|
|
||||||
|
|
||||||
c = _monitor->solo_boost_control ();
|
c = _monitor->solo_boost_control ();
|
||||||
solo_boost_control->set_controllable (c);
|
solo_boost_control->set_controllable (c);
|
||||||
solo_boost_adjustment.set_lower (c->lower());
|
solo_boost_adjustment.set_lower (c->lower());
|
||||||
solo_boost_adjustment.set_upper (c->upper());
|
solo_boost_adjustment.set_upper (c->upper());
|
||||||
control_link (control_connections, c, solo_boost_adjustment);
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@ namespace Gtkmm2ext {
|
|||||||
class MotionFeedback;
|
class MotionFeedback;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class VolumeController;
|
||||||
|
|
||||||
class MonitorSection : public RouteUI
|
class MonitorSection : public RouteUI
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -63,13 +65,13 @@ class MonitorSection : public RouteUI
|
|||||||
ChannelButtons _channel_buttons;
|
ChannelButtons _channel_buttons;
|
||||||
|
|
||||||
Gtk::Adjustment gain_adjustment;
|
Gtk::Adjustment gain_adjustment;
|
||||||
Gtkmm2ext::MotionFeedback* gain_control;
|
VolumeController* gain_control;
|
||||||
Gtk::Adjustment dim_adjustment;
|
Gtk::Adjustment dim_adjustment;
|
||||||
Gtkmm2ext::MotionFeedback* dim_control;
|
VolumeController* dim_control;
|
||||||
Gtk::Adjustment solo_boost_adjustment;
|
Gtk::Adjustment solo_boost_adjustment;
|
||||||
Gtkmm2ext::MotionFeedback* solo_boost_control;
|
VolumeController* solo_boost_control;
|
||||||
Gtk::Adjustment solo_cut_adjustment;
|
Gtk::Adjustment solo_cut_adjustment;
|
||||||
Gtkmm2ext::MotionFeedback* solo_cut_control;
|
VolumeController* solo_cut_control;
|
||||||
|
|
||||||
void populate_buttons ();
|
void populate_buttons ();
|
||||||
void set_button_names ();
|
void set_button_names ();
|
||||||
|
@ -952,40 +952,4 @@ escape_underscores (string const & s)
|
|||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
adjustment_to_controllable (Gtk::Adjustment* adj, boost::weak_ptr<Controllable> wcont)
|
|
||||||
{
|
|
||||||
boost::shared_ptr<Controllable> cont = wcont.lock();
|
|
||||||
|
|
||||||
if (cont) {
|
|
||||||
double val = adj->get_value();
|
|
||||||
if (val != cont->get_value()) {
|
|
||||||
cont->set_value (val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
controllable_to_adjustment (Gtk::Adjustment* adj, boost::weak_ptr<Controllable> wcont)
|
|
||||||
{
|
|
||||||
boost::shared_ptr<Controllable> cont = wcont.lock();
|
|
||||||
|
|
||||||
if (cont) {
|
|
||||||
float val = cont->get_value();
|
|
||||||
|
|
||||||
if (val != adj->get_value()) {
|
|
||||||
adj->set_value (val);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
control_link (ScopedConnectionList& scl, boost::shared_ptr<Controllable> c, Gtk::Adjustment& a)
|
|
||||||
{
|
|
||||||
boost::weak_ptr<Controllable> wc (c);
|
|
||||||
|
|
||||||
a.signal_value_changed().connect (sigc::bind (sigc::ptr_fun (adjustment_to_controllable), &a, wc));
|
|
||||||
c->Changed.connect (scl, MISSING_INVALIDATOR, boost::bind (controllable_to_adjustment, &a, wc),
|
|
||||||
gui_context());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -91,6 +91,4 @@ void resize_window_to_proportion_of_monitor (Gtk::Window*, int, int);
|
|||||||
|
|
||||||
std::string escape_underscores (std::string const &);
|
std::string escape_underscores (std::string const &);
|
||||||
|
|
||||||
void control_link (PBD::ScopedConnectionList& scl, boost::shared_ptr<PBD::Controllable> c, Gtk::Adjustment& a);
|
|
||||||
|
|
||||||
#endif /* __ardour_gtk_utils_h__ */
|
#endif /* __ardour_gtk_utils_h__ */
|
||||||
|
@ -221,6 +221,7 @@ gtk2_ardour_sources = [
|
|||||||
'ui_config.cc',
|
'ui_config.cc',
|
||||||
'utils.cc',
|
'utils.cc',
|
||||||
'version.cc',
|
'version.cc',
|
||||||
|
'volume_controller.cc',
|
||||||
'waveview.cc',
|
'waveview.cc',
|
||||||
'window_proxy.cc'
|
'window_proxy.cc'
|
||||||
]
|
]
|
||||||
|
@ -42,7 +42,7 @@ class BindingProxy : public sigc::trackable
|
|||||||
|
|
||||||
bool button_press_handler (GdkEventButton *);
|
bool button_press_handler (GdkEventButton *);
|
||||||
|
|
||||||
boost::shared_ptr<PBD::Controllable> get_controllable() { return controllable; }
|
boost::shared_ptr<PBD::Controllable> get_controllable() const { return controllable; }
|
||||||
void set_controllable (boost::shared_ptr<PBD::Controllable>);
|
void set_controllable (boost::shared_ptr<PBD::Controllable>);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -62,7 +62,8 @@ class MotionFeedback : public Gtk::VBox
|
|||||||
gfloat upper () { return _upper; }
|
gfloat upper () { return _upper; }
|
||||||
gfloat range () { return _range; }
|
gfloat range () { return _range; }
|
||||||
|
|
||||||
void set_controllable (boost::shared_ptr<PBD::Controllable> c) { binding_proxy.set_controllable (c); }
|
boost::shared_ptr<PBD::Controllable> controllable() const;
|
||||||
|
virtual void set_controllable (boost::shared_ptr<PBD::Controllable> c);
|
||||||
void set_lamp_color (const Gdk::Color&);
|
void set_lamp_color (const Gdk::Color&);
|
||||||
|
|
||||||
static Glib::RefPtr<Gdk::Pixbuf> render_pixbuf (int size);
|
static Glib::RefPtr<Gdk::Pixbuf> render_pixbuf (int size);
|
||||||
|
@ -704,3 +704,16 @@ MotionFeedback::render_pixbuf (int size)
|
|||||||
|
|
||||||
return pixbuf;
|
return pixbuf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
MotionFeedback::set_controllable (boost::shared_ptr<PBD::Controllable> c)
|
||||||
|
{
|
||||||
|
binding_proxy.set_controllable (c);
|
||||||
|
}
|
||||||
|
|
||||||
|
boost::shared_ptr<PBD::Controllable>
|
||||||
|
MotionFeedback::controllable () const
|
||||||
|
{
|
||||||
|
return binding_proxy.get_controllable ();
|
||||||
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user