Announcement

Collapse
No announcement yet.

Winamp Scripting

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

  • #91
    I'm still a little off-topic but I just want to say that the rand Items plugin always insert the 2nd song of an album !

    I don't really understand the last line of the code (CInt(idxs(Int(ubound(idxs)+1 * Rnd)))):
    code:
    Rand = Int((Dict1.Count + 1) * Rnd)
    idxs = Split(itms(Rand), ":", -1, 1)
    Rand2 = CInt(idxs(Int(ubound(idxs)+1 * Rnd)))
    mlq(Rand2).enqueue

    But I think the problem is here.

    any idea ?

    [edit]
    me and my beloved brain have found the answer :

    I juste changed the brackets and +1 in the random
    code:

    Rand = Int(Dict1.Count*Rnd+1)
    idxs = Split(itms(Rand), ":")
    Rand2 = Int(idxs(Int(ubound(idxs)*Rnd+1)))
    mlq(Rand2).enqueue

    Last edited by neFAST; 22 September 2004, 22:08.

    Comment


    • #92
      Plenty of changes. The library is now named ActiveWinamp instead of gen_script1Lib.

      + Many of the methods now return strong types rather than variants. Changed types used internally and externally quite a bit, should work better.

      + Fixed a serious problem with closing scripts.

      Application:
      +SendMsg() - does a sendmessage to the main hwnd
      +PostMsg() - does a postmessage to the main hwnd
      +UpdateTitle()
      +RunScript(BSTR)
      +Property PlayState
      +Property Hwnd
      +Property Panning
      -Events:
      +ChangedVolume()
      +ChangedStatus()
      +PlaybackEOF()

      Playlist:
      +SendMsg()
      +PostMsg()
      +Property Hwnd

      MediaLibrary:
      +SendMsg()
      +PostMsg()
      +Property Hwnd

      You can use the sendmsg and postmsg methods to do many of the other actions not available natively to the plugin.
      Attached Files
      Music Plugins

      Comment


      • #93
        Much more interesting sample in MFC, demonstrates how to do ml queries and work with the arrays. The previous example wont work anymore due to the changes in gen_script1.
        Attached Files
        Music Plugins

        Comment


        • #94
          I'm now also using a "helper ML plugin" in my plugin NxS Balloon Tip. And I also get the data from the Media Library instead of using IPC_GET_EXTENDED_FILE_INFO.

          ON-TOPIC
          I'm writing documentation for your plugin, that means all the methods functions described and a couple of guidelines. Hope you'll like it...

          Comment


          • #95
            Sounds good saivert. I will eventually get around to writing up the .idl file properly, so that when using it within VB or othewise using the type library, there will be some better help contexts for the methods/properties.

            If you want you can fill in this idl file, or just use it as a reference.
            Attached Files
            Music Plugins

            Comment


            • #96
              Docs

              I actually didn't need the .idl file as I can use OLEView (bundled with VC++) to de-compile the .tlb file into a .idl file again. I will not fill in the idl file however becuase I am writing documentation for use by anyone, and not just people who can read idl file like it was a novel.

              It will be more structured and have a tree-like form with examples along the way.

              Here is the first draft:
              Attached Files

              Comment


              • #97
                Ok looks good saivert.

                Although there is still heaps to do with this plugin, its nearing a point where I am happy to release it and the names and dispids etc will all remain fixed. I need to add plenty of stuff for dynamically adding hotkeys/ menu /items /arguments to scripts etc. But that is mostly for script hosting stuff and can be added over time without affecting the rest of the functionality.

                Ive been holding off doing any docos etc until I set the interfaces in stone. But it currently provides most of the typical stuff you would use from an external program through COM, so I may release it.

                The reason for editing the .idl file is not for people to read that, but it is used to compile the type library. The help strings are part of this library, in this way the object is self documenting. When using it in VB or any other environment, the help strings that are put in this .idl file appear in the object browser. A good IDE will also provide little tool tip texts with these help strings when using a method from the type library.

                (the position property in the playlist is both set/get).
                Music Plugins

                Comment


                • #98
                  Fixed a leak problem with arrays (runqueryarray/getselected/getsendtoitems).

                  Fixed issue with getting meta data from items not in the ml.

                  Fixed sample client app
                  Attached Files
                  Music Plugins

                  Comment


                  • #99
                    sample app

                    The mfc sample app. Works much better.
                    Attached Files
                    Music Plugins

                    Comment


                    • ActiveWinamp Scripting Reference Rev. 1

                      All done!

                      I hope it will be included in future releases of ActiveWinamp.

                      Note: The ZIP also contains two scripts i have written, check em' out

                      Here it is:
                      Attached Files

                      Comment


                      • Randomize list?

                        Can a script be used to randomize a playlist?

                        Comment


                        • theres already one for randomize selection included, and if you want to randomize the entire thing in winmap click misc->sort->randomize list

                          but if you really wanted to make the script, you could just edit randomize selection
                          There is no reset button on life... but the graphics kick ass

                          Comment


                          • I'd like to automate it so that it can be scheduled to load a playlist and randomize it. Currently, I am simply scheduling it as a task. If I could run a script instead of a playlist that would randomize after load that would be ideal.

                            Comment


                            • Scripts now run in a separate thread. This allows you to to lengthy operations such as connect to remote web sites or databases etc without locking up winamp. Note that lengthy operations within the Application object itself (basically all exposed methods) will still lockup winamp due to the way it is implemented. (in particular ml queries which take a long time). But when the script isn't 'inside' an exposed method winamp will still be responsive. (ie when calling methods on other objects or other execution which doesnt spend time in calls to the exposed methods).

                              Also fixes some mem leak issues with ml queries.

                              The quit method now quits when you call quit rather than just signalling that it should quit when the script is finished. Note there may be some occasions where it doesnt quit immediately and may continue executing for a couple more lines, so structure your code accordingly until its fixed.

                              Theres likely to be a few bugs but it seems to run ok so far.


                              @John Baker: That would probably require an event which fires on opening of new items. No such event exists yet.

                              You can however use this script:

                              SendMsg 273, 40029, 0
                              playlist.postmsg 273, 40212, 0
                              quit

                              And assign it a hotkey or something. Then use this to open playlists. It sends the 'open file dialog' command to winamp, then the 'randomize playlist' to the playlist after the dialog is closed.
                              Attached Files
                              Music Plugins

                              Comment


                              • shaneh - thanks again for this plugin, my remote is working great. I've still got a bunch of stuff to do - software is never truly "done", eh?

                                Anyway, I turned a friend onto your plugin, and he's asking if there's a way to get to the album art (even just a filename) using this OM. I didn't see one, so I'm passing the question along. If not, do you have any plans to expose such a property/method?

                                Thanks,
                                FarmerDave

                                Comment

                                Working...
                                X