/*
*/
#ifndef Phonon_GST_MEDIAOBJECT_H
#define Phonon_GST_MEDIAOBJECT_H

#include "abstractmediaproducer.h"
#include <kurl.h>
#include <phonon/mediaobjectinterface.h>

class KUrl;

namespace Phonon
{
namespace Gst
{
	class MediaObject : public AbstractMediaProducer, public MediaObjectInterface
	{
		Q_OBJECT
		Q_INTERFACES( Phonon::MediaObjectInterface )
		public:
			MediaObject( QObject* parent );
			~MediaObject();
			Q_INVOKABLE KUrl url() const;
			Q_INVOKABLE qint64 totalTime() const;
			Q_INVOKABLE qint32 aboutToFinishTime() const;
			Q_INVOKABLE void setUrl( const KUrl& url );
			void openMedia(Phonon::MediaObject::Media media, const QString &mediaDevice);
			Q_INVOKABLE void setAboutToFinishTime( qint32 newAboutToFinishTime );

			Q_INVOKABLE void play();
			Q_INVOKABLE void pause();
			Q_INVOKABLE void seek( qint64 time );

		public Q_SLOTS:
			void stop();

		Q_SIGNALS:
			void finished();
			void aboutToFinish( qint32 msec );
			void length( qint64 length );

		protected:
			//virtual void emitTick();

		private:
			KUrl m_url;
			qint32 m_aboutToFinishTime;
			bool m_aboutToFinishNotEmitted;
	};
}} //namespace Phonon::Gst

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