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

List:       kde-commits
Subject:    kdeextragear-1/amarok
From:       Ian Monroe <ian.monroe () gmail ! com>
Date:       2005-04-25 7:49:15
Message-ID: 20050425074915.587A2488 () office ! kde ! org
[Download RAW message or body]

CVS commit by ianmonroe: 

A right click on the playlist window's analyzer now swaps between blockanalyzer and \
sonogram. I don't have GL working currently, so I don't know which of the GL ones \
work well resized. Add them to the createPlaylistAnalyzer in analyzerfactory.cpp if \
they do. CCMAIL:amarok-devel@lists.sf.net


  M +1 -0      ChangeLog   1.631
  M +1 -1      release_amarok.rb   1.23
  M +35 -6     src/actionclasses.cpp   1.91
  M +11 -0     src/actionclasses.h   1.40
  M +1 -0      src/analyzers/analyzerbase.h   1.27
  M +17 -0     src/analyzers/analyzerfactory.cpp   1.25


--- kdeextragear-1/amarok/src/analyzers/analyzerbase.h  #1.26:1.27
@@ -136,4 +136,5 @@ class Factory
 public:
     static QWidget* createAnalyzer( QWidget* );
+    static QWidget* createPlaylistAnalyzer( QWidget *);
 };
 

--- kdeextragear-1/amarok/src/analyzers/analyzerfactory.cpp  #1.24:1.25
@@ -85,2 +85,19 @@ QWidget *Analyzer::Factory::createAnalyz
     return analyzer;
 }
+
+QWidget *Analyzer::Factory::createPlaylistAnalyzer( QWidget *parent)
+{
+    QWidget *analyzer = 0;
+    switch( AmarokConfig::currentPlaylistAnalyzer() )
+    {
+        case 1:
+            analyzer = new Sonogram( parent );
+            break;
+        default:
+            AmarokConfig::setCurrentPlaylistAnalyzer( 0 );
+        case 0:
+            analyzer = new BlockAnalyzer( parent );
+            break;
+    }
+    return analyzer;
+}

--- kdeextragear-1/amarok/src/actionclasses.cpp  #1.90:1.91
@@ -10,4 +10,5 @@
 #include "collectiondb.h"
 #include "covermanager.h"
+#include "debug.h"
 #include "enginecontroller.h"
 #include "k3bexporter.h"
@@ -239,5 +240,5 @@ PlayPauseAction::engineStateChanged( Eng
 // AnalyzerAction
 //////////////////////////////////////////////////////////////////////////////////////////
                
-#include "blockanalyzer.h"
+#include "analyzerbase.h"
 
 AnalyzerAction::AnalyzerAction( KActionCollection *ac )
@@ -262,11 +263,10 @@ AnalyzerAction::plug( QWidget *w, int in
         addContainer( w, id );
         connect( w, SIGNAL( destroyed() ), SLOT( slotDestroyed() ) );
-
-        QWidget *block = new BlockAnalyzer( w );
+        QWidget *container = new AnaylzerContainer(w);
+        QWidget *block = Analyzer::Factory::createPlaylistAnalyzer( container );
+        container->installEventFilter(block);
         block->setName( "ToolBarAnalyzer" );
-
-        bar->insertWidget( id, 0, block, index );
+        bar->insertWidget( id, 0, container, index );
         bar->setItemAutoSized( id, true );
-
         return containerCount() - 1;
     }
@@ -274,4 +274,33 @@ AnalyzerAction::plug( QWidget *w, int in
 }
 
+AnaylzerContainer::AnaylzerContainer( QWidget *w )
+ : QWidget(w, "AnaylzerContainer"),
+ m_child(0)
+{ }
+
+void
+AnaylzerContainer::resizeEvent( QResizeEvent *)
+{
+    debug() << "resizing to " << size().width() << endl;
+    if(!m_child)
+        m_child = childAt(0,0,false);
+    if(m_child)
+        m_child->resize(size());
+}
+
+void
+AnaylzerContainer::mousePressEvent( QMouseEvent *e)
+{
+    if(e->button()==Qt::LeftButton)
+    {
+        delete m_child;
+        AmarokConfig::setCurrentPlaylistAnalyzer( \
AmarokConfig::currentPlaylistAnalyzer() + 1 ); +        QWidget* newAnalyzer = \
Analyzer::Factory::createPlaylistAnalyzer( this ); +        \
newAnalyzer->resize(size()); +        newAnalyzer->installEventFilter(this);
+        newAnalyzer->show();
+        m_child=newAnalyzer;
+    }
+}
 
 //////////////////////////////////////////////////////////////////////////////////////////


--- kdeextragear-1/amarok/src/actionclasses.h  #1.39:1.40
@@ -67,4 +67,14 @@ namespace amaroK
     };
 
+    class AnaylzerContainer : public QWidget
+    {
+        public:
+            AnaylzerContainer( QWidget *w );
+        protected:
+            void resizeEvent( QResizeEvent * );
+            void mousePressEvent( QMouseEvent *e );
+        private:
+            QWidget* m_child;
+    };
 
     class AnalyzerAction : public KAction
@@ -73,4 +83,5 @@ namespace amaroK
             AnalyzerAction( KActionCollection* );
             virtual int plug( QWidget *, int index = -1 );
+        
     };
 

--- kdeextragear-1/amarok/ChangeLog  #1.630:1.631
@@ -6,4 +6,5 @@
 VERSION 1.3-beta1:
   FEATURES:
+    * Different analyzers available for the playlist window.
     * New DCOP call "player: enableRepeatTrack" sets repeat track on or
       off.

--- kdeextragear-1/amarok/release_amarok.rb  #1.22:1.23
@@ -14,5 +14,5 @@
 
 name     = "amarok"
-$cvsroot = ":pserver:#{username}@cvs.kde.org:/home/kde"
+$cvsroot = ":ext:#{username}@cvs.kde.org:/home/kde"
 folder   = "amarok-#{version}"
 doi18n   = "yes"


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

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