From 374f7e8f35e0205b056184c889b2caf5cdac08ec Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 10 Feb 2007 01:11:44 +0000 Subject: Made Raul::List read/write thread safe. Uh.. kinda, a bit. :) Reorganized machina into libraries. git-svn-id: http://svn.drobilla.net/lad/machina@295 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/MachinaGUI.cpp | 5 +++-- src/gui/MachinaGUI.hpp | 18 ++++++++++-------- src/gui/Makefile.am | 4 ++-- src/gui/main.cpp | 26 +++++++++++++++++++++++++- 4 files changed, 40 insertions(+), 13 deletions(-) (limited to 'src/gui') diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp index a7602c1..09a3649 100644 --- a/src/gui/MachinaGUI.cpp +++ b/src/gui/MachinaGUI.cpp @@ -65,11 +65,12 @@ gtkmm_set_width_for_given_text (Gtk::Widget &w, const gchar *text, -MachinaGUI::MachinaGUI(/*int argc, char** argv*/) +MachinaGUI::MachinaGUI(SharedPtr m/*int argc, char** argv*/) : _pane_closed(false), _update_pane_position(true), _user_pane_position(0), - _refresh(false) + _refresh(false), + _machine(m) { /*_settings_filename = getenv("HOME"); _settings_filename += "/.machinarc";*/ diff --git a/src/gui/MachinaGUI.hpp b/src/gui/MachinaGUI.hpp index 27b7f4f..804bf41 100644 --- a/src/gui/MachinaGUI.hpp +++ b/src/gui/MachinaGUI.hpp @@ -20,23 +20,24 @@ //#include "config.h" #include -#include +#include #include using namespace std; -class MachinaCanvas; +namespace Machina { class Machine; } +class MachinaCanvas; class MachinaGUI { public: - MachinaGUI(/*int argc, char** argv*/); + MachinaGUI(SharedPtr machine/*int argc, char** argv*/); ~MachinaGUI(); boost::shared_ptr canvas() { return _canvas; } - Gtk::Window* window() { return _main_window; } + Gtk::Window* window() { return _main_window; } void attach(); void quit() { _main_window->hide(); } @@ -64,12 +65,13 @@ protected: bool _pane_closed; bool _update_pane_position; int _user_pane_position; + + bool _refresh; boost::shared_ptr _canvas; + boost::shared_ptr _machine; Gtk::Main* _gtk_main; - - bool _refresh; Gtk::Window* _main_window; Gtk::AboutDialog* _about_window; @@ -81,8 +83,8 @@ protected: Gtk::TextView* _status_text; Gtk::Paned* _main_paned; Gtk::Expander* _messages_expander; - Gtk::ToolButton* _zoom_normal_button; - Gtk::ToolButton* _zoom_full_button; + Gtk::ToolButton* _zoom_normal_button; + Gtk::ToolButton* _zoom_full_button; }; #endif // MACHINA_GUI_H diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index e7a88b7..1bdb381 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -1,5 +1,5 @@ -AM_CXXFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" @LIBGLADEMM_CFLAGS@ @GNOMECANVASMM_CFLAGS@ @JACK_CFLAGS@ @FLOWCANVAS_CFLAGS@ @RAUL_CFLAGS@ -machina_gui_LDADD = @LIBGLADEMM_LIBS@ @GNOMECANVASMM_LIBS@ @JACK_LIBS@ @FLOWCANVAS_LIBS@ @RAUL_CFLAGS@ +AM_CXXFLAGS = -DPKGDATADIR=\"$(pkgdatadir)\" @LIBGLADEMM_CFLAGS@ @GNOMECANVASMM_CFLAGS@ @JACK_CFLAGS@ @FLOWCANVAS_CFLAGS@ @RAUL_CFLAGS@ -I$(top_srcdir)/src/engine +machina_gui_LDADD = @LIBGLADEMM_LIBS@ @GNOMECANVASMM_LIBS@ @JACK_LIBS@ @FLOWCANVAS_LIBS@ @RAUL_CFLAGS@ ../engine/libmachina.la EXTRA_DIST = machina.gladep diff --git a/src/gui/main.cpp b/src/gui/main.cpp index 7250cb1..4e55e58 100644 --- a/src/gui/main.cpp +++ b/src/gui/main.cpp @@ -17,26 +17,50 @@ //#include "../../config.h" +#include #include #include +#include "machina/Loader.hpp" +#include "machina/JackDriver.hpp" +#include "machina/JackNodeFactory.hpp" + #include "MachinaGUI.hpp" +using namespace Machina; + + int main(int argc, char** argv) { + // Build engine + + SharedPtr driver(new JackDriver()); + + SharedPtr m(new Machine()); + + m->activate(); + + driver->set_machine(m); + driver->attach("machina"); + + + + // Launch GUI try { Gnome::Canvas::init(); Gtk::Main app(argc, argv); - MachinaGUI gui; + MachinaGUI gui(m); app.run(*gui.window()); } catch (std::string msg) { std::cerr << "Caught exception, aborting. Error message was: " << msg << std::endl; return 1; } + + driver->detach(); return 0; } -- cgit v1.2.1