Switch to unified view

a/GUI/mainw/trayicon.h b/GUI/mainw/trayicon.h
1
/* GUI_TrayIcon.h */
2
3
/* Copyright (C) 2012  gleugner
1
/* Copyright (C) 2012  gleugner
4
 *
2
 *
5
 * This file is part of sayonara player
3
 * This file is part of sayonara player
6
 *
4
 *
7
 * This program is free software: you can redistribute it and/or modify
5
 * This program is free software: you can redistribute it and/or modify
...
...
15
 * GNU General Public License for more details.
13
 * GNU General Public License for more details.
16
14
17
 * You should have received a copy of the GNU General Public License
15
 * You should have received a copy of the GNU General Public License
18
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
 */
17
 */
20
21
22
#ifndef GUI_TRAYICON_H
18
#ifndef GUI_TRAYICON_H
23
#define GUI_TRAYICON_H
19
#define GUI_TRAYICON_H
24
20
25
#include "HelperStructs/CSettingsStorage.h"
26
#include "HelperStructs/MetaData.h"
21
#include "HelperStructs/MetaData.h"
27
22
28
//#include "Notification/Notification.h"
23
#include <QSystemTrayIcon>
29
//#include "Notification/NotificationPluginLoader.h"
30
24
31
class NotificationPluginLoader;
25
class QAction;
32
26
class QMenu;
33
#include <QSystemTrayIcon>
27
class CSettingsStorage;
34
#include <QAction>
35
#include <QTimer>
36
28
37
/**
29
/**
38
 * Small class to be used as tray icon
30
 * Small class to be used as tray icon
39
 */
31
 */
40
class GUI_TrayIcon : public QSystemTrayIcon {
32
class GUI_TrayIcon : public QSystemTrayIcon {
41
    Q_OBJECT
33
    Q_OBJECT;
34
42
public:
35
public:
43
36
44
    GUI_TrayIcon(QObject *parent = 0);
37
    GUI_TrayIcon(QObject *parent = 0);
45
    virtual ~GUI_TrayIcon();
46
38
47
    virtual bool event(QEvent * e);
39
    virtual bool event(QEvent * e);
48
    void set_timeout(int timeout_ms);
40
    void set_timeout(int timeout_ms);
49
    void set_notification_active(bool active);
50
41
51
    void set_enable_play(bool);
42
    void set_enable_play(bool);
52
    void set_enable_stop(bool);
43
    void set_enable_stop(bool);
53
    void set_enable_mute(bool);
44
    void set_enable_mute(bool);
54
    void set_enable_fwd(bool);
45
    void set_enable_fwd(bool);
...
...
56
    void set_enable_show(bool);
47
    void set_enable_show(bool);
57
48
58
    int get_vol_step();
49
    int get_vol_step();
59
50
60
public slots:
51
public slots:
61
    void trackChanged(const MetaData& md);
62
    void songChangedMessage(const MetaData& md);
52
    void songChangedMessage(const MetaData& md);
63
    void setPlaying(bool);
53
    void setPlaying(bool);
64
    void setMute(bool mute);
54
    void setMute(bool mute);
65
    void change_skin(QString stylesheet);
55
    void change_skin(QString stylesheet);
66
    void stop();
56
    void stop();
67
57
68
signals:
58
signals:
69
    /**
59
    /**
70
     * this event is fired, if we have a mouse wheel event
60
     * this event is fired, if we have a mouse wheel event
71
     * @param delta bigger then 0 when mouse wheel has moved forward
61
     * @param delta bigger then 0 when mouse wheel has moved forward
72
     smaller when moved backwards
62
     * smaller when moved backwards
73
    */
63
     */
74
    void sig_volume_changed_by_wheel(int delta);
64
    void sig_volume_changed_by_wheel(int delta);
75
    void sig_play_clicked();
65
    void sig_play_clicked();
76
    void sig_pause_clicked();
66
    void sig_pause_clicked();
77
    void sig_fwd_clicked();
67
    void sig_fwd_clicked();
78
    void sig_bwd_clicked();
68
    void sig_bwd_clicked();
...
...
88
    void fwd_clicked();
78
    void fwd_clicked();
89
    void bwd_clicked();
79
    void bwd_clicked();
90
    void show_clicked();
80
    void show_clicked();
91
    void close_clicked();
81
    void close_clicked();
92
    void mute_clicked();
82
    void mute_clicked();
93
    void timer_timed_out();
94
83
95
private:
84
private:
96
    QAction*    m_closeAction;
85
    QAction*    m_closeAction;
97
    QAction*    m_playAction;
86
    QAction*    m_playAction;
98
    QAction*    m_stopAction;
87
    QAction*    m_stopAction;
99
    QAction*    m_muteAction;
88
    QAction*    m_muteAction;
100
    QAction*    m_fwdAction;
89
    QAction*    m_fwdAction;
101
    QAction*    m_bwdAction;
90
    QAction*    m_bwdAction;
102
    QAction*    m_showAction;
91
    QAction*    m_showAction;
103
    QMenu*                      m_trayContextMenu;
92
    QMenu*      m_trayContextMenu;
104
93
105
    QIcon                   m_playIcon;
94
    QIcon                   m_playIcon;
106
    QIcon                   m_pauseIcon;
95
    QIcon                   m_pauseIcon;
107
    int                     m_timeout;
96
    int                     m_timeout;
108
    int                     m_vol_step;
97
    int                     m_vol_step;
109
98
110
    NotificationPluginLoader* m_plugin_loader;
111
112
    bool                    m_notification_active;
113
    bool                    m_playing;
99
    bool                    m_playing;
114
    bool                    m_mute;
100
    bool                    m_mute;
115
    CSettingsStorage*       m_settings;
101
    CSettingsStorage*       m_settings;
116
102
117
    bool            _md_set;
118
    MetaData            _md;
119
    QTimer*         _timer;
120
    bool            _mute;
103
    bool            _mute;
121
};
104
};
122
105
123
#endif
106
#endif