Changeset 2d3320dc962cca52a0388c0b3ff4c470e8ac830e

Show
Ignore:
Timestamp:
12/11/07 23:18:31 (1 year ago)
Author:
Antoine Cellerier <dionoea@videolan.org>
git-committer:
Antoine Cellerier <dionoea@videolan.org> 1194905911 +0000
git-parent:

[3f32e82e12c68514db43bc1f7a4d7a460d2c6bb8]

git-author:
Antoine Cellerier <dionoea@videolan.org> 1194905911 +0000
Message:

Add option to use a flat playlist in the rc.lua interface (default disabled).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • share/luaintf/rc.lua

    r87c76c2 r2d3320d  
    5151    * autoalias: If autocompletion returns only one possibility, use it 
    5252                 (0 to disable, 1 to enable). 
     53    * flatplaylist: 0 to disable, 1 to enable. 
    5354]============================================================================] 
    5455 
     
    6465        autocompletion = 1; 
    6566        autoalias = 1; 
    66         welcome = "Remote control interface initialized. Type `help' for help." 
     67        welcome = "Remote control interface initialized. Type `help' for help."; 
     68        flatplaylist = 0; 
    6769      } 
    6870 
     
    164166end 
    165167 
     168function playlist_is_tree( client ) 
     169    if client.env.flatplaylist == 0 then 
     170        return true 
     171    else 
     172        return false 
     173    end 
     174end 
     175 
    166176function playlist(name,client,arg) 
    167177    function playlist0(item,prefix) 
     
    188198    end 
    189199    local playlist 
     200    local tree = playlist_is_tree(client) 
     201    print("tree",tree) 
    190202    if name == "search" then 
    191         playlist = vlc.playlist.search(arg or ""
     203        playlist = vlc.playlist.search(arg or "", tree
    192204    else 
    193205        if tonumber(arg) then 
    194206            print "number" 
    195             playlist = vlc.playlist.get(tonumber(arg)
     207            playlist = vlc.playlist.get(tonumber(arg), tree
    196208        elseif arg then 
    197209            print "string" 
    198             playlist = vlc.playlist.get(arg
     210            playlist = vlc.playlist.get(arg, tree
    199211        else 
    200             playlist = vlc.playlist.get(
     212            playlist = vlc.playlist.get(nil, tree
    201213        end 
    202214    end 
     
    224236        client:append("Valid sort keys are: id, title, artist, genre, random, duration, album.") 
    225237    else 
    226         vlc.playlist.sort(arg) 
     238        local tree = playlist_is_tree(client) 
     239        vlc.playlist.sort(arg,false,tree) 
    227240    end 
    228241end