Mercurial > repos > blastem
annotate mediaplayer.h @ 2354:a773b8f09292
Remove old refresh hack that is causing VDPFifoTesting to have a failed test
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 19 Oct 2023 23:27:57 -0700 |
parents | 789802d99629 |
children | 97f164d1f0f6 |
rev | line source |
---|---|
2289
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
1 #ifndef MEDIAPLAYER_H_ |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
2 #define MEDIAPLAYER_H_ |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
3 |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
4 #include <stdint.h> |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
5 #include "system.h" |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
6 #include "vgm.h" |
2290
c4980d89614b
Support WAVE files in media player
Michael Pavone <pavone@retrodev.com>
parents:
2289
diff
changeset
|
7 #include "wave.h" |
2296
789802d99629
Add basic FLAC decoder and add FLAC playback support to the media player
Michael Pavone <pavone@retrodev.com>
parents:
2290
diff
changeset
|
8 #include "flac.h" |
2290
c4980d89614b
Support WAVE files in media player
Michael Pavone <pavone@retrodev.com>
parents:
2289
diff
changeset
|
9 #include "render_audio.h" |
2289
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
10 |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
11 typedef struct chip_info chip_info; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
12 typedef void (*chip_run_fun)(void *context, uint32_t cycle); |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
13 typedef void (*chip_adjust_fun)(chip_info *chip); |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
14 struct chip_info { |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
15 void *context; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
16 chip_run_fun run; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
17 chip_adjust_fun adjust; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
18 data_block *blocks; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
19 uint32_t clock; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
20 uint32_t samples; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
21 uint8_t cmd; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
22 uint8_t data_type; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
23 }; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
24 |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
25 typedef struct { |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
26 system_header header; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
27 system_media *media; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
28 vgm_header *vgm; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
29 vgm_extended_header *vgm_ext; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
30 data_block *ym_seek_block; |
2290
c4980d89614b
Support WAVE files in media player
Michael Pavone <pavone@retrodev.com>
parents:
2289
diff
changeset
|
31 wave_header *wave; |
2296
789802d99629
Add basic FLAC decoder and add FLAC playback support to the media player
Michael Pavone <pavone@retrodev.com>
parents:
2290
diff
changeset
|
32 flac_file *flac; |
2290
c4980d89614b
Support WAVE files in media player
Michael Pavone <pavone@retrodev.com>
parents:
2289
diff
changeset
|
33 audio_source *audio; |
2289
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
34 chip_info *chips; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
35 uint32_t num_chips; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
36 uint32_t current_offset; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
37 uint32_t playback_time; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
38 uint32_t wait_samples; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
39 uint32_t ym_seek_offset; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
40 uint32_t ym_block_offset; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
41 uint8_t state; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
42 uint8_t media_type; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
43 uint8_t should_return; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
44 } media_player; |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
45 |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
46 media_player *alloc_media_player(system_media *media, uint32_t opts); |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
47 |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
48 |
92449b47cce8
Integrate VGM player into main blastem binary
Michael Pavone <pavone@retrodev.com>
parents:
diff
changeset
|
49 #endif //MEDIAPLAYER_H_ |