aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorMax Horn2003-07-29 01:36:10 +0000
committerMax Horn2003-07-29 01:36:10 +0000
commit1be944755f1f089b5b000852a9fc34c8b5eea017 (patch)
treefd513fec8190330ffc4b86e0c97121f4e19c4afc /sound
parent3f99e8d1d4e757dcbc54dba7872a4ffddeab1076 (diff)
downloadscummvm-rg350-1be944755f1f089b5b000852a9fc34c8b5eea017.tar.gz
scummvm-rg350-1be944755f1f089b5b000852a9fc34c8b5eea017.tar.bz2
scummvm-rg350-1be944755f1f089b5b000852a9fc34c8b5eea017.zip
added makeRateConverter factory function
svn-id: r9270
Diffstat (limited to 'sound')
-rw-r--r--sound/rate.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sound/rate.h b/sound/rate.h
index de1180b1f7..2ac69cc411 100644
--- a/sound/rate.h
+++ b/sound/rate.h
@@ -93,5 +93,17 @@ public:
}
};
+static inline RateConverter *makeRateConverter(st_rate_t inrate, st_rate_t outrate, bool stereo) {
+ printf("makeRateConverter: inrate %d, outrate %d\n", inrate, outrate);
+ if (inrate != outrate) {
+ return new LinearRateConverter(inrate, outrate);
+ //return new ResampleRateConverter(inrate, outrate, 1);
+ } else {
+ if (stereo)
+ return new CopyRateConverter<true>();
+ else
+ return new CopyRateConverter<false>();
+ }
+}
#endif