Main Page | Class Hierarchy | Compound List | File List | Compound Members

MuvinoMain Class Reference

This class implements the application logic of the main GUI class MuvinoMainDlg. More...

#include <muvinomain.hpp>

Inherits MuvinoMainDlg.

List of all members.

Public Slots

virtual void fileNew ()
virtual void fileOpen ()
virtual void fileOpen (const QString &path)
virtual void fileLoadVideo ()
virtual void fileLoadVideo (const QString &path)
virtual void fileExit ()
virtual void fileSave ()
virtual void fileSaveAs ()
virtual void playerStart ()
virtual void playerStop ()
virtual void playerPlay ()
virtual void playerBack3s ()
virtual void setDisplayRateFromSlider (int value)
virtual void playerAudioStateChange (int state)
virtual void displayCurrentMediaTime (bool showSubSec=false)
 Display current media time in player and emit the currentMediaTimeEvent(const MP7Time &) signal.

void closeVideo ()
 Close the video loaded by loadVideo().

bool playVideo (const MP7Time &time=MP7Time())
 Start video play-back at a given absolute media time point.

virtual void treeViewSelectItem (QListViewItem *item)
 Tree view item was selected.

virtual void mp7DocModificationChange (bool m)
 Modification status of the MPEG-7 document has changed.

virtual void treeViewSetSelected (MP7ListViewItem *item)
 Set selected item.

void treeViewClicked (QListViewItem *item)
 Set the current tree view item and cause currentSlider to show the video segment containing the XML element item.

virtual void mp7ElementValueChange ()
void splitCurrentSegment ()
 Split current segment at current media time point.

void setTitleImage ()
 Set the MPEG-7 TitleImage descriptor of the current segment to the current video frame.


Signals

void currentMediaTimeEvent (const MP7Time &time)

Public Member Functions

bool loadVideo (const char *filename, const char *demuxDir, MP4Decoder::eColorSpace colorSpace)
 Initialize the adaptor chain and the video widget for play-back of an MP4 encoded video.

bool loadMP7Doc (const QString &filename)
 Load an MPEG-7 file in XML format.

int checkMP7DocWithVideo ()
 Check MPEG-7 document with loaded video.


Protected Member Functions

void setCaptionFromFile (const QString &file=QString::null, bool modified=false)
 Set the caption of this top-level widget according to the given filename.

virtual void closeEvent (QCloseEvent *e)
 Window close event handler.

void initMenuBar ()
void resetVideoDisplay ()
 Reset the video widget to its default settings.

void stopAudio ()
 Stop audio play-back.

void stopVideoAudio ()
 Stop video and audio play-back.

void pauseVideoAudio ()
 Pause video and audio play-back.

MP7Time videoDuration () const
 Return the duration of the loaded video.

MP7Time currentVideoTime () const
 Get current video media time stamp.

void setCurrentVideoTimeLabel (const MP7Time &time, bool showSubSec=false)
 Set the current media time label to the given value.

void setDisplayRateSlider (double rate)
 Set the display rate slider control to the given rate.

void initMP7TreeView ()
 Initialize the MPEG-7 tree view widget.

bool warnAndSaveMP7Doc ()
 Ask the user to save the current MPEG-7 document if it has been modified.

void createMP7Doc (const MP7Time &duration)
 Create new MPEG-7 document with one video segment of given duration.

void resetMP7ElementValue ()
 Reset the mp7ElementValue widget.

void disableMP7ElementValue (bool disable)
 Disable the mp7ElementValue widget.

void initSegmentNav ()
 Initialize the segmentNav widgets.

void resetSegmentNav ()
 Reset the segmentNav widgets to show default values.


Detailed Description

This class implements the application logic of the main GUI class MuvinoMainDlg.

The latter class has been generated using the Qt Designer.

Author:
Mario Taschwer


Member Function Documentation

int MuvinoMain::checkMP7DocWithVideo  ) 
 

Check MPEG-7 document with loaded video.

If no MPEG-7 document has been loaded, a new one with an appropriate Video descriptor will be created. In case of discrepancy, a warning dialog will be shown to the user which lets him choose between opening a different MPEG-7 document, creating a new one (which is instantly performed), or cancelling the operation (which is implemented by the caller of this function).

