12345678910111213141516171819202122232425262728293031323334 |
- #include "MessageList.h"
- namespace midi {
-
- bool MessageList::contains(const Message& message) const
- {
- return find(message) != end();
- }
- MessageList::const_iterator MessageList::find(const Message& message) const
- {
- for(const_iterator it = begin(); it != end(); it++) {
- if(message == **it) {
- return it;
- }
- }
- return end();
- }
-
- void MessageList::print(std::ostream& stream) const
- {
- stream << "midi message list:\n";
- unsigned int i = 0;
- for(const_iterator msg_it = begin(); msg_it != end(); msg_it++, i++) {
- stream << "#" << i << " ";
- (*msg_it)->print(stream);
- }
- stream << "\n";
- stream.flush();
- }
- }; // namespace
|