PDA

View Full Version : Flash Skins and Playlists


m4gnus
04-14-2009, 06:58
Heyho!

Recently i switched to the korean firmware because flash skins really look great especially because i like programming and messing with my D2 [laugh]

The first thing that i missed(and which i knew i'd miss) is the playlist support. I don't know how some people can live without them with more than 2 gb songs(and i even missed them on my old 2gb U2), so i thought i'd work on a way to integrate playlists in flash skins.

The basic flash skin(i think that's how it is called) already has one simple playlist but after checking the source i noticed that this implementation gets quite slow if you have too much songs on your D2(it skips to the next song until it found the next song in the playlist).
So i wrote a C# application that precomputes how much the D2 has to skip to get to the next track which is significantly faster and reduces the lag between the tracks.

So why am i posting this? I hope that i'm not the only one who hopes for playlists in combination with flash skins and i think the method i use for my implementation offers quite a lot of possibilities for improvement and advanced features that the D2 doesn't offer at the moment.
And i hope that more people can integrate those features in their flash skins

What i have accomplished so far:
- a flash skin that supports multiple playlists
- a helper app that can generate playlists for the flash skin from .m3u files

what i plan to implement(and what is possible):
- mutiple editable(on the D2) playlist(like the DPL but for all playlists...this should be quite easy)
- searching for tracks(with a virtual keyboard, this still needs some thinking but should be possible)
- custom music browser(s) (this needs some work, so i'm trying to implement the track searching first)

I'm releasing the source code for my flash skin and my helper app for other developers if people are interested. But be aware that my code might not look very nice, most certainly can be improved and needs some cleaning.

The helper app:
link (http://mitglied.lycos.de/m4gnus/)
It is quickly hacked together and it is written in C# so you need the Microsoft .Net 3.5 Framework (http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=333325fd-ae52-4e35-b531-508d977d32a6) .

How it works/what it does:
Scan D2 should be the first thing to press(when you have your D2 connected)
It will take quite long(multiple minutes) and fills the Music Library with all your songs.

Now you can either create a new playlist(using the --> , <-- buttons and the Search function)
And save it by entering a filename and pressing Save Playlist.

Or you can load a m3u file, convert it and save it to the D2. But this only works if the files in the m3u playlist have the same filename than the ones on your D2(and results in problems if there are multiple files with the same filename)

Note: The Music Library must be sorted the same way that your tracks on your D2 are sorted when you press Music Library->Titles. This is usually the case but i had some problems after upgrading my firmware. Removing all my files and sending them back to the D2 did the trick.

Note2:
Theoretically multiple playlists are supported but i was too lazy, so at the moment the old one gets overwritten.

The flash skin:
Needs some cleaning up, so i will post it later.

I hope that i can help some people and push the development of new features for the D2. If nobody cares(or if it has been done already) then i will continue to finish this for myself and don't bother you anymore ;)

regards,
m4gnus

tirim4
04-14-2009, 07:13
This is great! I dont really need playlists, but a lotof people seems to do, and I would defenetly find it handy to be able to play playlists sometimes. Keep up the good work, as Im not a programmer I can't help you with code, but if you wan't a beta tester sometime I will sure help you;)

m4gnus
04-14-2009, 16:49
It would be really great if some people could help me with the testing.

At the moment i am developing a test flash skin that checks whether the songs in the database are correctly ordered. This has to be the case for the playlists to work and i have had some problems with it. I hope that was just a result of the firmware upgrade but i'm not quite sure.

I had planned to have it finished about now, but it just crashes the D2 :(

Meanwhile, if somebody wants to test the Helperapp, feel free to do so.
Just press Scan D2, after the Music Library is filled, disconnect the D2(don't close the application) and compare the ordering of some tracks in the helper app with those on the D2 when you go to the music library and select "Titles"(this is what i'm trying to do automatically)

If i make some progress i will post it in here.

regards,
m4gnus

tirim4
04-15-2009, 03:01
I tried the helperapp and it seems to work as it should, but where do I find the playlist.txt when I've saved it?

m4gnus
04-15-2009, 03:38
oh sorry forgot to mention it...
It saves to D2:\Playlists\ . there will be 2 files:
A playlists.txt which tells the player how many playlists there are and where they can be found(the filename) and the playlist.txt that you created.

Thanks for testing!

I have experimanted some more and i have come to the conclusion that the D2-Database is a mess :/
when you edit the id3 tags of the files the D2 doesn't change the title and artist accordingly.
For example:
I've had the file "Guru Josh Project - Infinity.mp3" on the D2,without tags, the title of this file should be the filename without the extensions which means that in the Titles-list it should be found at the letter G("Guru Josh Project - Infinity). After changing the tracks it should correctly indentify the title as "Infinity" and sort the Titles-list, so that the song is found at the letter I (just how like my helper app predicts it) but this isn't the case!

The title is still "Guru Josh Project - Infinity" and i have to remove the file, turn on my d2(until the database is updated), move it back on the player, turn it on again(until the database is updated) and now it is sorted correctly. wtf! :/

Is there a way to force a complete Database reset or something like that? Or does somebody know where the database is located?

regards,
m4gnus

caz
04-15-2009, 04:15
hey m4gnus,
i really like to have playlists and a file browser on my d2. could you post a step by step installation guide of your app to help you testing it? would be easier to give it a try. cause otherwise i have to search all the infos and put them together^^ i just didn't get the ting with "Just press Scan D2, after the Music Library is filled, disconnect the D2(don't close the application)" so a step by step guide would be very much appreciated :-D
thanks for your efforts man!
do you think the file browser will be able to be implemented in every flash skin (unless we have the fla file) ?
do you have any screenshots?

vampire666
04-15-2009, 04:58
[...]

Is there a way to force a complete Database reset or something like that? Or does somebody know where the database is located?

regards,
m4gnus

Hi there.
As far as I know, if I remember correctly, changing the language of the D2 forces a database rebuild, so you could try that.

P.S. I'm sure your work is appreciated (I do for sure)!

m4gnus
04-15-2009, 09:34
i really like to have playlists and a file browser on my d2. could you post a step by step installation guide of your app to help you testing it? would be easier to give it a try.
Sure:
Here's the app (http://mitglied.lycos.de/m4gnus/). Just copy those files somewhere and run the .exe. If it crashes you don't have the Microsoft .Net 3.5 Framework installed. Get it here (http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=333325fd-ae52-4e35-b531-508d977d32a6)

When the app starts you will see 2 large list-boxes(and a small one which acts like a console for error output) one is titled Music Library and one playlist.

When you press the Scan D2 button(with your D2 connected) on the top-right the programm won't respond for some time as it walks through all of the files on your D2, sorts them and puts them into the music library list.

What i asked you to do for testing is comparing how the tracks in my app are sorted to those on the D2.
You can do this by doing the steps i just described(you should have a list with all of your songs in the music library list-box), then you can disconnect the player as usual.
Now turn the D2 on, go to the music library, go back until you see Artists,Albums,Genre,Titles,...(don't know the exact names, translated them from german) and select Titles.
Now you should see the exact same list as on the PC.
On the topright on your D2 you can see the track number (for example [0001/1385]) navigate to some tracks and check whether they have the same track number on your D2 and in my app.

If this works, everything is fine. if not, try changing the language to something else, let it rebuild the database and change it back then try it again.

With the app you can create playlists either with the "-->" and "<--" buttons(the first one moves the selected song from the musiclibrary to the playlist, the second removes the selected song from the playlist) or from an existing playlistfile with the Load M3U button. I recommend creating the m3u directly with the files from the D2, though(no files on your harddrives...the files need to be on the D2, i will fix this when i have some time). This function doesn't work if multiple files on your d2 have the same name(i will fix this too).

The playlists will be saved on your D2 in a folder called "Playlists". At the moment only one playlist is possible, but i haven't released the flash skin yet ,so i guess this is not a problem ;)
(Developers can look at the text files and write their own playlist loader if they want. it's not difficult, but i will release the source if i complete the flash skin)

The flash skin is almost completed, it already worked completely as long as the display is turned on when the song ended but now i have to rework some things to get it working all of the time :/


As far as I know, if I remember correctly, changing the language of the D2 forces a database rebuild, so you could try that.
thank you very much! i think that did the trick and maybe i already found a way to do this from the PC, maybe i'll set my D2 on fire or something , but i won't know till i tried it ;)
at least this is way easier than moving all files to my harddrive and moving them back to the player.


do you think the file browser will be able to be implemented in every flash skin (unless we have the fla file) ?
it means every flash skin can have it's own browser.
Essentially my technique allows a flash skin to access ANY music file on the D2 quite fast, which makes it possible to implement your own way of navigating through your files, like searching with a virtual keyboard(though this will need additional help from the helper app, because the D2 is too slow to search through all of the songs), or a new browser.

The best thing would be if someone could write a browser with more features and share the source, so that others can integrate it into their flash skins.
(i doubt that i will be that person because i already spend most of the day for the helper app and the flash skin[damned bugs!])


regards,
m4gnus

caz
04-15-2009, 10:41
so you're from germany?
i can't wait to see your flash skin and test it.. a seperate file browser with playlists would be REALLY nice. once i wanted to implement a seperate file browser to the ocean flash skin. but yeah.. didn't work. cause the flashskin would be a lot slower.

(serious): D2 flash player does not provide such functional by default.
Something like this is possible, but realization of it is too difficult and usability is too low. I know at least 2 ways how to do this, but none of them is satisfy my requirements of speed of the skin... check here (http://www.iaudiophile.net/forums/showthread.php?t=25938) what i mean. :-) i'll test your work soon, right?

tirim4
04-15-2009, 11:51
^Skisn with browsers dont have to be slow. Test Haptic andUltimate/ultimateMOD.

vampire666
04-15-2009, 12:06
thank you very much! i think that did the trick and maybe i already found a way to do this from the PC, maybe i'll set my D2 on fire or something , but i won't know till i tried it ;)
at least this is way easier than moving all files to my harddrive and moving them back to the player.

You are welcome. :)

m4gnus
04-15-2009, 12:18
yes, i'm from germany.

I think i finally fixed all bugs, so i finally have a working version of my flash skin!
It is really just a prototype(you will notice when you look at my button "design" ;) ) and can still be improved in speed( for example at the moment the flash skins checks every 200ms if the song has changed... this can be optimised and results in a longer gap between tracks)

First of all, heres the link (http://mitglied.lycos.de/m4gnus)(linking directly to the file doesn't work..)
The .zip contains the music.swf(how to install a flash skin (http://iaudiophile.net/forums/showthread.php?t=18804)) and the vertical_edit.fla(which is a total mess![i hate developing in flash :/])

Now, the instructions:
The skin is a modified vertical skin.
I added the 2 large ugly blue buttons. The right one loads the first playlist(the helper app overwrites the previous when you create a new one so theres only one there at the moment) and starts to play the first track, this may take some time. After that skipping to the other songs should be quite fast.

The left button displays the playlist and whether the playlist is activated or not.(the button on the bottom left closes the playlist and the scrolling has a problem[you can scroll up one track too far])

How to create a playlist?:
1. Connect the D2 to the PC
2. Start the Helper App
3. Press Scan D2(this will take a while)
4. The easiest way to create a playlist is using the --> and <-- buttons:
-Select a song in the music library and press the --> button. It will be added to the playlist
-repeat the step above for as many songs as you like
5. Enter a name in the textbox which says playlist.txt(or leave it as it is)
6. Press Save Playlist
7. Disconnect the D2
8. Go to the Music Library
9. Press the Back arrow on the right until you see Artists,Albums,Genre,Titles,...
10. Double Click Titles, and play a random song
11. Pause the playback(click on the middle of the screen)
12. Make sure Repeat is ON(otherwise the player might freeze at the next step) and Shuffle is OFF(otherwise the skin won't skip to the correct titles) by clicking in the middle above the songtitle and the progress bar
13. Press the right blue button, to load the playlist
14. The player will need some time to find the first song(depending on how many songs you have on your D2)
15. The player should now play the playlist as usual, you can use the forward and rewind buttons, just don't select a new song in the browser, because that will stop the playlist.

If the skin skips to the wrong songs, you have a problem with your database(for example after editing id3tags)(or you have shuffle still enabled), changing the language to something else and back to normal should fix it.

You can view the playlist by pressing the left blue button.

I hope that explanation is complete and i got all of the bugs.
The usage will definately become simpler, i just didn't have the time to improve it further and this is (hopefully) the first working version.

Please post if anything doesn't work or if you encounter a bug.

regards,
m4gnus

tirim4
04-15-2009, 12:47
My D2 loads he first track fine, but when I tries to skip track it just kepps repeating the first track... And the left utton just shows a list of "undefined"...

m4gnus
04-15-2009, 13:04
hmm not good...can you post your 2 playlist files(Playlists.txt and
yourPlaylist.txt)?
How have you created the playlist? did you use the --> and <-- buttons or did you Load a .m3u?
Did you scroll up in the playlist window? this results in a list of "undefined" tracks. if this is the case just scroll down 2 times if not it seems like something is wrong with your playlist .txt-file.

regards,
m4gnus

GTStriker
04-15-2009, 13:15
Looks promising in theory (I'm a FW 2.xx user), great job, few questions:
1) Let's say you created a playlist. Now you want to add to it, do you need to do a new one or the "D2Helper App" is capable of scanning the existing txt file on the D2?
2) Can you use the "D2Helper App" (only) on FW 2.xx (scanning the D2 own created DPL or music directory)?
3) Does it matter if you have 3.02 FW and not 3.59?

m4gnus
04-15-2009, 13:25
1) Let's say you created a playlist. Now you want to add to it, do you need to do a new one or the "D2Helper App" is capable of scanning the existing txt file on the D2?
2) Can you use the "D2Helper App" (only) on FW 2.xx (scanning the D2 own created DPL or music directory)?
3) Does it matter if you have 3.02 FW and not 3.59?

1)The flash skin and the helper app are both just a proof of concept, which means there's a lot more that can be done.
At the moment it doesn't scan the txt files but this can be implemented easily.

2) The helper app works on every firmware, but the produced .txt files will be useless.

3)i don't know, i only have 3.59 and haven't tested it on any other firmware

Hope that helps

regards,
m4gnus

tirim4
04-15-2009, 13:43
hmm not good...can you post your 2 playlist files(Playlists.txt and
yourPlaylist.txt)?
How have you created the playlist? did you use the --> and <-- buttons or did you Load a .m3u?
Did you scroll up in the playlist window? this results in a list of "undefined" tracks. if this is the case just scroll down 2 times if not it seems like something is wrong with your playlist .txt-file.

regards,
m4gnus

I used the arrw way of creating playlist and yes I've tried scrolling... a lot...

Her's my textfiles:

EDIT: Im using fw 3.02 by the way...

m4gnus
04-15-2009, 14:01
Offtopic:indica and nightwish?! awesome, just saw them live about a month ago
back to the problem:
it could probably be the firmware which would be really bad because debuging that over the internet would be a pain...

if you have some knowledge of flash you can try to debug it yourself...it seems as if the playlist doesn't load correctly, but i don't understand why the first track is playing :/

i will try to write a flash skin with some debug output and upload it, maybe i can fix that bug like that, but it will take some time. i have to go now and there are a lot of things i have to do tomorrow. so maybe i can finish it till tomorrow evening.

Edit:
Another problem: is it possible that the player pauses the flash skin after some time?
Everything works correctly on my D2 if i touch the screen somewhere before the song ends(so that the screen turns on), but if i just let it play it won't skip to the next track in my playlist.

regards,
m4gnus

tirim4
04-16-2009, 04:58
Offtopic:indica and nightwish?! awesome, just saw them live about a month ago
back to the problem:
it could probably be the firmware which would be really bad because debuging that over the internet would be a pain...

if you have some knowledge of flash you can try to debug it yourself...it seems as if the playlist doesn't load correctly, but i don't understand why the first track is playing :/

i will try to write a flash skin with some debug output and upload it, maybe i can fix that bug like that, but it will take some time. i have to go now and there are a lot of things i have to do tomorrow. so maybe i can finish it till tomorrow evening.

Edit:
Another problem: is it possible that the player pauses the flash skin after some time?
Everything works correctly on my D2 if i touch the screen somewhere before the song ends(so that the screen turns on), but if i just let it play it won't skip to the next track in my playlist.

regards,
m4gnus

offtopic: Yeay, I love them both! I want to see them live too, but missed all their swedish conserts...

ontopic:I have barely no knowledge in flash... Ill see if I can go through all of your steps a few times again to see if it's just me who have done something wrong...
But there has been some problems with a few flash skins in D2+ firmware, will try UCI selector lite which have got those skins to work.

