aboutsummaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-03-18 02:11:51 +0000
committerDavid Robillard <d@drobilla.net>2007-03-18 02:11:51 +0000
commit47f59aaad7a5ab8c189905544a761940ae9f8509 (patch)
tree67b6ec9ad915de327cda5007c8c1708a1e256c87 /src/gui
parenta716b2c0571f5bdcd817835cecb30cb7a4c745e0 (diff)
downloadmachina-47f59aaad7a5ab8c189905544a761940ae9f8509.tar.gz
machina-47f59aaad7a5ab8c189905544a761940ae9f8509.tar.bz2
machina-47f59aaad7a5ab8c189905544a761940ae9f8509.zip
Improved automata diagram drawing (include notes, use standard initial note notation).
Made compilation without Jack possible. git-svn-id: http://svn.drobilla.net/lad/machina@363 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/MachinaCanvas.cpp3
-rw-r--r--src/gui/MachinaGUI.cpp10
-rw-r--r--src/gui/Makefile.am3
-rw-r--r--src/gui/main.cpp16
4 files changed, 21 insertions, 11 deletions
diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp
index c7d9843..34db1c1 100644
--- a/src/gui/MachinaCanvas.cpp
+++ b/src/gui/MachinaCanvas.cpp
@@ -194,6 +194,9 @@ MachinaCanvas::build(SharedPtr<Machina::Machine> machine)
{
destroy();
+ if (!machine)
+ return;
+
std::map<SharedPtr<Machina::Node>, SharedPtr<NodeView> > views;
for (Machina::Machine::Nodes::const_iterator i = machine->nodes().begin();
diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp
index 0848f8b..3d4676e 100644
--- a/src/gui/MachinaGUI.cpp
+++ b/src/gui/MachinaGUI.cpp
@@ -303,13 +303,10 @@ MachinaGUI::status_message(const string& msg)
/** Update the sensitivity status of menus to reflect the present.
- *
- * (eg. disable "Connect to Jack" when Machina is already connected to Jack)
*/
void
MachinaGUI::connect_widgets()
{
-
}
using namespace std;
@@ -427,7 +424,7 @@ MachinaGUI::menu_import_midi()
SharedPtr<Machina::SMFDriver> file_driver(new Machina::SMFDriver());
//SharedPtr<Machina::Machine> machine = file_driver->learn(dialog.get_uri(),
// track_sb->get_value_as_int());
- SharedPtr<Machina::Machine> machine = file_driver->learn(dialog.get_uri(), 16.0);
+ SharedPtr<Machina::Machine> machine = file_driver->learn(dialog.get_filename(), 16.0);
if (machine) {
dialog.hide();
@@ -457,11 +454,12 @@ MachinaGUI::menu_export_midi()
SharedPtr<Machina::SMFDriver> file_driver(new Machina::SMFDriver());
_engine->driver()->deactivate();
const SharedPtr<Machina::Machine> m = _engine->machine();
- m->set_sink(file_driver);
- file_driver->start(dialog.get_filename());
+ m->set_sink(file_driver->writer());
+ file_driver->writer()->start(dialog.get_filename());
file_driver->run(m, 32); // FIXME: hardcoded max length. TODO: solve halting problem
m->set_sink(_engine->driver());
m->reset();
+ file_driver->writer()->finish();
_engine->driver()->activate();
}
}
diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am
index 5c6cf47..1d6390d 100644
--- a/src/gui/Makefile.am
+++ b/src/gui/Makefile.am
@@ -1,5 +1,4 @@
AM_CXXFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" @LIBGLADEMM_CFLAGS@ @GNOMECANVASMM_CFLAGS@ @JACK_CFLAGS@ @FLOWCANVAS_CFLAGS@ @RAUL_CFLAGS@ -I$(top_srcdir)/src/engine
-machina_gui_LDADD = @FLOWCANVAS_LIBS@ @LIBGLADEMM_LIBS@ @GNOMECANVASMM_LIBS@ @JACK_LIBS@ @RAUL_CFLAGS@ ../engine/libmachina.la
EXTRA_DIST = machina.gladep
@@ -11,6 +10,8 @@ dist_sharefiles_DATA = machina.glade
if WITH_GUI
+machina_gui_LDADD = @FLOWCANVAS_LIBS@ @LIBGLADEMM_LIBS@ @GNOMECANVASMM_LIBS@ @JACK_LIBS@ @RAUL_CFLAGS@ ../engine/libmachina.la
+
bin_PROGRAMS = machina_gui
machina_gui_SOURCES = \
main.cpp \
diff --git a/src/gui/main.cpp b/src/gui/main.cpp
index b6dea9c..4185c45 100644
--- a/src/gui/main.cpp
+++ b/src/gui/main.cpp
@@ -19,11 +19,15 @@
#include <iostream>
#include <string>
#include <libgnomecanvasmm.h>
+#include "../config.h"
#include "machina/Loader.hpp"
-#include "machina/JackDriver.hpp"
#include "machina/SMFDriver.hpp"
#include "MachinaGUI.hpp"
+#ifdef WITH_JACK
+#include "machina/JackDriver.hpp"
+#endif
+
using namespace std;
using namespace Machina;
@@ -42,8 +46,14 @@ main(int argc, char** argv)
}
// Build engine
- SharedPtr<JackDriver> driver(new JackDriver(machine));
+ SharedPtr<Driver> driver;
+#ifdef WITH_JACK
+ driver = SharedPtr<Driver>(new JackDriver(machine));
driver->attach("machina");
+#endif
+ if (!driver)
+ driver = SharedPtr<Driver>(new SMFDriver(machine));
+
SharedPtr<Engine> engine(new Engine(driver));
// Launch GUI
@@ -62,8 +72,6 @@ main(int argc, char** argv)
return 1;
}
- driver->detach();
-
return 0;
}