21#include <sfx2/sfxsids.hrc>
25#include <com/sun/star/lang/IllegalArgumentException.hpp>
34 :
PanelLayout(pParent,
"MediaPlaybackPanel",
"svx/ui/mediaplayback.ui"),
35 maMediaController(SID_AVMEDIA_TOOLBOX, *pBindings, *this),
36 maIdle(
"MediaPlaybackPanel"),
39 mxTimeEdit =
m_xBuilder->weld_entry(
"timeedit");
40 mxPlayToolBox =
m_xBuilder->weld_toolbar(
"playtoolbox");
41 mxMuteToolBox =
m_xBuilder->weld_toolbar(
"mutetoolbox");
42 mxTimeSlider =
m_xBuilder->weld_scale(
"timeslider");
43 mxVolumeSlider =
m_xBuilder->weld_scale(
"volumeslider");
44 mxZoomListBox =
m_xBuilder->weld_combo_box(
"zoombox");
53 if (pParent ==
nullptr)
54 throw lang::IllegalArgumentException(
"no parent Window given to MediaPlaybackPanel::Create",
nullptr, 0);
55 if (pBindings ==
nullptr)
56 throw lang::IllegalArgumentException(
"no SfxBindings given to MediaPlaybackPanel::Create",
nullptr, 2);
58 return std::make_unique<MediaPlaybackPanel>(pParent, pBindings);
81 const sal_uInt16 nSID,
85 if( nSID == SID_AVMEDIA_TOOLBOX )
87 if(eState >= SfxItemState::DEFAULT)
97 mxPlayToolBox->set_sensitive(
false);
98 avmedia::MediaControlBase::UpdateToolBoxes(rMediaItem);
116 mpBindings->GetDispatcher()->ExecuteList(SID_AVMEDIA_TOOLBOX, SfxCallMode::RECORD, { &aItem });
126 mpBindings->GetDispatcher()->ExecuteList(SID_AVMEDIA_TOOLBOX, SfxCallMode::RECORD, { &aItem });
127 mpBindings->Invalidate(SID_AVMEDIA_TOOLBOX);
132 mpBindings->Invalidate(SID_AVMEDIA_TOOLBOX);
143 if( !mpMediaItem || (mpMediaItem->getTime() == mpMediaItem->getDuration() ))
146 aItem.
setTime( mpMediaItem->getTime());
148 else if (rId ==
"pause")
150 aItem.
setState( MediaState::Pause );
152 else if (rId ==
"stop")
157 else if (rId ==
"mute")
159 aItem.
setMute( mxMuteToolBox->get_item_active(
"mute") );
161 else if (rId ==
"loop")
163 aItem.
setLoop( mxPlayToolBox->get_item_active(
"loop") );
166 if(aItem.
getMaskSet() != AVMediaSetMask::NONE)
168 mpBindings->GetDispatcher()->ExecuteList(SID_AVMEDIA_TOOLBOX, SfxCallMode::RECORD, { &aItem } );
169 mpBindings->Invalidate(SID_AVMEDIA_TOOLBOX);
virtual void Start(bool bStartTimer=true) override
std::unique_ptr< weld::Builder > m_xBuilder
void Invalidate(sal_uInt16 nId)
virtual SfxPoolItem * Clone(SfxItemPool *pPool=nullptr) const=0
void SetPriority(TaskPriority ePriority)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
#define LINK(Instance, Class, Member)