/*
*/
#ifndef Phonon_GST_AUDIODATAOUTPUT_H
#define Phonon_GST_AUDIODATAOUTPUT_H

#include "abstractaudiooutput.h"
#include <phonon/audiodataoutput.h>
#include <QVector>

namespace Phonon
{
namespace Gst
{
	/**
	 * \author Matthias Kretz <kretz@kde.org>
	 */
	class AudioDataOutput : public AbstractAudioOutput
	{
		Q_OBJECT
		public:
			AudioDataOutput( QObject* parent );
			~AudioDataOutput();

		public Q_SLOTS:
			Phonon::AudioDataOutput::Format format() const;
			int dataSize() const;
			int sampleRate() const;
			void setFormat( Phonon::AudioDataOutput::Format format );
			void setDataSize( int size );

		public:
			// Fake specific:
			virtual void processBuffer( const QVector<float>& buffer );

		signals:
			void dataReady( const QMap<Phonon::AudioDataOutput::Channel, QVector<qint16> >& data );
			void dataReady( const QMap<Phonon::AudioDataOutput::Channel, QVector<float> >& data );
			void endOfMedia( int remainingSamples );

		private:
			void convertAndEmit( const QVector<float>& buffer );

			Phonon::AudioDataOutput::Format m_format;
			int m_dataSize;
			QVector<float> m_pendingData;
	};
}} //namespace Phonon::Gst

// vim: sw=4 ts=4 tw=80
#endif // Phonon_FAKE_AUDIODATAOUTPUT_H
