Commit e12cc01a authored by Max Kellermann's avatar Max Kellermann

decoder_*: convert to C++

parent 71c69728
......@@ -70,13 +70,11 @@ mpd_headers = \
src/idle.h \
src/conf.h \
src/crossfade.h \
src/decoder_control.h \
src/decoder_plugin.h \
src/decoder_command.h \
src/decoder_buffer.h \
src/decoder_api.h \
src/decoder_plugin.h \
src/decoder_internal.h \
src/encoder_plugin.h \
src/encoder_list.h \
src/encoder_api.h \
......@@ -207,9 +205,9 @@ src_mpd_SOURCES = \
src/cue/cue_parser.c src/cue/cue_parser.h \
src/decoder_error.h \
src/DecoderThread.cxx src/DecoderThread.hxx \
src/decoder_control.c \
src/decoder_api.c \
src/decoder_internal.c \
src/DecoderControl.cxx src/DecoderControl.hxx \
src/DecoderAPI.cxx \
src/DecoderInternal.cxx src/DecoderInternal.hxx \
src/DecoderPrint.cxx src/DecoderPrint.hxx \
src/Directory.cxx src/Directory.hxx \
src/DirectorySave.cxx src/DirectorySave.hxx \
......@@ -274,7 +272,7 @@ src_mpd_SOURCES = \
src/page.c \
src/Permission.cxx src/Permission.hxx \
src/PlayerThread.cxx src/PlayerThread.hxx \
src/player_control.c \
src/PlayerControl.cxx \
src/playlist.c \
src/playlist_global.c \
src/playlist_control.c \
......
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
......@@ -18,15 +18,19 @@
*/
#include "config.h"
extern "C" {
#include "decoder_api.h"
#include "decoder_internal.h"
#include "decoder_control.h"
#include "audio_config.h"
#include "song.h"
#include "buffer.h"
#include "pipe.h"
#include "chunk.h"
#include "replay_gain_config.h"
}
#include "DecoderControl.hxx"
#include "DecoderInternal.hxx"
#include "song.h"
#include <glib.h>
......@@ -362,11 +366,10 @@ update_stream_tag(struct decoder *decoder, struct input_stream *is)
enum decoder_command
decoder_data(struct decoder *decoder,
struct input_stream *is,
const void *_data, size_t length,
const void *data, size_t length,
uint16_t kbit_rate)
{
struct decoder_control *dc = decoder->dc;
const char *data = _data;
GError *error = NULL;
enum decoder_command cmd;
......@@ -417,7 +420,6 @@ decoder_data(struct decoder *decoder,
while (length > 0) {
struct music_chunk *chunk;
char *dest;
size_t nbytes;
bool full;
......@@ -427,10 +429,10 @@ decoder_data(struct decoder *decoder,
return dc->command;
}
dest = music_chunk_write(chunk, &dc->out_audio_format,
decoder->timestamp -
dc->song->start_ms / 1000.0,
kbit_rate, &nbytes);
void *dest = music_chunk_write(chunk, &dc->out_audio_format,
decoder->timestamp -
dc->song->start_ms / 1000.0,
kbit_rate, &nbytes);
if (dest == NULL) {
/* the chunk is full, flush it */
decoder_flush_chunk(decoder);
......@@ -456,7 +458,7 @@ decoder_data(struct decoder *decoder,
g_cond_signal(dc->client_cond);
}
data += nbytes;
data = (const uint8_t *)data + nbytes;
length -= nbytes;
decoder->timestamp += (double)nbytes /
......
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
......@@ -18,10 +18,13 @@
*/
#include "config.h"
#include "decoder_control.h"
#include "pipe.h"
#include "DecoderControl.hxx"
#include "song.h"
extern "C" {
#include "pipe.h"
}
#include <assert.h>
#undef G_LOG_DOMAIN
......
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
......@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_DECODER_CONTROL_H
#define MPD_DECODER_CONTROL_H
#ifndef MPD_DECODER_CONTROL_HXX
#define MPD_DECODER_CONTROL_HXX
#include "decoder_command.h"
#include "audio_format.h"
......
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
......@@ -18,11 +18,15 @@
*/
#include "config.h"
#include "decoder_internal.h"
#include "decoder_control.h"
#include "DecoderInternal.hxx"
#include "DecoderControl.hxx"
extern "C" {
#include "pipe.h"
#include "input_stream.h"
#include "buffer.h"
}
#include "input_stream.h"
#include "chunk.h"
#include <assert.h>
......
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
......@@ -17,8 +17,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef MPD_DECODER_INTERNAL_H
#define MPD_DECODER_INTERNAL_H
#ifndef MPD_DECODER_INTERNAL_HXX
#define MPD_DECODER_INTERNAL_HXX
#include "decoder_command.h"
#include "pcm_convert.h"
......
......@@ -19,6 +19,8 @@
#include "config.h"
#include "DecoderThread.hxx"
#include "DecoderControl.hxx"
#include "DecoderInternal.hxx"
#include "decoder_error.h"
#include "decoder_plugin.h"
#include "song.h"
......@@ -26,8 +28,6 @@
#include "Mapper.hxx"
extern "C" {
#include "decoder_control.h"
#include "decoder_internal.h"
#include "decoder_list.h"
#include "decoder_api.h"
#include "replay_gain_ape.h"
......
/*
* Copyright (C) 2003-2011 The Music Player Daemon Project
* Copyright (C) 2003-2013 The Music Player Daemon Project
* http://www.musicpd.org
*
* This program is free software; you can redistribute it and/or modify
......@@ -18,14 +18,14 @@
*/
#include "config.h"
extern "C" {
#include "player_control.h"
#include "decoder_control.h"
#include "path.h"
#include "log.h"
#include "tag.h"
#include "song.h"
#include "idle.h"
#include "pcm_volume.h"
}
#include "song.h"
#include "DecoderControl.hxx"
#include "Main.hxx"
#include <assert.h>
......
......@@ -20,13 +20,13 @@
#include "config.h"
#include "PlayerThread.hxx"
#include "DecoderThread.hxx"
#include "DecoderControl.hxx"
#include "song.h"
#include "Main.hxx"
#include "mpd_error.h"
extern "C" {
#include "player_control.h"
#include "decoder_control.h"
#include "output_all.h"
#include "event_pipe.h"
#include "crossfade.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment