many options moved to menus, region list context menu sort of operational
git-svn-id: svn://localhost/trunk/ardour2@219 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -68,6 +68,7 @@ ardour_ui_dependents.cc
|
||||
ardour_ui_dialogs.cc
|
||||
ardour_ui_ed.cc
|
||||
ardour_ui_mixer.cc
|
||||
ardour_ui_options.cc
|
||||
audio_clock.cc
|
||||
audio_time_axis.cc
|
||||
automation_gain_line.cc
|
||||
|
||||
@@ -57,6 +57,8 @@
|
||||
<menuitem action='set-playhead'/>
|
||||
<menuitem action='audition-at-mouse'/>
|
||||
<menuitem action='brush-at-mouse'/>
|
||||
<separator/>
|
||||
<menuitem action='ToggleFollowPlayhead'/>
|
||||
</menu>
|
||||
<menu name='Edit' action='Edit'>
|
||||
<menuitem action='undo'/>
|
||||
@@ -125,6 +127,37 @@
|
||||
<menuitem action='ToggleLocations'/>
|
||||
<menuitem action='ToggleBigClock'/>
|
||||
</menu>
|
||||
<menu name='Options' action='Options'>
|
||||
<menuitem action='SendMTC'/>
|
||||
<menuitem action='SendMMC'/>
|
||||
<menuitem action='UseMMC'/>
|
||||
<menuitem action='SendMIDIfeedback'/>
|
||||
<menuitem action='UseMIDIcontrol'/>
|
||||
<separator/>
|
||||
<menuitem action='AutoConnectNewTrackInputsToHardware'/>
|
||||
<menuitem action='AutoConnectNewTrackOutputsToHardware'/>
|
||||
<menuitem action='AutoConnectNewTrackOutputsToHardware'/>
|
||||
<menuitem action='ManuallyConnectNewTrackOutputs'/>
|
||||
<separator/>
|
||||
<menuitem action='UseHardwareMonitoring'/>
|
||||
<menuitem action='UseSoftwareMonitoring'/>
|
||||
<menuitem action='UseExternalMonitoring'/>
|
||||
<separator/>
|
||||
<menuitem action='StopPluginsWithTransport'/>
|
||||
<menuitem action='RunPluginsWhileRecording'/>
|
||||
<separator/>
|
||||
<menuitem action='VerifyRemoveLastCapture'/>
|
||||
<menuitem action='StopRecordingOnXrun'/>
|
||||
<menuitem action='StopTransportAtEndOfSession'/>
|
||||
<menuitem action='GainReduceFastTransport'/>
|
||||
<separator/>
|
||||
<menuitem action='LatchedSolo'/>
|
||||
<menuitem action='SoloInPlace'/>
|
||||
<menuitem action='SoloViaBus'/>
|
||||
<separator/>
|
||||
<menuitem action='AutomaticallyCreateCrossfades'/>
|
||||
<menuitem action='UnmuteNewFullCrossfades'/>
|
||||
</menu>
|
||||
</menubar>
|
||||
|
||||
<popup name='redirectmenu'>
|
||||
@@ -157,4 +190,29 @@
|
||||
<menuitem action='SetShuttleUnitsSemitones'/>
|
||||
</popup>
|
||||
|
||||
<popup name='RegionListMenu'>
|
||||
<menuitem action='rlAudition'/>
|
||||
<menuitem action='rlHide'/>
|
||||
<menuitem action='rlRemove'/>
|
||||
<separator/>
|
||||
<menuitem action='rlShowAll'/>
|
||||
<menu name='Sort' action='RegionListSort'>
|
||||
<menuitem action='SortAscending'/>
|
||||
<menuitem action='SortDescending'/>
|
||||
<separator/>
|
||||
<menuitem action='SortByRegionName'/>
|
||||
<menuitem action='SortByRegionLength'/>
|
||||
<menuitem action='SortByRegionPosition'/>
|
||||
<menuitem action='SortByRegionTimestamp'/>
|
||||
<menuitem action='SortByRegionStartinFile'/>
|
||||
<menuitem action='SortByRegionEndinFile'/>
|
||||
<menuitem action='SortBySourceFileName'/>
|
||||
<menuitem action='SortBySourceFileLength'/>
|
||||
<menuitem action='SortBySourceFileCreationDate'/>
|
||||
<menuitem action='SortBySourceFilesystem'/>
|
||||
</menu>
|
||||
<separator/>
|
||||
<menuitem action='rlEmbedAudio'/>
|
||||
<menuitem action='rlImportAudio'/>
|
||||
</popup>
|
||||
</ui>
|
||||
|
||||
@@ -803,6 +803,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
||||
|
||||
/* transport */
|
||||
|
||||
time_master_button (_("time\nmaster")),
|
||||
|
||||
shuttle_units_button (_("% ")),
|
||||
|
||||
punch_in_button (_("punch\nin")),
|
||||
@@ -811,7 +813,6 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], string rcfile)
|
||||
auto_play_button (_("auto\nplay")),
|
||||
auto_input_button (_("auto\ninput")),
|
||||
click_button (_("click")),
|
||||
follow_button (_("follow\nPH")),
|
||||
auditioning_alert_button (_("AUDITIONING")),
|
||||
solo_alert_button (_("SOLO")),
|
||||
shown_flag (false)
|
||||
@@ -1369,34 +1370,6 @@ ARDOUR_UI::toggle_click ()
|
||||
&Session::set_clicking);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::follow_changed ()
|
||||
{
|
||||
bool x;
|
||||
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (follow_button.get_active() != (x = editor->follow_playhead())) {
|
||||
follow_button.set_active (x);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_follow ()
|
||||
{
|
||||
bool x;
|
||||
|
||||
if (!editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (editor->follow_playhead() != (x = follow_button.get_active())) {
|
||||
editor->set_follow_playhead (x);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_session_auto_loop ()
|
||||
{
|
||||
|
||||
@@ -212,7 +212,6 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||
void toggle_punch_out ();
|
||||
void toggle_auto_return ();
|
||||
void toggle_click ();
|
||||
void toggle_follow ();
|
||||
|
||||
void toggle_session_auto_loop ();
|
||||
void toggle_session_punch_in ();
|
||||
@@ -366,6 +365,12 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||
|
||||
Gtkmm2ext::StatefulButton rec_button;
|
||||
|
||||
Gtk::ToggleButton time_master_button;
|
||||
Gtk::ComboBoxText sync_option_combo;
|
||||
|
||||
void sync_option_changed ();
|
||||
void toggle_time_master ();
|
||||
|
||||
enum ShuttleBehaviour {
|
||||
Sprung,
|
||||
Wheel
|
||||
@@ -408,14 +413,11 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||
Gtk::ToggleButton auto_play_button;
|
||||
Gtk::ToggleButton auto_input_button;
|
||||
Gtk::ToggleButton click_button;
|
||||
Gtk::ToggleButton follow_button;
|
||||
Gtk::ToggleButton auditioning_alert_button;
|
||||
Gtk::ToggleButton solo_alert_button;
|
||||
|
||||
Gtk::VBox alert_box;
|
||||
|
||||
void follow_changed ();
|
||||
|
||||
void solo_blink (bool);
|
||||
void audition_blink (bool);
|
||||
|
||||
@@ -671,6 +673,31 @@ class ARDOUR_UI : public Gtkmm2ext::UI
|
||||
Glib::RefPtr<Gtk::ActionGroup> common_actions;
|
||||
|
||||
void editor_realized ();
|
||||
|
||||
void toggle_session_state (const char* group, const char* action, void (ARDOUR::Session::*set)(bool));
|
||||
void toggle_send_midi_feedback ();
|
||||
void toggle_use_mmc ();
|
||||
void toggle_send_mmc ();
|
||||
void toggle_use_midi_control();
|
||||
void toggle_send_mtc ();
|
||||
|
||||
void toggle_AutoConnectNewTrackInputsToHardware();
|
||||
void toggle_AutoConnectNewTrackOutputsToHardware();
|
||||
void toggle_AutoConnectNewTrackOutputsToMaster();
|
||||
void toggle_ManuallyConnectNewTrackOutputs();
|
||||
void toggle_UseHardwareMonitoring();
|
||||
void toggle_UseSoftwareMonitoring();
|
||||
void toggle_UseExternalMonitoring();
|
||||
void toggle_StopPluginsWithTransport();
|
||||
void toggle_RunPluginsWhileRecording();
|
||||
void toggle_VerifyRemoveLastCapture();
|
||||
void toggle_StopRecordingOnXrun();
|
||||
void toggle_StopTransportAtEndOfSession();
|
||||
void toggle_GainReduceFastTransport();
|
||||
void toggle_LatchedSolo();
|
||||
void toggle_SoloViaBus();
|
||||
void toggle_AutomaticallyCreateCrossfades();
|
||||
void toggle_UnmuteNewFullCrossfades();
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -53,6 +53,16 @@ using namespace Gtk;
|
||||
using namespace Glib;
|
||||
using namespace sigc;
|
||||
|
||||
|
||||
static const gchar *psync_strings[] = {
|
||||
N_("Internal"),
|
||||
N_("Slave to MTC"),
|
||||
N_("Sync with JACK"),
|
||||
0
|
||||
};
|
||||
|
||||
static vector<string> positional_sync_strings;
|
||||
|
||||
int
|
||||
ARDOUR_UI::setup_windows ()
|
||||
{
|
||||
@@ -293,6 +303,8 @@ ARDOUR_UI::setup_transport ()
|
||||
act->connect_proxy (auto_loop_button);
|
||||
act = ActionManager::get_action (X_("Transport"), X_("PlaySelection"));
|
||||
act->connect_proxy (play_selection_button);
|
||||
act = ActionManager::get_action (X_("Transport"), X_("ToggleTimeMaster"));
|
||||
act->connect_proxy (time_master_button);
|
||||
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (roll_button, _("Play from playhead"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (stop_button, _("Stop playback"));
|
||||
@@ -306,7 +318,7 @@ ARDOUR_UI::setup_transport ()
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (punch_in_button, _("Start recording at auto-punch start"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (punch_out_button, _("Stop recording at auto-punch end"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (click_button, _("Enable/Disable audio click"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (follow_button, _("Enable/Disable follow playhead"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (time_master_button, _("Does Ardour control the time?"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (shuttle_box, _("Shuttle speed control"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (shuttle_units_button, _("Select semitones or %%-age for speed display"));
|
||||
ARDOUR_UI::instance()->tooltips().set_tip (speed_display_box, _("Current transport speed"));
|
||||
@@ -329,8 +341,8 @@ ARDOUR_UI::setup_transport ()
|
||||
punch_in_button.set_name ("TransportButton");
|
||||
punch_out_button.set_name ("TransportButton");
|
||||
click_button.set_name ("TransportButton");
|
||||
follow_button.set_name ("TransportButton");
|
||||
|
||||
time_master_button.set_name ("TransportButton");
|
||||
|
||||
goto_start_button.unset_flags (CAN_FOCUS);
|
||||
goto_end_button.unset_flags (CAN_FOCUS);
|
||||
roll_button.unset_flags (CAN_FOCUS);
|
||||
@@ -344,7 +356,7 @@ ARDOUR_UI::setup_transport ()
|
||||
punch_out_button.unset_flags (CAN_FOCUS);
|
||||
punch_in_button.unset_flags (CAN_FOCUS);
|
||||
click_button.unset_flags (CAN_FOCUS);
|
||||
follow_button.unset_flags (CAN_FOCUS);
|
||||
time_master_button.unset_flags (CAN_FOCUS);
|
||||
|
||||
goto_start_button.set_events (goto_start_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
goto_end_button.set_events (goto_end_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
@@ -357,9 +369,9 @@ ARDOUR_UI::setup_transport ()
|
||||
auto_play_button.set_events (auto_play_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
auto_input_button.set_events (auto_input_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
click_button.set_events (click_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
follow_button.set_events (click_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
punch_in_button.set_events (punch_in_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
punch_out_button.set_events (punch_out_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
time_master_button.set_events (punch_out_button.get_events() & ~(Gdk::ENTER_NOTIFY_MASK|Gdk::LEAVE_NOTIFY_MASK));
|
||||
|
||||
shuttle_box.signal_button_press_event().connect (mem_fun(*this, &ARDOUR_UI::shuttle_box_button_press));
|
||||
shuttle_box.signal_button_release_event().connect (mem_fun(*this, &ARDOUR_UI::shuttle_box_button_release));
|
||||
@@ -386,7 +398,6 @@ ARDOUR_UI::setup_transport ()
|
||||
auto_play_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_auto_play));
|
||||
auto_input_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_auto_input));
|
||||
click_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_click));
|
||||
follow_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_follow));
|
||||
punch_in_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_punch_in));
|
||||
punch_out_button.signal_toggled().connect (mem_fun(*this,&ARDOUR_UI::toggle_punch_out));
|
||||
|
||||
@@ -448,6 +459,12 @@ ARDOUR_UI::setup_transport ()
|
||||
sdframe->set_shadow_type (SHADOW_IN);
|
||||
sdframe->add (speed_display_box);
|
||||
|
||||
positional_sync_strings = internationalize (psync_strings);
|
||||
|
||||
set_popdown_strings (sync_option_combo, positional_sync_strings);
|
||||
sync_option_combo.set_active_text (positional_sync_strings.front());
|
||||
sync_option_combo.signal_changed().connect (mem_fun (*this, &ARDOUR_UI::sync_option_changed));
|
||||
|
||||
shbox->pack_start (*sdframe, false, false);
|
||||
shbox->pack_start (shuttle_units_button, true, true);
|
||||
shbox->pack_start (shuttle_style_button, false, false);
|
||||
@@ -466,22 +483,20 @@ ARDOUR_UI::setup_transport ()
|
||||
transport_tearoff_hbox.pack_start (primary_clock, false, false, 5);
|
||||
transport_tearoff_hbox.pack_start (secondary_clock, false, false, 5);
|
||||
|
||||
transport_tearoff_hbox.pack_start (sync_option_combo, false, false);
|
||||
transport_tearoff_hbox.pack_start (time_master_button, false, false);
|
||||
transport_tearoff_hbox.pack_start (punch_in_button, false, false);
|
||||
transport_tearoff_hbox.pack_start (punch_in_button, false, false);
|
||||
transport_tearoff_hbox.pack_start (punch_out_button, false, false);
|
||||
transport_tearoff_hbox.pack_start (auto_input_button, false, false);
|
||||
transport_tearoff_hbox.pack_start (auto_return_button, false, false);
|
||||
transport_tearoff_hbox.pack_start (auto_play_button, false, false);
|
||||
transport_tearoff_hbox.pack_start (click_button, false, false);
|
||||
transport_tearoff_hbox.pack_start (follow_button, false, false);
|
||||
|
||||
/* desensitize */
|
||||
|
||||
set_transport_sensitivity (false);
|
||||
|
||||
/* catch up with editor state */
|
||||
|
||||
follow_changed ();
|
||||
|
||||
// transport_tearoff_hbox.pack_start (preroll_button, false, false);
|
||||
// transport_tearoff_hbox.pack_start (preroll_clock, false, false);
|
||||
|
||||
@@ -859,3 +874,23 @@ ARDOUR_UI::editor_realized ()
|
||||
const guint32 FUDGE = 20; // Combo's are stupid - they steal space from the entry for the button
|
||||
set_size_request_to_display_given_text (shuttle_style_button, _("sprung"), 2+FUDGE, 10);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::sync_option_changed ()
|
||||
{
|
||||
string which;
|
||||
|
||||
if (session == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
which = sync_option_combo.get_active_text();
|
||||
|
||||
if (which == positional_sync_strings[Session::None]) {
|
||||
session->request_slave_source (Session::None);
|
||||
} else if (which == positional_sync_strings[Session::MTC]) {
|
||||
session->request_slave_source (Session::MTC);
|
||||
} else if (which == positional_sync_strings[Session::JACK]) {
|
||||
session->request_slave_source (Session::JACK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ void
|
||||
ARDOUR_UI::setup_keybindings ()
|
||||
{
|
||||
install_actions ();
|
||||
editor->register_actions ();
|
||||
RedirectBox::register_actions ();
|
||||
|
||||
try {
|
||||
|
||||
@@ -52,7 +52,6 @@ ARDOUR_UI::create_editor ()
|
||||
return -1;
|
||||
}
|
||||
|
||||
editor->DisplayControlChanged.connect (mem_fun(*this, &ARDOUR_UI::editor_display_control_changed));
|
||||
editor->Realized.connect (mem_fun (*this, &ARDOUR_UI::editor_realized));
|
||||
|
||||
return 0;
|
||||
@@ -64,9 +63,15 @@ ARDOUR_UI::install_actions ()
|
||||
Glib::RefPtr<ActionGroup> main_actions = ActionGroup::create (X_("Main"));
|
||||
Glib::RefPtr<Action> act;
|
||||
|
||||
/* menus + submenus that need action items */
|
||||
|
||||
ActionManager::register_action (main_actions, X_("Session"), _("Session"));
|
||||
ActionManager::register_action (main_actions, X_("Export"), _("Export"));
|
||||
ActionManager::register_action (main_actions, X_("Cleanup"), _("Cleanup"));
|
||||
ActionManager::register_action (main_actions, X_("Sync"), _("Sync"));
|
||||
ActionManager::register_action (main_actions, X_("Options"), _("Options"));
|
||||
|
||||
/* the real actions */
|
||||
|
||||
act = ActionManager::register_action (main_actions, X_("New"), _("New"), bind (mem_fun(*this, &ARDOUR_UI::new_session), false, string ()));
|
||||
|
||||
@@ -159,7 +164,7 @@ ARDOUR_UI::install_actions ()
|
||||
ActionManager::register_action (common_actions, X_("GotoEditor"), _("Editor"), mem_fun(*this, &ARDOUR_UI::goto_editor_window));
|
||||
ActionManager::register_action (common_actions, X_("GotoMixer"), _("Mixer"), mem_fun(*this, &ARDOUR_UI::goto_mixer_window));
|
||||
ActionManager::register_toggle_action (common_actions, X_("ToggleSoundFileBrowser"), _("Sound File Browser"), mem_fun(*this, &ARDOUR_UI::toggle_sound_file_browser));
|
||||
ActionManager::ActionManager::register_toggle_action (common_actions, X_("ToggleOptionsEditor"), _("Options Editor"), mem_fun(*this, &ARDOUR_UI::toggle_options_window));
|
||||
ActionManager::register_toggle_action (common_actions, X_("ToggleOptionsEditor"), _("Options Editor"), mem_fun(*this, &ARDOUR_UI::toggle_options_window));
|
||||
ActionManager::register_toggle_action (common_actions, X_("ToggleAudioLibrary"), _("Audio Library"), mem_fun(*this, &ARDOUR_UI::toggle_sound_file_browser));
|
||||
act = ActionManager::register_toggle_action (common_actions, X_("ToggleInspector"), _("Track/Bus Inspector"), mem_fun(*this, &ARDOUR_UI::toggle_route_params_window));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
@@ -245,6 +250,14 @@ ARDOUR_UI::install_actions ()
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
ActionManager::transport_sensitive_actions.push_back (act);
|
||||
|
||||
/* XXX the newline in the displayed name of this action is really wrong, but its because we want the button
|
||||
that proxies for this action to be more compact. It would be nice to find a way to override the action
|
||||
name appearance on the button.
|
||||
*/
|
||||
|
||||
act = ActionManager::register_action (transport_actions, X_("ToggleTimeMaster"), _("time\nmaster"), mem_fun(*this, &ARDOUR_UI::toggle_time_master));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_action (common_actions, X_("SendAllMidiFeedback"), _("send all midi feedback"), mem_fun(*this, &ARDOUR_UI::send_all_midi_feedback));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (common_actions, X_("ToggleRecordEnableTrack1"), _("toggle record enable track1"), bind (mem_fun(*this, &ARDOUR_UI::toggle_record_enable), 0U));
|
||||
@@ -316,8 +329,79 @@ ARDOUR_UI::install_actions ()
|
||||
|
||||
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));
|
||||
|
||||
Glib::RefPtr<ActionGroup> option_actions = ActionGroup::create ("options");
|
||||
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("SendMTC"), _("Send MTC"), mem_fun (*this, &ARDOUR_UI::toggle_send_mtc));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("SendMMC"), _("Send MMC"), mem_fun (*this, &ARDOUR_UI::toggle_send_mtc));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("UseMMC"), _("Send MMC"), mem_fun (*this, &ARDOUR_UI::toggle_use_mmc));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("SendMIDIfeedback"), _("Send MIDI feedback"), mem_fun (*this, &ARDOUR_UI::toggle_send_midi_feedback));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("UseMIDIcontrol"), _("Use MIDI control"), mem_fun (*this, &ARDOUR_UI::toggle_use_midi_control));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("AutoConnectNewTrackInputsToHardware"), _("Connect newtrack inputs to hardware"), mem_fun (*this, &ARDOUR_UI::toggle_AutoConnectNewTrackInputsToHardware));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
RadioAction::Group connect_outputs_group;
|
||||
|
||||
act = ActionManager::register_radio_action (option_actions, connect_outputs_group, X_("AutoConnectNewTrackOutputsToHardware"), _("Connect new track outputs to hardware"), mem_fun (*this, &ARDOUR_UI::toggle_AutoConnectNewTrackOutputsToHardware));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_radio_action (option_actions, connect_outputs_group, X_("AutoConnectNewTrackOutputsToMaster"), _("Connect new track outputs to master"), mem_fun (*this, &ARDOUR_UI::toggle_AutoConnectNewTrackOutputsToMaster));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_radio_action (option_actions, connect_outputs_group, X_("ManuallyConnectNewTrackOutputs"), _("Manually connect new track outputs"), mem_fun (*this, &ARDOUR_UI::toggle_ManuallyConnectNewTrackOutputs));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
RadioAction::Group monitoring_group;
|
||||
|
||||
act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseHardwareMonitoring"), _("Hardware monitoring"), mem_fun (*this, &ARDOUR_UI::toggle_UseHardwareMonitoring));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseSoftwareMonitoring"), _("Software monitoring"), mem_fun (*this, &ARDOUR_UI::toggle_UseSoftwareMonitoring));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_radio_action (option_actions, monitoring_group, X_("UseExternalMonitoring"), _("External monitoring"), mem_fun (*this, &ARDOUR_UI::toggle_UseExternalMonitoring));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("StopPluginsWithTransport"), _("Stop plugins with transport"), mem_fun (*this, &ARDOUR_UI::toggle_StopPluginsWithTransport));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("RunPluginsWhileRecording"), _("Run plugins while recording"), mem_fun (*this, &ARDOUR_UI::toggle_RunPluginsWhileRecording));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("VerifyRemoveLastCapture"), _("Verify remove last capture"), mem_fun (*this, &ARDOUR_UI::toggle_VerifyRemoveLastCapture));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("StopRecordingOnXrun"), _("Stop recording on xrun"), mem_fun (*this, &ARDOUR_UI::toggle_StopRecordingOnXrun));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("StopTransportAtEndOfSession"), _("Stop transport at session end"), mem_fun (*this, &ARDOUR_UI::toggle_StopTransportAtEndOfSession));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("GainReduceFastTransport"), _("-12dB gain reduce ffwd/rewind"), mem_fun (*this, &ARDOUR_UI::toggle_GainReduceFastTransport));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_toggle_action (option_actions, X_("LatchedSolo"), _("Latched solo"), mem_fun (*this, &ARDOUR_UI::toggle_LatchedSolo));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
RadioAction::Group solo_group;
|
||||
|
||||
act = ActionManager::register_radio_action (option_actions, solo_group, X_("SoloInPlace"), _("Solo in-place"), mem_fun (*this, &ARDOUR_UI::toggle_SoloViaBus));
|
||||
act = ActionManager::register_radio_action (option_actions, solo_group, X_("SoloViaBus"), _("Solo via bus"), mem_fun (*this, &ARDOUR_UI::toggle_SoloViaBus));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_action (option_actions, X_("AutomaticallyCreateCrossfades"), _("Automatically create crossfades"), mem_fun (*this, &ARDOUR_UI::toggle_AutomaticallyCreateCrossfades));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (option_actions, X_("UnmuteNewFullCrossfades"), _("Unmute new full crossfades"), mem_fun (*this, &ARDOUR_UI::toggle_UnmuteNewFullCrossfades));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
#ifdef NEW_ACTIONS
|
||||
act = ActionManager::register_action (option_actions, X_("SetRegionLayerMode", _("SetRegionLayerMode"), mem_fun (*this, &ARDOUR_UI::toggle_SetRegionLayerMode)));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (option_actions, X_("SetCrossfadeModel", _("SetCrossfadeModel"), mem_fun (*this, &ARDOUR_UI::toggle_SetCrossfadeModel)));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
#endif
|
||||
|
||||
ActionManager::add_action_group (shuttle_actions);
|
||||
ActionManager::add_action_group (option_actions);
|
||||
ActionManager::add_action_group (jack_actions);
|
||||
ActionManager::add_action_group (transport_actions);
|
||||
ActionManager::add_action_group (main_actions);
|
||||
@@ -366,15 +450,3 @@ ARDOUR_UI::build_menu_bar ()
|
||||
menu_bar_base.add (menu_hbox);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::editor_display_control_changed (Editing::DisplayControl c)
|
||||
{
|
||||
switch (c) {
|
||||
case Editing::FollowPlayhead:
|
||||
follow_button.set_active (editor->follow_playhead ());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
152
gtk2_ardour/ardour_ui_options.cc
Normal file
152
gtk2_ardour/ardour_ui_options.cc
Normal file
@@ -0,0 +1,152 @@
|
||||
/*
|
||||
Copyright (C) 2005 Paul Davis
|
||||
|
||||
This program 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.
|
||||
|
||||
This program 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 more 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
$Id$
|
||||
*/
|
||||
|
||||
#include <ardour/configuration.h>
|
||||
#include <ardour/session.h>
|
||||
#include <ardour/audioengine.h>
|
||||
|
||||
#include "ardour_ui.h"
|
||||
#include "actions.h"
|
||||
|
||||
using namespace Gtk;
|
||||
using namespace ARDOUR;
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_time_master ()
|
||||
{
|
||||
bool yn = time_master_button.get_active();
|
||||
|
||||
Config->set_jack_time_master (yn);
|
||||
|
||||
if (session) {
|
||||
session->engine().reset_timebase ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_session_state (const char* group, const char* action, void (Session::*set)(bool))
|
||||
{
|
||||
if (session) {
|
||||
Glib::RefPtr<Action> act = ActionManager::get_action (group, action);
|
||||
if (act) {
|
||||
Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
(session->*set) (tact->get_active());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_send_mtc ()
|
||||
{
|
||||
toggle_session_state ("options", "SendMTC", &Session::set_send_mtc);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_send_mmc ()
|
||||
{
|
||||
toggle_session_state ("options", "SendMMC", &Session::set_send_mmc);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_use_mmc ()
|
||||
{
|
||||
toggle_session_state ("options", "UseMMC", &Session::set_mmc_control);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_use_midi_control ()
|
||||
{
|
||||
toggle_session_state ("options", "UseMIDIcontrol", &Session::set_midi_control);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_send_midi_feedback ()
|
||||
{
|
||||
toggle_session_state ("options", "SendMIDIfeedback", &Session::set_midi_feedback);
|
||||
}
|
||||
|
||||
void
|
||||
ARDOUR_UI::toggle_AutoConnectNewTrackInputsToHardware()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_AutoConnectNewTrackOutputsToHardware()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_AutoConnectNewTrackOutputsToMaster()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_ManuallyConnectNewTrackOutputs()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_UseHardwareMonitoring()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_UseSoftwareMonitoring()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_UseExternalMonitoring()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_StopPluginsWithTransport()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_RunPluginsWhileRecording()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_VerifyRemoveLastCapture()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_StopRecordingOnXrun()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_StopTransportAtEndOfSession()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_GainReduceFastTransport()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_LatchedSolo()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_SoloViaBus()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_AutomaticallyCreateCrossfades()
|
||||
{
|
||||
}
|
||||
void
|
||||
ARDOUR_UI::toggle_UnmuteNewFullCrossfades()
|
||||
{
|
||||
}
|
||||
@@ -525,6 +525,7 @@ Editor::Editor (AudioEngine& eng)
|
||||
route_display_model = ListStore::create(route_display_columns);
|
||||
route_list_display.set_model (route_display_model);
|
||||
route_list_display.append_column (_("Tracks"), route_display_columns.text);
|
||||
route_list_display.set_headers_visible (false);
|
||||
route_list_display.set_name ("TrackListDisplay");
|
||||
route_list_display.get_selection()->set_mode (Gtk::SELECTION_MULTIPLE);
|
||||
route_list_display.set_reorderable (true);
|
||||
@@ -556,6 +557,7 @@ Editor::Editor (AudioEngine& eng)
|
||||
edit_group_display.append_column (_("groupname"), group_columns.text);
|
||||
edit_group_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(0));
|
||||
edit_group_display.get_column (0)->set_data (X_("colnum"), GUINT_TO_POINTER(1));
|
||||
edit_group_display.set_headers_visible (false);
|
||||
|
||||
/* use checkbox for the active column */
|
||||
|
||||
@@ -593,11 +595,12 @@ Editor::Editor (AudioEngine& eng)
|
||||
region_list_display.set_name ("RegionListDisplay");
|
||||
|
||||
region_list_model = TreeStore::create (region_list_columns);
|
||||
region_list_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
||||
|
||||
region_list_display.set_model (region_list_model);
|
||||
region_list_sort_model = TreeModelSort::create (region_list_model);
|
||||
region_list_sort_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
||||
|
||||
region_list_display.set_model (region_list_sort_model);
|
||||
region_list_display.append_column (_("Regions"), region_list_columns.name);
|
||||
region_list_display.set_reorderable (true);
|
||||
region_list_display.set_headers_visible (false);
|
||||
region_list_display.get_selection()->set_mode (SELECTION_SINGLE);
|
||||
region_list_display.add_object_drag (region_list_columns.region.index(), "regions");
|
||||
|
||||
@@ -618,12 +621,10 @@ Editor::Editor (AudioEngine& eng)
|
||||
|
||||
region_list_display.signal_key_press_event().connect (mem_fun(*this, &Editor::region_list_display_key_press));
|
||||
region_list_display.signal_key_release_event().connect (mem_fun(*this, &Editor::region_list_display_key_release));
|
||||
region_list_display.signal_button_press_event().connect (mem_fun(*this, &Editor::region_list_display_button_press));
|
||||
region_list_display.signal_button_press_event().connect (mem_fun(*this, &Editor::region_list_display_button_press), false);
|
||||
region_list_display.signal_button_release_event().connect (mem_fun(*this, &Editor::region_list_display_button_release));
|
||||
region_list_display.get_selection()->signal_changed().connect (mem_fun(*this, &Editor::region_list_selection_changed));
|
||||
// GTK2FIX
|
||||
//region_list_display.unselect_row.connect (mem_fun(*this, &Editor::region_list_display_unselected));
|
||||
//region_list_display.signal_columns_changed().connect (mem_fun(*this, &Editor::region_list_column_click));
|
||||
// region_list_display.signal_popup_menu().connect (bind (mem_fun (*this, &Editor::show_region_list_display_context_menu), 1, 0));
|
||||
|
||||
named_selection_scroller.add (named_selection_display);
|
||||
named_selection_scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC);
|
||||
@@ -631,6 +632,7 @@ Editor::Editor (AudioEngine& eng)
|
||||
named_selection_model = TreeStore::create (named_selection_columns);
|
||||
named_selection_display.set_model (named_selection_model);
|
||||
named_selection_display.append_column (_("Chunks"), named_selection_columns.text);
|
||||
named_selection_display.set_headers_visible (false);
|
||||
named_selection_display.set_size_request (100, -1);
|
||||
named_selection_display.set_name ("RegionListDisplay");
|
||||
|
||||
@@ -670,6 +672,10 @@ Editor::Editor (AudioEngine& eng)
|
||||
add_accel_group (ActionManager::ui_manager->get_accel_group());
|
||||
|
||||
vpacker.pack_end (global_hpacker, true, true);
|
||||
|
||||
/* register actions now so that set_state() can find them and set toggles/checks etc */
|
||||
|
||||
register_actions ();
|
||||
|
||||
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
|
||||
set_state (*node);
|
||||
@@ -2108,8 +2114,13 @@ Editor::set_state (const XMLNode& node)
|
||||
|
||||
if ((prop = node.property ("follow-playhead"))) {
|
||||
bool yn = (prop->value() == "yes");
|
||||
_follow_playhead = !yn;
|
||||
set_follow_playhead (yn);
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleFollowPlayhead"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
/* do it twice to force the change */
|
||||
tact->set_active (!yn);
|
||||
tact->set_active (yn);
|
||||
}
|
||||
}
|
||||
|
||||
if ((prop = node.property ("xfades-visible"))) {
|
||||
@@ -2789,8 +2800,6 @@ Editor::convert_drop_to_paths (vector<string>& paths,
|
||||
where each pathname is delimited by \r\n
|
||||
*/
|
||||
|
||||
cerr << "by hand parsing of URI list\n";
|
||||
|
||||
const char* p = data.get_text().c_str();
|
||||
const char* q;
|
||||
|
||||
@@ -2822,15 +2831,12 @@ Editor::convert_drop_to_paths (vector<string>& paths,
|
||||
p++;
|
||||
}
|
||||
|
||||
cerr << "end result = " << uris.size() << endl;
|
||||
|
||||
if (uris.empty()) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
for (vector<ustring>::iterator i = uris.begin(); i != uris.end(); ++i) {
|
||||
cerr << "looking at " << (*i) << endl;
|
||||
if ((*i).substr (0,7) == "file://") {
|
||||
string p = *i;
|
||||
url_decode (p);
|
||||
@@ -3692,6 +3698,16 @@ Editor::set_show_measures (bool yn)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_follow_playhead ()
|
||||
{
|
||||
RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("ToggleFollowPlayhead"));
|
||||
if (act) {
|
||||
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic(act);
|
||||
set_follow_playhead (tact->get_active());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_follow_playhead (bool yn)
|
||||
{
|
||||
|
||||
@@ -707,6 +707,7 @@ class Editor : public PublicEditor
|
||||
void region_list_clear ();
|
||||
void region_list_selection_mapover (sigc::slot<void,ARDOUR::Region&>);
|
||||
void build_region_list_menu ();
|
||||
void show_region_list_display_context_menu (int button, int time);
|
||||
|
||||
Gtk::CheckMenuItem* toggle_auto_regions_item;
|
||||
Gtk::CheckMenuItem* toggle_full_region_list_item;
|
||||
|
||||
@@ -21,7 +21,7 @@ Editor::register_actions ()
|
||||
RefPtr<ActionGroup> editor_actions = ActionGroup::create (X_("Editor"));
|
||||
|
||||
/* non-operative menu items for menu bar */
|
||||
|
||||
-
|
||||
ActionManager::register_action (editor_actions, X_("Edit"), _("Edit"));
|
||||
ActionManager::register_action (editor_actions, X_("View"), _("View"));
|
||||
ActionManager::register_action (editor_actions, X_("ZoomFocus"), _("ZoomFocus"));
|
||||
@@ -192,7 +192,7 @@ Editor::register_actions ()
|
||||
act = ActionManager::register_action (editor_actions, "extend-range-to-start-of-region", _("extend range to start of region"), bind (mem_fun(*this, &Editor::extend_selection_to_start_of_region), false));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_action (editor_actions, "toggle-follow-playhead", _("toggle follow playhead"), (mem_fun(*this, &Editor::toggle_follow_playhead)));
|
||||
act = ActionManager::register_toggle_action (editor_actions, "ToggleFollowPlayhead", _("follow playhead"), (mem_fun(*this, &Editor::toggle_follow_playhead)));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, "remove-last-capture", _("remove last capture"), (mem_fun(*this, &Editor::remove_last_capture)));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
@@ -254,6 +254,9 @@ Editor::register_actions ()
|
||||
RadioAction::Group sort_type_group;
|
||||
RadioAction::Group sort_order_group;
|
||||
|
||||
/* the region list popup menu */
|
||||
ActionManager::register_action (rl_actions, X_("RegionListSort"), _("Sort"));
|
||||
|
||||
act = ActionManager::register_action (rl_actions, X_("rlAudition"), _("Audition"), mem_fun(*this, &Editor::audition_region_from_region_list));
|
||||
ActionManager::region_list_selection_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (rl_actions, X_("rlHide"), _("Hide"), mem_fun(*this, &Editor::hide_region_from_region_list));
|
||||
@@ -293,6 +296,14 @@ Editor::register_actions ()
|
||||
act = ActionManager::register_action (rl_actions, X_("rlImportAudio"), _("Embed audio (link)"), bind (mem_fun(*this, &Editor::import_audio), false));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
#ifdef NEW_ACTIONS
|
||||
|
||||
ToggleWaveformVisibility;
|
||||
ToggleWaveformsWhileRecording;
|
||||
ToggleMeasureVisibility;
|
||||
|
||||
#endif
|
||||
|
||||
ActionManager::add_action_group (rl_actions);
|
||||
ActionManager::add_action_group (zoom_actions);
|
||||
ActionManager::add_action_group (mouse_mode_actions);
|
||||
|
||||
@@ -3383,12 +3383,6 @@ Editor::toggle_xfades_active ()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::toggle_follow_playhead ()
|
||||
{
|
||||
set_follow_playhead (!_follow_playhead);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::set_xfade_visibility (bool yn)
|
||||
{
|
||||
|
||||
@@ -298,21 +298,27 @@ Editor::add_audio_region_to_region_display (AudioRegion *region)
|
||||
void
|
||||
Editor::region_list_selection_changed()
|
||||
{
|
||||
bool sensitive;
|
||||
bool selected;
|
||||
|
||||
if (region_list_display.get_selection()->count_selected_rows() > 0) {
|
||||
sensitive = true;
|
||||
selected = true;
|
||||
} else {
|
||||
sensitive = false;
|
||||
selected = false;
|
||||
}
|
||||
|
||||
for (vector<Glib::RefPtr<Gtk::Action> >::iterator i = ActionManager::region_list_selection_sensitive_actions.begin(); i != ActionManager::region_list_selection_sensitive_actions.end(); ++i) {
|
||||
(*i)->set_sensitive (sensitive);
|
||||
if (selected) {
|
||||
TreeView::Selection::ListHandle_Path rows = region_list_display.get_selection()->get_selected_rows ();
|
||||
TreeView::Selection::ListHandle_Path::iterator i = rows.begin();
|
||||
TreeIter iter;
|
||||
|
||||
/* just set the first selected region (in fact, the selection model might be SINGLE, which
|
||||
means there can only be one.
|
||||
*/
|
||||
|
||||
if ((iter = region_list_model->get_iter (*i))) {
|
||||
set_selected_regionview_from_region_list (*((*iter)[region_list_columns.region]), false);
|
||||
}
|
||||
}
|
||||
|
||||
// GTK2FIX
|
||||
// set_selected_regionview_from_region_list (*region, false);
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
@@ -384,6 +390,22 @@ Editor::toggle_full_region_list ()
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::show_region_list_display_context_menu (int button, int time)
|
||||
{
|
||||
if (region_list_menu == 0) {
|
||||
build_region_list_menu ();
|
||||
}
|
||||
|
||||
if (region_list_display.get_selection()->count_selected_rows() > 0) {
|
||||
ActionManager::set_sensitive (ActionManager::region_list_selection_sensitive_actions, true);
|
||||
} else {
|
||||
ActionManager::set_sensitive (ActionManager::region_list_selection_sensitive_actions, false);
|
||||
}
|
||||
|
||||
region_list_menu->popup (button, time);
|
||||
}
|
||||
|
||||
bool
|
||||
Editor::region_list_display_key_press (GdkEventKey* ev)
|
||||
{
|
||||
@@ -415,6 +437,8 @@ Editor::region_list_display_button_press (GdkEventButton *ev)
|
||||
int cellx;
|
||||
int celly;
|
||||
|
||||
cerr << "RL button press\n";
|
||||
|
||||
if (region_list_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
|
||||
if ((iter = region_list_model->get_iter (path))) {
|
||||
region = (*iter)[region_list_columns.region];
|
||||
@@ -431,10 +455,7 @@ Editor::region_list_display_button_press (GdkEventButton *ev)
|
||||
}
|
||||
|
||||
if (Keyboard::is_context_menu_event (ev)) {
|
||||
if (region_list_menu == 0) {
|
||||
build_region_list_menu ();
|
||||
}
|
||||
region_list_menu->popup (ev->button, ev->time);
|
||||
show_region_list_display_context_menu (ev->button, ev->time);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -472,6 +493,8 @@ Editor::region_list_display_button_release (GdkEventButton *ev)
|
||||
int celly;
|
||||
Region* region;
|
||||
|
||||
cerr << "RL button release\n";
|
||||
|
||||
if (region_list_display.get_path_at_pos ((int)ev->x, (int)ev->y, path, column, cellx, celly)) {
|
||||
if ((iter = region_list_model->get_iter (path))) {
|
||||
region = (*iter)[region_list_columns.region];
|
||||
@@ -604,60 +627,14 @@ Editor::reset_region_list_sort_type (RegionListSortType type)
|
||||
{
|
||||
if (type != region_list_sort_type) {
|
||||
region_list_sort_type = type;
|
||||
|
||||
switch (type) {
|
||||
case ByName:
|
||||
region_list_display.get_column (0)->set_title (_("Regions/name"));
|
||||
break;
|
||||
|
||||
case ByLength:
|
||||
region_list_display.get_column (0)->set_title (_("Regions/length"));
|
||||
break;
|
||||
|
||||
case ByPosition:
|
||||
region_list_display.get_column (0)->set_title (_("Regions/position"));
|
||||
break;
|
||||
|
||||
case ByTimestamp:
|
||||
region_list_display.get_column (0)->set_title (_("Regions/creation"));
|
||||
break;
|
||||
|
||||
case ByStartInFile:
|
||||
region_list_display.get_column (0)->set_title (_("Regions/start"));
|
||||
break;
|
||||
|
||||
case ByEndInFile:
|
||||
region_list_display.get_column (0)->set_title (_("Regions/end"));
|
||||
break;
|
||||
|
||||
case BySourceFileName:
|
||||
region_list_display.get_column (0)->set_title (_("Regions/file name"));
|
||||
break;
|
||||
|
||||
case BySourceFileLength:
|
||||
region_list_display.get_column (0)->set_title (_("Regions/file size"));
|
||||
break;
|
||||
|
||||
case BySourceFileCreationDate:
|
||||
region_list_display.get_column (0)->set_title (_("Regions/file date"));
|
||||
break;
|
||||
|
||||
case BySourceFileFS:
|
||||
region_list_display.get_column (0)->set_title (_("Regions/file system"));
|
||||
break;
|
||||
}
|
||||
|
||||
// region_list_sort_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
||||
region_list_sort_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::reset_region_list_sort_direction (bool up)
|
||||
{
|
||||
// GTK2FIX
|
||||
//region_list_display.set_sort_type (up ? GTK_SORT_ASCENDING : GTK_SORT_DESCENDING);
|
||||
/* reset to force resort */
|
||||
// region_list_sort_model->set_sort_func (0, mem_fun (*this, &Editor::region_list_sorter));
|
||||
// region_list_display.set_sort_type (up ? GTK_SORT_ASCENDING : GTK_SORT_DESCENDING);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -69,8 +69,6 @@ DnDTreeView::serialize_pointers (RefPtr<TreeModel> model, TreeSelection::ListHan
|
||||
void
|
||||
DnDTreeView::on_drag_data_get(const RefPtr<DragContext>& context, SelectionData& selection_data, guint info, guint time)
|
||||
{
|
||||
cerr << "DnDTreeview::drag_data_get, target = " << selection_data.get_target() << endl;
|
||||
|
||||
if (selection_data.get_target() == "GTK_TREE_MODEL_ROW") {
|
||||
|
||||
TreeView::on_drag_data_get (context, selection_data, info, time);
|
||||
@@ -87,8 +85,6 @@ DnDTreeView::on_drag_data_get(const RefPtr<DragContext>& context, SelectionData&
|
||||
void
|
||||
DnDTreeView::on_drag_data_received(const RefPtr<DragContext>& context, int x, int y, const SelectionData& selection_data, guint info, guint time)
|
||||
{
|
||||
cerr << "DnDTreeview::drag_data_received @ " << x << ',' << y << " target = " << selection_data.get_target() << endl;
|
||||
|
||||
if (suggested_action) {
|
||||
/* this is a drag motion callback. just update the status to
|
||||
say that we are still dragging, and that's it.
|
||||
|
||||
Reference in New Issue
Block a user