Adam Waite
Adam Waite

Reputation: 18865

MPMediaItemCollection Whole Library?

Does anyone know if it's possible to create an MPMediaItemCollection object containing every song in a users iPod library without the user having to select it using the MPMediaPicker stuff? Like, on application launch perhaps.

Thanks...

Upvotes: 1

Views: 600

Answers (2)

Filippo
Filippo

Reputation: 21

// _musicPlayer = [MPMusicPlayerController iPodMusicPlayer];

MPMediaQuery *allLibrary = [[MPMediaQuery alloc]init];
[allLibrary setGroupingType:MPMediaGroupingTitle];
[_musicPlayer setQueueWithQuery:allLibrary];

Upvotes: 2

edie
edie

Reputation: 768

Try this one

    MPMediaQuery *everything = [[MPMediaQuery alloc] init];

    NSArray *songs = [everything items];
    MPMediaItemCollection *mediaCollection = [MPMediaItemCollection collectionWithItems:songs];
    [everything release];

Upvotes: 1

Related Questions