aboutsummaryrefslogtreecommitdiffstats
path: root/src/MixerControl.cxx (unfollow)
Commit message (Collapse)AuthorFilesLines
2013-10-02Log: new logging library APIMax Kellermann1-3/+0
Prepare to migrate away from GLib. Currently, we're still using GLib as a backend.
2013-09-04util/Error: new error passing libraryMax Kellermann1-17/+12
Replaces GLib's GError.
2013-08-04MixerPlugin: pass config_param referenceMax Kellermann1-1/+1
2013-04-16MixerInternal: use Mutex instead of GMutexMax Kellermann1-23/+8
2013-04-16MixerInternal: convert to classMax Kellermann1-11/+11
2013-02-22mixer_plugin: convert to C++Max Kellermann1-3/+3
2011-01-29copyright year 2011Max Kellermann1-1/+1
2009-12-31Update copyright notices.Avuton Olrich1-1/+1
2009-12-08mixer: explicitly close all mixers on shutdownMax Kellermann1-0/+4
Mixers with the "global" flag set aren't closed automatically when the output device is closed. Thus, they might still be open when MPD shuts down.
2009-11-12include config.h in all sourcesMax Kellermann1-0/+1
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-10-23mixer_control: don't close the mixer if set_volume() failsMax Kellermann1-2/+0
A mixer is useful enough if it can be read. Setting it may be found unavailable at runtime.
2009-10-23mixer_plugin: get_volume() may return -1 if unavailableMax Kellermann1-2/+6
If the method get_volume() returns -1 and no error object is set, then the volume is currently unavailable, but the mixer should not be closed immediately.
2009-10-23mixer_control: allow methods "open" and "close" to be NULLMax Kellermann1-1/+5
It's possible to have a mixer implementation which does not explicitly need the methods open() and close().
2009-10-21mixer_plugin: pass audio_output pointer to mixer_plugin.init()Max Kellermann1-2/+3
This allows the mixer object to access its associated audio output object.
2009-10-20mixer_plugin: use GError for error handlingMax Kellermann1-12/+13
2009-07-06output: use the software mixer pluginMax Kellermann1-13/+0
Do all the software volume stuff inside each output thread, not in the player thread. This allows one software mixer per output device, and also allows the user to configure the mixer type (hardware or software) for each audio output. This moves the global "mixer_type" setting into the "audio_output" section, deprecating the "mixer_enabled" flag.
2009-03-27mixer: assert that the new volume value is validMax Kellermann1-0/+1
Added an assertion in mixer_set_volume(). Removed the range checks from the ALSA and OSS plugins.
2009-03-27mixer_control: don't lock the mutex twice in mixer_failed()Max Kellermann1-5/+14
The function mixer_failed() expects the mixer mutex to be already locked, yet it calls mixer_close(), which attempts to lock the mutex again, deadlocking itself.
2009-03-26mixer: don't reopen failed mixer automaticallyMax Kellermann1-2/+6
If a (global) mixer has been closed due to failure, don't reopen it with every volume get/set. Leave it closed until it is explicitly opened.
2009-03-26mixer_control: close mixer on failureMax Kellermann1-0/+16
When getting or setting the volume fails, the MPD core close the mixer. Moved the duplicated code from the mixer plugins.
2009-03-26mixer: added flag "open"Max Kellermann1-4/+37
Remember if a mixer object is open or closed. Don't call open() again if it is already open. This guarantees that the mixer plugin is always called in a consistent state, and we will be able to remove lots of checks from the implementations. To support mixers which are automatically opened even if the audio output is still closed (to set the volume before playback starts), this patch also adds the "global" flag to the mixer_plugin struct. Both ALSA and OSS set this flag, while PULSE does not.
2009-03-26mixer_control: don't allow mixer==NULLMax Kellermann1-9/+7
As a side effect, the previous patch added the mixer==NULL checks. It is now illegal to call mixer functions with a NULL argument. Convert the runtime checks to assertions.
2009-03-14mixer: protect the mixer struct with a mutexMax Kellermann1-3/+28
In some rare cases, there was a race condition between the output thread and the main thread: when you disable/enable an output device in the main thread, this caused a crash in the output thread. Protect the whole mixer struct with a GMutex to prevent that.
2009-03-14mixer_api: moved functions to mixer_control.cMax Kellermann1-0/+76
mixer_control.h should provide the functions needed to manipulate a mixer, without exposing the internal mixer API (which is provided by mixer_api.h).
2009-03-14mixer_control: moved functions to mixer_all.cMax Kellermann1-61/+0
2009-03-13all: Update copyright header.Avuton Olrich1-3/+4
This updates the copyright header to all be the same, which is pretty much an update of where to mail request for a copy of the GPL and the years of the MPD project. This also puts all committers under 'The Music Player Project' umbrella. These entries should go individually in the AUTHORS file, for consistancy.
2009-03-12mixer_control: don't touch mixers of disabled outputsMax Kellermann1-0/+6
When an audio output device is disabled, also disable its mixer.
2009-03-12audio: converted device number check to assertionMax Kellermann1-4/+4
No caller must ever pass an invalid device number to mixer_control_setvol() or mixer_control_getvol().
2009-03-12audio: moved mixer functions to mixer_control.cMax Kellermann1-48/+11
2009-02-16mixer: include cleanupMax Kellermann1-0/+1
Don't include conf.h in mixer_api.h. Use a forward struct declaration instead.
2009-02-16output: include cleanupMax Kellermann1-0/+1
Don't include output_api.h in output_internal.h. This change requires adding missing includes in several sources.
2009-02-16mixer_api: replaced method "control()" with "{get,set}_volume()"Max Kellermann1-6/+14
The method control() is too complicated, and overengineered. Replace it with two trivial functions: get_volume() and set_volume().
2009-02-16output_plugin: replaced method "control()" with "mixer()"Max Kellermann1-6/+10
The output plugin shouldn't know any specifics of the mixer API. Make it return the mixer object, and let the caller deal with it.
2009-02-11audio: moved code to output_command.cMax Kellermann1-35/+0
The output_command library provides a command interface to the audio outputs. It assumes the input comes from an untrusted source (i.e. the client) and verifies all parameters.
2009-02-11audio: replaced parseAudioConfig() with audio_format_parse()Max Kellermann1-57/+8
Added audio_format_parse() in a separate library, with a modern interface: return a GError instead of logging errors. This allows the caller to deal with the error.
2009-02-10audio: moved code to output_all.cMax Kellermann1-255/+20
Moved code which deals with all audio outputs at once into a separate library.
2009-02-10audio: moved protocol code to output_print.cMax Kellermann1-16/+0
2009-02-10audio: moved state file code to output_state.cMax Kellermann1-53/+0
2009-02-10audio: removed isCurrentAudioFormat()Max Kellermann1-8/+0
This function isn't used anymore.
2009-02-10audio: added output enumeration functionsMax Kellermann1-0/+22
Added audio_output_get(), audio_output_find().
2009-02-10audio: added audio_output_config_count()Max Kellermann1-1/+7
audio_output_config_count() returns the number of audio outputs in the configuration file. It is only used by initAudioDriver(). The public function audio_output_count() now returns audioOutputArraySize.
2009-01-25use g_free() instead of free()Max Kellermann1-1/+1
On some platforms, g_free() must be used for memory allocated by GLib. This patch intends to correct a lot of occurrences, but is probably not complete.
2009-01-25mixer: removed mixer_configure_legacy(), AC_MIXER_CONFIGUREMax Kellermann1-17/+0
Those have been superseded by the new legacy configuration code.
2009-01-25conf: const pointers in block get functionsMax Kellermann1-3/+3
All config_get_block_*() functions should accept constant config_param pointers.
2009-01-17conf: no CamelCase, part IMax Kellermann1-6/+6
Renamed functions, types, variables.
2009-01-04renaming mixer.h to mixer_api.hViliam Mateicka1-1/+1
2009-01-03audio: use GLib instead of utils.hMax Kellermann1-2/+2
2008-12-31Moving mixers to audio outputsViliam Mateicka1-0/+55
2008-12-31exporting functionsViliam Mateicka1-1/+1
2008-12-29removed os_compat.hMax Kellermann1-1/+2
Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.