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
755d5507
Commit
755d5507
authored
Sep 09, 2008
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output: renamed method names
No CamelCase. Also don't declare typedefs for the methods.
parent
40a9961b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
34 deletions
+23
-34
audioOutput.c
src/audioOutput.c
+11
-12
output_api.h
src/output_api.h
+12
-22
No files found.
src/audioOutput.c
View file @
755d5507
...
...
@@ -67,10 +67,10 @@ int initAudioOutput(struct audio_output *ao, ConfigParam * param)
WARNING
(
"Attempt to detect audio output device
\n
"
);
audio_output_plugins_for_each
(
plugin
,
i
)
{
if
(
plugin
->
test
DefaultDeviceFunc
)
{
if
(
plugin
->
test
_default_device
)
{
WARNING
(
"Attempting to detect a %s audio "
"device
\n
"
,
plugin
->
name
);
if
(
plugin
->
test
DefaultDeviceFunc
()
==
0
)
{
if
(
plugin
->
test
_default_device
()
==
0
)
{
WARNING
(
"Successfully detected a %s "
"audio device
\n
"
,
plugin
->
name
);
break
;
...
...
@@ -110,7 +110,7 @@ int initAudioOutput(struct audio_output *ao, ConfigParam * param)
copyAudioFormat
(
&
ao
->
outAudioFormat
,
&
ao
->
reqAudioFormat
);
}
if
(
plugin
->
init
DriverFunc
(
ao
,
param
)
!=
0
)
if
(
plugin
->
init
(
ao
,
param
)
!=
0
)
return
0
;
return
1
;
...
...
@@ -139,7 +139,7 @@ int openAudioOutput(struct audio_output *audioOutput,
}
if
(
!
audioOutput
->
open
)
ret
=
audioOutput
->
plugin
->
open
DeviceFunc
(
audioOutput
);
ret
=
audioOutput
->
plugin
->
open
(
audioOutput
);
audioOutput
->
sameInAndOutFormats
=
!
cmpAudioFormat
(
&
audioOutput
->
inAudioFormat
,
...
...
@@ -183,7 +183,7 @@ int playAudioOutput(struct audio_output *audioOutput,
convertAudioFormat
(
audioOutput
,
&
playChunk
,
&
size
);
}
ret
=
audioOutput
->
plugin
->
play
Func
(
audioOutput
,
playChunk
,
size
);
ret
=
audioOutput
->
plugin
->
play
(
audioOutput
,
playChunk
,
size
);
return
ret
;
}
...
...
@@ -191,20 +191,20 @@ int playAudioOutput(struct audio_output *audioOutput,
void
dropBufferedAudioOutput
(
struct
audio_output
*
audioOutput
)
{
if
(
audioOutput
->
open
)
audioOutput
->
plugin
->
dropBufferedAudioFunc
(
audioOutput
);
audioOutput
->
plugin
->
cancel
(
audioOutput
);
}
void
closeAudioOutput
(
struct
audio_output
*
audioOutput
)
{
if
(
audioOutput
->
open
)
audioOutput
->
plugin
->
close
DeviceFunc
(
audioOutput
);
audioOutput
->
plugin
->
close
(
audioOutput
);
}
void
finishAudioOutput
(
struct
audio_output
*
audioOutput
)
{
closeAudioOutput
(
audioOutput
);
if
(
audioOutput
->
plugin
->
finish
DriverFunc
)
audioOutput
->
plugin
->
finish
DriverFunc
(
audioOutput
);
if
(
audioOutput
->
plugin
->
finish
)
audioOutput
->
plugin
->
finish
(
audioOutput
);
if
(
audioOutput
->
convBuffer
)
free
(
audioOutput
->
convBuffer
);
}
...
...
@@ -212,9 +212,8 @@ void finishAudioOutput(struct audio_output *audioOutput)
void
sendMetadataToAudioOutput
(
struct
audio_output
*
audioOutput
,
const
struct
tag
*
tag
)
{
if
(
!
audioOutput
->
plugin
->
sendMetdataFunc
)
return
;
audioOutput
->
plugin
->
sendMetdataFunc
(
audioOutput
,
tag
);
if
(
audioOutput
->
plugin
->
send_tag
)
audioOutput
->
plugin
->
send_tag
(
audioOutput
,
tag
);
}
void
printAllOutputPluginTypes
(
FILE
*
fp
)
...
...
src/output_api.h
View file @
755d5507
...
...
@@ -32,36 +32,26 @@
struct
audio_output
;
typedef
int
(
*
AudioOutputTestDefaultDeviceFunc
)
(
void
);
typedef
int
(
*
AudioOutputInitDriverFunc
)
(
struct
audio_output
*
audioOutput
,
ConfigParam
*
param
);
struct
audio_output_plugin
{
const
char
*
name
;
typedef
void
(
*
AudioOutputFinishDriverFunc
)
(
struct
audio_output
*
audioOutput
);
int
(
*
test_default_device
)(
void
);
typedef
int
(
*
AudioOutputOpenDeviceFunc
)
(
struct
audio_output
*
audioOutput
);
int
(
*
init
)(
struct
audio_output
*
ao
,
ConfigParam
*
param
);
typedef
int
(
*
AudioOutputPlayFunc
)
(
struct
audio_output
*
audioOutput
,
const
char
*
playChunk
,
size_t
size
);
void
(
*
finish
)(
struct
audio_output
*
ao
);
typedef
void
(
*
AudioOutputDropBufferedAudioFunc
)
(
struct
audio_output
*
audioOutput
);
int
(
*
open
)(
struct
audio_output
*
ao
);
typedef
void
(
*
AudioOutputCloseDeviceFunc
)
(
struct
audio_output
*
audioOutput
);
int
(
*
play
)(
struct
audio_output
*
ao
,
const
char
*
playChunk
,
size_t
size
);
typedef
void
(
*
AudioOutputSendMetadataFunc
)
(
struct
audio_output
*
audioOutput
,
const
struct
tag
*
tag
);
void
(
*
cancel
)(
struct
audio_output
*
ao
);
struct
audio_output_plugin
{
const
char
*
name
;
void
(
*
close
)(
struct
audio_output
*
ao
);
AudioOutputTestDefaultDeviceFunc
testDefaultDeviceFunc
;
AudioOutputInitDriverFunc
initDriverFunc
;
AudioOutputFinishDriverFunc
finishDriverFunc
;
AudioOutputOpenDeviceFunc
openDeviceFunc
;
AudioOutputPlayFunc
playFunc
;
AudioOutputDropBufferedAudioFunc
dropBufferedAudioFunc
;
AudioOutputCloseDeviceFunc
closeDeviceFunc
;
AudioOutputSendMetadataFunc
sendMetdataFunc
;
void
(
*
send_tag
)(
struct
audio_output
*
audioOutput
,
const
struct
tag
*
tag
);
};
struct
audio_output
{
...
...
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