summaryrefslogtreecommitdiff
path: root/src/volume.c
AgeCommit message (Collapse)Author
2009-03-14mixer_api: moved functions to mixer_control.cMax Kellermann
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-14volume: moved code to mixer_all.cMax Kellermann
2009-03-14volume: use bool instead of intMax Kellermann
Return true/false on success/failure, instead of 0/-1. Pass true/false instead of 1/0 for the "rel" boolean parameter.
2009-03-13all: Update copyright header.Avuton Olrich
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-12audio: moved mixer functions to mixer_control.cMax Kellermann
2009-03-12volume: removed unused variable "default_mixer"Max Kellermann
2009-03-02mixer: adding code to optionally disable all hw mixersViliam Mateicka
2009-02-28volume: throttle access to hardware mixersMax Kellermann
On some hardware, reading the mixer value from hardware is an expensive operation, and MPD has to do it for every client. Throttle access to the hardware, cache the result for one second.
2009-02-26mixer: Add "disabled" mixer_type.Avuton Olrich
2009-02-10audio: moved code to output_all.cMax Kellermann
Moved code which deals with all audio outputs at once into a separate library.
2009-01-25mixer: configure legacy mixer before the audio outputsMax Kellermann
Reimplemented the legacy mixer configuration: copy the deprecated configuration values into the audio_output section. Don't configure the mixers twice (once for the audio_output, and a second time for the legacy values). This requires volume_init() to be called before initAudioDriver().
2009-01-25conf: const pointers in block get functionsMax Kellermann
All config_get_block_*() functions should accept constant config_param pointers.
2009-01-17conf: no CamelCase, part IMax Kellermann
Renamed functions, types, variables.
2009-01-11removing mixer_reconfigure memmory leak, fixing configure of alsa and oss ↵Viliam Mateicka
mixer (passing parameters)
2009-01-07pcm_utils: moved code to pcm_volume.cMax Kellermann
Moved the software volume code to a separate library.
2009-01-03don't include utils.h when it isn't usedMax Kellermann
2009-01-01mixer: renamed mix_* options to mixer_*Max Kellermann
There is no reason to use the shortcut "mix" instead of "mixer".
2008-12-31Moving mixers to audio outputsViliam Mateicka
2008-12-29volume: use GLib loggingMax Kellermann
2008-12-29removed os_compat.hMax Kellermann
Only include headers which are really needed. os_compat.h aimed to make MPD easily portable, but was never actually made portable.
2008-12-28utils: removed myFgets()Max Kellermann
Replaced myFgets() with fgets() + g_strchomp().
2008-12-02replaced mpd_likely/mpd_unlikely by G_LIKELY/G_UNLIKELYThomas Jansen
We want to remove gcc.h eventually. This takes care of all the G_LIKELY/G_UNLIKELY macros.
2008-11-14volume: eliminate alloca() usageMax Kellermann
alloca() is not a portable function. Don't use it. Using strncasecmp() is much more efficient anyway, because no memory needs to be allocated and copied.
2008-11-14volume: moved code to oss_mixer_find()Max Kellermann
2008-11-11pcm_volume: added constant PCM_VOLUME_1Max Kellermann
It may be desirable to change the range of integer volume levels (e.g. to 1024, which may utilize shifts instead of expensive integer divisions). Introduce the constant PCM_VOLUME_1 which describes the integer value for "100% volume". This is currently 1000.
2008-11-11pcm_utils: added inline function pcm_float_to_volume()Max Kellermann
2008-10-28utils: use g_str_has_prefix() instead of prefixcmp()Max Kellermann
Remove duplicated code from MPD.
2008-10-14command: added command "idle"Max Kellermann
"idle" waits until something noteworthy happens on the server, e.g. song change, playlist modified, database updated. This allows clients to keep up to date without polling.
2008-09-23start using prefixcmp()Eric Wong
LOC reduction and less noise makes things easier for tired old folks to follow.
2008-09-23volume: oops, only #include <alloca.h> if OSS is enabledEric Wong
2008-09-23oss: avoid heap allocations when configuring mixerEric Wong
Noticed-by: Courtney Cavin
2008-09-07volume: don't pass "fd" to changeVolumeLevel()Max Kellermann
The "volume" library shouldn't talk to the client. Move error handling to command.c.
2008-08-26renamed player.c to player_control.cMax Kellermann
Give player.c a better name, meaning that the code is used to control the player thread.
2008-08-26enable -Wpointer-arith, -Wstrict-prototypesMax Kellermann
Also enable -Wunused-parameter - this forces us to add the gcc "unused" attribute to a lot of parameters (mostly library callback functions), but it's worth it during code refactorizations.
2008-04-12clean up CPP includesMax Kellermann
Try to only include headers which are really needed. We should particularly check all "headers including other headers". The long-term goal is to have a manageable, small API for plugins (decoders, output) without so many mpd internals cluttering the namespace. git-svn-id: https://svn.musicpd.org/mpd/trunk@7319 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-03-26fix "unreachable code" warningMax Kellermann
There is unreachable code at several positions, e.g. after an #if/#end, or after an endless loop. Remove that. git-svn-id: https://svn.musicpd.org/mpd/trunk@7197 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-02-05fix -Wconst warningsMax Kellermann
[ew: cleaned up the dirty union hack a bit] Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7180 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-26fixed -Wshadow warningsMax Kellermann
Signed-off-by: Eric Wong <normalperson@yhbt.net> git-svn-id: https://svn.musicpd.org/mpd/trunk@7143 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2008-01-03Cleanup #includes of standard system headers and put them in one placeEric Wong
This will make refactoring features easier, especially now that pthreads support and larger refactorings are on the horizon. Hopefully, this will make porting to other platforms (even non-UNIX-like ones for masochists) easier, too. os_compat.h will house all the #includes for system headers considered to be the "core" of MPD. Headers for optional features will be left to individual source files. git-svn-id: https://svn.musicpd.org/mpd/trunk@7130 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-05-26Changing all calls to ERROR() followed by exit(EXIT_FAILURE) with a singleJ. Alexander Treuman
call to FATAL(). git-svn-id: https://svn.musicpd.org/mpd/trunk@6276 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-04-05The massive copyright updateAvuton Olrich
git-svn-id: https://svn.musicpd.org/mpd/trunk@5834 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2007-01-14Don't initialize globals to zero (or NULL)Eric Wong
Some compilers and linkers aren't smart enough to optimize this, as global variables are implictly initialized to zero. As a result, binaries are a bit smaller as more goes in the .bss and less in the text section. git-svn-id: https://svn.musicpd.org/mpd/trunk@5254 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-26Replace strdup and {c,re,m}alloc with x* variants to check for OOM errorsEric Wong
I'm checking for zero-size allocations and assert()-ing them, so we can more easily get backtraces and debug problems, but we'll also allow -DNDEBUG people to live on the edge if they wish. We do not rely on errno when checking for OOM errors because some implementations of malloc do not set it, and malloc is commonly overridden by userspace wrappers. I've spent some time looking through the source and didn't find any obvious places where we would explicitly allocate 0 bytes, so we shouldn't trip any of those assertions. We also avoid allocating zero bytes because C libraries don't handle this consistently (some return NULL, some not); and it's dangerous either way. git-svn-id: https://svn.musicpd.org/mpd/trunk@4690 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-11Spelling & GrammarAvuton Olrich
git-svn-id: https://svn.musicpd.org/mpd/trunk@4612 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-08-09labels should be on the left most column, no tabbingWarren Dukes
git-svn-id: https://svn.musicpd.org/mpd/trunk@4605 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30software volume can now be saved and read from the state fileEric Wong
git-svn-id: https://svn.musicpd.org/mpd/trunk@4495 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30commandError() cleanups, fixup gcc checksEric Wong
stripped binary size reduced by 9k on my machine from making commandError a function. We'll print out error messages slightly slower before, but the smaller binary is more than worth it. git-svn-id: https://svn.musicpd.org/mpd/trunk@4488 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-30interface/connection malloc reductions from mpd-keEric Wong
This patch massively reduces the amount of heap allocations at the interface/command layer. Most commands with minimal output should not allocate memory from the heap at all. Things like repeatedly polling status, currentsong, and volume changes should be faster as a result, and more importantly, not a source of memory fragmentation. These changes should be safe in that there's no way for a remote-client to corrupt memory or otherwise do bad stuff to MPD, but an extra set of eyes to review would be good. Of course there's never any warranty :) No longer do we use FILE * structures in the interface, which means we don't have to allocate any new memory for most connections. Now, before you go on about losing the buffering that FILE * +implies+, remember that myfprintf() never took advantage of any of the stdio buffering features. To reduce the diff and make bugs easier to spot in the diff, I've kept myfprintf in places where we write to files (and not network interfaces). Expect myfprintf to go away entirely soon (we'll use fprintf for writing regular files). git-svn-id: https://svn.musicpd.org/mpd/trunk@4483 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-20Add mpd-indent.shAvuton Olrich
Indent the entire tree, hopefully we can keep it indented. git-svn-id: https://svn.musicpd.org/mpd/trunk@4410 09075e82-0dd4-0310-85a5-a0d7c8717e4f
2006-07-17alsa: fix memory leaks from snd_*_open*()Eric Wong
ALSA uses a global config structure that's overwritten (and not free'd) every time one of those functions is called, so we have to manually call snd_config_update_free_global() to release it. Hint taken from MEMORY-LEAK in the ALSA source code git-svn-id: https://svn.musicpd.org/mpd/trunk@4381 09075e82-0dd4-0310-85a5-a0d7c8717e4f