mirror of
https://github.com/gryf/wmamixer.git
synced 2025-12-17 11:30:21 +01:00
Initial cleanup
This commit is contained in:
339
COPYING
Normal file
339
COPYING
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
675 Mass Ave, Cambridge, MA 02139, USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Appendix: How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
4
Makefile
Normal file
4
Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
all:
|
||||
gcc -Wall -Wextra -lXpm -lXext -lX11 -lasound wmamixer.c -o wmamixer
|
||||
|
||||
|
||||
4
README
Normal file
4
README
Normal file
@@ -0,0 +1,4 @@
|
||||
wmamixer
|
||||
--------
|
||||
|
||||
wmamixer is an alsa mixer for windowmaker based on wmsmixer.
|
||||
160
README.wmmixer
Normal file
160
README.wmmixer
Normal file
@@ -0,0 +1,160 @@
|
||||
wmmixer - A mixer designed for WindowMaker
|
||||
05/09/98 Release 1.0 Beta1
|
||||
Copyright (C) 1998 Sam Hawker <shawkie@geocities.com>
|
||||
This software comes with ABSOLUTELY NO WARRANTY
|
||||
This software is free software, and you are welcome to redistribute it
|
||||
under certain conditions
|
||||
See the COPYING file for details.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
THE AUTHOR:
|
||||
===========
|
||||
|
||||
Sam Hawker (17/m/uk)
|
||||
|
||||
shawkie@geocities.com
|
||||
http://www.geocities.com/SiliconValley/Vista/2471/
|
||||
|
||||
|
||||
INSTALLING:
|
||||
===========
|
||||
|
||||
xmkmf
|
||||
make
|
||||
strip wmmixer
|
||||
make install
|
||||
|
||||
|
||||
CONFIGURATION:
|
||||
==============
|
||||
|
||||
Users can configure wmmixer to suit their requirements by means of a ~/.wmmixer
|
||||
file. A commented example is supplied, and would be a good starting point.
|
||||
|
||||
cp home.wmmixer ~/.wmmixer
|
||||
|
||||
|
||||
USAGE:
|
||||
======
|
||||
|
||||
You can access all the channels on your soundcard's mixer with wmmixer. Most
|
||||
common channels are identified with an appropriate icon.
|
||||
Controls include a stereo (mono where appropriate) volume control and a recording
|
||||
source toggle button.
|
||||
|
||||
Press the "<" and ">" arrow buttons to select a channel.
|
||||
The icon identifies the current channel (a volume symbol with a question mark
|
||||
represents an unrecognised channel).
|
||||
Click and/or drag the volume display to set channel volume.
|
||||
There is a also a button to set recording sources.
|
||||
|
||||
|
||||
AFTERSTEP USERS:
|
||||
================
|
||||
(thanks to tygris@erols.com)
|
||||
|
||||
This release includes in a new command line option.
|
||||
The effect this has is to enable shape support (it implies "-s"), and
|
||||
to reduce the size of the window to 56x56 pixels.
|
||||
The "-position position" option has also been added, so you can push
|
||||
wmcdplay off the edge of the screen while it gets swallowed.
|
||||
To put wmmount in your Wharf, add the following line in the appropriate
|
||||
part of your .steprc
|
||||
|
||||
*Wharf wmmount nil MaxSwallow "wmmount" wmmount -a -position -0-0 &
|
||||
|
||||
It is also possible (by editing and recompiling the afterstep sources),
|
||||
to make Wharf handle the new 56x56 pixel window properly - yes, I add
|
||||
an option to use a 56x56 pixel window, even though the AfterStep Wharf
|
||||
really wants 55x57 pixel ones.
|
||||
|
||||
I am told (by tygris@erols.com):
|
||||
|
||||
"Locate Wharf.c (or is it Wharf.cc?) Should be in
|
||||
AfterStep-1.0/modules/Wharf. Locate this:
|
||||
|
||||
if (Buttons[button].maxsize) {
|
||||
Buttons[button].icons[0].w = 55;
|
||||
Buttons[button].icons[0].h = 57;
|
||||
}
|
||||
|
||||
and change the 55 and 57 to 56's. Save and compile."
|
||||
|
||||
|
||||
BUILD PROBLEMS:
|
||||
===============
|
||||
|
||||
You may have trouble linking wmmixer with the compiler supplied on some
|
||||
recent Linux distributions (eg. Debian 2.0 & RedHat 5.1).
|
||||
It can be made to build by adding the following line to the top of the
|
||||
Imakefile, before executing xmkmf:
|
||||
|
||||
CC = c++
|
||||
|
||||
I am not sure of the effect this has on memory usage, etc.
|
||||
|
||||
|
||||
RELEASE HISTORY:
|
||||
================
|
||||
|
||||
Release 0.1 07/02/98 Finally reached a state I am prepared to put my
|
||||
name to.
|
||||
No KNOWN bugs.
|
||||
|
||||
Release 0.2 12/02/98 Fixed nasty memory hole.
|
||||
|
||||
Release 0.3 24/02/98 Fixed bug relating to manual window positioning.
|
||||
|
||||
Release 0.4 04/03/98 Reduced CPU Load (thanks to aseltine@cs.umass.edu).
|
||||
Support for NetBSD (you may need to make it use -lossaudio when linking).
|
||||
(thanks to Geir.I.Jensen@runit.sintef.no)
|
||||
Only updates when it has to now.
|
||||
|
||||
Release 0.5 05/03/98 Better support for NetBSD and FreeBSD.
|
||||
Fixed bug relating to cards with no volume channel.
|
||||
(thanks to dalroi@wit401310.student.utwente.nl)
|
||||
Fixed bug relating to hiding "Rec" checkbox on FreeBSD.
|
||||
(thanks to dalroi@wit401310.student.utwente.nl)
|
||||
|
||||
Release 0.6 12/03/98 Fixed setRec() in mixctl.h.
|
||||
(thanks to Geir.I.Jensen@runit.sintef.no)
|
||||
Now works on 8bpp displays with full colormaps.
|
||||
(thanks to devernay@istar.fr on the mailing-list)
|
||||
Now configurable through a ~/.wmmixer file.
|
||||
(suggested by steeve@minet.net)
|
||||
New channel symbols.
|
||||
(thanks to steeve@minet.net)
|
||||
|
||||
Release 0.7 25/04/98 Better checking of supported channels.
|
||||
Now GPL.
|
||||
Sensible CPU load.
|
||||
New FAQ.
|
||||
New mixctl.h.
|
||||
New look.
|
||||
(thanks to warp@xs4all.nl)
|
||||
|
||||
Release 0.8 06/05/98 Removed broken display code.
|
||||
Added "-b back_color" command line argument.
|
||||
|
||||
Release 0.1 05/09/98 Added a little error checking.
|
||||
Beta1 More delicate volume leds fit in better with other apps.
|
||||
Added "-a" command line argument for AfterStep users.
|
||||
Added "-position position" command line argument.
|
||||
Command line arguments, "-a", "-w" and "-s" are now toggle,
|
||||
so if you enable one at compile-time, you can override
|
||||
it at run-time.
|
||||
Added command to configuration file format.
|
||||
62
README.wmsmixer
Normal file
62
README.wmsmixer
Normal file
@@ -0,0 +1,62 @@
|
||||
wmsmixer - A mixer designed for WindowMaker with scrollwheel support
|
||||
Copyright (C) 2003 Damian Kramer <psiren@hibernaculum.net>
|
||||
Copyright (C) 1998 Sam Hawker <shawkie@geocities.com>
|
||||
This software comes with ABSOLUTELY NO WARRANTY
|
||||
This software is free software, and you are welcome to redistribute it
|
||||
under certain conditions
|
||||
See the COPYING file for details.
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
|
||||
|
||||
|
||||
To install:
|
||||
|
||||
xmkmf
|
||||
make
|
||||
make install
|
||||
|
||||
|
||||
You probably want to read the README.wmmixer file too. Most of that
|
||||
applies to this program, apart from the recsrc code which has been
|
||||
removed.
|
||||
|
||||
The main changes between this and wmmixer are:
|
||||
|
||||
* Added scrollwheel support. If your scrollwheel is mapped to buttons
|
||||
4 and 5, using it will increase/decrease the volume of the current
|
||||
channel.
|
||||
|
||||
* Removed all the recsrc code.
|
||||
|
||||
* Changed the display arrangement slightly, and replaced the recsrc
|
||||
button with a numeric/text display.
|
||||
|
||||
* Added the setname configuration option, which allows you to give a
|
||||
different channel name (4 chars max) to the built in one if you
|
||||
wish.
|
||||
|
||||
* Clicking on the channel icon will briefly display the text name for the
|
||||
channel. This is also displayed when you switch channels.
|
||||
|
||||
* Mono channels have one wide bar rather than two thinner ones.
|
||||
|
||||
* Changed some icons, and added a few new ones. Several icons are
|
||||
still to be created. Any submissions are always welcome.
|
||||
|
||||
|
||||
Please report any bugs to me <psiren@hibernaculum.net>, rather
|
||||
than Sam Hawker. I'm sure he doesn't want to go fixing my cockups ;-)
|
||||
|
||||
16
XPM/chars.xpm
Normal file
16
XPM/chars.xpm
Normal file
@@ -0,0 +1,16 @@
|
||||
/* XPM */
|
||||
static char * chars_xpm[] = {
|
||||
"156 9 4 1",
|
||||
" c #282828 s back_color",
|
||||
". c #004941 s led_color_low",
|
||||
"@ c #20B2AE s led_color_high",
|
||||
"# c #188A86 s led_color_med",
|
||||
" ",
|
||||
" .@@@. #@@@ @@@# #@@@ #@@@# #@@@# #@@@# #...# @@@ ...# #...# #... @...@ #@@@ #@@@# #@@@# #@@@# #@@@# #@@@# #@@@# #...# #...# #...# #...# #...# #@@@#",
|
||||
" @ @ @ @ @ . @ @ @ . @ . @ . @ @ . @ . . @ @ @ @ . @@ @@ @ @ @ @ @ @ @ @ @ @ @ . . @ . @ @ @ @ @ @ @ @ @ @ . @",
|
||||
" @ @ @ @ @ . @ @ @ . @ . @ . @ @ . @ . . @ @ @ @ . @ @ @ @ @ @ @ @ @ @ @ @ @ @ . . @ . @ @ @ @ @ @ @ @ @ @ . @.",
|
||||
" #@@@# #@@@ #... #...# #@@@ #@@@ #.#@# #@@@# .#. ...# #@@ #... #...# #...# #...# #@@@# #@..# #@@@ #@@@# .#. #...# #...# #...# @ #@@@# .@. ",
|
||||
" @ @ @ @ @ . @ @ @ . @ . @ @ @ @ . @ . . @ @ @ @ . @ @ @ @ @ @ @ . @ @ @ @ @ . @ . @ . @ @ @ @ @ @ @ @ @ . @ .@ .",
|
||||
" @ @ @ @ @ . @ @ @ . @ . @ @ @ @ . @ . @ @ @ @ @ . @ @ @ @ @ @ @ . @ @@ @ @ . @ . @ . @ @ @ @ @@ @@ @ @ . @ @ .",
|
||||
" #...# #@@@ @@@# #@@@ #@@@# #... #@@@# #...# @@@ #@@@# #...# #@@@# #...# #...# #@@@# #... #@@@# #...# #@@@# .#. #@@@# #@# #...# #...# #@@@# #@@@#",
|
||||
" "};
|
||||
16
XPM/digits.xpm
Normal file
16
XPM/digits.xpm
Normal file
@@ -0,0 +1,16 @@
|
||||
/* XPM */
|
||||
static char * digits_xpm[] = {
|
||||
"66 9 4 1",
|
||||
" c #282828 s back_color",
|
||||
"@ c #20B2AE s led_color_high",
|
||||
". c #004941 s led_color_low",
|
||||
"# c #188A86 s led_color_med",
|
||||
" ",
|
||||
" @@@ ...# #@@@# #@@@# @...@ #@@@# #@@@# #@@@# #@@@# #@@@# ... ",
|
||||
" @ @ . @ . @ . @ @ @ @ . @ . . @ @ @ @ @ . .",
|
||||
" @ @ . @ . @ . @ @ @ @ . @ . . @ @ @ @ @ . .",
|
||||
" #...# ...# #@@@# @@@# #@@@# @@@@# #@@@# ...# #@@@# #@@@# ... ",
|
||||
" @ @ . @ @ . . @ . @ . @ @ @ . @ @ @ . @ . .",
|
||||
" @ @ . @ @ . . @ . @ . @ @ @ . @ @ @ . @ . .",
|
||||
" @@@ ...@ #@@@# #@@@# ...# #@@@# #@@@# ...@ #@@@# #@@@# ... ",
|
||||
" "};
|
||||
BIN
XPM/icons.xcf
Normal file
BIN
XPM/icons.xcf
Normal file
Binary file not shown.
31
XPM/icons.xpm
Normal file
31
XPM/icons.xpm
Normal file
@@ -0,0 +1,31 @@
|
||||
/* XPM */
|
||||
static char * icons_xpm[] = {
|
||||
"650 24 4 1",
|
||||
". c #202020 s back_color",
|
||||
"+ c #00C9C1 s led_color_high",
|
||||
"@ c #0C8580 s led_color_med ",
|
||||
"# c #184A48 s led_color_low",
|
||||
"..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
|
||||
"..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
|
||||
"..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
|
||||
".................................................................++...........................................................................................................................................................................................................+......................................................................................................................................................................................................................................................................................................................@......@.............................................................",
|
||||
"..................................#######.......................+..+..............................................+..........................................................................#++...........................................................................+.++....+..+.+...........#.............................................................................................................................................................#++++++#..................#++++++#..................#++++++#...............#+++++++++++++#...........#+++++++++++++#................@....@..............................................................",
|
||||
".................................#++++++++#....................#+..+#.............................................+........................++......................#++++++#.................#++#+.........................++++++..............++.++........................+.++....+..+.+.........#+++#.....................+#........................++.++........................#++++++#..................#++++++#..................#++++++#..................#++++++++++++#+...........#++++++++++++#+...........#++++++++++++#+.......@+++++++++++++++++@.......@+++++++++++++++++@...............@..@...............................................................",
|
||||
"................................#++@#..@+++@...................#+..+#..........................................+.++....+..+.+.............++.+....................#++++++++++++#+...........++#+#+......................++###+++++............##.##...................+.+.++.++...++..+.++........+++++.....................++#.......................##.##.......................#++++++++++++#+...........#++++++++++++#+...........#++++++++++++#+...........#+++++++....+.+.+.........#+++++++....+.+.+.........#+++++++....+.+.+.....+++++++++++++++++++++.....+++++++++++++++++++++...............@@..........................................++.++.................",
|
||||
"...................#+...........+++.....#+++@..++...............+..+...........................................+.++....+..+.+............+.+.+.......+...........#+++++++....+.+.+..........+#+#++.....................++####++++++...........++.++...................+.+.+++++.+.++.++.++.......#+++++#....................+++#......................++.++......................#+++++++....+.+.+.........#+++++++....+.+.+.........#+++++++....+.+.+..........+#++++++++++++#+..........+#++++++++++++#+..........+#++++++++++++#+......+++++@#.......#@+++++.....+++++@#.......#@+++++........#++++++++++++++#..........++.......................##.##.................",
|
||||
".................#+++..........#++#......#+++#.++................++................+++++++++++++++........+.+.++.++...++..+.++..........+#+..##.......+..........+#++++++++++++#+............+#++.+....................+++###++++@+...........##.##...................+++.+++++++.+++++++++.......+++++.....................++#.......................##.##......................+#++++++++++++#+..........+#++++++++++++#+..........+#++++++++++++#+...........+.#++++++#................+.#++++++#................+.#++++++#............++++@..++...++..@++++.....++++@..++...++..@++++........++++++++++++++++.........+..+......................++.++.................",
|
||||
"...............#+++++..........#+++#......+++#..................#+#................+#+#+#+#+#+#+#+#.......+.+.+++++.+.++.++.++.........+.#+...+..+....+..........+.#++++++#...................++##.+..................+##+###+++@+++..........++.++..........#+.......+++++++++++++++++++++.......#+++#..........#+.........+#.............#+.........++.++..........#+..........+.#++++++#................+.#++++++#................+.#++++++#.................+.........................+.........................+......................++#...++...++...#++.......++#...++...++...#++.........+++####..#...+++............+......................##.##.................",
|
||||
".............#+++++++...........++++......+++#.................++++#...............+#+#+#+#+#+#+#+#.......+++.+++++++.+++++++++...........++#.+...+....+.........+..............................+##.+.................+#####+++@++++.......................#+++.......@@@@@@@@@@@@@@@@@@@@@.........#..........#+++......................#+++......................#+++..........+.........................+.........................+..........................#+........................#+........................#+..........................+++++++++.................+++++++++..............++#######.#...++...........+............#+.........++.++..........#+.....",
|
||||
"...........#+++++++++...........#++#......+++#.++.............#+#.++...............+#+#+#+#+#+#+#+#.......+++++++++++++++++++++...........+#+.#.+.+.+..+.........#+..............................+##.+................+####+..+####+.....................#+++++.......+.++++++++++++++++.++..................#+++++....................#+++++....................#+++++..........#+........................#+........................#+.......................................................................................................++#########++.............++#########++............++##@@####..#.++..........+...........#+++......................#+++.....",
|
||||
".........#+++++++++++....................#+++#.++............++#.++++..............+#.#.#.#.#.#.#+#.......@@@@@@@@@@@@@@@@@@@@@...........+#+.+...+....+..........#+..............................+##.+...............+####+..+####+...................#+++++++.......+.++++.++++.++++.+.+.................#+++++++..................#+++++++..................#+++++++...........#+........................#+........................#+.....................@..@@..@..................@..@@..@..................@..@@..@....................+###+@#+@#+@##+...........+###+@#+@#+@##+...........++##@@@##.#...++....................#+++++....................#+++++.....",
|
||||
".......#+++++++++++++....................++++...............#+#.+.+..+.............+#.#.#.#.#.#.#+#.......+++++++++++++++++++++...........++..+...+....+...........+...............................+##.+..............++++@+++#####+.................#+++++++++.......+.++.+.++++..+.+...................#+++++++++................#+++++++++................#+++++++++............+.........................+.........................+.....................@.@..@.@.........+........@.@..@.@.........++.......@.@..@.@.........++........+####@@#@@#@@###+.........+####@@#@@#@@###+..........++###@#####.#.++..........+.......#+++++++..................#+++++++.....",
|
||||
".....#+++++++++++++++...................++++................#+..+..+.+.............+++++++++++++++#.......+.+++++++++++++++++++........+.#+...+..+....+............+................................+##+..............+++@+++##++##+...............#+++++++++++..........+.+.++.+..+...................#+++++++++++..............#+++++++++++..............#+++++++++++............+...........+.............+..........++.............+..........++.........@.@..@.@........++........@.@..@.@........+..+......@.@..@.@........+..+.......+####+@#+@#+@###..........+####+@#+@#+@###...........++########.#..++................#+++++++++................#+++++++++.....",
|
||||
"....+++++++++++++++++.................#++++.................#+.....+.+..............###############.......+.++++.++++.++++++++..........+#+..##.......+............+.................................+++...............+@++++###+++..............#+++++++++++++..........+.+..+.+......++............#+++++++++++++............#+++++++++++++............#+++++++++++++............+..........++.............+.........+..+............+.........+..+........@.@..@.@.........+........@.@..@.@..........+.......@.@..@.@..........+........+####@@#@@#@@##.+.........+####@@#@@#@@##.+..........++########.#.#++..............#+++++++++++..............#+++++++++++.....",
|
||||
"....................................@++++#...................#+...#+#+......................................++.+.++++..+.+++.+...........+.+.+.......+............++....................................+..............++++++####++............#+++++++++++++++............+..+.......+..+.........#+++++++++++++++..........#+++++++++++++++..........#+++++++++++++++...........++...........+............++...........+............++...........+.........@..@@..@.........+........@..@@..@.........+........@..@@..@........+..+.......+####+@#+@#+@#.++.........+####+@#+@#+@...++.........+++#.#.#.#...+++............#+++++++++++++............#+++++++++++++.....",
|
||||
"...................................++++#......................#++++++........................................+.+.++.+..+.++..+............++.+...................++..............................#+++...+#..............+++++###++............+++++++++++++++++.........................+.........+++++++++++++++++.........+++++++++++++++++.........+++++++++++++++++..........++............+...........++...........+............++..........+..+........................+++.......................++++.......................++........+####@@#@@#@@.+++++.......+####@@#@@#@@.+++++........++++++++++++++++..........#+++++++++++++++..........#+++++++++++++++.....",
|
||||
"...................................@+#.............................+#........................................+.+..+.+....+.................++...................++...............................+...+++#.................++++++.......................................................+........................................................................................++............+++.........++...........++++.........++............++..........++........................++........................++........................+#############.++.........+############...++.........#++++++++++++++#.........+++++++++++++++++.........+++++++++++++++++.....",
|
||||
"................................................................+++#...........................................+..+.............................................+.....................................................................................................................++++......................................................................................+.........................+.........................+.........................+.........................+.........................+..........................++++++++++++++.+..........++++++++++++++.+...................................................................................",
|
||||
"..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
|
||||
"..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
|
||||
"..........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................",
|
||||
".........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................."};
|
||||
121
XPM/tile.xpm
Normal file
121
XPM/tile.xpm
Normal file
@@ -0,0 +1,121 @@
|
||||
/* XPM */
|
||||
static char *tile_xpm[] = {
|
||||
"64 64 54 1",
|
||||
" c #F3CEF3CEF3CE",
|
||||
". c #000000000000",
|
||||
"X c #514461856185",
|
||||
"o c #A289A289B2CA",
|
||||
"O c #A289A289A289",
|
||||
"+ c #A2899248B2CA",
|
||||
"@ c #9248A289A289",
|
||||
"# c #A2899248A289",
|
||||
"$ c #92489248A289",
|
||||
"% c #924892489248",
|
||||
"& c #92488207A289",
|
||||
"* c #820792489248",
|
||||
"= c #924882079248",
|
||||
"- c #820782079248",
|
||||
"; c #820782078207",
|
||||
": c #820771C69248",
|
||||
"> c #618551446185",
|
||||
", c #9248A289B2CA",
|
||||
"< c #92489248B2CA",
|
||||
"1 c #82079248A289",
|
||||
"2 c #82078207A289",
|
||||
"3 c #71C682079248",
|
||||
"4 c #71C682078207",
|
||||
"5 c #514451446185",
|
||||
"6 c #514451445144",
|
||||
"7 c #820771C68207",
|
||||
"8 c #410351445144",
|
||||
"9 c #514441035144",
|
||||
"0 c #71C671C69248",
|
||||
"q c #71C671C68207",
|
||||
"w c #71C671C671C6",
|
||||
"e c #410341035144",
|
||||
"r c #71C661858207",
|
||||
"t c #618571C68207",
|
||||
"y c #410351444103",
|
||||
"u c #410341034103",
|
||||
"i c #618571C671C6",
|
||||
"p c #410330C24103",
|
||||
"a c #30C241034103",
|
||||
"s c #71C6618571C6",
|
||||
"d c #6185618571C6",
|
||||
"f c #618561858207",
|
||||
"g c #30C230C230C2",
|
||||
"h c #618561856185",
|
||||
"j c #30C230C24103",
|
||||
"k c #5144618571C6",
|
||||
"l c #30C2410330C2",
|
||||
"z c #6185514471C6",
|
||||
"x c #208130C230C2",
|
||||
"c c #30C2208130C2",
|
||||
"v c #5144514471C6",
|
||||
"b c #2081208130C2",
|
||||
"n c #208120812081",
|
||||
"m c #410330C25144",
|
||||
" .",
|
||||
" X.",
|
||||
" oOoO+O+O+O+@#$+@#$#$#$$$#$$%&%&%&%&*&*&*=-=*=-=-=--;---;:;:;>.",
|
||||
" oo@o,o@o@o@+@+@<@$@$@$@$@$1$$$*$*$*&*&*2*&*2*-*-*-----3-3-4-X.",
|
||||
" oO+OoO#O+@#@#@#$#@#$#%#$$%$%$%&%&*=%&*=*=*=-=-=--;-;-;:;:;:;5.",
|
||||
" ,ooo@+@+@+@+@<@#@<@$$$$$$$$$*$1$*&*&*&*&*2*---*-----3---4:4:6.",
|
||||
" +O+O+O+@#$#@#$#$#$$%$$$%&%&%&%&*=*&*=-=*=---=--;---;:;:4:;:45.",
|
||||
" @o@o@o@+@+@<@$@$@$$$@$1$1$*$*$*&*&*2*=*2*-*-*-----4-3-4:4-4:6.",
|
||||
" +O#O+@#@#@#$#$#$#%#%$%&%$%&%&*=*&*=*=*=-=-=--;-;-;:;:;:;:4745.",
|
||||
" @+@+@+@+@<@#@$@$$$$$$$$$*$*$*&*&*&*&*2*---*-----3---4:4:4:4:8.",
|
||||
" #O+@#$#@#$#$#$$%$$$%&%&%&%&*=*&*=-=-=---=--;:;-;:;:4:4:474:49.",
|
||||
" @o@<@+@<@$@$@$$$$$1$1$*$*$*&*&*2*=*2*-*-*-----4-4-4:4:4:4:408.",
|
||||
" +@#@#@#$#$#$$%#%$%&%$%&%&*=*&*=*=*=-=-=--;-;-;:;:;:;:474747q9.",
|
||||
" @+@+@<@$$$@$$$$$1$$$*&*$*&*&*&*&*2*---------3-3-4:4:4:4:404q8.",
|
||||
" #$#@#$#$#$$%$$$%&%&%&%&*=-&*=-=-=---=--;:;:;:;:4:4:474:47q7q9.",
|
||||
" @#@<@$@$@$$$$$*$1$*$*$*&*&*2*-*2*-*-*-3---4-4-4:4:4:4:404q4q8.",
|
||||
" #@#$#$#$$%$%$%&%$%&%&*=*=*=-=*=-=;=--;-;-;:;:47;:474747q7q7q9.",
|
||||
" @<@$$$@$$$$$1$$$*&*&*&*&*&*=*2*---------4-3-4:4:4:4:404qq04q8.",
|
||||
" #$#$#$$%$%$%&%&%&%&*=-&*=-=-=------;:;:;:;:4:4:47q747qqq7qqq9.",
|
||||
" @$@$@$$$$$*$1$*$*$*&*&*2*-*-*---*-3-3-4-4-4:4:4:4:404q4q4qqq8.",
|
||||
" #$#$$%$%$%&%&%&%&*=*=*=-=-=-=;=--;:;-;:;:474:474747q7q7qqwqw9.",
|
||||
" $$@$$$$$*$$$*&*&*&*&*2*=*2*---------4-3-4:4:4:4:404qqq4qqqqqe.",
|
||||
" #$$%$%$%&%&*&%&*=-&*=-=-=------;:;:;:;:4:4:47q7q7qqq7qqwrqqw9.",
|
||||
" @$$$$$*$1$*&*$*2*&*2*-*-*-----3-3-4-4-4:4:404:404q4q4qqqqqtqy.",
|
||||
" $%$%$%&%&%=%&*=*=*=-=-=--;=--;:;-;:;:474:474747q7q7qqwqwqwrwe.",
|
||||
" $$$$*$1$*&*&*&*&*2*--2*-----3---4:3-4:4:4:4:404qqqqqqqqqtqtqu.",
|
||||
" &%$%&%&*&*&*=-=*=-=-=--;---;:;:;:;:4:4:47q7q7qqq7qqwrqrwrwrip.",
|
||||
" $$*$*$*&*&*2*&*2*-*-*-----3-3-4-4-4:4:404q404q4q4qtqqqiqtqiru.",
|
||||
" $%&%&*=%&*=*=*=-=-=--;-;-;:;-;:;:474:47q747q7q7qqwqwqwrwrirwu.",
|
||||
" *$1$*&*&*&*&*2*---*-----3---4:4:4:4:4:4:404qqqqqqqqqtqtqirira.",
|
||||
" &%&*=*&*=-=*=-=-=--;---;:;:;:;:4:4:47q7q7qqqqqqwrqrwrwriririp.",
|
||||
" *$*&*&*2*&*2*-*-*-----3-3-4-4-4:4:404q4q4qqq4qtqtqiqiqiriqira.",
|
||||
" &*=*&*=*=*=-=-=--;-;-;:;:;:;:474:47q7q7q7q7qqwrwqwrwrirwrisip.",
|
||||
" *&*&*&*&*2*---*-----3---4:4:4:4:404:404qqqqqqqqqtqtqiriririra.",
|
||||
" =*&*=-=*=---=--;---;:;:4:;:474:47q7q7qqqqqqwrwrwrwriririsdrdp.",
|
||||
" *&*2*=*2*-*-*-----4-3-4:4-4:4:404q4q4qqqqqtqtqiqiqiriqifirifa.",
|
||||
" &*=*=*=-=-=--;-;-;:;:;:;:474747q7q7qqq7qqwrwqwrwrirwrisisisdp.",
|
||||
" *&*&*2*---*-----3-3-4:4:4:4:404qq04qqqqqtqqqirtqiririririfida.",
|
||||
" =-=-=---=--;:;-;:;:4:4:474:47q7q7qqqqqqwrwrwrwriririsdrdsdddp.",
|
||||
" *=*2*-*-*-----4-4-4:4:4:4:404q4q4qqqqqtqtqiqiqiriqifififidida.",
|
||||
" =*=-=-=--;-;-;:;:4:;:474747q7q7qqwqwqwrwqwrwrirwrisdsisdsdsdp.",
|
||||
" *2*---------4-3-4:4:4:4:404qq04qqqqqtqqqiririririririfidddddg.",
|
||||
" =---=--;:;:;:;:4:4:474:47q7q7qqqqqqwrwrwrwriririsdsdsddddddhj.",
|
||||
" *---*-3---4-4-4:4:4:4:404q4q4qqqqqtqtqiqiqiririfififidddidkdl.",
|
||||
" =;=--;:;-;:;:474:474747q7q7qqwqwqwrwrwrwrirwrisdsdsdsdsddhzhj.",
|
||||
" --------4-3-4:4:4:4:404qq04qqqqqtqqqiririririfirifidddddddddx.",
|
||||
" ---;:;:;:;:4:4:47q747qqq7qqwqqqwrwrirwriririsdsdsddddddhzhzhc.",
|
||||
" --3-3-4-4-4:4:4:4:404q4q4qqqqqtqtqiriqiririfififidddddkdkdXdx.",
|
||||
" -;:;-;:;:474:474747q7q7qqwqwqwrwrwrwrisisisdsdsdddsddhzhdhzhg.",
|
||||
" ----4-3-4:4:4:4:404qqq4qqqqqtqtqiriririrififdfidddddkdddkzkdx.",
|
||||
" :;:;:;:4:4:47q7q7qqq7qqwrqqwrwriririririsdsdsddddddhzhzhzhzXc.",
|
||||
" 3-4-4-4:4:404:404q4q4qqqqqtqtqiriqiririfidididddddkdkdXdXdXzx.",
|
||||
" -;:;:474:47q747q7q7qqwqwqwrwrirwrisisisdsdsddddddhzhdhzhzXzhc.",
|
||||
" 4:4-4:4:4:4:404qqqqqqqqqtqtqiriririrififdfidddddkdddkzkdXzXzx.",
|
||||
" :;:4:4:47q7q7qqq7qqwrqrwrwriririsirisdsdsddddddhzhzhzhzXzXzXc.",
|
||||
" 4-4:4:404q404qqq4qtqqqiqtqiriqiririfidididddddkdkdXdXdXzXzXvx.",
|
||||
" :474:47q7q7q7q7qqwrwqwrwrirwrisisisdsdsddddddhzhzhzhzXzhzX>5c.",
|
||||
" 4:4:4:4:404qqqqqqqqqtqtqiririririfiddfidddddkdddXzkdXzXzXvXzx.",
|
||||
" :4:47q7q7qqqqqqwrwrwrwriririsdrisdddsddddddhzhzXzhzXzXzX>5>5c.",
|
||||
" 4:404q4q4qqqqqtqtqiqiqiriqiririfidididddddkdkdXzXdXzXzXvXvXvx.",
|
||||
" :47q7q7q7q7qqwrwqwrwrirwrisisisdsdsddhdddhzhzhzhzXzXzX>5>5>5b.",
|
||||
" 404:404qqqqqqqqqiqtqiririririfidddidddddkdkdXzkzXzXzXvXv5vX5n.",
|
||||
" >65656569698989y9e9u9ueumueupupapaplpgjgjgjgcgcgcgcxcbcncnbnb.",
|
||||
" ..............................................................."};
|
||||
74
XPM/wmsmixer.xpm
Normal file
74
XPM/wmsmixer.xpm
Normal file
@@ -0,0 +1,74 @@
|
||||
/* XPM */
|
||||
static char * wmsmixer_xpm[] = {
|
||||
"64 64 7 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #AEAAAE",
|
||||
"@ c #282828 s back_color",
|
||||
"# c #202020",
|
||||
"$ c #F7F3FF",
|
||||
"% c #86828E",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ............................ ........................+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" ++++++++++++++++++++++++++++ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" ...........................+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .#@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .#@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .#@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .#@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@@@@+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" ++++++++++++++++++++++++++++ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" ............................ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .$$$$$$$$$$$$%$$$$$$$$$$$$%+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .$+++++++++++.$+++++++++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .$++++++.++++.$++++.++++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .$+++++..++++.$++++..+++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .$++++...++++.$++++...++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .$+++....++++.$++++....+++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .$++++...++++.$++++...++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .$+++++..++++.$++++..+++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .$++++++.++++.$++++.++++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .$+++++++++++.$+++++++++++.+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" .%............%............+ .@@@@@@@@@@@@@@@@@@@@@@@+ ",
|
||||
" ++++++++++++++++++++++++++++ +++++++++++++++++++++++++ ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
||||
737
wmamixer.c
Normal file
737
wmamixer.c
Normal file
@@ -0,0 +1,737 @@
|
||||
// wmamixer - An alsa mixer designed for WindowMaker with scrollwheel support
|
||||
// Copyright (C) 2015 Roman Dobosz <gryf@vimja.com>
|
||||
// Copyright (C) 2003 Damian Kramer <psiren@hibernaculum.net>
|
||||
// Copyright (C) 1998 Sam Hawker <shawkie@geocities.com>
|
||||
//
|
||||
// This software comes with ABSOLUTELY NO WARRANTY
|
||||
// This software is free software, and you are welcome to redistribute it
|
||||
// under certain conditions
|
||||
// See the README file for a more complete notice.
|
||||
|
||||
#include "wmamixer.h"
|
||||
|
||||
// global mixer struct
|
||||
struct Mixer *mixer_ctrl;
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int i;
|
||||
XGCValues gcv;
|
||||
unsigned long gcm;
|
||||
char back_color[] = "back_color";
|
||||
char led_color_high[] = "led_color_high";
|
||||
char led_color_med[] = "led_color_med";
|
||||
char led_color_low[] = "led_color_low";
|
||||
XpmAttributes xpmattr;
|
||||
XpmColorSymbol xpmcsym[4] = {
|
||||
{back_color, NULL, color[0]},
|
||||
{led_color_high, NULL, color[1]},
|
||||
{led_color_med, NULL, color[2]},
|
||||
{led_color_low, NULL, color[3]}
|
||||
};
|
||||
|
||||
scanArgs(argc, argv);
|
||||
initXWin(argc, argv);
|
||||
|
||||
xpmattr.numsymbols = 4;
|
||||
xpmattr.colorsymbols = xpmcsym;
|
||||
xpmattr.exactColors = false;
|
||||
xpmattr.closeness = 40000;
|
||||
xpmattr.valuemask = XpmColorSymbols | XpmExactColors | XpmCloseness;
|
||||
XpmCreatePixmapFromData(d_display, w_root, wmsmixer_xpm, &pm_main,
|
||||
&pm_mask, &xpmattr);
|
||||
XpmCreatePixmapFromData(d_display, w_root, tile_xpm, &pm_tile, NULL,
|
||||
&xpmattr);
|
||||
XpmCreatePixmapFromData(d_display, w_root, icons_xpm, &pm_icon, NULL,
|
||||
&xpmattr);
|
||||
XpmCreatePixmapFromData(d_display, w_root, digits_xpm, &pm_digits, NULL,
|
||||
&xpmattr);
|
||||
XpmCreatePixmapFromData(d_display, w_root, chars_xpm, &pm_chars, NULL,
|
||||
&xpmattr);
|
||||
pm_disp = XCreatePixmap(d_display, w_root, 64, 64, DefaultDepth(d_display,
|
||||
DefaultScreen(d_display)));
|
||||
|
||||
gcm = GCGraphicsExposures;
|
||||
gcv.graphics_exposures = false;
|
||||
gc_gc = XCreateGC(d_display, w_root, gcm, &gcv);
|
||||
|
||||
color[0] = mixColor(ledcolor, 0, backcolor, 100);
|
||||
color[1] = mixColor(ledcolor, 100, backcolor, 0);
|
||||
color[2] = mixColor(ledcolor, 60, backcolor, 40);
|
||||
color[3] = mixColor(ledcolor, 25, backcolor, 75);
|
||||
|
||||
if (wmaker || ushape || astep) {
|
||||
XShapeCombineMask(d_display, w_activewin, ShapeBounding, winsize/2-32,
|
||||
winsize/2-32, pm_mask, ShapeSet);
|
||||
} else {
|
||||
XCopyArea(d_display, pm_tile, pm_disp, gc_gc, 0, 0, 64, 64, 0, 0);
|
||||
}
|
||||
|
||||
XSetClipMask(d_display, gc_gc, pm_mask);
|
||||
XCopyArea(d_display, pm_main, pm_disp, gc_gc, 0, 0, 64, 64, 0, 0);
|
||||
XSetClipMask(d_display, gc_gc, None);
|
||||
|
||||
mixer_ctrl = Mixer_create(mixer_device);
|
||||
|
||||
if (mixer_ctrl->openOK != 0) {
|
||||
fprintf(stderr, "%s : Unable to open mixer device '%s'.\n", NAME,
|
||||
mixer_device);
|
||||
} else {
|
||||
for (i=0; i <mixer_ctrl->devices_no; i++) {
|
||||
if (i > 24) {
|
||||
fprintf(stderr,"%s : Sorry, can only use channels 0-24\n", NAME);
|
||||
break;
|
||||
}
|
||||
channel[channels] = i;
|
||||
channels++;
|
||||
}
|
||||
}
|
||||
|
||||
readFile();
|
||||
|
||||
if (channels==0)
|
||||
fprintf(stderr,"%s : Sorry, no supported channels found.\n", NAME);
|
||||
else {
|
||||
checkVol(true);
|
||||
|
||||
XEvent xev;
|
||||
XSelectInput(d_display, w_activewin, ExposureMask | ButtonPressMask |
|
||||
ButtonReleaseMask | ButtonMotionMask);
|
||||
XMapWindow(d_display, w_main);
|
||||
|
||||
bool done = false;
|
||||
while(!done ) {
|
||||
while(XPending(d_display) ) {
|
||||
XNextEvent(d_display, &xev);
|
||||
switch(xev.type ) {
|
||||
case Expose:
|
||||
repaint();
|
||||
break;
|
||||
case ButtonPress:
|
||||
pressEvent(&xev.xbutton);
|
||||
break;
|
||||
case ButtonRelease:
|
||||
releaseEvent();
|
||||
break;
|
||||
case MotionNotify:
|
||||
motionEvent(&xev.xmotion);
|
||||
break;
|
||||
case ClientMessage:
|
||||
if (xev.xclient.data.l[0] == deleteWin) done=true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (btnstate & (BTNPREV | BTNNEXT)) {
|
||||
rpttimer++;
|
||||
if (rpttimer >= RPTINTERVAL) {
|
||||
if (btnstate & BTNNEXT)
|
||||
curchannel++;
|
||||
else
|
||||
curchannel--;
|
||||
if (curchannel < 0)
|
||||
curchannel = channels - 1;
|
||||
if (curchannel >= channels)
|
||||
curchannel = 0;
|
||||
checkVol(true);
|
||||
rpttimer = 0;
|
||||
}
|
||||
} else {
|
||||
checkVol(false);
|
||||
}
|
||||
|
||||
if (text_counter) {
|
||||
text_counter--;
|
||||
if (!text_counter) {
|
||||
drawVolLevel();
|
||||
repaint();
|
||||
}
|
||||
// printf("%c", text_counter);
|
||||
}
|
||||
|
||||
XFlush(d_display);
|
||||
|
||||
usleep(50000);
|
||||
}
|
||||
}
|
||||
|
||||
XFreeGC(d_display, gc_gc);
|
||||
XFreePixmap(d_display, pm_main);
|
||||
XFreePixmap(d_display, pm_tile);
|
||||
XFreePixmap(d_display, pm_disp);
|
||||
XFreePixmap(d_display, pm_mask);
|
||||
XFreePixmap(d_display, pm_icon);
|
||||
XFreePixmap(d_display, pm_digits);
|
||||
XFreePixmap(d_display, pm_chars);
|
||||
freeXWin();
|
||||
Mixer_destroy(mixer_ctrl);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/* Mixer struct support functions */
|
||||
struct Mixer *Mixer_create(char *device) {
|
||||
struct Mixer *mixer_ctrl = malloc(sizeof(struct Mixer));
|
||||
assert(mixer_ctrl != NULL);
|
||||
mixer_ctrl->openOK = 0;
|
||||
mixer_ctrl->devices_no = 0;
|
||||
mixer_ctrl->devices_no = 0;
|
||||
return mixer_ctrl;
|
||||
}
|
||||
|
||||
void Mixer_set_left(int current, int value) {
|
||||
}
|
||||
|
||||
void Mixer_set_right(int current, int value) {
|
||||
}
|
||||
|
||||
void Mixer_write_volume(int current) {
|
||||
}
|
||||
|
||||
int Mixer_read_left(int current) {
|
||||
return 50;
|
||||
}
|
||||
|
||||
int Mixer_read_right(int current) {
|
||||
return 50;
|
||||
}
|
||||
|
||||
int Mixer_read_volume(int channel, bool read) {
|
||||
return 50;
|
||||
}
|
||||
|
||||
bool Mixer_get_stereo(int channel) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void Mixer_destroy(struct Mixer *mix) {
|
||||
assert(mix != NULL);
|
||||
//free(mix->name);
|
||||
free(mix);
|
||||
}
|
||||
|
||||
void initXWin(int argc, char **argv)
|
||||
{
|
||||
winsize=astep ? ASTEPSIZE : NORMSIZE;
|
||||
|
||||
if ((d_display=XOpenDisplay(display))==NULL ) {
|
||||
fprintf(stderr,"%s : Unable to open X display '%s'.\n", NAME, XDisplayName(display));
|
||||
exit(1);
|
||||
}
|
||||
_XA_GNUSTEP_WM_FUNC=XInternAtom(d_display, "_GNUSTEP_WM_FUNCTION", false);
|
||||
deleteWin=XInternAtom(d_display, "WM_DELETE_WINDOW", false);
|
||||
|
||||
w_root=DefaultRootWindow(d_display);
|
||||
|
||||
XWMHints wmhints;
|
||||
XSizeHints shints;
|
||||
shints.x=0;
|
||||
shints.y=0;
|
||||
shints.flags=0;
|
||||
bool pos=(XWMGeometry(d_display, DefaultScreen(d_display), position, NULL, 0, &shints, &shints.x, &shints.y,
|
||||
&shints.width, &shints.height, &shints.win_gravity) & (XValue | YValue));
|
||||
shints.min_width=winsize;
|
||||
shints.min_height=winsize;
|
||||
shints.max_width=winsize;
|
||||
shints.max_height=winsize;
|
||||
shints.base_width=winsize;
|
||||
shints.base_height=winsize;
|
||||
shints.flags=PMinSize | PMaxSize | PBaseSize;
|
||||
|
||||
createWin(&w_main, shints.x, shints.y);
|
||||
|
||||
if (wmaker || astep || pos)
|
||||
shints.flags |= USPosition;
|
||||
if (wmaker ) {
|
||||
wmhints.initial_state=WithdrawnState;
|
||||
wmhints.flags=WindowGroupHint | StateHint | IconWindowHint;
|
||||
createWin(&w_icon, shints.x, shints.y);
|
||||
w_activewin=w_icon;
|
||||
wmhints.icon_window=w_icon;
|
||||
}
|
||||
else{
|
||||
wmhints.initial_state=NormalState;
|
||||
wmhints.flags=WindowGroupHint | StateHint;
|
||||
w_activewin=w_main;
|
||||
}
|
||||
wmhints.window_group=w_main;
|
||||
XSetWMHints(d_display, w_main, &wmhints);
|
||||
XSetWMNormalHints(d_display, w_main, &shints);
|
||||
XSetCommand(d_display, w_main, argv, argc);
|
||||
XStoreName(d_display, w_main, NAME);
|
||||
XSetIconName(d_display, w_main, NAME);
|
||||
XSetWMProtocols(d_display, w_activewin, &deleteWin, 1);
|
||||
}
|
||||
|
||||
void freeXWin()
|
||||
{
|
||||
XDestroyWindow(d_display, w_main);
|
||||
if (wmaker)
|
||||
XDestroyWindow(d_display, w_icon);
|
||||
XCloseDisplay(d_display);
|
||||
}
|
||||
|
||||
void createWin(Window *win, int x, int y)
|
||||
{
|
||||
XClassHint classHint;
|
||||
*win=XCreateSimpleWindow(d_display, w_root, x, y, winsize, winsize, 0, 0, 0);
|
||||
classHint.res_name=NAME;
|
||||
classHint.res_class=CLASS;
|
||||
XSetClassHint(d_display, *win, &classHint);
|
||||
}
|
||||
|
||||
unsigned long getColor(char *colorname)
|
||||
{
|
||||
XColor color;
|
||||
XWindowAttributes winattr;
|
||||
XGetWindowAttributes(d_display, w_root, &winattr);
|
||||
color.pixel=0;
|
||||
XParseColor(d_display, winattr.colormap, colorname, &color);
|
||||
color.flags=DoRed | DoGreen | DoBlue;
|
||||
XAllocColor(d_display, winattr.colormap, &color);
|
||||
return color.pixel;
|
||||
}
|
||||
|
||||
unsigned long mixColor(char *colorname1, int prop1, char *colorname2, int prop2)
|
||||
{
|
||||
XColor color, color1, color2;
|
||||
XWindowAttributes winattr;
|
||||
XGetWindowAttributes(d_display, w_root, &winattr);
|
||||
XParseColor(d_display, winattr.colormap, colorname1, &color1);
|
||||
XParseColor(d_display, winattr.colormap, colorname2, &color2);
|
||||
color.pixel=0;
|
||||
color.red=(color1.red*prop1+color2.red*prop2)/(prop1+prop2);
|
||||
color.green=(color1.green*prop1+color2.green*prop2)/(prop1+prop2);
|
||||
color.blue=(color1.blue*prop1+color2.blue*prop2)/(prop1+prop2);
|
||||
color.flags=DoRed | DoGreen | DoBlue;
|
||||
XAllocColor(d_display, winattr.colormap, &color);
|
||||
return color.pixel;
|
||||
}
|
||||
|
||||
void scanArgs(int argc, char **argv) {
|
||||
int i;
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0) {
|
||||
usage();
|
||||
exit(0);
|
||||
}
|
||||
if (strcmp(argv[i], "-v")==0 || strcmp(argv[i], "--version")==0) {
|
||||
fprintf(stderr, "wmsmixer version %s\n", VERSION);
|
||||
exit(0);
|
||||
}
|
||||
if (strcmp(argv[i], "-w")==0)
|
||||
wmaker=!wmaker;
|
||||
if (strcmp(argv[i], "-s")==0)
|
||||
ushape=!ushape;
|
||||
if (strcmp(argv[i], "-a")==0)
|
||||
astep=!astep;
|
||||
if (strcmp(argv[i], "-novol")==0)
|
||||
no_volume_display = 1;
|
||||
if (strcmp(argv[i], "-d")==0 ) {
|
||||
if (i<argc-1 ) {
|
||||
i++;
|
||||
sprintf(mixer_device, "%s", argv[i]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(argv[i], "-l")==0 ) {
|
||||
if (i<argc-1 ) {
|
||||
i++;
|
||||
sprintf(ledcolor, "%s", argv[i]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(argv[i], "-b")==0 ) {
|
||||
if (i<argc-1 ) {
|
||||
i++;
|
||||
sprintf(backcolor, "%s", argv[i]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(argv[i], "-position")==0 ) {
|
||||
if (i<argc-1 ) {
|
||||
i++;
|
||||
sprintf(position, "%s", argv[i]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(argv[i], "-display")==0 ) {
|
||||
if (i<argc-1 ) {
|
||||
i++;
|
||||
sprintf(display, "%s", argv[i]);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void readFile() {
|
||||
FILE *rcfile;
|
||||
char buf[256];
|
||||
int done;
|
||||
int current=-1;
|
||||
char *confpath;
|
||||
|
||||
if (getenv("XDG_CONFIG_HOME")) {
|
||||
confpath = malloc(snprintf(NULL, 0, "%s%s", getenv("XDG_CONFIG_HOME"),
|
||||
"/wmamixer.conf") + 1);
|
||||
sprintf(confpath, "%s%s", getenv("XDG_CONFIG_HOME"), "/wmamixer.conf");
|
||||
} else {
|
||||
confpath = malloc(snprintf(NULL, 0, "%s%s", getenv("HOME"),
|
||||
"/.config/wmamixer.conf") + 1);
|
||||
sprintf(confpath, "%s%s", getenv("HOME"), "/.config/wmamixer.conf");
|
||||
}
|
||||
|
||||
if(access(confpath, 0) != 0) {
|
||||
printf("no conf file\n");
|
||||
free(confpath);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((rcfile = fopen(confpath, "r")) == NULL) {
|
||||
printf("cannot open conf file\n");
|
||||
free(confpath);
|
||||
return;
|
||||
}
|
||||
|
||||
channels=0;
|
||||
do {
|
||||
fgets(buf, 250, rcfile);
|
||||
if ((done=feof(rcfile)) == 0) {
|
||||
buf[strlen(buf) - 1] = 0;
|
||||
|
||||
if (strncmp(buf, "addchannel ", strlen("addchannel ")) == 0) {
|
||||
sscanf(buf, "addchannel %i", ¤t);
|
||||
if (current >= mixer_ctrl->devices_no ) {
|
||||
fprintf(stderr, "%s : Sorry, this channel (%i) is "
|
||||
"not supported.\n", NAME, current);
|
||||
current = -1;
|
||||
}
|
||||
else{
|
||||
channel[channels]=current;
|
||||
channels++;
|
||||
}
|
||||
}
|
||||
|
||||
if (strncmp(buf, "setchannel ", strlen("setchannel ")) == 0) {
|
||||
sscanf(buf, "setchannel %i", ¤t);
|
||||
if (current >= mixer_ctrl->devices_no ) {
|
||||
fprintf(stderr,"%s : Sorry, this channel (%i) is "
|
||||
"not supported.\n", NAME, current);
|
||||
current = -1;
|
||||
}
|
||||
}
|
||||
|
||||
if (strncmp(buf, "setname ", strlen("setname ")) == 0) {
|
||||
if (current == -1) {
|
||||
fprintf(stderr, "%s : Sorry, no current channel.\n",
|
||||
NAME);
|
||||
} else {
|
||||
small_labels[current] = (char *) malloc(sizeof(char) *
|
||||
5);
|
||||
sscanf(buf, "setname %4s", small_labels[current]);
|
||||
}
|
||||
}
|
||||
|
||||
if (strncmp(buf, "setmono ", strlen("setmono ")) == 0) {
|
||||
if (current == -1) {
|
||||
fprintf(stderr,"%s : Sorry, no current channel.\n",
|
||||
NAME);
|
||||
} else {
|
||||
int value;
|
||||
sscanf(buf, "setmono %i", &value);
|
||||
Mixer_set_left(current, value);
|
||||
Mixer_set_right(current, value);
|
||||
Mixer_write_volume(current);
|
||||
}
|
||||
}
|
||||
|
||||
if (strncmp(buf, "setleft ", strlen("setleft ")) == 0 ) {
|
||||
if (current == -1) {
|
||||
fprintf(stderr, "%s : Sorry, no current channel.\n",
|
||||
NAME);
|
||||
} else {
|
||||
int value;
|
||||
sscanf(buf, "setleft %i", &value);
|
||||
Mixer_set_left(current, value);
|
||||
Mixer_write_volume(current);
|
||||
}
|
||||
}
|
||||
|
||||
if (strncmp(buf, "setright ", strlen("setright ")) == 0 ) {
|
||||
if (current == -1) {
|
||||
fprintf(stderr, "%s : Sorry, no current channel.\n",
|
||||
NAME);
|
||||
} else{
|
||||
int value;
|
||||
sscanf(buf, "setleft %i", &value);
|
||||
Mixer_set_right(current, value);
|
||||
Mixer_write_volume(current);
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (done == 0);
|
||||
fclose(rcfile);
|
||||
free(confpath);
|
||||
}
|
||||
|
||||
void checkVol(bool forced) {
|
||||
Mixer_read_volume(channel[curchannel], true);
|
||||
int nl = Mixer_read_left(channel[curchannel]);
|
||||
int nr = Mixer_read_right(channel[curchannel]);
|
||||
if (forced ) {
|
||||
curleft=nl;
|
||||
curright=nr;
|
||||
update();
|
||||
repaint();
|
||||
}
|
||||
else{
|
||||
if (nl!=curleft || nr!=curright ) {
|
||||
if (nl!=curleft ) {
|
||||
curleft=nl;
|
||||
if (Mixer_get_stereo(channel[curchannel]))
|
||||
drawLeft();
|
||||
else
|
||||
drawMono();
|
||||
}
|
||||
if (nr!=curright ) {
|
||||
curright=nr;
|
||||
if (Mixer_get_stereo(channel[curchannel]))
|
||||
drawRight();
|
||||
else
|
||||
drawMono();
|
||||
}
|
||||
if (!no_volume_display)
|
||||
drawVolLevel();
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void pressEvent(XButtonEvent *xev)
|
||||
{
|
||||
if (xev->button == Button4 || xev->button == Button5) {
|
||||
int inc;
|
||||
if (xev->button == Button4) inc = 4;
|
||||
else inc = -4;
|
||||
|
||||
Mixer_read_volume(channel[curchannel], false);
|
||||
Mixer_set_left(channel[curchannel],
|
||||
CLAMP(Mixer_read_left(channel[curchannel]) + inc, 0, 100));
|
||||
Mixer_set_right(channel[curchannel],
|
||||
CLAMP(Mixer_read_right(channel[curchannel]) + inc, 0, 100));
|
||||
Mixer_write_volume(channel[curchannel]);
|
||||
checkVol(false);
|
||||
return;
|
||||
}
|
||||
|
||||
int x=xev->x-(winsize/2-32);
|
||||
int y=xev->y-(winsize/2-32);
|
||||
if (x>=5 && y>=47 && x<=17 && y<=57 ) {
|
||||
curchannel--;
|
||||
if (curchannel<0)
|
||||
curchannel=channels-1;
|
||||
btnstate |= BTNPREV;
|
||||
rpttimer=0;
|
||||
drawBtns(BTNPREV);
|
||||
checkVol(true);
|
||||
return;
|
||||
}
|
||||
if (x>=18 && y>=47 && x<=30 && y<=57 ) {
|
||||
curchannel++;
|
||||
if (curchannel>=channels)
|
||||
curchannel=0;
|
||||
btnstate|=BTNNEXT;
|
||||
rpttimer=0;
|
||||
drawBtns(BTNNEXT);
|
||||
checkVol(true);
|
||||
return;
|
||||
}
|
||||
if (x>=37 && x<=56 && y>=8 && y<=56 ) {
|
||||
int v=((60-y)*100)/(2*25);
|
||||
dragging=true;
|
||||
if (x<=50)
|
||||
Mixer_set_left(channel[curchannel], v);
|
||||
if (x>=45)
|
||||
Mixer_set_right(channel[curchannel], v);
|
||||
Mixer_write_volume(channel[curchannel]);
|
||||
checkVol(false);
|
||||
return;
|
||||
}
|
||||
if (x>=5 && y>=21 && x<=30 && y<=42) {
|
||||
drawText(small_labels[channel[curchannel]]);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void releaseEvent() {
|
||||
dragging = false;
|
||||
btnstate &= ~(BTNPREV | BTNNEXT);
|
||||
drawBtns(BTNPREV | BTNNEXT);
|
||||
repaint();
|
||||
}
|
||||
|
||||
void motionEvent(XMotionEvent *xev)
|
||||
{
|
||||
int x=xev->x-(winsize/2-32);
|
||||
int y=xev->y-(winsize/2-32);
|
||||
if (x>=37 && x<=56 && y>=8 && dragging ) {
|
||||
int v=((60-y)*100)/(2*25);
|
||||
if (v<0)
|
||||
v=0;
|
||||
if (x<=50)
|
||||
Mixer_set_left(channel[curchannel], v);
|
||||
if (x>=45)
|
||||
Mixer_set_right(channel[curchannel], v);
|
||||
Mixer_write_volume(channel[curchannel]);
|
||||
checkVol(false);
|
||||
}
|
||||
}
|
||||
|
||||
void repaint()
|
||||
{
|
||||
XCopyArea(d_display, pm_disp, w_activewin, gc_gc, 0, 0, 64, 64, winsize/2-32, winsize/2-32);
|
||||
XEvent xev;
|
||||
while(XCheckTypedEvent(d_display, Expose, &xev));
|
||||
}
|
||||
|
||||
void update()
|
||||
{
|
||||
drawText(small_labels[channel[curchannel]]);
|
||||
|
||||
XCopyArea(d_display, pm_icon, pm_disp, gc_gc, icon[channel[curchannel]]*26, 0, 26, 24, 5, 19);
|
||||
if (Mixer_get_stereo(channel[curchannel])) {
|
||||
drawLeft();
|
||||
drawRight();
|
||||
}
|
||||
else {
|
||||
drawMono();
|
||||
}
|
||||
}
|
||||
|
||||
void drawText(char *text)
|
||||
{
|
||||
char *p = text;
|
||||
char p2;
|
||||
int i;
|
||||
|
||||
for (i=0; i<4; i++, p++) {
|
||||
p2 = toupper(*p);
|
||||
if (p2 >= 'A' && p2 <= 'Z') {
|
||||
XCopyArea(d_display, pm_chars, pm_disp, gc_gc, 6*((int)p2-65), 0, 6, 9, 5+(i*6), 5);
|
||||
}
|
||||
else if (p2 >= '0' && p2 <= '9') {
|
||||
XCopyArea(d_display, pm_digits, pm_disp, gc_gc, 6*((int)p2-48), 0, 6, 9, 5+(i*6), 5);
|
||||
}
|
||||
else {
|
||||
if (p2 == '\0')
|
||||
p--;
|
||||
XCopyArea(d_display, pm_digits, pm_disp, gc_gc, 60, 0, 6, 9, 5+(i*6), 5);
|
||||
}
|
||||
}
|
||||
if (!no_volume_display)
|
||||
text_counter = 10;
|
||||
}
|
||||
|
||||
void drawVolLevel() {
|
||||
int i;
|
||||
int digits[4];
|
||||
|
||||
int vol = (Mixer_read_left(channel[curchannel]) +
|
||||
Mixer_read_right(channel[curchannel])) / 2;
|
||||
|
||||
digits[0] = (vol/100) ? 1 : 10;
|
||||
digits[1] = (vol/10) == 10 ? 0 : (vol/10);
|
||||
digits[2] = vol%10;
|
||||
digits[3] = 10;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
XCopyArea(d_display, pm_digits, pm_disp, gc_gc, 6*digits[i], 0, 6, 9,
|
||||
5+(i*6), 5);
|
||||
}
|
||||
}
|
||||
|
||||
void drawLeft() {
|
||||
int i;
|
||||
XSetForeground(d_display, gc_gc, color[0]);
|
||||
XFillRectangle(d_display, pm_disp, gc_gc, 46, 7, 2, 49);
|
||||
|
||||
XSetForeground(d_display, gc_gc, color[1]);
|
||||
for (i = 0; i < 25; i++) {
|
||||
if (i==(curleft*25)/100)
|
||||
XSetForeground(d_display, gc_gc, color[3]);
|
||||
XFillRectangle(d_display, pm_disp, gc_gc, 37, 55-2*i, 9, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void drawRight()
|
||||
{
|
||||
int i;
|
||||
XSetForeground(d_display, gc_gc, color[0]);
|
||||
XFillRectangle(d_display, pm_disp, gc_gc, 46, 7, 2, 49);
|
||||
|
||||
XSetForeground(d_display, gc_gc, color[1]);
|
||||
for (i=0;i<25;i++) {
|
||||
if (i==(curright*25)/100)
|
||||
XSetForeground(d_display, gc_gc, color[3]);
|
||||
XFillRectangle(d_display, pm_disp, gc_gc, 48, 55-2*i, 9, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void drawMono()
|
||||
{
|
||||
int i;
|
||||
XSetForeground(d_display, gc_gc, color[1]);
|
||||
for (i=0;i<25;i++ ) {
|
||||
if (i==(curright*25)/100)
|
||||
XSetForeground(d_display, gc_gc, color[3]);
|
||||
XFillRectangle(d_display, pm_disp, gc_gc, 37, 55-2*i, 20, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void drawBtns(int btns)
|
||||
{
|
||||
if (btns & BTNPREV)
|
||||
drawBtn(5, 47, 13, 11, (btnstate & BTNPREV));
|
||||
if (btns & BTNNEXT)
|
||||
drawBtn(18, 47, 13, 11, (btnstate & BTNNEXT));
|
||||
}
|
||||
|
||||
void drawBtn(int x, int y, int w, int h, bool down)
|
||||
{
|
||||
if (!down)
|
||||
XCopyArea(d_display, pm_main, pm_disp, gc_gc, x, y, w, h, x, y);
|
||||
else {
|
||||
XCopyArea(d_display, pm_main, pm_disp, gc_gc, x, y, 1, h-1, x+w-1, y+1);
|
||||
XCopyArea(d_display, pm_main, pm_disp, gc_gc, x+w-1, y+1, 1, h-1, x, y);
|
||||
XCopyArea(d_display, pm_main, pm_disp, gc_gc, x, y, w-1, 1, x+1, y+h-1);
|
||||
XCopyArea(d_display, pm_main, pm_disp, gc_gc, x+1, y+h-1, w-1, 1, x, y);
|
||||
}
|
||||
}
|
||||
|
||||
void usage() {
|
||||
printf("%s - An ALSA mixer designed for WindowMaker with ", NAME);
|
||||
fputs("\
|
||||
scrollwheel support\n\
|
||||
Copyright (C) 2015 Roman Dobosz <gryf@vimja.com>\n\
|
||||
Copyright (C) 2003 Damian Kramer <psiren@hibernaculum.net>\n\
|
||||
Copyright (C) 1998 Sam Hawker <shawkie@geocities.com>\n\
|
||||
This software comes with ABSOLUTELY NO WARRANTY\n\
|
||||
This software is free software, and you are welcome to redistribute it\n\
|
||||
under certain conditions\n\
|
||||
See the README file for a more complete notice.\n\n", stdout);
|
||||
printf("usage:\n\n %s [options]\n\noptions:\n\n", NAME);
|
||||
fputs("\
|
||||
-h | --help display this help screen\n\
|
||||
-v | --version display the version\n\
|
||||
-w use WithdrawnState (for WindowMaker)\n\
|
||||
-s shaped window\n\
|
||||
-a use smaller window (for AfterStep Wharf)\n\
|
||||
-l led_color use the specified color for led display\n\
|
||||
-b back_color use the specified color for backgrounds\n\
|
||||
-d mix_device use specified device (rather than /dev/mixer)\n\
|
||||
-position position set window position (see X manual pages)\n\
|
||||
-display display select target display (see X manual pages)\n\n",
|
||||
stdout);
|
||||
}
|
||||
116
wmamixer.conf.example
Normal file
116
wmamixer.conf.example
Normal file
@@ -0,0 +1,116 @@
|
||||
# User config file
|
||||
# Should be saved as $XDG_CONFIG_HOME/wmamixer.conf (XDG_CONFIG_HOME is
|
||||
# usually accessible under ~/.config direcotry)
|
||||
# Comments and blank lines mostly allowed
|
||||
|
||||
# The format of this file is a series of commands:
|
||||
|
||||
# addchannel %i
|
||||
# Adds a channel to the sequence. %i specifies a channel.
|
||||
# These are the values from my <linux/soundcard.h>:
|
||||
#
|
||||
# SOUND_MIXER_VOLUME 0
|
||||
# SOUND_MIXER_BASS 1
|
||||
# SOUND_MIXER_TREBLE 2
|
||||
# SOUND_MIXER_SYNTH 3
|
||||
# SOUND_MIXER_PCM 4
|
||||
# SOUND_MIXER_SPEAKER 5
|
||||
# SOUND_MIXER_LINE 6
|
||||
# SOUND_MIXER_MIC 7
|
||||
# SOUND_MIXER_CD 8
|
||||
# SOUND_MIXER_IMIX 9 /* Recording monitor */
|
||||
# SOUND_MIXER_ALTPCM 10
|
||||
# SOUND_MIXER_RECLEV 11 /* Recording level */
|
||||
# SOUND_MIXER_IGAIN 12 /* Input gain */
|
||||
# SOUND_MIXER_OGAIN 13 /* Output gain */
|
||||
# SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */
|
||||
# SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */
|
||||
# SOUND_MIXER_LINE3 16 /* Input source 3 (line) */
|
||||
# SOUND_MIXER_DIGITAL1 17 /* Digital (input) 1 */
|
||||
# SOUND_MIXER_DIGITAL2 18 /* Digital (input) 2 */
|
||||
# SOUND_MIXER_DIGITAL3 19 /* Digital (input) 3 */
|
||||
# SOUND_MIXER_PHONEIN 20 /* Phone input */
|
||||
# SOUND_MIXER_PHONEOUT 21 /* Phone output */
|
||||
# SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */
|
||||
# SOUND_MIXER_RADIO 23 /* Radio in */
|
||||
# SOUND_MIXER_MONITOR 24 /* Monitor (usually mic) volume */
|
||||
#
|
||||
# Ths channel added becomes the current channel for subsequent
|
||||
# setmono, setleft, setright and setname commands.
|
||||
|
||||
# setchannel %i
|
||||
# Similar to addchannel, except the channel is not actually added
|
||||
# to the sequence, merely made the current channel for subsequent
|
||||
# setmono, setleft, setright and setname commands.
|
||||
|
||||
# setmono %i
|
||||
# Sets both left and right volumes for the current channel.
|
||||
# The channel may be mono or stereo.
|
||||
# The value specified must be an integer in the range 0 to 100.
|
||||
|
||||
# setleft %i
|
||||
# Sets left volume for the current channel.
|
||||
# Do not use on a mono channel.
|
||||
# The value specified must be an integer in the range 0 to 100.
|
||||
|
||||
# setright %i
|
||||
# Sets right volume for the current channel.
|
||||
# Do not use on a mono channel.
|
||||
# The value specified must be an integer in the range 0 to 100.
|
||||
|
||||
# setname <text>
|
||||
# Set the name for this channel. This will be displayed briefly
|
||||
# when you switch to this channel, or when you click on the
|
||||
# icon. The program will only use the first 4 characters of this
|
||||
# text.
|
||||
|
||||
# At least one channel must be added!
|
||||
|
||||
# VOLUME
|
||||
addchannel 0
|
||||
setmono 90
|
||||
setname main
|
||||
|
||||
# PCM
|
||||
addchannel 4
|
||||
setmono 64
|
||||
|
||||
# SPEAKER
|
||||
addchannel 5
|
||||
setmono 0
|
||||
|
||||
# LINE
|
||||
addchannel 6
|
||||
setmono 0
|
||||
|
||||
# MIC
|
||||
addchannel 7
|
||||
setmono 0
|
||||
|
||||
# CD
|
||||
addchannel 8
|
||||
setmono 90
|
||||
|
||||
# RECLEVEL
|
||||
addchannel 11
|
||||
setmono 0
|
||||
|
||||
# OGAIN
|
||||
addchannel 13
|
||||
setmono 0
|
||||
|
||||
# LINE1
|
||||
addchannel 14
|
||||
setmono 0
|
||||
|
||||
# LINE2
|
||||
addchannel 15
|
||||
setmono 100
|
||||
|
||||
# DIGITAL1
|
||||
addchannel 17
|
||||
setmono 0
|
||||
|
||||
# PHONEIN
|
||||
addchannel 20
|
||||
setmono 0
|
||||
170
wmamixer.h
Normal file
170
wmamixer.h
Normal file
@@ -0,0 +1,170 @@
|
||||
// wmamixer - An alsa mixer designed for WindowMaker with scrollwheel support
|
||||
// Copyright (C) 2015 Roman Dobosz <gryf@vimja.com>
|
||||
// Copyright (C) 2003 Damian Kramer <psiren@hibernaculum.net>
|
||||
// Copyright (C) 1998 Sam Hawker <shawkie@geocities.com>
|
||||
//
|
||||
// This software comes with ABSOLUTELY NO WARRANTY
|
||||
// This software is free software, and you are welcome to redistribute it
|
||||
// under certain conditions
|
||||
// See the README file for a more complete notice.
|
||||
|
||||
#ifndef WMAMIXER_H
|
||||
#define WMAMIXER_H
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <stdbool.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include <X11/X.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xproto.h>
|
||||
#include <X11/xpm.h>
|
||||
#include <X11/extensions/shape.h>
|
||||
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
#define WINDOWMAKER false
|
||||
#define USESHAPE false
|
||||
#define AFTERSTEP false
|
||||
#define NORMSIZE 64
|
||||
#define ASTEPSIZE 56
|
||||
#define NAME "wmamixer"
|
||||
#define CLASS "Wmamixer"
|
||||
|
||||
|
||||
#define VERSION "0.1"
|
||||
|
||||
// User defines - custom
|
||||
#define BACKCOLOR "#202020"
|
||||
#define LEDCOLOR "#00c9c1"
|
||||
|
||||
#undef CLAMP
|
||||
#define CLAMP(v, l, h) (((v) > (h)) ? (h) : (((v) < (l)) ? (l) : (v)))
|
||||
|
||||
|
||||
// Pixmaps - standard
|
||||
Pixmap pm_main;
|
||||
Pixmap pm_tile;
|
||||
Pixmap pm_disp;
|
||||
Pixmap pm_mask;
|
||||
|
||||
// Pixmaps - custom
|
||||
Pixmap pm_icon;
|
||||
Pixmap pm_digits;
|
||||
Pixmap pm_chars;
|
||||
|
||||
// Xpm images - standard
|
||||
#include "XPM/wmsmixer.xpm"
|
||||
#include "XPM/tile.xpm"
|
||||
|
||||
// Xpm images - custom
|
||||
#include "XPM/icons.xpm"
|
||||
#include "XPM/digits.xpm"
|
||||
#include "XPM/chars.xpm"
|
||||
|
||||
// Variables for command-line arguments - standard
|
||||
bool wmaker = WINDOWMAKER;
|
||||
bool ushape = USESHAPE;
|
||||
bool astep = AFTERSTEP;
|
||||
char display[256] = "";
|
||||
char position[256] = "";
|
||||
int winsize;
|
||||
bool no_volume_display = 0;
|
||||
|
||||
// Variables for command-line arguments - custom
|
||||
char mixer_device[256] = "default";
|
||||
char backcolor[256] = BACKCOLOR;
|
||||
char ledcolor[256] = LEDCOLOR;
|
||||
|
||||
// X-Windows basics - standard
|
||||
Atom _XA_GNUSTEP_WM_FUNC;
|
||||
Atom deleteWin;
|
||||
Display *d_display;
|
||||
Window w_icon;
|
||||
Window w_main;
|
||||
Window w_root;
|
||||
Window w_activewin;
|
||||
|
||||
// X-Windows basics - custom
|
||||
GC gc_gc;
|
||||
unsigned long color[4];
|
||||
|
||||
int text_counter = 0;
|
||||
|
||||
// Misc custom global variables
|
||||
// ----------------------------
|
||||
|
||||
// Current state information
|
||||
int curchannel = 0;
|
||||
int curleft;
|
||||
int curright;
|
||||
|
||||
// For buttons
|
||||
int btnstate = 0;
|
||||
#define BTNNEXT 1
|
||||
#define BTNPREV 2
|
||||
|
||||
// For repeating next and prev buttons
|
||||
#define RPTINTERVAL 5
|
||||
int rpttimer = 0;
|
||||
|
||||
// For draggable volume control
|
||||
bool dragging = false;
|
||||
|
||||
int channels = 2;
|
||||
int channel[25];
|
||||
int icon[25] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
|
||||
18, 19, 20, 21, 22, 23, 24};
|
||||
char *small_labels[25] = {"vol ", "bass", "trbl", "synt", "pcm ",
|
||||
"spkr", "line", "mic ", "cd ", "mix ", "pcm2", "rec ", "igai", "ogai",
|
||||
"lin1", "lin2", "lin3", "dig1", "dig2", "dig3", "phin", "phou", "vid ",
|
||||
"rad ", "mon "};
|
||||
|
||||
struct Mixer {
|
||||
int openOK;
|
||||
int devices_no;
|
||||
};
|
||||
|
||||
// Procedures and functions - standard
|
||||
void initXWin(int argc, char **argv);
|
||||
void freeXWin();
|
||||
void createWin(Window *win, int x, int y);
|
||||
unsigned long getColor(char *colorname);
|
||||
unsigned long mixColor(char *colorname1, int prop1, char *colorname2,
|
||||
int prop2);
|
||||
|
||||
// Procedures and functions - custom
|
||||
void scanArgs(int argc, char **argv);
|
||||
void readFile();
|
||||
void usage();
|
||||
void checkVol(bool forced);
|
||||
void pressEvent(XButtonEvent *xev);
|
||||
void releaseEvent();
|
||||
void motionEvent(XMotionEvent *xev);
|
||||
void repaint();
|
||||
void update();
|
||||
void drawLeft();
|
||||
void drawRight();
|
||||
void drawMono();
|
||||
void drawVolLevel();
|
||||
void drawText(char *text);
|
||||
void drawBtns(int btns);
|
||||
void drawBtn(int x, int y, int w, int h, bool down);
|
||||
|
||||
struct Mixer *Mixer_create(char *device);
|
||||
void Mixer_set_left(int current, int value);
|
||||
void Mixer_set_right(int current, int value);
|
||||
void Mixer_write_volume(int current);
|
||||
int Mixer_read_left(int current);
|
||||
int Mixer_read_right(int current);
|
||||
int Mixer_read_volume(int channel, bool read);
|
||||
bool Mixer_get_stereo(int channel);
|
||||
|
||||
void Mixer_destroy(struct Mixer *mix);
|
||||
|
||||
#endif /* WMAMIXER_H */
|
||||
Reference in New Issue
Block a user