some more work on collabsible albums. I think I will need to optimize the playlist...
[amarok.git] / src / enginebase.cpp
blob650b04b21599810d1de626b1ba1e25e807490ff5
1 //Copyright: (C) 2003 Mark Kretschmann
2 // (C) 2004,2005 Max Howell, <max.howell@methylblue.com>
3 //License: See COPYING
5 #include "enginebase.h"
7 #include <cmath>
10 Engine::Base::Base()
11 : Amarok::Plugin()
12 , m_xfadeLength( 0 )
13 , m_xfadeNextTrack( false )
14 , m_volume( 50 )
15 , m_scope( SCOPESIZE )
16 , m_isStream( false )
20 Engine::Base::~Base()
24 //////////////////////////////////////////////////////////////////////
27 bool
28 Engine::Base::load( const KUrl &url, bool stream )
30 m_url = url;
31 m_isStream = stream;
33 return true;
37 void Engine::Base::setVolume( uint value )
39 m_volume = value;
41 setVolumeSW( makeVolumeLogarithmic( value ) );
45 uint
46 Engine::Base::makeVolumeLogarithmic( uint volume ) // static
48 // We're using a logarithmic function to make the volume ramp more natural.
49 return static_cast<uint>( 100 - 100.0 * std::log10( ( 100 - volume ) * 0.09 + 1.0 ) );
53 #include "enginebase.moc"