00001 #ifndef _ENGINE_H
00002 #define _ENGINE_H
00003
00004 #include <qobject.h>
00005 #include <kurl.h>
00006 #include <arts/kmedia2.h>
00007 #include <noatun/playlist.h>
00008
00009 class Visualization;
00010
00011 namespace Arts
00012 {
00013 class SoundServerV2;
00014
00015 class Synth_AMAN_PLAY;
00016 }
00017
00018 namespace Noatun
00019 {
00020 class StereoEffectStack;
00021 class StereoVolumeControl;
00022 class Equalizer;
00023 class Session;
00024 }
00025
00026 class NoatunApp;
00027
00033 class Engine : public QObject
00034 {
00035 Q_OBJECT
00036 friend class NoatunApp;
00037 public:
00038 Engine(QObject *parent=0);
00039 ~Engine();
00040 void setInitialized();
00041 bool initialized() const;
00042
00043 public slots:
00047 bool open(const PlaylistItem &file);
00051 bool play();
00055 void pause();
00059 void stop();
00064 void seek(int msec);
00065
00066 void setVolume(int percent);
00067
00068 void connectPlayObject();
00069 signals:
00070 void done();
00076 void artsError();
00077
00078 void aboutToPlay();
00079
00080 public:
00081 int state();
00082 int position();
00083 int length();
00084 int volume() const;
00085
00086 private:
00087 int openMixerFD();
00088 void closeMixerFD(int);
00089 void useHardwareMixer(bool);
00090 bool initArts();
00091
00092 public:
00093 Arts::SoundServerV2 *server() const;
00094 Arts::PlayObject playObject() const;
00095 Arts::SoundServerV2 *simpleSoundServer() const;
00096 Noatun::StereoEffectStack *effectStack() const;
00097 Noatun::Equalizer *equalizer() const;
00098 Noatun::StereoEffectStack *visualizationStack() const;
00099 Noatun::StereoEffectStack *globalEffectStack() const;
00100 Noatun::Session *session() const;
00101
00102 private:
00103 class EnginePrivate;
00104 EnginePrivate *d;
00105 bool mPlay;
00106 };
00107
00108 #endif