2017-12-11 02:30:00 +01:00
|
|
|
/*
|
|
|
|
2017-12-10: Preliminary MOGG Support. As long as the stream is unencrypted, this should be fine.
|
2018-03-23 16:34:48 +01:00
|
|
|
This will also work on unconventional 5 channel Vorbis streams but some sound cards might not like it.
|
|
|
|
TODO (Eventually): Add decryption for encrypted MOGG types (Rock Band, etc.)
|
2017-12-11 02:30:00 +01:00
|
|
|
|
2018-03-23 16:34:48 +01:00
|
|
|
-bxaimc
|
2017-12-11 02:30:00 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "meta.h"
|
|
|
|
#include "../coding/coding.h"
|
|
|
|
|
|
|
|
/* MOGG - Harmonix Music Systems (Guitar Hero)[Unencrypted Type] */
|
|
|
|
VGMSTREAM * init_vgmstream_mogg(STREAMFILE *streamFile) {
|
|
|
|
#ifdef VGM_USE_VORBIS
|
2018-03-23 16:34:48 +01:00
|
|
|
off_t start_offset;
|
2017-12-11 02:30:00 +01:00
|
|
|
|
2018-03-23 16:34:48 +01:00
|
|
|
/* checks */
|
|
|
|
if (!check_extensions(streamFile, "mogg"))
|
|
|
|
goto fail;
|
2017-12-11 02:30:00 +01:00
|
|
|
|
2018-03-23 16:34:48 +01:00
|
|
|
{
|
|
|
|
ogg_vorbis_meta_info_t ovmi = {0};
|
|
|
|
VGMSTREAM * result = NULL;
|
2017-12-11 02:30:00 +01:00
|
|
|
|
2018-03-23 16:34:48 +01:00
|
|
|
ovmi.meta_type = meta_MOGG;
|
2017-12-11 02:30:00 +01:00
|
|
|
|
2018-03-23 16:34:48 +01:00
|
|
|
start_offset = read_32bitLE(0x04, streamFile);
|
|
|
|
result = init_vgmstream_ogg_vorbis_callbacks(streamFile, NULL, start_offset, &ovmi);
|
2017-12-11 02:30:00 +01:00
|
|
|
|
2018-03-23 16:34:48 +01:00
|
|
|
if (result != NULL) {
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|
2017-12-11 02:30:00 +01:00
|
|
|
|
|
|
|
fail:
|
2018-03-23 16:34:48 +01:00
|
|
|
/* clean up anything we may have opened */
|
2017-12-11 02:30:00 +01:00
|
|
|
#endif
|
2018-03-23 16:34:48 +01:00
|
|
|
return NULL;
|
|
|
|
}
|