[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/multimedia/amarok/playground/src/context/applets/videoclip
From:       Leo Franchi <lfranchi () kde ! org>
Date:       2009-05-29 10:06:36
Message-ID: 1243591596.311734.14553.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 974406 by lfranchi:

kick the applet to show a video when dataUpdated is called, and some
style cleanups

 M  +19 -7     VideoclipApplet.cpp  


--- trunk/extragear/multimedia/amarok/playground/src/context/applets/videoclip/VideoclipApplet.cpp \
#974405:974406 @@ -64,7 +64,8 @@
 }
 
 
-void VideoclipApplet::init()
+void 
+VideoclipApplet::init()
 {
     setBackgroundHints( Plasma::Applet::NoBackground );
 
@@ -154,7 +155,8 @@
         m_videoWidget->hide();
 }
 
-void VideoclipApplet::constraintsEvent( Plasma::Constraints constraints )
+void 
+VideoclipApplet::constraintsEvent( Plasma::Constraints constraints )
 {
     Q_UNUSED( constraints );
     prepareGeometryChange();
@@ -169,7 +171,8 @@
 }
 
 
-void VideoclipApplet::paintInterface( QPainter *p, const QStyleOptionGraphicsItem \
*option, const QRect &contentsRect ) +void 
+VideoclipApplet::paintInterface( QPainter *p, const QStyleOptionGraphicsItem \
*option, const QRect &contentsRect )  {
     Q_UNUSED( p );
     Q_UNUSED( option );
@@ -181,24 +184,32 @@
     drawRoundedRectAroundText( p, m_headerText );
  }
 
-QSizeF VideoclipApplet::sizeHint( Qt::SizeHint which, const QSizeF & constraint ) \
const +QSizeF 
+VideoclipApplet::sizeHint( Qt::SizeHint which, const QSizeF & constraint ) const
 {
     // hardcoding for now
     return QSizeF( QGraphicsWidget::sizeHint( which, constraint ).width(), m_height \
);  }
 
 
-void VideoclipApplet::connectSource( const QString &source )
+void 
+VideoclipApplet::connectSource( const QString &source )
 {
     if ( source == "videoclip" )
         dataEngine( "amarok-videoclip" )->connectSource( "videoclip", this );
 }
 
-void VideoclipApplet::dataUpdated( const QString& name, const \
Plasma::DataEngine::Data& data ) // SLOT +void 
+VideoclipApplet::dataUpdated( const QString& name, const Plasma::DataEngine::Data& \
data ) // SLOT  {
     DEBUG_BLOCK
     Q_UNUSED( name )
     
+    // HACK sometimes it takes longer for amarok to realize that a stream has video,
+    // so when engineNewTrackPlaying is called it doesn't know about it yet. however
+    // by the time this gets called, more has been downloaded and phonon figures it \
outs +    engineNewTrackPlaying();
+    
     int width = 130;
     // Properly delete previsouly allocated item
     while ( !m_layoutWidgetList.empty() )
@@ -299,7 +310,8 @@
 }
 
 
-void VideoclipApplet::appendVideoClip( )
+void 
+VideoclipApplet::appendVideoClip( )
 {
     QAbstractButton *button = qobject_cast<QAbstractButton *>(QObject::sender() );
     if ( button )


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic