2014-05-22 11:24:40 +02:00
|
|
|
/*
|
2016-02-26 17:54:05 +01:00
|
|
|
* Copyright 2003-2016 The Music Player Daemon Project
|
2014-05-22 11:24:40 +02:00
|
|
|
* http://www.musicpd.org
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef FAKE_DECODER_API_HXX
|
|
|
|
#define FAKE_DECODER_API_HXX
|
|
|
|
|
|
|
|
#include "check.h"
|
2016-11-18 07:13:35 +01:00
|
|
|
#include "decoder/Client.hxx"
|
2014-05-22 11:10:41 +02:00
|
|
|
#include "thread/Mutex.hxx"
|
|
|
|
#include "thread/Cond.hxx"
|
2014-05-22 11:24:40 +02:00
|
|
|
|
2016-11-18 07:13:35 +01:00
|
|
|
struct FakeDecoder final : DecoderClient {
|
2014-05-22 11:10:41 +02:00
|
|
|
Mutex mutex;
|
|
|
|
Cond cond;
|
|
|
|
|
2016-11-18 07:13:35 +01:00
|
|
|
bool initialized = false;
|
2016-11-18 07:59:01 +01:00
|
|
|
|
|
|
|
/* virtual methods from DecoderClient */
|
|
|
|
void Ready(AudioFormat audio_format,
|
|
|
|
bool seekable, SignedSongTime duration) override;
|
2016-11-18 08:15:07 +01:00
|
|
|
DecoderCommand GetCommand() override;
|
|
|
|
void CommandFinished() override;
|
|
|
|
SongTime GetSeekTime() override;
|
|
|
|
uint64_t GetSeekFrame() override;
|
|
|
|
void SeekError() override;
|
2016-11-18 12:34:04 +01:00
|
|
|
InputStreamPtr OpenUri(const char *uri) override;
|
2016-11-17 22:21:36 +01:00
|
|
|
size_t Read(InputStream &is, void *buffer, size_t length) override;
|
2016-11-18 08:27:30 +01:00
|
|
|
void SubmitTimestamp(double t) override;
|
|
|
|
DecoderCommand SubmitData(InputStream *is,
|
|
|
|
const void *data, size_t length,
|
|
|
|
uint16_t kbit_rate) override;
|
|
|
|
DecoderCommand SubmitTag(InputStream *is, Tag &&tag) override ;
|
|
|
|
void SubmitReplayGain(const ReplayGainInfo *replay_gain_info) override;
|
|
|
|
void SubmitMixRamp(MixRampInfo &&mix_ramp) override;
|
2014-05-22 11:24:40 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|