beautypg.com

Grass Valley K2 TX/MAM Database Protocol Manual v.2.2 User Manual

Page 34

background image

TX/MAM Database Protocol Manual - document version: 2.2

– Page 34

char* Formats

XML structure with Formats and import field values (Italic
values are optional) e.g.

offset=”00:00:30:00”

duration=”00:00:10:00”>

value




The import field is transformed to a Main Event import field
by the name of: “[formatIndex]_[fieldName]”. If [value] of an
format import field is empty, the value ‘empty’ will be used.

char* MainEventName

Main Event name.

long long iLockID

0 (is not used).

char* TcIn

Specifies timecode in in hh:mm:ss:ff.

char* TcOut

Specifies timecode out in hh:mm:ss:ff.



Result
The result of the function is an integer that can have following values:

Value

Description

>=0

Success, the main_event is created. The result is the id of the new
main_event.

-1

Failure, the main_event could not be created.



Example
This example creates a main event with an import field (test) and format (PGM).

// Constants

const string8 externalRefSt = “test”;

const string8 playoutIpSt = “192.168.0.1”;

const int playoutPortNm = 5020;

const string8 assetIpSt = “192.168.0.2”;

const int assetPortNm = 5020;

const long long channelIdNm = 1;

// Connect to asset database

int result = cob_init_remote ( assetIpSt.c_str(), assetPortNm );

if (result == 0 ) return;

// Find external reference in asset database

cob_criteria_clear();

cob_fieldlist_clear();

cob_criteria_add_sqlquery( "asset_element" , "SELECT first 1 id, save_stamp FROM
asset_element WHERE external_ref = :external_ref" );

cob_criteria_add_sqlparam( "asset_element", "external_ref", externalRefSt.c_str() );

long long assetIdNm;

result = cob_get_id_list( &assetIdNm, 1 );

if ( result <= 0 ) return;