void VLCMediaController::clearMediaController() { current_audio_channel = Phonon::AudioChannelDescription(); available_audio_channels.clear(); current_subtitle = Phonon::SubtitleDescription(); available_subtitles.clear(); i_current_angle = 0; i_available_angles = 0; //current_chapter = Phonon::ChapterDescription(); //available_chapters.clear(); current_chapter = 0; available_chapters = 0; //current_title = Phonon::TitleDescription(); //available_titles.clear(); current_title = 0; available_titles = 0; b_autoplay_titles = false; emit availableAudioChannelsChanged(); emit availableSubtitlesChanged(); emit availableTitlesChanged( 0 ); emit availableChaptersChanged( 0 ); }
/* add chapter */ void VLCMediaController::chapterAdded( int titleId, const QString & name ) { //QHash<QByteArray, QVariant> properties; //properties.insert( "name", name ); //properties.insert( "description", "" ); //available_chapters << Phonon::ChapterDescription( titleId, properties ); available_chapters++; emit availableChaptersChanged( available_chapters ); }
VideoWindow::VideoWindow(QWidget * parent) : QMainWindow(parent) { setupUi(this); _mediaObject = new Phonon::MediaObject(this); _mediaObject->setTickInterval(1000); connect(_mediaObject, SIGNAL(tick(qint64)), SLOT(tick(qint64))); connect(_mediaObject, SIGNAL(totalTimeChanged(qint64)), SLOT(totalTimeChanged(qint64))); connect(_mediaObject, SIGNAL(stateChanged(Phonon::State, Phonon::State)), SLOT(stateChanged(Phonon::State, Phonon::State))); connect(_mediaObject, SIGNAL(metaDataChanged()), SLOT(metaDataChanged())); connect(_mediaObject, SIGNAL(currentSourceChanged(const Phonon::MediaSource &)), SLOT(sourceChanged(const Phonon::MediaSource &))); connect(_mediaObject, SIGNAL(aboutToFinish()), SLOT(aboutToFinish())); _mediaController = new Phonon::MediaController(_mediaObject); connect(_mediaController, SIGNAL(availableAudioChannelsChanged()), SLOT(availableAudioChannelsChanged())); connect(_mediaController, SIGNAL(availableSubtitlesChanged()), SLOT(availableSubtitlesChanged())); #ifdef NEW_TITLE_CHAPTER_HANDLING connect(_mediaController, SIGNAL(availableTitlesChanged()), SLOT(availableTitlesChanged())); connect(_mediaController, SIGNAL(availableChaptersChanged()), SLOT(availableChaptersChanged())); #else connect(_mediaController, SIGNAL(availableTitlesChanged(int)), SLOT(availableTitlesChanged())); connect(_mediaController, SIGNAL(availableChaptersChanged(int)), SLOT(availableChaptersChanged())); #endif //NEW_TITLE_CHAPTER_HANDLING connect(_mediaController, SIGNAL(availableAnglesChanged(int)), SLOT(availableAnglesChanged())); _videoWidget = new Phonon::VideoWidget(this); videoLayout->addWidget(_videoWidget); _videoWidget->setMinimumHeight(200); Phonon::createPath(_mediaObject, _videoWidget); _audioOutput = new Phonon::AudioOutput(Phonon::VideoCategory, this); Phonon::createPath(_mediaObject, _audioOutput); //actions connect connect(actionPlay, SIGNAL(triggered()), _mediaObject, SLOT(play())); connect(actionPause, SIGNAL(triggered()), _mediaObject, SLOT(pause())); connect(actionStop, SIGNAL(triggered()), _mediaObject, SLOT(stop())); connect(actionPlayDVD, SIGNAL(triggered()), SLOT(playDVD())); connect(actionOpenSubtitleFile, SIGNAL(triggered()), SLOT(openSubtitleFile())); connect(actionExit, SIGNAL(triggered()), _mediaObject, SLOT(stop())); connect(actionExit, SIGNAL(triggered()), SLOT(close())); //seekSlider _seekSlider = new Phonon::SeekSlider(); seekerLayout->insertWidget(0, _seekSlider); _seekSlider->setMediaObject(_mediaObject); //volumdeSlider _volumeSlider = new Phonon::VolumeSlider(); volumeLayout->insertWidget(0, _volumeSlider); _volumeSlider->setAudioOutput(_audioOutput); _volumeSlider->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum); //currentTimeLcdNumber currentTimeLcdNumber->display("00:00"); //totalTimeLcdNumber totalTimeLcdNumber->display("00:00"); }