Foldback: NO-OP clang-format

This commit is contained in:
Robin Gareus 2021-03-26 02:48:04 +01:00
parent 01bc039f9b
commit 05f6550e2c
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
2 changed files with 373 additions and 392 deletions

View file

@ -17,22 +17,22 @@
*/
#include "ardour/audioengine.h"
#include "ardour/logmeter.h"
#include "ardour/meter.h"
#include "ardour/pannable.h"
#include "ardour/panner_shell.h"
#include "ardour/panner_manager.h"
#include "ardour/panner_shell.h"
#include "ardour/profile.h"
#include "ardour/route.h"
#include "ardour/send.h"
#include "ardour/session.h"
#include "ardour/user_bundle.h"
#include "ardour/value_as_string.h"
#include "ardour/meter.h"
#include "ardour/logmeter.h"
#include "gtkmm2ext/doi.h"
#include "gtkmm2ext/gtk_ui.h"
#include "gtkmm2ext/menu_elems.h"
#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/doi.h"
#include "pbd/fastlog.h"
#include "widgets/tooltips.h"
@ -40,15 +40,15 @@
#include "ardour_window.h"
#include "enums_convert.h"
#include "foldback_strip.h"
#include "mixer_ui.h"
#include "gui_thread.h"
#include "io_selector.h"
#include "keyboard.h"
#include "mixer_ui.h"
#include "public_editor.h"
#include "send_ui.h"
#include "timers.h"
#include "io_selector.h"
#include "utils.h"
#include "gui_thread.h"
#include "ui_config.h"
#include "utils.h"
#include "pbd/i18n.h"
@ -61,8 +61,7 @@ using namespace std;
#define PX_SCALE(px) std::max ((float)px, rintf ((float)px* UIConfiguration::instance ().get_ui_scale ()))
FoldbackSend::FoldbackSend (boost::shared_ptr<Send> snd, \
boost::shared_ptr<ARDOUR::Route> sr, boost::shared_ptr<ARDOUR::Route> fr, uint32_t wd)
FoldbackSend::FoldbackSend (boost::shared_ptr<Send> snd, boost::shared_ptr<ARDOUR::Route> sr, boost::shared_ptr<ARDOUR::Route> fr, uint32_t wd)
: _button (ArdourButton::led_default_elements)
, _send (snd)
, _send_route (sr)
@ -70,14 +69,12 @@ FoldbackSend::FoldbackSend (boost::shared_ptr<Send> snd, \
, _send_proc (snd)
, _send_del (snd)
, _width (wd)
, pan_control (ArdourKnob::default_elements, ArdourKnob::Flags (ArdourKnob::Detent | ArdourKnob::ArcToZero))
, _pan_control (ArdourKnob::default_elements, ArdourKnob::Flags (ArdourKnob::Detent | ArdourKnob::ArcToZero))
, _adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain ()), 0, 1, 0.01, 0.1)
, _slider (&_adjustment, boost::shared_ptr<PBD::Controllable> (), 0, max (13.f, rintf (13.f * UIConfiguration::instance ().get_ui_scale ())))
, _ignore_ui_adjustment (true)
, _slider_persistant_tooltip (&_slider)
{
HBox* snd_but_pan = new HBox ();
_button.set_distinct_led_click (true);
@ -101,13 +98,13 @@ FoldbackSend::FoldbackSend (boost::shared_ptr<Send> snd, \
boost::shared_ptr<Pannable> pannable = _send_del->panner ()->pannable ();
boost::shared_ptr<AutomationControl> ac;
ac = pannable->pan_azimuth_control;
pan_control.set_size_request (PX_SCALE(19), PX_SCALE(19));
pan_control.set_tooltip_prefix (_("Pan: "));
pan_control.set_name ("trim knob");
pan_control.set_no_show_all (true);
snd_but_pan->pack_start (pan_control, false, false);
pan_control.show ();
pan_control.set_controllable (ac);
_pan_control.set_size_request (PX_SCALE (19), PX_SCALE (19));
_pan_control.set_tooltip_prefix (_("Pan: "));
_pan_control.set_name ("trim knob");
_pan_control.set_no_show_all (true);
snd_but_pan->pack_start (_pan_control, false, false);
_pan_control.show ();
_pan_control.set_controllable (ac);
}
boost::shared_ptr<AutomationControl> lc;
lc = _send->gain_control ();
@ -135,13 +132,12 @@ FoldbackSend::~FoldbackSend ()
{
_connections.drop_connections ();
_slider.set_controllable (boost::shared_ptr<AutomationControl> ());
pan_control.set_controllable (boost::shared_ptr<AutomationControl> ());
_pan_control.set_controllable (boost::shared_ptr<AutomationControl> ());
_send = boost::shared_ptr<Send> ();
_send_route = boost::shared_ptr<Route> ();
_foldback_route = boost::shared_ptr<Route> ();
_send_proc = boost::shared_ptr<Processor> ();
_send_del = boost::shared_ptr<Delivery> ();
}
void
@ -207,7 +203,6 @@ void
FoldbackSend::send_state_changed ()
{
_button.set_active (_send_proc->enabled ());
}
void
@ -272,22 +267,17 @@ FoldbackSend::build_send_menu ()
menu->set_name ("ArdourContextMenu");
items.push_back (
MenuElem(_("Copy track/bus gain to send"), sigc::bind (sigc::mem_fun (*this, &FoldbackSend::set_gain), -0.1))
);
MenuElem (_("Copy track/bus gain to send"), sigc::bind (sigc::mem_fun (*this, &FoldbackSend::set_gain), -0.1)));
items.push_back (
MenuElem(_("Set send gain to -inf"), sigc::bind (sigc::mem_fun (*this, &FoldbackSend::set_gain), 0.0))
);
MenuElem (_("Set send gain to -inf"), sigc::bind (sigc::mem_fun (*this, &FoldbackSend::set_gain), 0.0)));
items.push_back (
MenuElem(_("Set send gain to 0dB"), sigc::bind (sigc::mem_fun (*this, &FoldbackSend::set_gain), 1.0))
);
MenuElem (_("Set send gain to 0dB"), sigc::bind (sigc::mem_fun (*this, &FoldbackSend::set_gain), 1.0)));
if (_send_proc->get_pre_fader ()) {
items.push_back (
MenuElem(_("Set send post fader"), sigc::bind (sigc::mem_fun (*this, &FoldbackSend::set_send_position), true))
);
MenuElem (_("Set send post fader"), sigc::bind (sigc::mem_fun (*this, &FoldbackSend::set_send_position), true)));
} else {
items.push_back (
MenuElem(_("Set send pre fader"), sigc::bind (sigc::mem_fun (*this, &FoldbackSend::set_send_position), false))
);
MenuElem (_("Set send pre fader"), sigc::bind (sigc::mem_fun (*this, &FoldbackSend::set_send_position), false)));
}
items.push_back (MenuElem (_("Remove This Send"), sigc::mem_fun (*this, &FoldbackSend::remove_me)));
@ -307,7 +297,6 @@ FoldbackSend::set_gain (float new_gain)
return;
}
lc->set_value (new_gain, Controllable::NoGroup);
}
void
@ -353,7 +342,6 @@ FoldbackSend::remove_me ()
_send_route->remove_processor (send_proc);
}
FoldbackStrip* FoldbackStrip::_entered_foldback_strip;
PBD::Signal1<void, FoldbackStrip*> FoldbackStrip::CatchDeletion;
@ -585,7 +573,6 @@ 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;
@ -687,8 +674,7 @@ FoldbackStrip::set_route (boost::shared_ptr<Route> rt)
}
// predicate for sort call in get_sorted_stripables
struct StripableByPresentationOrder
{
struct StripableByPresentationOrder {
bool operator() (const boost::shared_ptr<Stripable>& a, const boost::shared_ptr<Stripable>& b) const
{
return a->presentation_info ().order () < b->presentation_info ().order ();
@ -715,7 +701,6 @@ FoldbackStrip::update_send_box ()
}
stripables.sort (StripableByPresentationOrder ());
for (StripableList::iterator it = stripables.begin (); it != stripables.end (); ++it) {
boost::shared_ptr<Stripable> s_sp = *it;
boost::shared_ptr<Route> s_rt = boost::dynamic_pointer_cast<Route> (s_sp);
boost::shared_ptr<Send> snd = s_rt->internal_send_for (_route);
@ -771,7 +756,9 @@ void
FoldbackStrip::update_panner_choices ()
{
ENSURE_GUI_THREAD (*this, &FoldbackStrip::update_panner_choices)
if (!_route->panner_shell()) { return; }
if (!_route->panner_shell ()) {
return;
}
uint32_t in = _route->output ()->n_ports ().n_audio ();
uint32_t out = in;
@ -894,7 +881,6 @@ FoldbackStrip::build_route_select_menu ()
fb_list = _session->get_routelist (true, PresentationInfo::FoldbackBus);
for (RouteList::iterator s = fb_list.begin (); s != fb_list.end (); ++s) {
boost::shared_ptr<Route> route = (*s);
if (route == _route) {
continue;
@ -904,7 +890,7 @@ FoldbackStrip::build_route_select_menu ()
return menu;
}
gboolean
bool
FoldbackStrip::name_button_button_press (GdkEventButton* ev)
{
if (ev->button == 1 && ev->type == GDK_BUTTON_PRESS) {
@ -1021,7 +1007,6 @@ FoldbackStrip::fast_update ()
}
_meter->set (log_meter0dB (meter_level));
}
void
@ -1041,12 +1026,10 @@ 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
@ -1076,7 +1059,6 @@ FoldbackStrip::map_frozen ()
{
ENSURE_GUI_THREAD (*this, &FoldbackStrip::map_frozen)
RouteUI::map_frozen ();
}
@ -1109,7 +1091,6 @@ FoldbackStrip::reset_strip_style ()
} else {
set_name ("AudioBusStripBaseInactive");
}
}
void
@ -1255,7 +1236,6 @@ FoldbackStrip::create_selected_sends (bool post_fader)
}
}
}
}
bool
@ -1279,8 +1259,7 @@ FoldbackStrip::build_sends_menu ()
menu->set_name ("ArdourContextMenu");
items.push_back (
MenuElem(_("Assign selected tracks and buses (prefader)"), sigc::bind (sigc::mem_fun (*this, &FoldbackStrip::create_selected_sends), false))
);
MenuElem (_("Assign selected tracks and buses (prefader)"), sigc::bind (sigc::mem_fun (*this, &FoldbackStrip::create_selected_sends), false)));
items.push_back (
MenuElem (_("Assign selected tracks and buses (postfader)"), sigc::bind (sigc::mem_fun (*this, &FoldbackStrip::create_selected_sends), true)));

View file

@ -16,16 +16,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef __ardour_foldback_strip__
#define __ardour_foldback_strip__
#include <vector>
#ifndef _gtkardour_foldback_strip_
#define _gtkardour_foldback_strip_
#include <cmath>
#include <vector>
#include <gtkmm/adjustment.h>
#include <gtkmm/button.h>
#include <gtkmm/box.h>
#include <gtkmm/button.h>
#include <gtkmm/eventbox.h>
#include <gtkmm/frame.h>
#include <gtkmm/label.h>
@ -37,10 +36,10 @@
#include "pbd/stateful.h"
#include "ardour/types.h"
#include "ardour/ardour.h"
#include "ardour/processor.h"
#include "ardour/meter.h"
#include "ardour/processor.h"
#include "ardour/types.h"
#include "pbd/fastlog.h"
@ -65,6 +64,7 @@ namespace ARDOUR {
class Plugin;
class PeakMeter;
}
namespace Gtk {
class Window;
class Style;
@ -78,11 +78,27 @@ class ArdourWindow;
class FoldbackSend : public Gtk::VBox
{
public:
FoldbackSend (boost::shared_ptr<ARDOUR::Send>, \
boost::shared_ptr<ARDOUR::Route> sr, boost::shared_ptr<ARDOUR::Route> fr, uint32_t wd);
FoldbackSend (boost::shared_ptr<ARDOUR::Send>, boost::shared_ptr<ARDOUR::Route> sr, boost::shared_ptr<ARDOUR::Route> fr, uint32_t wd);
~FoldbackSend ();
private:
void led_clicked (GdkEventButton*);
bool button_press (GdkEventButton*);
bool button_release (GdkEventButton*);
void set_gain (float new_gain);
void set_send_position (bool post);
void remove_me ();
void route_property_changed (const PBD::PropertyChange&);
void name_changed ();
void send_state_changed ();
void level_adjusted ();
void level_changed ();
void set_tooltip ();
Gtk::Menu* build_send_menu ();
ArdourWidgets::ArdourButton _button;
boost::shared_ptr<ARDOUR::Send> _send;
boost::shared_ptr<ARDOUR::Route> _send_route;
@ -90,27 +106,11 @@ private:
boost::shared_ptr<ARDOUR::Processor> _send_proc;
boost::shared_ptr<ARDOUR::Delivery> _send_del;
uint32_t _width;
void led_clicked(GdkEventButton *);
bool button_press (GdkEventButton*);
bool button_release (GdkEventButton*);
Gtk::Menu* build_send_menu ();
void set_gain (float new_gain);
void set_send_position (bool post);
void remove_me ();
void route_property_changed (const PBD::PropertyChange&);
void name_changed ();
void send_state_changed ();
void level_adjusted ();
void level_changed ();
void set_tooltip ();
ArdourWidgets::ArdourKnob pan_control;
ArdourWidgets::ArdourKnob _pan_control;
Gtk::Adjustment _adjustment;
ArdourWidgets::HSliderController _slider;
bool _ignore_ui_adjustment;
Gtkmm2ext::PersistentTooltip _slider_persistant_tooltip;
PBD::ScopedConnectionList _connections;
};
@ -122,7 +122,7 @@ public:
std::string name () const;
PannerUI& panner_ui() { return panners; }
PluginSelector* plugin_selector ();
void set_embedded (bool);
@ -131,18 +131,26 @@ public:
void set_button_names ();
void revert_to_default_display ();
boost::shared_ptr<ARDOUR::Stripable> stripable() const {
PannerUI& panner_ui ()
{
return panners;
}
boost::shared_ptr<ARDOUR::Stripable> stripable () const
{
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 {
boost::shared_ptr<ARDOUR::Delivery> current_delivery () const
{
return _current_delivery;
}
bool mixer_owned () const {
bool mixer_owned () const
{
return _mixer_owned;
}
@ -164,16 +172,56 @@ public:
void duplicate_current_fb ();
void set_selected (bool yn);
static FoldbackStrip* entered_foldback_strip() { return _entered_foldback_strip; }
static FoldbackStrip* entered_foldback_strip ()
{
return _entered_foldback_strip;
}
protected:
friend class Mixer_UI;
void set_packed (bool yn);
bool packed () { return _packed; }
bool packed ()
{
return _packed;
}
private:
Mixer_UI& _mixer;
void init ();
void setup_comment_button ();
void hide_clicked ();
void io_changed_proxy ();
void connect_to_pan ();
void update_panner_choices ();
void update_fb_level_control ();
void update_output_display ();
void update_send_box ();
void processors_changed (ARDOUR::RouteProcessorChange);
void remove_current_fb ();
void clear_send_box ();
void cycle_foldbacks (bool next);
void update_sensitivity ();
void spill_change (boost::shared_ptr<ARDOUR::Stripable>);
void show_sends_clicked ();
void send_blink (bool);
bool name_button_button_press (GdkEventButton*);
bool send_button_press_event (GdkEventButton* ev);
void create_selected_sends (bool include_buses);
void route_property_changed (const PBD::PropertyChange&);
void name_changed ();
void map_frozen ();
void hide_processor_editor (boost::weak_ptr<ARDOUR::Processor> processor);
void hide_redirect_editors ();
void engine_running ();
void engine_stopped ();
void set_current_delivery (boost::shared_ptr<ARDOUR::Delivery>);
void drop_send ();
Gtk::Menu* build_route_ops_menu ();
Gtk::Menu* build_route_select_menu ();
Gtk::Menu* build_sends_menu ();
Mixer_UI& _mixer;
bool _embedded;
bool _packed;
@ -186,20 +234,17 @@ private:
Gtk::EventBox spacer;
Gtk::VBox send_display;
Gtk::ScrolledWindow send_scroller;
Gtk::Frame global_frame;
Gtk::VBox global_vpacker;
Gtk::HBox master_box;
Gtk::HBox prev_next_box;
ProcessorBox* insert_box;
ProcessorSelection _pr_selection;
PannerUI panners;
Gtk::HBox master_box;
IOButton output_button;
Gtk::HBox prev_next_box;
void help_count_plugins (boost::weak_ptr<ARDOUR::Processor>);
uint32_t _plugin_insert_cnt;
@ -212,52 +257,10 @@ private:
ArdourWidgets::ArdourKnob* fb_level_control;
ArdourWidgets::FastMeter* _meter;
void setup_comment_button ();
void hide_clicked();
void io_changed_proxy ();
PBD::ScopedConnection panstate_connection;
PBD::ScopedConnection panstyle_connection;
void connect_to_pan ();
void update_panner_choices ();
void update_fb_level_control ();
void update_output_display ();
void update_send_box ();
void processors_changed (ARDOUR::RouteProcessorChange);
void clear_send_box ();
gboolean name_button_button_press (GdkEventButton*);
Gtk::Menu* build_route_ops_menu ();
Gtk::Menu* build_route_select_menu ();
void cycle_foldbacks (bool next);
void update_sensitivity ();
void spill_change (boost::shared_ptr<ARDOUR::Stripable>);
void show_sends_clicked ();
void send_blink (bool);
bool send_button_press_event (GdkEventButton *ev);
Gtk::Menu* build_sends_menu ();
void create_selected_sends (bool include_buses);
void remove_current_fb ();
void route_property_changed (const PBD::PropertyChange&);
void name_changed ();
void map_frozen ();
void hide_processor_editor (boost::weak_ptr<ARDOUR::Processor> processor);
void hide_redirect_editors ();
static FoldbackStrip* _entered_foldback_strip;
void engine_running();
void engine_stopped();
void set_current_delivery (boost::shared_ptr<ARDOUR::Delivery>);
void drop_send ();
PBD::ScopedConnection send_gone_connection;
void reset_strip_style ();
@ -266,7 +269,6 @@ private:
bool mixer_strip_leave_event (GdkEventCrossing*);
PBD::ScopedConnectionList _connections;
};
#endif /* __ardour_foldback_strip__ */
#endif