summaryrefslogtreecommitdiff
path: root/libs/evoral
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-11-06 18:12:49 -0500
committerDavid Robillard <d@drobilla.net>2016-12-03 15:18:20 -0500
commit0f5a73a7fd00015b9d95bf05f5f4266ae782d469 (patch)
treece5bda90ed6b3a09c0c4ac1e092d67d754eb73ca /libs/evoral
parent90fcdcfde9459f3bc65c48568dc2a5faf4cd7708 (diff)
Fix Sequence/Event const-correctness issues
Diffstat (limited to 'libs/evoral')
-rw-r--r--libs/evoral/evoral/Sequence.hpp5
-rw-r--r--libs/evoral/src/Sequence.cpp4
2 files changed, 4 insertions, 5 deletions
diff --git a/libs/evoral/evoral/Sequence.hpp b/libs/evoral/evoral/Sequence.hpp
index 8485f94a49..7c0818a7fb 100644
--- a/libs/evoral/evoral/Sequence.hpp
+++ b/libs/evoral/evoral/Sequence.hpp
@@ -232,9 +232,8 @@ public:
void invalidate(std::set<WeakNotePtr>* notes);
- const Event<Time>& operator*() const { return *_event; }
- const boost::shared_ptr< Event<Time> > operator->() const { return _event; }
- const boost::shared_ptr< Event<Time> > get_event_pointer() { return _event; }
+ const Event<Time>& operator*() const { return *_event; }
+ const boost::shared_ptr< const Event<Time> > operator->() const { return _event; }
const const_iterator& operator++(); // prefix only
diff --git a/libs/evoral/src/Sequence.cpp b/libs/evoral/src/Sequence.cpp
index 1d518c3f07..b44091371b 100644
--- a/libs/evoral/src/Sequence.cpp
+++ b/libs/evoral/src/Sequence.cpp
@@ -203,7 +203,7 @@ Sequence<Time>::const_iterator::const_iterator(const Sequence<Time>&
DEBUG_TRACE(DEBUG::Sequence,
string_compose("Starting at type 0x%1 : 0x%2 @ %3\n",
(int)_event->event_type(),
- (int)((MIDIEvent<Time>*)_event.get())->type(),
+ (int)_event->buffer()[0],
_event->time()));
}
}
@@ -330,7 +330,7 @@ Sequence<Time>::const_iterator::operator++()
assert(_event && _event->buffer() && _event->size() > 0);
- const MIDIEvent<Time>& ev = *((MIDIEvent<Time>*)_event.get());
+ const MIDIEvent<Time>& ev = *((const MIDIEvent<Time>*)_event.get());
if (!( ev.is_note()
|| ev.is_cc()