*/
-//#define ALWAYS_DISPLAY_WIRES
-
#ifdef WAF_BUILD
#include "gtk2ardour-config.h"
#endif
#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"
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)
_button.set_active (_processor->active());
+ _routing_icon.set_no_show_all(true);
+ _input_icon.set_no_show_all(true);
+
_button.show ();
-#ifdef ALWAYS_DISPLAY_WIRES
- _routing_icon.show();
-#endif
- _input_icon.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());
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);
/* 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());
}
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 ();
}
switch (_position) {
case PreFader:
_button.set_name ("processor prefader");
- _routing_icon.set_name ("ProcessorPreFader");
break;
case Fader:
_button.set_name ("processor fader");
- _routing_icon.set_name ("ProcessorFader");
break;
case PostFader:
_button.set_name ("processor postfader");
- _routing_icon.set_name ("ProcessorPostFader");
break;
}
}
void
ProcessorEntry::processor_configuration_changed (const ChanCount in, const ChanCount out)
{
-#if 0 // debug, devel information
- printf("ProcessorEntry::processor_config_changed %s %d %d\n",
- name(Wide).c_str(),
- in.n_audio(), out.n_audio());
-#endif
-
_input_icon.set_ports(in);
_output_icon.set_ports(out);
_routing_icon.set_sources(in);
if (_processor) {
boost::shared_ptr<PluginInsert> pi = boost::dynamic_pointer_cast<PluginInsert> (_processor);
if (pi) {
+ std::string postfix = "";
+ uint32_t replicated;
+ if ((replicated = pi->get_count()) > 1) {
+ postfix = string_compose(_("\nThis mono plugin has been replicated %1 times."), replicated);
+ }
if (pi->plugin()->has_editor()) {
ARDOUR_UI::instance()->set_tip (_button,
- string_compose (_("<b>%1</b>\nDouble-click to show GUI.\nAlt+double-click to show generic GUI."), name (Wide)));
+ string_compose (_("<b>%1</b>\nDouble-click to show GUI.\nAlt+double-click to show generic GUI.%2"), name (Wide), postfix));
} else {
ARDOUR_UI::instance()->set_tip (_button,
- string_compose (_("<b>%1</b>\nDouble-click to show generic GUI."), name (Wide)));
+ string_compose (_("<b>%1</b>\nDouble-click to show generic GUI.%2"), name (Wide), postfix));
}
return;
}
}
} else {
+ boost::shared_ptr<ARDOUR::PluginInsert> pi;
+ uint32_t replicated;
+ if ((pi = boost::dynamic_pointer_cast<ARDOUR::PluginInsert> (_processor)) != 0
+ && (replicated = pi->get_count()) > 1)
+ {
+ name_display += string_compose(_("(%1x1) "), replicated);
+ }
switch (w) {
case Wide:
for (list<Control*>::iterator i = _controls.begin(); i != _controls.end(); ++i) {
items.push_back (CheckMenuElem ((*i)->name ()));
- CheckMenuItem* c = dynamic_cast<CheckMenuItem*> (&items.back ());
+ Gtk::CheckMenuItem* c = dynamic_cast<Gtk::CheckMenuItem*> (&items.back ());
c->set_active ((*i)->visible ());
c->signal_toggled().connect (sigc::bind (sigc::mem_fun (*this, &ProcessorEntry::toggle_control_visibility), *i));
}
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);
}
}
}
-void
-ProcessorEntry::Control::hide_label ()
-{
- _label.hide ();
-}
-
string
ProcessorEntry::Control::state_id () const
{
return string_compose (X_("control %1"), c->id().to_s ());
}
-BlankProcessorEntry::BlankProcessorEntry (ProcessorBox* b, Width w, ChanCount cc)
- : ProcessorEntry (b, boost::shared_ptr<Processor>(), w)
-{
-#ifdef ALWAYS_DISPLAY_WIRES
- _vbox.pack_start (_routing_icon);
- _routing_icon.set_sources(cc);
- _routing_icon.set_sinks(cc);
- _routing_icon.show();
- setup_visuals ();
- _routing_icon.set_size_request (-1, 8);
- _vbox.set_size_request (-1, 8);
-#else
- _vbox.set_size_request (-1, 0);
-#endif
-}
-
PluginInsertProcessorEntry::PluginInsertProcessorEntry (ProcessorBox* b, boost::shared_ptr<ARDOUR::PluginInsert> p, Width w)
: ProcessorEntry (b, p, w)
, _plugin_insert (p)
void
PluginInsertProcessorEntry::plugin_insert_splitting_changed ()
{
-#if 0 // debug, devel information
- printf("--%s--\n", _plugin_insert->name().c_str());
- printf("AUDIO src: %d -> in:%d | * cnt %d * | out: %d -> snk: %d\n",
- _plugin_insert->input_streams().n_audio(),
- _plugin_insert->natural_input_streams().n_audio(),
- _plugin_insert->get_count(),
- _plugin_insert->natural_output_streams().n_audio(),
- _plugin_insert->output_streams().n_audio());
- printf("MIDI src: %d -> in:%d | * cnt %d * | out: %d -> snk: %d\n",
- _plugin_insert->input_streams().n_midi(),
- _plugin_insert->natural_input_streams().n_midi(),
- _plugin_insert->get_count(),
- _plugin_insert->natural_output_streams().n_midi(),
- _plugin_insert->output_streams().n_midi());
- printf("TOTAL src: %d -> in:%d | * cnt %d * | out: %d -> snk: %d\n",
- _plugin_insert->input_streams().n_total(),
- _plugin_insert->natural_input_streams().n_total(),
- _plugin_insert->get_count(),
- _plugin_insert->natural_output_streams().n_total(),
- _plugin_insert->output_streams().n_total());
-#endif
-
_output_icon.set_ports(_plugin_insert->output_streams());
_routing_icon.set_splitting(_plugin_insert->splitting ());
_plugin_insert->input_streams().n_audio() < _plugin_insert->natural_input_streams().n_audio()
)
{
- _routing_icon.set_size_request (-1, 8);
- _routing_icon.show();
+ _routing_icon.set_size_request (-1, 7);
+ _routing_icon.set_visible(true);
+ _input_icon.show();
} else {
-#ifdef ALWAYS_DISPLAY_WIRES
- _routing_icon.set_size_request (-1, 4);
-#else
- _routing_icon.hide();
-#endif
+ _routing_icon.set_visible(false);
+ if (_position_num != 0) {
+ _input_icon.hide();
+ }
}
_input_icon.queue_draw();
cairo_rectangle (cr, ev->area.x, ev->area.y, ev->area.width, ev->area.height);
cairo_clip (cr);
- 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();
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, .8, .3, .3);
+ 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, .4, .4, .8);
+ 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);
+ const float x = rintf(width * (.2f + .6f * i / (_ports.n_total() - 1.f)));
+ cairo_rectangle (cr, x-1, 0, 3, height);
+ cairo_fill(cr);
}
} else if (_ports.n_total() == 1) {
if (_ports.n_midi() == 1) {
- cairo_set_source_rgb (cr, .8, .3, .3);
+ 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, .4, .4, .8);
+ 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);
+ const float x = rintf(width * .5);
+ cairo_rectangle (cr, x-1, 0, 3, height);
+ cairo_fill(cr);
cairo_stroke(cr);
}
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();
const uint32_t sinks = _sinks.n_total();
/* MIDI */
- cairo_set_source_rgb (cr, .6, .2, .2);
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_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);
}
/* AUDIO */
- cairo_set_source_rgb (cr, .6, .6, .8);
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);
_route->PropertyChanged.connect (
_route_connections, invalidator (*this), boost::bind (&ProcessorBox::route_property_changed, this, _1), gui_context()
);
-#ifdef ALWAYS_DISPLAY_WIRES
- /* update BlankProcessorEntry wire-count */
- _route->io_changed.connect (
- _route_connections, invalidator (*this), boost::bind (&ProcessorBox::io_changed_proxy, this), gui_context ()
- );
-#endif
redisplay_processors ();
}
`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 ();
{
ENSURE_GUI_THREAD (*this, &ProcessorBox::redisplay_processors);
bool fader_seen;
- ChanCount amp_chan_count;
if (no_processor_redisplay) {
return;
fader_seen = false;
_route->foreach_processor (sigc::bind (sigc::mem_fun (*this, &ProcessorBox::help_count_visible_prefader_processors),
- &_visible_prefader_processors, &fader_seen, &_chan_count));
-
- if (_visible_prefader_processors == 0) { // fader only
- BlankProcessorEntry* bpe = new BlankProcessorEntry (this, _width, amp_chan_count);
- processor_display.add_child (bpe);
- }
+ &_visible_prefader_processors, &fader_seen));
_route->foreach_processor (sigc::mem_fun (*this, &ProcessorBox::add_processor_to_display));
setup_entry_positions ();
}
-void
-ProcessorBox::io_changed_proxy ()
-{
- Glib::signal_idle().connect_once (sigc::mem_fun (*this, &ProcessorBox::redisplay_processors));
-}
-
/** Add a ProcessorWindowProxy for a processor to our list, if that processor does
* not already have one.
*/
}
void
-ProcessorBox::help_count_visible_prefader_processors (boost::weak_ptr<Processor> p, uint32_t* cnt, bool* amp_seen, ChanCount *cc)
+ProcessorBox::help_count_visible_prefader_processors (boost::weak_ptr<Processor> p, uint32_t* cnt, bool* amp_seen)
{
boost::shared_ptr<Processor> processor (p.lock ());
if (boost::dynamic_pointer_cast<Amp>(processor)) {
*amp_seen = true;
- for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
- cc->set(*t, processor->input_streams().get(*t));
- }
} else {
if (!*amp_seen) {
(*cnt)++;
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++);
}
}
}