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
00032
00033
00034
00037
00038 #ifndef _musepack_h_
00039 #define _musepack_h_
00040
00041 #ifdef __cplusplus
00042 extern "C" {
00043 #endif
00044
00045 #include <stdio.h>
00046 #include <stdlib.h>
00047 #include <string.h>
00048 #include <math.h>
00049
00050 #include "musepack/config_types.h"
00051 #include "musepack/decoder.h"
00052 #include "musepack/math.h"
00053 #include "musepack/reader.h"
00054 #include "musepack/streaminfo.h"
00055
00056 enum {
00057 MPC_FRAME_LENGTH = (36 * 32),
00058 MPC_DECODER_BUFFER_LENGTH = 4 * MPC_FRAME_LENGTH
00059 };
00060
00061
00062 #define ERROR_CODE_OK 0
00063 #define ERROR_CODE_FILE -1
00064 #define ERROR_CODE_SV7BETA 1
00065 #define ERROR_CODE_CBR 2
00066 #define ERROR_CODE_IS 3
00067 #define ERROR_CODE_BLOCKSIZE 4
00068 #define ERROR_CODE_INVALIDSV 5
00069
00072 void mpc_streaminfo_init(mpc_streaminfo *si);
00073
00078 mpc_int32_t mpc_streaminfo_read(mpc_streaminfo *si, mpc_reader *r);
00079
00082 double mpc_streaminfo_get_length(mpc_streaminfo *si);
00083
00086 mpc_int64_t mpc_streaminfo_get_length_samples(mpc_streaminfo *si);
00087
00091 void mpc_decoder_setup(mpc_decoder *d, mpc_reader *r);
00092
00097 BOOL mpc_decoder_initialize(mpc_decoder *d, mpc_streaminfo *si);
00098
00102 void mpc_decoder_scale_output(mpc_decoder *d, double scale_factor);
00103
00112 mpc_uint32_t mpc_decoder_decode(
00113 mpc_decoder *d,
00114 MPC_SAMPLE_FORMAT *buffer,
00115 mpc_uint32_t *vbr_update_acc,
00116 mpc_uint32_t *vbr_update_bits);
00117
00119 BOOL mpc_decoder_seek_sample(mpc_decoder *d, mpc_int64_t destsample);
00120
00122 BOOL mpc_decoder_seek_seconds(mpc_decoder *d, double seconds);
00123
00124 #ifdef __cplusplus
00125 }
00126 #endif // __cplusplus
00127
00128 #endif // _musepack_h_