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() ...@@ -43,8 +43,7 @@ MediaPlayer::MediaPlayer()
libvlc_event_attach( p_em, libvlc_MediaPlayerStopped, callbacks, this, m_ex ); 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_MediaPlayerEndReached, callbacks, this, m_ex );
libvlc_event_attach( p_em, libvlc_MediaPlayerPositionChanged, 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 ) MediaPlayer::MediaPlayer( Media* media )
...@@ -92,13 +91,11 @@ void MediaPlayer::callbacks( const libvlc_event_t* ev ...@@ -92,13 +91,11 @@ void MediaPlayer::callbacks( const libvlc_event_t* ev
self->emit timeChanged(); self->emit timeChanged();
break; break;
case libvlc_MediaPlayerPositionChanged: case libvlc_MediaPlayerPositionChanged:
// qDebug() << "Position changed" << event->u.media_player_position_changed.new_position;
self->emit positionChanged(); self->emit positionChanged();
break; break;
//TODO: activate this when switching to VLC 1.1 case libvlc_MediaPlayerLengthChanged:
// case libvlc_MediaPlayerLengthChanged: self->emit lengthChanged();
// self->emit lengthChanged(); break;
// break;
case libvlc_MediaPlayerSnapshotTaken: case libvlc_MediaPlayerSnapshotTaken:
self->emit snapshotTaken(); self->emit snapshotTaken();
break; break;
......
...@@ -73,8 +73,7 @@ namespace LibVLCpp ...@@ -73,8 +73,7 @@ namespace LibVLCpp
void stopped(); void stopped();
void endReached(); void endReached();
void positionChanged(); void positionChanged();
//TODO: activate this when switching to VLC 1.1 void lengthChanged();
// void lengthChanged();
}; };
} }
......
...@@ -31,9 +31,8 @@ ...@@ -31,9 +31,8 @@
#include "MetaDataManager.h" #include "MetaDataManager.h"
#include "Library.h" #include "Library.h"
//TODO: change m_lengthHasChanged default value to false when switching to VLC 1.1
MetaDataManager::MetaDataManager() : m_renderWidget( NULL ), MetaDataManager::MetaDataManager() : m_renderWidget( NULL ),
m_mediaIsPlaying( false), m_lengthHasChanged( true ) m_mediaIsPlaying( false), m_lengthHasChanged( false )
{ {
m_mediaPlayer = new LibVLCpp::MediaPlayer(); m_mediaPlayer = new LibVLCpp::MediaPlayer();
connect( Library::getInstance(), SIGNAL( newMediaLoaded( Media* ) ),this, SLOT( newMediaLoaded( Media* ) ) ); connect( Library::getInstance(), SIGNAL( newMediaLoaded( Media* ) ),this, SLOT( newMediaLoaded( Media* ) ) );
...@@ -92,8 +91,7 @@ void MetaDataManager::computeVideoMetaData() ...@@ -92,8 +91,7 @@ void MetaDataManager::computeVideoMetaData()
//Disabling audio for this specific use of the media //Disabling audio for this specific use of the media
m_currentClip->addVolatileParam( ":no-audio", ":audio" ); 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() void MetaDataManager::computeImageMetaData()
...@@ -106,8 +104,7 @@ void MetaDataManager::getMetaData() ...@@ -106,8 +104,7 @@ void MetaDataManager::getMetaData()
{ {
m_mediaIsPlaying = false; m_mediaIsPlaying = false;
//TODO: restore this when VLC1.1 comes out. //TODO: restore this when VLC1.1 comes out.
// m_lengthHasChanged = false; m_lengthHasChanged = false;
m_lengthHasChanged = true;
m_nextMedia = true; m_nextMedia = true;
m_currentClip->setLength( m_mediaPlayer->getLength() ); m_currentClip->setLength( m_mediaPlayer->getLength() );
...@@ -169,7 +166,6 @@ void MetaDataManager::startAudioDataParsing() ...@@ -169,7 +166,6 @@ void MetaDataManager::startAudioDataParsing()
// disconnect( m_mediaPlayer, SIGNAL( stopped() ), this, SLOT( 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( osb, ":amem-opensb=%lld", (long long int)(intptr_t) &MetaDataManager::openSoundBuffer);
sprintf( psb, ":amem-playsb=%lld", (long long int)(intptr_t) &MetaDataManager::playSoundBuffer); sprintf( psb, ":amem-playsb=%lld", (long long int)(intptr_t) &MetaDataManager::playSoundBuffer);
sprintf( csb, ":amem-closesb=%lld", (long long int)(intptr_t) &MetaDataManager::closeSoundBuffer); 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