Subversion Repositories eduke32

Rev

Rev 7138 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7138 Rev 8132
Line 3... Line 3...
3
3
4
#ifdef __cplusplus
4
#ifdef __cplusplus
5
extern "C" {
5
extern "C" {
6
#endif
6
#endif
7
7
8
#define XMP_VERSION "4.4.2"
8
#define XMP_VERSION "4.5.0"
9
#define XMP_VERCODE 0x040402
9
#define XMP_VERCODE 0x040500
10
#define XMP_VER_MAJOR 4
10
#define XMP_VER_MAJOR 4
11
#define XMP_VER_MINOR 4
11
#define XMP_VER_MINOR 5
12
#define XMP_VER_RELEASE 2
12
#define XMP_VER_RELEASE 0
13
13
14
#if defined(_WIN32) && !defined(__CYGWIN__)
14
#if defined(_WIN32) && !defined(__CYGWIN__)
15
# if defined(BUILDING_STATIC)
15
# if defined(BUILDING_STATIC)
16
#  define EXPORT
16
#  define LIBXMP_EXPORT
17
# elif defined(BUILDING_DLL)
17
# elif defined(BUILDING_DLL)
18
#  define EXPORT __declspec(dllexport)
18
#  define LIBXMP_EXPORT __declspec(dllexport)
19
# else
19
# else
20
#  define EXPORT __declspec(dllimport)
20
#  define LIBXMP_EXPORT __declspec(dllimport)
21
# endif
21
# endif
22
#elif defined(__OS2__) && defined(__WATCOMC__) && defined(__SW_BD)
22
#elif defined(__OS2__) && defined(__WATCOMC__) && defined(__SW_BD)
23
#  define EXPORT __declspec(dllexport)
23
#  define LIBXMP_EXPORT __declspec(dllexport)
24
#elif (defined(__GNUC__) || defined(__clang__) || defined(__HP_cc)) && defined(XMP_SYM_VISIBILITY)
24
#elif (defined(__GNUC__) || defined(__clang__) || defined(__HP_cc)) && defined(XMP_SYM_VISIBILITY)
25
# define EXPORT __attribute__((visibility ("default")))
25
# define LIBXMP_EXPORT __attribute__((visibility ("default")))
26
#elif defined(__SUNPRO_C) && defined(XMP_LDSCOPE_GLOBAL)
26
#elif defined(__SUNPRO_C) && defined(XMP_LDSCOPE_GLOBAL)
27
# define EXPORT __global
27
# define LIBXMP_EXPORT __global
28
#elif defined(EMSCRIPTEN)
28
#elif defined(EMSCRIPTEN)
29
# define EXPORT EMSCRIPTEN_KEEPALIVE
29
# define LIBXMP_EXPORT EMSCRIPTEN_KEEPALIVE
30
#else
30
#else
31
# define EXPORT 
31
# define LIBXMP_EXPORT
32
#endif
32
#endif
33
33
34
#define XMP_NAME_SIZE           64      /* Size of module name and type */
34
#define XMP_NAME_SIZE           64      /* Size of module name and type */
35
35
36
#define XMP_KEY_OFF             0x81    /* Note number for key off event */
36
#define XMP_KEY_OFF             0x81    /* Note number for key off event */
Line 199... Line 199...
199
    int dca;            /* Duplicate check action */
199
        int dca;                /* Duplicate check action */
200
    int ifc;            /* Initial filter cutoff */
200
        int ifc;                /* Initial filter cutoff */
201
    int ifr;            /* Initial filter resonance */
201
        int ifr;                /* Initial filter resonance */
202
};
202
};
203
203
-
 
