Director Api

All other topics about Ventuz Director here.

Director Api

Postby mofo7777 » 05 Dec 2014, 17:14

Hello.

Here (http://www.ventuz.com/support/help/latest4/Director/PlugIns.html), the documentation says :

Code: Select all
DirectorTemplateData templateData = new DirectorTemplateData(template);
templateData.Data.FirstLine = "Test";


FirstLine is a dynamic type. But what if i don't know the name of the type and his type ?

Code: Select all
using (StreamReader reader = File.OpenText("C:\\Users\\Public\\Documents\\Ventuz4\\Projects\\DirectorSlideShow\\pages\\LineChart3_20141205_150309.vpg"))
{
  // Get the data from page (not the Template).
  TemplateData data = TemplateData.Deserialize(reader, false, null);

  // data.DataModel is always null...
  // data.Template is alwals null...

  // Get the Template from the uri of the page
  Template template = this.plugin.Application.Show.Templates.GetTemplate(data.Namespace);

  // Problem the Template has no data associated, so CueAsync just cue the Template, not the Page.
  DirectorTemplateData templateData = new DirectorTemplateData(template);
  this.plugin.Application.Show.Channels[0].CueAsync(templateData);

  // templateData.Data is readonly so this can't be use :
  // templateData.Data = data.Data; 
}


So having only this information :
C:\\Users\\Public\\Documents\\Ventuz4\\Projects\\DirectorSlideShow\\pages\\LineChart3_20141205_150309.vpg
, how can i make a CueAsync on this page ?
mofo7777
 
Posts: 53
Joined: 24 Oct 2012, 15:03

Re: Director Api

Postby mofo7777 » 05 Dec 2014, 18:29

Also what is CueAsSubTemplateAsync(...) from the IChannel documentation ?
mofo7777
 
Posts: 53
Joined: 24 Oct 2012, 15:03

Re: Director Api

Postby Alex Klein » 08 Dec 2014, 18:08

If you use Template.Deserialize, you need to specify a template resolver (last parameter, see documentation on the API call). You just passed null! This can be a lambda expression that uses the URI in the argument and sets the Template in the argument. Without this, you will get a TemplateData that has no idea for what template your page is, hence no datamodel and no template. It basically is an empty shell for your page data without any knowledge that it is a page. By the way, you should use the DirectorTemplateData instead of TemplateData if I'm not mistaken.

The easiest way to cue a page is to use the correct URI. Unfortunately, that's not part of the Director user manual yet, it's a bit hidden in the remoting documentation... you can create a Uri with the "Ventuz"-scheme to access files inside the Ventuz project folder. If Director knows how to do handle it, it will try to make it cueable. For your example, it would be:

CueAsync(new Uri("ventuz://pages/LineChart3_20141205_150309.vpg"))

Same works for assets (e.g. images, movies, etc). CueasSubTemplateAsync exactly does what it says: It cues a sub-template into the already cued main template. For example, in the hockey demo scene it is used to put the sponsor into the scoreboard.
Alex Klein
 

Re: Director Api

Postby mofo7777 » 08 Dec 2014, 18:44

Thank you.

CueAsync(new Uri("ventuz://pages/LineChart3_20141205_150309.vpg")) was just what i was looking for. And it works perfect.

The problem with CueasSubTemplateAsync, is that i only see it in the documentation. I can't find it anywhere in Ventuz.Director.Shared, nor in Ventuz.Kernel.Remoting4... IChannel doesn't implement CueasSubTemplateAsync. So where is it ?
mofo7777
 
Posts: 53
Joined: 24 Oct 2012, 15:03

Re: Director Api

Postby Alex Klein » 09 Dec 2014, 11:02

Aah, you are right, I totally forgot. CueAsSubTemplateAsync was the old internal name for AddSubTemplateAsync before we renamed it. The comment in the documentation just hasn't been updated yet. It was better software design to force the user to specify the timeline item he wants to add the sub-template to than to implicitly use the cued item. Just use the result of the CueAsync-task as input for AddSubTemplateAsync...
Alex Klein
 

Re: Director Api

Postby mofo7777 » 09 Dec 2014, 18:55

Re.

I Wonder if i really need to use AddSubTemplateAsync. I don't really understand the purpose of this (CueAsync seems to be enough).

Now i can Cue, Take and TakeOut. I can TakeOut a Template/Page, after this one is Take.

But if i only Cue a Template/Page, i don't know how to Clear it without doing a Take.

Could you clarify this, thank you.
mofo7777
 
Posts: 53
Joined: 24 Oct 2012, 15:03

Re: Director Api

Postby Alex Klein » 10 Dec 2014, 17:17

Internally, we have an "UncueAsync" call on the channel. However, that's not part of the API yet so right now, there is no way for you to clear the cue... I'll add a ticket so we add that for Ventuz V4.06
Alex Klein
 

Re: Director Api

Postby mofo7777 » 11 Dec 2014, 17:25

Ok.

Another question.


Ventuz.Director.Shared

CueAsync(...)

By calling Task.Wait() or Task.Result, the caller can wait for the task to complete setting up the TimelineItem for the TemplateData. However, this does not mean that the cue on the rendering machine has actually been performed, only that the channel/timeline has created a TimelineItem for this cue operation. The actually cueing on the rendering machine may have to wait for previous or running cue/take operations. To wait for a cue to be complete, listener for TimelineItem's Status property to change to Cued.



http://www.ventuz.com/support/help/late ... ugIns.html

Once the cueing is done and we have been returned the ITimelineItem instance, we might use it to present some further information to the user but that has been omitted for brevity.


I would like to know when a Cue or a Take operation is really finished. I just see that ITimelineItem has only one property (DisplayName). Can you give me more information about that, thank you.
mofo7777
 
Posts: 53
Joined: 24 Oct 2012, 15:03

Re: Director Api

Postby mofo7777 » 11 Dec 2014, 17:46

Re.

I can see the property Status Inside the debugger (after subscribe PropertyChanged from the ITimelineItem). So it seems not to be exposed...
mofo7777
 
Posts: 53
Joined: 24 Oct 2012, 15:03

Re: Director Api

Postby Alex Klein » 11 Dec 2014, 18:11

Yeah, it's internal at the moment. There were some things we still have to tighten up before we can expose it. Right now you can only try to use the Channel's IsTakeAvailable (which would be false while something is cueing). Not a 100% replacement, but might work...
Alex Klein
 

Next

Return to General Discussion