mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-16 11:46:25 +01:00
NO-OP: whitespace
* Remove leading and trailing whitespace.
* use tabs to indent, space to align
/* prefer C-style comments like this,
* always use an asterisk on every line, this
* way small ASCII-graphics are always aligned
* using spaces after the asterisk.
*
* ^
* / \
* / \
* / \
* / \
* / \
* / /\ \
* /__/ \_/\_^__\
* A R D O U R
*
<< NO asterisk, there may be tabs :(
*
*/
This commit is contained in:
parent
9ec031cfce
commit
19a2d384fc
2 changed files with 634 additions and 662 deletions
|
|
@ -53,7 +53,7 @@ class Crossfade;
|
|||
|
||||
namespace Properties {
|
||||
/* fake the type, since regions are handled by SequenceProperty which doesn't
|
||||
care about such things.
|
||||
* care about such things.
|
||||
*/
|
||||
LIBARDOUR_API extern PBD::PropertyDescriptor<bool> regions;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,8 +63,6 @@ struct ShowMeTheList {
|
|||
string name;
|
||||
};
|
||||
|
||||
|
||||
|
||||
void
|
||||
Playlist::make_property_quarks ()
|
||||
{
|
||||
|
|
@ -102,8 +100,8 @@ RegionListProperty::create () const
|
|||
void
|
||||
RegionListProperty::get_content_as_xml (boost::shared_ptr<Region> region, XMLNode & node) const
|
||||
{
|
||||
/* All regions (even those which are deleted) have their state saved by other
|
||||
code, so we can just store ID here.
|
||||
/* All regions (even those which are deleted) have their state
|
||||
* saved by other code, so we can just store ID here.
|
||||
*/
|
||||
|
||||
node.set_property ("id", region->id());
|
||||
|
|
@ -349,10 +347,9 @@ Playlist::~Playlist ()
|
|||
void
|
||||
Playlist::_set_sort_id ()
|
||||
{
|
||||
/*
|
||||
Playlists are given names like <track name>.<id>
|
||||
or <track name>.<edit group name>.<id> where id
|
||||
is an integer. We extract the id and sort by that.
|
||||
/* Playlists are given names like <track name>.<id>
|
||||
* or <track name>.<edit group name>.<id> where id
|
||||
* is an integer. We extract the id and sort by that.
|
||||
*/
|
||||
|
||||
size_t dot_position = _name.val().find_last_of(".");
|
||||
|
|
@ -372,9 +369,9 @@ bool
|
|||
Playlist::set_name (const string& str)
|
||||
{
|
||||
/* in a typical situation, a playlist is being used
|
||||
by one diskstream and also is referenced by the
|
||||
Session. if there are more references than that,
|
||||
then don't change the name.
|
||||
* by one diskstream and also is referenced by the
|
||||
* Session. if there are more references than that,
|
||||
* then don't change the name.
|
||||
*/
|
||||
|
||||
if (_refcnt > 2) {
|
||||
|
|
@ -389,11 +386,11 @@ Playlist::set_name (const string& str)
|
|||
}
|
||||
|
||||
/***********************************************************************
|
||||
CHANGE NOTIFICATION HANDLING
|
||||
|
||||
Notifications must be delayed till the region_lock is released. This
|
||||
is necessary because handlers for the signals may need to acquire
|
||||
the lock (e.g. to read from the playlist).
|
||||
* CHANGE NOTIFICATION HANDLING
|
||||
*
|
||||
* Notifications must be delayed till the region_lock is released. This
|
||||
* is necessary because handlers for the signals may need to acquire
|
||||
* the lock (e.g. to read from the playlist).
|
||||
***********************************************************************/
|
||||
|
||||
void
|
||||
|
|
@ -546,7 +543,7 @@ void
|
|||
Playlist::notify_region_added (boost::shared_ptr<Region> r)
|
||||
{
|
||||
/* the length change might not be true, but we have to act
|
||||
as though it could be.
|
||||
* as though it could be.
|
||||
*/
|
||||
|
||||
if (holding_state()) {
|
||||
|
|
@ -583,9 +580,9 @@ Playlist::flush_notifications (bool from_undo)
|
|||
*/
|
||||
|
||||
/* we have no idea what order the regions ended up in pending
|
||||
bounds (it could be based on selection order, for example).
|
||||
so, to preserve layering in the "most recently moved is higher"
|
||||
model, sort them by existing layer, then timestamp them.
|
||||
* bounds (it could be based on selection order, for example).
|
||||
* so, to preserve layering in the "most recently moved is higher"
|
||||
* model, sort them by existing layer, then timestamp them.
|
||||
*/
|
||||
|
||||
// RegionSortByLayer cmp;
|
||||
|
|
@ -661,7 +658,7 @@ Playlist::clear_pending ()
|
|||
}
|
||||
|
||||
/*************************************************************
|
||||
PLAYLIST OPERATIONS
|
||||
* PLAYLIST OPERATIONS
|
||||
*************************************************************/
|
||||
|
||||
/** Note: this calls set_layer (..., DBL_MAX) so it will reset the layering index of region */
|
||||
|
|
@ -692,7 +689,7 @@ Playlist::add_region (boost::shared_ptr<Region> region, samplepos_t position, fl
|
|||
}
|
||||
|
||||
/* note that itimes can be zero if we being asked to just
|
||||
insert a single fraction of the region.
|
||||
* insert a single fraction of the region.
|
||||
*/
|
||||
|
||||
for (int i = 0; i < itimes; ++i) {
|
||||
|
|
@ -918,7 +915,6 @@ static void maybe_add_start_beats (TempoMap const& tm, PropertyList& plist, boos
|
|||
* start and end if cutting == true. Regions that lie entirely within start and end are always
|
||||
* removed.
|
||||
*/
|
||||
|
||||
void
|
||||
Playlist::partition_internal (samplepos_t start, samplepos_t end, bool cutting, RegionList& thawlist)
|
||||
{
|
||||
|
|
@ -935,8 +931,8 @@ Playlist::partition_internal (samplepos_t start, samplepos_t end, bool cutting,
|
|||
|
||||
in_partition = true;
|
||||
|
||||
/* need to work from a copy, because otherwise the regions we add during the process
|
||||
get operated on as well.
|
||||
/* need to work from a copy, because otherwise the regions we add
|
||||
* during the process get operated on as well.
|
||||
*/
|
||||
|
||||
RegionList copy = regions.rlist();
|
||||
|
|
@ -958,8 +954,8 @@ Playlist::partition_internal (samplepos_t start, samplepos_t end, bool cutting,
|
|||
}
|
||||
|
||||
/* coverage will return OverlapStart if the start coincides
|
||||
with the end point. we do not partition such a region,
|
||||
so catch this special case.
|
||||
* with the end point. we do not partition such a region,
|
||||
* so catch this special case.
|
||||
*/
|
||||
|
||||
if (current->first_sample() >= end) {
|
||||
|
|
@ -977,18 +973,16 @@ Playlist::partition_internal (samplepos_t start, samplepos_t end, bool cutting,
|
|||
|
||||
if (overlap == Evoral::OverlapInternal) {
|
||||
/* split: we need 3 new regions, the front, middle and end.
|
||||
cut: we need 2 regions, the front and end.
|
||||
*/
|
||||
|
||||
/*
|
||||
start end
|
||||
---------------*************************------------
|
||||
P1 P2 P3 P4
|
||||
SPLIT:
|
||||
---------------*****++++++++++++++++====------------
|
||||
CUT
|
||||
---------------*****----------------====------------
|
||||
|
||||
* cut: we need 2 regions, the front and end.
|
||||
*
|
||||
*
|
||||
* start end
|
||||
* ---------------*************************------------
|
||||
* P1 P2 P3 P4
|
||||
* SPLIT:
|
||||
* ---------------*****++++++++++++++++====------------
|
||||
* CUT
|
||||
* ---------------*****----------------====------------
|
||||
*/
|
||||
|
||||
if (!cutting) {
|
||||
|
|
@ -1088,19 +1082,17 @@ Playlist::partition_internal (samplepos_t start, samplepos_t end, bool cutting,
|
|||
} else if (overlap == Evoral::OverlapStart) {
|
||||
|
||||
/* split: we need 2 regions: the front and the end.
|
||||
cut: just trim current to skip the cut area
|
||||
*/
|
||||
|
||||
/*
|
||||
start end
|
||||
---------------*************************------------
|
||||
P2 P1 P3 P4
|
||||
|
||||
SPLIT:
|
||||
---------------****+++++++++++++++++++++------------
|
||||
CUT:
|
||||
-------------------*********************------------
|
||||
|
||||
* cut: just trim current to skip the cut area
|
||||
*
|
||||
*
|
||||
* start end
|
||||
* ---------------*************************------------
|
||||
* P2 P1 P3 P4
|
||||
*
|
||||
* SPLIT:
|
||||
* ---------------****+++++++++++++++++++++------------
|
||||
* CUT:
|
||||
* -------------------*********************------------
|
||||
*/
|
||||
|
||||
if (!cutting) {
|
||||
|
|
@ -1133,19 +1125,19 @@ Playlist::partition_internal (samplepos_t start, samplepos_t end, bool cutting,
|
|||
} else if (overlap == Evoral::OverlapExternal) {
|
||||
|
||||
/* split: no split required.
|
||||
cut: remove the region.
|
||||
*/
|
||||
|
||||
/*
|
||||
start end
|
||||
---------------*************************------------
|
||||
P2 P1 P3 P4
|
||||
|
||||
SPLIT:
|
||||
---------------*************************------------
|
||||
CUT:
|
||||
----------------------------------------------------
|
||||
|
||||
* cut: remove the region.
|
||||
*
|
||||
*
|
||||
* start end
|
||||
* ---------------*************************------------
|
||||
* P2 P1 P3 P4
|
||||
*
|
||||
*
|
||||
* SPLIT:
|
||||
* ---------------*************************------------
|
||||
* CUT:
|
||||
* ----------------------------------------------------
|
||||
*
|
||||
*/
|
||||
|
||||
if (cutting) {
|
||||
|
|
@ -1186,8 +1178,8 @@ Playlist::cut_copy (boost::shared_ptr<Playlist> (Playlist::*pmf)(samplepos_t, sa
|
|||
} else {
|
||||
|
||||
/* paste the next section into the nascent playlist,
|
||||
offset to reflect the start of the first range we
|
||||
chopped.
|
||||
* offset to reflect the start of the first range we
|
||||
* chopped.
|
||||
*/
|
||||
|
||||
ret->paste (pl, (*i).start - start, 1.0f, 0);
|
||||
|
|
@ -1423,7 +1415,7 @@ Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float times)
|
|||
}
|
||||
|
||||
/* do not move regions glued to music time - that
|
||||
has to be done separately.
|
||||
* has to be done separately.
|
||||
*/
|
||||
|
||||
if (!ignore_music_glue && (*r)->position_lock_style() != AudioTime) {
|
||||
|
|
@ -1446,8 +1438,7 @@ Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float times)
|
|||
RegionWriteLock rlock (this);
|
||||
RegionList copy (regions.rlist());
|
||||
|
||||
/* use a copy since this operation can modify the region list
|
||||
*/
|
||||
/* use a copy since this operation can modify the region list */
|
||||
|
||||
for (RegionList::iterator r = copy.begin(); r != copy.end(); ++r) {
|
||||
_split_region (*r, at);
|
||||
|
|
@ -1498,8 +1489,8 @@ Playlist::duplicate_ranges (std::list<AudioRange>& ranges, float times)
|
|||
plist.add (Properties::layer, region->layer ());
|
||||
|
||||
/* note: we must use the version of ::create with an offset here,
|
||||
since it supplies that offset to the Region constructor, which
|
||||
is necessary to get audio region gain envelopes right.
|
||||
* since it supplies that offset to the Region constructor, which
|
||||
* is necessary to get audio region gain envelopes right.
|
||||
*/
|
||||
left = RegionFactory::create (region, MusicSample (0, 0), plist, true);
|
||||
}
|
||||
|
|
@ -1686,7 +1677,7 @@ Playlist::region_bounds_changed (const PropertyChange& what_changed, boost::shar
|
|||
if (what_changed.contains (Properties::position)) {
|
||||
|
||||
/* remove it from the list then add it back in
|
||||
the right place again.
|
||||
* the right place again.
|
||||
*/
|
||||
|
||||
RegionSortByPosition cmp;
|
||||
|
|
@ -1695,8 +1686,8 @@ Playlist::region_bounds_changed (const PropertyChange& what_changed, boost::shar
|
|||
|
||||
if (i == regions.end()) {
|
||||
/* the region bounds are being modified but its not currently
|
||||
in the region list. we will use its bounds correctly when/if
|
||||
it is added
|
||||
* in the region list. we will use its bounds correctly when/if
|
||||
* it is added
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
|
@ -1785,7 +1776,7 @@ Playlist::region_bounds_changed (const PropertyChange& what_changed, boost::shar
|
|||
}
|
||||
|
||||
/* don't notify about layer changes, since we are the only object that can initiate
|
||||
them, and we notify in ::relayer()
|
||||
* them, and we notify in ::relayer()
|
||||
*/
|
||||
|
||||
if (what_changed.contains (our_interests)) {
|
||||
|
|
@ -1896,7 +1887,6 @@ Playlist::regions_at (samplepos_t sample)
|
|||
|
||||
boost::shared_ptr<Region>
|
||||
Playlist::top_region_at (samplepos_t sample)
|
||||
|
||||
{
|
||||
RegionReadLock rlock (this);
|
||||
boost::shared_ptr<RegionList> rlist = find_regions_at (sample);
|
||||
|
|
@ -1913,7 +1903,6 @@ Playlist::regions_at (samplepos_t sample)
|
|||
|
||||
boost::shared_ptr<Region>
|
||||
Playlist::top_unmuted_region_at (samplepos_t sample)
|
||||
|
||||
{
|
||||
RegionReadLock rlock (this);
|
||||
boost::shared_ptr<RegionList> rlist = find_regions_at (sample);
|
||||
|
|
@ -2205,12 +2194,8 @@ Playlist::find_next_region (samplepos_t sample, RegionPoint point, int dir)
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
void
|
||||
Playlist::mark_session_dirty ()
|
||||
{
|
||||
|
|
@ -2514,7 +2499,6 @@ struct RelayerSort {
|
|||
* regions in the playlist to put the specified region in the appropriate
|
||||
* place. The actual layering will be fixed up when relayer() happens.
|
||||
*/
|
||||
|
||||
void
|
||||
Playlist::set_layer (boost::shared_ptr<Region> region, double new_layer)
|
||||
{
|
||||
|
|
@ -2569,9 +2553,9 @@ Playlist::relayer ()
|
|||
}
|
||||
|
||||
/* Build up a new list of regions on each layer, stored in a set of lists
|
||||
each of which represent some period of time on some layer. The idea
|
||||
is to avoid having to search the entire region list to establish whether
|
||||
each region overlaps another */
|
||||
* each of which represent some period of time on some layer. The idea
|
||||
* is to avoid having to search the entire region list to establish whether
|
||||
* each region overlaps another */
|
||||
|
||||
/* how many pieces to divide this playlist's time up into */
|
||||
int const divisions = 512;
|
||||
|
|
@ -2609,8 +2593,8 @@ Playlist::relayer ()
|
|||
for (RegionList::iterator i = copy.begin(); i != copy.end(); ++i) {
|
||||
|
||||
/* find the time divisions that this region covers; if there are no regions on the list,
|
||||
division_size will equal 0 and in this case we'll just say that
|
||||
start_division = end_division = 0.
|
||||
* division_size will equal 0 and in this case we'll just say that
|
||||
* start_division = end_division = 0.
|
||||
*/
|
||||
int start_division = 0;
|
||||
int end_division = 0;
|
||||
|
|
@ -2629,7 +2613,7 @@ Playlist::relayer ()
|
|||
size_t j = layers.size();
|
||||
while (j > 0) {
|
||||
/* try layer j - 1; it can go on if it overlaps no other region
|
||||
that is already on that layer
|
||||
* that is already on that layer
|
||||
*/
|
||||
|
||||
bool overlap = false;
|
||||
|
|
@ -2670,16 +2654,16 @@ Playlist::relayer ()
|
|||
}
|
||||
|
||||
/* It's a little tricky to know when we could avoid calling this; e.g. if we are
|
||||
relayering because we just removed the only region on the top layer, nothing will
|
||||
appear to have changed, but the StreamView must still sort itself out. We could
|
||||
probably keep a note of the top layer last time we relayered, and check that,
|
||||
but premature optimisation &c...
|
||||
* relayering because we just removed the only region on the top layer, nothing will
|
||||
* appear to have changed, but the StreamView must still sort itself out. We could
|
||||
* probably keep a note of the top layer last time we relayered, and check that,
|
||||
* but premature optimisation &c...
|
||||
*/
|
||||
notify_layering_changed ();
|
||||
|
||||
/* This relayer() may have been called as a result of a region removal, in which
|
||||
case we need to setup layering indices to account for the one that has just
|
||||
gone away.
|
||||
* case we need to setup layering indices to account for the one that has just
|
||||
* gone away.
|
||||
*/
|
||||
setup_layering_indices (copy);
|
||||
}
|
||||
|
|
@ -2766,10 +2750,10 @@ Playlist::uses_source (boost::shared_ptr<const Source> src, bool shallow) const
|
|||
|
||||
for (set<boost::shared_ptr<Region> >::const_iterator r = all_regions.begin(); r != all_regions.end(); ++r) {
|
||||
/* Note: passing the second argument as false can cause at best
|
||||
incredibly deep and time-consuming recursion, and at worst
|
||||
cycles if the user has managed to create cycles of reference
|
||||
between compound regions. We generally only this during
|
||||
cleanup, and @param shallow is passed as true.
|
||||
* incredibly deep and time-consuming recursion, and at worst
|
||||
* cycles if the user has managed to create cycles of reference
|
||||
* between compound regions. We generally only this during
|
||||
* cleanup, and @param shallow is passed as true.
|
||||
*/
|
||||
if ((*r)->uses_source (src, shallow)) {
|
||||
return true;
|
||||
|
|
@ -2908,14 +2892,14 @@ Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
|
|||
|
||||
if ((*next)->position() != region->last_sample() + 1) {
|
||||
/* they didn't used to touch, so after shuffle,
|
||||
just have them swap positions.
|
||||
* just have them swap positions.
|
||||
*/
|
||||
new_pos = (*next)->position();
|
||||
} else {
|
||||
/* they used to touch, so after shuffle,
|
||||
make sure they still do. put the earlier
|
||||
region where the later one will end after
|
||||
it is moved.
|
||||
* make sure they still do. put the earlier
|
||||
* region where the later one will end after
|
||||
* it is moved.
|
||||
*/
|
||||
new_pos = region->position() + (*next)->length();
|
||||
}
|
||||
|
|
@ -2950,13 +2934,13 @@ Playlist::shuffle (boost::shared_ptr<Region> region, int dir)
|
|||
samplepos_t new_pos;
|
||||
if (region->position() != (*prev)->last_sample() + 1) {
|
||||
/* they didn't used to touch, so after shuffle,
|
||||
just have them swap positions.
|
||||
* just have them swap positions.
|
||||
*/
|
||||
new_pos = region->position();
|
||||
} else {
|
||||
/* they used to touch, so after shuffle,
|
||||
make sure they still do. put the earlier
|
||||
one where the later one will end after
|
||||
* make sure they still do. put the earlier
|
||||
* one where the later one will end after
|
||||
*/
|
||||
new_pos = (*prev)->position() + region->length();
|
||||
}
|
||||
|
|
@ -3159,9 +3143,7 @@ Playlist::combine (const RegionList& r)
|
|||
|
||||
boost::shared_ptr<Region> parent_region = RegionFactory::create (sources, plist, true);
|
||||
|
||||
/* now the non-whole-file region that we will actually use in the
|
||||
* playlist
|
||||
*/
|
||||
/* now the non-whole-file region that we will actually use in the playlist */
|
||||
|
||||
plist.clear ();
|
||||
plist.add (Properties::start, 0);
|
||||
|
|
@ -3171,8 +3153,7 @@ Playlist::combine (const RegionList& r)
|
|||
|
||||
boost::shared_ptr<Region> compound_region = RegionFactory::create (parent_region, plist, true);
|
||||
|
||||
/* remove all the selected regions from the current playlist
|
||||
*/
|
||||
/* remove all the selected regions from the current playlist */
|
||||
|
||||
freeze ();
|
||||
|
||||
|
|
@ -3180,9 +3161,7 @@ Playlist::combine (const RegionList& r)
|
|||
remove_region (*i);
|
||||
}
|
||||
|
||||
/* do type-specific stuff with the originals and the new compound
|
||||
region
|
||||
*/
|
||||
/* do type-specific stuff with the originals and the new compound region */
|
||||
|
||||
post_combine (originals, compound_region);
|
||||
|
||||
|
|
@ -3217,12 +3196,12 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
|
|||
samplepos_t adjusted_end = 0; // gcc isn't smart enough
|
||||
|
||||
/* the leftmost (earliest) edge of the compound region
|
||||
starts at zero in its source, or larger if it
|
||||
has been trimmed or content-scrolled.
|
||||
|
||||
the rightmost (latest) edge of the compound region
|
||||
relative to its source is the starting point plus
|
||||
the length of the region.
|
||||
* starts at zero in its source, or larger if it
|
||||
* has been trimmed or content-scrolled.
|
||||
*
|
||||
* the rightmost (latest) edge of the compound region
|
||||
* relative to its source is the starting point plus
|
||||
* the length of the region.
|
||||
*/
|
||||
|
||||
// (2) get all the original regions
|
||||
|
|
@ -3267,9 +3246,7 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
|
|||
samplepos_t pos = original->position();
|
||||
/* make a copy, but don't announce it */
|
||||
original = RegionFactory::create (original, false);
|
||||
/* the pure copy constructor resets position() to zero,
|
||||
so fix that up.
|
||||
*/
|
||||
/* the pure copy constructor resets position() to zero, so fix that up. */
|
||||
original->set_position (pos);
|
||||
}
|
||||
|
||||
|
|
@ -3284,7 +3261,7 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
|
|||
switch (original->coverage (adjusted_start, adjusted_end)) {
|
||||
case Evoral::OverlapNone:
|
||||
/* original region does not cover any part
|
||||
of the current state of the compound region
|
||||
* of the current state of the compound region
|
||||
*/
|
||||
continue;
|
||||
|
||||
|
|
@ -3297,15 +3274,11 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
|
|||
break;
|
||||
|
||||
case Evoral::OverlapExternal:
|
||||
/* overlap fully covers original, so leave it
|
||||
as is
|
||||
*/
|
||||
/* overlap fully covers original, so leave it as is */
|
||||
break;
|
||||
|
||||
case Evoral::OverlapEnd:
|
||||
/* overlap starts within but covers end,
|
||||
so trim the front of the region
|
||||
*/
|
||||
/* overlap starts within but covers end, so trim the front of the region */
|
||||
original->trim_front (adjusted_start);
|
||||
modified_region = true;
|
||||
break;
|
||||
|
|
@ -3320,8 +3293,7 @@ Playlist::uncombine (boost::shared_ptr<Region> target)
|
|||
}
|
||||
|
||||
if (move_offset) {
|
||||
/* fix the position to match any movement of the compound region.
|
||||
*/
|
||||
/* fix the position to match any movement of the compound region. */
|
||||
original->set_position (original->position() + move_offset);
|
||||
modified_region = true;
|
||||
}
|
||||
|
|
@ -3451,7 +3423,7 @@ void
|
|||
Playlist::coalesce_and_check_crossfades (list<Evoral::Range<samplepos_t> > ranges)
|
||||
{
|
||||
/* XXX: it's a shame that this coalesce algorithm also exists in
|
||||
TimeSelection::consolidate().
|
||||
* TimeSelection::consolidate().
|
||||
*/
|
||||
|
||||
/* XXX: xfade: this is implemented in Evoral::RangeList */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue