Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
f824ecdf
Commit
f824ecdf
authored
May 18, 2010
by
Daniel Seuthe
Committed by
Max Kellermann
May 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replay_gain_config: added function replay_gain_get_real_mode()
parent
6c831e04
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
11 deletions
+21
-11
replay_gain_filter_plugin.c
src/filter/replay_gain_filter_plugin.c
+2
-11
replay_gain_config.c
src/replay_gain_config.c
+13
-0
replay_gain_config.h
src/replay_gain_config.h
+6
-0
No files found.
src/filter/replay_gain_filter_plugin.c
View file @
f824ecdf
...
...
@@ -28,7 +28,6 @@
#include "replay_gain_info.h"
#include "replay_gain_config.h"
#include "mixer_control.h"
#include "playlist.h"
#include <assert.h>
#include <string.h>
...
...
@@ -115,11 +114,7 @@ replay_gain_filter_init(G_GNUC_UNUSED const struct config_param *param,
filter_init
(
&
filter
->
filter
,
&
replay_gain_filter_plugin
);
filter
->
mixer
=
NULL
;
if
(
replay_gain_mode
==
REPLAY_GAIN_AUTO
)
{
filter
->
mode
=
g_playlist
.
queue
.
random
?
REPLAY_GAIN_TRACK
:
REPLAY_GAIN_ALBUM
;
}
else
{
filter
->
mode
=
replay_gain_mode
;
}
filter
->
mode
=
replay_gain_get_real_mode
();
replay_gain_info_init
(
&
filter
->
info
);
filter
->
volume
=
PCM_VOLUME_1
;
...
...
@@ -169,11 +164,7 @@ replay_gain_filter_filter(struct filter *_filter,
enum
replay_gain_mode
rg_mode
;
/* check if the mode has been changed since the last call */
if
(
replay_gain_mode
==
REPLAY_GAIN_AUTO
)
{
rg_mode
=
g_playlist
.
queue
.
random
?
REPLAY_GAIN_TRACK
:
REPLAY_GAIN_ALBUM
;
}
else
{
rg_mode
=
replay_gain_mode
;
}
rg_mode
=
replay_gain_get_real_mode
();
if
(
filter
->
mode
!=
rg_mode
)
{
g_debug
(
"replay gain mode has changed %d->%d
\n
"
,
filter
->
mode
,
rg_mode
);
...
...
src/replay_gain_config.c
View file @
f824ecdf
...
...
@@ -19,6 +19,7 @@
#include "config.h"
#include "replay_gain_config.h"
#include "playlist.h"
#include "conf.h"
#include "idle.h"
...
...
@@ -129,3 +130,15 @@ void replay_gain_global_init(void)
replay_gain_missing_preamp
=
pow
(
10
,
f
/
20
.
0
);
}
}
enum
replay_gain_mode
replay_gain_get_real_mode
(
void
)
{
enum
replay_gain_mode
rgm
;
rgm
=
replay_gain_mode
;
if
(
rgm
==
REPLAY_GAIN_AUTO
)
rgm
=
g_playlist
.
queue
.
random
?
REPLAY_GAIN_TRACK
:
REPLAY_GAIN_ALBUM
;
return
rgm
;
}
src/replay_gain_config.h
View file @
f824ecdf
...
...
@@ -45,4 +45,10 @@ replay_gain_get_mode_string(void);
bool
replay_gain_set_mode_string
(
const
char
*
p
);
/**
* Returns the "real" mode according to the "auto" setting"
*/
enum
replay_gain_mode
replay_gain_get_real_mode
(
void
);
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment