forked from kode54/libupse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
upse.h
104 lines (89 loc) · 2.32 KB
/
upse.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*
* UPSE: the unix playstation sound emulator.
*
* Filename: upse.h
* Purpose: libupse development header
*
* Copyright (c) 2007 William Pitcock <[email protected]>
*
* UPSE is free software, released under the GNU General Public License,
* version 2.
*
* A copy of the GNU General Public License, version 2, is included in
* the UPSE source kit as COPYING.
*
* UPSE is offered without any warranty of any kind, explicit or implicit.
*/
#ifndef __UPSE_LIBUPSE_UPSE_H_GUARD
#define __UPSE_LIBUPSE_UPSE_H_GUARD
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdlib.h>
#else
#include <unistd.h>
#endif
#include "upse-types.h"
#include "upse-container-xsf.h"
typedef struct
{
u16 rate;
u32 length;
u32 stop;
u32 fade;
u32 volume;
char *title;
char *artist;
char *game;
char *year;
char *genre;
char *psfby;
char *comment;
char *copyright;
upse_xsf_t *xsf;
} upse_psf_t;
typedef struct
{
void *(*open_impl) (const char *path, const char *mode);
size_t(*read_impl) (void *ptr, size_t size, size_t nmemb, void *file);
int (*seek_impl) (void *file, long offset, int whence);
int (*close_impl) (void *file);
long (*tell_impl) (void *file);
} upse_iofuncs_t;
upse_psf_t *upse_get_psf_metadata(const char *path, const upse_iofuncs_t * iofuncs);
void upse_free_psf_metadata(upse_psf_t * info);
typedef void (*upse_audio_callback_func_t) (unsigned char *, long, const void *);
/*
* Set the interpolation mode.
*
* 1: interpolation (like a real PSX/PS2)
* 0: interpolation only on reverb
* (PeOPS/Neill Corlett's model says interpolation always but doesn't do it)
*/
void upse_set_interpolation_mode(u32 setting);
/*
* Set a custom interpolation coefficient.
* Implies that interpolation_mode is non-zero.
*/
void upse_set_interpolation_coefficient(double setting);
/*
* Enable or disable reverb.
*/
void upse_set_reverb_mode(u32 setting);
/*
* Enable or disable non-downsampled reverb. [EXPERIMENTAL]
*/
void upse_set_reverb_no_downsample(u32 setting);
/*
* Custom BIOS stuff.
*/
int upse_has_custom_bios(void);
const char *upse_get_custom_bios(void);
void upse_set_custom_bios(const char *bios);
/*
* Utility functions.
*/
float upse_strtof(const char *value);
#include "upse-eventloop.h"
#include "upse-module.h"
#endif