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

@@ -52,7 +52,7 @@ FlacDecoder::Initialize(unsigned sample_rate, unsigned bits_per_sample,
audio_format.sample_rate)
: SignedSongTime::Negative();
decoder_initialized(*GetDecoder(), audio_format,
decoder_initialized(*GetClient(), audio_format,
GetInputStream().IsSeekable(),
duration);
@@ -77,9 +77,9 @@ FlacDecoder::OnVorbisComment(const FLAC__StreamMetadata_VorbisComment &vc)
{
ReplayGainInfo rgi;
if (flac_parse_replay_gain(rgi, vc))
decoder_replay_gain(*GetDecoder(), &rgi);
decoder_replay_gain(*GetClient(), &rgi);
decoder_mixramp(*GetDecoder(), flac_parse_mixramp(vc));
decoder_mixramp(*GetClient(), flac_parse_mixramp(vc));
tag = flac_vorbis_comments_to_tag(&vc);
}
@@ -148,7 +148,7 @@ FlacDecoder::OnWrite(const FLAC__Frame &frame,
unsigned bit_rate = nbytes * 8 * frame.header.sample_rate /
(1000 * frame.header.blocksize);
auto cmd = decoder_data(*GetDecoder(), GetInputStream(),
auto cmd = decoder_data(*GetClient(), GetInputStream(),
data.data, data.size,
bit_rate);
switch (cmd) {