2010-06-23 20:46:43 +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 DEVICESTATE_H
|
|
|
|
#define DEVICESTATE_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
2010-06-24 07:59:41 +00:00
|
|
|
#include <QMap>
|
|
|
|
#include <QPair>
|
|
|
|
#include <QVariant>
|
|
|
|
#include <QTabWidget>
|
2010-06-23 20:46:43 +00:00
|
|
|
|
2010-06-29 06:14:36 +00:00
|
|
|
#include "skin_parser.h"
|
|
|
|
|
2010-06-23 20:46:43 +00:00
|
|
|
class DeviceState : public QWidget {
|
2010-06-24 07:59:41 +00:00
|
|
|
|
2010-06-23 20:46:43 +00:00
|
|
|
Q_OBJECT
|
2010-06-24 07:59:41 +00:00
|
|
|
|
2010-06-23 20:46:43 +00:00
|
|
|
public:
|
2010-06-24 07:59:41 +00:00
|
|
|
enum InputType
|
|
|
|
{
|
|
|
|
Text,
|
|
|
|
Slide,
|
|
|
|
Spin,
|
|
|
|
DSpin,
|
|
|
|
Combo,
|
|
|
|
Check
|
|
|
|
};
|
|
|
|
|
2010-06-23 20:46:43 +00:00
|
|
|
DeviceState(QWidget *parent = 0);
|
|
|
|
virtual ~DeviceState();
|
|
|
|
|
2010-06-29 06:14:36 +00:00
|
|
|
QVariant data(QString tag, int paramCount = 0,
|
|
|
|
skin_tag_parameter* params = 0);
|
2010-06-26 05:18:21 +00:00
|
|
|
void setData(QString tag, QVariant data);
|
2010-06-24 07:59:41 +00:00
|
|
|
|
2010-06-24 18:43:06 +00:00
|
|
|
signals:
|
|
|
|
void settingsChanged();
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void input();
|
|
|
|
|
2010-06-23 20:46:43 +00:00
|
|
|
private:
|
2010-07-08 06:54:08 +00:00
|
|
|
static QString fileName(QString path, bool extension);
|
|
|
|
static QString directory(QString path, int level);
|
2010-07-08 08:14:04 +00:00
|
|
|
static QString secsToString(int secs);
|
2010-07-08 06:54:08 +00:00
|
|
|
|
2010-06-24 07:59:41 +00:00
|
|
|
QMap<QString, QPair<InputType, QWidget*> > inputs;
|
|
|
|
QTabWidget tabs;
|
2010-06-23 20:46:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DEVICESTATE_H
|