EDIT: Tried using the loader, made the skin freeze.
Redid all the steps but it still just plays the first song...

EDIT2: Now the right blue button just loads the same song all the time, and it's not one in the playlist...

m4gnus
04-16-2009, 05:48
Ill see if I can go through all of your steps a few times again to see if it's just me who have done something wrong...

Ok do that but it looks like there's something wrong with the flash skin because your .txt files look alright.
I will post a debug-version of my flash skin in a few hours(got some other things to do :/ )

regards,
m4gnus

caz
04-16-2009, 05:48
Another problem: is it possible that the player pauses the flash skin after some time?
(offtopic: i'm not from germany but i speak german :-D)

yes, as far as i know thats true. the flash skin pauses after it has turned black. if you want a proof of it, just download the skin i designed and serious coded (just click on the ocean flash skin link in my signature). if you load this flashskin (offtopic: wich i like MOST) on your d2, play a song and switch to hold (by touch or by hw-lock, just as you like). a clock will show you the time. if the screen turns black and you unlock it after a second, you'll see that the time takes a step (let's say you locked it on 8:33am and unlock it on 8:36 you'll first see 8:33 and than it'll jump to 8:36 and unlock the screen). just if you want to know if this is true^^ YES the flash skin pauses if you lock it (or if it turns to black). if you want to know if you can change this, i would write a message to serious if i were you..

hope this is an answer that help you..

m4gnus
04-21-2009, 12:06
heyho,
sorry, that i haven't posted any updates lately, i've been toying with design ideas and stuff like that. so i haven't really worked on the code(except for a debug console). I think i will port the playlist to a horizontal player(i'm modding the cowon sample skin at the moment) and rework some of my code(been inspired by coverflow, i'll switch to folder browsing as well), so there won't be updates for a while....

Btw i still haven't found a way to stop the D2 from pausing the flash skin except for leaving the screen on permanently(this can be changed in the options). So, if somebody finds a solution please tell me.

regards,
m4gnus