Commit Graph

43 Commits

Author SHA1 Message Date
nia 6094acde02
NetBSD build fix (#487) 2022-06-11 20:23:31 +02:00
Baptiste Daroussin db279644c3
Fix freebsd (#464)
* FreeBSD: catchup with the internal changes in code

* FreeBSD: use statvfs instead on statfs

Follow NetBSD here while here, catch up with code architecture changes
2021-11-25 08:55:33 +01:00
Michael Stapelberg 73c6eb2d4c use param structs everywhere for consistency 2021-11-02 21:45:31 +01:00
Michael Stapelberg ffedf14066 volume: fix colors (+param struct) 2021-11-02 21:11:06 +01:00
Felix Buehler 269c06c4bb [volume] fix memory leak
mend
2020-04-26 23:00:41 +02:00
Felix Buehler 44fad4d2cd use format_placeholder for volume 2020-04-07 23:02:30 +02:00
nia 9b8403ac84 print_volume: Native NetBSD audio support
Avoid using the OSS emulation layer to fetch the master volume,
and instead share the audioio code with OpenBSD.

Avoid a failed read on the master control's mute enum if it can't
be found, because sometimes there isn't one.
2020-03-11 23:29:56 +00:00
Thomas Klausner 5aec4a5da3 Improve NetBSD port. (#361)
Detect and link against ossaudio.

Comment out unused code and functions.
2019-07-29 13:46:20 -07:00
Michael Stapelberg 23da59920c make pulseaudio an optional dependency, follow best practices
For my thoughts about optional dependencies, see
https://michael.stapelberg.ch/posts/2019-05-23-optional-dependencies/

This commit follows the best practices outlined in that article:

1. The travis config was modified to verify both code paths build and link/don’t
   link against pulseaudio.

2. If pulseaudio is missing, the build fails until packagers explicitly pass a
   --disable flag. In practice, I think the only situation when this flag should
   be set is in source-based linux distributions where users can express
   package-level compilation preferences (e.g. Gentoo USE flags).

3. The --version output now reflects the status of the optional dependency.

fixes #359
2019-07-29 21:07:40 +02:00
Michael Stapelberg a57cdc84e2
Switch to autotools (#316) 2019-01-23 08:56:40 +01:00
Denton Liu 7efbeeaf6c Implement %devicename specifier for volume module (#325)
This commit implements the %devicename specifier for the volume module
for both PulseAudio and ALSA. This way, i3status will be able to display
the specific device that corresponds to the volume indicator.

Note that this is not implemented for the OSS API but is left in a state
where someone can pick it up for the future.
2019-01-23 08:45:51 +01:00
Eugene Dzhurinsky 696ddf461f
Fixed ALSA capture device monitoring.
When using ALSA, the "Capture" mixer doesn't have the playback channel,
instead "capture"-related methods should be used to get information
about the current volume / state of the mixer.
2019-01-03 21:59:33 -05:00
arcnmx ddadc8e4d7 Provide a more natural volume percentage with ALSA.
The rationale of the code is explained in the header:
http://git.alsa-project.org/?p=alsa-utils.git;a=blob;f=alsamixer/volume_mapping.c;h=1c0d7c45e6686239464e1b0bbc8983ea57f3914f;hb=HEAD
> The mapping is designed so that the position in the interval is
> proportional to the volume as a human ear would perceive it (i.e., the
> position is the cubic root of the linear sample multiplication
> factor).

and the commit message:
http://git.alsa-project.org/?p=alsa-utils.git;a=commit;h=34bb514b5fd1d6f91ba9a7b3a70b0ea0c6014250
> use a mapping where the bar height is proportional to the audible
> volume, i.e., where the amplitude is the cube of the bar height.

and further explanation can be found in the pull request:
https://github.com/i3/i3status/pull/268#pullrequestreview-147429763
2018-10-11 00:21:03 +03:00
Antonio Huete Jimenez deca11c0a0 Do not use pulseaudio for DragonFly BSD 2018-07-14 20:23:22 +00:00
Felix Buehler 52e9f6f63b able to print percentage
its now possible to have percentage before and after a variable. except
for the date. But percentage with dates does not make much sense to me, so
i skipped it.
2018-07-13 15:03:31 +02:00
Olivier Gayot 598b76cc53 Make sure the arguments passed to printf/die(...) match the format
Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>
2018-06-20 14:20:17 +02:00
Carlin Bingham 5b416d4ac0 OpenBSD: fix volume display on some hardware
On some hardware the AUDIO_MIXER_READ ioctl requires the current number
of channels to be set, and the mute device found needs to be checked if
it belongs to the master output device.
2018-02-13 02:12:04 +13:00
Watcom 8d2ef5f99b pulse device may be specified by name (#126) (#162) 2016-09-14 09:26:45 +02:00
Brendan Van Hook a13b2e7288 Added support for lemonbar 2015-10-04 14:52:32 -04:00
Dmitrij D. Czarkoff 15f2279592 Use SndIO for volume module on OpenBSD
* add audio(4) code by Robert Nagy
 * disable PulseAudio

While at OpenBSD support, add "-pthread" to LIBS.
2015-08-01 17:35:09 +02:00
Watcom Hecht f779da1a59 PulseAudio muted volume support (fixes #27) 2015-04-19 13:28:26 -03:00
Watcom Hecht 1710c206cf PulseAudio support for volume input 2015-04-03 17:57:40 -03:00
Watcom Hecht b12e11237b refactoring to avoid code duplication 2015-03-29 17:05:26 -03:00
Baptiste Daroussin eaf5d6bf80 print_volume: don’t return, complete the buffer first
Follow the changed done for Linux on f0cd726b
2015-03-25 08:13:47 +01:00
Michael Stapelberg d74e904bf4 clang-format-3.5 -i **/*.[ch], update modeline
From here on, we’ll use clang-format to automatically format the source.

This has worked well in i3, so we are introducing it for i3status.
2015-03-16 10:01:07 +01:00
Michael Stapelberg 8a57208b1d Bugfix: fix wrong color tags with xmobar
fixes #1353
2014-08-26 20:54:04 +02:00
Gereon Kremer 4bd0ba88c8 Added different format string for volume in case it is muted.
If the volume is muted, the volume level would simply be displayed as zero and the color changed to color_degraded.
This patch lets the user define a custom format string for when the volume is muted.
The default value is "♪: 0%" ("♪: %volume" being the usual format).
2013-11-18 22:31:42 +01:00
oblique 8445d6a929 print_volume(linux): Open a new mixer every time.
This fix the following bug:
    If you switch your sound card on-the-fly, print_volume continued to
    use the old sound card.
2013-05-19 19:48:07 +02:00
Michael Stapelberg f0cd726bf0 print_volume: don’t return, complete the buffer first
Otherwise, i3bar will display “SPEC VIOLATION” because full_text is
missing in the block.
2013-03-19 19:56:44 +01:00
Baptiste Daroussin f30ec89b79 Support mixer_idx with OSS
make mixer_idx load the default mixer
2013-03-19 19:53:26 +01:00
Baptiste Daroussin 7f83d0a197 Show degraded colors in case volume is muted with OSS 2013-03-19 18:36:49 +01:00
Gereon Kremer 6147e2b268 changing volume color from bad to degraded if muted 2013-01-05 08:37:20 +01:00
Scott Tincman 0eeded8bc0 DragonFlyBSD support added 2012-11-15 12:31:17 +01:00
Michael Stapelberg 7dcc961fa2 Bugfix: Move the pbval definition outside the ifdef (Thanks XTaran)
This fixes compilation on !linux
2012-10-03 15:12:49 +02:00
Simon Elsbrock 1c4677a644 turn volume into red if muted
fixes #743
2012-09-05 23:28:27 +02:00
Michael Stapelberg 296eb5e706 Error handling: Never output null as full_text (JSON), prefix messages with i3status (Thanks Artemis)
The former made i3bar crash, the latter is helpful for debugging.
2012-05-09 18:56:57 +02:00
Jasper Lievisse Adriaanse aabac78fd0 Print the volume on OpenBSD too. Add missing library to Makefile accordingly. 2012-04-29 11:13:29 +02:00
Michael Stapelberg 1b3aa40485 add yajl compat code 2012-04-08 14:05:47 +02:00
Michael Stapelberg 12b1bfa9b8 Properly output JSON with libyajl 2012-03-25 22:05:00 +02:00
Michael Stapelberg d5b4c8e368 Implement the i3bar JSON protocol
This hardcodes all the JSON parts. Strings are not properly escaped currently.
The best/easiest way to fix this is by actually using libyajl.
2012-02-16 23:30:54 +00:00
Baptiste Daroussin d87a735be5 Add simple volume support on FreeBSD 2011-07-24 02:12:23 +02:00
Axel Beckert 5e276db583 Fix FTBFS on kFreeBSD 2011-07-21 22:02:34 +02:00
Michael Stapelberg eb46963d4c Implement ALSA volume support 2010-07-20 19:33:41 +02:00