204
204
struct xmp_instrument {
205
struct xmp_instrument {
205
        char name[32];                  /* Instrument name */
206
        char name[32];                  /* Instrument name */
206
        int vol;                        /* Instrument volume */
207
        int vol;                        /* Instrument volume */
207
        int nsm;                        /* Number of samples */
208
        int nsm;                        /* Number of samples */
208
        int rls;                        /* Release (fadeout) */
209
        int rls;                        /* Release (fadeout) */
Line 289... Line 290...
289
    unsigned char pan;  /* Current stereo pan */
290
        unsigned char pan;      /* Current stereo pan */
290
    unsigned char reserved;     /* Reserved */
291
        unsigned char reserved; /* Reserved */
291
    struct xmp_event event;     /* Current track event */
292
        struct xmp_event event; /* Current track event */
292
};
293
};
293
294
-
 
295
294
struct xmp_frame_info {                 /* Current frame information */
296
struct xmp_frame_info {                 /* Current frame information */
295
        int pos;                        /* Current position */
297
        int pos;                        /* Current position */
296
        int pattern;                    /* Current pattern */
298
        int pattern;                    /* Current pattern */
297
        int row;                        /* Current row in pattern */
299
        int row;                        /* Current row in pattern */
298
        int num_rows;                   /* Number of rows in current pattern */
300
        int num_rows;                   /* Number of rows in current pattern */
Line 315... Line 317...
315
};
317
};
316
318
317
319
318
typedef char *xmp_context;
320
typedef char *xmp_context;
319
321
320
EXPORT extern const char *xmp_version;
322
LIBXMP_EXPORT extern const char *xmp_version;
321
EXPORT extern const unsigned int xmp_vercode;
323
LIBXMP_EXPORT extern const unsigned int xmp_vercode;
322
324
323
EXPORT xmp_context xmp_create_context  (void);
325
LIBXMP_EXPORT xmp_context xmp_create_context  (void);
324
EXPORT void        xmp_free_context    (xmp_context);
326
LIBXMP_EXPORT void        xmp_free_context    (xmp_context);
325
#ifdef EDUKE32_DISABLED
327
#ifdef EDUKE32_DISABLED
326
EXPORT int         xmp_test_module     (char *, struct xmp_test_info *);
328
LIBXMP_EXPORT int         xmp_test_module     (char *, struct xmp_test_info *);
327
EXPORT int         xmp_load_module     (xmp_context, char *);
329
LIBXMP_EXPORT int         xmp_load_module     (xmp_context, char *);
328
#endif
330
#endif
329
EXPORT void        xmp_scan_module     (xmp_context);
331
LIBXMP_EXPORT void        xmp_scan_module     (xmp_context);
330
EXPORT void        xmp_release_module  (xmp_context);
332
LIBXMP_EXPORT void        xmp_release_module  (xmp_context);
331
EXPORT int         xmp_start_player    (xmp_context, int, int);
333
LIBXMP_EXPORT int         xmp_start_player    (xmp_context, int, int);
332
EXPORT int         xmp_play_frame      (xmp_context);
334
LIBXMP_EXPORT int         xmp_play_frame      (xmp_context);
333
EXPORT int         xmp_play_buffer     (xmp_context, void *, int, int);
335
LIBXMP_EXPORT int         xmp_play_buffer     (xmp_context, void *, int, int);
334
EXPORT void        xmp_get_frame_info  (xmp_context, struct xmp_frame_info *);
336
LIBXMP_EXPORT void        xmp_get_frame_info  (xmp_context, struct xmp_frame_info *);
335
EXPORT void        xmp_end_player      (xmp_context);
337
LIBXMP_EXPORT void        xmp_end_player      (xmp_context);
336
EXPORT void        xmp_inject_event    (xmp_context, int, struct xmp_event *);
338
LIBXMP_EXPORT void        xmp_inject_event    (xmp_context, int, struct xmp_event *);
337
EXPORT void        xmp_get_module_info (xmp_context, struct xmp_module_info *);
339
LIBXMP_EXPORT void        xmp_get_module_info (xmp_context, struct xmp_module_info *);
338
EXPORT const char**xmp_get_format_list (void);
340
LIBXMP_EXPORT const char  **xmp_get_format_list (void);
339
EXPORT int         xmp_next_position   (xmp_context);
341
LIBXMP_EXPORT int         xmp_next_position   (xmp_context);
340
EXPORT int         xmp_prev_position   (xmp_context);
342
LIBXMP_EXPORT int         xmp_prev_position   (xmp_context);
341
EXPORT int         xmp_set_position    (xmp_context, int);
343
LIBXMP_EXPORT int         xmp_set_position    (xmp_context, int);
-
 
