Commit bf05f834 authored by luyikei's avatar luyikei Committed by Hugo Beauzée-Luyssen

Clip: Don't use "get" prefix

Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent e9d23106
......@@ -41,9 +41,9 @@ ClipProperty::ClipProperty( Clip* clip, QWidget *parent ) :
connect( this, SIGNAL( accepted() ), this, SLOT( deleteLater() ) );
connect( this, SIGNAL( rejected() ), this, SLOT( deleteLater() ) );
setWindowTitle( m_clip->getMedia()->fileInfo()->fileName() + " " + tr( "properties" ) );
setWindowTitle( m_clip->media()->fileInfo()->fileName() + " " + tr( "properties" ) );
//Snapshot
ui->snapshotLabel->setPixmap( m_clip->getMedia()->snapshot().scaled( 128, 128, Qt::KeepAspectRatio ) );
ui->snapshotLabel->setPixmap( m_clip->media()->snapshot().scaled( 128, 128, Qt::KeepAspectRatio ) );
//Metatags
const QPushButton* button = ui->buttonBox->button( QDialogButtonBox::Apply );
Q_ASSERT( button != nullptr);
......
......@@ -236,7 +236,7 @@ ImportController::accept()
collapseAllButCurrentPath();
foreach ( Clip* clip, m_temporaryMedias->clips().values() )
{
if ( clip->getMedia()->source()->length() == 0 )
if ( clip->media()->source()->length() == 0 )
invalidMedias = true;
Core::instance()->library()->addClip( clip );
}
......@@ -258,9 +258,9 @@ ImportController::handleInvalidMedias()
{
foreach ( Clip* clip, m_temporaryMedias->clips().values() )
{
if ( clip->getMedia()->source()->length() == 0 )
if ( clip->media()->source()->length() == 0 )
{
Transcoder *transcoder = new Transcoder( clip->getMedia() );
Transcoder *transcoder = new Transcoder( clip->media() );
connect( transcoder, SIGNAL( done() ), transcoder, SLOT( deleteLater() ) );
transcoder->transcodeToPs();
}
......
......@@ -68,7 +68,7 @@ TagWidget::clipSelected( Clip* clip )
else
static_cast<QPushButton*>(m_buttonList[i])->setChecked( false );
}
connect( clip->getMedia(), SIGNAL( metaDataComputed( const Media* ) ),
connect( clip->media(), SIGNAL( metaDataComputed( const Media* ) ),
this, SLOT( setMetaTags() ) );
connect( clip, SIGNAL( destroyed() ), this, SLOT( clipDestroyed() ) );
}
......
......@@ -65,20 +65,20 @@ MediaCellView::MediaCellView( Clip* clip, QWidget *parent ) :
m_ui->clipCountLabel->hide();
m_ui->arrow->hide();
}
if ( clip->getMedia()->source()->isParsed() == false )
if ( clip->media()->source()->isParsed() == false )
{
m_ui->thumbnail->setEnabled( false );
connect( MetaDataManager::instance(), SIGNAL( startingComputing( const Media* )),
this, SLOT( metadataComputingStarted( const Media* ) ), Qt::DirectConnection );
}
connect( clip->getMedia(), SIGNAL( metaDataComputed() ),
connect( clip->media(), SIGNAL( metaDataComputed() ),
this, SLOT( metadataUpdated() ) );
// Snapshot generation will generate a QPixmap, which has to be done on GUI thread
connect( clip->getMedia(), SIGNAL( snapshotAvailable() ),
connect( clip->media(), SIGNAL( snapshotAvailable() ),
this, SLOT( snapshotUpdated() ), Qt::QueuedConnection );
setThumbnail( clip->getMedia()->snapshot() );
setTitle( clip->getMedia()->fileName() );
setThumbnail( clip->media()->snapshot() );
setTitle( clip->media()->fileName() );
setLength( clip->lengthSecond() * 1000 );
}
......@@ -90,7 +90,7 @@ MediaCellView::~MediaCellView()
void
MediaCellView::metadataComputingStarted( const Media *media )
{
if ( media != m_clip->getMedia() )
if ( media != m_clip->media() )
return ;
//Disable the delete button to avoid deleting the media while metadata are computed.
m_ui->delLabel->setEnabled( false );
......@@ -102,18 +102,18 @@ MediaCellView::metadataComputingStarted( const Media *media )
void
MediaCellView::metadataUpdated()
{
setLength( m_clip->getMedia()->source()->length() );
setLength( m_clip->media()->source()->length() );
m_ui->thumbnail->setEnabled( true );
//If the media is a Video or an Image, we must wait for the snapshot to be computer
//before allowing deletion.
if ( m_clip->getMedia()->fileType() == Media::Audio )
if ( m_clip->media()->fileType() == Media::Audio )
m_ui->delLabel->setEnabled( true );
}
void
MediaCellView::snapshotUpdated()
{
setThumbnail( m_clip->getMedia()->snapshot() );
setThumbnail( m_clip->media()->snapshot() );
m_ui->delLabel->setEnabled( true );
}
......@@ -147,7 +147,7 @@ MediaCellView::nbClipUpdated()
if ( m_clip->isRootClip() == true )
nbClips = m_clip->mediaContainer()->count();
else
nbClips = m_clip->getParent()->mediaContainer()->count();
nbClips = m_clip->parent()->mediaContainer()->count();
if ( nbClips == 0 )
{
......@@ -222,7 +222,7 @@ MediaCellView::mouseMoveEvent( QMouseEvent* event )
mimeData->setData( "vlmc/uuid", m_clip->uuid().toString().toLatin1() );
QDrag* drag = new QDrag( this );
drag->setMimeData( mimeData );
Media* parent = m_clip->getMedia();
Media* parent = m_clip->media();
drag->setPixmap( parent->snapshot().scaled( 100, 100, Qt::KeepAspectRatio ) );
drag->exec( Qt::CopyAction | Qt::MoveAction, Qt::CopyAction );
}
......@@ -294,7 +294,7 @@ MediaCellView::contextMenuEvent( QContextMenuEvent *event )
return ;
if ( copyInWorkspace == selectedAction )
{
if ( Core::instance()->workspace()->copyToWorkspace( m_clip->getMedia() ) == false )
if ( Core::instance()->workspace()->copyToWorkspace( m_clip->media() ) == false )
{
QMessageBox::warning( nullptr, tr( "Can't copy to workspace" ),
tr( "Can't copy this media to workspace: %1" ).arg( Core::instance()->workspace()->lastError() ) );
......
......@@ -123,7 +123,7 @@ MediaLibrary::viewChanged( ViewController *view )
bool
MediaLibrary::filterByName( const Clip *clip, const QString &filter )
{
return ( clip->getMedia()->fileName().contains( filter, Qt::CaseInsensitive ) );
return ( clip->media()->fileName().contains( filter, Qt::CaseInsensitive ) );
}
bool
......
......@@ -98,7 +98,7 @@ ClipMetadataDisplayer::setWatchedClip( const Clip *clip )
disconnect( m_watchedClip );
m_watchedClip = clip;
m_watchedMedia = clip->getMedia();
m_watchedMedia = clip->media();
connect( m_watchedClip, SIGNAL( unloaded( Clip* ) ), this, SLOT( clipDestroyed( Clip* ) ) );
if ( m_watchedMedia->source()->isParsed() == true )
metadataUpdated();
......
......@@ -201,7 +201,7 @@ AbstractGraphicsMediaItem::setEmphasized( bool value )
bool
AbstractGraphicsMediaItem::hasResizeBoundaries() const
{
return ( clipHelper()->clip()->getMedia()->fileType() != Media::Image );
return ( clipHelper()->clip()->media()->fileType() != Media::Image );
}
qint64
......
......@@ -38,10 +38,10 @@
GraphicsAudioItem::GraphicsAudioItem( Clip* clip ) :
AbstractGraphicsMediaItem( clip )
{
QTime length = QTime().addMSecs( clip->getMedia()->source()->length() );
QTime length = QTime().addMSecs( clip->media()->source()->length() );
QString tooltip( tr( "<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2" )
.arg( clip->getMedia()->fileName() )
.arg( clip->media()->fileName() )
.arg( length.toString("hh:mm:ss.zzz") ) );
setToolTip( tooltip );
}
......@@ -51,10 +51,10 @@ GraphicsAudioItem::GraphicsAudioItem( ClipHelper* ch ) :
{
setFlags( QGraphicsItem::ItemIsSelectable );
QTime length = QTime().addMSecs( ch->clip()->getMedia()->source()->length() );
QTime length = QTime().addMSecs( ch->clip()->media()->source()->length() );
QString tooltip( tr( "<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2" )
.arg( ch->clip()->getMedia()->fileName() )
.arg( ch->clip()->media()->fileName() )
.arg( length.toString("hh:mm:ss.zzz") ) );
setToolTip( tooltip );
setAcceptHoverEvents( true );
......@@ -171,7 +171,7 @@ GraphicsAudioItem::paintTitle( QPainter* painter, const QStyleOptionGraphicsItem
// Initiate the font metrics calculation
QFontMetrics fm( painter->font() );
QString text = m_clipHelper->clip()->getMedia()->fileName();
QString text = m_clipHelper->clip()->media()->fileName();
// Get the transformations required to map the text on the viewport
QTransform viewPortTransform = Timeline::instance()->tracksView()->viewportTransform();
......
......@@ -37,10 +37,10 @@
GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) :
AbstractGraphicsMediaItem( clip )
{
QTime length = QTime().addMSecs( clip->getMedia()->source()->length() );
QTime length = QTime().addMSecs( clip->media()->source()->length() );
QString tooltip( tr( "<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2" )
.arg( clip->getMedia()->fileName() )
.arg( clip->media()->fileName() )
.arg( length.toString("hh:mm:ss.zzz") ) );
setToolTip( tooltip );
}
......@@ -48,10 +48,10 @@ GraphicsMovieItem::GraphicsMovieItem( Clip* clip ) :
GraphicsMovieItem::GraphicsMovieItem( ClipHelper* ch ) :
AbstractGraphicsMediaItem( ch )
{
QTime length = QTime().addMSecs( ch->clip()->getMedia()->source()->length() );
QTime length = QTime().addMSecs( ch->clip()->media()->source()->length() );
QString tooltip( tr( "<p style='white-space:pre'><b>Name:</b> %1"
"<br><b>Length:</b> %2" )
.arg( ch->clip()->getMedia()->fileName() )
.arg( ch->clip()->media()->fileName() )
.arg( length.toString("hh:mm:ss.zzz") ) );
setToolTip( tooltip );
}
......@@ -165,7 +165,7 @@ GraphicsMovieItem::paintTitle( QPainter* painter, const QStyleOptionGraphicsItem
// Initiate the font metrics calculation
QFontMetrics fm( painter->font() );
QString text = m_clipHelper->clip()->getMedia()->fileName();
QString text = m_clipHelper->clip()->media()->fileName();
// Get the transformations required to map the text on the viewport
QTransform viewPortTransform = Timeline::instance()->tracksView()->viewportTransform();
......
......@@ -378,8 +378,8 @@ TracksView::clipDragEnterEvent( QDragEnterEvent *event )
Clip *clip = Core::instance()->library()->clip( fullId );
if ( clip == nullptr )
return;
bool hasVideo = clip->getMedia()->source()->hasVideo();
bool hasAudio = clip->getMedia()->source()->hasAudio();
bool hasVideo = clip->media()->source()->hasVideo();
bool hasAudio = clip->media()->source()->hasAudio();
if ( hasAudio == false && hasVideo == false )
return ;
......
......@@ -124,7 +124,7 @@ Library::addClip( Clip *clip )
bool ret = MediaContainer::addClip( clip );
if ( ret != false )
setCleanState( false );
m_medias[clip->getMedia()->fileInfo()->absoluteFilePath()] = clip->getMedia();
m_medias[clip->media()->fileInfo()->absoluteFilePath()] = clip->media();
return ret;
}
......
......@@ -84,7 +84,7 @@ MediaContainer::addMedia( const QFileInfo& fileInfo )
}
foreach( Clip* it, m_clips.values() )
{
if ( (*it->getMedia()->fileInfo()) == fileInfo )
if ( (*it->media()->fileInfo()) == fileInfo )
{
vlmcWarning() << "Ignoring aleady imported media" << fileInfo.absolutePath();
return nullptr;
......@@ -99,7 +99,7 @@ MediaContainer::mediaAlreadyLoaded( const QFileInfo& fileInfo )
{
foreach( Clip* clip, m_clips.values() )
{
if ( clip->getMedia()->fileInfo()->filePath() == fileInfo.filePath() )
if ( clip->media()->fileInfo()->filePath() == fileInfo.filePath() )
return true;
}
return false;
......@@ -111,7 +111,7 @@ MediaContainer::addClip( Clip* clip )
foreach ( Clip* c, m_clips.values() )
{
if ( clip->uuid() == c->uuid() ||
( clip->getMedia()->fileInfo() == c->getMedia()->fileInfo() &&
( clip->media()->fileInfo() == c->media()->fileInfo() &&
( clip->begin() == c->begin() && clip->end() == c->end() ) ) )
{
vlmcWarning() << "Clip already loaded.";
......
......@@ -55,7 +55,7 @@ Clip::Clip( Media *media, qint64 begin /*= 0*/, qint64 end /*= -1*/, const QStri
Clip::Clip( Clip *parent, qint64 begin /*= -1*/, qint64 end /*= -1*/,
const QString &uuid /*= QString()*/ ) :
m_media( parent->getMedia() ),
m_media( parent->media() ),
m_begin( begin ),
m_end( end ),
m_rootClip( parent->rootClip() ),
......@@ -82,13 +82,13 @@ Clip::~Clip()
}
Media*
Clip::getMedia()
Clip::media()
{
return m_media;
}
const Media*
Clip::getMedia() const
Clip::media() const
{
return m_media;
}
......@@ -183,13 +183,13 @@ Clip::isRootClip() const
}
Clip*
Clip::getParent()
Clip::parent()
{
return m_parent;
}
const Clip*
Clip::getParent() const
Clip::parent() const
{
return m_parent;
}
......
......@@ -93,11 +93,11 @@ class Clip : public QObject
/**
\return Returns the Media that the clip was basep uppon.
*/
Media* getMedia();
const Media* getMedia() const;
Media* media();
const Media* media() const;
Clip *getParent();
const Clip *getParent() const;
Clip *parent();
const Clip *parent() const;
MediaContainer* mediaContainer();
const MediaContainer* mediaContainer() const;
......
......@@ -118,9 +118,9 @@ Workspace::clipLoaded( Clip *clip )
if ( clip->isRootClip() == false )
return ;
//If already in workspace : well...
if ( isInWorkspace( clip->getMedia() ) == true )
if ( isInWorkspace( clip->media() ) == true )
return ;
copyToWorkspace( clip->getMedia() );
copyToWorkspace( clip->media() );
}
void
......
......@@ -88,7 +88,7 @@ ClipRenderer::startPreview()
updateInfos( m_selectedClip );
delete m_sourceRenderer;
m_sourceRenderer = m_selectedClip->getMedia()->source()->createRenderer( m_eventWatcher );
m_sourceRenderer = m_selectedClip->media()->source()->createRenderer( m_eventWatcher );
m_sourceRenderer->setOutputWidget( (void *) static_cast< RenderWidget* >( m_renderWidget )->id() );
connect( m_eventWatcher, SIGNAL( stopped() ), this, SLOT( videoStopped() ) );
......@@ -100,7 +100,7 @@ ClipRenderer::startPreview()
connect( m_eventWatcher, SIGNAL( timeChanged( qint64 ) ), this, SLOT( timeChanged( qint64 ) ) );
m_sourceRenderer->start();
m_sourceRenderer->setPosition( (float)m_begin / (float)m_selectedClip->getMedia()->source()->nbFrames() );
m_sourceRenderer->setPosition( (float)m_begin / (float)m_selectedClip->media()->source()->nbFrames() );
m_clipLoaded = true;
m_isRendering = true;
m_paused = false;
......@@ -175,7 +175,7 @@ ClipRenderer::previousFrame()
Q_ASSERT( m_paused == true );
}
/* FIXME: Implement a better way to render previous frame */
qint64 interval = static_cast<qint64>( qCeil(1000.0f * 2.0f / m_selectedClip->getMedia()->source()->fps() ) );
qint64 interval = static_cast<qint64>( qCeil(1000.0f * 2.0f / m_selectedClip->media()->source()->fps() ) );
m_sourceRenderer->setTime( m_sourceRenderer->time() - interval );
m_sourceRenderer->nextFrame();
}
......@@ -191,7 +191,7 @@ qint64
ClipRenderer::getLengthMs() const
{
if ( m_selectedClip )
return ( qRound64( (qreal)( m_end - m_begin ) / m_selectedClip->getMedia()->source()->fps() * 1000.0 ) );
return ( qRound64( (qreal)( m_end - m_begin ) / m_selectedClip->media()->source()->fps() * 1000.0 ) );
return 0;
}
......@@ -214,14 +214,14 @@ ClipRenderer::getCurrentFrame() const
if ( m_clipLoaded == false || m_isRendering == false || m_selectedClip == nullptr )
return 0;
return qRound64( (qreal)m_sourceRenderer->time() / 1000 *
(qreal)m_selectedClip->getMedia()->source()->fps() );
(qreal)m_selectedClip->media()->source()->fps() );
}
float
ClipRenderer::getFps() const
{
if ( m_selectedClip != nullptr )
return m_selectedClip->getMedia()->source()->fps();
return m_selectedClip->media()->source()->fps();
return 0.0f;
}
......@@ -237,7 +237,7 @@ ClipRenderer::previewWidgetCursorChanged( qint64 newFrame )
if ( m_isRendering == true )
{
newFrame += m_begin;
qint64 nbSeconds = qRound64( (qreal)newFrame / m_selectedClip->getMedia()->source()->fps() );
qint64 nbSeconds = qRound64( (qreal)newFrame / m_selectedClip->media()->source()->fps() );
m_sourceRenderer->setTime( nbSeconds * 1000 );
}
}
......@@ -271,7 +271,7 @@ ClipRenderer::videoPlaying()
void
ClipRenderer::timeChanged( qint64 time )
{
float fps = m_selectedClip->getMedia()->source()->fps();
float fps = m_selectedClip->media()->source()->fps();
qint64 f = qRound64( (qreal)time / 1000.0 * fps );
if ( f >= m_end )
return ;
......
......@@ -68,7 +68,7 @@ ClipWorkflow::initialize()
m_state = ClipWorkflow::Initializing;
delete m_renderer;
m_renderer = m_clipHelper->clip()->getMedia()->source()->createRenderer( m_eventWatcher );
m_renderer = m_clipHelper->clip()->media()->source()->createRenderer( m_eventWatcher );
preallocate();
initializeInternals();
......@@ -104,11 +104,11 @@ ClipWorkflow::loadingComplete()
void
ClipWorkflow::adjustBegin()
{
if ( m_clipHelper->clip()->getMedia()->fileType() == Media::Video ||
m_clipHelper->clip()->getMedia()->fileType() == Media::Audio )
if ( m_clipHelper->clip()->media()->fileType() == Media::Video ||
m_clipHelper->clip()->media()->fileType() == Media::Audio )
{
m_renderer->setTime( m_clipHelper->begin() /
m_clipHelper->clip()->getMedia()->source()->fps() * 1000 );
m_clipHelper->clip()->media()->source()->fps() * 1000 );
}
}
......
......@@ -82,7 +82,7 @@ TrackWorkflow::addClip( ClipHelper* ch, qint64 start )
ClipWorkflow* cw;
if ( m_trackType == Workflow::VideoTrack )
{
if ( ch->clip()->getMedia()->fileType() == Media::Video )
if ( ch->clip()->media()->fileType() == Media::Video )
cw = new VideoClipWorkflow( ch );
else
cw = new ImageClipWorkflow( ch );
......@@ -529,7 +529,7 @@ TrackWorkflow::clear()
void
TrackWorkflow::adjustClipTime( qint64 currentFrame, qint64 start, ClipWorkflow* cw )
{
float fps = cw->clip()->getMedia()->source()->fps();
float fps = cw->clip()->media()->source()->fps();
qint64 nbMs = ( currentFrame - start ) / fps * 1000;
qint64 beginInMs = cw->getClipHelper()->begin() / fps * 1000;
qint64 startFrame = beginInMs + nbMs;
......
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