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() ...@@ -86,31 +86,68 @@ void InputStatsPanel::clear()
MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) : MetaPanel::MetaPanel( QWidget *parent, intf_thread_t *_p_intf ) :
QWidget( parent ), p_intf( _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() 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; #define UPDATE_META( meta, widget ) { \
return URI; 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 ) : InfoPanel::InfoPanel( QWidget *parent, intf_thread_t *_p_intf ) :
QWidget( parent ), p_intf( _p_intf ) QWidget( parent ), p_intf( _p_intf )
{ {
......
...@@ -57,13 +57,25 @@ public: ...@@ -57,13 +57,25 @@ public:
virtual ~MetaPanel(); virtual ~MetaPanel();
private: private:
intf_thread_t *p_intf; 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: public slots:
void update( input_item_t * ); void update( input_item_t * );
void clear(); void clear();
char* getURI();
char* getName();
}; };
class InfoPanel: public QWidget class InfoPanel: public QWidget
......
<ui version="4.0" > <ui version="4.0" >
<author></author>
<comment></comment>
<exportmacro></exportmacro>
<class>InputStats</class> <class>InputStats</class>
<widget class="QWidget" name="InputStats" > <widget class="QWidget" name="InputStats" >
<property name="geometry" > <property name="geometry" >
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>470</width> <width>486</width>
<height>300</height> <height>302</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle" >
<string>_("Form")</string> <string>_("Form")</string>
</property> </property>
<widget class="QGroupBox" name="groupBox_4" > <layout class="QGridLayout" >
<property name="geometry" > <property name="margin" >
<rect> <number>9</number>
<x>240</x> </property>
<y>150</y> <property name="spacing" >
<width>215</width> <number>6</number>
<height>135</height>
</rect>
</property> </property>
<item row="1" column="1" >
<widget class="QGroupBox" name="groupBox_4" >
<property name="title" > <property name="title" >
<string>_("Audio")</string> <string>_("Audio")</string>
</property> </property>
...@@ -87,79 +84,60 @@ ...@@ -87,79 +84,60 @@
</item> </item>
</layout> </layout>
</widget> </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" > <property name="geometry" >
<rect> <rect>
<x>10</x> <x>11</x>
<y>10</y> <y>62</y>
<width>215</width> <width>133</width>
<height>135</height> <height>28</height>
</rect> </rect>
</property> </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" > <property name="text" >
<string>0</string> <string>_("Displayed frames")</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> <widget class="QLabel" name="label_6" >
<item row="3" column="2" > <property name="geometry" >
<widget class="QLabel" name="sent_bytes_text_6" > <rect>
<property name="text" > <x>11</x>
<string>kb/s</string> <y>96</y>
<width>133</width>
<height>28</height>
</rect>
</property> </property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QLabel" name="sent_bytes_text_5" >
<property name="text" > <property name="text" >
<string>kb/s</string> <string>_("Lost frames")</string>
</property> </property>
</widget> </widget>
</item> <widget class="QLabel" name="label_2" >
<item row="2" column="2" > <property name="geometry" >
<widget class="QLabel" name="sent_bytes_text_4" > <rect>
<property name="sizePolicy" > <x>11</x>
<sizepolicy> <y>28</y>
<hsizetype>0</hsizetype> <width>133</width>
<vsizetype>0</vsizetype> <height>28</height>
<horstretch>0</horstretch> </rect>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="text" > <property name="text" >
<string>kB</string> <string>_("Decoded blocks")</string>
</property>
<property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> <widget class="QLabel" name="vlost_frames" >
<item row="3" column="1" > <property name="geometry" >
<widget class="QLabel" name="stream_bitrate_text" > <rect>
<x>150</x>
<y>96</y>
<width>50</width>
<height>28</height>
</rect>
</property>
<property name="text" > <property name="text" >
<string>0</string> <string>0</string>
</property> </property>
...@@ -167,9 +145,15 @@ ...@@ -167,9 +145,15 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> <widget class="QLabel" name="vdisplayed_text" >
<item row="2" column="1" > <property name="geometry" >
<widget class="QLabel" name="demuxed_text" > <rect>
<x>150</x>
<y>62</y>
<width>50</width>
<height>28</height>
</rect>
</property>
<property name="text" > <property name="text" >
<string>0</string> <string>0</string>
</property> </property>
...@@ -177,56 +161,26 @@ ...@@ -177,56 +161,26 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item> <widget class="QLabel" name="vdecoded_text" >
<item row="2" column="0" > <property name="geometry" >
<widget class="QLabel" name="label_7" > <rect>
<property name="text" > <x>150</x>
<string>_("Demuxed")</string> <y>28</y>
</property> <width>50</width>
</widget> <height>28</height>
</item> </rect>
<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>
</property> </property>
</widget>
</item>
<item row="0" column="2" >
<widget class="QLabel" name="sent_bytes_text_7" >
<property name="text" > <property name="text" >
<string>kB</string> <string>0</string>
</property> </property>
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item>
</layout>
</widget> </widget>
</item>
<item row="0" column="1" >
<widget class="QGroupBox" name="groupBox_3" > <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" > <property name="title" >
<string>_("Streaming")</string> <string>_("Streaming")</string>
</property> </property>
...@@ -322,66 +276,73 @@ ...@@ -322,66 +276,73 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QGroupBox" name="groupBox_2" > </item>
<property name="geometry" > <item row="0" column="0" >
<rect> <widget class="QGroupBox" name="groupBox" >
<x>10</x>
<y>150</y>
<width>215</width>
<height>135</height>
</rect>
</property>
<property name="title" > <property name="title" >
<string>_("Video")</string> <string>_("Input")</string>
</property> </property>
<widget class="QLabel" name="label_4" > <layout class="QGridLayout" >
<property name="geometry" > <property name="margin" >
<rect> <number>9</number>
<x>11</x> </property>
<y>62</y> <property name="spacing" >
<width>133</width> <number>6</number>
<height>28</height>
</rect>
</property> </property>
<item row="0" column="1" >
<widget class="QLabel" name="read_text" >
<property name="text" > <property name="text" >
<string>_("Displayed frames")</string> <string>0</string>
</property> </property>
</widget> <property name="alignment" >
<widget class="QLabel" name="label_6" > <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
<property name="geometry" >
<rect>
<x>11</x>
<y>96</y>
<width>133</width>
<height>28</height>
</rect>
</property> </property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLabel" name="input_bitrate_text" >
<property name="text" > <property name="text" >
<string>_("Lost frames")</string> <string>0</string>
</property>
<property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="label_2" > </item>
<property name="geometry" > <item row="3" column="2" >
<rect> <widget class="QLabel" name="sent_bytes_text_6" >
<x>11</x> <property name="text" >
<y>28</y> <string>kb/s</string>
<width>133</width>
<height>28</height>
</rect>
</property> </property>
</widget>
</item>
<item row="1" column="2" >
<widget class="QLabel" name="sent_bytes_text_5" >
<property name="text" > <property name="text" >
<string>_("Decoded blocks")</string> <string>kb/s</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="vlost_frames" > </item>
<property name="geometry" > <item row="2" column="2" >
<rect> <widget class="QLabel" name="sent_bytes_text_4" >
<x>150</x> <property name="sizePolicy" >
<y>96</y> <sizepolicy>
<width>50</width> <hsizetype>0</hsizetype>
<height>28</height> <vsizetype>0</vsizetype>
</rect> <horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text" >
<string>kB</string>
</property> </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" > <property name="text" >
<string>0</string> <string>0</string>
</property> </property>
...@@ -389,15 +350,9 @@ ...@@ -389,15 +350,9 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="vdisplayed_text" > </item>
<property name="geometry" > <item row="2" column="1" >
<rect> <widget class="QLabel" name="demuxed_text" >
<x>150</x>
<y>62</y>
<width>50</width>
<height>28</height>
</rect>
</property>
<property name="text" > <property name="text" >
<string>0</string> <string>0</string>
</property> </property>
...@@ -405,25 +360,50 @@ ...@@ -405,25 +360,50 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
<widget class="QLabel" name="vdecoded_text" > </item>
<property name="geometry" > <item row="2" column="0" >
<rect> <widget class="QLabel" name="label_7" >
<x>150</x> <property name="text" >
<y>28</y> <string>_("Demuxed")</string>
<width>50</width> </property>
<height>28</height> </widget>
</rect> </item>
<item row="3" column="0" >
<widget class="QLabel" name="label_3" >
<property name="text" >
<string>_("Stream bitrate")</string>
</property> </property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" > <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>
<property name="alignment" > <property name="alignment" >
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property> </property>
</widget> </widget>
</item>
</layout>
</widget> </widget>
</item>
</layout>
</widget> </widget>
<pixmapfunction></pixmapfunction>
<resources/> <resources/>
<connections/> <connections/>
</ui> </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