summaryrefslogtreecommitdiffstats
path: root/mixer.h
Commit message (Collapse)AuthorAgeFilesLines
* mixer: support native audio driver muteUoti Urpala2012-04-111-0/+2
| | | | | | | | | | | | | Make mixer support setting the mute attribute at audio driver level, if one exists separately from volume. As of this commit, no libao2 driver exposes such an attribute yet; that will be added in later commits. Since the mute status can now be set externally, it's no longer completely obvious when the player should automatically disable mute when uninitializing an audio output. The implemented behavior is to turn mute off at uninitialization if we turned it on and haven't noticed it turn off (by external means) since.
* audio: fix unmute-at-end logicUoti Urpala2012-04-111-0/+1
| | | | | | | | | | | | The player tried to disable mute before exiting, so that if mute is emulated by setting volume to 0 and the volume setting is a system-global one, we don't leave it at 0. However, the logic doing this at process exit was flawed, as volume settings are handled by audio output instances and the audio output that set the mute state may have been closed earlier. Trying to write reliably working logic that restores volume at exit only would be tricky, so change the code to always unmute an audio driver before closing it and restore mute status if one is opened again later.
* audio: restore balance setting after reinitUoti Urpala2012-04-111-0/+1
| | | | | | | Restore the audio balance setting when the audio chain is reinitialized (also after switching to another file). Also add a note about the balance code being seriously buggy.
* audio: restore volume setting after AO reinit if neededUoti Urpala2012-04-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | MPlayer volume control was originally implemented with the assumption that it controls a system-wide volume setting which keeps its value even if a process closes and reopens the audio device. However, this is not actually true for --softvol mode or some audio output APIs that only consider volume as a per-client setting for software mixing. This could have annoying results, as the volume would be reset to a default value if the AO was closed and reopened, for example whem moving to a new file or crossing ordered chapter boundaries. Add code to set the previous volume again after audio reinitialization if the current audio chain is known to behave this way (softvol active or the AO driver is known to not keep persistent volume externally). This also avoids an inconsistency with the mute flag. The frontend assumed the mute status is persistent across file changes, but it could be similarly lost. The audio drivers that are assumed to not keep persistent volume are: coreaudio, dsound, esd, nas, openal, sdl. None of these changes have been tested. I'm guessing that ESD and NAS do per-connection non-persistent volume settings. Partially based on code by wm4.
* audio: keep volume level internally (not only in AO)Uoti Urpala2012-04-111-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current volume was always queried from the the audio output driver (or filter in case of --softvol). The only case where it was stored on mixer level was that when turning off mute, volume was set to the value it had before mute was activated. Change the mixer code to always store the current target volume internally. It still checks for significant changes from external sources and resets the internal value in that case. The main functionality changes are: Volume will now be kept separately from mute status. Increasing or decreasing volume will now change it relative to the original value before mute, even if mute is implemented by setting AO level volume to 0. Volume changes no longer automatically disable mute. The exception is relative changes up (like the volume increase key in default keybindings); that's the only case which still disables mute. Keeping the value internally avoids problems with granularity of possible volume values supported by AO. Increase/decrease keys could work unsymmetrically, or when specifying a smaller than default --volstep, even fail completely. In one case occurring in practice, if the AO only supports changing volume in steps of about 2 and rounds down the requested volume, then volume down key would decrease by 4 but volume up would increase by 2 (previous volume plus or minus the default change of 3, rounded down to a multiple of 2). Now, the internal value will keep full precision.
* options: move mixer.h options to structUoti Urpala2012-03-201-5/+4
|
* mixer: reindent/cosmetic changeswm42012-03-201-4/+1
| | | | | | There should be no real semantic changes. Remove the mixer_setbothvolume macro, as it was unused.
* audio: change external AO interface to "ao_[method](ao, ...)"Uoti Urpala2011-04-091-1/+1
| | | | | | | | Make the outside interface of audio output handling similar to the video output one. An AO object is first created, and then methods called with ao_[methodname](ao, args...). However internally libao2/ still holds all data in globals, and trying to create multiple simultaneous AO instances won't work.
* Add license header to all top-level files missing them.diego2010-01-301-0/+18
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30471 b3059339-0415-0410-9bf9-f77b7e298cf2
* Get rid of pointless 'extern' keywords.diego2008-12-031-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28085 b3059339-0415-0410-9bf9-f77b7e298cf2
* ao_functions_t should be const, part 1reimar2008-02-011-1/+1
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25945 b3059339-0415-0410-9bf9-f77b7e298cf2
* Identifiers starting with underscores are reserved.diego2007-07-311-3/+3
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23954 b3059339-0415-0410-9bf9-f77b7e298cf2
* The audio balance feature implemented with af_pan.zuxy2007-06-201-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23588 b3059339-0415-0410-9bf9-f77b7e298cf2
* allow forcing of software volume control and setting maximum amplification.reimar2004-11-141-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13934 b3059339-0415-0410-9bf9-f77b7e298cf2
* New 'Mixer API' with ability to change volume through libaf (this part was ↵alex2004-06-261-9/+18
| | | | | | written by Reimar Doffinger) and lesser global variables git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12673 b3059339-0415-0410-9bf9-f77b7e298cf2
* add option to select mixer channelattila2004-01-241-0/+1
| | | | | | | patch by Catalin Muresan <catalin.muresan@astral.ro> git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11838 b3059339-0415-0410-9bf9-f77b7e298cf2
* add mute support ( step 1 ) and fixed panscan bugs (1000l for me)pontscho2002-06-061-0/+2
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6312 b3059339-0415-0410-9bf9-f77b7e298cf2
* Moved HW dependent mixer stuff to libao and removed master switchanders2002-02-211-3/+0
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4789 b3059339-0415-0410-9bf9-f77b7e298cf2
* applied solaris8/netbsd/other fixes patch by Jürgen Keil <jk@tools.de>arpi_esp2001-06-051-4/+4
| | | | git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1039 b3059339-0415-0410-9bf9-f77b7e298cf2
* ups, I missed'em..gabucino2001-04-151-0/+19
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@442 b3059339-0415-0410-9bf9-f77b7e298cf2