]> git.sesse.net Git - vlc/blob - modules/gui/qt4/components/infopanels.cpp
*Qt4: InfoTabs, the layout..
[vlc] / modules / gui / qt4 / components / infopanels.cpp
1 /*****************************************************************************
2  * infopanels.cpp : Panels for the information dialogs
3  ****************************************************************************
4  * Copyright (C) 2006 the VideoLAN team
5  * $Id$
6  *
7  * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #include "components/infopanels.hpp"
25 #include "qt4.hpp"
26
27 #include <QTreeWidget>
28 #include <QPushButton>
29
30 InputStatsPanel::InputStatsPanel( QWidget *parent, intf_thread_t *_p_intf ) :
31                                   QWidget( parent ), p_intf( _p_intf )
32 {
33     ui.setupUi( this );
34 }
35
36 InputStatsPanel::~InputStatsPanel()
37 {
38 }
39
40 void InputStatsPanel::Update( input_item_t *p_item )
41 {
42
43     vlc_mutex_lock( &p_item->p_stats->lock );
44
45 #define UPDATE( widget,format, calc... ) \
46     { QString str; ui.widget->setText( str.sprintf( format, ## calc ) );  }
47
48     UPDATE( read_text, "%8.0f kB", (float)(p_item->p_stats->i_read_bytes)/1000);
49     UPDATE( input_bitrate_text, "%6.0f kb/s",
50                     (float)(p_item->p_stats->f_input_bitrate * 8000 ));
51     UPDATE( demuxed_text, "%8.0f kB",
52                     (float)(p_item->p_stats->i_demux_read_bytes)/1000 );
53     UPDATE( stream_bitrate_text, "%6.0f kb/s",
54                     (float)(p_item->p_stats->f_demux_bitrate * 8000 ));
55
56     /* Video */
57     UPDATE( vdecoded_text, "%5i", p_item->p_stats->i_decoded_video );
58     UPDATE( vdisplayed_text, "%5i", p_item->p_stats->i_displayed_pictures );
59     UPDATE( vlost_frames, "%5i", p_item->p_stats->i_lost_pictures );
60
61     /* Sout */
62     UPDATE( sent_text, "%5i", p_item->p_stats->i_sent_packets );
63     UPDATE( sent_bytes_text, "%8.0f kB",
64             (float)(p_item->p_stats->i_sent_bytes)/1000 );
65     UPDATE( send_bitrate_text, "%6.0f kb/s",
66             (float)(p_item->p_stats->f_send_bitrate*8)*1000 );
67
68     /* Audio*/
69     UPDATE( adecoded_text, "%5i", p_item->p_stats->i_decoded_audio );
70     UPDATE( aplayed_text, "%5i", p_item->p_stats->i_played_abuffers );
71     UPDATE( alost_text, "%5i", p_item->p_stats->i_lost_abuffers );
72
73     vlc_mutex_unlock(& p_item->p_stats->lock );
74 }
75
76 void InputStatsPanel::Clear()
77 {
78 }
79
80 MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
81                                     QWidget( parent ), p_intf( _p_intf )
82 {
83
84 }
85 MetaPanel::~MetaPanel()
86 {
87 }
88 void MetaPanel::Update( input_item_t *p_item)
89 {
90 }
91 void MetaPanel::Clear()
92 {
93 }
94
95 char* MetaPanel::GetURI()
96 {
97     char *URI;
98     return URI;
99 }
100
101 char* MetaPanel::GetName()
102 {
103     char *Name;
104     return Name;
105 }
106
107 InfoPanel::InfoPanel( QWidget *parent, intf_thread_t *_p_intf ) :
108                                       QWidget( parent ), p_intf( _p_intf )
109 {
110 }
111 InfoPanel::~InfoPanel()
112 {
113 }
114 void InfoPanel::Update( input_item_t *p_item)
115 {
116 }
117 void InfoPanel::Clear()
118 {
119 }
120