/* This file is part of Machina. * Copyright 2007-2011 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_ENGINE_HPP #define MACHINA_ENGINE_HPP #include #include #include "raul/Atom.hpp" #include "machina/types.hpp" #include "machina/Driver.hpp" #include "machina/Loader.hpp" namespace Machina { class Machine; class Engine { public: Engine(Raul::Forge& forge, SPtr driver, Sord::World& rdf_world); Sord::World& rdf_world() { return _rdf_world; } static SPtr new_driver(Raul::Forge& forge, const std::string& name, SPtr machine); SPtr driver() { return _driver; } SPtr machine() { return _driver->machine(); } Raul::Forge& forge() { return _forge; } SPtr load_machine(const Glib::ustring& uri); SPtr load_machine_midi(const Glib::ustring& uri, double q, Raul::TimeDuration dur); void import_machine(SPtr machine); void export_midi(const Glib::ustring& filename, Raul::TimeDuration dur); void set_bpm(double bpm); void set_quantization(double beat_fraction); private: SPtr _driver; Sord::World& _rdf_world; Loader _loader; Raul::Forge _forge; }; } // namespace Machina #endif // MACHINA_ENGINE_HPP