2005-09-25 14:42:24 -04:00
|
|
|
/*
|
2006-08-01 15:17:49 -04:00
|
|
|
Copyright (C) 2000-2006 Paul Davis
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ardour_mixer_strip__
|
|
|
|
#define __ardour_mixer_strip__
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include <cmath>
|
2005-11-28 23:41:15 -05:00
|
|
|
|
|
|
|
#include <gtkmm/eventbox.h>
|
|
|
|
#include <gtkmm/button.h>
|
|
|
|
#include <gtkmm/box.h>
|
|
|
|
#include <gtkmm/frame.h>
|
|
|
|
#include <gtkmm/button.h>
|
|
|
|
#include <gtkmm/label.h>
|
|
|
|
#include <gtkmm/togglebutton.h>
|
|
|
|
#include <gtkmm/menu.h>
|
|
|
|
#include <gtkmm/textview.h>
|
|
|
|
#include <gtkmm/adjustment.h>
|
|
|
|
|
2011-01-04 21:06:29 -05:00
|
|
|
#include "gtkmm2ext/auto_spin.h"
|
|
|
|
#include "gtkmm2ext/click_box.h"
|
|
|
|
#include "gtkmm2ext/bindable_button.h"
|
2011-07-01 12:31:21 -04:00
|
|
|
#include "gtkmm2ext/stateful_button.h"
|
2006-07-07 19:51:30 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/stateful.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "ardour/types.h"
|
|
|
|
#include "ardour/ardour.h"
|
|
|
|
#include "ardour/processor.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-02-25 13:26:51 -05:00
|
|
|
#include "pbd/fastlog.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2015-04-24 16:16:34 -04:00
|
|
|
#include "ardour_knob.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
#include "route_ui.h"
|
|
|
|
#include "gain_meter.h"
|
|
|
|
#include "panner_ui.h"
|
|
|
|
#include "enums.h"
|
2007-06-27 16:23:48 -04:00
|
|
|
#include "processor_box.h"
|
2011-10-29 16:08:48 -04:00
|
|
|
#include "visibility_group.h"
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
namespace ARDOUR {
|
|
|
|
class Route;
|
|
|
|
class Send;
|
2007-06-27 16:23:48 -04:00
|
|
|
class Processor;
|
2005-09-25 14:42:24 -04:00
|
|
|
class Session;
|
|
|
|
class PortInsert;
|
2007-05-18 11:58:01 -04:00
|
|
|
class Bundle;
|
2005-09-25 14:42:24 -04:00
|
|
|
class Plugin;
|
|
|
|
}
|
2005-11-28 23:41:15 -05:00
|
|
|
namespace Gtk {
|
|
|
|
class Window;
|
|
|
|
class Style;
|
|
|
|
}
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
class Mixer_UI;
|
2009-06-28 20:38:58 -04:00
|
|
|
class MotionController;
|
|
|
|
class RouteGroupMenu;
|
2011-11-18 19:56:35 -05:00
|
|
|
class ArdourWindow;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
class MixerStrip : public RouteUI, public Gtk::EventBox
|
|
|
|
{
|
|
|
|
public:
|
2009-12-17 13:24:23 -05:00
|
|
|
MixerStrip (Mixer_UI&, ARDOUR::Session*, boost::shared_ptr<ARDOUR::Route>, bool in_mixer = true);
|
|
|
|
MixerStrip (Mixer_UI&, ARDOUR::Session*, bool in_mixer = true);
|
2005-09-25 14:42:24 -04:00
|
|
|
~MixerStrip ();
|
|
|
|
|
2009-06-20 13:15:33 -04:00
|
|
|
void set_width_enum (Width, void* owner);
|
|
|
|
Width get_width_enum () const { return _width; }
|
|
|
|
void* width_owner () const { return _width_owner; }
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-10-22 13:17:34 -04:00
|
|
|
GainMeter& gain_meter() { return gpm; }
|
|
|
|
PannerUI& panner_ui() { return panners; }
|
2009-10-22 21:00:13 -04:00
|
|
|
PluginSelector* plugin_selector();
|
2009-05-16 22:08:13 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
void fast_update ();
|
|
|
|
void set_embedded (bool);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2008-12-08 11:07:28 -05:00
|
|
|
void set_route (boost::shared_ptr<ARDOUR::Route>);
|
2009-06-23 16:02:15 -04:00
|
|
|
void set_button_names ();
|
2009-11-20 10:26:34 -05:00
|
|
|
void show_send (boost::shared_ptr<ARDOUR::Send>);
|
2011-01-04 21:06:15 -05:00
|
|
|
void revert_to_default_display ();
|
|
|
|
|
|
|
|
/** @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;
|
|
|
|
}
|
2006-03-09 18:44:39 -05:00
|
|
|
|
2010-08-17 22:20:15 -04:00
|
|
|
bool mixer_owned () const {
|
|
|
|
return _mixer_owned;
|
|
|
|
}
|
|
|
|
|
2011-02-09 21:44:56 -05:00
|
|
|
void hide_things ();
|
|
|
|
|
2011-01-04 18:26:59 -05:00
|
|
|
sigc::signal<void> WidthChanged;
|
|
|
|
|
|
|
|
/** The delivery that we are handling the level for with our fader has changed */
|
|
|
|
PBD::Signal1<void, boost::weak_ptr<ARDOUR::Delivery> > DeliveryChanged;
|
2008-12-12 09:43:24 -05:00
|
|
|
|
2009-12-25 16:06:52 -05:00
|
|
|
static PBD::Signal1<void,MixerStrip*> CatchDeletion;
|
2009-05-16 22:08:13 -04:00
|
|
|
|
2011-07-06 20:37:13 -04:00
|
|
|
std::string state_id() const;
|
|
|
|
|
2011-10-29 16:08:48 -04:00
|
|
|
void parameter_changed (std::string);
|
2011-11-03 13:49:12 -04:00
|
|
|
void route_active_changed ();
|
2011-10-29 16:08:48 -04:00
|
|
|
|
2011-11-04 13:53:21 -04:00
|
|
|
void copy_processors ();
|
|
|
|
void cut_processors ();
|
|
|
|
void paste_processors ();
|
|
|
|
void select_all_processors ();
|
2014-07-24 23:49:33 -04:00
|
|
|
void deselect_all_processors ();
|
2014-07-24 13:30:11 -04:00
|
|
|
bool delete_processors (); //note: returns false if nothing was deleted
|
2011-11-04 13:53:21 -04:00
|
|
|
void toggle_processors ();
|
|
|
|
void ab_plugins ();
|
|
|
|
|
2014-07-23 17:13:55 -04:00
|
|
|
void set_selected(bool yn);
|
2014-07-23 17:58:43 -04:00
|
|
|
bool is_selected() {return _selected;}
|
2014-07-23 17:13:55 -04:00
|
|
|
|
2014-07-24 12:28:31 -04:00
|
|
|
static MixerStrip* entered_mixer_strip() { return _entered_mixer_strip; }
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
protected:
|
|
|
|
friend class Mixer_UI;
|
|
|
|
void set_packed (bool yn);
|
|
|
|
bool packed () { return _packed; }
|
|
|
|
|
|
|
|
void set_stuff_from_route ();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Mixer_UI& _mixer;
|
|
|
|
|
2008-12-08 11:07:28 -05:00
|
|
|
void init ();
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
bool _embedded;
|
|
|
|
bool _packed;
|
2008-02-16 17:43:18 -05:00
|
|
|
bool _mixer_owned;
|
2005-09-25 14:42:24 -04:00
|
|
|
Width _width;
|
2007-04-29 18:39:21 -04:00
|
|
|
void* _width_owner;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2011-11-28 12:58:15 -05:00
|
|
|
ArdourButton hide_button;
|
|
|
|
ArdourButton width_button;
|
2014-07-06 14:14:12 -04:00
|
|
|
ArdourButton number_label;
|
2005-09-25 14:42:24 -04:00
|
|
|
Gtk::HBox width_hide_box;
|
2008-12-14 02:59:33 -05:00
|
|
|
Gtk::EventBox* spacer;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void hide_clicked();
|
2011-11-24 15:07:55 -05:00
|
|
|
bool width_button_pressed (GdkEventButton *);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
Gtk::Frame global_frame;
|
|
|
|
Gtk::VBox global_vpacker;
|
|
|
|
|
2009-07-12 20:26:28 -04:00
|
|
|
ProcessorBox processor_box;
|
2011-05-18 02:53:24 -04:00
|
|
|
GainMeter gpm;
|
|
|
|
PannerUI panners;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-11-03 10:53:24 -04:00
|
|
|
Glib::RefPtr<Gtk::SizeGroup> button_size_group;
|
|
|
|
|
2014-07-14 11:08:38 -04:00
|
|
|
Gtk::Table rec_mon_table;
|
|
|
|
Gtk::Table solo_iso_table;
|
|
|
|
Gtk::Table mute_solo_table;
|
2006-05-19 13:29:05 -04:00
|
|
|
Gtk::Table bottom_button_table;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2011-11-28 12:58:15 -05:00
|
|
|
ArdourButton meter_point_button;
|
2006-05-21 06:11:59 -04:00
|
|
|
|
2010-04-03 09:40:34 -04:00
|
|
|
void meter_changed ();
|
2006-05-21 06:11:59 -04:00
|
|
|
|
2011-11-28 12:58:15 -05:00
|
|
|
ArdourButton input_button;
|
|
|
|
ArdourButton output_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2015-03-11 14:45:02 -04:00
|
|
|
void input_button_resized (Gtk::Allocation&);
|
|
|
|
void output_button_resized (Gtk::Allocation&);
|
|
|
|
|
2011-11-28 12:58:15 -05:00
|
|
|
ArdourButton* midi_input_enable_button;
|
2011-06-28 12:55:41 -04:00
|
|
|
Gtk::HBox input_button_box;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-12-04 12:45:11 -05:00
|
|
|
std::string longest_label;
|
|
|
|
|
2011-06-28 12:55:41 -04:00
|
|
|
void midi_input_status_changed ();
|
2011-07-03 11:01:21 -04:00
|
|
|
bool input_active_button_press (GdkEventButton*);
|
|
|
|
bool input_active_button_release (GdkEventButton*);
|
2011-06-28 12:55:41 -04:00
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
gint mark_update_safe ();
|
|
|
|
guint32 mode_switch_in_progress;
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2011-11-28 12:58:15 -05:00
|
|
|
ArdourButton name_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2011-11-28 12:58:15 -05:00
|
|
|
ArdourButton _comment_button;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2015-04-24 16:16:34 -04:00
|
|
|
ArdourKnob trim_control;
|
|
|
|
|
2011-10-29 17:18:26 -04:00
|
|
|
void setup_comment_button ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2011-11-28 12:58:15 -05:00
|
|
|
ArdourButton group_button;
|
2009-06-28 20:38:58 -04:00
|
|
|
RouteGroupMenu *group_menu;
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
gint input_press (GdkEventButton *);
|
2014-08-22 12:45:34 -04:00
|
|
|
gint input_release (GdkEventButton *);
|
|
|
|
|
2005-09-25 14:42:24 -04:00
|
|
|
gint output_press (GdkEventButton *);
|
2014-08-22 12:45:34 -04:00
|
|
|
gint output_release (GdkEventButton *);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2009-11-09 22:16:57 -05:00
|
|
|
Gtk::Menu input_menu;
|
|
|
|
std::list<boost::shared_ptr<ARDOUR::Bundle> > input_menu_bundles;
|
2009-02-10 21:14:01 -05:00
|
|
|
void maybe_add_bundle_to_input_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
Gtk::Menu output_menu;
|
2009-11-09 22:16:57 -05:00
|
|
|
std::list<boost::shared_ptr<ARDOUR::Bundle> > output_menu_bundles;
|
2009-02-10 21:14:01 -05:00
|
|
|
void maybe_add_bundle_to_output_menu (boost::shared_ptr<ARDOUR::Bundle>, ARDOUR::BundleList const &);
|
2009-10-14 12:10:01 -04:00
|
|
|
|
2012-10-18 12:15:11 -04:00
|
|
|
void bundle_input_chosen (boost::shared_ptr<ARDOUR::Bundle>);
|
|
|
|
void bundle_output_chosen (boost::shared_ptr<ARDOUR::Bundle>);
|
2005-09-25 14:42:24 -04:00
|
|
|
|
2006-07-31 23:23:35 -04:00
|
|
|
void diskstream_changed ();
|
2014-01-08 18:18:29 -05:00
|
|
|
void io_changed_proxy ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
Gtk::Menu *send_action_menu;
|
2009-03-05 12:25:52 -05:00
|
|
|
Gtk::MenuItem* rename_menu_item;
|
2005-09-25 14:42:24 -04:00
|
|
|
void build_send_action_menu ();
|
|
|
|
|
|
|
|
void new_send ();
|
|
|
|
void show_send_controls ();
|
|
|
|
|
2009-12-21 13:23:07 -05:00
|
|
|
PBD::ScopedConnection panstate_connection;
|
|
|
|
PBD::ScopedConnection panstyle_connection;
|
2005-09-25 14:42:24 -04:00
|
|
|
void connect_to_pan ();
|
2014-01-08 18:18:29 -05:00
|
|
|
void update_panner_choices ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
void update_diskstream_display ();
|
|
|
|
void update_input_display ();
|
|
|
|
void update_output_display ();
|
|
|
|
|
|
|
|
void set_automated_controls_sensitivity (bool yn);
|
|
|
|
|
2006-01-07 21:56:49 -05:00
|
|
|
Gtk::Menu* route_ops_menu;
|
2005-09-25 14:42:24 -04:00
|
|
|
void build_route_ops_menu ();
|
2010-04-16 15:31:57 -04:00
|
|
|
gboolean name_button_button_press (GdkEventButton*);
|
2014-08-22 12:45:34 -04:00
|
|
|
gboolean name_button_button_release (GdkEventButton*);
|
2014-07-29 17:40:19 -04:00
|
|
|
gboolean number_button_button_press (GdkEventButton*);
|
2005-09-25 14:42:24 -04:00
|
|
|
void list_route_operations ();
|
|
|
|
|
2009-06-21 15:59:56 -04:00
|
|
|
bool select_route_group (GdkEventButton *);
|
2009-12-09 22:25:32 -05:00
|
|
|
void route_group_changed ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
Gtk::Style *passthru_style;
|
|
|
|
|
2011-08-30 11:44:00 -04:00
|
|
|
void route_color_changed ();
|
2005-09-25 14:42:24 -04:00
|
|
|
void show_passthru_color ();
|
|
|
|
|
2011-12-01 11:57:29 -05:00
|
|
|
void property_changed (const PBD::PropertyChange&);
|
|
|
|
void name_button_resized (Gtk::Allocation&);
|
2007-06-23 16:13:13 -04:00
|
|
|
void name_changed ();
|
2005-09-25 14:42:24 -04:00
|
|
|
void update_speed_display ();
|
|
|
|
void map_frozen ();
|
2008-12-16 18:21:01 -05:00
|
|
|
void hide_processor_editor (boost::weak_ptr<ARDOUR::Processor> processor);
|
2008-03-17 16:54:03 -04:00
|
|
|
void hide_redirect_editors ();
|
2005-09-25 14:42:24 -04:00
|
|
|
|
|
|
|
bool ignore_speed_adjustment;
|
|
|
|
|
2014-07-24 12:28:31 -04:00
|
|
|
static MixerStrip* _entered_mixer_strip;
|
|
|
|
|
2006-05-17 08:07:16 -04:00
|
|
|
void engine_running();
|
|
|
|
void engine_stopped();
|
|
|
|
|
2011-11-02 20:42:16 -04:00
|
|
|
virtual void bus_send_display_changed (boost::shared_ptr<ARDOUR::Route>);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2011-01-04 18:26:59 -05:00
|
|
|
void set_current_delivery (boost::shared_ptr<ARDOUR::Delivery>);
|
2011-06-01 13:00:29 -04:00
|
|
|
|
2009-11-20 10:26:34 -05:00
|
|
|
void drop_send ();
|
2009-12-21 13:23:07 -05:00
|
|
|
PBD::ScopedConnection send_gone_connection;
|
2009-11-20 10:26:34 -05:00
|
|
|
|
2009-11-20 12:11:00 -05:00
|
|
|
void reset_strip_style ();
|
|
|
|
|
2009-10-01 13:20:12 -04:00
|
|
|
void update_io_button (boost::shared_ptr<ARDOUR::Route> route, Width width, bool input_button);
|
2011-10-28 13:04:09 -04:00
|
|
|
void port_connected_or_disconnected (boost::weak_ptr<ARDOUR::Port>, boost::weak_ptr<ARDOUR::Port>);
|
2011-02-22 12:04:06 -05:00
|
|
|
|
2014-07-24 12:28:31 -04:00
|
|
|
bool mixer_strip_enter_event ( GdkEventCrossing * );
|
|
|
|
bool mixer_strip_leave_event ( GdkEventCrossing * );
|
|
|
|
|
2011-10-29 16:08:48 -04:00
|
|
|
/** A VisibilityGroup to manage the visibility of some of our controls.
|
|
|
|
* We fill it with the controls that are being managed, using the same names
|
|
|
|
* as those used with _mixer_strip_visibility in RCOptionEditor. Then
|
|
|
|
* this VisibilityGroup is configured by changes to the RC variable
|
2014-07-28 16:55:20 -04:00
|
|
|
* mixer-element-visibility, which happen when the user makes changes in
|
2011-10-29 16:08:48 -04:00
|
|
|
* the RC option editor.
|
|
|
|
*/
|
|
|
|
VisibilityGroup _visibility;
|
2011-11-02 21:44:17 -04:00
|
|
|
boost::optional<bool> override_solo_visibility () const;
|
2011-10-29 16:08:48 -04:00
|
|
|
|
2014-06-26 13:21:05 -04:00
|
|
|
PBD::ScopedConnectionList _config_connection;
|
2011-10-29 16:08:48 -04:00
|
|
|
|
2011-11-02 22:20:45 -04:00
|
|
|
void add_input_port (ARDOUR::DataType);
|
|
|
|
void add_output_port (ARDOUR::DataType);
|
|
|
|
|
2013-07-07 13:04:07 -04:00
|
|
|
bool _suspend_menu_callbacks;
|
2011-11-13 10:12:34 -05:00
|
|
|
bool level_meter_button_press (GdkEventButton *);
|
|
|
|
void popup_level_meter_menu (GdkEventButton *);
|
2013-07-07 00:17:02 -04:00
|
|
|
void add_level_meter_item_point (Gtk::Menu_Helpers::MenuList &, Gtk::RadioMenuItem::Group &, std::string const &, ARDOUR::MeterPoint);
|
|
|
|
void add_level_meter_item_type (Gtk::Menu_Helpers::MenuList &, Gtk::RadioMenuItem::Group &, std::string const &, ARDOUR::MeterType);
|
2011-11-13 10:12:34 -05:00
|
|
|
void set_meter_point (ARDOUR::MeterPoint);
|
2013-07-07 00:17:02 -04:00
|
|
|
void set_meter_type (ARDOUR::MeterType);
|
2011-11-13 10:12:34 -05:00
|
|
|
PBD::ScopedConnection _level_meter_connection;
|
|
|
|
|
2012-11-26 17:05:45 -05:00
|
|
|
std::string meter_point_string (ARDOUR::MeterPoint);
|
2005-09-25 14:42:24 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __ardour_mixer_strip__ */
|