#include "evoral/Control.hpp"
#include "evoral/midi_util.h"
-#include "canvas/pixbuf.h"
+#include "canvas/debug.h"
#include "automation_region_view.h"
#include "automation_time_axis.h"
, pre_press_cursor (0)
, _note_player (0)
{
+ CANVAS_DEBUG_NAME (_note_group, string_compose ("note group for %1", get_item_name()));
_note_group->raise_to_top();
PublicEditor::DropDownKeys.connect (sigc::mem_fun (*this, &MidiRegionView::drop_down_keys));
, pre_press_cursor (0)
, _note_player (0)
{
+ CANVAS_DEBUG_NAME (_note_group, string_compose ("note group for %1", get_item_name()));
_note_group->raise_to_top();
+
PublicEditor::DropDownKeys.connect (sigc::mem_fun (*this, &MidiRegionView::drop_down_keys));
connect_to_diskstream ();
reset_width_dependent_items (_pixel_width);
group->raise_to_top();
- group->Event.connect (sigc::mem_fun (this, &MidiRegionView::canvas_event));
-
midi_view()->midi_track()->PlaybackChannelModeChanged.connect (_channel_mode_changed_connection, invalidator (*this),
boost::bind (&MidiRegionView::midi_channel_mode_changed, this),
}
bool
-MidiRegionView::canvas_event(GdkEvent* ev)
+MidiRegionView::canvas_group_event(GdkEvent* ev)
{
bool r;
break;
}
- return false;
+ return trackview.editor().canvas_region_view_event (ev, group, this);
}
void
MouseMode m = editor.current_mouse_mode();
if (m == MouseDraw || (m == MouseObject && Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier()))) {
-
editor.drags()->set (new NoteCreateDrag (dynamic_cast<Editor *> (&editor), group, this), (GdkEvent *) ev);
_mouse_state = AddDragging;
remove_ghost_note ();
void clear_events (bool with_selection_signal = true);
- bool canvas_event(GdkEvent* ev);
+ bool canvas_group_event(GdkEvent* ev);
bool note_canvas_event(GdkEvent* ev);
void midi_channel_mode_changed ();
}
_selected = selected;
- set_fill_color (base_color ());
+ set_fill_color (base_color());
if (_selected) {
set_outline_color(calculate_outline(ARDOUR_UI::config()->get_canvasvar_MidiNoteSelected()));
_region->PropertyChanged.connect (*this, invalidator (*this), boost::bind (&RegionView::region_changed, this, _1), gui_context());
- group->Event.connect (sigc::bind (sigc::mem_fun (PublicEditor::instance(), &PublicEditor::canvas_region_view_event), group, this));
-
set_colors ();
ColorsChanged.connect (sigc::mem_fun (*this, &RegionView::color_handler));
delete editor;
}
+bool
+RegionView::canvas_group_event (GdkEvent* event)
+{
+ return trackview.editor().canvas_region_view_event (event, group, this);
+}
+
void
RegionView::set_silent_frames (const AudioIntervalResult& silences, double /*threshold*/)
{
bool recording,
TimeAxisViewItem::Visibility);
+ bool canvas_group_event (GdkEvent*);
+
virtual void region_resized (const PBD::PropertyChange&);
virtual void region_muted ();
void region_locked ();
rect->rect = new ArdourCanvas::Rectangle (selection_group);
CANVAS_DEBUG_NAME (rect->rect, "selection rect");
- rect->rect->set_outline_what (0);
+ rect->rect->set_outline (false);
rect->rect->set_fill_color (ARDOUR_UI::config()->get_canvasvar_SelectionRect());
rect->start_trim = new ArdourCanvas::Rectangle (selection_group);
CANVAS_DEBUG_NAME (rect->rect, "selection rect start trim");
- rect->start_trim->set_outline_what (0);
+ rect->start_trim->set_outline (false);
+ rect->start_trim->set_fill (false);
rect->end_trim = new ArdourCanvas::Rectangle (selection_group);
CANVAS_DEBUG_NAME (rect->rect, "selection rect end trim");
- rect->end_trim->set_outline_what (0);
+ rect->end_trim->set_outline (false);
+ rect->end_trim->set_fill (false);
free_selection_rects.push_front (rect);
, _automation (automation)
, _dragging (false)
{
- group = new ArdourCanvas::Group (&parent);
- CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", it_name));
-
- init (it_name, spu, base_color, start, duration, vis, true, true);
+ init (it_name, &parent, spu, base_color, start, duration, vis, true, true);
}
TimeAxisViewItem::TimeAxisViewItem (const TimeAxisViewItem& other)
/* share the other's parent, but still create a new group */
ArdourCanvas::Group* parent = other.group->parent();
-
- group = new ArdourCanvas::Group (parent);
- CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
-
+
_selected = other._selected;
-
- init (other.item_name, other.samples_per_pixel, c, other.frame_position,
+
+ init (other.item_name, parent, other.samples_per_pixel, c, other.frame_position,
other.item_duration, other.visibility, other.wide_enough_for_name, other.high_enough_for_name);
}
void
-TimeAxisViewItem::init (const string& it_name, double fpp, Gdk::Color const & base_color,
+TimeAxisViewItem::init (const string& it_name, ArdourCanvas::Group* parent, double fpp, Gdk::Color const & base_color,
framepos_t start, framepos_t duration, Visibility vis,
bool wide, bool high)
{
+ group = new ArdourCanvas::Group (parent);
+ CANVAS_DEBUG_NAME (group, string_compose ("TAVI group for %1", get_item_name()));
+ group->Event.connect (sigc::mem_fun (*this, &TimeAxisViewItem::canvas_group_event));
+
item_name = it_name;
samples_per_pixel = fpp;
frame_position = start;
delete group;
}
+bool
+TimeAxisViewItem::canvas_group_event (GdkEvent* ev)
+{
+ return false;
+}
+
void
TimeAxisViewItem::hide_rect ()
{
TimeAxisViewItem (const TimeAxisViewItem&);
- void init (const std::string&, double, Gdk::Color const &, framepos_t, framepos_t, Visibility, bool, bool);
+ void init (const std::string&, ArdourCanvas::Group*, double, Gdk::Color const &, framepos_t, framepos_t, Visibility, bool, bool);
+
+ virtual bool canvas_group_event (GdkEvent*);
virtual void compute_colors (Gdk::Color const &);
virtual void set_colors();