Commit 8a03a261 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Reactivating length change event for MetaDataManager

parent d07133d8
......@@ -43,8 +43,7 @@ MediaPlayer::MediaPlayer()
libvlc_event_attach( p_em, libvlc_MediaPlayerStopped, callbacks, this, m_ex );
libvlc_event_attach( p_em, libvlc_MediaPlayerEndReached, callbacks, this, m_ex );
libvlc_event_attach( p_em, libvlc_MediaPlayerPositionChanged, callbacks, this, m_ex );
//TODO: activate this when switching to vlc 1.1
// libvlc_event_attach( p_em, libvlc_MediaPlayerLengthChanged, callbacks,this,m_ex );
libvlc_event_attach( p_em, libvlc_MediaPlayerLengthChanged, callbacks,this,m_ex );
}
MediaPlayer::MediaPlayer( Media* media )
......@@ -92,13 +91,11 @@ void MediaPlayer::callbacks( const libvlc_event_t* ev
self->emit timeChanged();
break;
case libvlc_MediaPlayerPositionChanged:
// qDebug() << "Position changed" << event->u.media_player_position_changed.new_position;
self->emit positionChanged();
break;
//TODO: activate this when switching to VLC 1.1
// case libvlc_MediaPlayerLengthChanged:
// self->emit lengthChanged();
// break;
case libvlc_MediaPlayerLengthChanged:
self->emit lengthChanged();
break;
case libvlc_MediaPlayerSnapshotTaken:
self->emit snapshotTaken();
break;
......
......@@ -73,8 +73,7 @@ namespace LibVLCpp
void stopped();
void endReached();
void positionChanged();
//TODO: activate this when switching to VLC 1.1
// void lengthChanged();
void lengthChanged();
};
}
......
......@@ -31,9 +31,8 @@
#include "MetaDataManager.h"
#include "Library.h"
//TODO: change m_lengthHasChanged default value to false when switching to VLC 1.1
MetaDataManager::MetaDataManager() : m_renderWidget( NULL ),
m_mediaIsPlaying( false), m_lengthHasChanged( true )
m_mediaIsPlaying( false), m_lengthHasChanged( false )
{
m_mediaPlayer = new LibVLCpp::MediaPlayer();
connect( Library::getInstance(), SIGNAL( newMediaLoaded( Media* ) ),this, SLOT( newMediaLoaded( Media* ) ) );
......@@ -92,8 +91,7 @@ void MetaDataManager::computeVideoMetaData()
//Disabling audio for this specific use of the media
m_currentClip->addVolatileParam( ":no-audio", ":audio" );
//TODO: activate this when switching to VLC 1.1
// connect( m_mediaPlayer, SIGNAL( lengthChanged() ), this, SLOT( entrypointLengthChanged() ) );
connect( m_mediaPlayer, SIGNAL( lengthChanged() ), this, SLOT( entrypointLengthChanged() ) );
}
void MetaDataManager::computeImageMetaData()
......@@ -106,8 +104,7 @@ void MetaDataManager::getMetaData()
{
m_mediaIsPlaying = false;
//TODO: restore this when VLC1.1 comes out.
// m_lengthHasChanged = false;
m_lengthHasChanged = true;
m_lengthHasChanged = false;
m_nextMedia = true;
m_currentClip->setLength( m_mediaPlayer->getLength() );
......@@ -169,7 +166,6 @@ void MetaDataManager::startAudioDataParsing()
// disconnect( m_mediaPlayer, SIGNAL( stopped() ), this, SLOT( startAudioDataParsing() ) );
//Deactivating video, so that real time doesn't matter
sprintf( osb, ":amem-opensb=%lld", (long long int)(intptr_t) &MetaDataManager::openSoundBuffer);
sprintf( psb, ":amem-playsb=%lld", (long long int)(intptr_t) &MetaDataManager::playSoundBuffer);
sprintf( csb, ":amem-closesb=%lld", (long long int)(intptr_t) &MetaDataManager::closeSoundBuffer);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment