12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifndef __CPICTURE_PLAYER_H__
- #define __CPICTURE_PLAYER_H__
- #include <stdio.h>
- #include <stdint.h>
- #include <stdbool.h>
- #ifdef __cplusplus
- extern "C"
- {
- #endif // __cplusplus
- #if defined(_WIN32)
- #include <SDL.h>
- #include <SDL_video.h>
- #include <SDL_render.h>
- #include <SDL_rect.h>
- #include <SDL_mutex.h>
- //#include <SDL_image.h>
- #else
- #include <SDL2/SDL.h>
- #include <SDL2/SDL_video.h>
- #include <SDL2/SDL_render.h>
- #include <SDL2/SDL_rect.h>
- #include <SDL2/SDL_mutex.h>
- //#include <SDL2/SDL_image.h>
- #endif
- #ifdef __cplusplus
- }
- #endif // __cplusplus
- #ifndef MAX_FILECOUNT
- #define MAX_FILECOUNT 32
- #endif // !MAX_FILECOUNT
- #ifndef MAX_PATH
- #define MAX_PATH 260
- #endif
- typedef void (*play_logfun)(const char* fmt, ...);
- typedef struct rvc_picture_player_param_s {
- char* stricon_path;
- int icx;
- int icy;
- uint8_t uwindow_width;
- uint8_t uwindow_height;
- play_logfun rvc_log;
- bool bfull_screen;
- bool bprim_monitor;
- int nfile_cnt;
- int nplay_cnt;
- int nplay_interval;
- char strroot_path[MAX_PATH];
- char strfile_names[MAX_FILECOUNT][MAX_PATH];
- }rvc_picture_player_param_t;
- class CPicturePlayer
- {
- public:
- CPicturePlayer();
- ~CPicturePlayer();
- int Init(rvc_picture_player_param_t* tparam);
- int DeInit();
- bool StartPicPlay();
- int StopPicPlay();
- int ExitPicturePlayingThread();
- bool GetPicPlayingFlag();
- int64_t GetPicPlayingThreadId();
- public:
- play_logfun m_rvclog;
- SDL_Window* m_window;
- int m_nfile_cnt;
- int m_nplay_cnt;
- int m_nplay_interval;
- char m_strroot_path[MAX_PATH];
- char m_strfile_names[MAX_FILECOUNT][MAX_PATH];
- private:
- bool m_bplaying;
- char* m_stricopath;
- SDL_Thread* m_thid;
- };
- #endif
|