• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: get iTunes songs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: get iTunes songs


  • Subject: Re: get iTunes songs
  • From: John Stiles <email@hidden>
  • Date: Mon, 16 Oct 2006 08:12:13 -0700

Does it affect the performance if you comment out this bit?
            if (![artist isEqualToString:@""])
           if (![artistArray containsObject:artist])
               [artistArray addObject:artist];
This seems very slow as you are walking your entire artist array for every song you load.
This could be a lot faster if you used a dictionary, but as a first test, just comment it out and see if it affects things.



Olariu Adrian Mihai wrote:
If I have about 5000 tracks in the library mand it takes about 20 seconds to load all the track in my table view. Below is the code that I use to load tracks.

   while (track = [trackEnum nextObject])
   {

id obj=[trackArray objectAtIndex:count];
count++;
if ([track databaseId] == [currentTrack databaseId])
{
currentTrackObject = obj;
[obj setValue:[playIcon image] forKey:@"Status"];
}
NSString *artist = [track artist];
[obj setValue:track forKey:@"Track"];
[obj setValue:[track name] forKey:@"Name"];
[obj setValue:[track time] forKey:@"Time"];
[obj setValue:artist forKey:@"Artist"];
[obj setValue:[track album] forKey:@"Album"];
[obj setValue:[[NSNumber alloc] initWithInt:[track rating]/20 ] forKey:@"MyRating"];
if (![artist isEqualToString:@""])
if (![artistArray containsObject:artist])
[artistArray addObject:artist];
}



John Stiles wrote:
I think Automator will be doing the same basic thing as EyeTunes—using AppleEvents to get a list of all available songs.
Could you post the EyeTunes code that was too slow for you?
How slow was too slow?


Olariu Adrian Mihai wrote:
I want to create an application that get all the songs from itunes library and display them in a tableview.
I have tried EyeTunes framework but is to slow for what I am trying to do. I see that from an "Automator" application it is possible to get all the tracks from itunes library but how can I include this functionality in my application?


Thanks.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: get iTunes songs
      • From: Olariu Adrian Mihai <email@hidden>
References: 
 >get iTunes songs (From: Olariu Adrian Mihai <email@hidden>)
 >Re: get iTunes songs (From: John Stiles <email@hidden>)
 >Re: get iTunes songs (From: Olariu Adrian Mihai <email@hidden>)

  • Prev by Date: Re: Do Notifications thread?
  • Next by Date: Re: Enabling/Disabling an NSTableView in an NSPanel
  • Previous by thread: Re: get iTunes songs
  • Next by thread: Re: get iTunes songs
  • Index(es):
    • Date
    • Thread