Merge branch 'cairocanvas' into recfolder

This commit is contained in:
Robin Gareus 2014-07-05 21:13:46 +02:00
commit 3d4e477216
26 changed files with 344 additions and 81 deletions

View File

@ -1,26 +1,4 @@
<ui>
<accelerator action='set-mouse-mode-object'/>
<accelerator action='set-mouse-mode-range'/>
<accelerator action='set-mouse-mode-gain'/>
<accelerator action='set-mouse-mode-draw'/>
<accelerator action='set-mouse-mode-zoom'/>
<accelerator action='set-mouse-mode-timefx'/>
<accelerator action='set-mouse-mode-object-range'/>
<accelerator action='toggle-internal-edit'/>
<accelerator action='focus-on-clock'/>
<accelerator action='track-solo-toggle'/>
<accelerator action='track-mute-toggle'/>
<accelerator action='toggle-edit-mode'/>
<accelerator action='toggle-midi-input-active'/>
<accelerator action='escape'/>
<accelerator action='alt-start-range'/>
<accelerator action='alt-finish-range'/>
#ifdef GTKOSX
<accelerator action='Quit'/>
#endif
<menubar name='Main' action='MainMenu'>
<menu name='Session' action='Session'>
<menuitem action='New'/>
@ -135,13 +113,11 @@
<menuitem action='selected-marker-to-previous-region-boundary'/>
<menuitem action='edit-cursor-to-next-region-sync'/>
<menuitem action='edit-cursor-to-previous-region-sync'/>
<separator/>
<menuitem action='edit-to-playhead'/>
<menuitem action='set-edit-point'/>
</menu>
<menu action="MarkerMenu">
<menuitem action='add-location-from-playhead'/>
<menuitem action='remove-location-from-playhead'/>
<separator/>
<menuitem action='goto-mark-1'/>
<menuitem action='goto-mark-2'/>
@ -188,11 +164,11 @@
<menuitem action='select-all-in-punch-range'/>
<menuitem action='select-all-in-loop-range'/>
<separator/>
<menuitem action='select-range-between-cursors'/>
<menuitem action='move-range-start-to-previous-region-boundary'/>
<menuitem action='move-range-start-to-next-region-boundary'/>
<menuitem action='move-range-end-to-previous-region-boundary'/>
<menuitem action='move-range-end-to-next-region-boundary'/>
<separator/>
<menuitem action='start-range'/>
<menuitem action='finish-range'/>
<separator/>
@ -357,6 +333,7 @@
<separator/>
<menu action="PrimaryClockMenu">
<menuitem action='focus-on-clock'/>
<menuitem action="primary-clock-timecode"/>
<menuitem action="primary-clock-bbt"/>
<menuitem action="primary-clock-minsec"/>

View File

