Commit 8ecfa9be authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Media: Remove InputType. We don't support this and it clutters the code.

parent 82225c51
...@@ -238,7 +238,7 @@ ImportController::accept() ...@@ -238,7 +238,7 @@ ImportController::accept()
collapseAllButCurrentPath(); collapseAllButCurrentPath();
foreach ( Clip* clip, m_temporaryMedias->clips().values() ) foreach ( Clip* clip, m_temporaryMedias->clips().values() )
{ {
if ( clip->getMedia()->source()->length() == 0 && clip->getMedia()->inputType() == Media::File ) if ( clip->getMedia()->source()->length() == 0 )
invalidMedias = true; invalidMedias = true;
Library::getInstance()->addClip( clip ); Library::getInstance()->addClip( clip );
} }
...@@ -260,7 +260,7 @@ ImportController::handleInvalidMedias() ...@@ -260,7 +260,7 @@ ImportController::handleInvalidMedias()
{ {
foreach ( Clip* clip, m_temporaryMedias->clips().values() ) foreach ( Clip* clip, m_temporaryMedias->clips().values() )
{ {
if ( clip->getMedia()->source()->length() == 0 && clip->getMedia()->inputType() == Media::File ) if ( clip->getMedia()->source()->length() == 0 )
{ {
Transcoder *transcoder = new Transcoder( clip->getMedia() ); Transcoder *transcoder = new Transcoder( clip->getMedia() );
connect( transcoder, SIGNAL( done() ), transcoder, SLOT( deleteLater() ) ); connect( transcoder, SIGNAL( done() ), transcoder, SLOT( deleteLater() ) );
......
...@@ -106,19 +106,11 @@ Clip::lengthSecond() const ...@@ -106,19 +106,11 @@ Clip::lengthSecond() const
void void
Clip::computeLength() Clip::computeLength()
{ {
if ( m_media->inputType() == Media::File ) float fps = m_media->source()->fps();
{ if ( fps < 0.1f )
float fps = m_media->source()->fps(); fps = Clip::DefaultFPS;
if ( fps < 0.1f ) m_length = m_end - m_begin;
fps = Clip::DefaultFPS; m_lengthSeconds = qRound64( (float)m_length / fps );
m_length = m_end - m_begin;
m_lengthSeconds = qRound64( (float)m_length / fps );
}
else
{
m_length = 0;
m_lengthSeconds = 0;
}
} }
const QStringList& const QStringList&
......
...@@ -106,12 +106,6 @@ void Media::setFileType(Media::FileType type) ...@@ -106,12 +106,6 @@ void Media::setFileType(Media::FileType type)
m_fileType = type; m_fileType = type;
} }
Media::InputType
Media::inputType() const
{
return m_inputType;
}
void void
Media::setNbFrames( qint64 nbFrames ) Media::setNbFrames( qint64 nbFrames )
{ {
...@@ -187,7 +181,6 @@ Media::onMetaDataComputed() ...@@ -187,7 +181,6 @@ Media::onMetaDataComputed()
void void
Media::setFilePath( const QString &filePath ) Media::setFilePath( const QString &filePath )
{ {
m_inputType = Media::File;
if ( m_fileInfo ) if ( m_fileInfo )
delete m_fileInfo; delete m_fileInfo;
m_fileInfo = new QFileInfo( filePath ); m_fileInfo = new QFileInfo( filePath );
......
...@@ -66,11 +66,6 @@ public: ...@@ -66,11 +66,6 @@ public:
Video, Video,
Image Image
}; };
enum InputType
{
File,
Stream
};
static const QString VideoExtensions; static const QString VideoExtensions;
static const QString AudioExtensions; static const QString AudioExtensions;
static const QString ImageExtensions; static const QString ImageExtensions;
...@@ -98,8 +93,6 @@ public: ...@@ -98,8 +93,6 @@ public:
FileType fileType() const; FileType fileType() const;
void setFileType( FileType type ); void setFileType( FileType type );
InputType inputType() const;
Clip* baseClip() { return m_baseClip; } Clip* baseClip() { return m_baseClip; }
const Clip* baseClip() const { return m_baseClip; } const Clip* baseClip() const { return m_baseClip; }
void setBaseClip( Clip* clip ); void setBaseClip( Clip* clip );
...@@ -122,7 +115,6 @@ protected: ...@@ -122,7 +115,6 @@ protected:
QFileInfo* m_fileInfo; QFileInfo* m_fileInfo;
qint64 m_nbFrames; qint64 m_nbFrames;
FileType m_fileType; FileType m_fileType;
InputType m_inputType;
QString m_fileName; QString m_fileName;
Clip* m_baseClip; Clip* m_baseClip;
bool m_inWorkspace; bool m_inWorkspace;
......
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