43 auto &view =
Get( *pTrack );
44 return view.GetCumulativeHeightBefore() + view.GetHeight();
54 auto &other =
Get( track );
76 return Get(
const_cast< Track &
>( track ) );
83 auto &track = *pTrack;
90 return Find(
const_cast< Track*
>( pTrack ) );
101 leader->AdjustPositions();
115 if (attr ==
"height" && valueView.
TryGet(nValue)) {
119 nValue = std::max( 40l,
std::min( nValue, 1000l ));
123 else if ( attr ==
"minimized" && valueView.
TryGet(nValue)) {
133 return { { rect.GetTop(), shared_from_this() } };
199 : mProject{ project }
202 .
Subscribe(*
this, &TrackPositioner::OnUpdate);
226 while(
auto pTrack = *iter ) {
228 view.SetCumulativeHeightBefore( yy );
229 yy += view.GetHeight();
239 return std::make_shared< TrackPositioner >( project );
Utility ClientData::Site to register hooks into a host class that attach client data.
declares abstract base class Track, TrackList, and iterators over TrackList
static const AttachedTrackObjects::RegisteredFactory key
DEFINE_ATTACHED_VIRTUAL(DoGetView)
Class template generates single-dispatch, open method registry tables.
static Return Call(This &obj, Arguments &&...arguments)
Invoke the method – but only after static initialization time.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Client code makes static instance from a factory of attachments; passes it to Get or Find as a retrie...
std::shared_ptr< Track > FindTrack()
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
A move-only handle representing a connection to a Publisher.
Abstract base class for an object holding data associated with points on a time axis.
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
auto Find(Track *pTrack) -> TrackIter< TrackType >
Turn a pointer into a TrackIter (constant time); get end iterator if this does not own the track.
auto Any() -> TrackIterRange< TrackType >
static TrackList & Get(AudacityProject &project)
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
std::shared_ptr< TrackVRulerControls > GetVRulerControls()
void SetMinimized(bool minimized)
void WriteXMLAttributes(XMLWriter &) const override
Serialize persistent attributes.
static int GetChannelGroupHeight(const Track *pTrack)
std::shared_ptr< TrackVRulerControls > mpVRulerControls
virtual void DoSetMinimized(bool isMinimized)
bool GetMinimized() const
int GetExpandedHeight() const
static TrackView * Find(Track *)
static int GetTotalHeight(const TrackList &list)
virtual bool IsSpectral() const
bool HandleXMLAttribute(const std::string_view &attr, const XMLAttributeValueView &valueView) override
Deserialize an attribute, returning true if recognized.
static int GetCumulativeHeight(const Track *pTrack)
void SetExpandedHeight(int height)
TrackView(const TrackView &)=delete
void CopyTo(Track &track) const override
Copy state, for undo/redo purposes.
virtual Refinement GetSubViews(const wxRect &rect)
virtual std::shared_ptr< TrackVRulerControls > DoGetVRulerControls()=0
static int GetTrackHeight(const Track *pTrack)
static TrackView & Get(Track &)
virtual std::shared_ptr< CommonTrackCell > GetAffordanceControls()
virtual int GetMinimizedHeight() const =0
std::vector< std::pair< wxCoord, std::shared_ptr< TrackView > > > Refinement
A view into an attribute value. The class does not take the ownership of the data.
bool TryGet(bool &value) const noexcept
Try to get a boolean value from the view.
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
void WriteAttr(const wxString &name, const Identifier &value)
A convenient default parameter for class template Site.
Notification of changes in individual tracks of TrackList, or of TrackList's composition.
const std::weak_ptr< Track > mpTrack
@ RESIZING
Posted when some track changed its height.
@ DELETION
Posted when a track has been deleted from a tracklist. Also posted when one track replaces another.
@ ADDITION
Posted when a track has been added to a tracklist. Also posted when one track replaces another.
@ PERMUTED
Posted when tracks are reordered but otherwise unchanged.
TrackPositioner & operator=(const TrackPositioner &) PROHIBITED
TrackPositioner(AudacityProject &project)
AudacityProject & mProject
void OnUpdate(const TrackListEvent &e)
Observer::Subscription mSubscription
TrackPositioner(const TrackPositioner &) PROHIBITED