Audacity 3.2.0
CommonTrackControls.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5CommonTrackControls.h
6
7Paul Licameli split from TrackControls.h
8
9**********************************************************************/
10
11#ifndef __AUDACITY_COMMON_TRACK_CONTROLS__
12#define __AUDACITY_COMMON_TRACK_CONTROLS__
13
14#include "TrackControls.h" // to inherit
15
18class PopupMenuTable;
22
23namespace TrackInfo{ struct TCPLine; }
24using TCPLines = std::vector< TrackInfo::TCPLine >;
25
26class AUDACITY_DLL_API CommonTrackControls /* not final */ : public TrackControls
27{
28public:
30
31 // This is passed to the InitUserData() methods of the PopupMenuTable
32 // objects returned by GetMenuExtension:
34 {
35 public:
38 wxWindow *pParent;
39 unsigned result;
40 };
41
42 const TCPLines& GetTCPLines() const override;
43
44protected:
45 // An override is supplied for derived classes to call through but it is
46 // still marked pure virtual
47 virtual std::vector<UIHandlePtr> HitTest
48 (const TrackPanelMouseState &state,
49 const AudacityProject *) override = 0;
50
51 unsigned DoContextMenu
52 (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition,
53 AudacityProject *pProject) override;
54 virtual PopupMenuTable *GetMenuExtension(Track *pTrack) = 0;
55
56 // TrackPanelDrawable implementation
57 void Draw(
59 const wxRect &rect, unsigned iPass ) override;
60
61 wxRect DrawingArea(
63 const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
64
65 std::weak_ptr<CloseButtonHandle> mCloseHandle;
66 std::weak_ptr<MenuButtonHandle> mMenuHandle;
67 std::weak_ptr<MinimizeButtonHandle> mMinimizeHandle;
68 std::weak_ptr<SelectButtonHandle> mSelectButtonHandle;
69 std::weak_ptr<TrackSelectHandle> mSelectHandle;
70};
71
72#endif
std::vector< TrackInfo::TCPLine > TCPLines
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
std::weak_ptr< SelectButtonHandle > mSelectButtonHandle
std::weak_ptr< TrackSelectHandle > mSelectHandle
std::weak_ptr< MenuButtonHandle > mMenuHandle
std::weak_ptr< CloseButtonHandle > mCloseHandle
std::weak_ptr< MinimizeButtonHandle > mMinimizeHandle
virtual PopupMenuTable * GetMenuExtension(Track *pTrack)=0
unsigned DoContextMenu(const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, AudacityProject *pProject) override
TrackControls(std::shared_ptr< Track > pTrack)
virtual const TrackInfo::TCPLines & GetTCPLines() const =0
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:122
virtual std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *pProject)=0
virtual void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
virtual wxRect DrawingArea(TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)