mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
ripping, tearing, shredding
git-svn-id: svn://localhost/trunk/ardour2@130 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
8f54e41058
commit
c74f6577e2
12 changed files with 130 additions and 173 deletions
|
|
@ -847,7 +847,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
||||||
connection_editor = 0;
|
connection_editor = 0;
|
||||||
add_route_dialog = 0;
|
add_route_dialog = 0;
|
||||||
route_params = 0;
|
route_params = 0;
|
||||||
meter_bridge = 0;
|
|
||||||
option_editor = 0;
|
option_editor = 0;
|
||||||
location_ui = 0;
|
location_ui = 0;
|
||||||
open_session_selector = 0;
|
open_session_selector = 0;
|
||||||
|
|
@ -1897,7 +1896,6 @@ restart JACK with more ports."));
|
||||||
void
|
void
|
||||||
ARDOUR_UI::diskstream_added (DiskStream* ds)
|
ARDOUR_UI::diskstream_added (DiskStream* ds)
|
||||||
{
|
{
|
||||||
// meter_bridge_dialog_check->set_sensitive (true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -205,7 +205,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||||
protected:
|
protected:
|
||||||
friend class PublicEditor;
|
friend class PublicEditor;
|
||||||
|
|
||||||
void toggle_metering ();
|
|
||||||
void toggle_clocking ();
|
void toggle_clocking ();
|
||||||
void toggle_auto_play ();
|
void toggle_auto_play ();
|
||||||
void toggle_auto_input ();
|
void toggle_auto_input ();
|
||||||
|
|
@ -329,9 +328,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||||
void start_clocking ();
|
void start_clocking ();
|
||||||
void stop_clocking ();
|
void stop_clocking ();
|
||||||
|
|
||||||
AudioClock big_clock;
|
void manage_window (Gtk::Window&);
|
||||||
Gtk::Frame big_clock_frame;
|
|
||||||
ArdourDialog* big_clock_window;
|
AudioClock big_clock;
|
||||||
|
Gtk::Frame big_clock_frame;
|
||||||
|
Gtk::Window* big_clock_window;
|
||||||
|
|
||||||
/* Transport Control */
|
/* Transport Control */
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -66,11 +66,6 @@ ARDOUR_UI::setup_windows ()
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (create_meter_bridge ()) {
|
|
||||||
error << _("UI: cannot setup meter_bridge") << endmsg;
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* all other dialogs are created conditionally */
|
/* all other dialogs are created conditionally */
|
||||||
|
|
||||||
we_have_dependents ();
|
we_have_dependents ();
|
||||||
|
|
@ -425,16 +420,24 @@ ARDOUR_UI::setup_clock ()
|
||||||
{
|
{
|
||||||
ARDOUR_UI::Clock.connect (bind (mem_fun (big_clock, &AudioClock::set), false));
|
ARDOUR_UI::Clock.connect (bind (mem_fun (big_clock, &AudioClock::set), false));
|
||||||
|
|
||||||
big_clock_window = new ArdourDialog ("big clock window");
|
big_clock_window = new Gtk::Window (WINDOW_TOPLEVEL);
|
||||||
|
|
||||||
big_clock_window->set_border_width (0);
|
big_clock_window->set_border_width (0);
|
||||||
big_clock_window->add (big_clock);
|
big_clock_window->add (big_clock);
|
||||||
big_clock_window->set_title (_("ardour: clock"));
|
big_clock_window->set_title (_("ardour: clock"));
|
||||||
big_clock_window->set_type_hint (Gdk::WINDOW_TYPE_HINT_MENU);
|
big_clock_window->set_type_hint (Gdk::WINDOW_TYPE_HINT_MENU);
|
||||||
|
big_clock_window->signal_realize().connect (bind (sigc::ptr_fun (set_decoration), big_clock_window, (Gdk::DECOR_BORDER|Gdk::DECOR_RESIZEH)));
|
||||||
big_clock_window->signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), static_cast<Gtk::Window*>(big_clock_window)));
|
|
||||||
|
|
||||||
big_clock_window->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::big_clock_hiding));
|
big_clock_window->signal_unmap().connect (mem_fun(*this, &ARDOUR_UI::big_clock_hiding));
|
||||||
|
|
||||||
|
manage_window (*big_clock_window);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ARDOUR_UI::manage_window (Window& win)
|
||||||
|
{
|
||||||
|
win.signal_delete_event().connect (bind (sigc::ptr_fun (just_hide_it), &win));
|
||||||
|
win.signal_enter_notify_event().connect (bind (mem_fun (Keyboard::the_keyboard(), &Keyboard::enter_window), &win));
|
||||||
|
win.signal_leave_notify_event().connect (bind (mem_fun (Keyboard::the_keyboard(), &Keyboard::leave_window), &win));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@
|
||||||
#include "ardour_ui.h"
|
#include "ardour_ui.h"
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
#include "mixer_ui.h"
|
#include "mixer_ui.h"
|
||||||
#include "meter_bridge.h"
|
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "route_params_ui.h"
|
#include "route_params_ui.h"
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
@ -68,8 +67,6 @@ ARDOUR_UI::connect_dependents_to_session (ARDOUR::Session *s)
|
||||||
{
|
{
|
||||||
editor->connect_to_session (s);
|
editor->connect_to_session (s);
|
||||||
mixer->connect_to_session (s);
|
mixer->connect_to_session (s);
|
||||||
|
|
||||||
meter_bridge->set_session (s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
#include "ardour_ui.h"
|
#include "ardour_ui.h"
|
||||||
#include "connection_editor.h"
|
#include "connection_editor.h"
|
||||||
#include "location_ui.h"
|
#include "location_ui.h"
|
||||||
#include "meter_bridge.h"
|
|
||||||
#include "mixer_ui.h"
|
#include "mixer_ui.h"
|
||||||
#include "option_editor.h"
|
#include "option_editor.h"
|
||||||
#include "public_editor.h"
|
#include "public_editor.h"
|
||||||
|
|
@ -81,9 +80,7 @@ ARDOUR_UI::connect_to_session (Session *s)
|
||||||
/* </CMT Additions> */
|
/* </CMT Additions> */
|
||||||
|
|
||||||
|
|
||||||
if (session->n_diskstreams()) {
|
if (session->n_diskstreams() == 0) {
|
||||||
// meter_bridge_dialog_check->set_sensitive (true);
|
|
||||||
} else {
|
|
||||||
session->DiskStreamAdded.connect (mem_fun(*this, &ARDOUR_UI::diskstream_added));
|
session->DiskStreamAdded.connect (mem_fun(*this, &ARDOUR_UI::diskstream_added));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -178,10 +175,8 @@ ARDOUR_UI::unload_session ()
|
||||||
add_track_item->set_sensitive (false);
|
add_track_item->set_sensitive (false);
|
||||||
export_item->set_sensitive (false);
|
export_item->set_sensitive (false);
|
||||||
close_item->set_sensitive (false);
|
close_item->set_sensitive (false);
|
||||||
// meter_bridge_dialog_check->set_sensitive (false);
|
|
||||||
connection_editor_check->set_sensitive (false);
|
connection_editor_check->set_sensitive (false);
|
||||||
locations_dialog_check->set_sensitive (false);
|
locations_dialog_check->set_sensitive (false);
|
||||||
// meter_bridge_dialog_check->set_active(false);
|
|
||||||
connection_editor_check->set_active(false);
|
connection_editor_check->set_active(false);
|
||||||
locations_dialog_check->set_active(false);
|
locations_dialog_check->set_active(false);
|
||||||
route_params_check->set_sensitive (false);
|
route_params_check->set_sensitive (false);
|
||||||
|
|
@ -282,14 +277,10 @@ ARDOUR_UI::big_clock_hiding()
|
||||||
void
|
void
|
||||||
ARDOUR_UI::toggle_big_clock_window ()
|
ARDOUR_UI::toggle_big_clock_window ()
|
||||||
{
|
{
|
||||||
if (big_clock_window->within_hiding()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (big_clock_window->is_visible()) {
|
if (big_clock_window->is_visible()) {
|
||||||
big_clock_window->hide_all ();
|
big_clock_window->hide ();
|
||||||
} else {
|
} else {
|
||||||
big_clock_window->show_all ();
|
big_clock_window->present ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -305,9 +296,9 @@ ARDOUR_UI::toggle_options_window ()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (option_editor->is_visible()) {
|
if (option_editor->is_visible()) {
|
||||||
option_editor->hide_all ();
|
option_editor->hide ();
|
||||||
} else {
|
} else {
|
||||||
option_editor->show_all ();
|
option_editor->present ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -324,18 +315,6 @@ ARDOUR_UI::toggle_auto_input ()
|
||||||
toggle_some_session_state (auto_input_button,
|
toggle_some_session_state (auto_input_button,
|
||||||
&Session::get_auto_input,
|
&Session::get_auto_input,
|
||||||
&Session::set_auto_input);
|
&Session::set_auto_input);
|
||||||
|
|
||||||
meter_bridge->clear_all_meters ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
ARDOUR_UI::toggle_metering ()
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
if (global_meter_button.get_active()) {
|
|
||||||
meter_bridge->toggle_metering ();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
@ -361,9 +340,9 @@ ARDOUR_UI::toggle_location_window ()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (location_ui->is_visible()) {
|
if (location_ui->is_visible()) {
|
||||||
location_ui->hide_all();
|
location_ui->hide();
|
||||||
} else {
|
} else {
|
||||||
location_ui->show_all();
|
location_ui->present();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -396,9 +375,9 @@ ARDOUR_UI::toggle_route_params_window ()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (route_params->is_visible ()) {
|
if (route_params->is_visible ()) {
|
||||||
route_params->hide_all ();
|
route_params->hide ();
|
||||||
} else {
|
} else {
|
||||||
route_params->show_all ();
|
route_params->present ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -657,7 +657,7 @@ Keyboard::get_modifier_masks ()
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Keyboard::enter_window (GdkEventCrossing *ev)
|
Keyboard::enter_window (GdkEventCrossing *ev, Gtk::Window* win)
|
||||||
{
|
{
|
||||||
switch (ev->detail) {
|
switch (ev->detail) {
|
||||||
case GDK_NOTIFY_INFERIOR:
|
case GDK_NOTIFY_INFERIOR:
|
||||||
|
|
@ -674,7 +674,7 @@ Keyboard::enter_window (GdkEventCrossing *ev)
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
Keyboard::leave_window (GdkEventCrossing *ev)
|
Keyboard::leave_window (GdkEventCrossing *ev, Gtk::Window* win)
|
||||||
{
|
{
|
||||||
switch (ev->detail) {
|
switch (ev->detail) {
|
||||||
case GDK_NOTIFY_INFERIOR:
|
case GDK_NOTIFY_INFERIOR:
|
||||||
|
|
|
||||||
|
|
@ -65,8 +65,8 @@ class Keyboard : public sigc::trackable, Stateful
|
||||||
return (ev->state & RelevantModifierKeyMask) == 0;
|
return (ev->state & RelevantModifierKeyMask) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool leave_window (GdkEventCrossing *ev);
|
bool leave_window (GdkEventCrossing *ev, Gtk::Window*);
|
||||||
bool enter_window (GdkEventCrossing *ev);
|
bool enter_window (GdkEventCrossing *ev, Gtk::Window*);
|
||||||
|
|
||||||
static bool modifier_state_contains (guint state, ModifierMask);
|
static bool modifier_state_contains (guint state, ModifierMask);
|
||||||
static bool modifier_state_equals (guint state, ModifierMask);
|
static bool modifier_state_equals (guint state, ModifierMask);
|
||||||
|
|
|
||||||
|
|
@ -167,8 +167,6 @@ Mixer_UI::Mixer_UI (AudioEngine& eng)
|
||||||
snapshot_display.signal_button_press_event().connect (mem_fun (*this, &Mixer_UI::snapshot_display_button_press));
|
snapshot_display.signal_button_press_event().connect (mem_fun (*this, &Mixer_UI::snapshot_display_button_press));
|
||||||
|
|
||||||
_plugin_selector = new PluginSelector (PluginManager::the_manager());
|
_plugin_selector = new PluginSelector (PluginManager::the_manager());
|
||||||
_plugin_selector->signal_delete_event().connect (bind (ptr_fun (just_hide_it),
|
|
||||||
static_cast<Window *> (_plugin_selector)));
|
|
||||||
|
|
||||||
signal_configure_event().connect (mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::configure_handler));
|
signal_configure_event().connect (mem_fun (*ARDOUR_UI::instance(), &ARDOUR_UI::configure_handler));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@
|
||||||
#include <lrdf.h>
|
#include <lrdf.h>
|
||||||
|
|
||||||
#include <gtkmm/table.h>
|
#include <gtkmm/table.h>
|
||||||
|
#include <gtkmm/stock.h>
|
||||||
#include <gtkmm/button.h>
|
#include <gtkmm/button.h>
|
||||||
#include <gtkmm/notebook.h>
|
#include <gtkmm/notebook.h>
|
||||||
|
|
||||||
|
|
@ -35,14 +36,13 @@
|
||||||
#include "i18n.h"
|
#include "i18n.h"
|
||||||
|
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
|
using namespace Gtk;
|
||||||
|
|
||||||
PluginSelector::PluginSelector (PluginManager *mgr)
|
PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
: ArdourDialog ("plugin selector")
|
: Dialog (_("ardour: plugins"), true, false)
|
||||||
{
|
{
|
||||||
set_position (Gtk::WIN_POS_MOUSE);
|
set_position (Gtk::WIN_POS_MOUSE);
|
||||||
set_name ("PluginSelectorWindow");
|
set_name ("PluginSelectorWindow");
|
||||||
set_title (_("ardour: plugins"));
|
|
||||||
set_modal(true);
|
|
||||||
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
|
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
|
||||||
|
|
||||||
manager = mgr;
|
manager = mgr;
|
||||||
|
|
@ -89,14 +89,9 @@ PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
ARDOUR_UI::instance()->tooltips().set_tip(*btn_add, _("Add a plugin to the effect list"));
|
ARDOUR_UI::instance()->tooltips().set_tip(*btn_add, _("Add a plugin to the effect list"));
|
||||||
Gtk::Button *btn_remove = manage(new Gtk::Button(_("Remove")));
|
Gtk::Button *btn_remove = manage(new Gtk::Button(_("Remove")));
|
||||||
ARDOUR_UI::instance()->tooltips().set_tip(*btn_remove, _("Remove a plugin from the effect list"));
|
ARDOUR_UI::instance()->tooltips().set_tip(*btn_remove, _("Remove a plugin from the effect list"));
|
||||||
Gtk::Button *btn_ok = manage(new Gtk::Button(_("OK")));
|
|
||||||
Gtk::Button *btn_cancel = manage(new Gtk::Button(_("Cancel")));
|
|
||||||
|
|
||||||
Gtk::Button *btn_update = manage(new Gtk::Button(_("Update")));
|
Gtk::Button *btn_update = manage(new Gtk::Button(_("Update")));
|
||||||
ARDOUR_UI::instance()->tooltips().set_tip(*btn_update, _("Update available plugins"));
|
ARDOUR_UI::instance()->tooltips().set_tip(*btn_update, _("Update available plugins"));
|
||||||
|
|
||||||
btn_ok->set_name("PluginSelectorButton");
|
|
||||||
btn_cancel->set_name("PluginSelectorButton");
|
|
||||||
btn_add->set_name("PluginSelectorButton");
|
btn_add->set_name("PluginSelectorButton");
|
||||||
btn_remove->set_name("PluginSelectorButton");
|
btn_remove->set_name("PluginSelectorButton");
|
||||||
|
|
||||||
|
|
@ -109,9 +104,11 @@ PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
table->attach(*btn_update, 5, 6, 5, 6, Gtk::FILL, Gtk::FILL, 5, 5);
|
table->attach(*btn_update, 5, 6, 5, 6, Gtk::FILL, Gtk::FILL, 5, 5);
|
||||||
|
|
||||||
table->attach(added_list, 0, 7, 7, 9);
|
table->attach(added_list, 0, 7, 7, 9);
|
||||||
table->attach(*btn_ok, 1, 3, 9, 10, Gtk::FILL, Gtk::FILL, 5, 5);
|
|
||||||
table->attach(*btn_cancel, 3, 4, 9, 10, Gtk::FILL, Gtk::FILL, 5, 5);
|
add_button (Stock::OK, RESPONSE_ACCEPT);
|
||||||
add (*table);
|
add_button (Stock::CANCEL, RESPONSE_CANCEL);
|
||||||
|
|
||||||
|
get_vbox()->pack_start (*table);
|
||||||
|
|
||||||
using namespace Gtk::Notebook_Helpers;
|
using namespace Gtk::Notebook_Helpers;
|
||||||
notebook.pages().push_back (TabElem (ladspa_display, _("LADSPA")));
|
notebook.pages().push_back (TabElem (ladspa_display, _("LADSPA")));
|
||||||
|
|
@ -142,10 +139,6 @@ PluginSelector::PluginSelector (PluginManager *mgr)
|
||||||
btn_update->signal_clicked().connect (mem_fun(*this, &PluginSelector::btn_update_clicked));
|
btn_update->signal_clicked().connect (mem_fun(*this, &PluginSelector::btn_update_clicked));
|
||||||
btn_add->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_add_clicked));
|
btn_add->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_add_clicked));
|
||||||
btn_remove->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_remove_clicked));
|
btn_remove->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_remove_clicked));
|
||||||
btn_ok->signal_clicked().connect(mem_fun(*this, &PluginSelector::btn_ok_clicked));
|
|
||||||
btn_cancel->signal_clicked().connect(mem_fun(*this,&PluginSelector::btn_cancel_clicked));
|
|
||||||
signal_delete_event().connect (mem_fun(*this, &PluginSelector::wm_close));
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -328,27 +321,6 @@ PluginSelector::btn_remove_clicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Adds a plugin, and closes the window.
|
|
||||||
void
|
|
||||||
PluginSelector::btn_ok_clicked()
|
|
||||||
{
|
|
||||||
list<PluginInfo*>::iterator i;
|
|
||||||
|
|
||||||
for (i = added_plugins.begin(); i != added_plugins.end(); ++i){
|
|
||||||
use_plugin (*i);
|
|
||||||
}
|
|
||||||
|
|
||||||
hide();
|
|
||||||
added_plugins.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
PluginSelector::btn_cancel_clicked()
|
|
||||||
{
|
|
||||||
hide();
|
|
||||||
added_plugins.clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
PluginSelector::btn_update_clicked()
|
PluginSelector::btn_update_clicked()
|
||||||
{
|
{
|
||||||
|
|
@ -356,9 +328,34 @@ PluginSelector::btn_update_clicked()
|
||||||
input_refiller ();
|
input_refiller ();
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
int
|
||||||
PluginSelector::wm_close(GdkEventAny* ev)
|
PluginSelector::run ()
|
||||||
{
|
{
|
||||||
btn_cancel_clicked();
|
ResponseType r;
|
||||||
return TRUE;
|
list<PluginInfo*>::iterator i;
|
||||||
|
|
||||||
|
r = (ResponseType) Dialog::run ();
|
||||||
|
|
||||||
|
switch (r) {
|
||||||
|
case RESPONSE_ACCEPT:
|
||||||
|
for (i = added_plugins.begin(); i != added_plugins.end(); ++i){
|
||||||
|
use_plugin (*i);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
cleanup ();
|
||||||
|
|
||||||
|
return (int) r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
PluginSelector::cleanup ()
|
||||||
|
{
|
||||||
|
hide();
|
||||||
|
added_plugins.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,25 +20,25 @@
|
||||||
#ifndef __ardour_plugin_selector_h__
|
#ifndef __ardour_plugin_selector_h__
|
||||||
#define __ardour_plugin_selector_h__
|
#define __ardour_plugin_selector_h__
|
||||||
|
|
||||||
#include <gtkmm/notebook.h>
|
#include <gtkmm/dialog.h>
|
||||||
#include <gtkmm/notebook.h>
|
#include <gtkmm/notebook.h>
|
||||||
#include <gtkmm/treeview.h>
|
#include <gtkmm/treeview.h>
|
||||||
#include <gtkmm2ext/selector.h>
|
#include <gtkmm2ext/selector.h>
|
||||||
|
|
||||||
#include <ardour_dialog.h>
|
|
||||||
|
|
||||||
namespace ARDOUR {
|
namespace ARDOUR {
|
||||||
class Session;
|
class Session;
|
||||||
class PluginManager;
|
class PluginManager;
|
||||||
class Plugin;
|
class Plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
class PluginSelector : public ArdourDialog
|
class PluginSelector : public Gtk::Dialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PluginSelector (ARDOUR::PluginManager *);
|
PluginSelector (ARDOUR::PluginManager *);
|
||||||
sigc::signal<void,ARDOUR::Plugin *> PluginCreated;
|
sigc::signal<void,ARDOUR::Plugin *> PluginCreated;
|
||||||
|
|
||||||
|
int run (); // XXX should we try not to overload the non-virtual Gtk::Dialog::run() ?
|
||||||
|
|
||||||
void set_session (ARDOUR::Session*);
|
void set_session (ARDOUR::Session*);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
@ -118,12 +118,10 @@ class PluginSelector : public ArdourDialog
|
||||||
void row_clicked(GdkEventButton *);
|
void row_clicked(GdkEventButton *);
|
||||||
void btn_add_clicked();
|
void btn_add_clicked();
|
||||||
void btn_remove_clicked();
|
void btn_remove_clicked();
|
||||||
void btn_ok_clicked();
|
|
||||||
void btn_update_clicked();
|
void btn_update_clicked();
|
||||||
void btn_apply_clicked();
|
void btn_apply_clicked();
|
||||||
void btn_cancel_clicked();
|
|
||||||
void use_plugin (ARDOUR::PluginInfo*);
|
void use_plugin (ARDOUR::PluginInfo*);
|
||||||
gint wm_close(GdkEventAny* ev);
|
void cleanup ();
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // __ardour_plugin_selector_h__
|
#endif // __ardour_plugin_selector_h__
|
||||||
|
|
|
||||||
|
|
@ -64,11 +64,12 @@
|
||||||
using namespace sigc;
|
using namespace sigc;
|
||||||
using namespace ARDOUR;
|
using namespace ARDOUR;
|
||||||
using namespace Gtk;
|
using namespace Gtk;
|
||||||
|
using namespace Glib;
|
||||||
using namespace Gtkmm2ext;
|
using namespace Gtkmm2ext;
|
||||||
|
|
||||||
|
|
||||||
|
RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelector &plugsel,
|
||||||
RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelector &plugsel, RouteRedirectSelection & rsel, bool owner_is_mixer)
|
RouteRedirectSelection & rsel, bool owner_is_mixer)
|
||||||
: _route(rt),
|
: _route(rt),
|
||||||
_session(sess),
|
_session(sess),
|
||||||
_owner_is_mixer (owner_is_mixer),
|
_owner_is_mixer (owner_is_mixer),
|
||||||
|
|
@ -83,8 +84,11 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelec
|
||||||
redirect_drag_in_progress = false;
|
redirect_drag_in_progress = false;
|
||||||
|
|
||||||
model = ListStore::create(columns);
|
model = ListStore::create(columns);
|
||||||
selection = redirect_display.get_selection();
|
|
||||||
|
RefPtr<TreeSelection> selection = redirect_display.get_selection();
|
||||||
selection->set_mode (Gtk::SELECTION_MULTIPLE);
|
selection->set_mode (Gtk::SELECTION_MULTIPLE);
|
||||||
|
selection->signal_changed().connect (mem_fun (*this, &RedirectBox::selection_changed));
|
||||||
|
|
||||||
redirect_display.set_model (model);
|
redirect_display.set_model (model);
|
||||||
redirect_display.append_column (NULL, columns.text);
|
redirect_display.append_column (NULL, columns.text);
|
||||||
redirect_display.set_name ("MixerRedirectSelector");
|
redirect_display.set_name ("MixerRedirectSelector");
|
||||||
|
|
@ -113,7 +117,6 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelec
|
||||||
redirect_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::redirect_button));
|
redirect_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::redirect_button));
|
||||||
|
|
||||||
//redirect_display.signal_button_release_event().connect_after (ptr_fun (do_not_propagate));
|
//redirect_display.signal_button_release_event().connect_after (ptr_fun (do_not_propagate));
|
||||||
//_plugin_selector.hide.connect(mem_fun(*this,&RedirectBox::disconnect_newplug));
|
|
||||||
set_stuff_from_route ();
|
set_stuff_from_route ();
|
||||||
|
|
||||||
/* start off as a passthru strip. we'll correct this, if necessary,
|
/* start off as a passthru strip. we'll correct this, if necessary,
|
||||||
|
|
@ -323,61 +326,62 @@ RedirectBox::redirect_button (GdkEventButton *ev)
|
||||||
Menu *
|
Menu *
|
||||||
RedirectBox::build_redirect_menu ()
|
RedirectBox::build_redirect_menu ()
|
||||||
{
|
{
|
||||||
popup_act_grp = Gtk::ActionGroup::create();
|
popup_act_grp = Gtk::ActionGroup::create(X_("redirectmenu"));
|
||||||
|
Glib::RefPtr<Action> act;
|
||||||
|
|
||||||
/* new stuff */
|
/* new stuff */
|
||||||
|
ActionManager::register_action (popup_act_grp, X_("newplugin"), _("New Plugin ..."), mem_fun(*this, &RedirectBox::choose_plugin));
|
||||||
|
ActionManager::register_action (popup_act_grp, X_("newinsert"), _("New Insert"), mem_fun(*this, &RedirectBox::choose_insert));
|
||||||
|
ActionManager::register_action (popup_act_grp, X_("newsend"), _("New Send ..."), mem_fun(*this, &RedirectBox::choose_send));
|
||||||
|
ActionManager::register_action (popup_act_grp, X_("clear"), _("Clear"), mem_fun(*this, &RedirectBox::clear_redirects));
|
||||||
|
|
||||||
popup_act_grp->add (Gtk::Action::create("newplugin", _("New Plugin ...")), mem_fun(*this, &RedirectBox::choose_plugin));
|
|
||||||
popup_act_grp->add (Gtk::Action::create("newinsert", _("New Insert")), mem_fun(*this, &RedirectBox::choose_insert));
|
|
||||||
popup_act_grp->add (Gtk::Action::create("newsend", _("New Send ...")), mem_fun(*this, &RedirectBox::choose_send));
|
|
||||||
popup_act_grp->add (Gtk::Action::create("clear", _("Clear")), mem_fun(*this, &RedirectBox::clear_redirects));
|
|
||||||
|
|
||||||
/* standard editing stuff */
|
/* standard editing stuff */
|
||||||
|
act = ActionManager::register_action (popup_act_grp, X_("cut"), _("Cut"), mem_fun(*this, &RedirectBox::cut_redirects));
|
||||||
popup_act_grp->add (Gtk::Action::create("cut", _("Cut")), mem_fun(*this, &RedirectBox::cut_redirects));
|
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||||
popup_act_grp->add (Gtk::Action::create("copy", _("Copy")), mem_fun(*this, &RedirectBox::copy_redirects));
|
act = ActionManager::register_action (popup_act_grp, X_("copy"), _("Copy"), mem_fun(*this, &RedirectBox::copy_redirects));
|
||||||
popup_act_grp->add (Gtk::Action::create("paste", _("Paste")), mem_fun(*this, &RedirectBox::paste_redirects));
|
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||||
popup_act_grp->add (Gtk::Action::create("rename", _("Rename")), mem_fun(*this, &RedirectBox::rename_redirects));
|
ActionManager::ActionManager::register_action (popup_act_grp, X_("paste"), _("Paste"), mem_fun(*this, &RedirectBox::paste_redirects));
|
||||||
popup_act_grp->add (Gtk::Action::create("selectall", _("Select All")), mem_fun(*this, &RedirectBox::select_all_redirects));
|
act = ActionManager::register_action (popup_act_grp, X_("rename"), _("Rename"), mem_fun(*this, &RedirectBox::rename_redirects));
|
||||||
popup_act_grp->add (Gtk::Action::create("deselectall", _("Deselect All")), mem_fun(*this, &RedirectBox::deselect_all_redirects));
|
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||||
|
ActionManager::register_action (popup_act_grp, X_("selectall"), _("Select All"), mem_fun(*this, &RedirectBox::select_all_redirects));
|
||||||
|
ActionManager::register_action (popup_act_grp, X_("deselectall"), _("Deselect All"), mem_fun(*this, &RedirectBox::deselect_all_redirects));
|
||||||
|
|
||||||
/* activation */
|
/* activation */
|
||||||
|
act = ActionManager::register_action (popup_act_grp, X_("activate"), _("Activate"), bind (mem_fun(*this, &RedirectBox::for_selected_redirects), &RedirectBox::activate_redirect));
|
||||||
popup_act_grp->add (Gtk::Action::create("activate", _("Activate")), bind (mem_fun(*this, &RedirectBox::for_selected_redirects), &RedirectBox::activate_redirect));
|
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||||
popup_act_grp->add (Gtk::Action::create("deactivate", _("Deactivate")), bind (mem_fun(*this, &RedirectBox::for_selected_redirects), &RedirectBox::deactivate_redirect));
|
act = ActionManager::register_action (popup_act_grp, X_("deactivate"), _("Deactivate"), bind (mem_fun(*this, &RedirectBox::for_selected_redirects), &RedirectBox::deactivate_redirect));
|
||||||
popup_act_grp->add (Gtk::Action::create("activateall", _("Activate All")), bind (mem_fun(*this, &RedirectBox::all_redirects_active), true));
|
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||||
popup_act_grp->add (Gtk::Action::create("deactivateall", _("Deactivate All")), bind (mem_fun(*this, &RedirectBox::all_redirects_active), false));
|
ActionManager::register_action (popup_act_grp, X_("activate"), _("Activate"), bind (mem_fun(*this, &RedirectBox::all_redirects_active),true));
|
||||||
|
ActionManager::register_action (popup_act_grp, X_("activate"), _("Activate"), bind (mem_fun(*this, &RedirectBox::all_redirects_active), false));
|
||||||
/* show editors */
|
|
||||||
|
|
||||||
popup_act_grp->add (Gtk::Action::create("edit", _("Edit")), bind (mem_fun(*this, &RedirectBox::for_selected_redirects), &RedirectBox::edit_redirect));
|
|
||||||
|
|
||||||
selection_dependent_items.push_back (popup_act_grp->get_action("cut"));
|
|
||||||
selection_dependent_items.push_back (popup_act_grp->get_action("copy"));
|
|
||||||
selection_dependent_items.push_back (popup_act_grp->get_action("rename"));
|
|
||||||
selection_dependent_items.push_back (popup_act_grp->get_action("activate"));
|
|
||||||
selection_dependent_items.push_back (popup_act_grp->get_action("deactivate"));
|
|
||||||
selection_dependent_items.push_back (popup_act_grp->get_action("edit"));
|
|
||||||
|
|
||||||
//popup_ui_mgr = Gtk::UIManager::create();
|
/* show editors */
|
||||||
//popup_ui_mgr->insert_action_group(popup_act_grp);
|
act = ActionManager::register_action (popup_act_grp, X_("edit"), _("Edit"), bind (mem_fun(*this, &RedirectBox::for_selected_redirects), &RedirectBox::edit_redirect));
|
||||||
|
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||||
redirect_menu = dynamic_cast<Gtk::Menu*>(ActionManager::get_widget("/redirectmenu") );
|
|
||||||
redirect_menu->signal_map_event().connect (mem_fun(*this, &RedirectBox::redirect_menu_map_handler));
|
ActionManager::add_action_group (popup_act_grp);
|
||||||
redirect_menu->set_name ("ArdourContextMenu");
|
|
||||||
show_all_children();
|
redirect_menu = dynamic_cast<Gtk::Menu*>(ActionManager::get_widget("/redirectmenu") );
|
||||||
return redirect_menu;
|
redirect_menu->signal_map_event().connect (mem_fun(*this, &RedirectBox::redirect_menu_map_handler));
|
||||||
|
redirect_menu->set_name ("ArdourContextMenu");
|
||||||
|
|
||||||
|
show_all_children();
|
||||||
|
|
||||||
|
return redirect_menu;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
RedirectBox::selection_changed ()
|
||||||
|
{
|
||||||
|
bool sensitive = (redirect_display.get_selection()->count_selected_rows()) ? true : false;
|
||||||
|
|
||||||
|
for (vector<Glib::RefPtr<Gtk::Action> >::iterator i = ActionManager::plugin_selection_sensitive_actions.begin(); i != ActionManager::plugin_selection_sensitive_actions.end(); ++i) {
|
||||||
|
(*i)->set_sensitive (sensitive);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gint
|
gint
|
||||||
RedirectBox::redirect_menu_map_handler (GdkEventAny *ev)
|
RedirectBox::redirect_menu_map_handler (GdkEventAny *ev)
|
||||||
{
|
{
|
||||||
bool sensitive = (redirect_display.get_selection()->count_selected_rows()) ? true : false;
|
|
||||||
|
|
||||||
for (vector<Glib::RefPtr<Gtk::Action> >::iterator i = selection_dependent_items.begin(); i != selection_dependent_items.end(); ++i) {
|
|
||||||
(*i)->set_sensitive (sensitive);
|
|
||||||
}
|
|
||||||
|
|
||||||
popup_act_grp->get_action("paste")->set_sensitive (!_rr_selection.redirects.empty());
|
popup_act_grp->get_action("paste")->set_sensitive (!_rr_selection.redirects.empty());
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
@ -397,7 +401,9 @@ RedirectBox::deselect_all_redirects ()
|
||||||
void
|
void
|
||||||
RedirectBox::choose_plugin ()
|
RedirectBox::choose_plugin ()
|
||||||
{
|
{
|
||||||
show_plugin_selector();
|
sigc::connection newplug_connection = _plugin_selector.PluginCreated.connect (mem_fun(*this,&RedirectBox::insert_plugin_chosen));
|
||||||
|
_plugin_selector.run ();
|
||||||
|
newplug_connection.disconnect();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
@ -534,18 +540,6 @@ RedirectBox::send_io_finished (IOSelector::Result r, Redirect* redirect, IOSelec
|
||||||
delete_when_idle (ios);
|
delete_when_idle (ios);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
|
||||||
RedirectBox::disconnect_newplug ()
|
|
||||||
{
|
|
||||||
newplug_connection.disconnect();
|
|
||||||
}
|
|
||||||
void
|
|
||||||
RedirectBox::show_plugin_selector ()
|
|
||||||
{
|
|
||||||
newplug_connection = _plugin_selector.PluginCreated.connect (mem_fun(*this,&RedirectBox::insert_plugin_chosen));
|
|
||||||
_plugin_selector.show_all ();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
RedirectBox::redirects_changed (void *src)
|
RedirectBox::redirects_changed (void *src)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,8 @@ class RedirectBox : public Gtk::HBox
|
||||||
|
|
||||||
ModelColumns columns;
|
ModelColumns columns;
|
||||||
Glib::RefPtr<Gtk::ListStore> model;
|
Glib::RefPtr<Gtk::ListStore> model;
|
||||||
Glib::RefPtr<Gtk::TreeSelection> selection;
|
|
||||||
|
void selection_changed ();
|
||||||
|
|
||||||
Gtk::EventBox redirect_eventbox;
|
Gtk::EventBox redirect_eventbox;
|
||||||
Gtk::HBox redirect_hpacker;
|
Gtk::HBox redirect_hpacker;
|
||||||
|
|
@ -118,8 +119,6 @@ class RedirectBox : public Gtk::HBox
|
||||||
|
|
||||||
Width _width;
|
Width _width;
|
||||||
|
|
||||||
sigc::connection newplug_connection;
|
|
||||||
|
|
||||||
Gtk::Menu *send_action_menu;
|
Gtk::Menu *send_action_menu;
|
||||||
void build_send_action_menu ();
|
void build_send_action_menu ();
|
||||||
|
|
||||||
|
|
@ -129,7 +128,6 @@ class RedirectBox : public Gtk::HBox
|
||||||
Glib::RefPtr<Gtk::UIManager> popup_ui_mgr;
|
Glib::RefPtr<Gtk::UIManager> popup_ui_mgr;
|
||||||
Glib::RefPtr<Gtk::ActionGroup> popup_act_grp;
|
Glib::RefPtr<Gtk::ActionGroup> popup_act_grp;
|
||||||
Gtk::Menu *redirect_menu;
|
Gtk::Menu *redirect_menu;
|
||||||
vector<Glib::RefPtr<Gtk::Action> > selection_dependent_items;
|
|
||||||
gint redirect_menu_map_handler (GdkEventAny *ev);
|
gint redirect_menu_map_handler (GdkEventAny *ev);
|
||||||
Gtk::Menu * build_redirect_menu ();
|
Gtk::Menu * build_redirect_menu ();
|
||||||
void build_redirect_tooltip (Gtk::EventBox&, string);
|
void build_redirect_tooltip (Gtk::EventBox&, string);
|
||||||
|
|
@ -147,16 +145,10 @@ class RedirectBox : public Gtk::HBox
|
||||||
void show_redirect_name (void*, ARDOUR::Redirect *);
|
void show_redirect_name (void*, ARDOUR::Redirect *);
|
||||||
void add_redirect_to_display (ARDOUR::Redirect *);
|
void add_redirect_to_display (ARDOUR::Redirect *);
|
||||||
|
|
||||||
void show_plugin_selector ();
|
|
||||||
|
|
||||||
|
|
||||||
string redirect_name (ARDOUR::Redirect&);
|
string redirect_name (ARDOUR::Redirect&);
|
||||||
|
|
||||||
|
|
||||||
void remove_redirect_gui (ARDOUR::Redirect *);
|
void remove_redirect_gui (ARDOUR::Redirect *);
|
||||||
|
|
||||||
void disconnect_newplug();
|
|
||||||
|
|
||||||
void redirects_reordered (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&, int*);
|
void redirects_reordered (const Gtk::TreeModel::Path&, const Gtk::TreeModel::iterator&, int*);
|
||||||
gint compute_redirect_sort_keys ();
|
gint compute_redirect_sort_keys ();
|
||||||
vector<sigc::connection> redirect_active_connections;
|
vector<sigc::connection> redirect_active_connections;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue