Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_playlist_output (Read 49049 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_playlist_output

Got bored and wanted to share my playlist with a friend only to find now way to do this..  So out of boredom and wanting to poke around the foobar api I wrote this.  Currently designed to easily replicate WinAmp's HTML output.  The output html itself is rather plain and needs a css file to go with it [the included foobar2000.css gives a nice look that can be seen here ]

Text output is done using the playlist formatting.

Support for playlist formatting in HTML is in the works.  Currently it doesn't scale well.  Example,  a 7000 track playlist using the Hybrid formatting string creates a 10 Megabyte HTML file.  This is mostly due to the addition and conversion of spaces to   to preserve structure.  Once I get this working better I will release a build that includes this support.

Comments, suggestions, bugs, crisitism, etc all welcome.

Download: here

foo_playlist_output

Reply #1
Nice work Tres`ni, this is going to come in handy.
You're talking to my guy all wrong... It's the wrong tone. Say it again, and i'll stab you in the face with a soldering iron!

foo_playlist_output

Reply #2
Nice, but CSS-file doesn't work for me.

((((( Strictly4me )))))

foo_playlist_output

Reply #3
Quote
Nice, but CSS-file doesn't work for me.
[a href="index.php?act=findpost&pid=295421"][{POST_SNAPBACK}][/a]

Did you copy the foobar2000.css file into the same directory as your generated HTML file? Works here, and that's all I had to do...

Code: [Select]
<link rel="stylesheet" type="text/css" href="foobar2000.css" />

indicates that relative path are same directory. Guess you can edit the HTML file if you want it differently.
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

foo_playlist_output

Reply #4
Quote
Did you copy the foobar2000.css file into the same directory as your generated HTML file?

Upps, now it works fine! - My mistake, sorry! 
THX.

((((( Strictly4me )))))

foo_playlist_output

Reply #5
Not bad! 



But i would prefer 01. ... 02. ... 03., for the countnumbers from 1 to 9.
Would looks more nice.

((((( Strictly4me )))))

foo_playlist_output

Reply #6
Nice one.
You may want to replace
.hilite { color: darkblue; }
with
.hilite { color: #000080; }
and
font-family: courier new;
with
font-family: "Courier New", Courier, monospace;
so it validates against w3c.

foo_playlist_output

Reply #7
i just use mp3tag's export feature...
- sig removed, no code allowed

foo_playlist_output

Reply #8
Quote
so it validates against w3c.
[a href="index.php?act=findpost&pid=295531"][{POST_SNAPBACK}][/a]

For full W3C XHTML validity the plugin should maybe also convert special characters occurring in names in playlist to theire respective control sequences:

Code: [Select]
Special Characters in XML:

Special character       Special meaning         Entity encoding

       >                 Begins a tag.           &gt;
       <                 Ends a tag.             &lt;
       "                 Quotation mark.         &quot;
       '                 Apostrophe.             &apos;
       &                 Ampersand.              &amp;


EDIT:
Explaining better: Like converting Captain Beefheart & His Magic Band into Captain Beefheart &amp; His Magic Band
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

foo_playlist_output

Reply #9
Quote
Not bad!  



But i would prefer 01. ... 02. ... 03., for the countnumbers from 1 to 9.
Would looks more nice.

((((( Strictly4me )))))
[a href="index.php?act=findpost&pid=295498"][{POST_SNAPBACK}][/a]

I haven't tried this plugin yet, but can't you do

$num(%_playlist_number%,$len(%_playlist_total%)) to get zero padded numbers?

foo_playlist_output

Reply #10
Quote
I haven't tried this plugin yet, but can't you do

$num(%_playlist_number%,$len(%_playlist_total%)) to get zero padded numbers?
[a href="index.php?act=findpost&pid=295594"][{POST_SNAPBACK}][/a]

To get tracknumbers with 4553 leading zeros?  We'd need a $log function to solve this easily, or multiple embedded $if-s.


EDIT: Ooops, foosion is right  Sorry
Life is Real...
(But not in audio :) )

foo_playlist_output

Reply #11
Quote
To get tracknumbers with 4553 leading zeros?  We'd need a $log function to solve this easily, or multiple embedded $if-s.[a href="index.php?act=findpost&pid=295595"][{POST_SNAPBACK}][/a]
Read carefully what was posted; the format is $num(%_playlist_number%,$len(%_playlist_total%)). The $len() function easily solves this - and it does compute the (rounded) base 10 logarithm .

foo_playlist_output

Reply #12
ERROR (CORE) : Failed to load DLL: foo_playlist_output.dll, reason: Unable to load DLL.


foo_playlist_output

Reply #13
Quote
ERROR (CORE) : Failed to load DLL: foo_playlist_output.dll, reason: Unable to load DLL.


[a href="index.php?act=findpost&pid=295615"][{POST_SNAPBACK}][/a]


This does require that you have the MSVC7 runtime dll's as I am using Visual Studio .Net to compile.  That's most likely the problem

foo_playlist_output

Reply #14
Quote
Quote
Not bad!  
But i would prefer 01. ... 02. ... 03., for the countnumbers from 1 to 9.
Would looks more nice.

((((( Strictly4me )))))
[a href="index.php?act=findpost&pid=295498"][{POST_SNAPBACK}][/a]

I haven't tried this plugin yet, but can't you do

$num(%_playlist_number%,$len(%_playlist_total%)) to get zero padded numbers?
[a href="index.php?act=findpost&pid=295594"][{POST_SNAPBACK}][/a]


Nope you can't..  The current HTML formatting is static to the WinAmp defaults..  Mostly because if I tried using the playlist formating then you can likely end up with huge listings like what I mentioned in my original post.  I thought about using padded numbers, but decided agianst it since it didn't look like the WinAmp defaults....  That might seem dumb, but in the end my goal is to have 2 HTML output options: WinAmp and foobar2000, where foobar2000 uses your playlist formating string to generate the HTML.

foo_playlist_output

Reply #15
Quote
For full W3C XHTML validity the plugin should maybe also convert special characters occurring in names in playlist to theire respective control sequences:
[a href="index.php?act=findpost&pid=295581"][{POST_SNAPBACK}][/a]

Good catch, I actually have code for this, I just commented it out when I was commenting out all the code for playlist formatting output..  I'll fix here quick.

foo_playlist_output

Reply #16
Quote
Nope you can't..  The current HTML formatting is static to the WinAmp defaults..  Mostly because if I tried using the playlist formating then you can likely end up with huge listings like what I mentioned in my original post.  I thought about using padded numbers, but decided agianst it since it didn't look like the WinAmp defaults....  That might seem dumb, but in the end my goal is to have 2 HTML output options: WinAmp and foobar2000, where foobar2000 uses your playlist formating string to generate the HTML.
[{POST_SNAPBACK}][/a]

That's too bad. How about a third mode, custom string?

Otherwise, I'd still have to use a manual string.

[a href="http://www.hydrogenaudio.org/forums/index.php?showtopic=13807]http://www.hydrogenaudio.org/forums/index....showtopic=13807[/url]
http://www.hydrogenaudio.org/forums/index....showtopic=20412

http://my.netian.com/~cajunlee/list.htm

foo_playlist_output

Reply #17
Quote
That's too bad. How about a third mode, custom string?


I'll add it to my to do list  While I have [atleast rudementary] skills when it come to Win32 programming, the way the foobar2K API works is differant from anything I've ever done before so it's taking a little getting used to.  I'll probably have this working before I figure out playlist formatting output without producing huge files

foo_playlist_output

Reply #18
Quote
This does require that you have the MSVC7 runtime dll's as I am using Visual Studio .Net to compile.  That's most likely the problem
[a href="index.php?act=findpost&pid=295768"][{POST_SNAPBACK}][/a]


I have the MSVC7 runtime dlls installed so that doesn't seem to be the problem.

*shrugs* oh well.

foo_playlist_output

Reply #19
I have the same problem as Gord and I also have the MCSVR runtimes.

ERROR (CORE) : Failed to load DLL: foo_playlist_output.dll, reason: Unable to load DLL

foo_playlist_output

Reply #20
Thanks for this nice plugin , it works well

my little suggestion:
I would prefer something like
"Playlist length: 3 days 4 hours 7 minutes 21 seconds."
instead of
"Playlist length: 76 hours 7 minutes 21 seconds."

and then also replacing 7 days by 1 week like in the status display page in foobar prefs


EDIT:
i ve just realised that lenght of the playlist lenght displayed in foobar and the one displayed in the generated output file differ.
ie:
- in foobar: 8h42mn31s
- in the generated output file: 8h41mn28s

and the longer the playlist is , the bigger is the difference

foo_playlist_output

Reply #21
Quote
i ve just realised that lenght of the playlist lenght displayed in foobar and the one displayed in the generated output file differ.
ie:
- in foobar: 8h42mn31s
- in the generated output file: 8h41mn28s

and the longer the playlist is , the bigger is the difference
[a href="index.php?act=findpost&pid=295829"][{POST_SNAPBACK}][/a]

That's correct. I got "Playlist length: 47 hours 6 minutes 45 seconds." from foo_playlist_output and "1d 23:12:03" from foobar2000. Thats an almost 6 minutes discrepancy in under 48 hours. That's too much....
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

foo_playlist_output

Reply #22
Quote
I have the MSVC7 runtime dlls installed so that doesn't seem to be the problem.
[a href="index.php?act=findpost&pid=295797"][{POST_SNAPBACK}][/a]

Do you have both msvcr71.dll and msvcp71.dll in the same folder as foobar2000.exe?
"ONLY THOSE WHO ATTEMPT THE IMPOSSIBLE WILL ACHIEVE THE ABSURD"
        - Oceania Association of Autonomous Astronauts

foo_playlist_output

Reply #23
Quote
Quote
i ve just realised that lenght of the playlist lenght displayed in foobar and the one displayed in the generated output file differ.
ie:
- in foobar: 8h42mn31s
- in the generated output file: 8h41mn28s

and the longer the playlist is , the bigger is the difference
[a href="index.php?act=findpost&pid=295829"][{POST_SNAPBACK}][/a]

That's correct. I got "Playlist length: 47 hours 6 minutes 45 seconds." from foo_playlist_output and "1d 23:12:03" from foobar2000. Thats an almost 6 minutes discrepancy in under 48 hours. That's too much....
[a href="index.php?act=findpost&pid=295873"][{POST_SNAPBACK}][/a]


Now that's really odd..  Let me look into it some more and see what I can figure out.
[developer stuff]
I am using
Code: [Select]
  metadb_handle_list temp;
 playlist_oper::get()->get_data(temp);

 for(int i = 0; i < temp.get_count(); i++)
     total += temp.get_item(i)->handle_get_length();
 temp.delete_all();
...
 unsigned long total_hours = total / 3600;
 total %= 3600;

 out.add_int(total_minutes);
 total %= 60;

To compute the length of the playlist, anyone see why there would be such huge discrepencies?  Only thing I can figure is I don't check for ones that return handle_get_length() <= 0, which may mean that I can't get the length that way...  I'm not sure..
[/developer stuff]

foo_playlist_output

Reply #24
Quote
Only thing I can figure is I don't check for ones that return handle_get_length() <= 0, which may mean that I can't get the length that way...  I'm not sure..[a href="index.php?act=findpost&pid=295897"][{POST_SNAPBACK}][/a]
Some inputs may return -1.0, if the length cannot be determined (think streaming audio). You should just count those as having length 0, at least that's what the properties dialog does.

Also there is string_print_time in the SDK, if you want to output the total time in the same format as in the properties dialog/status bar.

 
SimplePortal 1.0.0 RC1 © 2008-2021