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
00028
00029
00030
00031
00032
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:
00044
00045
00046
00047 bool open(const PlaylistItem &file);
00048
00049
00050
00051 bool play();
00052
00053
00054
00055 void pause();
00056
00057
00058
00059 void stop();
00060
00061
00062
00063
00064 void seek(int msec);
00065
00066 void setVolume(int percent);
00067
00068 signals:
00069 void done();
00070
00071
00072
00073
00074
00075 void artsError();
00076
00077 public:
00078 int state();
00079 int position();
00080 int length();
00081 int volume() const;
00082
00083 private:
00084 int openMixerFD();
00085 void closeMixerFD(int);
00086 void useHardwareMixer(bool);
00087 bool initArts();
00088
00089 public:
00090 Arts::SoundServerV2 *server() const;
00091 Arts::PlayObject playObject() const;
00092 Arts::SoundServerV2 *simpleSoundServer() const;
00093 Noatun::StereoEffectStack *effectStack() const;
00094 Noatun::Equalizer *equalizer() const;
00095 Noatun::StereoEffectStack *visualizationStack() const;
00096 Noatun::StereoEffectStack *globalEffectStack() const;
00097 Noatun::Session *session() const;
00098
00099 private:
00100 class EnginePrivate;
00101 EnginePrivate *d;
00102 bool mPlay;
00103 };
00104
00105 #endif