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