gap-dev-discuss
[Top][All Lists]
Advanced

[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 22:42:07 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120430 Thunderbird/12.0.1

Le 13/05/2012 19:27, Sebastian Reitenbach a écrit :
>  
> On Sunday, May 13, 2012 19:01 CEST, Philippe Roussel <address@hidden> wrote: 
>> Yes, I saw that yesterday, I spoke too fast...
>>
>> Can you save and load playlists on your setup ? With the small patch I
>> sent it works quite well here.
> 
> Here too. However, I recognized in the Code of Playlist.m and 
> PlaylistController.m
> there are checks to not load a file twice tot the playlist, which is just not 
> working.
> It is comparing the new Song Object, with the Objects in the playlist. But 
> since they
> have different Object IDs, this fails. I think it should better compare the 
> filename
> attribute of a Song instance?

Yep. The following might help :

Index: Song.m
===================================================================
RCS file: /sources/gap/gap/user-apps/Cynthiune/Song.m,v
retrieving revision 1.2
diff -u -r1.2 Song.m
--- Song.m      13 May 2012 16:56:42 -0000      1.2
+++ Song.m      13 May 2012 20:40:36 -0000
@@ -73,6 +73,15 @@
   return self;
 }

+- (BOOL)isEqual:(id)object
+{
+  if (object == self)
+    return YES;
+  if ([object class] != [self class])
+    return NO;
+  return [filename isEqualToString:[object filename]];
+}
+
 - (id) initWithFilename: (NSString *) aFilename
 {
   self = [self init];



reply via email to

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