diff options
author | Max Kellermann <max@duempel.org> | 2010-01-04 20:43:19 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2010-01-04 21:02:36 +0100 |
commit | 1330274ffc6f80d5dd768902b09849cf32f329d2 (patch) | |
tree | c0cb2e00efec3239e1976a212f6fbdeb62fe5b04 /src/replay_gain_info.c | |
parent | 0e183d3fa1f216729725127d868d66268e1a35d4 (diff) | |
download | mpd-1330274ffc6f80d5dd768902b09849cf32f329d2.tar.gz mpd-1330274ffc6f80d5dd768902b09849cf32f329d2.tar.xz mpd-1330274ffc6f80d5dd768902b09849cf32f329d2.zip |
replay_gain: moved code to replay_gain_info.c
Diffstat (limited to '')
-rw-r--r-- | src/replay_gain_info.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/replay_gain_info.c b/src/replay_gain_info.c new file mode 100644 index 000000000..676394c0f --- /dev/null +++ b/src/replay_gain_info.c @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2003-2010 The Music Player Daemon Project + * 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. + */ + +#include "config.h" +#include "replay_gain_info.h" + +#include <glib.h> + +struct replay_gain_info * +replay_gain_info_new(void) +{ + struct replay_gain_info *ret = g_new(struct replay_gain_info, 1); + + for (unsigned i = 0; i < G_N_ELEMENTS(ret->tuples); ++i) { + ret->tuples[i].gain = 0.0; + ret->tuples[i].peak = 0.0; + } + + return ret; +} + +struct replay_gain_info * +replay_gain_info_dup(const struct replay_gain_info *src) +{ + return g_memdup(src, sizeof(*src)); +} + +void +replay_gain_info_free(struct replay_gain_info *info) +{ + g_free(info); +} |