Hi,
i’m using a grouplist to navigate a drive where some music files are stored.
I generate an xml with a php script with all the info i need:
<?xml version="1.0" encoding="UTF-8"?>
<data>
<item id_group="0">
<name>Album - Daft Punk</name>
<fullname></fullname>
<item id="0">
<name>01. Give Life Back to Music.mp3</name>
<fullname>..\Audio\\Album - Daft Punk\\01. Give Life Back to Music.mp3</fullname>
<extension>mp3</extension>
</item>
<item id="1">
<name>02. The Game of Love.mp3</name>
<fullname>..\Audio\\Album - Daft Punk\\02. The Game of Love.mp3</fullname>
<extension>mp3</extension>
</item>
...
<item id="15">
<name>E.Cassidy-I wish I was a single girl again.wav</name>
<fullname>..\Audio\\Album - Daft Punk\\E.Cassidy-I wish I was a single girl again.wav</fullname>
<extension>wav</extension>
</item>
</item>
<item id_group="1">
<name>dEUS - The Ideal Crash (1998)</name>
<fullname></fullname>
<item id="17">
<name>dEUS - The Ideal Crash - 01 - Put The Freaks Up Front .mp3</name>
<fullname>..\Audio\\dEUS - The Ideal Crash (1998)\\dEUS - The Ideal Crash - 01 - Put The Freaks Up Front .mp3</fullname>
<extension>mp3</extension>
</item>
<item id="26">
<name>dEUS - The Ideal Crash - 10 - Dream Sequence 1 .mp3</name>
<fullname>..\Audio\\dEUS - The Ideal Crash (1998)\\dEUS - The Ideal Crash - 10 - Dream Sequence 1 .mp3</fullname>
<extension>mp3</extension>
</item>
</item>
<item id_group="2">
<name>The Frames</name>
<fullname></fullname>
<item id="27">
<name>04 - Evergreen.mp3</name>
<fullname>..\Audio\\The Frames\\04 - Evergreen.mp3</fullname>
<extension>mp3</extension>
</item>
<item id="28">
<name>04 - Evergreen_1.mp3</name>
<fullname>..\Audio\\The Frames\\04 - Evergreen_1.mp3</fullname>
<extension>mp3</extension>
</item>
<item id="32">
<name>10 - Denounced.mp3</name>
<fullname>..\Audio\\The Frames\\10 - Denounced.mp3</fullname>
<extension>mp3</extension>
</item>
</item>
<item id="33">
<name>avevate ragione voi.mp3</name>
<fullname>..\Audio\\avevate ragione voi.mp3</fullname>
<extension>mp3</extension>
</item>
<item id="34">
<name>Cher Backer - Autumn Leaves.mp3</name>
<fullname>..\Audio\\Cher Backer - Autumn Leaves.mp3</fullname>
<extension>mp3</extension>
</item>
<item id="35">
<name>Cher Backer - Autumn Leaves.wav</name>
<fullname>..\Audio\\Cher Backer - Autumn Leaves.wav</fullname>
<extension>wav</extension>
</item>
<item id="52">
<name>willy_moon-i_wanna_be_your_man.mp3</name>
<fullname>..\Audio\\willy_moon-i_wanna_be_your_man.mp3</fullname>
<extension>mp3</extension>
</item>
</data>
The tree is perfectly shown: directories,sub directories and files. Folders are shown first.
I’m now tryng to play all the files in sequence, one after the other.
Problems start when, from within a folder I have to go one level up (->root) and then one level down (->next directory) and start playing the first track of the next directory…
I’m trying to use this code:
function play_next()
{
current_music_id = music_id;
next_music_id = (parseInt(music_id)+1).toString();
if($$(\"music\").item(next_music_id)!=undefined)
{
next_music_level = $$(\"music\").item(next_music_id).\$level;
if(next_music_level==current_music_level)
{
current_folder = $$(\"music\").item(current_music_id).fullname.substr(0,$$(\"music\").item(current_music_id).fullname.length-$$(\"music\").item(current_music_id).name.length);
next_folder = $$(\"music\").item(next_music_id).fullname.substr(0,$$(\"music\").item(next_music_id).fullname.length-$$(\"music\").item(next_music_id).name.length);
if(next_folder!=current_folder)
{
$$('music').on_click.dhx_list_item.call($$('music'),{},$$(\"music\").item(current_music_id).\$parent);
$$('music').on_click.dhx_list_item.call($$('music'),{},$$(\"music\").item(next_music_id).\$parent);
}
}
else
{
if(next_music_level<current_music_level)
$$('music').on_click.dhx_list_item.call($$('music'),{},$$(\"music\").item(current_music_id).\$parent);
if(next_music_level>current_music_level)
$$('music').on_click.dhx_list_item.call($$('music'),{},$$(\"music\").item(next_music_id).\$parent);
}
$$('music').on_click.dhx_list_item.call($$('music'),{}, next_music_id);
// and then i call the "play" method on my player
}
}
The result is that the next track correctly starts playing BUT no visual feedback is provided to the user…I’m only able to go up from the current folder to the root but could not manage to go down and select the current track…
Any help???