mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-21 08:27:13 +01:00
static TrackPanel::Get()...
... not member functions of AudacityProject
This commit is contained in:
@@ -46,7 +46,7 @@ AudacityProject::AttachedWindows::RegisteredFactory sLyricsWindowKey{
|
||||
double GetZoomOfSelection( const AudacityProject &project )
|
||||
{
|
||||
auto &viewInfo = ViewInfo::Get( project );
|
||||
const auto &trackPanel = *project.GetTrackPanel();
|
||||
auto &trackPanel = TrackPanel::Get( project );
|
||||
|
||||
const double lowerBound =
|
||||
std::max(viewInfo.selectedRegion.t0(),
|
||||
@@ -144,7 +144,7 @@ double GetZoomOfToFit( const AudacityProject &project )
|
||||
{
|
||||
auto &tracks = TrackList::Get( project );
|
||||
auto &viewInfo = ViewInfo::Get( project );
|
||||
const auto &trackPanel = *project.GetTrackPanel();
|
||||
auto &trackPanel = TrackPanel::Get( project );
|
||||
|
||||
const double end = tracks.GetEndTime();
|
||||
const double start = viewInfo.bScrollBeyondZero
|
||||
@@ -176,7 +176,7 @@ void DoZoomFit(AudacityProject &project)
|
||||
|
||||
void DoZoomFitV(AudacityProject &project)
|
||||
{
|
||||
auto trackPanel = project.GetTrackPanel();
|
||||
auto &trackPanel = TrackPanel::Get( project );
|
||||
auto &tracks = TrackList::Get( project );
|
||||
|
||||
// Only nonminimized audio tracks will be resized
|
||||
@@ -187,7 +187,7 @@ void DoZoomFitV(AudacityProject &project)
|
||||
|
||||
// Find total height to apportion
|
||||
int height;
|
||||
trackPanel->GetTracksUsableArea(NULL, &height);
|
||||
trackPanel.GetTracksUsableArea(NULL, &height);
|
||||
height -= 28;
|
||||
|
||||
// The height of minimized and non-audio tracks cannot be apportioned
|
||||
@@ -215,10 +215,10 @@ void OnZoomIn(const CommandContext &context)
|
||||
void OnZoomNormal(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto trackPanel = project.GetTrackPanel();
|
||||
auto &trackPanel = TrackPanel::Get( project );
|
||||
|
||||
project.Zoom(ZoomInfo::GetDefaultZoom());
|
||||
trackPanel->Refresh(false);
|
||||
trackPanel.Refresh(false);
|
||||
}
|
||||
|
||||
void OnZoomOut(const CommandContext &context)
|
||||
@@ -240,7 +240,7 @@ void OnZoomToggle(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &viewInfo = ViewInfo::Get( project );
|
||||
auto trackPanel = project.GetTrackPanel();
|
||||
auto &trackPanel = TrackPanel::Get( project );
|
||||
|
||||
// const double origLeft = viewInfo.h;
|
||||
// const double origWidth = GetScreenEndTime() - origLeft;
|
||||
@@ -253,7 +253,7 @@ void OnZoomToggle(const CommandContext &context)
|
||||
fabs(log(Zoom1 / Z)) > fabs(log( Z / Zoom2)) ? Zoom1:Zoom2;
|
||||
|
||||
project.Zoom(ChosenZoom);
|
||||
trackPanel->Refresh(false);
|
||||
trackPanel.Refresh(false);
|
||||
// const double newWidth = GetScreenEndTime() - viewInfo.h;
|
||||
// const double newh = origLeft + (origWidth - newWidth) / 2;
|
||||
// TP_ScrollWindow(newh);
|
||||
@@ -316,7 +316,7 @@ void OnGoSelStart(const CommandContext &context)
|
||||
auto &project = context.project;
|
||||
auto &viewInfo = ViewInfo::Get( project );
|
||||
auto &selectedRegion = viewInfo.selectedRegion;
|
||||
auto &trackPanel = *project.GetTrackPanel();
|
||||
auto &trackPanel = TrackPanel::Get( project );
|
||||
|
||||
if (selectedRegion.isPoint())
|
||||
return;
|
||||
@@ -330,7 +330,7 @@ void OnGoSelEnd(const CommandContext &context)
|
||||
auto &project = context.project;
|
||||
auto &viewInfo = ViewInfo::Get( project );
|
||||
auto &selectedRegion = viewInfo.selectedRegion;
|
||||
auto &trackPanel = *project.GetTrackPanel();
|
||||
auto &trackPanel = TrackPanel::Get( project );
|
||||
|
||||
if (selectedRegion.isPoint())
|
||||
return;
|
||||
@@ -383,7 +383,7 @@ void OnShowClipping(const CommandContext &context)
|
||||
{
|
||||
auto &project = context.project;
|
||||
auto &commandManager = CommandManager::Get( project );
|
||||
auto trackPanel = project.GetTrackPanel();
|
||||
auto &trackPanel = TrackPanel::Get( project );
|
||||
|
||||
bool checked = !gPrefs->Read(wxT("/GUI/ShowClipping"), 0L);
|
||||
gPrefs->Write(wxT("/GUI/ShowClipping"), checked);
|
||||
@@ -393,7 +393,7 @@ void OnShowClipping(const CommandContext &context)
|
||||
wxTheApp->AddPendingEvent(wxCommandEvent{
|
||||
EVT_PREFS_UPDATE, ShowClippingPrefsID() });
|
||||
|
||||
trackPanel->Refresh(false);
|
||||
trackPanel.Refresh(false);
|
||||
}
|
||||
|
||||
#if defined(EXPERIMENTAL_EFFECTS_RACK)
|
||||
|
||||
Reference in New Issue
Block a user