videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolbar.cpp
changeset 52 e3cecb93e76a
child 58 d2b028fd1f7d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/videoplayback/videoplaybackview/controlsrc/videoplaybackcontrolbar.cpp	Wed Aug 18 09:50:14 2010 +0300
@@ -0,0 +1,194 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Implementation of VideoPlaybackControlBar
+*
+*/
+
+// Version : %version:  8 %
+
+
+
+#include "mpxvideo_debug.h"
+#include "videoplaybacktoolbar.h"
+#include "videoplaybackcontrolbar.h"
+#include "videoplaybackprogressbar.h"
+#include "mpxcommonvideoplaybackview.hrh"
+#include "videoplaybackcontrolscontroller.h"
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::VideoPlaybackControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlBar::VideoPlaybackControlBar(
+        VideoPlaybackControlsController* controller )
+    : mController( controller )
+{
+    MPX_ENTER_EXIT(_L("VideoPlaybackControlBar::VideoPlaybackControlBar"));
+
+    //
+    // create toolbar handler
+    //
+    mToolBar = new VideoPlaybackToolBar( mController );
+
+    //
+    // create progressbar handler
+    //
+    mProgressBar = new VideoPlaybackProgressBar( mController );
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::~VideoPlaybackControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+VideoPlaybackControlBar::~VideoPlaybackControlBar()
+{
+    MPX_DEBUG(_L("VideoPlaybackControlBar::~VideoPlaybackControlBar()"));
+
+    if ( mProgressBar )
+    {
+        delete mProgressBar;
+        mProgressBar = NULL;
+    }
+
+    if ( mToolBar )
+    {
+        delete mToolBar;
+        mToolBar = NULL;
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::initialize()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::initialize()
+{
+    MPX_ENTER_EXIT(_L("VideoPlaybackControlBar::initialize()"));
+
+    if ( mProgressBar )
+    {
+        mProgressBar->initialize();
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::updateState()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::updateState( TMPXPlaybackState state )
+{
+    MPX_DEBUG(_L("VideoPlaybackControlBar::updateState() state = %d"), state );
+
+    if ( mToolBar )
+    {
+        mToolBar->updateState( state );
+    }
+
+    if ( mProgressBar )
+    {
+        mProgressBar->updateState( state );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::aspectRatioChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::aspectRatioChanged( int aspectRatio )
+{
+    MPX_DEBUG(_L("VideoPlaybackControlBar::aspectRatioChanged() aspectRatio = %d"), aspectRatio );
+
+    if ( mToolBar )
+    {
+        mToolBar->aspectRatioChanged( aspectRatio );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::updateWithFileDetails()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::updateWithFileDetails(
+        VideoPlaybackViewFileDetails* details )
+{
+    MPX_DEBUG(_L("VideoPlaybackControlBar::updateWithFileDetails()"));
+
+    if ( mToolBar )
+    {
+        mToolBar->updateWithFileDetails( details );
+    }
+
+    if ( mProgressBar )
+    {
+        mProgressBar->updateWithFileDetails( details );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::setVisibleToControlBar()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::setVisibleToControlBar( bool visible )
+{
+    MPX_ENTER_EXIT(_L("VideoPlaybackControlBar::setVisibleToControlBar()"),
+                   _L("visible = %d, current visibility = %d"), visible, isVisible() );
+
+    if ( visible != isVisible() )
+    {
+        setVisible( visible );
+        mToolBar->setVisible( visible );        
+    }
+}
+
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::durationChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::durationChanged( int duration )
+{
+    MPX_DEBUG(_L("VideoPlaybackControlBar::durationChanged()"));
+
+    if ( mProgressBar )
+    {
+        mProgressBar->durationChanged( duration );
+    }
+
+    if ( mToolBar )
+    {
+        mToolBar->durationChanged( duration );
+    }
+}
+
+// -------------------------------------------------------------------------------------------------
+// VideoPlaybackControlBar::positionChanged()
+// -------------------------------------------------------------------------------------------------
+//
+void VideoPlaybackControlBar::positionChanged( int position )
+{
+    MPX_DEBUG(_L("VideoPlaybackControlBar::positionChanged()"));
+
+    if ( mProgressBar )
+    {
+        mProgressBar->positionChanged( position );
+    }
+
+    if ( mToolBar )
+    {
+        mToolBar->positionChanged( position );
+    }
+}
+
+//End of file