Audacity 3.2.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | List of all members
EffectsButtonHandle Class Referencefinal

#include <PlayableTrackButtonHandles.h>

Inheritance diagram for EffectsButtonHandle:
[legend]
Collaboration diagram for EffectsButtonHandle:
[legend]

Public Member Functions

 EffectsButtonHandle (const std::shared_ptr< Track > &pTrack, const wxRect &rect)
 
EffectsButtonHandleoperator= (const EffectsButtonHandle &)=default
 
virtual ~EffectsButtonHandle ()
 
- Public Member Functions inherited from ButtonHandle
std::shared_ptr< TrackGetTrack () const
 
bool IsClicked () const
 
- Public Member Functions inherited from UIHandle
virtual ~UIHandle ()=0
 
virtual void Enter (bool forward, AudacityProject *pProject)
 
virtual bool HasRotation () const
 
virtual bool Rotate (bool forward)
 
virtual bool HasEscape (AudacityProject *pProject) const
 
virtual bool Escape (AudacityProject *pProject)
 
virtual bool HandlesRightClick ()
 Whether the handle has any special right-button handling. More...
 
virtual Result Click (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0
 
virtual Result Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject)=0
 
virtual HitTestPreview Preview (const TrackPanelMouseState &state, AudacityProject *pProject)=0
 
virtual Result Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)=0
 
virtual Result Cancel (AudacityProject *pProject)=0
 
virtual bool StopsOnKeystroke ()
 
virtual void OnProjectChange (AudacityProject *pProject)
 
Result GetChangeHighlight () const
 
void SetChangeHighlight (Result val)
 
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
 
virtual void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
 
virtual wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)
 

Static Public Member Functions

static UIHandlePtr HitTest (std::weak_ptr< EffectsButtonHandle > &holder, const wxMouseState &state, const wxRect &rect, const AudacityProject *pProject, const std::shared_ptr< Track > &pTrack)
 
- Static Public Member Functions inherited from UIHandle
static UIHandle::Result NeedChangeHighlight (const UIHandle &, const UIHandle &)
 
- Static Public Member Functions inherited from TrackPanelDrawable
static wxRect MaximizeWidth (const wxRect &rect, const wxRect &panelRect)
 
static wxRect MaximizeHeight (const wxRect &rect, const wxRect &panelRect)
 

Protected Member Functions

