diff options
author | David Robillard <d@drobilla.net> | 2011-01-10 21:23:14 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-01-10 21:23:14 +0000 |
commit | f293da6bc4f0f631c086d35666e3e8bfef19b8f2 (patch) | |
tree | d0e693bdec5e4a53daca500434533d2fc5c43650 /src/engine/MidiAction.hpp | |
parent | db319f5a8cb7915b2d5b93adab148fa16d92e7e5 (diff) | |
download | machina-f293da6bc4f0f631c086d35666e3e8bfef19b8f2.tar.gz machina-f293da6bc4f0f631c086d35666e3e8bfef19b8f2.tar.bz2 machina-f293da6bc4f0f631c086d35666e3e8bfef19b8f2.zip |
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
Diffstat (limited to 'src/engine/MidiAction.hpp')
-rw-r--r-- | src/engine/MidiAction.hpp | 59 |
1 files changed, 59 insertions, 0 deletions
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 <http://drobilla.net> + * + * 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 <http://www.gnu.org/licenses/>. + */ + +#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<Raul::MIDISink> driver, Raul::TimeStamp time); + + virtual void write_state(Redland::Model& model); + +private: + + size_t _size; + const size_t _max_size; + Raul::AtomicPtr<byte> _event; +}; + + +} // namespace Machina + +#endif // MACHINA_MIDIACTION_HPP |