Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

engine.h

Go to the documentation of this file.
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  * Handles all playing, connecting to aRts.
00030  * Does almost everything related to multimedia.
00031  * Most interfacing should be done with Player
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      * opens the file, use play() to start playing
00046      **/
00047     bool open(const PlaylistItem &file);
00048     /**
00049      * Continues playing
00050      **/
00051     bool play();
00052     /**
00053      * Terminates playing, does not close the file
00054      **/
00055     void pause();
00056     /**
00057      * resets the engine
00058      **/
00059     void stop();
00060     /**
00061      * skips to a timecode
00062      * unit is milliseconds
00063      **/
00064     void seek(int msec);
00065 
00066     void setVolume(int percent);
00067 
00068 signals:
00069     void done();
00070     /**
00071      * emitted when arts dies and noatun has to start 
00072      * it again. This is called when the new arts
00073      * is already initialized
00074      **/
00075     void artsError();
00076     
00077 public:
00078     int state();
00079     int position(); // return position in milliseconds
00080     int length(); // return track-length in milliseconds
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

Generated at Mon Apr 1 11:45:00 2002 for noatun by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001