2006-08-20 23:12:56 +00:00
|
|
|
|
|
|
|
#include "plugin.h"
|
|
|
|
|
2008-05-18 00:14:34 +00:00
|
|
|
#define SETTINGS_VERSION 5
|
2008-01-12 05:45:38 +00:00
|
|
|
#define SETTINGS_MIN_VERSION 1
|
|
|
|
#define SETTINGS_FILENAME "mpegplayer.cfg"
|
|
|
|
|
2008-01-26 14:24:09 +00:00
|
|
|
#if defined(TOSHIBA_GIGABEAT_F) || defined(SANSA_E200) || defined(SANSA_C200) \
|
2009-05-12 13:22:39 +00:00
|
|
|
|| defined(IRIVER_H10) || defined(COWON_D2) || defined(PHILIPS_HDD1630) \
|
2009-07-15 22:02:42 +00:00
|
|
|
|| defined(SANSA_FUZE) || defined(SANSA_E200V2) || defined(TOSHIBA_GIGABEAT_S)
|
2007-12-29 19:46:35 +00:00
|
|
|
#define MPEG_OPTION_DITHERING_ENABLED 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef MPEG_OPTION_DITHERING_ENABLED
|
|
|
|
#define MPEG_OPTION_DITHERING_ENABLED 0
|
|
|
|
#endif
|
|
|
|
|
2007-10-16 14:23:50 +00:00
|
|
|
enum mpeg_option_id
|
|
|
|
{
|
2007-12-29 19:46:35 +00:00
|
|
|
#if MPEG_OPTION_DITHERING_ENABLED
|
2007-10-16 14:23:50 +00:00
|
|
|
MPEG_OPTION_DITHERING,
|
|
|
|
#endif
|
|
|
|
MPEG_OPTION_DISPLAY_FPS,
|
|
|
|
MPEG_OPTION_LIMIT_FPS,
|
|
|
|
MPEG_OPTION_SKIP_FRAMES,
|
2008-05-18 00:14:34 +00:00
|
|
|
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
|
|
|
MPEG_OPTION_BACKLIGHT_BRIGHTNESS,
|
|
|
|
#endif
|
2007-10-16 14:23:50 +00:00
|
|
|
};
|
|
|
|
|
2008-02-01 02:25:15 +00:00
|
|
|
enum mpeg_audio_option_id
|
|
|
|
{
|
|
|
|
MPEG_AUDIO_TONE_CONTROLS,
|
|
|
|
MPEG_AUDIO_CHANNEL_MODES,
|
|
|
|
MPEG_AUDIO_CROSSFEED,
|
|
|
|
MPEG_AUDIO_EQUALIZER,
|
|
|
|
MPEG_AUDIO_DITHERING,
|
|
|
|
};
|
|
|
|
|
2008-01-12 05:45:38 +00:00
|
|
|
enum mpeg_resume_id
|
|
|
|
{
|
|
|
|
MPEG_RESUME_MENU_ALWAYS = 0,
|
|
|
|
MPEG_RESUME_MENU_IF_INCOMPLETE,
|
|
|
|
MPEG_RESUME_RESTART,
|
|
|
|
MPEG_RESUME_ALWAYS,
|
|
|
|
MPEG_RESUME_NUM_OPTIONS,
|
|
|
|
};
|
|
|
|
|
2007-10-16 14:23:50 +00:00
|
|
|
enum mpeg_start_id
|
|
|
|
{
|
|
|
|
MPEG_START_RESTART,
|
|
|
|
MPEG_START_RESUME,
|
|
|
|
MPEG_START_SEEK,
|
2008-01-12 05:45:38 +00:00
|
|
|
MPEG_START_SETTINGS,
|
2007-10-16 14:23:50 +00:00
|
|
|
MPEG_START_QUIT,
|
2008-01-12 05:45:38 +00:00
|
|
|
MPEG_START_EXIT,
|
2007-10-16 14:23:50 +00:00
|
|
|
};
|
|
|
|
|
2009-08-27 14:24:58 +00:00
|
|
|
enum mpeg_setting_id
|
|
|
|
{
|
|
|
|
MPEG_SETTING_DISPLAY_SETTINGS,
|
|
|
|
MPEG_SETTING_AUDIO_SETTINGS,
|
|
|
|
MPEG_SETTING_ENABLE_START_MENU,
|
|
|
|
MPEG_SETTING_CLEAR_RESUMES,
|
|
|
|
};
|
|
|
|
|
2007-10-16 14:23:50 +00:00
|
|
|
enum mpeg_menu_id
|
|
|
|
{
|
2009-08-27 14:24:58 +00:00
|
|
|
MPEG_MENU_SETTINGS,
|
|
|
|
MPEG_MENU_RESUME,
|
2007-10-16 14:23:50 +00:00
|
|
|
MPEG_MENU_QUIT,
|
|
|
|
};
|
|
|
|
|
2006-08-20 23:12:56 +00:00
|
|
|
struct mpeg_settings {
|
2007-10-09 20:42:20 +00:00
|
|
|
int showfps; /* flag to display fps */
|
|
|
|
int limitfps; /* flag to limit fps */
|
|
|
|
int skipframes; /* flag to skip frames */
|
2008-01-12 05:45:38 +00:00
|
|
|
int resume_options; /* type of resume action at start */
|
2007-10-09 20:42:20 +00:00
|
|
|
int resume_count; /* total # of resumes in config file */
|
|
|
|
int resume_time; /* resume time for current mpeg (in half minutes) */
|
2007-12-29 19:46:35 +00:00
|
|
|
char resume_filename[MAX_PATH]; /* filename of current mpeg */
|
|
|
|
#if MPEG_OPTION_DITHERING_ENABLED
|
2007-10-09 20:42:20 +00:00
|
|
|
int displayoptions;
|
2007-09-25 02:59:42 +00:00
|
|
|
#endif
|
2008-02-01 02:25:15 +00:00
|
|
|
/* Audio options - simple on/off specification */
|
|
|
|
int tone_controls;
|
|
|
|
int channel_modes;
|
|
|
|
int crossfeed;
|
|
|
|
int equalizer;
|
|
|
|
int dithering;
|
2008-05-18 00:14:34 +00:00
|
|
|
/* Backlight options */
|
|
|
|
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
|
|
|
int backlight_brightness;
|
|
|
|
#endif
|
2006-08-20 23:12:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern struct mpeg_settings settings;
|
|
|
|
|
2008-01-12 05:45:38 +00:00
|
|
|
int mpeg_start_menu(uint32_t duration);
|
2009-08-27 14:24:58 +00:00
|
|
|
int mpeg_menu(void);
|
2008-01-12 05:45:38 +00:00
|
|
|
|
|
|
|
void mpeg_menu_sysevent_clear(void);
|
|
|
|
long mpeg_menu_sysevent(void);
|
2009-06-16 04:25:21 +00:00
|
|
|
int mpeg_menu_sysevent_callback(int btn, const struct menu_item_ex *menu);
|
2008-01-12 05:45:38 +00:00
|
|
|
void mpeg_menu_sysevent_handle(void);
|
|
|
|
|
2007-10-09 20:42:20 +00:00
|
|
|
void init_settings(const char* filename);
|
2006-08-20 23:12:56 +00:00
|
|
|
void save_settings(void);
|
2008-05-18 00:14:34 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_BACKLIGHT_BRIGHTNESS
|
|
|
|
void mpeg_backlight_update_brightness(int value);
|
|
|
|
#endif
|