~ubuntu-branches/ubuntu/breezy/kdemultimedia/breezy

« back to all changes in this revision

Viewing changes to noatun/library/noatun/engine.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-03-24 04:48:58 UTC
  • mfrom: (1.2.1 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050324044858-8ff88o9jxej6ii3d
Tags: 4:3.4.0-0ubuntu3
Add kubuntu_02_hide_arts_menu_entries.diff to hide artsbuilder and artscontrol k-menu entries

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _ENGINE_H
 
2
#define _ENGINE_H
 
3
 
 
4
#include <qobject.h>
 
5
#include <kurl.h>
 
6
#include <arts/kmedia2.h>
 
7
#include <noatun/playlist.h>
 
8
 
 
9
class Visualization;
 
10
 
 
11
namespace Arts
 
12
{
 
13
        class SoundServerV2;
 
14
 
 
15
        class Synth_AMAN_PLAY;
 
16
}
 
17
 
 
18
namespace Noatun
 
19
{
 
20
        class StereoEffectStack;
 
21
        class StereoVolumeControl;
 
22
        class Equalizer;
 
23
        class Session;
 
24
}
 
25
 
 
26
class NoatunApp;
 
27
 
 
28
/**
 
29
 * Handles all playing, connecting to aRts.
 
30
 * Does almost everything related to multimedia.
 
31
 * Most interfacing should be done with Player
 
32
 **/
 
33
class Engine : public QObject
 
34
{
 
35
Q_OBJECT
 
36
friend class NoatunApp;
 
37
public:
 
38
        Engine(QObject *parent=0);
 
39
        ~Engine();
 
40
        void setInitialized();
 
41
        bool initialized() const;
 
42
 
 
43
public slots:
 
44
        /**
 
45
         * opens the file, use play() to start playing
 
46
         **/
 
47
        bool open(const PlaylistItem &file);
 
48
        /**
 
49
         * Continues playing
 
50
         **/
 
51
        bool play();
 
52
        /**
 
53
         * Terminates playing, does not close the file
 
54
         **/
 
55
        void pause();
 
56
        /**
 
57
         * resets the engine
 
58
         **/
 
59
        void stop();
 
60
        /**
 
61
         * skips to a timecode
 
62
         * unit is milliseconds
 
63
         **/
 
64
        void seek(int msec);
 
65
 
 
66
        void setVolume(int percent);
 
67
 
 
68
        void connectPlayObject();
 
69
signals:
 
70
        void done();
 
71
        /**
 
72
         * emitted when arts dies and noatun has to start
 
73
         * it again. This is called when the new arts
 
74
         * is already initialized
 
75
         **/
 
76
        void artsError();
 
77
 
 
78
        void aboutToPlay();
 
79
 
 
80
        void receivedStreamMeta(
 
81
                const QString &streamName, const QString &streamGenre,
 
82
                const QString &streamUrl, const QString &streamBitrate,
 
83
                const QString &trackTitle, const QString &trackUrl
 
84
        );
 
85
 
 
86
        void playingFailed();
 
87
 
 
88
        private slots:
 
89
                void slotProxyError();
 
90
                void deleteProxy();
 
91
 
 
92
public:
 
93
        int state();
 
94
        int position(); // return position in milliseconds
 
95
        int length(); // return track-length in milliseconds
 
96
        int volume() const;
 
97
 
 
98
private:
 
99
        int openMixerFD();
 
100
        void closeMixerFD(int);
 
101
        void useHardwareMixer(bool);
 
102
        bool initArts();
 
103
 
 
104
public:
 
105
        Arts::SoundServerV2 *server() const;
 
106
        Arts::PlayObject playObject() const;
 
107
        Arts::SoundServerV2 *simpleSoundServer() const;
 
108
        Noatun::StereoEffectStack *effectStack() const;
 
109
        Noatun::Equalizer *equalizer() const;
 
110
        Noatun::StereoEffectStack *visualizationStack() const;
 
111
        Noatun::StereoEffectStack *globalEffectStack() const;
 
112
        Noatun::Session *session() const;
 
113
 
 
114
private:
 
115
        class EnginePrivate;
 
116
        EnginePrivate *d;
 
117
        bool mPlay;
 
118
};
 
119
 
 
120
#endif