Audacity  2.3.1
Public Member Functions | Protected Attributes | List of all members
PlayableTrack Class Reference

An AudioTrack that can be played and stopped. More...

#include <Track.h>

Inheritance diagram for PlayableTrack:
AudioTrack Track CommonTrackPanelCell XMLTagHandler TrackPanelCell TrackPanelNode NoteTrack WaveTrack

Public Member Functions

 PlayableTrack (const std::shared_ptr< DirManager > &projDirManager)
 
 PlayableTrack (const Track &orig)
 
bool GetMute () const
 
bool GetSolo () const
 
void SetMute (bool m)
 
void SetSolo (bool s)
 
void Init (const PlayableTrack &init)
 
void Merge (const Track &init) override
 
void WriteXMLAttributes (XMLWriter &xmlFile) const
 
bool HandleXMLAttribute (const wxChar *attr, const wxChar *value)
 
- Public Member Functions inherited from AudioTrack
 AudioTrack (const std::shared_ptr< DirManager > &projDirManager)
 
 AudioTrack (const Track &orig)
 
void WriteXMLAttributes (XMLWriter &WXUNUSED(xmlFile)) const
 
bool HandleXMLAttribute (const wxChar *, const wxChar *)
 
- Public Member Functions inherited from Track
TrackId GetId () const
 
std::shared_ptr< const TrackSubstitutePendingChangedTrack () const
 
std::shared_ptr< const TrackSubstituteOriginalTrack () const
 
std::vector< UIHandlePtrHitTest (const TrackPanelMouseState &, const AudacityProject *pProject) finaloverride
 
std::shared_ptr< TrackPanelCellContextMenuDelegate () override
 
virtual std::vector< UIHandlePtrDetailedHitTest (const TrackPanelMouseState &, const AudacityProject *pProject, int currentTool, bool bMultiTool)=0
 
std::shared_ptr< TrackPanelCellGetTrackControl ()
 
std::shared_ptr< TrackPanelCellGetVRulerControl ()
 
std::shared_ptr< TrackPanelCellGetResizer ()
 
virtual int GetMinimizedHeight () const
 
int GetActualHeight () const
 
int GetIndex () const
 
void SetIndex (int index)
 
int GetY () const
 
int GetHeight () const
 
void SetHeight (int h)
 
bool GetMinimized () const
 
void SetMinimized (bool isMinimized)
 
bool LinkConsistencyCheck ()
 
 Track (const std::shared_ptr< DirManager > &projDirManager)
 
 Track (const Track &orig)
 
virtual ~Track ()
 
void Init (const Track &orig)
 
virtual Holder Duplicate () const =0
 
wxString GetName () const
 
void SetName (const wxString &n)
 
wxString GetDefaultName () const
 
void SetDefaultName (const wxString &n)
 
bool GetSelected () const
 
virtual void SetSelected (bool s)
 
virtual ChannelType GetChannel () const
 
virtual double GetOffset () const =0
 
void Offset (double t)
 
virtual void SetOffset (double o)
 
virtual void SetPan (float)
 
virtual void SetPanFromChannelType ()
 
const std::shared_ptr
< DirManager > & 
GetDirManager () const
 
virtual Holder Cut (double WXUNUSED(t0), double WXUNUSED(t1))=0
 
virtual Holder Copy (double WXUNUSED(t0), double WXUNUSED(t1), bool forClipboard=true) const =0
 
virtual void Clear (double WXUNUSED(t0), double WXUNUSED(t1))=0
 
virtual void Paste (double WXUNUSED(t), const Track *WXUNUSED(src))=0
 
virtual void SyncLockAdjust (double oldT1, double newT1)
 
virtual void Silence (double WXUNUSED(t0), double WXUNUSED(t1))=0
 
virtual void InsertSilence (double WXUNUSED(t), double WXUNUSED(len))=0
 
bool SameKindAs (const Track &track) const
 
template<typename R = void, typename... Functions>
TypeSwitch (const Functions &...functions)
 
template<typename R = void, typename... Functions>
TypeSwitch (const Functions &...functions) const
 
virtual void WriteXML (XMLWriter &xmlFile) const =0
 
virtual bool GetErrorOpening ()
 
virtual double GetStartTime () const =0
 
virtual double GetEndTime () const =0
 
bool IsSyncLockSelected () const
 
void Notify (int code=-1)
 
bool Any () const
 
bool IsSelected () const
 
bool IsSelectedOrSyncLockSelected () const
 
bool IsLeader () const
 
bool IsSelectedLeader () const
 
- Public Member Functions inherited from CommonTrackPanelCell
 CommonTrackPanelCell ()
 
virtual ~CommonTrackPanelCell ()=0
 
HitTestPreview DefaultPreview (const TrackPanelMouseState &, const AudacityProject *) override
 
- Public Member Functions inherited from TrackPanelCell
virtual ~TrackPanelCell ()=0
 
virtual unsigned DoContextMenu (const wxRect &rect, wxWindow *pParent, wxPoint *pPosition)
 
virtual unsigned CaptureKey (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
virtual unsigned KeyDown (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
virtual unsigned KeyUp (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
virtual unsigned Char (wxKeyEvent &event, ViewInfo &viewInfo, wxWindow *pParent)
 
- Public Member Functions inherited from TrackPanelNode
 TrackPanelNode ()
 
virtual ~TrackPanelNode ()=0
 
- Public Member Functions inherited from XMLTagHandler
 XMLTagHandler ()
 
virtual ~XMLTagHandler ()
 
virtual bool HandleXMLTag (const wxChar *tag, const wxChar **attrs)=0
 
virtual void HandleXMLEndTag (const wxChar *WXUNUSED(tag))
 
virtual void HandleXMLContent (const wxString &WXUNUSED(content))
 
virtual XMLTagHandlerHandleXMLChild (const wxChar *tag)=0
 
bool ReadXMLTag (const char *tag, const char **attrs)
 
void ReadXMLEndTag (const char *tag)
 
void ReadXMLContent (const char *s, int len)
 
XMLTagHandlerReadXMLChild (const char *tag)
 

Protected Attributes

bool mMute { false }
 
bool mSolo { false }
 
- Protected Attributes inherited from Track
std::weak_ptr< TrackListmList
 
TrackNodePointer mNode {}
 
int mIndex
 
int mY
 
int mHeight
 
wxString mName
 
wxString mDefaultName
 
bool mLinked
 
bool mMinimized
 
ChannelType mChannel
 
double mOffset
 
std::shared_ptr< DirManagermDirManager
 
std::shared_ptr< TrackControlsmpControls
 
std::shared_ptr
< TrackVRulerControls
mpVRulerContols
 
std::shared_ptr
< TrackPanelResizerCell
mpResizer
 
std::weak_ptr< SelectHandlemSelectHandle
 
std::weak_ptr< TimeShiftHandlemTimeShiftHandle
 

Additional Inherited Members

- Public Types inherited from Track
enum  ChannelType { LeftChannel = 0, RightChannel = 1, MonoChannel = 2 }
 
enum  : unsigned { DefaultHeight = 150 }
 
using Holder = std::unique_ptr< Track >
 
template<typename R = void>
using Continuation = std::function< R() >
 
using Fallthrough = Continuation<>
 
- Static Public Member Functions inherited from Track
template<typename Subclass = Track>
static std::shared_ptr< Subclass > Pointer (Track *t)
 
template<typename Subclass = const Track>
static std::shared_ptr< Subclass > Pointer (const Track *t)
 
static void FinishCopy (const Track *n, Track *dest)
 
- Public Attributes inherited from Track
wxSize vrulerSize
 
- Protected Member Functions inherited from Track
virtual void DoSetHeight (int h)
 
virtual void DoSetMinimized (bool isMinimized)
 
std::shared_ptr< TrackFindTrack () override
 
virtual std::shared_ptr
< TrackControls
GetControls ()=0
 
virtual std::shared_ptr
< TrackVRulerControls
GetVRulerControls ()=0
 
- Protected Member Functions inherited from CommonTrackPanelCell
unsigned HandleWheelRotation (const TrackPanelMouseEvent &event, AudacityProject *pProject) override
 

Detailed Description

An AudioTrack that can be played and stopped.

Definition at line 769 of file Track.h.

Constructor & Destructor Documentation

PlayableTrack::PlayableTrack ( const std::shared_ptr< DirManager > &  projDirManager)
inline

Definition at line 772 of file Track.h.

773  : AudioTrack{ projDirManager } {}
A Track that can load/save audio data to/from XML.
Definition: Track.h:754
PlayableTrack::PlayableTrack ( const Track orig)
inline

Definition at line 774 of file Track.h.

774 : AudioTrack{ orig } {}
A Track that can load/save audio data to/from XML.
Definition: Track.h:754

Member Function Documentation

bool PlayableTrack::GetMute ( ) const
inline
bool PlayableTrack::GetSolo ( ) const
inline
bool PlayableTrack::HandleXMLAttribute ( const wxChar *  attr,
const wxChar *  value 
)

Definition at line 421 of file Track.cpp.

References AudioTrack::HandleXMLAttribute(), XMLValueChecker::IsGoodInt(), mMute, and mSolo.

Referenced by NoteTrack::HandleXMLTag(), and WaveTrack::HandleXMLTag().

422 {
423  const wxString strValue{ value };
424  long nValue;
425  if (!wxStrcmp(attr, wxT("mute")) &&
426  XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue)) {
427  mMute = (nValue != 0);
428  return true;
429  }
430  else if (!wxStrcmp(attr, wxT("solo")) &&
431  XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue)) {
432  mSolo = (nValue != 0);
433  return true;
434  }
435 
436  return AudioTrack::HandleXMLAttribute(attr, value);
437 }
bool mSolo
Definition: Track.h:792
static bool IsGoodInt(const wxString &strInt)
Check that the supplied string can be converted to a long (32bit) integer.
bool HandleXMLAttribute(const wxChar *, const wxChar *)
Definition: Track.h:765
bool mMute
Definition: Track.h:791
void PlayableTrack::Init ( const PlayableTrack init)

Definition at line 380 of file Track.cpp.

References Track::Init(), mMute, and mSolo.

Referenced by WaveTrack::Init().

381 {
382  mMute = orig.mMute;
383  mSolo = orig.mSolo;
384  AudioTrack::Init( orig );
385 }
bool mSolo
Definition: Track.h:792
void Init(const Track &orig)
Definition: Track.cpp:78
bool mMute
Definition: Track.h:791
void PlayableTrack::Merge ( const Track init)
overridevirtual

Reimplemented from Track.

Reimplemented in WaveTrack.

Definition at line 387 of file Track.cpp.

References Track::Merge(), mMute, and mSolo.

Referenced by WaveTrack::Merge().

388 {
389  auto pOrig = dynamic_cast<const PlayableTrack *>(&orig);
390  wxASSERT( pOrig );
391  mMute = pOrig->mMute;
392  mSolo = pOrig->mSolo;
393  AudioTrack::Merge( *pOrig );
394 }
bool mSolo
Definition: Track.h:792
An AudioTrack that can be played and stopped.
Definition: Track.h:769
virtual void Merge(const Track &orig)
Definition: Track.cpp:112
bool mMute
Definition: Track.h:791
void PlayableTrack::SetMute ( bool  m)

Definition at line 396 of file Track.cpp.

References mMute, and Track::Notify().

397 {
398  if ( mMute != m ) {
399  mMute = m;
400  Notify();
401  }
402 }
void Notify(int code=-1)
Definition: Track.cpp:350
bool mMute
Definition: Track.h:791
void PlayableTrack::SetSolo ( bool  s)

Definition at line 404 of file Track.cpp.

References mSolo, and Track::Notify().

Referenced by TrackActions::DoTrackMute().

405 {
406  if ( mSolo != s ) {
407  mSolo = s;
408  Notify();
409  }
410 }
bool mSolo
Definition: Track.h:792
void Notify(int code=-1)
Definition: Track.cpp:350
void PlayableTrack::WriteXMLAttributes ( XMLWriter xmlFile) const

Definition at line 413 of file Track.cpp.

References mMute, mSolo, XMLWriter::WriteAttr(), and AudioTrack::WriteXMLAttributes().

Referenced by NoteTrack::WriteXML(), and WaveTrack::WriteXML().

414 {
415  xmlFile.WriteAttr(wxT("mute"), mMute);
416  xmlFile.WriteAttr(wxT("solo"), mSolo);
418 }
bool mSolo
Definition: Track.h:792
virtual void WriteAttr(const wxString &name, const wxString &value)
Definition: XMLWriter.cpp:131
void WriteXMLAttributes(XMLWriter &WXUNUSED(xmlFile)) const
Definition: Track.h:762
bool mMute
Definition: Track.h:791

Member Data Documentation

bool PlayableTrack::mMute { false }
protected

Definition at line 791 of file Track.h.

Referenced by HandleXMLAttribute(), Init(), Merge(), SetMute(), and WriteXMLAttributes().

bool PlayableTrack::mSolo { false }
protected

Definition at line 792 of file Track.h.

Referenced by HandleXMLAttribute(), Init(), Merge(), SetSolo(), and WriteXMLAttributes().


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