Robert Bieber | 73a3747 | 2010-07-08 21:53:27 +0000 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * __________ __ ___. |
| 3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ |
| 4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / |
| 5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < |
| 6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ |
| 7 | * \/ \/ \/ \/ \/ |
| 8 | * $Id$ |
| 9 | * |
| 10 | * Copyright (C) 2010 Robert Bieber |
| 11 | * |
| 12 | * This program is free software; you can redistribute it and/or |
| 13 | * modify it under the terms of the GNU General Public License |
| 14 | * as published by the Free Software Foundation; either version 2 |
| 15 | * of the License, or (at your option) any later version. |
| 16 | * |
| 17 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY |
| 18 | * KIND, either express or implied. |
| 19 | * |
| 20 | ****************************************************************************/ |
| 21 | |
| 22 | #ifndef SKINTIMER_H |
| 23 | #define SKINTIMER_H |
| 24 | |
| 25 | #include <QWidget> |
| 26 | #include <QTimer> |
Robert Bieber | b990664 | 2010-07-09 02:11:34 +0000 | [diff] [blame^] | 27 | #include <QToolButton> |
Robert Bieber | 73a3747 | 2010-07-08 21:53:27 +0000 | [diff] [blame] | 28 | |
| 29 | #include "devicestate.h" |
| 30 | |
| 31 | namespace Ui { |
| 32 | class SkinTimer; |
| 33 | } |
| 34 | |
| 35 | class SkinTimer : public QWidget { |
| 36 | Q_OBJECT |
| 37 | public: |
| 38 | static const int millisPerTick; |
| 39 | |
| 40 | SkinTimer(DeviceState* device, QWidget *parent = 0); |
| 41 | ~SkinTimer(); |
| 42 | |
| 43 | private slots: |
| 44 | void start(); |
| 45 | void stop(); |
| 46 | void tick(); |
| 47 | void stateChange(); |
Robert Bieber | b990664 | 2010-07-09 02:11:34 +0000 | [diff] [blame^] | 48 | void deviceChange(); |
Robert Bieber | 73a3747 | 2010-07-08 21:53:27 +0000 | [diff] [blame] | 49 | |
| 50 | private: |
| 51 | void setupUI(); |
| 52 | |
| 53 | Ui::SkinTimer *ui; |
| 54 | DeviceState* device; |
| 55 | |
| 56 | QTimer timer; |
| 57 | unsigned long int elapsedTime; |
Robert Bieber | b990664 | 2010-07-09 02:11:34 +0000 | [diff] [blame^] | 58 | unsigned long int totalTime; |
| 59 | |
| 60 | QList<QToolButton*> playStateButtons; |
Robert Bieber | 73a3747 | 2010-07-08 21:53:27 +0000 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | #endif // SKINTIMER_H |