Commit a55f4315 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Stream can now be added to the media library

parent 8f63afd9
......@@ -35,7 +35,7 @@ GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) : m_clip( clip ), m_width( 0
QTime length = QTime().addMSecs( clip->getParent()->getLength() );
QString tooltip( tr( "<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2" )
.arg( clip->getParent()->getFileInfo()->fileName() )
.arg( clip->getParent()->getFileName() )
.arg( length.toString("hh:mm:ss.zzz") ) );
setToolTip( tooltip );
setAcceptHoverEvents( true );
......@@ -218,7 +218,7 @@ void GraphicsMovieItem::paintTitle( QPainter* painter, const QStyleOptionGraphic
// Initiate the font metrics calculation
QFontMetrics fm( painter->font() );
QString text = m_clip->getParent()->getFileInfo()->fileName();
QString text = m_clip->getParent()->getFileName();
// Get the transformations required to map the text on the viewport
QTransform viewPortTransform = Timeline::getInstance()->tracksView()->viewportTransform();
......
......@@ -118,7 +118,6 @@ void LibraryWidget::removeMedia( const QUuid& uuid )
void LibraryWidget::newClipLoaded( Clip* clip )
{
//From here, the clip is const.
addClip( clip );
m_ui.LibraryTabs->setCurrentIndex( (int) clip->getParent()->getFileType() );
}
......
......@@ -34,7 +34,7 @@ ListViewMediaItem::ListViewMediaItem( Clip* clip, Media::FileType fType, QListWi
setIcon( QIcon( ":/images/images/vlmc.png") );
m_truncatedName = clip->getParent()->getFileInfo()->baseName();
m_truncatedName = clip->getParent()->getFileName();
if ( m_truncatedName.length() > MAX_NAME_LENGTH )
{
m_truncatedName.truncate( MAX_NAME_LENGTH - 3 );
......@@ -46,7 +46,7 @@ ListViewMediaItem::ListViewMediaItem( Clip* clip, Media::FileType fType, QListWi
QTime length;
length = length.addSecs( m_clip->getLengthSecond() );
setToolTip( "Filename: " + m_clip->getParent()->getFileInfo()->fileName() + "\n" +
setToolTip( "Filename: " + clip->getParent()->getFileName() + "\n" +
"Length: " + length.toString() );
}
......
......@@ -84,6 +84,7 @@ void Library::newMediaLoadingAsked( const QString& filePath, const QStrin
bool Library::mediaAlreadyLoaded( const QString& filePath )
{
//FIXME: Is this necessary ??
Media* media;
foreach ( media, m_medias )
{
......
......@@ -53,6 +53,7 @@ Media::Media( const QString& filePath, const QString& uuid )
{
m_inputType = Media::File;
m_fileInfo = new QFileInfo( filePath );
m_fileName = m_fileInfo->fileName();
setFileType();
if ( m_fileType == Media::Video || m_fileType == Media::Audio )
m_mrl = "file:///" + m_fileInfo->absoluteFilePath();
......@@ -65,6 +66,8 @@ Media::Media( const QString& filePath, const QString& uuid )
m_mrl = filePath.right( filePath.length() - streamPrefix.length() );
//FIXME:
m_fileType = Media::Video;
m_fileName = m_mrl;
qDebug() << "Loading a stream";
}
m_vlcMedia = new LibVLCpp::Media( m_mrl );
}
......@@ -240,3 +243,13 @@ qint64 Media::getNbFrames() const
{
return m_nbFrames;
}
const QString& Media::getMrl() const
{
return m_mrl;
}
const QString& Media::getFileName() const
{
return m_fileName;
}
......@@ -92,6 +92,8 @@ public:
const QPixmap& getSnapshot() const;
const QFileInfo* getFileInfo() const;
const QString& getMrl() const;
const QString& getFileName() const;
/**
\return Returns the length of this media (ie the
......@@ -158,6 +160,7 @@ protected:
audioData m_audioData;
FileType m_fileType;
InputType m_inputType;
QString m_fileName;
signals:
void metaDataComputed();
......
......@@ -117,6 +117,7 @@ void TrackWorkflow::renderClip( ClipWorkflow* cw, qint64 currentFrame,
{
cw->getStateLock()->lockForRead();
qDebug() << "Rendering clip" << cw << "state:" << cw->getState();
if ( cw->getState() == ClipWorkflow::Rendering )
{
//The rendering state meens... whell it means that the frame is
......
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