[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gap-dev-discuss] Cynthiune - shuffle playlist

From: Philippe Roussel
Subject: Re: [Gap-dev-discuss] Cynthiune - shuffle playlist
Date: Sun, 13 May 2012 11:22:46 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Hi Riccardo,

Le 12/05/2012 00:04, Riccardo Mottola a écrit :
> Hi,
> Philippe Roussel wrote:
>> File attached. Nothing funny here, just filenames with spaces (not mine,
>> I swear !).
>> By the way, using absolute paths could be nice. If I move this .m3u file
>> its content is useless.
> I can load your playlist just fine! The songs are greyed out because I
> don't have the files, but they load and I don't see any errors. I wonder
> if you have local changes or some specific setting...
> M3U accepts both local as well as absolute paths. They even can be
> mixed. Perhaps in the future we can add an option. For now I don't want
> to add new features but debug and fix what we have so we can do a needed
> release.

I found the bug.

In PlaylistController, _feedPlaylistWithTreeOfFilenames: is used to load
song files and playlist files.

If [FormatTester -formatNumberForFile:] returns something > -1 we
consider the file as a song and this is wrong : this method returns 0+
if an Format bundle accept the file extension *or* if a Format bundle
+canTestFileHeaders returns YES. I have one of these bundles compiled so
my playlist file is always considered as a music file.

Just inverting the following test works but in the long run this code
should be separated, there are no reason to used to same code to load a
playlist and to load music files.


Index: PlaylistController.m
RCS file: /sources/gap/gap/user-apps/Cynthiune/PlaylistController.m,v
retrieving revision 1.4
diff -u -r1.4 PlaylistController.m
--- PlaylistController.m        9 May 2012 16:27:08 -0000       1.4
+++ PlaylistController.m        13 May 2012 09:14:33 -0000
@@ -496,14 +496,14 @@
       else if (fileIsAcceptable (filename))
-          if ([formatTester formatNumberForFile: filename] > -1)
+         if ([formatTester fileIsPlaylist: filename])
+           {
+             [playlist loadFromFile: filename];
+           }
+          else if ([formatTester formatNumberForFile: filename] > -1)
               [playlist addSong: [Song songWithFilename: filename]];
-         else if ([formatTester fileIsPlaylist: filename])
-          {
-             [playlist loadFromFile: filename];
-         }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]