This commit is contained in:
bnnm 2019-10-20 23:51:06 +02:00
parent cf618362ff
commit 6e7977772d
4 changed files with 18 additions and 7 deletions

View File

@ -283,13 +283,13 @@ static void apply_config(VGMSTREAM * vgmstream, cli_config *cfg) {
/* honor suggested config, if any (defined order matters)
* note that ignore_fade and play_forever should take priority */
if (vgmstream->config_loop_count) {
if (vgmstream->config_loop_count > 0.0) {
cfg->loop_count = vgmstream->config_loop_count;
}
if (vgmstream->config_fade_delay) {
if (vgmstream->config_fade_delay > 0.0) {
cfg->fade_delay = vgmstream->config_fade_delay;
}
if (vgmstream->config_fade_time) {
if (vgmstream->config_fade_time > 0.0) {
cfg->fade_time = vgmstream->config_fade_time;
}
if (vgmstream->config_force_loop) {

View File

@ -49,7 +49,7 @@ The following can be used in place of `(value)` for `(key) = (value)` commands.
* `$1|2|3|4`: value has size of 8/16/24/32 bit (optional, defaults to 4)
* Example: `@0x10:BE$2` means `get big endian 16b value at 0x10`
- `(field)`: uses current value of some fields. Accepted strings:
- `interleave, interleave_last, channels, sample_rate, start_offset, data_size, num_samples, loop_start_sample, loop_end_sample, subsong_count, subsong_offset`
- `interleave, interleave_last, channels, sample_rate, start_offset, data_size, num_samples, loop_start_sample, loop_end_sample, subsong_count, subsong_offset, subfile_offset, subfile_size, name_valueX`
- `(other)`: other special values for certain keys, described per key

View File

@ -25,7 +25,7 @@ sounds/file#12
### Segments mode
Some games clumsily loop audio by using multiple full file "segments", so you can play separate intro + loop files together as a single track. Channel number must be equal, mixing sample rates is ok (uses first).
Some games clumsily loop audio by using multiple full file "segments", so you can play separate intro + loop files together as a single track.
**Ratchet & Clank (PS2)**: *bgm01.txtp*
```
@ -57,6 +57,8 @@ loop_start_segment = 2
loop_end_segment = 3
loop_mode = keep # loops in 2nd file's loop_start to 3rd file's loop_end
```
Mixing sample rates is ok (uses first) but channel number must be equal for all files. You can use mixing (explained later) to join segments of different channels though.
### Layers mode
Some games layer channels or dynamic parts that must play at the same time, for example main melody + vocal track.

View File

@ -7,12 +7,20 @@
#define _STREAMTYPES_H
#ifdef _MSC_VER
/* Common versions:
* - 1500: VS2008
* - 1600: VS2010
* - 1700: VS2012
* - 1800: VS2013
* - 1900: VS2015
* - 1920: VS2019 */
#if (_MSC_VER >= 1600)
#include <stdint.h>
#else
#include <pstdint.h>
#endif /* (_MSC_VER >= 1600) */
#endif
#ifndef inline /* (_MSC_VER < 1900)? */
#define inline _inline
@ -23,10 +31,11 @@
#if (_MSC_VER < 1900)
#define snprintf _snprintf
#endif /* (_MSC_VER < 1900) */
#endif
#else
#include <stdint.h>
#endif /* _MSC_VER */
typedef int16_t sample; //TODO: deprecated, remove