2018-11-03 19:26:50 +01:00
|
|
|
/*
|
|
|
|
* plugins.h - helper for plugins
|
|
|
|
*/
|
|
|
|
#ifndef _PLUGINS_H_
|
|
|
|
#define _PLUGINS_H_
|
|
|
|
|
|
|
|
#include "streamfile.h"
|
|
|
|
|
2019-03-09 20:50:58 +01:00
|
|
|
|
|
|
|
#if 0
|
|
|
|
/* ****************************************** */
|
|
|
|
/* PLAYER: simplifies plugin code */
|
|
|
|
/* ****************************************** */
|
|
|
|
|
|
|
|
/* opaque player state */
|
|
|
|
typedef struct VGMSTREAM_PLAYER VGMSTREAM_PLAYER;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
//...
|
|
|
|
} VGMSTREAM_PLAYER_INFO;
|
|
|
|
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_init(...);
|
|
|
|
|
2019-03-11 14:49:29 +01:00
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_format_check(...);
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_set_format_whilelist(...);
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_set_format_blacklist(...);
|
2019-03-09 20:50:58 +01:00
|
|
|
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_set_file(...);
|
|
|
|
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_get_config(...);
|
|
|
|
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_set_config(...);
|
|
|
|
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_get_buffer(...);
|
|
|
|
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_get_info(...);
|
|
|
|
|
2019-03-11 14:49:29 +01:00
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_describe(...);
|
|
|
|
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_get_title(...);
|
|
|
|
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_get_tagfile(...);
|
|
|
|
|
2019-03-09 20:50:58 +01:00
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_play(...);
|
|
|
|
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_seek(...);
|
|
|
|
|
|
|
|
VGMSTREAM_PLAYER* vgmstream_player_close(...);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ****************************************** */
|
|
|
|
/* TAGS: loads key=val tags from a file */
|
|
|
|
/* ****************************************** */
|
|
|
|
|
2019-03-04 22:50:05 +01:00
|
|
|
/* opaque tag state */
|
|
|
|
typedef struct VGMSTREAM_TAGS VGMSTREAM_TAGS;
|
2018-11-03 19:26:50 +01:00
|
|
|
|
2019-03-04 22:50:05 +01:00
|
|
|
/* Initializes TAGS and returns pointers to extracted strings (always valid but change
|
|
|
|
* on every vgmstream_tags_next_tag call). Next functions are safe to call even if this fails (validate NULL).
|
|
|
|
* ex.: const char *tag_key, *tag_val; tags=vgmstream_tags_init(&tag_key, &tag_val); */
|
|
|
|
VGMSTREAM_TAGS* vgmstream_tags_init(const char* *tag_key, const char* *tag_val);
|
2018-11-03 19:26:50 +01:00
|
|
|
|
2019-03-04 22:50:05 +01:00
|
|
|
/* Resets tagfile to restart reading from the beginning for a new filename.
|
|
|
|
* Must be called first before extracting tags. */
|
|
|
|
void vgmstream_tags_reset(VGMSTREAM_TAGS* tags, const char* target_filename);
|
2018-11-03 19:26:50 +01:00
|
|
|
|
|
|
|
|
|
|
|
/* Extracts next valid tag in tagfile to *tag. Returns 0 if no more tags are found (meant to be
|
2018-11-17 17:54:42 +01:00
|
|
|
* called repeatedly until 0). Key/values are trimmed and values can be in UTF-8. */
|
2019-03-04 22:50:05 +01:00
|
|
|
int vgmstream_tags_next_tag(VGMSTREAM_TAGS* tags, STREAMFILE* tagfile);
|
|
|
|
|
|
|
|
/* Closes tag file */
|
|
|
|
void vgmstream_tags_close(VGMSTREAM_TAGS* tags);
|
2018-11-03 19:26:50 +01:00
|
|
|
|
2019-03-09 20:50:58 +01:00
|
|
|
|
2019-03-04 22:50:05 +01:00
|
|
|
#ifdef VGMSTREAM_MIXING
|
2019-03-09 20:50:58 +01:00
|
|
|
/* ****************************************** */
|
|
|
|
/* MIXING: modifies vgmstream output */
|
|
|
|
/* ****************************************** */
|
|
|
|
|
2019-03-04 22:50:05 +01:00
|
|
|
/* Enables mixing effects, with max outbuf samples as a hint. Once active, plugin
|
2019-03-09 20:50:58 +01:00
|
|
|
* must use returned input_channels to create outbuf and output_channels to output audio.
|
|
|
|
* Needs to be enabled last after adding effects. */
|
|
|
|
void vgmstream_mixing_enable(VGMSTREAM* vgmstream, int32_t max_sample_count, int *input_channels, int *output_channels);
|
|
|
|
|
|
|
|
/* sets a fadeout */
|
|
|
|
//void vgmstream_mixing_fadeout(VGMSTREAM *vgmstream, float start_second, float duration_seconds);
|
|
|
|
|
|
|
|
/* sets downmixing if needed */
|
|
|
|
//void vgmstream_mixing_downmix(VGMSTREAM *vgmstream, int max_channels)
|
2019-03-04 22:50:05 +01:00
|
|
|
#endif
|
2018-11-03 19:26:50 +01:00
|
|
|
|
|
|
|
#endif /* _PLUGINS_H_ */
|