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 GetEffectsRect (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< 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 234 of file PlayableTrackControls.cpp.

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

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

Definition at line 201 of file PlayableTrackControls.cpp.

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

248{
249 static TCPLines playableTrackTCPLines;
250 static std::once_flag flag;
251 std::call_once( flag, []{
252 playableTrackTCPLines = CommonTrackInfo::StaticTCPLines();
253 playableTrackTCPLines.insert( playableTrackTCPLines.end(), {
254 { TCPLine::kItemMute | TCPLine::kItemSolo, kTrackInfoBtnSize + 1, 0,
255 MuteAndSoloDrawFunction },
256 } );
257 } );
258 return playableTrackTCPLines;
259}
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 261 of file PlayableTrackControls.cpp.

262{
263 static TCPLines playableTrackTCPLines;
264 static std::once_flag flag;
265 std::call_once( flag, []{
266 playableTrackTCPLines = CommonTrackInfo::StaticTCPLines();
267 playableTrackTCPLines.insert( playableTrackTCPLines.end(), {
268 { TCPLine::kItemMute | TCPLine::kItemSolo, kTrackInfoBtnSize + 1, 0,
269 MuteAndSoloDrawFunction },
270 } );
271 playableTrackTCPLines.insert( playableTrackTCPLines.end(), {
272 { TCPLine::kItemEffects, kTrackEffectsBtnHeight + 1, 0,
273 EffectsDrawFunction },
274 } );
275 } );
276 return playableTrackTCPLines;
277}

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: