wtorek, 29 listopada 2011

Chyron - eyeball to eyeball

Here is a few trailers and code samples about programming with Chyron.I noticed that there is not to much information about fixing the the issues you can ecounter working with LyricLib. So I decided to publish interesting information about my adventure with Chyron.

First step is to get LyricLib. You can find it here. To do this go to your project and right click on References folder, then click Add Reference. Add the reference to your project and type in your code this using line:
using LyricLib;

The three main objects are you going to use are:
       static ILyricObject _lyric;
        static ISceneProxy _scene;
        static IFrameBufferProxy _fb;

To make connection with your Lyric ensure that you have code to do it:
_lyricServer = new LyricServerClass();
_lyric = _lyricServer.GetLyric() as ILyricObject;

if (_lyric != null)
{
    _lyric.RegisterLEIFlet(_lyricLicense, "1000", "derp");
    Console.WriteLine("connected");
}
else
{
    Console.WriteLine("error");
}

The next basic step is to load scene:
_fb = (IFrameBufferProxy)_lyric.FrameBuffer(1);
_scene = (ISceneProxy)_fb.SceneByFilename(_messageFile);
if ((_fb != null) && (_scene == null))
{
    _lyric.Open(_messageFile, true);
    _scene = (ISceneProxy)_fb.SceneByFilename(_messageFile);
}       


I looked around in Chyron and noticed that there is not too much examples that can show you how to use they library in .net projects.

Anyway, I have found this as a very valuable information to work with LyricLib:
enum UpdateSrc { UPDATE_DATA = 1, UPDATE_FILE = 2 };
enum UpdateOp { UPDATE_REPLACE = 1, UPDATE_APPEND = 2 };
enum NodeType
{
TYPE_THREEDCHARACTER = 1, TYPE_WAVEFRONTOBJECT = 2, TYPE_THREEDSTUDIOOBJECT = 3, TYPE_IMAGEOBJECT = 4, TYPE_ORTHOGRAPHICCAMERA = 5, TYPE_PERSPECTIVECAMERA = 6, TYPE_GLOBALLIGHT = 7, TYPE_DIRECTIONALLIGHT = 8, TYPE_POSITIONALLIGHT = 9, TYPE_SPOTLIGHT = 10, TYPE_TEXTWINDOW = 11, TYPE_LOOPOBJECT = 12, TYPE_PAUSEOBJECT = 13, TYPE_CLIP = 14, TYPE_VIDEOREGION = 15, TYPE_CLOCKTIMER = 16, TYPE_ANIMATEDELEMENT = 17, TYPE_MIX = 18,
TYPE_FLIPBOOK = 19, TYPE_ITVEVENT = 20, TYPE_MULTIFXOBJ = 21, TYPE_SPLINEWINDOW = 22, TYPE_SQUEEZEBACKREGION = 23, TYPE_THREEDTEMPLATE = 24, TYPE_CUSTOM = 25, TYPE_PROXYBASED = 26, TYPE_MOVIE = 27, TYPE_3DPLUGINOBJECT = 32 };

Using Chrome enumeratos coding can be much more easier. Here is example how to get text object from scene:
INodeProxy pTextNode = (INodeProxy)_scene.Element(id);
if (pTextNode.Type == (int)NodeType.TYPE_TEXTWINDOW)
{
    int iRegion = 0;
    int iSource = (int)UpdateSrc.UPDATE_DATA;
    int iOp = (int)UpdateOp.UPDATE_REPLACE;
    string sData = text;
    int result = pTextNode.Update(iRegion, iSource, iOp, sData);
}

Aand another one example to play scene:

if (!_scene.IsOnOutput())
{
    _scene.Play(1, 0);
}
else
{
    _scene.Play(0, 0);
}
While I was trying to create some easy demo I was looking around how to put basic grpahic int the scene. Here is another few lines explaining how to do it:
string fileName = "D:\\Chyron\\graphics\\sunburst2HD.jpg";
ILyricCanvas pCanvas = (ILyricCanvas)_lyric.ActiveCanvas;
ISceneProxy pScene = (ISceneProxy)pCanvas.Scene;
ISelection pSelection = (ISelection)pCanvas.Selection;
pSelection.Execute("Insert Template");
pSelection.Text = "C# Text Test";
object iInter = new Int32();
iInter = 0;
((IImageProxy)((IBackgroundProxy)pScene.Background).Image).Save(fileName, "0");

At the end two trailers I have found:

"How to use a macro to populate a 2d text crawl with info from a text file.  "




"How to Create A Directory "

Brak komentarzy:

Prześlij komentarz