]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/info_panels.hpp
e7d7617edae2e6d8267a3503ef2ed39d990a34b8
[vlc] / modules / gui / qt4 / components / info_panels.hpp
1 /*****************************************************************************
2  * info_panels.hpp : Panels for the information dialogs
3  ****************************************************************************
4  * Copyright (C) 2006-2007 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *          Jean-Baptiste Kempf <jb@videolan.org>
9  *          Ilkka Ollakka <ileoo@videolan.org>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 2 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, write to the Free Software
23  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
24  *****************************************************************************/
25
26 #ifndef _INFOPANELS_H_
27 #define _INFOPANELS_H_
28
29 #ifdef HAVE_CONFIG_H
30 # include "config.h"
31 #endif
32
33 #include <vlc_common.h>
34 #include <vlc_meta.h>
35
36 #include <QWidget>
37
38 #include <limits.h>
39
40 #define setSpinBounds( spinbox ) {               \
41     spinbox->setRange( 0, INT_MAX );             \
42     spinbox->setAccelerated( true ) ;            \
43     spinbox->setAlignment( Qt::AlignRight );     \
44     spinbox->setSpecialValueText(""); }
45
46 class QTreeWidget;
47 class QTreeWidgetItem;
48 class QTreeView;
49 class QSpinBox;
50 class QLineEdit;
51 class CoverArtLabel;
52 class QTextEdit;
53 class QLabel;
54 class VLCStatsView;
55 class QPushButton;
56
57 class MetaPanel: public QWidget
58 {
59     Q_OBJECT
60 public:
61     MetaPanel( QWidget *, struct intf_thread_t * );
62     void saveMeta();
63
64     bool isInEditMode();
65     void setEditMode( bool );
66
67 private:
68     input_item_t *p_input;
69     struct intf_thread_t *p_intf;
70     bool b_inEditMode;
71
72     QLineEdit *title_text;
73     QLineEdit *artist_text;
74     QLineEdit *genre_text;
75     QLineEdit *copyright_text;
76     QLineEdit *collection_text;
77     QLineEdit *seqnum_text;
78     QLineEdit *seqtot_text;
79
80     QTextEdit *description_text;
81 //    QSpinBox *rating_text;
82     QLineEdit *date_text;
83 //    QLineEdit *setting_text;
84     QLineEdit *language_text;
85     QLineEdit *nowplaying_text;
86     QLineEdit *publisher_text;
87     QLineEdit *encodedby_text;
88     CoverArtLabel *art_cover;
89
90     QLabel   *lblURL;
91     QString  currentURL;
92
93     QPushButton *fingerprintButton;
94
95 public slots:
96     void update( input_item_t * );
97     void clear();
98     void fingerprint();
99     void fingerprintUpdate( input_item_t * );
100
101 private slots:
102     void enterEditMode();
103
104 signals:
105     void uriSet( const QString& );
106     void editing();
107 };
108
109 class ExtraMetaPanel: public QWidget
110 {
111     Q_OBJECT
112 public:
113     ExtraMetaPanel( QWidget * );
114 private:
115     QTreeWidget *extraMetaTree;
116 public slots:
117     void update( input_item_t * );
118     void clear();
119 };
120
121 class InputStatsPanel: public QWidget
122 {
123     Q_OBJECT
124 public:
125     InputStatsPanel( QWidget * );
126 protected:
127     virtual void hideEvent( QHideEvent * );
128 private:
129     QTreeWidget *StatsTree;
130     QTreeWidgetItem *input;
131     QTreeWidgetItem *read_media_stat;
132     QTreeWidgetItem *input_bitrate_stat;
133     QTreeWidgetItem *input_bitrate_graph;
134     QTreeWidgetItem *demuxed_stat;
135     QTreeWidgetItem *stream_bitrate_stat;
136     QTreeWidgetItem *corrupted_stat;
137     QTreeWidgetItem *discontinuity_stat;
138
139     QTreeWidgetItem *video;
140     QTreeWidgetItem *vdecoded_stat;
141     QTreeWidgetItem *vdisplayed_stat;
142     QTreeWidgetItem *vlost_frames_stat;
143     QTreeWidgetItem *vfps_stat;
144
145     QTreeWidgetItem *streaming;
146     QTreeWidgetItem *send_stat;
147     QTreeWidgetItem *send_bytes_stat;
148     QTreeWidgetItem *send_bitrate_stat;
149
150     QTreeWidgetItem *audio;
151     QTreeWidgetItem *adecoded_stat;
152     QTreeWidgetItem *aplayed_stat;
153     QTreeWidgetItem *alost_stat;
154
155     VLCStatsView *statsView;
156 public slots:
157     void update( input_item_t * );
158     void clear();
159 };
160
161 class InfoPanel: public QWidget
162 {
163     Q_OBJECT
164 public:
165     InfoPanel( QWidget * );
166 private:
167     QTreeWidget *InfoTree;
168 public slots:
169     void update( input_item_t * );
170     void clear();
171 };
172
173 #endif