00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef NFO_H
00023 #define NFO_H
00024
00031 #ifdef __cplusplus
00032 extern "C" {
00033 #endif
00034
00035 #define NFO_STRINGIFY(s) #s
00036 #define NFO_TOSTRING(s) NFO_STRINGIFY(s)
00037
00038 #define NFO_VERSION_INT(a, b, c) (a << 16 | b << 8 | c)
00039 #define NFO_VERSION_DOT(a, b, c) a ##.## b ##.## c
00040 #define NFO_VERSION(a, b, c) NFO_VERSION_DOT(a, b, c)
00041
00042 #define LIBNFO_VERSION_MAJOR 1
00043 #define LIBNFO_VERSION_MINOR 0
00044 #define LIBNFO_VERSION_MICRO 0
00045
00046 #define LIBNFO_VERSION_INT NFO_VERSION_INT(LIBNFO_VERSION_MAJOR, \
00047 LIBNFO_VERSION_MINOR, \
00048 LIBNFO_VERSION_MICRO)
00049 #define LIBNFO_VERSION NFO_VERSION(LIBNFO_VERSION_MAJOR, \
00050 LIBNFO_VERSION_MINOR, \
00051 LIBNFO_VERSION_MICRO)
00052 #define LIBNFO_VERSION_STR NFO_TOSTRING(LIBNFO_VERSION)
00053 #define LIBNFO_BUILD LIBNFO_VERSION_INT
00054
00055 #include <inttypes.h>
00056
00061 #ifdef __cplusplus
00062 }
00063 #endif
00064
00065
00066 typedef struct nfo_stream_video_s nfo_stream_video_t;
00067 typedef struct nfo_stream_audio_s nfo_stream_audio_t;
00068 typedef struct nfo_stream_sub_s nfo_stream_sub_t;
00069 typedef struct nfo_fileinfo_s nfo_fileinfo_t;
00070 typedef struct nfo_actor_s nfo_actor_t;
00071 typedef struct nfo_movie_s nfo_movie_t;
00072 typedef struct nfo_tvshow_s nfo_tvshow_t;
00073 typedef struct nfo_tvshow_episode_s nfo_tvshow_episode_t;
00074 typedef struct nfo_s nfo_t;
00075
00076 typedef enum nfo_type_s
00077 {
00078 NFO_UNKNOWN,
00079 NFO_MOVIE,
00080 NFO_TVSHOW,
00081 NFO_MUSIC,
00082 } nfo_type_t;
00083
00084 typedef enum nfo_actor_field_s {
00085 NFO_ACTOR_NAME,
00086 NFO_ACTOR_ROLE,
00087 NFO_ACTOR_THUMB,
00088 } nfo_actor_field_t;
00089
00090 typedef enum nfo_video_field_s {
00091 NFO_VIDEO_WIDTH,
00092 NFO_VIDEO_HEIGHT,
00093 NFO_VIDEO_CODEC,
00094 NFO_VIDEO_FORMAT_INFO,
00095 NFO_VIDEO_DURATION,
00096 NFO_VIDEO_BITRATE,
00097 NFO_VIDEO_BITRATE_MODE,
00098 NFO_VIDEO_BITRATE_MAX,
00099 NFO_VIDEO_CONTAINER,
00100 NFO_VIDEO_CODEC_ID,
00101 NFO_VIDEO_CODEC_INFO,
00102 NFO_VIDEO_SCAN_TYPE,
00103 NFO_VIDEO_ASPECT,
00104 } nfo_video_field_t;
00105
00106 typedef enum nfo_audio_field_s {
00107 NFO_AUDIO_LANG,
00108 NFO_AUDIO_CODEC,
00109 NFO_AUDIO_CHANNELS,
00110 NFO_AUDIO_BITRATE,
00111 } nfo_audio_field_t;
00112
00113 typedef enum nfo_sub_field_s {
00114 NFO_SUB_LANG,
00115 } nfo_sub_field_t;
00116
00117 typedef enum nfo_movie_field_s {
00118 NFO_MOVIE_TITLE,
00119 NFO_MOVIE_ORIGINAL_TITLE,
00120 NFO_MOVIE_RATING,
00121 NFO_MOVIE_YEAR,
00122 NFO_MOVIE_TOP250,
00123 NFO_MOVIE_VOTES,
00124 NFO_MOVIE_OUTLINE,
00125 NFO_MOVIE_PLOT,
00126 NFO_MOVIE_TAGLINE,
00127 NFO_MOVIE_RUNTIME,
00128 NFO_MOVIE_THUMB,
00129 NFO_MOVIE_FAN_ART,
00130 NFO_MOVIE_MPAA,
00131 NFO_MOVIE_PLAY_COUNT,
00132 NFO_MOVIE_WATCHED,
00133 NFO_MOVIE_ID,
00134 NFO_MOVIE_TRAILER,
00135 NFO_MOVIE_GENRE,
00136 NFO_MOVIE_CREDITS,
00137 NFO_MOVIE_DIRECTOR,
00138 NFO_MOVIE_STUDIO,
00139 } nfo_movie_field_t;
00140
00141 typedef enum nfo_tvshow_field_s {
00142 NFO_TVSHOW_TITLE,
00143 NFO_TVSHOW_RATING,
00144 NFO_TVSHOW_SEASON,
00145 NFO_TVSHOW_EPISODE,
00146 NFO_TVSHOW_DISPLAY_SEASON,
00147 NFO_TVSHOW_DISPLAY_EPISODE,
00148 NFO_TVSHOW_EPISODE_GUIDE_URL,
00149 NFO_TVSHOW_PLOT,
00150 NFO_TVSHOW_MPAA,
00151 NFO_TVSHOW_WATCHED,
00152 NFO_TVSHOW_GENRE,
00153 NFO_TVSHOW_PREMIERED,
00154 NFO_TVSHOW_STUDIO,
00155 NFO_TVSHOW_FANART,
00156 NFO_TVSHOW_FANART_HEADER,
00157 NFO_TVSHOW_FANART_COVER,
00158 } nfo_tvshow_field_t;
00159
00160 typedef enum nfo_tvshow_episode_field_s {
00161 NFO_TVSHOW_EPISODE_TITLE,
00162 NFO_TVSHOW_EPISODE_RATING,
00163 NFO_TVSHOW_EPISODE_SEASON,
00164 NFO_TVSHOW_EPISODE_EPISODE,
00165 NFO_TVSHOW_EPISODE_PLOT,
00166 NFO_TVSHOW_EPISODE_THUMB,
00167 NFO_TVSHOW_EPISODE_FANART,
00168 NFO_TVSHOW_EPISODE_FANART_SEASON,
00169 NFO_TVSHOW_EPISODE_PLAY_COUNT,
00170 NFO_TVSHOW_EPISODE_CREDITS,
00171 NFO_TVSHOW_EPISODE_DIRECTOR,
00172 NFO_TVSHOW_EPISODE_AIRED,
00173 NFO_TVSHOW_EPISODE_VOTES,
00174 } nfo_tvshow_episode_field_t;
00175
00176
00177 nfo_t *nfo_init (const char *filename);
00178 void nfo_free (nfo_t *nfo);
00179
00180
00181 nfo_type_t nfo_get_type (nfo_t *nfo);
00182 nfo_movie_t *nfo_get_movie (nfo_t *nfo);
00183 nfo_tvshow_episode_t *nfo_get_tvshow_episode (nfo_t *nfo);
00184
00185
00186 char *nfo_movie_get (nfo_movie_t *movie, nfo_movie_field_t f);
00187
00188 int nfo_movie_get_actors_count (nfo_movie_t *movie);
00189 nfo_actor_t *nfo_movie_get_actor (nfo_movie_t *movie, int id);
00190
00191 int nfo_movie_get_video_streams_count (nfo_movie_t *movie);
00192 nfo_stream_video_t *nfo_movie_get_video_stream (nfo_movie_t *movie, int id);
00193
00194 int nfo_movie_get_audio_streams_count (nfo_movie_t *movie);
00195 nfo_stream_audio_t *nfo_movie_get_audio_stream (nfo_movie_t *movie, int id);
00196
00197 int nfo_movie_get_sub_streams_count (nfo_movie_t *movie);
00198 nfo_stream_sub_t *nfo_movie_get_sub_stream (nfo_movie_t *movie, int id);
00199
00200
00201 char *nfo_tvshow_episode_get (nfo_tvshow_episode_t *ep,
00202 nfo_tvshow_episode_field_t f);
00203
00204 int nfo_tvshow_episode_get_actors_count (nfo_tvshow_episode_t *ep);
00205 nfo_actor_t *nfo_tvshow_episode_get_actor (nfo_tvshow_episode_t *ep, int id);
00206
00207 int nfo_tvshow_episode_get_video_streams_count (nfo_tvshow_episode_t *ep);
00208 nfo_stream_video_t *nfo_tvshow_episode_get_video_stream
00209 (nfo_tvshow_episode_t *ep, int id);
00210
00211 int nfo_tvshow_episode_get_audio_streams_count (nfo_tvshow_episode_t *ep);
00212 nfo_stream_audio_t *nfo_tvshow_episode_get_audio_stream
00213 (nfo_tvshow_episode_t *ep, int id);
00214
00215 int nfo_tvshow_episode_get_sub_streams_count (nfo_tvshow_episode_t *ep);
00216 nfo_stream_sub_t *nfo_tvshow_episode_get_sub_stream
00217 (nfo_tvshow_episode_t *ep, int id);
00218
00219 nfo_tvshow_t *nfo_tvshow_episode_get_show (nfo_tvshow_episode_t *ep);
00220 char *nfo_tvshow_get (nfo_tvshow_t *ep, nfo_tvshow_field_t f);
00221
00222
00223 char *nfo_actor_get (nfo_actor_t *actor, nfo_actor_field_t f);
00224
00225
00226 char *nfo_video_stream_get (nfo_stream_video_t *video, nfo_video_field_t f);
00227 char *nfo_audio_stream_get (nfo_stream_audio_t *audio, nfo_audio_field_t f);
00228 char *nfo_sub_stream_get (nfo_stream_sub_t *sub, nfo_sub_field_t f);
00229
00230 #endif