summaryrefslogtreecommitdiff
path: root/muse2/muse/audioconvert.cpp
diff options
context:
space:
mode:
authorOrcan Ogetbil <oget.fedora@gmail.com>2011-09-08 02:05:32 +0000
committerOrcan Ogetbil <oget.fedora@gmail.com>2011-09-08 02:05:32 +0000
commitd3e8a1b4c98cb3ba8b73f367ea88ad23f8dbca66 (patch)
tree921e5193e46287f0c34f4eff1590efb1df18d20f /muse2/muse/audioconvert.cpp
parentff0c5e9154e7a3d71d2465639b5e0da1ea2c7242 (diff)
introducing namespaces
Diffstat (limited to 'muse2/muse/audioconvert.cpp')
-rw-r--r--muse2/muse/audioconvert.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/muse2/muse/audioconvert.cpp b/muse2/muse/audioconvert.cpp
index 95c97883..6b67f30e 100644
--- a/muse2/muse/audioconvert.cpp
+++ b/muse2/muse/audioconvert.cpp
@@ -142,7 +142,7 @@ off_t AudioConverter::readAudio(SndFileR& f, unsigned offset, float** buffer, in
off_t frame = offset; // _spos is added before the call.
unsigned fsrate = f.samplerate();
- bool resample = isValid() && ((unsigned)sampleRate != fsrate);
+ bool resample = isValid() && ((unsigned)MusEGlobal::sampleRate != fsrate);
// No resampling needed?
if(!resample)
@@ -159,7 +159,7 @@ off_t AudioConverter::readAudio(SndFileR& f, unsigned offset, float** buffer, in
{
// Sample rates are different. Seek to a calculated 'sample rate ratio factored' position.
- double srcratio = (double)fsrate / (double)sampleRate;
+ double srcratio = (double)fsrate / (double)MusEGlobal::sampleRate;
//long inSize = long((double)frames * _src_ratio) + 1 // From MusE-2 file converter.
off_t newfr = (off_t)floor(((double)frame * srcratio)); // From simplesynth.
@@ -343,13 +343,13 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n
// off_t frame = offset; // _spos is added before the call.
unsigned fsrate = f.samplerate();
- //bool resample = src_state && ((unsigned)sampleRate != fsrate);
-// bool resample = isValid() && ((unsigned)sampleRate != fsrate);
+ //bool resample = src_state && ((unsigned)MusEGlobal::sampleRate != fsrate);
+// bool resample = isValid() && ((unsigned)MusEGlobal::sampleRate != fsrate);
- if((sampleRate == 0) || (fsrate == 0))
+ if((MusEGlobal::sampleRate == 0) || (fsrate == 0))
{
#ifdef AUDIOCONVERT_DEBUG
- printf("SRCAudioConverter::process Error: sampleRate or file samplerate is zero!\n");
+ printf("SRCAudioConverter::process Error: MusEGlobal::sampleRate or file samplerate is zero!\n");
#endif
return _sfCurFrame;
}
@@ -357,7 +357,7 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n
SRC_DATA srcdata;
int fchan = f.channels();
// Ratio is defined as output sample rate over input samplerate.
- double srcratio = (double)sampleRate / (double)fsrate;
+ double srcratio = (double)MusEGlobal::sampleRate / (double)fsrate;
// Extra input compensation.
long inComp = 1;
@@ -369,7 +369,7 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n
//long inSize = (long)floor(((double)outSize / srcratio)); // From simplesynth.
//long inFrames = (long)floor(((double)outFrames / srcratio)); // From simplesynth.
long inFrames = (long)ceil(((double)outFrames / srcratio)) + inComp; // From simplesynth.
- //long inFrames = (long)floor(double(outFrames * sfinfo.samplerate) / double(sampleRate)); // From simplesynth.
+ //long inFrames = (long)floor(double(outFrames * sfinfo.samplerate) / double(MusEGlobal::sampleRate)); // From simplesynth.
long inSize = inFrames * fchan;
//long inSize = inFrames * channel;
@@ -583,7 +583,7 @@ RubberBandAudioConverter::RubberBandAudioConverter(int channels, int options) :
_rbs = 0;
_channels = channels;
- _rbs = new RubberBandStretcher(sampleRate, _channels, _options); // , initialTimeRatio = 1.0, initialPitchScale = 1.0
+ _rbs = new RubberBandStretcher(MusEGlobal::sampleRate, _channels, _options); // , initialTimeRatio = 1.0, initialPitchScale = 1.0
}
RubberBandAudioConverter::~RubberBandAudioConverter()
@@ -605,7 +605,7 @@ void RubberBandAudioConverter::setChannels(int ch)
_rbs = 0;
_channels = ch;
- _rbs = new RubberBandStretcher(sampleRate, _channels, _options); // , initialTimeRatio = 1.0, initialPitchScale = 1.0
+ _rbs = new RubberBandStretcher(MusEGlobal::sampleRate, _channels, _options); // , initialTimeRatio = 1.0, initialPitchScale = 1.0
}
void RubberBandAudioConverter::reset()
@@ -639,13 +639,13 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel
// off_t frame = offset; // _spos is added before the call.
unsigned fsrate = f.samplerate();
- //bool resample = src_state && ((unsigned)sampleRate != fsrate);
-// bool resample = isValid() && ((unsigned)sampleRate != fsrate);
+ //bool resample = src_state && ((unsigned)MusEGlobal::sampleRate != fsrate);
+// bool resample = isValid() && ((unsigned)MusEGlobal::sampleRate != fsrate);
- if((sampleRate == 0) || (fsrate == 0))
+ if((MusEGlobal::sampleRate == 0) || (fsrate == 0))
{
#ifdef AUDIOCONVERT_DEBUG
- printf("RubberBandAudioConverter::process Error: sampleRate or file samplerate is zero!\n");
+ printf("RubberBandAudioConverter::process Error: MusEGlobal::sampleRate or file samplerate is zero!\n");
#endif
return _sfCurFrame;
}
@@ -653,7 +653,7 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel
// SRC_DATA srcdata;
int fchan = f.channels();
// Ratio is defined as output sample rate over input samplerate.
- double srcratio = (double)sampleRate / (double)fsrate;
+ double srcratio = (double)MusEGlobal::sampleRate / (double)fsrate;
// Extra input compensation.
long inComp = 1;
@@ -665,7 +665,7 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel
//long inSize = (long)floor(((double)outSize / srcratio)); // From simplesynth.
//long inFrames = (long)floor(((double)outFrames / srcratio)); // From simplesynth.
long inFrames = (long)ceil(((double)outFrames / srcratio)) + inComp; // From simplesynth.
- //long inFrames = (long)floor(double(outFrames * sfinfo.samplerate) / double(sampleRate)); // From simplesynth.
+ //long inFrames = (long)floor(double(outFrames * sfinfo.samplerate) / double(MusEGlobal::sampleRate)); // From simplesynth.
long inSize = inFrames * fchan;
//long inSize = inFrames * channel;