Commit 55187257 authored by Ludovic Fauvet's avatar Ludovic Fauvet
Browse files

Cosmetic and comments

parent 138c8580
......@@ -31,10 +31,16 @@ MediaPlayer::MediaPlayer( Media* media, bool playStop /* = true*/ )
m_internalPtr = libvlc_media_player_new_from_media( media->getInternalPtr(), m_ex );
m_ex.checkThrow();
// Initialize the event manager
p_em = libvlc_media_player_event_manager( m_internalPtr, m_ex );
// Register the callback
libvlc_event_attach( p_em, libvlc_MediaPlayerSnapshotTaken, callbacks, this, m_ex );
}
/**
* Event dispatcher.
*/
void MediaPlayer::callbacks( const libvlc_event_t* event, void* ptr )
{
MediaPlayer* self = reinterpret_cast<MediaPlayer*>( ptr );
......
#include <QtDebug>
#include "Media.h"
Media::Media(LibVLCpp::Instance* instance, const QString& mrl ) : m_instance( NULL ), m_vlcMedia( NULL ), m_vlcMediaPlayer( NULL ),
m_mrl( mrl )
Media::Media(LibVLCpp::Instance* instance, const QString& mrl )
: m_instance( NULL ), m_vlcMedia( NULL ), m_vlcMediaPlayer( NULL ),
m_mrl( mrl )
{
if ( instance == NULL )
{
......
......@@ -29,9 +29,14 @@ QList<ListViewMediaItem*>* LibraryWidget::m_medias = NULL;
LibraryWidget::LibraryWidget( QWidget *parent ) : QWidget( parent )
{
m_ui.setupUi( this );
m_ui.listWidgetAudio->setType( ListViewMediaItem::Audio );
m_ui.listWidgetImage->setType( ListViewMediaItem::Image );
m_ui.listWidgetVideo->setType( ListViewMediaItem::Video );
// *Always* force the selection of the first tab
m_ui.LibraryTabs->setCurrentIndex( 0 );
if ( LibraryWidget::m_medias == NULL )
LibraryWidget::m_medias = new QList<ListViewMediaItem*>();
}
......@@ -93,7 +98,7 @@ ListViewMediaItem* LibraryWidget::insertNewMedia( QString fileNam
ListViewMediaItem* item = NULL;
foreach( item, *m_medias )
{
if (item->fileInfo()->absoluteFilePath() == fileName)
if ( item->fileInfo()->absoluteFilePath() == fileName )
return item;
}
QFileInfo* fileInfo = new QFileInfo( fileName );
......@@ -142,7 +147,7 @@ void LibraryWidget::on_pushButtonAddMedia_clicked()
void LibraryWidget::on_pushButtonRemoveMedia_clicked()
{
QListWidget* mediaList = ( QListWidget* )(this->m_ui.LibraryTabs->currentWidget()->children().back());
QListWidget* mediaList = ( QListWidget* )( this->m_ui.LibraryTabs->currentWidget()->children().back() );
ListViewMediaItem* item = ( ListViewMediaItem* ) mediaList->currentItem();
this->removeMedia( item );
}
......
......@@ -20,7 +20,7 @@
<enum>QTabWidget::East</enum>
</property>
<property name="currentIndex">
<number>2</number>
<number>0</number>
</property>
<property name="elideMode">
<enum>Qt::ElideNone</enum>
......
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