15#include "../../../HitTestResult.h"
19#include "../../ui/ChannelView.h"
21#include "../../../RefreshCode.h"
24#include "../../../TrackArtist.h"
25#include "../../../TrackPanelDrawingContext.h"
26#include "../../../TrackPanelMouseEvent.h"
27#include "../../../UIHandle.h"
28#include "../../../widgets/Ruler.h"
29#include "../../../widgets/LinearUpdater.h"
30#include "../../../widgets/LogarithmicUpdater.h"
31#include "../../../widgets/RealFormat.h"
39 return FindChannel<TimeTrack>();
45 static Ruler theRuler{
56 std::vector<UIHandlePtr> results;
60 auto result = std::make_shared<TimeTrackVZoomHandle>(
63 results.push_back(result);
68 std::copy(more.begin(), more.end(), std::back_inserter(results));
75 const wxRect &rect_,
unsigned iPass)
91 auto dc = &context.
dc;
98 if (
size.first < rect.GetWidth()) {
99 int adj = rr.GetWidth() -
size.first;
106 auto vruler = &
ruler();
118 auto vruler = &
ruler();
121 min = tt->GetRangeLower() * 100.0;
122 max = tt->GetRangeUpper() * 100.0;
124 vruler->SetDbMirrorValue( 0.0 );
126 rect.x, rect.y, rect.x + rect.width, rect.y + rect.height - 1);
127 vruler->SetOrientation(wxVERTICAL);
128 vruler->SetRange(max,
min);
129 vruler->SetFormat(tt->GetDisplayLog()
132 vruler->SetUnits({});
133 vruler->SetLabelEdges(
false);
134 if (tt->GetDisplayLog())
140 vruler->GetMaxSize(&
size.first, &
size.second);
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *pProject) override
static ChannelView & Get(Channel &channel)
std::pair< int, int > vrulerSize
static const LinearUpdater & Instance()
static const LogarithmicUpdater & Instance()
wxColour & Colour(int iIndex)
A kind of Track used to 'warp time'.
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
~TimeTrackVRulerControls()
std::weak_ptr< TimeTrackVZoomHandle > mVZoomHandle
void UpdateRuler(const wxRect &rect) override
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &state, const AudacityProject *) override
std::shared_ptr< TimeTrack > FindTimeTrack()
virtual void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
void copy(const T *src, T *dst, int32_t n)