Is there a free library for loading M3U playlist files' paths into alistbox?

K

kimiraikkonen

Hi,
The question is exactly the same with thread subject.

It would be great if there's a free M3U library which provides loading
M3U / PLS playlist items' paths into a listbox for VB.NET 2005. Vice
versa (saving capability) also would be nice

Thanks!
 
O

\(O\)enone

kimiraikkonen said:
It would be great if there's a free M3U library which provides loading
M3U / PLS playlist items' paths into a listbox for VB.NET 2005. Vice
versa (saving capability) also would be nice

Thanks!

I don't know about PLS files, but M3U files are about as easy to read and
write as you could ask for, so you can just write your own code for this.

File information is here:

http://www.wotsit.org/list.asp?search=m3u
 
T

Tom Shelton

Hi,
The question is exactly the same with thread subject.

It would be great if there's a free M3U library which provides loading
M3U / PLS playlist items' paths into a listbox for VB.NET 2005. Vice
versa (saving capability) also would be nice

Thanks!

M3U is a really simple format - it's really just straight text.
Creating a library should be really easy. Hmmm, in fact, I used to
have an app I wrote on a Linux box using C# and Mono that would scan
directories and generate M3U playlists... I'll look around and see if
I still have the code (though, I suspect not). But, here is at least
one resource describing the format:

http://hanna.pyxidis.org/tech/m3u.html

HTH
 
K

kimiraikkonen

(O)enone said:
I don't know about PLS files

[...]

OK, I do now, Wikipedia has some information on the content of these files.
They're also just text files so you should be able to easily read and write
these too.

http://en.wikipedia.org/wiki/PLS_(file_format)

Yes, they are straight text-based formats, but they have some
exclusive specifiers such as #EXTM3U, #EXTINF and more. I have to
ignore or translate these specifiers during loading files' path's into
listbox, that makes project harder than you guess. If it's easy to
import an M3U items' path's into a listbox with knowing all M3U
specifiers, it would be so good to see here a code sample.

Thanks.
 
T

Tom Shelton

(O)enone said:
I don't know about PLS files

OK, I do now, Wikipedia has some information on the content of these files.
They're also just text files so you should be able to easily read and write
these too.

(O)enone

Yes, they are straight text-based formats, but they have some
exclusive specifiers such as #EXTM3U, #EXTINF and more. I have to
ignore or translate these specifiers during loading files' path's into
listbox, that makes project harder than you guess. If it's easy to
import an M3U items' path's into a listbox with knowing all M3U
specifiers, it would be so good to see here a code sample.

Thanks.

I'm not exactly sure what your asking? What exactly are you after
from the file. The file format is very, very simple - here is the
sample from the format documentation:

#EXTM3U
#EXTINF:111,3rd Bass - Al z A-B-Cee z
mp3/3rd Bass/3rd bass - Al z A-B-Cee z.mp3
#EXTINF:462,Apoptygma Berzerk - Kathy�s song (VNV Nation rmx)
mp3/Apoptygma Berzerk/Apoptygma Berzerk - Kathy's Song (Victoria Mix
by VNV Nation).mp3
#EXTINF:394,Apoptygma Berzerk - Kathy's Song
mp3/Apoptygma Berzerk/Apoptygma Berzerk - Kathy's Song.mp3
#EXTINF:307,Apoptygma Bezerk - Starsign
mp3/Apoptygma Berzerk/Apoptygma Berzerk - Starsign.mp3
#EXTINF:282,Various_Artists - Butthole Surfers: They Came In
mp3/Butthole_Surfers-They_Came_In.mp3

The #EXTM3U is always the first line of the file. So, you can just
ignore that first line when reading it in. Then, each pair of lines
after that makes up the information about a particular track. The
#EXTINF line is metadata... In the fomrat of:

#EXTINF:track length in whole seconds,name of track

The name is not the filename, but the actual song title - according
the spec, a generator should take that from the file metadata (the ID3
tag for an mp3). If it doesn't exist, it is the filename - extension.

And the next line is the actual path/filename.

So, what part is giving you trouble?
 
K

kimiraikkonen

