Announcement

Collapse
No announcement yet.

Random Mix

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

    Random Mix

    Maybe this has been addressed before, but is there a way to script the "Random Mix" feature of the Squeezebox to play 20 random songs, a random album, or year, based on Genre(s)? All the settings are already in the Squeezebox. The feature just needs to be started.

    Thanks in advance!

    #2
    I haven't tried this and rarely use the random mix. You could try using the plug-in command PlayerSendCLICommand to send the commands from scripts. For example:
    PlayerSendCLICommand("MyPlayerName", "randomplay albums")

    Here are some of the options of the ramdomplay command: randomplay <tracks|albums|contributors|year> . Check the Squeezebox server CLI help for other options.

    Comment


      #3
      I'm trying to do this now, but I can't get past the first line!

      When I try to execute:

      Sub Main(ByVal parm As Object)

      Dim hspi As Object = hs.plugin("SqueezeBox")

      hspi.PlayerSendCLICommand("Main", "randomplay songs")

      end sub

      I receive the error:

      Running script, script run or compile error in file: SB_Random_Play.txt1006:Expected ')' in line 1 More info: Expected ')'

      Any ideas???

      Comment


        #4
        Save it as SB_Random_Play.vb instead of SB_Random_Play.txt. This VB.Net code, and HS2 uses the script file extension to determine this.

        Comment


          #5
          That did it! Works great.

          "Sub Main(ByVal parm As Object)

          Dim hspi As Object = hs.plugin("SqueezeBox")

          hspi.PlayerSendCLICommand("SB1", "randomplay track")

          end sub"

          Thanks!

          Comment


            #6
            Revisiting this thread

            I originally started this thread about 7 years back (!) and was wondering if there were any "new" any ways to do this via the plugin. I've recently integrated Alexa and I know my wife would love to be able to speak "Alexa, Tell HomeSeer to Run the Event Play a Random Soundtrack"

            If not, will a script like this still run between HS3 and the current plugin, or does it need to be modified? Thanks!

            Sub Main(ByVal parm As Object)

            Dim hspi As Object = hs.plugin("SqueezeBox")

            hspi.PlayerSendCLICommand("SB1", "randomplay albums")

            end sub

            Comment


              #7
              Not sure if this helps, but thinking of a different solution maybe for you. Personally here, we pretty much stream all our music now. My wife loves Pandora and solely uses that. I have it tied into the squeezebox plugin for her and she just starts it up. I have my event set to play her quickmix. The cool thing about this, she has control over what she listens to. Since she uses Pandora at work as well, she can modify which station is part of her quick mix and those changes show up in the squeezebox plugin. Takes me outta the mix, and gives her control of the random songs she wants played.

              Comment


                #8
                Originally posted by kwolter View Post
                I originally started this thread about 7 years back (!) and was wondering if there were any "new" any ways to do this via the plugin. I've recently integrated Alexa and I know my wife would love to be able to speak "Alexa, Tell HomeSeer to Run the Event Play a Random Soundtrack"

                If not, will a script like this still run between HS3 and the current plugin, or does it need to be modified? Thanks!

                Sub Main(ByVal parm As Object)

                Dim hspi As Object = hs.plugin("SqueezeBox")

                hspi.PlayerSendCLICommand("SB1", "randomplay albums")

                end sub
                You can use the PlayerSendCLICommand command in HS3 (see plugin doc) to send the command to the player though calling plugin functions in HS3 is a bit different. You need to use the hs.PluginFunction function (see HS3 doc)

                Comment


                  #9
                  I tried this last night and obviously I have no idea what I'm doing! :-) Any assistance anyone could lend would be appreciated.

                  Comment


                    #10
                    Below is script varation from the example in the doc to send the ramdom play track command to a player. he value of the playerIntstance variable is the instance of the player you can see in the SqueeseBox > Status web page.

                    PHP Code:
                    Sub Main(Parm As Object)
                      Try
                        
                    Dim playerInstance As String "Player_0015833d0a57"
                        
                    Dim Args(1) As Object
                        
                        Args
                    (0) = "randomplay track"
                        
                    Args(1) = False
                        
                        hs
                    .PluginFunction("SqueezeBox"playerInstance"PlayerSendCLICommand"Args)
                      Catch 
                    ex As Exception
                        hs
                    .WriteLog("SqueezeBox Scripts""Exception " ex.ToString)
                      
                    End Try
                    End Sub 

                    Comment

                    Working...
                    X