Announcement

Collapse
No announcement yet.

Winamp - HS Control Script

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

  • Winamp - HS Control Script

    Howdy folks, some updates to the Winamp control script.

    I have put together the following script to control Winamp and receive feedback as to song playing, player status, volume, shuffle, load playlists, turn on the sound card input, adjust volume, etc.

    Using this script you can use any trigger (voice, X-10, Conditions, Time etc) to run Winamp. Also, with the variables put into hs.devicestring you will be able to have HS speak the current song playing, next song etc.

    This is the second version and now has a copy of my Mainlobby music file. Feedback? Questions? Comments?

    Download the zip file from: http://www.technicalhelp4u.com/homeseer/janiwinamp.zip

    Click here for a screen shot: http://www.technicalhelp4u.com/homeseer/devices.jpg
    Attached Files
    Last edited by mycrobyte; January 6th, 2008, 12:52 PM. Reason: Updated version

  • #2
    Current Readme File

    JANIWINAMP Homeseer Interface v. 1.00
    Oct 2005 Mycrobyte www.TechnicalHelp4u.com

    I wanted to develop a free interface to winamp. Using Active Winamp plugin from Shane Hird (MANY THANKS!!) I was able to put the
    attached script together.




    Requirements (or at least my setup)

    1. HS2 installed and working

    2. Winamp installed and working - tested with version 5.11

    3. Active Winamp installed. http://www.myplugins.info/activewinamp.htm or http://www.winamp.com/plugins/details.php?id=143299

    4. Updated gen_activewa.dll available from Shane Hird (see #3 above) - Not completly needed, but recommended. You will need to copy this file to
    your winamp/plugins folder and rename the extension from xxx (where xxx is a 3 digit release code) to dll - overwrite the existing file.

    5. For 2 way communication copy the enclosed startup_x.vbs to \winamp\plugins\scripts Note, this script starts with Winamp and reports back
    to JaniWinAmp.vbs. I have only been able to get the track change event to work, it is to update on player state and volume change also.

    6. You will see Active Winamp 1.0 listed in your Winamp -->Preferences--->Plugins---General No configuration is required. You can troubleshoot here
    to ensure that Active Winamp is installed and that startup_x.vbs is a running script.

    7. Copy the following files to Homeseer Scripts directory:
    JaniWinAmp.vbs Main Script which controls Winamp via ActiveWinamp
    InstallJaniEvents.txt Sets up events to control Winamp - you need to set up your own triggers.
    EnableJaniEvents.txt Enables above events. For some reason StartWA event is not enabling automatically. Ideas?
    CreateJaniDevices.txt Creates 6 named devices for Winamp data. j10 to j15
    CreateJaniButtons.txt Adds Control buttons to the above devices

    8. Set up a one time event to install, delete after running. Best results are if you click 'wait for script to finish' for each
    See the install.jpg picture
    Run the scripts in this order:
    a. InstallJaniEvents.txt - this calls EnableJaniEvents.txt
    b. CreateJaniDevices.txt
    c. CreateJaniButtons.txt


    You should be rocking and rolling.



    Known issues:

    - I cannot close winamp without using an outside program
    - In startup_x.vbs the player state and volume change subs do not work. You may wish to run the UpdateInfo sub every x minutes if the player
    status and volume status are very important to you. If you use the events from within Homeseer to control Winamp then these values should be updated.

    Comment


    • #3
      Just wondering if anyone worked with this, didn't get much feedback either way. I've put together a Mainlobby page to control these script functions which works really nicely.

      Anyway, would appreciate hearing from any users and to see if anyone's improved on the scripts.

      Comment


      • #4
        still on 1.7 homeseer

        I am using the Winamp Com 2.1.1 http://www.adcock8.freeserve.co.uk/. I am still on homeseer 1.7 but will give your script a try when I upgrade to 2.

        Comment


        • #5
          Does this support Shuffle control?

          Does this support multiple instances of Winamp?

          That's the last thing I need (shuffle).

          --Dan
          Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

          Comment


          • #6
            Yes to shuffle control.

            Have not tried with multiple instances.

            Comment


            • #7
              mycrobyte,

              thanks for the reply, I ended up coding some custom .exe files that interface to different class names (you start each instance of winamp with a different classname winamp.exe /classname="namegoeshere"). Then in HS I put together a .vb script that sends out the necessary "hs.launch" commands.

              Works like a charm!

              --Dan
              Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

              Comment


              • #8
                Updated version posted

                see first post.

                Comment


                • #9
                  Links are fixed by request.

                  Enjoy this script and my free Itunes one.

                  Comment


                  • #10
                    Are you still working on this? or has it gone as far as it can go??

                    TrOjAn

                    Comment


                    • #11
                      I have figured out how to get Active Winamp to return the volume and player state correctly! This bit from the Active Winamp documentation (what little there is) helped me figure this out.

                      Only use "Application" in front to resolve naming conflicts and of course when writing event handlers, like:

                      Sub Application_ChangedVolume

                      End Sub

                      http://www.myplugins.info/activewina...ivewinamp:docs


                      Just add the Application_ to the event handlers in the startup_x.vbs file.

                      Also, under the UpdatInfo() Sub in the JaniWinamp.vbs
                      the following code will return winamp's current volume as a value from 0 - 255.

                      hs.SetDeviceValue strPlayerVolume, wo.volume

                      From this, you can select the device in HSTouch from a text element (or a slider) and it will return the true value of the player's volume.

                      -Ben

                      Comment


                      • #12
                        I presume your fixes address:

                        Known issues:
                        - In startup_x.vbs the player state and volume change subs do not work. You may wish to run the UpdateInfo sub every x minutes if the player
                        status and volume status are very important to you. If you use the events from within Homeseer to control Winamp then these values should be updated.
                        Thanks for posting. I've made the changes but haven't decided yet on installing WinAmp onto my Hometroller. Also going to leave hs.SetDeviceString so that Volume Status shows in Device View (or will Value show up there?).

                        Sub UpdateInfo()
                        hs.SetDeviceString strCurrentSong, wo.playlist(wo.playlist.position).ATFString("%artist% - %title%")
                        hs.SetDeviceString strCurrentAlbum, wo.playlist(wo.playlist.position).ATFString("%album%")
                        hs.SetDeviceString strNextSong, wo.playlist(wo.playlist.position+1).ATFString("%artist% - %title%")
                        hs.SetDeviceValue strPlayerVolume, wo.volume
                        hs.SetDeviceString strPlayerVolume, wo.volume
                        Call PlayerStatus
                        Call ShuffleStatus
                        End Sub

                        Comment


                        • #13
                          Yes those are the problems I'm addressing. That will allow volume and player state to be received by the respective devices: strPlayerVolume and strPlayerStatus.

                          I stored the volume as a value (0-255) in an effort to use a slider in HSTouch.
                          I got the slider to return the correct volume when it is changed through winamp, but am having serious difficulty figuring out how to change the winamp volume when moving the slider. I feel like I am close though.


                          Sub PlayerStatus()
                          dim s
                          s = wo.playstate
                          I have also added the following line so that wo.playerstate is also stored as 1 when playing, 0 when stopped, and 3 when paused.

                          hs.SetDeviceValue "j10", wo.playstate

                          (a device can hold a value as well as a string)

                          This allowed me to use the sample play pause stop images from the iphone sample.

                          Just set the Status Tracking in HSTouch to Player Status and select use status image. Then under Status Images select the images you wish to use and the values which should display them (0,1, and 3).

                          I did all of this because I love winamp so much

                          I'm attaching an image of my current iphone GUI.


                          -Ben
                          Attached Files

                          Comment


                          • #14
                            Just got the slider to control winamp volume!
                            I had to create an event that sends the current device value to the winamp object that is triggered when the PlayerVolume device is changed.
                            I will elaborate further if anyone is interested.

                            Comment


                            • #15
                              I should try changing the volume on my Zone8 Winamp. That's the one that I use to Shoutcast to my phone.

                              If the volume works, I'd be VERY interested in this, especially since it can tell me what song is playing (a problem I've had with how I set this up).

                              I'd like to use this on all my Zones, however, if not, I'm good with how I currently do things. I would like to see more information on my Zone8, as I'm generally out in the world somewhere when I'm using it.

                              --Dan
                              Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

                              Comment

                              Working...
                              X