Max Kellermann
6d21b9448a
pcm/PcmVolume: rename to Volume.cxx
2013-12-23 10:35:21 +01:00
Max Kellermann
86e72ffefb
util/Clamp: generic Clamp() function
2013-12-22 21:08:06 +01:00
Max Kellermann
9cfd9d7ce0
Merge branch 'v0.18.x'
2013-12-15 19:17:40 +01:00
Max Kellermann
42a09ff17a
mixer/alsa: fix deadlock
...
This deadlock was a regression by commit 8e38b4f8
. Since we currently
can't resolve this, let's revert the commit, and add a GLib specific
workaround for the build failure.
2013-12-15 19:07:25 +01:00
Max Kellermann
c7b1038a9d
Merge branch 'v0.18.x'
2013-12-14 12:37:16 +01:00
Max Kellermann
8e38b4f83c
mixer/alsa: use BlockingCall() instead of EventLoop::AddCall()
...
This is safer, and works without epoll(). Fixes a build failure with
uClibc, which does not support epoll().
2013-12-13 14:35:36 +01:00
Max Kellermann
f90abe9530
include cleanup using iwyu
2013-11-28 11:50:54 +01:00
Max Kellermann
88e630170e
mixer/software: fix double free bug
2013-10-30 23:12:45 +01:00
Max Kellermann
20597b3632
*: use nullptr instead of NULL
2013-10-28 23:58:17 +01:00
Max Kellermann
222dc8a239
Util/ASCII: add StringEqualsCaseASCII() overload with length
...
Replaces GLib's g_ascii_strncasecmp().
2013-10-21 08:42:55 +02:00
Max Kellermann
0e4d2e7277
Util/ASCII: add function StringEqualsCaseASCII()
...
Replaces GLib's g_ascii_strcasecmp().
2013-10-20 23:09:51 +02:00
Max Kellermann
dbd88e6aef
Client, ...: remove unnecessary glib.h include
2013-10-15 22:51:09 +02:00
Max Kellermann
060814daa8
Log: new logging library API
...
Prepare to migrate away from GLib. Currently, we're still using GLib
as a backend.
2013-10-02 08:57:55 +02:00
Max Kellermann
a2ce2447a6
Merge branch 'v0.17.x'
2013-10-01 17:20:38 +02:00
Max Kellermann
9a1076256d
mixer/alsa: handle ENODEV
...
Fixes busy loop when USB sound device gets unplugged (Mantis bug
#3824 ).
2013-10-01 16:35:27 +02:00
Max Kellermann
72ef38d4a7
mixer/alsa: log snd_mixer_handle_events() errors
2013-10-01 16:30:20 +02:00
Max Kellermann
26d92c80ed
conf.h: remove obsolete header
...
Use only ConfigData.hxx in plugin sources to reduce header
dependencies.
2013-09-05 08:47:10 +02:00
Max Kellermann
29030b54c9
util/Error: new error passing library
...
Replaces GLib's GError.
2013-09-04 18:14:22 +02:00
Max Kellermann
5c48d3fbba
alsa/mixer: defer InvalidateSockets() call to I/O thread
2013-08-10 14:05:06 +02:00
Max Kellermann
342333f72a
mixer/alsa: invoke InvalidateSockets() in constructor
2013-08-10 13:54:23 +02:00
Max Kellermann
be0c8495cd
event/MultiSocketMonitor: PrepareSockets() returns timeout
...
Simplify the API, don't use GLib specific integer type.
2013-08-10 11:52:31 +02:00
Max Kellermann
abe090ec1f
*: remove remaining __cplusplus checks
2013-08-07 19:58:52 +02:00
Max Kellermann
123dd5fe2d
mixer/alsa: use AllocatedArray for the pollfd buffer
2013-08-07 18:56:57 +02:00
Max Kellermann
b70d38dc10
Makefile.am: move sources to libsystem.a
2013-08-07 10:31:31 +02:00
Max Kellermann
85b77b81ca
*: use gcc.h macros instead of GLib
2013-08-04 23:48:01 +02:00
Max Kellermann
a0beb5fa26
MixerPlugin: pass config_param reference
2013-08-04 14:07:50 +02:00
Max Kellermann
f54bcc1f16
FilterPlugin: pass config_param reference
2013-08-04 14:07:50 +02:00
Max Kellermann
06f898cc12
tag: convert to C++
2013-07-30 20:19:53 +02:00
Max Kellermann
648196319f
output_api: convert to C++
2013-07-30 08:34:10 +02:00
Max Kellermann
8ce9b53093
mixer/software: use gcc_unused instead of G_GNUC_UNUSED
2013-04-16 23:50:41 +02:00
Max Kellermann
cb8449a66d
MixerInternal: convert to class
2013-04-16 21:33:25 +02:00
Max Kellermann
621467717d
mixer/winmm: convert to a class
2013-04-16 21:31:03 +02:00
Max Kellermann
506c716cf2
mixer/Software: convert to a class
2013-04-16 21:25:27 +02:00
Max Kellermann
9f625b0a0d
mixer/Pulse: convert to a class
2013-04-16 21:18:54 +02:00
Max Kellermann
bc1b4131cb
mixer/Oss: convert to a class
2013-04-16 21:11:14 +02:00
Max Kellermann
80ba3c5932
mixer/Alsa: convert to a class
2013-04-16 21:11:06 +02:00
Max Kellermann
e63420a8c2
output/Pulse: convert to C++
2013-04-16 20:51:21 +02:00
Max Kellermann
c654c7630a
pcm_*: move to src/pcm/
2013-04-09 01:24:52 +02:00
Max Kellermann
496f70fc0d
mixer_plugin: convert to C++
2013-02-22 20:51:23 +01:00
Max Kellermann
9ede4c5f3c
{output,mixer}/winmm: convert to C++
2013-02-22 20:29:03 +01:00
Max Kellermann
a9ce0218c1
FilterInternal: convert struct filter to a OO interface
2013-02-02 09:34:07 +01:00
Max Kellermann
3894450b10
filter: convert to C++
2013-02-01 17:47:09 +01:00
Max Kellermann
1b175025fe
pcm_*: convert to C++
2013-01-31 21:11:06 +01:00
Max Kellermann
7764136211
mixer/software, filter/volume: convert to C++
2013-01-31 21:11:06 +01:00
Max Kellermann
26a9ce7b29
output/{alsa,oss}: convert to C++
2013-01-29 14:32:32 +01:00
Max Kellermann
e22ef6c481
output/roar: convert to C++
2013-01-16 23:29:56 +01:00
Max Kellermann
2101daef5a
mixer/Alsa: use MultiSocketMonitor
2013-01-15 18:18:00 +01:00
Max Kellermann
49f3855407
configure.ac: enable WIN32_LEAN_AND_MEAN on Windows
2013-01-11 11:06:16 +01:00
Max Kellermann
26ebfc04b0
EventPipe: rename to GlobalEvents
2013-01-09 23:31:43 +01:00
Max Kellermann
5faf443038
event_pipe.h: convert to C++
2013-01-09 22:37:47 +01:00
Max Kellermann
d3e1b72d38
mixer/{alsa,pulse}: convert to C++
2013-01-09 22:25:24 +01:00
Max Kellermann
457d98c860
output/raop: delete the RAOP plugin
...
This plugin is horrible code, I mean it. Last year, I tried hard to
fix it, but I figured would take less time to do a full rewrite.
Given that I don't even have any device that supports RAOP, I can't do
that properly. After 16 months, nobody volunteered for fixing it.
Hereby, I delete it, because having no RAOP plugin is better than
having this mess. Sorry.
2012-05-29 23:15:41 +02:00
Max Kellermann
26ec62714c
mixer/alsa: listen for external volume changes
...
Use libasound's polling functions, implement a bridge to GSource /
GPollFD and send idle events to clients when an external program
changes the ALSA mixer volume.
2012-01-05 01:52:40 +01:00
Max Kellermann
7873b5e78b
mixer/alsa: move code to alsa_mixer_setup()
...
Better error handling.
2012-01-05 01:52:05 +01:00
Max Kellermann
1b889c527f
mixer/alsa: move code to alsa_mixer_lookup_elem()
2012-01-05 00:52:41 +01:00
Max Kellermann
3934d2d30c
output/pulse: don't expose internal struct in public header
...
Provide _lock() and _unlock() to wrap all accesses from the mixer
plugin.
2011-09-17 19:50:36 +02:00
Max Kellermann
947848ebf6
output/roar: export volume methods
...
Use these instead of exposing the internal roar_t struct.
2011-09-17 19:33:51 +02:00
Max Kellermann
062948b110
mixer/raop: include cleanup
2011-08-31 08:31:26 +02:00
Max Kellermann
82f336a78f
output/raop: remove excessive debug messages
2011-08-24 01:47:27 +02:00
Max Kellermann
350aa33022
output/raop: consistently use GError
2011-08-24 01:47:26 +02:00
Hans-Kristian Arntzen
d9353c4fd3
Remove unused headers in Roar plugin.
...
Should fix build errors for Win32.
2011-03-23 21:59:22 +01:00
Max Kellermann
0c9fc2f809
Merge commit 'release-0.16.2'
...
Conflicts:
Makefile.am
NEWS
configure.ac
2011-03-19 09:58:07 +01:00
Hans-Kristian Arntzen
1a954748a0
RoarAudio output plugin
2011-03-16 17:57:47 +01:00
Thomas Jansen
948b8f35e6
general: whitespace cleanup
...
Remove trailing whitespace found by this command:
find -name '*.[ch]' | xargs grep "[[:space:]]$"
2011-02-09 22:42:31 +01:00
Max Kellermann
c6cbcc2c25
copyright year 2011
2011-01-29 10:13:54 +01:00
Dustin Puckett
79e0db4ca0
output/raop: new output plugin
...
Remote Audio Output Protocol (RAOP), for Apple devices.
2011-01-28 21:17:09 +01:00
Denis Krjuchkov
e6fc88a758
mixer: winmm_mixer implemented
2010-10-09 02:45:08 +06:00
Avuton Olrich
9d3865cb95
Update copyright notices.
2009-12-31 20:58:43 -08:00
Max Kellermann
5b82ffc291
include config.h in all sources
...
After we've been hit by Large File Support problems several times in
the past week (which only occur on 32 bit platforms, which I don't
have), this is yet another attempt to fix the issue.
2009-11-12 09:17:03 +01:00
Max Kellermann
e0e6813a1d
fd_util: removed creat_cloexec()
...
Add a "mode" argument to open_cloexec() instead.
2009-11-10 16:53:24 +01:00
Max Kellermann
e3af0032b2
set the close-on-exec flag on all file descriptors
...
Added the "fd_util" library, which attempts to use the new thread-safe
Linux system calls pipe2(), accept4() and the options O_CLOEXEC,
SOCK_CLOEXEC. Without these, it falls back to FD_CLOEXEC, which is
not thread safe.
This is particularly important for the "pipe" output plugin (and
others, such as JACK/PulseAudio), because we were heavily leaking file
descriptors to child processes.
2009-11-07 18:55:16 +01:00
Max Kellermann
c426a0bc5c
output/pulse: call mixer on state changes
...
Don't let the mixer plugin "override" the libpulse callbacks.
Instead, add a "mixer" attribute to the pulse_output struct, and call
the mixer on all interesting events.
2009-10-23 10:33:26 +02:00
Max Kellermann
ede828c910
mixer_control: allow methods "open" and "close" to be NULL
...
It's possible to have a mixer implementation which does not explicitly
need the methods open() and close().
2009-10-23 09:15:51 +02:00
Max Kellermann
7dd172efec
mixer/pulse: don't get volume if stream is not yet ready
...
Moved the check from pulse_mixer_open() to pulse_mixer_update().
2009-10-22 20:28:12 +02:00
Max Kellermann
b479a264b6
pulse: code rewrite using the asynchronous libpulse API
...
This is a complete rewrite of the PulseAudio output plugin. It uses
the asynchronous API, which gives us more control over everything.
Additionally, it connects to the PulseAudio server on startup, and
keeps this connection up while MPD runs. During pause, instead of
closing the stream, it enables "cork".
2009-10-21 10:30:42 +02:00
Max Kellermann
ac32f36e4e
mixer_plugin: pass audio_output pointer to mixer_plugin.init()
...
This allows the mixer object to access its associated audio output
object.
2009-10-21 09:48:41 +02:00
Max Kellermann
4e2fb3fb89
mixer_plugin: use GError for error handling
2009-10-20 22:10:56 +02:00
Max Kellermann
097e200a97
mixer/{oss,alsa}: renamed the mixer source files
2009-10-20 21:23:05 +02:00
Max Kellermann
bc4266bef8
pulse: renamed source files
2009-10-20 21:05:11 +02:00
Max Kellermann
5d74b1efef
mixer/software: new mixer which controls filter/volume
...
This mixer plugin may be used instead of the traditional global
software mixer. It integrates with the "volume" filter plugin, and
can control the software volume of an audio output which has no
hardware mixer.
2009-07-06 21:52:15 +02:00
Max Kellermann
9038882d95
alsa_mixer: use g_ascii_strcasecmp() instead of strcasecmp()
...
strcasecmp() is locale dependent, making it a bad choice for internal
string comparisons.
2009-04-28 09:28:16 +02:00
Daniel Kahn Gillmor
05dfdfdb39
alsa_mixer: add mixer_index option
...
This allows you to select controls with duplicate names.
2009-04-28 09:15:48 +02:00
Max Kellermann
d2010c0289
pulse_mixer: use PULSE's mainloop lock instead of GMutex
...
Using two different kinds of locks may result in a race condition with
a deadlock. The libpulse callbacks need no locks at all, because the
mainloop object can be assumed to be already locked.
2009-04-25 13:53:15 +02:00
Max Kellermann
eb059a789c
alsa_mixer: call snd_config_update_free_global() in finish()
...
snd_config_update_free_global() frees cached ALSA configuration. This
keeps valgrind a little bit more quiet. This patch moves the call
from the open() method into the finish() method, which seems more
natural: it allows the use of the config cache, and improves the
cleanup phase.
2009-04-21 22:47:08 +02:00
Max Kellermann
43864762ee
mixer: assert that the new volume value is valid
...
Added an assertion in mixer_set_volume(). Removed the range checks
from the ALSA and OSS plugins.
2009-03-27 20:10:39 +01:00
Max Kellermann
7d3921bb88
pulse_mixer: protect the struct with a mutex
...
There are numerous race conditions between the libpulse thread
(pulse_mixer.c callbacks) and the rest of MPD. Protect the volatile
attributes of the pulse_mixer struct with a mutex to fix that.
2009-03-27 16:55:17 +01:00
Max Kellermann
7f762a5cec
pulse_mixer: return if mixer is offline
...
Eliminate one indent level. Also remove several debug useless debug
messages.
2009-03-27 16:44:37 +01:00
Max Kellermann
13319e0b70
pulse_mixer: removed superfluous G_GNUC_UNUSED attributes
...
Those parameters are used after all.
2009-03-27 16:44:36 +01:00
Max Kellermann
d448392f25
pulse_mixer: use local pa_cvolume variable for set_volume()
...
Don't mess with pulse_mixer.volume for setting the volume. This
variable should only be used to transfer the current volume from
sink_input_vol() to pulse_mixer_get_volume().
2009-03-27 16:44:36 +01:00
Max Kellermann
8258457b43
pulse_mixer: wait for get_volume() operation to complete
...
The pa_context_get_sink_input_info() function is asynchronous, and
after it returns, libpulse does not guarantee that the operation has
completed yet; in fact, it is not likely. Explicitly wait for the
operation to complete.
The code for the new pulse_wait_for_operation() function was inspired
by mplayer and xine code.
2009-03-27 16:44:36 +01:00
Max Kellermann
929c200c38
pulse_mixer: adapted code style
...
Use the same code style as the rest of MPD.
2009-03-27 00:43:47 +01:00
Max Kellermann
4343c108b3
pulse_mixer: removed superfluous initializations
...
Don't initialize attributes which are only used in an open mixer. As
long as nobody accesses them, their values are uninitialized and
undefined.
2009-03-26 19:50:31 +01:00
Max Kellermann
239e6da442
pulse_mixer: allocate "volume" statically
...
The pm->volume attribute was allocated in pulse_mixer_init(), but is
never freed. This leaks memory. Instead of adding the g_free() call
to pulse_mixer_finish(), let's just make "volume" a static attribute
of the pulse_mixer struct. That is easier to deal with.
2009-03-26 19:50:27 +01:00
Max Kellermann
6c480d7db4
pulse_mixer: removed superfluous NULL checks in close()
...
When the MPD core knows that the pulse mixer is open, pm->mainloop and
pm->context must be non-NULL.
2009-03-26 19:50:23 +01:00
Max Kellermann
8cf206f2ee
pulse_mixer: initialize "online" and "index" in open()
...
The attributes "online" and "index" were not properly reinitialized
after a close/open cycle.
2009-03-26 19:50:15 +01:00
Max Kellermann
52575d1b9d
pulse: make configuration strings const
...
Nobody needs to modify these strings. We can make them const, and
convert config_dup_block_string() to config_get_block_string(). This
also fixes memory leaks in the pulse mixer.
2009-03-26 19:50:10 +01:00
Max Kellermann
cd4964cdee
pulse: don't check config_param!=NULL
...
The conf.h functions deal well with config_param==NULL and will return
the specified default value then.
2009-03-26 19:50:02 +01:00
Max Kellermann
74273d419a
pulse_mixer: free libpulse objects on failure
...
When the mixer initialization fails, we have to free the libpulse
objects we have already created, to prevent resource leaks.
2009-03-26 19:49:58 +01:00
Max Kellermann
3d2c8b001a
pulse_mixer: unlock the mainloop on failure
...
It's illegal to return from pulse_mixer_setup() without unlocking the
main loop. In the error handling, that unlock() call was missing.
2009-03-26 19:49:55 +01:00
Max Kellermann
d113c07190
pulse_mixer: moved code to pulse_mixer_setup()
...
Prepare for adding proper error handling.
2009-03-26 19:49:39 +01:00