00001 00034 #include "oldgcccompat.h" // Compatibilty macros for GCC < 4.7 00035 00036 #ifndef BEEDO_H 00037 #define BEEDO_H 00038 00039 #include <phononnamespace.h> 00040 #include <Path> 00041 // Forward declaration of Phonon classes 00042 namespace Phonon 00043 { 00044 class AudioOutput; 00045 class MediaObject; 00046 class VideoWidget; 00047 } 00048 00049 #include <QObject> 00050 #include <QWidget> 00051 #ifdef BEEDOOLDQTFALLBACK 00052 #include <QBuffer> 00053 #endif 00054 00055 namespace AlarmNotifications 00056 { 00057 00071 class Beedo : public QObject 00072 { 00073 Q_OBJECT 00074 private: 00080 bool _go; 00086 QWidget* _display; 00092 Phonon::AudioOutput* _audio; 00098 Phonon::MediaObject* _media; 00104 Phonon::VideoWidget* _video; 00110 Phonon::Path _mediaToAudio; 00116 Phonon::Path _mediaToVideo; 00117 #ifdef BEEDOOLDQTFALLBACK 00118 QBuffer _videobuffer; 00119 #endif 00120 00126 Beedo(); 00133 void start_internal() noexcept; 00142 void stop_internal() noexcept; 00151 void createMediaObjects(); 00158 void destroyMediaObjects(); 00159 private slots: 00166 void playAlarmVideo(); 00173 void stopAlarmVideo(); 00182 void phononStateChange ( const Phonon::State newState, const Phonon::State oldState ); 00183 public: 00190 static Beedo& instance(); 00199 inline static void start() noexcept 00200 { 00201 Beedo::instance().start_internal(); 00202 } 00211 inline static void stop() noexcept 00212 { 00213 Beedo::instance().stop_internal(); 00214 } 00222 virtual ~Beedo(); 00229 Beedo ( const Beedo& other ) = delete; 00236 Beedo ( Beedo&& other ) = delete; 00244 Beedo& operator= ( const Beedo& other ) = delete; 00252 Beedo& operator= ( Beedo&& other ) = delete; 00259 void destroy(); 00260 signals: 00267 void signalPlay(); 00274 void signalStop(); 00275 }; 00276 00277 } 00278 00279 #endif // BEEDO_H