344
LIBXMP_EXPORT int         xmp_set_row         (xmp_context, int);
-
 
345
LIBXMP_EXPORT int         xmp_set_tempo_factor(xmp_context, double);
342
EXPORT void        xmp_stop_module     (xmp_context);
346
LIBXMP_EXPORT void        xmp_stop_module     (xmp_context);
343
EXPORT void        xmp_restart_module  (xmp_context);
347
LIBXMP_EXPORT void        xmp_restart_module  (xmp_context);
344
EXPORT int         xmp_seek_time       (xmp_context, int);
348
LIBXMP_EXPORT int         xmp_seek_time       (xmp_context, int);
345
EXPORT int         xmp_channel_mute    (xmp_context, int, int);
349
LIBXMP_EXPORT int         xmp_channel_mute    (xmp_context, int, int);
346
EXPORT int         xmp_channel_vol     (xmp_context, int, int);
350
LIBXMP_EXPORT int         xmp_channel_vol     (xmp_context, int, int);
347
EXPORT int         xmp_set_player      (xmp_context, int, int);
351
LIBXMP_EXPORT int         xmp_set_player      (xmp_context, int, int);
348
EXPORT int         xmp_get_player      (xmp_context, int);
352
LIBXMP_EXPORT int         xmp_get_player      (xmp_context, int);
349
EXPORT int         xmp_set_instrument_path (xmp_context, char *);
353
LIBXMP_EXPORT int         xmp_set_instrument_path (xmp_context, char *);
350
EXPORT int         xmp_load_module_from_memory (xmp_context, void *, long);
354
LIBXMP_EXPORT int         xmp_load_module_from_memory (xmp_context, void *, long);
351
#ifdef EDUKE32_DISABLED
355
#ifdef EDUKE32_DISABLED
352
EXPORT int         xmp_load_module_from_file (xmp_context, void *, long);
356
LIBXMP_EXPORT int         xmp_load_module_from_file (xmp_context, void *, long);
353
#endif
357
#endif
354
-
 
355
/* External sample mixer API */
358
/* External sample mixer API */
356
EXPORT int         xmp_start_smix       (xmp_context, int, int);
359
LIBXMP_EXPORT int         xmp_start_smix       (xmp_context, int, int);
357
EXPORT void        xmp_end_smix         (xmp_context);
360
LIBXMP_EXPORT void        xmp_end_smix         (xmp_context);
358
EXPORT int         xmp_smix_play_instrument(xmp_context, int, int, int, int);
361
LIBXMP_EXPORT int         xmp_smix_play_instrument(xmp_context, int, int, int, int);
359
EXPORT int         xmp_smix_play_sample (xmp_context, int, int, int, int);
362
LIBXMP_EXPORT int         xmp_smix_play_sample (xmp_context, int, int, int, int);
360
EXPORT int         xmp_smix_channel_pan (xmp_context, int, int);
363
LIBXMP_EXPORT int         xmp_smix_channel_pan (xmp_context, int, int);
361
#ifdef EDUKE32_DISABLED
364
#ifdef EDUKE32_DISABLED
362
EXPORT int         xmp_smix_load_sample (xmp_context, int, char *);
365
LIBXMP_EXPORT int         xmp_smix_load_sample (xmp_context, int, char *);
363
#endif
366
#endif
364
EXPORT int         xmp_smix_release_sample (xmp_context, int);
367
LIBXMP_EXPORT int         xmp_smix_release_sample (xmp_context, int);
365
368
366
#ifdef __cplusplus
369
#ifdef __cplusplus
367
}
370
}
368
#endif
371
#endif
369
372