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 <kapplication.h> //baseclass
35 namespace KIO
{ class Job
; }
38 class KActionCollection
;
43 class MediaDeviceManager
;
45 class AMAROK_EXPORT App
: public KApplication
, public EngineObserver
52 static App
*instance() { return static_cast<App
*>( kapp
); }
54 static void handleCliArgs();
55 static void initCliArgs( int argc
, char *argv
[] );
57 static int mainThreadId
;
59 PlaylistWindow
*playlistWindow() const { return m_pPlaylistWindow
; }
62 friend class PlaylistWindow
; //requires access to applySettings()
65 void useScores( bool use
);
66 void useRatings( bool use
);
67 void moodbarPrefs( bool show
, bool moodier
, int alter
, bool withMusic
);
69 protected: /* for OSD, tray, and dcop */
70 void engineStateChanged( Engine::State state
, Engine::State oldState
= Engine::Empty
);
71 void engineNewMetaData( const MetaBundle
&bundle
, bool trackChanged
);
72 void engineTrackPositionChanged( long position
, bool /*userSeek*/ );
73 void engineVolumeChanged( int );
76 void setRating1() { setRating( 1 ); }
77 void setRating2() { setRating( 2 ); }
78 void setRating3() { setRating( 3 ); }
79 void setRating4() { setRating( 4 ); }
80 void setRating5() { setRating( 5 ); }
85 void applySettings( bool firstTime
= false );
86 void slotConfigAmarok( const QByteArray
& page
= QByteArray() );
87 void slotNewConfigAmarok( const QByteArray
& page
= QByteArray() );
88 void slotConfigShortcuts();
89 void slotConfigToolBars();
90 void slotConfigEqualizer();
91 void setUseScores( bool use
);
92 void setUseRatings( bool use
);
93 void setMoodbarPrefs( bool show
, bool moodier
, int alter
, bool withMusic
);
94 KIO::Job
*trashFiles( const KUrl::List
&files
);
98 void slotTrashResult( KJob
*job
);
101 void initGlobalShortcuts();
102 void firstRunWizard();
104 /** returns the playlistWindow */
105 QWidget
*mainWindow() const;
107 void setRating( int n
);
110 PlaylistWindow
*m_pPlaylistWindow
;
112 Amarok::TrayIcon
*m_pTray
;
114 MediaDeviceManager
*m_pMediaDeviceManager
;
117 #define pApp static_cast<App*>(kapp)
120 #endif // AMAROK_APP_H