/*
*/

#include <gst/gst.h>
#include <gst-phonon/gst-phonon.h>
#include "audiooutput.h"
#include <QVector>
#include <kdebug.h>

#include <config.h>
//#include <config-phonon.h>

#ifdef HAVE_SYS_SOUNDCARD_H
#include <sys/soundcard.h>
#endif
#include <sys/ioctl.h>
#include <iostream>

namespace Phonon
{
namespace Gst
{
AudioOutput::AudioOutput( QObject* parent )
	: AbstractAudioOutput( parent )
{
	object = gpho_audio_output_new(GPHO_CATEGORY_MUSIC); /* XXX: how to change that.. */
}

AudioOutput::~AudioOutput()
{
	gst_object_unref(object);
}

float AudioOutput::volume() const
{
	return m_volume;
}

int AudioOutput::outputDevice() const
{
	return m_device;
}

void AudioOutput::setVolume( float newVolume )
{
	m_volume = newVolume;
	emit volumeChanged( m_volume );
}

bool AudioOutput::setOutputDevice(int newDevice)
{
	Q_ASSERT( newDevice >= 10000 );
	Q_ASSERT( newDevice <= 10001 );
	m_device = newDevice;
    return true;
}

void AudioOutput::processBuffer( const QVector<float>& buffer )
{
}

void AudioOutput::openDevice()
{
}

void AudioOutput::closeDevice()
{
}

}} //namespace Phonon::Gst

#include "audiooutput.moc"
// vim: sw=4 ts=4
