2017-09-17 01:24:57 -03:00
|
|
|
//
|
|
|
|
// VGMInterface.h
|
|
|
|
// VGMStream
|
|
|
|
//
|
|
|
|
// Created by Christopher Snowhill on 9/1/17.
|
|
|
|
// Copyright 2017 __LoSnoCo__. All rights reserved.
|
|
|
|
//
|
|
|
|
|
2018-06-28 06:59:59 -04:00
|
|
|
#import <libvgmstream/vgmstream.h>
|
2022-02-07 02:49:27 -03:00
|
|
|
|
2023-06-01 01:31:44 -04:00
|
|
|
#import <libvgmstream/api.h>
|
2017-09-17 01:24:57 -03:00
|
|
|
|
2022-01-07 03:12:34 -03:00
|
|
|
/* a STREAMFILE that operates via standard IO using a buffer */
|
2017-09-17 01:24:57 -03:00
|
|
|
typedef struct _COGSTREAMFILE {
|
2022-02-07 02:49:27 -03:00
|
|
|
STREAMFILE vt; /* callbacks */
|
|
|
|
|
|
|
|
void* infile; /* CogSource, retained */
|
|
|
|
char* name; /* FILE filename */
|
|
|
|
int name_len; /* cache */
|
|
|
|
|
|
|
|
char* archname; /* archive name */
|
|
|
|
int archname_len; /* cache */
|
|
|
|
int archpath_end; /* where the last / ends before archive name */
|
|
|
|
int archfile_end; /* where the last | ends before file name */
|
|
|
|
|
|
|
|
offv_t offset; /* last read offset (info) */
|
|
|
|
offv_t buf_offset; /* current buffer data start */
|
|
|
|
uint8_t* buf; /* data buffer */
|
|
|
|
size_t buf_size; /* max buffer size */
|
|
|
|
size_t valid_size; /* current buffer size */
|
|
|
|
size_t file_size; /* buffered file size */
|
2017-09-17 01:24:57 -03:00
|
|
|
} COGSTREAMFILE;
|
|
|
|
|
2022-01-07 03:12:34 -03:00
|
|
|
STREAMFILE* open_cog_streamfile_from_url(NSURL* url);
|
|
|
|
STREAMFILE* open_cog_streamfile(const char* filename);
|
2019-11-24 01:36:57 -03:00
|
|
|
|
2022-02-07 02:49:27 -03:00
|
|
|
VGMSTREAM* init_vgmstream_from_cogfile(const char* path, int subsong);
|
2021-09-06 13:28:26 -03:00
|
|
|
|
|
|
|
void register_log_callback();
|