aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-12-18 07:53:39 +0000
committerDavid Robillard <d@drobilla.net>2014-12-18 07:53:39 +0000
commit0f5a2bafb9f1c3f64256e1899857b2f5cb3d8982 (patch)
treef826e3cda65db9990aa9d1b805d634f0e3ce23d5 /src/gui
parent452f0c9a8e020831eedb0dcb8b78b8ca9435b502 (diff)
downloadmachina-0f5a2bafb9f1c3f64256e1899857b2f5cb3d8982.tar.gz
machina-0f5a2bafb9f1c3f64256e1899857b2f5cb3d8982.tar.bz2
machina-0f5a2bafb9f1c3f64256e1899857b2f5cb3d8982.zip
Work towards engine/GUI separation.
git-svn-id: http://svn.drobilla.net/lad/trunk/machina@5495 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/MachinaCanvas.cpp21
-rw-r--r--src/gui/main.cpp14
2 files changed, 19 insertions, 16 deletions
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index 76c029c..f7292bf 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -1,6 +1,6 @@
/*
This file is part of Machina.
- Copyright 2007-2013 David Robillard <http://drobilla.net>
+ Copyright 2007-2014 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
@@ -182,14 +182,17 @@ MachinaCanvas::on_erase_object(SPtr<client::ClientObject> object)
void
MachinaCanvas::action_create_node(double x, double y)
{
- machina::client::ClientObject obj(0);
- obj.set(URIs::instance().rdf_type,
- _app->forge().make_urid(URIs::instance().machina_Node));
- obj.set(URIs::instance().machina_canvas_x, _app->forge().make((float)x));
- obj.set(URIs::instance().machina_canvas_y, _app->forge().make((float)y));
- obj.set(URIs::instance().machina_duration,
- _app->forge().make((float)_app->default_length()));
- _app->controller()->create(obj);
+ const Properties props = {
+ { URIs::instance().rdf_type,
+ _app->forge().make_urid(URIs::instance().machina_Node) },
+ { URIs::instance().machina_canvas_x,
+ _app->forge().make((float)x) },
+ { URIs::instance().machina_canvas_y,
+ _app->forge().make((float)y) },
+ { URIs::instance().machina_duration,
+ _app->forge().make((float)_app->default_length()) } };
+
+ _app->controller()->create(props);
}
void
diff --git a/src/gui/main.cpp b/src/gui/main.cpp
index 407258d..547966f 100644
--- a/src/gui/main.cpp
+++ b/src/gui/main.cpp
@@ -1,6 +1,6 @@
/*
This file is part of Machina.
- Copyright 2007-2013 David Robillard <http://drobilla.net>
+ Copyright 2007-2014 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
@@ -80,13 +80,13 @@ main(int argc, char** argv)
machine = SPtr<Machine>(new Machine(beats));
}
- std::string driver_name = "smf";
-#ifdef HAVE_JACK
- driver_name = "jack";
-#endif
+ // Create driver
+ SPtr<Driver> driver(Engine::new_driver(forge, "jack", machine));
+ if (!driver) {
+ cerr << "warning: Failed to create Jack driver, using SMF" << endl;
+ driver = SPtr<Driver>(Engine::new_driver(forge, "smf", machine));
+ }
- // Build engine
- SPtr<Driver> driver(Engine::new_driver(forge, driver_name, machine));
SPtr<Engine> engine(new Engine(forge, driver, rdf_world));
Gtk::Main app(argc, argv);