00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #ifndef MUVINOMAIN_H
00037 #define MUVINOMAIN_H
00038
00137 #include <DataChannel.hpp>
00138 #include <ReferenceCounter.hpp>
00139 #include <adaptors/MP4Decoder.hpp>
00140
00141 #include "muvinomaindlg.hpp"
00142 #include "MP7Doc.hpp"
00143 #include "MP7Time.hpp"
00144
00145 class QApplication;
00146 class QTimer;
00147 class GlobalTimer;
00148 class ESSynchronizer;
00149 class SegmentSlider;
00150
00158 class MuvinoMain : public MuvinoMainDlg {
00159 Q_OBJECT
00160
00161 public:
00162 MuvinoMain();
00163 ~MuvinoMain();
00164
00165 protected:
00172 void setCaptionFromFile(const QString &file = QString::null, bool modified = false);
00173
00174
00175
00177 virtual void closeEvent(QCloseEvent * e);
00178
00179
00180
00181 public slots:
00182 virtual void fileNew();
00183 virtual void fileOpen();
00184 virtual void fileOpen(const QString &path);
00185 virtual void fileLoadVideo();
00186 virtual void fileLoadVideo(const QString &path);
00187 virtual void fileExit();
00188 virtual void fileSave();
00189 virtual void fileSaveAs();
00190
00191 protected:
00192 void initMenuBar();
00193
00194
00195
00196 public:
00212 bool loadVideo(const char *filename, const char *demuxDir,
00213 MP4Decoder::eColorSpace colorSpace);
00214
00215 public slots:
00216 virtual void playerStart();
00217 virtual void playerStop();
00218 virtual void playerPlay();
00219 virtual void playerBack3s();
00220 virtual void setDisplayRateFromSlider(int value);
00221 virtual void playerAudioStateChange(int state);
00222
00226 virtual void displayCurrentMediaTime(bool showSubSec = false);
00227
00231 void closeVideo();
00232
00241 bool playVideo(const MP7Time &time = MP7Time());
00242
00243 signals:
00244 void currentMediaTimeEvent(const MP7Time &time);
00245
00246 protected:
00250 void resetVideoDisplay();
00251
00257 void stopAudio();
00258
00264 void stopVideoAudio();
00265
00270 void pauseVideoAudio();
00271
00275 MP7Time videoDuration() const;
00276
00281 MP7Time currentVideoTime() const;
00282
00288 void setCurrentVideoTimeLabel(const MP7Time &time, bool showSubSec = false);
00289
00293 void setDisplayRateSlider(double rate);
00294
00295
00296
00297 public:
00302 bool loadMP7Doc(const QString &filename);
00303
00316 int checkMP7DocWithVideo();
00317
00318 public slots:
00320 virtual void treeViewSelectItem(QListViewItem *item);
00321
00325 virtual void mp7DocModificationChange(bool m);
00326
00328 virtual void treeViewSetSelected(MP7ListViewItem *item);
00329
00334 void treeViewClicked(QListViewItem *item);
00335
00336 protected:
00338 void initMP7TreeView();
00339
00347 bool warnAndSaveMP7Doc();
00348
00352 void createMP7Doc(const MP7Time &duration);
00353
00354
00355
00356 public slots:
00357 virtual void mp7ElementValueChange();
00358
00359 protected:
00361 void resetMP7ElementValue();
00362
00364 void disableMP7ElementValue(bool disable);
00365
00366
00367
00368 public slots:
00373 void splitCurrentSegment();
00374
00378 void setTitleImage();
00379
00380 protected:
00382 void initSegmentNav();
00383
00385 void resetSegmentNav();
00386
00387
00388
00389 private:
00391 static const QString caption;
00392
00394 DataChannel *videoDC;
00395
00397 DataChannel *audioDC;
00398
00400 GlobalTimer *globalTimer;
00401
00403 ReferenceCounter *globalTimerRefCnt;
00404
00406 ESSynchronizer *essync;
00407
00409 QTimer *mediaTimeUpdater;
00410
00412 MP7Doc *doc;
00413
00415 MP7ListViewItem *currentMP7Item;
00416
00418 SegmentSlider *currentSlider;
00419
00421 SegmentSlider *totalSlider;
00422 };
00423
00424 #endif