AddMusic example Ipod library access

I want to use the addmusic example that apple have created for the IPod library access and be able to play the music in MY application; I however dont know which files to copy and how to combine the two... can someone please tell me what to do? I already have created a button in MY application which will then upon click do the same thing that the button in the AddMusic example does to open up the Mediapicker thing. Any help will be greatly appreciated.

Answers


You don't need to copy any specific files from the example, just some of the functions.

To pick the music you use MPMediaPickerController , look at AddMusicOrShowMusic in MainViewController.m to see how to instantiate that and what delegate methods you need to implement.

The important class you need to use to play the music is MPMusicPlayerController. In MainViewController.m you'll see the methods you need to implement and how to use it, see - (IBAction) playOrPauseMusic: (id)sender { for example.

Essentially you'll take the media items returned by MPMediaPickerController and call setQueueWithItemCollection on the MPMediaPickerController to queue up the music. After that it's really just a case of calling play/pause/etc and updating your interface.

The code you need is all in there, you just need to pull out the right bits.


Need Your Help

allocate text value submitted by a form to a variable after clicking submit button

php javascript html

I want to store the text value submitted by clicking the submit button of a form, in a variable, so that I can use that variable for further querying the DB.

How to add dynamic customized ShareThis button?

javascript social sharethis

I would like to use ShareThis on my site and add multiple buttons for the same service to share multiple objects. This is possible but I could only get the buttons to be in one of the default style...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.