decoder/Client: new interface which wraps struct Decoder
Prepare for a Decoder API redesign based on an abstract class with virtual methods.
This commit is contained in:
@@ -147,7 +147,7 @@ mikmod_decoder_finish(void)
|
||||
}
|
||||
|
||||
static void
|
||||
mikmod_decoder_file_decode(Decoder &decoder, Path path_fs)
|
||||
mikmod_decoder_file_decode(DecoderClient &client, Path path_fs)
|
||||
{
|
||||
/* deconstify the path because libmikmod wants a non-const
|
||||
string pointer */
|
||||
@@ -170,7 +170,7 @@ mikmod_decoder_file_decode(Decoder &decoder, Path path_fs)
|
||||
const AudioFormat audio_format(mikmod_sample_rate, SampleFormat::S16, 2);
|
||||
assert(audio_format.IsValid());
|
||||
|
||||
decoder_initialized(decoder, audio_format, false,
|
||||
decoder_initialized(client, audio_format, false,
|
||||
SignedSongTime::Negative());
|
||||
|
||||
Player_Start(handle);
|
||||
@@ -178,7 +178,7 @@ mikmod_decoder_file_decode(Decoder &decoder, Path path_fs)
|
||||
DecoderCommand cmd = DecoderCommand::NONE;
|
||||
while (cmd == DecoderCommand::NONE && Player_Active()) {
|
||||
ret = VC_WriteBytes(buffer, sizeof(buffer));
|
||||
cmd = decoder_data(decoder, nullptr, buffer, ret, 0);
|
||||
cmd = decoder_data(client, nullptr, buffer, ret, 0);
|
||||
}
|
||||
|
||||
Player_Stop();
|
||||
|
||||
Reference in New Issue
Block a user