set_outline_color(calculate_outline(ARDOUR_UI::config()->canvasvar_MidiNoteInactiveChannel.get()));
} else {
// set the color according to the notes selection state
- selected(_selected);
+ set_selected(_selected);
}
// this forces the item to update..... maybe slow...
_item->hide();
}
void
-CanvasNoteEvent::selected(bool selected)
+CanvasNoteEvent::set_selected(bool selected)
{
if (!_note) {
return;
void validate ();
bool selected() const { return _selected; }
- void selected(bool yn);
+ void set_selected(bool yn);
virtual void move_event(double dx, double dy) = 0;
bool
MidiRegionView::key_press (GdkEventKey* ev)
{
- cerr << "MRV key press\n";
-
/* since GTK bindings are generally activated on press, and since
detectable auto-repeat is the name of the game and only sends
repeated presses, carry out key actions at key press, not release.
/* yes, this steals r */
if (midi_view()->midi_track()->step_editing()) {
midi_view()->step_edit_rest ();
- cerr << "Stole that r because " << midi_view()->midi_track()->name()
- << " is step editing!\n";
return true;
}
}
{
for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) {
if ((*i)->selected() && (*i) != ev) {
- (*i)->selected(false);
+ (*i)->set_selected(false);
(*i)->hide_velocity();
}
}
Selection::iterator tmp = i;
++tmp;
- (*i)->selected (false);
+ (*i)->set_selected (false);
_selection.erase (i);
i = tmp;
_selection.erase (i);
}
- ev->selected (false);
+ ev->set_selected (false);
ev->hide_velocity ();
if (_selection.empty()) {
}
if (_selection.insert (ev).second) {
- ev->selected (true);
+ ev->set_selected (true);
play_midi_note ((ev)->note());
}
for (Events::iterator i = e.begin(); i != e.end(); ++i) {
if (_selection.insert (*i).second) {
- (*i)->selected (true);
+ (*i)->set_selected (true);
}
}
editor.get_selection().add (this);
}
}
+
+void
+MidiRegionView::color_handler ()
+{
+ RegionView::color_handler ();
+
+ for (Events::iterator i = _events.begin(); i != _events.end(); ++i) {
+ (*i)->set_selected ((*i)->selected()); // will change color
+ }
+
+ /* XXX probably more to do here */
+}
inline ARDOUR::ColorMode color_mode() const { return midi_view()->color_mode(); }
void set_frame_color();
+ void color_handler ();
void redisplay_model();
void show_list_editor ();
void selection_as_notelist (Notes& selected, bool allow_all_if_none_selected = false);
-
+
protected:
/** Allows derived types to specify their visibility requirements
* to the TimeAxisViewItem parent class.
_note_lines->lower_to_bottom();
- ColorsChanged.connect(sigc::mem_fun(*this, &MidiStreamView::draw_note_lines));
+ ColorsChanged.connect(sigc::mem_fun(*this, &MidiStreamView::color_handler));
note_range_adjustment.set_page_size(_highest_note - _lowest_note);
note_range_adjustment.set_value(_lowest_note);
void
MidiStreamView::draw_note_lines()
{
+ if (!_note_lines) {
+ return;
+ }
+
double y;
double prev_y = contents_height();
uint32_t color;
void
MidiStreamView::color_handler ()
{
+ draw_note_lines ();
+
if (_trackview.is_midi_track()) {
canvas_rect->property_fill_color_rgba() = ARDOUR_UI::config()->canvasvar_MidiTrackBase.get();
} else {
void display_track (boost::shared_ptr<ARDOUR::Track> tr);
void update_contents_height ();
+
void draw_note_lines();
void apply_note_range(uint8_t lowest, uint8_t highest, bool to_region_views);
bool update_data_note_range(uint8_t min, uint8_t max);
virtual void set_height(double h);
void set_y (double);
void set_color (Gdk::Color const &);
-
+
ArdourCanvas::Item* get_canvas_frame();
ArdourCanvas::Group* get_canvas_group();
ArdourCanvas::Item* get_name_highlight();
state once this is done.
*/
- cerr << "This undo has " << side_effect_removals.size() << " SER's to be re-added\n";
for (set<NotePtr>::iterator i = side_effect_removals.begin(); i != side_effect_removals.end(); ++i) {
_model->add_note_unlocked (*i);
}
if (side_effect_notes) {
XMLNodeList notes = side_effect_notes->children();
- cerr << "Reconstruct DiffCommand with " << notes.size() << " SER's\n";
for (XMLNodeList::iterator n = notes.begin(); n != notes.end(); ++n) {
side_effect_removals.insert (unmarshal_note (*n));
}
gettimeofday(&now, 0);
_current_trans.top()->set_timestamp(now);
- cerr << "add cmd @ " << _current_trans.top() << " to history\n";
-
_history.add(_current_trans.top());
_current_trans.pop();
}
UndoTransaction::~UndoTransaction ()
{
- cerr << "UndoTransaction destroyed\n";
drop_references ();
clear ();
}
void
command_death (UndoTransaction* ut, Command* c)
{
- cerr << "Command drop ref\n";
-
if (ut->clearing()) {
return;
}