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
3a82283b
Commit
3a82283b
authored
Feb 16, 2009
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
output_control: no CamelCase
Renamed variables.
parent
ed591f19
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
55 additions
and
56 deletions
+55
-56
output_control.c
src/output_control.c
+44
-44
output_control.h
src/output_control.h
+11
-12
No files found.
src/output_control.c
View file @
3a82283b
...
...
@@ -50,39 +50,39 @@ static void ao_command_async(struct audio_output *ao,
}
bool
audio_output_open
(
struct
audio_output
*
a
udioOutput
,
const
struct
audio_format
*
audio
F
ormat
)
audio_output_open
(
struct
audio_output
*
a
o
,
const
struct
audio_format
*
audio
_f
ormat
)
{
a
udioOutput
->
reopen_after
=
0
;
a
o
->
reopen_after
=
0
;
if
(
a
udioOutput
->
open
&&
audio_format_equals
(
audio
Format
,
&
audioOutput
->
in_audio_format
))
{
if
(
a
o
->
open
&&
audio_format_equals
(
audio
_format
,
&
ao
->
in_audio_format
))
{
return
true
;
}
a
udioOutput
->
in_audio_format
=
*
audioF
ormat
;
a
o
->
in_audio_format
=
*
audio_f
ormat
;
if
(
audio_format_defined
(
&
a
udioOutput
->
config_audio_format
))
{
if
(
audio_format_defined
(
&
a
o
->
config_audio_format
))
{
/* copy config_audio_format to out_audio_format only if the
device is not yet open; if it is already open,
plugin->open() may have modified out_audio_format,
and the value is already ok */
if
(
!
a
udioOutput
->
open
)
a
udioOutput
->
out_audio_format
=
a
udioOutput
->
config_audio_format
;
if
(
!
a
o
->
open
)
a
o
->
out_audio_format
=
a
o
->
config_audio_format
;
}
else
{
a
udioOutput
->
out_audio_format
=
audioOutput
->
in_audio_format
;
if
(
a
udioOutput
->
open
)
audio_output_close
(
a
udioOutput
);
a
o
->
out_audio_format
=
ao
->
in_audio_format
;
if
(
a
o
->
open
)
audio_output_close
(
a
o
);
}
if
(
a
udioOutput
->
thread
==
NULL
)
audio_output_thread_start
(
a
udioOutput
);
if
(
a
o
->
thread
==
NULL
)
audio_output_thread_start
(
a
o
);
if
(
!
a
udioOutput
->
open
)
ao_command
(
a
udioOutput
,
AO_COMMAND_OPEN
);
if
(
!
a
o
->
open
)
ao_command
(
a
o
,
AO_COMMAND_OPEN
);
return
a
udioOutput
->
open
;
return
a
o
->
open
;
}
void
...
...
@@ -102,56 +102,56 @@ audio_output_signal(struct audio_output *ao)
notify_signal
(
&
ao
->
notify
);
}
void
audio_output_play
(
struct
audio_output
*
audioOutput
,
const
char
*
playC
hunk
,
size_t
size
)
void
audio_output_play
(
struct
audio_output
*
ao
,
const
char
*
c
hunk
,
size_t
size
)
{
assert
(
size
>
0
);
if
(
!
a
udioOutput
->
open
)
if
(
!
a
o
->
open
)
return
;
a
udioOutput
->
args
.
play
.
data
=
playC
hunk
;
a
udioOutput
->
args
.
play
.
size
=
size
;
ao_command_async
(
a
udioOutput
,
AO_COMMAND_PLAY
);
a
o
->
args
.
play
.
data
=
c
hunk
;
a
o
->
args
.
play
.
size
=
size
;
ao_command_async
(
a
o
,
AO_COMMAND_PLAY
);
}
void
audio_output_pause
(
struct
audio_output
*
a
udioOutput
)
void
audio_output_pause
(
struct
audio_output
*
a
o
)
{
ao_command_async
(
a
udioOutput
,
AO_COMMAND_PAUSE
);
ao_command_async
(
a
o
,
AO_COMMAND_PAUSE
);
}
void
audio_output_cancel
(
struct
audio_output
*
a
udioOutput
)
void
audio_output_cancel
(
struct
audio_output
*
a
o
)
{
ao_command_async
(
a
udioOutput
,
AO_COMMAND_CANCEL
);
ao_command_async
(
a
o
,
AO_COMMAND_CANCEL
);
}
void
audio_output_close
(
struct
audio_output
*
a
udioOutput
)
void
audio_output_close
(
struct
audio_output
*
a
o
)
{
if
(
a
udioOutput
->
open
)
ao_command
(
a
udioOutput
,
AO_COMMAND_CLOSE
);
if
(
a
o
->
open
)
ao_command
(
a
o
,
AO_COMMAND_CLOSE
);
}
void
audio_output_finish
(
struct
audio_output
*
a
udioOutput
)
void
audio_output_finish
(
struct
audio_output
*
a
o
)
{
audio_output_close
(
a
udioOutput
);
audio_output_close
(
a
o
);
if
(
a
udioOutput
->
thread
!=
NULL
)
{
ao_command
(
a
udioOutput
,
AO_COMMAND_KILL
);
g_thread_join
(
a
udioOutput
->
thread
);
if
(
a
o
->
thread
!=
NULL
)
{
ao_command
(
a
o
,
AO_COMMAND_KILL
);
g_thread_join
(
a
o
->
thread
);
}
if
(
a
udioOutput
->
plugin
->
finish
)
a
udioOutput
->
plugin
->
finish
(
audioOutput
->
data
);
if
(
a
o
->
plugin
->
finish
)
a
o
->
plugin
->
finish
(
ao
->
data
);
notify_deinit
(
&
a
udioOutput
->
notify
);
notify_deinit
(
&
a
o
->
notify
);
}
void
audio_output_send_tag
(
struct
audio_output
*
audioOutput
,
const
struct
tag
*
tag
)
void
audio_output_send_tag
(
struct
audio_output
*
ao
,
const
struct
tag
*
tag
)
{
if
(
a
udioOutput
->
plugin
->
send_tag
==
NULL
)
if
(
a
o
->
plugin
->
send_tag
==
NULL
)
return
;
a
udioOutput
->
args
.
tag
=
tag
;
ao_command_async
(
a
udioOutput
,
AO_COMMAND_SEND_TAG
);
a
o
->
args
.
tag
=
tag
;
ao_command_async
(
a
o
,
AO_COMMAND_SEND_TAG
);
}
src/output_control.h
View file @
3a82283b
...
...
@@ -23,17 +23,16 @@
#include <stdbool.h>
struct
audio_output
;
struct
audio_output_plugin
;
struct
audio_format
;
struct
tag
;
struct
config_param
;
int
audio_output_init
(
struct
audio_output
*
,
const
struct
config_param
*
param
);
audio_output_init
(
struct
audio_output
*
ao
,
const
struct
config_param
*
param
);
bool
audio_output_open
(
struct
audio_output
*
a
udioOutput
,
const
struct
audio_format
*
audio
F
ormat
);
audio_output_open
(
struct
audio_output
*
a
o
,
const
struct
audio_format
*
audio
_f
ormat
);
/**
* Opens or closes the device, depending on the "enabled" flag.
...
...
@@ -50,15 +49,15 @@ audio_output_update(struct audio_output *ao,
void
audio_output_signal
(
struct
audio_output
*
ao
);
void
audio_output_play
(
struct
audio_output
*
audioOutput
,
const
char
*
playC
hunk
,
size_t
size
);
void
audio_output_play
(
struct
audio_output
*
ao
,
const
char
*
c
hunk
,
size_t
size
);
void
audio_output_pause
(
struct
audio_output
*
a
udioOutput
);
void
audio_output_pause
(
struct
audio_output
*
a
o
);
void
audio_output_cancel
(
struct
audio_output
*
a
udioOutput
);
void
audio_output_close
(
struct
audio_output
*
a
udioOutput
);
void
audio_output_finish
(
struct
audio_output
*
a
udioOutput
);
void
audio_output_send_tag
(
struct
audio_output
*
audioOutput
,
const
struct
tag
*
tag
);
void
audio_output_cancel
(
struct
audio_output
*
a
o
);
void
audio_output_close
(
struct
audio_output
*
a
o
);
void
audio_output_finish
(
struct
audio_output
*
a
o
);
void
audio_output_send_tag
(
struct
audio_output
*
ao
,
const
struct
tag
*
tag
);
#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