From b4c4b293a0c8acd0ad81f7b6963cf8424a0e4238 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 29 Jan 2014 22:49:45 +0100 Subject: [PATCH] sfxr: use instrumentTrack() instead of maintaining own variable No need to maintain instrument track on our own here. Furthermore minor coding style improvements. --- plugins/sfxr/sfxr.cpp | 11 +++++------ plugins/sfxr/sfxr.h | 1 - 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/plugins/sfxr/sfxr.cpp b/plugins/sfxr/sfxr.cpp index a459768d3..ea8b0d235 100644 --- a/plugins/sfxr/sfxr.cpp +++ b/plugins/sfxr/sfxr.cpp @@ -321,7 +321,6 @@ bool SfxrSynth::isPlaying() const sfxrInstrument::sfxrInstrument( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &sfxr_plugin_descriptor ), - m_instrumentTrack(_instrument_track), m_attModel(0.0f, this), m_holdModel(0.3f, this), m_susModel(0.0f, this), @@ -1062,10 +1061,10 @@ void sfxrInstrumentView::mutate() void sfxrInstrumentView::previewSound() { - sfxrInstrument * s = castModel(); - InstrumentTrack * it = s->m_instrumentTrack; + sfxrInstrument* s = castModel(); + InstrumentTrack* it = s->instrumentTrack(); it->silenceAllNotes(); - it->processInEvent( MidiEvent( MidiNoteOn, 0, it->baseNoteModel()->value(), MidiMaxVelocity ), MidiTime() ); + it->processInEvent( MidiEvent( MidiNoteOn, 0, it->baseNoteModel()->value(), MidiMaxVelocity ) ); } @@ -1074,9 +1073,9 @@ extern "C" { // necessary for getting instance out of shared lib -Plugin * PLUGIN_EXPORT lmms_plugin_main( Model *, void * _data ) +Plugin * PLUGIN_EXPORT lmms_plugin_main( Model*, void* data ) { - return( new sfxrInstrument( static_cast( _data ) ) ); + return new sfxrInstrument( static_cast( data ) ); } diff --git a/plugins/sfxr/sfxr.h b/plugins/sfxr/sfxr.h index 524f67314..1f98b1b05 100644 --- a/plugins/sfxr/sfxr.h +++ b/plugins/sfxr/sfxr.h @@ -184,7 +184,6 @@ public: private: - InstrumentTrack * m_instrumentTrack; SfxrZeroToOneFloatModel m_attModel; SfxrZeroToOneFloatModel m_holdModel; SfxrZeroToOneFloatModel m_susModel;