Returns:
0 if the current MPEG-7 document and the video are compatible.
1 if a new (compatible) MPEG-7 document has been created.
2 if the user chose to open a new MPEG-7 document.
3 if the user chose to cancel the operation.

void MuvinoMain::createMP7Doc const MP7Time duration  )  [protected]
 

Create new MPEG-7 document with one video segment of given duration.

The existing MPEG-7 document will be deleted without warning!

MP7Time MuvinoMain::currentVideoTime  )  const [protected]
 

Get current video media time stamp.

Returns a default MP7Time object if the time stamp cannot be determined.

bool MuvinoMain::loadMP7Doc const QString &  filename  ) 
 

Load an MPEG-7 file in XML format.

Returns:
true on success, false on error.

bool MuvinoMain::loadVideo const char *  filename,
const char *  demuxDir,
MP4Decoder::eColorSpace  colorSpace
 

Initialize the adaptor chain and the video widget for play-back of an MP4 encoded video.

The resolution (width, height) needs to match the dimensions of #videoWidget.

Parameters:
filename file name of MP4 encoded video.
demuxDir local directory where the demuxed elementary streams are to be stored.
colorSpace color space which the video should be converted to; must be one of: MP4Decoder::ColorSpaceGRAY8, MP4Decoder::ColorSpaceRGB24, MP4Decoder::ColorSpaceRGB32.
Returns:
true on success, false on error.
See also:
QLabelRenderer

virtual void MuvinoMain::mp7DocModificationChange bool  m  )  [virtual, slot]
 

Modification status of the MPEG-7 document has changed.

Parameters:
m true means modified.

void MuvinoMain::pauseVideoAudio  )  [protected]
 

Pause video and audio play-back.

The DataChannel threads will eventually terminate, leaving the input stream open. This function does not wait for the DataChannel threads to terminate.

bool MuvinoMain::playVideo const MP7Time time = MP7Time()  )  [slot]
 

Start video play-back at a given absolute media time point.

Parameters:
time media time point; an invalid (default) time point means "continue from current time point".
Returns:
true on success, false on error.
See also:
MP7Time::timePointIsValid()

void MuvinoMain::setCaptionFromFile const QString &  file = QString::null,
bool  modified = false
[protected]
 

Set the caption of this top-level widget according to the given filename.

Parameters:
file file name (may be full path name), the directory path will not be displayed.
modified if true, an asterisk will be displayed to indicate that the document has been modified.

void MuvinoMain::setCurrentVideoTimeLabel const MP7Time time,
bool  showSubSec = false
[protected]
 

Set the current media time label to the given value.

Parameters:
time media time point.
showSubSec determines whether sub-second fractions will be shown.

void MuvinoMain::setDisplayRateSlider double  rate  )  [protected]
 

Set the display rate slider control to the given rate.

See also:
#setDisplayRateFromSlider(int)

void MuvinoMain::splitCurrentSegment  )  [slot]
 

Split current segment at current media time point.

If there are child segments, the appropriate child segment will be splitted.

void MuvinoMain::stopAudio  )  [protected]
 

Stop audio play-back.

When this function returns, the audio DataChannel thread has terminated. Make sure that #globalTimer is not paused before calling this method.

void MuvinoMain::stopVideoAudio  )  [protected]
 

Stop video and audio play-back.

When this function returns, the video and audio DataChannel threads have terminated, and the input streams have been closed. Make sure that #globalTimer is not paused before calling this method.

void MuvinoMain::treeViewClicked QListViewItem *  item  )  [slot]
 

Set the current tree view item and cause currentSlider to show the video segment containing the XML element item.

Parameters:
item must actually be of type MP7ListViewItem *.

MP7Time MuvinoMain::videoDuration  )  const [protected]
 

Return the duration of the loaded video.

If no video is loaded, a null time will be returned.

bool MuvinoMain::warnAndSaveMP7Doc  )  [protected]
 

Ask the user to save the current MPEG-7 document if it has been modified.

Save the document if the user chose to do so. A message box with 3 buttons will be displayed: Save, Discard, and Cancel.

Returns:
false if the user chose to cancel the operation; true otherwise.


The documentation for this class was generated from the following file:
Generated on Mon Sep 27 09:12:05 2004 for Muvino by doxygen 1.3.2