2c6c14e1362c666d7883e9e823c6b2b5926d86bb
[vlc.git] / modules / gui / qt4 / components / info_panels.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  *          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 #include <vlc/vlc.h>
30 #include <vlc_meta.h>
31
32 #include <QWidget>
33
34 #ifdef HAVE_LIMITS_H
35 #   include <limits.h>
36 #endif
37
38 #define setSpinBounds( spinbox ) {               \
39     spinbox->setRange( 0, INT_MAX );             \
40     spinbox->setAccelerated( true ) ;            \
41     spinbox->setAlignment( Qt::AlignRight );     \
42     spinbox->setSpecialValueText(""); }
43
44 class QTreeWidget;
45 class QTreeWidgetItem;
46 class QTreeView;
47 class QSpinBox;
48 class QLineEdit;
49 class QLabel;
50
51 class MetaPanel: public QWidget
52 {
53     Q_OBJECT;
54 public:
55     MetaPanel( QWidget *, intf_thread_t * );
56     virtual ~MetaPanel();
57     void saveMeta();
58
59     bool isInEditMode();
60     void setEditMode( bool );
61
62 private:
63     input_item_t *p_input;
64     intf_thread_t *p_intf;
65     bool b_inEditMode;
66
67     QLineEdit *title_text;
68     QLineEdit *artist_text;
69     QLineEdit *genre_text;
70     QLineEdit *copyright_text;
71     QLineEdit *collection_text;
72     QLineEdit *seqnum_text;
73     QLineEdit *description_text;
74 //    QSpinBox *rating_text;
75     QLineEdit *date_text;
76 //    QLineEdit *setting_text;
77     QLineEdit *language_text;
78     QLineEdit *nowplaying_text;
79     QLineEdit *publisher_text;
80 //    QLineEdit *encodedby_text;
81     QLabel *art_cover;
82
83 public slots:
84     void update( input_item_t * );
85     void clear();
86
87 private slots:
88     void enterEditMode();
89
90 signals:
91     void uriSet( QString );
92     void editing();
93 };
94
95 class ExtraMetaPanel: public QWidget
96 {
97     Q_OBJECT;
98 public:
99     ExtraMetaPanel( QWidget *, intf_thread_t * );
100     virtual  ~ExtraMetaPanel() {};
101 private:
102     intf_thread_t *p_intf;
103     QTreeWidget *extraMetaTree;
104 public slots:
105     void update( input_item_t * );
106     void clear();
107 };
108
109 class InputStatsPanel: public QWidget
110 {
111     Q_OBJECT;
112 public:
113     InputStatsPanel( QWidget *, intf_thread_t * );
114     virtual ~InputStatsPanel();
115 private:
116     intf_thread_t *p_intf;
117
118     QTreeWidget *StatsTree;
119     QTreeWidgetItem *input;
120     QTreeWidgetItem *read_media_stat;
121     QTreeWidgetItem *input_bitrate_stat;
122     QTreeWidgetItem *demuxed_stat;
123     QTreeWidgetItem *stream_bitrate_stat;
124
125     QTreeWidgetItem *video;
126     QTreeWidgetItem *vdecoded_stat;
127     QTreeWidgetItem *vdisplayed_stat;
128     QTreeWidgetItem *vlost_frames_stat;
129     QTreeWidgetItem *vfps_stat;
130
131     QTreeWidgetItem *streaming;
132     QTreeWidgetItem *send_stat;
133     QTreeWidgetItem *send_bytes_stat;
134     QTreeWidgetItem *send_bitrate_stat;
135
136     QTreeWidgetItem *audio;
137     QTreeWidgetItem *adecoded_stat;
138     QTreeWidgetItem *aplayed_stat;
139     QTreeWidgetItem *alost_stat;
140
141 public slots:
142     void update( input_item_t * );
143     void clear();
144 };
145
146 class InfoPanel: public QWidget
147 {
148     Q_OBJECT;
149 public:
150     InfoPanel( QWidget *, intf_thread_t * );
151     virtual ~InfoPanel();
152 private:
153     intf_thread_t *p_intf;
154     QTreeWidget *InfoTree;
155 public slots:
156     void update( input_item_t * );
157     void clear();
158 };
159 #endif