23#include <wx/mousestate.h>
26 const std::shared_ptr<Channel> &channel
34 std::vector<UIHandlePtr> results;
37 std::make_shared<TrackPanelResizeHandle>(pChannel, st.
state.m_y);
39 results.push_back(result);
46 const wxRect &rect,
unsigned iPass )
51 dynamic_cast<Track *
>(&pChannel->GetChannelGroup());
54 auto dc = &context.
dc;
55 const auto &channels = pTrack->Channels();
56 const bool last = (pChannel == *channels.rbegin());
60 dc->DrawRectangle( rect );
72 auto labelw = artist->pZoomInfo->GetLeftOffset() - 1;
75 rect.GetX(), rect.GetY(), labelw, rect.GetHeight() );
78 dc->SetPen(*wxBLACK_PEN);
80 const auto left = rect.GetLeft();
81 AColor::Line( *dc, left, rect.GetTop(), left, rect.GetBottom() );
87 rec.width -= labelw - rec.x;
94 dc->SetBrush(*wxTRANSPARENT_BRUSH);
95 dc->SetPen(*wxBLACK_PEN);
96 const auto left = rec.GetLeft();
97 const auto right = rec.GetRight();
98 const auto top = rec.GetTop();
99 const auto bottom = rec.GetBottom();
111 return std::make_shared<ResizerCellAttachments>(track,
115 return std::make_shared<TrackPanelResizerCell>(
125 auto &track =
static_cast<Track&
>(group);
Adapts TrackAttachment interface with extra channel index argument.
static const AttachedTrackObjects::RegisteredFactory key
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
static void Line(wxDC &dc, wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
static void Dark(wxDC *dc, bool selected, bool highlight=false)
static void TrackPanelBackground(wxDC *dc, bool selected)
Makes temporary drawing context changes that you back out of, RAII style.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Holds multiple objects of the parameter type as a single attachment to Track.
static Attachment & Get(const AttachedTrackObjects::RegisteredFactory &key, Track &track, size_t iChannel)
virtual size_t NChannels() const =0
Report the number of channels.
std::shared_ptr< ChannelType > GetChannel(size_t iChannel)
Retrieve a channel, cast to the given type.
ChannelGroup & GetChannelGroup()
Channel object's lifetime is assumed to be nested in its Track's.
size_t GetChannelIndex() const
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
auto FindChannel() -> std::shared_ptr< Subtype >
May return null.
static TrackArtist * Get(TrackPanelDrawingContext &)
Abstract base class for an object holding data associated with points on a time axis.
std::weak_ptr< TrackPanelResizeHandle > mResizeHandle
TrackPanelResizerCell(const TrackPanelResizerCell &)=delete
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
static TrackPanelResizerCell & Get(Channel &channel)
std::vector< UIHandlePtr > HitTest(const TrackPanelMouseState &, const AudacityProject *) override
static TrackPanelResizerCell & GetFromChannelGroup(ChannelGroup &group, size_t iChannel)