From f293da6bc4f0f631c086d35666e3e8bfef19b8f2 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 10 Jan 2011 21:23:14 +0000 Subject: Rewrite with UI/engine split. Note some things aren't quite working right again yet... git-svn-id: http://svn.drobilla.net/lad/trunk/machina@2821 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/MidiAction.hpp | 59 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 src/engine/MidiAction.hpp (limited to 'src/engine/MidiAction.hpp') diff --git a/src/engine/MidiAction.hpp b/src/engine/MidiAction.hpp new file mode 100644 index 0000000..f8b3fdc --- /dev/null +++ b/src/engine/MidiAction.hpp @@ -0,0 +1,59 @@ +/* This file is part of Machina. + * Copyright (C) 2007-2009 David Robillard + * + * Machina 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 3 of the License, or + * (at your option) any later version. + * + * Machina 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 more details. + * + * You should have received a copy of the GNU General Public License + * along with Machina. If not, see . + */ + +#ifndef MACHINA_MIDIACTION_HPP +#define MACHINA_MIDIACTION_HPP + +#include "raul/AtomicPtr.hpp" +#include "raul/TimeSlice.hpp" + +#include "machina/types.hpp" + +#include "Action.hpp" + +namespace Raul { class MIDISink; } + +namespace Machina { + + +class MidiAction : public Action { +public: + ~MidiAction(); + + MidiAction(size_t size, + const unsigned char* event); + + size_t event_size() { return _size; } + byte* event() { return _event.get(); } + + bool set_event(size_t size, const byte* event); + + void execute(SharedPtr driver, Raul::TimeStamp time); + + virtual void write_state(Redland::Model& model); + +private: + + size_t _size; + const size_t _max_size; + Raul::AtomicPtr _event; +}; + + +} // namespace Machina + +#endif // MACHINA_MIDIACTION_HPP -- cgit v1.2.1