Audacity 3.2.0
|
Persistent data for display of a note track. More...
#include <NoteTrackDisplayData.h>
Public Types | |
enum | { MinPitch = 0 , MaxPitch = 127 } |
Public Member Functions | |
~NoteTrackRange () override | |
std::unique_ptr< NoteTrackAttachment > | Clone () const override |
void | WriteXML (XMLWriter &xmlFile) const override |
Default implementation does nothing. More... | |
bool | HandleAttribute (const Attribute &attribute) override |
Return whether the attribute was used; default returns false. More... | |
int | GetBottomNote () const |
Gets the current bottom note (a pitch) More... | |
int | GetTopNote () const |
Gets the current top note (a pitch) More... | |
void | SetBottomNote (int note) |
Sets the bottom note (a pitch), making sure that it is never greater than the top note. More... | |
void | SetTopNote (int note) |
Sets the top note (a pitch), making sure that it is never less than the bottom note. More... | |
void | SetNoteRange (int note1, int note2) |
Sets the top and bottom note (both pitches) automatically, swapping them if needed. More... | |
void | ShiftNoteRange (int offset) |
Shifts all notes vertically by the given pitch. More... | |
void | ZoomAllNotes (Alg_seq *pSeq) |
Zooms so that all notes are visible. More... | |
void | ZoomMaxExtent () |
Zooms so that the entire track is visible. More... | |
Public Member Functions inherited from NoteTrackAttachment | |
~NoteTrackAttachment () override | |
virtual void | WriteXML (XMLWriter &xmlFile) const |
Default implementation does nothing. More... | |
virtual bool | HandleAttribute (const Attribute &attribute) |
Return whether the attribute was used; default returns false. More... | |
Static Public Member Functions | |
static NoteTrackRange & | Get (const NoteTrack &track) |
Allow mutative access to attached data of a const track. More... | |
Private Attributes | |
int | mBottomNote { MinPitch } |
int | mTopNote { MaxPitch } |
Persistent data for display of a note track.
Definition at line 22 of file NoteTrackDisplayData.h.
anonymous enum |
|
overridedefault |
|
override |
Definition at line 29 of file NoteTrackDisplayData.cpp.
|
static |
Allow mutative access to attached data of a const track.
Definition at line 20 of file NoteTrackDisplayData.cpp.
References key.
Referenced by NoteTrackVRulerControls::HandleWheelRotation(), anonymous_namespace{ImportMIDI.cpp}::ImportMIDI(), NoteTrackDisplayData::NoteTrackDisplayData(), NoteTrackMenuTable::OnChangeOctave(), NoteTrackVRulerMenuTable::OnZoom(), NoteTrackVZoomHandle::Release(), NoteTrackDisplayData::Zoom(), and NoteTrackDisplayData::ZoomTo().
|
inline |
|
inline |
|
overridevirtual |
Return whether the attribute was used; default returns false.
Reimplemented from NoteTrackAttachment.
Definition at line 40 of file NoteTrackDisplayData.cpp.
References SetBottomNote(), and SetTopNote().
void NoteTrackRange::SetBottomNote | ( | int | note | ) |
Sets the bottom note (a pitch), making sure that it is never greater than the top note.
Definition at line 56 of file NoteTrackDisplayData.cpp.
References mBottomNote, MinPitch, and mTopNote.
Referenced by HandleAttribute().
void NoteTrackRange::SetNoteRange | ( | int | note1, |
int | note2 | ||
) |
Sets the top and bottom note (both pitches) automatically, swapping them if needed.
Definition at line 78 of file NoteTrackDisplayData.cpp.
References MaxPitch, mBottomNote, MinPitch, mTopNote, and anonymous_namespace{NoteTrack.cpp}::swap().
Referenced by ZoomAllNotes(), and NoteTrackDisplayData::ZoomTo().
void NoteTrackRange::SetTopNote | ( | int | note | ) |
Sets the top note (a pitch), making sure that it is never less than the bottom note.
Definition at line 68 of file NoteTrackDisplayData.cpp.
References MaxPitch, mBottomNote, and mTopNote.
Referenced by HandleAttribute().
void NoteTrackRange::ShiftNoteRange | ( | int | offset | ) |
Shifts all notes vertically by the given pitch.
Definition at line 96 of file NoteTrackDisplayData.cpp.
References MaxPitch, mBottomNote, and mTopNote.
Referenced by NoteTrackVRulerControls::HandleWheelRotation(), and NoteTrackMenuTable::OnChangeOctave().
|
overridevirtual |
Default implementation does nothing.
Reimplemented from NoteTrackAttachment.
Definition at line 34 of file NoteTrackDisplayData.cpp.
References mBottomNote, mTopNote, XMLWriter::WriteAttr(), and wxT().
void NoteTrackRange::ZoomAllNotes | ( | Alg_seq * | pSeq | ) |
Zooms so that all notes are visible.
Definition at line 120 of file NoteTrackDisplayData.cpp.
References MaxPitch, MinPitch, and SetNoteRange().
Referenced by anonymous_namespace{ImportMIDI.cpp}::ImportMIDI().
|
inline |
|
private |
Definition at line 68 of file NoteTrackDisplayData.h.
Referenced by SetBottomNote(), SetNoteRange(), SetTopNote(), ShiftNoteRange(), and WriteXML().
|
private |
Definition at line 69 of file NoteTrackDisplayData.h.
Referenced by SetBottomNote(), SetNoteRange(), SetTopNote(), ShiftNoteRange(), and WriteXML().