Audacity 3.2.0
PlayIndicatorOverlay.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5PlayIndicatorOverlay.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_PLAY_INDICATOR_OVERLAY__
12#define __AUDACITY_PLAY_INDICATOR_OVERLAY__
13
14#include <memory>
15#include "ClientData.h"
16#include "../../widgets/Overlay.h" // to inherit
17#include "Observer.h"
18
19class AudacityProject;
20
21
22// Common class for overlaying track panel or ruler
24 : public Overlay
25 , public ClientData::Base
26{
27public:
30
31 void Update(int newIndicatorX) { mNewIndicatorX = newIndicatorX; }
32
33private:
34 unsigned SequenceNumber() const override;
35 std::pair<wxRect, bool> DoGetRectangle(wxSize size) override;
36 void Draw(OverlayPanel &panel, wxDC &dc) override;
37
38protected:
39
41 const bool mIsMaster;
42 int mLastIndicatorX { -1 };
43 int mNewIndicatorX { -1 };
44 bool mNewIsCapturing { false };
45 bool mLastIsCapturing { false };
46};
47
48// Master object for track panel, creates the other object for the ruler
50{
51public:
52 explicit
54
55private:
57
58 std::shared_ptr<PlayIndicatorOverlayBase> mPartner;
60};
61
62#endif
Utility ClientData::Site to register hooks into a host class that attach client data.
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
A move-only handle representing a connection to a Publisher.
Definition: Observer.h:70
void Draw(OverlayPanel &panel, wxDC &dc) override
std::pair< wxRect, bool > DoGetRectangle(wxSize size) override
PlayIndicatorOverlayBase(AudacityProject *project, bool isMaster)
unsigned SequenceNumber() const override
This number determines an ordering of overlays, so that those with higher numbers overpaint those wit...
void Update(int newIndicatorX)
AudacityProject *const mProject
Observer::Subscription mSubscription
PlayIndicatorOverlay(AudacityProject *project)
std::shared_ptr< PlayIndicatorOverlayBase > mPartner
void OnTimer(Observer::Message)
A convenient default parameter for class template Site.
Definition: ClientData.h:29
Default message type for Publisher.
Definition: Observer.h:26