73{
74 wxDC *dc = GetDC();
75 if (!dc)
76 return false;
77
78 int width, height;
79 dc->GetSize(&width, &height);
80
81 int rulerScreenHeight = 40;
82 int screenTotalHeight =
84
85 double scale = height / (double)screenTotalHeight;
86
87 int rulerPageHeight = (int)(rulerScreenHeight * scale);
94
96 artist.SetBackgroundBrushes(*wxWHITE_BRUSH, *wxWHITE_BRUSH,
97 *wxWHITE_PEN, *wxWHITE_PEN);
100 artist.pSelectedRegion = ®ion;
101 ZoomInfo zoomInfo(0.0, width / screenDuration);
102 artist.pZoomInfo = &zoomInfo;
103 int y = rulerPageHeight;
104
106 for (auto n : l->Channels()) {
108 wxRect r;
109 r.x = 0;
110 r.y = 0;
111 r.width = width;
112
113
114
115 auto trackHeight = (int)(view.GetHeight() * scale);
116 r.height = trackHeight;
117
118 const auto subViews = view.GetSubViews( r );
119 if (subViews.empty())
120 continue;
121
122 auto iter = subViews.begin(),
end = subViews.end(), next = iter;
123 auto yy = iter->first;
124 for ( ; iter !=
end; iter = next ) {
125 ++next;
126 auto nextY = ( next ==
end )
127 ? trackHeight
128 : next->first;
129 r.y = y + yy;
130 r.SetHeight( nextY - yy );
131 yy = nextY;
132
134 *dc, {}, {}, &artist
135 };
137 }
138
139 dc->SetPen(*wxBLACK_PEN);
141
142 y += trackHeight;
143 }
144 };
145
146 return true;
147}
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
static int GetTotalHeight(const TrackList &list)
static ChannelView & Get(Channel &channel)
static const LinearUpdater & Instance()
void SetOrientation(int orient)
void Draw(wxDC &dc) const
void SetLabelEdges(bool labelEdges)
void SetBounds(int left, int top, int right, int bottom)
void SetRange(double min, double max)
Defines a selected portion of a project.
This class handles the actual rendering of WaveTracks (both waveforms and spectra),...
double GetEndTime() const
Return the greatest end time of the tracks, or 0 when no tracks.
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.