11#ifndef __AUDACITY_NOTETRACK__ 
   12#define __AUDACITY_NOTETRACK__ 
   30   void Begin ## name(); \ 
   92   using Holder = std::shared_ptr<NoteTrack>;
 
   98   void MoveTo(
double origin)
 override { mOrigin = origin; }
 
   99   void ShiftBy(
double t0, 
double delta) 
override;
 
  101   Alg_seq &GetSeq() 
const;
 
  103   void WarpAndTransposeNotes(
double t0, 
double t1,
 
  106   void SetSequence(std::unique_ptr<Alg_seq> &&seq);
 
  107   void PrintSequence();
 
  109   Alg_seq *MakeExportableSeq(std::unique_ptr<Alg_seq> &cleanup) 
const;
 
  110   bool ExportMIDI(
const wxString &f) 
const;
 
  111   bool ExportAllegro(
const wxString &f) 
const;
 
  117   bool Trim (
double t0, 
double t1) ;
 
  118   void Clear(
double t0, 
double t1) 
override;
 
  119   void Paste(
double t, 
const Track &src) 
override;
 
  123   bool Shift(
double t) ;
 
  126      return mVelocity.load(std::memory_order_relaxed); }
 
  127   void SetVelocity(
float velocity);
 
  146#define NUM_CHANNELS 16 
  148#define ALL_CHANNELS (1 << NUM_CHANNELS) - 1 
  149#define CHANNEL_BIT(c) (1 << (c % NUM_CHANNELS)) 
  151      return mVisibleChannels.load(std::memory_order_relaxed);
 
  154      mVisibleChannels.store(value, std::memory_order_relaxed);
 
  157      return (GetVisibleChannels() & 
CHANNEL_BIT(c)) != 0;
 
  160      mVisibleChannels.fetch_or(
CHANNEL_BIT(c), std::memory_order_relaxed); }
 
  162      mVisibleChannels.fetch_and(~
CHANNEL_BIT(c), std::memory_order_relaxed); }
 
  164      mVisibleChannels.fetch_xor(
CHANNEL_BIT(c), std::memory_order_relaxed); }
 
  168      auto visibleChannels = 0u;
 
  173      mVisibleChannels.store(visibleChannels, std::memory_order_relaxed);
 
  187      std::shared_ptr<ChannelInterval> DoGetChannel(
size_t iChannel) 
override;
 
  188      double Start() 
const override;
 
  189      double End() 
const override;
 
  190      size_t NChannels() 
const override;
 
  193      const std::shared_ptr<const NoteTrack> 
mpTrack;
 
  197   std::shared_ptr<WideChannelGroupInterval> 
DoGetInterval(
size_t iInterval)
 
  200   void DoSetVelocity(
float velocity);
 
  202   void AddToDuration( 
double delta );
 
  208   mutable std::unique_ptr<Alg_seq> 
mSeq;
 
  213   std::atomic<float> mVelocity{ 0.0f }; 
 
  217   double mOrigin{ 0.0 };
 
  230#define SonifyBeginSonification() 
  231#define SonifyEndSonification() 
  232#define SonifyBeginNoteBackground() 
  233#define SonifyEndNoteBackground() 
  234#define SonifyBeginNoteForeground() 
  235#define SonifyEndNoteForeground() 
  236#define SonifyBeginMeasures() 
  237#define SonifyEndMeasures() 
  238#define SonifyBeginSerialize() 
  239#define SonifyEndSerialize() 
  240#define SonifyBeginUnserialize() 
  241#define SonifyEndUnserialize() 
  242#define SonifyBeginAutoSave() 
  243#define SonifyEndAutoSave() 
  244#define SonifyBeginModifyState() 
  245#define SonifyEndModifyState() 
ClientData::Site< NoteTrack, NoteTrackAttachment, ClientData::DeepCopying > NoteTrackAttachments
NOTE_TRACK_API wxString GetMIDIDeviceInfo()
CRTP_BASE(NoteTrackAttachmentBase, struct, ClientData::Cloneable< NoteTrackAttachment, ClientData::UniquePtr >)
NOTE_TRACK_API StringSetting MIDIPlaybackDevice
ENUMERATE_TRACK_TYPE(NoteTrack)
NOTE_TRACK_API IntSetting MIDISynthLatency_ms
NOTE_TRACK_API StringSetting MIDIRecordingDevice
struct NOTE_TRACK_API NoteTrackAttachment
std::pair< double, double > QuantizedTimeAndBeat
Extends Track with notions of mute and solo setting.
std::function< void(double)> ProgressReporter
std::pair< std::string_view, XMLAttributeValueView > Attribute
std::vector< Attribute > AttributesList
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
void ShiftBy(double t)
Change start time by given duration.
virtual std::shared_ptr< Interval > DoGetInterval(size_t iInterval)=0
Retrieve an interval.
size_t NIntervals() const
Report the number of intervals.
Utility to register hooks into a host class that attach client data.
Specialization of Setting for int.
A Track that is used for Midi notes. (Somewhat old code).
std::unique_ptr< char[]> mSerializationBuffer
bool IsVisibleChan(int c) const
void MoveTo(double origin) override
Change start time to given time point.
void SetVisibleChannels(unsigned value)
float GetVelocity() const
std::unique_ptr< Alg_seq > mSeq
std::shared_ptr< NoteTrack > Holder
static EnumSetting< bool > AllegroStyleSetting
unsigned GetVisibleChannels() const
void ToggleVisibleChan(int c)
void SoloVisibleChan(int c)
void ClearVisibleChan(int c)
long mSerializationLength
NoteTrack(const NoteTrack &orig, ProtectedCreationArg &&)=delete
NoteTrack(const NoteTrack &orig)=delete
Copy construction hasn't been necessary yet.
void SetVisibleChan(int c)
This is defined just to enable dynamic_cast on it.
Specialization of Setting for strings.
Transforms one point in time to another point. For example, a time stretching effect might use one to...
Abstract base class for an object holding data associated with points on a time axis.
virtual Holder Clone(bool backup) const =0
virtual void Paste(double t, const Track &src)=0
Weak precondition allows overrides to replicate one channel into many.
virtual Holder PasteInto(AudacityProject &project, TrackList &list) const =0
virtual Holder Copy(double t0, double t1, bool forClipboard=true) const =0
Create new tracks and don't modify this track.
virtual const TypeInfo & GetTypeInfo() const =0
virtual void InsertSilence(double t, double len)=0
static const TypeInfo & ClassTypeInfo()
virtual void Clear(double t0, double t1)=0
std::shared_ptr< Track > Holder
virtual void WriteXML(XMLWriter &xmlFile) const =0
virtual void Silence(double t0, double t1, ProgressReporter reportProgress={})=0
virtual Holder Cut(double t0, double t1)=0
Create tracks and modify this track.
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Generates overrides of channel-related functions.
This class is an interface which should be implemented by classes which wish to be able to load and s...
virtual XMLTagHandler * HandleXMLChild(const std::string_view &tag)=0
virtual bool HandleXMLTag(const std::string_view &tag, const AttributesList &attrs)=0
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
@ DeepCopying
point to new sub-objects; these must define a Clone() member; won't compile for std::weak_ptr
std::string Serialize(const ProjectForm &form)
A convenient base class defining abstract virtual Clone() for a given kind of pointer.
const std::shared_ptr< const NoteTrack > mpTrack
virtual void WriteXML(XMLWriter &xmlFile) const
Default implementation does nothing.
virtual bool HandleAttribute(const Attribute &attribute)
Return whether the attribute was used; default returns false.
~NoteTrackAttachment() override
Empty argument passed to some public constructors.