Clementine-audio-player-Mac.../src/visualisations/visualisationcontainer.h

76 lines
1.9 KiB
C
Raw Normal View History

/* This file is part of Clementine.
Clementine 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, either version 3 of the License, or
(at your option) any later version.
Clementine is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VISUALISATIONCONTAINER_H
#define VISUALISATIONCONTAINER_H
2010-06-06 20:18:06 +02:00
#include <QGraphicsView>
#include <QBasicTimer>
#include "core/song.h"
class GstEngine;
2010-06-06 20:18:06 +02:00
class ProjectMVisualisation;
class VisualisationOverlay;
2010-06-06 20:18:06 +02:00
class VisualisationContainer : public QGraphicsView {
Q_OBJECT
public:
VisualisationContainer(QWidget* parent = 0);
static const char* kSettingsGroup;
static const int kDefaultWidth;
static const int kDefaultHeight;
2010-06-06 20:18:06 +02:00
static const int kDefaultFps;
void SetEngine(GstEngine* engine);
2010-06-06 20:18:06 +02:00
void SetActions(QAction* previous, QAction* play_pause,
QAction* stop, QAction* next);
public slots:
void SongMetadataChanged(const Song& metadata);
void Stopped();
protected:
// QWidget
void showEvent(QShowEvent*);
void hideEvent(QHideEvent*);
void resizeEvent(QResizeEvent *);
2010-06-06 20:18:06 +02:00
void timerEvent(QTimerEvent *);
void mouseMoveEvent(QMouseEvent *event);
void enterEvent(QEvent *);
void leaveEvent(QEvent *);
private:
void SizeChanged();
private slots:
void ChangeOverlayOpacity(qreal value);
private:
GstEngine* engine_;
ProjectMVisualisation* vis_;
2010-06-06 20:18:06 +02:00
VisualisationOverlay* overlay_;
QBasicTimer update_timer_;
QGraphicsProxyWidget* overlay_proxy_;
int fps_;
};
#endif // VISUALISATIONCONTAINER_H