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
7c567e3c
Commit
7c567e3c
authored
Aug 29, 2014
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CrossFade: pass total_time as SignedSongTime instance
parent
58352ea6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
4 deletions
+7
-4
CrossFade.cxx
src/CrossFade.cxx
+4
-2
CrossFade.hxx
src/CrossFade.hxx
+2
-1
PlayerThread.cxx
src/PlayerThread.cxx
+1
-1
No files found.
src/CrossFade.cxx
View file @
7c567e3c
...
...
@@ -19,6 +19,7 @@
#include "config.h"
#include "CrossFade.hxx"
#include "Chrono.hxx"
#include "MusicChunk.hxx"
#include "AudioFormat.hxx"
#include "util/NumberParser.hxx"
...
...
@@ -85,7 +86,7 @@ mixramp_interpolate(const char *ramp_list, float required_db)
}
unsigned
CrossFadeSettings
::
Calculate
(
float
total_time
,
CrossFadeSettings
::
Calculate
(
SignedSongTime
total_time
,
float
replay_gain_db
,
float
replay_gain_prev_db
,
const
char
*
mixramp_start
,
const
char
*
mixramp_prev_end
,
const
AudioFormat
af
,
...
...
@@ -95,7 +96,8 @@ CrossFadeSettings::Calculate(float total_time,
unsigned
int
chunks
=
0
;
float
chunks_f
;
if
(
duration
<
0
||
duration
>=
total_time
||
if
(
total_time
.
IsNegative
()
||
duration
<
0
||
duration
>=
total_time
.
ToDoubleS
()
||
/* we can't crossfade when the audio formats are different */
af
!=
old_format
)
return
0
;
...
...
src/CrossFade.hxx
View file @
7c567e3c
...
...
@@ -23,6 +23,7 @@
#include "Compiler.h"
struct
AudioFormat
;
class
SignedSongTime
;
struct
CrossFadeSettings
{
/**
...
...
@@ -60,7 +61,7 @@ struct CrossFadeSettings {
* should be disabled for this song change
*/
gcc_pure
unsigned
Calculate
(
float
total_time
,
unsigned
Calculate
(
SignedSongTime
total_time
,
float
replay_gain_db
,
float
replay_gain_prev_db
,
const
char
*
mixramp_start
,
const
char
*
mixramp_prev_end
,
...
...
src/PlayerThread.cxx
View file @
7c567e3c
...
...
@@ -1001,7 +1001,7 @@ Player::Run()
calculate how many chunks will be required
for it */
cross_fade_chunks
=
pc
.
cross_fade
.
Calculate
(
dc
.
total_time
.
ToDoubleS
()
,
pc
.
cross_fade
.
Calculate
(
dc
.
total_time
,
dc
.
replay_gain_db
,
dc
.
replay_gain_prev_db
,
dc
.
GetMixRampStart
(),
...
...
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