mixer/software, filter/volume: convert to C++
This commit is contained in:
		
							
								
								
									
										10
									
								
								Makefile.am
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								Makefile.am
									
									
									
									
									
								
							| @@ -60,7 +60,6 @@ mpd_headers = \ | |||||||
| 	src/filter_plugin.h \ | 	src/filter_plugin.h \ | ||||||
| 	src/filter_registry.h \ | 	src/filter_registry.h \ | ||||||
| 	src/filter/chain_filter_plugin.h \ | 	src/filter/chain_filter_plugin.h \ | ||||||
| 	src/filter/volume_filter_plugin.h \ |  | ||||||
| 	src/command.h \ | 	src/command.h \ | ||||||
| 	src/conf.h \ | 	src/conf.h \ | ||||||
| 	src/decoder_plugin.h \ | 	src/decoder_plugin.h \ | ||||||
| @@ -84,7 +83,6 @@ mpd_headers = \ | |||||||
| 	src/mixer_list.h \ | 	src/mixer_list.h \ | ||||||
| 	src/mixer_plugin.h \ | 	src/mixer_plugin.h \ | ||||||
| 	src/mixer_type.h \ | 	src/mixer_type.h \ | ||||||
| 	src/mixer/software_mixer_plugin.h \ |  | ||||||
| 	src/daemon.h \ | 	src/daemon.h \ | ||||||
| 	src/AudioCompress/config.h \ | 	src/AudioCompress/config.h \ | ||||||
| 	src/AudioCompress/compress.h \ | 	src/AudioCompress/compress.h \ | ||||||
| @@ -809,7 +807,8 @@ MIXER_API_SRC = \ | |||||||
| 	src/mixer_api.c | 	src/mixer_api.c | ||||||
|  |  | ||||||
| libmixer_plugins_a_SOURCES = \ | libmixer_plugins_a_SOURCES = \ | ||||||
| 	src/mixer/software_mixer_plugin.c | 	src/mixer/SoftwareMixerPlugin.cxx \ | ||||||
|  | 	src/mixer/SoftwareMixerPlugin.hxx | ||||||
| libmixer_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \ | libmixer_plugins_a_CPPFLAGS = $(AM_CPPFLAGS) \ | ||||||
| 	$(ALSA_CFLAGS) \ | 	$(ALSA_CFLAGS) \ | ||||||
| 	$(PULSE_CFLAGS) | 	$(PULSE_CFLAGS) | ||||||
| @@ -979,7 +978,8 @@ libfilter_plugins_a_SOURCES = \ | |||||||
| 	src/filter/normalize_filter_plugin.c \ | 	src/filter/normalize_filter_plugin.c \ | ||||||
| 	src/filter/ReplayGainFilterPlugin.cxx \ | 	src/filter/ReplayGainFilterPlugin.cxx \ | ||||||
| 	src/filter/ReplayGainFilterPlugin.hxx \ | 	src/filter/ReplayGainFilterPlugin.hxx \ | ||||||
| 	src/filter/volume_filter_plugin.c | 	src/filter/VolumeFilterPlugin.cxx \ | ||||||
|  | 	src/filter/VolumeFilterPlugin.hxx | ||||||
|  |  | ||||||
| FILTER_LIBS = \ | FILTER_LIBS = \ | ||||||
| 	libfilter_plugins.a \ | 	libfilter_plugins.a \ | ||||||
| @@ -1368,7 +1368,7 @@ test_read_mixer_SOURCES = test/read_mixer.cxx \ | |||||||
| 	src/tokenizer.c src/utils.c src/string_util.c \ | 	src/tokenizer.c src/utils.c src/string_util.c \ | ||||||
| 	src/mixer_control.c src/mixer_api.c \ | 	src/mixer_control.c src/mixer_api.c \ | ||||||
| 	src/filter_plugin.c \ | 	src/filter_plugin.c \ | ||||||
| 	src/filter/volume_filter_plugin.c \ | 	src/filter/VolumeFilterPlugin.cxx \ | ||||||
| 	src/fd_util.c | 	src/fd_util.c | ||||||
|  |  | ||||||
| if ENABLE_BZIP2_TEST | if ENABLE_BZIP2_TEST | ||||||
|   | |||||||
| @@ -30,12 +30,12 @@ extern "C" { | |||||||
| #include "mixer_control.h" | #include "mixer_control.h" | ||||||
| #include "mixer_type.h" | #include "mixer_type.h" | ||||||
| #include "mixer_list.h" | #include "mixer_list.h" | ||||||
| #include "mixer/software_mixer_plugin.h" |  | ||||||
| #include "filter_plugin.h" | #include "filter_plugin.h" | ||||||
| #include "filter_registry.h" | #include "filter_registry.h" | ||||||
| #include "filter/chain_filter_plugin.h" | #include "filter/chain_filter_plugin.h" | ||||||
| } | } | ||||||
|  |  | ||||||
|  | #include "mixer/SoftwareMixerPlugin.hxx" | ||||||
| #include "filter/AutoConvertFilterPlugin.hxx" | #include "filter/AutoConvertFilterPlugin.hxx" | ||||||
| #include "filter/ReplayGainFilterPlugin.hxx" | #include "filter/ReplayGainFilterPlugin.hxx" | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,5 +1,5 @@ | |||||||
| /*
 | /*
 | ||||||
|  * Copyright (C) 2003-2011 The Music Player Daemon Project |  * Copyright (C) 2003-2013 The Music Player Daemon Project | ||||||
|  * http://www.musicpd.org
 |  * http://www.musicpd.org
 | ||||||
|  * |  * | ||||||
|  * This program is free software; you can redistribute it and/or modify |  * This program is free software; you can redistribute it and/or modify | ||||||
| @@ -18,7 +18,7 @@ | |||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "config.h" | #include "config.h" | ||||||
| #include "filter/volume_filter_plugin.h" | #include "VolumeFilterPlugin.hxx" | ||||||
| #include "filter_plugin.h" | #include "filter_plugin.h" | ||||||
| #include "filter_internal.h" | #include "filter_internal.h" | ||||||
| #include "filter_registry.h" | #include "filter_registry.h" | ||||||
| @@ -113,7 +113,8 @@ volume_filter_filter(struct filter *_filter, const void *src, size_t src_size, | |||||||
| 
 | 
 | ||||||
| 	memcpy(dest, src, src_size); | 	memcpy(dest, src, src_size); | ||||||
| 
 | 
 | ||||||
| 	success = pcm_volume(dest, src_size, filter->audio_format.format, | 	success = pcm_volume(dest, src_size, | ||||||
|  | 			     sample_format(filter->audio_format.format), | ||||||
| 			     filter->volume); | 			     filter->volume); | ||||||
| 	if (!success) { | 	if (!success) { | ||||||
| 		g_set_error(error_r, volume_quark(), 0, | 		g_set_error(error_r, volume_quark(), 0, | ||||||
| @@ -125,12 +126,12 @@ volume_filter_filter(struct filter *_filter, const void *src, size_t src_size, | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const struct filter_plugin volume_filter_plugin = { | const struct filter_plugin volume_filter_plugin = { | ||||||
| 	.name = "volume", | 	"volume", | ||||||
| 	.init = volume_filter_init, | 	volume_filter_init, | ||||||
| 	.finish = volume_filter_finish, | 	volume_filter_finish, | ||||||
| 	.open = volume_filter_open, | 	volume_filter_open, | ||||||
| 	.close = volume_filter_close, | 	volume_filter_close, | ||||||
| 	.filter = volume_filter_filter, | 	volume_filter_filter, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| unsigned | unsigned | ||||||
| @@ -1,5 +1,5 @@ | |||||||
| /*
 | /*
 | ||||||
|  * Copyright (C) 2003-2011 The Music Player Daemon Project |  * Copyright (C) 2003-2013 The Music Player Daemon Project | ||||||
|  * http://www.musicpd.org
 |  * http://www.musicpd.org
 | ||||||
|  * |  * | ||||||
|  * This program is free software; you can redistribute it and/or modify |  * 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. |  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #ifndef VOLUME_FILTER_PLUGIN_H | #ifndef MPD_VOLUME_FILTER_PLUGIN_HXX | ||||||
| #define VOLUME_FILTER_PLUGIN_H | #define MPD_VOLUME_FILTER_PLUGIN_HXX | ||||||
| 
 | 
 | ||||||
| struct filter; | struct filter; | ||||||
| 
 | 
 | ||||||
| @@ -1,5 +1,5 @@ | |||||||
| /*
 | /*
 | ||||||
|  * Copyright (C) 2003-2011 The Music Player Daemon Project |  * Copyright (C) 2003-2013 The Music Player Daemon Project | ||||||
|  * http://www.musicpd.org
 |  * http://www.musicpd.org
 | ||||||
|  * |  * | ||||||
|  * This program is free software; you can redistribute it and/or modify |  * This program is free software; you can redistribute it and/or modify | ||||||
| @@ -18,11 +18,11 @@ | |||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #include "config.h" | #include "config.h" | ||||||
| #include "software_mixer_plugin.h" | #include "SoftwareMixerPlugin.hxx" | ||||||
| #include "mixer_api.h" | #include "mixer_api.h" | ||||||
| #include "filter_plugin.h" | #include "filter_plugin.h" | ||||||
| #include "filter_registry.h" | #include "filter_registry.h" | ||||||
| #include "filter/volume_filter_plugin.h" | #include "filter/VolumeFilterPlugin.hxx" | ||||||
| #include "pcm_volume.h" | #include "pcm_volume.h" | ||||||
| 
 | 
 | ||||||
| #include <assert.h> | #include <assert.h> | ||||||
| @@ -91,11 +91,13 @@ software_mixer_set_volume(struct mixer *mixer, unsigned volume, | |||||||
| } | } | ||||||
| 
 | 
 | ||||||
| const struct mixer_plugin software_mixer_plugin = { | const struct mixer_plugin software_mixer_plugin = { | ||||||
| 	.init = software_mixer_init, | 	software_mixer_init, | ||||||
| 	.finish = software_mixer_finish, | 	software_mixer_finish, | ||||||
| 	.get_volume = software_mixer_get_volume, | 	nullptr, | ||||||
| 	.set_volume = software_mixer_set_volume, | 	nullptr, | ||||||
| 	.global = true, | 	software_mixer_get_volume, | ||||||
|  | 	software_mixer_set_volume, | ||||||
|  | 	true, | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| struct filter * | struct filter * | ||||||
| @@ -1,5 +1,5 @@ | |||||||
| /*
 | /*
 | ||||||
|  * Copyright (C) 2003-2011 The Music Player Daemon Project |  * Copyright (C) 2003-2013 The Music Player Daemon Project | ||||||
|  * http://www.musicpd.org
 |  * http://www.musicpd.org
 | ||||||
|  * |  * | ||||||
|  * This program is free software; you can redistribute it and/or modify |  * 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. |  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| #ifndef SOFTWARE_MIXER_PLUGIN_H | #ifndef MPD_SOFTWARE_MIXER_PLUGIN_HXX | ||||||
| #define SOFTWARE_MIXER_PLUGIN_H | #define MPD_SOFTWARE_MIXER_PLUGIN_HXX | ||||||
| 
 | 
 | ||||||
| struct mixer; | struct mixer; | ||||||
| struct filter; | struct filter; | ||||||
		Reference in New Issue
	
	Block a user
	 Max Kellermann
					Max Kellermann