00001 /* 00002 * Copyright (C) 2003-2009 The Music Player Daemon Project 00003 * http://www.musicpd.org 00004 * 00005 * This program is free software; you can redistribute it and/or modify 00006 * it under the terms of the GNU General Public License as published by 00007 * the Free Software Foundation; either version 2 of the License, or 00008 * (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License along 00016 * with this program; if not, write to the Free Software Foundation, Inc., 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 */ 00019 /* 00020 * (c)2004 replayGain code by AliasMrJones 00021 */ 00022 00023 #ifndef MPD_REPLAY_GAIN_H 00024 #define MPD_REPLAY_GAIN_H 00025 00026 enum replay_gain_mode { 00027 REPLAY_GAIN_OFF = -1, 00028 REPLAY_GAIN_ALBUM, 00029 REPLAY_GAIN_TRACK, 00030 }; 00031 00032 struct audio_format; 00033 00034 extern enum replay_gain_mode replay_gain_mode; 00035 00036 struct replay_gain_tuple { 00037 float gain; 00038 float peak; 00039 }; 00040 00041 struct replay_gain_info { 00042 struct replay_gain_tuple tuples[2]; 00043 00044 /* used internally by mpd, to mess with it */ 00045 float scale; 00046 }; 00047 00048 struct replay_gain_info * 00049 replay_gain_info_new(void); 00050 00051 void replay_gain_info_free(struct replay_gain_info *info); 00052 00053 void replay_gain_global_init(void); 00054 00055 void 00056 replay_gain_apply(struct replay_gain_info *info, char *buffer, int bufferSize, 00057 const struct audio_format *format); 00058 00059 #endif