xp_comm_proj/cine/imgcache.c
/* routine: CacheSetMode
 * purpose: Set cacheator mode (interactive or loop)
 */
CacheSetMode
purpose: Set cacheator mode (interactive or loop)
CacheSetMode purpose : Set cacheator mode ( interactive or loop )
int CacheSetMode(OMobj_id obj_id, OMevent_mask event_mask, int seq_num)
{
  CacheInfo *cache;
  int newmode;
  if( (cache = GetCacheInfo( obj_id )) == NULL )
    return( 0 );
  newmode = 0;
  OMget_name_int_val( obj_id, OMstr_to_name("mode"), &newmode );
  if( (newmode != 0) && (newmode != 1) )
    {
      fprintf( stderr, "CacheSetMode: Invalid mode\n" );
      return( 0 );
    }
  if( (newmode != cache->mode) && (cache->capture || cache->playback) )
    {
      OMset_name_int_val( obj_id, OMstr_to_name("mode"), cache->mode );
      fprintf( stderr, "CacheSetMode: Can't change mode while active\n" );
      return( 0 );
    }
  cache->mode = newmode;
  return( 1 );
}
int CacheSetMode ( OMobj_id obj_id , OMevent_mask event_mask , int seq_num ) { CacheInfo * cache ; int newmode ; if ( ( cache = GetCacheInfo ( obj_id ) ) == NULL ) return ( 0 ) ; newmode = 0 ; OMget_name_int_val ( obj_id , OMstr_to_name ( " " ) , & newmode ) ; if ( ( newmode != 0 ) && ( newmode != 1 ) ) { fprintf ( stderr , " \n " ) ; return ( 0 ) ; } if ( ( newmode != cache -> mode ) && ( cache -> capture || cache -> playback ) ) { OMset_name_int_val ( obj_id , OMstr_to_name ( " " ) , cache -> mode ) ; fprintf ( stderr , " \n " ) ; return ( 0 ) ; } cache -> mode = newmode ; return ( 1 ) ; }
routine: CacheSetMode
 purpose: Set cacheator mode (interactive or loop)
routine : CacheSetMode purpose : Set cacheator mode ( interactive or loop )
/* Get pointer to control structure
   */ /* Do not let someone change modes while in capture or
   *  playback mode since managing this would get overwhelming
   */