From 4543288514e1b0a83c6ed003dfb22e175e07bfaa Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 8 Feb 2007 03:56:42 +0000 Subject: Circular nodes in FlowCanvas, related necessary redesign work and changes for API update. Beginnings of a Machina GUI. git-svn-id: http://svn.drobilla.net/lad/machina@290 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/MachinaCanvas.cpp | 157 ++++++++++++++++++++ src/gui/MachinaCanvas.hpp | 55 +++++++ src/gui/MachinaGUI.cpp | 370 ++++++++++++++++++++++++++++++++++++++++++++++ src/gui/MachinaGUI.hpp | 88 +++++++++++ src/gui/Makefile.am | 22 +++ src/gui/machina-icon.svg | 66 +++++++++ src/gui/machina.glade | 340 ++++++++++++++++++++++++++++++++++++++++++ src/gui/machina.gladep | 9 ++ src/gui/main.cpp | 44 ++++++ 9 files changed, 1151 insertions(+) create mode 100644 src/gui/MachinaCanvas.cpp create mode 100644 src/gui/MachinaCanvas.hpp create mode 100644 src/gui/MachinaGUI.cpp create mode 100644 src/gui/MachinaGUI.hpp create mode 100644 src/gui/Makefile.am create mode 100644 src/gui/machina-icon.svg create mode 100644 src/gui/machina.glade create mode 100644 src/gui/machina.gladep create mode 100644 src/gui/main.cpp (limited to 'src/gui') diff --git a/src/gui/MachinaCanvas.cpp b/src/gui/MachinaCanvas.cpp new file mode 100644 index 0000000..2309a5c --- /dev/null +++ b/src/gui/MachinaCanvas.cpp @@ -0,0 +1,157 @@ +/* This file is part of Machina. + * Copyright (C) 2007 Dave Robillard + * + * 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 + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * Machina is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +//#include "config.h" +#include +#include +#include "MachinaCanvas.hpp" +#include "MachinaGUI.hpp" + +MachinaCanvas::MachinaCanvas(MachinaGUI* app, int width, int height) +: FlowCanvas(width, height), + _app(app) +{ +} + + +void +MachinaCanvas::connect(boost::shared_ptr, //item1, + boost::shared_ptr) //item2) +{ +#if 0 + boost::shared_ptr p1 = boost::dynamic_pointer_cast(port1); + boost::shared_ptr p2 = boost::dynamic_pointer_cast(port2); + if (!p1 || !p2) + return; + + if (p1->type() == JACK_AUDIO && p2->type() == JACK_AUDIO + || (p1->type() == JACK_MIDI && p2->type() == JACK_MIDI)) + _app->jack_driver()->connect(p1, p2); +#ifdef HAVE_ALSA + else if (p1->type() == ALSA_MIDI && p2->type() == ALSA_MIDI) + _app->alsa_driver()->connect(p1, p2); +#endif + else + status_message("WARNING: Cannot make connection, incompatible port types."); +#endif +} + + +void +MachinaCanvas::disconnect(boost::shared_ptr,// item1, + boost::shared_ptr)// item2) +{ +#if 0 + boost::shared_ptr input + = boost::dynamic_pointer_cast(port1); + boost::shared_ptr output + = boost::dynamic_pointer_cast(port2); + + if (!input || !output) + return; + + if (input->is_output() && output->is_input()) { + // Damn, guessed wrong + boost::shared_ptr swap = input; + input = output; + output = swap; + } + + if (!input || !output || input->is_output() || output->is_input()) { + status_message("ERROR: Attempt to disconnect mismatched/unknown ports"); + return; + } + + if (input->type() == JACK_AUDIO && output->type() == JACK_AUDIO + || input->type() == JACK_MIDI && output->type() == JACK_MIDI) + _app->jack_driver()->disconnect(output, input); +#ifdef HAVE_ALSA + else if (input->type() == ALSA_MIDI && output->type() == ALSA_MIDI) + _app->alsa_driver()->disconnect(output, input); +#endif + else + status_message("ERROR: Attempt to disconnect ports with mismatched types"); +#endif +} + + +void +MachinaCanvas::status_message(const string& msg) +{ + _app->status_message(string("[Canvas] ").append(msg)); +} + + +void +MachinaCanvas::item_selected(SharedPtr i) +{ + SharedPtr item = PtrCast(i); + if (!item) + return; + + cerr << "SELECTED: " << i->name() << endl; + + SharedPtr last = _last_selected.lock(); + + if (last) { + boost::shared_ptr c(new Connection(shared_from_this(), + last, item, 0x9999AAFF, true)); + last->add_connection(c); + item->add_connection(c); + add_connection(c); + i->raise_to_top(); + _last_selected.reset(); + } else { + _last_selected = item; + } +} + + +bool +MachinaCanvas::canvas_event(GdkEvent* event) +{ + static int last = 0; + + assert(event); + + if (event->type == GDK_BUTTON_PRESS) { + + const double x = event->button.x; + const double y = event->button.y; + + if (event->button.button == 1) { + SharedPtr item(new Ellipse(shared_from_this(), + string("Note")+(char)(last++ +'0'), x, y, 30, 30, true)); + item->signal_selected.connect(sigc::bind(sigc::mem_fun(this, + &MachinaCanvas::item_selected), item)); + add_item(item); + item->raise_to_top(); + } else if (event->button.button == 2) { + SharedPtr item(new Module(shared_from_this(), + string("Note")+(char)(last++ +'0'), x, y, true)); + item->resize(); + add_item(item); + } else if (event->button.button == 3) { + //_last_click_x = (int)event->button.x; + //_last_click_y = (int)event->button.y; + //show_menu(event); + } + } + + return FlowCanvas::canvas_event(event); +} + diff --git a/src/gui/MachinaCanvas.hpp b/src/gui/MachinaCanvas.hpp new file mode 100644 index 0000000..85ae550 --- /dev/null +++ b/src/gui/MachinaCanvas.hpp @@ -0,0 +1,55 @@ +/* This file is part of Machina. + * Copyright (C) 2007 Dave Robillard + * + * 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 + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * Machina is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef PATCHAGEPATCHBAYAREA_H +#define PATCHAGEPATCHBAYAREA_H + +#include +#include +#include +#include + +using namespace LibFlowCanvas; + +class MachinaGUI; + +class MachinaCanvas : public FlowCanvas +{ +public: + MachinaCanvas(MachinaGUI* _app, int width, int height); + + void connect(boost::shared_ptr port1, + boost::shared_ptr port2); + + void disconnect(boost::shared_ptr port1, + boost::shared_ptr port2); + + void status_message(const string& msg); + +protected: + bool canvas_event(GdkEvent* event); + + void item_selected(SharedPtr item); + +private: + MachinaGUI* _app; + + WeakPtr _last_selected; +}; + + +#endif // PATCHAGEPATCHBAYAREA_H diff --git a/src/gui/MachinaGUI.cpp b/src/gui/MachinaGUI.cpp new file mode 100644 index 0000000..a7602c1 --- /dev/null +++ b/src/gui/MachinaGUI.cpp @@ -0,0 +1,370 @@ +/* This file is part of Machina. + * Copyright (C) 2007 Dave Robillard + * + * 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 + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * Machina is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include +#include +#include +#include +#include +#include +#include "MachinaGUI.hpp" +#include "MachinaCanvas.hpp" + +//#include "config.h" + +// FIXME: include to avoid undefined reference to boost SP debug hooks stuff +#include + + + +/* Gtk helpers (resize combo boxes) */ + +#if 0 +static void +gtkmm_get_ink_pixel_size (Glib::RefPtr layout, + int& width, + int& height) +{ + Pango::Rectangle ink_rect = layout->get_ink_extents (); + + width = (ink_rect.get_width() + PANGO_SCALE / 2) / PANGO_SCALE; + height = (ink_rect.get_height() + PANGO_SCALE / 2) / PANGO_SCALE; +} + + +static void +gtkmm_set_width_for_given_text (Gtk::Widget &w, const gchar *text, + gint hpadding/*, gint vpadding*/) + +{ + int old_width, old_height; + w.get_size_request(old_width, old_height); + + int width, height; + w.ensure_style (); + + gtkmm_get_ink_pixel_size (w.create_pango_layout (text), width, height); + w.set_size_request(width + hpadding, old_height);//height + vpadding); +} +#endif +/* end Gtk helpers */ + + + +MachinaGUI::MachinaGUI(/*int argc, char** argv*/) +: _pane_closed(false), + _update_pane_position(true), + _user_pane_position(0), + _refresh(false) +{ + /*_settings_filename = getenv("HOME"); + _settings_filename += "/.machinarc";*/ + + _canvas = boost::shared_ptr(new MachinaCanvas(this, 1600*2, 1200*2)); + + Glib::RefPtr xml; + + // Check for the .glade file in current directory + string glade_filename = "./machina.glade"; + ifstream fs(glade_filename.c_str()); + if (fs.fail()) { // didn't find it, check PKGDATADIR + fs.clear(); + glade_filename = PKGDATADIR; + glade_filename += "/machina.glade"; + + fs.open(glade_filename.c_str()); + if (fs.fail()) { + cerr << "Unable to find machina.glade in current directory or " << PKGDATADIR << "." << endl; + exit(EXIT_FAILURE); + } + fs.close(); + } + + try { + xml = Gnome::Glade::Xml::create(glade_filename); + } catch(const Gnome::Glade::XmlError& ex) { + std::cerr << ex.what() << std::endl; + throw; + } + + xml->get_widget("machina_win", _main_window); + xml->get_widget("about_win", _about_window); + xml->get_widget("file_quit_menuitem", _menu_file_quit); + xml->get_widget("view_refresh_menuitem", _menu_view_refresh); + xml->get_widget("view_messages_menuitem", _menu_view_messages); + xml->get_widget("help_about_menuitem", _menu_help_about); + xml->get_widget("canvas_scrolledwindow", _canvas_scrolledwindow); + xml->get_widget("status_text", _status_text); + xml->get_widget("main_paned", _main_paned); + xml->get_widget("messages_expander", _messages_expander); + xml->get_widget("zoom_full_but", _zoom_full_button); + xml->get_widget("zoom_normal_but", _zoom_normal_button); + + _canvas_scrolledwindow->add(*_canvas); + //m_canvas_scrolledwindow->signal_event().connect(sigc::mem_fun(_canvas, &FlowCanvas::scroll_event_handler)); + _canvas->scroll_to(static_cast(_canvas->width()/2 - 320), + static_cast(_canvas->height()/2 - 240)); // FIXME: hardcoded + + //_zoom_slider->signal_value_changed().connect(sigc::mem_fun(this, &MachinaGUI::zoom_changed)); + + _zoom_normal_button->signal_clicked().connect(sigc::bind( + sigc::mem_fun(this, &MachinaGUI::zoom), 1.0)); + + _zoom_full_button->signal_clicked().connect(sigc::mem_fun(_canvas.get(), &MachinaCanvas::zoom_full)); + + _menu_file_quit->signal_activate().connect( sigc::mem_fun(this, &MachinaGUI::menu_file_quit)); + _menu_view_refresh->signal_activate().connect( sigc::mem_fun(this, &MachinaGUI::menu_view_refresh)); + _menu_view_messages->signal_toggled().connect( sigc::mem_fun(this, &MachinaGUI::show_messages_toggled)); + _menu_help_about->signal_activate().connect( sigc::mem_fun(this, &MachinaGUI::menu_help_about)); + + connect_widgets(); + + //update_state(); + + _canvas->show(); + + _main_window->present(); + + _update_pane_position = false; + _main_paned->set_position(max_pane_position()); + + _main_paned->property_position().signal_changed().connect( + sigc::mem_fun(*this, &MachinaGUI::on_pane_position_changed)); + + _messages_expander->property_expanded().signal_changed().connect( + sigc::mem_fun(*this, &MachinaGUI::on_messages_expander_changed)); + + _main_paned->set_position(max_pane_position()); + _user_pane_position = max_pane_position() - _main_window->get_height()/8; + _update_pane_position = true; + _pane_closed = true; + + // Idle callback, check if we need to refresh + Glib::signal_timeout().connect(sigc::mem_fun(this, &MachinaGUI::idle_callback), 100); + + // Faster idle callback to update DSP load progress bar + //Glib::signal_timeout().connect(sigc::mem_fun(this, &MachinaGUI::update_load), 50); +} + + +MachinaGUI::~MachinaGUI() +{ +} + + +void +MachinaGUI::attach() +{ +#if 0 + _jack_driver->attach(true); + + menu_view_refresh(); + + update_toolbar(); + + //m_status_bar->push("Connected to JACK server"); +#endif +} + + +bool +MachinaGUI::idle_callback() +{ +#if 0 + if (_jack_driver) { + while (!_jack_driver->events().empty()) { + MachinaEvent& ev = _jack_driver->events().front(); + _jack_driver->events().pop(); + ev.execute(); + } + } + + + bool refresh = _refresh; + + refresh = refresh || (_jack_driver && _jack_driver->is_dirty()); + + if (refresh) { + + _canvas->flag_all_connections(); + + _jack_driver->refresh(); + } + + if (refresh) { + _canvas->destroy_all_flagged_connections(); + _refresh = false; + } + + update_load(); +#endif + return true; +} + + +void +MachinaGUI::zoom(double z) +{ + _canvas->set_zoom(z); +} + + +void +MachinaGUI::zoom_changed() +{ +/* + static bool enable_signal = true; + if (enable_signal) { + enable_signal = false; + zoom(_zoom_slider->get_value()); + enable_signal = true; + } + */ +} + + +#if 0 +void +MachinaGUI::update_state() +{ + for (ModuleMap::iterator i = _canvas->modules().begin(); i != _canvas->modules().end(); ++i) + (*i).second->load_location(); + + //cerr << "[Machina] Resizing window: (" << _state_manager->get_window_size().x + // << "," << _state_manager->get_window_size().y << ")" << endl; + + _main_window->resize( + static_cast(_state_manager->get_window_size().x), + static_cast(_state_manager->get_window_size().y)); + + //cerr << "[Machina] Moving window: (" << _state_manager->get_window_location().x + // << "," << _state_manager->get_window_location().y << ")" << endl; + + _main_window->move( + static_cast(_state_manager->get_window_location().x), + static_cast(_state_manager->get_window_location().y)); + +} + +#endif + + +void +MachinaGUI::status_message(const string& msg) +{ + if (_status_text->get_buffer()->size() > 0) + _status_text->get_buffer()->insert(_status_text->get_buffer()->end(), "\n"); + + _status_text->get_buffer()->insert(_status_text->get_buffer()->end(), msg); + _status_text->scroll_to_mark(_status_text->get_buffer()->get_insert(), 0); +} + + +/** 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() +{ + +} + + +void +MachinaGUI::menu_file_quit() +{ + _main_window->hide(); +} + + +void +MachinaGUI::on_pane_position_changed() +{ + // avoid infinite recursion... + if (!_update_pane_position) + return; + + _update_pane_position = false; + + int new_position = _main_paned->get_position(); + + if (_pane_closed && new_position < max_pane_position()) { + // Auto open + _user_pane_position = new_position; + _messages_expander->set_expanded(true); + _pane_closed = false; + _menu_view_messages->set_active(true); + } else if (new_position >= max_pane_position()) { + // Auto close + _pane_closed = true; + + _messages_expander->set_expanded(false); + if (new_position > max_pane_position()) + _main_paned->set_position(max_pane_position()); // ... here + _menu_view_messages->set_active(false); + + _user_pane_position = max_pane_position() - _main_window->get_height()/8; + } + + _update_pane_position = true; +} + + +void +MachinaGUI::on_messages_expander_changed() +{ + if (!_pane_closed) { + // Store pane position for restoring + _user_pane_position = _main_paned->get_position(); + if (_update_pane_position) { + _update_pane_position = false; + _main_paned->set_position(max_pane_position()); + _update_pane_position = true; + } + _pane_closed = true; + } else { + _main_paned->set_position(_user_pane_position); + _pane_closed = false; + } +} + + +void +MachinaGUI::show_messages_toggled() +{ + if (_update_pane_position) + _messages_expander->set_expanded(_menu_view_messages->get_active()); +} + + +void +MachinaGUI::menu_view_refresh() +{ + assert(_canvas); + + //_canvas->destroy(); +} + + +void +MachinaGUI::menu_help_about() +{ + _about_window->show(); +} + + diff --git a/src/gui/MachinaGUI.hpp b/src/gui/MachinaGUI.hpp new file mode 100644 index 0000000..27b7f4f --- /dev/null +++ b/src/gui/MachinaGUI.hpp @@ -0,0 +1,88 @@ +/* This file is part of Machina. + * Copyright (C) 2007 Dave Robillard + * + * 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 + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * Machina is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef MACHINA_GUI_H +#define MACHINA_GUI_H + +//#include "config.h" +#include +#include +#include + +using namespace std; + +class MachinaCanvas; + + +class MachinaGUI +{ +public: + MachinaGUI(/*int argc, char** argv*/); + ~MachinaGUI(); + + boost::shared_ptr canvas() { return _canvas; } + + Gtk::Window* window() { return _main_window; } + + void attach(); + void quit() { _main_window->hide(); } + + void status_message(const string& msg); + inline void queue_refresh() { _refresh = true; } + + int max_pane_position() + { return _main_paned->property_max_position() - _messages_expander->get_label_widget()->get_height() - 8; } + +protected: + void connect_widgets(); + + void menu_file_quit(); + void show_messages_toggled(); + void menu_view_refresh(); + void menu_help_about(); + void zoom(double z); + void zoom_changed(); + bool idle_callback(); + + void on_pane_position_changed(); + void on_messages_expander_changed(); + + bool _pane_closed; + bool _update_pane_position; + int _user_pane_position; + + boost::shared_ptr _canvas; + + Gtk::Main* _gtk_main; + + bool _refresh; + + Gtk::Window* _main_window; + Gtk::AboutDialog* _about_window; + Gtk::MenuItem* _menu_file_quit; + Gtk::CheckMenuItem* _menu_view_messages; + Gtk::MenuItem* _menu_view_refresh; + Gtk::MenuItem* _menu_help_about; + Gtk::ScrolledWindow* _canvas_scrolledwindow; + Gtk::TextView* _status_text; + Gtk::Paned* _main_paned; + Gtk::Expander* _messages_expander; + 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 new file mode 100644 index 0000000..e7a88b7 --- /dev/null +++ b/src/gui/Makefile.am @@ -0,0 +1,22 @@ +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@ + +EXTRA_DIST = machina.gladep + +sharefilesdir = $(pkgdatadir) +dist_sharefiles_DATA = machina.glade + +#globalpixmapsdir = $(datadir)/pixmaps +#dist_globalpixmaps_DATA = machina-icon.svg + +if WITH_GUI + +bin_PROGRAMS = machina_gui +machina_gui_SOURCES = \ + main.cpp \ + MachinaGUI.hpp \ + MachinaGUI.cpp \ + MachinaCanvas.hpp \ + MachinaCanvas.cpp + +endif diff --git a/src/gui/machina-icon.svg b/src/gui/machina-icon.svg new file mode 100644 index 0000000..39f7be0 --- /dev/null +++ b/src/gui/machina-icon.svg @@ -0,0 +1,66 @@ + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/src/gui/machina.glade b/src/gui/machina.glade new file mode 100644 index 0000000..e1f6fa0 --- /dev/null +++ b/src/gui/machina.glade @@ -0,0 +1,340 @@ + + + + + + + 1 + Machina + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + 640 + 480 + True + False + machina-icon.svg + True + False + False + GDK_WINDOW_TYPE_HINT_NORMAL + GDK_GRAVITY_NORTH_WEST + True + False + + + + True + False + 0 + + + + True + GTK_PACK_DIRECTION_LTR + GTK_PACK_DIRECTION_LTR + + + + True + _File + True + + + + + + + True + gtk-open + True + + + + + + + True + gtk-save + True + + + + + + + True + gtk-save-as + True + + + + + + + True + + + + + + True + gtk-quit + True + + + + + + + + + + + True + _View + True + + + + + + + True + View "console" messages + _Messages + True + False + + + + + + + + True + _Refresh + True + + + + + + True + gtk-refresh + 1 + 0.5 + 0.5 + 0 + 0 + + + + + + + + + + + + True + _Help + True + + + + + + + True + gtk-about + True + + + + + + + + + + 0 + False + False + + + + + + True + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH_HORIZ + True + True + + + + True + gtk-zoom-100 + True + True + False + + + False + True + + + + + + True + gtk-zoom-fit + True + True + False + + + False + True + + + + + 0 + False + False + + + + + + True + True + 0 + + + + True + True + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + + + + False + True + + + + + + True + False + 0 + + + + True + True + GTK_POLICY_NEVER + GTK_POLICY_AUTOMATIC + GTK_SHADOW_IN + GTK_CORNER_TOP_LEFT + + + + True + False + True + False + False + True + GTK_JUSTIFY_LEFT + GTK_WRAP_WORD + False + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + True + Messages + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + label_item + + + + + True + True + + + + + 2 + True + True + + + + + + + + True + Machina + © 2007 Dave Robillard <http://drobilla.net> + It's a machine + 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 Foundation; either version 2 of the License, or +(at your option) any later version. + +Machina is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with Machina; if not, write to the Free Software Foundation, Inc., +51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + False + http://drobilla.net/software/machina + Website: + Dave Robillard <dave@drobilla.net> + translator-credits + machina-icon.svg + + + diff --git a/src/gui/machina.gladep b/src/gui/machina.gladep new file mode 100644 index 0000000..c27832f --- /dev/null +++ b/src/gui/machina.gladep @@ -0,0 +1,9 @@ + + + + + Machina + machina + C++ + FALSE + diff --git a/src/gui/main.cpp b/src/gui/main.cpp new file mode 100644 index 0000000..7250cb1 --- /dev/null +++ b/src/gui/main.cpp @@ -0,0 +1,44 @@ +/* This file is part of Machina. + * Copyright (C) 2007 Dave Robillard + * + * 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 + * Foundation; either version 2 of the License, or (at your option) any later + * version. + * + * Machina is distributed in the hope that it will be useful, but WITHOUT ANY + * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + +//#include "../../config.h" + +#include +#include + +#include "MachinaGUI.hpp" + +int +main(int argc, char** argv) +{ + try { + + Gnome::Canvas::init(); + Gtk::Main app(argc, argv); + + MachinaGUI gui; + app.run(*gui.window()); + + } catch (std::string msg) { + std::cerr << "Caught exception, aborting. Error message was: " << msg << std::endl; + return 1; + } + + return 0; +} + + -- cgit v1.2.1