00001 /*************************************************************************** 00002 soundengine.h - description 00003 ------------------- 00004 begin : Sat Jul 27 2002 00005 copyright : (C) 2002 by Samuele Catuzzi 00006 email : samuele_catuzzi@yahoo.it 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 ***************************************************************************/ 00017 00018 /******************************************************************************** 00019 * * 00020 * This class is a remake of portions of software from kaboodle (class Engine) * 00021 * I report here noatun copyright notice and permission notice. * 00022 * Samuele Catuzzi * 00023 ********************************************************************************/ 00024 00025 /***************************************************************** 00026 00027 Copyright (c) 2000-2001 the noatun authors. See file NOATUN_AUTHORS. 00028 00029 Permission is hereby granted, free of charge, to any person obtaining a copy 00030 of this software and associated documentation files (the "Software"), to deal 00031 in the Software without restriction, including without limitation the rights 00032 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00033 copies of the Software, and to permit persons to whom the Software is 00034 furnished to do so, subject to the following conditions: 00035 00036 The above copyright notice and this permission notice shall be included in 00037 all copies or substantial portions of the Software. 00038 00039 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00040 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00041 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00042 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIAB\ILITY, WHETHER IN 00043 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 00044 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00045 00046 ******************************************************************/ 00047 00048 #ifndef SOUND_ENGINE_H 00049 #define SOUND_ENGINE_H 00050 00051 #include <kconfig.h> 00052 #include <kdebug.h> 00053 #include <klocale.h> 00054 #include <kmessagebox.h> 00055 #include <kmimetype.h> 00056 #include <kstandarddirs.h> 00057 #include <kurl.h> 00058 #include <qtimer.h> 00059 #include <qfile.h> 00060 #include <qdir.h> 00061 00062 #include <arts/connect.h> 00063 #include <arts/dynamicrequest.h> 00064 #include <arts/flowsystem.h> 00065 #include <arts/kartsdispatcher.h> 00066 #include <arts/kartsserver.h> 00067 #include <arts/kmedia2.h> 00068 #include <arts/kplayobjectfactory.h> 00069 #include <arts/soundserver.h> 00070 #include <qobject.h> 00071 #include <kurl.h> 00072 00073 namespace Arts 00074 { 00075 class PlayObject; 00076 class SoundServerV2; 00077 } 00078 00084 class SoundEngine : public QObject 00085 { 00086 Q_OBJECT 00087 00088 public: 00089 SoundEngine(QObject *parent=0); 00090 ~SoundEngine(); 00091 00092 enum EngineState { Stop, Play, Empty }; 00093 00094 public slots: 00098 bool load(const KURL &file); 00099 00103 void pause(); 00104 00108 void play(); 00109 00113 void stop(); 00114 00115 public: 00116 EngineState state(); 00117 00118 private: 00119 bool reload(void); 00120 bool m_needReload; 00121 KPlayObject *playobj; 00122 KArtsDispatcher dispatcher; 00123 KArtsServer server; 00124 KURL file; 00125 }; 00126 00127 #endif