mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-20 13:46:30 +01:00
trim at edit point added, keybindings altered (in progress); more subtle improvements to splice mode
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@2701 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
afb0c4246e
commit
c2b9f932c4
11 changed files with 87 additions and 20 deletions
|
|
@ -119,7 +119,7 @@
|
|||
<menuitem action='set-mouse-mode-timefx'/>
|
||||
<separator/>
|
||||
<menuitem action='cycle-edit-point'/>
|
||||
<menuitem action='cycle-edit-mode'/>
|
||||
<menuitem action='toggle-edit-mode'/>
|
||||
</menu>
|
||||
</menu>
|
||||
<menu name='Regions' action='Regions'>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
(gtk_accel_path "<Actions>/Editor/cycle-snap-mode" "<Alt>KP_Decimal")
|
||||
(gtk_accel_path "<Actions>/Editor/cycle-snap-choice" "KP_Decimal")
|
||||
(gtk_accel_path "<Actions>/Editor/cycle-edit-point" "KP_Divide")
|
||||
(gtk_accel_path "<Actions>/Editor/cycle-edit-mode" "KP_Multiply")
|
||||
(gtk_accel_path "<Actions>/Editor/toggle-edit-mode" "KP_Multiply")
|
||||
; (gtk_accel_path "<Actions>/redirectmenu/copy" "")
|
||||
; (gtk_accel_path "<Actions>/options/MeterFalloffFaster" "")
|
||||
(gtk_accel_path "<Actions>/Transport/ToggleRollForgetCapture" "<Control>space")
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
; (gtk_accel_path "<Actions>/Editor/snap-magnetic" "")
|
||||
; (gtk_accel_path "<Actions>/Editor/playhead-to-range-end" "")
|
||||
(gtk_accel_path "<Actions>/Editor/scroll-playhead-forward" "<Shift>rightarrow")
|
||||
(gtk_accel_path "<Actions>/Editor/align-regions-sync-relative" "a")
|
||||
(gtk_accel_path "<Actions>/Editor/align-regions-sync-relative" "y")
|
||||
; (gtk_accel_path "<Actions>/Editor/EditSelectRegionOptions" "")
|
||||
(gtk_accel_path "<Actions>/Editor/crop" "c")
|
||||
; (gtk_accel_path "<Actions>/redirectmenu/newsend" "")
|
||||
|
|
@ -131,7 +131,7 @@
|
|||
; (gtk_accel_path "<Actions>/RegionList/rlRemove" "")
|
||||
(gtk_accel_path "<Actions>/Transport/GotoStart" "Home")
|
||||
(gtk_accel_path "<Actions>/Editor/scroll-playhead-backward" "<Shift>leftarrow")
|
||||
(gtk_accel_path "<Actions>/Editor/split-region" "s")
|
||||
(gtk_accel_path "<Actions>/Editor/split-region" "d")
|
||||
; (gtk_accel_path "<Actions>/Transport/ToggleAutoInput" "")
|
||||
; (gtk_accel_path "<Actions>/Snap/snap-to-thirtyseconds" "")
|
||||
; (gtk_accel_path "<Actions>/Snap/snap-to-minutes" "")
|
||||
|
|
@ -241,7 +241,7 @@
|
|||
; (gtk_accel_path "<Actions>/Snap/snap-to-asixteenthbeat" "")
|
||||
(gtk_accel_path "<Actions>/Editor/select-all-in-punch-range" "<Control>d")
|
||||
; (gtk_accel_path "<Actions>/redirectmenu/edit" "")
|
||||
(gtk_accel_path "<Actions>/Editor/duplicate-region" "d")
|
||||
(gtk_accel_path "<Actions>/Editor/duplicate-region" "p")
|
||||
(gtk_accel_path "<Actions>/Editor/multi-duplicate-region" "<Alt>d")
|
||||
; (gtk_accel_path "<Actions>/JACK/JACKLatency2048" "")
|
||||
; (gtk_accel_path "<Actions>/Editor/ToggleWaveformsWhileRecording" "")
|
||||
|
|
@ -322,6 +322,8 @@
|
|||
(gtk_accel_path "<Actions>/Editor/set-fade-out-length" "backslash")
|
||||
(gtk_accel_path "<Actions>/Editor/trim-from-start" "<Shift>braceleft")
|
||||
(gtk_accel_path "<Actions>/Editor/trim-to-end" "<Shift>braceright")
|
||||
(gtk_accel_path "<Actions>/Editor/trim-front" "a")
|
||||
(gtk_accel_path "<Actions>/Editor/trim-back" "s")
|
||||
(gtk_accel_path "<Actions>/Editor/goto-mark-1" "KP_1")
|
||||
(gtk_accel_path "<Actions>/Editor/goto-mark-2" "KP_2")
|
||||
(gtk_accel_path "<Actions>/Editor/goto-mark-3" "KP_3")
|
||||
|
|
|
|||
|
|
@ -120,6 +120,9 @@
|
|||
<menuitem action='set-mouse-mode-gain'/>
|
||||
<menuitem action='set-mouse-mode-zoom'/>
|
||||
<menuitem action='set-mouse-mode-timefx'/>
|
||||
<separator/>
|
||||
<menuitem action='cycle-edit-point'/>
|
||||
<menuitem action='toggle-edit-mode'/>
|
||||
</menu>
|
||||
</menu>
|
||||
<menu name='Select' action='Select'>
|
||||
|
|
@ -164,6 +167,8 @@
|
|||
<menuitem action='set-fade-in-length'/>
|
||||
<menuitem action='set-fade-out-length'/>
|
||||
<separator/>
|
||||
<menuitem action='trim-back'/>
|
||||
<menuitem action='trim-front'/>
|
||||
<menuitem action='trim-from-start'/>
|
||||
<menuitem action='trim-to-end'/>
|
||||
<menuitem action='trim-region-to-loop'/>
|
||||
|
|
|
|||
|
|
@ -1633,6 +1633,10 @@ class Editor : public PublicEditor
|
|||
void trim_finished_callback (ArdourCanvas::Item*, GdkEvent*);
|
||||
void thaw_region_after_trim (RegionView& rv);
|
||||
|
||||
void trim_region_front();
|
||||
void trim_region_back();
|
||||
void trim_region (bool front);
|
||||
|
||||
void trim_region_to_edit_point ();
|
||||
void trim_region_from_edit_point ();
|
||||
void trim_region_to_loop ();
|
||||
|
|
|
|||
|
|
@ -222,6 +222,10 @@ Editor::register_actions ()
|
|||
act = ActionManager::register_action (editor_actions, "edit-to-playhead", _("Edit to Playhead"), bind (mem_fun(*this, &Editor::cursor_align), false));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_action (editor_actions, "trim-front", _("Trim front at edit point"), mem_fun(*this, &Editor::trim_region_front));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
act = ActionManager::register_action (editor_actions, "trim-back", _("Trim back at edit point"), mem_fun(*this, &Editor::trim_region_back));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
||||
act = ActionManager::register_action (editor_actions, "trim-from-start", _("Start to edit point"), mem_fun(*this, &Editor::trim_region_from_edit_point));
|
||||
ActionManager::session_sensitive_actions.push_back (act);
|
||||
|
|
|
|||
|
|
@ -3029,6 +3029,13 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
|
|||
|
||||
if ((pointer_y_span = (drag_info.last_trackview->order - tv->order)) != 0) {
|
||||
|
||||
/* drop any splice-induced selection madness */
|
||||
|
||||
if (!pre_drag_region_selection.empty()) {
|
||||
selection->set (pre_drag_region_selection);
|
||||
pre_drag_region_selection.clear ();
|
||||
}
|
||||
|
||||
int32_t children = 0, numtracks = 0;
|
||||
// XXX hard coding track limit, oh my, so very very bad
|
||||
bitset <1024> tracks (0x00);
|
||||
|
|
|
|||
|
|
@ -4152,3 +4152,43 @@ Editor::ensure_entered_selected (bool op_really_wants_one_region_if_none_are_sel
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
Editor::trim_region_front ()
|
||||
{
|
||||
trim_region (true);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::trim_region_back ()
|
||||
{
|
||||
trim_region (false);
|
||||
}
|
||||
|
||||
void
|
||||
Editor::trim_region (bool front)
|
||||
{
|
||||
nframes64_t where = get_preferred_edit_position();
|
||||
RegionSelection& rs = get_regions_for_action ();
|
||||
|
||||
if (rs.empty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
begin_reversible_command (front ? _("trim front") : _("trim back"));
|
||||
|
||||
for (list<RegionView*>::const_iterator i = rs.by_layer().begin(); i != rs.by_layer().end(); ++i) {
|
||||
if (!(*i)->region()->locked()) {
|
||||
boost::shared_ptr<Playlist> pl = (*i)->region()->playlist();
|
||||
XMLNode &before = pl->get_state();
|
||||
if (front) {
|
||||
(*i)->region()->trim_front (where, this);
|
||||
} else {
|
||||
(*i)->region()->trim_end (where, this);
|
||||
}
|
||||
XMLNode &after = pl->get_state();
|
||||
session->add_command(new MementoCommand<Playlist>(*pl.get(), &before, &after));
|
||||
}
|
||||
}
|
||||
commit_reversible_command ();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -167,9 +167,9 @@ class AudioRegion : public Region
|
|||
nframes_t skip_frames = 0) const;
|
||||
|
||||
bool verify_start (nframes_t position);
|
||||
bool verify_length (nframes_t position);
|
||||
bool verify_length (nframes_t& length);
|
||||
bool verify_start_mutable (nframes_t& start);
|
||||
bool verify_start_and_length (nframes_t start, nframes_t length);
|
||||
bool verify_start_and_length (nframes_t start, nframes_t& length);
|
||||
void recompute_at_start ();
|
||||
void recompute_at_end ();
|
||||
|
||||
|
|
|
|||
|
|
@ -209,9 +209,9 @@ class Region : public PBD::StatefulDestructible, public boost::enable_shared_fro
|
|||
void first_edit ();
|
||||
|
||||
virtual bool verify_start (nframes_t) = 0;
|
||||
virtual bool verify_start_and_length (nframes_t, nframes_t) = 0;
|
||||
virtual bool verify_start_and_length (nframes_t, nframes_t&) = 0;
|
||||
virtual bool verify_start_mutable (nframes_t&_start) = 0;
|
||||
virtual bool verify_length (nframes_t) = 0;
|
||||
virtual bool verify_length (nframes_t&) = 0;
|
||||
virtual void recompute_at_start () = 0;
|
||||
virtual void recompute_at_end () = 0;
|
||||
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ AudioRegion::listen_to_my_curves ()
|
|||
}
|
||||
|
||||
bool
|
||||
AudioRegion::verify_length (nframes_t len)
|
||||
AudioRegion::verify_length (nframes_t& len)
|
||||
{
|
||||
boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource>(source());
|
||||
|
||||
|
|
@ -338,16 +338,19 @@ AudioRegion::verify_length (nframes_t len)
|
|||
return true;
|
||||
}
|
||||
|
||||
nframes_t maxlen = 0;
|
||||
|
||||
for (uint32_t n=0; n < sources.size(); ++n) {
|
||||
if (_start > sources[n]->length() - len) {
|
||||
return false;
|
||||
}
|
||||
maxlen = max (maxlen, sources[n]->length() - _start);
|
||||
}
|
||||
|
||||
len = min (len, maxlen);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
AudioRegion::verify_start_and_length (nframes_t new_start, nframes_t new_length)
|
||||
AudioRegion::verify_start_and_length (nframes_t new_start, nframes_t& new_length)
|
||||
{
|
||||
boost::shared_ptr<AudioFileSource> afs = boost::dynamic_pointer_cast<AudioFileSource>(source());
|
||||
|
||||
|
|
@ -355,11 +358,14 @@ AudioRegion::verify_start_and_length (nframes_t new_start, nframes_t new_length)
|
|||
return true;
|
||||
}
|
||||
|
||||
nframes_t maxlen = 0;
|
||||
|
||||
for (uint32_t n=0; n < sources.size(); ++n) {
|
||||
if (new_length > sources[n]->length() - new_start) {
|
||||
return false;
|
||||
}
|
||||
maxlen = max (maxlen, sources[n]->length() - new_start);
|
||||
}
|
||||
|
||||
new_length = min (new_length, maxlen);
|
||||
|
||||
return true;
|
||||
}
|
||||
bool
|
||||
|
|
|
|||
|
|
@ -1155,11 +1155,10 @@ Playlist::region_bounds_changed (Change what_changed, boost::shared_ptr<Region>
|
|||
|
||||
if (what_changed & ARDOUR::LengthChanged) {
|
||||
delta += (nframes64_t) region->length() - (nframes64_t) region->last_length();
|
||||
|
||||
}
|
||||
|
||||
if (delta) {
|
||||
possibly_splice (region->last_position(), delta, region);
|
||||
possibly_splice (region->last_position() + region->last_length(), delta, region);
|
||||
}
|
||||
|
||||
if (holding_state ()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue