diff options
author | David Robillard <d@drobilla.net> | 2011-10-22 03:21:21 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-10-22 03:21:21 +0000 |
commit | 66b6d9d6fb8446b6225356defd72b0cc3a9511c4 (patch) | |
tree | f27355a3882ac1ebe38b7f5cab9bfe7b5b3471e5 /include/ingen | |
parent | d9e8e65328406f10de9f272572d4bee0732a7b3c (diff) | |
download | ingen-66b6d9d6fb8446b6225356defd72b0cc3a9511c4.tar.gz ingen-66b6d9d6fb8446b6225356defd72b0cc3a9511c4.tar.bz2 ingen-66b6d9d6fb8446b6225356defd72b0cc3a9511c4.zip |
Remove EventType.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3586 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'include/ingen')
-rw-r--r-- | include/ingen/EventType.hpp | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/include/ingen/EventType.hpp b/include/ingen/EventType.hpp deleted file mode 100644 index bbe1fef8..00000000 --- a/include/ingen/EventType.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2008-2011 David Robillard <http://drobilla.net> - * - * Ingen is free software; you can redistribute it and/or modify it under the - * terms of the GNU General Public License as published by the Free Software - * Foundation; either version 2 of the License, or (at your option) any later - * version. - * - * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY - * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef INGEN_INTERFACE_EVENTTYPE_HPP -#define INGEN_INTERFACE_EVENTTYPE_HPP - -#include "raul/URI.hpp" - -namespace Ingen { - -/** A type of event (that can live in an EventBuffer). - */ -class EventType { -public: - - enum Symbol { - UNKNOWN = 0, - MIDI = 1, - OSC = 2 - }; - - EventType(const Raul::URI& uri) - : _symbol(UNKNOWN) - { - if (uri == type_uri(MIDI)) { - _symbol = MIDI; - } else if (uri == type_uri(OSC)) { - _symbol = OSC; - } - } - - EventType(Symbol symbol) - : _symbol(symbol) - {} - - inline const Raul::URI& uri() const { return type_uri(_symbol); } - - inline bool operator==(const Symbol& symbol) const { return (_symbol == symbol); } - inline bool operator!=(const Symbol& symbol) const { return (_symbol != symbol); } - inline bool operator==(const EventType& type) const { return (_symbol == type._symbol); } - inline bool operator!=(const EventType& type) const { return (_symbol != type._symbol); } - - inline bool is_midi() { return _symbol == MIDI; } - inline bool is_osc() { return _symbol == OSC; } - -private: - static inline const Raul::URI& type_uri(unsigned symbol_num) { - assert(symbol_num <= OSC); - static const Raul::URI uris[] = { - "http://drobilla.net/ns/ingen#nil", - "http://drobilla.net/ns/ingen#MidiEvent", - "http://drobilla.net/ns/ingen#OSCEvent" - }; - return uris[symbol_num]; - } - - Symbol _symbol; -}; - -} // namespace Ingen - -#endif // INGEN_INTERFACE_EVENTTYPE_HPP |