This is the script you want to use. It works flawlessly for me, but I'm
just using a straight PC (LAN) to SBT setup. I removed the auto loading
component. I felt it was more stable without it. Just load Foobar2000
first and then the script.
>
> $m_ip = "127.0.0.1"
> $m_port = 9090
> $m_playerid = "00:04:40:22:f2:80"
> $m_amip = "C:\MUSIC\LMS directory\nextsong.txt"
> $m_fooh = "[CLASS:{E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}]"
> $m_naspath = "C:\MUSIC\LMS directory"
> $m_f = ""
> $m_r = "0"
> $m_j = "0"
> $m_q = "?"
> $m_t = ""
> $m_n = ""
> $m_ze = ""
> $m_vn = ""
> $m_sq = ""
> $m_title = ""
> $m_idle = 0
> $m_xo = "0"
> $m_seek = 0
> $m_elt = ""
> $m_seekt = 1
> $m_0seek = 0
> SplashTextOn( "FooSQ", "Loading...", 250, 50)
> WinWait($m_fooh, "", 60)
> $m_fooha = WinGetHandle($m_fooh)
> TCPStartup()
> SplashOff()
> $m_tcp = TCPConnect($m_ip, $m_port)
> if @error Then
> MsgBox(1, "FooSQ", "Not working")
> Else
> SplashTextOn( "FooSQ", "Connected!", 250, 50)
> SplashOff()
> EndIf
> While WinExists($m_fooha)
> $m_title = WinGetTitle($m_fooha)
> If StringRegExp($m_title, "foobar2000") Then
> $m_idle = 1
> Else
> $m_idle = 0
> EndIf
> If $m_idle = 0 And $m_title <> "" Then
> $a_tn = StringSplit($m_title, "/")
> $m_vn = $a_tn[1]
> $m_r = $a_tn[2]
> $m_q = $a_tn[3]
> $m_elt = $a_tn[4]
> if number($m_seekt) > 0 AND $m_0seek = 0 Then
> $m_seekv = number($m_r) - number($m_xo)
> if abs($m_seekv) > $m_seekt AND $m_xo <> "0" AND $m_f =
> $m_vn Then
> $m_seek = 1
> Endif
> Endif
> $m_xo = $m_r
> if $m_0seek > 0 then
> $m_0seek = $m_0seek -1
> endif
> Else
> $m_0seek = 50
> EndIf
> Select
> Case $m_idle = 1 And $m_j <> "0"
> $m_j = "0"
> TCPSend($m_tcp,$m_playerid & " stop" & @CRLF & " playlist
> clear " & @CRLF)
> Case $m_idle = 0 And $m_j = "0"
> $m_j = "1"
> $m_f = $m_vn
> $m_sq = StringReplace(StringReplace(StringReplace($m_vn, "",
> "/"), " ", "%20"), $m_NASPath, "")
> TCPSend($m_tcp,$m_playerid & " playlist play " & $m_sq &
> @CRLF)
> Case $m_idle = 0 AND $m_j = "1" AND $m_seek = 0
> if $m_q = "1" Then
> $m_j = "2"
> TCPSend($m_tcp,$m_playerid & " pause 1 " & @CRLF)
> Else
> if $m_f <> $m_vn Then
> if $m_t = "0" Then
> if $m_vn <> $m_n Then
> $m_sq =
> StringReplace(StringReplace(StringReplace($m_vn, "", "/"), " ", "%20"),
> $m_NASPath, "")
> TCPSend($m_tcp,$m_playerid & " playlist
> play " & $m_sq & @CRLF)
> Endif
> endif
> $m_t = ""
> $m_ze = ""
> $m_f = $m_vn
> Else
> if number($m_r) < 12 AND number($m_r) > 1 Then
> if $m_ze = "" Then
> $m_amips = FileOpen($m_amip, 0)
> $m_n = FileReadLine($m_amip)
> FileClose($m_amip)
> $m_sq =
> StringReplace(StringReplace(StringReplace($m_n, "", "/"), " ", "%20"),
> $m_NASPath, "")
> TCPSend($m_tcp,$m_playerid & " playlist
> insert " & $m_sq & @CRLF)
> $m_ze = "1"
> Endif
> Endif
> if Number($m_r) < 2 Then
> $m_t = "0"
> Endif
> Endif
> EndIf
> Case $m_idle = 0 And $m_j = "2"
> If $m_q = "?" Then
> $m_j = "1"
> TCPSend($m_tcp,$m_playerid & " pause 0 " & @CRLF)
> EndIf
> Case $m_idle = 0 AND $m_j = "1" AND $m_seek = 1
> $m_seek = 0
> $m_ze = ""
> TCPSend($m_tcp,$m_playerid & " playlist clear" & @CRLF)
> TCPSend($m_tcp,$m_playerid & " playlist play " &
> StringReplace(StringReplace(StringReplace($m_vn, "", "/"), " ", "%20"),
> $m_naspath, "") & @CRLF)
> TCPSend($m_tcp,$m_playerid & " pause 1" & @CRLF)
> sleep(50)
> TCPSend($m_tcp,$m_playerid & " time " & $m_elt & @CRLF)
> Sleep(50)
> TCPSend($m_tcp,$m_playerid & " pause 0" & @CRLF)
> EndSelect
> Sleep(50)
> WEnd
> TCPSend($m_tcp,$m_playerid & " stop " & @CRLF & " playlist clear " &
> @CRLF)
> Sleep(10000)
> Exit
>
------------------------------------------------------------------------
Fizbin's Profile: http://forums.slimdevices.com/member.php?userid=58734
View this thread: http://forums.slimdevices.com/showthread.php?t=79575
_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/discuss