Cut and Copy should remember the white space at the end of a range.
This will be used when you paste with Ripple; it maintains the whitespace that you chose in the selection. Also fix default setting of Dim contol by storing the default(normal) value for MPControl Controllables.
This commit is contained in:
parent
1bbb60df5d
commit
e85ff4dad2
|
@ -1521,7 +1521,7 @@ RouteTimeAxisView::paste (framepos_t pos, float times, Selection& selection, siz
|
||||||
|
|
||||||
pl->clear_changes ();
|
pl->clear_changes ();
|
||||||
if (Config->get_edit_mode() == Ripple) {
|
if (Config->get_edit_mode() == Ripple) {
|
||||||
std::pair<framepos_t, framepos_t> extent = (*p)->get_extent();
|
std::pair<framepos_t, framepos_t> extent = (*p)->get_extent_with_endspace();
|
||||||
framecnt_t amount = extent.second - extent.first;
|
framecnt_t amount = extent.second - extent.first;
|
||||||
pl->ripple(pos, amount * times, boost::shared_ptr<Region>());
|
pl->ripple(pos, amount * times, boost::shared_ptr<Region>());
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,7 @@ public:
|
||||||
MPControl (T initial, const std::string& name, PBD::Controllable::Flag flag,
|
MPControl (T initial, const std::string& name, PBD::Controllable::Flag flag,
|
||||||
float lower = 0.0f, float upper = 1.0f)
|
float lower = 0.0f, float upper = 1.0f)
|
||||||
: PBD::Controllable (name, flag)
|
: PBD::Controllable (name, flag)
|
||||||
|
, _normal (initial)
|
||||||
, _value (initial)
|
, _value (initial)
|
||||||
, _lower (lower)
|
, _lower (lower)
|
||||||
, _upper (upper)
|
, _upper (upper)
|
||||||
|
@ -76,6 +77,7 @@ public:
|
||||||
|
|
||||||
double lower () const { return _lower; }
|
double lower () const { return _lower; }
|
||||||
double upper () const { return _upper; }
|
double upper () const { return _upper; }
|
||||||
|
double normal () const { return _normal; }
|
||||||
|
|
||||||
/* "access as T" API */
|
/* "access as T" API */
|
||||||
|
|
||||||
|
@ -114,6 +116,7 @@ protected:
|
||||||
T _value;
|
T _value;
|
||||||
T _lower;
|
T _lower;
|
||||||
T _upper;
|
T _upper;
|
||||||
|
T _normal;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LIBARDOUR_API MonitorProcessor : public Processor
|
class LIBARDOUR_API MonitorProcessor : public Processor
|
||||||
|
|
|
@ -120,6 +120,7 @@ public:
|
||||||
uint32_t n_regions() const;
|
uint32_t n_regions() const;
|
||||||
bool all_regions_empty() const;
|
bool all_regions_empty() const;
|
||||||
std::pair<framepos_t, framepos_t> get_extent () const;
|
std::pair<framepos_t, framepos_t> get_extent () const;
|
||||||
|
std::pair<framepos_t, framepos_t> get_extent_with_endspace() const;
|
||||||
layer_t top_layer() const;
|
layer_t top_layer() const;
|
||||||
|
|
||||||
EditMode get_edit_mode() const { return _edit_mode; }
|
EditMode get_edit_mode() const { return _edit_mode; }
|
||||||
|
@ -396,6 +397,8 @@ public:
|
||||||
void setup_layering_indices (RegionList const &);
|
void setup_layering_indices (RegionList const &);
|
||||||
void coalesce_and_check_crossfades (std::list<Evoral::Range<framepos_t> >);
|
void coalesce_and_check_crossfades (std::list<Evoral::Range<framepos_t> >);
|
||||||
boost::shared_ptr<RegionList> find_regions_at (framepos_t);
|
boost::shared_ptr<RegionList> find_regions_at (framepos_t);
|
||||||
|
|
||||||
|
framepos_t _end_space; //this is used when we are pasting a range with extra space at the end
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace ARDOUR */
|
} /* namespace ARDOUR */
|
||||||
|
|
|
@ -256,6 +256,10 @@ Playlist::Playlist (boost::shared_ptr<const Playlist> other, framepos_t start, f
|
||||||
add_region_internal (new_region, position);
|
add_region_internal (new_region, position);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//keep track of any dead space at end (for pasting into Ripple or Splice mode)
|
||||||
|
//at the end of construction, any length of cnt beyond the extents of the regions is end_space
|
||||||
|
_end_space = cnt - (get_extent().second - get_extent().first);
|
||||||
|
|
||||||
in_set_state--;
|
in_set_state--;
|
||||||
first_set_state = false;
|
first_set_state = false;
|
||||||
}
|
}
|
||||||
|
@ -315,6 +319,7 @@ Playlist::init (bool hide)
|
||||||
_frozen = false;
|
_frozen = false;
|
||||||
_capture_insertion_underway = false;
|
_capture_insertion_underway = false;
|
||||||
_combine_ops = 0;
|
_combine_ops = 0;
|
||||||
|
_end_space = 0;
|
||||||
|
|
||||||
_session.history().BeginUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::begin_undo, this));
|
_session.history().BeginUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::begin_undo, this));
|
||||||
_session.history().EndUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::end_undo, this));
|
_session.history().EndUndoRedo.connect_same_thread (*this, boost::bind (&Playlist::end_undo, this));
|
||||||
|
@ -1104,6 +1109,10 @@ Playlist::flush_notifications (bool from_undo)
|
||||||
|
|
||||||
in_partition = false;
|
in_partition = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//keep track of any dead space at end (for pasting into Ripple or Splice mode)
|
||||||
|
framepos_t wanted_length = end-start;
|
||||||
|
_end_space = wanted_length - get_extent().second-get_extent().first;
|
||||||
}
|
}
|
||||||
|
|
||||||
boost::shared_ptr<Playlist>
|
boost::shared_ptr<Playlist>
|
||||||
|
@ -1188,7 +1197,8 @@ Playlist::flush_notifications (bool from_undo)
|
||||||
new_name += '.';
|
new_name += '.';
|
||||||
new_name += buf;
|
new_name += buf;
|
||||||
|
|
||||||
cnt = min (_get_extent().second - start, cnt);
|
// cnt = min (_get_extent().second - start, cnt); (We need the full range length when copy/pasting in Ripple. Why was this limit here? It's not in CUT... )
|
||||||
|
|
||||||
return PlaylistFactory::create (shared_from_this(), start, cnt, new_name, result_is_hidden);
|
return PlaylistFactory::create (shared_from_this(), start, cnt, new_name, result_is_hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2242,6 +2252,14 @@ Playlist::get_extent () const
|
||||||
return _get_extent ();
|
return _get_extent ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pair<framepos_t, framepos_t>
|
||||||
|
Playlist::get_extent_with_endspace () const
|
||||||
|
{
|
||||||
|
pair<framepos_t, framepos_t> l = get_extent();
|
||||||
|
l.second += _end_space;
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
|
||||||
pair<framepos_t, framepos_t>
|
pair<framepos_t, framepos_t>
|
||||||
Playlist::_get_extent () const
|
Playlist::_get_extent () const
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user