wmusic: Add version 1.5.0 to repository

This commit is contained in:
Doug Torrance 2018-06-22 16:20:52 -04:00 committed by Carlos R. Mafra
parent 219e04f6ad
commit 7054a65b90
30 changed files with 4950 additions and 0 deletions

339
wmusic/COPYING Normal file
View 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.

20
wmusic/Makefile.in Normal file
View file

@ -0,0 +1,20 @@
RCSS = Makefile.in configure.in README
all: wmusic
wmusic:
cd src && ${MAKE} wmusic
clean:
rm -f *~ *.o core wmusic.spec
cd src && ${MAKE} clean
distclean: clean
rm -f config.status config.log Makefile config.cache
cd src && ${MAKE} distclean
install:
cd src && ${MAKE} install
uninstall:
cd src && ${MAKE} uninstall

184
wmusic/README Normal file
View file

@ -0,0 +1,184 @@
wmusic
by Hadess <hadess@hadess.net>
maintained by John <john+wmusic@jtan.com>
wmusic is a dockapp that remote-controls xmms. Here is a list of the features:
- VCR style controls including fast rewind and fast forward
- Time and Playlist position display
- Super stylee rotating arrow
- Hiding of the xmms windows (on startup and through middle-click)
- AfterStep users, add this line to your ~/GNUstep/Library/AfterStep/wharf:
*Wharf wmusic - Swallow "wmusic" wmusic -w &
- Sawfish users, grab Tiger-T's DockMill theme, and apply it to the running
dockapp with the -w flag on. See the theme's README for more details.
- KDE users can use the "Dock Application Bar" to dock wmusic, don't forget
the -w flag to launch wmusic. Right-Click on Kicker, then pick:
Add->Extension->Dock Application Bar
http://home.jtan.com/~john/index.shtml?software.shtml
Building
--------
Requirements:
- xmms >= 1.0.0 and all the appropriate devel packages (glib,
gtk+, xmms, glibc...)
- xmms > 1.2.4 if you have problems with the prefs window popping up
Simply type:
./configure
make
make install
URLs
----
XMMS: http://xmms.org
DockMill: http://tigert.gimp.org/files/sawmill-themes/DockMill.tar.gz
Changelog
---------
- 1.5.0
* Added -R option to start xmms when wmusic is started, and to exit wmusic
when xmms exits.
(Thanks to Mateusz Greszta)
* Incremented the minor version number, getting sick of 1.4.xx releases :)
- 1.4.14
* Fixed the configure/manpage issue from 1.4.13 :)
- 1.4.13
* Added Russian/Ukrainian glyph support.
(Thanks to Alexey Voinov <voins@voins.program.ru>,
Michael Shigorin <mike@altlinux.ru>)
- 1.4.12
* Added patch to make sure xmms is running before calling some functions.
(Thanks to Michael Cohrs <<michael@cohrs.de>)
* Added patch to fix volume slider overdrawing.
(Thanks to Zdik Kudrle <zdik.kudrle@borg.cz>)
* Added patch to treat main window just like playlist, equalizer, with regard
to visibility after right-clicking the wmusic app.
(Thanks to Nicolas Hinz <nicolas-hinz@gmx.de>)
- 1.4.11
* Added patch to show volume slider (-b flag), allowing volume control
without a scroll mouse.
(Thanks to Alessandro Budai <budai@ingsun1.univ.trieste.it>)
- 1.4.10
* Added patch to fix segfaults caused by wrong size of displayRect array
(Thanks to Alexey Voinov <voins@voins.program.ru>)
- 1.4.9
* Added patch to stop rotating arrow when XMMS is paused (-a flag)
* Added patch to switch between time left and time elapsed display
(-l flag to start with time left)
* Changed docs to reflect new maintainership (John Chapin)
- 1.4.8
* Corrected e-mail addresses
- 1.4.7
* KDE support removed (maybe) because it breaks everything else (should fix
the "buttons not clickable" problem)
- 1.4.6
* Non-GNU make fixes (thanks to Eric Melville <eric@freebsd.org>)
* KDE support in libdockapp (thanks to Alain Schroeder <alain@mini.gt.owl.de>)
* KDE testing and README update (thanks to Eric Christopherson from #kde-users)
- 1.4.5
* Fixed another leak (will it ever stop ?)
(thanks to Ulrich Seidl for finding it out)
- 1.4.4
* Fixed a leak (thanks to Gerry OKeefe for reporting this one)
- 1.4.3
* Fixed volume flag to be -V (collided with -v/--version)
* Updated man page
* Fixed a leak
* Fixed title "freezing" when emptying the playlist
* Changed the separator for the scrolling title (and the code as well)
* Added ()*/ to the recognized characters
* Fixed a segfault related to the new separator code
- 1.4.2
* Updated manpage
* Added manpage by Alain Schroeder
* Added -t flag to start with title display (idea by Antoine Labour as well)
* Added apostroph in title (Antoine Labour <antoine.labour@m4x.org>)
* Fixed 2 segfaults (title related again)
- 1.4.1
* Fixed wmusic.spec.in (thanks to g0sh on OPN)
* Really fixed the title display bugs
* Make sure to use -w to run it under window managers other than Window Maker
* Made the title scrolling speed slower
- 1.4
* Debian fixes and maintainership (Alain Schroeder)
* Wheel scroll support for volume change (thanks Marius Aamodt Eriksen)
* Added scroll title display, had to rework the GUI a bit
- 1.2.6
* Added hours:minutes display for songs longer than 99 minutes and 59 seconds
(idea by Scott Mc Dermott <scottm@octaldream.com>)
* Now upstream Debian package
- 1.2.5
* Changed the size of the dockapp to 64x64, now Sawfish compatible
- 1.2.4
* Included libdockapp inside the archive, it is not needed to download and
install it separately.
* Added AfterStep compatibility
- 1.2.3
* Removed -n option (don't run XMMS on startup)
* Added -r option (run XMMS on startup)
* Double-click on the display will now run XMMS
* Added more differences between XMMS not playing / XMMS not running
- 1.2.2
* fixed a crazy cpu bug, threads are no more used
- 1.2.1
* changed the name from wmplay to wmusic
* fixed a bug (uninitialized var. was used on some circumstances)
* removed the close-on-xmms-close (click on the display to run xmms)
* added -n switch to avoid running xmms on startup
- 1.2
* a little bug fix for transparency
* added autoconf support, thanks to Logan
- 1.1.9
* Added -x switch for wmxmms like mouse-bindings
(lo_tek wanted it :P)
- 1.1.8
* Now multi-threaded, so that the display is independant of the rest
- 1.1.0
* Rewrote to use libdockapp rather than gdk
- 0.9.9
* Added Stereo/Mono display
* Added kbps display
- 0.9
* Added time and pos display, and the rotating arrow
* Switched the building to a Makefile
- 0.1
* First version, only the bottom buttons are working
Copyright
---------
Plain and simple GPL version 2.0, see COPYING for more infos
- based on design work of Antoine Nulle and Martjin Pieterse
- double-click code from WMpop by Jérôme SAUTRET (jerome@linuxfan.com)

1708
wmusic/configure vendored Executable file

File diff suppressed because it is too large Load diff

63
wmusic/configure.in Normal file
View file

@ -0,0 +1,63 @@
dnl configure.in for wmusic
AC_PREREQ(2.12)
AC_INIT(src/wmusic.c)
VERSION=1.5.0
PACKAGE=wmusic
echo
echo "Configuring package: $PACKAGE-$VERSION"
echo
AC_PROG_CC
AC_PROG_INSTALL
AC_CONFIG_HEADER(src/config.h:src/config.h.in)
AC_PATH_X
dnl AC_CHECK_LIB(dockapp, DAProcessActionRects, ,
dnl echo
dnl echo "Error: libdockapp was not found"
dnl echo
dnl exit 1)
AC_CHECK_LIB(Xxf86vm,XF86VidModeQueryExtension,[
AC_DEFINE(XF86VIDMODE,1,[XF86VidMode extension is present])
VM_LIBS="-lXxf86vm"],,-L$x_libraries -lXext)
AC_CHECK_LIB(Xxf86dga,XF86DGAQueryExtension,[
AC_DEFINE(XF86DGA,1,[XF86DGA extension is present])
DGA_LIBS="-lXxf86dga"],,-L$x_libraries -lXext)
AC_PATH_PROG(PATH_XMMSCONFIG,xmms-config, no,
$PATH:/usr/X11R6/bin:/usr/local/bin)
if test $PATH_XMMSCONFIG = "no"; then
echo
echo "It appears as if Xmms (X Multimedia System - http://www.xmms.org)"
echo "is not installed on your computer."
echo
echo "If you have Xmms, make sure xmms-config is in your \$PATH"
echo
exit
fi
AC_PATH_PROG(PATH_GTKCONFIG,gtk-config, no,
$PATH:/usr/X11R6/bin:/usr/local/bin)
if test $PATH_GTKCONFIG = "no"; then
echo
echo "It appears as if GTK+ - http://www.gtk.org)"
echo "is not installed on your computer."
echo
echo "If you have gtk+, make sure gtk-config is in your \$PATH"
echo
exit
fi
AC_SUBST(DGA_LIBS)
AC_SUBST(VM_LIBS)
AC_SUBST(VERSION)
AC_SUBST(PACKAGE)
AC_OUTPUT(Makefile wmusic.spec src/Makefile src/version.h)

115
wmusic/debian/changelog Normal file
View file

@ -0,0 +1,115 @@
wmusic (1.4.10-2) unstable; urgency=low
* Use xlibs-dev as Build-Dep instead of xlibs6-dev (Closes: #170164).
-- Alain Schroeder <alain@debian.org> Fri, 7 Mar 2003 20:45:14 +0100
wmusic (1.4.10-1) unstable; urgency=low
* New Upstream (Fixes Segfaults with gcc-3.0; New Upstream Address)
* Changed all addresses in debian/copyright and debian/wmusic.1
* Fix hiding of xmms on startup (Closes: #166529).
-- Alain Schroeder <alain@debian.org> Wed, 30 Oct 2002 01:30:27 +0100
wmusic (1.4.9-1) unstable; urgency=low
* New Upstream (It now includes the arrow-patch from 1.4.7-1 and adds the
possibility, to choose if the time left or time elapsed is displayed).
* Upped Standart Version.
-- Alain Schroeder <alain@debian.org> Fri, 22 Feb 2002 12:34:49 +0100
wmusic (1.4.7-1) unstable; urgency=low
* New Upstream (Only changes to included libdockapp, which we don't use
since there is an debian package)
* Modified patch from (1.2.6-3 / #86939 / Spinning arrow when stopped)
to work only, if command line argument -a or --rotate-arrow is given.
Upstream is unresponsive at the moment, so I'm releasing this now.
* Changed Manpage to reflect the new patch.
* Changed debian menu entry to start with --rotate-arrow by default, too
-- Alain Schroeder <alain@debian.org> Thu, 2 Aug 2001 20:22:39 +0200
wmusic (1.4.6-1) unstable; urgency=low
* New Upstream (No real change - only a few changes to README and
Makefile for *BSD)
* Linked against libdockapp again - the maintainer included my fixes
and fixed my fixes again ;)
-- Alain Schroeder <alain@debian.org> Tue, 24 Apr 2001 19:21:37 +0200
wmusic (1.4.5-2) unstable; urgency=low
* Patched included libdockapp, to work correctly with KDE. (closes: #89516)
-- Alain Schroeder <alain@debian.org> Sun, 15 Apr 2001 01:59:11 +0200
wmusic (1.4.5-1) unstable; urgency=low
* New Upstream.
-- Alain Schroeder <alain@debian.org> Mon, 11 Apr 2001 13:50:32 +0200
wmusic (1.4.4-2) unstable; urgency=low
* Fixed menu entry and added a long description.
-- Alain Schroeder <alain@debian.org> Mon, 9 Apr 2001 15:52:48 +0200
wmusic (1.4.4-1) unstable; urgency=low
* New Upstream, fixes Memory Leak and closes #91826
-- Alain Schroeder <alain@debian.org> Mon, 2 Apr 2001 00:30:38 +0200
wmusic (1.4.3-1) unstable; urgency=low
* New Upstream
* Changed back to libdockapp delivered with wmusic, since it
seem to handle some stuff right, this might close 89516, maybe
not...
-- Alain Schroeder <alain@debian.org> Wed, 16 Mar 2001 11:29:58 +0100
wmusic (1.4.2-1) unstable; urgency=low
* New Upstream
-- Alain Schroeder <alain@debian.org> Mon, 12 Mar 2001 10:46:57 +0100
wmusic (1.4.1-1) unstable; urgency=low
* New Upstream
* Upgraded Standarts Version
-- Alain Schroeder <alain@debian.org> Sun, 11 Mar 2001 16:47:29 +0100
wmusic (1.2.6-4) unstable; urgency=low
* Wrote a manpage, closes #87140
-- Alain Schroeder <alain@debian.org> Tue, 27 Feb 2001 11:29:12 +0100
wmusic (1.2.6-3) unstable; urgency=low
* Now wmusic´s arrow doesn´t spin, if xmms is paused, closes #86939
-- Alain Schroeder <alain@debian.org> Thu, 22 Feb 2001 05:17:45 +0100
wmusic (1.2.6-2) unstable; urgency=low
* Changed section to sound
* Fixed dependencies and compiled wmusic against libdockapp
instead of just linking it (changed src/Makefile.in too to this),
closes Bug#86101
-- Alain Schroeder <alain@debian.org> Fri, 16 Feb 2001 17:09:44 +0100
wmusic (1.2.6-1) unstable; urgency=low
* Initial Release, closes Bug#85266.
-- Alain Schroeder <alain@debian.org> Sun, 14 Jan 2001 16:23:10 +0000

14
wmusic/debian/control Normal file
View file

@ -0,0 +1,14 @@
Source: wmusic
Section: sound
Priority: optional
Maintainer: Alain Schroeder <alain@debian.org>
Build-Depends: xmms-dev, xlibs-dev, libgtk1.2-dev, debhelper, libdockapp-dev
Standards-Version: 3.5.6.0
Package: wmusic
Architecture: any
Depends: ${shlibs:Depends}
Description: a remote-control DockApp for xmms
wmusic is a dockapp that remote-controls xmms. Features include VCR-style
controls, Time and Playlist display, supa stylee rotating arrow, hiding of
the xmms windows and reactive interface.

14
wmusic/debian/copyright Normal file
View file

@ -0,0 +1,14 @@
This package was debianized by Bastien Nocera <hadess@hadess.net> on
Sun, 14 Jan 2001 16:23:10 +0000 and is now maintained by Alain Schröder
<alain@debian.org>.
It was downloaded from http://home.jtan.com/~john/wmusic/
Upstream Author(s): John Chapin <john+wmusic@jtan.com>
Copyright:
You are free to distribute this software under the terms of
the GNU General Public License.
On Debian systems, the complete text of the GNU General Public
License can be found in /usr/share/common-licenses/GPL file.

1
wmusic/debian/docs Normal file
View file

@ -0,0 +1 @@
README

3
wmusic/debian/menu Normal file
View file

@ -0,0 +1,3 @@
?package(wmusic):needs=X11 section=Apps/Sound\
title="wmusic" command="/usr/bin/wmusic --rotate-arrow" \
description="A remote-control DockApp for XMMS"

78
wmusic/debian/rules Executable file
View file

@ -0,0 +1,78 @@
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# This is the debhelper compatability version to use.
export DH_COMPAT=1
build: build-stamp
build-stamp:
dh_testdir
./configure --prefix=/usr/X11R6 --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
# Add here commands to compile the package.
$(MAKE)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
# Add here commands to clean up after the build process.
-$(MAKE) distclean
-rm config.log config.status config.cache Makefile
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
# Add here commands to install the package into debian/tmp.
$(MAKE) install PREFIX=`pwd`/debian/tmp/usr
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
# dh_testversion
dh_testdir
dh_testroot
# dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installemacsen
# dh_installpam
# dh_installinit
dh_installcron
dh_installmanpages
dh_installinfo
# dh_undocumented wmusic.1
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
# You may want to make some executables suid here.
# dh_suidregister
# dh_makeshlibs
dh_installdeb
# dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install

73
wmusic/debian/wmusic.1 Normal file
View file

@ -0,0 +1,73 @@
.TH WMUSIC 1 "February 22, 2002"
.SH NAME
wmusic \- a remote-control DockApp for xmms
.SH SYNOPSIS
.B wmusic
.RI [ options ]
.SH DESCRIPTION
This manual page documents briefly the
.B wmusic command.
\fBwmusic\fP is a dockapp that remote-controls xmms. Features include
VCR-style controls, Time and Playlist display, supa stylee rotating
arrow, hiding of the xmms windows and reactive interface.
.SH OPTIONS
These programs follow the usual GNU command line syntax, with long
options starting with two dashes (`-').
A summary of options is included below.
For a complete description, see the Info files.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.TP
.B \-c, \-\-command <program>
Use <program> as the command to launch XMMS. You can start XMMS
by a double-click into the status part of \fBwmusic\fP.
.TP
.B \-d, \-\-display host:display[.screen]
specifies the X server to contact; see X(1).
.TP
.B \-r, \-\-run
Run XMMS on startup.
.TP
.B \-R, \-\-run\-exclusive
Run XMMS on startup, exit when xmms exits.
.TP
.B \-s, \-\-session <number>
Wich XMMS Session to use.
.TP
.B \-t, \-\-title
Shows title instead of kbps by default.
.TP
.B \-u, \-\-hide
Hide XMMS windows on startup.
.TP
.B \-V, \-\-volume
Stepping of the wheel volume control (in percent).
.TP
.B \-x, \-\-wmxmms
Use wmxmms-like show and hide. Just hide the main XMMS window.
If you do not use this parameter, \fBwmusic\fP show and hide
the main, playlist and equaliser windows. You can toggle the hide
function by pressing with the middle button into the status part of
\fBwmusic\fP.
.TP
.B \-w, \-\-windowed
Run in windowed mode. Use this, if you want to run \fBwmusic\fP in
the AfterStep wharf.
.TP
.B \-a, \-\-rotate-arrow
Stop the rotating arrow when \fBwmusic\fP is paused.
.TP
.B \-l, \-\-time-left
Start \fBwmusic\fP with the display showing time left instead of time
elapsed.
.SH SEE ALSO
.BR xmms (1x), wmaker (1x)
.SH AUTHOR
wmusic was originally written by Bastien Nocera <hadess@hadess.net> and
it is now maintained by John Chapin <john+wmusic@jtan.com>.
This manual page was written by Alain Schroeder <alain@debian.org>,
for the Debian GNU/Linux system (but may be used by others).

250
wmusic/install-sh Normal file
View file

@ -0,0 +1,250 @@
#! /bin/sh
#
# install - install a program, script, or datafile
# This comes from X11R5 (mit/util/scripts/install.sh).
#
# Copyright 1991 by the Massachusetts Institute of Technology
#
# Permission to use, copy, modify, distribute, and sell this software and its
# documentation for any purpose is hereby granted without fee, provided that
# the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation, and that the name of M.I.T. not be used in advertising or
# publicity pertaining to distribution of the software without specific,
# written prior permission. M.I.T. makes no representations about the
# suitability of this software for any purpose. It is provided "as is"
# without express or implied warranty.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd="$cpprog"
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd="$stripprog"
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "install: no input file specified"
exit 1
else
true
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d $dst ]; then
instcmd=:
else
instcmd=mkdir
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f $src -o -d $src ]
then
true
else
echo "install: $src does not exist"
exit 1
fi
if [ x"$dst" = x ]
then
echo "install: no destination specified"
exit 1
else
true
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d $dst ]
then
dst="$dst"/`basename $src`
else
true
fi
fi
## this sed command emulates the dirname command
dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS="${oIFS}"
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp="${pathcomp}${1}"
shift
if [ ! -d "${pathcomp}" ] ;
then
$mkdirprog "${pathcomp}"
else
true
fi
pathcomp="${pathcomp}/"
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename $dst`
else
dstfile=`basename $dst $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename $dst`
else
true
fi
# Make a temp file name in the proper directory.
dsttmp=$dstdir/#inst.$$#
# Move or copy the file name to the temp name
$doit $instcmd $src $dsttmp &&
trap "rm -f ${dsttmp}" 0 &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
$doit $rmcmd -f $dstdir/$dstfile &&
$doit $mvcmd $dsttmp $dstdir/$dstfile
fi &&
exit 0

View file

@ -0,0 +1,3 @@
Alfredo K. Kojima <kojima@windowmaker.org>
Pascal G. Hofstee <daeron@windowmaker.org>

19
wmusic/libdockapp/COPYING Normal file
View file

@ -0,0 +1,19 @@
Copyright (c) 1999 Alfredo K. Kojima
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

48
wmusic/libdockapp/README Normal file
View file

@ -0,0 +1,48 @@
DockApp Making Standard Library
Alfredo K. Kojima <kojima@windowmaker.org>
Pascal G. Hofstee <daeron@windowmaker.org>
...............................................................................
You must have the libXpm library installed and the shape extension supported
by your X server to be able to build and install libdockapp.
To compile libDockApp enter the libdockapp directory and type:
./configure
make install
The API is described in dockapp.h wmtest.c is a sample program
that shows the library usage.
License:
Copyright (c) 1999, 2000 Alfredo K. Kojima, Pascal Hofstee
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -0,0 +1,52 @@
/*
* Copyright (c) 1999 Alfredo K. Kojima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* $Id: dacallback.c,v 1.1.1.1 2004/02/27 02:53:10 john Exp $
*/
#include "dockapp.h"
extern DACallbacks d_callbacks;
extern int d_timeout;
void
DASetCallbacks(DACallbacks *callbacks)
{
long mask = 0;
d_callbacks = *callbacks;
if (callbacks->buttonPress)
mask |= ButtonPressMask;
if (callbacks->buttonRelease)
mask |= ButtonReleaseMask;
if (callbacks->motion)
mask |= PointerMotionMask;
XSelectInput(DADisplay, DAWindow, mask);
XFlush(DADisplay);
}
void
DASetTimeout(int miliseconds)
{
d_timeout = miliseconds;
}

View file

@ -0,0 +1,45 @@
/*
* Copyright (c) 1999 Alfredo K. Kojima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* $Id: dacolor.c,v 1.1.1.1 2004/02/27 02:53:10 john Exp $
*/
#include "dockapp.h"
extern char *progName;
unsigned long
DAGetColor(char *colorName)
{
XColor color;
if (!XParseColor(DADisplay,
DefaultColormap(DADisplay, DefaultScreen(DADisplay)),
colorName, &color))
printf("%s: could not parse color %s\n", progName, colorName), exit(1);
if (!XAllocColor(DADisplay, DefaultColormap(DADisplay, DefaultScreen(DADisplay)), &color)) {
printf("%s: could not allocate color %s. Using black\n", progName, colorName);
return BlackPixel(DADisplay, DefaultScreen(DADisplay));
}
return color.pixel;
}

122
wmusic/libdockapp/daevent.c Normal file
View file

@ -0,0 +1,122 @@
/*
* Copyright (c) 1999 Alfredo K. Kojima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* $Id: daevent.c,v 1.1.1.1 2004/02/27 02:53:10 john Exp $
*/
#include <sys/time.h>
#include "dockapp.h"
extern Window DALeader;
extern DACallbacks d_callbacks;
extern int d_timeout;
Bool
DAProcessEvent(XEvent *event)
{
if ((event->xany.window != DAWindow) && (event->xany.window != DALeader))
return False;
switch (event->type) {
case DestroyNotify:
if (d_callbacks.destroy)
(*d_callbacks.destroy)();
exit(0);
break;
case ButtonPress:
if (d_callbacks.buttonPress)
(*d_callbacks.buttonPress)(event->xbutton.button,
event->xbutton.state,
event->xbutton.x,
event->xbutton.y);
break;
case ButtonRelease:
if (d_callbacks.buttonRelease)
(*d_callbacks.buttonRelease)(event->xbutton.button,
event->xbutton.state,
event->xbutton.x,
event->xbutton.y);
break;
case MotionNotify:
if (d_callbacks.motion)
(*d_callbacks.motion)(event->xmotion.x,
event->xmotion.y);
break;
case EnterNotify:
if (d_callbacks.enter)
(*d_callbacks.enter)();
break;
case LeaveNotify:
if (d_callbacks.leave)
(*d_callbacks.leave)();
break;
default:
return False;
}
return True;
}
void
DAEventLoop(void)
{
XEvent event;
for (;;) {
if (d_timeout >= 0) {
if (!DANextEventOrTimeout(&event, d_timeout)) {
if (d_callbacks.timeout)
(*d_callbacks.timeout)();
continue;
}
}
else
XNextEvent(DADisplay, &event);
DAProcessEvent(&event);
}
}
Bool
DANextEventOrTimeout(XEvent *event, unsigned long miliseconds)
{
struct timeval timeout;
fd_set rset;
XSync(DADisplay, False);
if (XPending(DADisplay)) {
XNextEvent(DADisplay, event);
return True;
}
timeout.tv_sec = miliseconds / 1000;
timeout.tv_usec = (miliseconds % 1000) * 1000;
FD_ZERO(&rset);
FD_SET(ConnectionNumber(DADisplay), &rset);
if (select(ConnectionNumber(DADisplay)+1, &rset, NULL, NULL, &timeout) > 0) {
XNextEvent(DADisplay, event);
return True;
}
return False;
}

335
wmusic/libdockapp/damain.c Normal file
View file

@ -0,0 +1,335 @@
/*
* Copyright (c) 1999 Alfredo K. Kojima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* $Id: damain.c,v 1.1.1.1 2004/02/27 02:53:10 john Exp $
*/
#include "dockapp.h"
#define MIN(a, b) (a < b ? a : b)
char *progName = NULL;
int d_width, d_height;
int d_windowed = 0;
int d_timeout = 0;
DACallbacks d_callbacks = {NULL, NULL, NULL, NULL, NULL, NULL, NULL};
DARect DANoRect = {0, 0, 0, 0};
Display *DADisplay = NULL;
Window DALeader = None;
Window DAWindow = None;
int DADepth = 0;
Visual *DAVisual = NULL;
GC DAGC = NULL;
DARect DAPreferredIconSizes = {-1, -1, 0, 0};
void
DAGetDisplay(char *display, int argc, char **argv)
{
progName = argv[0];
/* Open Connection to X Server */
DADisplay = XOpenDisplay(display);
if (!DADisplay) {
printf("%s: could not open display %s!\n", progName,
XDisplayName(display));
exit(EXIT_FAILURE);
}
}
void
DAProposeIconSize(unsigned width, unsigned height)
{
XIconSize *iconSizes;
int nrSizes = 0;
d_width = width;
d_height = height;
/* Get the nearest allowed icon size if the WM specifies such */
iconSizes = XAllocIconSize();
if (XGetIconSizes(DADisplay, DefaultRootWindow(DADisplay),
&iconSizes, &nrSizes)) {
int i;
int da = -1;
int min_w = -1, min_h = -1;
int max_w = 0, max_h = 0;
for (i = 0; i < nrSizes; i++) {
int w1, h1, w, h;
if ((max_w < iconSizes[i].max_width) ||
(max_h < iconSizes[i].max_height)) {
max_w = iconSizes[i].max_width;
max_h = iconSizes[i].max_height;
}
if ((min_w > iconSizes[i].min_width) ||
(min_h > iconSizes[i].min_height) ||
(min_w == -1)) {
min_w = iconSizes[i].min_width;
min_h = iconSizes[i].min_height;
}
if ((width > iconSizes[i].max_width) ||
(width < iconSizes[i].min_width) ||
(height > iconSizes[i].max_height) ||
(height < iconSizes[i].min_height))
continue;
w1 = (iconSizes[i].max_width - width ) % iconSizes[i].width_inc;
h1 = (iconSizes[i].max_height - height) % iconSizes[i].height_inc;
w = MIN(w1, iconSizes[i].width_inc - w1);
h = MIN(h1, iconSizes[i].height_inc - h1);
if ((w * h < da) || (da == -1)) {
d_width = width + w;
d_height = height + h;
da = w * h;
}
}
DAPreferredIconSizes.x = min_w;
DAPreferredIconSizes.y = min_h;
DAPreferredIconSizes.width = max_w;
DAPreferredIconSizes.height = max_h;
if (da == -1) { /* requested size is out of bounds */
printf("Warning (%s): requested icon-size (%d x %d) is out of the range "
"allowed by the window manager\n",
progName, d_width, d_height);
}
}
XFree(iconSizes);
}
void
DACreateIcon(char *name, unsigned width, unsigned height, int argc, char **argv)
{
XClassHint *classHint;
XWMHints *wmHints;
XGCValues gcv;
d_width = width;
d_height = height;
/* Create Windows */
DAWindow = XCreateSimpleWindow(DADisplay, DefaultRootWindow(DADisplay),
0, 0, width, height, 0, 0, 0);
DALeader = XCreateSimpleWindow(DADisplay, DefaultRootWindow(DADisplay),
0, 0, 1, 1, 0, 0, 0);
/* Set ClassHint */
if (!(classHint = XAllocClassHint()))
printf("%s: can't allocate memory for class hints!\n", progName), exit(1);
classHint->res_class = "DockApp";
classHint->res_name = name;
XSetClassHint(DADisplay, DALeader, classHint);
XFree(classHint);
/* Set WMHints */
if (!(wmHints = XAllocWMHints()))
printf("%s: can't allocate memory for wm hints!\n", progName), exit(1);
wmHints->flags = IconWindowHint|WindowGroupHint;
if (!d_windowed) {
wmHints->flags |= StateHint;
wmHints->initial_state = WithdrawnState;
}
//Hadess
{
Status status;
XTextProperty title;
status = XStringListToTextProperty(&progName, 1, &title);
XSetWMName(DADisplay, DALeader, &title);
XSetWMName(DADisplay, DAWindow, &title);
// XStoreName(DADisplay, DALeader, progName);
// XStoreName(DADisplay, DAWindow, progName);
}
wmHints->window_group = DALeader;
wmHints->icon_window = DAWindow;
XSetWMHints(DADisplay, DALeader, wmHints);
/* Set Command to start the app so it can be docked properly */
XSetCommand(DADisplay, DALeader, argv, argc);
DADepth = DefaultDepth(DADisplay, DefaultScreen(DADisplay));
DAVisual = DefaultVisual(DADisplay, DefaultScreen(DADisplay));
DAGC = DefaultGC(DADisplay, DefaultScreen(DADisplay));
gcv.graphics_exposures = False;
XChangeGC(DADisplay, DAGC, GCGraphicsExposures, &gcv);
XFlush(DADisplay);
}
void
DAShow(void)
{
if (!d_windowed)
XMapRaised(DADisplay, DALeader);
else
XMapRaised(DADisplay, DAWindow);
XFlush(DADisplay);
}
static DAProgramOption defaultOptions[] = {
{"-h", "--help", "shows this help text and exit", DONone, False, {NULL}},
{"-v", "--version", "shows program version and exit", DONone, False, {NULL}},
{"-w", "--windowed", "runs the application in windowed mode", DONone, False, {NULL}}
};
static void
printHelp(char *prog, char *description, DAProgramOption *options, int count)
{
int j;
printf("Usage: %s [OPTIONS]\n", prog);
if (description)
puts(description);
for (j = 0; j < count + 3; j++) {
char blank[30];
int c;
int i;
if (j >= count) {
options = defaultOptions;
i = j - count;
}
else
i = j;
if (options[i].shortForm && options[i].longForm)
c = printf(" %s, %s", options[i].shortForm, options[i].longForm);
else if (options[i].shortForm)
c = printf(" %s", options[i].shortForm);
else if (options[i].longForm)
c = printf(" %s", options[i].longForm);
else
continue;
if (options[i].type != DONone) {
switch (options[i].type) {
case DOInteger:
c += printf(" <integer>");
break;
case DOString:
c += printf(" <string>");
break;
case DONatural:
c += printf(" <number>");
break;
}
}
memset(blank, ' ', 30);
if (c > 29)
c = 1;
blank[30-c] = 0;
printf("%s %s\n", blank, options[i].description);
}
}
void
DAParseArguments(int argc, char **argv, DAProgramOption *options,
int count, char *programDescription, char *versionDescription)
{
int i, j;
int found = 0;
for (i = 1; i < argc; i++) {
if (strcmp(argv[i], "-h") == 0 || strcmp(argv[i], "--help") == 0)
printHelp(argv[0], programDescription, options, count), exit(0);
if (strcmp(argv[i], "-v") == 0 || strcmp(argv[i], "--version") == 0)
puts(versionDescription), exit(0);
if (strcmp(argv[i], "-w") == 0 || strcmp(argv[i], "--windowed") == 0) {
d_windowed = 1;
continue;
}
found = 0;
for (j = 0; j < count; j++) {
if ((options[j].shortForm && strcmp(options[j].shortForm, argv[i]) == 0) ||
(options[j].longForm && strcmp(options[j].longForm, argv[i]) == 0)) {
found = 1;
options[j].used = True;
if (options[j].type == DONone)
break;
i++;
if (i >= argc)
printf("%s: missing argument for option '%s'\n", argv[0], argv[i-1]), exit(1);
switch (options[j].type) {
case DOInteger:
{
int integer;
if (sscanf(argv[i], "%i", &integer) != 1)
printf("%s: error parsing argument for option %s\n",
argv[0], argv[i-1]), exit(1);
*options[j].value.integer = integer;
}
break;
case DONatural:
{
int integer;
if (sscanf(argv[i], "%i", &integer) != 1)
printf("%s: error oarsing argument for option %s\n",
argv[0], argv[i-1]), exit(1);
if (integer < 0)
printf("%s: argument %s must be >= 0\n",
argv[0], argv[i-1]), exit(1);
*options[j].value.integer = integer;
}
break;
case DOString:
*options[j].value.string = argv[i];
break;
}
break;
}
}
if (!found) {
printf("%s: unrecognized option '%s'\n", argv[0], argv[i]);
printHelp(argv[0], programDescription, options, count), exit(1);
}
}
}

View file

@ -0,0 +1,72 @@
/*
* Copyright (c) 1999 Alfredo K. Kojima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* $Id: dapixmap.c,v 1.1.1.1 2004/02/27 02:53:10 john Exp $
*/
#include <X11/Xlib.h>
#include <X11/xpm.h>
#include <X11/extensions/shape.h>
#include <X11/Xatom.h>
#include "dockapp.h"
extern int d_width, d_height;
void
DASetShapeWithOffset(Pixmap shapeMask, int x_ofs, int y_ofs)
{
XShapeCombineMask(DADisplay, DAWindow, ShapeBounding, -x_ofs, -y_ofs, shapeMask,
ShapeSet);
XFlush(DADisplay);
}
void
DASetPixmap(Pixmap pixmap)
{
XSetWindowBackgroundPixmap(DADisplay, DAWindow, pixmap);
XClearWindow(DADisplay, DAWindow);
XFlush(DADisplay);
}
Pixmap
DAMakePixmap(void)
{
return (XCreatePixmap(DADisplay, DAWindow, d_width, d_height, DADepth));
}
Bool
DAMakePixmapFromData(char **data, Pixmap *pixmap, Pixmap *mask,
unsigned *width, unsigned *height)
{
XpmAttributes xpmAttr;
xpmAttr.valuemask = XpmCloseness;
xpmAttr.closeness = 40000;
if (XpmCreatePixmapFromData(DADisplay, DAWindow, data,
pixmap, mask, &xpmAttr) != 0)
return False;
*width = xpmAttr.width;
*height = xpmAttr.height;
return True;
}

View file

@ -0,0 +1,51 @@
/*
* Copyright (c) 1999 Alfredo K. Kojima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* $Id: darect.c,v 1.1.1.1 2004/02/27 02:53:10 john Exp $
*/
#include "dockapp.h"
void
DAProcessActionRects(int x, int y, DAActionRect *actionrects, int count,
void *data)
{
int index = 0;
if (!actionrects)
return;
while ( (index < count) &&
((x < actionrects[index].rect.x) ||
(x > actionrects[index].rect.x + actionrects[index].rect.width) ||
(y < actionrects[index].rect.y) ||
(y > actionrects[index].rect.y + actionrects[index].rect.height)))
index++;
if (index == count)
return;
if (actionrects[index].action)
(*actionrects[index].action)(x - actionrects[index].rect.x,
y - actionrects[index].rect.y,
actionrects[index].rect,
data);
}

253
wmusic/libdockapp/dockapp.h Normal file
View file

@ -0,0 +1,253 @@
/*
* Copyright (c) 1999 Alfredo K. Kojima
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* $Id: dockapp.h,v 1.1.1.1 2004/02/27 02:53:10 john Exp $
*/
#ifndef _DOCKAPP_H_
#define _DOCKAPP_H_
/*
* This is a simple (trivial) library for writing Window Maker dock
* applications, or dockapps (those that only show up in the dock), easily.
*
* It is very limited and can be only used for dockapps that open a single
* appicon for process in only ibe single display, but this seems to be
* enough for most, if not all, dockapps.
*/
#include <X11/Xlib.h>
#include <X11/xpm.h>
#include <stdlib.h>
#include <stdio.h>
/*
* the callbacks for events related to the dockapp window your program wants
* to handle
*/
typedef struct {
/* the dockapp window was destroyed */
void (*destroy)(void);
/* button pressed */
void (*buttonPress)(int button, int state, int x, int y);
/* button released */
void (*buttonRelease)(int button, int state, int x, int y);
/* pointer motion */
void (*motion)(int x, int y);
/* pointer entered dockapp window */
void (*enter)(void);
/* pointer left dockapp window */
void (*leave)(void);
/* timer expired */
void (*timeout)(void);
} DACallbacks;
typedef struct {
char *shortForm; /* short form for option, like -w */
char *longForm; /* long form for option, like --withdrawn */
char *description; /* description for the option */
short type; /* type of argument */
Bool used; /* if the argument was passed on the cmd-line */
/* the following are only set if the "used" field is True */
union {
void *ptr; /* a ptr for the value that was passed */
int *integer; /* on the command line */
char **string;
} value;
} DAProgramOption;
typedef struct {
int x, y;
int width, height;
} DARect;
typedef void DARectCallback(int x, int y, DARect rect, void *data);
typedef struct {
DARect rect;
DARectCallback *action;
} DAActionRect;
/* option argument types */
enum {
DONone, /* simple on/off flag */
DOInteger, /* an integer number */
DOString, /* a string */
DONatural /* positive integer number */
};
extern Display *DADisplay;
extern Window DAWindow;
extern int DADepth;
extern Visual *DAVisual;
extern GC DAGC;
extern DARect DANoRect;
/*
* DAParseArguments-
* Command line arguments parser. The program is exited if there are
* syntax errors.
*
* -h, --help and --version are automatically handled (causing the program
* to exit)
* -w is handled automatically as well and causes the dockapp to be run
* in windowed mode.
*/
void DAParseArguments(int argc, char **argv, DAProgramOption *options,
int count, char *programDescription, char *versionDescription);
/*
* DAInitialize-
* Initialize the dockapp, open a connection to the X Server,
* create the needed windows and set them up to become an appicon window.
* It will automatically detect if Window Maker is present and use
* an appropriate window form.
*
* You must call this always before calling anything else (except for
* DAParseArguments())
*
* Arguments:
* display - the name of the display to connect to.
* Use "" to use the default value.
* name - the name of your dockapp, used as the instance name
* for the WM_CLASS hint. Like wmyaclock.
* The ClassName is set to "DockApp" on default.
* width, height - the size of the dockapp window. 48x48 is the
* preferred size.
* argc, argc - the program arguments. argv[0] will be used
* as the instance name for the WM_CLASS hint.
*/
#define DAInitialize(display, name, width, height, argc, argv) \
DAGetDisplay(display, argc, argv); \
DACreateIcon(name, width, height, argc, argv);
void DAGetDisplay(char *display, int argc, char **argv);
void DACreateIcon(char *name, unsigned width, unsigned height,
int argc, char **argv);
void DAProposeIconSize(unsigned width, unsigned height);
/*
* DASetShapeWithOffset-
* Sets the shape mask of the dockapp to the specified one. This is
* optional. If you pass None as shapeMask, the dockapp will become
* non-shaped.
*
* This is only needed if you want the dockapp to be shaped.
*/
#define DASetShape(shapeMask) (DASetShapeWithOffset((shapeMask), 0, 0))
void DASetShapeWithOffset(Pixmap shapeMask, int x_ofs, int y_ofs);
/*
* DASetPixmap-
* Sets the image pixmap for the dockapp. Once you set the image with it,
* you don't need to handle expose events.
*/
void DASetPixmap(Pixmap pixmap);
/*
* DAMakePixmap-
* Creates a pixmap suitable for use with DASetPixmap()
*/
Pixmap DAMakePixmap(void);
/*
* DAMakePixmapFromData-
* Creates a pixmap and mask from XPM data
*/
Bool DAMakePixmapFromData(char **data, Pixmap *pixmap, Pixmap *mask,
unsigned *width, unsigned *height);
/*
* DAGetColor-
* Returns a color.
*/
unsigned long DAGetColor(char *colorName);
/*
* DAShow-
* Opens the dockapp.
*
* Always call this function or the dockapp won't show up.
*/
void DAShow(void);
/*
* DASetCallbacks-
* Register a set of callbacks for events like mouse clicks.
*
* Only needed if you want to receive some event.
*/
void DASetCallbacks(DACallbacks *callbacks);
/*
* DASetTimeout-
* Sets a timeout for the DAEventLoop(). The timeout callback
* will be called whenever the app doesn't get any events from the
* X server in the specified time.
*/
void DASetTimeout(int miliseconds);
/*
* DANextEventOrTimeout-
* Waits until a event is received or the timeout limit has
* expired. Returns True if an event was received.
*/
Bool DANextEventOrTimeout(XEvent *event, unsigned long miliseconds);
/*
* DAProcessEvent-
* Processes an event. Returns True if the event was handled and
* False otherwise.
*
* Must be called from your event loop, unless you use DAEventLoop()
*/
Bool DAProcessEvent(XEvent *event);
/*
* DAEventLoop-
* Enters an event loop where events are processed until the dockapp
* is closed. This function never returns.
*/
void DAEventLoop(void);
/*
* DAProcessActionRects-
* Processes the current coordinates for the functions in the array of
* action rectangles, converting coordinates to relative coordinates in
* the rectangles. The last item must be NULL.
*/
void DAProcessActionRects(int x, int y, DAActionRect *actionrects,
int count, void *data);
#endif

37
wmusic/src/Makefile.in Normal file
View file

@ -0,0 +1,37 @@
RCSS = wmusic.c Makefile.in config.h.in version.h.in
CC = @CC@
PREFIX = @prefix@
SRCS = wmusic.c ../libdockapp/dacallback.c ../libdockapp/dacolor.c \
../libdockapp/daevent.c ../libdockapp/damain.c \
../libdockapp/dapixmap.c ../libdockapp/darect.c
OBJS = $(SRCS:.c=.o)
CFLAGS = -Wall -g -O2 -I. -I../libdockapp `@PATH_GTKCONFIG@ --cflags` \
`@PATH_XMMSCONFIG@ --cflags` \
-DDATA_DIR=\"`@PATH_XMMSCONFIG@ --data-dir`\"
LDFLAGS = @LIBS@ -lXpm `@PATH_GTKCONFIG@ --libs` `@PATH_XMMSCONFIG@ --libs` \
@DGA_LIBS@ @VM_LIBS@
all: wmusic
install: all
if test ! -d $(PREFIX); then mkdir -p $(PREFIX); fi
if test ! -d $(PREFIX)/bin; then mkdir -p $(PREFIX)/bin; fi
@INSTALL@ -c -m 755 -s wmusic $(PREFIX)/bin
wmusic: $(OBJS) $(IFLAGS)
gcc -g -o wmusic $(OBJS) $(LDFLAGS)
uninstall: clean
rm -f $(PREFIX)/bin/wmusic
clean:
rm -f *~ *.o ../libdockapp/*~ ../libdockapp/*.o core wmusic
distclean: clean
rm -f Makefile config.h version.h

0
wmusic/src/config.h.in Normal file
View file

1
wmusic/src/version.h.in Normal file
View file

@ -0,0 +1 @@
#define VERSION "@PACKAGE@ @VERSION@"

View file

@ -0,0 +1,161 @@
/* XPM */
static char * wmusic_digits_xpm[] = {
"193 101 57 1",
" c None",
". c #202020",
"+ c #1FB1AC",
"@ c #23ADA7",
"# c #27A8A3",
"$ c #2AA39F",
"% c #2E9F9B",
"& c #319A97",
"* c #359593",
"= c #38908F",
"- c #3C8C8B",
"; c #3F8787",
"> c #438282",
", c #477E7E",
"' c #4A797A",
") c #4E7476",
"! c #516F72",
"~ c #556B6E",
"{ c #58666A",
"] c #5C6166",
"^ c #5F5C62",
"/ c #63585D",
"( c #675359",
"_ c #6A4E55",
": c #6E4A51",
"< c #71454D",
"[ c #754049",
"} c #783B45",
"| c #7C3741",
"1 c #7F323D",
"2 c #832D38",
"3 c #872934",
"4 c #8A2430",
"5 c #8E1F2C",
"6 c #911A28",
"7 c #951624",
"8 c #981120",
"9 c #9C0C1C",
"0 c #9F0717",
"a c #1F1F1F",
"b c #20B2AC",
"c c #004841",
"d c #188983",
"e c #107C78",
"f c #004840",
"g c #A00818",
"h c #FF7F7F",
"i c #FF0000",
"j c #000000",
"k c #808088",
"l c #A8A8A8",
"m c #F8FCF8",
"n c #F0F0F8",
"o c #004941",
"p c #20B2AE",
"q c #007D71",
"r c #1A2625",
".............................................................+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ",
"..bbb...cccd.dbbbd.dbbbd.dcccd.dbbbd.dbbbd.dbbbd.dbbbd.dbbbd.+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ",
".b...b.c...b.c...b.c...b.b...b.b...c.b...c.c...b.b...b.b...b.+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ",
".b...b.c...b.c...b.c...b.b...b.b...c.b...c.c...b.b...b.b...b.+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ",
".dcccd..cccd.dbbbd..bbbd.dbbbd.dbbbd.dbbbd..cccd.dbbbd.dbbbd.+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ",
".b...b.c...b.b...c.c...b.c...b.c...b.b...b.c...b.b...b.c...b.+@#$%&*=-;>,')!~{]^/(_:<[}|1234567890aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ",
".b...b.c...b.b...c.c...b.c...b.c...b.b...b.c...b.b...b.c...b. ",
"..bbb...cccd.dbbbd.dbbbd..cccd.dbbbd.dbbbd..cccd.dbbbd.dbbbd. ",
"............................................................. ",
"............................................................................. ",
"............................................................................. ",
"...bbbb...cccce.ebbbbd.ebbbbe.ecccce.ebbbbe.ebbbbd.ebbbbe.ebbbbd.ebbbbd...... ",
"..b....b.c....b.c....b.c....b.b....b.b....c.b....c.c....b.b....b.b....b..b... ",
"..b....b.c....b.c....b.c....b.b....b.b....c.b....c.c....b.b....b.b....b..b... ",
"..b....b.c....b.c....b.c....b.b....b.b....c.b....c.c....b.b....b.b....b...... ",
"..ecccce..cccce.ebbbbe.ebbbbe.ebbbbe.ebbbbe.ebbbbe..cccce.ebbbbe.ebbbbe...... ",
"..b....b.c....b.b....c.c....b.c....b.c....b.b....b.c....b.b....b.c....b...... ",
"..b....b.c....b.b....c.c....b.c....b.c....b.b....b.c....b.b....b.c....b..b... ",
"..b....b.c....b.b....c.c....b.c....b.c....b.b....b.c....b.b....b.c....b..b... ",
"...bbbb...cccce.ebbbbe.ebbbbe..cccce.ebbbbe.ebbbbe..cccce.ebbbbe.ebbbbe...... ",
"............................................................................. ",
"............................................................................. ",
"...b...f.....b...f.....b...b.....gggg....higg....ihhi....ggih....gggg....gggg. ",
"..bb.f..f...bb.b..f...bb.b..b...g....g..h....g..g....g..g....h..g....i..g....g ",
"bbbb..f..fbbbb..b..fbbbb..b..b..f....g..f....g..f....g..f....i..f....h..f....g ",
"bbbb..f..fbbbb..b..fbbbb..b..b..i....i..g....g..g....g..g....g..g....h..g....g ",
"..bb.f..f...bb.b..f...bb.b..b..iii...h.ggg...g.ggg...g.ggg...g.ggg...i.ggg...g ",
"...b...f.....b...f.....b...b..iiiii..hggggg..iggggg..gggggg..gggigg..gggggg..g ",
" ..g....i..g....h..g....g..g....g..h....g..g....g ",
" ..g....g..g....h..g....i..i....g..h....g..g....g ",
" ...gggg....gggi....gihh....hhig....iggg....gggg. ",
"jjjjjjjjjjjjjkjjjjjjjjjjjjjkjjjjjjjjjjjjkjjjjjjjjjjjjk ",
"jllllllllllllmjllllllllllllmjlllllllllllmjlllllllllllm ...f...f.. ",
"jlljlljlljlllmjlljlljlljlllmjlllljlljlllmjllljlljllllm ..ff.f..f. ",
"jlljljjljjlllmjlljjljjljlllmjllljjljjlllmjllljjljjlllm ffff..f..f ",
"jlljjjjjjjlllmjlljjjjjjjlllmjlljjjjjjlllmjllljjjjjjllm ffff..f..f ",
"jlljljjljjlllmjlljjljjljlllmjllljjljjlllmjllljjljjlllm ..ff.f..f. ",
"jlljlljlljlllmjlljlljlljlllmjlllljlljlllmjllljlljllllm ...f...f.. ",
"jllllllllllllmjllllllllllllmjlllllllllllmjlllllllllllm ",
"kmmmmmmmmmmmmmkmmmmmmmmmmmmmkmmmmmmmmmmmmkmmmmmmmmmmmm .................. ",
"jjjjjjjjjjkjjjjjjjjjjjjjjjjjjjjkjjjjjjjjjjkjjjjjjjjjjk .................. ",
"jlllllllllmjlllllllllllllllllllmjlllllllllmjlllllllllm b...b............. ",
"jlllllllllmjlllllllllllllllllllmjlllllllllmjlllllllllm b...b............. ",
"jlllljllllmjllllllljjllllllllllmjlljjljjllmjlljjjjjllm b.b.bb..bb..bbb... ",
"jllljjjlllmjllllllljjjjllllllllmjlljjljjllmjlljjjjjllm bb..b.b.b.b.fb.... ",
"jlljjjjjllmjllllllljjjjjjllllllmjlljjljjllmjlljjjjjllm b.b.bb..bb..bbb... ",
"jlllllllllmjllllllljjjjllllllllmjlljjljjllmjlljjjjjllm ........b......... ",
"jlljjjjjllmjllllllljjllllllllllmjlljjljjllmjlljjjjjllm ",
"jlllllllllmjlllllllllllllllllllmjlllllllllmjlllllllllm ",
"jlllllllllmjlllllllllllllllllllmjlllllllllmjlllllllllm ",
"kmmmmmmmmmmkmmmmmmmmmmmmmmmmmmmmkmmmmmmmmmmkmmmmmmmmmm ",
"nmmmmmmmmnnnnknnnmmmmmnnnnnknmmmmmmmmnnnknnnmmmmmnnnnk ",
"nlllllllllllljnlllllllllllljnllllllllllljnlllllllllllj ",
"nlljlljlljllljnlljlljlljllljnlllljlljllljnllljlljllllj ",
"nlljljjljjllljnlljjljjljllljnllljjljjllljnllljjljjlllj ",
"nlljjjjjjjllljnlljjjjjjjllljnlljjjjjjllljnllljjjjjjllj ",
"nlljljjljjllljnlljjljjljllljnllljjljjllljnllljjljjlllj ",
"nlljlljlljllljnlljlljlljllljnlllljlljllljnllljlljllllj ",
"nlllllllllllljnlllllllllllljnllllllllllljnlllllllllllj ",
"kjjjjjjjjjjjjjkjjjjjjjjjjjjjkjjjjjjjjjjjjkjjjjjjjjjjjj ",
"nnmmmmmnnnknnnnnmmmmmmmmmmmmmmmknnnmmmmnnnknnnmmmmnnnk ",
"nllllllllljnllllllllllllllllllljnllllllllljnlllllllllj ",
"nllllllllljnllllllllllllllllllljnllllllllljnlllllllllj ",
"nlllljlllljnllllllljjlllllllllljnlljjljjlljnlljjjjjllj ",
"nllljjjllljnllllllljjjjlllllllljnlljjljjlljnlljjjjjllj ",
"nlljjjjjlljnllllllljjjjjjlllllljnlljjljjlljnlljjjjjllj ",
"nllllllllljnllllllljjjjlllllllljnlljjljjlljnlljjjjjllj ",
"nlljjjjjlljnllllllljjlllllllllljnlljjljjlljnlljjjjjllj ",
"nllllllllljnllllllllllllllllllljnllllllllljnlllllllllj ",
"nllllllllljnllllllllllllllllllljnllllllllljnlllllllllj ",
"kjjjjjjjjjjkjjjjjjjjjjjjjjjjjjjjkjjjjjjjjjjkjjjjjjjjjj ",
" ",
"............................................................................................................................................................. ",
".opppo.qppp..qpppq.qppp..qpppq.qpppq.qpppq.qoooq..oooq..oooq.qoooq.qooo..pooop.qppp..qpppq.qpppq.qpppq.qpppq.qpppq.qpppq.qoooq.qoooq.qoooq.qoooq.qoooq.qpppq. ",
".p...p.p...p.p...o.p...p.p...o.p...o.p...o.p...p.o...p.o...p.p...p.p...o.pp.pp.p...p.p...p.p...p.p...p.p...p.p...o.o.p.o.p...p.p...p.p...p.p...p.p...p.o...p. ",
".p...p.p...p.p...o.p...p.p...o.p...o.p...o.p...p.o...p.o...p.p..po.p...o.p.p.p.p...p.p...p.p...p.p...p.p...p.p...o.o.p.o.p...p.p...p.p...p.op.po.p...p.o..po. ",
".qpppq.qppp..qooo..qoooq.qppp..qppp..qoppq.qpppq..oooq..oooq.qppo..qooo..qoooq.qoooq.qoooq.qpppq.qpooq.qppp..qpppq..oqo..qoooq.qoooq.qoooq..opo..qpppq..opo.. ",
".p...p.p...p.p...o.p...p.p...o.p...o.p...p.p...p.o...p.o...p.p..po.p...o.p...p.p...p.p...p.p...o.p.p.p.p...p.o...p.o.p.o.p...p.p...p.p.p.p.op.po.o...p.op..o. ",
".p...p.p...p.p...o.p...p.p...o.p...o.p...p.p...p.o...p.o...p.p...p.p...o.p...p.p...p.p...p.p...o.p..pp.p...p.o...p.o.p.o.p...p.p...p.pp.pp.p...p.o...p.p...o. ",
".qoooq.qppp..qpppq.pppp..qpppq.pooo..qpppq.qoooq..ooop.qpppq.qoooq.qpppo.qoooq.pooop.qpppq.qooo..qpppq.qoooq.qpppq..oqo..opppp..ppp..pooop.qooopqqpppq.qpppq. ",
"............................................................................................................................................................. ",
" ",
"........................................................................................................................q...... ",
"..ppp...oooq.qpppq.qpppq.qoooq.qpppq.qpppq.qpppq.qpppq.qpppq..ooo...ooo...ooo...poo...poo...oop...ooo...oop...p.p..opppq.opopo. ",
".p...p.o...p.o...p.o...p.p...p.p...o.p...o.o...p.p...p.p...p.o...o.o...o.o...o.p...o.p...o.o...p.p.q.p.o..po.o.pro.pq..o.qpppq. ",
".p...p.o...p.o...p.o...p.p...p.p...o.p...o.o...p.p...p.p...p.o...o.o...o.o...o.p...o.p...o.o...p.oqqqo.o.p.o.o.p.o.p...o.p...o. ",
".qoooq..oooq.qpppq..pppq.qpppq.qpppq.qpppq..oooq.opppo.qpppq..ooo..qpppq..ooo...ooo..qooo...oooq.ppppp..opo...oqo..pppq..qppq.. ",
".p...p.o...p.p...o.o...p.o...p.o...p.p...p.o...p.p...p.o...p.o...o.o...o.o...o.o...o.p...o.o...p.oqqqo.o.p.o.o.p.o.p...o.p...o. ",
".p...p.o...p.p...o.o...p.o...p.o...p.p...p.o...p.p...p.o...p.o...o.o...o.o...o.o...o.p...o.o...p.p.q.p.op..o.o.p.o.pq..o.p...o. ",
"..ppp...ooop.qpppq.qpppq..oooq.qpppq.qpppq..oooq.qpppq.qpppq..ooo...ooo...qpq...ooo...poo...oop...ooo...poo...opo..opppq.qpppq. ",
"............................................................................................................................... ",
" ",
"................................................................................................................................................................................................ ",
".qoqpq.opppo.qpppq.qooq...qpq..qpppq..opo..qpppq.qoooq.qoooq.qopoq.qoooq..qppq.pooop.qoooq.qpppq.qpppq.qpppq.qpppq.qpppq.qpppq.qoooq.qoqoq.qppp..qooo..qoooq..pppq.qoqoq.qpppq.qoqoq.qoooq.pqoo. ",
".p.p.p.p...p.p...o.p..po.op.po.p...o.qpppq.p...o.p...p.p...p.p...p.p...p.opq.p.pp.pp.p...p.p...p.p...p.p...p.p...p.p...o.o.p.o.p...p.p.p.p.p...p.p...o.p...p.q...p.p.p.p.o...p.p.p.p.p...p.op..o ",
".p.p.p.p...p.p...o.p..po.op.po.p...o.p.p.p.p...o.op.po.p..pp.p..pp.p..po.op..p.p.p.p.p...p.p...p.p...p.p...p.p...p.p...o.o.p.o.p...p.p.p.p.p...p.p...o.p...p.o...p.p.p.p.o...p.p.p.p.p...p.op..o ",
".qpqoq.qpppq.qppp..poop...pop..qppq..qopoq.qooo...opo..qopoq.qopoq.qppo...pooq.qoooq.qpppq.qoooq.qoooq..pppq.qpppq.qooo...oqo..qpppq..ppp..qppp..qpppq.qpqoq..qpp..qoqoq.qpppq.qoqoq.qpppq..qppq ",
".p.p.p.p...p.p...p.p..po.op.po.p...o.p.p.p.p...o.op.po.pp..p.pp..p.p..po.op..p.p...p.p...p.p...p.p...p.p...p.p...o.p...o.o.p.o.o...p.p.p.p.p...p.p...p.p.p.p.o...p.p.p.p.o...p.p.p.p.o...p.op..p ",
".p.p.p.p...p.p...p.qpppq.qpppq.p...o.qpppq.p...o.p...p.p...p.p...p.p...p.qp..p.p...p.p...p.p...p.p...p.p...p.p...o.p...o.o.p.o.o...p.p.p.p.p...p.p...p.p.p.p.q...p.p.p.p.o...p.qpqpq.o...p.op..p ",
".qoqpq.qoooq.qppp...ooqp.pqoqp.qpppq..opo..qooo..qoooq.qoooq.qoooq.qoooq.pqoop.qoooq.qoooq.qpppq.qoooq.qoooq.qooo..qpppq..oqo..qpppq.qoqoq.qppp..qpppq.qpqoq..pppq.qpppq.qpppq..ooop..oooq..qppq ",
"................................................................................................................................................................................................ "};

View file

@ -0,0 +1,83 @@
/* XPM */
static char * wmusic_master_xpm[] = {
"64 64 16 1",
" c None",
". c #202020",
"+ c #C0C0C0",
"@ c #20B0A8",
"# c #188880",
"$ c #107C78",
"% c #004840",
"& c #A00818",
"* c #20B2AC",
"= c #188983",
"- c #004841",
"; c #000000",
"> c #F0F0F8",
", c #F8FCF8",
"' c #808088",
") c #A8A8A8",
" ",
" ",
" ",
" ",
" ........................................................ ",
" .......................................................+ ",
" .......................................................+ ",
" ....@@@@...@@@@........@@@@...@@@@........@@@...@@@....+ ",
" ...@....@.@....@..#@..@....@.@....@......@...@.@...@...+ ",
" ...@....@.@....@..$@..@....@.@....@......@...@.@...@...+ ",
" ...@....@.@....@......@....@.@....@......$%%%$.$%%%$...+ ",
" ...$%%%%$.$%%%%$......$%%%%$.$%%%%$......@...@.@...@...+ ",
" ...@....@.@....@......@....@.@....@......@...@.@...@...+ ",
" ...@....@.@....@..#@..@....@.@....@.......@@@...@@@....+ ",
" ...@....@.@....@..$@..@....@.@....@....................+ ",
" ....@@@@...@@@@........@@@@...@@@@.....................+ ",
" .......................................................+ ",
" .......................................................+ ",
" .........%...%.........................................+ ",
" ........%%.%..%...............................&&&&.....+ ",
" ......%%%%..%..%.............................&....&....+ ",
" ......%%%%..%..%.............................%....&....+ ",
" ........%%.%..%..............................&....&....+ ",
" .........%...%..............................&&&...&....+ ",
" ...........................................&&&&&..&....+ ",
" .............................................&....&....+ ",
" ....***...***...***..........................&....&....+ ",
" ...*...*.*...*.*...*..........................&&&&.....+ ",
" ...*...*.*...*.*...*.*...*.............................+ ",
" ...=---=.=---=.=---=.*...*.............................+ ",
" ...*...*.*...*.*...*.*.*.**..**..***...................+ ",
" ...*...*.*...*.*...*.**..*.*.*.*.%*....................+ ",
" ....***...***...***..*.*.**..**..***...................+ ",
" .............................*.........................+ ",
" .......................................................+ ",
" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
" ",
" ",
" ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ",
" ;>,,,,,,,,>>>>'>>>,,,,,>>>>>'>,,,,,,,,>>>'>>>,,,,,>>>>'+ ",
" ;>))))))))))));>))))))))))));>)))))))))));>)))))))))));+ ",
" ;>));));));)));>));));));)));>))));));)));>)));));))));+ ",
" ;>)););;);;)));>));;);;);)));>)));;);;)));>)));;);;)));+ ",
" ;>));;;;;;;)));>));;;;;;;)));>));;;;;;)));>)));;;;;;));+ ",
" ;>)););;);;)));>));;);;);)));>)));;);;)));>)));;);;)));+ ",
" ;>));));));)));>));));));)));>))));));)));>)));));))));+ ",
" ;>))))))))))));>))))))))))));>)))))))))));>)))))))))));+ ",
" ;';;;;;;;;;;;;;';;;;;;;;;;;;;';;;;;;;;;;;;';;;;;;;;;;;;+ ",
" ;>>,,,,,>>>'>>>>>,,,,,,,,,,,,,,,'>>>,,,,>>>'>>>,,,,>>>'+ ",
" ;>)))))))));>)))))))))))))))))));>)))))))));>)))))))));+ ",
" ;>)))))))));>)))))))))))))))))));>)))))))));>)))))))));+ ",
" ;>))));))));>)))))));;))))))))));>));;);;));>));;;;;));+ ",
" ;>)));;;)));>)))))));;;;))))))));>));;);;));>));;;;;));+ ",
" ;>));;;;;));>)))))));;;;;;))))));>));;);;));>));;;;;));+ ",
" ;>)))))))));>)))))));;;;))))))));>));;);;));>));;;;;));+ ",
" ;>));;;;;));>)))))));;))))))))));>));;);;));>));;;;;));+ ",
" ;>)))))))));>)))))))))))))))))));>)))))))));>)))))))));+ ",
" ;>)))))))));>)))))))))))))))))));>)))))))));>)))))))));+ ",
" ;';;;;;;;;;;';;;;;;;;;;;;;;;;;;;;';;;;;;;;;;';;;;;;;;;;+ ",
" ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ",
" ",
" ",
" ",
" "};

763
wmusic/src/wmusic.c Normal file
View file

@ -0,0 +1,763 @@
/* wmusic - a xmms remote-controlling DockApp
* Copyright (C) 2000-2001 Bastien Nocera <hadess@hadess.net>
* Maintained by John Chapin <john+wmusic@jtan.com>
*
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#define DBL_CLICK_INTERVAL 250 /* double click interval in milliseconds */
#define ARROW_INTERVAL 100 /* arrow update interval in milliseconds */
#define SCROLL_INTERVAL 300 /* scroll update interval in milliseconds */
#define SEPARATOR " ** " /* The separator for the scrolling title */
#define DISPLAYSIZE 6 /* width of text to display (running title) */
#include <dockapp.h>
#include <unistd.h>
#include <ctype.h>
#include <string.h>
#include <locale.h>
#include <xmms/xmmsctrl.h>
#include "version.h"
#include "config.h"
#include "wmusic-master.xpm"
#include "wmusic-digits.xpm"
/*---------------------------------------------------------------------------*/
/* Prototypes */
/*---------------------------------------------------------------------------*/
void copyNumArea(int x, int y, int sx, int sy, int dx, int dy);
void ActionPlay(int x, int y, DARect rect, void *data);
void ActionPause(int x, int y, DARect rect, void *data);
void ActionEject(int x, int y, DARect rect, void *data);
void ActionPrev(int x, int y, DARect rect, void *data);
void ActionNext(int x, int y, DARect rect, void *data);
void ActionStop(int x, int y, DARect rect, void *data);
void ActionFastr(int x, int y, DARect rect, void *data);
void ActionFastf(int x, int y, DARect rect, void *data);
void ToggleWins(int x, int y, DARect rect, void *data);
void ToggleVol(int x, int y, DARect rect, void *data);
void ChangeVol(int x, int y, DARect rect, void *data);
void ToggleTitle(int x, int y, DARect rect, void *data);
void ToggleTime(int x, int y, DARect rect, void *data);
void buttonPress(int button, int state, int x, int y);
void buttonRelease(int button, int state, int x, int y);
void DisplayRoutine();
void DrawPos (int pos);
void DrawTime(int time);
void DrawArrow(void);
void DrawChannels(int channels);
void DrawKbps(int bps);
void DrawTitle(char *title);
void ExecuteXmms(void);
/*----------------------------------------------------------------------------*/
/* Variables */
/*----------------------------------------------------------------------------*/
/* X11 variables */
char *displayName = "";
GC gc;
XEvent ev;
/* Dockapp variables */
unsigned int xmms_session = 0;
char *xmms_cmd = "xmms";
Bool main_vis=0, pl_vis=0, eq_vis=0;
Bool xmms_running;
unsigned int volume_step = 5;
Bool run_excusive=0;
Bool t_scroll=0;
Bool t_time=0;
Bool t_volume=0;
float title_pos = 0;
unsigned int arrow_pos = 0;
Bool pause_norotate = 0;
Time click_time=0;
Pixmap pixmap, mask; /* Pixmap that is displayed */
Pixmap pixnum, masknum; /* Pixmap source */
int left_pressed = 0; /* for pseudo drag callback */
int motion_event = 0; /* on motion events we do not want(too fast) display update */
static DAActionRect buttonRects[] = {
{{5, 39, 14, 9}, ActionPrev},
{{19, 39, 14, 9}, ActionNext},
{{33, 39, 13, 9}, ActionFastr},
{{46, 39, 13, 9}, ActionFastf},
{{5, 48, 11, 11}, ActionEject},
{{16, 48, 21, 11}, ActionPlay},
{{37, 48, 11, 11}, ActionPause},
{{48, 48, 11, 11}, ActionStop}
};
static DAActionRect toggleRect[] = {
{{5, 5, 54, 30}, ToggleWins}
};
static DAActionRect globRect[] = {
{{0, 0, 64, 64}, ToggleVol}
};
static DAActionRect displayRects[] = {
{{5, 5, 54, 12}, ToggleTime},
{{5, 25, 54, 9}, ToggleTitle}
};
static DAActionRect volumeRects[] = {
{{5, 17, 38, 8 }, ChangeVol}
};
static DAProgramOption options[] = {
{"-c", "--command", "Command to launch xmms", DOString, False,
{&xmms_cmd} },
{"-d", "--display", "Display to use", DOString, False, {&displayName} },
{"-r", "--run", "Run xmms on startup", DONone, False, {NULL} },
{"-s", "--session", "Xmms session to use", DONatural, False,
{&xmms_session} },
{"-t", "--title", "Show title instead of kbps by default", DONone,
False, {NULL} },
{"-u", "--hide", "Hide xmms windows on startup", DONone, False,
{NULL} },
{"-V", "--volume", "Stepping of the wheel volume control (in percent)",
DONatural, False, {&volume_step} },
{"-x", "--wmxmms", "Use wmxmms-like show and hide", DONone, False,
{NULL} },
{"-a", "--rotate-arrow", "Do not rotate the arrow, when paused",
DONone, False, {NULL} },
{"-l", "--time-left", "Show time left instead of time remaining by default",
DONone, False, {NULL} },
{"-b", "--volume-slider", "Show volume slider instead of channels",
DONone, False, {NULL}},
{"-R", "--run-excusive", "Run xmms on startup, exit when xmms exits", DONone, False, {NULL} }
};
typedef struct
{
wchar_t c;
int x;
int y;
} glyphdescr;
static glyphdescr glyphs[] = {
{L'-', 67, 83}, {L'.', 73, 83}, {L'\x27', 79, 83},
{L'(', 85, 83}, {L')', 91, 83}, {L'*', 97, 83}, {L'/', 103, 83},
{L'0', 1, 83}, {L'1', 7, 83}, {L'2', 13, 83}, {L'3', 19, 83}, {L'4', 25, 83},
{L'5', 31, 83}, {L'6', 37, 83}, {L'7', 43, 83}, {L'8', 49, 83}, {L'9', 55, 83},
{L'A', 1, 73}, {L'a', 1, 73},
{L'B', 7, 73}, {L'b', 7, 73},
{L'C', 13, 73}, {L'c', 13, 73},
{L'D', 19, 73}, {L'd', 19, 73},
{L'E', 25, 73}, {L'e', 25, 73},
{L'F', 31, 73}, {L'f', 31, 73},
{L'G', 37, 73}, {L'g', 37, 73},
{L'H', 43, 73}, {L'h', 43, 73},
{L'I', 49, 73}, {L'i', 49, 73},
{L'J', 55, 73}, {L'j', 55, 73},
{L'K', 61, 73}, {L'k', 61, 73},
{L'L', 67, 73}, {L'l', 67, 73},
{L'M', 73, 73}, {L'm', 73, 73},
{L'N', 79, 73}, {L'n', 79, 73},
{L'O', 85, 73}, {L'o', 85, 73},
{L'P', 91, 73}, {L'p', 91, 73},
{L'Q', 97, 73}, {L'q', 97, 73},
{L'R',103, 73}, {L'r',103, 73},
{L'S',109, 73}, {L's',109, 73},
{L'T',115, 73}, {L't',115, 73},
{L'U',121, 73}, {L'u',121, 73},
{L'V',127, 73}, {L'v',127, 73},
{L'W',133, 73}, {L'w',133, 73},
{L'X',139, 73}, {L'x',139, 73},
{L'Y',145, 73}, {L'y',145, 73},
{L'Z',151, 73}, {L'z',151, 73},
{L'\x42e', 1, 93}, {L'\x44e', 1, 93}, /* cyrillic Yu */
{L'\x410', 7, 93}, {L'\x430', 7, 93}, /* cyrillic A */
{L'\x411', 13, 93}, {L'\x431', 13, 93}, /* cyrillic Be */
{L'\x426', 19, 93}, {L'\x446', 19, 93}, /* cyrillic Ce */
{L'\x414', 25, 93}, {L'\x434', 25, 93}, /* cyrillic De */
{L'\x415', 31, 93}, {L'\x435', 31, 93}, /* cyrillic Ye */
{L'\x424', 37, 93}, {L'\x444', 37, 93}, /* cyrillic eF */
{L'\x413', 43, 93}, {L'\x433', 43, 93}, /* cyrillic Ge */
{L'\x425', 49, 93}, {L'\x445', 49, 93}, /* cyrillic Ha */
{L'\x418', 55, 93}, {L'\x438', 55, 93}, /* cyrillic I */
{L'\x419', 61, 93}, {L'\x439', 61, 93}, /* cyrillic I-kratkoe */
{L'\x41a', 67, 93}, {L'\x43a', 67, 93}, /* cyrillic Ka */
{L'\x41b', 73, 93}, {L'\x43b', 73, 93}, /* cyrillic eL */
{L'\x41c', 79, 93}, {L'\x43c', 79, 93}, /* cyrillic eM */
{L'\x41d', 85, 93}, {L'\x43d', 85, 93}, /* cyrillic eN */
{L'\x41e', 91, 93}, {L'\x43e', 91, 93}, /* cyrillic O */
{L'\x41f', 97, 93}, {L'\x43f', 97, 93}, /* cyrillic Pe */
{L'\x42f',103, 93}, {L'\x44f',103, 93}, /* cyrillic Ya */
{L'\x420',109, 93}, {L'\x440',109, 93}, /* cyrillic eR */
{L'\x421',115, 93}, {L'\x441',115, 93}, /* cyrillic eS */
{L'\x422',121, 93}, {L'\x442',121, 93}, /* cyrillic Te */
{L'\x423',127, 93}, {L'\x443',127, 93}, /* cyrillic U */
{L'\x416',133, 93}, {L'\x436',133, 93}, /* cyrillic Je */
{L'\x412',139, 93}, {L'\x432',139, 93}, /* cyrillic Ve */
{L'\x42c',145, 93}, {L'\x44c',145, 93}, /* cyrillic MyagkijZnak */
{L'\x42b',151, 93}, {L'\x44b',151, 93}, /* cyrillic Y */
{L'\x417',157, 93}, {L'\x437',157, 93}, /* cyrillic Ze */
{L'\x428',163, 93}, {L'\x448',163, 93}, /* cyrillic Sha */
{L'\x42d',169, 93}, {L'\x44d',169, 93}, /* cyrillic E */
{L'\x429',175, 93}, {L'\x449',175, 93}, /* cyrillic Scha */
{L'\x427',181, 93}, {L'\x447',181, 93}, /* cyrillic Che */
{L'\x42a',187, 93}, {L'\x44a',187, 93}, /* cyrillic TvyordyiZnak */
{L'\x404',115, 83}, {L'\x454',115, 83}, /* ukrainian IE */
{L'\x406', 49, 73}, {L'\x456', 49, 73}, /* ukrainian I */
{L'\x407',109, 83}, {L'\x457',109, 83}, /* ukrainian YI */
{L'\x491', 43, 93}, {L'\x490', 43, 93}, /* ukrainian GHE with upturn */
{L'\x401',121, 83}, {L'\x451',121, 83}, /* cyrillic Yo */
{L' ', 61, 83}
};
/*----------------------------------------------------------------------------*/
/* Functions */
/*----------------------------------------------------------------------------*/
void copyNumArea(int x, int y, int sx, int sy, int dx, int dy)
{
XCopyArea(DADisplay, pixnum, pixmap, gc, x, y, sx, sy, dx, dy);
}
void buttonDraw(DARect rect)
{
copyNumArea((rect.x)-5, (rect.y)-8, rect.width, rect.height,
rect.x, rect.y);
DASetPixmap(pixmap);
}
void ActionPlay(int x, int y, DARect rect, void *data)
{
if (data) {
buttonDraw(rect);
} else {
xmms_remote_play(xmms_session);
}
}
void ActionPause(int x, int y, DARect rect, void *data)
{
if (data) {
buttonDraw(rect);
} else {
xmms_remote_pause(xmms_session);
}
}
void ActionEject(int x, int y, DARect rect, void *data)
{
if (data) {
buttonDraw(rect);
} else {
xmms_remote_eject(xmms_session);
}
}
void ActionPrev(int x, int y, DARect rect, void *data)
{
if (data) {
buttonDraw(rect);
} else {
xmms_remote_playlist_prev(xmms_session);
}
}
void ActionNext(int x, int y, DARect rect, void *data)
{
if (data) {
buttonDraw(rect);
} else {
xmms_remote_playlist_next(xmms_session);
}
}
void ActionStop(int x, int y, DARect rect, void *data)
{
if (data) {
buttonDraw(rect);
} else {
xmms_remote_stop(xmms_session);
}
}
void ActionFastr(int x, int y, DARect rect, void *data)
{
if (data) {
buttonDraw(rect);
} else {
xmms_remote_jump_to_time(xmms_session,
xmms_remote_get_output_time(xmms_session)-10000);
}
}
void ActionFastf(int x, int y, DARect rect, void *data)
{
if (data) {
buttonDraw(rect);
} else {
xmms_remote_jump_to_time(xmms_session,
xmms_remote_get_output_time(xmms_session)+10000);
}
}
void ToggleWins(int x, int y, DARect rect, void *data)
{
if (xmms_running)
{
if (options[7].used)
{
if (data)
xmms_remote_main_win_toggle(xmms_session,
!xmms_remote_is_main_win(xmms_session));
if (!data)
xmms_remote_pl_win_toggle(xmms_session,
!xmms_remote_is_pl_win(xmms_session));
} else {
if (xmms_remote_is_main_win(xmms_session) ||
xmms_remote_is_pl_win(xmms_session) ||
xmms_remote_is_eq_win(xmms_session))
{
main_vis = xmms_remote_is_main_win(xmms_session);
pl_vis = xmms_remote_is_pl_win(xmms_session);
eq_vis = xmms_remote_is_eq_win(xmms_session);
xmms_remote_main_win_toggle(xmms_session, 0);
xmms_remote_pl_win_toggle(xmms_session, 0);
xmms_remote_eq_win_toggle(xmms_session, 0);
} else {
xmms_remote_main_win_toggle(xmms_session, main_vis);
xmms_remote_pl_win_toggle(xmms_session, pl_vis);
xmms_remote_eq_win_toggle(xmms_session, eq_vis);
}
}
} else {
if ( (ev.xbutton.time-click_time) <= DBL_CLICK_INTERVAL )
{
click_time=0;
ExecuteXmms();
} else {
click_time=ev.xbutton.time;
}
}
}
void ToggleVol(int x, int y, DARect rect, void *data)
{
int volume;
int factor;
if (*(int*)data == 1)
factor = volume_step;
else
factor = -volume_step;
/* xmms seems to do the bounds checking for us */
volume = xmms_remote_get_main_volume(xmms_session);
xmms_remote_set_main_volume(xmms_session, volume+factor);
}
void ChangeVol(int x, int y, DARect rect, void *data)
{
int volume = (int)100*(((float)x)/38);
xmms_remote_set_main_volume(xmms_session, volume);
}
void ToggleTitle(int x, int y, DARect rect, void *data)
{
if (t_scroll)
t_scroll = 0;
else t_scroll =1;
}
void ToggleTime(int x, int y, DARect rect, void *data)
{
if (t_time)
t_time = 0;
else t_time =1;
}
void buttonPress(int button, int state, int x, int y)
{
if (button==1)
left_pressed=1;
if (xmms_running)
{
if (button == 1)
{
char *tmp="1";
DAProcessActionRects(x, y, buttonRects, sizeof(buttonRects)/sizeof(DAActionRect), tmp);
DAProcessActionRects(x, y, displayRects, sizeof(displayRects)/sizeof(DAActionRect), tmp);
}
if (button == 2)
{
DAProcessActionRects(x, y, toggleRect, sizeof(toggleRect)/sizeof(DAActionRect), NULL);
}
if (button == 3)
{
char *tmp="1";
DAProcessActionRects(x, y, toggleRect, sizeof(toggleRect)/sizeof(DAActionRect), tmp);
}
if ((button == 4) || (button == 5))
{
if (button == 5)
{
/* Wheel scrolls down */
int tmp=2;
DAProcessActionRects(x, y, globRect, sizeof(globRect)/sizeof(DAActionRect), &tmp);
} else {
/* Wheel scrolls up */
int tmp=1;
DAProcessActionRects(x, y, globRect, sizeof(globRect)/sizeof(DAActionRect), &tmp);
}
}
}
else
DAProcessActionRects(x, y, toggleRect, sizeof(toggleRect)/sizeof(DAActionRect), NULL);
}
void buttonRelease(int button, int state, int x, int y)
{
if (button==1)
left_pressed=0;
if (xmms_running)
{
if (button == 1)
{
copyNumArea(0,51, 54, 20, 5,39);
DASetPixmap(pixmap);
DAProcessActionRects(x, y, buttonRects, sizeof(buttonRects)/sizeof(DAActionRect), NULL);
}
}
}
void buttonDrag(int x, int y)
{
motion_event=1;
if (t_volume)
if (left_pressed==1) {
DAProcessActionRects(x,y, volumeRects, 1, NULL);
DrawChannels(0); /* volume only update */
DASetPixmap(pixmap);
}
}
void DisplayRoutine()
{
int time = 0, length = 0, position = 100;
int rate, freq, nch;
char *title = NULL;
Bool do_scroll=t_scroll;
xmms_running=xmms_remote_is_running(xmms_session);
/* Compute diplay */
if (!xmms_running)
{
if (run_excusive)
exit(0);
position = 100; /* Will display "00" as the current position */
do_scroll = 0; /* Will display channel/kbps info */
arrow_pos = 5;
rate = 0;
time = 0;
nch = 4;
freq = 0;
length = 0;
} else {
/* check again, avoiding xmms_remote_* functions to hang,
if xmms was closed in the meantime */
if ((xmms_running = xmms_remote_is_running(xmms_session)))
{
position = xmms_remote_get_playlist_pos(xmms_session);
xmms_remote_get_info(xmms_session, &rate, &freq, &nch);
time = xmms_remote_get_output_time(xmms_session);
length = xmms_remote_get_playlist_time(xmms_session, position);
title = xmms_remote_get_playlist_title(xmms_session, position);
if (!xmms_remote_is_playing(xmms_session) || (pause_norotate &&
xmms_remote_is_paused(xmms_session) ))
arrow_pos = 5;
}
}
/*Draw everything */
if (t_time) DrawTime(length-time);
else DrawTime(time);
DrawPos(position);
DrawArrow();
DrawChannels(nch);
if (do_scroll && (title != NULL))
DrawTitle(title);
else
DrawKbps(rate);
DASetPixmap(pixmap);
if (title != NULL)
free(title);
}
void DrawPos (int pos)
{
char posstr[16];
char *p = posstr;
int i=1;
pos++;
if (pos > 99) pos=0;
sprintf(posstr, "%02d", pos);
for (;i<3; i++)
{
copyNumArea((*p-'0')*6 + 1, 1, 6, 7, (i*6)+39, 7);
p++;
}
}
void DrawTime(int time)
{
char timestr[16];
char *p = timestr;
int i=0;
time = time / 1000;
/* 3 cases:
* up to 99 minutes and 59 seconds
* up to 99 hours and 59 minutes
* more
*/
if (time < 6000)
{
sprintf(timestr, "%02d%02d", time / 60, time % 60);
} else {
if (time < 360000)
{
sprintf(timestr, "%02d%02d", time / 3600,
time % 3600 / 60);
} else {
sprintf(timestr, "%02d%02d", 0, 0);
}
}
for (;i<4; i++)
{
copyNumArea((*p-'0')*7 + 2, 11, 7, 9, i<2 ?(i*7)+7:(i*7)+12, 7);
p++;
}
}
void DrawArrow(void)
{
copyNumArea((arrow_pos*8)+30, 22, 8, 9, 47, 19);
arrow_pos++;
if (arrow_pos > 4) arrow_pos = 0;
}
void DrawChannels(int channels)
{
if (t_volume) {
int volume = (int)(0.36*(float)xmms_remote_get_main_volume(xmms_session));
if (volume > 36)
volume = 36;
copyNumArea(61, 0, volume, 6, 7, 18);
copyNumArea(97, 0, 36-volume, 6, 7+volume, 18);
} else {
if (channels == 4)
{
copyNumArea(55, 32, 10, 6, 10, 18);
} else {
copyNumArea((channels*10), 22, 10, 6, 10, 18);
}
}
}
void DrawKbps(int bps)
{
char kbpstr[16];
char *p = kbpstr;
int i=1;
if (bps > 999000) bps=0;
sprintf(kbpstr, "%03d", bps / 1000);
for (;i<4; i++)
{
copyNumArea((*p-'0')*6 + 1, 1, 6, 7, (i*6)+1, 26);
p++;
}
copyNumArea(55, 39, 18, 8, 25, 26);
}
void DrawChar(wchar_t wc, int x, int y)
{
int i;
for(i = 0; i < sizeof(glyphs)/sizeof(glyphdescr) - 1; ++i)
{
if(wc == glyphs[i].c)
break;
}
copyNumArea(glyphs[i].x, glyphs[i].y, 6, 8, x, y);
}
int DrawChars(char *title, int tpos, int pos)
{
wchar_t wc;
mbtowc(NULL, NULL, 0);
while(*title && (pos <= (tpos + DISPLAYSIZE)))
{
int len = mbtowc(&wc, title, MB_CUR_MAX);
title += len;
if(pos > tpos)
DrawChar(wc, (pos - tpos)*6 + 1, 26);
++pos;
}
return pos;
}
void DrawTitle(char *name)
{
int len, pos, tpos = title_pos;
if (name == NULL)
return;
#ifdef DEBUG
printf("name: %s\n", name);
#endif
len = pos = DrawChars(name, tpos, 0);
if(pos < 6)
{
DrawChars(" ", tpos, pos);
return;
}
if(pos <= tpos + DISPLAYSIZE)
pos = DrawChars(SEPARATOR, tpos, pos);
if(pos <= tpos + DISPLAYSIZE)
DrawChars(name, tpos, pos);
if(tpos >= len + strlen(SEPARATOR))
title_pos = 0;
title_pos = title_pos + 0.5;
}
void ExecuteXmms(void)
{
char *command;
int status;
command=malloc(strlen(xmms_cmd)+5);
sprintf(command, "%s &", xmms_cmd);
status = system(command);
if (status)
{
fprintf(stderr, "XMMS can't be launched, exiting...");
exit(1);
}
while (!xmms_remote_is_running(xmms_session))
usleep(10000L);
free(command);
}
/*----------------------------------------------------------------------------*/
/* Main */
/*----------------------------------------------------------------------------*/
int main(int argc, char **argv)
{
unsigned height, width;
DACallbacks callbacks={NULL, buttonPress, buttonRelease, buttonDrag,
NULL, NULL, NULL};
/* Initialization */
DAParseArguments(argc, argv, options,
sizeof(options)/sizeof(DAProgramOption),
"XMMS remote control by Bastien Nocera <hadess@hadess.net>",
VERSION);
setlocale(LC_ALL, "");
DAInitialize(displayName, "wmusic", 64, 64, argc, argv);
DASetCallbacks(&callbacks);
DASetTimeout(100);
DAMakePixmapFromData(wmusic_master_xpm, &pixmap,
&mask, &height, &width);
DAMakePixmapFromData(wmusic_digits_xpm, &pixnum,
&masknum, &height, &width);
gc = DefaultGC(DADisplay, DefaultScreen(DADisplay));
DASetShapeWithOffset(mask, 0, 0);
DASetPixmap(pixmap);
DAShow();
/* End of initialization */
if (options[4].used) t_scroll=1;
if (options[8].used) pause_norotate=1;
if (options[9].used) t_time=1;
if (options[10].used) t_volume=1;
if (options[11].used) run_excusive=1;
/* Launch xmms if it's not running and -r or -R was used */
xmms_running=xmms_remote_is_running(xmms_session);
if ((!xmms_running) && (options[2].used || run_excusive))
{
ExecuteXmms();
xmms_running=1;
}
if(xmms_remote_is_main_win(xmms_session) && (options[6].used))
ToggleWins(0, 0, DANoRect, NULL);
/* Update the display */
DisplayRoutine();
while (1) {
if (DANextEventOrTimeout(&ev, 100))
DAProcessEvent(&ev);
if (!motion_event)
DisplayRoutine();
else
motion_event=0;
}
return 0;
}

43
wmusic/wmusic.spec.in Normal file
View file

@ -0,0 +1,43 @@
%define name @PACKAGE@
%define version @VERSION@
%define release 1
%define prefix /usr
Summary: a remote-control DockApp for xmms
Name: %{name}
Version: %{version}
Release: %{release}
Copyright: GPL
Source: http://hadess.net/files/wmusic-%{version}.tar.gz
Group: Applications/Multimedia
BuildRoot: /var/tmp/%{name}-%{version}-root
Packager: Hadess <hadess@hadess.net>
Requires: xmms >= 1.0.0
%description
wmusic is a dockapp that remote-controls xmms. Here is a list of the features:
- VCR style controls including fast rewind and fast forward
- Time and Playlist position display
- Super stylee rotating arrow
- Hiding of the xmms windows (on startup and through middle-click)
- Multi-threaded
%prep
%setup -q -n %{name}-%{version}
%build
./configure --prefix=%{prefix}
%install
make PREFIX=$RPM_BUILD_ROOT/%{prefix} install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%attr(0755,root,root) /%{prefix}/bin/wmusic
%doc COPYING README
%changelog
* Mon Jan 31 2000 Hadess <hadess@writeme.com>
- First .spec file