Commit ff71dbf3 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen
Browse files

Connect bug fixed. Added a tooltip with the basic video informations.

parent 8d5dab54
......@@ -55,9 +55,9 @@ void MetaDataManager::run()
m_currentClip->addParam( ":audio" );
m_mediaPlayer->setMedia( m_currentClip->getVLCMedia() );
m_mediaPlayer->play();
connect( m_mediaPlayer, SIGNAL( playing() ), this, SLOT( getMetaData() ) );
m_mediaPlayer->play();
qDebug() << "play asked";
}
usleep( 10000 );
}
......@@ -109,10 +109,9 @@ void MetaDataManager::setSnapshot()
//CHECKME:
//This is synchrone, but it may become asynchrone in the future...
//connect( m_mediaPlayer, SIGNAL( stopped() ), this, SLOT( startAudioDataParsing() ) );
qDebug() << "Stopping playback";
m_mediaPlayer->stop();
//startAudioDataParsing();
// startAudioDataParsing();
}
void MetaDataManager::startAudioDataParsing()
......@@ -148,12 +147,13 @@ void MetaDataManager::startAudioDataParsing()
void MetaDataManager::openSoundBuffer( void* datas, unsigned int* freq, unsigned int* nbChannels, unsigned int* fourCCFormat, unsigned int* frameSize )
{
qDebug() << "Opening sound buffer with freq =" << freq;
qDebug() << "Opening sound buffer with freq =" << *freq << "nbChannels =" << *nbChannels << "frameSize =" << *frameSize;
}
void MetaDataManager::playSoundBuffer( void* datas, unsigned char* buffer, size_t buffSize, unsigned int nbSample )
{
// qDebug() << "Playing sound buffer with nbSample =" << nbSample;
// qDebug() << "Playing sound buffer with nbSample =" << nbSample << "buffSize =" << buffSize;
// qDebug() << "Buff[0] = " << (unsigned int)buffer[0];
}
void MetaDataManager::closeSoundBuffer( void* datas )
......
......@@ -134,7 +134,7 @@ void LibraryWidget::insertNewMediasFromFileDialog( QString title, QString fil
foreach ( filePath, fileNames )
{
// item = insertNewMedia( fileName, filetype );
if( fileType == Library::Video )
// if( fileType == Library::Video )
emit newClipLoadingAsked( filePath );
}
// if ( item != NULL )
......
......@@ -46,33 +46,33 @@ public:
explicit LibraryWidget( QWidget *parent = 0 );
virtual ~LibraryWidget();
ListViewMediaItem* addMedia( const Clip* clip, Library::FileType fileType );
void removeMedia( const QUuid& uuid );
int getIndex( ListViewMediaItem* media );
ListViewMediaItem* addMedia( const Clip* clip, Library::FileType fileType );
void removeMedia( const QUuid& uuid );
int getIndex( ListViewMediaItem* media );
protected:
virtual void changeEvent( QEvent *e );
virtual void changeEvent( QEvent *e );
private:
ListViewMediaItem* insertNewMedia( QString filename, Library::FileType fileType );
void insertNewMediasFromFileDialog( QString title, QString filter, Library::FileType fileType );
ListViewMediaItem* insertNewMedia( QString filename, Library::FileType fileType );
void insertNewMediasFromFileDialog( QString title, QString filter, Library::FileType fileType );
Ui::LibraryWidget m_ui;
static QList<ListViewMediaItem*>* m_medias;
public slots:
void newClipLoaded( Clip* );
void clipRemoved( const QUuid& );
void newClipLoaded( Clip* );
void clipRemoved( const QUuid& );
private slots:
void on_pushButtonAddMedia_clicked();
void on_pushButtonRemoveMedia_clicked();
void on_pushButtonAddMedia_clicked();
void on_pushButtonRemoveMedia_clicked();
signals:
// void listViewMediaAdded(Clip* clip);
void newClipLoadingAsked( const QString& );
void removingClipAsked( const QUuid& );
void newClipLoadingAsked( const QString& );
void removingClipAsked( const QUuid& );
};
#endif /* !LIBRARYWIDGET_H */
......@@ -23,6 +23,7 @@
#include "ListViewMediaItem.h"
#include <QPixmap>
#include <QDebug>
#include <QTime>
ListViewMediaItem::ListViewMediaItem( const Clip* clip, Library::FileType fType, QListWidget* parent, int type ) :
QListWidgetItem( parent, type ), m_clip( clip )
......@@ -43,9 +44,22 @@ ListViewMediaItem::~ListViewMediaItem()
void ListViewMediaItem::snapshotChanged()
{
setIcon( QIcon( m_clip->getSnapshot() ) );
//this is a nasty patch for the moment :
//TODO: fix this !!!!
QTime length;
length = length.addSecs( m_clip->getLength() / 1000 );
qDebug() << m_clip->getLength();
qDebug() << length;
setToolTip( "Filename: " + m_clip->getFileInfo()->fileName() + "\n" +
"Length: " + length.toString() );
//"Length: " + length.toString("h 'h' m 'm' s 's'") );
}
const Clip* ListViewMediaItem::getClip() const
{
return m_clip;
}
......@@ -22,6 +22,7 @@
#include <QSvgRenderer>
#include <QPainter>
#include "MediaListWidget.h"
MediaListWidget::MediaListWidget( QWidget* parent ) : QListWidget( parent )
......
......@@ -38,7 +38,8 @@ class MediaListWidget : public QListWidget
Q_OBJECT
public:
MediaListWidget( QWidget* parent = 0 );
void setType( Library::FileType fileType );
void setType( Library::FileType fileType );
protected:
virtual void mousePressEvent( QMouseEvent* event );
virtual void mouseMoveEvent( QMouseEvent* event );
......
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