[Summary] Implemented use case to show and select master bus on MasterLevelMeter click

This commit is contained in:
GZharun 2014-08-05 16:18:08 +03:00
parent dbfaa75584
commit d1413f60a6
4 changed files with 33 additions and 1 deletions

View file

@ -687,6 +687,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void add_routes (ARDOUR::RouteList&);
void timeaxisview_deleted (TimeAxisView *);
void master_meter_clicked ();
Gtk::Container& inspector_home;
Gtk::Container& _master_bus_ui_home;
MasterBusUI* _master_bus_ui;

View file

@ -198,6 +198,23 @@ Editor::create_editor_mixer ()
} else {
_master_bus_ui->init(_session);
}
_master_bus_ui->MasterMeterClicked.connect(*this, invalidator (*this), boost::bind (&Editor::master_meter_clicked, this), gui_context() );
}
void
Editor::master_meter_clicked ()
{
if (!_session) {
return;
}
TimeAxisView* tv = axis_view_from_route (_session->master_out() );
if (tv) {
TrackViewList selected;
selected.push_back(tv);
get_selection().set(selected);
}
}
void

View file

@ -147,6 +147,7 @@ void MasterBusUI::init(ARDOUR::Session *session)
ARDOUR_UI::Blink.connect (sigc::mem_fun (*this, &MasterBusUI::solo_blink));
_level_meter.set_session(session);
_level_meter.ButtonRelease.connect_same_thread (_session_connections, boost::bind (&MasterBusUI::on_level_meter_button_release, this, _1) );
}
void MasterBusUI::on_output_connection_mode_changed()
@ -189,6 +190,15 @@ void MasterBusUI::on_output_connection_mode_changed()
route_mute_state_changed(NULL);
}
bool
MasterBusUI::on_level_meter_button_release (GdkEventButton *ev)
{
// EMIT SIGNAL
MasterMeterClicked ();
return true;
}
MasterBusUI::~MasterBusUI ()
{
CatchDeletion (this);

View file

@ -53,6 +53,8 @@ public:
void fast_update ();
void set_route (boost::shared_ptr<ARDOUR::Route>);
static PBD::Signal1<void,MasterBusUI*> CatchDeletion;
PBD::Signal0<void> MasterMeterClicked;
private:
static int __meter_width;
@ -68,7 +70,8 @@ private:
void on_master_mute_button (WavesButton*);
void on_clear_solo_button (WavesButton*);
void on_global_rec_button (WavesButton*);
void on_output_connection_mode_changed();
void on_output_connection_mode_changed ();
bool on_level_meter_button_release (GdkEventButton*);
// MASTER staff
void connect_route_state_signals(ARDOUR::RouteList& tracks);