mirror of
https://github.com/gryf/wmamixer.git
synced 2025-12-18 12:00:22 +01:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1a21b9d42f | |||
| a60507c8df | |||
| 93e9c32cfc | |||
| febbf8a42d | |||
| 3c7e9e82a6 | |||
| 14065492e7 |
50
README
50
README
@@ -1,50 +0,0 @@
|
||||
wmamixer
|
||||
========
|
||||
|
||||
Wmamixer is a fork of wmsmixer and is an ALSA mixer dockapp for Window Maker.
|
||||
|
||||
The code for the ALSA part was taken and adapted from amixer and alsamixer
|
||||
programs from alsa-utils package.
|
||||
|
||||
Bugs
|
||||
----
|
||||
|
||||
If spotted any bug, please report it using bug tracker on bitbucket.
|
||||
|
||||
Changes
|
||||
-------
|
||||
|
||||
Changes with comparison with wmsmixer:
|
||||
|
||||
- ALSA instead of OSS. This is the real thing, using alsa-lib, not just
|
||||
emulation of OSS.
|
||||
- Removed config file support, since it doesn't apply anymore
|
||||
|
||||
Limitations
|
||||
-----------
|
||||
|
||||
1. Currently, wmamixer does not support switches and enum type of controls.
|
||||
Only volume is supported. Enum and switch based ALSA controls are simply
|
||||
ignored.
|
||||
|
||||
2. There are controls with really small limit range, for example here is
|
||||
control Beep (pc speaker in other words) which is represented by amixer like
|
||||
this:
|
||||
|
||||
Simple mixer control 'Beep',0
|
||||
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
|
||||
Playback channels: Mono
|
||||
Limits: Playback 0 - 3
|
||||
Mono: Playback 1 [33%] [-12.00dB] [on]
|
||||
|
||||
Under "Limits" section, there is a Playback capability with range 0 - 3. Using
|
||||
scrollwheel on such low ranges is somehow awkward. For that controls it's
|
||||
better to use clicking instead of scrolling.
|
||||
|
||||
|
||||
Links
|
||||
-----
|
||||
wmsmixer homepage:
|
||||
http://web.archive.org/web/20081024034859/http://www.hibernaculum.net/wmsmixer/index.php
|
||||
ALSA homepage:
|
||||
http://www.alsa-project.org
|
||||
151
README.rst
Normal file
151
README.rst
Normal file
@@ -0,0 +1,151 @@
|
||||
wmamixer
|
||||
========
|
||||
|
||||
Wmamixer is a fork of `wmsmixer`_ and is an `ALSA`_ mixer dockapp for Window
|
||||
Maker.
|
||||
|
||||
The code for the `ALSA`_ part was taken and adapted from amixer and alsamixer
|
||||
programs from alsa-utils package.
|
||||
|
||||
.. image:: /images/wmamixer.gif?raw=true
|
||||
:alt: wmamixer overview
|
||||
|
||||
Build
|
||||
-----
|
||||
|
||||
To build the dockapp, just perform following command in the project topmost
|
||||
directory:
|
||||
|
||||
.. code:: shell-session
|
||||
|
||||
$ make
|
||||
|
||||
Next, copy binary ``wmamixer`` in convenient place.
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
To see usage information for the dockapp, pass ``--help`` option from terminal
|
||||
emulator, like:
|
||||
|
||||
.. code:: shell-session
|
||||
|
||||
user@linux ~ $ wmamixer --help
|
||||
|
||||
which will output several lines of information and options:
|
||||
|
||||
* ``-h`` or ``--help`` will display options and exit,
|
||||
* ``-v`` or ``--version`` will display version and exit,
|
||||
* ``-w`` will use *withdrawn state*, which will make wmamixer behave like a
|
||||
Window Maker dockapp,
|
||||
* ``-s`` will make some part of the window transparent,
|
||||
* ``-a`` will make window a bit smaller. Instead of standard 64x64 pixels, it
|
||||
will be 56x56 pixels, additionally with transparent background. This mode is
|
||||
useful for placing it in AfterStep Wharf,
|
||||
* ``-l`` with a color as an argument will change led color (default bright
|
||||
greenish),
|
||||
* ``-b`` with a color as an argument will change background for the led color
|
||||
(default dark greenish). Colors can be specified using `X11 color names`_, or
|
||||
by hexadecimal number in #RGB format, like:
|
||||
|
||||
.. code:: shell-session
|
||||
|
||||
user@linux ~ $ wmamixer -l red -b '#ffff00' # red led on yellow background
|
||||
user@linux ~ $ wmamixer -b darkslateblue # Dark Slate Blue background
|
||||
|
||||
* ``-d`` selects desired ALSA device. By default, first device, which is called
|
||||
``default`` is selected. That device is taken by pulseaudio nowadays, so
|
||||
you'll see only two controls: one for master volume and the other for capture
|
||||
volume. To be able to change all supported by soundcard controls, you need to
|
||||
pass right PCM device to this option. First, you need to know which device
|
||||
need to be passed as an argument to ``-d`` option. To list ALSA devices you
|
||||
might use ``aplay`` program from ``alsa-utils`` package:
|
||||
|
||||
.. code:: shell-session
|
||||
|
||||
user@linux ~ $ aplay -l
|
||||
**** List of PLAYBACK Hardware Devices ****
|
||||
card 0: HDMI [HDA Intel HDMI], device 3: HDMI 0 [HDMI 0]
|
||||
Subdevices: 1/1
|
||||
Subdevice #0: subdevice #0
|
||||
card 0: HDMI [HDA Intel HDMI], device 7: HDMI 1 [HDMI 1]
|
||||
Subdevices: 1/1
|
||||
Subdevice #0: subdevice #0
|
||||
card 0: HDMI [HDA Intel HDMI], device 8: HDMI 2 [HDMI 2]
|
||||
Subdevices: 1/1
|
||||
Subdevice #0: subdevice #0
|
||||
card 1: PCH [HDA Intel PCH], device 0: 92HD91BXX Analog [92HD91BXX Analog]
|
||||
Subdevices: 0/1
|
||||
Subdevice #0: subdevice #0
|
||||
|
||||
So in above example there are two sound devices, which one is HDMI and the
|
||||
other PCH. To select PCH device, it is enough to invoke ``wmamixer`` like:
|
||||
|
||||
.. code:: shell-session
|
||||
|
||||
user@linux ~ $ wmamixer -d hw:1
|
||||
|
||||
where ``hw:1`` means the second card (you can see it within the line ``card
|
||||
1: PCH [HDA Intel PCH], device 0: 92HD91BXX Analog [92HD91BXX Analog]`` on
|
||||
``aplay -l`` output in the example above),
|
||||
* ``-position`` with appropriate argument (usually ``+0+0`` for top-left
|
||||
corner) will try to convince window manager to place application in certain
|
||||
position,
|
||||
* ``-display`` with correct *X11 display* will try to use specified display
|
||||
instead of current one (usually ``:0``).
|
||||
|
||||
User interface is straightforward.
|
||||
|
||||
.. image:: /images/wmamixer_gui.png
|
||||
:alt: wmamixer gui elements
|
||||
|
||||
1. Volume level indicator of currently selected mixer.
|
||||
2. Icon for currently selected mixer. If clicked, will show abbreviated mixer
|
||||
name for a short time on volume level indicator.
|
||||
3. Cycles through available mixers.
|
||||
4. Volume bar. Clicking on the volume bar between the left and right channels
|
||||
will set same volume level for both of them. Mouse scroll will adjust
|
||||
volume for both channels at the same time.
|
||||
5. If clicked on left or right bar, volume will be adjusted for selected mixer
|
||||
left or right channel accordingly. Note, that not all mixers have ability to
|
||||
adjust volume for each channels separately. Mouse scroll will adjust volume
|
||||
for both channels as in point 4.
|
||||
|
||||
Bugs
|
||||
----
|
||||
|
||||
If spotted any bug, please report it using bug tracker on bitbucket or github.
|
||||
|
||||
Changes
|
||||
-------
|
||||
|
||||
Changes with comparison with `wmsmixer`_:
|
||||
|
||||
* `ALSA`_ instead of OSS. This is the real thing, using alsa-lib, not just
|
||||
emulation of OSS.
|
||||
* Removed config file support, since it doesn't apply anymore
|
||||
|
||||
Limitations
|
||||
-----------
|
||||
|
||||
1. Currently, wmamixer does not support switches and enum type of controls.
|
||||
Only volume is supported. Enum and switch based ALSA controls are simply
|
||||
ignored.
|
||||
|
||||
2. There are controls with really small limit range, for example here is
|
||||
control Beep (pc speaker in other words) which is represented by amixer like
|
||||
this::
|
||||
|
||||
Simple mixer control 'Beep',0
|
||||
Capabilities: pvolume pvolume-joined pswitch pswitch-joined
|
||||
Playback channels: Mono
|
||||
Limits: Playback 0 - 3
|
||||
Mono: Playback 1 [33%] [-12.00dB] [on]
|
||||
|
||||
Under "Limits" section, there is a Playback capability with range 0 - 3. Using
|
||||
scrollwheel on such low ranges is somehow awkward. For that controls it's
|
||||
better to use clicking instead of scrolling.
|
||||
|
||||
.. _wmsmixer: http://web.archive.org/web/20081024034859/http://www.hibernaculum.net/wmsmixer/index.php
|
||||
.. _ALSA: http://www.alsa-project.org
|
||||
.. _X11 color names: https://en.wikipedia.org/wiki/X11_color_names
|
||||
@@ -29,7 +29,6 @@ static char * wmamixer_xpm[] = {
|
||||
" ...........................+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@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@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
|
||||
BIN
images/wmamixer.gif
Normal file
BIN
images/wmamixer.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 67 KiB |
BIN
images/wmamixer_gui.png
Normal file
BIN
images/wmamixer_gui.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
@@ -302,14 +302,14 @@ void Mixer_set_selem_props(struct Selem *selem, const char *name) {
|
||||
}
|
||||
}
|
||||
|
||||
void Selem_set_name(struct Selem *selem, const char *name, short int *count) {
|
||||
char new_name[5], buf[5];
|
||||
void Selem_set_name(struct Selem *selem, const char *name, short unsigned int *count) {
|
||||
char new_name[5], buf[4];
|
||||
|
||||
if (*count > 10) {
|
||||
snprintf(new_name, sizeof(new_name), "%s", name);
|
||||
} else {
|
||||
snprintf(buf, sizeof(buf) - 1, "%s", name);
|
||||
snprintf(new_name, sizeof(new_name), "%s%d", buf, *count);
|
||||
snprintf(buf, sizeof(buf), "%s", name);
|
||||
snprintf(new_name, sizeof(new_name), "%s%hu", buf, *count);
|
||||
}
|
||||
|
||||
selem->name = strdup(new_name);
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#define CLASS "Wmamixer"
|
||||
|
||||
|
||||
#define VERSION "0.1"
|
||||
#define VERSION "1.1"
|
||||
|
||||
// User defines - custom
|
||||
#define BACKCOLOR "#202020"
|
||||
@@ -142,7 +142,7 @@ typedef struct {
|
||||
} slideCaptureMono;
|
||||
|
||||
struct NamesCount {
|
||||
short int pcm, line, lineb, mic, micb, capt, vol, aux;
|
||||
short unsigned int pcm, line, lineb, mic, micb, capt, vol, aux;
|
||||
} namesCount = {1, 1, 1, 1, 1, 1, 1, 1};
|
||||
|
||||
struct Selem *selems[32] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||
@@ -194,7 +194,7 @@ void Mixer_set_right(int current, int value);
|
||||
void Mixer_set_limits(snd_mixer_elem_t *elem, struct Selem *selem);
|
||||
void Mixer_set_volume(int current, int channelIndex, int value);
|
||||
|
||||
void Selem_set_name(struct Selem *selem, const char *name, short int *count);
|
||||
void Selem_set_name(struct Selem *selem, const char *name, short unsigned int *count);
|
||||
void Selem_destroy();
|
||||
|
||||
#endif // WMAMIXER_H_
|
||||
|
||||
Reference in New Issue
Block a user