mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-05 14:18:53 +02:00
Fix mac build
This commit is contained in:
parent
43ff84ba48
commit
b9b5e0ca09
@ -5573,8 +5573,10 @@ int AudacityProject::FindClips(double t0, double t1, bool next, std::vector<Foun
|
|||||||
const TrackList* tracks = GetTracks();
|
const TrackList* tracks = GetTracks();
|
||||||
finalResults.clear();
|
finalResults.clear();
|
||||||
|
|
||||||
bool anyWaveTracksSelected = std::any_of(tracks->begin(), tracks->end(), [] (const movable_ptr<Track>& t) {
|
bool anyWaveTracksSelected =
|
||||||
return t->GetSelected() && t->GetKind() == Track::Wave; });
|
tracks->end() != std::find_if(tracks->begin(), tracks->end(),
|
||||||
|
[] (const movable_ptr<Track>& t) {
|
||||||
|
return t->GetSelected() && t->GetKind() == Track::Wave; });
|
||||||
|
|
||||||
// first search the tracks individually
|
// first search the tracks individually
|
||||||
std::vector<FoundClip> results;
|
std::vector<FoundClip> results;
|
||||||
@ -5600,8 +5602,9 @@ int AudacityProject::FindClips(double t0, double t1, bool next, std::vector<Foun
|
|||||||
std::max_element(results.begin(), results.end(), compareStart);
|
std::max_element(results.begin(), results.end(), compareStart);
|
||||||
|
|
||||||
std::vector<FoundClip> resultsStartTime;
|
std::vector<FoundClip> resultsStartTime;
|
||||||
std::copy_if(results.begin(), results.end(), std::back_inserter(resultsStartTime),
|
for ( auto &r : results )
|
||||||
[&] (const FoundClip& r) { return r.startTime == (*p).startTime; } );
|
if ( r.startTime == (*p).startTime )
|
||||||
|
resultsStartTime.push_back( r );
|
||||||
|
|
||||||
if (resultsStartTime.size() > 1) {
|
if (resultsStartTime.size() > 1) {
|
||||||
// more than one clip with same start time so
|
// more than one clip with same start time so
|
||||||
@ -5614,9 +5617,9 @@ int AudacityProject::FindClips(double t0, double t1, bool next, std::vector<Foun
|
|||||||
std::max_element(resultsStartTime.begin(),
|
std::max_element(resultsStartTime.begin(),
|
||||||
resultsStartTime.end(), compareEnd);
|
resultsStartTime.end(), compareEnd);
|
||||||
|
|
||||||
std::copy_if(resultsStartTime.begin(), resultsStartTime.end(),
|
for ( auto &r : resultsStartTime )
|
||||||
std::back_inserter(finalResults),
|
if ( r.endTime == (*p).endTime )
|
||||||
[&] (const FoundClip& r) { return r.endTime == (*p).endTime; } );
|
finalResults.push_back( r );
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
finalResults = resultsStartTime;
|
finalResults = resultsStartTime;
|
||||||
@ -6605,8 +6608,10 @@ int AudacityProject::FindClipBoundaries(double time, bool next, std::vector<Foun
|
|||||||
const TrackList* tracks = GetTracks();
|
const TrackList* tracks = GetTracks();
|
||||||
finalResults.clear();
|
finalResults.clear();
|
||||||
|
|
||||||
bool anyWaveTracksSelected = std::any_of(tracks->begin(), tracks->end(), [] (const movable_ptr<Track>& t) {
|
bool anyWaveTracksSelected =
|
||||||
return t->GetSelected() && t->GetKind() == Track::Wave; });
|
tracks->end() != std::find_if(tracks->begin(), tracks->end(),
|
||||||
|
[] (const movable_ptr<Track>& t) {
|
||||||
|
return t->GetSelected() && t->GetKind() == Track::Wave; });
|
||||||
|
|
||||||
// first search the tracks individually
|
// first search the tracks individually
|
||||||
std::vector<FoundClipBoundary> results;
|
std::vector<FoundClipBoundary> results;
|
||||||
@ -6631,8 +6636,9 @@ int AudacityProject::FindClipBoundaries(double time, bool next, std::vector<Foun
|
|||||||
auto p = next ? min_element(results.begin(), results.end(), compare ) :
|
auto p = next ? min_element(results.begin(), results.end(), compare ) :
|
||||||
max_element(results.begin(), results.end(), compare);
|
max_element(results.begin(), results.end(), compare);
|
||||||
|
|
||||||
std::copy_if(results.begin(), results.end(), std::back_inserter(finalResults),
|
for ( auto &r : results )
|
||||||
[&] (const FoundClipBoundary& r) { return r.time == (*p).time; });
|
if ( r.time == (*p).time )
|
||||||
|
finalResults.push_back( r );
|
||||||
}
|
}
|
||||||
|
|
||||||
return nTracksSearched;
|
return nTracksSearched;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user