[vlmc-devel] commit: ClipRenderer.cpp: Add interfaces to control volume and handle volume change signal ( Rohit Yadav )

git at videolan.org git at videolan.org
Sun Sep 26 22:14:50 CEST 2010


vlmc | branch: master | Rohit Yadav <rohityadav89 at gmail.com> | Mon Sep 27 01:58:08 2010 +0530| [9d2e93c774377eb9bcd3c75abe1ba0f2ef1ca8ff] | committer: Rohit Yadav 

ClipRenderer.cpp: Add interfaces to control volume and handle volume change signal
as needed.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=9d2e93c774377eb9bcd3c75abe1ba0f2ef1ca8ff
---

 src/Renderer/ClipRenderer.cpp |   14 ++++++++++++++
 src/Renderer/ClipRenderer.h   |    2 ++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/Renderer/ClipRenderer.cpp b/src/Renderer/ClipRenderer.cpp
index 16fc063..88df361 100644
--- a/src/Renderer/ClipRenderer.cpp
+++ b/src/Renderer/ClipRenderer.cpp
@@ -44,6 +44,7 @@ ClipRenderer::ClipRenderer() :
     connect( m_mediaPlayer,     SIGNAL( stopped() ),            this,   SLOT( __videoStopped() ) );
     connect( m_mediaPlayer,     SIGNAL( paused() ),             this,   SIGNAL( paused() ) );
     connect( m_mediaPlayer,     SIGNAL( playing() ),            this,   SIGNAL( playing() ) );
+    connect( m_mediaPlayer,     SIGNAL( volumeChanged() ),      this,   SIGNAL( volumeChanged() ) );
     connect( m_mediaPlayer,     SIGNAL( timeChanged( qint64 ) ),        this,   SLOT( __timeChanged( qint64 ) ) );
     connect( m_mediaPlayer,     SIGNAL( endReached() ),         this,   SLOT( __endReached() ) );
 }
@@ -149,6 +150,19 @@ ClipRenderer::togglePlayPause( bool forcePause )
     }
 }
 
+int
+ClipRenderer::getVolume() const
+{
+    return m_mediaPlayer->getVolume();
+}
+
+int
+ClipRenderer::setVolume( int volume )
+{
+    //Returns 0 if the volume was set, -1 if it was out of range
+    return m_mediaPlayer->setVolume( volume );
+}
+
 void
 ClipRenderer::nextFrame()
 {
diff --git a/src/Renderer/ClipRenderer.h b/src/Renderer/ClipRenderer.h
index c8e15c4..6026d5b 100644
--- a/src/Renderer/ClipRenderer.h
+++ b/src/Renderer/ClipRenderer.h
@@ -47,6 +47,8 @@ public:
 
     virtual void            togglePlayPause( bool forcePause );
     virtual void            stop();
+    virtual int             setVolume( int volume );
+    virtual int             getVolume() const;
     virtual void            nextFrame();
     virtual void            previousFrame();
     virtual qint64          length() const;



More information about the Vlmc-devel mailing list