rlm@1: #ifndef NESVPIECEhh rlm@1: #define NESVPIECEhh rlm@1: rlm@1: #define NESVIDEOS_LOGGING 1 rlm@1: rlm@1: #ifdef __cplusplus rlm@1: extern "C" { rlm@1: #endif rlm@1: rlm@1: /* Is video logging enabled? 0=no, 1=yes, 2=active. Default value: 0 */ rlm@1: extern int LoggingEnabled; rlm@1: rlm@1: /* Get and set the video recording command (shell command) */ rlm@1: extern const char* NESVideoGetVideoCmd(); rlm@1: extern void NESVideoSetVideoCmd(const char *cmd); rlm@1: rlm@1: /* Tells to use these functions for obtaining/releasing FILE pointers for writing - if not specified, popen/pclose are used. */ rlm@1: extern void NESVideoSetFileFuncs( FILE* openFunc(const char *,const char *), int closeFunc(FILE*) ); rlm@1: rlm@1: /* Tells to call these functions per frame with amounts (seconds and frames) of video and audio progress */ rlm@1: extern void NESVideoEnableDebugging( void videoMessageFunc(const char *msg), void audioMessageFunc(const char *msg) ); rlm@1: rlm@1: /* Save 1 frame of video. (Assumed to be 16-bit RGB) */ rlm@1: /* FPS is scaled by 24 bits (*0x1000000) */ rlm@1: /* Does not do anything if LoggingEnabled<2. */ rlm@1: extern void NESVideoLoggingVideo rlm@1: (const void*data, unsigned width, unsigned height, rlm@1: unsigned fps_scaled); rlm@1: rlm@1: /* Save N bytes of audio. bytes_per_second is required on the first call. */ rlm@1: /* Does not do anything if LoggingEnabled<2. */ rlm@1: /* The interval of calling this function is not important, as long as all the audio rlm@1: * data is eventually written without too big delay (5 seconds is too big) rlm@1: * This function may be called multiple times per video frame, or once per a few video rlm@1: * frames, or anything in between. Just that all audio data must be written exactly once, rlm@1: * and in order. */ rlm@1: extern void NESVideoLoggingAudio rlm@1: (const void*data, rlm@1: unsigned rate, unsigned bits, unsigned chans, rlm@1: unsigned nsamples); rlm@1: /* nsamples*chans*(bits/8) = bytes in *data. */ rlm@1: /* rate*chans*(bits/8) = bytes per second. */ rlm@1: rlm@1: #ifdef __cplusplus rlm@1: } rlm@1: #endif rlm@1: rlm@1: #endif