diff options
author | David Robillard <d@drobilla.net> | 2018-01-21 00:41:34 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2018-01-21 00:56:50 +0100 |
commit | a99b72e4adbc4c28fadc08d29299d99405f72db9 (patch) | |
tree | fb21f2cea8f5db1dc187cdbdd01f43e73bbddfff /tests/ingen_test.cpp | |
parent | 329f498d901f9be9c0c820749850f5277a17df5d (diff) | |
download | ingen-a99b72e4adbc4c28fadc08d29299d99405f72db9.tar.gz ingen-a99b72e4adbc4c28fadc08d29299d99405f72db9.tar.bz2 ingen-a99b72e4adbc4c28fadc08d29299d99405f72db9.zip |
Add FilePath class and remove use of glib path utilities
Diffstat (limited to 'tests/ingen_test.cpp')
-rw-r--r-- | tests/ingen_test.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/tests/ingen_test.cpp b/tests/ingen_test.cpp index ab7cbc7d..beac1a7f 100644 --- a/tests/ingen_test.cpp +++ b/tests/ingen_test.cpp @@ -22,11 +22,6 @@ #include <boost/optional.hpp> -#include <glibmm/convert.h> -#include <glibmm/miscutils.h> -#include <glibmm/thread.h> -#include <glibmm/timer.h> - #include "raul/Path.hpp" #include "serd/serd.h" @@ -48,6 +43,7 @@ #include "ingen/URIMap.hpp" #include "ingen/World.hpp" #include "ingen/client/ThreadedSigClientInterface.hpp" +#include "ingen/filesystem.hpp" #include "ingen/runtime_paths.hpp" #include "ingen/types.hpp" @@ -71,7 +67,6 @@ ingen_try(bool cond, const char* msg) int main(int argc, char** argv) { - Glib::thread_init(); set_bundle_path_from_code((void*)&ingen_try); // Create world @@ -100,7 +95,7 @@ main(int argc, char** argv) } const std::string start_graph = real_start_graph; - const std::string cmds_file_path = (const char*)execute.get_body(); + const FilePath cmds_file_path = (const char*)execute.get_body(); free(real_start_graph); // Load modules @@ -188,10 +183,10 @@ main(int argc, char** argv) // Save resulting graph auto r = world->store()->find(Raul::Path("/")); - const std::string base = Glib::path_get_basename(cmds_file_path); + const std::string base = cmds_file_path.stem(); const std::string out_name = base.substr(0, base.find('.')) + ".out.ingen"; - const std::string out_path = Glib::build_filename(Glib::get_current_dir(), out_name); - world->serialiser()->write_bundle(r->second, URI(Glib::filename_to_uri(out_path))); + const FilePath out_path = filesystem::current_path() / out_name; + world->serialiser()->write_bundle(r->second, URI(out_path)); // Undo every event (should result in a graph identical to the original) for (int i = 0; i < n_events; ++i) { @@ -202,8 +197,8 @@ main(int argc, char** argv) // Save completely undone graph r = world->store()->find(Raul::Path("/")); const std::string undo_name = base.substr(0, base.find('.')) + ".undo.ingen"; - const std::string undo_path = Glib::build_filename(Glib::get_current_dir(), undo_name); - world->serialiser()->write_bundle(r->second, URI(Glib::filename_to_uri(undo_path))); + const FilePath undo_path = filesystem::current_path() / undo_name; + world->serialiser()->write_bundle(r->second, URI(undo_path)); // Redo every event (should result in a graph identical to the pre-undo output) for (int i = 0; i < n_events; ++i) { @@ -214,8 +209,8 @@ main(int argc, char** argv) // Save completely redone graph r = world->store()->find(Raul::Path("/")); const std::string redo_name = base.substr(0, base.find('.')) + ".redo.ingen"; - const std::string redo_path = Glib::build_filename(Glib::get_current_dir(), redo_name); - world->serialiser()->write_bundle(r->second, URI(Glib::filename_to_uri(redo_path))); + const FilePath redo_path = filesystem::current_path() / redo_name; + world->serialiser()->write_bundle(r->second, URI(redo_path)); serd_env_free(env); sratom_free(sratom); |