Editing from a control surface must have the ability to ignore mouse location.
Add mark_in and mark_out actions that explicitly use the playhead as the edit location.
This commit is contained in:
parent
458a2b723c
commit
3332633d19
@ -1497,8 +1497,8 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
|||||||
void set_loop_start_from_edit_point ();
|
void set_loop_start_from_edit_point ();
|
||||||
void set_loop_end_from_edit_point ();
|
void set_loop_end_from_edit_point ();
|
||||||
|
|
||||||
void keyboard_selection_begin ();
|
void keyboard_selection_begin ( Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE );
|
||||||
void keyboard_selection_finish (bool add);
|
void keyboard_selection_finish (bool add, Editing::EditIgnoreOption = Editing::EDIT_IGNORE_NONE);
|
||||||
bool have_pending_keyboard_selection;
|
bool have_pending_keyboard_selection;
|
||||||
framepos_t pending_keyboard_selection_start;
|
framepos_t pending_keyboard_selection_start;
|
||||||
|
|
||||||
|
@ -375,8 +375,11 @@ Editor::register_actions ()
|
|||||||
|
|
||||||
reg_sens (editor_actions, "crop", _("Crop"), sigc::mem_fun(*this, &Editor::crop_region_to_selection));
|
reg_sens (editor_actions, "crop", _("Crop"), sigc::mem_fun(*this, &Editor::crop_region_to_selection));
|
||||||
|
|
||||||
reg_sens (editor_actions, "start-range", _("Start Range"), sigc::mem_fun(*this, &Editor::keyboard_selection_begin));
|
reg_sens (editor_actions, "start-range-from-playhead", _("Start Range from Playhead"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_begin), EDIT_IGNORE_MOUSE ));
|
||||||
reg_sens (editor_actions, "finish-range", _("Finish Range"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_finish), false));
|
reg_sens (editor_actions, "finish-range-from-playhead", _("Finish Range from Playhead"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_finish), false, EDIT_IGNORE_MOUSE ));
|
||||||
|
|
||||||
|
reg_sens (editor_actions, "start-range", _("Start Range"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_begin), EDIT_IGNORE_NONE));
|
||||||
|
reg_sens (editor_actions, "finish-range", _("Finish Range"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_finish), false, EDIT_IGNORE_NONE));
|
||||||
|
|
||||||
reg_sens (editor_actions, "start-punch-range", _("Start Punch Range"), sigc::mem_fun(*this, &Editor::set_punch_start_from_edit_point));
|
reg_sens (editor_actions, "start-punch-range", _("Start Punch Range"), sigc::mem_fun(*this, &Editor::set_punch_start_from_edit_point));
|
||||||
reg_sens (editor_actions, "finish-punch-range", _("Finish Punch Range"), sigc::mem_fun(*this, &Editor::set_punch_end_from_edit_point));
|
reg_sens (editor_actions, "finish-punch-range", _("Finish Punch Range"), sigc::mem_fun(*this, &Editor::set_punch_end_from_edit_point));
|
||||||
@ -384,8 +387,8 @@ Editor::register_actions ()
|
|||||||
reg_sens (editor_actions, "start-loop-range", _("Start Loop Range"), sigc::mem_fun(*this, &Editor::set_loop_start_from_edit_point));
|
reg_sens (editor_actions, "start-loop-range", _("Start Loop Range"), sigc::mem_fun(*this, &Editor::set_loop_start_from_edit_point));
|
||||||
reg_sens (editor_actions, "finish-loop-range", _("Finish Loop Range"), sigc::mem_fun(*this, &Editor::set_loop_end_from_edit_point));
|
reg_sens (editor_actions, "finish-loop-range", _("Finish Loop Range"), sigc::mem_fun(*this, &Editor::set_loop_end_from_edit_point));
|
||||||
|
|
||||||
reg_sens (editor_actions, "alt-start-range", _("Start Range"), sigc::mem_fun(*this, &Editor::keyboard_selection_begin));
|
reg_sens (editor_actions, "alt-start-range", _("Start Range"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_begin), EDIT_IGNORE_NONE));
|
||||||
reg_sens (editor_actions, "alt-finish-range", _("Finish Range"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_finish), false));
|
reg_sens (editor_actions, "alt-finish-range", _("Finish Range"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_finish), false, EDIT_IGNORE_NONE));
|
||||||
|
|
||||||
// reg_sens (editor_actions, "finish-add-range", _("Finish Add Range"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_finish), true));
|
// reg_sens (editor_actions, "finish-add-range", _("Finish Add Range"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_finish), true));
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ using namespace PBD;
|
|||||||
using namespace Editing;
|
using namespace Editing;
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::keyboard_selection_finish (bool /*add*/)
|
Editor::keyboard_selection_finish (bool /*add*/, Editing::EditIgnoreOption ign)
|
||||||
{
|
{
|
||||||
if (_session) {
|
if (_session) {
|
||||||
|
|
||||||
@ -49,7 +49,7 @@ Editor::keyboard_selection_finish (bool /*add*/)
|
|||||||
if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
|
if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
|
||||||
end = _session->audible_frame();
|
end = _session->audible_frame();
|
||||||
} else {
|
} else {
|
||||||
end = get_preferred_edit_position();
|
end = get_preferred_edit_position(ign);
|
||||||
}
|
}
|
||||||
|
|
||||||
//snap the selection start/end
|
//snap the selection start/end
|
||||||
@ -69,7 +69,7 @@ Editor::keyboard_selection_finish (bool /*add*/)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Editor::keyboard_selection_begin ()
|
Editor::keyboard_selection_begin (Editing::EditIgnoreOption ign)
|
||||||
{
|
{
|
||||||
if (_session) {
|
if (_session) {
|
||||||
|
|
||||||
@ -77,9 +77,11 @@ Editor::keyboard_selection_begin ()
|
|||||||
framepos_t end = selection->time.end_frame(); //0 if no current selection
|
framepos_t end = selection->time.end_frame(); //0 if no current selection
|
||||||
|
|
||||||
if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
|
if ((_edit_point == EditAtPlayhead) && _session->transport_rolling()) {
|
||||||
|
printf("if you don't wait a second, this wil be wrong");
|
||||||
start = _session->audible_frame();
|
start = _session->audible_frame();
|
||||||
} else {
|
} else {
|
||||||
start = get_preferred_edit_position();
|
printf("keyboard_selection_begin:: getting pref\n");
|
||||||
|
start = get_preferred_edit_position(ign);
|
||||||
}
|
}
|
||||||
|
|
||||||
//snap the selection start/end
|
//snap the selection start/end
|
||||||
|
@ -357,8 +357,8 @@ BasicUI::jump_by_bars (double bars)
|
|||||||
session->request_locate ( session->convert_to_frames (any) );
|
session->request_locate ( session->convert_to_frames (any) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void BasicUI::mark_in () { access_action("Editor/start-range"); }
|
void BasicUI::mark_in () { access_action("Editor/start-range-from-playhead"); }
|
||||||
void BasicUI::mark_out () { access_action("Editor/finish-range"); }
|
void BasicUI::mark_out () { access_action("Editor/finish-range-from-playhead"); }
|
||||||
|
|
||||||
void BasicUI::toggle_click () { access_action("Transport/ToggleClick"); }
|
void BasicUI::toggle_click () { access_action("Transport/ToggleClick"); }
|
||||||
void BasicUI::midi_panic () { access_action("MIDI/panic"); }
|
void BasicUI::midi_panic () { access_action("MIDI/panic"); }
|
||||||
|
Loading…
Reference in New Issue
Block a user