gstreamerplayer.h 2.17 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/***************************************************************************
                          gstreamerplayer.h  -  description
                             -------------------
    begin                : Sat Feb 9 2003
    copyright            : (C) 2003 by Tim Jansen
    email                : tim@tjansen.de
***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

18

19 20 21
#ifndef GSTREAMERPLAYER_H
#define GSTREAMERPLAYER_H

Scott Wheeler's avatar
Scott Wheeler committed
22
#include <config.h>
23 24 25

#if HAVE_GSTREAMER

26
#include <kde/gstplay/play.h>
27 28 29 30 31

#include <qstring.h>

#include "player.h"

32
class GStreamerPlayer : public Player
33 34 35 36 37 38 39
{
    Q_OBJECT

public:
    GStreamerPlayer();
    virtual ~GStreamerPlayer();

40
    virtual void play(const FileHandle &file = FileHandle::null());
41 42

    virtual void setVolume(float volume = 1.0);
43
    virtual float volume() const;
44 45 46 47

    virtual bool playing() const;
    virtual bool paused() const;

Scott Wheeler's avatar
Scott Wheeler committed
48 49
    virtual int totalTime() const;
    virtual int currentTime() const;
50 51
    virtual int position() const; // in this case not really the percent

Scott Wheeler's avatar
Scott Wheeler committed
52
    virtual void seek(int seekTime);
53 54 55 56 57 58 59
    virtual void seekPosition(int position);

public slots:
    void pause();
    void stop();

private slots:
60 61
    void slotSetPosition(long long d) { m_positionNs = d; }
    void slotSetDuration(long long d) { m_durationNs = d; }
62
    void slotStopIfNotPlaying();
63 64

private:
65
    void setupPlayer();
66

67
    KDE::GSTPlay::Play *m_player;
68
    unsigned long long m_duration;
69

70 71
    long long m_positionNs; // in ns
    long long m_durationNs; // in ns
72

73 74
    QString m_currentFile;
    float m_currentVolume;
75 76 77
};

#endif
78 79

#endif