Beispiel #1
0
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 );
}
Beispiel #2
0
/* add audio channel -> in libvlc it is track, it means audio in another
   language
 */
void VLCMediaController::audioChannelAdded( int id, const QString & lang )
{
	QHash<QByteArray, QVariant> properties;
	properties.insert( "name", lang );
	properties.insert( "description", "" );

	available_audio_channels << Phonon::AudioChannelDescription( id, properties );
	emit availableAudioChannelsChanged();
}
Beispiel #3
0
void MediaControllerPrivate::backendObjectChanged(QObject *m_backendObject)
{
    QObject::connect(m_backendObject, SIGNAL(availableSubtitlesChanged()), q, SIGNAL(availableSubtitlesChanged()));
    QObject::connect(m_backendObject, SIGNAL(availableAudioChannelsChanged()), q, SIGNAL(availableAudioChannelsChanged()));
    QObject::connect(m_backendObject, SIGNAL(titleChanged(int)), q, SIGNAL(titleChanged(int)));
    QObject::connect(m_backendObject, SIGNAL(availableTitlesChanged(int)), q, SIGNAL(availableTitlesChanged(int)));
    QObject::connect(m_backendObject, SIGNAL(chapterChanged(int)), q, SIGNAL(chapterChanged(int)));
    QObject::connect(m_backendObject, SIGNAL(availableChaptersChanged(int)), q, SIGNAL(availableChaptersChanged(int)));
    QObject::connect(m_backendObject, SIGNAL(angleChanged(int)), q, SIGNAL(angleChanged(int)));
    QObject::connect(m_backendObject, SIGNAL(availableAnglesChanged(int)), q, SIGNAL(availableAnglesChanged(int)));
}
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");
}