
TX/MAM Database Protocol Manual - document version: 2.2 – Page 36
11.2 Checking if the asset indicated by asset_id is in a schedule with
the time indicated by start_timedate and end_timedate
long cob_check_asset_scheduled( long long asset_id, long long start_timedate,
long long end_timedate );
Parameters
The main asset id, e.g. 302.
The start time of the period to check as Cobalt time field.
The end time of the period to check as Cobalt time field.
Result
The result of the function is an integer that can have following values:
Failure, the check could not be performed.
The asset is not scheduled within this time period.
The asset is scheduled, the result is the id of the first main event to use
this asset.
Example
To check if an asset is scheduled within now and now + 1 hour:
long cob_init( "no name" );
cob_msec_to_timedate( start_datetime );
mainevent_id = cob_check_asset_scheduled( 302, mainevent_datetime,
mainevent_datetime + (60 *60 * 1000));
if ( mainevent_id < 0 ){
/* Log error */
} else if ( mainevent_id > 0 ) {
/* asset is scheduled */
} else {
/* asset is not scheduled */
}
Komentarze do niniejszej Instrukcji