From aaeb5216ad3f951be89aa2dcad437f0320a4597d Mon Sep 17 00:00:00 2001 From: Lukas W Date: Wed, 26 Nov 2014 01:14:52 +0100 Subject: [PATCH] Rename note to Note --- include/InstrumentTrack.h | 4 +- include/Mixer.h | 2 +- include/{note.h => Note.h} | 14 +++--- include/NotePlayHandle.h | 8 ++-- include/Pattern.h | 10 ++-- include/Piano.h | 2 +- include/PianoRoll.h | 18 +++---- plugins/HydrogenImport/HydrogenImport.cpp | 4 +- plugins/MidiImport/MidiImport.cpp | 4 +- plugins/flp_import/FlpImport.cpp | 4 +- plugins/flp_import/FlpImport.h | 2 +- plugins/lb302/lb302.h | 2 +- plugins/vestige/vestige.h | 2 +- plugins/zynaddsubfx/LocalZynAddSubFx.h | 2 +- plugins/zynaddsubfx/RemoteZynAddSubFx.cpp | 2 +- src/core/AutomationPattern.cpp | 6 +-- src/core/InstrumentFunctions.cpp | 4 +- src/core/{note.cpp => Note.cpp} | 34 ++++++------- src/core/NotePlayHandle.cpp | 10 ++-- src/core/PresetPreviewPlayHandle.cpp | 2 +- src/core/Song.cpp | 2 +- src/core/midi/MidiAlsaSeq.cpp | 2 +- src/core/midi/MidiClient.cpp | 2 +- src/core/midi/MidiWinMM.cpp | 2 +- src/gui/PianoRoll.cpp | 58 +++++++++++------------ src/tracks/InstrumentTrack.cpp | 4 +- src/tracks/Pattern.cpp | 26 +++++----- 27 files changed, 116 insertions(+), 116 deletions(-) rename include/{note.h => Note.h} (93%) rename src/core/{note.cpp => Note.cpp} (84%) diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index af20c5fb2..1a64825a0 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -206,8 +206,8 @@ public: signals: void instrumentChanged(); void newNote(); - void midiNoteOn( const note& ); - void midiNoteOff( const note& ); + void midiNoteOn( const Note& ); + void midiNoteOff( const Note& ); void nameChanged(); diff --git a/include/Mixer.h b/include/Mixer.h index a3e5c8463..f8f9cf313 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -53,7 +53,7 @@ #include "lmms_basics.h" -#include "note.h" +#include "Note.h" #include "fifo_buffer.h" #include "MixerProfiler.h" diff --git a/include/note.h b/include/Note.h similarity index 93% rename from include/note.h rename to include/Note.h index 6cf9538b5..eb36462a6 100644 --- a/include/note.h +++ b/include/Note.h @@ -1,5 +1,5 @@ /* - * note.h - declaration of class note which contains all informations about a + * Note.h - declaration of class note which contains all informations about a * note + definitions of several constants and enums * * Copyright (c) 2004-2014 Tobias Doerffel @@ -78,17 +78,17 @@ const float MaxDetuning = 4 * 12.0f; -class EXPORT note : public SerializingObject +class EXPORT Note : public SerializingObject { public: - note( const MidiTime & _length = MidiTime( 0 ), + Note( const MidiTime & _length = MidiTime( 0 ), const MidiTime & _pos = MidiTime( 0 ), int key = DefaultKey, volume_t _volume = DefaultVolume, panning_t _panning = DefaultPanning, DetuningHelper * _detuning = NULL ); - note( const note & _note ); - virtual ~note(); + Note( const Note & _note ); + virtual ~Note(); // used by GUI inline void setSelected( const bool _selected ){ m_selected = _selected; } @@ -112,7 +112,7 @@ public: void quantizeLength( const int _q_grid ); void quantizePos( const int _q_grid ); - static inline bool lessThan( note * &lhs, note * &rhs ) + static inline bool lessThan( Note * &lhs, Note * &rhs ) { // function to compare two notes - must be called explictly when // using qSort @@ -234,7 +234,7 @@ private: } ; -typedef QVector NoteVector; +typedef QVector NoteVector; #endif diff --git a/include/NotePlayHandle.h b/include/NotePlayHandle.h index 03b3fddd7..e0f0bcdaf 100644 --- a/include/NotePlayHandle.h +++ b/include/NotePlayHandle.h @@ -27,7 +27,7 @@ #define NOTE_PLAY_HANDLE_H #include "lmmsconfig.h" -#include "note.h" +#include "Note.h" #include "PlayHandle.h" #include "Track.h" #include "MemoryManager.h" @@ -42,7 +42,7 @@ typedef QList NotePlayHandleList; typedef QList ConstNotePlayHandleList; -class EXPORT NotePlayHandle : public PlayHandle, public note +class EXPORT NotePlayHandle : public PlayHandle, public Note { MM_OPERATORS public: @@ -63,7 +63,7 @@ public: NotePlayHandle( InstrumentTrack* instrumentTrack, const f_cnt_t offset, const f_cnt_t frames, - const note& noteToPlay, + const Note& noteToPlay, NotePlayHandle* parent = NULL, int midiEventChannel = -1, Origin origin = OriginPattern ); @@ -326,7 +326,7 @@ public: static NotePlayHandle * acquire( InstrumentTrack* instrumentTrack, const f_cnt_t offset, const f_cnt_t frames, - const note& noteToPlay, + const Note& noteToPlay, NotePlayHandle* parent = NULL, int midiEventChannel = -1, NotePlayHandle::Origin origin = NotePlayHandle::OriginPattern ); diff --git a/include/Pattern.h b/include/Pattern.h index fdfd9ab57..5deb67c45 100644 --- a/include/Pattern.h +++ b/include/Pattern.h @@ -33,7 +33,7 @@ #include -#include "note.h" +#include "Note.h" #include "Track.h" @@ -67,13 +67,13 @@ public: MidiTime beatPatternLength() const; // note management - note * addNote( const note & _new_note, const bool _quant_pos = true ); + Note * addNote( const Note & _new_note, const bool _quant_pos = true ); - void removeNote( const note * _note_to_del ); + void removeNote( const Note * _note_to_del ); - note * noteAtStep( int _step ); + Note * noteAtStep( int _step ); - note * rearrangeNote( const note * _note_to_proc, + Note * rearrangeNote( const Note * _note_to_proc, const bool _quant_pos = true ); void rearrangeAllNotes(); void clearNotes(); diff --git a/include/Piano.h b/include/Piano.h index ff2e185e1..48dd7f137 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -25,7 +25,7 @@ #ifndef PIANO_H #define PIANO_H -#include "note.h" +#include "Note.h" #include "Model.h" class InstrumentTrack; diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 7bf5edce9..817ebde33 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -32,7 +32,7 @@ #include "ComboBoxModel.h" #include "SerializingObject.h" -#include "note.h" +#include "Note.h" #include "lmms_basics.h" #include "Song.h" #include "tooltip.h" @@ -123,7 +123,7 @@ protected: int getKey( int _y ) const; static inline void drawNoteRect( QPainter & _p, int _x, int _y, - int _width, note * _n, const QColor & noteCol ); + int _width, Note * _n, const QColor & noteCol ); void removeSelection(); void selectAll(); void getSelectedNotes( NoteVector & _selected_notes ); @@ -137,8 +137,8 @@ protected slots: void recordAccompany(); void stop(); - void startRecordNote( const note & _n ); - void finishRecordNote( const note & _n ); + void startRecordNote( const Note & _n ); + void finishRecordNote( const Note & _n ); void horScrolled( int _new_pos ); void verScrolled( int _new_pos ); @@ -232,7 +232,7 @@ private: void shiftSemiTone(int amount); bool isSelection() const; int selectionCount() const; - void testPlayNote( note * n ); + void testPlayNote( Note * n ); void testPlayKey( int _key, int _vol, int _pan ); void pauseTestNotes( bool _pause = true ); @@ -300,9 +300,9 @@ private: MidiTime m_currentPosition; bool m_recording; - QList m_recordingNotes; + QList m_recordingNotes; - note * m_currentNote; + Note * m_currentNote; actions m_action; noteEditMode m_noteEditMode; @@ -355,9 +355,9 @@ private: void copy_to_clipboard( const NoteVector & _notes ) const; - void drawDetuningInfo( QPainter & _p, note * _n, int _x, int _y ); + void drawDetuningInfo( QPainter & _p, Note * _n, int _x, int _y ); bool mouseOverNote(); - note * noteUnderMouse(); + Note * noteUnderMouse(); // turn a selection rectangle into selected notes void computeSelectedNotes( bool shift ); diff --git a/plugins/HydrogenImport/HydrogenImport.cpp b/plugins/HydrogenImport/HydrogenImport.cpp index 6be40e091..6cfe648d8 100644 --- a/plugins/HydrogenImport/HydrogenImport.cpp +++ b/plugins/HydrogenImport/HydrogenImport.cpp @@ -12,7 +12,7 @@ #include "Engine.h" #include "Instrument.h" #include "InstrumentTrack.h" -#include "note.h" +#include "Note.h" #include "Pattern.h" #include "Track.h" #include "bb_track.h" @@ -271,7 +271,7 @@ bool HydrogenImport::readSong() int i = pattern_count - 1 + nbb; pattern_id[sName] = pattern_count - 1; Pattern*p = dynamic_cast( drum_track[instrId]->getTCO( i ) ); - note n; + Note n; n.setPos( nPosition ); if ( (nPosition + 48) <= nSize ) { diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index 7250a126f..215e79523 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -244,7 +244,7 @@ public: } - void addNote( note & n ) + void addNote( Note & n ) { if( !p || n.pos() > lastEnd + DefaultTicksPerTact ) { @@ -378,7 +378,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) smfMidiChannel * ch = chs[evt->chan].create( tc ); Alg_note_ptr noteEvt = dynamic_cast( evt ); - note n( noteEvt->get_duration() * ticksPerBeat, + Note n( noteEvt->get_duration() * ticksPerBeat, noteEvt->get_start_time() * ticksPerBeat, noteEvt->get_identifier() - 12, noteEvt->get_loud()); diff --git a/plugins/flp_import/FlpImport.cpp b/plugins/flp_import/FlpImport.cpp index 64e6b38e9..183772625 100644 --- a/plugins/flp_import/FlpImport.cpp +++ b/plugins/flp_import/FlpImport.cpp @@ -414,7 +414,7 @@ struct FL_Channel : public FL_Plugin int fxChannel; int layerParent; - typedef QList > noteVector; + typedef QList > noteVector; noteVector notes; QList dots; @@ -1313,7 +1313,7 @@ if( p.currentEffectChannel <= NumFLFxChannels ) 8 ) ); pos /= (4*ppq) / DefaultTicksPerTact; len /= (4*ppq) / DefaultTicksPerTact; - note n( len, pos, key, vol * 100 / 128, + Note n( len, pos, key, vol * 100 / 128, pan*200 / 128 - 100 ); if( ch < p.numChannels ) { diff --git a/plugins/flp_import/FlpImport.h b/plugins/flp_import/FlpImport.h index 8470ce3f6..18ba3e251 100644 --- a/plugins/flp_import/FlpImport.h +++ b/plugins/flp_import/FlpImport.h @@ -30,7 +30,7 @@ #include #include "ImportFilter.h" -#include "note.h" +#include "Note.h" diff --git a/plugins/lb302/lb302.h b/plugins/lb302/lb302.h index dbef4e190..71e4d6dc3 100644 --- a/plugins/lb302/lb302.h +++ b/plugins/lb302/lb302.h @@ -168,7 +168,7 @@ public: private: void processNote( NotePlayHandle * n ); - void initNote(lb302Note *note); + void initNote(lb302Note *Note); void initSlide(); private: diff --git a/plugins/vestige/vestige.h b/plugins/vestige/vestige.h index 24184704f..51265aaaf 100644 --- a/plugins/vestige/vestige.h +++ b/plugins/vestige/vestige.h @@ -34,7 +34,7 @@ #include "Instrument.h" #include "InstrumentView.h" -#include "note.h" +#include "Note.h" #include "knob.h" #include "AutomatableModel.h" diff --git a/plugins/zynaddsubfx/LocalZynAddSubFx.h b/plugins/zynaddsubfx/LocalZynAddSubFx.h index b9077345f..f4e3b8ff3 100644 --- a/plugins/zynaddsubfx/LocalZynAddSubFx.h +++ b/plugins/zynaddsubfx/LocalZynAddSubFx.h @@ -26,7 +26,7 @@ #define LOCAL_ZYNADDSUBFX_H #include "MidiEvent.h" -#include "note.h" +#include "Note.h" class Master; class NulEngine; diff --git a/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp b/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp index 813ac516d..54da176ea 100644 --- a/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp @@ -30,7 +30,7 @@ #include #define BUILD_REMOTE_PLUGIN_CLIENT -#include "note.h" +#include "Note.h" #include "RemotePlugin.h" #include "RemoteZynAddSubFx.h" #include "LocalZynAddSubFx.h" diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index c5aa7a02b..68ca7882b 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -187,7 +187,7 @@ MidiTime AutomationPattern::putValue( const MidiTime & _time, cleanObjects(); MidiTime newTime = _quant_pos && Engine::automationEditor() ? - note::quantized( _time, + Note::quantized( _time, Engine::automationEditor()->quantization() ) : _time; @@ -220,7 +220,7 @@ void AutomationPattern::removeValue( const MidiTime & _time, cleanObjects(); MidiTime newTime = _quant_pos && Engine::automationEditor() ? - note::quantized( _time, + Note::quantized( _time, Engine::automationEditor()->quantization() ) : _time; @@ -260,7 +260,7 @@ MidiTime AutomationPattern::setDragValue( const MidiTime & _time, const float _v if( m_dragging == false ) { MidiTime newTime = _quant_pos && Engine::automationEditor() ? - note::quantized( _time, + Note::quantized( _time, Engine::automationEditor()->quantization() ) : _time; this->removeValue( newTime ); diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 050d19d80..1083a3052 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -256,7 +256,7 @@ void InstrumentFunctionNoteStacking::processNote( NotePlayHandle * _n ) break; } // create copy of base-note - note note_copy( _n->length(), 0, sub_note_key, _n->getVolume(), _n->getPanning(), _n->detuning() ); + Note note_copy( _n->length(), 0, sub_note_key, _n->getVolume(), _n->getPanning(), _n->detuning() ); // create sub-note-play-handle, only note is // different @@ -477,7 +477,7 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) NotePlayHandleManager::acquire( _n->instrumentTrack(), frames_processed, gated_frames, - note( MidiTime( 0 ), MidiTime( 0 ), sub_note_key, (volume_t) qRound( _n->getVolume() * vol_level ), + Note( MidiTime( 0 ), MidiTime( 0 ), sub_note_key, (volume_t) qRound( _n->getVolume() * vol_level ), _n->getPanning(), _n->detuning() ), _n, -1, NotePlayHandle::OriginArpeggio ) ); diff --git a/src/core/note.cpp b/src/core/Note.cpp similarity index 84% rename from src/core/note.cpp rename to src/core/Note.cpp index f2bc1f337..fca078587 100644 --- a/src/core/note.cpp +++ b/src/core/Note.cpp @@ -27,7 +27,7 @@ #include -#include "note.h" +#include "Note.h" #include "DetuningHelper.h" #include "templates.h" @@ -35,7 +35,7 @@ -note::note( const MidiTime & _length, const MidiTime & _pos, +Note::Note( const MidiTime & _length, const MidiTime & _pos, int _key, volume_t _volume, panning_t _panning, DetuningHelper * _detuning ) : m_selected( false ), @@ -63,7 +63,7 @@ note::note( const MidiTime & _length, const MidiTime & _pos, -note::note( const note & _note ) : +Note::Note( const Note & _note ) : SerializingObject( _note ), m_selected( _note.m_selected ), m_oldKey( _note.m_oldKey ), @@ -86,7 +86,7 @@ note::note( const note & _note ) : -note::~note() +Note::~Note() { if( m_detuning ) { @@ -97,7 +97,7 @@ note::~note() -void note::setLength( const MidiTime & _length ) +void Note::setLength( const MidiTime & _length ) { m_length = _length; } @@ -105,7 +105,7 @@ void note::setLength( const MidiTime & _length ) -void note::setPos( const MidiTime & _pos ) +void Note::setPos( const MidiTime & _pos ) { m_pos = _pos; } @@ -113,7 +113,7 @@ void note::setPos( const MidiTime & _pos ) -void note::setKey( const int _key ) +void Note::setKey( const int _key ) { const int k = qBound( 0, _key, NumKeys ); m_key = k; @@ -122,7 +122,7 @@ void note::setKey( const int _key ) -void note::setVolume( volume_t _volume ) +void Note::setVolume( volume_t _volume ) { const volume_t v = qBound( MinVolume, _volume, MaxVolume ); m_volume = v; @@ -131,7 +131,7 @@ void note::setVolume( volume_t _volume ) -void note::setPanning( panning_t _panning ) +void Note::setPanning( panning_t _panning ) { const panning_t p = qBound( PanningLeft, _panning, PanningRight ); m_panning = p; @@ -140,7 +140,7 @@ void note::setPanning( panning_t _panning ) -MidiTime note::quantized( const MidiTime & _m, const int _q_grid ) +MidiTime Note::quantized( const MidiTime & _m, const int _q_grid ) { float p = ( (float) _m / _q_grid ); if( p - floorf( p ) < 0.5f ) @@ -153,7 +153,7 @@ MidiTime note::quantized( const MidiTime & _m, const int _q_grid ) -void note::quantizeLength( const int _q_grid ) +void Note::quantizeLength( const int _q_grid ) { setLength( quantized( length(), _q_grid ) ); if( length() == 0 ) @@ -165,7 +165,7 @@ void note::quantizeLength( const int _q_grid ) -void note::quantizePos( const int _q_grid ) +void Note::quantizePos( const int _q_grid ) { setPos( quantized( pos(), _q_grid ) ); } @@ -173,7 +173,7 @@ void note::quantizePos( const int _q_grid ) -void note::saveSettings( QDomDocument & _doc, QDomElement & _this ) +void Note::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setAttribute( "key", m_key ); _this.setAttribute( "vol", m_volume ); @@ -190,7 +190,7 @@ void note::saveSettings( QDomDocument & _doc, QDomElement & _this ) -void note::loadSettings( const QDomElement & _this ) +void Note::loadSettings( const QDomElement & _this ) { const int oldKey = _this.attribute( "tone" ).toInt() + _this.attribute( "oct" ).toInt() * KeysPerOctave; m_key = qMax( oldKey, _this.attribute( "key" ).toInt() ); @@ -209,7 +209,7 @@ void note::loadSettings( const QDomElement & _this ) -void note::editDetuningPattern() +void Note::editDetuningPattern() { createDetuning(); m_detuning->automationPattern()->openInAutomationEditor(); @@ -218,7 +218,7 @@ void note::editDetuningPattern() -void note::createDetuning() +void Note::createDetuning() { if( m_detuning == NULL ) { @@ -232,7 +232,7 @@ void note::createDetuning() -bool note::hasDetuningInfo() const +bool Note::hasDetuningInfo() const { return m_detuning && m_detuning->hasAutomation(); } diff --git a/src/core/NotePlayHandle.cpp b/src/core/NotePlayHandle.cpp index f8b1321e5..4e3f798fc 100644 --- a/src/core/NotePlayHandle.cpp +++ b/src/core/NotePlayHandle.cpp @@ -48,12 +48,12 @@ NotePlayHandle::BaseDetuning::BaseDetuning( DetuningHelper *detuning ) : NotePlayHandle::NotePlayHandle( InstrumentTrack* instrumentTrack, const f_cnt_t _offset, const f_cnt_t _frames, - const note& n, + const Note& n, NotePlayHandle *parent, int midiEventChannel, Origin origin ) : PlayHandle( TypeNotePlayHandle, _offset ), - note( n.length(), n.pos(), n.key(), n.getVolume(), n.getPanning(), n.detuning() ), + Note( n.length(), n.pos(), n.key(), n.getVolume(), n.getPanning(), n.detuning() ), m_pluginData( NULL ), m_filter( NULL ), m_instrumentTrack( instrumentTrack ), @@ -168,7 +168,7 @@ void NotePlayHandle::done() void NotePlayHandle::setVolume( volume_t _volume ) { - note::setVolume( _volume ); + Note::setVolume( _volume ); const int baseVelocity = m_instrumentTrack->midiPort()->baseVelocity(); @@ -180,7 +180,7 @@ void NotePlayHandle::setVolume( volume_t _volume ) void NotePlayHandle::setPanning( panning_t panning ) { - note::setPanning( panning ); + Note::setPanning( panning ); MidiEvent event( MidiMetaEvent, midiChannel(), midiKey(), panningToMidi( panning ) ); event.setMetaEvent( MidiNotePanning ); @@ -582,7 +582,7 @@ void NotePlayHandleManager::init() NotePlayHandle * NotePlayHandleManager::acquire( InstrumentTrack* instrumentTrack, const f_cnt_t offset, const f_cnt_t frames, - const note& noteToPlay, + const Note& noteToPlay, NotePlayHandle* parent, int midiEventChannel, NotePlayHandle::Origin origin ) diff --git a/src/core/PresetPreviewPlayHandle.cpp b/src/core/PresetPreviewPlayHandle.cpp index e4c95eb62..dceb5b0d2 100644 --- a/src/core/PresetPreviewPlayHandle.cpp +++ b/src/core/PresetPreviewPlayHandle.cpp @@ -163,7 +163,7 @@ PresetPreviewPlayHandle::PresetPreviewPlayHandle( const QString & _preset_file, m_previewNote = NotePlayHandleManager::acquire( s_previewTC->previewInstrumentTrack(), 0, typeInfo::max() / 2, - note( 0, 0, DefaultKey, 100 ) ); + Note( 0, 0, DefaultKey, 100 ) ); setAudioPort( s_previewTC->previewInstrumentTrack()->audioPort() ); diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 2969c2ebe..930259c88 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -112,7 +112,7 @@ Song::Song() : /* connect( &m_masterPitchModel, SIGNAL( dataChanged() ), this, SLOT( masterPitchChanged() ) );*/ - qRegisterMetaType( "note" ); + qRegisterMetaType( "note" ); } diff --git a/src/core/midi/MidiAlsaSeq.cpp b/src/core/midi/MidiAlsaSeq.cpp index 7923fc659..33740bafd 100644 --- a/src/core/midi/MidiAlsaSeq.cpp +++ b/src/core/midi/MidiAlsaSeq.cpp @@ -32,7 +32,7 @@ #include "Song.h" #include "MidiPort.h" #include "MidiTime.h" -#include "note.h" +#include "Note.h" #ifdef LMMS_HAVE_ALSA diff --git a/src/core/midi/MidiClient.cpp b/src/core/midi/MidiClient.cpp index 494641aaa..b4e9e250a 100644 --- a/src/core/midi/MidiClient.cpp +++ b/src/core/midi/MidiClient.cpp @@ -25,7 +25,7 @@ #include "MidiClient.h" #include "MidiPort.h" -#include "note.h" +#include "Note.h" MidiClient::MidiClient() diff --git a/src/core/midi/MidiWinMM.cpp b/src/core/midi/MidiWinMM.cpp index 67c1319bc..01badfd5d 100644 --- a/src/core/midi/MidiWinMM.cpp +++ b/src/core/midi/MidiWinMM.cpp @@ -30,7 +30,7 @@ #include "Engine.h" #include "gui_templates.h" #include "MidiPort.h" -#include "note.h" +#include "Note.h" #ifdef LMMS_BUILD_WIN32 diff --git a/src/gui/PianoRoll.cpp b/src/gui/PianoRoll.cpp index 020fd3951..3e806c25b 100644 --- a/src/gui/PianoRoll.cpp +++ b/src/gui/PianoRoll.cpp @@ -851,8 +851,8 @@ void PianoRoll::setCurrentPattern( Pattern* newPattern ) // make sure to always get informed about the pattern being destroyed connect( m_pattern, SIGNAL( destroyedPattern( Pattern* ) ), this, SLOT( hidePattern( Pattern* ) ) ); - connect( m_pattern->instrumentTrack(), SIGNAL( midiNoteOn( const note& ) ), this, SLOT( startRecordNote( const note& ) ) ); - connect( m_pattern->instrumentTrack(), SIGNAL( midiNoteOff( const note& ) ), this, SLOT( finishRecordNote( const note& ) ) ); + connect( m_pattern->instrumentTrack(), SIGNAL( midiNoteOn( const Note& ) ), this, SLOT( startRecordNote( const Note& ) ) ); + connect( m_pattern->instrumentTrack(), SIGNAL( midiNoteOff( const Note& ) ), this, SLOT( finishRecordNote( const Note& ) ) ); connect( m_pattern->instrumentTrack()->pianoModel(), SIGNAL( dataChanged() ), this, SLOT( update() ) ); setWindowTitle( tr( "Piano-Roll - %1" ).arg( m_pattern->name() ) ); @@ -931,7 +931,7 @@ void PianoRoll::setBarColor( const QColor & c ) inline void PianoRoll::drawNoteRect( QPainter & _p, int _x, int _y, - int _width, note * _n, const QColor & noteCol ) + int _width, Note * _n, const QColor & noteCol ) { ++_x; ++_y; @@ -1017,7 +1017,7 @@ inline void PianoRoll::drawNoteRect( QPainter & _p, int _x, int _y, -inline void PianoRoll::drawDetuningInfo( QPainter & _p, note * _n, int _x, +inline void PianoRoll::drawDetuningInfo( QPainter & _p, Note * _n, int _x, int _y ) { int middle_y = _y + KEY_LINE_HEIGHT / 2; @@ -1701,7 +1701,7 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me ) // whether this action creates new note(s) or not bool is_new_note = false; - note * created_new_note = NULL; + Note * created_new_note = NULL; // did it reach end of vector because // there's no note?? if( it == notes.begin()-1 ) @@ -1721,7 +1721,7 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me ) MidiTime note_pos( pos_ticks - ( quantization() / 2 ) ); MidiTime note_len( newNoteLen() ); - note new_note( note_len, note_pos, key_num ); + Note new_note( note_len, note_pos, key_num ); new_note.setSelected( true ); new_note.setPanning( m_lastNotePanning ); new_note.setVolume( m_lastNoteVolume ); @@ -1741,7 +1741,7 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me ) { note_pos += note_len; } - note new_note( note_len, note_pos, key_num + chord[i] ); + Note new_note( note_len, note_pos, key_num + chord[i] ); new_note.setSelected( true ); new_note.setPanning( m_lastNotePanning ); new_note.setVolume( m_lastNoteVolume ); @@ -1856,14 +1856,14 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me ) ! is_new_note && _me->modifiers() & Qt::ShiftModifier ) { // vector to hold new notes until we're through the loop - QVector newNotes; + QVector newNotes; it = notes.begin(); while( it != notes.end() ) { if( ( *it )->selected() ) { // copy this note - note noteCopy( (note) **it ); + Note noteCopy( (Note) **it ); newNotes.push_back( noteCopy ); } ++it; @@ -1874,7 +1874,7 @@ void PianoRoll::mousePressEvent( QMouseEvent * _me ) //put notes from vector into piano roll for( int i=0; iaddNote( newNotes[i] ); + Note * newNote = m_pattern->addNote( newNotes[i] ); newNote->setSelected( false ); } @@ -2000,7 +2000,7 @@ void PianoRoll::mouseDoubleClickEvent( QMouseEvent * _me ) // go through notes to figure out which one we want to change NoteVector nv; - foreach( note * i, notes ) + foreach( Note * i, notes ) { if( i->pos().getTicks() >= ticks_start && i->pos().getTicks() <= ticks_end @@ -2013,12 +2013,12 @@ void PianoRoll::mouseDoubleClickEvent( QMouseEvent * _me ) // make sure we're on a note if( nv.size() > 0 ) { - note * closest = NULL; + Note * closest = NULL; int closest_dist = 9999999; // if we caught multiple notes, find the closest... if( nv.size() > 1 ) { - foreach( note * i, nv ) + foreach( Note * i, nv ) { const int dist = qAbs( i->pos().getTicks() - ticks_middle ); if( dist < closest_dist ) { closest = i; closest_dist = dist; } @@ -2045,7 +2045,7 @@ void PianoRoll::mouseDoubleClickEvent( QMouseEvent * _me ) -void PianoRoll::testPlayNote( note * n ) +void PianoRoll::testPlayNote( Note * n ) { m_lastKey = n->key(); @@ -2431,7 +2431,7 @@ void PianoRoll::mouseMoveEvent( QMouseEvent * _me ) NoteVector::ConstIterator it = notes.begin()+notes.size()-1; for( int i = 0; i < notes.size(); ++i ) { - note * n = *it; + Note * n = *it; if( n->pos().getTicks() >= ticks_start && n->pos().getTicks() <= ticks_end && n->length().getTicks() != 0 @@ -3512,7 +3512,7 @@ void PianoRoll::wheelEvent( QWheelEvent * _we ) // go through notes to figure out which one we want to change NoteVector nv; - foreach( note * i, notes ) + foreach( Note * i, notes ) { if( i->pos().getTicks() >= ticks_start && i->pos().getTicks() <= ticks_end @@ -3527,7 +3527,7 @@ void PianoRoll::wheelEvent( QWheelEvent * _we ) const int step = _we->delta() > 0 ? 1.0 : -1.0; if( m_noteEditMode == NoteEditVolume ) { - foreach( note * n, nv ) + foreach( Note * n, nv ) { volume_t vol = tLimit( n->getVolume() + step, MinVolume, MaxVolume ); n->setVolume( vol ); @@ -3536,7 +3536,7 @@ void PianoRoll::wheelEvent( QWheelEvent * _we ) } else if( m_noteEditMode == NoteEditPanning ) { - foreach( note * n, nv ) + foreach( Note * n, nv ) { panning_t pan = tLimit( n->getPanning() + step, PanningLeft, PanningRight ); n->setPanning( pan ); @@ -3738,7 +3738,7 @@ void PianoRoll::stop() -void PianoRoll::startRecordNote( const note & _n ) +void PianoRoll::startRecordNote( const Note & _n ) { if( m_recording == true && hasValidPattern() == true && Engine::getSong()->isPlaying() && @@ -3752,7 +3752,7 @@ void PianoRoll::startRecordNote( const note & _n ) { sub = m_pattern->startPosition(); } - note n( 1, Engine::getSong()->getPlayPos( + Note n( 1, Engine::getSong()->getPlayPos( Engine::getSong()->playMode() ) - sub, _n.key(), _n.getVolume(), _n.getPanning() ); if( n.pos() >= 0 ) @@ -3765,7 +3765,7 @@ void PianoRoll::startRecordNote( const note & _n ) -void PianoRoll::finishRecordNote( const note & _n ) +void PianoRoll::finishRecordNote( const Note & _n ) { if( m_recording == true && hasValidPattern() == true && Engine::getSong()->isPlaying() && @@ -3774,12 +3774,12 @@ void PianoRoll::finishRecordNote( const note & _n ) Engine::getSong()->playMode() == Song::Mode_PlayPattern ) ) { - for( QList::Iterator it = m_recordingNotes.begin(); + for( QList::Iterator it = m_recordingNotes.begin(); it != m_recordingNotes.end(); ++it ) { if( it->key() == _n.key() ) { - note n( _n.length(), it->pos(), + Note n( _n.length(), it->pos(), it->key(), it->getVolume(), it->getPanning() ); n.quantizeLength( quantization() ); @@ -3943,7 +3943,7 @@ void PianoRoll::enterValue( NoteVector* nv ) if( ok ) { - foreach( note * n, *nv ) + foreach( Note * n, *nv ) { n->setVolume( new_val ); } @@ -3962,7 +3962,7 @@ void PianoRoll::enterValue( NoteVector* nv ) if( ok ) { - foreach( note * n, *nv ) + foreach( Note * n, *nv ) { n->setPanning( new_val ); } @@ -3983,7 +3983,7 @@ void PianoRoll::copy_to_clipboard( const NoteVector & _notes ) const for( NoteVector::ConstIterator it = _notes.begin(); it != _notes.end(); ++it ) { - note clip_note( **it ); + Note clip_note( **it ); clip_note.setPos( clip_note.pos( start_pos ) ); clip_note.saveState( dataFile, note_list ); } @@ -4058,7 +4058,7 @@ void PianoRoll::pasteNotes() { DataFile dataFile( value.toUtf8() ); - QDomNodeList list = dataFile.elementsByTagName( note::classNodeName() ); + QDomNodeList list = dataFile.elementsByTagName( Note::classNodeName() ); // remove selection and select the newly pasted notes clearSelectedNotes(); @@ -4071,7 +4071,7 @@ void PianoRoll::pasteNotes() for( int i = 0; !list.item( i ).isNull(); ++i ) { // create the note - note cur_note; + Note cur_note; cur_note.restoreState( list.item( i ).toElement() ); cur_note.setPos( cur_note.pos() + m_timeLine->pos() ); @@ -4278,7 +4278,7 @@ bool PianoRoll::mouseOverNote() -note * PianoRoll::noteUnderMouse() +Note * PianoRoll::noteUnderMouse() { QPoint pos = mapFromGlobal( QCursor::pos() ); diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 1fee7d06b..01d6a8b9e 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -256,7 +256,7 @@ void InstrumentTrack::processInEvent( const MidiEvent& event, const MidiTime& ti { nph = NotePlayHandleManager::acquire( this, offset, typeInfo::max() / 2, - note( MidiTime(), MidiTime(), event.key(), event.volume( midiPort()->baseVelocity() ) ), + Note( MidiTime(), MidiTime(), event.key(), event.volume( midiPort()->baseVelocity() ) ), NULL, event.channel(), NotePlayHandle::OriginMidiInput ); m_notes[event.key()] = nph; @@ -634,7 +634,7 @@ bool InstrumentTrack::play( const MidiTime & _start, const fpp_t _frames, } } - note * cur_note; + Note * cur_note; while( nit != notes.end() && ( cur_note = *nit )->pos() == cur_start ) { diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index e43b1d1ec..da8060313 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -79,7 +79,7 @@ Pattern::Pattern( const Pattern& other ) : { for( NoteVector::ConstIterator it = other.m_notes.begin(); it != other.m_notes.end(); ++it ) { - m_notes.push_back( new note( **it ) ); + m_notes.push_back( new Note( **it ) ); } init(); @@ -167,9 +167,9 @@ MidiTime Pattern::beatPatternLength() const return MidiTime( max_length ).nextFullTact() * MidiTime::ticksPerTact(); } -note * Pattern::addNote( const note & _new_note, const bool _quant_pos ) +Note * Pattern::addNote( const Note & _new_note, const bool _quant_pos ) { - note * new_note = new note( _new_note ); + Note * new_note = new Note( _new_note ); if( _quant_pos && Engine::pianoRoll() ) { new_note->quantizePos( Engine::pianoRoll()->quantization() ); @@ -213,7 +213,7 @@ note * Pattern::addNote( const note & _new_note, const bool _quant_pos ) -void Pattern::removeNote( const note * _note_to_del ) +void Pattern::removeNote( const Note * _note_to_del ) { instrumentTrack()->lock(); NoteVector::Iterator it = m_notes.begin(); @@ -240,7 +240,7 @@ void Pattern::removeNote( const note * _note_to_del ) // returns a pointer to the note at specified step, or NULL if note doesn't exist -note * Pattern::noteAtStep( int _step ) +Note * Pattern::noteAtStep( int _step ) { for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end(); ++it ) @@ -254,12 +254,12 @@ note * Pattern::noteAtStep( int _step ) } -note * Pattern::rearrangeNote( const note * _note_to_proc, +Note * Pattern::rearrangeNote( const Note * _note_to_proc, const bool _quant_pos ) { // just rearrange the position of the note by removing it and adding // a copy of it -> addNote inserts it at the correct position - note copy_of_note( *_note_to_proc ); + Note copy_of_note( *_note_to_proc ); removeNote( _note_to_proc ); return addNote( copy_of_note, _quant_pos ); @@ -270,7 +270,7 @@ note * Pattern::rearrangeNote( const note * _note_to_proc, void Pattern::rearrangeAllNotes() { // sort notes by start time - qSort(m_notes.begin(), m_notes.end(), note::lessThan ); + qSort(m_notes.begin(), m_notes.end(), Note::lessThan ); } @@ -397,7 +397,7 @@ void Pattern::loadSettings( const QDomElement & _this ) if( node.isElement() && !node.toElement().attribute( "metadata" ).toInt() ) { - note * n = new note; + Note * n = new Note; n->restoreState( node.toElement() ); m_notes.push_back( n ); } @@ -499,7 +499,7 @@ void Pattern::ensureBeatNotes() } if( found == false ) { - addNote( note( MidiTime( 0 ), MidiTime( ( i * + addNote( Note( MidiTime( 0 ), MidiTime( ( i * MidiTime::ticksPerTact() ) / MidiTime::stepsPerTact() ) ), false ); } @@ -773,7 +773,7 @@ void PatternView::mousePressEvent( QMouseEvent * _me ) return; } - note * n = m_pat->noteAtStep( step ); + Note * n = m_pat->noteAtStep( step ); // if note at step not found, ensureBeatNotes and try again if( n == NULL ) @@ -840,7 +840,7 @@ void PatternView::wheelEvent( QWheelEvent * _we ) int vol = 0; int len = 0; - note * n = m_pat->noteAtStep( step ); + Note * n = m_pat->noteAtStep( step ); if( n != NULL ) { vol = n->getVolume(); @@ -1083,7 +1083,7 @@ void PatternView::paintEvent( QPaintEvent * ) for( int it = 0; it < steps; it++ ) // go through all the steps in the beat pattern { - note * n = m_pat->noteAtStep( it ); + Note * n = m_pat->noteAtStep( it ); // figure out x and y coordinates for step graphic const int x = TCO_BORDER_WIDTH + static_cast( it * w / steps );