diff src/common/nesvideos-piece.h @ 19:5e8e5083da94

brought in common and gba, fixed problems with outdated Makefile.am files in both of these packages
author Robert McIntyre <rlm@mit.edu>
date Sun, 04 Mar 2012 14:33:52 -0600
parents f9f4f1b99eed
children
line wrap: on
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/common/nesvideos-piece.h	Sun Mar 04 14:33:52 2012 -0600
     1.3 @@ -0,0 +1,48 @@
     1.4 +#ifndef NESVPIECEhh
     1.5 +#define NESVPIECEhh
     1.6 +
     1.7 +#define NESVIDEOS_LOGGING 1
     1.8 +
     1.9 +#ifdef __cplusplus
    1.10 +extern "C" {
    1.11 +#endif
    1.12 +
    1.13 +/* Is video logging enabled? 0=no, 1=yes, 2=active. Default value: 0 */ 
    1.14 +extern int LoggingEnabled; 
    1.15 +
    1.16 +/* Get and set the video recording command (shell command) */ 
    1.17 +extern const char* NESVideoGetVideoCmd(); 
    1.18 +extern void NESVideoSetVideoCmd(const char *cmd);
    1.19 +
    1.20 +/* Tells to use these functions for obtaining/releasing FILE pointers for writing - if not specified, popen/pclose are used. */
    1.21 +extern void NESVideoSetFileFuncs( FILE* openFunc(const char *,const char *), int closeFunc(FILE*) );
    1.22 +
    1.23 +/* Tells to call these functions per frame with amounts (seconds and frames) of video and audio progress */
    1.24 +extern void NESVideoEnableDebugging( void videoMessageFunc(const char *msg), void audioMessageFunc(const char *msg) );
    1.25 +
    1.26 +/* Save 1 frame of video. (Assumed to be 16-bit RGB) */ 
    1.27 +/* FPS is scaled by 24 bits (*0x1000000) */
    1.28 +/* Does not do anything if LoggingEnabled<2. */ 
    1.29 +extern void NESVideoLoggingVideo
    1.30 +    (const void*data, unsigned width, unsigned height,
    1.31 +     unsigned fps_scaled); 
    1.32 +
    1.33 +/* Save N bytes of audio. bytes_per_second is required on the first call. */ 
    1.34 +/* Does not do anything if LoggingEnabled<2. */ 
    1.35 +/* The interval of calling this function is not important, as long as all the audio
    1.36 + * data is eventually written without too big delay (5 seconds is too big)
    1.37 + * This function may be called multiple times per video frame, or once per a few video
    1.38 + * frames, or anything in between. Just that all audio data must be written exactly once,
    1.39 + * and in order. */ 
    1.40 +extern void NESVideoLoggingAudio
    1.41 +    (const void*data,
    1.42 +     unsigned rate, unsigned bits, unsigned chans,
    1.43 +     unsigned nsamples);
    1.44 +/* nsamples*chans*(bits/8) = bytes in *data. */
    1.45 +/*     rate*chans*(bits/8) = bytes per second. */
    1.46 +
    1.47 +#ifdef __cplusplus
    1.48 +}
    1.49 +#endif
    1.50 +
    1.51 +#endif