diff options
author | David Robillard <d@drobilla.net> | 2007-08-28 17:48:37 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-08-28 17:48:37 +0000 |
commit | 056b2a59d5cb28042926dab61f56e49917c8eec4 (patch) | |
tree | 7c5ae738749667bc5800da51db63205fb0793659 /gtk2_ardour | |
parent | 23949886e6f207e423d11b330b8d7e9ad5a949bf (diff) |
Split MidiModel::Note out to ARDOUR::Note in it's own file (midi_model.h was getting fat).
Initial work on MidiModel iterator.
git-svn-id: svn://localhost/ardour2/trunk@2355 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/canvas-hit.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/canvas-midi-event.cc | 2 | ||||
-rw-r--r-- | gtk2_ardour/canvas-midi-event.h | 14 | ||||
-rw-r--r-- | gtk2_ardour/canvas-note.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/midi_region_view.cc | 6 | ||||
-rw-r--r-- | gtk2_ardour/midi_region_view.h | 4 | ||||
-rw-r--r-- | gtk2_ardour/midi_streamview.cc | 4 |
7 files changed, 17 insertions, 17 deletions
diff --git a/gtk2_ardour/canvas-hit.h b/gtk2_ardour/canvas-hit.h index 114d608a89..b924f981bb 100644 --- a/gtk2_ardour/canvas-hit.h +++ b/gtk2_ardour/canvas-hit.h @@ -29,7 +29,7 @@ namespace Canvas { class CanvasHit : public Diamond, public CanvasMidiEvent { public: - CanvasHit(MidiRegionView& region, Group& group, double size, const ARDOUR::MidiModel::Note* note=NULL) + CanvasHit(MidiRegionView& region, Group& group, double size, const ARDOUR::Note* note=NULL) : Diamond(group, size), CanvasMidiEvent(region, this, note) {} // FIXME diff --git a/gtk2_ardour/canvas-midi-event.cc b/gtk2_ardour/canvas-midi-event.cc index 0ff479eaf3..642ae170b1 100644 --- a/gtk2_ardour/canvas-midi-event.cc +++ b/gtk2_ardour/canvas-midi-event.cc @@ -31,7 +31,7 @@ namespace Gnome { namespace Canvas { -CanvasMidiEvent::CanvasMidiEvent(MidiRegionView& region, Item* item, const ARDOUR::MidiModel::Note* note) +CanvasMidiEvent::CanvasMidiEvent(MidiRegionView& region, Item* item, const ARDOUR::Note* note) : _region(region) , _item(item) , _state(None) diff --git a/gtk2_ardour/canvas-midi-event.h b/gtk2_ardour/canvas-midi-event.h index ce49b580b4..63b32cf0ca 100644 --- a/gtk2_ardour/canvas-midi-event.h +++ b/gtk2_ardour/canvas-midi-event.h @@ -43,7 +43,7 @@ namespace Canvas { */ class CanvasMidiEvent { public: - CanvasMidiEvent(MidiRegionView& region, Item* item, const ARDOUR::MidiModel::Note* note = NULL); + CanvasMidiEvent(MidiRegionView& region, Item* item, const ARDOUR::Note* note = NULL); virtual ~CanvasMidiEvent() {} bool on_event(GdkEvent* ev); @@ -62,16 +62,16 @@ public: const Item* item() const { return _item; } Item* item() { return _item; } - const ARDOUR::MidiModel::Note* note() { return _note; } + const ARDOUR::Note* note() { return _note; } protected: enum State { None, Pressed, Dragging }; - MidiRegionView& _region; - Item* const _item; - State _state; - const ARDOUR::MidiModel::Note* _note; - bool _selected; + MidiRegionView& _region; + Item* const _item; + State _state; + const ARDOUR::Note* _note; + bool _selected; }; } // namespace Gnome diff --git a/gtk2_ardour/canvas-note.h b/gtk2_ardour/canvas-note.h index 398d7d1abb..b12958a8ab 100644 --- a/gtk2_ardour/canvas-note.h +++ b/gtk2_ardour/canvas-note.h @@ -30,7 +30,7 @@ namespace Canvas { class CanvasNote : public SimpleRect, public CanvasMidiEvent { public: - CanvasNote(MidiRegionView& region, Group& group, const ARDOUR::MidiModel::Note* note=NULL) + CanvasNote(MidiRegionView& region, Group& group, const ARDOUR::Note* note=NULL) : SimpleRect(group), CanvasMidiEvent(region, this, note) { } diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index b12f8ef4d9..2d70eb1c95 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -359,7 +359,7 @@ MidiRegionView::create_note_at(double x, double y, double dur) //double dur = m.frames_per_bar(t, trackview.session().frame_rate()) / m.beats_per_bar(); // Add a 1 beat long note (for now) - const MidiModel::Note new_note(stamp, dur, (uint8_t)note, 0x40); + const Note new_note(stamp, dur, (uint8_t)note, 0x40); view->update_bounds(new_note.note()); @@ -629,7 +629,7 @@ MidiRegionView::extend_active_notes() * duration so they can be drawn in full immediately. */ void -MidiRegionView::add_note (const MidiModel::Note& note) +MidiRegionView::add_note (const Note& note) { assert(note.time() >= 0); //assert(note.time() < _region->length()); @@ -777,7 +777,7 @@ MidiRegionView::note_dropped(CanvasMidiEvent* ev, double dt, uint8_t dnote) for (Selection::iterator i = _selection.begin(); i != _selection.end(); ++i) { command_remove_note(*i); - MidiModel::Note copy(*(*i)->note()); + Note copy(*(*i)->note()); copy.set_time((*i)->note()->time() + dt); copy.set_note((*i)->note()->note() + dnote); diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index be05556ce0..1d37ed26e5 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -77,7 +77,7 @@ class MidiRegionView : public RegionView GhostRegion* add_ghost (AutomationTimeAxisView&); void add_event(const ARDOUR::MidiEvent& ev); - void add_note(const ARDOUR::MidiModel::Note& note); + void add_note(const ARDOUR::Note& note); void begin_write(); void end_write(); @@ -99,7 +99,7 @@ class MidiRegionView : public RegionView _delta_command = _model->new_delta_command(); } - void command_add_note(ARDOUR::MidiModel::Note& note) { + void command_add_note(ARDOUR::Note& note) { if (_delta_command) _delta_command->add(note); } diff --git a/gtk2_ardour/midi_streamview.cc b/gtk2_ardour/midi_streamview.cc index 21eae23f90..3e33142b4d 100644 --- a/gtk2_ardour/midi_streamview.cc +++ b/gtk2_ardour/midi_streamview.cc @@ -149,7 +149,7 @@ MidiStreamView::display_region(MidiRegionView* region_view, bool load_model) if (source->model()) { // Find our note range for (size_t i=0; i < source->model()->n_notes(); ++i) { - const MidiModel::Note& note = source->model()->note_at(i); + const Note& note = source->model()->note_at(i); update_bounds(note.note()); } } @@ -469,7 +469,7 @@ MidiStreamView::update_rec_regions (boost::shared_ptr<MidiModel> data, nframes_t MidiRegionView* mrv = (MidiRegionView*)iter->second; // FIXME: slow for (size_t i=0; i < data->n_notes(); ++i) { - const MidiModel::Note& note = data->note_at(i); + const Note& note = data->note_at(i); if (note.time() > start + dur) break; |