boost::bind (&MidiRegionView::snap_changed, this),
gui_context());
+ trackview.editor().MouseModeChanged.connect(_mouse_mode_connection, invalidator (*this),
+ boost::bind (&MidiRegionView::mouse_mode_changed, this),
+ gui_context ());
+
Config->ParameterChanged.connect (*this, invalidator (*this), boost::bind (&MidiRegionView::parameter_changed, this, _1), gui_context());
connect_to_diskstream ();
bool
MidiRegionView::enter_notify (GdkEventCrossing* ev)
{
- trackview.editor().MouseModeChanged.connect (
- _mouse_mode_connection, invalidator (*this), boost::bind (&MidiRegionView::mouse_mode_changed, this), gui_context ()
- );
-
enter_internal();
_entered = true;
void
MidiRegionView::mouse_mode_changed ()
{
- if (trackview.editor().internal_editing()) {
- // Switched in to internal editing mode while entered
- enter_internal();
- } else {
- // Switched out of internal editing mode while entered
- leave_internal();
+ // Adjust frame colour (become more transparent for internal tools)
+ set_frame_color();
+
+ if (_entered) {
+ if (trackview.editor().internal_editing()) {
+ // Switched in to internal editing mode while entered
+ enter_internal();
+ } else {
+ // Switched out of internal editing mode while entered
+ leave_internal();
+ }
}
}
}
}
+uint32_t
+MidiRegionView::fill_opacity() const
+{
+ uint32_t a = RegionView::fill_opacity();
+ if (trackview.editor().current_mouse_mode() == MouseDraw ||
+ trackview.editor().current_mouse_mode() == MouseContent) {
+ /* Make rect more transparent when in an internal mode. This should
+ probably be configurable somehow. */
+ a /= 2;
+ }
+ return a;
+}
+
void
MidiRegionView::set_frame_color()
{
f = fill_color;
}
- if (!rect_visible) {
- f = UINT_RGBA_CHANGE_A (f, 80);
- }
+ f = UINT_RGBA_CHANGE_A (f, fill_opacity());
frame->set_fill_color (f);
}
last_item_width = 0;
wide_enough_for_name = wide;
high_enough_for_name = high;
- rect_visible = true;
vestigial_frame = 0;
if (duration == 0) {
return false;
}
-void
-TimeAxisViewItem::hide_rect ()
-{
- rect_visible = false;
- set_frame_color ();
-
- if (name_highlight) {
- name_highlight->set_outline_what (ArdourCanvas::Rectangle::What (0));
- name_highlight->set_fill_color (UINT_RGBA_CHANGE_A (fill_color, 64));
- }
-}
-
-void
-TimeAxisViewItem::show_rect ()
-{
- rect_visible = true;
- set_frame_color ();
-
- if (name_highlight) {
- name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
- name_highlight->set_fill_color (fill_color);
- }
-}
-
/**
* Set the position of this item on the timeline.
*
uint32_t
TimeAxisViewItem::fill_opacity () const
{
- if (!rect_visible) {
- /* if the frame/rect is marked as "invisible", then the
- fill should be translucent.parent.
- */
- return 64;
- }
-
if (_dragging) {
return 130;
}
virtual void lower () { return; }
virtual void lower_to_bottom () { return; }
- virtual void hide_rect ();
- virtual void show_rect ();
-
/** @return true if the name area should respond to events */
bool name_active() const { return name_connected; }
int name_text_width;
bool wide_enough_for_name;
bool high_enough_for_name;
- bool rect_visible;
ArdourCanvas::Container* group;
ArdourCanvas::Rectangle* vestigial_frame;