aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sound/fmopl.cpp2
-rw-r--r--sound/mixer.cpp1
-rw-r--r--sound/module.mk5
-rw-r--r--sound/voc.cpp38
-rw-r--r--sound/voc.h17
5 files changed, 47 insertions, 16 deletions
diff --git a/sound/fmopl.cpp b/sound/fmopl.cpp
index ef25721767..293b39a14b 100644
--- a/sound/fmopl.cpp
+++ b/sound/fmopl.cpp
@@ -32,7 +32,7 @@
#include "fmopl.h"
-#include "common/engine.h" // for warning/error/debug
+#include "common/util.h"
#ifndef PI
#define PI 3.14159265358979323846
diff --git a/sound/mixer.cpp b/sound/mixer.cpp
index 4cb53ed927..20495e94ab 100644
--- a/sound/mixer.cpp
+++ b/sound/mixer.cpp
@@ -21,7 +21,6 @@
*/
#include "stdafx.h"
-#include "common/engine.h" // for warning/error/debug
#include "common/file.h"
#include "common/util.h"
diff --git a/sound/module.mk b/sound/module.mk
index 5744a80156..b78e32e6fe 100644
--- a/sound/module.mk
+++ b/sound/module.mk
@@ -8,8 +8,9 @@ MODULE_OBJS = \
sound/midiparser_xmidi.o \
sound/mixer.o \
sound/mpu401.o \
- sound/rate.o
-# sound/resample.o
+ sound/rate.o \
+# sound/resample.o \
+ sound/voc.o
# Include common rules
include common.rules
diff --git a/sound/voc.cpp b/sound/voc.cpp
new file mode 100644
index 0000000000..568c3507be
--- /dev/null
+++ b/sound/voc.cpp
@@ -0,0 +1,38 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2001 Ludvig Strigeus
+ * Copyright (C) 2001-2003 The ScummVM project
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * $Header$
+ *
+ */
+
+#include "stdafx.h"
+#include "common/util.h"
+#include "sound/voc.h"
+
+
+int getSampleRateFromVOCRate(int vocSR) {
+ if (vocSR == 0xa5 || vocSR == 0xa6) {
+ return 11025;
+ } else if (vocSR == 0xd2 || vocSR == 0xd3) {
+ return 22050;
+ } else {
+ int sr = 1000000L / (256L - vocSR);
+ warning("inexact sample rate used: %i (0x%x)", sr, vocSR);
+ return sr;
+ }
+}
diff --git a/sound/voc.h b/sound/voc.h
index b516575f54..5768be2c19 100644
--- a/sound/voc.h
+++ b/sound/voc.h
@@ -48,17 +48,10 @@ struct VocBlockHeader {
#pragma END_PACK_STRUCTS
#endif
-
-static inline int getSampleRateFromVOCRate(int vocSR) {
- if (vocSR == 0xa5 || vocSR == 0xa6) {
- return 11025;
- } else if (vocSR == 0xd2 || vocSR == 0xd3) {
- return 22050;
- } else {
- int sr = 1000000L / (256L - vocSR);
- warning("inexact sample rate used: %i (0x%x)", sr, vocSR);
- return sr;
- }
-}
+/**
+ * Take a sample rate parameter as it occurs in a VOC sound header, and
+ * return the corresponding sample frequency.
+ */
+extern int getSampleRateFromVOCRate(int vocSR);
#endif