2010-06-06 16:06:23 +02:00
|
|
|
/* 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"
|
2010-06-06 16:06:23 +02:00
|
|
|
|
|
|
|
class GstEngine;
|
2010-06-06 20:18:06 +02:00
|
|
|
class ProjectMVisualisation;
|
|
|
|
class VisualisationOverlay;
|
2010-06-06 16:06:23 +02:00
|
|
|
|
2010-06-06 20:18:06 +02:00
|
|
|
class VisualisationContainer : public QGraphicsView {
|
2010-06-06 16:06:23 +02:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
VisualisationContainer(QWidget* parent = 0);
|
|
|
|
|
2010-06-06 20:17:41 +02:00
|
|
|
static const char* kSettingsGroup;
|
|
|
|
static const int kDefaultWidth;
|
|
|
|
static const int kDefaultHeight;
|
2010-06-06 20:18:06 +02:00
|
|
|
static const int kDefaultFps;
|
2010-06-06 20:17:41 +02:00
|
|
|
|
2010-06-06 16:06:23 +02:00
|
|
|
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();
|
2010-06-06 16:06:23 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
// QWidget
|
|
|
|
void showEvent(QShowEvent*);
|
|
|
|
void hideEvent(QHideEvent*);
|
2010-06-06 20:17:41 +02:00
|
|
|
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);
|
2010-06-06 16:06:23 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
GstEngine* engine_;
|
|
|
|
ProjectMVisualisation* vis_;
|
2010-06-06 20:18:06 +02:00
|
|
|
VisualisationOverlay* overlay_;
|
|
|
|
QBasicTimer update_timer_;
|
|
|
|
|
|
|
|
QGraphicsProxyWidget* overlay_proxy_;
|
|
|
|
|
|
|
|
int fps_;
|
2010-06-06 16:06:23 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // VISUALISATIONCONTAINER_H
|