diff options
Diffstat (limited to 'src/engine/machina/Context.hpp')
-rw-r--r-- | src/engine/machina/Context.hpp | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/engine/machina/Context.hpp b/src/engine/machina/Context.hpp new file mode 100644 index 0000000..270ede7 --- /dev/null +++ b/src/engine/machina/Context.hpp @@ -0,0 +1,44 @@ +/* This file is part of Machina. + * Copyright 2007-2012 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_CONTEXT_HPP +#define MACHINA_CONTEXT_HPP + +#include "raul/Atom.hpp" +#include "raul/TimeSlice.hpp" + +namespace Machina { + +class Context { +public: + Context(Raul::Forge& forge, uint32_t rate, uint32_t ppqn, double bpm) + : _forge(forge) + , _time(rate, ppqn, bpm) + {} + + Raul::Forge& forge() { return _forge; } + const Raul::TimeSlice& time() const { return _time; } + Raul::TimeSlice& time() { return _time; } + +private: + Raul::Forge& _forge; + Raul::TimeSlice _time; +}; + +} // namespace Machina + +#endif // MACHINA_CONTEXT_HPP |