aboutsummaryrefslogtreecommitdiff
path: root/audio/softsynth/mt32/Part.cpp
diff options
context:
space:
mode:
authorColin Snover2016-11-25 12:24:08 -0600
committerColin Snover2016-11-25 12:24:08 -0600
commitdf4a503622a524ad8ef47e1c325ac4a711549921 (patch)
tree29ac9e6d51fd4cd17e4ebe9d1f66ff93abd0cd9d /audio/softsynth/mt32/Part.cpp
parentb4dbd6d3c275097b4be964b7da4478ff930cbaa7 (diff)
downloadscummvm-rg350-df4a503622a524ad8ef47e1c325ac4a711549921.tar.gz
scummvm-rg350-df4a503622a524ad8ef47e1c325ac4a711549921.tar.bz2
scummvm-rg350-df4a503622a524ad8ef47e1c325ac4a711549921.zip
Revert "MT32: Update Munt to 2.0.0"
This reverts commit b4dbd6d3c275097b4be964b7da4478ff930cbaa7.
Diffstat (limited to 'audio/softsynth/mt32/Part.cpp')
-rw-r--r--audio/softsynth/mt32/Part.cpp34
1 files changed, 16 insertions, 18 deletions
diff --git a/audio/softsynth/mt32/Part.cpp b/audio/softsynth/mt32/Part.cpp
index cba198d651..cffc3ed744 100644
--- a/audio/softsynth/mt32/Part.cpp
+++ b/audio/softsynth/mt32/Part.cpp
@@ -1,5 +1,5 @@
/* Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009 Dean Beeler, Jerome Fisher
- * Copyright (C) 2011-2016 Dean Beeler, Jerome Fisher, Sergey V. Mikayev
+ * Copyright (C) 2011, 2012, 2013, 2014 Dean Beeler, Jerome Fisher, Sergey V. Mikayev
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -15,16 +15,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <cstdio>
-#include <cstring>
+//#include <cstdio>
+//#include <cstring>
+#include "mt32emu.h"
#include "internals.h"
-
-#include "Part.h"
-#include "Partial.h"
#include "PartialManager.h"
-#include "Poly.h"
-#include "Synth.h"
namespace MT32Emu {
@@ -166,7 +162,7 @@ void Part::refresh() {
patchCache[t].reverb = patchTemp->patch.reverbSwitch > 0;
}
memcpy(currentInstr, timbreTemp->common.name, 10);
- synth->newTimbreSet(partNum, patchTemp->patch.timbreGroup, patchTemp->patch.timbreNum, currentInstr);
+ synth->newTimbreSet(partNum, patchTemp->patch.timbreGroup, currentInstr);
updatePitchBenderRange();
}
@@ -511,7 +507,7 @@ void Part::playPoly(const PatchCache cache[4], const MemParams::RhythmTemp *rhyt
#if MT32EMU_MONITOR_PARTIALS > 1
synth->printPartialUsage();
#endif
- synth->reportHandler->onPolyStateChanged((Bit8u)partNum);
+ synth->polyStateChanged(partNum);
}
void Part::allNotesOff() {
@@ -597,14 +593,16 @@ void Part::partialDeactivated(Poly *poly) {
if (!poly->isActive()) {
activePolys.remove(poly);
synth->partialManager->polyFreed(poly);
- synth->reportHandler->onPolyStateChanged((Bit8u)partNum);
+ synth->polyStateChanged(partNum);
}
}
+//#define POLY_LIST_DEBUG
+
PolyList::PolyList() : firstPoly(NULL), lastPoly(NULL) {}
bool PolyList::isEmpty() const {
-#ifdef MT32EMU_POLY_LIST_DEBUG
+#ifdef POLY_LIST_DEBUG
if ((firstPoly == NULL || lastPoly == NULL) && firstPoly != lastPoly) {
printf("PolyList: desynchronised firstPoly & lastPoly pointers\n");
}
@@ -621,7 +619,7 @@ Poly *PolyList::getLast() const {
}
void PolyList::prepend(Poly *poly) {
-#ifdef MT32EMU_POLY_LIST_DEBUG
+#ifdef POLY_LIST_DEBUG
if (poly->getNext() != NULL) {
printf("PolyList: Non-NULL next field in a Poly being prepended is ignored\n");
}
@@ -634,14 +632,14 @@ void PolyList::prepend(Poly *poly) {
}
void PolyList::append(Poly *poly) {
-#ifdef MT32EMU_POLY_LIST_DEBUG
+#ifdef POLY_LIST_DEBUG
if (poly->getNext() != NULL) {
printf("PolyList: Non-NULL next field in a Poly being appended is ignored\n");
}
#endif
poly->setNext(NULL);
if (lastPoly != NULL) {
-#ifdef MT32EMU_POLY_LIST_DEBUG
+#ifdef POLY_LIST_DEBUG
if (lastPoly->getNext() != NULL) {
printf("PolyList: Non-NULL next field in the lastPoly\n");
}
@@ -658,7 +656,7 @@ Poly *PolyList::takeFirst() {
Poly *oldFirst = firstPoly;
firstPoly = oldFirst->getNext();
if (firstPoly == NULL) {
-#ifdef MT32EMU_POLY_LIST_DEBUG
+#ifdef POLY_LIST_DEBUG
if (lastPoly != oldFirst) {
printf("PolyList: firstPoly != lastPoly in a list with a single Poly\n");
}
@@ -677,7 +675,7 @@ void PolyList::remove(Poly * const polyToRemove) {
for (Poly *poly = firstPoly; poly != NULL; poly = poly->getNext()) {
if (poly->getNext() == polyToRemove) {
if (polyToRemove == lastPoly) {
-#ifdef MT32EMU_POLY_LIST_DEBUG
+#ifdef POLY_LIST_DEBUG
if (lastPoly->getNext() != NULL) {
printf("PolyList: Non-NULL next field in the lastPoly\n");
}
@@ -691,4 +689,4 @@ void PolyList::remove(Poly * const polyToRemove) {
}
}
-} // namespace MT32Emu
+}