Commit 06f9bf94 authored by Thomas Eschenbacher's avatar Thomas Eschenbacher
Browse files

- added Kwave::SampleFIFO::getAll()

- fixed somy whitespace
parent 7d1c7036
......@@ -30,7 +30,7 @@ namespace Kwave
{
/**
* array with sample_t, for use in KwaveSampleSource, KwaveSampleSink
* array with sample_t, for use in Kwave::SampleSource, Kwave::SampleSink
* and other streaming classes.
*/
class Q_DECL_EXPORT SampleArray
......
......@@ -66,6 +66,20 @@ void Kwave::SampleFIFO::put(const Kwave::SampleArray &buffer)
m_buffer.dequeue();
}
//***************************************************************************
QList<Kwave::SampleArray> Kwave::SampleFIFO::getAll()
{
QMutexLocker _lock(&m_lock);
QList<Kwave::SampleArray> list;
while (!m_buffer.isEmpty())
list.push_front(m_buffer.dequeue());
m_read_offset = 0;
return list;
}
//***************************************************************************
unsigned int Kwave::SampleFIFO::get(Kwave::SampleArray &buffer)
{
......
......@@ -21,6 +21,7 @@
#include "config.h"
#include <QtGlobal>
#include <QList>
#include <QMutex>
#include <QQueue>
......@@ -62,6 +63,13 @@ namespace Kwave
*/
virtual unsigned int get(Kwave::SampleArray &buffer);
/**
* gets and removes all samples from the FIFO
*
* @return a list of sample arrays
*/
virtual QList<Kwave::SampleArray> getAll();
/**
* Returns the number of samples that can be read out.
* @see m_written
......
......@@ -57,7 +57,7 @@ namespace Kwave
* @param start position within the track
* @param samples array with initial samples
*/
Stripe(sample_index_t start, const Kwave::SampleArray& samples);
Stripe(sample_index_t start, const Kwave::SampleArray &samples);
/**
* Constructor. Creates a stripe that already contains samples,
......@@ -67,7 +67,7 @@ namespace Kwave
* @param stripe source stripe to copy from
* @param offset offset within the source stripe
*/
Stripe(sample_index_t start, Stripe& stripe, unsigned int offset);
Stripe(sample_index_t start, Stripe &stripe, unsigned int offset);
/**
* Destructor.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment