summaryrefslogtreecommitdiffstats
path: root/src/libs/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-07 23:09:48 +0000
committerDavid Robillard <d@drobilla.net>2007-10-07 23:09:48 +0000
commit971c02f3707c4872a2da9a3b946b6508290c5ab4 (patch)
tree1dd28dabb27f75a1c5fc79bb583e50c8ec98974f /src/libs/gui
parent288a04a65de1ff86ff0ca6e02e611f83e881d159 (diff)
downloadingen-971c02f3707c4872a2da9a3b946b6508290c5ab4.tar.gz
ingen-971c02f3707c4872a2da9a3b946b6508290c5ab4.tar.bz2
ingen-971c02f3707c4872a2da9a3b946b6508290c5ab4.zip
Added shared abstract interface for ports.
Moved DataType to shared. Switch data type URIs to match LV2 type semantics (e.g. separate audio/control types). git-svn-id: http://svn.drobilla.net/lad/ingen@840 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/gui')
-rw-r--r--src/libs/gui/Configuration.cpp16
-rw-r--r--src/libs/gui/NodeModule.cpp12
-rw-r--r--src/libs/gui/NodePropertiesWindow.cpp3
-rw-r--r--src/libs/gui/PatchCanvas.cpp16
4 files changed, 28 insertions, 19 deletions
diff --git a/src/libs/gui/Configuration.cpp b/src/libs/gui/Configuration.cpp
index ffef8137..f4c00545 100644
--- a/src/libs/gui/Configuration.cpp
+++ b/src/libs/gui/Configuration.cpp
@@ -83,21 +83,21 @@ Configuration::apply_settings()
uint32_t
-Configuration::get_port_color(const PortModel* pi)
+Configuration::get_port_color(const PortModel* p)
{
- assert(pi != NULL);
-
- if (pi->is_control()) {
+ assert(p != NULL);
+
+ if (p->is_control()) {
return _control_port_color;
- } else if (pi->is_audio()) {
+ } else if (p->is_audio()) {
return _audio_port_color;
- } else if (pi->is_midi()) {
+ } else if (p->is_midi()) {
return _midi_port_color;
- } else if (pi->is_osc()) {
+ } else if (p->is_osc()) {
return _osc_port_color;
}
- cerr << "[Configuration] Unknown port type " << pi->type() << ", port will appear bright red."
+ cerr << "[Configuration] Unknown port type " << p->type() << ", port will appear bright red."
<< endl;
return 0xFF0000B0;
diff --git a/src/libs/gui/NodeModule.cpp b/src/libs/gui/NodeModule.cpp
index d7cf0154..875a6d8c 100644
--- a/src/libs/gui/NodeModule.cpp
+++ b/src/libs/gui/NodeModule.cpp
@@ -128,7 +128,11 @@ NodeModule::embed_gui(bool embed)
if (!_gui_item) {
cerr << "Embedding LV2 GUI" << endl;
- _slv2_ui = _node->plugin()->ui(App::instance().engine().get(), _node.get());
+ const PluginModel* const plugin = dynamic_cast<const PluginModel*>(_node->plugin());
+ assert(plugin);
+
+ _slv2_ui = plugin->ui(App::instance().engine().get(), _node.get());
+
if (_slv2_ui) {
cerr << "Found UI" << endl;
c_widget = (GtkWidget*)slv2_ui_instance_get_widget(_slv2_ui);
@@ -276,7 +280,11 @@ NodeModule::popup_gui()
return false;
}
- _slv2_ui = _node->plugin()->ui(App::instance().engine().get(), _node.get());
+ const PluginModel* const plugin = dynamic_cast<const PluginModel*>(_node->plugin());
+ assert(plugin);
+
+ _slv2_ui = plugin->ui(App::instance().engine().get(), _node.get());
+
if (_slv2_ui) {
cerr << "Popping up LV2 GUI" << endl;
diff --git a/src/libs/gui/NodePropertiesWindow.cpp b/src/libs/gui/NodePropertiesWindow.cpp
index a6fb46ee..9848d872 100644
--- a/src/libs/gui/NodePropertiesWindow.cpp
+++ b/src/libs/gui/NodePropertiesWindow.cpp
@@ -52,7 +52,8 @@ NodePropertiesWindow::set_node(SharedPtr<NodeModel> node_model)
_node_path_label->set_text(node_model->path());
_node_polyphonic_toggle->set_active(node_model->polyphonic());
- SharedPtr<PluginModel> pm = node_model->plugin();
+ const PluginModel* pm = dynamic_cast<const PluginModel*>(node_model->plugin());
+ assert(pm);
if (pm) {
_plugin_type_label->set_text(pm->type_uri());
diff --git a/src/libs/gui/PatchCanvas.cpp b/src/libs/gui/PatchCanvas.cpp
index 236ed0d3..5e3c7f78 100644
--- a/src/libs/gui/PatchCanvas.cpp
+++ b/src/libs/gui/PatchCanvas.cpp
@@ -74,28 +74,28 @@ PatchCanvas::PatchCanvas(SharedPtr<PatchModel> patch, int width, int height)
// Add port menu items
_menu_add_audio_input->signal_activate().connect(
sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port),
- "audio_input", "ingen:audio", false));
+ "audio_input", "ingen:AudioPort", false));
_menu_add_audio_output->signal_activate().connect(
sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port),
- "audio_output", "ingen:audio", true));
+ "audio_output", "ingen:AudioPort", true));
_menu_add_control_input->signal_activate().connect(
sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port),
- "control_input", "ingen:control", false));
+ "control_input", "ingen:ControlPort", false));
_menu_add_control_output->signal_activate().connect(
sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port),
- "control_output", "ingen:control", true));
+ "control_output", "ingen:ControlPort", true));
_menu_add_midi_input->signal_activate().connect(
sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port),
- "midi_input", "ingen:midi", false));
+ "midi_input", "ingen:MidiPort", false));
_menu_add_midi_output->signal_activate().connect(
sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port),
- "midi_output", "ingen:midi", true));
+ "midi_output", "ingen:MidiPort", true));
_menu_add_osc_input->signal_activate().connect(
sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port),
- "osc_input", "ingen:osc", false));
+ "osc_input", "ingen:OSCPort", false));
_menu_add_osc_output->signal_activate().connect(
sigc::bind(sigc::mem_fun(this, &PatchCanvas::menu_add_port),
- "osc_output", "ingen:osc", true));
+ "osc_output", "ingen:OSCPort", true));
// Add control menu items
/*_menu_add_number_control->signal_activate().connect(