1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-07 12:12:23 +01:00

static SelectionState::Get()...

... not member functions of AudacityProject
This commit is contained in:
Paul Licameli
2019-01-22 12:06:46 -05:00
parent c1c0030013
commit 68e25f3b7d
10 changed files with 39 additions and 15 deletions

View File

@@ -11,6 +11,21 @@
#include "ViewInfo.h"
#include "Track.h"
#include "Project.h"
static const AudacityProject::AttachedObjects::RegisteredFactory key{
[](AudacityProject &){ return std::make_shared< SelectionState >(); }
};
SelectionState &SelectionState::Get( AudacityProject &project )
{
return project.AttachedObjects::Get< SelectionState >( key );
}
const SelectionState &SelectionState::Get( const AudacityProject &project )
{
return Get( const_cast< AudacityProject & >( project ) );
}
// Set selection length to the length of a track -- but if sync-lock is turned
// on, use the largest possible selection in the sync-lock group.