Commit 1f52d492 authored by Clément Stenac's avatar Clément Stenac

Qt4: add meta info panel and fix layout bug in stats

parent d4399026
......@@ -86,31 +86,68 @@ void InputStatsPanel::clear()
MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
QWidget( parent ), p_intf( _p_intf )
{
int line = 0;
QGridLayout *l = new QGridLayout( this );
#define ADD_META( string, widget ) { \
l->addWidget( new QLabel( qfu( string ) ), line, 0 ); \
widget = new QLabel( "" ); \
l->addWidget( widget, line, 1 ); \
line++; }
ADD_META( _( "Name" ), name_text );
ADD_META( _( "URI" ), uri_text );
ADD_META( VLC_META_ARTIST, artist_text );
ADD_META( VLC_META_GENRE, genre_text );
ADD_META( VLC_META_COPYRIGHT, copyright_text );
ADD_META( VLC_META_COLLECTION, collection_text );
ADD_META( VLC_META_SEQ_NUM, seqnum_text );
ADD_META( VLC_META_DESCRIPTION, description_text );
ADD_META( VLC_META_RATING, rating_text );
ADD_META( VLC_META_DATE, date_text );
ADD_META( VLC_META_LANGUAGE, language_text );
ADD_META( VLC_META_NOW_PLAYING, nowplaying_text );
ADD_META( VLC_META_PUBLISHER, publisher_text );
ADD_META( VLC_META_SETTING, setting_text );
}
MetaPanel::~MetaPanel()
{
}
void MetaPanel::update( input_item_t *p_item )
{
}
void MetaPanel::clear()
{
}
char* MetaPanel::getURI()
void MetaPanel::update( input_item_t *p_item )
{
char *URI;
return URI;
#define UPDATE_META( meta, widget ) { \
char* psz_meta = p_item->p_meta->psz_##meta; \
if( !EMPTY_STR( psz_meta ) ) \
widget->setText( qfu( psz_meta ) ); \
else \
widget->setText( "" ); }
if( !EMPTY_STR( p_item->psz_name ) )
name_text->setText( qfu( p_item->psz_name ) );
else name_text->setText( "" );
if( !EMPTY_STR( p_item->psz_uri ) )
uri_text->setText( qfu( p_item->psz_uri ) );
else uri_text->setText( "" );
UPDATE_META( artist, artist_text );
UPDATE_META( genre, genre_text );
UPDATE_META( copyright, copyright_text );
UPDATE_META( album, collection_text );
UPDATE_META( tracknum, seqnum_text );
UPDATE_META( description, description_text );
UPDATE_META( rating, rating_text );
UPDATE_META( date, date_text );
UPDATE_META( language, language_text );
UPDATE_META( nowplaying, nowplaying_text );
UPDATE_META( publisher, publisher_text );
UPDATE_META( setting, setting_text );
#undef UPDATE_META
}
char* MetaPanel::getName()
void MetaPanel::clear()
{
char *Name;
return Name;
}
InfoPanel::InfoPanel( QWidget *parent, intf_thread_t *_p_intf ) :
QWidget( parent ), p_intf( _p_intf )
{
......
......@@ -57,13 +57,25 @@ public:
virtual ~MetaPanel();
private:
intf_thread_t *p_intf;
QLabel *uri_text;
QLabel *name_text;
QLabel *artist_text;
QLabel *genre_text;
QLabel *copyright_text;
QLabel *collection_text;
QLabel *seqnum_text;
QLabel *description_text;
QLabel *rating_text;
QLabel *date_text;
QLabel *setting_text;
QLabel *language_text;
QLabel *nowplaying_text;
QLabel *publisher_text;
public slots:
void update( input_item_t * );
void clear();
char* getURI();
char* getName();
};
class InfoPanel: public QWidget
......
<ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>InputStats</class>
<widget class="QWidget" name="InputStats" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>470</width>
<height>300</height>
<width>486</width>
<height>302</height>
</rect>
</property>
<property name="windowTitle" >
<string>_("Form")</string>
</property>
<widget class="QGroupBox" name="groupBox_4" >
<property name="geometry" >
<rect>
<x>240</x>
<y>150</y>
<width>215</width>
<height>135</height>
</rect>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="1" >
<widget class="QGroupBox" name="groupBox_4" >
<property name="title" >
<string>_("Audio")</string>
</property>
......@@ -87,79 +84,60 @@
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox" >
</item>
<item row="1" column="0" >
<widget class="QGroupBox" name="groupBox_2" >
<property name="title" >
<string>_("Video")</string>
</property>
<widget class="QLabel" name="label_4" >
<property name="geometry" >
<rect>
<x>10</x>
<y>10</y>
<width>215</width>
<height>135</height>
<x>11</x>
<y>62</y>
<width>133</width>
<height>28</height>
</rect>
</property>
<property name="title" >
<string>_("Input")</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="1" >
<widget class="QLabel" name="read_text" >
<property name="text" >
<string>0</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="input_bitrate_text" >
<property name="text" >
<string>0</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<string>_("Displayed frames")</string>
</property>
</widget>
</item>
<item row="3" column="2" >
<widget class="QLabel" name="sent_bytes_text_6" >
<property name="text" >
<string>kb/s</string>
<widget class="QLabel" name="label_6" >
<property name="geometry" >
<rect>
<x>11</x>
<y>96</y>
<width>133</width>
<height>28</height>
</rect>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QLabel" name="sent_bytes_text_5" >
<property name="text" >
<string>kb/s</string>
<string>_("Lost frames")</string>
</property>
</widget>
</item>
<item row="2" column="2" >
<widget class="QLabel" name="sent_bytes_text_4" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
<widget class="QLabel" name="label_2" >
<property name="geometry" >
<rect>
<x>11</x>
<y>28</y>
<width>133</width>
<height>28</height>
</rect>
</property>
<property name="text" >
<string>kB</string>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<string>_("Decoded blocks")</string>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QLabel" name="stream_bitrate_text" >
<widget class="QLabel" name="vlost_frames" >
<property name="geometry" >
<rect>
<x>150</x>
<y>96</y>
<width>50</width>
<height>28</height>
</rect>
</property>
<property name="text" >
<string>0</string>
</property>
......@@ -167,9 +145,15 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="1" >
<widget class="QLabel" name="demuxed_text" >
<widget class="QLabel" name="vdisplayed_text" >
<property name="geometry" >
<rect>
<x>150</x>
<y>62</y>
<width>50</width>
<height>28</height>
</rect>
</property>
<property name="text" >
<string>0</string>
</property>
......@@ -177,56 +161,26 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_7" >
<property name="text" >
<string>_("Demuxed")</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>_("Stream bitrate")</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>_("Read at media")</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>_("Input bitrate")</string>
<widget class="QLabel" name="vdecoded_text" >
<property name="geometry" >
<rect>
<x>150</x>
<y>28</y>
<width>50</width>
<height>28</height>
</rect>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QLabel" name="sent_bytes_text_7" >
<property name="text" >
<string>kB</string>
<string>0</string>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1" >
<widget class="QGroupBox" name="groupBox_3" >
<property name="geometry" >
<rect>
<x>240</x>
<y>10</y>
<width>215</width>
<height>135</height>
</rect>
</property>
<property name="title" >
<string>_("Streaming")</string>
</property>
......@@ -322,66 +276,73 @@
</item>
</layout>
</widget>
<widget class="QGroupBox" name="groupBox_2" >
<property name="geometry" >
<rect>
<x>10</x>
<y>150</y>
<width>215</width>
<height>135</height>
</rect>
</property>
</item>
<item row="0" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>_("Video")</string>
<string>_("Input")</string>
</property>
<widget class="QLabel" name="label_4" >
<property name="geometry" >
<rect>
<x>11</x>
<y>62</y>
<width>133</width>
<height>28</height>
</rect>
<layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="1" >
<widget class="QLabel" name="read_text" >
<property name="text" >
<string>_("Displayed frames")</string>
<string>0</string>
</property>
</widget>
<widget class="QLabel" name="label_6" >
<property name="geometry" >
<rect>
<x>11</x>
<y>96</y>
<width>133</width>
<height>28</height>
</rect>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="input_bitrate_text" >
<property name="text" >
<string>_("Lost frames")</string>
<string>0</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="label_2" >
<property name="geometry" >
<rect>
<x>11</x>
<y>28</y>
<width>133</width>
<height>28</height>
</rect>
</item>
<item row="3" column="2" >
<widget class="QLabel" name="sent_bytes_text_6" >
<property name="text" >
<string>kb/s</string>
</property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QLabel" name="sent_bytes_text_5" >
<property name="text" >
<string>_("Decoded blocks")</string>
<string>kb/s</string>
</property>
</widget>
<widget class="QLabel" name="vlost_frames" >
<property name="geometry" >
<rect>
<x>150</x>
<y>96</y>
<width>50</width>
<height>28</height>
</rect>
</item>
<item row="2" column="2" >
<widget class="QLabel" name="sent_bytes_text_4" >
<property name="sizePolicy" >
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>kB</string>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="3" column="1" >
<widget class="QLabel" name="stream_bitrate_text" >
<property name="text" >
<string>0</string>
</property>
......@@ -389,15 +350,9 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="vdisplayed_text" >
<property name="geometry" >
<rect>
<x>150</x>
<y>62</y>
<width>50</width>
<height>28</height>
</rect>
</property>
</item>
<item row="2" column="1" >
<widget class="QLabel" name="demuxed_text" >
<property name="text" >
<string>0</string>
</property>
......@@ -405,25 +360,50 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
<widget class="QLabel" name="vdecoded_text" >
<property name="geometry" >
<rect>
<x>150</x>
<y>28</y>
<width>50</width>
<height>28</height>
</rect>
</item>
<item row="2" column="0" >
<widget class="QLabel" name="label_7" >
<property name="text" >
<string>_("Demuxed")</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>_("Stream bitrate")</string>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>0</string>
<string>_("Read at media")</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>_("Input bitrate")</string>
</property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QLabel" name="sent_bytes_text_7" >
<property name="text" >
<string>kB</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<pixmapfunction></pixmapfunction>
<resources/>
<connections/>
</ui>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment