diff data/model/WaveFileModel.cpp @ 1040:a1cd5abcb38b cxx11

Introduce and use a samplerate type
author Chris Cannam
date Wed, 04 Mar 2015 12:01:04 +0000
parents cc27f35aa75c
children 843f67be0ed9
line wrap: on
line diff
--- a/data/model/WaveFileModel.cpp	Tue Mar 03 17:09:19 2015 +0000
+++ b/data/model/WaveFileModel.cpp	Wed Mar 04 12:01:04 2015 +0000
@@ -37,7 +37,7 @@
 PowerOfSqrtTwoZoomConstraint
 WaveFileModel::m_zoomConstraint;
 
-WaveFileModel::WaveFileModel(FileSource source, int targetRate) :
+WaveFileModel::WaveFileModel(FileSource source, sv_samplerate_t targetRate) :
     m_source(source),
     m_path(source.getLocation()),
     m_reader(0),
@@ -145,18 +145,18 @@
     return m_reader->getChannelCount();
 }
 
-int
+sv_samplerate_t
 WaveFileModel::getSampleRate() const 
 {
     if (!m_reader) return 0;
     return m_reader->getSampleRate();
 }
 
-int
+sv_samplerate_t
 WaveFileModel::getNativeRate() const 
 {
     if (!m_reader) return 0;
-    int rate = m_reader->getNativeRate();
+    sv_samplerate_t rate = m_reader->getNativeRate();
     if (rate == 0) rate = getSampleRate();
     return rate;
 }