00001 #ifndef DATABASEBOX_H_ 00002 #define DATABASEBOX_H_ 00003 00004 #include <qwidget.h> 00005 #include <qdialog.h> 00006 #include <qstringlist.h> 00007 #include <qthread.h> 00008 #include <qtimer.h> 00009 #include <qptrlist.h> 00010 00011 #include "metadata.h" 00012 #include "playlist.h" 00013 #include <mythtv/mythwidgets.h> 00014 #include <mythtv/lcddevice.h> 00015 #include <mythtv/uilistbtntype.h> 00016 00017 class TreeCheckItem; 00018 00019 class ReadCDThread : public QThread 00020 { 00021 public: 00022 00023 ReadCDThread(const QString &dev); 00024 virtual void run(); 00025 bool statusChanged(){return cd_status_changed;} 00026 QMutex *getLock(){return &music_lock;} 00027 00028 private: 00029 00030 QString m_CDdevice; 00031 bool cd_status_changed; 00032 QMutex music_lock; 00033 }; 00034 00035 class DatabaseBox : public MythThemedDialog 00036 { 00037 Q_OBJECT 00038 public: 00039 DatabaseBox(MythMainWindow *parent, 00040 const QString dev, const QString &window_name, 00041 const QString &theme_filename, const char *name = 0); 00042 ~DatabaseBox(); 00043 00044 void dealWithTracks(PlaylistItem *item_ptr); 00045 void setCDTitle(const QString& title); 00046 void fillCD(void); 00047 00048 protected slots: 00049 void selected(UIListGenericTree *); 00050 void entered(UIListTreeType *, UIListGenericTree *); 00051 void doMenus(UIListGenericTree *); 00052 void alternateDoMenus(UIListGenericTree *, int); 00053 void keyPressEvent(QKeyEvent *e); 00054 void moveHeldUpDown(bool flag); 00055 void deleteTrack(UIListGenericTree *item); 00056 void copyNewPlaylist(); 00057 void copyToActive(); 00058 void deletePlaylist(); 00059 void renamePlaylist(); 00060 void popBackPlaylist(); 00061 void clearActive(); 00062 void closeActivePopup(); 00063 void closePlaylistPopup(); 00064 void occasionallyCheckCD(); 00065 void keepFilling(); 00066 void showWaiting(); 00067 00068 void ErrorPopup(const QString &msg); 00069 void closeErrorPopup(); 00070 00071 void CreateCDAudio(); 00072 void CreateCDMP3(); 00073 void BlankCDRW(); 00074 00075 private: 00076 void doSelected(UIListGenericTree *, bool cd_flag); 00077 void doPlaylistPopup(TreeCheckItem *item_ptr); 00078 void doActivePopup(PlaylistTitle *item_ptr); 00079 void checkParent(UIListGenericTree *); 00080 00081 void checkTree(UIListGenericTree *startingpoint = NULL); 00082 QPixmap getPixmap(QString &level); 00083 00084 UIListGenericTree *rootNode; 00085 UIListTreeType *tree; 00086 00087 CDCheckItem *cditem; 00088 00089 QString m_CDdevice; 00090 bool holding_track; 00091 PlaylistTrack *track_held; 00092 TreeCheckItem *allmusic; 00093 TreeCheckItem *alllists; 00094 PlaylistTitle *allcurrent; 00095 Playlist *active_playlist; 00096 00097 MythPopupBox *active_popup; 00098 MythRemoteLineEdit *active_pl_edit; 00099 00100 MythPopupBox *playlist_popup; 00101 MythRemoteLineEdit *playlist_rename; 00102 00103 MythPopupBox *error_popup; 00104 00105 ReadCDThread *cd_reader_thread; 00106 QTimer *cd_watcher; 00107 bool cd_checking_flag; 00108 00109 QTimer *fill_list_timer; 00110 int wait_counter; 00111 int numb_wait_dots; 00112 00113 QStringList treelevels; 00114 00115 QPtrList<UITextType> m_lines; 00116 }; 00117 00118 #endif
1.5.5