diff options
author | David Robillard <d@drobilla.net> | 2006-06-18 08:06:14 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2006-06-18 08:06:14 +0000 |
commit | 172a0119ee0a0bb6d50836c70936907c3eb71c9e (patch) | |
tree | cbcc56285b033bb9857b9be85f5f9be193b6f38f /src/progs/gtk/OmFlowCanvas.cpp | |
parent | e6f42fd640dcbad6b2e39cc85bdf307d197278b0 (diff) | |
download | ingen-172a0119ee0a0bb6d50836c70936907c3eb71c9e.tar.gz ingen-172a0119ee0a0bb6d50836c70936907c3eb71c9e.tar.bz2 ingen-172a0119ee0a0bb6d50836c70936907c3eb71c9e.zip |
More work on new ports implementation;
lots of mass renaming and code removal.
git-svn-id: http://svn.drobilla.net/lad/grauph@52 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/gtk/OmFlowCanvas.cpp')
-rw-r--r-- | src/progs/gtk/OmFlowCanvas.cpp | 96 |
1 files changed, 90 insertions, 6 deletions
diff --git a/src/progs/gtk/OmFlowCanvas.cpp b/src/progs/gtk/OmFlowCanvas.cpp index 863ba014..4920dc59 100644 --- a/src/progs/gtk/OmFlowCanvas.cpp +++ b/src/progs/gtk/OmFlowCanvas.cpp @@ -51,16 +51,39 @@ OmFlowCanvas::OmFlowCanvas(PatchController* controller, int width, int height) Glib::RefPtr<Gnome::Glade::Xml> xml = GladeFactory::new_glade_reference(); xml->get_widget("canvas_menu", m_menu); + xml->get_widget("canvas_menu_add_audio_input", m_menu_add_audio_input); + xml->get_widget("canvas_menu_add_audio_output", m_menu_add_audio_output); + xml->get_widget("canvas_menu_add_control_input", m_menu_add_control_input); + xml->get_widget("canvas_menu_add_control_output", m_menu_add_control_output); + xml->get_widget("canvas_menu_add_midi_input", m_menu_add_midi_input); + xml->get_widget("canvas_menu_add_midi_output", m_menu_add_midi_output); xml->get_widget("canvas_menu_load_plugin", m_menu_load_plugin); xml->get_widget("canvas_menu_load_patch", m_menu_load_patch); xml->get_widget("canvas_menu_new_patch", m_menu_new_patch); - m_menu_load_plugin->signal_activate().connect( - sigc::mem_fun<void>(this, &OmFlowCanvas::menu_load_plugin)); - m_menu_load_patch->signal_activate().connect( - sigc::mem_fun<void>(this, &OmFlowCanvas::menu_load_patch)); - m_menu_new_patch->signal_activate().connect( - sigc::mem_fun<void>(this, &OmFlowCanvas::menu_new_patch)); + // Add port menu items + m_menu_add_audio_input->signal_activate().connect( + sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + "audio_input", "AUDIO", false)); + m_menu_add_audio_output->signal_activate().connect( + sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + "audio_output", "AUDIO", true)); + m_menu_add_control_input->signal_activate().connect( + sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + "control_input", "CONTROL", false)); + m_menu_add_control_output->signal_activate().connect( + sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + "control_output", "CONTROL", true)); + m_menu_add_midi_input->signal_activate().connect( + sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + "midi_input", "MIDI", false)); + m_menu_add_midi_output->signal_activate().connect( + sigc::bind(sigc::mem_fun(this, &OmFlowCanvas::menu_add_port), + "midi_output", "MIDI", true)); + + m_menu_load_plugin->signal_activate().connect(sigc::mem_fun(this, &OmFlowCanvas::menu_load_plugin)); + m_menu_load_patch->signal_activate().connect(sigc::mem_fun(this, &OmFlowCanvas::menu_load_patch)); + m_menu_new_patch->signal_activate().connect(sigc::mem_fun(this, &OmFlowCanvas::menu_new_patch)); } @@ -150,6 +173,67 @@ OmFlowCanvas::destroy_selected() void +OmFlowCanvas::menu_add_port(const string& name, const string& type, bool is_output) +{ + const Path& path = m_patch_controller->path().base_path() + name; + Controller::instance().create_port(path, type, is_output); + + char temp_buf[16]; + snprintf(temp_buf, 16, "%d", m_last_click_x); + Controller::instance().set_metadata(path, "module-x", temp_buf); + snprintf(temp_buf, 16, "%d", m_last_click_y); + Controller::instance().set_metadata(path, "module-y", temp_buf); +} +/* +void +OmFlowCanvas::menu_add_audio_input() +{ + string name = "audio_in"; + Controller::instance().create_port(m_patch_controller->path().base_path() + name, "AUDIO", false); +} + + +void +OmFlowCanvas::menu_add_audio_output() +{ + string name = "audio_out"; + Controller::instance().create_port(m_patch_controller->path().base_path() + name, "AUDIO", true); +} + + +void +OmFlowCanvas::menu_add_control_input() +{ + string name = "control_in"; + Controller::instance().create_port(m_patch_controller->path().base_path() + name, "CONTROL", false); +} + + +void +OmFlowCanvas::menu_add_control_output() +{ + string name = "control_out"; + Controller::instance().create_port(m_patch_controller->path().base_path() + name, "CONTROL", true); +} + + +void +OmFlowCanvas::menu_add_midi_input() +{ + string name = "midi_in"; + Controller::instance().create_port(m_patch_controller->path().base_path() + name, "MIDI", false); +} + + +void +OmFlowCanvas::menu_add_midi_output() +{ + string name = "midi_out"; + Controller::instance().create_port(m_patch_controller->path().base_path() + name, "MIDI", true); +} +*/ + +void OmFlowCanvas::menu_load_plugin() { m_patch_controller->window()->load_plugin_window()->set_next_module_location( |