(O)enone wrote:
I don't know about PLS files
[...]
OK, I do now, Wikipedia has some information on the content of these files.
They're also just text files so you should be able to easily read and write
these too.
http://en.wikipedia.org/wiki/PLS_(file_format)
Yes, they are straight text-based formats, but they have some
exclusive specifiers such as #EXTM3U, #EXTINF and more. I have to
ignore or translate these specifiers during loading files' path's into
listbox, that makes project harder than you guess. If it's easy to
import an M3U items' path's into a listbox with knowing all M3U
specifiers, it would be so good to see here a code sample.

I'm not exactly sure what your asking? What exactly are you after
from the file. The file format is very, very simple - here is the
sample from the format documentation:

#EXTM3U
#EXTINF:111,3rd Bass - Al z A-B-Cee z
mp3/3rd Bass/3rd bass - Al z A-B-Cee z.mp3
#EXTINF:462,Apoptygma Berzerk - Kathy�s song (VNV Nation rmx)
mp3/Apoptygma Berzerk/Apoptygma Berzerk - Kathy's Song (Victoria Mix
by VNV Nation).mp3
#EXTINF:394,Apoptygma Berzerk - Kathy's Song
mp3/Apoptygma Berzerk/Apoptygma Berzerk - Kathy's Song.mp3
#EXTINF:307,Apoptygma Bezerk - Starsign
mp3/Apoptygma Berzerk/Apoptygma Berzerk - Starsign.mp3
#EXTINF:282,Various_Artists - Butthole Surfers: They Came In
mp3/Butthole_Surfers-They_Came_In.mp3

The #EXTM3U is always the first line of the file. So, you can just
ignore that first line when reading it in. Then, each pair of lines
after that makes up the information about a particular track. The
#EXTINF line is metadata... In the fomrat of:

#EXTINF:track length in whole seconds,name of track

The name is not the filename, but the actual song title - according
the spec, a generator should take that from the file metadata (the ID3
tag for an mp3). If it doesn't exist, it is the filename - extension.

And the next line is the actual path/filename.

So, what part is giving you trouble?

Hi Tom,
Thanks for your care but the issue is that i'm not so experienced as
much as you or others to translate them into a class library code. On
the net or on the group there's no such a detailed DLL (class library)
help for writing DLLs. I only worked on a simple class library project
with "your" help on that thread: (very thanks for this)

http://groups.google.com/group/micr...hl=en&lnk=st&q=class+library#1973fd12aad4b765

So, i "only" want to import M3U item' paths, no ID3 tags or no
duration(because i already did it).

Furthermore, if you give some tips for practising about writing DLLs
it would be great help and service of you :)

BTW, there's no obligation for writing the code as DLL, sure it may be
included in EXE, right?

Regards.
 
T

Tom Shelton

Hi Tom,
Thanks for your care but the issue is that i'm not so experienced as
much as you or others to translate them into a class library code. On
the net or on the group there's no such a detailed DLL (class library)
help for writing DLLs. I only worked on a simple class library project
with "your" help on that thread: (very thanks for this)

There's not a lot to creating a class library... The biggest conceptual
difference here is that generally a library is created to encourage
re-use of the code, so you want to avoid any coupling of your classes to
a particular implementation... In other words, you want to think in a
more abstracted manner then maybe classes you are building in an exe.
http://groups.google.com/group/micr...hl=en&lnk=st&q=class+library#1973fd12aad4b765

So, i "only" want to import M3U item' paths, no ID3 tags or no
duration(because i already did it).

Then your are already reading the file.... For all practicle purposes,
if a line doesn't start with #, then it is a path.
Furthermore, if you give some tips for practising about writing DLLs
it would be great help and service of you :)

The only real tips I can give you is practise :) Really, once you know
mechanical steps to creating/using a library - the rest is just learning
OO design techniques. You might want to do some reading about design
patterns.
BTW, there's no obligation for writing the code as DLL, sure it may be
included in EXE, right?

No, you are not oblicated to write the code in a dll. Anything you can
do in a dll, you can do right inside your exe. But, putting generic
stuff into a dll is a good idea, because you can easily reuse it in
other projects (not to mention that it centeralizes the maintainence of
that code).
 
K

kimiraikkonen

A little criticisim about M3U lists. They "usually" store file paths
WITHOUT exact/full path,they only store the filename with root folder
instead of storing as songs with their full paths including drive
letter.

1) Here is an original Winamp generated M3U example which makes
developer's job difficult:

