diff options
Diffstat (limited to 'test/FakeDecoderAPI.cxx')
-rw-r--r-- | test/FakeDecoderAPI.cxx | 41 |
1 files changed, 29 insertions, 12 deletions
diff --git a/test/FakeDecoderAPI.cxx b/test/FakeDecoderAPI.cxx index ca09ca982..552854ed6 100644 --- a/test/FakeDecoderAPI.cxx +++ b/test/FakeDecoderAPI.cxx @@ -1,5 +1,5 @@ /* - * Copyright (C) 2003-2012 The Music Player Daemon Project + * Copyright (C) 2003-2014 The Music Player Daemon Project * http://www.musicpd.org * * This program is free software; you can redistribute it and/or modify @@ -18,21 +18,30 @@ */ #include "config.h" -#include "DecoderAPI.hxx" -#include "InputStream.hxx" +#include "FakeDecoderAPI.hxx" +#include "decoder/DecoderAPI.hxx" +#include "input/InputStream.hxx" #include "util/Error.hxx" #include "Compiler.h" -#include <glib.h> - #include <unistd.h> void -decoder_initialized(gcc_unused Decoder &decoder, - gcc_unused const AudioFormat audio_format, +decoder_initialized(Decoder &decoder, + const AudioFormat audio_format, gcc_unused bool seekable, - gcc_unused float total_time) + float duration) { + struct audio_format_string af_string; + + assert(!decoder.initialized); + assert(audio_format.IsValid()); + + fprintf(stderr, "audio_format=%s duration=%f\n", + audio_format_to_string(audio_format, &af_string), + duration); + + decoder.initialized = true; } DecoderCommand @@ -57,6 +66,12 @@ decoder_seek_error(gcc_unused Decoder &decoder) { } +InputStream * +decoder_open_uri(Decoder &decoder, const char *uri, Error &error) +{ + return InputStream::OpenReady(uri, decoder.mutex, decoder.cond, error); +} + size_t decoder_read(gcc_unused Decoder *decoder, InputStream &is, @@ -129,16 +144,18 @@ decoder_replay_gain(gcc_unused Decoder &decoder, { const ReplayGainTuple *tuple = &rgi->tuples[REPLAY_GAIN_ALBUM]; if (tuple->IsDefined()) - g_printerr("replay_gain[album]: gain=%f peak=%f\n", - tuple->gain, tuple->peak); + fprintf(stderr, "replay_gain[album]: gain=%f peak=%f\n", + tuple->gain, tuple->peak); tuple = &rgi->tuples[REPLAY_GAIN_TRACK]; if (tuple->IsDefined()) - g_printerr("replay_gain[track]: gain=%f peak=%f\n", - tuple->gain, tuple->peak); + fprintf(stderr, "replay_gain[track]: gain=%f peak=%f\n", + tuple->gain, tuple->peak); } void decoder_mixramp(gcc_unused Decoder &decoder, gcc_unused MixRampInfo &&mix_ramp) { + fprintf(stderr, "MixRamp: start='%s' end='%s'\n", + mix_ramp.GetStart(), mix_ramp.GetEnd()); } |