@ -221,6 +221,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
splash = 0;
_numpad_locate_happening = false;
if (theArdourUI == 0) {
theArdourUI = this;
}
@ -490,8 +492,6 @@ ARDOUR_UI::post_engine ()
_tooltips.enable();
ActionManager::load_menus (ARDOUR_COMMAND_LINE::menus_file);
if (setup_windows ()) {
throw failed_constructor ();
}
@ -1909,7 +1909,7 @@ ARDOUR_UI::transport_roll ()
}
}
} else if (_session->get_play_range () && !Config->get_always_play_range()) {
} else if (_session->get_play_range () ) {
/* stop playing a range if we currently are */
_session->request_play_range (0, true);
}
@ -1976,10 +1976,10 @@ ARDOUR_UI::toggle_roll (bool with_abort, bool roll_out_of_bounded_mode)
if (rolling) {
_session->request_stop (with_abort, true);
} else {
if ( Config->get_always_play_range() ) {
if ( Config->get_follow_edits() && ( editor->get_selection().time.front().start == _session->transport_frame() ) ) { //if playhead is exactly at the start of a range, we can assume it was placed there by follow_edits
_session->request_play_range (&editor->get_selection().time, true);
_session->set_requested_return_frame( editor->get_selection().time.front().start ); //force an auto-return here
}
_session->request_transport_speed (1.0f);
}
}
@ -2153,7 +2153,7 @@ ARDOUR_UI::map_transport_state ()
auto_loop_button.set_active (false);
}
if (Config->get_always_play_range()) {
if (Config->get_follow_edits()) {
/* light up both roll and play-selection if they are joined */
roll_button.set_active (true);
play_selection_button.set_active (true);
@ -4411,3 +4411,47 @@ ARDOUR_UI::do_audio_midi_setup (uint32_t desired_sample_rate)
}
gint
ARDOUR_UI::transport_numpad_timeout ()
{
_numpad_locate_happening = false;
if (_numpad_timeout_connection.connected() )
_numpad_timeout_connection.disconnect();
return 1;
}
void
ARDOUR_UI::transport_numpad_decimal ()
{
_numpad_timeout_connection.disconnect();
if (_numpad_locate_happening) {
if (editor) editor->goto_nth_marker(_pending_locate_num - 1);
_numpad_locate_happening = false;
} else {
_pending_locate_num = 0;
_numpad_locate_happening = true;
_numpad_timeout_connection = Glib::signal_timeout().connect (mem_fun(*this, &ARDOUR_UI::transport_numpad_timeout), 2*1000);
}
}
void
ARDOUR_UI::transport_numpad_event (int num)
{
if ( _numpad_locate_happening ) {
_pending_locate_num = _pending_locate_num*10 + num;
} else {
switch (num) {
case 0: toggle_roll(false, false); break;
case 1: transport_rewind(1); break;
case 2: transport_forward(1); break;
case 3: transport_record(true); break;
case 4: if (_session) _session->request_play_loop(true); break;
case 5: if (_session) _session->request_play_loop(true); transport_record(false); break;
case 6: toggle_punch(); break;
case 7: toggle_click(); break;
case 8: toggle_auto_return(); break;
case 9: toggle_follow_edits(); break;
}
}
}

View File

@ -424,7 +424,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
boost::shared_ptr<TransportControllable> play_selection_controllable;
boost::shared_ptr<TransportControllable> rec_controllable;
void toggle_always_play_range ();
void toggle_follow_edits ();
void set_transport_controllable_state (const XMLNode&);
XMLNode& get_transport_controllable_state ();
@ -561,6 +561,15 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void set_transport_sensitivity (bool);
//stuff for ProTools-style numpad
void transport_numpad_event (int num);
void transport_numpad_decimal ();
bool _numpad_locate_happening;
int _pending_locate_num;
gint transport_numpad_timeout ();
sigc::connection _numpad_timeout_connection;
void transport_goto_nth_marker (int nth);
void transport_goto_zero ();
void transport_goto_start ();
void transport_goto_end ();

View File

@ -657,7 +657,7 @@ ARDOUR_UI::click_button_clicked (GdkEventButton* ev)
}
void
ARDOUR_UI::toggle_always_play_range ()
ARDOUR_UI::toggle_follow_edits ()
{
RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
assert (act);
@ -665,7 +665,7 @@ ARDOUR_UI::toggle_always_play_range ()
RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
assert (tact);
Config->set_always_play_range (tact->get_active ());
Config->set_follow_edits (tact->get_active ());
}

View File

@ -31,6 +31,7 @@
#include "ardour/session.h"
#include "actions.h"
#include "ardour_ui.h"
#include "public_editor.h"
#include "mixer_ui.h"
@ -59,6 +60,11 @@ ARDOUR_UI::we_have_dependents ()
editor->setup_tooltips ();
editor->UpdateAllTransportClocks.connect (sigc::mem_fun (*this, &ARDOUR_UI::update_transport_clocks));
/* all actions are defined */
ActionManager::enable_accelerators ();
ActionManager::load_menus (ARDOUR_COMMAND_LINE::menus_file);
editor->track_mixer_selection ();
mixer->track_editor_selection ();
}

View File

@ -229,6 +229,9 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_action (transport_actions, X_("ToggleRoll"), _("Start/Stop"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::toggle_roll), false, false));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("alternate-ToggleRoll"), _("Start/Stop"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::toggle_roll), false, false));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("ToggleRollMaybe"), _("Start/Continue/Stop"), sigc::bind (sigc::mem_fun (*this, &ARDOUR_UI::toggle_roll), false, true));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
@ -267,6 +270,10 @@ ARDOUR_UI::install_actions ()
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("alternate-record-roll"), _("Start Recording"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::transport_record), true));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::write_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("Rewind"), _("Rewind"), sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::transport_rewind), 0));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
@ -291,6 +298,9 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_action (transport_actions, X_("GotoStart"), _("Goto Start"), sigc::mem_fun(*this, &ARDOUR_UI::transport_goto_start));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("alternate-GotoStart"), _("Goto Start"), sigc::mem_fun(*this, &ARDOUR_UI::transport_goto_start));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("GotoEnd"), _("Goto End"), sigc::mem_fun(*this, &ARDOUR_UI::transport_goto_end));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
@ -298,6 +308,41 @@ ARDOUR_UI::install_actions ()
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
//these actions handle the numpad events, ProTools style
act = ActionManager::register_action (transport_actions, X_("numpad-decimal"), _("Numpad Decimal"), mem_fun(*this, &ARDOUR_UI::transport_numpad_decimal));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("numpad-0"), _("Numpad 0"), bind (mem_fun(*this, &ARDOUR_UI::transport_numpad_event), 0));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("numpad-1"), _("Numpad 1"), bind (mem_fun(*this, &ARDOUR_UI::transport_numpad_event), 1));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("numpad-2"), _("Numpad 2"), bind (mem_fun(*this, &ARDOUR_UI::transport_numpad_event), 2));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("numpad-3"), _("Numpad 3"), bind (mem_fun(*this, &ARDOUR_UI::transport_numpad_event), 3));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("numpad-4"), _("Numpad 4"), bind (mem_fun(*this, &ARDOUR_UI::transport_numpad_event), 4));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("numpad-5"), _("Numpad 5"), bind (mem_fun(*this, &ARDOUR_UI::transport_numpad_event), 5));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("numpad-6"), _("Numpad 6"), bind (mem_fun(*this, &ARDOUR_UI::transport_numpad_event), 6));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("numpad-7"), _("Numpad 7"), bind (mem_fun(*this, &ARDOUR_UI::transport_numpad_event), 7));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("numpad-8"), _("Numpad 8"), bind (mem_fun(*this, &ARDOUR_UI::transport_numpad_event), 8));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("numpad-9"), _("Numpad 9"), bind (mem_fun(*this, &ARDOUR_UI::transport_numpad_event), 9));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_action (transport_actions, X_("focus-on-clock"), _("Focus On Clock"), sigc::mem_fun(*this, &ARDOUR_UI::focus_on_clock));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
@ -344,7 +389,7 @@ ARDOUR_UI::install_actions ()
act = ActionManager::register_toggle_action (transport_actions, X_("ToggleAutoReturn"), _("Auto Return"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_auto_return));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);
act = ActionManager::register_toggle_action (transport_actions, X_("ToggleFollowEdits"), _("Follow Edits"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_always_play_range));
act = ActionManager::register_toggle_action (transport_actions, X_("ToggleFollowEdits"), _("Follow Edits"), sigc::mem_fun(*this, &ARDOUR_UI::toggle_follow_edits));
ActionManager::session_sensitive_actions.push_back (act);
ActionManager::transport_sensitive_actions.push_back (act);

