Announcement

Collapse
No announcement yet.

SqueezeBox v3 API..?

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

    SqueezeBox v3 API..?

    Hi PCP, all,

    I'm looking for API capabilities which may not currently exist. If not, I'd like to submit this as a feature request.

    I would like to initiate playing a playlist by script. For example:

    Code:
    Dim playlist As HomeSeerAPI.Playlist_Entry
    playlist.Lib_Type = 24  'Pandora
    playlist.Playlist_Name = "Bruno Mars Radio"
    playlist.Length = 1
    
    hs.PluginFunction("SqueezeBox", "", "PlayPlaylist", {playlist})
    Currently, of course, PlayPlaylist isn't accessible on the HSPI interface. All we have is the CLI method.

    Is it possible to implement a way to play a Pandora, Spotify, local file, etc from script?

    My scenario is as follows:
    1. Build a list of Pandora stations by script and submit to a global var
    2. Use Spud's Kinect plugin and special functionality he just implemented to use that global var as part of a VR string. Ex: Play Pandora <station1|station2></station1|station2>
    3. Kinect plugin sticks "station2" into another global var when the phrase is recognized, and then calls my script
    4. My script pulls "station2" and (in theory) plays it using the SqueezeBox plugin


    It's this last bit that I am missing. I could probably rig this up using the existing CLI functionality, but I'd rather have it "cleaner" than that, if that makes sense.

    Anyone have any thoughts?

    Thanks!

    hjk
    ---

    #2
    The plugin supports the HS3 Media APIs, therefore you should be able to call PlayPlaylist as in your example. You will need to call it for the plugin instance for your target player not for the primary plugin instance, which is the second argument in your PluginFunction example below. The HS3 media APIs are only included for plugin player instances, not the primary plugin instance. You can find the instance name on HS3 Plug-In>Manage page.

    Comment


      #3
      Originally posted by pcp View Post
      You will need to call it for the plugin instance for your target player not for the primary plugin instance, which is the second argument in your PluginFunction example below. The HS3 media APIs are only included for plugin player instances, not the primary plugin instance. You can find the instance name on HS3 Plug-In>Manage page.
      PCP, thanks. That was the missing link! I tried it and it works great. One follow-up question: is there a function to look up the instance name by player name?

      You're helping me quickly close this loop on the VR functionality!

      hjk
      ---

      Comment


        #4
        Not from the plugin, but you could find out the plugin name and instance name a HS3 device is associated with (using HS3 APIs), using for example the player root device. Check the following two HS3 API to get the plug-in name and instance name for a given device DeviceClass (which you can get using GetDeviceByRef)

        Public Property InterfaceInstance(ByVal hs As IHSApplication) As String
        Public Property Interface(ByVal hs As IHSApplication) As String

        Comment


          #5
          Originally posted by pcp View Post
          Not from the plugin, but you could find out the plugin name and instance name a HS3 device is associated with (using HS3 APIs), using for example the player root device. Check the following two HS3 API to get the plug-in name and instance name for a given device DeviceClass (which you can get using GetDeviceByRef)

          Public Property InterfaceInstance(ByVal hs As IHSApplication) As String
          Public Property Interface(ByVal hs As IHSApplication) As String
          THANK YOU for that. I wasn't sure where I would find the methods to determine the instance names. I tried it and it works!

          So now, from my Kinect VR event, I can manually pass the player device name (it seems any of the devices will do), and then my script runs. The script will grab the Pandora station name from the Kinect global variable, locate the player instance from the device name that was manually passed, and violla - it works!!

          Between you, Spud, and Blade, I haven't had this level of support from any vendor of any hardware or software package. I've been in IT for 17 years and dealt with everyone under the sun, too!

          Thanks!

          There was another guy in Spud's forum asking about how this was done... later today or tomorrow, I'll post my events and script examples.

          hjk
          ---

          Comment

          Working...
          X