Changeset 3935c13bd6e66808bf61fd2106a225acb775ec27

Show
Ignore:
Timestamp:
10/06/05 21:04:48 (3 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1118430288 +0000
git-parent:

[df73e4b31d402fa20437f1d7bdde0737bee3adde]

git-author:
Clément Stenac <zorglub@videolan.org> 1118430288 +0000
Message:

Implement SORT_AUTHOR. Closes #196

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/gui/wxwindows/playlist.cpp

    r6f484ce r3935c13  
    973973    { 
    974974        case SortTitle_Event: 
    975             playlist_RecursiveNodeSort( p_playlist, playlist_ItemGetById( p_playlist, p_wxitem->i_id ), 
    976                                         SORT_TITLE_NODES_FIRST, ORDER_NORMAL ); 
     975            playlist_RecursiveNodeSort( p_playlist, 
     976                            playlist_ItemGetById( p_playlist, p_wxitem->i_id ), 
     977                            SORT_TITLE_NODES_FIRST, ORDER_NORMAL ); 
    977978            break; 
    978979        case RSortTitle_Event: 
    979             playlist_RecursiveNodeSort( p_playlist, playlist_ItemGetById( p_playlist, p_wxitem->i_id ), 
    980                                         SORT_TITLE_NODES_FIRST, ORDER_REVERSE ); 
     980            playlist_RecursiveNodeSort( p_playlist, 
     981                            playlist_ItemGetById( p_playlist, p_wxitem->i_id ), 
     982                            SORT_TITLE_NODES_FIRST, ORDER_REVERSE ); 
    981983    } 
    982984    UnlockPlaylist( p_intf->p_sys, p_playlist ); 
  • src/playlist/sort.c

    rd41216c r3935c13  
    186186            else if( i_mode == SORT_AUTHOR ) 
    187187            { 
    188                 msg_Err( p_playlist,"META SORT not implemented" ); 
     188                char *psz_a = vlc_input_item_GetInfo( 
     189                                 &pp_items[i]->input, 
     190                                 _( "Meta-information"), _("Artist") ); 
     191                char *psz_b = vlc_input_item_GetInfo( 
     192                                 &pp_items[i_small]->input, 
     193                                 _( "Meta-information"), _("Artist") ); 
     194                if( pp_items[i]->i_children == -1 && 
     195                    pp_items[i_small]->i_children >= 0 ) 
     196                { 
     197                    i_test = 1; 
     198                } 
     199                else if( pp_items[i]->i_children >= 0 && 
     200                         pp_items[i_small]->i_children == -1 ) 
     201                { 
     202                    i_test = -1; 
     203                } 
     204                // both are nodes 
     205                else if( pp_items[i]->i_children >= 0 && 
     206                         pp_items[i_small]->i_children >= 0 ) 
     207                { 
     208                    i_test = strcasecmp( pp_items[i]->input.psz_name, 
     209                                         pp_items[i_small]->input.psz_name ); 
     210                } 
     211                else if( psz_a == NULL && psz_b != NULL ) 
     212                { 
     213                    i_test = 1; 
     214                } 
     215                else if( psz_a != NULL && psz_b == NULL ) 
     216                { 
     217                    i_test = -1; 
     218                } 
     219                else if( psz_a == NULL && psz_b == NULL ) 
     220                { 
     221                    i_test = strcasecmp( pp_items[i]->input.psz_name, 
     222                                         pp_items[i_small]->input.psz_name ); 
     223                } 
     224                else 
     225                { 
     226                    i_test = strcmp( psz_b, psz_a ); 
     227                } 
    189228            } 
    190229            else if( i_mode == SORT_TITLE_NODES_FIRST )