1 /***************************************************************************
4 begin : Mit Okt 23 14:35:18 CEST 2002
5 copyright : (C) 2002 by Mark Kretschmann
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
21 #include "config-amarok.h"
23 #include "amarok_export.h"
24 #include "engineobserver.h" //baseclass
25 #include <KUniqueApplication> //baseclass
35 namespace KIO
{ class Job
; }
40 class MediaDeviceManager
;
43 class AMAROK_EXPORT App
: public KUniqueApplication
, public EngineObserver
50 static App
*instance() { return static_cast<App
*>( kapp
); }
52 static void handleCliArgs();
53 static void initCliArgs( int argc
, char *argv
[] );
55 static int mainThreadId
;
57 inline MainWindow
*mainWindow() const { return m_mainWindow
; }
60 friend class MainWindow
; //requires access to applySettings()
63 void useScores( bool use
);
64 void useRatings( bool use
);
65 void moodbarPrefs( bool show
, bool moodier
, int alter
, bool withMusic
);
67 protected: /* for OSD, tray, and dcop */
68 void engineStateChanged( Engine::State state
, Engine::State oldState
= Engine::Empty
);
69 void engineNewMetaData( const MetaBundle
&bundle
, bool trackChanged
);
70 void engineTrackPositionChanged( long position
, bool /*userSeek*/ );
71 void engineVolumeChanged( int );
74 void setRating1() { setRating( 1 ); }
75 void setRating2() { setRating( 2 ); }
76 void setRating3() { setRating( 3 ); }
77 void setRating4() { setRating( 4 ); }
78 void setRating5() { setRating( 5 ); }
82 void applySettings( bool firstTime
= false );
83 void slotConfigAmarok( const QByteArray
& page
= QByteArray() );
84 void slotConfigShortcuts();
85 void slotConfigToolBars();
86 void slotConfigEqualizer();
87 void setUseScores( bool use
);
88 void setUseRatings( bool use
);
89 void setMoodbarPrefs( bool show
, bool moodier
, int alter
, bool withMusic
);
90 KIO::Job
*trashFiles( const KUrl::List
&files
);
94 void slotTrashResult( KJob
*job
);
97 void initGlobalShortcuts();
99 void setRating( int n
);
102 MainWindow
*m_mainWindow
;
104 Amarok::TrayIcon
*m_tray
;
106 MediaDeviceManager
*m_mediaDeviceManager
;
107 KSplashScreen
*m_splash
;
110 #define pApp static_cast<App*>(kapp)
113 #endif // AMAROK_APP_H