2024-04-16 03:43:29 +00:00
|
|
|
#ifndef MOVIE_H__
|
|
|
|
#define MOVIE_H__
|
|
|
|
|
|
|
|
#include "renderer.h"
|
|
|
|
|
2024-04-16 18:56:40 +00:00
|
|
|
#define MVELIB_NOERROR 0
|
|
|
|
#define MVELIB_FILE_ERROR -1
|
|
|
|
#define MVELIB_NOTINIT_ERROR -2
|
|
|
|
#define MVELIB_DDGR_ERROR -3
|
|
|
|
#define MVELIB_INIT_ERROR -4
|
|
|
|
#define MVELIB_PLAYBACK_ERROR -5
|
|
|
|
#define MVELIB_PLAYBACK_ABORTED -6
|
2024-04-16 03:43:29 +00:00
|
|
|
|
|
|
|
class oeApplication;
|
|
|
|
|
2024-04-16 18:56:40 +00:00
|
|
|
int mve_Init(const char *dir, const char *sndcard);
|
2024-04-16 03:43:29 +00:00
|
|
|
|
|
|
|
// simply plays a movie.
|
2024-04-16 18:56:40 +00:00
|
|
|
int mve_PlayMovie(const char *mvename, oeApplication *app);
|
2024-04-16 03:43:29 +00:00
|
|
|
|
|
|
|
// used to copy movie data to a pointer, looping will loop, fhandle will be a pointer to a file handle to be returned
|
|
|
|
// handle to movie sequence is returned by function.
|
2024-04-16 18:56:40 +00:00
|
|
|
unsigned int mve_SequenceStart(const char *mvename, int *fhandle, oeApplication *app, bool looping = false);
|
2024-04-16 03:43:29 +00:00
|
|
|
|
2024-04-16 18:56:40 +00:00
|
|
|
// frames movies started with SequenceStart. Optionally, pass a pointer to a variable which will receive
|
2024-04-16 03:43:29 +00:00
|
|
|
// bitmap handle containing data, nx and ny will contain adjusted x and y coordinates if needed.
|
|
|
|
// passing -1 to x and y centers the frame on that axis
|
|
|
|
// handle is the movie handle returned by mve_Sequence start
|
|
|
|
// returned value is the handle passed into mve_SequenceFrame or new one if movie looped.
|
2024-04-16 18:56:40 +00:00
|
|
|
unsigned int mve_SequenceFrame(unsigned int handle, int fhandle, bool sequence, int *bm_handle);
|
2024-04-16 03:43:29 +00:00
|
|
|
|
2024-04-16 18:56:40 +00:00
|
|
|
bool mve_SequenceClose(unsigned int handle, int fhandle);
|
2024-04-16 03:43:29 +00:00
|
|
|
|
|
|
|
// sets render frame boundaries.
|
2024-04-16 18:56:40 +00:00
|
|
|
void mve_SetRenderProperties(short x, short y, short w, short h, renderer_type type, bool hicolor);
|
2024-04-16 03:43:29 +00:00
|
|
|
|
|
|
|
// called every frame.
|
2024-04-16 18:56:40 +00:00
|
|
|
typedef void (*MovieFrameCallback_fp)(int x, int y, int movieFrameNum);
|
|
|
|
void mve_SetCallback(MovieFrameCallback_fp callBack);
|
2024-04-16 03:43:29 +00:00
|
|
|
|
|
|
|
// call to print out text.
|
2024-04-16 18:56:40 +00:00
|
|
|
void mve_Puts(short x, short y, ddgr_color col, const char *txt);
|
2024-04-16 03:43:29 +00:00
|
|
|
|
2024-04-16 18:56:40 +00:00
|
|
|
void mve_ClearRect(short x1, short y1, short x2, short y2);
|
2024-04-16 03:43:29 +00:00
|
|
|
|
|
|
|
#endif
|