loplugin:flatten in avmedia
Change-Id: Ie066ee15833a58db4a9a18006629c015d50a56b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92486 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
@@ -38,8 +38,9 @@ MediaControlBase::MediaControlBase()
|
|||||||
|
|
||||||
void MediaControlBase::UpdateTimeField( MediaItem const & aMediaItem, double fTime )
|
void MediaControlBase::UpdateTimeField( MediaItem const & aMediaItem, double fTime )
|
||||||
{
|
{
|
||||||
if( !aMediaItem.getURL().isEmpty())
|
if( aMediaItem.getURL().isEmpty())
|
||||||
{
|
return;
|
||||||
|
|
||||||
OUString aTimeString;
|
OUString aTimeString;
|
||||||
|
|
||||||
SvtSysLocale aSysLocale;
|
SvtSysLocale aSysLocale;
|
||||||
@@ -52,7 +53,6 @@ void MediaControlBase::UpdateTimeField( MediaItem const & aMediaItem, double fTi
|
|||||||
if( mxTimeEdit->get_text() != aTimeString )
|
if( mxTimeEdit->get_text() != aTimeString )
|
||||||
mxTimeEdit->set_text( aTimeString );
|
mxTimeEdit->set_text( aTimeString );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void MediaControlBase::UpdateVolumeSlider( MediaItem const & aMediaItem )
|
void MediaControlBase::UpdateVolumeSlider( MediaItem const & aMediaItem )
|
||||||
{
|
{
|
||||||
|
@@ -674,7 +674,9 @@ void SAL_CALL Player::setMediaTime( double fTime )
|
|||||||
{
|
{
|
||||||
::osl::MutexGuard aGuard(m_aMutex);
|
::osl::MutexGuard aGuard(m_aMutex);
|
||||||
|
|
||||||
if( mpPlaybin ) {
|
if( !mpPlaybin )
|
||||||
|
return;
|
||||||
|
|
||||||
gint64 gst_position = llround (fTime * GST_SECOND);
|
gint64 gst_position = llround (fTime * GST_SECOND);
|
||||||
|
|
||||||
gst_element_seek( mpPlaybin, 1.0,
|
gst_element_seek( mpPlaybin, 1.0,
|
||||||
@@ -687,7 +689,6 @@ void SAL_CALL Player::setMediaTime( double fTime )
|
|||||||
|
|
||||||
SAL_INFO( "avmedia.gstreamer", AVVERSION "seek to: " << gst_position << " ns original: " << fTime << " s" );
|
SAL_INFO( "avmedia.gstreamer", AVVERSION "seek to: " << gst_position << " ns original: " << fTime << " s" );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
double SAL_CALL Player::getMediaTime()
|
double SAL_CALL Player::getMediaTime()
|
||||||
|
@@ -224,8 +224,9 @@ void MediaWindowImpl::setURL( const OUString& rURL,
|
|||||||
OUString const& rTempURL, OUString const& rReferer)
|
OUString const& rTempURL, OUString const& rReferer)
|
||||||
{
|
{
|
||||||
maReferer = rReferer;
|
maReferer = rReferer;
|
||||||
if( rURL != getURL() )
|
if( rURL == getURL() )
|
||||||
{
|
return;
|
||||||
|
|
||||||
if( mxPlayer.is() )
|
if( mxPlayer.is() )
|
||||||
mxPlayer->stop();
|
mxPlayer->stop();
|
||||||
|
|
||||||
@@ -256,7 +257,6 @@ void MediaWindowImpl::setURL( const OUString& rURL,
|
|||||||
mxPlayer = createPlayer((!mTempFileURL.isEmpty()) ? mTempFileURL : maFileURL, rReferer, &m_sMimeType );
|
mxPlayer = createPlayer((!mTempFileURL.isEmpty()) ? mTempFileURL : maFileURL, rReferer, &m_sMimeType );
|
||||||
onURLChanged();
|
onURLChanged();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
const OUString& MediaWindowImpl::getURL() const
|
const OUString& MediaWindowImpl::getURL() const
|
||||||
{
|
{
|
||||||
@@ -332,8 +332,9 @@ void MediaWindowImpl::executeMediaItem( const MediaItem& rItem )
|
|||||||
mxPlayerWindow->setZoomLevel( rItem.getZoom() );
|
mxPlayerWindow->setZoomLevel( rItem.getZoom() );
|
||||||
|
|
||||||
// set play state at last
|
// set play state at last
|
||||||
if (nMaskSet & AVMediaSetMask::STATE)
|
if (!(nMaskSet & AVMediaSetMask::STATE))
|
||||||
{
|
return;
|
||||||
|
|
||||||
switch (rItem.getState())
|
switch (rItem.getState())
|
||||||
{
|
{
|
||||||
case MediaState::Play:
|
case MediaState::Play:
|
||||||
@@ -362,7 +363,6 @@ void MediaWindowImpl::executeMediaItem( const MediaItem& rItem )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void MediaWindowImpl::stop()
|
void MediaWindowImpl::stop()
|
||||||
{
|
{
|
||||||
@@ -472,8 +472,9 @@ void MediaWindowImpl::setPointer(PointerStyle aPointer)
|
|||||||
if (mpChildWindow)
|
if (mpChildWindow)
|
||||||
mpChildWindow->SetPointer(aPointer);
|
mpChildWindow->SetPointer(aPointer);
|
||||||
|
|
||||||
if (mxPlayerWindow.is())
|
if (!mxPlayerWindow.is())
|
||||||
{
|
return;
|
||||||
|
|
||||||
long nPointer;
|
long nPointer;
|
||||||
|
|
||||||
switch (aPointer)
|
switch (aPointer)
|
||||||
@@ -497,7 +498,6 @@ void MediaWindowImpl::setPointer(PointerStyle aPointer)
|
|||||||
|
|
||||||
mxPlayerWindow->setPointerType(nPointer);
|
mxPlayerWindow->setPointerType(nPointer);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void MediaWindowImpl::Resize()
|
void MediaWindowImpl::Resize()
|
||||||
{
|
{
|
||||||
@@ -524,8 +524,9 @@ void MediaWindowImpl::Resize()
|
|||||||
|
|
||||||
void MediaWindowImpl::StateChanged(StateChangedType eType)
|
void MediaWindowImpl::StateChanged(StateChangedType eType)
|
||||||
{
|
{
|
||||||
if (mxPlayerWindow.is())
|
if (!mxPlayerWindow.is())
|
||||||
{
|
return;
|
||||||
|
|
||||||
// stop playing when going disabled or hidden
|
// stop playing when going disabled or hidden
|
||||||
switch (eType)
|
switch (eType)
|
||||||
{
|
{
|
||||||
@@ -547,7 +548,6 @@ void MediaWindowImpl::StateChanged(StateChangedType eType)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
|
void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&)
|
||||||
{
|
{
|
||||||
@@ -577,8 +577,9 @@ void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rec
|
|||||||
const Point aBasePos(mpChildWindow->GetPosPixel());
|
const Point aBasePos(mpChildWindow->GetPosPixel());
|
||||||
const tools::Rectangle aVideoRect(aBasePos, mpChildWindow->GetSizePixel());
|
const tools::Rectangle aVideoRect(aBasePos, mpChildWindow->GetSizePixel());
|
||||||
|
|
||||||
if (pLogo && !pLogo->IsEmpty() && !aVideoRect.IsEmpty())
|
if (!(pLogo && !pLogo->IsEmpty() && !aVideoRect.IsEmpty()))
|
||||||
{
|
return;
|
||||||
|
|
||||||
Size aLogoSize(pLogo->GetSizePixel());
|
Size aLogoSize(pLogo->GetSizePixel());
|
||||||
const Color aBackgroundColor(67, 67, 67);
|
const Color aBackgroundColor(67, 67, 67);
|
||||||
|
|
||||||
@@ -608,7 +609,6 @@ void MediaWindowImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rec
|
|||||||
|
|
||||||
rRenderContext.DrawBitmapEx(aPoint, aLogoSize, *pLogo);
|
rRenderContext.DrawBitmapEx(aPoint, aLogoSize, *pLogo);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void MediaWindowImpl::GetFocus()
|
void MediaWindowImpl::GetFocus()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user