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:
Max Kellermann
2016-11-18 07:13:35 +01:00
parent 595d1942cb
commit fd77acc217
46 changed files with 460 additions and 407 deletions

View File

@@ -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();