From a81ff520885533e465e6dd6ecf044b6eec1c4068 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 19 Jan 2013 15:53:54 +0200 Subject: MT32: Sync with the latest changes in munt This syncs our code with munt commits 535bf96, 934c116, 1643d07 and 2eac585 --- audio/softsynth/mt32/Part.cpp | 16 ++++++++-------- audio/softsynth/mt32/Part.h | 5 +++-- audio/softsynth/mt32/TVA.cpp | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'audio/softsynth') diff --git a/audio/softsynth/mt32/Part.cpp b/audio/softsynth/mt32/Part.cpp index 852319be70..0c9e576100 100644 --- a/audio/softsynth/mt32/Part.cpp +++ b/audio/softsynth/mt32/Part.cpp @@ -246,7 +246,7 @@ void Part::backupCacheToPartials(PatchCache cache[4]) { // if so then duplicate the cached data from the part to the partial so that // we can change the part's cache without affecting the partial. // We delay this until now to avoid a copy operation with every note played - for (Common::List::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { + for (PolyList::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { (*polyIt)->backupCacheToPartials(cache); } } @@ -446,7 +446,7 @@ void Part::abortPoly(Poly *poly) { } bool Part::abortFirstPoly(unsigned int key) { - for (Common::List::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { + for (PolyList::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { Poly *poly = *polyIt; if (poly->getKey() == key) { abortPoly(poly); @@ -457,7 +457,7 @@ bool Part::abortFirstPoly(unsigned int key) { } bool Part::abortFirstPoly(PolyState polyState) { - for (Common::List::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { + for (PolyList::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { Poly *poly = *polyIt; if (poly->getState() == polyState) { abortPoly(poly); @@ -545,7 +545,7 @@ void Part::playPoly(const PatchCache cache[4], const MemParams::RhythmTemp *rhyt void Part::allNotesOff() { // The MIDI specification states - and Mok confirms - that all notes off (0x7B) // should treat the hold pedal as usual. - for (Common::List::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { + for (PolyList::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { Poly *poly = *polyIt; // FIXME: This has special handling of key 0 in NoteOff that Mok has not yet confirmed applies to AllNotesOff. // if (poly->canSustain() || poly->getKey() == 0) { @@ -560,14 +560,14 @@ void Part::allSoundOff() { // MIDI "All sound off" (0x78) should release notes immediately regardless of the hold pedal. // This controller is not actually implemented by the synths, though (according to the docs and Mok) - // we're only using this method internally. - for (Common::List::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { + for (PolyList::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { Poly *poly = *polyIt; poly->startDecay(); } } void Part::stopPedalHold() { - for (Common::List::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { + for (PolyList::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { Poly *poly = *polyIt; poly->stopPedalHold(); } @@ -586,7 +586,7 @@ void Part::stopNote(unsigned int key) { synth->printDebug("%s (%s): stopping key %d", name, currentInstr, key); #endif - for (Common::List::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { + for (PolyList::iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { Poly *poly = *polyIt; // Generally, non-sustaining instruments ignore note off. They die away eventually anyway. // Key 0 (only used by special cases on rhythm part) reacts to note off even if non-sustaining or pedal held. @@ -608,7 +608,7 @@ unsigned int Part::getActivePartialCount() const { unsigned int Part::getActiveNonReleasingPartialCount() const { unsigned int activeNonReleasingPartialCount = 0; - for (Common::List::const_iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { + for (PolyList::const_iterator polyIt = activePolys.begin(); polyIt != activePolys.end(); polyIt++) { Poly *poly = *polyIt; if (poly->getState() != POLY_Releasing) { activeNonReleasingPartialCount += poly->getActivePartialCount(); diff --git a/audio/softsynth/mt32/Part.h b/audio/softsynth/mt32/Part.h index 5c59c6d61f..7ae73a818c 100644 --- a/audio/softsynth/mt32/Part.h +++ b/audio/softsynth/mt32/Part.h @@ -24,6 +24,7 @@ namespace MT32Emu { class PartialManager; class Synth; +typedef Common::List PolyList; class Part { private: @@ -37,8 +38,8 @@ private: unsigned int activePartialCount; PatchCache patchCache[4]; - Common::List freePolys; - Common::List activePolys; + PolyList freePolys; + PolyList activePolys; void setPatch(const PatchParam *patch); unsigned int midiKeyToKey(unsigned int midiKey); diff --git a/audio/softsynth/mt32/TVA.cpp b/audio/softsynth/mt32/TVA.cpp index 7aadd64522..19a01cfc73 100644 --- a/audio/softsynth/mt32/TVA.cpp +++ b/audio/softsynth/mt32/TVA.cpp @@ -280,7 +280,7 @@ void TVA::nextPhase() { } int newTarget; - int newIncrement = 0; + int newIncrement = 0; // Initialised to please compilers int envPointIndex = phase; if (!allLevelsZeroFromNowOn) { -- cgit v1.2.3