From 66b6d9d6fb8446b6225356defd72b0cc3a9511c4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 22 Oct 2011 03:21:21 +0000 Subject: Remove EventType. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3586 a436a847-0d15-0410-975c-d299462d15a1 --- include/ingen/EventType.hpp | 76 --------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 include/ingen/EventType.hpp (limited to 'include/ingen/EventType.hpp') 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 - * - * 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 -- cgit v1.2.1