Announcement

Collapse
No announcement yet.

Need help with ActiveWinamp plugin

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Need help with ActiveWinamp plugin

    I'm using AutoIt, but I guess the case should be relatively easy.

    I did take a look at the plugin dll with DLL Export viewer. This is what I got:

    Code:
    IApplication
    -----------
    ChangedStatus
    ChangedTrack
    ChangedVolume
    PlaybackEOF
    CancelTimer
    ExecVisPlugin
    GetIniDirectory
    GetIniFile
    GetSendToItems
    GetWaVersion
    Hwmn
    LoadItem
    MediaLibrary
    Panning
    Pause
    Play
    Playlist
    PlayState
    Position
    PostMsg
    Previous
    Repeat
    RestartWinamp
    RunScript
    SayHi
    SendMsg
    SendTimeout
    ShowNotification
    Shuffle
    Skin
    Skip
    StopPlayback
    UpdateTitle
    Volume
    
    IPlaylist
    --------
    Clear
    Count
    DeleteIndex
    FlushCache
    GetSelection
    Hwnd
    Item
    Position
    PostMsg
    SendMsg
    SwapIndex
    
    IMediaItem
    -----------
    Album
    Artist
    ATRString
    DbIndex
    Enqueue
    Filename
    Genre
    Insert
    LastPlay
    Length
    Name
    Playcount
    Position
    Rating
    RefreshMeta
    Title
    Track
    GetItem
    Hwnd
    Item
    PostMsg
    RunQueryArray
    SendMsg
    
    ISiteManager
    -------------
    arguments
    AttachEvents
    Desctiption
    Quit
    
    _IApplicationEvents
    -------------------
    ChangedStatus
    ChangedTrack
    ChangedVolume
    PlaybackEOF
    As you can see there are a few categories:
    IApplication
    IPlaylist
    IMediaItem
    ISiteManager
    _IApplicationEvents

    "play" is an IApplication command. The following code works:
    Code:
    $winamp=ObjCreate("ActiveWinamp.Application")
    $winamp.play
    I guessed I could create a new object for IPlaylist, something like:
    Code:
    $winamp=ObjCreate("ActiveWinamp.Playlist")
    $winamp.clear
    This DOESN'T work, though. I had to code it like this:
    Code:
    $winamp=ObjCreate("ActiveWinamp.Application")
    $winamp.playlist.clear
    This works. So far so good. I can access application and playlist commands. Now I want to access MediaItem commands.
    I thought it would work the same, like this:
    Code:
    $winamp=ObjCreate("ActiveWinamp.Application")
    $album=$winamp.mediaitem.album
    But I always get an object error. Seems I didn't understand the principle. Can someone explain it to me, plase ?

  • #2
    I am posting this response with zero knowledge of AutoIt, and zero knowledge of any WinAMP plugins.

    Code:
    $winamp=ObjCreate("ActiveWinamp.Application")
    $album=$winamp.mediaitem.album
    I would assume that MediaItem is going to be an item in the playlist. But which item? So my first guess is that MediaItem is an array (or collection). So maybe try MediaItem(0) or MediaItem(1)

    If that's not the case, you could try being more granular.
    Code:
    $winamp=ObjCreate("ActiveWinamp.Application")
    $mItem=$winamp.mediaitem
    $album=$mItem.album

    Comment


    • #3
      I am also posting this response with zero knowledge of AutoIt, and zero knowledge of any WinAMP plugins.

      Looks like Playlist is an object under application. That makes sense as to why you need to go Application.Playlist.

      "MediaItem" is NOT an object under Application, BUT there is an object called "Item" under playlist. I would guess that this is an indexed property that returns things that conform to IMediaItem

      So try accessing like:

      Code:
      $winamp=ObjCreate("ActiveWinamp.Application")
      $mItem=$winamp.playlist.item(0)
      $album=$mItem.album
      
      or 
      
      $winamp=ObjCreate("ActiveWinamp.Application")
      $mItem=$winamp.playlist.item[0]
      $album=$mItem.album

      (note sure if it uses () or [] for index accesses.)


      Then you would obviously increment the 0 to access other items.
      -James
      Car: 2004 GTI VR6 24v Turbo 2.8L, GT35R, 630cc, Unitronic, Bosch 044, etc, etc..
      Main PC:i7 [email protected], 6GB DDR3, MSI X-58 Pro-E, Win 7 x64 RTM, Scythe Mugen2, 128GB G.Skill Falcon, 2x ATI4850 512MB Crossfire, Auzentech X-Fi Forte, Grado Labs SR-80

      Comment

      Working...
      X