artsplayer.h 2.56 KB
Newer Older
1 2 3 4
/***************************************************************************
                          artsplayer.h  -  description
                             -------------------
    begin                : Sun Feb 17 2002
5 6
    copyright            : (C) 2002 by Scott Wheeler <wheeler@kde.org>
                           (C) 2003 by Matthias Kretz <kretz@kde.org>
7 8 9 10 11 12 13 14 15 16 17 18 19 20
***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef ARTSPLAYER_H
#define ARTSPLAYER_H

Dirk Mueller's avatar
Dirk Mueller committed
21
#include <config.h>
Scott Wheeler's avatar
build  
Scott Wheeler committed
22 23 24

#ifdef USE_ARTS

25 26 27
#include "player.h"

#include <kurl.h>
Scott Wheeler's avatar
build  
Scott Wheeler committed
28

Dirk Mueller's avatar
Dirk Mueller committed
29
#include <qstring.h>
Scott Wheeler's avatar
build  
Scott Wheeler committed
30
#include <qobject.h>
Scott Wheeler's avatar
Scott Wheeler committed
31
#include <artsflow.h>
32

33 34 35
class KArtsDispatcher;
class KArtsServer;
class KAudioManagerPlay;
36

37 38 39
namespace KDE {
    class PlayObjectFactory;
    class PlayObject;
Dirk Mueller's avatar
Dirk Mueller committed
40
}
41

42
class ArtsPlayer : public Player
43
{
44 45
    Q_OBJECT

46 47 48 49
public:
    ArtsPlayer();
    virtual ~ArtsPlayer();

50
    virtual void play(const FileHandle &file = FileHandle::null());
51 52 53 54
    virtual void pause();
    virtual void stop();

    virtual void setVolume(float volume = 1.0);
55
    virtual float volume() const;
56 57 58 59

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

Scott Wheeler's avatar
Scott Wheeler committed
60 61
    virtual int totalTime() const;
    virtual int currentTime() const;
62 63
    virtual int position() const; // in this case not really the percent

Scott Wheeler's avatar
Scott Wheeler committed
64
    virtual void seek(int seekTime);
65 66
    virtual void seekPosition(int position);

67 68 69 70
private slots:
    void setupArtsObjects();
    void playObjectCreated();

71 72 73 74 75
private:
    void setupPlayer();
    void setupVolumeControl();
    bool serverRunning() const;

76 77 78 79 80
    KArtsDispatcher *m_dispatcher;
    KArtsServer *m_server;
    KDE::PlayObjectFactory *m_factory;
    KDE::PlayObject *m_playobject;
    KAudioManagerPlay *m_amanPlay;
81

Scott Wheeler's avatar
Scott Wheeler committed
82 83
    // This is a pretty heavy module for the needs that JuK has, it would probably
    // be good to use two Synth_MUL instead or the one from Noatun.
84

Scott Wheeler's avatar
Scott Wheeler committed
85
    Arts::StereoVolumeControl m_volumeControl;
86 87

    KURL m_currentURL;
88
    float m_currentVolume;
89 90 91
};

#endif
Dirk Mueller's avatar
Dirk Mueller committed
92 93
#endif

94
// vim: sw=4 ts=8 et