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;
21
22namespace TrackInfo{ struct TCPLine; }
23using TCPLines = std::vector< TrackInfo::TCPLine >;
24
25class AUDACITY_DLL_API CommonTrackControls /* not final */ : public TrackControls
26{
27public:
29
30 // This is passed to the InitUserData() methods of the PopupMenuTable
31 // objects returned by GetMenuExtension:
33 {
34 public:
37 wxWindow *pParent;
38 unsigned result;
39 };
40
41 const TCPLines& GetTCPLines() const override;
42
43protected:
44 // An override is supplied for derived classes to call through but it is
45 // still marked pure virtual
46 virtual std::vector<UIHandlePtr> HitTest
47 (const TrackPanelMouseState &state,
48 const AudacityProject *) override = 0;
49
50 unsigned DoContextMenu
51 (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition,
52 AudacityProject *pProject) override;
53 virtual PopupMenuTable *GetMenuExtension(Track *pTrack) = 0;
54
55 // TrackPanelDrawable implementation
56 void Draw(
58 const wxRect &rect, unsigned iPass ) override;
59
60 wxRect DrawingArea(
62 const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
63
64 std::weak_ptr<CloseButtonHandle> mCloseHandle;
65 std::weak_ptr<MenuButtonHandle> mMenuHandle;
66 std::weak_ptr<MinimizeButtonHandle> mMinimizeHandle;
67 std::weak_ptr<TrackSelectHandle> mSelectHandle;
68};
69
70#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< 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:110
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)