[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdeextragear-1/amarok/src/engine/mas
From: Roland Gigler <rolandg () web ! de>
Date: 2004-10-28 18:49:10
Message-ID: 20041028184910.3F1E116BDA () office ! kde ! org
[Download RAW message or body]
CVS commit by rolandg:
more cleanup, adjust to Plugin Properties
M +24 -30 masengine.cpp 1.6
M +6 -23 masengine.h 1.5
--- kdeextragear-1/amarok/src/engine/mas/masengine.h #1.4:1.5
@@ -22,20 +22,11 @@ what : interface to the
#include "enginebase.h"
-#include <vector>
-
-#include <qguardedptr.h>
-#include <qmap.h>
-#include <qstringlist.h>
-#include <qwidget.h>
-
-#include <qwidget.h>
+//#include <vector>
#ifdef __cplusplus
extern "C" {
#endif
-
-#include <mas/mas.h>
-#include <mas/mas_core.h>
-
+ #include <mas/mas.h>
+ #include <mas/mas_core.h>
#ifdef __cplusplus
}
@@ -46,7 +37,4 @@ class QTimer;
class KURL;
-namespace KDE { class PlayObject; }
-
-
class MasEngine : public Engine::Base
{
@@ -63,7 +51,6 @@ class MasEngine : public Engine::Base
uint position() const;
Engine::State state() const {return m_state;}
-// std::vector<float>* scope();
-
/*
+ const Engine::Scope& scope();
bool decoderConfigurable();
void configureDecoder();
@@ -109,6 +95,4 @@ class MasEngine : public Engine::Base
mas_device_t m_sbuf;
mas_device_t m_codec;
- //mas_device_t m_id3_device;
-
mas_device_t m_mix_device;
mas_port_t m_mix_sink;
@@ -121,4 +104,4 @@ class MasEngine : public Engine::Base
};
-#endif
+#endif // AMAROK_MASENGINE_H
--- kdeextragear-1/amarok/src/engine/mas/masengine.cpp #1.5:1.6
@@ -23,13 +23,8 @@ what : interface to the
#include <math.h> //setVolume(), timerEvent()
#include <string>
-#include <vector>
+//#include <vector>
-#include <qdir.h>
-#include <qdom.h>
-#include <qfile.h>
-#include <qlayout.h>
-#include <qstring.h>
-#include <qtextstream.h>
#include <qtimer.h>
+#include <qfile.h>
#include <kapplication.h>
@@ -47,5 +42,5 @@ what : interface to the
//#define DB_CUTOFF -40.0
#define BUFFER_TIME_MS 300
-/* #define POSTOUT_TIME_MS 100 */
+#define POSTOUT_TIME_MS 100
//#define QUERY_MIX_VOLUME 0
//#define QUERY_MIX_EPSILON 5
@@ -56,5 +51,5 @@ AMAROK_EXPORT_PLUGIN( MasEngine )
-MasEngine::MasEngine( )
+MasEngine::MasEngine()
: Engine::Base()
, m_inited (false)
@@ -71,4 +66,7 @@ MasEngine::MasEngine( )
addPluginProperty( "StreamingMode", "NoStreaming" );
+ addPluginProperty( "HasConfigure", "false" );
+ addPluginProperty( "HasCrossfading", "false" );
+ addPluginProperty( "HasEqualizer", "false" );
}
@@ -119,5 +116,5 @@ bool MasEngine::init()
bool MasEngine::canDecode( const KURL &url ) const
{
- static QStringList list;
+ QStringList list;
kdDebug() << "BEGIN " << k_funcinfo << endl;
@@ -153,4 +150,10 @@ bool MasEngine::load( const KURL& url, b
if ( !url.isLocalFile() ) { // for now
+ kdDebug() << " only local files are supported (for now)" << endl;
+ return false;
+ }
+
+ if ( !canDecode(url) ) {
+ kdDebug() << " cannot decode!" << endl;
return false;
}
@@ -250,5 +253,5 @@ void MasEngine::playingTimeout() //SLOT
m_state = Engine::Idle;
- emit trackEnded( );
+ emit trackEnded();
}
@@ -489,10 +490,4 @@ bool MasEngine::masinit()
#endif
- /* id3 tag parser */
- /* we have no need to read the tags from MAS */
-/*
- err = mas_asm_instantiate_device_on_channel( (char*)"tag", 0, 0, &m_id3_device, local );
- mas_assert( err >= 0, (char*)"Couldn't instantiate tag device" );
-*/
/* get a handle to the mixer */
@@ -551,9 +545,9 @@ bool MasEngine::masinit()
printf (" after ... masc_strike_package ...\n");
-/* masc_setup_package( &nugget, NULL, 0, 0 ); */
-/* masc_pushk_uint32( &nugget, "postout_time_ms", POSTOUT_TIME_MS ); */
-/* masc_finalize_package( &nugget ); */
-/* mas_set( m_sbuf, "postout_time_ms", &nugget ); */
-/* masc_strike_package( &nugget ); */
+ masc_setup_package( &nugget, NULL, 0, 0 );
+ masc_pushk_uint32( &nugget, "postout_time_ms", POSTOUT_TIME_MS );
+ masc_finalize_package( &nugget );
+ mas_set( m_sbuf, "postout_time_ms", &nugget );
+ masc_strike_package( &nugget );
/* If we can use a sample clock, let's do it... */
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic