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 // This decides what details to draw in the track control panel, besides
43 // those at the bottom
44 virtual const TCPLines& GetTCPLines() const;
45
46 // To help subclasses define GetTCPLines
47 static const TCPLines& StaticTCPLines();
48
49protected:
50 // An override is supplied for derived classes to call through but it is
51 // still marked pure virtual
52 virtual std::vector<UIHandlePtr> HitTest
53 (const TrackPanelMouseState &state,
54 const AudacityProject *) override = 0;
55
56 unsigned DoContextMenu
57 (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition,
58 AudacityProject *pProject) override;
59 virtual PopupMenuTable *GetMenuExtension(Track *pTrack) = 0;
60
61 // TrackPanelDrawable implementation
62 void Draw(
64 const wxRect &rect, unsigned iPass ) override;
65
66 wxRect DrawingArea(
68 const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
69
70 std::weak_ptr<CloseButtonHandle> mCloseHandle;
71 std::weak_ptr<MenuButtonHandle> mMenuHandle;
72 std::weak_ptr<MinimizeButtonHandle> mMinimizeHandle;
73 std::weak_ptr<SelectButtonHandle> mSelectButtonHandle;
74 std::weak_ptr<TrackSelectHandle> mSelectHandle;
75};
76
77#endif
TrackInfo::TCPLines TCPLines
Definition: TrackInfo.cpp:98
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)
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:162
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)
Functions for drawing the track control panel, which is shown to the side of a track It has the menus...