TCP-Message from Client at port 8250: SUBSCRIBE firstRD localhost:1880
Your client-code mentions:
/*
* Parse incoming command, e.g:
*
* ADD\r\n
* <StoryId>\r\n
* <xml><data></data></xml>\r\n\r\n
*
* The XML format is standard XML client data
* and must include a valid story ID.
*
* REMOVE\r\n
* <StoryId>\r\n\r\n
*
* Story ID is a unique ID of some sort.
*/
My xml is just a rundown.xml built for testings where I’ve added the storyId. My repository is a Node Red Client which reads the rundown and delivers it at the http endpoint. I could now add a web-interface to edit the rundown in Node Red and communicate with the client at port 8250 by tcp. Up to the subscription everything works fine.
The code advises I’ve got from https://github.com/CasparCG/client/blob/master/src/Repository/RepositoryDevice.cpp
But i think the idea is that the “remove” part is something you have to implement your self.
on the repository side.
Not really sure how this work as it is a bit of a mystery part off the client
but i guess when the client send’s a “remove” it actually means unsubscribe?
again not at all sure about this
Although i probably never gona a use it my self i have always been a bit curious how it works.
is for adding a story to the loaded rundown in the casparCG-Client
* REMOVE\r\n
* <StoryId>\r\n\r\n
is for removing a story from the loaded rundown in the casparCG-Client
What works:
The CasparCg-Client loads a rundown from an http endpoint in my remote client.
Then the CasparCG-Client builds up a tcp connection to my remote client for sending remote commands.
What is not working:
When sending the remove command to the CasparCG client nothing happens there.
I guess my command could be wrong or there has to be a special format of the storyId or something else.
Did I understand that right: One line in the client is a “story”, right? So not a bunch of lines making up a news story, what one would expect from the term “StoryId”.
With your instructions I can remove groups or items from the rundown now remotely. It is important that nested items can only be deleted with the whole group. They can’t be deleted with their own storyid. And if the item to delete is currently selected it won’t be deleted immediately. But you get a signation (coloured border) to activate “Repository Insert Changes” after going to the next item.
Where I still have problems is how to add items to the rundown. I think I will need some time with this, also.
To me the right command structure for adding an item is still unclear.
In node.js I tried something like this:
var cmdString = "ADD\r\n4\r\n<type>MOVIE</type><devicename>Local CasparCG</devicename><label>TESTPATTERNS/1080I6000_TEST_A</label><name>TESTPATTERNS/1080I6000_TEST_A</name><channel>1</channel><videolayer>10</videolayer><delay>0</delay><duration>0</duration><allowgpi>false</allowgpi><allowremotetriggering>false</allowremotetriggering><remotetriggerid></remotetriggerid><storyid>4</storyid><transition>CUT</transition><tween>Linear</tween><direction>RIGHT</direction><seek>0</seek><length>0</length><loop>false</loop><freezeonload>false</freezeonload><triggeronnext>false</triggeronnext><autoplay>false</autoplay><color>Transparent</color><timecode>00:00:01:29</timecode>\r\n\r\n"
var buffer = Buffer.from(cmdString, 'utf8');
Sending this buffer didn’t work. But it is the typical xml of a clip item in the rundown.
Perhaps I should change the entities before building my buffer from string.
But it would definetely help to know the right xml structure.
this is working on my side
behind ADD and ‘test’ <= storyid add \r\n
and end with \r\n\r\n
ADD
test
<?xml version="1.0" encoding="UTF-8"?><items><allowremotetriggering>false</allowremotetriggering><item><type>MOVIE</type><storyid>test</storyid><devicename>server1</devicename><label>GO1080P25</label><name>GO1080P25</name><channel>1</channel><videolayer>10</videolayer><delay>0</delay><duration>0</duration><allowgpi>false</allowgpi><allowremotetriggering>false</allowremotetriggering><remotetriggerid></remotetriggerid><storyid></storyid><transition>CUT</transition><transitionDuration>1</transitionDuration><tween>Linear</tween><direction>RIGHT</direction><seek>0</seek><length>0</length><loop>false</loop><freezeonload>true</freezeonload><triggeronnext>false</triggeronnext><autoplay>false</autoplay><color>Transparent</color><timecode></timecode></item></items>
the client can get upset when linefeeds or carriage returns are in the XML data.
when a “wrong” message is send it seems that the rundown isn’t listening any more when new requests are send.