summaryrefslogtreecommitdiff
path: root/media/libsoundtouch/src/FIFOSamplePipe.h
diff options
context:
space:
mode:
Diffstat (limited to 'media/libsoundtouch/src/FIFOSamplePipe.h')
-rw-r--r--media/libsoundtouch/src/FIFOSamplePipe.h28
1 files changed, 12 insertions, 16 deletions
diff --git a/media/libsoundtouch/src/FIFOSamplePipe.h b/media/libsoundtouch/src/FIFOSamplePipe.h
index cd3191c1af..3def42d1ab 100644
--- a/media/libsoundtouch/src/FIFOSamplePipe.h
+++ b/media/libsoundtouch/src/FIFOSamplePipe.h
@@ -17,13 +17,6 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2012-06-13 19:29:53 +0000 (Wed, 13 Jun 2012) $
-// File revision : $Revision: 4 $
-//
-// $Id: FIFOSamplePipe.h 143 2012-06-13 19:29:53Z oparviai $
-//
-////////////////////////////////////////////////////////////////////////////////
-//
// License :
//
// SoundTouch audio processing library
@@ -58,6 +51,18 @@ namespace soundtouch
/// Abstract base class for FIFO (first-in-first-out) sample processing classes.
class FIFOSamplePipe
{
+protected:
+
+ bool verifyNumberOfChannels(int nChannels) const
+ {
+ if ((nChannels > 0) && (nChannels <= SOUNDTOUCH_MAX_CHANNELS))
+ {
+ return true;
+ }
+ ST_THROW_RT_ERROR("Error: Illegal number of channels");
+ return false;
+ }
+
public:
// virtual default destructor
virtual ~FIFOSamplePipe() {}
@@ -122,7 +127,6 @@ public:
};
-
/// Base-class for sound processing routines working in FIFO principle. With this base
/// class it's easy to implement sound processing stages that can be chained together,
/// so that samples that are fed into beginning of the pipe automatically go through
@@ -145,7 +149,6 @@ protected:
output = pOutput;
}
-
/// Constructor. Doesn't define output pipe; it has to be set be
/// 'setOutPipe' function.
FIFOProcessor()
@@ -153,7 +156,6 @@ protected:
output = NULL;
}
-
/// Constructor. Configures output pipe.
FIFOProcessor(FIFOSamplePipe *pOutput ///< Output pipe.
)
@@ -161,13 +163,11 @@ protected:
output = pOutput;
}
-
/// Destructor.
virtual ~FIFOProcessor()
{
}
-
/// Returns a pointer to the beginning of the output samples.
/// This function is provided for accessing the output samples directly.
/// Please be careful for not to corrupt the book-keeping!
@@ -194,7 +194,6 @@ public:
return output->receiveSamples(outBuffer, maxSamples);
}
-
/// Adjusts book-keeping so that given number of samples are removed from beginning of the
/// sample buffer without copying them anywhere.
///
@@ -206,14 +205,12 @@ public:
return output->receiveSamples(maxSamples);
}
-
/// Returns number of samples currently available.
virtual uint numSamples() const
{
return output->numSamples();
}
-
/// Returns nonzero if there aren't any samples available for outputting.
virtual int isEmpty() const
{
@@ -226,7 +223,6 @@ public:
{
return output->adjustAmountOfSamples(numSamples);
}
-
};
}