#EXTM3U
#EXTINF:269,Nicole Scherzinger-Baby Love
baby_love.mp3
#EXTINF:195,Behind These Hazel Eyes
Behind These Hazel Eyes.mp3
#EXTINF:190,Britney Spears - Piece Of Me
Piece Of Me.mp3
#EXTINF:290,Justin Timberlake - Cry Me A River
Crymeariver.mp3

While you importing the lines into a VB listbox then you add items by
telling that add items which doesn't start with "#", the rest (path)
lines are remained just only file name with no exact path which is
useless. If they were exact paths like:

#EXTM3U
#EXTINF:269,Nicole Scherzinger-Baby Love
e:\asong\baby_love.mp3
#EXTINF:195,Behind These Hazel Eyes
d:\songs\Behind These Hazel Eyes.mp3
#EXTINF:190,Britney Spears - Piece Of Me
c:\Piece Of Me.mp3
#EXTINF:290,Justin Timberlake - Cry Me A River
c:\blabla\Crymeariver.mp3

There wouldn't be any complication and non-"#"-having lines would stay
as paths(would be great). But generic M3U isn't this.

2) Second thing is related to this but the reason is quite
different.In "some" cases (not always), If you remove playlist file
into another location(i'm not meaning changing mp3's location, pay
attention), the M3U playlist items are no longer playable.

Have a test:
Place some songs in "desktop", open Winamp, add this songs to the list
and save the list in "desktop" location such as "list.m3u". Then move
this list to "My Documents" (be careful, don't move songs,just m3u
list). You'll see they're no playable any longer due to misdesign in
M3U. (Same result with Windows Media Player)

Shortly, if "all" M3U file types were used to store song paths with
full/exact paths, there wouldn't be "any" problem even M3U lists can
recognize full paths you may try.

Regards.
 
T

Tom Shelton

A little criticisim about M3U lists. They "usually" store file paths
WITHOUT exact/full path,they only store the filename with root folder
instead of storing as songs with their full paths including drive
letter.

1) Here is an original Winamp generated M3U example which makes
developer's job difficult:

#EXTM3U
#EXTINF:269,Nicole Scherzinger-Baby Love
baby_love.mp3
#EXTINF:195,Behind These Hazel Eyes
Behind These Hazel Eyes.mp3
#EXTINF:190,Britney Spears - Piece Of Me
Piece Of Me.mp3
#EXTINF:290,Justin Timberlake - Cry Me A River
Crymeariver.mp3

While you importing the lines into a VB listbox then you add items by
telling that add items which doesn't start with "#", the rest (path)
lines are remained just only file name with no exact path which is
useless. If they were exact paths like:

#EXTM3U
#EXTINF:269,Nicole Scherzinger-Baby Love
e:\asong\baby_love.mp3
#EXTINF:195,Behind These Hazel Eyes
d:\songs\Behind These Hazel Eyes.mp3
#EXTINF:190,Britney Spears - Piece Of Me
c:\Piece Of Me.mp3
#EXTINF:290,Justin Timberlake - Cry Me A River
c:\blabla\Crymeariver.mp3

There wouldn't be any complication and non-"#"-having lines would stay
as paths(would be great). But generic M3U isn't this.

2) Second thing is related to this but the reason is quite
different.In "some" cases (not always), If you remove playlist file
into another location(i'm not meaning changing mp3's location, pay
attention), the M3U playlist items are no longer playable.

Have a test:
Place some songs in "desktop", open Winamp, add this songs to the list
and save the list in "desktop" location such as "list.m3u". Then move
this list to "My Documents" (be careful, don't move songs,just m3u
list). You'll see they're no playable any longer due to misdesign in
M3U. (Same result with Windows Media Player)

Shortly, if "all" M3U file types were used to store song paths with
full/exact paths, there wouldn't be "any" problem even M3U lists can
recognize full paths you may try.

Regards.

What you say about M3U list's is true. The path can be anything the
application understands... And that means they can be relative or
full paths. That can make it difficult to import M3U lists if you
don't know what the root was :)
 
K

kimiraikkonen

What you say about M3U list's is true. The path can be anything the
application understands... And that means they can be relative or
full paths. That can make it difficult to import M3U lists if you
don't know what the root was :)

Yep Tom, that's why developer is forced to put a lot of "if then"
statements in order to make application understand the correct full
path of M3U contents.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top