Foldback: Con't work to remove unused mixer-strip code

This commit is contained in:
Robin Gareus 2021-03-26 23:01:38 +01:00
parent c96462f7bb
commit a94c0d62a6
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
3 changed files with 14 additions and 165 deletions

View File

@ -342,21 +342,20 @@ FoldbackSend::remove_me ()
_send_route->remove_processor (send_proc);
}
FoldbackStrip* FoldbackStrip::_entered_foldback_strip;
/* ****************************************************************************/
PBD::Signal1<void, FoldbackStrip*> FoldbackStrip::CatchDeletion;
FoldbackStrip::FoldbackStrip (Mixer_UI& mx, Session* sess, boost::shared_ptr<Route> rt)
: SessionHandlePtr (sess)
, RouteUI (sess)
, _mixer (mx)
, _mixer_owned (true)
, _showing_sends (false)
, _width (80)
, _peak_meter (0)
, _pr_selection ()
, panners (sess)
, output_button (false)
, _plugin_insert_cnt (0)
, _comment_button (_("Comments"))
, fb_level_control (0)
, _meter (0)
@ -369,7 +368,6 @@ FoldbackStrip::FoldbackStrip (Mixer_UI& mx, Session* sess, boost::shared_ptr<Rou
void
FoldbackStrip::init ()
{
_entered_foldback_strip = 0;
ignore_comment_edit = false;
comment_area = 0;
@ -505,17 +503,9 @@ FoldbackStrip::init ()
global_frame.add (global_vpacker);
global_frame.set_shadow_type (Gtk::SHADOW_IN);
global_frame.set_name ("BaseFrame");
global_frame.set_name ("MixerStripFrame");
add (global_frame);
/* force setting of visible selected status */
_selected = true;
set_selected (false);
_packed = false;
_embedded = false;
name_button.signal_button_press_event ().connect (sigc::mem_fun (*this, &FoldbackStrip::name_button_button_press), false);
_previous_button.signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &FoldbackStrip::cycle_foldbacks), false));
_next_button.signal_clicked.connect (sigc::bind (sigc::mem_fun (*this, &FoldbackStrip::cycle_foldbacks), true));
@ -526,15 +516,12 @@ FoldbackStrip::init ()
add_events (Gdk::BUTTON_RELEASE_MASK |
Gdk::ENTER_NOTIFY_MASK |
Gdk::LEAVE_NOTIFY_MASK |
Gdk::KEY_PRESS_MASK |
Gdk::KEY_RELEASE_MASK);
set_flags (get_flags () | Gtk::CAN_FOCUS);
//watch for mouse enter/exit so we can do some stuff
signal_enter_notify_event ().connect (sigc::mem_fun (*this, &FoldbackStrip::mixer_strip_enter_event));
signal_leave_notify_event ().connect (sigc::mem_fun (*this, &FoldbackStrip::mixer_strip_leave_event));
Mixer_UI::instance ()->show_spill_change.connect (sigc::mem_fun (*this, &FoldbackStrip::spill_change));
}
@ -543,35 +530,14 @@ FoldbackStrip::~FoldbackStrip ()
{
CatchDeletion (this);
delete fb_level_control;
fb_level_control = 0;
_connections.drop_connections ();
clear_send_box ();
send_blink_connection.disconnect ();
if (this == _entered_foldback_strip)
_entered_foldback_strip = NULL;
}
bool
FoldbackStrip::mixer_strip_enter_event (GdkEventCrossing* /*ev*/)
{
_entered_foldback_strip = this;
//although we are triggering on the "enter", to the user it will appear that it is happenin on the "leave"
//because the FoldbackStrip control is a parent that encompasses the strip
deselect_all_processors ();
return false;
}
bool
FoldbackStrip::mixer_strip_leave_event (GdkEventCrossing* ev)
{
//if we have moved outside our strip, but not into a child view, then deselect ourselves
if (!(ev->detail == GDK_NOTIFY_INFERIOR)) {
_entered_foldback_strip = 0;
}
return false;
}
@ -621,7 +587,6 @@ FoldbackStrip::set_route (boost::shared_ptr<Route> rt)
/* setup panners */
panner_ui ().set_panner (_route->main_outs ()->panner_shell (), _route->main_outs ()->panner ());
update_panner_choices ();
panner_ui ().setup_pan ();
panner_ui ().set_send_drawing_mode (false);
@ -643,14 +608,13 @@ FoldbackStrip::set_route (boost::shared_ptr<Route> rt)
_route->output ()->changed.connect (*this, invalidator (*this), boost::bind (&FoldbackStrip::update_output_display, this), gui_context ());
_route->io_changed.connect (route_connections, invalidator (*this), boost::bind (&FoldbackStrip::io_changed_proxy, this), gui_context ());
_route->comment_changed.connect (route_connections, invalidator (*this), boost::bind (&FoldbackStrip::setup_comment_button, this), gui_context ());
_session->FBSendsChanged.connect (route_connections, invalidator (*this), boost::bind (&FoldbackStrip::update_send_box, this), gui_context ());
/* now force an update of all the various elements */
name_changed ();
update_send_box ();
_session->FBSendsChanged.connect (route_connections, invalidator (*this), boost::bind (&FoldbackStrip::update_send_box, this), gui_context ());
comment_changed ();
connect_to_pan ();
panners.setup_pan ();
@ -677,8 +641,6 @@ FoldbackStrip::set_route (boost::shared_ptr<Route> rt)
global_frame.show ();
global_vpacker.show ();
map_frozen ();
show ();
}
@ -717,7 +679,7 @@ FoldbackStrip::update_send_box ()
FoldbackSend* fb_s = new FoldbackSend (snd, s_rt, _route, _width);
send_display.pack_start (*fb_s, Gtk::PACK_SHRINK);
fb_s->show ();
s_rt->processors_changed.connect (_connections, invalidator (*this), boost::bind (&FoldbackStrip::processors_changed, this, _1), gui_context ());
s_rt->processors_changed.connect (_send_connections, invalidator (*this), boost::bind (&FoldbackStrip::processors_changed, this, _1), gui_context ());
}
}
}
@ -726,7 +688,7 @@ void
FoldbackStrip::clear_send_box ()
{
std::vector<Widget*> snd_list = send_display.get_children ();
_connections.drop_connections ();
_send_connections.drop_connections ();
for (uint32_t i = 0; i < snd_list.size (); i++) {
send_display.remove (*(snd_list[i]));
delete snd_list[i];
@ -735,25 +697,16 @@ FoldbackStrip::clear_send_box ()
}
void
FoldbackStrip::processors_changed (RouteProcessorChange)
FoldbackStrip::processors_changed (RouteProcessorChange)
{
update_send_box ();
}
void
FoldbackStrip::set_packed (bool yn)
{
_packed = yn;
}
void
FoldbackStrip::connect_to_pan ()
{
ENSURE_GUI_THREAD (*this, &FoldbackStrip::connect_to_pan)
panstate_connection.disconnect ();
panstyle_connection.disconnect ();
if (!_route->panner ()) {
return;
}
@ -821,24 +774,6 @@ FoldbackStrip::setup_comment_button ()
}
}
void
FoldbackStrip::help_count_plugins (boost::weak_ptr<Processor> p)
{
boost::shared_ptr<Processor> processor (p.lock ());
if (!processor || !processor->display_to_user ()) {
return;
}
boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (processor);
#ifdef MIXBUS
if (pi && pi->is_channelstrip ()) {
return;
}
#endif
if (pi) {
++_plugin_insert_cnt;
}
}
Gtk::Menu*
FoldbackStrip::build_route_ops_menu ()
{
@ -966,9 +901,7 @@ FoldbackStrip::update_sensitivity ()
void
FoldbackStrip::hide_clicked ()
{
_hide_button.set_sensitive (false);
ActionManager::get_toggle_action (X_("Mixer"), X_("ToggleFoldbackStrip"))->set_active (false);
_hide_button.set_sensitive (true);
}
void
@ -999,22 +932,11 @@ FoldbackStrip::show_sends_clicked ()
void
FoldbackStrip::fast_update ()
{
/*
* As this is the output level to a DAC, peak level is what is important
/* As this is the output level to a DAC, peak level is what is important
* So, much like the mackie control, we just want the highest peak from
* all channels in the route.
*/
float meter_level = -199.0;
uint32_t mn = _peak_meter->input_streams ().n_audio ();
for (uint32_t n = 0; n != mn; ++n) {
const float peak = _peak_meter->meter_level (n, MeterPeak0dB);
if (peak > meter_level) {
meter_level = peak;
}
}
const float meter_level = _peak_meter->meter_level (0, MeterMCP);
_meter->set (log_meter0dB (meter_level));
}
@ -1032,15 +954,6 @@ FoldbackStrip::send_blink (bool onoff)
}
}
void
FoldbackStrip::set_selected (bool yn)
{
global_frame.set_shadow_type (Gtk::SHADOW_IN);
global_frame.set_name ("MixerStripFrame");
global_frame.queue_draw ();
}
void
FoldbackStrip::route_property_changed (const PropertyChange& what_changed)
{
@ -1053,24 +966,9 @@ void
FoldbackStrip::name_changed ()
{
name_button.set_text (_route->name ());
set_tooltip (name_button, Gtkmm2ext::markup_escape_text (_route->name ()));
}
void
FoldbackStrip::set_embedded (bool yn)
{
_embedded = yn;
}
void
FoldbackStrip::map_frozen ()
{
ENSURE_GUI_THREAD (*this, &FoldbackStrip::map_frozen)
RouteUI::map_frozen ();
}
void
FoldbackStrip::reset_strip_style ()
{

View File

@ -122,10 +122,8 @@ public:
std::string name () const;
PluginSelector* plugin_selector ();
void set_embedded (bool);
void fast_update ();
void set_route (boost::shared_ptr<ARDOUR::Route>);
void set_button_names ();
@ -140,19 +138,6 @@ public:
return RouteUI::stripable ();
}
/** @return the delivery that is being edited using our fader; it will be the
* last send passed to show_send(), or our route's main out delivery.
*/
boost::shared_ptr<ARDOUR::Delivery> current_delivery () const
{
return _current_delivery;
}
bool mixer_owned () const
{
return _mixer_owned;
}
/** The delivery that we are handling the level for with our fader has changed */
PBD::Signal1<void, boost::weak_ptr<ARDOUR::Delivery> > DeliveryChanged;
@ -168,21 +153,6 @@ public:
bool delete_processors (); //note: returns false if nothing was deleted
void toggle_processors ();
void ab_plugins ();
void duplicate_current_fb ();
void set_selected (bool yn);
static FoldbackStrip* entered_foldback_strip ()
{
return _entered_foldback_strip;
}
protected:
friend class Mixer_UI;
void set_packed (bool yn);
bool packed ()
{
return _packed;
}
private:
void init ();
@ -207,18 +177,16 @@ private:
void create_selected_sends (bool include_buses);
void route_property_changed (const PBD::PropertyChange&);
void name_changed ();
void map_frozen ();
void duplicate_current_fb ();
void reset_strip_style ();
bool mixer_strip_enter_event (GdkEventCrossing*);
Gtk::Menu* build_route_ops_menu ();
Gtk::Menu* build_route_select_menu ();
Gtk::Menu* build_sends_menu ();
Mixer_UI& _mixer;
bool _embedded;
bool _packed;
bool _mixer_owned;
ARDOUR::Session* _session;
bool _showing_sends;
uint32_t _width;
@ -238,9 +206,6 @@ private:
IOButton output_button;
void help_count_plugins (boost::weak_ptr<ARDOUR::Processor>);
uint32_t _plugin_insert_cnt;
ArdourWidgets::ArdourButton name_button;
ArdourWidgets::ArdourButton _show_sends_button;
ArdourWidgets::ArdourButton _previous_button;
@ -250,18 +215,7 @@ private:
ArdourWidgets::ArdourKnob* fb_level_control;
ArdourWidgets::FastMeter* _meter;
PBD::ScopedConnection panstate_connection;
PBD::ScopedConnection panstyle_connection;
static FoldbackStrip* _entered_foldback_strip;
PBD::ScopedConnection send_gone_connection;
void reset_strip_style ();
bool mixer_strip_enter_event (GdkEventCrossing*);
bool mixer_strip_leave_event (GdkEventCrossing*);
PBD::ScopedConnectionList _connections;
PBD::ScopedConnectionList _send_connections;
};
#endif

View File

@ -625,7 +625,6 @@ Mixer_UI::add_stripables (StripableList& slist)
out_packer.pack_start (*foldback_strip, false, false);
// change 0 to 1 below for foldback to right of master
out_packer.reorder_child (*foldback_strip, 0);
foldback_strip->set_packed (true);
}
/* config from last run is set before there are any foldback strips
* this takes that setting and applies it after at least one foldback
@ -760,11 +759,9 @@ Mixer_UI::remove_foldback (FoldbackStrip* strip)
/* its all being taken care of */
return;
}
assert (strip == foldback_strip);
Glib::RefPtr<ToggleAction> act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
act->set_sensitive (false);
if (foldback_strip) {
foldback_strip->destroy_();
}
foldback_strip = 0;
}