Commit dd99cec1 authored by Rémi Duraffort's avatar Rémi Duraffort

Move the track id from the last column to the first one in the playlist dialog...

Move the track id from the last column to the first one in the playlist dialog and add VLC_META_ENGINE_DURATION in vlc_meta.h
parent c1bf65aa
...@@ -166,6 +166,7 @@ static inline void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src ) ...@@ -166,6 +166,7 @@ static inline void vlc_meta_Merge( vlc_meta_t *dst, const vlc_meta_t *src )
/* Shortcuts for the AddInfo */ /* Shortcuts for the AddInfo */
#define VLC_META_INFO_CAT N_("Meta-information") #define VLC_META_INFO_CAT N_("Meta-information")
#define VLC_META_TITLE input_MetaTypeToLocalizedString( vlc_meta_Title ) #define VLC_META_TITLE input_MetaTypeToLocalizedString( vlc_meta_Title )
#define VLC_META_DURATION N_( "Duration" )
#define VLC_META_ARTIST input_MetaTypeToLocalizedString( vlc_meta_Artist ) #define VLC_META_ARTIST input_MetaTypeToLocalizedString( vlc_meta_Artist )
#define VLC_META_GENRE input_MetaTypeToLocalizedString( vlc_meta_Genre ) #define VLC_META_GENRE input_MetaTypeToLocalizedString( vlc_meta_Genre )
#define VLC_META_COPYRIGHT input_MetaTypeToLocalizedString( vlc_meta_Copyright ) #define VLC_META_COPYRIGHT input_MetaTypeToLocalizedString( vlc_meta_Copyright )
...@@ -195,18 +196,19 @@ struct meta_export_t ...@@ -195,18 +196,19 @@ struct meta_export_t
const char *psz_file; const char *psz_file;
}; };
#define VLC_META_ENGINE_TITLE 0x00000001 #define VLC_META_ENGINE_TRACKID 0x00000001
#define VLC_META_ENGINE_ARTIST 0x00000004 #define VLC_META_ENGINE_TITLE 0x00000002
#define VLC_META_ENGINE_GENRE 0x00000008 #define VLC_META_ENGINE_DURATION 0x00000004
#define VLC_META_ENGINE_COPYRIGHT 0x00000010 #define VLC_META_ENGINE_ARTIST 0x00000008
#define VLC_META_ENGINE_COLLECTION 0x00000020 #define VLC_META_ENGINE_GENRE 0x00000010
#define VLC_META_ENGINE_SEQ_NUM 0x00000040 #define VLC_META_ENGINE_COPYRIGHT 0x00000020
#define VLC_META_ENGINE_DESCRIPTION 0x00000080 #define VLC_META_ENGINE_COLLECTION 0x00000040
#define VLC_META_ENGINE_RATING 0x00000100 #define VLC_META_ENGINE_SEQ_NUM 0x00000080
#define VLC_META_ENGINE_DATE 0x00000200 #define VLC_META_ENGINE_DESCRIPTION 0x00000100
#define VLC_META_ENGINE_URL 0x00000400 #define VLC_META_ENGINE_RATING 0x00000200
#define VLC_META_ENGINE_LANGUAGE 0x00000800 #define VLC_META_ENGINE_DATE 0x00000400
#define VLC_META_ENGINE_TRACKID 0x00001000 #define VLC_META_ENGINE_URL 0x00000800
#define VLC_META_ENGINE_LANGUAGE 0x00001000
#define VLC_META_ENGINE_ART_URL 0x00002000 #define VLC_META_ENGINE_ART_URL 0x00002000
......
...@@ -115,6 +115,9 @@ void PLItem::updateColumnHeaders() ...@@ -115,6 +115,9 @@ void PLItem::updateColumnHeaders()
{ {
switch( i_index ) switch( i_index )
{ {
case VLC_META_ENGINE_TRACKID:
item_col_strings.append( qtr( VLC_META_TRACKID ) );
break;
case VLC_META_ENGINE_ARTIST: case VLC_META_ENGINE_ARTIST:
item_col_strings.append( qtr( VLC_META_ARTIST ) ); item_col_strings.append( qtr( VLC_META_ARTIST ) );
break; break;
...@@ -136,9 +139,6 @@ void PLItem::updateColumnHeaders() ...@@ -136,9 +139,6 @@ void PLItem::updateColumnHeaders()
case VLC_META_ENGINE_SEQ_NUM: case VLC_META_ENGINE_SEQ_NUM:
item_col_strings.append( qtr( VLC_META_SEQ_NUM ) ); item_col_strings.append( qtr( VLC_META_SEQ_NUM ) );
break; break;
case VLC_META_ENGINE_TRACKID:
item_col_strings.append( qtr( VLC_META_TRACKID ) );
break;
default: default:
break; break;
} }
......
...@@ -727,6 +727,8 @@ void PLModel::sort( int column, Qt::SortOrder order ) ...@@ -727,6 +727,8 @@ void PLModel::sort( int column, Qt::SortOrder order )
goto next; \ goto next; \
} \ } \
} }
CHECK_COLUMN( TRACKID );
CHECK_COLUMN( TITLE ); CHECK_COLUMN( TITLE );
CHECK_COLUMN( DURATION ); CHECK_COLUMN( DURATION );
CHECK_COLUMN( ARTIST ); CHECK_COLUMN( ARTIST );
...@@ -734,7 +736,6 @@ void PLModel::sort( int column, Qt::SortOrder order ) ...@@ -734,7 +736,6 @@ void PLModel::sort( int column, Qt::SortOrder order )
CHECK_COLUMN( COLLECTION ); CHECK_COLUMN( COLLECTION );
CHECK_COLUMN( SEQ_NUM ); CHECK_COLUMN( SEQ_NUM );
CHECK_COLUMN( DESCRIPTION ); CHECK_COLUMN( DESCRIPTION );
CHECK_COLUMN( TRACKID );
#undef CHECK_COLUMN #undef CHECK_COLUMN
...@@ -747,6 +748,7 @@ next: ...@@ -747,6 +748,7 @@ next:
int i_mode; int i_mode;
switch( i_flag ) switch( i_flag )
{ {
case VLC_META_ENGINE_TRACKID: i_mode = SORT_ID; break;
case VLC_META_ENGINE_TITLE: i_mode = SORT_TITLE_NODES_FIRST;break; case VLC_META_ENGINE_TITLE: i_mode = SORT_TITLE_NODES_FIRST;break;
case VLC_META_ENGINE_DURATION: i_mode = SORT_DURATION; break; case VLC_META_ENGINE_DURATION: i_mode = SORT_DURATION; break;
case VLC_META_ENGINE_ARTIST: i_mode = SORT_ARTIST; break; case VLC_META_ENGINE_ARTIST: i_mode = SORT_ARTIST; break;
...@@ -754,7 +756,6 @@ next: ...@@ -754,7 +756,6 @@ next:
case VLC_META_ENGINE_COLLECTION: i_mode = SORT_ALBUM; break; case VLC_META_ENGINE_COLLECTION: i_mode = SORT_ALBUM; break;
case VLC_META_ENGINE_SEQ_NUM: i_mode = SORT_TRACK_NUMBER; break; case VLC_META_ENGINE_SEQ_NUM: i_mode = SORT_TRACK_NUMBER; break;
case VLC_META_ENGINE_DESCRIPTION:i_mode = SORT_DESCRIPTION; break; case VLC_META_ENGINE_DESCRIPTION:i_mode = SORT_DESCRIPTION; break;
case VLC_META_ENGINE_TRACKID: i_mode = SORT_ID; break;
default: i_mode = SORT_TITLE_NODES_FIRST;break; default: i_mode = SORT_TITLE_NODES_FIRST;break;
} }
if( p_root ) if( p_root )
...@@ -830,23 +831,23 @@ void PLModel::viewchanged( int meta ) ...@@ -830,23 +831,23 @@ void PLModel::viewchanged( int meta )
int index=0; int index=0;
switch( meta ) switch( meta )
{ {
case VLC_META_ENGINE_TITLE: case VLC_META_ENGINE_TRACKID:
index=0; break; index=0; break;
case VLC_META_ENGINE_DURATION: case VLC_META_ENGINE_TITLE:
index=1; break; index=1; break;
case VLC_META_ENGINE_ARTIST: case VLC_META_ENGINE_DURATION:
index=2; break; index=2; break;
case VLC_META_ENGINE_GENRE: case VLC_META_ENGINE_ARTIST:
index=3; break; index=3; break;
case VLC_META_ENGINE_COPYRIGHT: case VLC_META_ENGINE_GENRE:
index=4; break; index=4; break;
case VLC_META_ENGINE_COLLECTION: case VLC_META_ENGINE_COPYRIGHT:
index=5; break; index=5; break;
case VLC_META_ENGINE_SEQ_NUM: case VLC_META_ENGINE_COLLECTION:
index=6; break; index=6; break;
case VLC_META_ENGINE_DESCRIPTION: case VLC_META_ENGINE_SEQ_NUM:
index=7; break; index=7; break;
case VLC_META_ENGINE_TRACKID: case VLC_META_ENGINE_DESCRIPTION:
index=8; break; index=8; break;
default: default:
break; break;
......
...@@ -274,6 +274,7 @@ void StandardPLPanel::popupSelectColumn( QPoint pos ) ...@@ -274,6 +274,7 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
CONNECT( ContextUpdateMapper, mapped( int ), model, viewchanged( int ) ); CONNECT( ContextUpdateMapper, mapped( int ), model, viewchanged( int ) );
ADD_META_ACTION( TRACKID );
ADD_META_ACTION( TITLE ); ADD_META_ACTION( TITLE );
ADD_META_ACTION( DURATION ); ADD_META_ACTION( DURATION );
ADD_META_ACTION( ARTIST ); ADD_META_ACTION( ARTIST );
...@@ -281,7 +282,6 @@ void StandardPLPanel::popupSelectColumn( QPoint pos ) ...@@ -281,7 +282,6 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
ADD_META_ACTION( COLLECTION ); ADD_META_ACTION( COLLECTION );
ADD_META_ACTION( SEQ_NUM ); ADD_META_ACTION( SEQ_NUM );
ADD_META_ACTION( DESCRIPTION ); ADD_META_ACTION( DESCRIPTION );
ADD_META_ACTION( TRACKID );
#undef ADD_META_ACTION #undef ADD_META_ACTION
......
...@@ -37,10 +37,6 @@ ...@@ -37,10 +37,6 @@
#define HAS_QT43 ( QT_VERSION >= 0x040300 ) #define HAS_QT43 ( QT_VERSION >= 0x040300 )
/* Add define for duration, VLC_META_ENGINE doesn't include it */
#define VLC_META_ENGINE_DURATION 0x00000002
#define VLC_META_DURATION N_( "Duration" )
#define QT_NORMAL_MODE 0 #define QT_NORMAL_MODE 0
#define QT_ALWAYS_VIDEO_MODE 1 #define QT_ALWAYS_VIDEO_MODE 1
#define QT_MINIMAL_MODE 2 #define QT_MINIMAL_MODE 2
......
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