Audacity 3.2.0
PlayableTrack.h
Go to the documentation of this file.
1/*!********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 @file PlayableTrack.h
6 @brief Extends Track with notions of mute and solo setting
7
8 Dominic Mazzoni
9
10 Paul Licameli split from Track.h
11
12**********************************************************************/
13#ifndef __AUDACITY_PLAYABLE_TRACK__
14#define __AUDACITY_PLAYABLE_TRACK__
15
16#include "Prefs.h"
17#include "Track.h"
18
20class PLAYABLE_TRACK_API AudioTrack /* not final */ : public Track
21{
22public:
23 AudioTrack();
24 AudioTrack(const Track &orig, ProtectedCreationArg &&a);
25
26 static const TypeInfo &ClassTypeInfo();
27
28 // Serialize, not with tags of its own, but as attributes within a tag.
29 void WriteXMLAttributes(XMLWriter &WXUNUSED(xmlFile)) const {}
30
31 // Return true iff the attribute is recognized.
32 bool HandleXMLAttribute(const std::string_view & /*attr*/, const XMLAttributeValueView &/*value*/)
33 { return false; }
34};
35
37
39class PLAYABLE_TRACK_API PlayableTrack /* not final */ : public AudioTrack
40{
41public:
44
45 static const TypeInfo &ClassTypeInfo();
46
47 bool GetMute () const { return DoGetMute(); }
48 bool GetSolo () const { return DoGetSolo(); }
49 bool GetNotMute () const { return !DoGetMute(); }
50 bool GetNotSolo () const { return !DoGetSolo(); }
51 void SetMute (bool m);
52 void SetSolo (bool s);
53
54 // Serialize, not with tags of its own, but as attributes within a tag.
55 void WriteXMLAttributes(XMLWriter &xmlFile) const;
56
57 // Return true iff the attribute is recognized.
58 bool HandleXMLAttribute(const std::string_view &attr, const XMLAttributeValueView &value);
59
60protected:
61 bool DoGetMute() const;
62 void DoSetMute(bool value);
63 bool DoGetSolo() const;
64 void DoSetSolo(bool value);
65};
66
68
72};
73
74extern PLAYABLE_TRACK_API EnumSetting<SoloBehavior> TracksBehaviorsSolo;
75
76#endif
SoloBehavior
Definition: PlayableTrack.h:69
@ SoloBehaviorSimple
Definition: PlayableTrack.h:70
@ SoloBehaviorMulti
Definition: PlayableTrack.h:71
ENUMERATE_TRACK_TYPE(AudioTrack)
PLAYABLE_TRACK_API EnumSetting< SoloBehavior > TracksBehaviorsSolo
declares abstract base class Track, TrackList, and iterators over TrackList
Track subclass holding data representing sound (as notes, or samples, or ...)
Definition: PlayableTrack.h:21
bool HandleXMLAttribute(const std::string_view &, const XMLAttributeValueView &)
Definition: PlayableTrack.h:32
void WriteXMLAttributes(XMLWriter &WXUNUSED(xmlFile)) const
Definition: PlayableTrack.h:29
Adapts EnumSettingBase to a particular enumeration type.
Definition: Prefs.h:514
AudioTrack subclass that can also be audibly replayed by the program.
Definition: PlayableTrack.h:40
bool GetSolo() const
Definition: PlayableTrack.h:48
bool GetNotMute() const
Definition: PlayableTrack.h:49
bool GetNotSolo() const
Definition: PlayableTrack.h:50
bool GetMute() const
Definition: PlayableTrack.h:47
Abstract base class for an object holding data associated with points on a time axis.
Definition: Track.h:110
static const TypeInfo & ClassTypeInfo()
Definition: Track.cpp:790
A view into an attribute value. The class does not take the ownership of the data.
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
Definition: XMLWriter.h:25
Empty argument passed to some public constructors.
Definition: Track.h:117