Hi,

Sorry, I haven't been on in a while and logged in and got some pms about
this.  Thought I would see if I could help, although it does appear like
you probably solved it yourself.  I've put my current code below which
is for nas as well as columnsui.  It might not be what you were looking
for but you might be able to spot something useful there.  I've replaced
the parts that need customised in "<<<>>>" bits.  Quotation marks are
necessary around them when they are included (that is every replacement
except port)


Code:
--------------------
    #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  #AutoIt3Wrapper_icon=foo_largeico.ico
  #AutoIt3Wrapper_outfile=FooSQ6a.exe
  #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  $m_ip = "<<<insert ip of lms/squeezebox server here>>>"
  $m_port = <<<insert port.  I'm using 9595>>>
  $m_playerid = "<<<squeezebox mac address>>>"
  $m_fooexe = "<<<location of foobar exe>>>"
  $m_amip = "<<<location of amip text file>>>"
  $m_fooh = "[CLASS:{E7076D1C-A7BF-4f39-B771-BCBE88F2A2A8}]"
  $m_naspath = "<<<location of music library or  local music library to be 
substituted later with server drive.  e.g. c:/Music *see below>>>"
  $m_f = ""
  $m_r = "0"
  $m_s = "0"
  $m_p = "?"
  $m_t = ""
  $m_n = ""
  $m_ne = ""
  $m_fn = ""
  $m_sq = ""
  $m_title = ""
  $m_idle = 0
  $m_ro = "0"
  $m_seek = 0
  $m_elt = ""
  $m_seekt = 8
  $m_0seek = 0
  SplashTextOn( "FooSQ", "Loading...", 250, 50)
  Run($m_fooexe, "", @SW_MAXIMIZE)
  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_fn = $a_tn[1]
  $m_r = $a_tn[2]
  $m_p = $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_ro)
  if  abs($m_seekv) > $m_seekt AND $m_ro <> "0" AND $m_f = $m_fn  Then
  $m_seek = 1
  Endif
  Endif
  $m_ro = $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_s <> "0"
  $m_s = "0"
  TCPSend($m_tcp,$m_playerid & " stop" & @CRLF & " playlist clear " & @CRLF)
  Case $m_idle = 0 And $m_s = "0"
  $m_s = "1"
  $m_f = $m_fn
  $m_sq = StringReplace(StringReplace(StringReplace($m_fn, "\", "/"), " ", 
"%20"), $m_NASPath, "")
  TCPSend($m_tcp,$m_playerid & " playlist play " & $m_sq & @CRLF)
  Case $m_idle = 0 AND $m_s = "1" AND $m_seek = 0
  if $m_p = "1" Then
  $m_s = "2"
  TCPSend($m_tcp,$m_playerid & " pause 1 " & @CRLF)
  Else
  if $m_f <> $m_fn Then
  if     $m_t = "0" Then
  if $m_fn <> $m_n Then
  $m_sq = StringReplace(StringReplace(StringReplace($m_fn, "\", "/"), " ", 
"%20"), $m_NASPath, "")
  TCPSend($m_tcp,$m_playerid & " playlist play " & $m_sq & @CRLF)
  Endif
  endif
  $m_t = ""
  $m_ne = ""
  $m_f = $m_fn
  Else
  if number($m_r) < 12 AND number($m_r) > 1 Then
  if $m_ne = "" 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_ne = "1"
  Endif
  Endif
  if Number($m_r) < 2  Then
  $m_t = "0"
  Endif
  Endif
  EndIf
  Case $m_idle = 0 And $m_s = "2"
  If $m_p = "?" Then
  $m_s = "1"
  TCPSend($m_tcp,$m_playerid & " pause 0 " & @CRLF)
  EndIf
  Case $m_idle = 0 AND $m_s = "1" AND $m_seek = 1
  $m_seek = 0
  $m_ne = ""
  TCPSend($m_tcp,$m_playerid & " playlist clear" & @CRLF)
  TCPSend($m_tcp,$m_playerid & " playlist play " & 
StringReplace(StringReplace(StringReplace($m_fn, "\", "/"), " ", "%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
--------------------


Of the issues mentioned in the last few pages here, this has gapless
playback and has minimised the shutdown problem fizbin mentioned above. 
I believe it only happens now if you shut down the computer before the
autoit script shuts down.  Certainly I've not had it happen in quite a
while.  And therein lies a possible problem.  It's quite a while since I
looked at the script and a lot of it goes over my head right now (as I
doubtless mentioned at some point above I'm not a
programmer/coder/whatever). The reason is that I've not had any problems
with it so I don't need to edit it.  Another thing I should mention, in
case it is confusing, is that, before putting it in this post, I've
changed the four lines with stringreplace for "\" to "/" back to the
original lines from stuffedspacedog's nas script.  Unfortunately on my
version those parts like this:


Code:
--------------------
    
StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace(StringReplace($m_n,
 "\", "/"), " ", "%2520"), "ï","%25C3%25AF"), "#","%2523"), "Æ","%25C3%2586", 0 
, 2 ), "ö","%25C3%25B6", 0 , 2 ), "Ö","%25C3%2596", 0 , 2 ), "ú","%25C3%25BA"), 
"ò","%25C3%25B2"), "ó","%25C3%25B3"), "è","%25C3%25A8"), "é","%25C3%25A9"), 
"ê","%25C3%25AA"), "æ","%25C3%25A6", 0 , 2 ), "ð","%25C3%25B0"), 
"ý","%25C3%25BD"), "í","%25C3%25AD"), "á","%25C3%25A1", 0 , 2 ), 
"Á","%25C3%2581", 0 , 2 ), "å","%25C3%25A5"), "°","%25C2%25B0"), 
"à","%25C3%25A0"), "ç","%25C3%25A7", 0 , 2 ), "ô","%25C3%25B4", 0 , 2 ), 
"µ","%25C2%25B5"),  "ü","%25C3%25BC", 0 , 2
  ), ";","%253B"), "ä","%25C3%25A4"), "Ü","%25C3%259C", 0 , 2 ), 
"º","%25C2%25BA"), $m_naspath, "<<<location of same library on nas drive>>>")
--------------------


This is because of some oddity with my nas drive that forces me to
change quite a few characters.  Don't ask me why.  I don't have a clue
what character set it is using. (If anybody knows an easier way that
would be great).  So every now and then I do have to add a part to that.
It's also the reason the $m_naspath has a note.  Presumably the
original script from stuffedspacedog only needed the nas path in that
first line but mine needs the local library path and then that needs
substituted. Once again, I have no idea why.

So to sum up - sorry if this is of no use to anybody but since I was
asked (albeit two months ago) I thought I would politely reply.  Hope
somebody is helped by it!


------------------------------------------------------------------------
annoyingmouse's Profile: http://forums.slimdevices.com/member.php?userid=49704
View this thread: http://forums.slimdevices.com/showthread.php?t=79575

_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/discuss

Reply via email to