diff mediaplayer.h @ 2289:92449b47cce8

Integrate VGM player into main blastem binary
author Michael Pavone <pavone@retrodev.com>
date Sat, 04 Feb 2023 22:44:44 -0800
parents
children c4980d89614b
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mediaplayer.h	Sat Feb 04 22:44:44 2023 -0800
@@ -0,0 +1,43 @@
+#ifndef MEDIAPLAYER_H_
+#define MEDIAPLAYER_H_
+
+#include <stdint.h>
+#include "system.h"
+#include "vgm.h"
+
+typedef struct chip_info chip_info;
+typedef void (*chip_run_fun)(void *context, uint32_t cycle);
+typedef void (*chip_adjust_fun)(chip_info *chip);
+struct chip_info {
+	void            *context;
+	chip_run_fun    run;
+	chip_adjust_fun adjust;
+	data_block      *blocks;
+	uint32_t        clock;
+	uint32_t        samples;
+	uint8_t         cmd;
+	uint8_t         data_type;
+};
+
+typedef struct {
+	system_header       header;
+	system_media        *media;
+	vgm_header          *vgm;
+	vgm_extended_header *vgm_ext;
+	data_block          *ym_seek_block;
+	chip_info           *chips;
+	uint32_t            num_chips;
+	uint32_t            current_offset;
+	uint32_t            playback_time;
+	uint32_t            wait_samples;
+	uint32_t            ym_seek_offset;
+	uint32_t            ym_block_offset;
+	uint8_t             state;
+	uint8_t             media_type;
+	uint8_t             should_return;
+} media_player;
+
+media_player *alloc_media_player(system_media *media, uint32_t opts);
+
+
+#endif //MEDIAPLAYER_H_