# Basic background colour
bg[NORMAL] = { 0, 0, 0 }
- # A selected processor
- bg[SELECTED] = { 0, 0.5, 0.9 }
-
- # A send processor whose level is being controlled by the fader
+ # Colours for sends whose level is being controller by the fader
bg[ACTIVE] = { 0.19, 0.97, 0.69 }
fg[ACTIVE] = { 0.0, 0.0, 0.0 }
GtkCheckButton::indicator-spacing = 0
}
-# Colour of the frame of the fader in the processor list
+# Colour of a processor frame when it is selected
+style "processor_frame_selected"
+{
+ bg[NORMAL] = { 0.9, 0.8, 0.2 }
+}
+
+# Colour of a processor frame when it is a send whose level is being controller by the fader
+style "processor_frame_active_send"
+{
+ bg[NORMAL] = { 0.19, 0.97, 0.69 }
+}
+
+# Fader processor's background
+style "processor_fader"
+{
+ bg[NORMAL] = { 0.4, 0.4, 0.4 }
+}
+
+# Fader processor's frame
style "processor_fader_frame"
{
bg[NORMAL] = { 0.5, 0.5, 0.5 }
}
-# A pre-fader processor's background
+# Pre-fader processor's background
style "processor_prefader"
{
bg[NORMAL] = { 0.3, 0.0, 0.0 }
}
-# A pre-fader processor's frame
+# Pre-fader processor's frame
style "processor_prefader_frame"
{
bg[NORMAL] = { 0.5, 0.0, 0.0 }
}
-# The fader processor
-style "processor_fader"
-{
- bg[NORMAL] = { 0.4, 0.4, 0.4 }
-}
-
-# A post-fader processor's background
+# Post-fader processor's background
style "processor_postfader"
{
bg[NORMAL] = { 0.1, 0.3, 0.1 }
}
-# A post-fader processor's frame
+# Post-fader processor's frame
style "processor_postfader_frame"
{
bg[NORMAL] = { 0.1, 0.5, 0.1 }
widget "*EvenPortGroups" style:highest "even_port_groups"
widget "*MidiListView*" style:highest "white_tree_view"
widget "*ProcessorList*" style:highest "processor_list"
-widget "*ProcessorFaderFrame*" style:highest "processor_fader_frame"
+widget "*ProcessorFrameSelected" style:highest "processor_frame_selected"
+widget "*ProcessorFrameActiveSend" style:highest "processor_frame_active_send"
+widget "*ProcessorFaderFrame" style:highest "processor_fader_frame"
widget "*ProcessorPreFader" style:highest "processor_prefader"
widget "*ProcessorPreFaderFrame" style:highest "processor_prefader_frame"
widget "*ProcessorFader" style:highest "processor_fader"
ProcessorEntry::ProcessorEntry (boost::shared_ptr<Processor> p, Width w)
: _processor (p)
, _width (w)
+ , _visual_state (Gtk::STATE_NORMAL)
+ , _position (PreFader)
{
_hbox.pack_start (_active, false, false);
_event_box.add (_name);
return name ();
}
+void
+ProcessorEntry::set_visual_state (Gtk::StateType t)
+{
+ _visual_state = t;
+ setup_visuals ();
+}
+
+void
+ProcessorEntry::set_position (Position p)
+{
+ _position = p;
+ setup_visuals ();
+}
+
+void
+ProcessorEntry::setup_visuals ()
+{
+ switch (_position) {
+ case PreFader:
+ _event_box.set_name ("ProcessorPreFader");
+ if (_visual_state == Gtk::STATE_NORMAL) {
+ _frame.set_name ("ProcessorPreFaderFrame");
+ }
+ break;
+
+ case Fader:
+ _event_box.set_name ("ProcessorFader");
+ if (_visual_state == Gtk::STATE_NORMAL) {
+ _frame.set_name ("ProcessorFaderFrame");
+ }
+ break;
+
+ case PostFader:
+ _event_box.set_name ("ProcessorPostFader");
+ if (_visual_state == Gtk::STATE_NORMAL) {
+ _frame.set_name ("ProcessorPostFaderFrame");
+ }
+ break;
+ }
+
+ switch (_visual_state) {
+ case Gtk::STATE_NORMAL:
+ /* _frame has been set up above */
+ _event_box.set_state (Gtk::STATE_NORMAL);
+ break;
+ case Gtk::STATE_SELECTED:
+ _frame.set_name ("ProcessorFrameSelected");
+ /* don't change the background of the box when it is selected */
+ _event_box.set_state (Gtk::STATE_NORMAL);
+ break;
+ case Gtk::STATE_ACTIVE:
+ _frame.set_name ("ProcessorFrameActiveSend");
+ _event_box.set_state (Gtk::STATE_ACTIVE);
+ break;
+ }
+}
+
+
boost::shared_ptr<Processor>
ProcessorEntry::processor () const
{
i = j;
}
- setup_entry_widget_names ();
+ setup_entry_positions ();
}
/** Add a ProcessorWindowProxy for a processor to our list, if that processor does
ProcessorBox::reordered ()
{
compute_processor_sort_keys ();
- setup_entry_widget_names ();
+ setup_entry_positions ();
}
-/* Name the Entry widgets according to pre- or post-fader so that they get coloured right */
void
-ProcessorBox::setup_entry_widget_names ()
+ProcessorBox::setup_entry_positions ()
{
- /* It just so happens that the action_widget() is the event box (which gives the background
- * colour) and the widget() is the frame, more by good luck than good judgement.
- */
-
list<ProcessorEntry*> children = processor_display.children ();
bool pre_fader = true;
+
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);
} else {
if (pre_fader) {
- (*i)->action_widget().set_name ("ProcessorPreFader");
- (*i)->widget().set_name ("ProcessorPreFaderFrame");
+ (*i)->set_position (ProcessorEntry::PreFader);
} else {
- (*i)->action_widget().set_name ("ProcessorPostFader");
- (*i)->widget().set_name ("ProcessorPostFaderFrame");
+ (*i)->set_position (ProcessorEntry::PostFader);
}
}
}
Gtk::EventBox& action_widget ();
Gtk::Widget& widget ();
std::string drag_text () const;
+ void set_visual_state (Gtk::StateType);
+
+ enum Position {
+ PreFader,
+ Fader,
+ PostFader
+ };
+
+ void set_position (Position);
boost::shared_ptr<ARDOUR::Processor> processor () const;
void set_enum_width (Width);
virtual void set_pixel_width (int) {}
void processor_active_changed ();
void processor_property_changed (const PBD::PropertyChange&);
std::string name () const;
+ void setup_visuals ();
Gtk::Frame _frame;
Gtk::EventBox _event_box;
Gtk::CheckButton _active;
boost::shared_ptr<ARDOUR::Processor> _processor;
Width _width;
+ Gtk::StateType _visual_state;
+ Position _position;
PBD::ScopedConnection active_connection;
PBD::ScopedConnection name_connection;
};
void weird_plugin_dialog (ARDOUR::Plugin& p, ARDOUR::Route::ProcessorStreams streams);
void on_size_allocate (Gtk::Allocation &);
- void setup_entry_widget_names ();
+ void setup_entry_positions ();
static ProcessorBox* _current_processor_box;
/** @return Text to use in the icon that is dragged */
virtual std::string drag_text () const = 0;
+
+ /** Set the child's visual state */
+ virtual void set_visual_state (Gtk::StateType) = 0;
};
/** A VBox whose contents can be dragged and dropped */
assert (c);
if (c == _active) {
- c->action_widget().set_state (Gtk::STATE_ACTIVE);
+ c->set_visual_state (Gtk::STATE_ACTIVE);
} else if (selected (c)) {
- c->action_widget().set_state (Gtk::STATE_SELECTED);
+ c->set_visual_state (Gtk::STATE_SELECTED);
} else {
- c->action_widget().set_state (Gtk::STATE_NORMAL);
+ c->set_visual_state (Gtk::STATE_NORMAL);
}
}