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
......
This diff is collapsed.
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