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
0b4dfae2
Commit
0b4dfae2
authored
Oct 10, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
player: added player_control.audio_format
This replaces the attributes bits, channels, sampleRate.
parent
8c33b648
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
17 deletions
+12
-17
command.c
src/command.c
+1
-1
player_control.c
src/player_control.c
+5
-5
player_control.h
src/player_control.h
+4
-5
player_thread.c
src/player_thread.c
+2
-6
No files found.
src/command.c
View file @
0b4dfae2
...
@@ -403,7 +403,7 @@ static int commandStatus(struct client *client,
...
@@ -403,7 +403,7 @@ static int commandStatus(struct client *client,
client_printf
(
client
,
client_printf
(
client
,
COMMAND_STATUS_TIME
": %i:%i
\n
"
COMMAND_STATUS_TIME
": %i:%i
\n
"
COMMAND_STATUS_BITRATE
": %li
\n
"
COMMAND_STATUS_BITRATE
": %li
\n
"
COMMAND_STATUS_AUDIO
": %u:%
i:%i
\n
"
,
COMMAND_STATUS_AUDIO
": %u:%
u:%u
\n
"
,
getPlayerElapsedTime
(),
getPlayerTotalTime
(),
getPlayerElapsedTime
(),
getPlayerTotalTime
(),
getPlayerBitRate
(),
getPlayerBitRate
(),
getPlayerSampleRate
(),
getPlayerBits
(),
getPlayerSampleRate
(),
getPlayerBits
(),
...
...
src/player_control.c
View file @
0b4dfae2
...
@@ -256,17 +256,17 @@ double getPlayerTotalPlayTime(void)
...
@@ -256,17 +256,17 @@ double getPlayerTotalPlayTime(void)
unsigned
int
getPlayerSampleRate
(
void
)
unsigned
int
getPlayerSampleRate
(
void
)
{
{
return
pc
.
sampleR
ate
;
return
pc
.
audio_format
.
sample_r
ate
;
}
}
int
getPlayerBits
(
void
)
unsigned
getPlayerBits
(
void
)
{
{
return
pc
.
bits
;
return
pc
.
audio_format
.
bits
;
}
}
int
getPlayerChannels
(
void
)
unsigned
getPlayerChannels
(
void
)
{
{
return
pc
.
channels
;
return
pc
.
audio_format
.
channels
;
}
}
/* this actually creates a dupe of the current metadata */
/* this actually creates a dupe of the current metadata */
...
...
src/player_control.h
View file @
0b4dfae2
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#define PLAYER_H
#define PLAYER_H
#include "notify.h"
#include "notify.h"
#include "audio_format.h"
#include <stdint.h>
#include <stdint.h>
...
@@ -86,9 +87,7 @@ struct player_control {
...
@@ -86,9 +87,7 @@ struct player_control {
volatile
enum
player_state
state
;
volatile
enum
player_state
state
;
volatile
int8_t
error
;
volatile
int8_t
error
;
volatile
uint16_t
bitRate
;
volatile
uint16_t
bitRate
;
volatile
int8_t
bits
;
struct
audio_format
audio_format
;
volatile
int8_t
channels
;
volatile
uint32_t
sampleRate
;
volatile
float
totalTime
;
volatile
float
totalTime
;
volatile
float
elapsedTime
;
volatile
float
elapsedTime
;
volatile
float
fileTime
;
volatile
float
fileTime
;
...
@@ -157,9 +156,9 @@ double getPlayerTotalPlayTime(void);
...
@@ -157,9 +156,9 @@ double getPlayerTotalPlayTime(void);
unsigned
int
getPlayerSampleRate
(
void
);
unsigned
int
getPlayerSampleRate
(
void
);
int
getPlayerBits
(
void
);
unsigned
getPlayerBits
(
void
);
int
getPlayerChannels
(
void
);
unsigned
getPlayerChannels
(
void
);
struct
song
*
struct
song
*
playerCurrentDecodeSong
(
void
);
playerCurrentDecodeSong
(
void
);
...
...
src/player_thread.c
View file @
0b4dfae2
...
@@ -62,9 +62,7 @@ static int waitOnDecode(int *decodeWaitedOn)
...
@@ -62,9 +62,7 @@ static int waitOnDecode(int *decodeWaitedOn)
pc
.
totalTime
=
pc
.
fileTime
;
pc
.
totalTime
=
pc
.
fileTime
;
pc
.
bitRate
=
0
;
pc
.
bitRate
=
0
;
pc
.
sampleRate
=
0
;
audio_format_clear
(
&
pc
.
audio_format
);
pc
.
bits
=
0
;
pc
.
channels
=
0
;
*
decodeWaitedOn
=
1
;
*
decodeWaitedOn
=
1
;
return
0
;
return
0
;
...
@@ -253,9 +251,7 @@ static void do_play(void)
...
@@ -253,9 +251,7 @@ static void do_play(void)
closeAudioDevice
();
closeAudioDevice
();
}
}
pc
.
totalTime
=
dc
.
totalTime
;
pc
.
totalTime
=
dc
.
totalTime
;
pc
.
sampleRate
=
dc
.
audioFormat
.
sample_rate
;
pc
.
audio_format
=
dc
.
audioFormat
;
pc
.
bits
=
dc
.
audioFormat
.
bits
;
pc
.
channels
=
dc
.
audioFormat
.
channels
;
sizeToTime
=
audioFormatSizeToTime
(
&
ob
.
audioFormat
);
sizeToTime
=
audioFormatSizeToTime
(
&
ob
.
audioFormat
);
}
}
else
{
else
{
...
...
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