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
; }
41 class MediaDeviceManager
;
44 class AMAROK_EXPORT App
: public KUniqueApplication
, public EngineObserver
51 static App
*instance() { return static_cast<App
*>( kapp
); }
53 static void handleCliArgs();
54 static void initCliArgs( int argc
, char *argv
[] );
56 static int mainThreadId
;
58 inline MainWindow
*mainWindow() const { return m_mainWindow
; }
61 friend class MainWindow
; //requires access to applySettings()
64 void useScores( bool use
);
65 void useRatings( bool use
);
66 void moodbarPrefs( bool show
, bool moodier
, int alter
, bool withMusic
);
68 protected: /* for OSD, tray, and dcop */
69 void engineStateChanged( Engine::State state
, Engine::State oldState
= Engine::Empty
);
70 void engineNewMetaData( const MetaBundle
&bundle
, bool trackChanged
);
71 void engineTrackPositionChanged( long position
, bool /*userSeek*/ );
72 void engineVolumeChanged( int );
75 void setRating1() { setRating( 1 ); }
76 void setRating2() { setRating( 2 ); }
77 void setRating3() { setRating( 3 ); }
78 void setRating4() { setRating( 4 ); }
79 void setRating5() { setRating( 5 ); }
83 void applySettings( bool firstTime
= false );
84 void slotConfigAmarok( const QByteArray
& page
= QByteArray() );
85 void slotConfigShortcuts();
86 void slotConfigToolBars();
87 void slotConfigEqualizer();
88 void setUseScores( bool use
);
89 void setUseRatings( bool use
);
90 void setMoodbarPrefs( bool show
, bool moodier
, int alter
, bool withMusic
);
91 KIO::Job
*trashFiles( const KUrl::List
&files
);
95 void slotTrashResult( KJob
*job
);
98 void initGlobalShortcuts();
99 void firstRunWizard();
101 void setRating( int n
);
104 MainWindow
*m_mainWindow
;
106 Amarok::TrayIcon
*m_tray
;
108 MediaDeviceManager
*m_mediaDeviceManager
;
109 KSplashScreen
*m_splash
;
112 #define pApp static_cast<App*>(kapp)
115 #endif // AMAROK_APP_H