ee5d29f8ec3a9e16f3f36bcea09e6fd659e97958
[vlc.git] / modules / gui / qt4 / components / infopanels.hpp
1 /*****************************************************************************
2  * infopanels.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  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
23  *****************************************************************************/
24
25 #ifndef _INFOPANELS_H_
26 #define _INFOPANELS_H_
27
28 #include <vlc/vlc.h>
29 #include <vlc_meta.h>
30
31 #include <QWidget>
32
33 #ifdef HAVE_LIMITS_H
34 #   include <limits.h>
35 #endif
36
37 #define setSpinBounds( spinbox ) {               \
38     spinbox->setRange( 0, INT_MAX );             \
39     spinbox->setAccelerated( true ) ;            \
40     spinbox->setAlignment( Qt::AlignRight );     \
41     spinbox->setSpecialValueText(""); }
42
43 class QTreeWidget;
44 class QTreeWidgetItem;
45 class QTreeView;
46 class QSpinBox;
47 class QLineEdit;
48 class QLabel;
49
50 class MetaPanel: public QWidget
51 {
52     Q_OBJECT;
53 public:
54     MetaPanel( QWidget *, intf_thread_t * );
55     virtual ~MetaPanel();
56 private:
57     intf_thread_t *p_intf;
58     QLineEdit *uri_text;
59     QLineEdit *title_text;
60     QLineEdit *artist_text;
61     QLineEdit *genre_text;
62     QLineEdit *copyright_text;
63     QLineEdit *collection_text;
64     QSpinBox *seqnum_text;
65     QLineEdit *description_text;
66     QSpinBox *rating_text;
67     QSpinBox *date_text;
68     QLineEdit *setting_text;
69     QLineEdit *language_text;
70     QLineEdit *nowplaying_text;
71     QLineEdit *publisher_text;
72     QLabel *art_cover;
73
74 public slots:
75     void update( input_item_t * );
76     void clear();
77 private slots:
78     void setArt( QString );
79 signals:
80     void uriSet( QString );
81 };
82
83 class ExtraMetaPanel: public QWidget
84 {
85     Q_OBJECT;
86 public:
87     ExtraMetaPanel( QWidget *, intf_thread_t * );
88     virtual  ~ExtraMetaPanel() {};
89 private:
90     intf_thread_t *p_intf;
91     QTreeWidget *extraMetaTree;
92 public slots:
93     void update( input_item_t * );
94     void clear();
95 };
96
97 class InputStatsPanel: public QWidget
98 {
99     Q_OBJECT;
100 public:
101     InputStatsPanel( QWidget *, intf_thread_t * );
102     virtual ~InputStatsPanel();
103 private:
104     intf_thread_t *p_intf;
105
106     QTreeWidget *StatsTree;
107     QTreeWidgetItem *input;
108     QTreeWidgetItem *read_media_stat;
109     QTreeWidgetItem *input_bitrate_stat;
110     QTreeWidgetItem *demuxed_stat;
111     QTreeWidgetItem *stream_bitrate_stat;
112
113     QTreeWidgetItem *video;
114     QTreeWidgetItem *vdecoded_stat;
115     QTreeWidgetItem *vdisplayed_stat;
116     QTreeWidgetItem *vlost_frames_stat;
117
118     QTreeWidgetItem *streaming;
119     QTreeWidgetItem *send_stat;
120     QTreeWidgetItem *send_bytes_stat;
121     QTreeWidgetItem *send_bitrate_stat;
122
123     QTreeWidgetItem *audio;
124     QTreeWidgetItem *adecoded_stat;
125     QTreeWidgetItem *aplayed_stat;
126     QTreeWidgetItem *alost_stat;
127
128 public slots:
129     void update( input_item_t * );
130     void clear();
131 };
132
133 class InfoPanel: public QWidget
134 {
135     Q_OBJECT;
136 public:
137     InfoPanel( QWidget *, intf_thread_t * );
138     virtual ~InfoPanel();
139 private:
140     intf_thread_t *p_intf;
141     QTreeWidget *InfoTree;
142 public slots:
143     void update( input_item_t * );
144     void clear();
145 };
146 #endif