|
Slink-e / CDJ Discussion Archive #11 Re: slinkx and discs 201-400Posted By: Bill A <badbilly@c...> In Response To: Re: slinkx and discs 201-400 (Patick Jeski)
Hi, I figured it out after you mentioned using multiple devices when my app starts, I add 3 devices: ' 1st device for cds 1-200 x = Slinkx.AddDevice("cds1", "D:\Program Files\Nirvis\Device Files\Sony\cdsls.cde", 1, 1, 1) ' 2nd device for cds 201-400 (note its on ID number 4!) x = Slinkx.AddDevice("cds4", "D:\Program Files\Nirvis\Device Files\Sony\cdsls.cde", 4, 1, 1) ' 3rd device to receive messages x = Slinkx.AddDevice("cdr1", "D:\Program Files\Nirvis\Device Files\Sony\cdslr.cde", 1, 1, 1) Then to play a cd, I use this routine Private Sub playCD(ByVal cdNum As Integer, Optional ByVal trackNum As Integer) Dim playString As String Dim sRes As Long If trackNum = 0 Then trackNum = 1 End If playString = "play_dt[" If cdNum <= 200 Then If cdNum <= 100 Then playString = playString + Right("0" + Trim(Str(cdNum)), 2) + Right("0" + Trim(Str(trackNum)), 2) + "]" Else playString = playString + Right("0" + Trim(Hex(cdNum + 54)), 2) + Right("0" + Trim(Str(trackNum)), 2) + "]" End If sRes = Slinkx.Send("cds1", playString) Else cdNum = cdNum - 200 playString = playString + Right("0" + Trim(Hex(cdNum)), 2) + Right("0" + Trim(Str(trackNum)), 2) + "]" sRes = Slinkx.Send("cds4", playString) End If End Sub I don't quite understand why I have to have a second device on ID 4 (which annoys me because I like to understand my own code!) but it seems to work. Also, it seems strange that cds 1-100 need to be passed in decimal (even though 100 is '00') and then everything else needs to be in hex. I would have thought that to be consistantly strange cds 201-300 would have been in decimal!!! As to your question about my app, I have a couple of ideas, but my first aim is to write a CD player that uses Microsoft's Speech SDK to voice activate the playing of tracks (it seems to work ok with a few CD's, but I have a feeling it will not be able to cope when I have voice commands for hundreds of cd's!) Bill. (Sorry about the strange formatting on the code, but this just happened when I pasted it in) Responses To This Message
Slink-e / CDJ Discussion Archive #11 is maintained by slinke-bbs-owner@nirvis.com with WebBBS 3.21. |