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

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

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

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

257{
258 static TCPLines playableTrackTCPLines;
259 static std::once_flag flag;
260 std::call_once( flag, []{
261 playableTrackTCPLines = CommonTrackControls::StaticTCPLines();
262 playableTrackTCPLines.insert( playableTrackTCPLines.end(), {
263 { TCPLine::kItemMute | TCPLine::kItemSolo, kTrackInfoBtnSize + 1, 0,
264 MuteAndSoloDrawFunction },
265 } );
266 } );
267 return playableTrackTCPLines;
268}
TrackInfo::TCPLines TCPLines
Definition: TrackInfo.cpp:102
static std::once_flag flag
static const TCPLines & StaticTCPLines()
Definition: TrackInfo.cpp:123

References flag, and CommonTrackControls::StaticTCPLines().

Here is the call graph for this function:

◆ StaticWaveTCPLines()

const TCPLines & PlayableTrackControls::StaticWaveTCPLines ( )
static

Definition at line 270 of file PlayableTrackControls.cpp.

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

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: