File: replay_gain.h

package info (click to toggle)
libmpdclient 2.24-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 956 kB
  • sloc: ansic: 10,710; makefile: 9
file content (137 lines) | stat: -rw-r--r-- 3,246 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
// SPDX-License-Identifier: BSD-3-Clause
// Copyright The Music Player Daemon Project

/*! \file
 * \brief MPD client library
 *
 * Do not include this header directly.  Use mpd/client.h instead.
 */

#ifndef MPD_REPLAY_GAIN_H
#define MPD_REPLAY_GAIN_H

#include "compiler.h"

#include <stdbool.h>

struct mpd_connection;

/**
 * MPD's replay gain mode.
 *
 * @since libmpdclient 2.19, MPD 0.16.
 */
enum mpd_replay_gain_mode {
	/** ignore ReplayGain tag values */
	MPD_REPLAY_OFF = 0,

	/** use per-track ReplayGain values */
	MPD_REPLAY_TRACK,

	/** use per-album ReplayGain values */
	MPD_REPLAY_ALBUM,

	/**
	 * use available ReplayGain value; if both track and album tags are
	 * available, prefer track values.
	 **/
	MPD_REPLAY_AUTO,

	/** Unknown mode */
	MPD_REPLAY_UNKNOWN,
};

#ifdef __cplusplus
extern "C" {
#endif

/**
 * Parse a #mpd_pair value to check which replay gain mode it contains.
 */
mpd_pure
enum mpd_replay_gain_mode
mpd_parse_replay_gain_name(const char *name);

/**
 * Looks up the name of the specified replay gain mode.
 *
 * @return the name, or NULL if the replay gain mode is not valid
 *
 * @since libmpdclient 2.19.
 */
mpd_pure
const char *
mpd_lookup_replay_gain_mode(enum mpd_replay_gain_mode mode);

/**
 * Queries the current state of replay gain mode on MPD.
 *
 * Sends the "replay_gain_status" command to MPD.
 * Call mpd_recv_replay_gain_status() to read the response.
 *
 * @param connection the connection to MPD
 * @return true on success, false on error
 *
 * @since MPD 0.16, libmpdclient 2.19.
 */
bool
mpd_send_replay_gain_status(struct mpd_connection *connection);

/**
 * Receives the current state of replay gain mode on MPD.
 * Shortcut for mpd_recv_pair_named() and mpd_parse_replay_gain_name() ad
 * mpd_return_pair().
 *
 * @param connection the connection to MPD
 * @return #mpd_replay_gain_mode object: #MPD_REPLAY_UNKNOWN on error (or
 * unknown ReplayGain mode); other modes on success.
 *
 * @since MPD 0.16, libmpdclient 2.21.
 */
enum mpd_replay_gain_mode
mpd_recv_replay_gain_status(struct mpd_connection *connection);

/**
 * Shortcut for mpd_send_replay_gain_status(), mpd_recv_replay_gain_status() and
 * mpd_response_finish().
 *
 * @param connection the connection to MPD
 * @return #mpd_replay_gain_mode object: #MPD_REPLAY_UNKNOWN on error (or
 * unknown ReplayGain mode); other modes on success.
 *
 * @since MPD 0.16, libmpdclient 2.19.
 */
enum mpd_replay_gain_mode
mpd_run_replay_gain_status(struct mpd_connection *connection);

/**
 * Sets the current state of replay gain mode on MPD.
 *
 * @param connection the connection to MPD
 * @param mode the desired replay gain mode
 * @return true on success, false on error
 *
 * @since MPD 0.16, libmpdclient 2.19.
 */
bool
mpd_send_replay_gain_mode(struct mpd_connection *connection,
			  enum mpd_replay_gain_mode mode);

/**
 * Shortcut for mpd_send_replay_gain_mode() and mpd_response_finish().
 *
 * @param connection the connection to MPD
 * @param mode mode the desired replay gain mode
 * @return true on success, false on error
 *
 * @since MPD 0.16, libmpdclient 2.19.
 */
bool
mpd_run_replay_gain_mode(struct mpd_connection *connection,
			 enum mpd_replay_gain_mode mode);

#ifdef __cplusplus
}
#endif

#endif