mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-20 06:37:42 +02:00
Remove AudacityProject::GetScreenEndTime
This commit is contained in:
parent
ca5bb78abe
commit
69962f62d3
@ -1983,7 +1983,8 @@ void AudacityProject::FixScrollbars()
|
|||||||
LastTime =
|
LastTime =
|
||||||
std::max(LastTime, mViewInfo.selectedRegion.t1());
|
std::max(LastTime, mViewInfo.selectedRegion.t1());
|
||||||
|
|
||||||
const double screen = GetScreenEndTime() - mViewInfo.h;
|
const double screen =
|
||||||
|
GetTrackPanel()->GetScreenEndTime() - mViewInfo.h;
|
||||||
const double halfScreen = screen / 2.0;
|
const double halfScreen = screen / 2.0;
|
||||||
|
|
||||||
// If we can scroll beyond zero,
|
// If we can scroll beyond zero,
|
||||||
@ -2029,7 +2030,8 @@ void AudacityProject::FixScrollbars()
|
|||||||
|
|
||||||
bool oldhstate;
|
bool oldhstate;
|
||||||
bool oldvstate;
|
bool oldvstate;
|
||||||
bool newhstate = (GetScreenEndTime() - mViewInfo.h) < mViewInfo.total;
|
bool newhstate =
|
||||||
|
(GetTrackPanel()->GetScreenEndTime() - mViewInfo.h) < mViewInfo.total;
|
||||||
bool newvstate = panelHeight < totalHeight;
|
bool newvstate = panelHeight < totalHeight;
|
||||||
|
|
||||||
#ifdef __WXGTK__
|
#ifdef __WXGTK__
|
||||||
@ -2088,7 +2090,7 @@ void AudacityProject::FixScrollbars()
|
|||||||
panelHeight / mViewInfo.scrollStep, TRUE);
|
panelHeight / mViewInfo.scrollStep, TRUE);
|
||||||
|
|
||||||
if (refresh || (rescroll &&
|
if (refresh || (rescroll &&
|
||||||
(GetScreenEndTime() - mViewInfo.h) < mViewInfo.total)) {
|
(GetTrackPanel()->GetScreenEndTime() - mViewInfo.h) < mViewInfo.total)) {
|
||||||
mTrackPanel->Refresh(false);
|
mTrackPanel->Refresh(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4745,7 +4747,7 @@ void AudacityProject::Zoom(double level)
|
|||||||
// tOnLeft is the amount of time we would need before the selection left edge to center it.
|
// tOnLeft is the amount of time we would need before the selection left edge to center it.
|
||||||
float t0 = mViewInfo.selectedRegion.t0();
|
float t0 = mViewInfo.selectedRegion.t0();
|
||||||
float t1 = mViewInfo.selectedRegion.t1();
|
float t1 = mViewInfo.selectedRegion.t1();
|
||||||
float tAvailable = GetScreenEndTime() - mViewInfo.h;
|
float tAvailable = GetTrackPanel()->GetScreenEndTime() - mViewInfo.h;
|
||||||
float tOnLeft = (tAvailable - t0 + t1)/2.0;
|
float tOnLeft = (tAvailable - t0 + t1)/2.0;
|
||||||
// Bug 1292 (Enh) is effectively a request to do this scrolling of the selection into view.
|
// Bug 1292 (Enh) is effectively a request to do this scrolling of the selection into view.
|
||||||
// If tOnLeft is positive, then we have room for the selection, so scroll to it.
|
// If tOnLeft is positive, then we have room for the selection, so scroll to it.
|
||||||
@ -5605,11 +5607,6 @@ ContrastDialog *AudacityProject::GetContrastDialog(bool create)
|
|||||||
return mContrastDialog.get();
|
return mContrastDialog.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
double AudacityProject::GetScreenEndTime() const
|
|
||||||
{
|
|
||||||
return mTrackPanel->GetScreenEndTime();
|
|
||||||
}
|
|
||||||
|
|
||||||
void AudacityProject::SelectNone()
|
void AudacityProject::SelectNone()
|
||||||
{
|
{
|
||||||
for (auto t : GetTracks()->Any())
|
for (auto t : GetTracks()->Any())
|
||||||
@ -5634,7 +5631,7 @@ void AudacityProject::ZoomInByFactor( double ZoomFactor )
|
|||||||
// when there's a selection that's currently at least
|
// when there's a selection that's currently at least
|
||||||
// partially on-screen
|
// partially on-screen
|
||||||
|
|
||||||
const double endTime = GetScreenEndTime();
|
const double endTime = GetTrackPanel()->GetScreenEndTime();
|
||||||
const double duration = endTime - mViewInfo.h;
|
const double duration = endTime - mViewInfo.h;
|
||||||
|
|
||||||
bool selectionIsOnscreen =
|
bool selectionIsOnscreen =
|
||||||
@ -5661,7 +5658,8 @@ void AudacityProject::ZoomInByFactor( double ZoomFactor )
|
|||||||
|
|
||||||
// Zoom in
|
// Zoom in
|
||||||
ZoomBy(ZoomFactor);
|
ZoomBy(ZoomFactor);
|
||||||
const double newDuration = GetScreenEndTime() - mViewInfo.h;
|
const double newDuration =
|
||||||
|
GetTrackPanel()->GetScreenEndTime() - mViewInfo.h;
|
||||||
|
|
||||||
// Recenter on selCenter
|
// Recenter on selCenter
|
||||||
TP_ScrollWindow(selCenter - newDuration / 2);
|
TP_ScrollWindow(selCenter - newDuration / 2);
|
||||||
@ -5673,7 +5671,8 @@ void AudacityProject::ZoomInByFactor( double ZoomFactor )
|
|||||||
double origWidth = duration;
|
double origWidth = duration;
|
||||||
ZoomBy(ZoomFactor);
|
ZoomBy(ZoomFactor);
|
||||||
|
|
||||||
const double newDuration = GetScreenEndTime() - mViewInfo.h;
|
const double newDuration =
|
||||||
|
GetTrackPanel()->GetScreenEndTime() - mViewInfo.h;
|
||||||
double newh = origLeft + (origWidth - newDuration) / 2;
|
double newh = origLeft + (origWidth - newDuration) / 2;
|
||||||
|
|
||||||
// MM: Commented this out because it was confusing users
|
// MM: Commented this out because it was confusing users
|
||||||
@ -5696,10 +5695,10 @@ void AudacityProject::ZoomOutByFactor( double ZoomFactor )
|
|||||||
{
|
{
|
||||||
//Zoom() may change these, so record original values:
|
//Zoom() may change these, so record original values:
|
||||||
const double origLeft = mViewInfo.h;
|
const double origLeft = mViewInfo.h;
|
||||||
const double origWidth = GetScreenEndTime() - origLeft;
|
const double origWidth = GetTrackPanel()->GetScreenEndTime() - origLeft;
|
||||||
|
|
||||||
ZoomBy(ZoomFactor);
|
ZoomBy(ZoomFactor);
|
||||||
const double newWidth = GetScreenEndTime() - mViewInfo.h;
|
const double newWidth = GetTrackPanel()->GetScreenEndTime() - mViewInfo.h;
|
||||||
|
|
||||||
const double newh = origLeft + (origWidth - newWidth) / 2;
|
const double newh = origLeft + (origWidth - newWidth) / 2;
|
||||||
// newh = (newh > 0) ? newh : 0;
|
// newh = (newh > 0) ? newh : 0;
|
||||||
|
@ -393,7 +393,6 @@ public:
|
|||||||
|
|
||||||
void HandleResize();
|
void HandleResize();
|
||||||
void UpdateLayout();
|
void UpdateLayout();
|
||||||
double GetScreenEndTime() const;
|
|
||||||
void ZoomInByFactor( double ZoomFactor );
|
void ZoomInByFactor( double ZoomFactor );
|
||||||
void ZoomOutByFactor( double ZoomFactor );
|
void ZoomOutByFactor( double ZoomFactor );
|
||||||
|
|
||||||
|
@ -290,12 +290,13 @@ void OnGoSelStart(const CommandContext &context)
|
|||||||
auto &project = context.project;
|
auto &project = context.project;
|
||||||
auto &viewInfo = project.GetViewInfo();
|
auto &viewInfo = project.GetViewInfo();
|
||||||
auto &selectedRegion = viewInfo.selectedRegion;
|
auto &selectedRegion = viewInfo.selectedRegion;
|
||||||
|
auto &trackPanel = *project.GetTrackPanel();
|
||||||
|
|
||||||
if (selectedRegion.isPoint())
|
if (selectedRegion.isPoint())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
project.TP_ScrollWindow(
|
project.TP_ScrollWindow(
|
||||||
selectedRegion.t0() - ((project.GetScreenEndTime() - viewInfo.h) / 2));
|
selectedRegion.t0() - ((trackPanel.GetScreenEndTime() - viewInfo.h) / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnGoSelEnd(const CommandContext &context)
|
void OnGoSelEnd(const CommandContext &context)
|
||||||
@ -303,12 +304,13 @@ void OnGoSelEnd(const CommandContext &context)
|
|||||||
auto &project = context.project;
|
auto &project = context.project;
|
||||||
auto &viewInfo = project.GetViewInfo();
|
auto &viewInfo = project.GetViewInfo();
|
||||||
auto &selectedRegion = viewInfo.selectedRegion;
|
auto &selectedRegion = viewInfo.selectedRegion;
|
||||||
|
auto &trackPanel = *project.GetTrackPanel();
|
||||||
|
|
||||||
if (selectedRegion.isPoint())
|
if (selectedRegion.isPoint())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
project.TP_ScrollWindow(
|
project.TP_ScrollWindow(
|
||||||
selectedRegion.t1() - ((project.GetScreenEndTime() - viewInfo.h) / 2));
|
selectedRegion.t1() - ((trackPanel.GetScreenEndTime() - viewInfo.h) / 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnHistory(const CommandContext &context)
|
void OnHistory(const CommandContext &context)
|
||||||
|
@ -87,7 +87,8 @@ unsigned CommonTrackPanelCell::HandleWheelRotation
|
|||||||
|
|
||||||
// Scrubbing? Expand or contract about the center, ignoring mouse position
|
// Scrubbing? Expand or contract about the center, ignoring mouse position
|
||||||
if (scrubber.IsScrollScrubbing())
|
if (scrubber.IsScrollScrubbing())
|
||||||
center_h = viewInfo.h + (pProject->GetScreenEndTime() - viewInfo.h) / 2.0;
|
center_h = viewInfo.h +
|
||||||
|
(pProject->GetTrackPanel()->GetScreenEndTime() - viewInfo.h) / 2.0;
|
||||||
// Zooming out? Focus on mouse.
|
// Zooming out? Focus on mouse.
|
||||||
else if( steps <= 0 )
|
else if( steps <= 0 )
|
||||||
center_h = mouse_h;
|
center_h = mouse_h;
|
||||||
|
@ -80,7 +80,7 @@ void EditCursorOverlay::Draw(OverlayPanel &panel, wxDC &dc)
|
|||||||
const bool
|
const bool
|
||||||
onScreen = between_incexc(viewInfo.h,
|
onScreen = between_incexc(viewInfo.h,
|
||||||
mCursorTime,
|
mCursorTime,
|
||||||
mProject->GetScreenEndTime());
|
mProject->GetTrackPanel()->GetScreenEndTime());
|
||||||
|
|
||||||
if (!onScreen)
|
if (!onScreen)
|
||||||
return;
|
return;
|
||||||
|
@ -161,7 +161,7 @@ void PlayIndicatorOverlay::OnTimer(wxCommandEvent &event)
|
|||||||
bool onScreen = playPos >= 0.0 &&
|
bool onScreen = playPos >= 0.0 &&
|
||||||
between_incexc(viewInfo.h - tolerance,
|
between_incexc(viewInfo.h - tolerance,
|
||||||
playPos,
|
playPos,
|
||||||
mProject->GetScreenEndTime() + tolerance);
|
mProject->GetTrackPanel()->GetScreenEndTime() + tolerance);
|
||||||
|
|
||||||
// This displays the audio time, too...
|
// This displays the audio time, too...
|
||||||
mProject->TP_DisplaySelection();
|
mProject->TP_DisplaySelection();
|
||||||
@ -190,7 +190,7 @@ void PlayIndicatorOverlay::OnTimer(wxCommandEvent &event)
|
|||||||
onScreen = playPos >= 0.0 &&
|
onScreen = playPos >= 0.0 &&
|
||||||
between_incexc(viewInfo.h,
|
between_incexc(viewInfo.h,
|
||||||
playPos,
|
playPos,
|
||||||
mProject->GetScreenEndTime());
|
mProject->GetTrackPanel()->GetScreenEndTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -792,7 +792,8 @@ bool Scrubber::ShouldDrawScrubSpeed()
|
|||||||
double Scrubber::FindScrubSpeed(bool seeking, double time) const
|
double Scrubber::FindScrubSpeed(bool seeking, double time) const
|
||||||
{
|
{
|
||||||
ViewInfo &viewInfo = mProject->GetViewInfo();
|
ViewInfo &viewInfo = mProject->GetViewInfo();
|
||||||
const double screen = mProject->GetScreenEndTime() - viewInfo.h;
|
const double screen =
|
||||||
|
mProject->GetTrackPanel()->GetScreenEndTime() - viewInfo.h;
|
||||||
return (seeking ? FindSeekSpeed : FindScrubbingSpeed)
|
return (seeking ? FindSeekSpeed : FindScrubbingSpeed)
|
||||||
(viewInfo, mMaxSpeed, screen, time);
|
(viewInfo, mMaxSpeed, screen, time);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user