00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 #ifndef LIBDAISY_H_
00032 #define LIBDAISY_H_
00033
00034 #include <pthread.h>
00035
00036 #ifdef __cplusplus
00037 extern "C" {
00038 #endif
00039
00040
00041
00042
00043
00044
00045
00049 typedef void *daisyplayer_t;
00050
00054 enum daisy_status
00055 {
00056 DAISY_ERROR_UNKNOWN = 0x0000,
00057
00058
00059
00060
00061
00062 DAISY_ERROR_AUDIO_NOT_INITIALIZED = 0x0200,
00063 DAISY_ERROR_AUDIO_CREATE_MMAP = 0x0201,
00064 DAISY_ERROR_AUDIO_FSTAT = 0x0202,
00065 DAISY_ERROR_AUDIO_OPEN = 0x0203,
00066 DAISY_ERROR_AUDIO_FREE_MMAP = 0x0204,
00067 DAISY_ERROR_AUDIO_INITIATE_DATA = 0x0205,
00068 DAISY_ERROR_AUDIO_NOT_PLAYING = 0x0206,
00069 DAISY_ERROR_AUDIO_NOT_STOPPED = 0x0207,
00070 DAISY_ERROR_AUDIO_DATA_IS_NULL = 0x0208,
00071 DAISY_ERROR_AUDIO_MALLOC = 0x0209,
00072 DAISY_ERROR_AUDIO_PAUSED_WHILE_NOT_PLAYING = 0x0210,
00073 DAISY_ERROR_AUDIO_STOPPED_WHILE_NOT_PLAYING = 0x0211,
00074
00075
00076 DAISY_ERROR_PLAYBACK_NO_TEXT_IN_SEGMENT = 0x0301,
00077 DAISY_ERROR_PLAYBACK_NO_AUDIO_IN_SEGMENT = 0x0302,
00078 DAISY_ERROR_PLAYBACK_NO_DTB_LOADED = 0x0303,
00079 DAISY_ERROR_PLAYBACK_SEEK_FAILED = 0x0304,
00080
00081
00082 DAISY_ERROR_MISC_INIT_MUTEX = 0x0400,
00083
00084
00085 DAISY_END_OF_BOOK = 0x1100
00086 };
00087
00092 enum daisy_seek_option
00093 {
00094 DAISY_SEEK_PREV_CHAPTER = 1,
00095 DAISY_SEEK_PREV_PASSAGE = 2,
00096 DAISY_SEEK_NEXT_CHAPTER = 3,
00097 DAISY_SEEK_NEXT_PASSAGE = 4,
00098 DAISY_SEEK_TO_BEGINNING = 5
00099 };
00100
00105 enum daisy_bookinfo_option
00106 {
00107 DAISY_BOOKINFO_TITLETEXT = 1,
00108 DAISY_BOOKINFO_TITLEIMAGE = 2,
00109 DAISY_BOOKINFO_TOTALTIME = 3
00110 };
00111
00116 enum daisy_chapter_info
00117 {
00118 DAISY_CHAPTER_TITLE = 1,
00119 DAISY_CHAPTER_WEIGHT = 2
00120 };
00121
00130 typedef struct {
00131 int smilpos;
00132 int nodepos;
00133 } daisy_position;
00134
00135
00136
00137
00138
00139
00140
00156 daisyplayer_t daisy_init (void *data,
00157 void (*l_cb_daisy_audio_done) (void *),
00158 void (*l_cb_daisy_audio_next) (void *, unsigned long int),
00159 void (*l_cb_daisy_text) (void *, void *),
00160 void (*l_cb_daisy_id) (void *, void *),
00161 void (*l_cb_daisy_error) (void *, enum daisy_status, const char *daisy_status_msg),
00162 void (*l_cb_daisy_progress) (void *, long int)
00163 );
00164
00170 void daisy_term (daisyplayer_t daisy);
00171
00178 int daisy_load (daisyplayer_t daisy, char *path);
00179
00185 int daisy_play (daisyplayer_t daisy);
00186
00194 int daisy_seek (daisyplayer_t daisy, int seek_option);
00195
00204 daisy_position *daisy_get_position (daisyplayer_t daisy);
00205
00214 int daisy_goto_position (daisyplayer_t daisy, daisy_position *position);
00215
00221 int daisy_stop (daisyplayer_t daisy);
00222
00228 int daisy_pause (daisyplayer_t daisy);
00229
00237 char *daisy_get_info (daisyplayer_t daisy, int value);
00238
00244 int daisy_get_chapter_count (daisyplayer_t daisy);
00245
00256 char *daisy_get_chapter_info (daisyplayer_t daisy, int num, int option);
00257
00258 #ifdef __cplusplus
00259 }
00260 #endif
00261
00262
00263 #endif
00264