summaryrefslogtreecommitdiffstats
path: root/src/audio
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2020-04-06 21:52:29 +0200
committerUwe Klotz <uklotz@mixxx.org>2020-04-06 22:11:10 +0200
commite3bd16508964c3174e5dee6a40b87189f0850aac (patch)
tree4068ace6f8a5500606ee1460f67b2c84ee70fde0 /src/audio
parent57cfe1e13ad817f05218decbb2532305e7655e9a (diff)
Replace template integer frame/sample counts with SINT
Diffstat (limited to 'src/audio')
-rw-r--r--src/audio/signalinfo.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/audio/signalinfo.h b/src/audio/signalinfo.h
index 56d5d64946..982f80d946 100644
--- a/src/audio/signalinfo.h
+++ b/src/audio/signalinfo.h
@@ -45,23 +45,20 @@ class SignalInfo final {
// Conversion: #samples / sample offset -> #frames / frame offset
// Only works for integer sample offsets on frame boundaries!
- template<typename T>
- T samples2frames(T samples) const {
+ SINT samples2frames(SINT samples) const {
DEBUG_ASSERT(getChannelCount().isValid());
DEBUG_ASSERT(0 == (samples % getChannelCount()));
return samples / getChannelCount();
}
// Conversion: #frames / frame offset -> #samples / sample offset
- template<typename T>
- T frames2samples(T frames) const {
+ SINT frames2samples(SINT frames) const {
DEBUG_ASSERT(getChannelCount().isValid());
return frames * getChannelCount();
}
// Conversion: #frames / frame offset -> second offset
- template<typename T>
- double frames2secs(T frames) const {
+ double frames2secs(SINT frames) const {
DEBUG_ASSERT(getSampleRate().isValid());
return static_cast<double>(frames) / getSampleRate();
}
@@ -73,8 +70,7 @@ class SignalInfo final {
}
// Conversion: #frames / frame offset -> millisecond offset
- template<typename T>
- double frames2millis(T frames) const {
+ double frames2millis(SINT frames) const {
return frames2secs(frames) * 1000;
}
@@ -85,8 +81,7 @@ class SignalInfo final {
// Conversion: #samples / sample offset -> second offset
// Only works for integer sample offsets on frame boundaries!
- template<typename T>
- double samples2secs(T samples) const {
+ double samples2secs(SINT samples) const {
return frames2secs(samples2frames(samples));
}
@@ -98,8 +93,7 @@ class SignalInfo final {
// Conversion: #samples / sample offset -> millisecond offset
// Only works for integer sample offsets on frame boundaries!
- template<typename T>
- double samples2millis(T samples) const {
+ double samples2millis(SINT samples) const {
return frames2millis(samples2frames(samples));
}