Audacity  2.2.2
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 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::vector< UIHandlePtrHitTest (const TrackPanelMouseState &, const AudacityProject *pProject) finaloverride
 
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)
 
TrackGetLink () const
 
 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)
 
bool GetLinked () const
 
void SetLinked (bool l)
 
virtual int GetChannel () const
 
virtual double GetOffset () const =0
 
void Offset (double t)
 
virtual void SetOffset (double o)
 
void SetChannel (int c)
 
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
 
virtual int GetKind () const
 
virtual void WriteXML (XMLWriter &xmlFile) const =0
 
virtual bool GetErrorOpening ()
 
virtual double GetStartTime () const =0
 
virtual double GetEndTime () const =0
 
bool IsSyncLockSelected () const
 
- Public Member Functions inherited from CommonTrackPanelCell
 CommonTrackPanelCell ()
 
virtual ~CommonTrackPanelCell ()=0
 
- 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 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 mSelected
 
bool mLinked
 
bool mMinimized
 
int 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  { LeftChannel = 0, RightChannel = 1, MonoChannel = 2 }
 
enum  TrackKindEnum {
  None, Wave, Label, Time,
  All
}
 
enum  : unsigned { DefaultHeight = 150 }
 
using Holder = std::unique_ptr< Track >
 
- 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)
 
- 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 375 of file Track.h.

Constructor & Destructor Documentation

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

Definition at line 378 of file Track.h.

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

Definition at line 380 of file Track.h.

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

Member Function Documentation

bool PlayableTrack::GetMute ( ) const
inline

Definition at line 382 of file Track.h.

Referenced by audacityAudioCallback(), and TrackArtist::DrawTrack().

382 { return mMute; }
bool mMute
Definition: Track.h:397
bool PlayableTrack::GetSolo ( ) const
inline

Definition at line 383 of file Track.h.

Referenced by audacityAudioCallback(), and TrackArtist::DrawTrack().

383 { return mSolo; }
bool mSolo
Definition: Track.h:398
bool PlayableTrack::HandleXMLAttribute ( const wxChar *  attr,
const wxChar *  value 
)

Definition at line 368 of file Track.cpp.

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

Referenced by WaveTrack::HandleXMLTag().

369 {
370  const wxString strValue{ value };
371  long nValue;
372  if (!wxStrcmp(attr, wxT("mute")) &&
373  XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue)) {
374  mMute = (nValue != 0);
375  return true;
376  }
377  else if (!wxStrcmp(attr, wxT("solo")) &&
378  XMLValueChecker::IsGoodInt(strValue) && strValue.ToLong(&nValue)) {
379  mSolo = (nValue != 0);
380  return true;
381  }
382 
383  return AudioTrack::HandleXMLAttribute(attr, value);
384 }
bool mSolo
Definition: Track.h:398
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:371
bool mMute
Definition: Track.h:397
void PlayableTrack::Init ( const PlayableTrack init)

Definition at line 343 of file Track.cpp.

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

Referenced by WaveTrack::Init().

344 {
345  mMute = orig.mMute;
346  mSolo = orig.mSolo;
347  AudioTrack::Init( orig );
348 }
bool mSolo
Definition: Track.h:398
void Init(const Track &orig)
Definition: Track.cpp:83
bool mMute
Definition: Track.h:397
void PlayableTrack::Merge ( const Track init)
overridevirtual

Reimplemented from Track.

Reimplemented in WaveTrack.

Definition at line 350 of file Track.cpp.

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

Referenced by WaveTrack::Merge().

351 {
352  auto pOrig = dynamic_cast<const PlayableTrack *>(&orig);
353  wxASSERT( pOrig );
354  mMute = pOrig->mMute;
355  mSolo = pOrig->mSolo;
356  AudioTrack::Merge( *pOrig );
357 }
bool mSolo
Definition: Track.h:398
An AudioTrack that can be played and stopped.
Definition: Track.h:375
virtual void Merge(const Track &orig)
Definition: Track.cpp:104
bool mMute
Definition: Track.h:397
void PlayableTrack::SetMute ( bool  m)
inline
void PlayableTrack::SetSolo ( bool  s)
inline
void PlayableTrack::WriteXMLAttributes ( XMLWriter xmlFile) const

Definition at line 360 of file Track.cpp.

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

Referenced by WaveTrack::WriteXML().

361 {
362  xmlFile.WriteAttr(wxT("mute"), mMute);
363  xmlFile.WriteAttr(wxT("solo"), mSolo);
365 }
bool mSolo
Definition: Track.h:398
virtual void WriteAttr(const wxString &name, const wxString &value)
Definition: XMLWriter.cpp:131
void WriteXMLAttributes(XMLWriter &WXUNUSED(xmlFile)) const
Definition: Track.h:368
bool mMute
Definition: Track.h:397

Member Data Documentation

bool PlayableTrack::mMute { false }
protected

Definition at line 397 of file Track.h.

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

bool PlayableTrack::mSolo { false }
protected

Definition at line 398 of file Track.h.

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


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