aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-10-14 21:31:24 +0000
committerDavid Robillard <d@drobilla.net>2015-10-14 21:31:24 +0000
commitc521dda2ec729ffb4b84927218c8bb396d0033cc (patch)
treeb0e65f7a9797eb9d86229665d80fb7bc3f09c2b2
parent601c25d829ffc3a0ebf4a6a33fc94d0e8df51958 (diff)
downloadmachina-c521dda2ec729ffb4b84927218c8bb396d0033cc.tar.gz
machina-c521dda2ec729ffb4b84927218c8bb396d0033cc.tar.bz2
machina-c521dda2ec729ffb4b84927218c8bb396d0033cc.zip
Don't use Glib::ustring
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@5767 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--src/engine/Engine.cpp12
-rw-r--r--src/engine/Loader.cpp16
-rw-r--r--src/engine/SMFDriver.hpp2
-rw-r--r--src/engine/machina/Engine.hpp14
-rw-r--r--src/engine/machina/Loader.hpp10
-rw-r--r--src/gui/MachinaGUI.cpp2
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 <http://www.gnu.org/licenses/>.
*/
-#include <glibmm/ustring.h>
-
#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<Machine>
-Engine::load_machine(const Glib::ustring& uri)
+Engine::load_machine(const std::string& uri)
{
SPtr<Machine> machine = _loader.load(uri);
SPtr<Machine> 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<Machine>
-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> machine = _loader.load_midi(uri, q, dur);
SPtr<Machine> 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> machine = _driver->machine();
SPtr<machina::SMFDriver> 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 <iostream>
#include <map>
-#include <glibmm/ustring.h>
-
#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<Machine>
-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<Machine>
-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<SMFDriver> 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 <glibmm/ustring.h>
-
#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 <string>
-#include <glibmm/ustring.h>
-
#include "machina/Atom.hpp"
#include "machina/Driver.hpp"
#include "machina/Loader.hpp"
@@ -47,13 +45,13 @@ public:
SPtr<Machine> machine() { return _driver->machine(); }
Forge& forge() { return _forge; }
- SPtr<Machine> load_machine(const Glib::ustring& uri);
- SPtr<Machine> load_machine_midi(const Glib::ustring& uri,
- double q,
- Raul::TimeDuration dur);
+ SPtr<Machine> load_machine(const std::string& uri);
+ SPtr<Machine> 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 <glibmm/ustring.h>
-
#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<Machine> load(const Glib::ustring& filename);
+ SPtr<Machine> load(const std::string& filename);
- SPtr<Machine> load_midi(const Glib::ustring& filename,
- double q,
- Raul::TimeDuration dur);
+ SPtr<Machine> 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;