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, bool bHasSoloButton, const Track *pTrack)
 
static void GetEffectsRect (const wxRect &rect, wxRect &dest, const Track *pTrack)
 
- Static Public Member Functions inherited from CommonTrackControls
static const TCPLinesStaticTCPLines ()
 
- 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
virtual const TCPLinesGetTCPLines () const
 
 TrackControls (std::shared_ptr< Track > pTrack)
 
- Public Member Functions inherited from TrackControls
 TrackControls (std::shared_ptr< Track > pTrack)
 
virtual ~TrackControls ()=0
 
- Public Member Functions inherited from CommonTrackCell
 CommonTrackCell (const std::shared_ptr< Track > &pTrack)
 
 ~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 &) PROHIBITED
 
TrackPanelCelloperator= (const TrackPanelCell &) PROHIBITED
 
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< SelectButtonHandlemSelectButtonHandle
 
std::weak_ptr< TrackSelectHandlemSelectHandle
 

Detailed Description

Definition at line 19 of file PlayableTrackControls.h.

Member Function Documentation

◆ GetEffectsRect()

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

Definition at line 239 of file PlayableTrackControls.cpp.

241{
242 auto &trackControl = static_cast<const CommonTrackControls&>(
243 TrackControls::Get( *pTrack ) );
244 const auto resultsE = TrackInfo::CalcItemY( trackControl.GetTCPLines(), TCPLine::kItemEffects );
245 dest.x = rect.x;
246 dest.y = rect.y + resultsE.first;
247 dest.width = rect.width;
248 dest.height = resultsE.second;
249
250}
static TrackControls & Get(Track &track)
AUDACITY_DLL_API std::pair< int, int > CalcItemY(const TCPLines &lines, unsigned iItem)
Definition: TrackInfo.cpp:142

References TrackInfo::CalcItemY(), TrackControls::Get(), and TrackInfo::TCPLine::kItemEffects.

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,
bool  bHasSoloButton,
const Track pTrack 
)
static

Definition at line 206 of file PlayableTrackControls.cpp.

209{
210 auto &trackControl = static_cast<const CommonTrackControls&>(
211 TrackControls::Get( *pTrack ) );
212 auto resultsM = TrackInfo::CalcItemY( trackControl.GetTCPLines(), TCPLine::kItemMute );
213 auto resultsS = TrackInfo::CalcItemY( trackControl.GetTCPLines(), TCPLine::kItemSolo );
214 dest.height = resultsS.second;
215
216 int yMute = resultsM.first;
217 int ySolo = resultsS.first;
218
219 bool bSameRow = ( yMute == ySolo );
220 bool bNarrow = bSameRow && bHasSoloButton;
221
222 if( bNarrow )
223 {
224 if( solo )
225 GetNarrowSoloHorizontalBounds( rect, dest );
226 else
227 GetNarrowMuteHorizontalBounds( rect, dest );
228 }
229 else
231
232 if( bSameRow || !solo )
233 dest.y = rect.y + yMute;
234 else
235 dest.y = rect.y + ySolo;
236
237}
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, and TrackInfo::TCPLine::kItemSolo.

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 252 of file PlayableTrackControls.cpp.

253{
254 static TCPLines playableTrackTCPLines;
255 static std::once_flag flag;
256 std::call_once( flag, []{
257 playableTrackTCPLines = CommonTrackControls::StaticTCPLines();
258 playableTrackTCPLines.insert( playableTrackTCPLines.end(), {
259 { TCPLine::kItemMute | TCPLine::kItemSolo, kTrackInfoBtnSize + 1, 0,
260 MuteAndSoloDrawFunction },
261 } );
262 } );
263 return playableTrackTCPLines;
264}
TrackInfo::TCPLines TCPLines
Definition: TrackInfo.cpp:98
static std::once_flag flag
static const TCPLines & StaticTCPLines()
Definition: TrackInfo.cpp:119

References flag, and CommonTrackControls::StaticTCPLines().

Here is the call graph for this function:

◆ StaticWaveTCPLines()

const TCPLines & PlayableTrackControls::StaticWaveTCPLines ( )
static

Definition at line 266 of file PlayableTrackControls.cpp.

267{
268 static TCPLines playableTrackTCPLines;
269 static std::once_flag flag;
270 std::call_once( flag, []{
271 playableTrackTCPLines = CommonTrackControls::StaticTCPLines();
272 playableTrackTCPLines.insert( playableTrackTCPLines.end(), {
273 { TCPLine::kItemMute | TCPLine::kItemSolo, kTrackInfoBtnSize + 1, 0,
274 MuteAndSoloDrawFunction },
275 } );
276 playableTrackTCPLines.insert( playableTrackTCPLines.end(), {
277 { TCPLine::kItemEffects, kTrackEffectsBtnHeight + 1, 0,
278 EffectsDrawFunction },
279 } );
280 } );
281 return playableTrackTCPLines;
282}

References flag, and CommonTrackControls::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: