From c521dda2ec729ffb4b84927218c8bb396d0033cc Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 14 Oct 2015 21:31:24 +0000 Subject: Don't use Glib::ustring git-svn-id: http://svn.drobilla.net/lad/trunk/machina@5767 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/Engine.cpp | 12 +++++------- src/engine/Loader.cpp | 16 ++++++---------- src/engine/SMFDriver.hpp | 2 -- src/engine/machina/Engine.hpp | 14 ++++++-------- src/engine/machina/Loader.hpp | 10 ++++------ src/gui/MachinaGUI.cpp | 2 +- 6 files changed, 22 insertions(+), 34 deletions(-) diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp index 969b7cc..1aed7b6 100644 --- a/src/engine/Engine.cpp +++ b/src/engine/Engine.cpp @@ -14,8 +14,6 @@ along with Machina. If not, see . */ -#include - #include "machina_config.h" #include "machina/Engine.hpp" #include "machina/Loader.hpp" @@ -62,7 +60,7 @@ Engine::new_driver(Forge& forge, * Safe to call while engine is processing. */ SPtr -Engine::load_machine(const Glib::ustring& uri) +Engine::load_machine(const std::string& uri) { SPtr machine = _loader.load(uri); SPtr old_machine = _driver->machine(); // Keep reference @@ -78,9 +76,9 @@ Engine::load_machine(const Glib::ustring& uri) * Safe to call while engine is processing. */ SPtr -Engine::load_machine_midi(const Glib::ustring& uri, - double q, - Raul::TimeDuration dur) +Engine::load_machine_midi(const std::string& uri, + double q, + Raul::TimeDuration dur) { SPtr machine = _loader.load_midi(uri, q, dur); SPtr old_machine = _driver->machine(); // Keep reference @@ -93,7 +91,7 @@ Engine::load_machine_midi(const Glib::ustring& uri, } void -Engine::export_midi(const Glib::ustring& filename, Raul::TimeDuration dur) +Engine::export_midi(const std::string& filename, Raul::TimeDuration dur) { SPtr machine = _driver->machine(); SPtr file_driver( diff --git a/src/engine/Loader.cpp b/src/engine/Loader.cpp index 7b37694..1c662d2 100644 --- a/src/engine/Loader.cpp +++ b/src/engine/Loader.cpp @@ -18,8 +18,6 @@ #include #include -#include - #include "lv2/lv2plug.in/ns/ext/midi/midi.h" #include "machina/Loader.hpp" @@ -81,14 +79,12 @@ load_action(Sord::Model& model, Sord::Node node) * @return Loaded Machine. */ SPtr -Loader::load(const Glib::ustring& uri) +Loader::load(const std::string& uri) { - using Glib::ustring; - - ustring document_uri = uri; + std::string document_uri = uri; // If "URI" doesn't contain a colon, try to resolve as a filename - if (uri.find(":") == ustring::npos) { + if (uri.find(":") == string::npos) { document_uri = "file://" + document_uri; } @@ -186,9 +182,9 @@ Loader::load(const Glib::ustring& uri) } SPtr -Loader::load_midi(const Glib::ustring& uri, - double q, - Raul::TimeDuration dur) +Loader::load_midi(const std::string& uri, + double q, + Raul::TimeDuration dur) { SPtr file_driver(new SMFDriver(_forge, dur.unit())); return file_driver->learn(uri, q, dur); diff --git a/src/engine/SMFDriver.hpp b/src/engine/SMFDriver.hpp index d961a19..d22ba53 100644 --- a/src/engine/SMFDriver.hpp +++ b/src/engine/SMFDriver.hpp @@ -17,8 +17,6 @@ #ifndef MACHINA_SMFDRIVER_HPP #define MACHINA_SMFDRIVER_HPP -#include - #include "machina/Driver.hpp" #include "machina/types.hpp" diff --git a/src/engine/machina/Engine.hpp b/src/engine/machina/Engine.hpp index 4bd907b..dd40f42 100644 --- a/src/engine/machina/Engine.hpp +++ b/src/engine/machina/Engine.hpp @@ -19,8 +19,6 @@ #include -#include - #include "machina/Atom.hpp" #include "machina/Driver.hpp" #include "machina/Loader.hpp" @@ -47,13 +45,13 @@ public: SPtr machine() { return _driver->machine(); } Forge& forge() { return _forge; } - SPtr load_machine(const Glib::ustring& uri); - SPtr load_machine_midi(const Glib::ustring& uri, - double q, - Raul::TimeDuration dur); + SPtr load_machine(const std::string& uri); + SPtr load_machine_midi(const std::string& uri, + double q, + Raul::TimeDuration dur); - void export_midi(const Glib::ustring& filename, - Raul::TimeDuration dur); + void export_midi(const std::string& filename, + Raul::TimeDuration dur); void set_bpm(double bpm); void set_quantization(double beat_fraction); diff --git a/src/engine/machina/Loader.hpp b/src/engine/machina/Loader.hpp index 0b1e9ec..3fa66ff 100644 --- a/src/engine/machina/Loader.hpp +++ b/src/engine/machina/Loader.hpp @@ -17,8 +17,6 @@ #ifndef MACHINA_LOADER_HPP #define MACHINA_LOADER_HPP -#include - #include "machina/Atom.hpp" #include "machina/types.hpp" #include "raul/TimeStamp.hpp" @@ -35,11 +33,11 @@ class Loader public: Loader(Forge& forge, Sord::World& rdf_world); - SPtr load(const Glib::ustring& filename); + SPtr load(const std::string& filename); - SPtr load_midi(const Glib::ustring& filename, - double q, - Raul::TimeDuration dur); + SPtr load_midi(const std::string& filename, + double q, + Raul::TimeDuration dur); private: Forge& _forge; diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp index ff7095d..ff71ca7 100644 --- a/src/gui/MachinaGUI.cpp +++ b/src/gui/MachinaGUI.cpp @@ -481,7 +481,7 @@ MachinaGUI::menu_file_save_as() if (filename.length() < 13 || filename.substr(filename.length()-12) != ".machina.ttl") filename += ".machina.ttl"; - Glib::ustring uri = Glib::filename_to_uri(filename); + const std::string uri = Glib::filename_to_uri(filename); bool confirm = false; std::fstream fin; -- cgit v1.2.1