/src/libtomahawk/playlist/dynamic/echonest/EchonestSteerer.h
C Header | 97 lines | 54 code | 22 blank | 21 comment | 0 complexity | 655b1bea574f3e063935ee1c3e8a7ddb MD5 | raw file
1/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === 2 * 3 * Copyright 2010-2011, Leo Franchi <lfranchi@kde.org> 4 * 5 * Tomahawk is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * Tomahawk is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with Tomahawk. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19#ifndef ECHONEST_STEERER_H 20#define ECHONEST_STEERER_H 21 22#include <QWidget> 23#include <QTimeLine> 24 25class QPropertyAnimation; 26class QToolButton; 27class QLabel; 28class QComboBox; 29class QVBoxLayout; 30class QLineEdit; 31class QHBoxLayout; 32 33namespace Tomahawk 34{ 35 36class EchonestSteerer : public QWidget 37{ 38 Q_OBJECT 39 Q_PROPERTY( qreal opacity READ opacity WRITE setOpacity ) 40 41public: 42 EchonestSteerer( QWidget* parent = 0 ); 43 44 virtual void paintEvent(QPaintEvent* ); 45 46public slots: 47 void applySteering(); 48 void resetSteering( bool automatic = false ); 49 50 void fadeIn(); 51 void fadeOut(); 52 qreal opacity() const { return m_opacity; } 53 void setOpacity( qreal opacity ); 54signals: 55 void steerField( const QString& field ); 56 void steerDescription( const QString& desc ); 57 void reset(); 58 59 void resized(); 60 61 // interface to DynamicWidget 62 void steeringChanged(); 63private slots: 64 void changed(); 65 66 void resizeFrame( int ); 67 68private: 69 QToolButton* initButton( QWidget* parent ); 70 71 QHBoxLayout* m_layout; 72 73 QComboBox* m_amplifier; 74 QComboBox* m_field; 75 76 QLineEdit* m_description; 77 78 // text on the left 79 QVBoxLayout* m_textL; 80 QLabel* m_steerTop; 81 QLabel* m_steerBottom; 82 83 // icons on the right 84 QToolButton* m_apply; 85 QToolButton* m_reset; 86 87 // animations 88 QTimeLine m_resizeAnim; 89 bool m_expanding; 90 91 QPropertyAnimation* m_fadeAnim; 92 qreal m_opacity; 93}; 94 95}; 96 97#endif