1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-11-21 08:27:13 +01:00

static TrackList::Get()...

... not member function of AudacityProject
This commit is contained in:
Paul Licameli
2019-05-06 19:00:10 -04:00
parent 1ed9338e6f
commit 14ab93a01f
73 changed files with 553 additions and 482 deletions

View File

@@ -121,7 +121,7 @@ namespace ViewActions {
double GetZoomOfToFit( const AudacityProject &project )
{
const auto &tracks = *project.GetTracks();
auto &tracks = TrackList::Get( project );
const auto &viewInfo = project.GetViewInfo();
const auto &trackPanel = *project.GetTrackPanel();
@@ -143,10 +143,10 @@ double GetZoomOfToFit( const AudacityProject &project )
void DoZoomFit(AudacityProject &project)
{
auto &viewInfo = project.GetViewInfo();
auto tracks = project.GetTracks();
auto &tracks = TrackList::Get( project );
const double start = viewInfo.bScrollBeyondZero
? std::min(tracks->GetStartTime(), 0.0)
? std::min(tracks.GetStartTime(), 0.0)
: 0;
project.Zoom( GetZoomOfToFit( project ) );
@@ -156,10 +156,10 @@ void DoZoomFit(AudacityProject &project)
void DoZoomFitV(AudacityProject &project)
{
auto trackPanel = project.GetTrackPanel();
auto tracks = project.GetTracks();
auto &tracks = TrackList::Get( project );
// Only nonminimized audio tracks will be resized
auto range = tracks->Any<AudioTrack>() - &Track::GetMinimized;
auto range = tracks.Any<AudioTrack>() - &Track::GetMinimized;
auto count = range.size();
if (count == 0)
return;
@@ -171,7 +171,7 @@ void DoZoomFitV(AudacityProject &project)
// The height of minimized and non-audio tracks cannot be apportioned
height -=
tracks->Any().sum( &Track::GetHeight ) - range.sum( &Track::GetHeight );
tracks.Any().sum( &Track::GetHeight ) - range.sum( &Track::GetHeight );
// Give each resized track the average of the remaining height
height = height / count;
@@ -269,9 +269,9 @@ void OnAdvancedVZoom(const CommandContext &context)
void OnCollapseAllTracks(const CommandContext &context)
{
auto &project = context.project;
auto tracks = project.GetTracks();
auto &tracks = TrackList::Get( project );
for (auto t : tracks->Any())
for (auto t : tracks.Any())
t->SetMinimized(true);
project.ModifyState(true);
@@ -281,9 +281,9 @@ void OnCollapseAllTracks(const CommandContext &context)
void OnExpandAllTracks(const CommandContext &context)
{
auto &project = context.project;
auto tracks = project.GetTracks();
auto &tracks = TrackList::Get( project );
for (auto t : tracks->Any())
for (auto t : tracks.Any())
t->SetMinimized(false);
project.ModifyState(true);