View File

@ -328,7 +328,7 @@ ARDOUR_UI::parameter_changed (std::string p)
} else if (p == "always-play-range") {
ActionManager::map_some_state ("Transport", "ToggleFollowEdits", &RCConfiguration::get_always_play_range);
ActionManager::map_some_state ("Transport", "ToggleFollowEdits", &RCConfiguration::get_follow_edits);
} else if (p == "send-mtc") {

View File

@ -4546,6 +4546,8 @@ Editor::get_regions_from_selection_and_edit_point ()
if (_edit_point == EditAtMouse && entered_regionview && !selection->regions.contains (entered_regionview)) {
regions.add (entered_regionview);
} else {
regions = selection->regions;
}
if (regions.empty() && _edit_point != EditAtMouse) {

View File

@ -1328,6 +1328,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void set_punch_range (framepos_t start, framepos_t end, std::string cmd);
void add_location_from_playhead_cursor ();
void remove_location_at_playhead_cursor ();
bool select_new_marker;
void reverse_selection ();

View File

@ -194,8 +194,11 @@ Editor::register_actions ()
reg_sens (editor_actions, "select-all", _("Select All"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all), Selection::Set));
reg_sens (editor_actions, "deselect-all", _("Deselect All"), sigc::mem_fun(*this, &Editor::deselect_all));
reg_sens (editor_actions, "invert-selection", _("Invert Selection"), sigc::mem_fun(*this, &Editor::invert_selection));
reg_sens (editor_actions, "select-all-after-edit-cursor", _("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true));
reg_sens (editor_actions, "alternate-select-all-after-edit-cursor", _("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true));
reg_sens (editor_actions, "select-all-before-edit-cursor", _("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false));
reg_sens (editor_actions, "alternate-select-all-before-edit-cursor", _("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false));
reg_sens (editor_actions, "select-all-between-cursors", _("Select All Overlapping Edit Range"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_between), false));
reg_sens (editor_actions, "select-all-within-cursors", _("Select All Inside Edit Range"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_between), true));
@ -237,7 +240,12 @@ Editor::register_actions ()
reg_sens (editor_actions, "jump-forward-to-mark", _("Jump to Next Mark"), sigc::mem_fun(*this, &Editor::jump_forward_to_mark));
reg_sens (editor_actions, "jump-backward-to-mark", _("Jump to Previous Mark"), sigc::mem_fun(*this, &Editor::jump_backward_to_mark));
reg_sens (editor_actions, "add-location-from-playhead", _("Add Mark from Playhead"), sigc::mem_fun(*this, &Editor::add_location_from_playhead_cursor));
reg_sens (editor_actions, "alternate-add-location-from-playhead", _("Add Mark from Playhead"), sigc::mem_fun(*this, &Editor::add_location_from_playhead_cursor));
reg_sens (editor_actions, "remove-location-from-playhead", _("Remove Mark at Playhead"), sigc::mem_fun(*this, &Editor::remove_location_at_playhead_cursor));
reg_sens (editor_actions, "alternate-remove-location-from-playhead", _("Remove Mark at Playhead"), sigc::mem_fun(*this, &Editor::remove_location_at_playhead_cursor));
reg_sens (editor_actions, "nudge-next-forward", _("Nudge Next Later"), sigc::bind (sigc::mem_fun(*this, &Editor::nudge_forward), true, false));
reg_sens (editor_actions, "nudge-next-backward", _("Nudge Next Earlier"), sigc::bind (sigc::mem_fun(*this, &Editor::nudge_backward), true, false));
@ -298,7 +306,10 @@ Editor::register_actions ()
reg_sens (editor_actions, "duplicate-range", _("Duplicate Range"), sigc::bind (sigc::mem_fun(*this, &Editor::duplicate_range), false));
undo_action = reg_sens (editor_actions, "undo", S_("Command|Undo"), sigc::bind (sigc::mem_fun(*this, &Editor::undo), 1U));
redo_action = reg_sens (editor_actions, "redo", _("Redo"), sigc::bind (sigc::mem_fun(*this, &Editor::redo), 1U));
redo_action = reg_sens (editor_actions, "alternate-redo", _("Redo"), sigc::bind (sigc::mem_fun(*this, &Editor::redo), 1U));
redo_action = reg_sens (editor_actions, "alternate-alternate-redo", _("Redo"), sigc::bind (sigc::mem_fun(*this, &Editor::redo), 1U));
reg_sens (editor_actions, "export-audio", _("Export Audio"), sigc::mem_fun(*this, &Editor::export_audio));
reg_sens (editor_actions, "export-range", _("Export Range"), sigc::mem_fun(*this, &Editor::export_range));
@ -317,6 +328,7 @@ Editor::register_actions ()
reg_sens (editor_actions, "editor-cut", _("Cut"), sigc::mem_fun(*this, &Editor::cut));
reg_sens (editor_actions, "editor-delete", _("Delete"), sigc::mem_fun(*this, &Editor::delete_));
reg_sens (editor_actions, "alternate-editor-delete", _("Delete"), sigc::mem_fun(*this, &Editor::delete_));
reg_sens (editor_actions, "editor-copy", _("Copy"), sigc::mem_fun(*this, &Editor::copy));
reg_sens (editor_actions, "editor-paste", _("Paste"), sigc::mem_fun(*this, &Editor::keyboard_paste));
@ -327,7 +339,9 @@ Editor::register_actions ()
sigc::mem_fun (ARDOUR_UI::instance(), &ARDOUR_UI::toggle_errors));
reg_sens (editor_actions, "tab-to-transient-forwards", _("Move Later to Transient"), sigc::bind (sigc::mem_fun(*this, &Editor::tab_to_transient), true));
reg_sens (editor_actions, "alternate-tab-to-transient-forwards", _("Move Later to Transient"), sigc::bind (sigc::mem_fun(*this, &Editor::tab_to_transient), true));
reg_sens (editor_actions, "tab-to-transient-backwards", _("Move Earlier to Transient"), sigc::bind (sigc::mem_fun(*this, &Editor::tab_to_transient), false));
reg_sens (editor_actions, "alternate-tab-to-transient-backwards", _("Move Earlier to Transient"), sigc::bind (sigc::mem_fun(*this, &Editor::tab_to_transient), false));
reg_sens (editor_actions, "crop", _("Crop"), sigc::mem_fun(*this, &Editor::crop_region_to_selection));
@ -489,7 +503,7 @@ Editor::register_actions ()
ActionManager::register_action (editor_actions, "set-edit-ripple", _("Ripple"), bind (mem_fun (*this, &Editor::set_edit_mode), Ripple));
ActionManager::register_action (editor_actions, "set-edit-slide", _("Slide"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Slide));
ActionManager::register_action (editor_actions, "set-edit-lock", _("Lock"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Lock));
ActionManager::register_action (editor_actions, "toggle-edit-mode", _("Toggle Edit Mode"), sigc::mem_fun (*this, &Editor::cycle_edit_mode));
ActionManager::register_action (editor_actions, "cycle-edit-mode", _("Cycle Edit Mode"), sigc::mem_fun (*this, &Editor::cycle_edit_mode));
ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap to"));
ActionManager::register_action (editor_actions, X_("SnapMode"), _("Snap Mode"));
@ -1868,7 +1882,10 @@ Editor::register_region_actions ()
);
reg_sens (_region_actions, "set-fade-in-length", _("Set Fade In Length"), sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_length), true));
reg_sens (_region_actions, "alternate-set-fade-in-length", _("Set Fade In Length"), sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_length), true));
reg_sens (_region_actions, "set-fade-out-length", _("Set Fade Out Length"), sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_length), false));
reg_sens (_region_actions, "alternate-set-fade-out-length", _("Set Fade Out Length"), sigc::bind (sigc::mem_fun (*this, &Editor::set_fade_length), false));
reg_sens (_region_actions, "set-tempo-from-region", _("Set Tempo from Region = Bar"), sigc::mem_fun (*this, &Editor::set_tempo_from_region));
reg_sens (
@ -1912,7 +1929,9 @@ Editor::register_region_actions ()
reg_sens (_region_actions, "set-selection-from-region", _("Set Range Selection"), sigc::mem_fun (*this, &Editor::set_selection_from_region));
reg_sens (_region_actions, "nudge-forward", _("Nudge Later"), sigc::bind (sigc::mem_fun (*this, &Editor::nudge_forward), false, false));
reg_sens (_region_actions, "alternate-nudge-forward", _("Nudge Later"), sigc::bind (sigc::mem_fun (*this, &Editor::nudge_forward), false, false));
reg_sens (_region_actions, "nudge-backward", _("Nudge Earlier"), sigc::bind (sigc::mem_fun (*this, &Editor::nudge_backward), false, false));
reg_sens (_region_actions, "alternate-nudge-backward", _("Nudge Earlier"), sigc::bind (sigc::mem_fun (*this, &Editor::nudge_backward), false, false));
reg_sens (_region_actions, "sequence-regions", _("Sequence Regions"), sigc::mem_fun (*this, &Editor::sequence_regions));

View File

@ -4349,8 +4349,11 @@ SelectionDrag::finished (GdkEvent* event, bool movement_occurred)
if ( s->get_play_range() && s->transport_rolling() ) {
s->request_play_range (&_editor->selection->time, true);
} else {
if (Config->get_always_play_range() && !s->transport_rolling()) {
s->request_locate (_editor->get_selection().time.start());
if (Config->get_follow_edits() && !s->transport_rolling()) {
if (_operation == SelectionEndTrim)
_editor->maybe_locate_with_edit_preroll( _editor->get_selection().time.end_frame());
else
s->request_locate (_editor->get_selection().time.start());
}
}
}

View File

@ -1293,7 +1293,7 @@ Editor::button_press_handler (ArdourCanvas::Item* item, GdkEvent* event, ItemTyp
}
//not rolling, range mode click + join_play_range : locate the PH here
if ( !_drags->active () && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && Config->get_always_play_range() ) {
if ( !_drags->active () && !_session->transport_rolling() && ( effective_mouse_mode() == MouseRange ) && Config->get_follow_edits() ) {
framepos_t where = canvas_event_sample (event);
snap_to(where);
_session->request_locate (where, false);

View File

@ -133,7 +133,8 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions)
{
bool frozen = false;
list <boost::shared_ptr<Playlist > > used_playlists;
list<boost::shared_ptr<Playlist> > used_playlists;
list<RouteTimeAxisView*> used_trackviews;
if (regions.empty()) {
return;
@ -188,9 +189,16 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions)
/* remember used playlists so we can thaw them later */
used_playlists.push_back(pl);
TimeAxisView& tv = (*a)->get_time_axis_view();
RouteTimeAxisView* rtv = dynamic_cast<RouteTimeAxisView*> (&tv);
if (rtv) {
used_trackviews.push_back (rtv);
}
pl->freeze();
}
if (pl) {
pl->clear_changes ();
pl->split_region ((*a)->region(), where);
@ -200,17 +208,34 @@ Editor::split_regions_at (framepos_t where, RegionSelection& regions)
a = tmp;
}
vector<sigc::connection> region_added_connections;
for (list<RouteTimeAxisView*>::iterator i = used_trackviews.begin(); i != used_trackviews.end(); ++i) {
region_added_connections.push_back ((*i)->view()->RegionViewAdded.connect (sigc::mem_fun(*this, &Editor::collect_new_region_view)));
}
latest_regionviews.clear ();
while (used_playlists.size() > 0) {
list <boost::shared_ptr<Playlist > >::iterator i = used_playlists.begin();
(*i)->thaw();
used_playlists.pop_front();
}
for (vector<sigc::connection>::iterator c = region_added_connections.begin(); c != region_added_connections.end(); ++c) {
(*c).disconnect ();
}
commit_reversible_command ();
if (frozen){
EditorThaw(); /* Emit Signal */
}
if (!latest_regionviews.empty()) {
selection->add (latest_regionviews);
}
}
/** Move one extreme of the current range selection. If more than one range is selected,
@ -1892,6 +1917,35 @@ Editor::add_location_from_playhead_cursor ()
add_location_mark (_session->audible_frame());
}
void
Editor::remove_location_at_playhead_cursor ()
{
if (_session) {
//set up for undo
_session->begin_reversible_command (_("remove marker"));
XMLNode &before = _session->locations()->get_state();
bool removed = false;
//find location(s) at this time
Locations::LocationList locs;
_session->locations()->find_all_between (_session->audible_frame(), _session->audible_frame()+1, locs, Location::Flags(0));
for (Locations::LocationList::iterator i = locs.begin(); i != locs.end(); ++i) {
if ((*i)->is_mark()) {
_session->locations()->remove (*i);
removed = true;
}
}
//store undo
if (removed) {
XMLNode &after = _session->locations()->get_state();
_session->add_command(new MementoCommand<Locations>(*(_session->locations()), &before, &after));
_session->commit_reversible_command ();
}
}
}
/** Add a range marker around each selected region */
void
Editor::add_locations_from_region ()
@ -2213,7 +2267,7 @@ Editor::get_preroll ()
void
Editor::maybe_locate_with_edit_preroll ( framepos_t location )
{
if ( _session->transport_rolling() || !Config->get_always_play_range() )
if ( _session->transport_rolling() || !Config->get_follow_edits() )
return;
location -= get_preroll();
@ -5535,7 +5589,7 @@ Editor::set_playhead_cursor ()
}
}
if ( Config->get_always_play_range() )
if ( Config->get_follow_edits() )
cancel_time_selection();
}

View File

@ -1013,10 +1013,6 @@ Editor::time_selection_changed ()
} else {
ActionManager::set_sensitive (ActionManager::time_selection_sensitive_actions, true);
}
if (_session && Config->get_always_play_range() && !_session->transport_rolling() && !selection->time.empty()) {
_session->request_locate (selection->time.start());
}
}
/** Set all region actions to have a given sensitivity */

View File

@ -1337,6 +1337,21 @@ EngineControl::set_state (const XMLNode& root)
/* now see if there was an active state and switch the setup to it */
// purge states of backend that are not available in this built
vector<const ARDOUR::AudioBackendInfo*> backends = ARDOUR::AudioEngine::instance()->available_backends();
vector<std::string> backend_names;
for (vector<const ARDOUR::AudioBackendInfo*>::const_iterator i = backends.begin(); i != backends.end(); ++i) {
backend_names.push_back((*i)->name);
}
for (StateList::iterator i = states.begin(); i != states.end();) {
if (std::find(backend_names.begin(), backend_names.end(), (*i)->backend) == backend_names.end()) {
i = states.erase(i);
} else {
++i;
}
}
for (StateList::const_iterator i = states.begin(); i != states.end(); ++i) {
if ((*i)->active) {

View File

@ -23,6 +23,7 @@
#include "ardour/filesystem_paths.h"
#include "ardour_ui.h"
#include "public_editor.h"
#include "keyboard.h"
#include "opts.h"

View File

@ -97,11 +97,6 @@ This mode provides many different operations on both regions and control points,
@eep|Editor/cycle-edit-point|grave|next EP w/o marker
@eep|Editor/cycle-edit-point-with-marker|<@PRIMARY@>grave|next EP w/marker
@aep|Editor/move-range-start-to-previous-region-boundary|less|range start to prev region edge
@aep|Editor/move-range-start-to-next-region-boundary|<@PRIMARY@>less|range start to next region edge
@aep|Editor/move-range-end-to-previous-region-boundary|<@PRIMARY@>greater|range end to next prev edge
@aep|Editor/move-range-end-to-next-region-boundary|greater|range end to next region edge
@trans|Transport/ToggleRoll|space|toggle roll
@epp|Editor/play-edit-range|<@SECONDARY@>space|play edit range
@epp|Editor/play-from-edit-point-and-return|<@LEVEL4@>space|play from EP \& return
@ -109,6 +104,11 @@ This mode provides many different operations on both regions and control points,
@trans|Transport/ToggleRollForgetCapture|<@PRIMARY@>space|stop and destroy
@trans|Transport/record-roll|<@TERTIARY@>space|start recording
@trans|Editor/add-location-from-playhead|nabla|add marker
@trans|Editor/remove-location-from-playhead|<@PRIMARY@>nabla|add marker
;@trans|Transport/GotoStart|Return|to start marker
@movp|Transport/alternate-GotoStart|KP_Return|to edit point
@rop|Region/set-fade-in-length|slash|set fade in length
@rop|Region/toggle-region-fade-out|<@PRIMARY@>slash|toggle fade in active
@rop|Region/set-fade-out-length|backslash|set fade out length
@ -143,6 +143,8 @@ This mode provides many different operations on both regions and control points,
@wvis|Common/goto-editor|<@WINDOW@>e|toggle editor window
@mmode|MouseMode/set-mouse-mode-range|r|range mode
@edit|Editor/redo|<@PRIMARY@>r|redo
@edit|Editor/alternate-redo|<@PRIMARY@>y|redo
@edit|Editor/alternate-alternate-redo|<@PRIMARY@><@TERTIARY@>z|redo
@rop|Region/reverse-region|<@SECONDARY@>r|reverse
@trans|Transport/Record|<@TERTIARY@>r|engage record
@mmode|MouseMode/set-mouse-mode-timefx|t|timefx mode
@ -257,12 +259,9 @@ This mode provides many different operations on both regions and control points,
@movp|Transport/GotoStart|Home|to start marker
@movp|Transport/GotoEnd|End|to end marker
@edit|Editor/editor-delete|Delete|delete
@edit|Editor/alternate-editor-delete|BackSpace|backspace (delete)
@movp|Editor/playhead-to-edit|Return|to edit point
@eep|Editor/edit-to-playhead|<@SECONDARY@>Return|move EP to playhead
@trans|Editor/remove-last-capture|<@PRIMARY@>Delete|destroy last recording
@-group|Editor/escape|Escape|break drag or deselect all
@select|Editor/escape|Escape|break drag or deselect all
;; keypad
@ -280,26 +279,28 @@ This mode provides many different operations on both regions and control points,
@-group|Editor/alt-start-range|<@PRIMARY@>KP_Down|some text
@-group|Editor/alt-finish-range|<@PRIMARY@>KP_Up|some text
@markers|Editor/add-location-from-playhead|KP_Enter|add mark at playhead
@markers|Editor/alternate-add-location-from-playhead|KP_Enter|add mark at playhead
@markers|Editor/alternate-remove-location-from-playhead|<@PRIMARY@>KP_Enter|add mark at playhead
@wvis|Transport/focus-on-clock|KP_Divide|focus on main clock
@movp|Transport/GotoZero|KP_0|to zero
@-group|Editor/goto-mark-1|KP_1|some text
@-group|Editor/goto-mark-2|KP_2|some text
@-group|Editor/goto-mark-3|KP_3|some text
@-group|Editor/goto-mark-4|KP_4|some text
@-group|Editor/goto-mark-5|KP_5|some text
@-group|Editor/goto-mark-6|KP_6|some text
@-group|Editor/goto-mark-7|KP_7|some text
@-group|Editor/goto-mark-8|KP_8|some text
@-group|Editor/goto-mark-9|KP_9|some text
@movp|Transport/numpad-decimal|KP_Decimal|numpad decimal should initiate and finalize a locate-to-marker
@movp|Transport/numpad-0|KP_0|some text
@-group|Transport/numpad-1|KP_1|some text
@-group|Transport/numpad-2|KP_2|some text
@-group|Transport/numpad-3|KP_3|some text
@-group|Transport/numpad-4|KP_4|some text
@-group|Transport/numpad-5|KP_5|some text
@-group|Transport/numpad-6|KP_6|some text
@-group|Transport/numpad-7|KP_7|some text
@-group|Transport/numpad-8|KP_8|some text
@-group|Transport/numpad-9|KP_9|some text
;; F-N keys
@-group|Editor/edit-cursor-to-range-start|F1|some text
@-group|Editor/edit-cursor-to-range-end|F2|some text
@-group|Editor/pitch-shift-region|F5|some text
@select|Editor/select-range-between-cursors|F6|convert edit range to range
@-group|Editor/save-visual-state-1|<@PRIMARY@>F1|some text
@-group|Editor/save-visual-state-2|<@PRIMARY@>F2|some text

View File

@ -213,6 +213,9 @@ class PublicEditor : public Gtk::Window, public PBD::StatefulDestructible, publi
virtual void play_selection () = 0;
virtual void play_with_preroll () = 0;
virtual void maybe_locate_with_edit_preroll (framepos_t location) = 0;
virtual void goto_nth_marker (int nth) = 0;
virtual void add_location_from_playhead_cursor () = 0;
virtual void remove_location_at_playhead_cursor () = 0;
virtual void set_show_measures (bool yn) = 0;
virtual bool show_measures () const = 0;

View File

@ -148,7 +148,7 @@ CONFIG_VARIABLE (bool, secondary_clock_delta_edit_cursor, "secondary-clock-delta
CONFIG_VARIABLE (bool, show_track_meters, "show-track-meters", true)
CONFIG_VARIABLE (bool, locate_while_waiting_for_sync, "locate-while-waiting-for-sync", false)
CONFIG_VARIABLE (bool, disable_disarm_during_roll, "disable-disarm-during-roll", false)
CONFIG_VARIABLE (bool, always_play_range, "always-play-range", false)
CONFIG_VARIABLE (bool, follow_edits, "follow-edits", false)
CONFIG_VARIABLE (bool, super_rapid_clock_update, "super-rapid-clock-update", false)
/* metering */

View File

@ -508,6 +508,7 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
framepos_t transport_frame () const {return _transport_frame; }
framepos_t audible_frame () const;
framepos_t requested_return_frame() const { return _requested_return_frame; }
void set_requested_return_frame(framepos_t return_to);
enum PullupFormat {
pullup_Plus4Plus1,

View File

@ -145,10 +145,12 @@ Route::init ()
_output->changed.connect_same_thread (*this, boost::bind (&Route::output_change_handler, this, _1, _2));
_output->PortCountChanging.connect_same_thread (*this, boost::bind (&Route::output_port_count_changing, this, _1));
#if 0 // not used - just yet
if (!is_master() && !is_monitor() && !is_auditioner()) {
_delayline.reset (new DelayLine (_session, _name));
add_processor (_delayline, PreFader);
}
#endif
/* add amp processor */
@ -2605,8 +2607,10 @@ Route::set_processor_state (const XMLNode& node)
_meter->set_state (**niter, Stateful::current_state_version);
new_order.push_back (_meter);
} else if (prop->value() == "delay") {
_delayline->set_state (**niter, Stateful::current_state_version);
new_order.push_back (_delayline);
if (_delayline) {
_delayline->set_state (**niter, Stateful::current_state_version);
new_order.push_back (_delayline);
}
} else if (prop->value() == "main-outs") {
_main_outs->set_state (**niter, Stateful::current_state_version);
} else if (prop->value() == "intreturn") {
@ -4141,9 +4145,11 @@ Route::setup_invisible_processors ()
}
}
#if 0 // not used - just yet
if (!is_master() && !is_monitor() && !is_auditioner()) {
new_processors.push_front (_delayline);
}
#endif
/* MONITOR CONTROL */

View File

@ -1635,6 +1635,13 @@ Session::request_bounded_roll (framepos_t start, framepos_t end)
lar.push_back (ar);
request_play_range (&lar, true);
}
void
Session::set_requested_return_frame (framepos_t return_to)
{
_requested_return_frame = return_to;
}
void
Session::request_roll_at_and_return (framepos_t start, framepos_t return_to)
{

View File

@ -920,23 +920,35 @@ WaveView::set_global_logscaled (bool yn)
}
void
WaveView::region_resized ()
WaveView::set_region_start (frameoffset_t start)
{
if (!_region) {
return;
}
/* special: do not use _region->length() here to compute
bounding box because it will already have changed.
if we have a bounding box, use it.
if (_region_start == start) {
return;
}
begin_change ();
_region_start = start;
_bounding_box_dirty = true;
end_change ();
}
void
WaveView::region_resized ()
{
/* Called when the region start or end (thus length) has changed.
*/
_pre_change_bounding_box = _bounding_box;
if (!_region) {
return;
}
begin_change ();
_region_start = _region->start();
_bounding_box_dirty = true;
compute_bounding_box ();
end_change ();
}

View File

@ -34,6 +34,8 @@
#include <gtkmm/accelmap.h>
#include <gtkmm/uimanager.h>
#include <glibmm/miscutils.h>
#include "pbd/error.h"
#include "gtkmm2ext/actions.h"
@ -235,6 +237,50 @@ ActionManager::get_all_actions (vector<string>& names, vector<string>& paths, ve
}
}
void
ActionManager::enable_accelerators ()
{
/* the C++ API for functions used here appears to be broken in
gtkmm2.6, so we fall back to the C level.
*/
GList* list = gtk_ui_manager_get_action_groups (ui_manager->gobj());
GList* node;
GList* acts;
string ui_string = "<ui>";
/* get all actions, build a string describing them all as <accelerator
* action="name"/>
*/
for (node = list; node; node = g_list_next (node)) {
GtkActionGroup* group = (GtkActionGroup*) node->data;
for (acts = gtk_action_group_list_actions (group); acts; acts = g_list_next (acts)) {
ui_string += "<accelerator action=\"";
/* OK, this is pretty stupid ... there is the full
* accel path returned by gtk_action_get_accel_path ()
* but of course the UIManager doesn't use that, but
* just a name, which is the last component of the
* path. What a totally ridiculous design.
*/
string fullpath = gtk_action_get_accel_path ((GtkAction*) acts->data);
ui_string += Glib::path_get_basename (fullpath);
ui_string += "\"/>";
}
}
ui_string += "</ui>";
/* and load it */
ui_manager->add_ui_from_string (ui_string);
}
struct ActionState {
GtkAction* action;
bool sensitive;

View File

@ -50,6 +50,7 @@ namespace ActionManager {
LIBGTKMM2EXT_API extern void set_toggle_action (const char* group, const char* name, bool);
LIBGTKMM2EXT_API extern void add_action_group (Glib::RefPtr<Gtk::ActionGroup>);
LIBGTKMM2EXT_API extern void enable_accelerators ();
LIBGTKMM2EXT_API extern Glib::RefPtr<Gtk::Action> register_action (Glib::RefPtr<Gtk::ActionGroup> group,
const char * name, const char * label);

View File

@ -155,6 +155,20 @@ XMLTree::write() const
xmlSetDocCompressMode(doc, _compression);
writenode(doc, _root, doc->children, 1);
result = xmlSaveFormatFileEnc(_filename.c_str(), doc, "UTF-8", 1);
#ifndef NDEBUG
if (result == -1) {
xmlErrorPtr xerr = xmlGetLastError ();
if (!xerr) {
std::cerr << "unknown XML error during xmlSaveFormatFileEnc()." << std::endl;
} else {
std::cerr << "xmlSaveFormatFileEnc: error"
<< " domain: " << xerr->domain
<< " code: " << xerr->code
<< " msg: " << xerr->message
<< std::endl;
}
}
#endif
xmlFreeDoc(doc);
if (result == -1) {