loplugin:expandablemethods in avmedia

Change-Id: I215230d3b7e3649146083f00e7c10c03a4d3154e
Reviewed-on: https://gerrit.libreoffice.org/30470
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2016-11-01 16:45:26 +02:00
parent a7369d9899
commit 2db81e7336
2 changed files with 12 additions and 67 deletions

View File

@@ -334,10 +334,10 @@ void MediaWindowImpl::updateMediaItem( MediaItem& rItem ) const
rItem.setDuration( getDuration() ); rItem.setDuration( getDuration() );
rItem.setTime( getMediaTime() ); rItem.setTime( getMediaTime() );
rItem.setLoop( isPlaybackLoop() ); rItem.setLoop( mxPlayer.is() && mxPlayer->isPlaybackLoop() );
rItem.setMute( isMute() ); rItem.setMute( mxPlayer.is() && mxPlayer->isMute() );
rItem.setVolumeDB( getVolumeDB() ); rItem.setVolumeDB( mxPlayer.is() ? mxPlayer->getVolumeDB() : 0 );
rItem.setZoom( getZoom() ); rItem.setZoom( mxPlayerWindow.is() ? mxPlayerWindow->getZoomLevel() : media::ZoomLevel_NOT_AVAILABLE );
rItem.setURL( getURL(), mTempFileURL, maReferer ); rItem.setURL( getURL(), mTempFileURL, maReferer );
} }
@@ -356,17 +356,17 @@ void MediaWindowImpl::executeMediaItem( const MediaItem& rItem )
if (nMaskSet & AVMediaSetMask::TIME) if (nMaskSet & AVMediaSetMask::TIME)
setMediaTime(std::min(rItem.getTime(), getDuration())); setMediaTime(std::min(rItem.getTime(), getDuration()));
if (nMaskSet & AVMediaSetMask::LOOP) if (nMaskSet & AVMediaSetMask::LOOP && mxPlayer.is() )
setPlaybackLoop(rItem.isLoop()); mxPlayer->setPlaybackLoop( rItem.isLoop() );
if (nMaskSet & AVMediaSetMask::MUTE) if (nMaskSet & AVMediaSetMask::MUTE && mxPlayer.is() )
setMute(rItem.isMute()); mxPlayer->setMute( rItem.isMute() );
if (nMaskSet & AVMediaSetMask::VOLUMEDB) if (nMaskSet & AVMediaSetMask::VOLUMEDB && mxPlayer.is() )
setVolumeDB(rItem.getVolumeDB()); mxPlayer->setVolumeDB( rItem.getVolumeDB() );
if (nMaskSet & AVMediaSetMask::ZOOM) if (nMaskSet & AVMediaSetMask::ZOOM && mxPlayerWindow.is() )
setZoom(rItem.getZoom()); mxPlayerWindow->setZoomLevel( rItem.getZoom() );
// set play state at last // set play state at last
if (nMaskSet & AVMediaSetMask::STATE) if (nMaskSet & AVMediaSetMask::STATE)
@@ -401,16 +401,6 @@ void MediaWindowImpl::executeMediaItem( const MediaItem& rItem )
} }
} }
bool MediaWindowImpl::setZoom(css::media::ZoomLevel eLevel)
{
return mxPlayerWindow.is() && mxPlayerWindow->setZoomLevel( eLevel );
}
css::media::ZoomLevel MediaWindowImpl::getZoom() const
{
return( mxPlayerWindow.is() ? mxPlayerWindow->getZoomLevel() : media::ZoomLevel_NOT_AVAILABLE );
}
void MediaWindowImpl::stop() void MediaWindowImpl::stop()
{ {
if( mxPlayer.is() ) if( mxPlayer.is() )
@@ -438,39 +428,6 @@ double MediaWindowImpl::getMediaTime() const
return( mxPlayer.is() ? mxPlayer->getMediaTime() : 0.0 ); return( mxPlayer.is() ? mxPlayer->getMediaTime() : 0.0 );
} }
void MediaWindowImpl::setPlaybackLoop( bool bSet )
{
if( mxPlayer.is() )
mxPlayer->setPlaybackLoop( bSet );
}
bool MediaWindowImpl::isPlaybackLoop() const
{
return mxPlayer.is() && mxPlayer->isPlaybackLoop();
}
void MediaWindowImpl::setMute( bool bSet )
{
if( mxPlayer.is() )
mxPlayer->setMute( bSet );
}
bool MediaWindowImpl::isMute() const
{
return mxPlayer.is() && mxPlayer->isMute();
}
void MediaWindowImpl::setVolumeDB( sal_Int16 nVolumeDB )
{
if( mxPlayer.is() )
mxPlayer->setVolumeDB( nVolumeDB );
}
sal_Int16 MediaWindowImpl::getVolumeDB() const
{
return (mxPlayer.is() ? mxPlayer->getVolumeDB() : 0);
}
void MediaWindowImpl::stopPlayingInternal(bool bStop) void MediaWindowImpl::stopPlayingInternal(bool bStop)
{ {
if (isPlaying()) if (isPlaying())

View File

@@ -123,9 +123,6 @@ private:
// DragSourceHelper // DragSourceHelper
virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override; virtual void StartDrag( sal_Int8 nAction, const Point& rPosPixel ) override;
bool setZoom(css::media::ZoomLevel eLevel);
css::media::ZoomLevel getZoom() const;
void stop(); void stop();
bool isPlaying() const; bool isPlaying() const;
@@ -135,15 +132,6 @@ private:
void setMediaTime( double fTime ); void setMediaTime( double fTime );
double getMediaTime() const; double getMediaTime() const;
void setPlaybackLoop( bool bSet );
bool isPlaybackLoop() const;
void setMute( bool bSet );
bool isMute() const;
void setVolumeDB( sal_Int16 nVolumeDB );
sal_Int16 getVolumeDB() const;
void stopPlayingInternal( bool ); void stopPlayingInternal( bool );
void onURLChanged(); void onURLChanged();