mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 14:54:56 +01:00
come up and stay up
git-svn-id: svn://localhost/trunk/ardour2@138 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
14e3f7f215
commit
d6a27c9537
14 changed files with 375 additions and 171 deletions
|
|
@ -41,6 +41,7 @@ vector<RefPtr<Gtk::Action> > ActionManager::track_selection_sensitive_actions;
|
|||
vector<RefPtr<Gtk::Action> > ActionManager::plugin_selection_sensitive_actions;
|
||||
vector<RefPtr<Gtk::Action> > ActionManager::range_sensitive_actions;
|
||||
vector<RefPtr<Gtk::Action> > ActionManager::jack_sensitive_actions;
|
||||
vector<RefPtr<Gtk::Action> > ActionManager::jack_opposite_sensitive_actions;
|
||||
RefPtr<UIManager> ActionManager::ui_manager;
|
||||
string ActionManager::unbound_string = "--";
|
||||
|
||||
|
|
@ -194,3 +195,11 @@ ActionManager::get_action (ustring name)
|
|||
{
|
||||
return ui_manager->get_action (name);
|
||||
}
|
||||
|
||||
void
|
||||
ActionManager::set_sensitive (vector<RefPtr<Action> >& actions, bool state)
|
||||
{
|
||||
for (vector<RefPtr<Action> >::iterator i = actions.begin(); i != actions.end(); ++i) {
|
||||
(*i)->set_sensitive (state);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ class ActionManager
|
|||
static std::vector<Glib::RefPtr<Gtk::Action> > plugin_selection_sensitive_actions;
|
||||
static std::vector<Glib::RefPtr<Gtk::Action> > range_sensitive_actions;
|
||||
static std::vector<Glib::RefPtr<Gtk::Action> > jack_sensitive_actions;
|
||||
static std::vector<Glib::RefPtr<Gtk::Action> > jack_opposite_sensitive_actions;
|
||||
|
||||
static void set_sensitive (std::vector<Glib::RefPtr<Gtk::Action> >& actions, bool);
|
||||
|
||||
static std::string unbound_string; /* the key string returned if an action is not bound */
|
||||
static Glib::RefPtr<Gtk::UIManager> ui_manager;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,71 @@
|
|||
<ui>
|
||||
|
||||
<menubar name='Main'>
|
||||
</menubar>
|
||||
<popup name='ShuttleUnitsMenu'>
|
||||
<menuitem action='SetShuttleUnitsSemitones'/>
|
||||
<menuitem action='SetShuttleUnitsPercentage'/>
|
||||
</popup>
|
||||
|
||||
<popup name='ShuttleStyleMenu'>
|
||||
<menuitem action='SetShuttleActionSprung'/>
|
||||
<menuitem action='SetShuttleActionWheel'/>
|
||||
</popup>
|
||||
|
||||
<popup name='RegionListMenu'>
|
||||
<menuitem action='rlAudition'/>
|
||||
<menuitem action='rlHide'/>
|
||||
<menuitem action='rlRemove'/>
|
||||
<separator/>
|
||||
<menuitem action='rlShowAll'/>
|
||||
<separator/>
|
||||
<menuitem action='rlImportAudio'/>
|
||||
<menuitem action='rlEmbedAudio'/>
|
||||
</popup>
|
||||
|
||||
<menubar name='Main'>
|
||||
<menu action='Session'>
|
||||
<menuitem action='New'/>
|
||||
<menuitem action='Open'/>
|
||||
<menuitem action='Recent'/>
|
||||
<menuitem action='Close'/>
|
||||
<separator/>
|
||||
<menuitem action='AddTrackBus'/>
|
||||
<separator/>
|
||||
<menu action='Export'>
|
||||
<menuitem action='ExportSession'/>
|
||||
<menuitem action='ExportRange'/>
|
||||
</menu>
|
||||
<separator/>
|
||||
<menu name='Cleanup'>
|
||||
<menuitem action='CleanupUnused'/>
|
||||
<menuitem action='FlushWastebasket'/>
|
||||
</menu>
|
||||
<separator/>
|
||||
<menuitem action='Quit'/>
|
||||
</menu>
|
||||
<menu name='JACK'>
|
||||
<menuitem action='Disconnect'/>
|
||||
<menuitem action='Connect'/>
|
||||
<menu name='Latency'>
|
||||
<menuitem action='JACKLatency32'/>
|
||||
<menuitem action='JACKLatency64'/>
|
||||
<menuitem action='JACKLatency128'/>
|
||||
<menuitem action='JACKLatency256'/>
|
||||
<menuitem action='JACKLatency512'/>
|
||||
<menuitem action='JACKLatency1024'/>
|
||||
<menuitem action='JACKLatency2048'/>
|
||||
<menuitem action='JACKLatency4096'/>
|
||||
<menuitem action='JACKLatency8192'/>
|
||||
</menu>
|
||||
</menu>
|
||||
<menu name='Windows'>
|
||||
<menuitem action='GotoEditor'/>
|
||||
<menuitem action='GotoMixer'/>
|
||||
<menuitem action='ToggleOptionsEditor'/>
|
||||
<menuitem action='ToggleAudioLibrary'/>
|
||||
<menuitem action='ToggleConnections'/>
|
||||
<menuitem action='ToggleLocations'/>
|
||||
<menuitem action='ToggleBigClock'/>
|
||||
<menuitem action='ToggleAbout'/>
|
||||
</menu>
|
||||
</menubar>
|
||||
</ui>
|
||||
|
|
|
|||
|
|
@ -866,17 +866,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
|||
set_shuttle_units (Percentage);
|
||||
set_shuttle_behaviour (Sprung);
|
||||
|
||||
Glib::RefPtr<ActionGroup> shuttle_actions = ActionGroup::create ("ShuttleActions");
|
||||
|
||||
shuttle_actions->add (Action::create (X_("SetShuttleUnitsPercentage"), _("Percentage")), bind (mem_fun(*this, &ARDOUR_UI::set_shuttle_units), Percentage));
|
||||
shuttle_actions->add (Action::create (X_("SetShuttleUnitsSemitones"), _("Semitones")), bind (mem_fun(*this, &ARDOUR_UI::set_shuttle_units), Semitones));
|
||||
shuttle_actions->add (Action::create (X_("SetShuttleActionSprung"), _("Sprung")), bind (mem_fun(*this, &ARDOUR_UI::set_shuttle_behaviour), Sprung));
|
||||
shuttle_actions->add (Action::create (X_("SetShuttleActionWheel"), _("Wheel")), bind (mem_fun(*this, &ARDOUR_UI::set_shuttle_behaviour), Wheel));
|
||||
|
||||
ActionManager::add_action_group (shuttle_actions);
|
||||
|
||||
shuttle_style_menu = dynamic_cast<Menu*> (ActionManager::get_widget ("ShuttleStylePopup"));
|
||||
shuttle_unit_menu = dynamic_cast<Menu*> (ActionManager::get_widget ("ShuttleUnitPopup"));
|
||||
shuttle_style_menu = 0;
|
||||
shuttle_unit_menu = 0;
|
||||
|
||||
gettimeofday (&last_peak_grab, 0);
|
||||
gettimeofday (&last_shuttle_request, 0);
|
||||
|
|
@ -2209,10 +2200,8 @@ void
|
|||
ARDOUR_UI::engine_stopped ()
|
||||
{
|
||||
ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::engine_stopped));
|
||||
|
||||
jack_disconnect_item->set_sensitive (false);
|
||||
jack_reconnect_item->set_sensitive (true);
|
||||
jack_bufsize_menu->set_sensitive (false);
|
||||
ActionManager::set_sensitive (ActionManager::jack_sensitive_actions, false);
|
||||
ActionManager::set_sensitive (ActionManager::jack_opposite_sensitive_actions, true);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -2220,10 +2209,8 @@ void
|
|||
ARDOUR_UI::engine_running ()
|
||||
{
|
||||
ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::engine_running));
|
||||
|
||||
jack_disconnect_item->set_sensitive (true);
|
||||
jack_reconnect_item->set_sensitive (false);
|
||||
jack_bufsize_menu->set_sensitive (true);
|
||||
ActionManager::set_sensitive (ActionManager::jack_sensitive_actions, true);
|
||||
ActionManager::set_sensitive (ActionManager::jack_opposite_sensitive_actions, false);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -2231,9 +2218,8 @@ ARDOUR_UI::engine_halted ()
|
|||
{
|
||||
ENSURE_GUI_THREAD (mem_fun(*this, &ARDOUR_UI::engine_halted));
|
||||
|
||||
jack_disconnect_item->set_sensitive (false);
|
||||
jack_reconnect_item->set_sensitive (true);
|
||||
jack_bufsize_menu->set_sensitive (false);
|
||||
ActionManager::set_sensitive (ActionManager::jack_sensitive_actions, false);
|
||||
ActionManager::set_sensitive (ActionManager::jack_opposite_sensitive_actions, true);
|
||||
|
||||
update_sample_rate (0);
|
||||
|
||||
|
|
|
|||
|
|
@ -480,32 +480,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
|||
void build_menu_bar ();
|
||||
void pack_toplevel_controls();
|
||||
|
||||
/* handles on the menu bar items that need to
|
||||
be sensitive to whether or not we have
|
||||
a session loaded.
|
||||
*/
|
||||
|
||||
Gtk::MenuItem *add_track_item;
|
||||
Gtk::MenuItem *save_item;
|
||||
Gtk::MenuItem *snapshot_item;
|
||||
Gtk::MenuItem *save_as_item;
|
||||
Gtk::MenuItem *save_template_item;
|
||||
Gtk::MenuItem *export_item;
|
||||
Gtk::MenuItem *close_item;
|
||||
|
||||
Gtk::CheckMenuItem *connection_editor_check;
|
||||
Gtk::CheckMenuItem *route_params_check;
|
||||
Gtk::CheckMenuItem *locations_dialog_check;
|
||||
Gtk::CheckMenuItem *big_clock_check;
|
||||
Gtk::CheckMenuItem *tempo_editor_check;
|
||||
Gtk::CheckMenuItem *sfdb_check;
|
||||
Gtk::CheckMenuItem *options_window_check;
|
||||
|
||||
/* <CMT Additions> */
|
||||
Gtk::MenuItem *image_compositor_item ;
|
||||
/* </CMT Additions> */
|
||||
|
||||
|
||||
Gtk::Label wall_clock_label;
|
||||
Gtk::EventBox wall_clock_box;
|
||||
gint update_wall_clock ();
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include "ardour_ui.h"
|
||||
#include "public_editor.h"
|
||||
#include "audio_clock.h"
|
||||
#include "actions.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
|
@ -692,12 +693,18 @@ ARDOUR_UI::shuttle_box_expose (GdkEventExpose* event)
|
|||
void
|
||||
ARDOUR_UI::shuttle_style_clicked ()
|
||||
{
|
||||
if (shuttle_style_menu == 0) {
|
||||
shuttle_style_menu = dynamic_cast<Menu*> (ActionManager::get_widget ("ShuttleStylePopup"));
|
||||
}
|
||||
shuttle_style_menu->popup (1, 0);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::shuttle_unit_clicked ()
|
||||
{
|
||||
if (shuttle_unit_menu == 0) {
|
||||
shuttle_unit_menu = dynamic_cast<Menu*> (ActionManager::get_widget ("ShuttleUnitPopup"));
|
||||
}
|
||||
shuttle_unit_menu->popup (1, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -58,8 +58,9 @@ ARDOUR_UI::we_have_dependents ()
|
|||
void
|
||||
ARDOUR_UI::setup_keybindings ()
|
||||
{
|
||||
// GTK2FIX
|
||||
install_actions ();
|
||||
editor->register_actions ();
|
||||
RedirectBox::register_actions ();
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
#include "public_editor.h"
|
||||
#include "route_params_ui.h"
|
||||
#include "sfdb_ui.h"
|
||||
#include "actions.h"
|
||||
|
||||
#include "i18n.h"
|
||||
|
||||
|
|
@ -49,37 +50,11 @@ ARDOUR_UI::connect_to_session (Session *s)
|
|||
|
||||
/* sensitize menu bar options that are now valid */
|
||||
|
||||
// save_as_item->set_sensitive (true);
|
||||
save_template_item->set_sensitive (true);
|
||||
snapshot_item->set_sensitive (true);
|
||||
save_item->set_sensitive (true);
|
||||
add_track_item->set_sensitive (true);
|
||||
export_item->set_sensitive (true);
|
||||
close_item->set_sensitive (true);
|
||||
locations_dialog_check->set_sensitive (true);
|
||||
route_params_check->set_sensitive (true);
|
||||
connection_editor_check->set_sensitive (true);
|
||||
ActionManager::set_sensitive (ActionManager::session_sensitive_actions, true);
|
||||
|
||||
cleanup_item->set_sensitive (true);
|
||||
|
||||
/* sensitize transport bar */
|
||||
|
||||
goto_start_button.set_sensitive (true);
|
||||
goto_end_button.set_sensitive (true);
|
||||
roll_button.set_sensitive (true);
|
||||
stop_button.set_sensitive (true);
|
||||
play_selection_button.set_sensitive (true);
|
||||
rec_button.set_sensitive (true);
|
||||
auto_loop_button.set_sensitive (true);
|
||||
shuttle_box.set_sensitive (true);
|
||||
|
||||
/* <CMT Additions> */
|
||||
if (image_compositor_item) {
|
||||
image_compositor_item->set_sensitive(true) ;
|
||||
}
|
||||
/* </CMT Additions> */
|
||||
|
||||
|
||||
if (session->n_diskstreams() == 0) {
|
||||
session->DiskStreamAdded.connect (mem_fun(*this, &ARDOUR_UI::diskstream_added));
|
||||
}
|
||||
|
|
@ -166,30 +141,9 @@ ARDOUR_UI::unload_session ()
|
|||
point_one_second_connection.disconnect ();
|
||||
point_zero_one_second_connection.disconnect();
|
||||
|
||||
/* desensitize menu bar options that are now invalid */
|
||||
ActionManager::set_sensitive (ActionManager::session_sensitive_actions, false);
|
||||
|
||||
// save_as_item->set_sensitive (false);
|
||||
save_template_item->set_sensitive (false);
|
||||
snapshot_item->set_sensitive (false);
|
||||
save_item->set_sensitive (false);
|
||||
add_track_item->set_sensitive (false);
|
||||
export_item->set_sensitive (false);
|
||||
close_item->set_sensitive (false);
|
||||
connection_editor_check->set_sensitive (false);
|
||||
locations_dialog_check->set_sensitive (false);
|
||||
connection_editor_check->set_active(false);
|
||||
locations_dialog_check->set_active(false);
|
||||
route_params_check->set_sensitive (false);
|
||||
|
||||
/* desensitize transport bar */
|
||||
|
||||
goto_start_button.set_sensitive (false);
|
||||
goto_end_button.set_sensitive (false);
|
||||
roll_button.set_sensitive (false);
|
||||
stop_button.set_sensitive (false);
|
||||
play_selection_button.set_sensitive (false);
|
||||
rec_button.set_sensitive (false);
|
||||
auto_loop_button.set_sensitive (false);
|
||||
shuttle_box.set_sensitive (false);
|
||||
|
||||
stop_blinking ();
|
||||
|
|
@ -266,7 +220,8 @@ ARDOUR_UI::connection_editor_hiding()
|
|||
void
|
||||
ARDOUR_UI::big_clock_hiding()
|
||||
{
|
||||
big_clock_check->set_active(false);
|
||||
// GTK2FIX
|
||||
// big_clock_check->set_active(false);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -298,7 +253,8 @@ ARDOUR_UI::toggle_options_window ()
|
|||
void
|
||||
ARDOUR_UI::option_hiding ()
|
||||
{
|
||||
options_window_check->set_active(false);
|
||||
// GTK2FIX
|
||||
// options_window_check->set_active(false);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -338,7 +294,8 @@ ARDOUR_UI::toggle_location_window ()
|
|||
void
|
||||
ARDOUR_UI::location_ui_hiding()
|
||||
{
|
||||
locations_dialog_check->set_active(false);
|
||||
// GTK2FIX
|
||||
// locations_dialog_check->set_active(false);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
@ -369,18 +326,20 @@ ARDOUR_UI::toggle_route_params_window ()
|
|||
void
|
||||
ARDOUR_UI::route_params_hiding ()
|
||||
{
|
||||
route_params_check->set_active (false);
|
||||
// GTK2FIX
|
||||
// route_params_check->set_active (false);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_sound_file_browser ()
|
||||
{
|
||||
if (sfdb_check->get_active()) {
|
||||
SoundFileBrowser sfdb(_("Sound File Browser"));
|
||||
// GTK2FIX
|
||||
// if (sfdb_check->get_active()) {
|
||||
// SoundFileBrowser sfdb(_("Sound File Browser"));
|
||||
|
||||
sfdb_check->signal_toggled().connect (bind (mem_fun (sfdb, &Gtk::Dialog::response), Gtk::RESPONSE_CANCEL));
|
||||
sfdb.run();
|
||||
sfdb_check->set_active(false);
|
||||
}
|
||||
// sfdb_check->signal_toggled().connect (bind (mem_fun (sfdb, &Gtk::Dialog::response), Gtk::RESPONSE_CANCEL));
|
||||
// sfdb.run();
|
||||
// sfdb_check->set_active(false);
|
||||
// }
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,9 +112,10 @@ ARDOUR_UI::install_actions ()
|
|||
|
||||
Glib::RefPtr<ActionGroup> jack_actions = ActionGroup::create (X_("JACK"));
|
||||
|
||||
act = ActionManager::register_action (jack_actions, X_("JACKDisconnect"), _("Disconnect"), mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::disconnect_from_jack));
|
||||
ActionManager::jack_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (jack_actions, X_("JACKReconnect"), _("Reconnect"), mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::reconnect_to_jack));
|
||||
ActionManager::jack_opposite_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_action (jack_actions, X_("JACKDisconnect"), _("Disconnect"), mem_fun (*(ARDOUR_UI::instance()), &ARDOUR_UI::disconnect_from_jack));
|
||||
ActionManager::jack_sensitive_actions.push_back (act);
|
||||
|
||||
RadioAction::Group jack_latency_group;
|
||||
|
|
@ -269,6 +270,14 @@ ARDOUR_UI::install_actions ()
|
|||
act = ActionManager::register_action (common_actions, X_("ToggleRecordEnableTrack32"), _("toggle record enable track32"), bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 31U));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
Glib::RefPtr<ActionGroup> shuttle_actions = ActionGroup::create ("ShuttleActions");
|
||||
|
||||
shuttle_actions->add (Action::create (X_("SetShuttleUnitsPercentage"), _("Percentage")), bind (mem_fun(*this, &ARDOUR_UI::set_shuttle_units), Percentage));
|
||||
shuttle_actions->add (Action::create (X_("SetShuttleUnitsSemitones"), _("Semitones")), bind (mem_fun(*this, &ARDOUR_UI::set_shuttle_units), Semitones));
|
||||
shuttle_actions->add (Action::create (X_("SetShuttleActionSprung"), _("Sprung")), bind (mem_fun(*this, &ARDOUR_UI::set_shuttle_behaviour), Sprung));
|
||||
shuttle_actions->add (Action::create (X_("SetShuttleActionWheel"), _("Wheel")), bind (mem_fun(*this, &ARDOUR_UI::set_shuttle_behaviour), Wheel));
|
||||
|
||||
ActionManager::add_action_group (shuttle_actions);
|
||||
ActionManager::add_action_group (jack_actions);
|
||||
ActionManager::add_action_group (main_actions);
|
||||
ActionManager::add_action_group (common_actions);
|
||||
|
|
|
|||
|
|
@ -1634,13 +1634,6 @@ Editor::connect_to_session (Session *t)
|
|||
route_list_reordered ();
|
||||
//route_list.thaw ();
|
||||
|
||||
if (embed_audio_item) {
|
||||
embed_audio_item->set_sensitive (true);
|
||||
}
|
||||
if (import_audio_item) {
|
||||
import_audio_item->set_sensitive (true);
|
||||
}
|
||||
|
||||
for (TrackViewList::iterator i = track_views.begin(); i != track_views.end(); ++i) {
|
||||
(static_cast<TimeAxisView*>(*i))->set_samples_per_unit (frames_per_unit);
|
||||
}
|
||||
|
|
@ -1858,16 +1851,20 @@ Editor::popup_track_context_menu (int button, int32_t time, ItemType item_type,
|
|||
if (!with_selection) {
|
||||
if (region_edit_menu_split_item) {
|
||||
if (clicked_regionview && clicked_regionview->region.covers (edit_cursor->current_frame)) {
|
||||
region_edit_menu_split_item->set_sensitive (true);
|
||||
// GTK2FIX find the action, change its sensitivity
|
||||
// region_edit_menu_split_item->set_sensitive (true);
|
||||
} else {
|
||||
region_edit_menu_split_item->set_sensitive (false);
|
||||
// GTK2FIX see above
|
||||
// region_edit_menu_split_item->set_sensitive (false);
|
||||
}
|
||||
}
|
||||
if (region_edit_menu_split_multichannel_item) {
|
||||
if (clicked_regionview && clicked_regionview->region.n_channels() > 1) {
|
||||
region_edit_menu_split_multichannel_item->set_sensitive (true);
|
||||
// GTK2FIX find the action, change its sensitivity
|
||||
// region_edit_menu_split_multichannel_item->set_sensitive (true);
|
||||
} else {
|
||||
region_edit_menu_split_multichannel_item->set_sensitive (false);
|
||||
// GTK2FIX see above
|
||||
// region_edit_menu_split_multichannel_item->set_sensitive (false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -392,8 +392,8 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
|
|||
build_marker_menu ();
|
||||
}
|
||||
|
||||
Menu_Helpers::MenuList & children = marker_menu->items();
|
||||
// XXX: should really find this some other way
|
||||
// GTK2FIX use action group sensitivity
|
||||
#ifdef GTK2FIX
|
||||
if (children.size() >= 3) {
|
||||
MenuItem * loopitem = &children[2];
|
||||
if (loopitem) {
|
||||
|
|
@ -405,7 +405,7 @@ Editor::marker_context_menu (GdkEventButton* ev, ArdourCanvas::Item* item)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
marker_menu_item = item;
|
||||
marker_menu->popup (1, ev->time);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -288,14 +288,6 @@ Editor::session_going_away ()
|
|||
current_bbt_points = 0;
|
||||
}
|
||||
|
||||
if (embed_audio_item) {
|
||||
embed_audio_item->set_sensitive (false);
|
||||
}
|
||||
|
||||
if (import_audio_item) {
|
||||
import_audio_item->set_sensitive (false);
|
||||
}
|
||||
|
||||
/* mixer strip will be deleted all by itself
|
||||
when its route is deleted.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ using namespace Gtk;
|
|||
using namespace Glib;
|
||||
using namespace Gtkmm2ext;
|
||||
|
||||
RedirectBox* RedirectBox::_current_redirect_box = 0;
|
||||
|
||||
|
||||
RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelector &plugsel,
|
||||
RouteRedirectSelection & rsel, bool owner_is_mixer)
|
||||
|
|
@ -113,6 +115,9 @@ RedirectBox::RedirectBox (Placement pcmnt, Session& sess, Route& rt, PluginSelec
|
|||
|
||||
_route.redirects_changed.connect (mem_fun(*this, &RedirectBox::redirects_changed));
|
||||
|
||||
redirect_eventbox.signal_enter_notify_event().connect (bind (sigc::ptr_fun (RedirectBox::enter_box), this));
|
||||
redirect_eventbox.signal_leave_notify_event().connect (bind (sigc::ptr_fun (RedirectBox::leave_box), this));
|
||||
|
||||
redirect_display.signal_button_press_event().connect (mem_fun(*this, &RedirectBox::redirect_button));
|
||||
redirect_display.signal_button_release_event().connect (mem_fun(*this, &RedirectBox::redirect_button));
|
||||
|
||||
|
|
@ -326,40 +331,6 @@ RedirectBox::redirect_button (GdkEventButton *ev)
|
|||
Menu *
|
||||
RedirectBox::build_redirect_menu ()
|
||||
{
|
||||
popup_act_grp = Gtk::ActionGroup::create(X_("redirectmenu"));
|
||||
Glib::RefPtr<Action> act;
|
||||
|
||||
/* 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));
|
||||
|
||||
/* standard editing stuff */
|
||||
act = ActionManager::register_action (popup_act_grp, X_("cut"), _("Cut"), mem_fun(*this, &RedirectBox::cut_redirects));
|
||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||
act = ActionManager::register_action (popup_act_grp, X_("copy"), _("Copy"), mem_fun(*this, &RedirectBox::copy_redirects));
|
||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||
ActionManager::ActionManager::register_action (popup_act_grp, X_("paste"), _("Paste"), mem_fun(*this, &RedirectBox::paste_redirects));
|
||||
act = ActionManager::register_action (popup_act_grp, X_("rename"), _("Rename"), mem_fun(*this, &RedirectBox::rename_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 */
|
||||
act = ActionManager::register_action (popup_act_grp, X_("activate"), _("Activate"), bind (mem_fun(*this, &RedirectBox::for_selected_redirects), &RedirectBox::activate_redirect));
|
||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||
act = ActionManager::register_action (popup_act_grp, X_("deactivate"), _("Deactivate"), bind (mem_fun(*this, &RedirectBox::for_selected_redirects), &RedirectBox::deactivate_redirect));
|
||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||
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 */
|
||||
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);
|
||||
|
||||
ActionManager::add_action_group (popup_act_grp);
|
||||
|
||||
redirect_menu = dynamic_cast<Gtk::Menu*>(ActionManager::get_widget("/redirectmenu") );
|
||||
redirect_menu->signal_map_event().connect (mem_fun(*this, &RedirectBox::redirect_menu_map_handler));
|
||||
redirect_menu->set_name ("ArdourContextMenu");
|
||||
|
|
@ -382,7 +353,8 @@ RedirectBox::selection_changed ()
|
|||
gint
|
||||
RedirectBox::redirect_menu_map_handler (GdkEventAny *ev)
|
||||
{
|
||||
popup_act_grp->get_action("paste")->set_sensitive (!_rr_selection.redirects.empty());
|
||||
// GTK2FIX
|
||||
// popup_act_grp->get_action("paste")->set_sensitive (!_rr_selection.redirects.empty());
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
|
@ -1094,4 +1066,215 @@ RedirectBox::edit_redirect (Redirect* redirect)
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
RedirectBox::enter_box (GdkEventCrossing *ev, RedirectBox* rb)
|
||||
{
|
||||
switch (ev->detail) {
|
||||
case GDK_NOTIFY_INFERIOR:
|
||||
break;
|
||||
|
||||
case GDK_NOTIFY_VIRTUAL:
|
||||
/* fallthru */
|
||||
|
||||
default:
|
||||
_current_redirect_box = rb;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
RedirectBox::leave_box (GdkEventCrossing *ev, RedirectBox* rb)
|
||||
{
|
||||
switch (ev->detail) {
|
||||
case GDK_NOTIFY_INFERIOR:
|
||||
break;
|
||||
|
||||
case GDK_NOTIFY_VIRTUAL:
|
||||
/* fallthru */
|
||||
default:
|
||||
_current_redirect_box = 0;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::register_actions ()
|
||||
{
|
||||
Glib::RefPtr<Gtk::ActionGroup> popup_act_grp = Gtk::ActionGroup::create(X_("redirectmenu"));
|
||||
Glib::RefPtr<Action> act;
|
||||
|
||||
/* new stuff */
|
||||
ActionManager::register_action (popup_act_grp, X_("newplugin"), _("New Plugin ..."), sigc::ptr_fun (RedirectBox::rb_choose_plugin));
|
||||
ActionManager::register_action (popup_act_grp, X_("newinsert"), _("New Insert"), sigc::ptr_fun (RedirectBox::rb_choose_insert));
|
||||
ActionManager::register_action (popup_act_grp, X_("newsend"), _("New Send ..."), sigc::ptr_fun (RedirectBox::rb_choose_send));
|
||||
ActionManager::register_action (popup_act_grp, X_("clear"), _("Clear"), sigc::ptr_fun (RedirectBox::rb_clear));
|
||||
|
||||
/* standard editing stuff */
|
||||
act = ActionManager::register_action (popup_act_grp, X_("cut"), _("Cut"), sigc::ptr_fun (RedirectBox::rb_cut));
|
||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||
act = ActionManager::register_action (popup_act_grp, X_("copy"), _("Copy"), sigc::ptr_fun (RedirectBox::rb_copy));
|
||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||
ActionManager::ActionManager::register_action (popup_act_grp, X_("paste"), _("Paste"), sigc::ptr_fun (RedirectBox::rb_paste));
|
||||
act = ActionManager::register_action (popup_act_grp, X_("rename"), _("Rename"), sigc::ptr_fun (RedirectBox::rb_rename));
|
||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||
ActionManager::register_action (popup_act_grp, X_("selectall"), _("Select All"), sigc::ptr_fun (RedirectBox::rb_select_all));
|
||||
ActionManager::register_action (popup_act_grp, X_("deselectall"), _("Deselect All"), sigc::ptr_fun (RedirectBox::rb_deselect_all));
|
||||
|
||||
/* activation */
|
||||
act = ActionManager::register_action (popup_act_grp, X_("activate"), _("Activate"), sigc::ptr_fun (RedirectBox::rb_activate));
|
||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||
act = ActionManager::register_action (popup_act_grp, X_("deactivate"), _("Deactivate"), sigc::ptr_fun (RedirectBox::rb_deactivate));
|
||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||
ActionManager::register_action (popup_act_grp, X_("activate_all"), _("Activate all"), sigc::ptr_fun (RedirectBox::rb_activate_all));
|
||||
ActionManager::register_action (popup_act_grp, X_("deactivate_all"), _("Deactivate all"), sigc::ptr_fun (RedirectBox::rb_deactivate_all));
|
||||
|
||||
/* show editors */
|
||||
act = ActionManager::register_action (popup_act_grp, X_("edit"), _("Edit"), sigc::ptr_fun (RedirectBox::rb_edit));
|
||||
ActionManager::plugin_selection_sensitive_actions.push_back(act);
|
||||
|
||||
ActionManager::add_action_group (popup_act_grp);
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_choose_plugin ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
_current_redirect_box->choose_plugin ();
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_choose_insert ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
_current_redirect_box->choose_insert ();
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_choose_send ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
_current_redirect_box->choose_send ();
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_clear ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_current_redirect_box->clear_redirects ();
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_cut ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_current_redirect_box->cut_redirects ();
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_copy ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
_current_redirect_box->copy_redirects ();
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_paste ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_rename ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
_current_redirect_box->rename_redirects ();
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_select_all ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_current_redirect_box->select_all_redirects ();
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_deselect_all ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_current_redirect_box->deselect_all_redirects ();
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_activate ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_current_redirect_box->for_selected_redirects (&RedirectBox::activate_redirect);
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_deactivate ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
_current_redirect_box->for_selected_redirects (&RedirectBox::deactivate_redirect);
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_activate_all ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_current_redirect_box->all_redirects_active (true);
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_deactivate_all ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
_current_redirect_box->all_redirects_active (false);
|
||||
}
|
||||
|
||||
void
|
||||
RedirectBox::rb_edit ()
|
||||
{
|
||||
if (_current_redirect_box == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
_current_redirect_box->for_selected_redirects (&RedirectBox::edit_redirect);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -83,6 +83,8 @@ class RedirectBox : public Gtk::HBox
|
|||
sigc::signal<void,ARDOUR::Redirect *> RedirectSelected;
|
||||
sigc::signal<void,ARDOUR::Redirect *> RedirectUnselected;
|
||||
|
||||
static void register_actions();
|
||||
|
||||
protected:
|
||||
void set_stuff_from_route ();
|
||||
|
||||
|
|
@ -125,8 +127,6 @@ class RedirectBox : public Gtk::HBox
|
|||
void new_send ();
|
||||
void show_send_controls ();
|
||||
|
||||
Glib::RefPtr<Gtk::UIManager> popup_ui_mgr;
|
||||
Glib::RefPtr<Gtk::ActionGroup> popup_act_grp;
|
||||
Gtk::Menu *redirect_menu;
|
||||
gint redirect_menu_map_handler (GdkEventAny *ev);
|
||||
Gtk::Menu * build_redirect_menu ();
|
||||
|
|
@ -182,6 +182,25 @@ class RedirectBox : public Gtk::HBox
|
|||
|
||||
void wierd_plugin_dialog (ARDOUR::Plugin& p, uint32_t streams, ARDOUR::IO& io);
|
||||
|
||||
static RedirectBox* _current_redirect_box;
|
||||
static bool enter_box (GdkEventCrossing*, RedirectBox*);
|
||||
static bool leave_box (GdkEventCrossing*, RedirectBox*);
|
||||
|
||||
static void rb_choose_plugin ();
|
||||
static void rb_choose_insert ();
|
||||
static void rb_choose_send ();
|
||||
static void rb_clear ();
|
||||
static void rb_cut ();
|
||||
static void rb_copy ();
|
||||
static void rb_paste ();
|
||||
static void rb_rename ();
|
||||
static void rb_select_all ();
|
||||
static void rb_deselect_all ();
|
||||
static void rb_activate ();
|
||||
static void rb_deactivate ();
|
||||
static void rb_activate_all ();
|
||||
static void rb_deactivate_all ();
|
||||
static void rb_edit ();
|
||||
};
|
||||
|
||||
#endif /* __ardour_gtk_redirect_box__ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue