Audacity 3.2.0
Static Public Member Functions | List of all members
PlayableTrackControls Class Reference

#include <PlayableTrackControls.h>

Inheritance diagram for PlayableTrackControls:
[legend]
Collaboration diagram for PlayableTrackControls:
[legend]

Static Public Member Functions

static const TCPLinesStaticNoteTCPLines ()
 
static const TCPLinesStaticWaveTCPLines ()
 
static void GetMuteSoloRect (const wxRect &rect, wxRect &dest, bool solo, const Track *pTrack)
 
static void GetEffectsButtonRect (const wxRect &rect, wxRect &dest, const Track *pTrack)
 
- Static Public Member Functions inherited from TrackControls
static TrackControlsGet (Track &track)
 
static const TrackControlsGet (const Track &track)
 
- Static Public Member Functions inherited from TrackPanelDrawable
static wxRect MaximizeWidth (const wxRect &rect, const wxRect &panelRect)
 
static wxRect MaximizeHeight (const wxRect &rect, const wxRect &panelRect)
 

Additional Inherited Members

- Public Member Functions inherited from CommonTrackControls
const TCPLinesGetTCPLines () const override
 
 TrackControls (std::shared_ptr< Track > pTrack)
 
- Public Member Functions inherited from TrackControls
 TrackControls (std::shared_ptr< Track > pTrack)
 
virtual ~TrackControls ()=0
 
virtual const TrackInfo::TCPLinesGetTCPLines () const =0
 
- Public Member Functions inherited from CommonTrackCell
 CommonTrackCell (const std::shared_ptr< Track > &pTrack)
 Construct from a track. More...
 
 ~CommonTrackCell ()
 
std::shared_ptr< TrackDoFindTrack () override
 
void Reparent (const std::shared_ptr< Track > &parent) override
 Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More...
 
- Public Member Functions inherited from CommonTrackPanelCell
 CommonTrackPanelCell ()
 
virtual ~CommonTrackPanelCell ()=0
 
HitTestPreview DefaultPreview (const TrackPanelMouseState &, const AudacityProject *) override
 
std::shared_ptr< TrackFindTrack ()
 
std::shared_ptr< const TrackFindTrack () const
 
virtual std::vector< MenuItemGetMenuItems (const wxRect &rect, const wxPoint *pPosition, AudacityProject *pProject)
 Return a list of items for DoContextMenu() (empties for separators) More...
 
- Public Member Functions inherited from TrackPanelCell
 TrackPanelCell ()=default
 
 TrackPanelCell (const TrackPanelCell &)=delete
 
TrackPanelCelloperator= (const TrackPanelCell &)=delete
 
virtual ~TrackPanelCell ()=0
 
virtual HitTestPreview DefaultPreview (const TrackPanelMouseState &state, const AudacityProject *pProject)
 
virtual std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &state, const AudacityProject *pProject)=0
 
virtual unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject)
 
virtual std::shared_ptr< TrackPanelCellContextMenuDelegate ()
 
virtual unsigned DoContextMenu (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, AudacityProject *pProject)
 
virtual unsigned CaptureKey (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
 
virtual unsigned KeyDown (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
 
virtual unsigned KeyUp (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
 
virtual unsigned Char (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent, AudacityProject *project)
 
virtual unsigned LoseFocus (AudacityProject *project)
 
- Public Member Functions inherited from TrackPanelNode
 TrackPanelNode ()
 
virtual ~TrackPanelNode ()=0
 
- Public Member Functions inherited from TrackPanelDrawable
virtual ~TrackPanelDrawable ()=0
 
virtual void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass)
 
virtual wxRect DrawingArea (TrackPanelDrawingContext &context, const wxRect &rect, const wxRect &panelRect, unsigned iPass)
 
- Public Member Functions inherited from TrackAttachment
virtual ~TrackAttachment ()
 
virtual void CopyTo (Track &track) const
 Copy state, for undo/redo purposes. More...
 
virtual void Reparent (const std::shared_ptr< Track > &parent)
 Object may be shared among tracks but hold a special back-pointer to one of them; reassign it. More...
 
virtual void WriteXMLAttributes (XMLWriter &) const
 Serialize persistent attributes. More...
 
virtual bool HandleXMLAttribute (const std::string_view &attr, const XMLAttributeValueView &valueView)
 Deserialize an attribute, returning true if recognized. More...
 
- Public Member Functions inherited from ClientData::Base
virtual ~Base ()
 
- Protected Member Functions inherited from CommonTrackControls
virtual std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &state, const AudacityProject *) override=0
 
unsigned DoContextMenu (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, AudacityProject *pProject) override
 
virtual PopupMenuTableGetMenuExtension (Track *pTrack)=0
 
void Draw (TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
 
wxRect DrawingArea (TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
 
- Protected Member Functions inherited from CommonTrackPanelCell
virtual std::shared_ptr< TrackDoFindTrack ()=0
 
unsigned DoContextMenu (const wxRect &rect, wxWindow *pParent, const wxPoint *pPosition, AudacityProject *pProject) override
 
unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 
- Protected Attributes inherited from CommonTrackControls
std::weak_ptr< CloseButtonHandlemCloseHandle
 
std::weak_ptr< MenuButtonHandlemMenuHandle
 
std::weak_ptr< MinimizeButtonHandlemMinimizeHandle
 
std::weak_ptr< TrackSelectHandlemSelectHandle
 

Detailed Description

Definition at line 19 of file PlayableTrackControls.h.

Member Function Documentation

◆ GetEffectsButtonRect()

void PlayableTrackControls::GetEffectsButtonRect ( const wxRect &  rect,
wxRect &  dest,
const Track pTrack 
)
static

Definition at line 229 of file PlayableTrackControls.cpp.

231{
232 const auto rect = wxRect(rect_).Deflate(CommonTrackInfo::Margin);
233
234 auto &trackControl = static_cast<const CommonTrackControls&>(
235 TrackControls::Get( *pTrack ) );
236 const auto resultsE = TrackInfo::CalcItemY( trackControl.GetTCPLines(), TCPLine::kItemEffects );
237 GetEffectsButtonBounds(rect, dest);
238 dest.y = rect.y + resultsE.first;
239 dest.height = resultsE.second;
240}
static TrackControls & Get(Track &track)
static constexpr auto Margin
AUDACITY_DLL_API std::pair< int, int > CalcItemY(const TCPLines &lines, unsigned iItem)
Definition: TrackInfo.cpp:61
void GetEffectsButtonBounds(const wxRect &rect, wxRect &dest)

References TrackInfo::CalcItemY(), TrackControls::Get(), anonymous_namespace{PlayableTrackControls.cpp}::GetEffectsButtonBounds(), TrackInfo::TCPLine::kItemEffects, and CommonTrackInfo::Margin.

Referenced by EffectsButtonHandle::HitTest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMuteSoloRect()

void PlayableTrackControls::GetMuteSoloRect ( const wxRect &  rect,
wxRect &  dest,
bool  solo,
const Track pTrack 
)
static

Definition at line 199 of file PlayableTrackControls.cpp.

202{
203 const auto rect = wxRect(rect_).Deflate(CommonTrackInfo::Margin);
204
205 auto &trackControl = static_cast<const CommonTrackControls&>(
206 TrackControls::Get( *pTrack ) );
207 const auto [yMute, yHeight] = TrackInfo::CalcItemY( trackControl.GetTCPLines(), TCPLine::kItemMute );
208 const auto [ySolo, sHeight] = TrackInfo::CalcItemY( trackControl.GetTCPLines(), TCPLine::kItemSolo );
209 dest.height = sHeight;
210
211 const auto bSameRow = ( yMute == ySolo );
212
213 if( bSameRow )
214 {
215 if( solo )
216 GetNarrowSoloHorizontalBounds( rect, dest );
217 else
218 GetNarrowMuteHorizontalBounds( rect, dest );
219 }
220 else
222
223 if( bSameRow || !solo )
224 dest.y = rect.y + yMute;
225 else
226 dest.y = rect.y + ySolo;
227}
void GetNarrowSoloHorizontalBounds(const wxRect &rect, wxRect &dest)
void GetNarrowMuteHorizontalBounds(const wxRect &rect, wxRect &dest)
void GetWideMuteSoloHorizontalBounds(const wxRect &rect, wxRect &dest)

References TrackInfo::CalcItemY(), TrackControls::Get(), anonymous_namespace{PlayableTrackControls.cpp}::GetNarrowMuteHorizontalBounds(), anonymous_namespace{PlayableTrackControls.cpp}::GetNarrowSoloHorizontalBounds(), anonymous_namespace{PlayableTrackControls.cpp}::GetWideMuteSoloHorizontalBounds(), TrackInfo::TCPLine::kItemMute, TrackInfo::TCPLine::kItemSolo, and CommonTrackInfo::Margin.

Referenced by MuteButtonHandle::HitTest(), and SoloButtonHandle::HitTest().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StaticNoteTCPLines()

const TCPLines & PlayableTrackControls::StaticNoteTCPLines ( )
static

Definition at line 242 of file PlayableTrackControls.cpp.

243{
244 static TCPLines playableTrackTCPLines;
245 static std::once_flag flag;
246 std::call_once( flag, []{
247 playableTrackTCPLines = CommonTrackInfo::StaticTCPLines();
248 playableTrackTCPLines.insert( playableTrackTCPLines.end(), {
249 { TCPLine::kItemMute | TCPLine::kItemSolo, MuteSoloButtonHeight, MuteSoloButtonExtra,
250 MuteAndSoloDrawFunction },
251 } );
252 } );
253 return playableTrackTCPLines;
254}
std::vector< TrackInfo::TCPLine > TCPLines
static std::once_flag flag
AUDACITY_DLL_API const TCPLines & StaticTCPLines()

References flag, and CommonTrackInfo::StaticTCPLines().

Referenced by NoteTrackTCPLines::NoteTrackTCPLines().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ StaticWaveTCPLines()

const TCPLines & PlayableTrackControls::StaticWaveTCPLines ( )
static

Definition at line 256 of file PlayableTrackControls.cpp.

257{
258 static TCPLines playableTrackTCPLines;
259 static std::once_flag flag;
260 std::call_once( flag, []{
261 playableTrackTCPLines = CommonTrackInfo::StaticTCPLines();
262 playableTrackTCPLines.insert( playableTrackTCPLines.end(), {
263 { TCPLine::kItemMute | TCPLine::kItemSolo, MuteSoloButtonHeight, MuteSoloButtonExtra,
264 MuteAndSoloDrawFunction },
265 } );
266 playableTrackTCPLines.insert( playableTrackTCPLines.end(), {
267 { TCPLine::kItemEffects, EffectsButtonHeight, 0,
268 EffectsDrawFunction },
269 } );
270 } );
271 return playableTrackTCPLines;
272}

References flag, and CommonTrackInfo::StaticTCPLines().

Referenced by WaveTrackTCPLines::WaveTrackTCPLines().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: