Livecode client for Caspar CG - Connecting but nothing else

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
TechTaylor
Posts: 2
Joined: Wed Nov 18, 2015 12:27 pm

Livecode client for Caspar CG - Connecting but nothing else

Post by TechTaylor » Wed Nov 18, 2015 12:52 pm

Hi all,

So I'm very new to all of this, both live code and Caspar CG, so far so good I've managed to get Caspar working with it's client and with Telnet commands. I've started to create a client in Livecode to allow me to control the server, and it connects. I see that a connection has been made server side, however then I created a button to play a video on the server, just as a test, and nothing happens server side. I don't see the command come in.
The code for my connection button looks like this:

Code: Select all

global casparServer
-- if casparServer is not among the lines of opensockets then
   
   -- end if
on mouseUp
   if field "Server2" is empty then
      set the backgroundcolor of button "Server2" to "Gray "
         else
            put field "Server2" into casparServer
            if casparServer is among the lines of the opensockets then
      close socket casparServer
      set the backgroundcolor of button "Server2" to "Gray "
   else
      open socket to casparServer
      set the backgroundcolor of button "Server2" to "green"
   end if
end if
end mouseUp
And the code for the Play button looks like this:

Code: Select all

on mouseUp
  write "play 1-1 pure" to socket casparServer
end mouseUp
Can anyone shed some light on where I'm going wrong? I would understand if the server recieved the command but couldn't understand it due to poor syntax or formating however the fact the server doesn't see anything is leaving me perplexed without much of an idea as to how to check if anything is actually being sent from the livecode app.
Any help would be really appreciated

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Livecode client for Caspar CG - Connecting but nothing e

Post by jacque » Wed Nov 18, 2015 5:43 pm

You need to include the global declaration in every script that uses it. Put "global casparserver" at the top of the button script.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

TechTaylor
Posts: 2
Joined: Wed Nov 18, 2015 12:27 pm

Re: Livecode client for Caspar CG - Connecting but nothing e

Post by TechTaylor » Wed Nov 18, 2015 6:46 pm

Hi jacque

Thanks for the response, just tried that and still no joy... any other ideas as to where I might be going wrong?

Thanks,

TT

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7393
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Livecode client for Caspar CG - Connecting but nothing e

Post by jacque » Thu Nov 19, 2015 7:53 pm

Not really, but if the global variable is declared in all scripts that need to use it, then that part should work. Unfortunately I'm not familiar with Caspar or the commands it expects, so I can't help much there, but it may be that your socket implementation is incorrect. This lesson may help:

http://lessons.livecode.com/m/4071/l/12 ... ng-sockets
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Post Reply