www.homeseer.com    
 

Go Back   HomeSeer Message Board > Media Plug-ins > Media Discussion > SqueezeBox Plug-In (3P)

SqueezeBox Plug-In (3P) Discussion area for the SqueezeBox plug-in by PCP.

Reply
 
Thread Tools Display Modes
  #1  
Old November 8th, 2009, 01:22 PM
kwolter's Avatar
kwolter kwolter is offline
Seer Deluxe
 
Join Date: Jun 2001
Location: West Burbs of Chicago
Posts: 306
Question 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!
__________________
- Kurt
Reply With Quote
  #2  
Old November 8th, 2009, 06:54 PM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,647
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 . Check the Squeezebox server CLI help for other options.
Reply With Quote
  #3  
Old November 8th, 2009, 07:46 PM
kwolter's Avatar
kwolter kwolter is offline
Seer Deluxe
 
Join Date: Jun 2001
Location: West Burbs of Chicago
Posts: 306
Question

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???
Reply With Quote
  #4  
Old November 8th, 2009, 09:44 PM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,647
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.
Reply With Quote
  #5  
Old November 9th, 2009, 04:51 PM
kwolter's Avatar
kwolter kwolter is offline
Seer Deluxe
 
Join Date: Jun 2001
Location: West Burbs of Chicago
Posts: 306
Thumbs up

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!
Reply With Quote
  #6  
Old October 20th, 2016, 01:37 PM
kwolter's Avatar
kwolter kwolter is offline
Seer Deluxe
 
Join Date: Jun 2001
Location: West Burbs of Chicago
Posts: 306
Question 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
Reply With Quote
  #7  
Old October 20th, 2016, 02:38 PM
waynehead99 waynehead99 is offline
Super Seer
 
Join Date: May 2015
Location: Colorado
Posts: 1,978
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.
Reply With Quote
  #8  
Old October 23rd, 2016, 11:09 AM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,647
Quote:
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)
Reply With Quote
  #9  
Old October 26th, 2016, 04:45 PM
kwolter's Avatar
kwolter kwolter is offline
Seer Deluxe
 
Join Date: Jun 2001
Location: West Burbs of Chicago
Posts: 306
Red face

I tried this last night and obviously I have no idea what I'm doing! :-) Any assistance anyone could lend would be appreciated.
Reply With Quote
  #10  
Old October 31st, 2016, 08:05 AM
pcp pcp is offline
Super Seer
 
Join Date: Jan 2006
Location: MA
Posts: 1,647
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 
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 03:46 AM.


Copyright HomeSeer Technologies, LLC