Result CommitChanges (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
 
TranslatableString Tip (const wxMouseState &state, AudacityProject &) const override
 
bool StopsOnKeystroke () override
 
- Protected Member Functions inherited from ButtonHandle
 ButtonHandle (const std::shared_ptr< Track > &pTrack, const wxRect &rect)
 
ButtonHandleoperator= (const ButtonHandle &)=default
 
virtual ~ButtonHandle ()
 
virtual Result CommitChanges (const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent)=0
 
virtual TranslatableString Tip (const wxMouseState &state, AudacityProject &project) const =0
 
void Enter (bool forward, AudacityProject *) final override
 
Result Click (const TrackPanelMouseEvent &event, AudacityProject *pProject) final override
 
Result Drag (const TrackPanelMouseEvent &event, AudacityProject *pProject) final override
 
HitTestPreview Preview (const TrackPanelMouseState &state, AudacityProject *pProject) final override
 
Result Release (const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) final override
 
Result Cancel (AudacityProject *pProject) final override
 

Private Member Functions

 EffectsButtonHandle (const EffectsButtonHandle &)=delete
 

Additional Inherited Members

- Public Types inherited from UIHandle
using Result = unsigned
 
using Cell = TrackPanelCell
 
- Protected Attributes inherited from ButtonHandle
std::weak_ptr< TrackmpTrack
 
wxRect mRect
 
bool mWasIn { true }
 
bool mIsClicked {}
 
- Protected Attributes inherited from UIHandle
Result mChangeHighlight { 0 }
 

Detailed Description

Definition at line 79 of file PlayableTrackButtonHandles.h.

Constructor & Destructor Documentation

◆ EffectsButtonHandle() [1/2]

EffectsButtonHandle::EffectsButtonHandle ( const EffectsButtonHandle )
privatedelete

◆ EffectsButtonHandle() [2/2]

EffectsButtonHandle::EffectsButtonHandle ( const std::shared_ptr< Track > &  pTrack,
const wxRect &  rect 
)
explicit

Definition at line 141 of file PlayableTrackButtonHandles.cpp.

143 : ButtonHandle{ pTrack, rect }
144{}
A UIHandle for a TrackPanel button, such as the Mute and Solo buttons.
Definition: ButtonHandle.h:26

◆ ~EffectsButtonHandle()

EffectsButtonHandle::~EffectsButtonHandle ( )
virtual

Definition at line 146 of file PlayableTrackButtonHandles.cpp.

147{
148}

Member Function Documentation

◆ CommitChanges()

UIHandle::Result EffectsButtonHandle::CommitChanges ( const wxMouseEvent &  event,
AudacityProject pProject,
wxWindow *  pParent 
)
overrideprotectedvirtual

Implements ButtonHandle.

Definition at line 150 of file PlayableTrackButtonHandles.cpp.

152{
153 RealtimeEffectPanel::Get(*pProject).ShowPanel(mpTrack.lock().get(), true);
155}
std::weak_ptr< Track > mpTrack
Definition: ButtonHandle.h:72
void ShowPanel(Track *track, bool focus)
static RealtimeEffectPanel & Get(AudacityProject &project)

References RealtimeEffectPanel::Get(), ButtonHandle::mpTrack, RefreshCode::RefreshNone, and RealtimeEffectPanel::ShowPanel().

Here is the call graph for this function:

◆ HitTest()

UIHandlePtr EffectsButtonHandle::HitTest ( std::weak_ptr< EffectsButtonHandle > &  holder,
const wxMouseState &  state,
const wxRect &  rect,
const AudacityProject pProject,
const std::shared_ptr< Track > &  pTrack 
)
static

Definition at line 176 of file PlayableTrackButtonHandles.cpp.

180{
181 wxRect buttonRect;
182 if ( pTrack )
184 pTrack.get());
185
186 if ( TrackInfo::HideTopItem( rect, buttonRect ) )
187 return {};
188
189 if ( pTrack && buttonRect.Contains(state.m_x, state.m_y) ) {
190 auto result = std::make_shared<EffectsButtonHandle>( pTrack, buttonRect );
191 result = AssignUIHandlePtr(holder, result);
192 return result;
193 }
194 else
195 return {};
196}
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
Definition: UIHandle.h:151
static void GetEffectsRect(const wxRect &rect, wxRect &dest, const Track *pTrack)
AUDACITY_DLL_API bool HideTopItem(const wxRect &rect, const wxRect &subRect, int allowance=0)
Definition: TrackInfo.cpp:208

References AssignUIHandlePtr(), PlayableTrackControls::GetEffectsRect(), and TrackInfo::HideTopItem().

Referenced by WaveTrackControls::HitTest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator=()

EffectsButtonHandle & EffectsButtonHandle::operator= ( const EffectsButtonHandle )
default

◆ StopsOnKeystroke()

bool EffectsButtonHandle::StopsOnKeystroke ( )
inlineoverrideprotectedvirtual

Reimplemented from UIHandle.

Definition at line 99 of file PlayableTrackButtonHandles.h.

99{ return true; }

◆ Tip()

TranslatableString EffectsButtonHandle::Tip ( const wxMouseState &  state,
AudacityProject project 
) const
overrideprotectedvirtual

Implements ButtonHandle.

Definition at line 157 of file PlayableTrackButtonHandles.cpp.

159{
160 auto name = XO("Effects");
161 auto focused =
162 TrackFocus::Get( project ).Get() == GetTrack().get();
163 if (!focused)
164 return name;
165 else {
166 return name;
167 // Instead supply shortcut when "TrackEffects" is defined
168 /*
169 auto &commandManager = CommandManager::Get( project );
170 ComponentInterfaceSymbol command{ wxT("TrackEffects"), name };
171 return commandManager.DescribeCommandsAndShortcuts( &command, 1u );
172 */
173 }
174}
const TranslatableString name
Definition: Distortion.cpp:74
XO("Cut/Copy/Paste")
std::shared_ptr< Track > GetTrack() const
Definition: ButtonHandle.h:30
Subclass & Get(const RegisteredFactory &key)
Get reference to an attachment, creating on demand if not present, down-cast it to Subclass.
Definition: ClientData.h:309
Track * Get()

References TrackFocus::Get(), ClientData::Site< Host, ClientData, ObjectCopyingPolicy, Pointer, ObjectLockingPolicy, RegistryLockingPolicy >::Get(), ButtonHandle::GetTrack(), name, and XO().

Here is the call graph for this function:

The documentation for this class was generated from the following files: