Switch to unified view

a/GUI/player/GUI_TrayIcon.h b/GUI/player/GUI_TrayIcon.h
...
...
32
32
33
#include <QSystemTrayIcon>
33
#include <QSystemTrayIcon>
34
#include <QAction>
34
#include <QAction>
35
#include <QTimer>
35
#include <QTimer>
36
36
37
38
39
40
/**
37
/**
41
  * Small class to be used as tray icon
38
 * Small class to be used as tray icon
42
  */
39
 */
43
class GUI_TrayIcon : public QSystemTrayIcon {
40
class GUI_TrayIcon : public QSystemTrayIcon {
44
    Q_OBJECT
41
    Q_OBJECT
45
public:
42
public:
46
43
47
    GUI_TrayIcon(QObject *parent = 0);
44
    GUI_TrayIcon(QObject *parent = 0);
48
    virtual ~GUI_TrayIcon();
45
    virtual ~GUI_TrayIcon();
49
46
50
    virtual bool event ( QEvent * e );
47
    virtual bool event(QEvent * e);
51
    void set_timeout(int timeout_ms);
48
    void set_timeout(int timeout_ms);
52
    void set_notification_active(bool active);
49
    void set_notification_active(bool active);
53
50
54
   void set_enable_play(bool);
51
    void set_enable_play(bool);
55
   void set_enable_stop(bool);
52
    void set_enable_stop(bool);
56
   void set_enable_mute(bool);
53
    void set_enable_mute(bool);
57
   void set_enable_fwd(bool);
54
    void set_enable_fwd(bool);
58
   void set_enable_bwd(bool);
55
    void set_enable_bwd(bool);
59
   void set_enable_show(bool);
56
    void set_enable_show(bool);
60
57
61
62
63
64
   int get_vol_step();
58
    int get_vol_step();
65
59
66
public slots:
60
public slots:
67
    void trackChanged(const MetaData& md);
61
    void trackChanged(const MetaData& md);
68
    void songChangedMessage (const MetaData& md);
62
    void songChangedMessage(const MetaData& md);
69
    void setPlaying(bool);
63
    void setPlaying(bool);
70
    void setMute(bool mute);
64
    void setMute(bool mute);
71
    void change_skin(QString stylesheet);
65
    void change_skin(QString stylesheet);
72
    void stop();
66
    void stop();
73
67
74
signals:
68
signals:
75
76
    /**
69
    /**
77
      * this event is fired, if we have a mouse wheel event
70
     * this event is fired, if we have a mouse wheel event
78
      * @param delta bigger then 0 when mouse wheel has moved forward smaller when moved backwards
71
     * @param delta bigger then 0 when mouse wheel has moved forward
72
     smaller when moved backwards
79
      */
73
    */
80
    void onVolumeChangedByWheel (int delta);
74
    void sig_volume_changed_by_wheel(int delta);
81
    void sig_play_clicked();
75
    void sig_play_clicked();
82
    void sig_pause_clicked();
76
    void sig_pause_clicked();
83
    void sig_fwd_clicked();
77
    void sig_fwd_clicked();
84
    void sig_bwd_clicked();
78
    void sig_bwd_clicked();
85
    void sig_show_clicked();
79
    void sig_show_clicked();
...
...
87
    void sig_close_clicked();
81
    void sig_close_clicked();
88
    void sig_mute_clicked();
82
    void sig_mute_clicked();
89
    void sig_stop_clicked();
83
    void sig_stop_clicked();
90
84
91
private slots:
85
private slots:
92
  void play_clicked();
86
    void play_clicked();
93
  void stop_clicked();
87
    void stop_clicked();
94
  void fwd_clicked();
88
    void fwd_clicked();
95
  void bwd_clicked();
89
    void bwd_clicked();
96
  void show_clicked();
90
    void show_clicked();
97
  void close_clicked();
91
    void close_clicked();
98
  void mute_clicked();
92
    void mute_clicked();
99
  void timer_timed_out();
93
    void timer_timed_out();
100
101
102
94
103
private:
95
private:
104
    /// some shared actions
105
    QAction*                  m_closeAction;
96
    QAction*    m_closeAction;
106
    QAction*                  m_playAction;
97
    QAction*    m_playAction;
107
    QAction*                  m_stopAction;
98
    QAction*    m_stopAction;
108
    QAction*                  m_muteAction;
99
    QAction*    m_muteAction;
109
    QAction*                  m_fwdAction;
100
    QAction*    m_fwdAction;
110
    QAction*                  m_bwdAction;
101
    QAction*    m_bwdAction;
111
    QAction*                    m_showAction;
102
    QAction*    m_showAction;
112
113
    QMenu*                      m_trayContextMenu;
103
    QMenu*                      m_trayContextMenu;
114
115
104
116
    QIcon                   m_playIcon;
105
    QIcon                   m_playIcon;
117
    QIcon                   m_pauseIcon;
106
    QIcon                   m_pauseIcon;
118
    int                     m_timeout;
107
    int                     m_timeout;
119
    int                       m_vol_step;
108
    int                     m_vol_step;
120
121
109
122
    NotificationPluginLoader* m_plugin_loader;
110
    NotificationPluginLoader* m_plugin_loader;
123
111
124
    bool                    m_notification_active;
112
    bool                    m_notification_active;
125
    bool                    m_playing;
113
    bool                    m_playing;
126
    bool                    m_mute;
114
    bool                    m_mute;
127
    CSettingsStorage*       m_settings;
115
    CSettingsStorage*       m_settings;
128
116
129
    bool          _md_set;
117
    bool            _md_set;
130
    MetaData          _md;
118
    MetaData            _md;
131
    QTimer*           _timer;
119
    QTimer*         _timer;
132
    bool            _mute;
120
    bool            _mute;
133
134
135
136
137
};
121
};
138
122
139
140
#endif
123
#endif