summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gui/LoadPatchWindow.cpp161
-rw-r--r--src/gui/LoadPatchWindow.hpp43
-rw-r--r--src/gui/LoadSubpatchWindow.cpp207
-rw-r--r--src/gui/LoadSubpatchWindow.hpp80
-rw-r--r--src/gui/PatchCanvas.cpp1
-rw-r--r--src/gui/PatchView.cpp1
-rw-r--r--src/gui/PatchView.hpp1
-rw-r--r--src/gui/PatchWindow.cpp1
-rw-r--r--src/gui/PatchWindow.hpp1
-rw-r--r--src/gui/WindowFactory.cpp29
-rw-r--r--src/gui/WindowFactory.hpp4
-rw-r--r--src/gui/ingen_gui.glade249
-rw-r--r--src/gui/wscript1
13 files changed, 203 insertions, 576 deletions
diff --git a/src/gui/LoadPatchWindow.cpp b/src/gui/LoadPatchWindow.cpp
index bba7c75d..4f724e6b 100644
--- a/src/gui/LoadPatchWindow.cpp
+++ b/src/gui/LoadPatchWindow.cpp
@@ -17,20 +17,23 @@
#include <sys/types.h>
#include <dirent.h>
-#include <boost/optional/optional.hpp>
+#include <cassert>
+#include <boost/optional.hpp>
+#include <glibmm/miscutils.h>
#include "interface/EngineInterface.hpp"
#include "shared/LV2URIMap.hpp"
-#include "shared/runtime_paths.hpp"
+#include "client/NodeModel.hpp"
#include "client/PatchModel.hpp"
+#include "client/ClientStore.hpp"
+#include "shared/runtime_paths.hpp"
#include "App.hpp"
-#include "Configuration.hpp"
#include "LoadPatchWindow.hpp"
+#include "PatchView.hpp"
+#include "Configuration.hpp"
#include "ThreadedLoader.hpp"
-using namespace Ingen::Serialisation;
using boost::optional;
using namespace std;
-using namespace std;
using namespace Raul;
namespace Ingen {
@@ -39,40 +42,45 @@ namespace GUI {
LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
: Gtk::FileChooserDialog(cobject)
- , _merge_ports(true)
+ , _merge_ports(false)
{
+ xml->get_widget("load_patch_symbol_label", _symbol_label);
+ xml->get_widget("load_patch_symbol_entry", _symbol_entry);
+ xml->get_widget("load_patch_ports_label", _ports_label);
+ xml->get_widget("load_patch_merge_ports_radio", _merge_ports_radio);
+ xml->get_widget("load_patch_insert_ports_radio", _insert_ports_radio);
xml->get_widget("load_patch_poly_voices_radio", _poly_voices_radio);
xml->get_widget("load_patch_poly_from_file_radio", _poly_from_file_radio);
xml->get_widget("load_patch_poly_spinbutton", _poly_spinbutton);
- xml->get_widget("load_patch_merge_ports_radio", _merge_ports_radio);
- xml->get_widget("load_patch_insert_ports_radio", _insert_ports_radio);
xml->get_widget("load_patch_ok_button", _ok_button);
xml->get_widget("load_patch_cancel_button", _cancel_button);
- _poly_from_file_radio->signal_toggled().connect(
- sigc::mem_fun(this, &LoadPatchWindow::poly_from_file_selected));
_poly_voices_radio->signal_toggled().connect(
- sigc::mem_fun(this, &LoadPatchWindow::poly_voices_selected));
+ sigc::mem_fun(this, &LoadPatchWindow::enable_poly_spinner));
+ _cancel_button->signal_clicked().connect(
+ sigc::mem_fun(this, &LoadPatchWindow::cancel_clicked));
+ _ok_button->signal_clicked().connect(
+ sigc::mem_fun(this, &LoadPatchWindow::ok_clicked));
_merge_ports_radio->signal_toggled().connect(
sigc::mem_fun(this, &LoadPatchWindow::merge_ports_selected));
_insert_ports_radio->signal_toggled().connect(
sigc::mem_fun(this, &LoadPatchWindow::insert_ports_selected));
- _ok_button->signal_clicked().connect(
- sigc::mem_fun(this, &LoadPatchWindow::ok_clicked));
- _cancel_button->signal_clicked().connect(
- sigc::mem_fun(this, &LoadPatchWindow::cancel_clicked));
- _poly_voices_radio->set_active(true);
+ signal_selection_changed().connect(
+ sigc::mem_fun(this, &LoadPatchWindow::selection_changed));
Gtk::FileFilter filt;
- filt.add_pattern("*.om");
- filt.set_name("Om patch files (XML, DEPRECATED) (*.om)");
- filt.add_pattern("*.ingen.lv2");
- filt.set_name("Ingen bundles (*.ingen.lv2)");
filt.add_pattern("*.ingen.ttl");
filt.set_name("Ingen patch files (*.ingen.ttl)");
+ filt.add_pattern("*.ingen.lv2");
+ filt.set_name("Ingen bundles (*.ingen.lv2)");
+ filt.add_pattern("*.om");
+ filt.set_name("Om patch files (*.om)");
+
set_filter(filt);
+ property_select_multiple() = true;
+
// Add global examples directory to "shortcut folders" (bookmarks)
const string examples_dir = Shared::data_file_path("patches");
DIR* d = opendir(examples_dir.c_str());
@@ -84,9 +92,15 @@ LoadPatchWindow::LoadPatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gno
void
-LoadPatchWindow::present(SharedPtr<PatchModel> patch, GraphObject::Properties data)
+LoadPatchWindow::present(SharedPtr<PatchModel> patch, bool import, GraphObject::Properties data)
{
+ _import = import;
set_patch(patch);
+ _symbol_label->set_visible(!import);
+ _symbol_entry->set_visible(!import);
+ _ports_label->set_visible(_import);
+ _merge_ports_radio->set_visible(_import);
+ _insert_ports_radio->set_visible(_import);
_initial_data = data;
Gtk::Window::present();
}
@@ -99,7 +113,10 @@ LoadPatchWindow::present(SharedPtr<PatchModel> patch, GraphObject::Properties da
void
LoadPatchWindow::set_patch(SharedPtr<PatchModel> patch)
{
+ std::cout << "SET PATCH: " << patch->path() << endl;
_patch = patch;
+ _symbol_entry->set_text("");
+ _symbol_entry->set_sensitive(!_import);
_poly_spinbutton->set_value(patch->poly());
}
@@ -117,18 +134,19 @@ LoadPatchWindow::on_show()
void
-LoadPatchWindow::poly_from_file_selected()
+LoadPatchWindow::disable_poly_spinner()
{
_poly_spinbutton->property_sensitive() = false;
}
void
-LoadPatchWindow::poly_voices_selected()
+LoadPatchWindow::enable_poly_spinner()
{
_poly_spinbutton->property_sensitive() = true;
}
+
void
LoadPatchWindow::merge_ports_selected()
{
@@ -146,39 +164,106 @@ LoadPatchWindow::insert_ports_selected()
void
LoadPatchWindow::ok_clicked()
{
- if (!_patch)
+ if (!_patch) {
+ hide();
return;
+ }
- // If unset load_patch will load value
- optional<Path> parent;
- optional<Symbol> symbol;
+ const LV2URIMap& uris = App::instance().uris();
if (_poly_voices_radio->get_active())
_initial_data.insert(make_pair(
- App::instance().uris().ingen_polyphony,
- _poly_spinbutton->get_value_as_int()));
-
- if (!_patch->path().is_root()) {
- parent = _patch->path().parent();
- symbol = _patch->symbol();
+ uris.ingen_polyphony,
+ _poly_spinbutton->get_value_as_int()));
+
+ if (_import) {
+ // If unset load_patch will load value
+ optional<Path> parent;
+ optional<Symbol> symbol;
+ if (!_patch->path().is_root()) {
+ parent = _patch->path().parent();
+ symbol = _patch->symbol();
+ }
+
+ cout << "MERGE PORTS: " << _merge_ports << endl;
+
+ App::instance().loader()->load_patch(true, get_uri(), Path("/"),
+ parent, symbol, _initial_data);
+
+ } else {
+ std::list<Glib::ustring> uri_list = get_uris();
+ for (std::list<Glib::ustring>::iterator i = uri_list.begin(); i != uri_list.end(); ++i) {
+ // Cascade
+ Atom& x = _initial_data.find(uris.ingenui_canvas_x)->second;
+ x = Atom(x.get_float() + 20.0f);
+ Atom& y = _initial_data.find(uris.ingenui_canvas_y)->second;
+ y = Atom(y.get_float() + 20.0f);
+
+ Raul::Symbol symbol(symbol_from_filename(*i));
+ if (uri_list.size() == 1 && _symbol_entry->get_text() != "")
+ symbol = Symbol::symbolify(_symbol_entry->get_text());
+
+ symbol = avoid_symbol_clash(symbol);
+
+ App::instance().loader()->load_patch(false, *i, Path("/"),
+ _patch->path(), symbol, _initial_data);
+ }
}
- cout << "MERGE PORTS: " << _merge_ports << endl;
-
_patch.reset();
hide();
-
- App::instance().loader()->load_patch(true, get_uri(), Path("/"),
- parent, symbol, _initial_data);
}
void
LoadPatchWindow::cancel_clicked()
{
+ _patch.reset();
hide();
}
+Raul::Symbol
+LoadPatchWindow::symbol_from_filename(const Glib::ustring& filename)
+{
+ std::string symbol_str = Glib::path_get_basename(get_filename());
+ symbol_str = symbol_str.substr(0, symbol_str.find('.'));
+ return Raul::Symbol::symbolify(symbol_str);
+}
+
+
+Raul::Symbol
+LoadPatchWindow::avoid_symbol_clash(const Raul::Symbol& symbol)
+{
+ unsigned offset = App::instance().store()->child_name_offset(
+ _patch->path(), symbol);
+
+ if (offset != 0) {
+ std::stringstream ss;
+ ss << symbol << "_" << offset;
+ return ss.str();
+ } else {
+ return symbol;
+ }
+}
+
+
+void
+LoadPatchWindow::selection_changed()
+{
+ if (_import)
+ return;
+
+ if (get_filenames().size() != 1) {
+ _symbol_entry->set_text("");
+ _symbol_entry->set_sensitive(false);
+ } else {
+ _symbol_entry->set_text(avoid_symbol_clash(
+ symbol_from_filename(get_filename()).c_str()).c_str());
+ _symbol_entry->set_sensitive(true);
+ }
+}
+
+
} // namespace GUI
} // namespace Ingen
diff --git a/src/gui/LoadPatchWindow.hpp b/src/gui/LoadPatchWindow.hpp
index faae39dd..c8eafa1e 100644
--- a/src/gui/LoadPatchWindow.hpp
+++ b/src/gui/LoadPatchWindow.hpp
@@ -15,33 +15,26 @@
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef INGEN_GUI_LOADPATCHWINDOW_HPP
-#define INGEN_GUI_LOADPATCHWINDOW_HPP
+#ifndef INGEN_GUI_LOADSUBPATCHWINDOW_HPP
+#define INGEN_GUI_LOADSUBPATCHWINDOW_HPP
#include <libglademm/xml.h>
#include <gtkmm.h>
#include "raul/SharedPtr.hpp"
#include "interface/GraphObject.hpp"
-#include "Window.hpp"
-
using namespace Ingen::Shared;
namespace Ingen {
-namespace Client { class PatchModel; class PluginModel; }
-using Ingen::Client::PluginModel;
+namespace Client { class PatchModel; }
using Ingen::Client::PatchModel;
namespace GUI {
-/** 'Load Patch' window.
- *
- * Loaded by glade as a derived object. Used for both "Import" and "Load"
- * (e.g. Replace, clear-then-import) operations (the radio button state
- * should be changed with the provided methods before presenting).
+/** 'Add Subpatch' window.
*
- * This is not for loading subpatches. See @a LoadSubpatchWindow for that.
+ * Loaded by glade as a derived object.
*
* \ingroup GUI
*/
@@ -52,35 +45,45 @@ public:
void set_patch(SharedPtr<PatchModel> patch);
- void present(SharedPtr<PatchModel> patch, GraphObject::Properties data);
+ void present(SharedPtr<PatchModel> patch, bool import, GraphObject::Properties data);
protected:
void on_show();
private:
- void poly_voices_selected();
- void poly_from_file_selected();
+ void disable_poly_spinner();
+ void enable_poly_spinner();
void merge_ports_selected();
void insert_ports_selected();
- void ok_clicked();
+
+ void selection_changed();
void cancel_clicked();
+ void ok_clicked();
+
+ Raul::Symbol symbol_from_filename(const Glib::ustring& filename);
+ Raul::Symbol avoid_symbol_clash(const Raul::Symbol& symbol);
GraphObject::Properties _initial_data;
SharedPtr<PatchModel> _patch;
- bool _merge_ports;
+ Gtk::Label* _symbol_label;
+ Gtk::Entry* _symbol_entry;
+ Gtk::Label* _ports_label;
+ Gtk::RadioButton* _merge_ports_radio;
+ Gtk::RadioButton* _insert_ports_radio;
Gtk::RadioButton* _poly_voices_radio;
Gtk::RadioButton* _poly_from_file_radio;
Gtk::SpinButton* _poly_spinbutton;
- Gtk::RadioButton* _merge_ports_radio;
- Gtk::RadioButton* _insert_ports_radio;
Gtk::Button* _ok_button;
Gtk::Button* _cancel_button;
+
+ bool _import;
+ bool _merge_ports;
};
} // namespace GUI
} // namespace Ingen
-#endif // INGEN_GUI_LOADPATCHWINDOW_HPP
+#endif // INGEN_GUI_LOADSUBPATCHWINDOW_HPP
diff --git a/src/gui/LoadSubpatchWindow.cpp b/src/gui/LoadSubpatchWindow.cpp
deleted file mode 100644
index 240b4b64..00000000
--- a/src/gui/LoadSubpatchWindow.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-/* This file is part of Ingen.
- * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
- *
- * Ingen 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.
- *
- * Ingen 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 St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include <sys/types.h>
-#include <dirent.h>
-#include <cassert>
-#include <boost/optional.hpp>
-#include <glibmm/miscutils.h>
-#include "interface/EngineInterface.hpp"
-#include "shared/LV2URIMap.hpp"
-#include "client/NodeModel.hpp"
-#include "client/PatchModel.hpp"
-#include "client/ClientStore.hpp"
-#include "shared/runtime_paths.hpp"
-#include "App.hpp"
-#include "LoadSubpatchWindow.hpp"
-#include "PatchView.hpp"
-#include "Configuration.hpp"
-#include "ThreadedLoader.hpp"
-
-using boost::optional;
-using namespace std;
-using namespace Raul;
-
-namespace Ingen {
-namespace GUI {
-
-
-LoadSubpatchWindow::LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml)
-: Gtk::FileChooserDialog(cobject)
-{
- xml->get_widget("load_subpatch_symbol_entry", _symbol_entry);
- xml->get_widget("load_subpatch_poly_voices_radio", _poly_voices_radio);
- xml->get_widget("load_subpatch_poly_from_file_radio", _poly_from_file_radio);
- xml->get_widget("load_subpatch_poly_spinbutton", _poly_spinbutton);
- xml->get_widget("load_subpatch_ok_button", _ok_button);
- xml->get_widget("load_subpatch_cancel_button", _cancel_button);
-
- _poly_voices_radio->signal_toggled().connect(sigc::mem_fun(this, &LoadSubpatchWindow::enable_poly_spinner));
- _ok_button->signal_clicked().connect(sigc::mem_fun(this, &LoadSubpatchWindow::ok_clicked));
- _cancel_button->signal_clicked().connect(sigc::mem_fun(this, &LoadSubpatchWindow::cancel_clicked));
-
- Gtk::FileFilter filt;
- filt.add_pattern("*.om");
- filt.set_name("Om patch files (XML, DEPRECATED) (*.om)");
- filt.add_pattern("*.ingen.ttl");
- filt.set_name("Ingen patch files (RDF, *.ingen.ttl)");
- set_filter(filt);
-
- property_select_multiple() = true;
-
- // Add global examples directory to "shortcut folders" (bookmarks)
- const string examples_dir = Shared::data_file_path("patches");
- DIR* d = opendir(examples_dir.c_str());
- if (d != NULL) {
- add_shortcut_folder(examples_dir);
- closedir(d);
- }
-
- signal_selection_changed().connect(
- sigc::mem_fun(this, &LoadSubpatchWindow::selection_changed));
-}
-
-
-void
-LoadSubpatchWindow::present(SharedPtr<PatchModel> patch, GraphObject::Properties data)
-{
- set_patch(patch);
- _initial_data = data;
- Gtk::Window::present();
-}
-
-
-/** Sets the patch model for this window and initializes everything.
- *
- * This function MUST be called before using the window in any way!
- */
-void
-LoadSubpatchWindow::set_patch(SharedPtr<PatchModel> patch)
-{
- _patch = patch;
- _symbol_entry->set_text(patch->path().symbol());
- _poly_spinbutton->set_value(patch->poly());
-}
-
-
-void
-LoadSubpatchWindow::on_show()
-{
- if (App::instance().configuration()->patch_folder().length() > 0)
- set_current_folder(App::instance().configuration()->patch_folder());
- Gtk::FileChooserDialog::on_show();
-}
-
-
-///// Event Handlers //////
-
-
-void
-LoadSubpatchWindow::disable_poly_spinner()
-{
- _poly_spinbutton->property_sensitive() = false;
-}
-
-
-void
-LoadSubpatchWindow::enable_poly_spinner()
-{
- _poly_spinbutton->property_sensitive() = true;
-}
-
-
-void
-LoadSubpatchWindow::ok_clicked()
-{
- assert(_patch);
-
- const LV2URIMap& uris = App::instance().uris();
-
- if (_poly_voices_radio->get_active()) {
- _initial_data.insert(make_pair(uris.ingen_polyphony, (int)_poly_spinbutton->get_value_as_int()));
- }
-
- std::list<Glib::ustring> uri_list = get_uris();
- for (std::list<Glib::ustring>::iterator i = uri_list.begin(); i != uri_list.end(); ++i) {
- // Cascade
- Atom& x = _initial_data.find(uris.ingenui_canvas_x)->second;
- x = Atom(x.get_float() + 20.0f);
- Atom& y = _initial_data.find(uris.ingenui_canvas_y)->second;
- y = Atom(y.get_float() + 20.0f);
-
- Raul::Symbol symbol(symbol_from_filename(*i));
- if (uri_list.size() == 1 && _symbol_entry->get_text() != "")
- symbol = Symbol::symbolify(_symbol_entry->get_text());
-
- symbol = avoid_symbol_clash(symbol);
-
- App::instance().loader()->load_patch(false, *i, Path("/"),
- _patch->path(), symbol, _initial_data);
- }
-
- hide();
-}
-
-
-void
-LoadSubpatchWindow::cancel_clicked()
-{
- hide();
-}
-
-
-Raul::Symbol
-LoadSubpatchWindow::symbol_from_filename(const Glib::ustring& filename)
-{
- std::string symbol_str = Glib::path_get_basename(get_filename());
- symbol_str = symbol_str.substr(0, symbol_str.find('.'));
- return Raul::Symbol::symbolify(symbol_str);
-}
-
-
-Raul::Symbol
-LoadSubpatchWindow::avoid_symbol_clash(const Raul::Symbol& symbol)
-{
- unsigned offset = App::instance().store()->child_name_offset(
- _patch->path(), symbol);
-
- if (offset != 0) {
- std::stringstream ss;
- ss << symbol << "_" << offset;
- return ss.str();
- } else {
- return symbol;
- }
-}
-
-
-void
-LoadSubpatchWindow::selection_changed()
-{
- if (get_filenames().size() != 1) {
- _symbol_entry->set_text("");
- _symbol_entry->set_sensitive(false);
- } else {
- _symbol_entry->set_text(avoid_symbol_clash(
- symbol_from_filename(get_filename()).c_str()).c_str());
- _symbol_entry->set_sensitive(true);
- }
-}
-
-
-} // namespace GUI
-} // namespace Ingen
diff --git a/src/gui/LoadSubpatchWindow.hpp b/src/gui/LoadSubpatchWindow.hpp
deleted file mode 100644
index c216f26a..00000000
--- a/src/gui/LoadSubpatchWindow.hpp
+++ /dev/null
@@ -1,80 +0,0 @@
-/* This file is part of Ingen.
- * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
- *
- * Ingen 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.
- *
- * Ingen 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 St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef INGEN_GUI_LOADSUBPATCHWINDOW_HPP
-#define INGEN_GUI_LOADSUBPATCHWINDOW_HPP
-
-#include <libglademm/xml.h>
-#include <gtkmm.h>
-#include "raul/SharedPtr.hpp"
-#include "interface/GraphObject.hpp"
-using namespace Ingen::Shared;
-
-namespace Ingen {
-
-namespace Client { class PatchModel; }
-using Ingen::Client::PatchModel;
-
-namespace GUI {
-
-
-/** 'Add Subpatch' window.
- *
- * Loaded by glade as a derived object.
- *
- * \ingroup GUI
- */
-class LoadSubpatchWindow : public Gtk::FileChooserDialog
-{
-public:
- LoadSubpatchWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml);
-
- void set_patch(SharedPtr<PatchModel> patch);
-
- void present(SharedPtr<PatchModel> patch, GraphObject::Properties data);
-
-protected:
- void on_show();
-
-private:
- void disable_poly_spinner();
- void enable_poly_spinner();
-
- void ok_clicked();
- void cancel_clicked();
- void selection_changed();
-
- Raul::Symbol symbol_from_filename(const Glib::ustring& filename);
- Raul::Symbol avoid_symbol_clash(const Raul::Symbol& symbol);
-
- GraphObject::Properties _initial_data;
-
- SharedPtr<PatchModel> _patch;
-
- Gtk::Entry* _symbol_entry;
- Gtk::RadioButton* _poly_voices_radio;
- Gtk::RadioButton* _poly_from_file_radio;
- Gtk::SpinButton* _poly_spinbutton;
- Gtk::Button* _ok_button;
- Gtk::Button* _cancel_button;
-};
-
-
-} // namespace GUI
-} // namespace Ingen
-
-#endif // INGEN_GUI_LOADSUBPATCHWINDOW_HPP
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index bd215037..3c30910a 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -36,7 +36,6 @@
#include "PatchWindow.hpp"
#include "PatchPortModule.hpp"
#include "LoadPluginWindow.hpp"
-#include "LoadSubpatchWindow.hpp"
#include "NewSubpatchWindow.hpp"
#include "Port.hpp"
#include "Connection.hpp"
diff --git a/src/gui/PatchView.cpp b/src/gui/PatchView.cpp
index b8cc83a1..e420793a 100644
--- a/src/gui/PatchView.cpp
+++ b/src/gui/PatchView.cpp
@@ -26,7 +26,6 @@
#include "PatchCanvas.hpp"
#include "LoadPluginWindow.hpp"
#include "NewSubpatchWindow.hpp"
-#include "LoadSubpatchWindow.hpp"
#include "NodeControlWindow.hpp"
#include "PatchTreeWindow.hpp"
#include "GladeFactory.hpp"
diff --git a/src/gui/PatchView.hpp b/src/gui/PatchView.hpp
index 776cea48..0be9eb1e 100644
--- a/src/gui/PatchView.hpp
+++ b/src/gui/PatchView.hpp
@@ -43,7 +43,6 @@ namespace GUI {
class PatchCanvas;
class LoadPluginWindow;
class NewSubpatchWindow;
-class LoadSubpatchWindow;
class NewSubpatchWindow;
class NodeControlWindow;
class PatchDescriptionWindow;
diff --git a/src/gui/PatchWindow.cpp b/src/gui/PatchWindow.cpp
index 9efd4887..d4fb24cc 100644
--- a/src/gui/PatchWindow.cpp
+++ b/src/gui/PatchWindow.cpp
@@ -30,7 +30,6 @@
#include "LoadPluginWindow.hpp"
#include "NewSubpatchWindow.hpp"
#include "LoadPatchWindow.hpp"
-#include "LoadSubpatchWindow.hpp"
#include "NodeControlWindow.hpp"
#include "Configuration.hpp"
#include "MessagesWindow.hpp"
diff --git a/src/gui/PatchWindow.hpp b/src/gui/PatchWindow.hpp
index 8fecd28f..d4cc87a9 100644
--- a/src/gui/PatchWindow.hpp
+++ b/src/gui/PatchWindow.hpp
@@ -41,7 +41,6 @@ namespace GUI {
class LoadPluginWindow;
class LoadPatchWindow;
class NewSubpatchWindow;
-class LoadSubpatchWindow;
class NewSubpatchWindow;
class NodeControlWindow;
class PatchDescriptionWindow;
diff --git a/src/gui/WindowFactory.cpp b/src/gui/WindowFactory.cpp
index d5493339..7b5b6000 100644
--- a/src/gui/WindowFactory.cpp
+++ b/src/gui/WindowFactory.cpp
@@ -23,7 +23,6 @@
#include "LoadPatchWindow.hpp"
#include "LoadPluginWindow.hpp"
#include "LoadRemotePatchWindow.hpp"
-#include "LoadSubpatchWindow.hpp"
#include "NewSubpatchWindow.hpp"
#include "NodeControlWindow.hpp"
#include "PropertiesWindow.hpp"
@@ -47,7 +46,6 @@ WindowFactory::WindowFactory()
, _load_remote_patch_win(NULL)
, _upload_patch_win(NULL)
, _new_subpatch_win(NULL)
- , _load_subpatch_win(NULL)
, _properties_win(NULL)
{
Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference();
@@ -56,7 +54,6 @@ WindowFactory::WindowFactory()
xml->get_widget_derived("load_patch_win", _load_patch_win);
xml->get_widget_derived("load_remote_patch_win", _load_remote_patch_win);
xml->get_widget_derived("new_subpatch_win", _new_subpatch_win);
- xml->get_widget_derived("load_subpatch_win", _load_subpatch_win);
xml->get_widget_derived("properties_win", _properties_win);
xml->get_widget_derived("rename_win", _rename_win);
@@ -269,7 +266,19 @@ WindowFactory::present_load_patch(SharedPtr<PatchModel> patch, GraphObject::Prop
if (w != _patch_windows.end())
_load_patch_win->set_transient_for(*w->second);
- _load_patch_win->present(patch, data);
+ _load_patch_win->present(patch, true, data);
+}
+
+
+void
+WindowFactory::present_load_subpatch(SharedPtr<PatchModel> patch, GraphObject::Properties data)
+{
+ PatchWindowMap::iterator w = _patch_windows.find(patch->path());
+
+ if (w != _patch_windows.end())
+ _load_patch_win->set_transient_for(*w->second);
+
+ _load_patch_win->present(patch, false, data);
}
@@ -311,18 +320,6 @@ WindowFactory::present_new_subpatch(SharedPtr<PatchModel> patch, GraphObject::Pr
void
-WindowFactory::present_load_subpatch(SharedPtr<PatchModel> patch, GraphObject::Properties data)
-{
- PatchWindowMap::iterator w = _patch_windows.find(patch->path());
-
- if (w != _patch_windows.end())
- _load_subpatch_win->set_transient_for(*w->second);
-
- _load_subpatch_win->present(patch, data);
-}
-
-
-void
WindowFactory::present_rename(SharedPtr<ObjectModel> object)
{
PatchWindowMap::iterator w = _patch_windows.find(object->path());
diff --git a/src/gui/WindowFactory.hpp b/src/gui/WindowFactory.hpp
index 8f205620..c55eb13b 100644
--- a/src/gui/WindowFactory.hpp
+++ b/src/gui/WindowFactory.hpp
@@ -39,7 +39,6 @@ namespace GUI {
class LoadPatchWindow;
class LoadPluginWindow;
class LoadRemotePatchWindow;
-class LoadSubpatchWindow;
class NewSubpatchWindow;
class NodeControlWindow;
class PropertiesWindow;
@@ -75,10 +74,10 @@ public:
void present_load_plugin(SharedPtr<PatchModel> patch, Properties data=Properties());
void present_load_patch(SharedPtr<PatchModel> patch, Properties data=Properties());
+ void present_load_subpatch(SharedPtr<PatchModel> patch, Properties data=Properties());
void present_load_remote_patch(SharedPtr<PatchModel> patch, Properties data=Properties());
void present_upload_patch(SharedPtr<PatchModel> patch);
void present_new_subpatch(SharedPtr<PatchModel> patch, Properties data=Properties());
- void present_load_subpatch(SharedPtr<PatchModel> patch, Properties data=Properties());
void present_rename(SharedPtr<ObjectModel> object);
void present_properties(SharedPtr<ObjectModel> object);
@@ -104,7 +103,6 @@ private:
LoadRemotePatchWindow* _load_remote_patch_win;
UploadPatchWindow* _upload_patch_win;
NewSubpatchWindow* _new_subpatch_win;
- LoadSubpatchWindow* _load_subpatch_win;
PropertiesWindow* _properties_win;
RenameWindow* _rename_win;
};
diff --git a/src/gui/ingen_gui.glade b/src/gui/ingen_gui.glade
index d11335b6..acd3ad00 100644
--- a/src/gui/ingen_gui.glade
+++ b/src/gui/ingen_gui.glade
@@ -795,203 +795,6 @@
</widget>
</child>
</widget>
- <widget class="GtkFileChooserDialog" id="load_subpatch_win">
- <property name="title" translatable="yes">Load Subpatch - Ingen</property>
- <property name="window_position">center-on-parent</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="spacing">24</property>
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkTable" id="table6">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="column_spacing">12</property>
- <property name="row_spacing">12</property>
- <child>
- <widget class="GtkLabel" id="label79">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Symbol: </property>
- <property name="use_markup">True</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">load_subpatch_symbol_entry</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label80">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Polyphony: </property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="load_subpatch_poly_from_file_radio">
- <property name="label" translatable="yes">Load from _file</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip" translatable="yes">Use the polyphony value stored in the patch file</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">load_subpatch_poly_voices_radio</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox46">
- <property name="visible">True</property>
- <child>
- <widget class="GtkRadioButton" id="load_subpatch_poly_voices_radio">
- <property name="label" translatable="yes">_Voices: </property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip" translatable="yes">Specify a custom polyphony value for new patch</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">load_subpatch_poly_from_file_radio</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="load_subpatch_poly_spinbutton">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Specify a custom polyphony value for new patch</property>
- <property name="invisible_char">&#x25CF;</property>
- <property name="adjustment">1 0 1000 1 10 0</property>
- <property name="climb_rate">1</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label104">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="load_subpatch_symbol_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="tooltip" translatable="yes">Specify the name for the new patch</property>
- <property name="invisible_char">&#x25CF;</property>
- <property name="activates_default">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">3</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="load_subpatch_cancel_button">
- <property name="label">gtk-cancel</property>
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="load_subpatch_ok_button">
- <property name="label">gtk-open</property>
- <property name="response_id">-5</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
<widget class="GtkFileChooserDialog" id="load_patch_win">
<property name="title" translatable="yes">Load Patch - Ingen</property>
<property name="window_position">center-on-parent</property>
@@ -1007,18 +810,20 @@
<child>
<widget class="GtkTable" id="table14">
<property name="visible">True</property>
- <property name="n_rows">2</property>
+ <property name="n_rows">3</property>
<property name="n_columns">3</property>
<property name="column_spacing">12</property>
<property name="row_spacing">12</property>
<child>
- <widget class="GtkLabel" id="label123">
+ <widget class="GtkLabel" id="load_patch_poly_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Polyphony: </property>
<property name="use_markup">True</property>
</widget>
<packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
@@ -1038,20 +843,22 @@
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
<property name="x_options">GTK_FILL</property>
<property name="y_options"></property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label1">
+ <widget class="GtkLabel" id="load_patch_ports_label">
<property name="visible">True</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Ports: </property>
<property name="use_markup">True</property>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
@@ -1070,8 +877,8 @@
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
@@ -1090,8 +897,8 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
@@ -1135,7 +942,37 @@
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkLabel" id="load_patch_symbol_label">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Symbol: </property>
+ <property name="use_markup">True</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">load_patch_symbol_entry</property>
+ </widget>
+ <packing>
<property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="load_patch_symbol_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="tooltip" translatable="yes">Specify the name for the new patch</property>
+ <property name="invisible_char">&#x25CF;</property>
+ <property name="activates_default">True</property>
+ </widget>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">3</property>
<property name="y_options">GTK_FILL</property>
</packing>
</child>
diff --git a/src/gui/wscript b/src/gui/wscript
index 5550f836..ed9437d5 100644
--- a/src/gui/wscript
+++ b/src/gui/wscript
@@ -18,7 +18,6 @@ def build(bld):
LoadPatchWindow.cpp
LoadPluginWindow.cpp
LoadRemotePatchWindow.cpp
- LoadSubpatchWindow.cpp
MessagesWindow.cpp
NewSubpatchWindow.cpp
NodeControlWindow.cpp