Commit 1cb7ce6d authored by Rémi Duraffort's avatar Rémi Duraffort

Last patch to close #1479 (add a column with the track id)

parent 7187a7e9
...@@ -206,8 +206,9 @@ struct meta_export_t ...@@ -206,8 +206,9 @@ struct meta_export_t
#define VLC_META_ENGINE_DATE 0x00000200 #define VLC_META_ENGINE_DATE 0x00000200
#define VLC_META_ENGINE_URL 0x00000400 #define VLC_META_ENGINE_URL 0x00000400
#define VLC_META_ENGINE_LANGUAGE 0x00000800 #define VLC_META_ENGINE_LANGUAGE 0x00000800
#define VLC_META_ENGINE_TRACKID 0x00001000
#define VLC_META_ENGINE_ART_URL 0x00001000 #define VLC_META_ENGINE_ART_URL 0x00002000
#if 0 /* unused (yet?) */ #if 0 /* unused (yet?) */
#define VLC_META_ENGINE_MB_ARTIST_ID 0x00002000 #define VLC_META_ENGINE_MB_ARTIST_ID 0x00002000
......
...@@ -139,6 +139,9 @@ void PLItem::updateColumnHeaders() ...@@ -139,6 +139,9 @@ void PLItem::updateColumnHeaders()
case VLC_META_ENGINE_RATING: case VLC_META_ENGINE_RATING:
item_col_strings.append( qtr( VLC_META_RATING ) ); item_col_strings.append( qtr( VLC_META_RATING ) );
break; break;
case VLC_META_ENGINE_TRACKID:
item_col_strings.append( qtr( VLC_META_TRACKID ) );
break;
default: default:
break; break;
} }
...@@ -257,6 +260,10 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent ) ...@@ -257,6 +260,10 @@ void PLItem::update( playlist_item_t *p_item, bool iscurrent )
break; break;
case VLC_META_ENGINE_RATING: case VLC_META_ENGINE_RATING:
ADD_META( p_item, Rating ); ADD_META( p_item, Rating );
break;
case VLC_META_ENGINE_TRACKID:
item_col_strings.append( QString::number( p_item->i_id ) );
break;
default: default:
break; break;
} }
......
...@@ -736,6 +736,7 @@ void PLModel::sort( int column, Qt::SortOrder order ) ...@@ -736,6 +736,7 @@ void PLModel::sort( int column, Qt::SortOrder order )
CHECK_COLUMN( SEQ_NUM ); CHECK_COLUMN( SEQ_NUM );
CHECK_COLUMN( DESCRIPTION ); CHECK_COLUMN( DESCRIPTION );
CHECK_COLUMN( RATING ); CHECK_COLUMN( RATING );
CHECK_COLUMN( TRACKID );
#undef CHECK_COLUMN; #undef CHECK_COLUMN;
...@@ -756,6 +757,7 @@ next: ...@@ -756,6 +757,7 @@ next:
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_RATING: i_mode = SORT_RATING; break; case VLC_META_ENGINE_RATING: i_mode = SORT_RATING; 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 )
...@@ -847,6 +849,10 @@ void PLModel::viewchanged( int meta ) ...@@ -847,6 +849,10 @@ void PLModel::viewchanged( int meta )
index=6; break; index=6; break;
case VLC_META_ENGINE_DESCRIPTION: case VLC_META_ENGINE_DESCRIPTION:
index=7; break; index=7; break;
case VLC_META_ENGINE_RATING:
index=8; break;
case VLC_META_ENGINE_TRACKID:
index=9; break;
default: default:
break; break;
} }
......
...@@ -282,6 +282,7 @@ void StandardPLPanel::popupSelectColumn( QPoint pos ) ...@@ -282,6 +282,7 @@ void StandardPLPanel::popupSelectColumn( QPoint pos )
ADD_META_ACTION( SEQ_NUM ); ADD_META_ACTION( SEQ_NUM );
ADD_META_ACTION( DESCRIPTION ); ADD_META_ACTION( DESCRIPTION );
ADD_META_ACTION( RATING ); ADD_META_ACTION( RATING );
ADD_META_ACTION( TRACKID );
#undef ADD_META_ACTION #undef ADD_META_ACTION
......
...@@ -199,6 +199,10 @@ static int playlist_ItemArraySort( playlist_t *p_playlist, int i_items, ...@@ -199,6 +199,10 @@ static int playlist_ItemArraySort( playlist_t *p_playlist, int i_items,
{ {
DO_META_SORT( Rating ); DO_META_SORT( Rating );
} }
else if( i_mode == SORT_ID )
{
i_test = pp_items[i]->i_id - pp_items[i_small]->i_id;
}
else if( i_mode == SORT_TITLE_NODES_FIRST ) else if( i_mode == SORT_TITLE_NODES_FIRST )
{ {
/* Alphabetic sort, all nodes first */ /* Alphabetic sort, all nodes first */
......
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