00001 #ifndef NOATUN_H 00002 #define NOATUN_H 00003 00004 #include <kuniqueapp.h> 00005 00006 class Playlist; 00007 class Player; 00008 class LibraryLoader; 00009 class KPopupMenu; 00010 class NoatunPreferences; 00011 class Downloader; 00012 class Effects; 00013 class EffectView; 00014 class Equalizer; 00015 class EqualizerView; 00016 00017 class NoatunApp : public KUniqueApplication 00018 { 00019 Q_OBJECT 00020 friend class Playlist; 00021 friend class KCrash; 00022 00023 public: 00024 NoatunApp(); 00025 ~NoatunApp(); 00026 00027 Playlist *playlist() const; 00028 Player *player() const { return mPlayer; } 00029 NoatunPreferences *preferencesBox() const { return mPref; } 00030 00031 /** 00032 * get a list of mimetypes aRts (noatun) can play, KFileDialog 00033 * accepts this instead of the shell globs in the static functions, 00034 * so there ya go :) 00035 **/ 00036 QString mimeTypes(); 00037 00038 LibraryLoader *libraryLoader() const { return mLibraryLoader; } 00039 Downloader *downloader() const { return mDownloader; } 00040 static QImage readPNG(const QString &filename); 00041 Effects *effects() const; 00042 ::Equalizer *equalizer() const { return mEqualizer; } 00043 EqualizerView *equalizerView() const { return mEqualizerView; } 00044 00045 QCString version() const; 00046 00047 virtual void commitData(QSessionManager &); 00048 virtual void saveState(QSessionManager &); 00049 00050 signals: 00051 /** 00052 * Tells you (a UI plugin) to hide 00053 */ 00054 void hideYourself(); 00055 00056 /** 00057 * Tells you (a UI plugin) to show again 00058 */ 00059 void showYourself(); 00060 00061 public slots: 00062 /** 00063 * ask the UIs to hide or show 00064 **/ 00065 void toggleInterfaces(); 00066 /** 00067 * ask the UIs to show 00068 **/ 00069 void showInterfaces(); 00070 /** 00071 * ask the playlists to hide, then you have 00072 * to look around for them, or you'll lose 00073 **/ 00074 void hideInterfaces(); 00075 00076 public: //options 00077 bool autoPlay() const; 00078 bool loopList() const; 00079 bool oneInstance() const; 00080 QString saveDirectory() const; 00081 bool clearOnOpen() const; 00082 bool hackUpPlaylist() const; 00083 bool fastMixer() const; 00084 QString titleFormat() const; 00085 00086 void setOneInstance(bool); 00087 void setLoopList(bool); 00088 void setAutoPlay(bool); 00089 void setSaveDirectory(const QString &); 00090 void setRememberPositions(bool); 00091 void setClearOnOpen(bool); 00092 void setHackUpPlaylist(bool); 00093 void setFastMixer(bool); 00094 void setTitleFormat(const QString &); 00095 00096 /** 00097 * Adds an item to the plugin menu. 00098 * You may use this value with pluginMenu() for greater control of your menu entry 00099 * 00100 * @return the ID associated with the menu item, for use in @ref contextMenuRemove() 00101 **/ 00102 int pluginMenuAdd(const QString &text, const QObject *receiver, const char *member); 00103 00104 /** 00105 * Removes an item previously added to the plugin menu. 00106 **/ 00107 void pluginMenuRemove(int id); 00108 00109 KPopupMenu *pluginMenu(void); 00110 00111 protected: 00112 virtual int newInstance(); 00113 00114 public slots: 00115 // slots for the contextMenu 00116 void preferences(); 00117 void quit(); 00118 void fileOpen(); 00119 void effectView(); 00120 void equalizerView(); 00121 00122 private: 00123 static void cleverKCrashHack(int); 00124 void loadPlugins(); 00125 00126 private: 00127 Player *mPlayer; 00128 LibraryLoader *mLibraryLoader; 00129 KPopupMenu *mPluginMenu; 00130 Downloader *mDownloader; 00131 Effects *mEffects; 00132 EffectView *mEffectView; 00133 NoatunPreferences *mPref; 00134 ::Equalizer *mEqualizer; 00135 EqualizerView *mEqualizerView; 00136 bool showingInterfaces; 00137 }; 00138 00139 #define napp (static_cast<NoatunApp*>(kapp)) 00140 00141 // version info for the plugins 00142 // this is MAJOR.MINOR.PATCHLEVEL 00143 // and you developers better ignore patchlevel :) 00144 #define NOATUN_MAJOR 2 00145 #define NOATUN_MINOR 0 00146 #define NOATUN_PATCHLEVEL 0 00147 00148 #define NOATUN_VERSION "2.0.0" 00149 00150 #endif
1.2.9.1 written by Dimitri van Heesch,
© 1997-2001