diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2014-01-07 21:37:48 -0500 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2014-01-07 21:37:48 -0500 |
commit | 36c233fe6ce570ce85224626ce7aba4a2607537f (patch) | |
tree | e8c1f9f02766cf5f7ea10487967be2c17f49e906 /gtk2_ardour | |
parent | c235d3da994aba4febd644afa09bd5c836c050d5 (diff) | |
parent | 382eb0fc6842f202901245709534477b90bda461 (diff) |
Merge branch 'master' into cairocanvas
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/add_route_dialog.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/add_route_dialog.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/ardour3_styles.rc.in | 27 | ||||
-rw-r--r-- | gtk2_ardour/ardour3_ui_default.conf | 12 | ||||
-rw-r--r-- | gtk2_ardour/ardour3_widget_list.rc | 12 | ||||
-rw-r--r-- | gtk2_ardour/ardour_button.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/editor_mixer.cc | 10 | ||||
-rw-r--r-- | gtk2_ardour/processor_box.cc | 316 | ||||
-rw-r--r-- | gtk2_ardour/processor_box.h | 69 | ||||
-rw-r--r-- | gtk2_ardour/return_ui.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/send_ui.cc | 4 | ||||
-rw-r--r-- | gtk2_ardour/sfdb_ui.cc | 2 |
12 files changed, 317 insertions, 154 deletions
diff --git a/gtk2_ardour/add_route_dialog.cc b/gtk2_ardour/add_route_dialog.cc index e0e5c70798..8837e9f468 100644 --- a/gtk2_ardour/add_route_dialog.cc +++ b/gtk2_ardour/add_route_dialog.cc @@ -56,6 +56,7 @@ AddRouteDialog::AddRouteDialog () , configuration_label (_("Configuration:")) , mode_label (_("Track mode:")) , instrument_label (_("Instrument:")) + , reasonable_synth_id(0) { set_name ("AddRouteDialog"); set_modal (true); @@ -82,7 +83,7 @@ AddRouteDialog::AddRouteDialog () build_instrument_list (); instrument_combo.set_model (instrument_list); instrument_combo.pack_start (instrument_list_columns.name); - instrument_combo.set_active (0); + instrument_combo.set_active (reasonable_synth_id); instrument_combo.set_button_sensitivity (Gtk::SENSITIVITY_AUTO); VBox* vbox = manage (new VBox); @@ -587,6 +588,7 @@ AddRouteDialog::build_instrument_list () row[instrument_list_columns.info_ptr] = PluginInfoPtr (); row[instrument_list_columns.name] = _("-none-"); + uint32_t n = 1; for (PluginInfoList::const_iterator i = all_plugs.begin(); i != all_plugs.end(); ++i) { if (manager.get_status (*i) == PluginManager::Hidden) continue; @@ -595,6 +597,10 @@ AddRouteDialog::build_instrument_list () row = *(instrument_list->append()); row[instrument_list_columns.name] = (*i)->name; row[instrument_list_columns.info_ptr] = *i; + if ((*i)->unique_id == "https://community.ardour.org/node/7596") { + reasonable_synth_id = n; + } + n++; } } } diff --git a/gtk2_ardour/add_route_dialog.h b/gtk2_ardour/add_route_dialog.h index 31b746ac76..7cd3307d48 100644 --- a/gtk2_ardour/add_route_dialog.h +++ b/gtk2_ardour/add_route_dialog.h @@ -122,6 +122,7 @@ class AddRouteDialog : public ArdourDialog InstrumentListColumns instrument_list_columns; void build_instrument_list (); + uint32_t reasonable_synth_id; }; #endif /* __gtk_ardour_add_route_dialog_h__ */ diff --git a/gtk2_ardour/ardour3_styles.rc.in b/gtk2_ardour/ardour3_styles.rc.in index 8b5b5e4c99..8314e9dc36 100644 --- a/gtk2_ardour/ardour3_styles.rc.in +++ b/gtk2_ardour/ardour3_styles.rc.in @@ -731,6 +731,19 @@ style "midi_track_base" = "default" bg[SELECTED] = @@COLPREFIX@_bg } +style "audio_track_fader" = "gain_fader" +{ + bg[PRELIGHT] = @@COLPREFIX@_audio_track +} +style "audio_bus_fader" = "gain_fader" +{ + bg[PRELIGHT] = @@COLPREFIX@_audio_bus +} +style "midi_track_fader" = "gain_fader" +{ + bg[PRELIGHT] = @@COLPREFIX@_midi_track +} + style "audio_track_metrics" = "audio_track_base" { font_name = "@FONT_TINY@" @@ -815,7 +828,9 @@ style "plugin_slider" bg[ACTIVE] = shade (0.6, @@COLPREFIX@_lightest) bg[INSENSITIVE] = shade (0.6, @@COLPREFIX@_lightest) bg[SELECTED] = shade (0.6, @@COLPREFIX@_lightest) - bg[PRELIGHT] = shade (0.6, @@COLPREFIX@_lightest) + + # outer round-corner-background (pixslider does its own hover prelight) + bg[PRELIGHT] = @@COLPREFIX@_bg # the numeric display @@ -826,6 +841,16 @@ style "plugin_slider" text[PRELIGHT] = @@COLPREFIX@_text } +style "processor_control_button" = "very_small_text" +{ +} + +style "processor_control_slider" = "plugin_slider" +{ + bg[PRELIGHT] = @@COLPREFIX@_darkest + bg[NORMAL] = @@COLPREFIX@_bg +} + style "track_list_display" = "small_bold_text" { text[NORMAL] = @@COLPREFIX@_text diff --git a/gtk2_ardour/ardour3_ui_default.conf b/gtk2_ardour/ardour3_ui_default.conf index 619874982d..371ea9a731 100644 --- a/gtk2_ardour/ardour3_ui_default.conf +++ b/gtk2_ardour/ardour3_ui_default.conf @@ -187,12 +187,12 @@ <Option name="processor postfader: led active" value="78cb4eff"/> <Option name="processor postfader: text" value="aaaaa3ff"/> <Option name="processor postfader: text active" value="eeeeecff"/> - <Option name="processor control button: fill start" value="000000ff"/> - <Option name="processor control button: fill end" value="000000ff"/> - <Option name="processor control button: fill start active" value="000000ff"/> - <Option name="processor control button: fill end active" value="000000ff"/> - <Option name="processor control button: led" value="000000ff"/> - <Option name="processor control button: led active" value="ff0000ff"/> + <Option name="processor control button: fill start" value="222222ff"/> + <Option name="processor control button: fill end" value="333333ff"/> + <Option name="processor control button: fill start active" value="444444ff"/> + <Option name="processor control button: fill end active" value="333333ff"/> + <Option name="processor control button: led" value="224400ff"/> + <Option name="processor control button: led active" value="99cc00ff"/> <Option name="processor control button: text" value="ffffffff"/> <Option name="processor control button: text active" value="ffffffff"/> <Option name="monitor button: fill start" value="5f5a58ff"/> diff --git a/gtk2_ardour/ardour3_widget_list.rc b/gtk2_ardour/ardour3_widget_list.rc index 0e7075cef4..582871d87f 100644 --- a/gtk2_ardour/ardour3_widget_list.rc +++ b/gtk2_ardour/ardour3_widget_list.rc @@ -186,9 +186,13 @@ widget "*AudioMidiTrackMetricsInactive" style:highest "midi_track_metrics_inacti widget "*TimeAxisViewControlsBaseUnselected" style:highest "audio_track_base" widget "*AudioTrackControlsBaseUnselected" style:highest "audio_track_base" widget "*MidiTrackControlsBaseUnselected" style:highest "midi_track_base" -widget "*AudioTrackFader" style:highest "gain_fader" -widget "*MidiTrackFader" style:highest "gain_fader" -widget "*AudioBusFader" style:highest "gain_fader" + +widget "*SendUIFader" style:highest "plugin_slider" +widget "*ReturnUIFader" style:highest "plugin_slider" + +widget "*AudioTrackFader" style:highest "audio_track_fader" +widget "*MidiTrackFader" style:highest "midi_track_fader" +widget "*AudioBusFader" style:highest "audio_bus_fader" widget "*BusControlsBaseUnselected" style:highest "audio_bus_base" widget "*TrackSeparator" style:highest "track_separator" @@ -234,6 +238,8 @@ widget "*MotionControllerValue*" style:highest "small_entry" widget "*ParameterValueDisplay" style:highest "medium_bold_entry" widget "*PluginUIClickBox" style:highest "medium_bold_entry" widget "*PluginUIClickBox*" style:highest "medium_bold_entry" +widget "*ProcessorControlSlider" style:highest "processor_control_slider" +widget "*processor control button" style:highest "processor_control_button" widget "*PluginSlider" style:highest "plugin_slider" widget "*GainFader" style:highest "plugin_slider" widget "*MixerTrackCommentArea" style:highest "option_entry" diff --git a/gtk2_ardour/ardour_button.cc b/gtk2_ardour/ardour_button.cc index 3f118921d6..f1f45e90c3 100644 --- a/gtk2_ardour/ardour_button.cc +++ b/gtk2_ardour/ardour_button.cc @@ -302,6 +302,9 @@ ArdourButton::render (cairo_t* cr) } if ( ((_elements & Text)==Text) && !_text.empty()) { + cairo_save (cr); + cairo_rectangle (cr, 2, 1, get_width()-4, get_height()-2); + cairo_clip(cr); cairo_new_path (cr); cairo_set_source_rgba (cr, text_r, text_g, text_b, text_a); @@ -342,7 +345,7 @@ ArdourButton::render (cairo_t* cr) /* use old center'ed layout for follow up items - until rotation/aligment code is completed */ cairo_move_to (cr, (get_width() - _text_width)/2.0, get_height()/2.0 - _text_height/2.0); } - + cairo_restore (cr); } if (((_elements & Indicator)==Indicator)) { @@ -472,6 +475,7 @@ ArdourButton::on_size_request (Gtk::Requisition* req) req->height = _text_height + ypad; } } + req->width += _corner_radius; } void diff --git a/gtk2_ardour/editor_mixer.cc b/gtk2_ardour/editor_mixer.cc index 128767fa9b..67e749de50 100644 --- a/gtk2_ardour/editor_mixer.cc +++ b/gtk2_ardour/editor_mixer.cc @@ -133,17 +133,19 @@ Editor::show_editor_mixer (bool yn) if (current_mixer_strip == 0) { create_editor_mixer (); } - - current_mixer_strip->set_route (r); - current_mixer_strip->set_width_enum (editor_mixer_strip_width, (void*) this); } - if (current_mixer_strip->get_parent() == 0) { + if (current_mixer_strip && current_mixer_strip->get_parent() == 0) { global_hpacker.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK ); global_hpacker.reorder_child (*current_mixer_strip, 0); current_mixer_strip->show (); } + if (r) { + current_mixer_strip->set_route (r); + current_mixer_strip->set_width_enum (editor_mixer_strip_width, (void*) this); + } + } else { if (current_mixer_strip) { diff --git a/gtk2_ardour/processor_box.cc b/gtk2_ardour/processor_box.cc index 08079f4f91..daab501daa 100644 --- a/gtk2_ardour/processor_box.cc +++ b/gtk2_ardour/processor_box.cc @@ -38,6 +38,7 @@ #include <gtkmm2ext/choice.h> #include <gtkmm2ext/utils.h> #include <gtkmm2ext/doi.h> +#include <gtkmm2ext/rgb_macros.h> #include "ardour/amp.h" #include "ardour/audio_track.h" @@ -91,6 +92,9 @@ RefPtr<Action> ProcessorBox::rename_action; RefPtr<Action> ProcessorBox::edit_action; RefPtr<Action> ProcessorBox::edit_generic_action; +static const uint32_t audio_port_color = 0x4A8A0EFF; // Green +static const uint32_t midi_port_color = 0x960909FF; //Red + ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processor> p, Width w) : _button (ArdourButton::led_default_elements) , _position (PreFader) @@ -98,6 +102,8 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo , _processor (p) , _width (w) , _visual_state (Gtk::STATE_NORMAL) + , _input_icon(true) + , _output_icon(false) { _vbox.show (); @@ -109,18 +115,37 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo if (_processor) { + _vbox.pack_start (_routing_icon); + _vbox.pack_start (_input_icon); _vbox.pack_start (_button, true, true); + _vbox.pack_end (_output_icon); _button.set_active (_processor->active()); + + _routing_icon.set_no_show_all(true); + _input_icon.set_no_show_all(true); + _button.show (); + _routing_icon.set_visible(false); + _input_icon.hide(); + _output_icon.show(); _processor->ActiveChanged.connect (active_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_active_changed, this), gui_context()); _processor->PropertyChanged.connect (name_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_property_changed, this, _1), gui_context()); + _processor->ConfigurationChanged.connect (config_connection, invalidator (*this), boost::bind (&ProcessorEntry::processor_configuration_changed, this, _1, _2), gui_context()); set<Evoral::Parameter> p = _processor->what_can_be_automated (); for (set<Evoral::Parameter>::iterator i = p.begin(); i != p.end(); ++i) { - Control* c = new Control (_processor->automation_control (*i), _processor->describe_parameter (*i)); + std::string label = _processor->describe_parameter (*i); + + if (boost::dynamic_pointer_cast<Send> (_processor)) { + label = _("Send"); + } else if (boost::dynamic_pointer_cast<Return> (_processor)) { + label = _("Return"); + } + + Control* c = new Control (_processor->automation_control (*i), label); _controls.push_back (c); @@ -128,13 +153,14 @@ ProcessorEntry::ProcessorEntry (ProcessorBox* parent, boost::shared_ptr<Processo /* Add non-Amp controls to the processor box */ _vbox.pack_start (c->box); } - - if (boost::dynamic_pointer_cast<Send> (_processor)) { - /* Don't label send faders */ - c->hide_label (); - } } + _input_icon.set_ports(_processor->input_streams()); + _output_icon.set_ports(_processor->output_streams()); + + _routing_icon.set_sources(_processor->input_streams()); + _routing_icon.set_sinks(_processor->output_streams()); + setup_tooltip (); setup_visuals (); } else { @@ -168,9 +194,17 @@ ProcessorEntry::drag_text () const } void -ProcessorEntry::set_position (Position p) +ProcessorEntry::set_position (Position p, uint32_t num) { _position = p; + _position_num = num; + + if (_position_num == 0 || _routing_icon.get_visible()) { + _input_icon.show(); + } else { + _input_icon.hide(); + } + setup_visuals (); } @@ -246,6 +280,18 @@ ProcessorEntry::processor_property_changed (const PropertyChange& what_changed) } void +ProcessorEntry::processor_configuration_changed (const ChanCount in, const ChanCount out) +{ + _input_icon.set_ports(in); + _output_icon.set_ports(out); + _routing_icon.set_sources(in); + _routing_icon.set_sinks(out); + _input_icon.queue_draw(); + _output_icon.queue_draw(); + _routing_icon.queue_draw(); +} + +void ProcessorEntry::setup_tooltip () { if (_processor) { @@ -402,18 +448,19 @@ ProcessorEntry::Control::Control (boost::shared_ptr<AutomationControl> c, string , _adjustment (gain_to_slider_position_with_max (1.0, Config->get_max_gain()), 0, 1, 0.01, 0.1) , _slider (&_adjustment, 0, 13, false) , _slider_persistant_tooltip (&_slider) - , _button (ArdourButton::Element (ArdourButton::Text | ArdourButton::Indicator)) + , _button (ArdourButton::led_default_elements) , _ignore_ui_adjustment (false) , _visible (false) , _name (n) { _slider.set_controllable (c); + box.set_padding(0, 0, 4, 4); if (c->toggled()) { _button.set_text (_name); _button.set_led_left (true); _button.set_name ("processor control button"); - box.pack_start (_button); + box.add (_button); _button.show (); _button.signal_clicked.connect (sigc::mem_fun (*this, &Control::button_clicked)); @@ -422,10 +469,10 @@ ProcessorEntry::Control::Control (boost::shared_ptr<AutomationControl> c, string } else { - _slider.set_name ("PluginSlider"); + _slider.set_name ("ProcessorControlSlider"); _slider.set_text (_name); - box.pack_start (_slider); + box.add (_slider); _slider.show (); double const lo = c->internal_to_interface (c->lower ()); @@ -470,7 +517,6 @@ ProcessorEntry::Control::set_tooltip () string sm = Glib::Markup::escape_text (s.str()); - ARDOUR_UI::instance()->set_tip (_label, sm); _slider_persistant_tooltip.set_tip (sm); ARDOUR_UI::instance()->set_tip (_button, sm); } @@ -505,6 +551,7 @@ ProcessorEntry::Control::button_clicked () c->set_value (n ? 0 : 1); _button.set_active (!n); + set_tooltip (); } void @@ -578,12 +625,6 @@ ProcessorEntry::Control::hide_things () } } -void -ProcessorEntry::Control::hide_label () -{ - _label.hide (); -} - string ProcessorEntry::Control::state_id () const { @@ -593,11 +634,6 @@ ProcessorEntry::Control::state_id () const return string_compose (X_("control %1"), c->id().to_s ()); } -BlankProcessorEntry::BlankProcessorEntry (ProcessorBox* b, Width w) - : ProcessorEntry (b, boost::shared_ptr<Processor>(), w) -{ -} - PluginInsertProcessorEntry::PluginInsertProcessorEntry (ProcessorBox* b, boost::shared_ptr<ARDOUR::PluginInsert> p, Width w) : ProcessorEntry (b, p, w) , _plugin_insert (p) @@ -606,31 +642,52 @@ PluginInsertProcessorEntry::PluginInsertProcessorEntry (ProcessorBox* b, boost:: _splitting_connection, invalidator (*this), boost::bind (&PluginInsertProcessorEntry::plugin_insert_splitting_changed, this), gui_context() ); - _splitting_icon.set_size_request (-1, 12); - - _vbox.pack_start (_splitting_icon); - _vbox.reorder_child (_splitting_icon, 0); - plugin_insert_splitting_changed (); } void PluginInsertProcessorEntry::plugin_insert_splitting_changed () { - _splitting_icon.set_inputs(_plugin_insert->input_streams()); - _splitting_icon.set_outputs(_plugin_insert->output_streams()); + _output_icon.set_ports(_plugin_insert->output_streams()); + _routing_icon.set_splitting(_plugin_insert->splitting ()); + + ChanCount sources = _plugin_insert->input_streams(); + ChanCount sinks = _plugin_insert->natural_input_streams(); + + /* replicated instances */ + if (!_plugin_insert->splitting () && _plugin_insert->get_count() > 1) { + for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { + sinks.set(*t, sinks.get(*t) * _plugin_insert->get_count()); + } + } + /* MIDI bypass */ + if (_plugin_insert->natural_output_streams().n_midi() == 0 && + _plugin_insert->output_streams().n_midi() == 1) { + sinks.set(DataType::MIDI, 1); + sources.set(DataType::MIDI, 1); + } + + _input_icon.set_ports(sinks); + _routing_icon.set_sinks(sinks); + _routing_icon.set_sources(sources); - if (_plugin_insert->splitting () || ( - _plugin_insert->input_streams().n_midi() == 0 - && _plugin_insert->input_streams().n_audio() < _plugin_insert->output_streams().n_audio() - ) + if (_plugin_insert->splitting () || + _plugin_insert->input_streams().n_audio() < _plugin_insert->natural_input_streams().n_audio() ) { - _splitting_icon.show (); - _splitting_icon.queue_draw(); + _routing_icon.set_size_request (-1, 7); + _routing_icon.set_visible(true); + _input_icon.show(); } else { - _splitting_icon.hide (); + _routing_icon.set_visible(false); + if (_position_num != 0) { + _input_icon.hide(); + } } + + _input_icon.queue_draw(); + _output_icon.queue_draw(); + _routing_icon.queue_draw(); } void @@ -640,35 +697,78 @@ PluginInsertProcessorEntry::hide_things () plugin_insert_splitting_changed (); } -void -PluginInsertProcessorEntry::setup_visuals () + +bool +ProcessorEntry::PortIcon::on_expose_event (GdkEventExpose* ev) { - switch (_position) { - case PreFader: - _splitting_icon.set_name ("ProcessorPreFader"); - break; + cairo_t* cr = gdk_cairo_create (get_window()->gobj()); - case Fader: - _splitting_icon.set_name ("ProcessorFader"); - break; + cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height); + cairo_clip (cr); - case PostFader: - _splitting_icon.set_name ("ProcessorPostFader"); - break; + cairo_set_line_width (cr, 5.0); + cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); + + Gtk::Allocation a = get_allocation(); + double const width = a.get_width(); + double const height = a.get_height(); + + Gdk::Color const bg = get_style()->get_bg (STATE_NORMAL); + cairo_set_source_rgb (cr, bg.get_red_p (), bg.get_green_p (), bg.get_blue_p ()); + + cairo_rectangle (cr, 0, 0, width, height); + cairo_fill (cr); + + const double y0 = _input ? height-.5 : .5; + + if (_ports.n_total() > 1) { + for (uint32_t i = 0; i < _ports.n_total(); ++i) { + if (i < _ports.n_midi()) { + cairo_set_source_rgb (cr, + UINT_RGBA_R_FLT(midi_port_color), + UINT_RGBA_G_FLT(midi_port_color), + UINT_RGBA_B_FLT(midi_port_color)); + } else { + cairo_set_source_rgb (cr, + UINT_RGBA_R_FLT(audio_port_color), + UINT_RGBA_G_FLT(audio_port_color), + UINT_RGBA_B_FLT(audio_port_color)); + } + const float x = rintf(width * (.2f + .6f * i / (_ports.n_total() - 1.f))) + .5f; + cairo_move_to (cr, x, y0); + cairo_close_path(cr); + cairo_stroke(cr); + } + } else if (_ports.n_total() == 1) { + if (_ports.n_midi() == 1) { + cairo_set_source_rgb (cr, + UINT_RGBA_R_FLT(midi_port_color), + UINT_RGBA_G_FLT(midi_port_color), + UINT_RGBA_B_FLT(midi_port_color)); + } else { + cairo_set_source_rgb (cr, + UINT_RGBA_R_FLT(audio_port_color), + UINT_RGBA_G_FLT(audio_port_color), + UINT_RGBA_B_FLT(audio_port_color)); + } + cairo_move_to (cr, rintf(width * .5) + .5f, y0); + cairo_close_path(cr); + cairo_stroke(cr); } - ProcessorEntry::setup_visuals (); + cairo_destroy(cr); + return true; } bool -PluginInsertProcessorEntry::SplittingIcon::on_expose_event (GdkEventExpose* ev) +ProcessorEntry::RoutingIcon::on_expose_event (GdkEventExpose* ev) { cairo_t* cr = gdk_cairo_create (get_window()->gobj()); cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height); cairo_clip (cr); - cairo_set_line_width (cr, 1.5); + cairo_set_line_width (cr, 1.0); cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); Gtk::Allocation a = get_allocation(); @@ -684,54 +784,64 @@ PluginInsertProcessorEntry::SplittingIcon::on_expose_event (GdkEventExpose* ev) Gdk::Color const fg = get_style()->get_fg (STATE_NORMAL); cairo_set_source_rgb (cr, fg.get_red_p (), fg.get_green_p (), fg.get_blue_p ()); - const uint32_t inputs = _inputs.n_audio(); - const uint32_t outputs = _outputs.n_audio(); - - const float si_m = rintf(height * 0.5) + .5f; - - if (inputs == 1) { - const float si_l = rintf(width * 0.2) + .5f; - const float si_c = rintf(width * 0.5) + .5f; - const float si_r = rintf(width * 0.8) + .5f; - - cairo_move_to (cr, si_l, height); - cairo_line_to (cr, si_l, si_m); - cairo_line_to (cr, si_r, si_m); - cairo_line_to (cr, si_r, height); + const uint32_t sources = _sources.n_total(); + const uint32_t sinks = _sinks.n_total(); + + /* MIDI */ + const uint32_t midi_sources = _sources.n_midi(); + const uint32_t midi_sinks = _sinks.n_midi(); + + cairo_set_source_rgb (cr, + UINT_RGBA_R_FLT(midi_port_color), + UINT_RGBA_G_FLT(midi_port_color), + UINT_RGBA_B_FLT(midi_port_color)); + if (midi_sources > 0 && midi_sinks > 0 && sinks > 1 && sources > 1) { + for (uint32_t i = 0 ; i < midi_sources; ++i) { + const float si_x = rintf(width * (.2f + .6f * i / (sinks - 1.f))) + .5f; + const float si_x0 = rintf(width * (.2f + .6f * i / (sources - 1.f))) + .5f; + cairo_move_to (cr, si_x, height); + cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0); + cairo_stroke (cr); + } + } else if (midi_sources == 1 && midi_sinks == 1 && sinks == 1 && sources == 1) { + const float si_x = rintf(width * .5f) + .5f; + cairo_move_to (cr, si_x, height); + cairo_line_to (cr, si_x, 0); cairo_stroke (cr); + } - cairo_set_line_cap (cr, CAIRO_LINE_CAP_BUTT); - - const uint32_t outputs = _outputs.n_audio(); - for (uint32_t i = 2; i < outputs; ++i) { - const float si_b = rintf(width * (.2f + .6f * (i - 1.f) / (outputs - 1.f))) + .5f; - cairo_move_to (cr, si_b, height); - cairo_line_to (cr, si_b, si_m); + /* AUDIO */ + const uint32_t audio_sources = _sources.n_audio(); + const uint32_t audio_sinks = _sinks.n_audio(); + cairo_set_source_rgb (cr, + UINT_RGBA_R_FLT(audio_port_color), + UINT_RGBA_G_FLT(audio_port_color), + UINT_RGBA_B_FLT(audio_port_color)); + + if (_splitting) { + assert(audio_sinks > 1); + const float si_x0 = rintf(width * .5f) + .5f; + for (uint32_t i = midi_sinks; i < sinks; ++i) { + const float si_x = rintf(width * (.2f + .6f * i / (sinks - 1.f))) + .5f; + cairo_move_to (cr, si_x, height); + cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0); cairo_stroke (cr); } - - cairo_move_to (cr, si_c, si_m); - cairo_line_to (cr, si_c, 0); - cairo_stroke (cr); - } else { - cairo_set_line_cap (cr, CAIRO_LINE_CAP_ROUND); - for (uint32_t i = 0 ; i < outputs; ++i) { - const float si_x = rintf(width * (.2f + .6f * i / (outputs - 1.f))) + .5f; - if (i < inputs) { - cairo_move_to (cr, si_x, height); - cairo_line_to (cr, si_x, 0); - cairo_stroke (cr); - } else { - cairo_move_to (cr, si_x, si_m); - cairo_line_to (cr, si_x, height); - cairo_stroke (cr); - cairo_move_to (cr, si_x+4, si_m); - cairo_line_to (cr, si_x-4, si_m); - cairo_stroke (cr); - } + } else if (audio_sources > 1) { + for (uint32_t i = 0 ; i < audio_sources; ++i) { + const float si_x = rintf(width * (.2f + .6f * (i + midi_sinks) / (sinks - 1.f))) + .5f; + const float si_x0 = rintf(width * (.2f + .6f * (i + midi_sources) / (sources - 1.f))) + .5f; + cairo_move_to (cr, si_x, height); + cairo_curve_to (cr, si_x, 0, si_x0, height, si_x0, 0); + cairo_stroke (cr); } + } else if (audio_sources == 1 && audio_sinks == 1) { + const float si_x = rintf(width * .5f) + .5f; + cairo_move_to (cr, si_x, height); + cairo_line_to (cr, si_x, 0); + cairo_stroke (cr); } - + cairo_destroy(cr); return true; } @@ -761,7 +871,7 @@ ProcessorBox::ProcessorBox (ARDOUR::Session* sess, boost::function<PluginSelecto processor_display.set_name ("ProcessorList"); processor_display.set_data ("processorbox", this); processor_display.set_size_request (48, -1); - processor_display.set_spacing (2); + processor_display.set_spacing (0); processor_display.signal_enter_notify_event().connect (sigc::mem_fun(*this, &ProcessorBox::enter_notify), false); processor_display.signal_leave_notify_event().connect (sigc::mem_fun(*this, &ProcessorBox::leave_notify), false); @@ -845,10 +955,6 @@ ProcessorBox::object_drop(DnDVBox<ProcessorEntry>* source, ProcessorEntry* posit `dropped on' processor */ list<ProcessorEntry*> c = processor_display.children (); list<ProcessorEntry*>::iterator i = c.begin (); - while (dynamic_cast<BlankProcessorEntry*> (*i)) { - assert (i != c.end ()); - ++i; - } assert (i != c.end ()); p = (*i)->processor (); @@ -1427,11 +1533,6 @@ ProcessorBox::redisplay_processors () _route->foreach_processor (sigc::bind (sigc::mem_fun (*this, &ProcessorBox::help_count_visible_prefader_processors), &_visible_prefader_processors, &fader_seen)); - if (_visible_prefader_processors == 0) { // fader only - BlankProcessorEntry* bpe = new BlankProcessorEntry (this, _width); - processor_display.add_child (bpe); - } - _route->foreach_processor (sigc::mem_fun (*this, &ProcessorBox::add_processor_to_display)); for (ProcessorWindowProxies::iterator i = _processor_window_info.begin(); i != _processor_window_info.end(); ++i) { @@ -1612,15 +1713,16 @@ ProcessorBox::setup_entry_positions () list<ProcessorEntry*> children = processor_display.children (); bool pre_fader = true; + uint32_t num = 0; for (list<ProcessorEntry*>::iterator i = children.begin(); i != children.end(); ++i) { if (boost::dynamic_pointer_cast<Amp>((*i)->processor())) { pre_fader = false; - (*i)->set_position (ProcessorEntry::Fader); + (*i)->set_position (ProcessorEntry::Fader, num++); } else { if (pre_fader) { - (*i)->set_position (ProcessorEntry::PreFader); + (*i)->set_position (ProcessorEntry::PreFader, num++); } else { - (*i)->set_position (ProcessorEntry::PostFader); + (*i)->set_position (ProcessorEntry::PostFader, num++); } } } diff --git a/gtk2_ardour/processor_box.h b/gtk2_ardour/processor_box.h index 6aed08d17e..d25710392e 100644 --- a/gtk2_ardour/processor_box.h +++ b/gtk2_ardour/processor_box.h @@ -125,7 +125,7 @@ public: PostFader }; - void set_position (Position); + void set_position (Position, uint32_t); boost::shared_ptr<ARDOUR::Processor> processor () const; void set_enum_width (Width); @@ -143,6 +143,7 @@ protected: ArdourButton _button; Gtk::VBox _vbox; Position _position; + uint32_t _position_num; virtual void setup_visuals (); @@ -150,6 +151,7 @@ private: void led_clicked(); void processor_active_changed (); void processor_property_changed (const PBD::PropertyChange&); + void processor_configuration_changed (const ARDOUR::ChanCount in, const ARDOUR::ChanCount out); std::string name (Width) const; void setup_tooltip (); @@ -159,6 +161,7 @@ private: Gtk::StateType _visual_state; PBD::ScopedConnection active_connection; PBD::ScopedConnection name_connection; + PBD::ScopedConnection config_connection; class Control : public sigc::trackable { public: @@ -168,7 +171,6 @@ private: void add_state (XMLNode *) const; void set_state (XMLNode const *); void hide_things (); - void hide_label (); bool visible () const { return _visible; @@ -178,7 +180,7 @@ private: return _name; } - Gtk::VBox box; + Gtk::Alignment box; private: void slider_adjusted (); @@ -191,7 +193,6 @@ private: /* things for a slider */ Gtk::Adjustment _adjustment; Gtkmm2ext::HSliderController _slider; - Gtk::Label _label; Gtkmm2ext::PersistentTooltip _slider_persistant_tooltip; /* things for a button */ ArdourButton _button; @@ -204,12 +205,43 @@ private: std::list<Control*> _controls; void toggle_control_visibility (Control *); -}; -class BlankProcessorEntry : public ProcessorEntry -{ - public: - BlankProcessorEntry (ProcessorBox *, Width w); + class PortIcon : public Gtk::DrawingArea { + public: + PortIcon(bool input) { + _input = input; + _ports = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 1); + set_size_request (-1, 3); + } + void set_ports(ARDOUR::ChanCount const ports) { _ports = ports; } + private: + bool on_expose_event (GdkEventExpose *); + bool _input; + ARDOUR::ChanCount _ports; + }; + + class RoutingIcon : public Gtk::DrawingArea { + public: + RoutingIcon() { + _sources = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 1); + _sinks = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 1); + _splitting = false; + set_size_request (-1, 4); + } + void set_sources(ARDOUR::ChanCount const sources) { _sources = sources; } + void set_sinks(ARDOUR::ChanCount const sinks) { _sinks = sinks; } + void set_splitting(const bool splitting) { _splitting = splitting; } + private: + bool on_expose_event (GdkEventExpose *); + ARDOUR::ChanCount _sources; // signals available to feed into the processor(s) + ARDOUR::ChanCount _sinks; // combined number of outputs of the processor + bool _splitting; + }; + +protected: + RoutingIcon _routing_icon; + PortIcon _input_icon; + PortIcon _output_icon; }; class PluginInsertProcessorEntry : public ProcessorEntry @@ -220,25 +252,9 @@ public: void hide_things (); private: - void setup_visuals (); void plugin_insert_splitting_changed (); - - class SplittingIcon : public Gtk::DrawingArea { - public: - SplittingIcon() { - _inputs = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 1); - _outputs = ARDOUR::ChanCount(ARDOUR::DataType::AUDIO, 2); - } - void set_inputs(ARDOUR::ChanCount const inputs) { _inputs = inputs; } - void set_outputs(ARDOUR::ChanCount const outputs) { _outputs = outputs; } - private: - bool on_expose_event (GdkEventExpose *); - ARDOUR::ChanCount _inputs; - ARDOUR::ChanCount _outputs; - }; - boost::shared_ptr<ARDOUR::PluginInsert> _plugin_insert; - SplittingIcon _splitting_icon; + PBD::ScopedConnection _splitting_connection; }; @@ -434,6 +450,7 @@ class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARD void mixer_strip_delivery_changed (boost::weak_ptr<ARDOUR::Delivery>); XMLNode* entry_gui_object_state (ProcessorEntry *); + PBD::ScopedConnection amp_config_connection; }; #endif /* __ardour_gtk_processor_box__ */ diff --git a/gtk2_ardour/return_ui.cc b/gtk2_ardour/return_ui.cc index 592fff0a0e..92846af469 100644 --- a/gtk2_ardour/return_ui.cc +++ b/gtk2_ardour/return_ui.cc @@ -42,7 +42,7 @@ ReturnUI::ReturnUI (Gtk::Window* parent, boost::shared_ptr<Return> r, Session* s _gpm.set_controls (boost::shared_ptr<Route>(), r->meter(), r->amp()); _hbox.pack_start (_gpm, true, true); - set_name ("ReturnUIFrame"); + set_name (X_("ReturnUIFrame")); _vbox.set_spacing (5); _vbox.set_border_width (5); @@ -61,7 +61,7 @@ ReturnUI::ReturnUI (Gtk::Window* parent, boost::shared_ptr<Return> r, Session* s _return->input()->changed.connect (input_change_connection, invalidator (*this), boost::bind (&ReturnUI::ins_changed, this, _1, _2), gui_context()); _gpm.setup_meters (); - _gpm.set_fader_name ("ReturnUIFrame"); + _gpm.set_fader_name (X_("ReturnUIFader")); // screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect (sigc::mem_fun (*this, &ReturnUI::update)); fast_screen_update_connection = ARDOUR_UI::instance()->SuperRapidScreenUpdate.connect (sigc::mem_fun (*this, &ReturnUI::fast_update)); diff --git a/gtk2_ardour/send_ui.cc b/gtk2_ardour/send_ui.cc index 1bc4e031f0..1fead73084 100644 --- a/gtk2_ardour/send_ui.cc +++ b/gtk2_ardour/send_ui.cc @@ -46,7 +46,7 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session _gpm.set_controls (boost::shared_ptr<Route>(), s->meter(), s->amp()); _hbox.pack_start (_gpm, true, true); - set_name ("SendUIFrame"); + set_name (X_("SendUIFrame")); _vbox.set_spacing (5); _vbox.set_border_width (5); @@ -77,7 +77,7 @@ SendUI::SendUI (Gtk::Window* parent, boost::shared_ptr<Send> s, Session* session _panners.setup_pan (); _gpm.setup_meters (); - _gpm.set_fader_name ("SendUIFrame"); + _gpm.set_fader_name (X_("SendUIFader")); // screen_update_connection = ARDOUR_UI::instance()->RapidScreenUpdate.connect ( // sigc::mem_fun (*this, &SendUI::update)); diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 4944ef41a0..9b3d78e86d 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -707,7 +707,7 @@ SoundFileBrowser::add_gain_meter () boost::shared_ptr<Route> r = _session->the_auditioner (); gm->set_controls (r, r->shared_peak_meter(), r->amp()); - gm->set_fader_name (X_("AudioTrackFader")); + gm->set_fader_name (X_("GainFader")); meter_packer.set_border_width (12); meter_packer.pack_start (*gm, false, true); |