* AxisView defines the abstract base class for time-axis trackviews and routes.
*
*/
-class AxisView : public virtual Selectable, public virtual PBD::ScopedConnectionList, public virtual ARDOUR::SessionHandlePtr
+class AxisView : public virtual PBD::ScopedConnectionList, public virtual ARDOUR::SessionHandlePtr, public virtual Selectable
{
public:
ARDOUR::Session* session() const { return _session; }
}; /* class AxisView */
#endif /* __ardour_gtk_axis_view_h__ */
-
bool is_metric_display() { return _strip_type == 0; }
ARDOUR::MeterType meter_type();
+ bool selected() const { return false; }
+
protected:
boost::shared_ptr<ARDOUR::Route> _route;
PBD::ScopedConnectionList meter_route_connections;
}
void
-MixerStrip::set_selected (bool yn)
+MixerStrip::show_selected ()
{
- AxisView::set_selected (yn);
- if (_selected) {
+ if (selected()) {
global_frame.set_shadow_type (Gtk::SHADOW_ETCHED_OUT);
global_frame.set_name ("MixerStripSelectedFrame");
} else {
global_frame.set_shadow_type (Gtk::SHADOW_IN);
global_frame.set_name ("MixerStripFrame");
}
+
global_frame.queue_draw ();
// if (!yn)
}
}
-bool
-MixerStrip::is_selected () const
-{
- if (!_route) {
- return false;
- }
-
- return _route->presentation_info().selected();
-}
-
Gdk::Color
MixerStrip::color () const
{
{
return RouteUI::mark_hidden (!yn);
}
-
void vca_assign (boost::shared_ptr<ARDOUR::VCA>);
void vca_unassign (boost::shared_ptr<ARDOUR::VCA>);
- void set_selected (bool yn);
- bool is_selected() const;
+ void show_selected ();
static MixerStrip* entered_mixer_strip() { return _entered_mixer_strip; }
_selection.add (strip);
} else if (Keyboard::modifier_state_equals (ev->state, Keyboard::RangeSelectModifier)) {
- if (!_selection.selected(strip)) {
-
- /* extend selection */
-
- vector<MixerStrip*> tmp;
- bool accumulate = false;
- bool found_another = false;
-
- tmp.push_back (strip);
-
- for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
- if ((*i) == strip) {
- /* hit clicked strip, start accumulating till we hit the first
- selected strip
- */
- if (accumulate) {
- /* done */
- break;
- } else {
- accumulate = true;
- }
- } else if (_selection.selected (*i)) {
- /* hit selected strip. if currently accumulating others,
- we're done. if not accumulating others, start doing so.
- */
- found_another = true;
- if (accumulate) {
- /* done */
- break;
- } else {
- accumulate = true;
- }
+ /* extend selection */
+
+ vector<MixerStrip*> tmp;
+ bool accumulate = false;
+ bool found_another = false;
+
+ tmp.push_back (strip);
+
+ for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
+ if ((*i) == strip) {
+ /* hit clicked strip, start accumulating till we hit the first
+ selected strip
+ */
+ if (accumulate) {
+ /* done */
+ break;
} else {
- if (accumulate) {
- tmp.push_back (*i);
- }
+ accumulate = true;
}
- }
-
- if (found_another) {
- for (vector<MixerStrip*>::iterator i = tmp.begin(); i != tmp.end(); ++i) {
- _selection.add (*i);
+ } else if (_selection.selected (*i)) {
+ /* hit selected strip. if currently accumulating others,
+ we're done. if not accumulating others, start doing so.
+ */
+ found_another = true;
+ if (accumulate) {
+ /* done */
+ break;
+ } else {
+ accumulate = true;
+ }
+ } else {
+ if (accumulate) {
+ tmp.push_back (*i);
}
- } else
- _selection.set (strip); //user wants to start a range selection, but there aren't any others selected yet
+ }
}
+ if (found_another) {
+ for (vector<MixerStrip*>::iterator i = tmp.begin(); i != tmp.end(); ++i) {
+ _selection.add (*i);
+ }
+ } else
+ _selection.set (strip); //user wants to start a range selection, but there aren't any others selected yet
} else {
_selection.set (strip);
}
{
update_processor_box ();
}
+
{
return RouteUI::mark_hidden (!yn);
}
+
route_color_changed ();
}
}
+
+ if (what_changed.contains (Properties::selected)) {
+ show_selected ();
+ }
+}
+
+void
+RouteUI::set_selected (bool yn)
+{
+ Selectable::set_selected (yn);
+ if (_route) {
+ _route->presentation_info().set_selected (yn);
+ }
+}
+
+bool
+RouteUI::selected () const
+{
+ /* XXX not sure if this is a wise design. Probably don't really want
+ * the cached _selected value from Selectable.
+ */
+
+ if (!_route) {
+ return _selected;
+ }
+
+ return _route->presentation_info().selected();
}
void
}
}
-void
-RouteUI::set_selected (bool yn)
-{
- _route->presentation_info().set_selected (yn);
-}
-
bool
RouteUI::mark_hidden (bool yn)
{
PBD::ScopedConnection going_away_connection;
};
-class RouteUI : public virtual ARDOUR::SessionHandlePtr, public virtual sigc::trackable, public virtual PBD::ScopedConnectionList
+class RouteUI : public virtual ARDOUR::SessionHandlePtr, public virtual Selectable, public virtual PBD::ScopedConnectionList
{
public:
RouteUI (ARDOUR::Session*);
Gdk::Color route_color () const;
void choose_color ();
+ bool selected () const;
void set_selected (bool);
bool ignore_toggle;
std::string route_state_id () const;
-protected:
+ protected:
struct SoloMuteRelease {
SoloMuteRelease (bool was_active)
: active (was_active)
}
void
-TimeAxisView::set_selected (bool yn)
+TimeAxisView::show_selected ()
{
-#if 0
- /* end any name edit in progress */
- if (can_edit_name()) {
- end_name_edit (string(), 0);
- }
-#endif
-
- if (yn == _selected) {
- return;
- }
-
- Selectable::set_selected (yn);
-
- if (_selected) {
+ if (selected()) {
time_axis_frame.set_shadow_type (Gtk::SHADOW_IN);
time_axis_frame.set_name ("MixerStripSelectedFrame");
controls_ebox.set_name (controls_base_selected_name);
}
time_axis_frame.show();
-
}
void
/** @return true if hidden, otherwise false */
bool hidden () const { return _hidden; }
- void set_selected (bool);
virtual bool selectable() const { return true; }
/**
void build_size_menu ();
-private:
+ protected:
+ void show_selected ();
+
+ private:
Gtk::VBox* control_parent;
int _order;
uint32_t _effective_height;