summaryrefslogtreecommitdiffstats
path: root/noatun/modules/winskin/waSkin.h
blob: 7a2db9e10cfd3fcf268bbe360c1626e5379eb710 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/*
  Winamp Skin
  Copyright (C) 1999  Martin Vogt
  Copyright (C) 2001  Ryan Cumming

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation.

  For more information look at the file COPYRIGHT in this package

 */



#ifndef __WASKIN_H
#define __WASKIN_H

#include <noatun/plugin.h>
#include <noatun/app.h>
#include <noatun/player.h>
#include <qwidget.h>

// Use forward declarations so we compile in a finite time
class WaSkinModel;
class WaSkinManager;

class WaButton;
class WaDigit;
class WaLabel;
class WaInfo;
class WaMain;
class WaIndicator;
class WaTitleBar;
class WaClutterbar;
class WaStatus;

class WaJumpSlider;
class WaVolumeSlider;
class WaBalanceSlider;

class GuiSpectrumAnalyser;

class WaSkin;
extern WaSkin *_waskin_instance;

class WaSkin : public QWidget, public UserInterface {
  Q_OBJECT 
  NOATUNPLUGIND
    WaSkinModel *waSkinModel;
    WaSkinManager *waSkinManager;

  public:
     WaSkin();
    ~WaSkin();

    int getSkinId();

    void loadSkin(QString skinDir);
    void setChannels(int val);

    QSize sizeHint() const;

    static QString defaultSkin();
    static WaSkin *instance() { return _waskin_instance; }

  public slots:
    void repeatClickedEvent(bool);
    void shuffleClickedEvent(bool);
    void playlistClickedEvent(bool);
    void eqClickedEvent();

    // seek bar
    void jump(int second);
    void jumpSliderPressed();
    void jumpSliderReleased();
    void jumpValueChanged(int);

    void menuEvent();
    void minimizeEvent();
    void shadeEvent();
    void doUnload();
    void doClose();

    // balance
    void balanceSliderPressed();
    void balanceSetValue(int val);
    void balanceSliderReleased();

    // volume
    void volumeSliderPressed();
    void volumeSetValue(int val);
    void volumeSliderReleased();

    void playCurrentEvent();
    void playPauseEvent();

    void loopChange(int loopType);
    void playlistShown();
    void playlistHidden();
    void newSong();

    void timetick();
    void digitsClicked();

    void slotPlaying();
    void slotStopped();
    void slotPaused();

    WaSkinModel *skinModel() { return waSkinModel; }
    WaSkinManager *skinManager() { return waSkinManager; }
    WaInfo *skinInfo() { return waInfo; }
    
  protected:
    void updateLoopStyle();

    void createButtons();
    void createHighLevelElements();

    void keyPressEvent(QKeyEvent *);

    void shade();
    void unshade();

    QString getTitleString();
    QString getTimeString(int milliseconds, bool truncate = false);

    void focusOutEvent ( QFocusEvent * );
    void focusInEvent ( QFocusEvent * );

    void dragEnterEvent(QDragEnterEvent * event);
    void dropEvent(QDropEvent * event);

    void wheelEvent(QWheelEvent *e);

    WaButton *prev;
    WaButton *play;
    WaButton *pause;
    WaButton *stop;
    WaButton *next;
    WaButton *eject;
    WaButton *shuffle;
    WaButton *repeat;
    WaButton *playlist;
    WaButton *eq;

    WaButton *menu;
    WaButton *minimize;
    WaButton *titleshade;
    WaButton *close;

    WaJumpSlider *waJumpSlider;
    WaVolumeSlider *waVolumeSlider;
    WaBalanceSlider *waBalanceSlider;
    WaDigit *waDigit;

    WaLabel *waBPS;
    WaLabel *waFreq;

    WaInfo *waInfo;
    WaStatus *waStatus;
    WaIndicator *waStereo;
    WaIndicator *waMono;

    WaMain *main;
    WaTitleBar *waTitleBar;
    WaClutterbar *waClutterbar;

    GuiSpectrumAnalyser *guiSpectrumAnalyser;

    bool title_shaded;

    bool mJumpPressed;
    bool mBalancePressed;
    bool mVolumePressed;
};
#endif