2010-06-17 20:44:11 +00:00
|
|
|
/***************************************************************************
|
|
|
|
* __________ __ ___.
|
|
|
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
|
|
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
|
|
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
|
|
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
|
|
|
* \/ \/ \/ \/ \/
|
|
|
|
* $Id$
|
|
|
|
*
|
|
|
|
* Copyright (C) 2010 Robert Bieber
|
|
|
|
*
|
|
|
|
* 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; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
|
|
* KIND, either express or implied.
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef RBSCREEN_H
|
|
|
|
#define RBSCREEN_H
|
|
|
|
|
|
|
|
#include <QGraphicsItem>
|
|
|
|
|
|
|
|
#include "projectmodel.h"
|
2010-06-21 20:11:58 +00:00
|
|
|
#include "rbrenderinfo.h"
|
2010-06-22 07:55:50 +00:00
|
|
|
#include "rbimage.h"
|
2010-06-23 20:18:31 +00:00
|
|
|
#include "rbfont.h"
|
2010-06-30 19:35:00 +00:00
|
|
|
#include "rbalbumart.h"
|
|
|
|
#include "rbviewport.h"
|
2010-06-17 20:44:11 +00:00
|
|
|
|
|
|
|
class RBScreen : public QGraphicsItem
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2010-06-26 05:51:07 +00:00
|
|
|
RBScreen(const RBRenderInfo& info, bool remote = false,
|
|
|
|
QGraphicsItem *parent = 0);
|
2010-06-17 20:44:11 +00:00
|
|
|
virtual ~RBScreen();
|
|
|
|
|
|
|
|
QPainterPath shape() const;
|
|
|
|
QRectF boundingRect() const;
|
|
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option,
|
|
|
|
QWidget *widget);
|
|
|
|
|
2010-06-18 21:10:01 +00:00
|
|
|
int getWidth() const{ return width; }
|
|
|
|
int getHeight() const{ return height; }
|
|
|
|
|
2010-06-24 18:55:04 +00:00
|
|
|
void loadViewport(QString name, RBViewport* view);
|
2010-06-21 20:11:58 +00:00
|
|
|
void showViewport(QString name);
|
2010-06-29 21:09:29 +00:00
|
|
|
bool viewPortDisplayed(QString name)
|
|
|
|
{
|
|
|
|
return displayedViewports.contains(name);
|
|
|
|
}
|
2010-06-17 20:44:11 +00:00
|
|
|
|
2010-06-22 07:55:50 +00:00
|
|
|
void loadImage(QString name, RBImage* image)
|
|
|
|
{
|
|
|
|
images.insert(name, image);
|
2010-06-23 07:18:22 +00:00
|
|
|
image->hide();
|
2010-06-22 07:55:50 +00:00
|
|
|
}
|
|
|
|
RBImage* getImage(QString name){ return images.value(name, 0); }
|
|
|
|
|
2010-06-23 20:18:31 +00:00
|
|
|
void loadFont(int id, RBFont* font);
|
|
|
|
RBFont* getFont(int id);
|
|
|
|
|
2010-06-22 07:55:50 +00:00
|
|
|
void setBackdrop(QString filename);
|
2010-06-25 05:14:13 +00:00
|
|
|
bool hasBackdrop(){ return backdrop != 0; }
|
2010-06-23 19:41:30 +00:00
|
|
|
void makeCustomUI(QString id);
|
2010-07-03 22:57:42 +00:00
|
|
|
void setCustomUI(RBViewport* viewport){ customUI = viewport; }
|
|
|
|
RBViewport* getCustomUI(){ return customUI; }
|
2010-06-22 07:55:50 +00:00
|
|
|
|
2010-06-17 20:44:11 +00:00
|
|
|
static QColor stringToColor(QString str, QColor fallback);
|
|
|
|
|
2010-06-25 05:14:13 +00:00
|
|
|
QColor foreground(){ return fgColor; }
|
|
|
|
QColor background(){ return bgColor; }
|
|
|
|
|
2010-06-30 19:35:00 +00:00
|
|
|
void setAlbumArt(RBAlbumArt* art){ albumArt = art; }
|
|
|
|
void showAlbumArt(RBViewport* view)
|
|
|
|
{
|
|
|
|
if(albumArt)
|
|
|
|
{
|
|
|
|
albumArt->setParentItem(view);
|
|
|
|
albumArt->show();
|
2010-08-05 08:03:32 +00:00
|
|
|
albumArt->enableMove();
|
2010-06-30 19:35:00 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-07-03 22:57:42 +00:00
|
|
|
void breakSBS();
|
2010-06-18 21:10:01 +00:00
|
|
|
|
2010-06-17 20:44:11 +00:00
|
|
|
private:
|
|
|
|
int width;
|
|
|
|
int height;
|
2010-07-03 22:57:42 +00:00
|
|
|
int fullWidth;
|
|
|
|
int fullHeight;
|
2010-06-17 20:44:11 +00:00
|
|
|
QColor bgColor;
|
|
|
|
QColor fgColor;
|
|
|
|
QPixmap* backdrop;
|
2010-06-22 07:55:50 +00:00
|
|
|
QString themeBase;
|
2010-06-17 20:44:11 +00:00
|
|
|
|
|
|
|
ProjectModel* project;
|
|
|
|
|
2010-06-24 18:55:04 +00:00
|
|
|
QMap<QString, QList<RBViewport*>*> namedViewports;
|
2010-06-22 07:55:50 +00:00
|
|
|
QMap<QString, RBImage*> images;
|
|
|
|
QMap<QString, QString>* settings;
|
2010-06-23 20:18:31 +00:00
|
|
|
QMap<int, RBFont*> fonts;
|
2010-06-29 21:09:29 +00:00
|
|
|
QList<QString> displayedViewports;
|
2010-06-21 20:11:58 +00:00
|
|
|
|
2010-06-30 19:35:00 +00:00
|
|
|
RBAlbumArt* albumArt;
|
2010-07-03 22:57:42 +00:00
|
|
|
RBViewport* customUI;
|
2010-06-17 20:44:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // RBSCREEN_H
|