ITunes COM SDK, Playlists and Delphi

Hi there,
I just started playing around with the COM SDK in Delphi and things are going well, except for that I seem to be unable to create a playlist of my own and populate it with files from my hard disk.
According to the documentation I have IITPlaylist, IITUserPlaylist and IITLibraryPlaylist. The first and the last have AddFile() methods, but only IITUserPlaylist has a CreatePlaylist method. I'm pretty much confused about how to achieve the following for my mIRC iTunes remote control plugin:
- Create a temporary playlist
- Add a number of media files from my hard disk to the playlist
- Play exactly this playlist and nothing more.
I have been able to simply play a track, but iTunes will continue playing the rest of the current library after the song has finished.
I also created an empty playlist successfully, but I couldn't find anything about how to add files to this playlist. *big sigh*
Any suggestions are greatly welcome!

Okay, I figured out how it works. First you have to create a new playlist. The returned object will be of the type IITPlaylist, yet its property "kind" indicates that it is a user playlist. By type-casting it to IITUserPlaylist, one can access the new methods (addFile, PlayFirstTrack, etc.) - this is absolutely NOT obvious to the beginner. I admit, inheritance is one of the core elements of COM but hey, I'm just beginning with that.

Similar Messages

  • ITunes COM SDK to sync Audiobook with iOS 5 issue

    My application has been using iTunes COM SDK for Windows to add tracks into iOS devices and it's been working for years. Until the recently released iTunes 10.5 versus iOS 5, the added tracks are missing from the iOS 5 devices (iPhone, iPad, etc.).
    The SDK calls are returned successfully and from desktop, the iTunes 10.5 shows the tracks under "Books" folder of iOS 5 device correctly. I can also play it form desktop. But, from the iOS 5 device, the track is totally missing!!! However, if I perform a search in the device with the track name, then I can find it and play it. It just does not list under the Audiobooks folder of the device!
    If I used the same SDK calls to add to "Music" folder, then it works fine.
    Any idea? I suspect it is a bug either in iTunes 10.5 or iOS 5? Because apparently the audio track is there, iTunes 10.5 sees it, but the iOS 5 can't?
    Please help.
    Thanks.

    Thanks for the reply. The functions from iTunes COM SDK are straightforward. Find the IITIPodSource to the connected device and then obtain its IITLibraryPlaylist interface to call AddFile() or AddTrack() depends on whether the audio file is from file system or from iTunes Library. The trick for the audio file to be categorized in Audiobooks is to use ".m4b" file extension for AAC encoded format.
    It has been working for earlier iTunes versus iOS 4 and under, and it is still working, the file still shows up in iTunes > iOS 5 device > Books. However, the iOS 5 device's Music app does not pick it up. I found that if I tried to use ".m4a" then the iOS 5 device will pick it up under "Songs" (or "Music" under iTunes).
    I think either the AddTrack() or AddFile() calls have bugs or the iOS 5 Music app has glitch that cannot pickup certain files added into device. I've submitted bugs to http://bugreport.apple.com, at the same time, maybe someone from the community has idea to work around this?

  • ITune COM SDK supports GUI access?

    I am searching for  API to log-in to iTune with Apple ID and Password.
    I have  Apple ID and Passwords written in an excel file.
    What I want to do is to:
    Read the excel file line by line to take ID/PASS
    Log-in to iTunes with that ID/PASS
    Click the download button
    Is there any  library for this purpose (For step #2 and  #3)? Does iTunes COM SDK support that GUI (input in to the ID - PASSWORD field) access?
    This is urgent for me.
    Please anyone help.
    Thanks in Advance
    Rahman

    It seems that it is reading something in the ObAccessClient.xml file, because it receives a response from the Access Server. I would guess some sort of communications error - perhaps a certificate error if Open transport mode is not being used. Also, are the times on the asdk machine and the Access Server in sync?
    Regards,
    Colin

  • ITunes COM SDK License Warning

    Hi,
       I'm developing a commercial app that works with the iTunes COM SDK. However, on the download page for the SDK, there's this warning:
    Warning: Pre–release software is Apple confidential information. Your unauthorized distribution of pre–release software or disclosure of information relating to pre–release software (including the posting of screen shots) may subject you to both civil and criminal liability and result in immediate termination of your ADC Membership.
    I know this download is a few years old and, presumably, so is the message. However, since that's not made clear anywhere on the page, can I still use this SDK for commercial purposes or would it be considered as 'unauthorized distribution' since I have to include the DLL with my app? (As a side note, this message doesn't appear on all downloads,so it's not just a generic one).
    Thanks

    No, not sure how you've drawn the conclusion I'm just confirming that I've understood the warning message correct and that the SDK being released, whether in source or binary form, actually counts as 'unauthorized distribution'. I'm new to Apple SDKs, so I'm unfamiliar with how things like this work here. Seeing how widespread the iTunes COM tutorials are, I thought I might've misunderstood something regarding the warning. So, essentially, you're saying the answer to my question is no, it can't be used for commercial purposes. Correct?

  • ITunes COM SDK broken on Windows XP??

    I have an application called TuneUp Companion (http://www.tuneupmedia.com) that was working fine with iTunes 7.7 and after upgrading is broken.
    It works fine on Windows Vista ...but iTunes 8 on Windows XP seems to give a message back that the iTunes COM interface is not available.
    Are there known issues with the iTunes COM SDK for Windows (7/15/08 release) on Windows XP??
    Thanks, Raza

    much of this is speculation because I can't remember how many previous versions of iTunes were on these machines...but this is what we're seeing:
    extra entries in two registry keys... when it didn't work these two registry entries contained "AppID" values:
    HKEYCLASSESROOT\CLSID\{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}\Implemented
    Categories
    HKEYLOCALMACHINE\SOFTWARE\Classes\CLSID\{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}
    with the APpID set to the same iTunes CLSID string:
    {B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}
    and when it did work the AppIDs entries were gone. this is only on XP.
    on vista there never was any AppID entry.
    but, again, i wonder if that was added by previous versions of iTunes which we didn't install on the vista machines...
    Also, worthy of noting is this post from Apple:
    http://support.apple.com/kb/HT1925
    ciao, raza

  • Where did the iTunes COM SDK go?

    I was going to go download the iTunes COM SDK, originally at http://developer.apple.com/sdk/, but it appears that when you click on the link to get it, it redirects you to the ADC site... which doesn't have the iTunes COM SDK anywhere in there. Does anyone know where it went?

    You now need to have an ADC membership to download the SDKs. You can sign up for the free Online Developer membership here:
    http://developer.apple.com/products/membership.html

  • How to use iTunes COM SDK to set Media Kind for tracks

    There is no obvious function to set Media Kind of a track from iTunes COM SDK. Just curious if anyone knows how to do it programmatically?

    AFAICT there isn't a way to do it via the COM SDK. I currently do it by simulating window events using AutoIT.
    File a bug report as an enhancement request if you want it:
    https://bugreport.apple.com
    You'll need an ADC account; "ADC Online" accounts are free:
    http://developer.apple.com/products/membership.html

  • Itunes COM SDK: cannot register function with iTunes Outgoing Interface

    I am doing benchmarks and I want to time the encoding of a Music CD. In order to stop the "clock" and compute the time I am trying to bind a function with the _IITConvertOperationStatusEvents::OnConvertOperationCompleteEvent()
    I am writing a AutoIt script and I can create the iTunes application object but when I use the ObjEvent function to register my function with the event above it causes a COM exception to be raised and the ObjEvent completes with an error. The exception code I get is 80040200 which seems to be a generic error.
    $objApp=ObjCreate("iTunes.Application")
    $SinkObject=ObjEvent($objApp, "ITEvent", "_IITConvertOperationStatusEvents")
    <<exception 80040200>>
    Browsing the iTunes COM TypeLib the _IITConvertOperationStatus does not seem to be a child in the iTunes object hierarchy so I think this is way the exception is being raised. I have tried to register another function with another outgoing interface and this works just perfectly: _IiTunesEvents::OnQuitting()
    Do I need to create another object which gets passed as the first parameter to the ObjEvent function?
    *Here is the entire script:*
    $ITSourceKindAudioCD = 3
    $begin = 0
    Global $trackName, $progressValue, $maxProgressValue, $SinkObject
    $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; Install a custom error handler
    $objApp = ObjCreate("iTunes.Application")
    If @error Then
    MsgBox(0, "ObjCreate", "Create Object Failed", 3)
    Exit
    EndIf
    $event = ObjEvent($objApp, "ITEvent1_", "_IiTunesEvents")
    If @error Then
    MsgBox(0, "Failed", "IiTunesEvent binding failed", 5)
    Exit
    EndIf
    $SinkObject = ObjEvent($objApp, "ITEvent_", "_IITConvertOperationStatusEvents") ; Assign events to UDFs starting with IEEvent_
    If @error Then
    MsgBox(0, "ObjEvent binding", "ObjEvent failed!", 10)
    $objApp.Quit()
    Exit
    EndIf
    $colSources = $objApp.Sources
    $begin = TimerInit()
    For $objSource in $colSources
    If $objSource.Kind = $ITSourceKindAudioCD Then
    $strName = $objSource.Name
    $colPlaylists = $objSource.Playlists
    $objPlaylist = $colPlaylists.ItemByName($strName)
    $colTracks = $objPlaylist.Tracks
    $objApp.ConvertTracks2($colTracks)
    EndIf
    Next
    Do
    ; Wait around for the ripping to complete
    Until False
    ; This is my custom error handler
    Func MyErrFunc()
    $HexNumber = hex($oMyError.number,8)
    Msgbox(0,"","We intercepted a COM Error !" & @CRLF & _
    "Number is: " & $HexNumber & @CRLF & _
    "Windescription is: " & $oMyError.windescription )
    EndFunc
    Func ITEvent1_OnQuittingEvent()
    MsgBox(0, "Bye", "Bye-Bye", 10)
    EndFunc
    func ITEvent_OnConvertOperationCompleteEvent()
    $dif = TimerDiff($begin)
    MsgBox(0,"Time Difference",$dif)
    $objApp.Quit()
    EndFunc

    much of this is speculation because I can't remember how many previous versions of iTunes were on these machines...but this is what we're seeing:
    extra entries in two registry keys... when it didn't work these two registry entries contained "AppID" values:
    HKEYCLASSESROOT\CLSID\{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}\Implemented
    Categories
    HKEYLOCALMACHINE\SOFTWARE\Classes\CLSID\{B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}
    with the APpID set to the same iTunes CLSID string:
    {B9E1D2CB-CCFF-4AA6-9579-D7A4754030EF}
    and when it did work the AppIDs entries were gone. this is only on XP.
    on vista there never was any AppID entry.
    but, again, i wonder if that was added by previous versions of iTunes which we didn't install on the vista machines...
    Also, worthy of noting is this post from Apple:
    http://support.apple.com/kb/HT1925
    ciao, raza

  • Does iTunes come with 32bit and 64bit install?

    I have Windows 7 and it's a 32bit and 64bit Gaming Laptop G73SW.
    I've done all the troubleshoot tips, which has just made my computer worse.eg all icons changed, things now missing, so probably have to do a System Retore to get it all back.
    Every time i speak to Apple,  they're suggestions just make my computer stuffed, iTunes takes over all my programs etc.
    Simply put: Does iTunes come with a 32bit and 64bit Install??? If not i won't be using that program.
    Which makes it hard for my line of work atm as an Alpha and Beta Games Tester for many Private Platforms i play on.

    open minds entertainment wrote:
    It's 1 Computer especially made for games
    Well genius, it's either a 32bit or 64bit system, it cannot be both.
    Please learn to clearly describe the situation or it is unlikely that appropriate and relevant assistance will be provided.
    Keep in mind, these are user to user support forums.  The attitude that you spewed above is unlikely to get you any further assistance.

  • How do I get it back to the way it was on my iTunes with my playlists and songs?

    My playlists and songs have disappeared on iTunes after the most recent upgrade. The playlists and songs are still on my phone as they were since I haven't synced yet. But they completely disappeared in iTunes on my computer. So when I try to sync, it says that all the information will be deleted. I don't want to have to go through the trouble of re-doing all the playlists and adding all the songs again. It took me a while to get it the way I like it! So does anyone have a solution? Please and thank you!
    Oh and the only thing that stayed on were my purchases.

    Did you change the screen resolution?
    You can right-click on empty space on the Desktop and open the Display Properties.
    Control > Panel > Display > Settings

  • Itunes COM SDK C#

    Hi. I want to control burn audio automatic using itunes COM for .net with c#. please help me about source code

    Sign up for a free developer account at https://developer.apple.com then go to https://developer.apple.com/downloads and search for iTunes COM, it will be the one result.
    tt2

  • ITunes deleted all playlists and purchases

    Help!
    The other day I closed my iTunes program and it was working perfectly. I came back a few minutes later and re-opened it, only to find that all my playlists, purchases, everything had been deleted! All that is left is a library of songs about 3 years old. None of my activity (i.e. loaded songs, albums, purchases, etc.) since then is on there anymore.
    I'm not computer savvy, so if anyone could break down some super simple help for me, that would be amazing!

    It sounds like something has happened to your iTunes Library files - default location C:\Documents and Settings\User Name\My Documents\My Music\iTunes - which in addition to telling iTunes where the actual song files are located also contain playlist and related information.
    If you don't have a back-up copy of the last "good" .itl file - which would restore your Library - there are a few options for you to consider:
    1) Search your computer for any and all of the .itl files it contains. Each .itl may contain references to a significantly, or completely, different library and following the steps described in this article in the Apple Knowledge Base, you can check them and may be able to reconnect iTunes with the particular Library that you're looking for. Close iTunes for a half minute or so before restarting it each time you want to choose a different library file.
    At this stage, skip any of the .itl files located in the Previous iTunes Libraries folder ... We'll get back to those, if necessary, in Step 3).
    2) You can rebuild your Library with the procedure outlined in this article in the Apple Knowledge Base.
    You will lose some of your playlist related information (playcounts, dates added, dates last played, etc.) - but will retain most of it (ratings, comments, etc.) - with this method. The actual contents of the Library should be up-to-date.
    3) If you don't like the idea of losing the playcounts and such, have a look at this Knowledge Base article for one other option.
    Using this method will restore your iTunes Library to the exact state it was in on the date of the most recent .itl file in the Previous iTunes Libraries folder. The drawback is that any changes made since then - songs/playlists added and changes in playcounts, ratings, comments and such - will not be included in the restoration. But it will be easy to add newer songs by following the instructions linked to in Step 4).
    4) One final option is starting all over again with your iTunes Library by following the instructions in the Add to Library section of this KB article .
    This will update iTunes with a list of all the files you add but will not maintain any of your playlists or related information.

  • ITunes COM SDK Windows Playerstate

    Does anyone have any ideas how to tell when iTunes has finished a playlist and stopped playing? I do not wish to poll iTunes every so often to find out, originally I had everything setup so it was event based but it appears as though a playlist ending and the player stopping does not fire any player state events.
    Thanks in advance!

    It works fine for me.
    Try allowing cookies if your browser is set to disallow them.

  • Installing new version of itunes wipes out playlists and indivdual songs?

    Can't access itunes store now, probably because I refused to install the recent upgrades. Current one is 9.0.2.25 and when I installed it, I had to completely recreate everything because this upgrade wiped out all my playlists, a lot of random downloaded songs that were in the Music Library and all the the songs I had purchased from itunes that I hadn't dragged onto my computer. Is there any way to prevent this from happening? In order to keep my playlists and all music, do I have to do a full backup prior to the upgrade and then restore it all after the upgrade? Thanks.

    Very occasionally iTunes fails to rebuild the library properly following an upgrade. All you need to do is restore that backup you take regularly... Ah, OK.
    In the *Previous iTunes Libraries* folder should be a number of dated iTunes Library files. Take the most recent of these and copy it into the iTunes folder. Rename *iTunes Library.itl* as *iTunes Library (Empty).itl* and then rename the restored file as *iTunes Library.itl*. Start iTunes. The library should be updated to the new format and hopefully it won't go wrong this time.
    When you've fixed things...
    *Fast backup for iTunes library (Windows Only)*
    Grab SyncToy 2.1, a free tool from MS. This can be used to copy your entire iTunes library (& other important data folders) onto another hard drive or network share. You can then use SyncToy periodically to synchronise or echo your library to the backup. A preview will show which files need to be updated giving you a chance to spot unexpected changes and during the run only the new or updated files will be copied saving lots of time. And if your media is all organised below the main iTunes folder then you should also be able to open the backup library on any system running the same version of iTunes.
    tt2

  • How do i stop Itunes auto creating playlists and auto playing imports?

    HELP NEEDED - My PC crashed so i rebuilt with Windows 7, installed the latest itunes and so far so good. I then had to import my music library, first thing i noticed which it never did before, when i import folders it will automatically create a playlist for some of those imports, it doesn't create a playlist for every folder or album only some almost as if the smart playlist option is activated...how do i stop this happening? Second, when i import a folder Itunes autoplays the first song in each folder as it imports so it may play 2 seconds of a song or it may play a full song depending on the size of the folder, very annoying and because i have around 100 GB of music to import very very frustrating.
    Thanks,
    D

    The current build of iTunes (10.4.1.10) appears to have a couple of issues with M3U playlists. The first is that when you import an M3U playlist, the list is created, and any files not already in the library it are added to it, but for some reason they just don't get added to the playlist. Secondly, when adding folders to the library, iTunes is also attempting to add any M3U playlists that it finds as well as any other valid media files not already in the library. The upshot is that iTunes may create a bunch of empty playlists corresponding to any M3U files you have scattered through your folders.
    Use iTunes Folder Watch to scan your media folders for new files (and also for dead tracks) to avoid the issue. This is a more effective way of importing new media than simply adding in the entire media folder over and over again.
    If you already have empty playlists you are struggling to delete manually then I've written a script for just that purpose called KillEmptyPlaylists.
    As and when the time comes that you do want to import an M3U playlist then I have written another script to workaround the current difficulty called ImportM3U which does just what it says. It will also convert and add any WMA files present in the list on the fly whereas iTunes would normally ignore these.

Maybe you are looking for

  • Audio in video messages does not work

    When I record a video message for someone, the audio does not work properly. It either doesn't work at all (silence is recorded), or cuts out after a 1-2 seconds. The problem seems to be confined to the MP4 video/audio encoder used by Skype for video

  • IWeb Blog how to control how many articles go into archive?

    I'm probably just missing something, but after I add about five articles to my blog page, the older ones go into the archive. Is there a way to not do that, or at least have some control over how many go there? Also, is there some way to make a chang

  • Adapter Engine null

    Hi, I have an error with the adapter engine (PI 7.0): under Runtime Workbench / Component Monitoring / Integration Server Adapter Engine is shown with red light: "<i>Adapter Engine null</i>". Details are saying: "<i>No correct URL exists for the Runt

  • How do I get my computer to "trust" my iphone?

    How can I get my iPhone to trust my computer? My photos won't load. I recently got a new hard drive and this is only an issue since then.Thank you.

  • The "java" command wont work

    Hi, I have been running my java programs from the console all this while by typing "java " and then the complied class name and everything had been going on fine until this moring when I tried running a prog I'm currently working on and it gave the k