summaryrefslogtreecommitdiff
path: root/avmedia/source
diff options
context:
space:
mode:
authorAbhilash <abhilash300singh@gmail.com>2016-08-20 15:32:55 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2016-09-02 16:22:33 +0000
commit6228d6c52e4a6e6c0d82632a135211286e06852e (patch)
treee40add830c1bab801ef9d65fdea57d53fccbf0da /avmedia/source
parent8e375369206606c541cff5f46ea6a87db2c808b4 (diff)
tdf#32581 Add the possibility to retrieve the filename of media
Change-Id: I3ca1a9d830d3cb49753df61afa94413704c94a48 Reviewed-on: https://gerrit.libreoffice.org/28259 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'avmedia/source')
-rw-r--r--avmedia/source/framework/mediacontrol.cxx30
-rw-r--r--avmedia/source/framework/mediacontrol.hrc3
-rw-r--r--avmedia/source/framework/mediacontrol.src11
3 files changed, 42 insertions, 2 deletions
diff --git a/avmedia/source/framework/mediacontrol.cxx b/avmedia/source/framework/mediacontrol.cxx
index c698992ff4f7..b2c12c0a2dda 100644
--- a/avmedia/source/framework/mediacontrol.cxx
+++ b/avmedia/source/framework/mediacontrol.cxx
@@ -52,6 +52,7 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
mpZoomToolBox = VclPtr<ToolBox>::Create(this, WB_3DLOOK) ;
mpZoomListBox = VclPtr<ListBox>::Create( mpZoomToolBox.get(), WB_BORDER | WB_DROPDOWN | WB_AUTOHSCROLL | WB_3DLOOK ) ;
mpTimeEdit = VclPtr<Edit>::Create(this, WB_CENTER | WB_READONLY | WB_BORDER | WB_3DLOOK ) ;
+ mpMediaPath = VclPtr<FixedText>::Create(this, WB_VCENTER | WB_READONLY | WB_BORDER | WB_3DLOOK ) ;
SetBackground();
SetPaintTransparent( true );
@@ -97,6 +98,14 @@ MediaControl::MediaControl( vcl::Window* pParent, MediaControlStyle eControlStyl
mpZoomToolBox->Show();
maMinSize.Width() += mpZoomToolBox->GetSizePixel().Width();
+ const OUString aMediaPath( AVMEDIA_RESSTR( AVMEDIA_MEDIA_PATH_DEFAULT ) );
+ mpMediaPath->SetText(aMediaPath);
+ mpMediaPath->SetUpdateMode( false );
+ mpMediaPath->SetSizePixel( Size( mpMediaPath->GetTextWidth( aMediaPath ) + 400, mpPlayToolBox->GetSizePixel().Height() ) ); // maybe extend the no. 400 to span the screen width
+ mpMediaPath->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() );
+ mpMediaPath->Show();
+ maMinSize.Width() += mpMediaPath->GetSizePixel().Width();
+
if( MEDIACONTROLSTYLE_MULTILINE == meControlStyle )
{
maMinSize.Width() = 256;
@@ -145,6 +154,7 @@ void MediaControl::dispose()
mpZoomToolBox->SetItemWindow( AVMEDIA_TOOLBOXITEM_ZOOM, nullptr );
mpZoomListBox.disposeAndClear();
mpTimeEdit.disposeAndClear();
+ mpMediaPath.disposeAndClear();
mpZoomToolBox.disposeAndClear();
mpVolumeSlider.disposeAndClear();
mpMuteToolBox.disposeAndClear();
@@ -158,6 +168,17 @@ const Size& MediaControl::getMinSizePixel() const
return maMinSize;
}
+void MediaControl::UpdateURLField(MediaItem tempItem)
+{
+ const OUString aURL( AVMEDIA_RESSTR( AVMEDIA_MEDIA_PATH ) + ": " + tempItem.getURL() ) ;
+ mpMediaPath->SetText(aURL);
+ mpMediaPath->SetUpdateMode( false );
+ mpMediaPath->SetSizePixel( Size( mpMediaPath->GetTextWidth( aURL ) + 8, mpPlayToolBox->GetSizePixel().Height() ) );
+ mpMediaPath->SetControlBackground( Application::GetSettings().GetStyleSettings().GetWindowColor() );
+ mpMediaPath->Show();
+ maMinSize.Width() += mpMediaPath->GetSizePixel().Width();
+}
+
void MediaControl::Resize()
{
Point aPos( 0, 0 );
@@ -166,12 +187,13 @@ void MediaControl::Resize()
const sal_Int32 nVolumeSliderWidth = mpVolumeSlider->GetSizePixel().Width();
const sal_Int32 nZoomToolBoxWidth = mpZoomToolBox->GetSizePixel().Width();
const sal_Int32 nTimeEditWidth = mpTimeEdit->GetSizePixel().Width();
+ const sal_Int32 nMediaPathWidth = mpMediaPath->GetSizePixel().Width();
const sal_Int32 nTimeSliderHeight = mpTimeSlider->GetSizePixel().Height();
if( MEDIACONTROLSTYLE_SINGLELINE == meControlStyle )
{
- const sal_Int32 nTimeSliderWidth = GetSizePixel().Width() - ( AVMEDIA_CONTROLOFFSET * 3 ) -
- nPlayToolBoxWidth - nMuteToolBoxWidth - nVolumeSliderWidth - nTimeEditWidth - nZoomToolBoxWidth;
+ const sal_Int32 nTimeSliderWidth = GetSizePixel().Width() - ( AVMEDIA_CONTROLOFFSET * 4 ) -
+ nPlayToolBoxWidth - nMuteToolBoxWidth - nVolumeSliderWidth - nTimeEditWidth - nZoomToolBoxWidth - nMediaPathWidth;
mpPlayToolBox->SetPosSizePixel( aPos, mpPlayToolBox->GetSizePixel() );
@@ -189,6 +211,9 @@ void MediaControl::Resize()
aPos.X() += nVolumeSliderWidth + AVMEDIA_CONTROLOFFSET;
mpZoomToolBox->SetPosSizePixel( aPos, mpZoomToolBox->GetSizePixel() );
+
+ aPos.X() += nZoomToolBoxWidth + AVMEDIA_CONTROLOFFSET;
+ mpMediaPath->SetPosSizePixel( aPos, mpMediaPath->GetSizePixel() );
}
else
{
@@ -226,6 +251,7 @@ void MediaControl::setState( const MediaItem& rItem )
UpdateTimeSlider( maItem );
UpdateVolumeSlider( maItem );
UpdateTimeField( maItem, maItem.getTime() );
+ UpdateURLField(maItem);
}
}
diff --git a/avmedia/source/framework/mediacontrol.hrc b/avmedia/source/framework/mediacontrol.hrc
index 653b94b239c4..2f91740d1499 100644
--- a/avmedia/source/framework/mediacontrol.hrc
+++ b/avmedia/source/framework/mediacontrol.hrc
@@ -42,4 +42,7 @@
#define AVMEDIA_IMGLST 3072
#define AVMEDIA_IMGLST_L 3074
+#define AVMEDIA_MEDIA_PATH 4076
+#define AVMEDIA_MEDIA_PATH_DEFAULT 4078
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/avmedia/source/framework/mediacontrol.src b/avmedia/source/framework/mediacontrol.src
index bc81cc83998f..0b5c306dbeab 100644
--- a/avmedia/source/framework/mediacontrol.src
+++ b/avmedia/source/framework/mediacontrol.src
@@ -118,4 +118,15 @@ ImageList AVMEDIA_IMGLST_L
IdCount = 7;
};
+String AVMEDIA_MEDIA_PATH
+{
+ Text[en-US] = "Media Path";
+};
+
+String AVMEDIA_MEDIA_PATH_DEFAULT
+{
+ Text[en-US] = "No Media Selected";
+};
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */