1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 08:09:32 +02:00

Pass AudacityProject* to more methods of UIHandle

This commit is contained in:
Paul Licameli 2019-05-21 13:36:29 -04:00
parent ba5ce23668
commit 4a5abc9e41
30 changed files with 39 additions and 39 deletions

View File

@ -495,7 +495,7 @@ protected:
return RefreshCode::DrawOverlays;
}
void Enter(bool) override
void Enter(bool, AudacityProject *) override
{
mChangeHighlight = RefreshCode::DrawOverlays;
}
@ -649,7 +649,7 @@ protected:
return RefreshCode::DrawOverlays;
}
void Enter(bool) override
void Enter(bool, AudacityProject *) override
{
mChangeHighlight = RefreshCode::DrawOverlays;
}

View File

@ -183,7 +183,7 @@ bool CellularPanel::HandleEscapeKey(bool down)
{
auto target = Target();
if (target && target->HasEscape() && target->Escape()) {
if (target && target->HasEscape() && target->Escape(GetProject())) {
HandleCursorForPresentMouseState(false);
return true;
}
@ -331,7 +331,7 @@ void CellularPanel::HandleMotion
refreshCode = updateFlags;
if (handle && handle != oldHandle)
handle->Enter(true);
handle->Enter(true, GetProject());
if (oldHandle == handle)
oldHandle.reset();
@ -436,7 +436,7 @@ bool CellularPanel::ChangeTarget(bool forward, bool cycle)
return true;
else if (cycle && (size == 1 || IsMouseCaptured())) {
// Rotate through the states of this target only.
target->Enter(forward);
target->Enter(forward, GetProject());
return true;
}
}
@ -453,7 +453,7 @@ bool CellularPanel::ChangeTarget(bool forward, bool cycle)
state.mTarget += size - 1;
state.mTarget %= size;
if (Target())
Target()->Enter(forward);
Target()->Enter(forward, GetProject());
return true;
}

View File

@ -17,7 +17,7 @@ UIHandle::~UIHandle()
{
}
void UIHandle::Enter(bool)
void UIHandle::Enter(bool, AudacityProject *)
{
}
@ -36,7 +36,7 @@ bool UIHandle::HasEscape() const
return false;
}
bool UIHandle::Escape()
bool UIHandle::Escape(AudacityProject *)
{
return false;
}

View File

@ -47,7 +47,7 @@ public:
// This might put the handle into its first rotated state
// (or last, if forward is false) or mark itself as needing a highlight.
// Default does nothing.
virtual void Enter(bool forward);
virtual void Enter(bool forward, AudacityProject *pProject);
// Tell whether the handle has more than one TAB key rotation state.
// Default is always false.
@ -65,7 +65,7 @@ public:
// The handle may change state and mark itself for highlight change.
// Default does nothing and returns false
virtual bool Escape();
virtual bool Escape(AudacityProject *pProject);
// Assume hit test (implemented in other classes) was positive.
// May return Cancelled, overriding the hit test decision and stopping drag.

View File

@ -68,7 +68,7 @@ LabelGlyphHandle::LabelGlyphHandle
{
}
void LabelGlyphHandle::Enter(bool)
void LabelGlyphHandle::Enter(bool, AudacityProject *)
{
mChangeHighlight = RefreshCode::RefreshCell;
}

View File

@ -63,7 +63,7 @@ public:
virtual ~LabelGlyphHandle();
void Enter(bool forward) override;
void Enter(bool forward, AudacityProject *) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -33,7 +33,7 @@ LabelTextHandle::LabelTextHandle
{
}
void LabelTextHandle::Enter(bool)
void LabelTextHandle::Enter(bool, AudacityProject *)
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;

View File

@ -38,7 +38,7 @@ public:
std::shared_ptr<LabelTrack> GetTrack() const { return mpLT.lock(); }
int GetLabelNum() const { return mLabelNum; }
void Enter(bool forward) override;
void Enter(bool forward, AudacityProject *) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -30,7 +30,7 @@ NoteTrackButtonHandle::NoteTrackButtonHandle
{
}
void NoteTrackButtonHandle::Enter(bool)
void NoteTrackButtonHandle::Enter(bool, AudacityProject *)
{
mChangeHighlight = RefreshCode::RefreshCell;
}

View File

@ -46,7 +46,7 @@ public:
const NoteTrackButtonHandle &newState);
protected:
void Enter(bool forward) override;
void Enter(bool forward, AudacityProject *) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -60,7 +60,7 @@ NoteTrackVZoomHandle::NoteTrackVZoomHandle
{
}
void NoteTrackVZoomHandle::Enter(bool)
void NoteTrackVZoomHandle::Enter(bool, AudacityProject *)
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;

View File

@ -36,7 +36,7 @@ public:
std::shared_ptr<NoteTrack> GetTrack() const { return mpTrack.lock(); }
void Enter(bool forward) override;
void Enter(bool forward, AudacityProject *) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -31,7 +31,7 @@ CutlineHandle::CutlineHandle
{
}
void CutlineHandle::Enter(bool)
void CutlineHandle::Enter(bool, AudacityProject *)
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;

View File

@ -43,7 +43,7 @@ public:
const WaveTrackLocation &GetLocation() { return mLocation; }
std::shared_ptr<WaveTrack> GetTrack() { return mpTrack; }
void Enter(bool forward) override;
void Enter(bool forward, AudacityProject *) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -41,7 +41,7 @@ SampleHandle::SampleHandle( const std::shared_ptr<WaveTrack> &pTrack )
{
}
void SampleHandle::Enter(bool)
void SampleHandle::Enter(bool, AudacityProject *)
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;

View File

@ -44,7 +44,7 @@ public:
std::shared_ptr<WaveTrack> GetTrack() const { return mClickedTrack; }
void Enter(bool forward) override;
void Enter(bool forward, AudacityProject *) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -32,7 +32,7 @@ SpectrumVZoomHandle::SpectrumVZoomHandle
SpectrumVZoomHandle::~SpectrumVZoomHandle() = default;
void SpectrumVZoomHandle::Enter(bool)
void SpectrumVZoomHandle::Enter( bool, AudacityProject* )
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;

View File

@ -36,7 +36,7 @@ public:
std::shared_ptr<WaveTrack> GetTrack() const { return mpTrack.lock(); }
void Enter(bool forward) override;
void Enter(bool forward, AudacityProject*) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -31,7 +31,7 @@ WaveformVZoomHandle::WaveformVZoomHandle(
WaveformVZoomHandle::~WaveformVZoomHandle() = default;
void WaveformVZoomHandle::Enter(bool)
void WaveformVZoomHandle::Enter( bool, AudacityProject* )
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;

View File

@ -36,7 +36,7 @@ public:
std::shared_ptr<WaveTrack> GetTrack() const { return mpTrack.lock(); }
void Enter(bool forward) override;
void Enter( bool forward, AudacityProject * ) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -27,7 +27,7 @@ ButtonHandle::~ButtonHandle()
{
}
void ButtonHandle::Enter(bool)
void ButtonHandle::Enter(bool, AudacityProject *)
{
mChangeHighlight = RefreshCode::RefreshCell;
}

View File

@ -48,7 +48,7 @@ protected:
// Define a message for the status bar and tooltip.
virtual TranslatableString Tip(const wxMouseState &state) const = 0;
void Enter(bool forward) final override;
void Enter(bool forward, AudacityProject *) final override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject)

View File

@ -34,7 +34,7 @@ EnvelopeHandle::EnvelopeHandle( Envelope *pEnvelope )
{
}
void EnvelopeHandle::Enter(bool)
void EnvelopeHandle::Enter(bool, AudacityProject *)
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;

View File

@ -55,7 +55,7 @@ public:
Envelope *GetEnvelope() const { return mEnvelope; }
void Enter(bool forward) override;
void Enter(bool forward, AudacityProject *) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -487,7 +487,7 @@ namespace {
}
}
void SelectHandle::Enter(bool)
void SelectHandle::Enter(bool, AudacityProject *)
{
SetUseSnap(true);
}
@ -521,7 +521,7 @@ bool SelectHandle::HasEscape() const
return HasSnap() && mUseSnap;
}
bool SelectHandle::Escape()
bool SelectHandle::Escape(AudacityProject *)
{
if (SelectHandle::HasEscape()) {
SetUseSnap(false);

View File

@ -50,13 +50,13 @@ public:
bool IsClicked() const;
void SetUseSnap(bool use);
void Enter(bool forward) override;
void SetUseSnap(bool use, AudacityProject *project);
void Enter(bool forward, AudacityProject *) override;
bool HasSnap() const;
bool HasEscape() const override;
bool Escape() override;
bool Escape(AudacityProject *) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;

View File

@ -25,7 +25,7 @@ SliderHandle::SliderHandle
{
}
void SliderHandle::Enter(bool)
void SliderHandle::Enter(bool, AudacityProject *)
{
mChangeHighlight = RefreshCode::RefreshCell;
}

View File

@ -45,7 +45,7 @@ protected:
virtual Result CommitChanges
(const wxMouseEvent &event, AudacityProject *pProject) = 0;
void Enter(bool forward) override;
void Enter(bool forward, AudacityProject *) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject)

View File

@ -37,7 +37,7 @@ TimeShiftHandle::TimeShiftHandle
{
}
void TimeShiftHandle::Enter(bool)
void TimeShiftHandle::Enter(bool, AudacityProject *)
{
#ifdef EXPERIMENTAL_TRACK_PANEL_HIGHLIGHTING
mChangeHighlight = RefreshCode::RefreshCell;

View File

@ -84,7 +84,7 @@ public:
virtual ~TimeShiftHandle();
void Enter(bool forward) override;
void Enter(bool forward, AudacityProject *) override;
Result Click
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;