Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: iTunes working intermittently with Girder

  1. #1
    Join Date
    Jul 2005
    Posts
    13

    Default iTunes working intermittently with Girder

    I've been trying to add some functionality to enable switching of playlists in iTunes, and while it works occassionally, it doesn't work the bulk of the time and I get "nil" values for playlists and various other erros. I've searched for everything I can on iTunes and have not been able to figure out what's going on.

    I've downloaded the latest GML for iTunes (as well as the older versions) and have tried working with this on multiple versions of iTunes as well (4.8 and 4.9) to no avail.

    Basically what I want to do is use the "CurrentPlaylist" and "PlayFirstTrack" methods to switch from 1 playlist to another and start those playlists. I've seen a couple of other threads where people have done similar things using the Serial plugin, but it doesn't seem to behave properly on my system.

    Has anyone seen similar behavior with iTunes, or does anyone have a working GML file that enables switching of playlists somehow?

    Thanks in advance.
    Tom

  2. #2
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    Hi Tom,

    Post your lua code here for me to look at.

  3. #3
    Join Date
    Jul 2005
    Posts
    13

    Default

    Thanks Mike. I've tried it a number of different ways, but some variation of this worked at one point.

    Code:
    function iTunes.GetCurrent()
    
    local playlist1
    
    playlist1 = iTunes.com.CurrentPlaylist
    playlist1.Name = "2_90sMusic"
    playlist1:PlayFirstTrack ()
    
    end
    
    iTunes.GetCurrent()
    Here's what I get for an error:

    Code:
    ror: attempt to index local `playlist1' (a nil value)
    stack traceback:
       1:  method `GetCurrent' at line 6 [string "?"]
       2:  main of string "?" at line 11
    It's sort of strange behavior because I can get access to all the methods from the IiTunes class that are pre-defined in the COM interface GML, but if I try and add any or use on that's not in there it doesn't work. I'm sure it's just me doing something stupid...

    Thanks
    Tom

  4. #4
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    try ...
    Code:
    playlist1 = iTunes.com:CurrentPlaylist ()
    in luacom, the properties are accessed using . and methods are accessed using :

  5. #5
    Join Date
    Jul 2005
    Posts
    13

    Default

    Same problem. It doesn't seem to like CurrentPlaylist, even when I get the code right.

    It gives me the same "attempt to call field CurrentPlaylist (a nil value)" error.

  6. #6
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    can you paste that section of their com object help file here. i don't have it around right now.

  7. #7
    Join Date
    Jul 2005
    Posts
    13

    Default

    Here's the CurrentPlaylist definition:

    Code:
    HRESULT IiTunes::CurrentPlaylist  (  [out, retval] IITPlaylist **  iPlaylist   )   
     
       Returns the playlist containing the currently targeted track. 
    
    
    Parameters:
     iPlaylist  An IITPlaylist object corresponding to the playlist containing the currently targeted track. Will be set to NULL if there is no currently targeted playlist. 
    
    Return values:
     S_OK  The operation was successful.  
     S_FALSE  There is no currently targeted track, so there is no currently targeted playlist.  
     E_POINTER  iPlaylist is NULL.  
     E_FAIL  An unexpected error occurred.
    And here's the section for PlayFirstTrack from the IITPlaylist object:

    Code:
    HRESULT IITPlaylist::PlayFirstTrack  (    )   
     
       Start playing the first track in this playlist.

  8. #8
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    you do have the com object opened right?

    ie what does print (iTunes.com) give you?

  9. #9
    Join Date
    Jul 2005
    Posts
    13

    Default

    Yup, got it open. I get "table: 0159B4D0" when I test print(iTunes.com).

  10. #10
    Join Date
    Dec 2001
    Posts
    11,560

    Default

    what does print (iTunes.com.CurrentPlaylist ) give you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •