added blccc
parent
7421ca5d6b
commit
be4e1dd876
|
@ -0,0 +1 @@
|
|||
Sven Neumann <sven@gimp.org>
|
|
@ -0,0 +1,340 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 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
|
||||
|
||||
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) <year> <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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 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) year 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.
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,182 @@
|
|||
Basic Installation
|
||||
==================
|
||||
|
||||
These are generic installation instructions.
|
||||
|
||||
The `configure' shell script attempts to guess correct values for
|
||||
various system-dependent variables used during compilation. It uses
|
||||
those values to create a `Makefile' in each directory of the package.
|
||||
It may also create one or more `.h' files containing system-dependent
|
||||
definitions. Finally, it creates a shell script `config.status' that
|
||||
you can run in the future to recreate the current configuration, a file
|
||||
`config.cache' that saves the results of its tests to speed up
|
||||
reconfiguring, and a file `config.log' containing compiler output
|
||||
(useful mainly for debugging `configure').
|
||||
|
||||
If you need to do unusual things to compile the package, please try
|
||||
to figure out how `configure' could check whether to do them, and mail
|
||||
diffs or instructions to the address given in the `README' so they can
|
||||
be considered for the next release. If at some point `config.cache'
|
||||
contains results you don't want to keep, you may remove or edit it.
|
||||
|
||||
The file `configure.in' is used to create `configure' by a program
|
||||
called `autoconf'. You only need `configure.in' if you want to change
|
||||
it or regenerate `configure' using a newer version of `autoconf'.
|
||||
|
||||
The simplest way to compile this package is:
|
||||
|
||||
1. `cd' to the directory containing the package's source code and type
|
||||
`./configure' to configure the package for your system. If you're
|
||||
using `csh' on an old version of System V, you might need to type
|
||||
`sh ./configure' instead to prevent `csh' from trying to execute
|
||||
`configure' itself.
|
||||
|
||||
Running `configure' takes awhile. While running, it prints some
|
||||
messages telling which features it is checking for.
|
||||
|
||||
2. Type `make' to compile the package.
|
||||
|
||||
3. Optionally, type `make check' to run any self-tests that come with
|
||||
the package.
|
||||
|
||||
4. Type `make install' to install the programs and any data files and
|
||||
documentation.
|
||||
|
||||
5. You can remove the program binaries and object files from the
|
||||
source code directory by typing `make clean'. To also remove the
|
||||
files that `configure' created (so you can compile the package for
|
||||
a different kind of computer), type `make distclean'. There is
|
||||
also a `make maintainer-clean' target, but that is intended mainly
|
||||
for the package's developers. If you use it, you may have to get
|
||||
all sorts of other programs in order to regenerate files that came
|
||||
with the distribution.
|
||||
|
||||
Compilers and Options
|
||||
=====================
|
||||
|
||||
Some systems require unusual options for compilation or linking that
|
||||
the `configure' script does not know about. You can give `configure'
|
||||
initial values for variables by setting them in the environment. Using
|
||||
a Bourne-compatible shell, you can do that on the command line like
|
||||
this:
|
||||
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
|
||||
|
||||
Or on systems that have the `env' program, you can do it like this:
|
||||
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
|
||||
|
||||
Compiling For Multiple Architectures
|
||||
====================================
|
||||
|
||||
You can compile the package for more than one kind of computer at the
|
||||
same time, by placing the object files for each architecture in their
|
||||
own directory. To do this, you must use a version of `make' that
|
||||
supports the `VPATH' variable, such as GNU `make'. `cd' to the
|
||||
directory where you want the object files and executables to go and run
|
||||
the `configure' script. `configure' automatically checks for the
|
||||
source code in the directory that `configure' is in and in `..'.
|
||||
|
||||
If you have to use a `make' that does not supports the `VPATH'
|
||||
variable, you have to compile the package for one architecture at a time
|
||||
in the source code directory. After you have installed the package for
|
||||
one architecture, use `make distclean' before reconfiguring for another
|
||||
architecture.
|
||||
|
||||
Installation Names
|
||||
==================
|
||||
|
||||
By default, `make install' will install the package's files in
|
||||
`/usr/local/bin', `/usr/local/man', etc. You can specify an
|
||||
installation prefix other than `/usr/local' by giving `configure' the
|
||||
option `--prefix=PATH'.
|
||||
|
||||
You can specify separate installation prefixes for
|
||||
architecture-specific files and architecture-independent files. If you
|
||||
give `configure' the option `--exec-prefix=PATH', the package will use
|
||||
PATH as the prefix for installing programs and libraries.
|
||||
Documentation and other data files will still use the regular prefix.
|
||||
|
||||
In addition, if you use an unusual directory layout you can give
|
||||
options like `--bindir=PATH' to specify different values for particular
|
||||
kinds of files. Run `configure --help' for a list of the directories
|
||||
you can set and what kinds of files go in them.
|
||||
|
||||
If the package supports it, you can cause programs to be installed
|
||||
with an extra prefix or suffix on their names by giving `configure' the
|
||||
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
|
||||
|
||||
Optional Features
|
||||
=================
|
||||
|
||||
Some packages pay attention to `--enable-FEATURE' options to
|
||||
`configure', where FEATURE indicates an optional part of the package.
|
||||
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
|
||||
is something like `gnu-as' or `x' (for the X Window System). The
|
||||
`README' should mention any `--enable-' and `--with-' options that the
|
||||
package recognizes.
|
||||
|
||||
For packages that use the X Window System, `configure' can usually
|
||||
find the X include and library files automatically, but if it doesn't,
|
||||
you can use the `configure' options `--x-includes=DIR' and
|
||||
`--x-libraries=DIR' to specify their locations.
|
||||
|
||||
Specifying the System Type
|
||||
==========================
|
||||
|
||||
There may be some features `configure' can not figure out
|
||||
automatically, but needs to determine by the type of host the package
|
||||
will run on. Usually `configure' can figure that out, but if it prints
|
||||
a message saying it can not guess the host type, give it the
|
||||
`--host=TYPE' option. TYPE can either be a short name for the system
|
||||
type, such as `sun4', or a canonical name with three fields:
|
||||
CPU-COMPANY-SYSTEM
|
||||
|
||||
See the file `config.sub' for the possible values of each field. If
|
||||
`config.sub' isn't included in this package, then this package doesn't
|
||||
need to know the host type.
|
||||
|
||||
If you are building compiler tools for cross-compiling, you can also
|
||||
use the `--target=TYPE' option to select the type of system they will
|
||||
produce code for and the `--build=TYPE' option to select the type of
|
||||
system on which you are compiling the package.
|
||||
|
||||
Sharing Defaults
|
||||
================
|
||||
|
||||
If you want to set default values for `configure' scripts to share,
|
||||
you can create a site shell script called `config.site' that gives
|
||||
default values for variables like `CC', `cache_file', and `prefix'.
|
||||
`configure' looks for `PREFIX/share/config.site' if it exists, then
|
||||
`PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
`CONFIG_SITE' environment variable to the location of the site script.
|
||||
A warning: not all `configure' scripts look for a site script.
|
||||
|
||||
Operation Controls
|
||||
==================
|
||||
|
||||
`configure' recognizes the following options to control how it
|
||||
operates.
|
||||
|
||||
`--cache-file=FILE'
|
||||
Use and save the results of the tests in FILE instead of
|
||||
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
|
||||
debugging `configure'.
|
||||
|
||||
`--help'
|
||||
Print a summary of the options to `configure', and exit.
|
||||
|
||||
`--quiet'
|
||||
`--silent'
|
||||
`-q'
|
||||
Do not print messages saying which checks are being made. To
|
||||
suppress all normal output, redirect it to `/dev/null' (any error
|
||||
messages will still be shown).
|
||||
|
||||
`--srcdir=DIR'
|
||||
Look for the package's source code in directory DIR. Usually
|
||||
`configure' can determine that directory automatically.
|
||||
|
||||
`--version'
|
||||
Print the version of Autoconf used to generate the `configure'
|
||||
script, and exit.
|
||||
|
||||
`configure' also accepts some other, not widely useful, options.
|
|
@ -0,0 +1,5 @@
|
|||
## Makefile.am for blccc
|
||||
|
||||
SUBDIRS = data examples src stylesheets
|
||||
|
||||
EXTRA_DIST = autogen.sh
|
|
@ -0,0 +1,372 @@
|
|||
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = .
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
DATADIR = @DATADIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACAKGE = @PACAKGE@
|
||||
PACKAGE = @PACKAGE@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SUBDIRS = data examples src stylesheets
|
||||
|
||||
EXTRA_DIST = autogen.sh
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = README ./stamp-h.in AUTHORS COPYING ChangeLog INSTALL \
|
||||
Makefile.am Makefile.in NEWS aclocal.m4 config.guess config.h.in \
|
||||
config.sub configure configure.in install-sh ltmain.sh missing \
|
||||
mkinstalldirs
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in
|
||||
cd $(srcdir) && $(ACLOCAL)
|
||||
|
||||
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
|
||||
cd $(srcdir) && $(AUTOCONF)
|
||||
|
||||
config.h: stamp-h
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h; \
|
||||
$(MAKE) stamp-h; \
|
||||
else :; fi
|
||||
stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES= CONFIG_HEADERS=config.h \
|
||||
$(SHELL) ./config.status
|
||||
@echo timestamp > stamp-h 2> /dev/null
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
|
||||
@if test ! -f $@; then \
|
||||
rm -f $(srcdir)/stamp-h.in; \
|
||||
$(MAKE) $(srcdir)/stamp-h.in; \
|
||||
else :; fi
|
||||
$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOHEADER)
|
||||
@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
|
||||
|
||||
mostlyclean-hdr:
|
||||
|
||||
clean-hdr:
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h
|
||||
|
||||
maintainer-clean-hdr:
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
rev="$$subdir $$rev"; \
|
||||
test "$$subdir" != "." || dot_seen=yes; \
|
||||
done; \
|
||||
test "$$dot_seen" = "no" && rev=". $$rev"; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP))
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(PACKAGE)-$(VERSION)
|
||||
top_distdir = $(distdir)
|
||||
|
||||
# This target untars the dist file and tries a VPATH configuration. Then
|
||||
# it guarantees that the distribution is self-contained by making another
|
||||
# tarfile.
|
||||
distcheck: dist
|
||||
-rm -rf $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
|
||||
mkdir $(distdir)/=build
|
||||
mkdir $(distdir)/=inst
|
||||
dc_install_base=`cd $(distdir)/=inst && pwd`; \
|
||||
cd $(distdir)/=build \
|
||||
&& ../configure --srcdir=.. --prefix=$$dc_install_base \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) check \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) install \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
|
||||
&& $(MAKE) $(AM_MAKEFLAGS) dist
|
||||
-rm -rf $(distdir)
|
||||
@banner="$(distdir).tar.gz is ready for distribution"; \
|
||||
dashes=`echo "$$banner" | sed s/./=/g`; \
|
||||
echo "$$dashes"; \
|
||||
echo "$$banner"; \
|
||||
echo "$$dashes"
|
||||
dist: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
dist-all: distdir
|
||||
-chmod -R a+r $(distdir)
|
||||
GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
|
||||
-rm -rf $(distdir)
|
||||
distdir: $(DISTFILES)
|
||||
-rm -rf $(distdir)
|
||||
mkdir $(distdir)
|
||||
-chmod 777 $(distdir)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-recursive
|
||||
dvi-am:
|
||||
dvi: dvi-recursive
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
installcheck-am:
|
||||
installcheck: installcheck-recursive
|
||||
all-recursive-am: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
install-exec-am:
|
||||
install-exec: install-exec-recursive
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-recursive
|
||||
uninstall-am:
|
||||
uninstall: uninstall-recursive
|
||||
all-am: Makefile config.h
|
||||
all-redirect: all-recursive-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
clean-am: clean-hdr clean-tags clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-recursive
|
||||
|
||||
distclean-am: distclean-hdr distclean-tags distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-recursive
|
||||
-rm -f config.status
|
||||
|
||||
maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \
|
||||
maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
-rm -f config.status
|
||||
|
||||
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
|
||||
install-data-recursive uninstall-data-recursive install-exec-recursive \
|
||||
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
|
||||
all-recursive check-recursive installcheck-recursive info-recursive \
|
||||
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
|
||||
dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
|
||||
install-exec-am install-exec install-data-am install-data install-am \
|
||||
install uninstall-am uninstall all-redirect all-am all installdirs-am \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,74 @@
|
|||
Blinkenlights Chaos Control Center
|
||||
----------------------------------
|
||||
|
||||
If you have no clue what Blinkenlights is, take a look at
|
||||
http://www.blinkenlights.de/ first.
|
||||
|
||||
This is a rewrite of the master control program for Blinkenlights. Our
|
||||
first implementation used to be a GTK+ application that allowed
|
||||
previewing of movies and run-time modification of the playlist using a
|
||||
graphical user interface. It turned out that we need a way to control
|
||||
the Blinkenlights remotely, so this new implementation runs as a
|
||||
daemon controllable via telnet connections. We started to use this
|
||||
software for the Blinkenlights installation at the end of September
|
||||
2001.
|
||||
|
||||
Some parts of the code could definitely be redone better but keep in
|
||||
mind that this software evolved over time since we kept on adding new
|
||||
features while the Blinkenlights installation was already running
|
||||
every night from dusk till dawn. Actually we kept the software running
|
||||
all the time and just switched off power from the relais during the
|
||||
days. So this software has prooven to work reliable over a couple of
|
||||
months.
|
||||
|
||||
|
||||
How to compile:
|
||||
|
||||
You need glib-2.0 available from ftp://ftp.gtk.org/pub/gtk/v2.0/.
|
||||
Once you have glib-2.0 installed, the usual
|
||||
|
||||
./configure; make; make install
|
||||
|
||||
should do the trick.
|
||||
|
||||
|
||||
How to use:
|
||||
|
||||
Create a directory with blinkenlights movies. You can download some
|
||||
from http://www.blinkenlights.de/gallery/. Next, create a playlist of
|
||||
your favorite movies and call it playlist.default. The playlist format
|
||||
is simple: just add a line with a relative pathname for each movie you
|
||||
want to play. The examples directory contains some movies and a
|
||||
playlist to get you started.
|
||||
|
||||
Start blccc in the examples directory:
|
||||
|
||||
blccc localhost
|
||||
|
||||
blccc looks for the file playlist.default in the current directory and
|
||||
starts to play the playlist. It now sends UDP packets to localhost (or
|
||||
whatever host you specified on the command-line). You can connect to
|
||||
blccc using telnet. It listens on port 2323 on the local interface.
|
||||
Type 'telnet localhost 2323' and it should welcome you. Try the 'help'
|
||||
command to get an idea of what is possible. You can use netcat (nc) to
|
||||
send commands to blccc so that you can control the installation from
|
||||
scripts or cronjobs.
|
||||
|
||||
Now it's time to start blinkensim to visualize the stream of UDP
|
||||
packets:
|
||||
|
||||
blinkensim
|
||||
|
||||
|
||||
blccc also listens for UDP packets on port 4242. This packets are
|
||||
generated by the blinkenisdn daemon (not part of this package) and
|
||||
describe the state of the isdn lines. If one of the telephone lines
|
||||
goes off-hook, the pong game is started. The game is controlled thru
|
||||
dial tones. The special sequence *<digits># starts the movie
|
||||
<digits>.blm from the on-demand directory. This is how the Loveletters
|
||||
feature was implemented. As soon as all telephone lines are on-hook
|
||||
again, blccc continues to play movies from the playlist.
|
||||
|
||||
|
||||
Have Blinkenfun,
|
||||
Sven <sven@gimp.org>
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,147 @@
|
|||
#!/bin/sh
|
||||
|
||||
# This script does all the magic calls to automake/autoconf and
|
||||
# friends that are needed to configure a cvs checkout. You need a
|
||||
# couple of extra development tools to run this script successfully.
|
||||
#
|
||||
# If you are compiling from a released tarball you don't need these
|
||||
# tools and you shouldn't use this script. Just call ./configure
|
||||
# directly.
|
||||
|
||||
|
||||
PROJECT="The Blinkenlights Chaos Control Center"
|
||||
TEST_TYPE=-f
|
||||
FILE=src/blccc.c
|
||||
|
||||
LIBTOOL_REQUIRED_VERSION=1.3.4
|
||||
AUTOCONF_REQUIRED_VERSION=2.13
|
||||
AUTOMAKE_REQUIRED_VERSION=1.4
|
||||
|
||||
|
||||
srcdir=`dirname $0`
|
||||
test -z "$srcdir" && srcdir=.
|
||||
ORIGDIR=`pwd`
|
||||
cd $srcdir
|
||||
|
||||
|
||||
function check_version ()
|
||||
{
|
||||
if expr $1 \>= $2 > /dev/null; then
|
||||
echo "yes (version $1)"
|
||||
else
|
||||
echo "Too old (found version $1)!"
|
||||
DIE=1
|
||||
fi
|
||||
}
|
||||
|
||||
echo
|
||||
echo "I am testing that you have the required versions of libtool, autoconf,"
|
||||
echo "and automake."
|
||||
echo
|
||||
|
||||
DIE=0
|
||||
|
||||
echo -n "checking for libtool >= $LIBTOOL_REQUIRED_VERSION ... "
|
||||
if (libtoolize --version) < /dev/null > /dev/null 2>&1; then
|
||||
VER=`libtoolize --version \
|
||||
| grep libtool | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
|
||||
check_version $VER $LIBTOOL_REQUIRED_VERSION
|
||||
else
|
||||
echo
|
||||
echo " You must have libtool installed to compile $PROJECT."
|
||||
echo " Install the appropriate package for your distribution,"
|
||||
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1;
|
||||
fi
|
||||
|
||||
echo -n "checking for autoconf >= $AUTOCONF_REQUIRED_VERSION ... "
|
||||
if (autoconf --version) < /dev/null > /dev/null 2>&1; then
|
||||
VER=`autoconf --version \
|
||||
| grep -iw autoconf | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
|
||||
check_version $VER $AUTOCONF_REQUIRED_VERSION
|
||||
else
|
||||
echo
|
||||
echo " You must have autoconf installed to compile $PROJECT."
|
||||
echo " Download the appropriate package for your distribution,"
|
||||
echo " or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
|
||||
DIE=1;
|
||||
fi
|
||||
|
||||
echo -n "checking for automake >= $AUTOMAKE_REQUIRED_VERSION ... "
|
||||
if (automake --version) < /dev/null > /dev/null 2>&1; then
|
||||
VER=`automake --version \
|
||||
| grep automake | sed "s/.* \([0-9.]*\)[-a-z0-9]*$/\1/"`
|
||||
check_version $VER $AUTOMAKE_REQUIRED_VERSION
|
||||
else
|
||||
echo
|
||||
echo " You must have automake installed to compile $PROJECT."
|
||||
echo " Get ftp://ftp.cygnus.com/pub/home/tromey/automake-1.4p1.tar.gz"
|
||||
echo " (or a newer version if it is available)"
|
||||
DIE=1
|
||||
fi
|
||||
|
||||
if test "$DIE" -eq 1; then
|
||||
echo
|
||||
echo "Please install/upgrade the missing tools and call me again."
|
||||
echo
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
test $TEST_TYPE $FILE || {
|
||||
echo
|
||||
echo "You must run this script in the top-level $PROJECT directory."
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
if test -z "$*"; then
|
||||
echo
|
||||
echo "I am going to run ./configure with no arguments - if you wish "
|
||||
echo "to pass any to it, please specify them on the $0 command line."
|
||||
echo
|
||||
fi
|
||||
|
||||
|
||||
case $CC in
|
||||
*xlc | *xlc\ * | *lcc | *lcc\ *)
|
||||
am_opt=--include-deps
|
||||
;;
|
||||
esac
|
||||
|
||||
if test -z "$ACLOCAL_FLAGS"; then
|
||||
|
||||
acdir=`aclocal --print-ac-dir`
|
||||
m4list="glib-2.0.m4"
|
||||
|
||||
for file in $m4list
|
||||
do
|
||||
if [ ! -f "$acdir/$file" ]; then
|
||||
echo
|
||||
echo "WARNING: aclocal's directory is $acdir, but..."
|
||||
echo " no file $acdir/$file"
|
||||
echo " You may see fatal macro warnings below."
|
||||
echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS "
|
||||
echo " environment variable to \"-I /some/dir\", or install" echo " $acdir/$file."
|
||||
echo
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
aclocal $ACLOCAL_FLAGS
|
||||
|
||||
# optionally feature autoheader
|
||||
(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
|
||||
|
||||
automake --add-missing $am_opt
|
||||
autoconf
|
||||
|
||||
libtoolize --copy --force
|
||||
|
||||
cd $ORIGDIR
|
||||
|
||||
$srcdir/configure --enable-maintainer-mode "$@"
|
||||
|
||||
echo
|
||||
echo "Now type 'make' to compile $PROJECT."
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,55 @@
|
|||
/* config.h.in. Generated from configure.in by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,53 @@
|
|||
AC_INIT(src/blccc.c)
|
||||
|
||||
PACKAGE=blccc
|
||||
VERSION=1.99
|
||||
|
||||
AM_INIT_AUTOMAKE($PACKAGE,$VERSION)
|
||||
|
||||
AM_MAINTAINER_MODE
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
|
||||
|
||||
AC_CANONICAL_HOST
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_LIBTOOL
|
||||
AM_PROG_CC_STDC
|
||||
|
||||
changequote(,)dnl
|
||||
if test "x$GCC" = "xyes"; then
|
||||
case " $CFLAGS " in
|
||||
*[\ \ ]-Wall[\ \ ]*) ;;
|
||||
*) CFLAGS="$CFLAGS -Wall" ;;
|
||||
esac
|
||||
fi
|
||||
changequote([,])dnl
|
||||
|
||||
AC_ARG_ENABLE(debug, [ --enable-debug turn on debugging [default=no]],
|
||||
if eval "test x$enable_debug = xyes"; then
|
||||
DEBUGFLAG="-g"
|
||||
fi)
|
||||
|
||||
AM_PATH_GLIB_2_0(2.0.0, , , gobject gthread)
|
||||
|
||||
PKG_CHECK_MODULES(BLIB, blib >= 1.0.0)
|
||||
|
||||
DATADIR=$datadir/blccc
|
||||
AC_SUBST(DATADIR)
|
||||
|
||||
AC_SUBST(PACAKGE)
|
||||
AC_SUBST(VERSION)
|
||||
|
||||
AC_OUTPUT([
|
||||
Makefile
|
||||
data/Makefile
|
||||
examples/Makefile
|
||||
examples/on-demand/Makefile
|
||||
examples/movies/Makefile
|
||||
src/Makefile
|
||||
src/modules/Makefile
|
||||
stylesheets/Makefile
|
||||
stylesheets/examples/Makefile
|
||||
])
|
|
@ -0,0 +1,8 @@
|
|||
## Makefile.am for blccc/data
|
||||
## Process this file with automake to produce Makefile.in
|
||||
|
||||
blcccdatadir = $(DATADIR)
|
||||
|
||||
blcccdata_DATA = playlist.dtd
|
||||
|
||||
EXTRA_DIST = $(blcccdata_DATA)
|
|
@ -0,0 +1,215 @@
|
|||
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
DATADIR = @DATADIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACAKGE = @PACAKGE@
|
||||
PACKAGE = @PACKAGE@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
blcccdatadir = $(DATADIR)
|
||||
|
||||
blcccdata_DATA = playlist.dtd
|
||||
|
||||
EXTRA_DIST = $(blcccdata_DATA)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DATA = $(blcccdata_DATA)
|
||||
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps data/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
install-blcccdataDATA: $(blcccdata_DATA)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(blcccdatadir)
|
||||
@list='$(blcccdata_DATA)'; for p in $$list; do \
|
||||
if test -f $(srcdir)/$$p; then \
|
||||
echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(blcccdatadir)/$$p"; \
|
||||
$(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(blcccdatadir)/$$p; \
|
||||
else if test -f $$p; then \
|
||||
echo " $(INSTALL_DATA) $$p $(DESTDIR)$(blcccdatadir)/$$p"; \
|
||||
$(INSTALL_DATA) $$p $(DESTDIR)$(blcccdatadir)/$$p; \
|
||||
fi; fi; \
|
||||
done
|
||||
|
||||
uninstall-blcccdataDATA:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(blcccdata_DATA)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(blcccdatadir)/$$p; \
|
||||
done
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = data
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am: install-blcccdataDATA
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-blcccdataDATA
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(DATA)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(blcccdatadir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: uninstall-blcccdataDATA install-blcccdataDATA tags distdir \
|
||||
info-am info dvi-am dvi check check-am installcheck-am installcheck \
|
||||
install-exec-am install-exec install-data-am install-data install-am \
|
||||
install uninstall-am uninstall all-redirect all-am all installdirs \
|
||||
mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,14 @@
|
|||
<!-- DTD for blccc playlists -->
|
||||
|
||||
<!ELEMENT playlist (item+)>
|
||||
|
||||
<!ELEMENT item (param*)>
|
||||
<!ATTLIST item
|
||||
type CDATA "BMoviePlayer">
|
||||
|
||||
<!ELEMENT param EMPTY>
|
||||
<!ATTLIST param
|
||||
key CDATA #REQUIRED
|
||||
value CDATA #REQUIRED>
|
||||
|
||||
<!-- end of the DTD -->
|
|
@ -0,0 +1,8 @@
|
|||
## Makefile.am for blccc/examples
|
||||
|
||||
SUBDIRS = on-demand movies
|
||||
|
||||
EXTRA_DIST = \
|
||||
playlist.default.xml \
|
||||
config.xml \
|
||||
loveletters.xml
|
|
@ -0,0 +1,296 @@
|
|||
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
DATADIR = @DATADIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACAKGE = @PACAKGE@
|
||||
PACKAGE = @PACKAGE@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SUBDIRS = on-demand movies
|
||||
|
||||
EXTRA_DIST = playlist.default.xml config.xml loveletters.xml
|
||||
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps examples/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
rev="$$subdir $$rev"; \
|
||||
test "$$subdir" != "." || dot_seen=yes; \
|
||||
done; \
|
||||
test "$$dot_seen" = "no" && rev=". $$rev"; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = examples
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-recursive
|
||||
dvi-am:
|
||||
dvi: dvi-recursive
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
installcheck-am:
|
||||
installcheck: installcheck-recursive
|
||||
install-exec-am:
|
||||
install-exec: install-exec-recursive
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-recursive
|
||||
uninstall-am:
|
||||
uninstall: uninstall-recursive
|
||||
all-am: Makefile
|
||||
all-redirect: all-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
clean-am: clean-tags clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-recursive
|
||||
|
||||
distclean-am: distclean-tags distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-recursive
|
||||
|
||||
maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
|
||||
.PHONY: install-data-recursive uninstall-data-recursive \
|
||||
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
|
||||
uninstalldirs-recursive all-recursive check-recursive \
|
||||
installcheck-recursive info-recursive dvi-recursive \
|
||||
mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
|
||||
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
|
||||
install-exec install-data-am install-data install-am install \
|
||||
uninstall-am uninstall all-redirect all-am all installdirs-am \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!-- Example blccc config (BNF, Paris, France) -->
|
||||
|
||||
<blccc>
|
||||
<config>
|
||||
|
||||
<param key="width" value="26"/>
|
||||
<param key="height" value="20"/>
|
||||
<param key="aspect" value="0.5"/>
|
||||
<param key="playlist" value="playlist.default.xml"/>
|
||||
<param key="logfile" value="/var/tmp/blccc.log"/>
|
||||
<param key="recipient" value="localhost"/>
|
||||
<param key="isdn-host" value="10.0.1.98"/>
|
||||
<param key="isdn-port" value="1234"/>
|
||||
<param key="isdn-listen" value="1234"/>
|
||||
|
||||
<application name="Pong" type="BPong"
|
||||
number="9876564" public="yes" wamp="telekoma.alaw">
|
||||
<param key="lifetime" value="120000"/>
|
||||
</application>
|
||||
|
||||
<application name="Loveletters" type="BlOnDemand"
|
||||
number="9876569" public="yes" wamp="telekoma.alaw">
|
||||
<param key="loveletters" value="loveletters.xml"/>
|
||||
<param key="lifetime" value="24000"/>
|
||||
</application>
|
||||
|
||||
</config>
|
||||
</blccc>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!-- Example loveletters file -->
|
||||
|
||||
<loveletters>
|
||||
<movie id="2662" vanity="ANNA" href="movies/anna.blm"/>
|
||||
|
||||
<!-- the next vanity code is intentionally wrong to force a warning -->
|
||||
<movie id="2663" vanity="ANNB" href="movies/annb.blm"/>
|
||||
</loveletters>
|
|
@ -0,0 +1,7 @@
|
|||
## Makefile.am for blccc/examples/movies
|
||||
|
||||
EXTRA_DIST = \
|
||||
camel.blm \
|
||||
the_fly.blm \
|
||||
bushfire_60frames.gif \
|
||||
bushfire-test.gif
|
|
@ -0,0 +1,190 @@
|
|||
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ../..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
DATADIR = @DATADIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACAKGE = @PACAKGE@
|
||||
PACKAGE = @PACKAGE@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
EXTRA_DIST = camel.blm the_fly.blm bushfire_60frames.gif bushfire-test.gif
|
||||
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps examples/movies/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = examples/movies
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am:
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: tags distdir info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.5 KiB |
|
@ -0,0 +1,419 @@
|
|||
# BlinkenLights Movie 18x8
|
||||
# name = camel
|
||||
# description = aa
|
||||
# creator = Blinkenpaint 2.4
|
||||
# author = christine jaschek <blixum@web.de>
|
||||
# width = 18
|
||||
# height = 8
|
||||
# loop = no
|
||||
# duration = 8400
|
||||
|
||||
@200
|
||||
000100000000000000
|
||||
011110000000000000
|
||||
111011001100110000
|
||||
000001110011001000
|
||||
000001000000000100
|
||||
000000111111111010
|
||||
000000010000001000
|
||||
000000110000011000
|
||||
|
||||
@200
|
||||
000100000000000000
|
||||
011110000000000000
|
||||
111011001100110000
|
||||
000001110011001000
|
||||
000001000000000111
|
||||
000000111111111000
|
||||
000000010000001000
|
||||
000000110000011000
|
||||
|
||||
@200
|
||||
000100000000000000
|
||||
011110000000000000
|
||||
111011001100110000
|
||||
000001110011001000
|
||||
000001000000000100
|
||||
000000111111111010
|
||||
000000010000001000
|
||||
000000110000011000
|
||||
|
||||
@200
|
||||
000100000000000000
|
||||
011110000000000000
|
||||
111011001100110000
|
||||
000001110011001000
|
||||
000001000000000111
|
||||
000000111111111000
|
||||
000000010000001000
|
||||
000000110000011000
|
||||
|
||||
@200
|
||||
000100000000000000
|
||||
011110000000000000
|
||||
111011001100110000
|
||||
000001110011001000
|
||||
000001000000000100
|
||||
000000111111111010
|
||||
000000010000001000
|
||||
000000110000011000
|
||||
|
||||
@200
|
||||
000100000000000000
|
||||
011110000000000000
|
||||
111011001100110000
|
||||
000001110011001000
|
||||
000001000000000111
|
||||
000000111111111000
|
||||
000000010000001000
|
||||
000000110000011000
|
||||
|
||||
@200
|
||||
000100000000000000
|
||||
011110000000000000
|
||||
111011001100110000
|
||||
000001110011001000
|
||||
000001000000000100
|
||||
000000111111111010
|
||||
000000010000001000
|
||||
000000110000011000
|
||||
|
||||
@200
|
||||
000100000000000000
|
||||
011110000000000000
|
||||
111011001100110000
|
||||
000001110011001000
|
||||
000001000000000111
|
||||
000000111111111000
|
||||
000000010000001000
|
||||
000000110000011000
|
||||
|
||||
@200
|
||||
000100000000000000
|
||||
011110000000000000
|
||||
111011001100110000
|
||||
000001110011001000
|
||||
000001000000000100
|
||||
000000111111111010
|
||||
000000010000001000
|
||||
000000110000011000
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110000
|
||||
000000100000010000
|
||||
000001100000110000
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110100
|
||||
000000100000010000
|
||||
000001100000110000
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110000
|
||||
000000100000010010
|
||||
000001100000110000
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110100
|
||||
000000100000010000
|
||||
000001100000110001
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110000
|
||||
000000100000010010
|
||||
000001100000110001
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110000
|
||||
000000100000010000
|
||||
000001100000110011
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110100
|
||||
000000100000010000
|
||||
000001100000110011
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110000
|
||||
000000100000010010
|
||||
000001100000110011
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110100
|
||||
000000100000010010
|
||||
000001100000110011
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110000
|
||||
000000100000010110
|
||||
000001100000110011
|
||||
|
||||
@200
|
||||
001000000000000000
|
||||
111100000000000000
|
||||
110110011001100000
|
||||
000011100110010000
|
||||
000010000000001110
|
||||
000001111111110000
|
||||
000000100000010010
|
||||
000001100000110111
|
||||
|
||||
@200
|
||||
010000000000000000
|
||||
111000000000000000
|
||||
101100110011000000
|
||||
000111001100100000
|
||||
000100000000011100
|
||||
000011111111100000
|
||||
000000100001000010
|
||||
000001100011000111
|
||||
|
||||
@200
|
||||
100000000000000000
|
||||
110000000000000000
|
||||
011001100110000000
|
||||
001110011001000000
|
||||
001000000000111000
|
||||
000111111111000000
|
||||
000010000001000010
|
||||
000110000011000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
100000000000000000
|
||||
110011001100000000
|
||||
011100110010000000
|
||||
010000000001110000
|
||||
001111111110000000
|
||||
000010000100000010
|
||||
000110001100000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
100110011000000000
|
||||
111001100100000000
|
||||
100000000010000000
|
||||
011111111101000000
|
||||
001000000100000010
|
||||
011000001100000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
001100110000000000
|
||||
110011001000000000
|
||||
000000000100000000
|
||||
111111111010000000
|
||||
001000010000000010
|
||||
011000110000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
011001100000000000
|
||||
100110010000000000
|
||||
000000001000000000
|
||||
111111110100000000
|
||||
100000010000000010
|
||||
100000110000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
110011000000000000
|
||||
001100100000000000
|
||||
000000010000000000
|
||||
111111101000000000
|
||||
000001000000000010
|
||||
000011000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
100110000000000000
|
||||
011001000000000000
|
||||
000000100000000000
|
||||
111111010000000000
|
||||
000001000000000010
|
||||
000011000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
001100000000000000
|
||||
110010000000000000
|
||||
000001000000000000
|
||||
111110100000000000
|
||||
000100000000000010
|
||||
001100000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
011000000000000000
|
||||
100100000000000000
|
||||
000010000000000000
|
||||
111101000000000000
|
||||
000100000000000010
|
||||
001100000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
110000000000000000
|
||||
001000000000000000
|
||||
000100000000000000
|
||||
111010000000000000
|
||||
010000000000000010
|
||||
110000000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
100000000000000000
|
||||
010000000000000000
|
||||
001000000000000000
|
||||
110100000000000000
|
||||
010000000000000010
|
||||
110000000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
100000000000000000
|
||||
010000000000000000
|
||||
101000000000000000
|
||||
100000000000000010
|
||||
100000000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
100000000000000000
|
||||
010000000000000000
|
||||
000000000000000010
|
||||
000000000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
100000000000000000
|
||||
000000000000000010
|
||||
000000000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000010
|
||||
000000000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000010
|
||||
000000000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000010
|
||||
000000000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000010
|
||||
000000000000000111
|
||||
|
||||
@200
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000010
|
||||
000000000000000111
|
||||
|
||||
@400
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
||||
000000000000000000
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1 @@
|
|||
# BlinkenLights Movie 18x8
# name = wilber1
# description = gimp Wilber Standbild
# creator = Blinkenpaint 2.4
# author = the gimp crew
# width = 18
# height = 8
# loop = no
# duration = 200
@200
000000010000000011
000000001000011101
011100110110000001
110001111111000001
100001011001000010
011100000000010100
000010000011101000
000001111111110000
|
|
@ -0,0 +1,3 @@
|
|||
## Makefile.am for blccc/examples/on-demand
|
||||
|
||||
EXTRA_DIST = 4467.blm
|
|
@ -0,0 +1,189 @@
|
|||
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ../..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
DATADIR = @DATADIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACAKGE = @PACAKGE@
|
||||
PACKAGE = @PACKAGE@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
EXTRA_DIST = 4467.blm
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps examples/on-demand/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = examples/on-demand
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am:
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: tags distdir info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,42 @@
|
|||
<?xml version="1.0"?>
|
||||
<playlist>
|
||||
<playlist reverse="yes" invert="yes">
|
||||
<item reverse="yes" speed="0.02">
|
||||
<param key="movie" value="movies/camel.blm"/>
|
||||
<param key="reverse" value="yes"/>
|
||||
<param key="speed" value="100"/>
|
||||
</item>
|
||||
<item>
|
||||
<param key="movie" value="movies/camel.blm"/>
|
||||
<param key="reverse" value="yes"/>
|
||||
</item>
|
||||
</playlist>
|
||||
<item type="BPong"/>
|
||||
<item type="BPacman"/>
|
||||
<item type="BQix">
|
||||
<param key="lines" value="8"/>
|
||||
<param key="speed" value="1.2"/>
|
||||
<param key="lifetime" value="10000"/>
|
||||
</item>
|
||||
<item type="BFire">
|
||||
<param key="speed" value="0.6"/>
|
||||
<param key="lifetime" value="10000"/>
|
||||
</item>
|
||||
<item>
|
||||
<param key="movie" value="movies/hdl-mask.bml"/>
|
||||
</item>
|
||||
<item>
|
||||
<param key="movie" value="movies/the_fly.blm"/>
|
||||
<param key="h-align" value="0.3"/>
|
||||
<param key="v-align" value="0.7"/>
|
||||
<param key="clear" value="no"/>
|
||||
</item>
|
||||
<item>
|
||||
<param key="movie" value="movies/white.bml"/>
|
||||
</item>
|
||||
<item type="BFire">
|
||||
<param key="flames" value="no"/>
|
||||
</item>
|
||||
<item type="BTetris"/>
|
||||
</playlist>
|
||||
|
|
@ -0,0 +1,251 @@
|
|||
#!/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=:
|
||||
chmodcmd=""
|
||||
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
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,198 @@
|
|||
#! /bin/sh
|
||||
# Common stub for a few missing GNU programs while installing.
|
||||
# Copyright (C) 1996, 1997, 2001, 2002 Free Software Foundation, Inc.
|
||||
# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
|
||||
|
||||
# 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, 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.
|
||||
|
||||
if test $# -eq 0; then
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# In the cases where this matters, `missing' is being run in the
|
||||
# srcdir already.
|
||||
if test -f configure.in; then
|
||||
configure_ac=configure.ac
|
||||
else
|
||||
configure_ac=configure.in
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
|
||||
-h|--h|--he|--hel|--help)
|
||||
echo "\
|
||||
$0 [OPTION]... PROGRAM [ARGUMENT]...
|
||||
|
||||
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
|
||||
error status if there is no known handling for PROGRAM.
|
||||
|
||||
Options:
|
||||
-h, --help display this help and exit
|
||||
-v, --version output version information and exit
|
||||
|
||||
Supported PROGRAM values:
|
||||
aclocal touch file \`aclocal.m4'
|
||||
autoconf touch file \`configure'
|
||||
autoheader touch file \`config.h.in'
|
||||
automake touch all \`Makefile.in' files
|
||||
bison create \`y.tab.[ch]', if possible, from existing .[ch]
|
||||
flex create \`lex.yy.c', if possible, from existing .c
|
||||
lex create \`lex.yy.c', if possible, from existing .c
|
||||
makeinfo touch the output file
|
||||
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
|
||||
;;
|
||||
|
||||
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
|
||||
echo "missing - GNU libit 0.0"
|
||||
;;
|
||||
|
||||
-*)
|
||||
echo 1>&2 "$0: Unknown \`$1' option"
|
||||
echo 1>&2 "Try \`$0 --help' for more information"
|
||||
exit 1
|
||||
;;
|
||||
|
||||
aclocal*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acinclude.m4' or \`$configure_ac'. You might want
|
||||
to install the \`Automake' and \`Perl' packages. Grab them from
|
||||
any GNU archive site."
|
||||
touch aclocal.m4
|
||||
;;
|
||||
|
||||
autoconf)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`$configure_ac'. You might want to install the
|
||||
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
|
||||
archive site."
|
||||
touch configure
|
||||
;;
|
||||
|
||||
autoheader)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`acconfig.h' or \`$configure_ac'. You might want
|
||||
to install the \`Autoconf' and \`GNU m4' packages. Grab them
|
||||
from any GNU archive site."
|
||||
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' $configure_ac`
|
||||
test -z "$files" && files="config.h"
|
||||
touch_files=
|
||||
for f in $files; do
|
||||
case "$f" in
|
||||
*:*) touch_files="$touch_files "`echo "$f" |
|
||||
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
|
||||
*) touch_files="$touch_files $f.in";;
|
||||
esac
|
||||
done
|
||||
touch $touch_files
|
||||
;;
|
||||
|
||||
automake*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified \`Makefile.am', \`acinclude.m4' or \`$configure_ac'.
|
||||
You might want to install the \`Automake' and \`Perl' packages.
|
||||
Grab them from any GNU archive site."
|
||||
find . -type f -name Makefile.am -print |
|
||||
sed 's/\.am$/.in/' |
|
||||
while read f; do touch "$f"; done
|
||||
;;
|
||||
|
||||
bison|yacc)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.y' file. You may need the \`Bison' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Bison' from any GNU archive site."
|
||||
rm -f y.tab.c y.tab.h
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.y)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.c
|
||||
fi
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" y.tab.h
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f y.tab.h ]; then
|
||||
echo >y.tab.h
|
||||
fi
|
||||
if [ ! -f y.tab.c ]; then
|
||||
echo 'main() { return 0; }' >y.tab.c
|
||||
fi
|
||||
;;
|
||||
|
||||
lex|flex)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.l' file. You may need the \`Flex' package
|
||||
in order for those modifications to take effect. You can get
|
||||
\`Flex' from any GNU archive site."
|
||||
rm -f lex.yy.c
|
||||
if [ $# -ne 1 ]; then
|
||||
eval LASTARG="\${$#}"
|
||||
case "$LASTARG" in
|
||||
*.l)
|
||||
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
|
||||
if [ -f "$SRCFILE" ]; then
|
||||
cp "$SRCFILE" lex.yy.c
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
if [ ! -f lex.yy.c ]; then
|
||||
echo 'main() { return 0; }' >lex.yy.c
|
||||
fi
|
||||
;;
|
||||
|
||||
makeinfo)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is missing on your system. You should only need it if
|
||||
you modified a \`.texi' or \`.texinfo' file, or any other file
|
||||
indirectly affecting the aspect of the manual. The spurious
|
||||
call might also be the consequence of using a buggy \`make' (AIX,
|
||||
DU, IRIX). You might want to install the \`Texinfo' package or
|
||||
the \`GNU make' package. Grab either from any GNU archive site."
|
||||
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
|
||||
if test -z "$file"; then
|
||||
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
|
||||
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
|
||||
fi
|
||||
touch $file
|
||||
;;
|
||||
|
||||
*)
|
||||
echo 1>&2 "\
|
||||
WARNING: \`$1' is needed, and you do not seem to have it handy on your
|
||||
system. You might have modified some files without having the
|
||||
proper tools for further handling them. Check the \`README' file,
|
||||
it often tells you about the needed prerequirements for installing
|
||||
this package. You may also peek at any GNU archive site, in case
|
||||
some other package would contain this missing \`$1' program."
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -0,0 +1,40 @@
|
|||
#! /bin/sh
|
||||
# mkinstalldirs --- make directory hierarchy
|
||||
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
|
||||
# Created: 1993-05-16
|
||||
# Public domain
|
||||
|
||||
# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
|
||||
|
||||
errstatus=0
|
||||
|
||||
for file
|
||||
do
|
||||
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
|
||||
shift
|
||||
|
||||
pathcomp=
|
||||
for d
|
||||
do
|
||||
pathcomp="$pathcomp$d"
|
||||
case "$pathcomp" in
|
||||
-* ) pathcomp=./$pathcomp ;;
|
||||
esac
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
echo "mkdir $pathcomp"
|
||||
|
||||
mkdir "$pathcomp" || lasterr=$?
|
||||
|
||||
if test ! -d "$pathcomp"; then
|
||||
errstatus=$lasterr
|
||||
fi
|
||||
fi
|
||||
|
||||
pathcomp="$pathcomp/"
|
||||
done
|
||||
done
|
||||
|
||||
exit $errstatus
|
||||
|
||||
# mkinstalldirs ends here
|
|
@ -0,0 +1,62 @@
|
|||
## Makefile.am for blccc/src
|
||||
|
||||
SUBDIRS = modules
|
||||
|
||||
bin_PROGRAMS = blccc
|
||||
|
||||
AM_CPPFLAGS = -DG_DISABLE_DEPRECATED
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @BLIB_CFLAGS@
|
||||
LDADD = @GLIB_LIBS@ @BLIB_LIBS@ -lm
|
||||
|
||||
CLEANFILES =
|
||||
|
||||
blccc_sources = \
|
||||
blaccept.c \
|
||||
blaccept.h \
|
||||
blapp.c \
|
||||
blapp.h \
|
||||
blccc.c \
|
||||
blccc.h \
|
||||
blconfig.c \
|
||||
blconfig.h \
|
||||
blisdn.c \
|
||||
blisdn.h \
|
||||
bllisten.c \
|
||||
bllisten.h \
|
||||
bllogger.c \
|
||||
bllogger.h \
|
||||
blloveletters.c \
|
||||
blloveletters.h \
|
||||
blmarshal.list \
|
||||
blondemand.c \
|
||||
blondemand.h \
|
||||
blplaylist.c \
|
||||
blplaylist.h \
|
||||
blplaylist-parse.c \
|
||||
blplaylist-parse.h \
|
||||
blplaylistitem.c \
|
||||
blplaylistitem.h \
|
||||
bltheater.c \
|
||||
bltheater.h \
|
||||
bltypes.h \
|
||||
main.c
|
||||
|
||||
blccc_built_sources = \
|
||||
blmarshal.c \
|
||||
blmarshal.h
|
||||
|
||||
blccc_SOURCES = $(blccc_built_sources) $(blccc_sources)
|
||||
|
||||
gen_sources = xgen-gmh xgen-gmc
|
||||
CLEANFILES += $(gen_sources)
|
||||
|
||||
$(srcdir)/blmarshal.h: blmarshal.list
|
||||
$(GLIB_GENMARSHAL) --prefix=bl_marshal $(srcdir)/blmarshal.list --header >> xgen-gmh \
|
||||
&& (cmp -s xgen-gmh $@ || cp xgen-gmh $@) \
|
||||
&& rm -f xgen-gmh xgen-gmh~
|
||||
$(srcdir)/blmarshal.c: $(srcdir)/blmarshal.h
|
||||
echo "#include \"blmarshal.h\"" >> xgen-gmc \
|
||||
&& $(GLIB_GENMARSHAL) --prefix=bl_marshal $(srcdir)/blmarshal.list --body >> xgen-gmc \
|
||||
&& cp xgen-gmc $@ \
|
||||
&& rm -f xgen-gmc xgen-gmc~
|
|
@ -0,0 +1,452 @@
|
|||
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
DATADIR = @DATADIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACAKGE = @PACAKGE@
|
||||
PACKAGE = @PACKAGE@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SUBDIRS = modules
|
||||
|
||||
bin_PROGRAMS = blccc
|
||||
|
||||
AM_CPPFLAGS = -DG_DISABLE_DEPRECATED
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @BLIB_CFLAGS@
|
||||
LDADD = @GLIB_LIBS@ @BLIB_LIBS@ -lm
|
||||
CLEANFILES = $(gen_sources)
|
||||
|
||||
blccc_sources = blaccept.c blaccept.h blapp.c blapp.h blccc.c blccc.h blconfig.c blconfig.h blisdn.c blisdn.h bllisten.c bllisten.h bllogger.c bllogger.h blloveletters.c blloveletters.h blmarshal.list blondemand.c blondemand.h blplaylist.c blplaylist.h blplaylist-parse.c blplaylist-parse.h blplaylistitem.c blplaylistitem.h bltheater.c bltheater.h bltypes.h main.c
|
||||
|
||||
|
||||
blccc_built_sources = blmarshal.c blmarshal.h
|
||||
|
||||
|
||||
blccc_SOURCES = $(blccc_built_sources) $(blccc_sources)
|
||||
|
||||
gen_sources = xgen-gmh xgen-gmc
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
bin_PROGRAMS = blccc$(EXEEXT)
|
||||
PROGRAMS = $(bin_PROGRAMS)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
blccc_OBJECTS = blmarshal.$(OBJEXT) blaccept.$(OBJEXT) blapp.$(OBJEXT) \
|
||||
blccc.$(OBJEXT) blconfig.$(OBJEXT) blisdn.$(OBJEXT) bllisten.$(OBJEXT) \
|
||||
bllogger.$(OBJEXT) blloveletters.$(OBJEXT) blondemand.$(OBJEXT) \
|
||||
blplaylist.$(OBJEXT) blplaylist-parse.$(OBJEXT) \
|
||||
blplaylistitem.$(OBJEXT) bltheater.$(OBJEXT) main.$(OBJEXT)
|
||||
blccc_LDADD = $(LDADD)
|
||||
blccc_DEPENDENCIES =
|
||||
blccc_LDFLAGS =
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
SOURCES = $(blccc_SOURCES)
|
||||
OBJECTS = $(blccc_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .lo .o .obj .s
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
mostlyclean-binPROGRAMS:
|
||||
|
||||
clean-binPROGRAMS:
|
||||
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
|
||||
|
||||
distclean-binPROGRAMS:
|
||||
|
||||
maintainer-clean-binPROGRAMS:
|
||||
|
||||
install-binPROGRAMS: $(bin_PROGRAMS)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
@list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
|
||||
$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-binPROGRAMS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(bin_PROGRAMS)'; for p in $$list; do \
|
||||
rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
|
||||
done
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
# FIXME: We should only use cygpath when building on Windows,
|
||||
# and only if it is available.
|
||||
.c.obj:
|
||||
$(COMPILE) -c `cygpath -w $<`
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
|
||||
.c.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
.s.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
.S.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
|
||||
maintainer-clean-libtool:
|
||||
|
||||
blccc$(EXEEXT): $(blccc_OBJECTS) $(blccc_DEPENDENCIES)
|
||||
@rm -f blccc$(EXEEXT)
|
||||
$(LINK) $(blccc_LDFLAGS) $(blccc_OBJECTS) $(blccc_LDADD) $(LIBS)
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
rev="$$subdir $$rev"; \
|
||||
test "$$subdir" != "." || dot_seen=yes; \
|
||||
done; \
|
||||
test "$$dot_seen" = "no" && rev=". $$rev"; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = src
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
blaccept.o: blaccept.c bltypes.h blaccept.h blccc.h bllisten.h
|
||||
blapp.o: blapp.c bltypes.h blapp.h blplaylistitem.h
|
||||
blccc.o: blccc.c bltypes.h blapp.h blplaylistitem.h blccc.h blconfig.h \
|
||||
blisdn.h blondemand.h blplaylist.h bltheater.h
|
||||
blconfig.o: blconfig.c bltypes.h blapp.h blplaylistitem.h blconfig.h
|
||||
blisdn.o: blisdn.c bltypes.h blconfig.h blmarshal.h blisdn.h
|
||||
bllisten.o: bllisten.c bltypes.h blaccept.h bllisten.h
|
||||
bllogger.o: bllogger.c bltypes.h bllogger.h
|
||||
blloveletters.o: blloveletters.c bltypes.h blloveletters.h
|
||||
blmarshal.o: blmarshal.c blmarshal.h
|
||||
blondemand.o: blondemand.c bltypes.h blloveletters.h blondemand.h
|
||||
blplaylist-parse.o: blplaylist-parse.c bltypes.h blconfig.h blplaylist.h \
|
||||
blplaylistitem.h blplaylist-parse.h
|
||||
blplaylist.o: blplaylist.c bltypes.h blconfig.h blplaylist.h \
|
||||
blplaylistitem.h blplaylist-parse.h
|
||||
blplaylistitem.o: blplaylistitem.c bltypes.h blplaylistitem.h
|
||||
bltheater.o: bltheater.c bltypes.h blmarshal.h blconfig.h bllogger.h \
|
||||
blplaylist.h blplaylistitem.h bltheater.h
|
||||
main.o: main.c ../config.h bltypes.h blccc.h blconfig.h bllisten.h \
|
||||
blondemand.h
|
||||
|
||||
info-am:
|
||||
info: info-recursive
|
||||
dvi-am:
|
||||
dvi: dvi-recursive
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
installcheck-am:
|
||||
installcheck: installcheck-recursive
|
||||
install-exec-am: install-binPROGRAMS
|
||||
install-exec: install-exec-recursive
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-recursive
|
||||
uninstall-am: uninstall-binPROGRAMS
|
||||
uninstall: uninstall-recursive
|
||||
all-am: Makefile $(PROGRAMS)
|
||||
all-redirect: all-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
$(mkinstalldirs) $(DESTDIR)$(bindir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \
|
||||
mostlyclean-libtool mostlyclean-tags \
|
||||
mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
clean-am: clean-binPROGRAMS clean-compile clean-libtool clean-tags \
|
||||
clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-recursive
|
||||
|
||||
distclean-am: distclean-binPROGRAMS distclean-compile distclean-libtool \
|
||||
distclean-tags distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-recursive
|
||||
|
||||
maintainer-clean-am: maintainer-clean-binPROGRAMS \
|
||||
maintainer-clean-compile maintainer-clean-libtool \
|
||||
maintainer-clean-tags maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
|
||||
.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
|
||||
maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
|
||||
mostlyclean-compile distclean-compile clean-compile \
|
||||
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
|
||||
clean-libtool maintainer-clean-libtool install-data-recursive \
|
||||
uninstall-data-recursive install-exec-recursive \
|
||||
uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
|
||||
all-recursive check-recursive installcheck-recursive info-recursive \
|
||||
dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
|
||||
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
|
||||
install-exec install-data-am install-data install-am install \
|
||||
uninstall-am uninstall all-redirect all-am all installdirs-am \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
$(srcdir)/blmarshal.h: blmarshal.list
|
||||
$(GLIB_GENMARSHAL) --prefix=bl_marshal $(srcdir)/blmarshal.list --header >> xgen-gmh \
|
||||
&& (cmp -s xgen-gmh $@ || cp xgen-gmh $@) \
|
||||
&& rm -f xgen-gmh xgen-gmh~
|
||||
$(srcdir)/blmarshal.c: $(srcdir)/blmarshal.h
|
||||
echo "#include \"blmarshal.h\"" >> xgen-gmc \
|
||||
&& $(GLIB_GENMARSHAL) --prefix=bl_marshal $(srcdir)/blmarshal.list --body >> xgen-gmc \
|
||||
&& cp xgen-gmc $@ \
|
||||
&& rm -f xgen-gmc xgen-gmc~
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,347 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "blaccept.h"
|
||||
#include "blccc.h"
|
||||
#include "bllisten.h"
|
||||
|
||||
|
||||
const gchar *welcome_msg =
|
||||
"--------------------------------------------------\n"
|
||||
"Welcome to the Blinkenlights Chaos Control Center.\n"
|
||||
"--------------------------------------------------\n"
|
||||
"Type 'help' to get a list of supported commands.\n";
|
||||
|
||||
const gchar *help_msg =
|
||||
"Supported commands are:\n"
|
||||
" bye - closes the connection\n"
|
||||
" help - shows this list of supported commands\n"
|
||||
" isdn block - block control through isdn lines\n"
|
||||
" isdn unblock - allow control through isdn lines\n"
|
||||
" enable <number> - enable application\n"
|
||||
" disable <number> - disable application\n"
|
||||
" list - list items in current playlist\n"
|
||||
" load <filename> - load new playlist\n"
|
||||
" start <filename> - load new playlist and start immidiately\n"
|
||||
" next - skip to next item\n"
|
||||
" reload - reload current playlist\n"
|
||||
" status - show status info\n"
|
||||
" add <host> - add recipient\n"
|
||||
" remove <host> - remove recipient\n"
|
||||
#if 0
|
||||
" love <id> - play loveletter <id>\n"
|
||||
#endif
|
||||
" i - invert display\n"
|
||||
" v - flip display vertically\n"
|
||||
" h - flip display horizontally\n"
|
||||
" l - mirror left side\n"
|
||||
" r - mirror right side\n"
|
||||
" 0..9 # * - fake isdn event\n";
|
||||
|
||||
const gchar *load_msg = "Playlist loaded.\n";
|
||||
const gchar *reload_msg = "Playlist reloaded.\n";
|
||||
const gchar *added_msg = "Host added.\n";
|
||||
const gchar *removed_msg = "Host removed.\n";
|
||||
const gchar *love_msg = "Made love.\n";
|
||||
const gchar *event_msg = "Event dispatched.\n";
|
||||
const gchar *ok_msg = "OK\n";
|
||||
const gchar *failed_msg = "Operation failed.\n";
|
||||
const gchar *timeout_msg = "\nConnection timed out.\n";
|
||||
|
||||
const gchar *unknown_msg =
|
||||
"Unknown command, type 'help' to get a list of supported commands.\n";
|
||||
|
||||
|
||||
static inline void
|
||||
write_prompt (gint sock)
|
||||
{
|
||||
write (sock, "> ", 2);
|
||||
}
|
||||
|
||||
void
|
||||
bl_accept_new (BlListen *listen)
|
||||
{
|
||||
gint len;
|
||||
gint sock;
|
||||
gchar buf[1024];
|
||||
fd_set set;
|
||||
struct timeval tv;
|
||||
|
||||
g_return_if_fail (BL_IS_LISTEN (listen));
|
||||
|
||||
sock = accept (listen->sock, NULL, 0);
|
||||
|
||||
g_thread_create ((GThreadFunc) bl_accept_new, listen, FALSE, NULL);
|
||||
|
||||
write (sock, welcome_msg, strlen (welcome_msg));
|
||||
write_prompt (sock);
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
/* wait for input with a timeout of 10 minutes */
|
||||
|
||||
FD_ZERO (&set);
|
||||
FD_SET (sock, &set);
|
||||
tv.tv_sec = 600;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
len = select (sock + 1, &set, NULL, NULL, &tv);
|
||||
|
||||
if (len < 0)
|
||||
{
|
||||
if (errno == EINTR) /* select() was interupted */
|
||||
continue;
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (len == 0) /* select() timed out */
|
||||
{
|
||||
write (sock, timeout_msg, strlen (timeout_msg));
|
||||
break;
|
||||
}
|
||||
|
||||
len = read (sock, &buf, sizeof (buf));
|
||||
|
||||
if (len < 0)
|
||||
break;
|
||||
|
||||
if ((len > 2 && strncmp (buf, "bye", 3) == 0) ||
|
||||
(len > 3 && strncmp (buf, "quit", 4) == 0))
|
||||
{
|
||||
write (sock, "Good Bye.\n", 10);
|
||||
break;
|
||||
}
|
||||
else if (len > 5 && strncmp (buf, "status", 6) == 0)
|
||||
{
|
||||
if (listen->ccc)
|
||||
{
|
||||
gchar *status = bl_ccc_status (listen->ccc);
|
||||
write (sock, status, strlen (status));
|
||||
g_free (status);
|
||||
}
|
||||
}
|
||||
else if (len > 4 && strncmp (buf, "add ", 4) == 0)
|
||||
{
|
||||
gchar *host = g_strndup (buf + 4, len - 4);
|
||||
g_strstrip (host);
|
||||
if (listen->ccc && bl_ccc_add (listen->ccc, host, NULL))
|
||||
write (sock, added_msg, strlen (added_msg));
|
||||
else
|
||||
write (sock, failed_msg, strlen (failed_msg));
|
||||
g_free (host);
|
||||
}
|
||||
else if (len > 7 && strncmp (buf, "remove ", 7) == 0)
|
||||
{
|
||||
gchar *host = g_strndup (buf + 7, len - 7);
|
||||
g_strstrip (host);
|
||||
if (listen->ccc && bl_ccc_remove (listen->ccc, host, NULL))
|
||||
write (sock, removed_msg, strlen (removed_msg));
|
||||
else
|
||||
write (sock, failed_msg, strlen (failed_msg));
|
||||
g_free (host);
|
||||
}
|
||||
#if 0
|
||||
else if (len > 5 && strncmp (buf, "love ", 5) == 0)
|
||||
{
|
||||
gchar *id = g_strndup (buf + 5, len - 5);
|
||||
g_strstrip (id);
|
||||
if (listen->ccc && bl_ccc_on_demand (listen->ccc, id))
|
||||
write (sock, love_msg, strlen (love_msg));
|
||||
else
|
||||
write (sock, failed_msg, strlen (failed_msg));
|
||||
g_free (id);
|
||||
}
|
||||
#endif
|
||||
else if (len > 5 && strncmp (buf, "reload", 6) == 0)
|
||||
{
|
||||
if (listen->ccc && bl_ccc_reload (listen->ccc))
|
||||
write (sock, reload_msg, strlen (reload_msg));
|
||||
else
|
||||
write (sock, failed_msg, strlen (failed_msg));
|
||||
}
|
||||
else if (len > 3 && strncmp (buf, "list", 4) == 0)
|
||||
{
|
||||
if (listen->ccc)
|
||||
{
|
||||
gchar *list = bl_ccc_list (listen->ccc);
|
||||
write (sock, list, strlen (list));
|
||||
g_free (list);
|
||||
}
|
||||
}
|
||||
else if (len > 5 && strncmp (buf, "load ", 5) == 0)
|
||||
{
|
||||
gchar *name = g_strndup (buf + 5, len - 5);
|
||||
g_strstrip (name);
|
||||
if (listen->ccc && bl_ccc_load (listen->ccc, name, FALSE))
|
||||
write (sock, load_msg, strlen (load_msg));
|
||||
else
|
||||
write (sock, failed_msg, strlen (failed_msg));
|
||||
g_free (name);
|
||||
}
|
||||
else if (len > 6 && strncmp (buf, "start ", 6) == 0)
|
||||
{
|
||||
gchar *name = g_strndup (buf + 6, len - 6);
|
||||
g_strstrip (name);
|
||||
if (listen->ccc && bl_ccc_load (listen->ccc, name, TRUE))
|
||||
write (sock, load_msg, strlen (load_msg));
|
||||
else
|
||||
write (sock, failed_msg, strlen (failed_msg));
|
||||
g_free (name);
|
||||
}
|
||||
else if (len > 3 && strncmp (buf, "next", 4) == 0)
|
||||
{
|
||||
if (listen->ccc)
|
||||
{
|
||||
gchar *name = bl_ccc_next (listen->ccc);
|
||||
if (name)
|
||||
{
|
||||
g_snprintf (buf, sizeof (buf),
|
||||
"skipped to next item %s\n", name);
|
||||
write (sock, buf, strlen (buf));
|
||||
}
|
||||
else
|
||||
write (sock, failed_msg, strlen (failed_msg));
|
||||
g_free (name);
|
||||
}
|
||||
}
|
||||
else if (len > 9 && strncmp (buf, "isdn block", 10) == 0)
|
||||
{
|
||||
if (listen->ccc)
|
||||
bl_ccc_isdn_block (listen->ccc);
|
||||
}
|
||||
else if (len > 11 && strncmp (buf, "isdn unblock", 12) == 0)
|
||||
{
|
||||
if (listen->ccc)
|
||||
bl_ccc_isdn_unblock (listen->ccc);
|
||||
}
|
||||
else if (len > 6 && strncmp (buf, "enable ", 7) == 0)
|
||||
{
|
||||
gchar *num = g_strndup (buf + 7, len - 7);
|
||||
g_strstrip (num);
|
||||
if (listen->ccc && bl_ccc_app_enable (listen->ccc, num))
|
||||
write (sock, ok_msg, strlen (ok_msg));
|
||||
else
|
||||
write (sock, failed_msg, strlen (failed_msg));
|
||||
g_free (num);
|
||||
}
|
||||
else if (len > 7 && strncmp (buf, "disable ", 8) == 0)
|
||||
{
|
||||
gchar *num = g_strndup (buf + 8, len - 8);
|
||||
g_strstrip (num);
|
||||
if (listen->ccc && bl_ccc_app_disable (listen->ccc, num))
|
||||
write (sock, ok_msg, strlen (ok_msg));
|
||||
else
|
||||
write (sock, failed_msg, strlen (failed_msg));
|
||||
g_free (num);
|
||||
}
|
||||
else if (len > 3 && strncmp (buf, "help", 4) == 0)
|
||||
{
|
||||
write (sock, help_msg, strlen (help_msg));
|
||||
}
|
||||
else if (len > 0 && strncmp (buf, "i", 1) == 0)
|
||||
{
|
||||
if (listen->ccc && listen->ccc->effects)
|
||||
listen->ccc->effects->invert ^= B_EFFECT_SCOPE_ALL;
|
||||
}
|
||||
else if (len > 0 && strncmp (buf, "v", 1) == 0)
|
||||
{
|
||||
if (listen->ccc && listen->ccc->effects)
|
||||
listen->ccc->effects->vflip ^= B_EFFECT_SCOPE_ALL;
|
||||
}
|
||||
else if (len > 0 && strncmp (buf, "h", 1) == 0)
|
||||
{
|
||||
if (listen->ccc && listen->ccc->effects)
|
||||
listen->ccc->effects->hflip ^= B_EFFECT_SCOPE_ALL;
|
||||
}
|
||||
else if (len > 0 && strncmp (buf, "l", 1) == 0)
|
||||
{
|
||||
if (listen->ccc && listen->ccc->effects)
|
||||
{
|
||||
listen->ccc->effects->lmirror ^= B_EFFECT_SCOPE_ALL;
|
||||
|
||||
if (listen->ccc->effects->lmirror)
|
||||
listen->ccc->effects->rmirror = B_EFFECT_SCOPE_NONE;
|
||||
}
|
||||
}
|
||||
else if (len > 0 && strncmp (buf, "r", 1) == 0)
|
||||
{
|
||||
if (listen->ccc && listen->ccc->effects)
|
||||
{
|
||||
listen->ccc->effects->rmirror ^= B_EFFECT_SCOPE_ALL;
|
||||
|
||||
if (listen->ccc->effects->rmirror)
|
||||
listen->ccc->effects->lmirror = B_EFFECT_SCOPE_NONE;
|
||||
}
|
||||
}
|
||||
else if (len > 1 &&
|
||||
((*buf >= '0' && *buf <= '9') || *buf == '#' || *buf == '*'))
|
||||
{
|
||||
if (listen->ccc)
|
||||
{
|
||||
BModuleEvent event;
|
||||
|
||||
event.device_id = 0;
|
||||
event.type = B_EVENT_TYPE_KEY;
|
||||
|
||||
switch (*buf)
|
||||
{
|
||||
case '#':
|
||||
event.key = B_KEY_HASH;
|
||||
break;
|
||||
|
||||
case '*':
|
||||
event.key = B_KEY_ASTERISK;
|
||||
break;
|
||||
|
||||
default:
|
||||
event.key = *buf - '0' + B_KEY_0;
|
||||
}
|
||||
|
||||
bl_ccc_event (listen->ccc, &event);
|
||||
write (sock, event_msg, strlen (event_msg));
|
||||
}
|
||||
else
|
||||
{
|
||||
write (sock, failed_msg, strlen (failed_msg));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
write (sock, unknown_msg, strlen (unknown_msg));
|
||||
}
|
||||
|
||||
write_prompt (sock);
|
||||
}
|
||||
|
||||
close (sock);
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_ACCEPT_H__
|
||||
#define __BL_ACCEPT_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void bl_accept_new (BlListen *listen);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_ACCEPT_H__ */
|
|
@ -0,0 +1,190 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "blapp.h"
|
||||
|
||||
|
||||
static void bl_app_class_init (BlAppClass *klass);
|
||||
static void bl_app_init (BlApp *item);
|
||||
static void bl_app_finalize (GObject *object);
|
||||
static gchar * bl_app_describe (BlPlaylistItem *item);
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
GType
|
||||
bl_app_get_type (void)
|
||||
{
|
||||
static GType app_type = 0;
|
||||
|
||||
if (! app_type)
|
||||
{
|
||||
static const GTypeInfo app_info =
|
||||
{
|
||||
sizeof (BlAppClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) bl_app_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlApp),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) bl_app_init,
|
||||
};
|
||||
|
||||
app_type = g_type_register_static (BL_TYPE_PLAYLIST_ITEM,
|
||||
"BlApp", &app_info, 0);
|
||||
}
|
||||
|
||||
return app_type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_app_class_init (BlAppClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
BlPlaylistItemClass *item_class;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
item_class = BL_PLAYLIST_ITEM_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = bl_app_finalize;
|
||||
|
||||
item_class->describe = bl_app_describe;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_app_init (BlApp *item)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
bl_app_finalize (GObject *object)
|
||||
{
|
||||
BlApp *app = BL_APP (object);
|
||||
|
||||
g_free (app->name);
|
||||
app->name = NULL;
|
||||
g_free (app->number);
|
||||
app->number = NULL;
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
bl_app_describe (BlPlaylistItem *item)
|
||||
{
|
||||
BlApp *app = BL_APP (item);
|
||||
|
||||
return g_strdup_printf ("%s (%s)", app->name, app->number);
|
||||
}
|
||||
|
||||
static BlApp *
|
||||
bl_app_new (GType module_type,
|
||||
const gchar *name,
|
||||
const gchar *number,
|
||||
const gchar *vamp,
|
||||
gboolean public,
|
||||
gboolean disabled,
|
||||
gint priority)
|
||||
{
|
||||
BlApp *app = g_object_new (BL_TYPE_APP, NULL);
|
||||
|
||||
app->name = g_strdup (name);
|
||||
app->number = g_strdup (number);
|
||||
app->vamp = g_strdup (vamp);
|
||||
app->disabled = disabled;
|
||||
app->public = public;
|
||||
app->priority = priority;
|
||||
|
||||
BL_PLAYLIST_ITEM (app)->module = g_object_new (module_type, NULL);
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
BlApp *
|
||||
bl_app_new_from_attributes (const gchar **names,
|
||||
const gchar **values,
|
||||
const gchar *root,
|
||||
GError **error)
|
||||
{
|
||||
GType module_type;
|
||||
const gchar *type = NULL;
|
||||
const gchar *name = NULL;
|
||||
const gchar *number = NULL;
|
||||
const gchar *vamp = NULL;
|
||||
gboolean public = FALSE;
|
||||
gboolean disabled = FALSE;
|
||||
gint priority = 0;
|
||||
gint i;
|
||||
|
||||
g_return_val_if_fail (names != NULL && values != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
for (i = 0; names[i] && values[i]; i++)
|
||||
{
|
||||
if (strcmp (names[i], "name") == 0)
|
||||
name = values[i];
|
||||
else if (strcmp (names[i], "number") == 0)
|
||||
number = values[i];
|
||||
else if (strcmp (names[i], "type") == 0)
|
||||
type = values[i];
|
||||
else if (strcmp (names[i], "vamp") == 0)
|
||||
vamp = values[i];
|
||||
else if (strcmp (names[i], "public") == 0)
|
||||
b_parse_boolean (values[i], &public);
|
||||
else if (strcmp (names[i], "disabled") == 0)
|
||||
b_parse_boolean (values[i], &disabled);
|
||||
}
|
||||
|
||||
if (!name)
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"name argument missing in application element");
|
||||
return NULL;
|
||||
}
|
||||
if (!number)
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"number argument missing in application element");
|
||||
return NULL;
|
||||
}
|
||||
if (!type)
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"type argument missing in application element");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
module_type = g_type_from_name (type);
|
||||
if (!module_type || !g_type_is_a (module_type, B_TYPE_MODULE))
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"application type '%s' is not a BModule", type);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return bl_app_new (module_type,
|
||||
name, number, vamp, public, disabled, priority);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_APP_H__
|
||||
#define __BL_APP_H__
|
||||
|
||||
#include "blplaylistitem.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define BL_TYPE_APP (bl_app_get_type ())
|
||||
#define BL_APP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_APP, BlApp))
|
||||
#define BL_APP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_APP, BlAppClass))
|
||||
#define BL_IS_APP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_APP))
|
||||
|
||||
typedef struct _BlAppClass BlAppClass;
|
||||
|
||||
struct _BlApp
|
||||
{
|
||||
BlPlaylistItem parent_instance;
|
||||
|
||||
gchar *name;
|
||||
gchar *number;
|
||||
gchar *vamp;
|
||||
gboolean public;
|
||||
gboolean disabled;
|
||||
gint priority;
|
||||
|
||||
BlIsdnLine *line;
|
||||
};
|
||||
|
||||
struct _BlAppClass
|
||||
{
|
||||
BlPlaylistItemClass parent_class;
|
||||
};
|
||||
|
||||
GType bl_app_get_type (void) G_GNUC_CONST;
|
||||
BlApp * bl_app_new_from_attributes (const gchar **names,
|
||||
const gchar **values,
|
||||
const gchar *root,
|
||||
GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_APP_H__ */
|
|
@ -0,0 +1,814 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "blapp.h"
|
||||
#include "blccc.h"
|
||||
#include "blconfig.h"
|
||||
#include "blisdn.h"
|
||||
#include "blondemand.h"
|
||||
#include "blplaylist.h"
|
||||
#include "blplaylistitem.h"
|
||||
#include "bltheater.h"
|
||||
|
||||
|
||||
static void bl_ccc_class_init (BlCccClass *class);
|
||||
static void bl_ccc_init (BlCcc *ccc);
|
||||
static void bl_ccc_finalize (GObject *object);
|
||||
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
GType
|
||||
bl_ccc_get_type (void)
|
||||
{
|
||||
static GType ccc_type = 0;
|
||||
|
||||
if (!ccc_type)
|
||||
{
|
||||
static const GTypeInfo ccc_info =
|
||||
{
|
||||
sizeof (BlCccClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) bl_ccc_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlCcc),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) bl_ccc_init,
|
||||
};
|
||||
|
||||
ccc_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"BlCcc", &ccc_info, 0);
|
||||
}
|
||||
|
||||
return ccc_type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_ccc_class_init (BlCccClass *class)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
|
||||
parent_class = g_type_class_peek_parent (class);
|
||||
|
||||
object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = bl_ccc_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_ccc_init (BlCcc *ccc)
|
||||
{
|
||||
ccc->config = NULL;
|
||||
ccc->mutex = g_mutex_new ();
|
||||
ccc->theater = NULL;
|
||||
ccc->playlist = NULL;
|
||||
ccc->effects = NULL;
|
||||
ccc->isdn = NULL;
|
||||
ccc->active_app = NULL;
|
||||
|
||||
g_type_class_ref (B_TYPE_MOVIE_PLAYER);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_ccc_finalize (GObject *object)
|
||||
{
|
||||
BlCcc *ccc;
|
||||
|
||||
ccc = BL_CCC (object);
|
||||
|
||||
if (ccc->mutex)
|
||||
{
|
||||
g_mutex_free (ccc->mutex);
|
||||
ccc->mutex = NULL;
|
||||
}
|
||||
if (ccc->isdn)
|
||||
{
|
||||
g_object_unref (ccc->isdn);
|
||||
ccc->isdn = NULL;
|
||||
}
|
||||
if (ccc->theater)
|
||||
{
|
||||
g_object_unref (ccc->theater);
|
||||
ccc->theater = NULL;
|
||||
}
|
||||
if (ccc->playlist)
|
||||
{
|
||||
g_object_unref (ccc->playlist);
|
||||
ccc->playlist = NULL;
|
||||
}
|
||||
if (ccc->effects)
|
||||
{
|
||||
g_object_unref (ccc->effects);
|
||||
ccc->effects = NULL;
|
||||
}
|
||||
|
||||
g_type_class_unref (g_type_class_peek (B_TYPE_MOVIE_PLAYER));
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
isdn_incoming_call (BlIsdn *isdn,
|
||||
BlIsdnLine *line,
|
||||
BlCcc *ccc)
|
||||
{
|
||||
BlApp *active;
|
||||
BlApp *app;
|
||||
|
||||
g_printerr ("Incoming call on line %d: %s for %s\n",
|
||||
line->channel, line->calling_number, line->called_number);
|
||||
|
||||
active = ccc->active_app;
|
||||
|
||||
/* if the line matches this is the call we already handle */
|
||||
if (active && active->line == line)
|
||||
return;
|
||||
|
||||
app = bl_config_select_app (ccc->config, line->called_number);
|
||||
|
||||
if (!app)
|
||||
{
|
||||
g_printerr (" -> no matching number, go away.\n");
|
||||
bl_isdn_call_hangup (isdn, line, BL_ISDN_REASON_NO_USER_RESPONSE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (app->disabled)
|
||||
{
|
||||
g_printerr (" -> this application is temporarily disabled, go away.\n");
|
||||
bl_isdn_call_hangup (isdn, line, BL_ISDN_REASON_NO_USER_RESPONSE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!app->public &&
|
||||
!bl_config_authorize_caller (ccc->config, line->calling_number))
|
||||
{
|
||||
g_printerr (" -> I don't know you, go away.\n");
|
||||
bl_isdn_call_hangup (isdn, line, BL_ISDN_REASON_NO_USER_RESPONSE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (active)
|
||||
{
|
||||
if (app == active)
|
||||
{
|
||||
if (ccc->theater->item && ccc->theater->item->module)
|
||||
{
|
||||
BModule *module = ccc->theater->item->module;
|
||||
|
||||
if (module->num_players <
|
||||
B_MODULE_GET_CLASS (module)->max_players)
|
||||
{
|
||||
#if 0
|
||||
BModuleEvent event;
|
||||
|
||||
bl_isdn_call_accept (isdn, line, app->vamp);
|
||||
|
||||
app->line2 = line;
|
||||
|
||||
/* add a player to the module */
|
||||
event.device_id = line->channel - 1;
|
||||
event.type = B_EVENT_TYPE_PLAYER_ENTERED;
|
||||
event.key = 0;
|
||||
|
||||
bl_ccc_event (ccc, &event);
|
||||
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (app->priority > active->priority)
|
||||
{
|
||||
/* FIXME: change apps */
|
||||
}
|
||||
|
||||
g_printerr (" -> sorry, we are busy.\n");
|
||||
bl_isdn_call_hangup (isdn, line, BL_ISDN_REASON_USER_BUSY);
|
||||
return;
|
||||
}
|
||||
|
||||
bl_isdn_call_accept (isdn, line, app->vamp);
|
||||
|
||||
line->app = app;
|
||||
}
|
||||
|
||||
static void
|
||||
isdn_state_changed (BlIsdn *isdn,
|
||||
BlIsdnLine *line,
|
||||
BlCcc *ccc)
|
||||
{
|
||||
BModuleEvent event;
|
||||
|
||||
g_printerr ("Line %d went %s.\n",
|
||||
line->channel, line->offhook ? "offhook" : "onhook");
|
||||
|
||||
if (! line->app)
|
||||
return;
|
||||
|
||||
if (line->offhook)
|
||||
{
|
||||
BlApp *app = line->app;
|
||||
BlPlaylistItem *item = BL_PLAYLIST_ITEM (app);
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
ccc->active_app = app;
|
||||
app->line = line;
|
||||
|
||||
bl_theater_push_item (ccc->theater, item);
|
||||
bl_theater_play (ccc->theater);
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
|
||||
/* add a player to the module */
|
||||
event.device_id = line->channel - 1;
|
||||
event.type = B_EVENT_TYPE_PLAYER_ENTERED;
|
||||
event.key = 0;
|
||||
|
||||
bl_ccc_event (ccc, &event);
|
||||
}
|
||||
else
|
||||
{
|
||||
gboolean item_pushed;
|
||||
|
||||
/* EEK */
|
||||
item_pushed = (ccc->theater->item == BL_PLAYLIST_ITEM (line->app));
|
||||
|
||||
if (item_pushed)
|
||||
{
|
||||
/* remove the player from the module */
|
||||
event.device_id = line->channel - 1;
|
||||
event.type = B_EVENT_TYPE_PLAYER_LEFT;
|
||||
event.key = 0;
|
||||
|
||||
bl_ccc_event (ccc, &event);
|
||||
}
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
line->app->line = NULL;
|
||||
line->app = NULL;
|
||||
|
||||
if (item_pushed)
|
||||
bl_theater_finish (ccc->theater);
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
isdn_key_pressed (BlIsdn *isdn,
|
||||
BlIsdnLine *line,
|
||||
BModuleKey key,
|
||||
BlCcc *ccc)
|
||||
{
|
||||
BModuleEvent event;
|
||||
|
||||
if (! ccc->active_app)
|
||||
return;
|
||||
|
||||
/* FIXME: should remap ids */
|
||||
event.device_id = line->channel - 1;
|
||||
event.type = B_EVENT_TYPE_KEY;
|
||||
event.key = key;
|
||||
|
||||
bl_ccc_event (ccc, &event);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_ccc_set_item (BlCcc *ccc,
|
||||
BlPlaylistItem *item)
|
||||
{
|
||||
bl_theater_set_item (ccc->theater, item);
|
||||
|
||||
bl_theater_play (ccc->theater);
|
||||
}
|
||||
|
||||
static void
|
||||
theater_item_finished (BlTheater *theater,
|
||||
BlPlaylistItem *item,
|
||||
gboolean pushed,
|
||||
BlCcc *ccc)
|
||||
{
|
||||
if (ccc->active_app)
|
||||
{
|
||||
if (ccc->isdn && ccc->active_app->line)
|
||||
{
|
||||
bl_isdn_call_hangup (ccc->isdn,
|
||||
ccc->active_app->line,
|
||||
BL_ISDN_REASON_NORMAL_CALL_CLEARING);
|
||||
}
|
||||
|
||||
ccc->active_app = NULL;
|
||||
}
|
||||
|
||||
if (pushed)
|
||||
{
|
||||
bl_theater_pop_item (ccc->theater);
|
||||
bl_theater_play (ccc->theater);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ccc->playlist)
|
||||
{
|
||||
item = bl_playlist_load_next_item (ccc->playlist, FALSE);
|
||||
|
||||
if (! item)
|
||||
{
|
||||
/* reload the playlist menually because calling
|
||||
* bl_ccc_reload() will cause a recursive mutex
|
||||
* deadlock
|
||||
*/
|
||||
BlPlaylist *new;
|
||||
const gchar *filename;
|
||||
|
||||
g_print ("Playlist returned no item, reloading it...\n");
|
||||
|
||||
filename = b_object_get_filename (B_OBJECT (ccc->playlist));
|
||||
|
||||
new = bl_playlist_new_from_file (filename, ccc->config,
|
||||
bl_theater_paint_callback,
|
||||
ccc->theater);
|
||||
|
||||
if (new)
|
||||
{
|
||||
g_object_unref (ccc->playlist);
|
||||
ccc->playlist = new;
|
||||
|
||||
item = bl_playlist_load_next_item (ccc->playlist, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
if (item)
|
||||
bl_ccc_set_item (ccc, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bl_ccc_setup_applications (BlCcc *ccc)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
for (list = ccc->config->applications; list; list = list->next)
|
||||
{
|
||||
BModule *module = BL_PLAYLIST_ITEM (list->data)->module;
|
||||
|
||||
module->width = ccc->config->width;
|
||||
module->height = ccc->config->height;
|
||||
module->channels = 1;
|
||||
module->maxval = 255;
|
||||
module->aspect = ccc->config->aspect;
|
||||
module->buffer = g_new0 (guchar, module->width * module->height);
|
||||
module->owns_buffer = TRUE;
|
||||
module->paint_callback = bl_theater_paint_callback;
|
||||
module->paint_data = ccc->theater;
|
||||
}
|
||||
}
|
||||
|
||||
BlCcc *
|
||||
bl_ccc_new (BlConfig *config)
|
||||
{
|
||||
BlCcc *ccc;
|
||||
BlTheater *theater;
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CONFIG (config), NULL);
|
||||
|
||||
theater = bl_theater_new (config);
|
||||
if (!theater)
|
||||
return NULL;
|
||||
|
||||
ccc = BL_CCC (g_object_new (BL_TYPE_CCC, NULL));
|
||||
ccc->config = g_object_ref (config);
|
||||
ccc->theater = theater;
|
||||
|
||||
bl_theater_set_frame_data (theater, NULL);
|
||||
|
||||
g_signal_connect (G_OBJECT (theater), "item_finished",
|
||||
G_CALLBACK (theater_item_finished),
|
||||
ccc);
|
||||
|
||||
if (config->isdn_host)
|
||||
{
|
||||
ccc->isdn = bl_isdn_new (config, &error);
|
||||
if (!ccc->isdn)
|
||||
{
|
||||
g_printerr ("Could not setup connection to ISDN system "
|
||||
"on %s port %d:\n %s\n",
|
||||
config->isdn_host, config->isdn_port,
|
||||
error->message);
|
||||
g_object_unref (ccc);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (ccc->isdn)
|
||||
{
|
||||
bl_ccc_setup_applications (ccc);
|
||||
|
||||
g_signal_connect (G_OBJECT (ccc->isdn), "incoming_call",
|
||||
G_CALLBACK (isdn_incoming_call),
|
||||
ccc);
|
||||
g_signal_connect (G_OBJECT (ccc->isdn), "state_changed",
|
||||
G_CALLBACK (isdn_state_changed),
|
||||
ccc);
|
||||
g_signal_connect (G_OBJECT (ccc->isdn), "key_pressed",
|
||||
G_CALLBACK (isdn_key_pressed),
|
||||
ccc);
|
||||
}
|
||||
|
||||
bl_ccc_load (ccc, config->playlist, FALSE);
|
||||
|
||||
ccc->effects = b_effects_new ();
|
||||
|
||||
bl_theater_set_effects (ccc->theater, ccc->effects);
|
||||
|
||||
return ccc;
|
||||
}
|
||||
|
||||
gchar *
|
||||
bl_ccc_status (BlCcc *ccc)
|
||||
{
|
||||
GString *status;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CCC (ccc), NULL);
|
||||
|
||||
status = g_string_new (NULL);
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
if (ccc->playlist)
|
||||
{
|
||||
g_string_append_printf (status, "Playlist is '%s' with %d items.\n",
|
||||
b_object_get_name (B_OBJECT (ccc->playlist)),
|
||||
g_list_length (ccc->playlist->items));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_append (status, "No playlist loaded.\n");
|
||||
}
|
||||
|
||||
if (ccc->effects)
|
||||
{
|
||||
g_string_append_printf (status, "Current effects: "
|
||||
"invert=%s vflip=%s hflip=%s lmirror=%s rmirror=%s.\n",
|
||||
ccc->effects->invert ? "ON" : "OFF",
|
||||
ccc->effects->vflip ? "ON" : "OFF",
|
||||
ccc->effects->hflip ? "ON" : "OFF",
|
||||
ccc->effects->lmirror ? "ON" : "OFF",
|
||||
ccc->effects->rmirror ? "ON" : "OFF");
|
||||
}
|
||||
|
||||
if (ccc->theater->item)
|
||||
{
|
||||
gchar *str;
|
||||
|
||||
str = bl_playlist_item_describe (ccc->theater->item);
|
||||
g_string_append_printf (status, "Current item is a %s.\n", str);
|
||||
g_free (str);
|
||||
|
||||
if (bl_theater_is_playing (ccc->theater))
|
||||
g_string_append_printf (status, "The movie is playing%s.\n",
|
||||
ccc->active_app ? " on demand" : "");
|
||||
else
|
||||
g_string_append (status, "The movie is paused.\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_append (status, "No movie.\n");
|
||||
}
|
||||
|
||||
{
|
||||
GType *module_types;
|
||||
gint n_module_types;
|
||||
gint i;
|
||||
|
||||
g_string_append (status, "Modules: ");
|
||||
|
||||
module_types = g_type_children (B_TYPE_MODULE, &n_module_types);
|
||||
|
||||
for (i = 0; i < n_module_types; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
g_string_append (status, ", ");
|
||||
|
||||
g_string_append (status, g_type_name (module_types[i]));
|
||||
}
|
||||
|
||||
g_free (module_types);
|
||||
|
||||
g_string_append (status, "\n");
|
||||
}
|
||||
|
||||
{
|
||||
GList *recipients;
|
||||
|
||||
recipients = b_sender_list_recipients (ccc->theater->sender);
|
||||
|
||||
if (recipients)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
g_string_append (status, "Recipients: ");
|
||||
|
||||
for (list = recipients; list; list = g_list_next (list))
|
||||
{
|
||||
if (list->prev)
|
||||
g_string_append (status, ", ");
|
||||
|
||||
g_string_append (status, (gchar *) list->data);
|
||||
}
|
||||
|
||||
g_string_append (status, ".\n");
|
||||
|
||||
g_list_foreach (recipients, (GFunc) g_free, NULL);
|
||||
g_list_free (recipients);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_append (status, "No recipients.\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (ccc->isdn)
|
||||
{
|
||||
gint i;
|
||||
|
||||
g_string_append_printf (status, "Control through isdn is %s.\n",
|
||||
ccc->isdn->blocked ? "blocked" : "allowed");
|
||||
|
||||
g_string_append_printf (status, "The %d isdn lines are:\n",
|
||||
ccc->isdn->num_lines);
|
||||
|
||||
for (i = 0; i < ccc->isdn->num_lines; i++)
|
||||
{
|
||||
if (ccc->isdn->lines[i].offhook)
|
||||
g_string_append_printf (status, " %d: offhook (%s for %s)\n", i,
|
||||
ccc->isdn->lines[i].calling_number,
|
||||
ccc->isdn->lines[i].called_number);
|
||||
else
|
||||
g_string_append_printf (status, " %d: onhook\n", i);
|
||||
}
|
||||
}
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
|
||||
return g_string_free (status, FALSE);
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_ccc_reload (BlCcc *ccc)
|
||||
{
|
||||
gchar *filename = NULL;
|
||||
gboolean retval = FALSE;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CCC (ccc), FALSE);
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
if (ccc->playlist)
|
||||
filename = g_strdup (b_object_get_filename (B_OBJECT (ccc->playlist)));
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
|
||||
retval = bl_ccc_load (ccc, filename, FALSE);
|
||||
g_free (filename);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_ccc_load (BlCcc *ccc,
|
||||
const gchar *filename,
|
||||
gboolean instant_change)
|
||||
{
|
||||
BlConfig *config;
|
||||
BlPlaylist *new;
|
||||
BlPlaylistItem *item;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CCC (ccc), FALSE);
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
config = ccc->config;
|
||||
|
||||
new = bl_playlist_new_from_file (filename, config,
|
||||
bl_theater_paint_callback, ccc->theater);
|
||||
|
||||
if (new)
|
||||
{
|
||||
if (ccc->playlist)
|
||||
g_object_unref (ccc->playlist);
|
||||
ccc->playlist = new;
|
||||
|
||||
if (!ccc->theater->item)
|
||||
{
|
||||
item = bl_playlist_load_next_item (ccc->playlist, FALSE);
|
||||
|
||||
if (item)
|
||||
bl_ccc_set_item (ccc, item);
|
||||
}
|
||||
else if (instant_change)
|
||||
{
|
||||
bl_theater_finish (ccc->theater);
|
||||
}
|
||||
}
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
|
||||
return (new != NULL);
|
||||
}
|
||||
|
||||
gchar *
|
||||
bl_ccc_list (BlCcc *ccc)
|
||||
{
|
||||
gchar *retval = NULL;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CCC (ccc), NULL);
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
if (ccc->playlist)
|
||||
retval = bl_playlist_item_describe (BL_PLAYLIST_ITEM (ccc->playlist));
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
gchar *
|
||||
bl_ccc_next (BlCcc *ccc)
|
||||
{
|
||||
gchar *retval = NULL;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CCC (ccc), NULL);
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
bl_theater_finish (ccc->theater);
|
||||
|
||||
if (ccc->theater->item)
|
||||
retval = bl_playlist_item_describe (ccc->theater->item);
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
bl_ccc_kill (BlCcc *ccc)
|
||||
{
|
||||
g_return_if_fail (BL_IS_CCC (ccc));
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
if (ccc->theater)
|
||||
bl_theater_kill (ccc->theater);
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
}
|
||||
|
||||
void
|
||||
bl_ccc_event (BlCcc *ccc,
|
||||
BModuleEvent *event)
|
||||
{
|
||||
g_return_if_fail (BL_IS_CCC (ccc));
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
bl_theater_event (ccc->theater, event);
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_ccc_add (BlCcc *ccc,
|
||||
const gchar *host,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CCC (ccc), FALSE);
|
||||
g_return_val_if_fail (host != NULL, FALSE);
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
success = bl_theater_add_recipient (ccc->theater, host, error);
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_ccc_remove (BlCcc *ccc,
|
||||
const gchar *host,
|
||||
GError **error)
|
||||
{
|
||||
gboolean success;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CCC (ccc), FALSE);
|
||||
g_return_val_if_fail (host != NULL, FALSE);
|
||||
|
||||
g_mutex_lock (ccc->mutex);
|
||||
|
||||
success = bl_theater_remove_recipient (ccc->theater, host, error);
|
||||
|
||||
g_mutex_unlock (ccc->mutex);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_ccc_app_enable (BlCcc *ccc,
|
||||
const gchar *number)
|
||||
{
|
||||
BlApp *app;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CCC (ccc), FALSE);
|
||||
g_return_val_if_fail (number != NULL, FALSE);
|
||||
|
||||
app = bl_config_select_app (ccc->config, number);
|
||||
if (!app)
|
||||
return FALSE;
|
||||
|
||||
if (!app->disabled)
|
||||
return TRUE;
|
||||
|
||||
app->disabled = FALSE;
|
||||
g_printerr ("Enabled application %s (%s)\n", app->name, app->number);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_ccc_app_disable (BlCcc *ccc,
|
||||
const gchar *number)
|
||||
{
|
||||
BlApp *app;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CCC (ccc), FALSE);
|
||||
g_return_val_if_fail (number != NULL, FALSE);
|
||||
|
||||
app = bl_config_select_app (ccc->config, number);
|
||||
if (!app)
|
||||
return FALSE;
|
||||
|
||||
if (app->disabled)
|
||||
return TRUE;
|
||||
|
||||
app->disabled = TRUE;
|
||||
g_printerr ("Disabled application %s (%s)\n", app->name, app->number);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
bl_ccc_isdn_block (BlCcc *ccc)
|
||||
{
|
||||
g_return_if_fail (BL_IS_CCC (ccc));
|
||||
|
||||
if (ccc->isdn)
|
||||
bl_isdn_block (ccc->isdn);
|
||||
|
||||
bl_theater_finish (ccc->theater);
|
||||
}
|
||||
|
||||
void
|
||||
bl_ccc_isdn_unblock (BlCcc *ccc)
|
||||
{
|
||||
g_return_if_fail (BL_IS_CCC (ccc));
|
||||
|
||||
if (ccc->isdn)
|
||||
bl_isdn_unblock (ccc->isdn);
|
||||
}
|
|
@ -0,0 +1,85 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_CCC_H__
|
||||
#define __BL_CCC_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define BL_TYPE_CCC (bl_ccc_get_type ())
|
||||
#define BL_CCC(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_CCC, BlCcc))
|
||||
#define BL_CCC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_CCC, BlCccClass))
|
||||
#define BL_IS_CCC(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_CCC))
|
||||
#define BL_IS_CCC_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BL_TYPE_CCC))
|
||||
|
||||
typedef struct _BlCccClass BlCccClass;
|
||||
|
||||
struct _BlCccClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
struct _BlCcc
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
BlConfig *config;
|
||||
|
||||
GMutex *mutex;
|
||||
BlTheater *theater;
|
||||
BlPlaylist *playlist;
|
||||
BEffects *effects;
|
||||
BlIsdn *isdn;
|
||||
|
||||
BlApp *active_app;
|
||||
};
|
||||
|
||||
GType bl_ccc_get_type (void) G_GNUC_CONST;
|
||||
BlCcc * bl_ccc_new (BlConfig *config);
|
||||
|
||||
gchar * bl_ccc_status (BlCcc *ccc);
|
||||
gboolean bl_ccc_reload (BlCcc *ccc);
|
||||
gboolean bl_ccc_load (BlCcc *ccc,
|
||||
const gchar *filename,
|
||||
gboolean instant_change);
|
||||
gchar * bl_ccc_list (BlCcc *ccc);
|
||||
gchar * bl_ccc_next (BlCcc *ccc);
|
||||
void bl_ccc_kill (BlCcc *ccc);
|
||||
|
||||
void bl_ccc_event (BlCcc *ccc,
|
||||
BModuleEvent *event);
|
||||
|
||||
gboolean bl_ccc_add (BlCcc *ccc,
|
||||
const gchar *host,
|
||||
GError **error);
|
||||
gboolean bl_ccc_remove (BlCcc *ccc,
|
||||
const gchar *host,
|
||||
GError **error);
|
||||
|
||||
gboolean bl_ccc_app_enable (BlCcc *ccc,
|
||||
const gchar *number);
|
||||
gboolean bl_ccc_app_disable (BlCcc *ccc,
|
||||
const gchar *number);
|
||||
|
||||
void bl_ccc_isdn_block (BlCcc *ccc);
|
||||
void bl_ccc_isdn_unblock (BlCcc *ccc);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_CCC_H__ */
|
|
@ -0,0 +1,532 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "blapp.h"
|
||||
#include "blconfig.h"
|
||||
|
||||
#define DEFAULT_WIDTH 18
|
||||
#define DEFAULT_HEIGHT 8
|
||||
#define DEFAULT_TELNET_PORT 2323
|
||||
#define DEFAULT_ISDN_PORT 1234
|
||||
#define DEFAULT_ISDN_LINES 4
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_WIDTH,
|
||||
PROP_HEIGHT,
|
||||
PROP_MAXVAL,
|
||||
PROP_CHANNELS,
|
||||
PROP_ASPECT,
|
||||
PROP_PLAYLIST,
|
||||
PROP_LOGFILE,
|
||||
PROP_RECIPIENT,
|
||||
PROP_TELNET_PORT,
|
||||
PROP_ISDN_HOST,
|
||||
PROP_ISDN_PORT,
|
||||
PROP_ISDN_LISTEN,
|
||||
PROP_ISDN_LINES,
|
||||
PROP_AUTH_CALLER
|
||||
};
|
||||
|
||||
static void bl_config_class_init (BlConfigClass *klass);
|
||||
static void bl_config_init (BlConfig *view);
|
||||
static void bl_config_finalize (GObject *object);
|
||||
static void bl_config_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
|
||||
/* parser functions */
|
||||
|
||||
typedef struct _ParserData ParserData;
|
||||
|
||||
struct _ParserData
|
||||
{
|
||||
BlConfig *config;
|
||||
BlApp *app;
|
||||
gchar *root;
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
PARSER_IN_BLCCC = B_PARSER_STATE_USER,
|
||||
PARSER_IN_CONFIG,
|
||||
PARSER_IN_PARAM,
|
||||
PARSER_IN_APP,
|
||||
PARSER_IN_APP_PARAM,
|
||||
PARSER_FINISH
|
||||
};
|
||||
|
||||
static BParserState parser_start_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar **attribute_names,
|
||||
const gchar **attribute_values,
|
||||
gpointer user_data,
|
||||
GError **error);
|
||||
static BParserState parser_end_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar *cdata,
|
||||
gsize cdata_len,
|
||||
gpointer user_data,
|
||||
GError **error);
|
||||
|
||||
|
||||
static BObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
GType
|
||||
bl_config_get_type (void)
|
||||
{
|
||||
static GType config_type = 0;
|
||||
|
||||
if (!config_type)
|
||||
{
|
||||
static const GTypeInfo config_info =
|
||||
{
|
||||
sizeof (BlConfigClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) bl_config_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlConfig),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) bl_config_init,
|
||||
};
|
||||
|
||||
config_type = g_type_register_static (B_TYPE_OBJECT,
|
||||
"BlConfig", &config_info, 0);
|
||||
}
|
||||
|
||||
return config_type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_config_class_init (BlConfigClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
GParamSpec *param_spec;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = bl_config_finalize;
|
||||
object_class->set_property = bl_config_set_property;
|
||||
|
||||
param_spec = g_param_spec_int ("width", NULL, NULL,
|
||||
1, G_MAXSHORT, DEFAULT_WIDTH,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_WIDTH, param_spec);
|
||||
|
||||
param_spec = g_param_spec_int ("height", NULL, NULL,
|
||||
1, G_MAXSHORT, DEFAULT_HEIGHT,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_HEIGHT, param_spec);
|
||||
|
||||
param_spec = g_param_spec_int ("maxval", NULL, NULL,
|
||||
1, 255, 255,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_MAXVAL, param_spec);
|
||||
|
||||
param_spec = g_param_spec_int ("channels", NULL, NULL,
|
||||
1, G_MAXSHORT, 1,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_CHANNELS, param_spec);
|
||||
|
||||
param_spec = g_param_spec_double ("aspect", NULL, NULL,
|
||||
0.01, 100.0, 1.0,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_ASPECT, param_spec);
|
||||
|
||||
param_spec = b_param_spec_filename ("playlist", NULL, NULL,
|
||||
"playlist.default.xml",
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_PLAYLIST, param_spec);
|
||||
|
||||
param_spec = b_param_spec_filename ("logfile", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_LOGFILE, param_spec);
|
||||
|
||||
param_spec = g_param_spec_string ("recipient", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_RECIPIENT, param_spec);
|
||||
|
||||
param_spec = g_param_spec_int ("telnet-port", NULL, NULL,
|
||||
1024, 65535, DEFAULT_TELNET_PORT,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_TELNET_PORT, param_spec);
|
||||
|
||||
param_spec = g_param_spec_string ("isdn-host", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_ISDN_HOST, param_spec);
|
||||
|
||||
param_spec = g_param_spec_int ("isdn-port", NULL, NULL,
|
||||
1024, 65535, DEFAULT_ISDN_PORT,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_ISDN_PORT, param_spec);
|
||||
|
||||
param_spec = g_param_spec_int ("isdn-listen", NULL, NULL,
|
||||
1024, 65535, DEFAULT_ISDN_PORT,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_ISDN_LISTEN, param_spec);
|
||||
|
||||
param_spec = g_param_spec_int ("isdn-lines", NULL, NULL,
|
||||
0, 8, DEFAULT_ISDN_LINES,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_ISDN_LINES, param_spec);
|
||||
|
||||
param_spec = g_param_spec_string ("authorized-caller", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_AUTH_CALLER, param_spec);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_config_init (BlConfig *config)
|
||||
{
|
||||
config->recipients = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_config_finalize (GObject *object)
|
||||
{
|
||||
BlConfig *config = BL_CONFIG (object);
|
||||
|
||||
if (config->recipients)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
for (list = config->recipients; list; list = list->next)
|
||||
g_free (list->data);
|
||||
|
||||
g_list_free (config->recipients);
|
||||
config->recipients = NULL;
|
||||
}
|
||||
|
||||
if (config->authorized_callers)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
for (list = config->authorized_callers; list; list = list->next)
|
||||
g_free (list->data);
|
||||
|
||||
g_list_free (config->authorized_callers);
|
||||
config->authorized_callers = NULL;
|
||||
}
|
||||
|
||||
if (config->applications)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
for (list = config->applications; list; list = list->next)
|
||||
g_object_unref (G_OBJECT (list->data));
|
||||
|
||||
g_list_free (config->applications);
|
||||
config->applications = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_config_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
BlConfig *config = BL_CONFIG (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_WIDTH:
|
||||
config->width = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_HEIGHT:
|
||||
config->height = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_MAXVAL:
|
||||
config->maxval = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_CHANNELS:
|
||||
config->channels = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_ASPECT:
|
||||
config->aspect = g_value_get_double (value);
|
||||
break;
|
||||
case PROP_PLAYLIST:
|
||||
g_free (config->playlist);
|
||||
config->playlist = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_LOGFILE:
|
||||
g_free (config->logfile);
|
||||
config->logfile = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_RECIPIENT:
|
||||
if (g_value_get_string (value))
|
||||
config->recipients = g_list_append (config->recipients,
|
||||
g_value_dup_string (value));
|
||||
break;
|
||||
case PROP_TELNET_PORT:
|
||||
config->telnet_port = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_ISDN_HOST:
|
||||
config->isdn_host = g_value_dup_string (value);
|
||||
break;
|
||||
case PROP_ISDN_PORT:
|
||||
config->isdn_port = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_ISDN_LISTEN:
|
||||
config->isdn_listen = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_ISDN_LINES:
|
||||
config->isdn_lines = g_value_get_int (value);
|
||||
break;
|
||||
case PROP_AUTH_CALLER:
|
||||
if (g_value_get_string (value))
|
||||
config->authorized_callers = g_list_append (config->authorized_callers,
|
||||
g_value_dup_string (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
BlConfig *
|
||||
bl_config_new (void)
|
||||
{
|
||||
return BL_CONFIG (g_object_new (BL_TYPE_CONFIG, NULL));
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_config_parse (BlConfig *config,
|
||||
const gchar *filename,
|
||||
GError **error)
|
||||
{
|
||||
GIOChannel *io;
|
||||
BParser *parser;
|
||||
ParserData data;
|
||||
GList *list;
|
||||
gboolean retval;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CONFIG (config), FALSE);
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
g_object_set (G_OBJECT (config), "filename", filename, NULL);
|
||||
|
||||
io = g_io_channel_new_file (filename, "r", error);
|
||||
if (! io)
|
||||
return FALSE;
|
||||
|
||||
data.config = config;
|
||||
if (g_path_is_absolute (filename))
|
||||
{
|
||||
data.root = g_path_get_dirname (filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *dir = g_get_current_dir ();
|
||||
gchar *tmp = g_build_filename (dir, filename, NULL);
|
||||
|
||||
data.root = g_path_get_dirname (tmp);
|
||||
|
||||
g_free (tmp);
|
||||
g_free (dir);
|
||||
}
|
||||
|
||||
parser = b_parser_new (parser_start_element, parser_end_element, &data);
|
||||
|
||||
retval = b_parser_parse_io_channel (parser, io, TRUE, error);
|
||||
|
||||
if (retval && b_parser_get_state (parser) != PARSER_FINISH)
|
||||
{
|
||||
g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
|
||||
"This doesn't look like a blccc configuration file.");
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
b_parser_free (parser);
|
||||
g_free (data.root);
|
||||
g_io_channel_unref (io);
|
||||
|
||||
/* now query the registered applications */
|
||||
for (list = config->applications; list; list = list->next)
|
||||
{
|
||||
BlApp *app = BL_APP (list->data);
|
||||
BlPlaylistItem *item = BL_PLAYLIST_ITEM (app);
|
||||
|
||||
if (B_MODULE_GET_CLASS (item->module)->query (config->width,
|
||||
config->height,
|
||||
1, 255))
|
||||
{
|
||||
g_print ("Registered app: %s on %s %s %s\n",
|
||||
app->name, app->number,
|
||||
app->public ? "(public)" : "",
|
||||
app->disabled ? "(disabled)" : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"Application %s can not handle this configuration.",
|
||||
app->name);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_config_authorize_caller (BlConfig *config,
|
||||
const gchar *caller)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CONFIG (config), FALSE);
|
||||
|
||||
if (!caller)
|
||||
return FALSE;
|
||||
|
||||
for (list = config->authorized_callers; list; list = list->next)
|
||||
if (strcmp (caller, (gchar *) list->data) == 0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BlApp *
|
||||
bl_config_select_app (BlConfig *config,
|
||||
const gchar *called_number)
|
||||
{
|
||||
GList *list;
|
||||
|
||||
for (list = config->applications; list; list = list->next)
|
||||
{
|
||||
BlApp *app = list->data;
|
||||
|
||||
if (strcmp (app->number, called_number) == 0)
|
||||
return app;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static BParserState
|
||||
parser_start_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar **attribute_names,
|
||||
const gchar **attribute_values,
|
||||
gpointer user_data,
|
||||
GError **error)
|
||||
{
|
||||
ParserData *data = user_data;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case B_PARSER_STATE_TOPLEVEL:
|
||||
if (strcmp (element_name, "blccc") == 0)
|
||||
return PARSER_IN_BLCCC;
|
||||
break;
|
||||
|
||||
case PARSER_IN_BLCCC:
|
||||
if (strcmp (element_name, "config") == 0)
|
||||
return PARSER_IN_CONFIG;
|
||||
break;
|
||||
|
||||
case PARSER_IN_CONFIG:
|
||||
if (strcmp (element_name, "param") == 0)
|
||||
{
|
||||
if (b_parse_param (G_OBJECT (data->config), data->root,
|
||||
attribute_names, attribute_values, error))
|
||||
return PARSER_IN_PARAM;
|
||||
}
|
||||
else if (strcmp (element_name, "application") == 0)
|
||||
{
|
||||
if ((data->app = bl_app_new_from_attributes (attribute_names,
|
||||
attribute_values,
|
||||
data->root, error)))
|
||||
return PARSER_IN_APP;
|
||||
}
|
||||
break;
|
||||
|
||||
case PARSER_IN_APP:
|
||||
if (strcmp (element_name, "param") == 0)
|
||||
{
|
||||
if (b_parse_param (G_OBJECT (BL_PLAYLIST_ITEM (data->app)->module),
|
||||
data->root,
|
||||
attribute_names, attribute_values,
|
||||
error))
|
||||
return PARSER_IN_APP_PARAM;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return B_PARSER_STATE_UNKNOWN;
|
||||
}
|
||||
|
||||
static BParserState
|
||||
parser_end_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar *cdata,
|
||||
gsize cdata_len,
|
||||
gpointer user_data,
|
||||
GError **error)
|
||||
{
|
||||
ParserData *data = user_data;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case PARSER_IN_BLCCC:
|
||||
return PARSER_FINISH;
|
||||
|
||||
case PARSER_IN_CONFIG:
|
||||
return PARSER_IN_BLCCC;
|
||||
|
||||
case PARSER_IN_APP:
|
||||
g_return_val_if_fail (BL_IS_APP (data->app), B_PARSER_STATE_UNKNOWN);
|
||||
data->config->applications = g_list_append (data->config->applications,
|
||||
data->app);
|
||||
data->app = NULL;
|
||||
return PARSER_IN_CONFIG;
|
||||
|
||||
case PARSER_IN_PARAM:
|
||||
return PARSER_IN_CONFIG;
|
||||
|
||||
case PARSER_IN_APP_PARAM:
|
||||
return PARSER_IN_APP;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return B_PARSER_STATE_UNKNOWN;
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_CONFIG_H__
|
||||
#define __BL_CONFIG_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define BL_TYPE_CONFIG (bl_config_get_type ())
|
||||
#define BL_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_CONFIG, BlConfig))
|
||||
#define BL_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_CONFIG, BlConfigClass))
|
||||
#define BL_IS_CONFIG(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_CONFIG))
|
||||
#define BL_IS_CONFIG_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BL_TYPE_CONFIG))
|
||||
|
||||
typedef struct _BlConfigClass BlConfigClass;
|
||||
|
||||
struct _BlConfigClass
|
||||
{
|
||||
BObjectClass parent_class;
|
||||
};
|
||||
|
||||
struct _BlConfig
|
||||
{
|
||||
BObject parent_instance;
|
||||
|
||||
gint width;
|
||||
gint height;
|
||||
gint maxval;
|
||||
gint channels;
|
||||
gdouble aspect;
|
||||
|
||||
gchar *playlist;
|
||||
gchar *logfile;
|
||||
|
||||
GList *recipients;
|
||||
|
||||
gint telnet_port;
|
||||
|
||||
gchar *isdn_host;
|
||||
gint isdn_port;
|
||||
gint isdn_listen;
|
||||
gint isdn_lines;
|
||||
|
||||
GList *authorized_callers;
|
||||
|
||||
GList *applications;
|
||||
};
|
||||
|
||||
|
||||
GType bl_config_get_type (void) G_GNUC_CONST;
|
||||
BlConfig * bl_config_new (void);
|
||||
gboolean bl_config_parse (BlConfig *config,
|
||||
const gchar *filename,
|
||||
GError **error);
|
||||
|
||||
BlApp * bl_config_select_app (BlConfig *config,
|
||||
const gchar *called_number);
|
||||
gboolean bl_config_authorize_caller (BlConfig *config,
|
||||
const gchar *caller);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_CONFIG_H__ */
|
|
@ -0,0 +1,733 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <netdb.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/time.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
#include "blconfig.h"
|
||||
#include "blmarshal.h"
|
||||
#include "blisdn.h"
|
||||
|
||||
|
||||
/* #define ISDN_VERBOSE 1 */
|
||||
|
||||
|
||||
#define POLL_TIMEOUT 120 /* ms */
|
||||
#define RESET_TIMEOUT 60 /* sec */
|
||||
|
||||
|
||||
static void bl_isdn_class_init (BlIsdnClass *class);
|
||||
static void bl_isdn_init (BlIsdn *isdn);
|
||||
static void bl_isdn_finalize (GObject *object);
|
||||
|
||||
static gboolean bl_isdn_setup (BlIsdn *isdn,
|
||||
GError **error);
|
||||
static void bl_isdn_teardown (BlIsdn *isdn);
|
||||
|
||||
static void bl_isdn_hangup_all (BlIsdn *isdn);
|
||||
|
||||
static void bl_isdn_heartbeat_start (BlIsdn *isdn);
|
||||
static void bl_isdn_heartbeat_stop (BlIsdn *isdn);
|
||||
|
||||
static void bl_isdn_handle_message (BlIsdn *isdn,
|
||||
guchar *msg,
|
||||
gint len);
|
||||
|
||||
static gboolean udp_prepare (GSource *source,
|
||||
gint *timeout);
|
||||
static gboolean udp_check (GSource *source);
|
||||
static gboolean udp_dispatch (GSource *source,
|
||||
GSourceFunc callback,
|
||||
gpointer user_data);
|
||||
|
||||
|
||||
typedef struct _BlIsdnSource BlIsdnSource;
|
||||
struct _BlIsdnSource
|
||||
{
|
||||
GSource source;
|
||||
BlIsdn *isdn;
|
||||
};
|
||||
|
||||
static GSourceFuncs udp_funcs =
|
||||
{
|
||||
udp_prepare,
|
||||
udp_check,
|
||||
udp_dispatch,
|
||||
NULL
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
INCOMING_CALL,
|
||||
STATE_CHANGED,
|
||||
KEY_PRESSED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
static guint bl_isdn_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
/* BlIsdn source function */
|
||||
|
||||
static gboolean
|
||||
udp_prepare (GSource *source,
|
||||
gint *timeout)
|
||||
{
|
||||
BlIsdn *isdn = ((BlIsdnSource *) source)->isdn;
|
||||
fd_set set;
|
||||
struct timeval tv;
|
||||
|
||||
FD_ZERO (&set);
|
||||
FD_SET (isdn->listen_sock, &set);
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
isdn->packet_pending = (select (isdn->listen_sock + 1,
|
||||
&set, NULL, NULL, &tv) > 0);
|
||||
|
||||
if (timeout)
|
||||
*timeout = POLL_TIMEOUT;
|
||||
|
||||
if (isdn->packet_pending)
|
||||
isdn->no_packets = 0;
|
||||
else
|
||||
isdn->no_packets++;
|
||||
|
||||
if (isdn->no_packets == (RESET_TIMEOUT * 1000 / POLL_TIMEOUT))
|
||||
{
|
||||
g_printerr ("BlIsdn: %d seconds have gone by without any sign of life\n"
|
||||
" from the ISDN system. I'll try to reconnect ...\n",
|
||||
RESET_TIMEOUT);
|
||||
|
||||
bl_isdn_teardown (isdn);
|
||||
bl_isdn_setup (isdn, NULL);
|
||||
}
|
||||
|
||||
return isdn->packet_pending;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
udp_check (GSource *source)
|
||||
{
|
||||
BlIsdn *isdn = ((BlIsdnSource *) source)->isdn;
|
||||
|
||||
return isdn->packet_pending;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
udp_dispatch (GSource *source,
|
||||
GSourceFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
BlIsdn *isdn = ((BlIsdnSource *) source)->isdn;
|
||||
guchar buffer[2048];
|
||||
fd_set set;
|
||||
struct timeval tv;
|
||||
|
||||
isdn->packet_pending = FALSE;
|
||||
|
||||
FD_ZERO (&set);
|
||||
FD_SET (isdn->listen_sock, &set);
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
/* on first call empty the queue */
|
||||
if (!isdn->sock_initialized)
|
||||
{
|
||||
while (select (isdn->listen_sock + 1, &set, NULL, NULL, &tv) > 0)
|
||||
{
|
||||
FD_ZERO (&set);
|
||||
FD_SET (isdn->listen_sock, &set);
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
if (FD_ISSET (isdn->listen_sock, &set))
|
||||
read (isdn->listen_sock, buffer, sizeof (buffer));
|
||||
}
|
||||
isdn->sock_initialized = TRUE;
|
||||
}
|
||||
|
||||
while (select (isdn->listen_sock + 1, &set, NULL, NULL, &tv) > 0)
|
||||
{
|
||||
FD_ZERO (&set);
|
||||
FD_SET (isdn->listen_sock, &set);
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 0;
|
||||
|
||||
if (FD_ISSET (isdn->listen_sock, &set))
|
||||
{
|
||||
gint bytes;
|
||||
|
||||
bytes = read (isdn->listen_sock, buffer, sizeof (buffer) - 1);
|
||||
|
||||
if (bytes > 0)
|
||||
{
|
||||
buffer[bytes] = '\0';
|
||||
|
||||
if (!isdn->blocked)
|
||||
bl_isdn_handle_message (isdn, buffer, bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* BlIsdn GObject framework */
|
||||
|
||||
GType
|
||||
bl_isdn_get_type (void)
|
||||
{
|
||||
static GType isdn_type = 0;
|
||||
|
||||
if (!isdn_type)
|
||||
{
|
||||
static const GTypeInfo isdn_info =
|
||||
{
|
||||
sizeof (BlIsdnClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) bl_isdn_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlIsdn),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) bl_isdn_init,
|
||||
};
|
||||
|
||||
isdn_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"BlIsdn",
|
||||
&isdn_info, 0);
|
||||
}
|
||||
|
||||
return isdn_type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_isdn_class_init (BlIsdnClass *class)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
|
||||
parent_class = g_type_class_peek_parent (class);
|
||||
|
||||
object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
bl_isdn_signals[INCOMING_CALL] =
|
||||
g_signal_new ("incoming_call",
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (BlIsdnClass, incoming_call),
|
||||
NULL, NULL,
|
||||
bl_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE, 1, G_TYPE_POINTER);
|
||||
bl_isdn_signals[STATE_CHANGED] =
|
||||
g_signal_new ("state_changed",
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (BlIsdnClass, state_changed),
|
||||
NULL, NULL,
|
||||
bl_marshal_VOID__POINTER,
|
||||
G_TYPE_NONE, 1, G_TYPE_POINTER);
|
||||
bl_isdn_signals[KEY_PRESSED] =
|
||||
g_signal_new ("key_pressed",
|
||||
G_TYPE_FROM_CLASS (class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (BlIsdnClass, key_pressed),
|
||||
NULL, NULL,
|
||||
bl_marshal_VOID__POINTER_INT,
|
||||
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_INT);
|
||||
|
||||
class->incoming_call = NULL;
|
||||
class->state_changed = NULL;
|
||||
class->key_pressed = NULL;
|
||||
|
||||
object_class->finalize = bl_isdn_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_isdn_init (BlIsdn *isdn)
|
||||
{
|
||||
isdn->listen_sock = -1;
|
||||
isdn->send_sock = -1;
|
||||
isdn->heartbeat = 0;
|
||||
isdn->sock_initialized = FALSE;
|
||||
isdn->state_initialized = FALSE;
|
||||
isdn->packet_pending = FALSE;
|
||||
isdn->no_packets = 0;
|
||||
isdn->blocked = FALSE;
|
||||
isdn->lines = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_isdn_finalize (GObject *object)
|
||||
{
|
||||
BlIsdn *isdn = BL_ISDN (object);
|
||||
|
||||
bl_isdn_teardown (isdn);
|
||||
|
||||
if (isdn->source)
|
||||
{
|
||||
g_source_destroy (isdn->source);
|
||||
isdn->source = NULL;
|
||||
}
|
||||
if (isdn->lines)
|
||||
{
|
||||
g_free (isdn->lines);
|
||||
isdn->lines = NULL;
|
||||
}
|
||||
if (isdn->config)
|
||||
{
|
||||
g_object_unref (isdn->config);
|
||||
isdn->config = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
bl_isdn_setup (BlIsdn *isdn,
|
||||
GError **error)
|
||||
{
|
||||
BlConfig *config;
|
||||
struct sockaddr_in addr;
|
||||
struct hostent *dest;
|
||||
gchar *cmd;
|
||||
gint port;
|
||||
gint i;
|
||||
|
||||
config = isdn->config;
|
||||
|
||||
dest = gethostbyname (config->isdn_host);
|
||||
if (dest == NULL)
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"Unable to resolve host '%s'", config->isdn_host);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((isdn->listen_sock = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) != -1)
|
||||
{
|
||||
memset (&addr, 0, sizeof (addr));
|
||||
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons (config->isdn_listen);
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
|
||||
if ((bind (isdn->listen_sock,
|
||||
(struct sockaddr *) &addr, sizeof (addr))) == -1)
|
||||
{
|
||||
g_set_error (error, 0, 0, "Failed to bind listening socket: %s",
|
||||
g_strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"Failed to open listening socket: %s", g_strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
port = ntohs (addr.sin_port);
|
||||
|
||||
memset (&addr, 0, sizeof (addr));
|
||||
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_port = htons (config->isdn_port);
|
||||
memcpy (&addr.sin_addr.s_addr, dest->h_addr_list[0], dest->h_length);
|
||||
|
||||
if ((isdn->send_sock = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) != -1)
|
||||
{
|
||||
i = 1;
|
||||
if ((setsockopt (isdn->send_sock,
|
||||
SOL_SOCKET, SO_REUSEADDR, &i, sizeof (i))) == -1)
|
||||
{
|
||||
g_set_error (error, 0, 0, "Failed to configure send socket: %s",
|
||||
g_strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ((connect (isdn->send_sock,
|
||||
(struct sockaddr *) &addr, sizeof (addr))) == -1)
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"Failed to bind send socket: %s", g_strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"Failed to open send socket: %s", g_strerror (errno));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
cmd = g_strdup_printf ("0:register:%d", port);
|
||||
#if ISDN_VERBOSE
|
||||
g_printerr ("BlIsdn > %s\n", cmd);
|
||||
#endif
|
||||
if (send (isdn->send_sock, cmd, strlen (cmd), 0) == -1)
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"Failed to send register message: %s", g_strerror (errno));
|
||||
g_free (cmd);
|
||||
return FALSE;
|
||||
}
|
||||
g_free (cmd);
|
||||
|
||||
g_printerr ("Connected to ISDN system (%s:%d), listening on port %d\n",
|
||||
config->isdn_host, config->isdn_port, port);
|
||||
|
||||
bl_isdn_heartbeat_start (isdn);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_isdn_teardown (BlIsdn *isdn)
|
||||
{
|
||||
bl_isdn_heartbeat_stop (isdn);
|
||||
|
||||
if (isdn->listen_sock > -1)
|
||||
{
|
||||
close (isdn->listen_sock);
|
||||
isdn->listen_sock = -1;
|
||||
isdn->sock_initialized = FALSE;
|
||||
}
|
||||
|
||||
isdn->no_packets = 0;
|
||||
|
||||
bl_isdn_hangup_all (isdn);
|
||||
|
||||
if (isdn->send_sock > -1)
|
||||
{
|
||||
close (isdn->send_sock);
|
||||
isdn->send_sock = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bl_isdn_hangup_all (BlIsdn *isdn)
|
||||
{
|
||||
BlIsdnLine *line;
|
||||
gint i;
|
||||
|
||||
for (i = 0, line = isdn->lines; i < isdn->num_lines; i++, line++)
|
||||
{
|
||||
if (line->offhook)
|
||||
{
|
||||
gchar *msg = g_strdup_printf ("%d:hangup", i + 1);
|
||||
|
||||
send (isdn->send_sock, msg, strlen (msg), 0);
|
||||
|
||||
line->offhook = FALSE;
|
||||
if (!isdn->blocked)
|
||||
g_signal_emit (G_OBJECT (isdn),
|
||||
bl_isdn_signals[STATE_CHANGED], 0, line, NULL);
|
||||
|
||||
g_free (line->called_number);
|
||||
g_free (line->calling_number);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
bl_isdn_heartbeat (BlIsdn *isdn)
|
||||
{
|
||||
const gchar *msg = "0:heartbeat";
|
||||
|
||||
send (isdn->send_sock, msg, strlen (msg), 0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_isdn_heartbeat_start (BlIsdn *isdn)
|
||||
{
|
||||
g_return_if_fail (isdn->heartbeat == 0);
|
||||
|
||||
isdn->heartbeat = g_timeout_add (10000,
|
||||
(GSourceFunc) bl_isdn_heartbeat, isdn);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_isdn_heartbeat_stop (BlIsdn *isdn)
|
||||
{
|
||||
if (isdn->heartbeat)
|
||||
{
|
||||
g_source_remove (isdn->heartbeat);
|
||||
isdn->heartbeat = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bl_isdn_handle_message (BlIsdn *isdn,
|
||||
guchar *msg,
|
||||
gint len)
|
||||
{
|
||||
gint channel;
|
||||
|
||||
if (len < 2 || msg[1] != ':')
|
||||
return;
|
||||
|
||||
channel = msg[0] - '0';
|
||||
msg += 2;
|
||||
|
||||
if (channel > 0 && channel <= isdn->num_lines)
|
||||
{
|
||||
BlIsdnLine *line = isdn->lines + channel - 1;
|
||||
|
||||
g_return_if_fail (line->channel == channel);
|
||||
|
||||
if (line->offhook)
|
||||
{
|
||||
if (strncmp (msg, "onhook", 6) == 0)
|
||||
{
|
||||
#if ISDN_VERBOSE
|
||||
g_printerr ("BlIsdn: Line %d hung up\n", channel);
|
||||
#endif
|
||||
line->offhook = FALSE;
|
||||
g_signal_emit (G_OBJECT (isdn),
|
||||
bl_isdn_signals[STATE_CHANGED], 0, line);
|
||||
|
||||
g_free (line->calling_number);
|
||||
line->calling_number = NULL;
|
||||
|
||||
g_free (line->called_number);
|
||||
line->called_number = NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
else if (strncmp (msg, "dtmf:", 5) == 0)
|
||||
{
|
||||
BModuleKey key;
|
||||
|
||||
switch (msg[5])
|
||||
{
|
||||
case '0'...'9':
|
||||
key = msg[5] - '0';
|
||||
break;
|
||||
case '#':
|
||||
key = B_KEY_HASH;
|
||||
break;
|
||||
case '*':
|
||||
key = B_KEY_ASTERISK;
|
||||
break;
|
||||
default:
|
||||
g_printerr ("BlIsdn: Unknown DTMF key '%s'\n", msg + 5);
|
||||
return;
|
||||
}
|
||||
|
||||
#if ISDN_VERBOSE
|
||||
g_printerr ("BlIsdn: Key %c pressed on line %d\n",
|
||||
msg[5], channel);
|
||||
#endif
|
||||
g_signal_emit (G_OBJECT (isdn),
|
||||
bl_isdn_signals[KEY_PRESSED], 0, line, key);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else /* onhook */
|
||||
{
|
||||
if (strncmp (msg, "setup:", 6) == 0)
|
||||
{
|
||||
gchar *caller = msg + 6;
|
||||
gchar *called;
|
||||
|
||||
if ((called = strchr (caller, ':')))
|
||||
*called++ = '\0';
|
||||
|
||||
#if ISDN_VERBOSE
|
||||
g_printerr ("BlIsdn: incoming call on line %d from %s to %s\n",
|
||||
channel, caller, called);
|
||||
#endif
|
||||
g_free (line->called_number);
|
||||
line->called_number = g_strdup (called);
|
||||
|
||||
g_free (line->calling_number);
|
||||
line->calling_number = g_strdup (caller);
|
||||
|
||||
g_signal_emit (G_OBJECT (isdn),
|
||||
bl_isdn_signals[INCOMING_CALL], 0, line);
|
||||
return;
|
||||
}
|
||||
else if (strncmp (msg, "connected", 9) == 0)
|
||||
{
|
||||
#if ISDN_VERBOSE
|
||||
g_printerr ("BlIsdn: line %d connected\n", channel);
|
||||
#endif
|
||||
line->offhook = TRUE;
|
||||
g_signal_emit (G_OBJECT (isdn),
|
||||
bl_isdn_signals[STATE_CHANGED], 0, line);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (channel != 0)
|
||||
{
|
||||
g_printerr ("BlIsdn: line %d is out of range (%d lines configured)\n",
|
||||
channel, isdn->num_lines);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strncmp (msg, "error:", 6) == 0)
|
||||
{
|
||||
if (channel == 0)
|
||||
g_printerr ("BlIsdn: General error signalled: %s\n", msg + 6);
|
||||
else
|
||||
g_printerr ("BlIsdn: Error signalled on line %d: %s\n",
|
||||
channel, msg + 6);
|
||||
}
|
||||
}
|
||||
|
||||
BlIsdn *
|
||||
bl_isdn_new (BlConfig *config,
|
||||
GError **error)
|
||||
{
|
||||
BlIsdn *isdn;
|
||||
struct hostent *dest;
|
||||
gint i;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CONFIG (config), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
g_return_val_if_fail (config->isdn_host != NULL, NULL);
|
||||
g_return_val_if_fail (config->isdn_port > 0, NULL);
|
||||
g_return_val_if_fail (config->isdn_listen > 0, NULL);
|
||||
g_return_val_if_fail (config->isdn_lines < 9, NULL);
|
||||
|
||||
dest = gethostbyname (config->isdn_host);
|
||||
if (dest == NULL)
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"Unable to resolve host '%s'", config->isdn_host);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
isdn = BL_ISDN (g_object_new (BL_TYPE_ISDN, NULL));
|
||||
|
||||
isdn->config = g_object_ref (config);
|
||||
|
||||
if (! bl_isdn_setup (isdn, error))
|
||||
{
|
||||
bl_isdn_teardown (isdn);
|
||||
g_object_unref (isdn);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
isdn->num_lines = config->isdn_lines;
|
||||
isdn->lines = g_new0 (BlIsdnLine, isdn->num_lines);
|
||||
|
||||
for (i = 0; i < isdn->num_lines; i++)
|
||||
isdn->lines[i].channel = i + 1;
|
||||
|
||||
isdn->source = g_source_new (&udp_funcs, sizeof (BlIsdnSource));
|
||||
g_source_set_priority (isdn->source, G_PRIORITY_DEFAULT);
|
||||
g_source_set_can_recurse (isdn->source, FALSE);
|
||||
|
||||
((BlIsdnSource *) isdn->source)->isdn = isdn;
|
||||
g_source_attach (isdn->source, NULL);
|
||||
|
||||
return isdn;
|
||||
}
|
||||
|
||||
void
|
||||
bl_isdn_call_accept (BlIsdn *isdn,
|
||||
BlIsdnLine *line,
|
||||
const gchar *wamp)
|
||||
{
|
||||
gchar *cmd;
|
||||
|
||||
g_return_if_fail (BL_IS_ISDN (isdn));
|
||||
g_return_if_fail (line != NULL);
|
||||
|
||||
if (isdn->blocked)
|
||||
return;
|
||||
|
||||
cmd = g_strdup_printf ("%d:accept", line->channel);
|
||||
#if ISDN_VERBOSE
|
||||
g_printerr ("BlIsdn > %s\n", cmd);
|
||||
#endif
|
||||
send (isdn->send_sock, cmd, strlen (cmd), 0);
|
||||
g_free (cmd);
|
||||
|
||||
if (wamp)
|
||||
{
|
||||
cmd = g_strdup_printf ("%d:playbackground:%s", line->channel, wamp);
|
||||
#if ISDN_VERBOSE
|
||||
g_printerr ("BlIsdn > %s\n", cmd);
|
||||
#endif
|
||||
send (isdn->send_sock, cmd, strlen (cmd), 0);
|
||||
g_free (cmd);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
bl_isdn_call_hangup (BlIsdn *isdn,
|
||||
BlIsdnLine *line,
|
||||
BlIsdnReason reason)
|
||||
{
|
||||
gchar *cmd;
|
||||
|
||||
g_return_if_fail (BL_IS_ISDN (isdn));
|
||||
g_return_if_fail (line != NULL);
|
||||
|
||||
if (reason)
|
||||
cmd = g_strdup_printf ("%d:hangup:%d", line->channel, reason);
|
||||
else
|
||||
cmd = g_strdup_printf ("%d:hangup", line->channel);
|
||||
|
||||
#if ISDN_VERBOSE
|
||||
g_printerr ("BlIsdn > %s\n", cmd);
|
||||
#endif
|
||||
send (isdn->send_sock, cmd, strlen (cmd), 0);
|
||||
g_free (cmd);
|
||||
}
|
||||
|
||||
void
|
||||
bl_isdn_block (BlIsdn *isdn)
|
||||
{
|
||||
g_return_if_fail (BL_IS_ISDN (isdn));
|
||||
|
||||
bl_isdn_hangup_all (isdn);
|
||||
|
||||
isdn->blocked = TRUE;
|
||||
|
||||
g_printerr ("BlIsdn: Thrown out all callers, ISDN is now blocked!\n");
|
||||
}
|
||||
|
||||
void
|
||||
bl_isdn_unblock (BlIsdn *isdn)
|
||||
{
|
||||
g_return_if_fail (BL_IS_ISDN (isdn));
|
||||
|
||||
isdn->blocked = FALSE;
|
||||
|
||||
g_printerr ("BlIsdn: Unblocked ISDN!\n");
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_ISDN_H__
|
||||
#define __BL_ISDN_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
BL_ISDN_NO_REASON = 0,
|
||||
BL_ISDN_REASON_NORMAL_CALL_CLEARING = 16,
|
||||
BL_ISDN_REASON_USER_BUSY = 17,
|
||||
BL_ISDN_REASON_NO_USER_RESPONSE = 18
|
||||
} BlIsdnReason;
|
||||
|
||||
|
||||
#define BL_TYPE_ISDN (bl_isdn_get_type ())
|
||||
#define BL_ISDN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_ISDN, BlIsdn))
|
||||
#define BL_ISDN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_ISDN, BlIsdnClass))
|
||||
#define BL_IS_ISDN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_ISDN))
|
||||
#define BL_IS_ISDN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BL_TYPE_ISDN))
|
||||
|
||||
typedef struct _BlIsdnClass BlIsdnClass;
|
||||
|
||||
struct _BlIsdnClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
void (* incoming_call) (BlIsdn *isdn,
|
||||
BlIsdnLine *line);
|
||||
void (* state_changed) (BlIsdn *isdn,
|
||||
BlIsdnLine *line);
|
||||
void (* key_pressed) (BlIsdn *isdn,
|
||||
BlIsdnLine *line,
|
||||
BModuleKey key);
|
||||
};
|
||||
|
||||
struct _BlIsdn
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
BlConfig *config;
|
||||
|
||||
GSource *source;
|
||||
|
||||
gint listen_sock;
|
||||
gint send_sock;
|
||||
|
||||
guint heartbeat;
|
||||
|
||||
gboolean sock_initialized;
|
||||
gboolean state_initialized;
|
||||
gboolean packet_pending;
|
||||
gint no_packets;
|
||||
|
||||
gboolean blocked;
|
||||
gint num_lines;
|
||||
BlIsdnLine *lines;
|
||||
};
|
||||
|
||||
struct _BlIsdnLine
|
||||
{
|
||||
gint channel;
|
||||
gboolean offhook;
|
||||
gchar *called_number;
|
||||
gchar *calling_number;
|
||||
|
||||
/* used only by BlCcc */
|
||||
BlApp *app;
|
||||
};
|
||||
|
||||
|
||||
GType bl_isdn_get_type (void) G_GNUC_CONST;
|
||||
BlIsdn * bl_isdn_new (BlConfig *config,
|
||||
GError **error);
|
||||
void bl_isdn_call_accept (BlIsdn *isdn,
|
||||
BlIsdnLine *line,
|
||||
const gchar *wamp);
|
||||
void bl_isdn_call_hangup (BlIsdn *isdn,
|
||||
BlIsdnLine *line,
|
||||
BlIsdnReason reason);
|
||||
void bl_isdn_block (BlIsdn *isdn);
|
||||
void bl_isdn_unblock (BlIsdn *isdn);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_ISDN_H__ */
|
|
@ -0,0 +1,163 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "blaccept.h"
|
||||
#include "bllisten.h"
|
||||
|
||||
|
||||
static void bl_listen_class_init (BlListenClass *class);
|
||||
static void bl_listen_init (BlListen *listen);
|
||||
static void bl_listen_finalize (GObject *object);
|
||||
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
GType
|
||||
bl_listen_get_type (void)
|
||||
{
|
||||
static GType listen_type = 0;
|
||||
|
||||
if (!listen_type)
|
||||
{
|
||||
static const GTypeInfo listen_info =
|
||||
{
|
||||
sizeof (BlListenClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) bl_listen_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlListen),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) bl_listen_init,
|
||||
};
|
||||
|
||||
listen_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"BlListen",
|
||||
&listen_info, 0);
|
||||
}
|
||||
|
||||
return listen_type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_listen_class_init (BlListenClass *class)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
|
||||
parent_class = g_type_class_peek_parent (class);
|
||||
|
||||
object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->finalize = bl_listen_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_listen_init (BlListen *listen)
|
||||
{
|
||||
listen->sock = -1;
|
||||
listen->ccc = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_listen_finalize (GObject *object)
|
||||
{
|
||||
BlListen *listen;
|
||||
|
||||
listen = BL_LISTEN (object);
|
||||
|
||||
if (listen->sock > -1)
|
||||
{
|
||||
close (listen->sock);
|
||||
listen->sock = -1;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
BlListen *
|
||||
bl_listen_new (gint port,
|
||||
BlCcc *ccc)
|
||||
{
|
||||
BlListen *listener;
|
||||
struct sockaddr_in addr;
|
||||
gint sock;
|
||||
gint i;
|
||||
|
||||
g_return_val_if_fail (port > 0, NULL);
|
||||
|
||||
if ((sock = socket (PF_INET, SOCK_STREAM, IPPROTO_IP)) != -1)
|
||||
{
|
||||
i = 1;
|
||||
if ((setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, &i, sizeof (i))) == -1)
|
||||
{
|
||||
close (sock);
|
||||
g_warning ("Failed to configure socket: %s", g_strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset (&addr, 0, sizeof (addr));
|
||||
|
||||
addr.sin_family = PF_INET;
|
||||
addr.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
|
||||
addr.sin_port = htons (port);
|
||||
|
||||
if ((bind (sock, (struct sockaddr *) &addr, sizeof (addr))) == -1)
|
||||
{
|
||||
close (sock);
|
||||
g_print ("Failed to bind to socket: %s\n", g_strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_warning ("Failed to open socket: %s", g_strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (listen (sock, 1) != 0)
|
||||
{
|
||||
g_warning ("Failed to put socket into the listening state: %s",
|
||||
g_strerror (errno));
|
||||
close (sock);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
listener = BL_LISTEN (g_object_new (BL_TYPE_LISTEN, NULL));
|
||||
|
||||
listener->sock = sock;
|
||||
listener->ccc = ccc;
|
||||
g_object_add_weak_pointer (G_OBJECT (ccc), (gpointer *) &listener->ccc);
|
||||
|
||||
g_thread_create ((GThreadFunc) bl_accept_new, listener, FALSE, NULL);
|
||||
|
||||
return listener;
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_LISTEN_H__
|
||||
#define __BL_LISTEN_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define BL_TYPE_LISTEN (bl_listen_get_type ())
|
||||
#define BL_LISTEN(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_LISTEN, BlListen))
|
||||
#define BL_LISTEN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_LISTEN, BlListenClass))
|
||||
#define BL_IS_LISTEN(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_LISTEN))
|
||||
#define BL_IS_LISTEN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BL_TYPE_LISTEN))
|
||||
|
||||
typedef struct _BlListenClass BlListenClass;
|
||||
|
||||
struct _BlListenClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
struct _BlListen
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
gint sock;
|
||||
BlCcc *ccc;
|
||||
};
|
||||
|
||||
GType bl_listen_get_type (void) G_GNUC_CONST;
|
||||
BlListen * bl_listen_new (gint port,
|
||||
BlCcc *ccc);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_LISTEN_H__ */
|
|
@ -0,0 +1,215 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "bllogger.h"
|
||||
|
||||
|
||||
#define LOG_INDENT 2
|
||||
|
||||
|
||||
static void bl_logger_class_init (BlLoggerClass *klass);
|
||||
static void bl_logger_init (BlLogger *view);
|
||||
static void bl_logger_finalize (GObject *object);
|
||||
|
||||
static BObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
GType
|
||||
bl_logger_get_type (void)
|
||||
{
|
||||
static GType logger_type = 0;
|
||||
|
||||
if (!logger_type)
|
||||
{
|
||||
static const GTypeInfo logger_info =
|
||||
{
|
||||
sizeof (BlLoggerClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) bl_logger_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlLogger),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) bl_logger_init,
|
||||
};
|
||||
|
||||
logger_type = g_type_register_static (B_TYPE_OBJECT,
|
||||
"BlLogger",
|
||||
&logger_info, 0);
|
||||
}
|
||||
|
||||
return logger_type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_logger_class_init (BlLoggerClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = bl_logger_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_logger_init (BlLogger *logger)
|
||||
{
|
||||
logger->writer = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_logger_finalize (GObject *object)
|
||||
{
|
||||
BlLogger *logger = BL_LOGGER (object);
|
||||
|
||||
if (logger->writer)
|
||||
{
|
||||
b_writer_free (logger->writer);
|
||||
fclose (logger->stream);
|
||||
|
||||
logger->writer = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
BlLogger *
|
||||
bl_logger_new_from_file (const gchar *filename,
|
||||
GError **error)
|
||||
{
|
||||
BlLogger *logger;
|
||||
FILE *stream;
|
||||
|
||||
g_return_val_if_fail (filename != NULL, NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
stream = fopen (filename, "a");
|
||||
if (!stream)
|
||||
{
|
||||
g_set_error (error, 0, 0, g_strerror (errno));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
logger = BL_LOGGER (g_object_new (BL_TYPE_LOGGER,
|
||||
"filename", filename, NULL));
|
||||
|
||||
logger->stream = stream;
|
||||
logger->writer = b_writer_new (stream, LOG_INDENT);
|
||||
|
||||
return logger;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_logger_get_time (BlLogger *logger)
|
||||
{
|
||||
time_t now = time (NULL);
|
||||
struct tm *tm = gmtime (&now);
|
||||
|
||||
g_snprintf (logger->year, 8, "%d", tm->tm_year + 1900);
|
||||
g_snprintf (logger->month, 8, "%d", tm->tm_mon + 1);
|
||||
g_snprintf (logger->day, 8, "%d", tm->tm_mday);
|
||||
g_snprintf (logger->hour, 8, "%d", tm->tm_hour);
|
||||
g_snprintf (logger->minute, 8, "%d", tm->tm_min);
|
||||
g_snprintf (logger->second, 8, "%d", tm->tm_sec);
|
||||
}
|
||||
|
||||
void
|
||||
bl_logger_start_module (BlLogger *logger,
|
||||
BModule *module)
|
||||
{
|
||||
gchar *title;
|
||||
gchar *description;
|
||||
gchar *author;
|
||||
|
||||
g_return_if_fail (BL_IS_LOGGER (logger));
|
||||
g_return_if_fail (B_IS_MODULE (module));
|
||||
|
||||
bl_logger_get_time (logger);
|
||||
|
||||
b_write_open_tag (logger->writer, "start",
|
||||
"tz", "UTC",
|
||||
"year", logger->year,
|
||||
"month", logger->month,
|
||||
"day", logger->day,
|
||||
"hour", logger->hour,
|
||||
"minute", logger->minute,
|
||||
"second", logger->second,
|
||||
NULL);
|
||||
|
||||
b_module_describe (module, &title, &description, &author);
|
||||
|
||||
if (title)
|
||||
{
|
||||
b_write_element (logger->writer, "title", title, NULL);
|
||||
g_free (title);
|
||||
}
|
||||
if (description)
|
||||
{
|
||||
b_write_element (logger->writer, "description", description, NULL);
|
||||
g_free (description);
|
||||
}
|
||||
if (author)
|
||||
{
|
||||
b_write_element (logger->writer, "author", author, NULL);
|
||||
g_free (author);
|
||||
}
|
||||
|
||||
if (B_IS_MOVIE_PLAYER (module))
|
||||
{
|
||||
BMoviePlayer *player = B_MOVIE_PLAYER (module);
|
||||
|
||||
if (player->filename)
|
||||
b_write_element (logger->writer, "filename", player->filename, NULL);
|
||||
}
|
||||
|
||||
b_write_close_tag (logger->writer, "start");
|
||||
|
||||
fflush (logger->stream);
|
||||
}
|
||||
|
||||
void
|
||||
bl_logger_stop (BlLogger *logger)
|
||||
{
|
||||
g_return_if_fail (BL_IS_LOGGER (logger));
|
||||
|
||||
bl_logger_get_time (logger);
|
||||
|
||||
b_write_element (logger->writer, "stop", NULL,
|
||||
"tz", "UTC",
|
||||
"year", logger->year,
|
||||
"month", logger->month,
|
||||
"day", logger->day,
|
||||
"hour", logger->hour,
|
||||
"minute", logger->minute,
|
||||
"second", logger->second,
|
||||
NULL);
|
||||
|
||||
fflush (logger->stream);
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_LOGGER_H__
|
||||
#define __BL_LOGGER_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define BL_TYPE_LOGGER (bl_logger_get_type ())
|
||||
#define BL_LOGGER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_LOGGER, BlLogger))
|
||||
#define BL_LOGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_LOGGER, BlLoggerClass))
|
||||
#define BL_IS_LOGGER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_LOGGER))
|
||||
#define BL_IS_LOGGER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BL_TYPE_LOGGER))
|
||||
|
||||
typedef struct _BlLoggerClass BlLoggerClass;
|
||||
|
||||
struct _BlLoggerClass
|
||||
{
|
||||
BObjectClass parent_class;
|
||||
};
|
||||
|
||||
struct _BlLogger
|
||||
{
|
||||
BObject parent_instance;
|
||||
|
||||
FILE *stream;
|
||||
BWriter *writer;
|
||||
|
||||
gchar year[8];
|
||||
gchar month[8];
|
||||
gchar day[8];
|
||||
gchar hour[8];
|
||||
gchar minute[8];
|
||||
gchar second[8];
|
||||
};
|
||||
|
||||
|
||||
GType bl_logger_get_type (void) G_GNUC_CONST;
|
||||
BlLogger * bl_logger_new_from_file (const gchar *filename,
|
||||
GError **error);
|
||||
void bl_logger_start_module (BlLogger *logger,
|
||||
BModule *module);
|
||||
void bl_logger_stop (BlLogger *logger);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_LOGGER_H__ */
|
|
@ -0,0 +1,344 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "blloveletters.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PARSER_IN_LOVELETTERS = B_PARSER_STATE_USER,
|
||||
PARSER_IN_MOVIE,
|
||||
PARSER_FINISH
|
||||
} ParserState;
|
||||
|
||||
typedef struct _ParserData ParserData;
|
||||
struct _ParserData
|
||||
{
|
||||
gchar *root;
|
||||
GHashTable *hash;
|
||||
};
|
||||
|
||||
|
||||
static void bl_loveletters_class_init (BlLovelettersClass *klass);
|
||||
static void bl_loveletters_init (BlLoveletters *view);
|
||||
static void bl_loveletters_finalize (GObject *object);
|
||||
|
||||
static void bl_loveletter_validate (const gchar *filename,
|
||||
const gchar *id,
|
||||
const gchar *vanity);
|
||||
|
||||
static BParserState parser_start_element (BParserState state,
|
||||
const gchar *name,
|
||||
const gchar **names,
|
||||
const gchar **attribute_values,
|
||||
gpointer user_data,
|
||||
GError **error);
|
||||
static BParserState parser_end_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar *cdata,
|
||||
gsize cdata_len,
|
||||
gpointer user_data,
|
||||
GError **error);
|
||||
|
||||
|
||||
static BObjectClass *parent_class = NULL;
|
||||
|
||||
static const gchar *vanity_codes[] =
|
||||
{
|
||||
"0+",
|
||||
"1",
|
||||
"2abc",
|
||||
"3def",
|
||||
"4ghi",
|
||||
"5jkl",
|
||||
"6mno",
|
||||
"7pqrs",
|
||||
"8tuv",
|
||||
"9wxyz",
|
||||
};
|
||||
|
||||
|
||||
GType
|
||||
bl_loveletters_get_type (void)
|
||||
{
|
||||
static GType loveletters_type = 0;
|
||||
|
||||
if (!loveletters_type)
|
||||
{
|
||||
static const GTypeInfo loveletters_info =
|
||||
{
|
||||
sizeof (BlLovelettersClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) bl_loveletters_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlLoveletters),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) bl_loveletters_init,
|
||||
};
|
||||
|
||||
loveletters_type = g_type_register_static (B_TYPE_OBJECT,
|
||||
"BlLoveletters",
|
||||
&loveletters_info, 0);
|
||||
}
|
||||
|
||||
return loveletters_type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_loveletters_class_init (BlLovelettersClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = bl_loveletters_finalize;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_loveletters_init (BlLoveletters *loveletters)
|
||||
{
|
||||
loveletters->hash = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
g_free, g_free);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_loveletters_finalize (GObject *object)
|
||||
{
|
||||
BlLoveletters *loveletters = BL_LOVELETTERS (object);
|
||||
|
||||
if (loveletters->hash)
|
||||
{
|
||||
g_hash_table_destroy (loveletters->hash);
|
||||
loveletters->hash = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
BlLoveletters *
|
||||
bl_loveletters_new_from_file (const gchar *filename,
|
||||
GError **error)
|
||||
{
|
||||
GIOChannel *io;
|
||||
BlLoveletters *loveletters;
|
||||
BParser *parser;
|
||||
ParserData data;
|
||||
gboolean success;
|
||||
|
||||
g_return_val_if_fail (filename != NULL, NULL);
|
||||
g_return_val_if_fail (g_path_is_absolute (filename), NULL);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
|
||||
|
||||
io = g_io_channel_new_file (filename, "r", error);
|
||||
if (! io)
|
||||
return NULL;
|
||||
|
||||
loveletters = BL_LOVELETTERS (g_object_new (BL_TYPE_LOVELETTERS,
|
||||
"filename", filename,
|
||||
NULL));
|
||||
|
||||
data.hash = loveletters->hash;
|
||||
data.root = g_path_get_dirname (filename);
|
||||
|
||||
parser = b_parser_new (parser_start_element, parser_end_element, &data);
|
||||
|
||||
success = b_parser_parse_io_channel (parser, io, TRUE, error);
|
||||
|
||||
if (success && b_parser_get_state (parser) != PARSER_FINISH)
|
||||
{
|
||||
g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
|
||||
"This doesn't look like a Blinkenlights loveletters file.");
|
||||
success = FALSE;
|
||||
}
|
||||
|
||||
b_parser_free (parser);
|
||||
|
||||
if (!success)
|
||||
{
|
||||
g_object_unref (loveletters);
|
||||
loveletters = NULL;
|
||||
}
|
||||
|
||||
g_free (data.root);
|
||||
|
||||
return loveletters;
|
||||
}
|
||||
|
||||
const gchar *
|
||||
bl_loveletters_lookup (BlLoveletters *loveletters,
|
||||
const gchar *id)
|
||||
{
|
||||
g_return_val_if_fail (BL_IS_LOVELETTERS (loveletters), NULL);
|
||||
|
||||
return g_hash_table_lookup (loveletters->hash, id);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_loveletter_validate (const gchar *filename,
|
||||
const gchar *id,
|
||||
const gchar *vanity)
|
||||
{
|
||||
const gchar *v_code = NULL;
|
||||
gint id_len, v_len, i;
|
||||
|
||||
if (!g_file_test (filename, G_FILE_TEST_EXISTS))
|
||||
g_printerr ("Loveletters-Warning: "
|
||||
"href for '%s' points to nonexistant file.\n", id);
|
||||
|
||||
id_len = id ? strlen (id) : 0;
|
||||
v_len = vanity ? strlen (vanity) : 0;
|
||||
|
||||
if (v_len && id_len != v_len)
|
||||
{
|
||||
g_printerr ("Loveletters-Warning: "
|
||||
"id '%s' has invalid vanity code", id);
|
||||
vanity = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < id_len; i++)
|
||||
{
|
||||
switch (id[i])
|
||||
{
|
||||
case '0' ... '9':
|
||||
v_code = vanity_codes[id[i] - '0'];
|
||||
break;
|
||||
|
||||
default:
|
||||
g_printerr ("Loveletters-Warning: "
|
||||
"id '%s' contains illegal character(s).\n",id);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!vanity)
|
||||
continue;
|
||||
|
||||
if (!strchr (v_code, g_ascii_tolower (vanity[i])))
|
||||
{
|
||||
g_printerr ("Loveletters-Warning: "
|
||||
"id '%s' has invalid vanity code.\n", id);
|
||||
vanity = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static BParserState
|
||||
parser_start_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar **names,
|
||||
const gchar **values,
|
||||
gpointer user_data,
|
||||
GError **error)
|
||||
{
|
||||
ParserData *data = (ParserData *) user_data;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case B_PARSER_STATE_TOPLEVEL:
|
||||
if (! strcmp (element_name, "loveletters"))
|
||||
return PARSER_IN_LOVELETTERS;
|
||||
break;
|
||||
|
||||
case PARSER_IN_LOVELETTERS:
|
||||
if (! strcmp (element_name, "movie"))
|
||||
{
|
||||
const gchar *id = NULL;
|
||||
const gchar *vanity = NULL;
|
||||
const gchar *href = NULL;
|
||||
gchar *filename;
|
||||
gint i;
|
||||
|
||||
for (i = 0; names[i] && values[i]; i++)
|
||||
{
|
||||
if (!id && strcmp (names[i], "id") == 0)
|
||||
id = values[i];
|
||||
if (!vanity && strcmp (names[i], "vanity") == 0)
|
||||
vanity = values[i];
|
||||
if (!href && strcmp (names[i], "href") == 0)
|
||||
href = values[i];
|
||||
}
|
||||
|
||||
if (!id)
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"id attribute is missing for movie element.");
|
||||
break;
|
||||
}
|
||||
if (!href)
|
||||
{
|
||||
g_set_error (error, 0, 0,
|
||||
"href attribute is missing for movie element.");
|
||||
break;
|
||||
}
|
||||
|
||||
if (g_hash_table_lookup (data->hash, id))
|
||||
{
|
||||
g_set_error (error, 0, 0, "id '%s' is not unique.", id);
|
||||
break;
|
||||
}
|
||||
|
||||
filename = b_filename_from_utf8 (href, data->root, error);
|
||||
if (filename)
|
||||
{
|
||||
bl_loveletter_validate (filename, id, vanity);
|
||||
|
||||
g_hash_table_insert (data->hash, g_strdup (id), filename);
|
||||
return PARSER_IN_MOVIE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return B_PARSER_STATE_UNKNOWN;
|
||||
}
|
||||
|
||||
static BParserState
|
||||
parser_end_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar *cdata,
|
||||
gsize cdata_len,
|
||||
gpointer user_data,
|
||||
GError **error)
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case PARSER_IN_LOVELETTERS:
|
||||
return PARSER_FINISH;
|
||||
|
||||
case PARSER_IN_MOVIE:
|
||||
return PARSER_IN_LOVELETTERS;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return B_PARSER_STATE_UNKNOWN;
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_LOVELETTERS_H__
|
||||
#define __BL_LOVELETTERS_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define BL_TYPE_LOVELETTERS (bl_loveletters_get_type ())
|
||||
#define BL_LOVELETTERS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_LOVELETTERS, BlLoveletters))
|
||||
#define BL_LOVELETTERS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_LOVELETTERS, BlLovelettersClass))
|
||||
#define BL_IS_LOVELETTERS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_LOVELETTERS))
|
||||
|
||||
|
||||
typedef struct _BlLovelettersClass BlLovelettersClass;
|
||||
|
||||
struct _BlLovelettersClass
|
||||
{
|
||||
BObjectClass parent_class;
|
||||
};
|
||||
|
||||
struct _BlLoveletters
|
||||
{
|
||||
BObject parent_instance;
|
||||
|
||||
GHashTable *hash;
|
||||
};
|
||||
|
||||
|
||||
GType bl_loveletters_get_type (void) G_GNUC_CONST;
|
||||
BlLoveletters * bl_loveletters_new_from_file (const gchar *filename,
|
||||
GError **error);
|
||||
const gchar * bl_loveletters_lookup (BlLoveletters *loveletters,
|
||||
const gchar *id);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_LOVELETTERS_H__ */
|
|
@ -0,0 +1,132 @@
|
|||
#include "blmarshal.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
#define g_marshal_value_peek_boolean(v) g_value_get_boolean (v)
|
||||
#define g_marshal_value_peek_char(v) g_value_get_char (v)
|
||||
#define g_marshal_value_peek_uchar(v) g_value_get_uchar (v)
|
||||
#define g_marshal_value_peek_int(v) g_value_get_int (v)
|
||||
#define g_marshal_value_peek_uint(v) g_value_get_uint (v)
|
||||
#define g_marshal_value_peek_long(v) g_value_get_long (v)
|
||||
#define g_marshal_value_peek_ulong(v) g_value_get_ulong (v)
|
||||
#define g_marshal_value_peek_int64(v) g_value_get_int64 (v)
|
||||
#define g_marshal_value_peek_uint64(v) g_value_get_uint64 (v)
|
||||
#define g_marshal_value_peek_enum(v) g_value_get_enum (v)
|
||||
#define g_marshal_value_peek_flags(v) g_value_get_flags (v)
|
||||
#define g_marshal_value_peek_float(v) g_value_get_float (v)
|
||||
#define g_marshal_value_peek_double(v) g_value_get_double (v)
|
||||
#define g_marshal_value_peek_string(v) (char*) g_value_get_string (v)
|
||||
#define g_marshal_value_peek_param(v) g_value_get_param (v)
|
||||
#define g_marshal_value_peek_boxed(v) g_value_get_boxed (v)
|
||||
#define g_marshal_value_peek_pointer(v) g_value_get_pointer (v)
|
||||
#define g_marshal_value_peek_object(v) g_value_get_object (v)
|
||||
#else /* !G_ENABLE_DEBUG */
|
||||
/* WARNING: This code accesses GValues directly, which is UNSUPPORTED API.
|
||||
* Do not access GValues directly in your code. Instead, use the
|
||||
* g_value_get_*() functions
|
||||
*/
|
||||
#define g_marshal_value_peek_boolean(v) (v)->data[0].v_int
|
||||
#define g_marshal_value_peek_char(v) (v)->data[0].v_int
|
||||
#define g_marshal_value_peek_uchar(v) (v)->data[0].v_uint
|
||||
#define g_marshal_value_peek_int(v) (v)->data[0].v_int
|
||||
#define g_marshal_value_peek_uint(v) (v)->data[0].v_uint
|
||||
#define g_marshal_value_peek_long(v) (v)->data[0].v_long
|
||||
#define g_marshal_value_peek_ulong(v) (v)->data[0].v_ulong
|
||||
#define g_marshal_value_peek_int64(v) (v)->data[0].v_int64
|
||||
#define g_marshal_value_peek_uint64(v) (v)->data[0].v_uint64
|
||||
#define g_marshal_value_peek_enum(v) (v)->data[0].v_int
|
||||
#define g_marshal_value_peek_flags(v) (v)->data[0].v_uint
|
||||
#define g_marshal_value_peek_float(v) (v)->data[0].v_float
|
||||
#define g_marshal_value_peek_double(v) (v)->data[0].v_double
|
||||
#define g_marshal_value_peek_string(v) (v)->data[0].v_pointer
|
||||
#define g_marshal_value_peek_param(v) (v)->data[0].v_pointer
|
||||
#define g_marshal_value_peek_boxed(v) (v)->data[0].v_pointer
|
||||
#define g_marshal_value_peek_pointer(v) (v)->data[0].v_pointer
|
||||
#define g_marshal_value_peek_object(v) (v)->data[0].v_pointer
|
||||
#endif /* !G_ENABLE_DEBUG */
|
||||
|
||||
|
||||
/* VOID:INT (./blmarshal.list:1) */
|
||||
|
||||
/* VOID:POINTER,INT (./blmarshal.list:2) */
|
||||
void
|
||||
bl_marshal_VOID__POINTER_INT (GClosure *closure,
|
||||
GValue *return_value,
|
||||
guint n_param_values,
|
||||
const GValue *param_values,
|
||||
gpointer invocation_hint,
|
||||
gpointer marshal_data)
|
||||
{
|
||||
typedef void (*GMarshalFunc_VOID__POINTER_INT) (gpointer data1,
|
||||
gpointer arg_1,
|
||||
gint arg_2,
|
||||
gpointer data2);
|
||||
register GMarshalFunc_VOID__POINTER_INT callback;
|
||||
register GCClosure *cc = (GCClosure*) closure;
|
||||
register gpointer data1, data2;
|
||||
|
||||
g_return_if_fail (n_param_values == 3);
|
||||
|
||||
if (G_CCLOSURE_SWAP_DATA (closure))
|
||||
{
|
||||
data1 = closure->data;
|
||||
data2 = g_value_peek_pointer (param_values + 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
data1 = g_value_peek_pointer (param_values + 0);
|
||||
data2 = closure->data;
|
||||
}
|
||||
callback = (GMarshalFunc_VOID__POINTER_INT) (marshal_data ? marshal_data : cc->callback);
|
||||
|
||||
callback (data1,
|
||||
g_marshal_value_peek_pointer (param_values + 1),
|
||||
g_marshal_value_peek_int (param_values + 2),
|
||||
data2);
|
||||
}
|
||||
|
||||
/* VOID:POINTER (./blmarshal.list:3) */
|
||||
|
||||
/* VOID:POINTER,BOOLEAN (./blmarshal.list:4) */
|
||||
void
|
||||
bl_marshal_VOID__POINTER_BOOLEAN (GClosure *closure,
|
||||
GValue *return_value,
|
||||
guint n_param_values,
|
||||
const GValue *param_values,
|
||||
gpointer invocation_hint,
|
||||
gpointer marshal_data)
|
||||
{
|
||||
typedef void (*GMarshalFunc_VOID__POINTER_BOOLEAN) (gpointer data1,
|
||||
gpointer arg_1,
|
||||
gboolean arg_2,
|
||||
gpointer data2);
|
||||
register GMarshalFunc_VOID__POINTER_BOOLEAN callback;
|
||||
register GCClosure *cc = (GCClosure*) closure;
|
||||
register gpointer data1, data2;
|
||||
|
||||
g_return_if_fail (n_param_values == 3);
|
||||
|
||||
if (G_CCLOSURE_SWAP_DATA (closure))
|
||||
{
|
||||
data1 = closure->data;
|
||||
data2 = g_value_peek_pointer (param_values + 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
data1 = g_value_peek_pointer (param_values + 0);
|
||||
data2 = closure->data;
|
||||
}
|
||||
callback = (GMarshalFunc_VOID__POINTER_BOOLEAN) (marshal_data ? marshal_data : cc->callback);
|
||||
|
||||
callback (data1,
|
||||
g_marshal_value_peek_pointer (param_values + 1),
|
||||
g_marshal_value_peek_boolean (param_values + 2),
|
||||
data2);
|
||||
}
|
||||
|
||||
/* VOID:UINT,POINTER (./blmarshal.list:5) */
|
||||
|
||||
/* VOID:VOID (./blmarshal.list:6) */
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
|
||||
#ifndef __bl_marshal_MARSHAL_H__
|
||||
#define __bl_marshal_MARSHAL_H__
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* VOID:INT (./blmarshal.list:1) */
|
||||
#define bl_marshal_VOID__INT g_cclosure_marshal_VOID__INT
|
||||
|
||||
/* VOID:POINTER,INT (./blmarshal.list:2) */
|
||||
extern void bl_marshal_VOID__POINTER_INT (GClosure *closure,
|
||||
GValue *return_value,
|
||||
guint n_param_values,
|
||||
const GValue *param_values,
|
||||
gpointer invocation_hint,
|
||||
gpointer marshal_data);
|
||||
|
||||
/* VOID:POINTER (./blmarshal.list:3) */
|
||||
#define bl_marshal_VOID__POINTER g_cclosure_marshal_VOID__POINTER
|
||||
|
||||
/* VOID:POINTER,BOOLEAN (./blmarshal.list:4) */
|
||||
extern void bl_marshal_VOID__POINTER_BOOLEAN (GClosure *closure,
|
||||
GValue *return_value,
|
||||
guint n_param_values,
|
||||
const GValue *param_values,
|
||||
gpointer invocation_hint,
|
||||
gpointer marshal_data);
|
||||
|
||||
/* VOID:UINT,POINTER (./blmarshal.list:5) */
|
||||
#define bl_marshal_VOID__UINT_POINTER g_cclosure_marshal_VOID__UINT_POINTER
|
||||
|
||||
/* VOID:VOID (./blmarshal.list:6) */
|
||||
#define bl_marshal_VOID__VOID g_cclosure_marshal_VOID__VOID
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __bl_marshal_MARSHAL_H__ */
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
VOID: INT
|
||||
VOID: POINTER, INT
|
||||
VOID: POINTER
|
||||
VOID: POINTER, BOOLEAN
|
||||
VOID: UINT, POINTER
|
||||
VOID: VOID
|
|
@ -0,0 +1,391 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
#include "blloveletters.h"
|
||||
#include "blondemand.h"
|
||||
|
||||
|
||||
#define TICK 250
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
PROP_ADVANCED,
|
||||
PROP_LOVELETTERS
|
||||
};
|
||||
|
||||
static void bl_on_demand_class_init (BlOnDemandClass *class);
|
||||
static void bl_on_demand_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec);
|
||||
static gboolean bl_on_demand_query (gint width,
|
||||
gint height,
|
||||
gint channels,
|
||||
gint maxval);
|
||||
static gboolean bl_on_demand_prepare (BModule *module,
|
||||
GError **error);
|
||||
static void bl_on_demand_relax (BModule *module);
|
||||
static void bl_on_demand_start (BModule *module);
|
||||
static gint bl_on_demand_tick (BModule *module);
|
||||
static void bl_on_demand_event (BModule *module,
|
||||
BModuleEvent *event);
|
||||
static void bl_on_demand_describe (BModule *module,
|
||||
const gchar **title,
|
||||
const gchar **description,
|
||||
const gchar **author);
|
||||
static void bl_on_demand_paint (BModule *module);
|
||||
|
||||
|
||||
static BModuleClass *parent_class = NULL;
|
||||
|
||||
|
||||
GType
|
||||
bl_on_demand_get_type (void)
|
||||
{
|
||||
static GType type = 0;
|
||||
|
||||
if (! type)
|
||||
{
|
||||
static const GTypeInfo info =
|
||||
{
|
||||
sizeof (BlOnDemandClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) bl_on_demand_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlOnDemand),
|
||||
0, /* n_preallocs */
|
||||
NULL /* instance_init */
|
||||
};
|
||||
|
||||
type = g_type_register_static (B_TYPE_MOVIE_PLAYER,
|
||||
"BlOnDemand", &info, 0);
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_on_demand_class_init (BlOnDemandClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
GParamSpec *param_spec;
|
||||
BModuleClass *module_class;
|
||||
BMoviePlayerClass *player_class;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
module_class = B_MODULE_CLASS (klass);
|
||||
player_class = B_MOVIE_PLAYER_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->set_property = bl_on_demand_set_property;
|
||||
|
||||
param_spec = g_param_spec_boolean ("advanced", NULL,
|
||||
"Use advanced features (pause/restart).",
|
||||
FALSE,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_ADVANCED, param_spec);
|
||||
|
||||
param_spec = b_param_spec_filename ("loveletters", NULL,
|
||||
"The filename of the loveletters list.",
|
||||
NULL,
|
||||
G_PARAM_CONSTRUCT | G_PARAM_WRITABLE);
|
||||
g_object_class_install_property (object_class, PROP_LOVELETTERS, param_spec);
|
||||
|
||||
module_class->max_players = 1;
|
||||
|
||||
module_class->query = bl_on_demand_query;
|
||||
module_class->prepare = bl_on_demand_prepare;
|
||||
module_class->relax = bl_on_demand_relax;
|
||||
module_class->start = bl_on_demand_start;
|
||||
module_class->tick = bl_on_demand_tick;
|
||||
module_class->event = bl_on_demand_event;
|
||||
module_class->describe = bl_on_demand_describe;
|
||||
|
||||
player_class->request_stop = parent_class->start; /* loop the movie */
|
||||
}
|
||||
|
||||
static void
|
||||
bl_on_demand_set_property (GObject *object,
|
||||
guint property_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
BlOnDemand *on_demand = BL_ON_DEMAND (object);
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case PROP_ADVANCED:
|
||||
on_demand->advanced = g_value_get_boolean (value);
|
||||
break;
|
||||
case PROP_LOVELETTERS:
|
||||
if (on_demand->filename)
|
||||
g_object_unref (on_demand->filename);
|
||||
on_demand->filename = g_value_dup_string (value);
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
bl_on_demand_query (gint width,
|
||||
gint height,
|
||||
gint channels,
|
||||
gint maxval)
|
||||
{
|
||||
return (width > 2 * MAX_ON_DEMAND_CHARS && height > 3 &&
|
||||
channels == 1 && maxval == 255);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
bl_on_demand_prepare (BModule *module,
|
||||
GError **error)
|
||||
{
|
||||
BlOnDemand *on_demand = BL_ON_DEMAND (module);
|
||||
|
||||
if (!on_demand->filename)
|
||||
{
|
||||
g_set_error (error, 0, 0, "No loveletters file configured");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
B_MOVIE_PLAYER (module)->clear = FALSE;
|
||||
|
||||
on_demand->loveletters =
|
||||
bl_loveletters_new_from_file (on_demand->filename, error);
|
||||
|
||||
on_demand->movie_active = FALSE;
|
||||
on_demand->movie_paused = FALSE;
|
||||
|
||||
return (on_demand->loveletters != NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_on_demand_relax (BModule *module)
|
||||
{
|
||||
BlOnDemand *on_demand = BL_ON_DEMAND (module);
|
||||
|
||||
if (on_demand->loveletters)
|
||||
{
|
||||
g_object_unref (on_demand->loveletters);
|
||||
on_demand->loveletters = NULL;
|
||||
}
|
||||
|
||||
if (on_demand->movie_active)
|
||||
{
|
||||
parent_class->relax (module);
|
||||
on_demand->movie_active = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bl_on_demand_start (BModule *module)
|
||||
{
|
||||
BlOnDemand *on_demand = BL_ON_DEMAND (module);
|
||||
|
||||
on_demand->chars = -1;
|
||||
on_demand->movie_active = FALSE;
|
||||
|
||||
bl_on_demand_paint (module);
|
||||
b_module_ticker_start (module, TICK);
|
||||
}
|
||||
|
||||
static gint
|
||||
bl_on_demand_tick (BModule *module)
|
||||
{
|
||||
BlOnDemand *on_demand = BL_ON_DEMAND (module);
|
||||
|
||||
if (on_demand->movie_active && !on_demand->movie_paused)
|
||||
return parent_class->tick (module);
|
||||
|
||||
if (!on_demand->movie_active)
|
||||
bl_on_demand_paint (module);
|
||||
|
||||
return TICK;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_on_demand_event (BModule *module,
|
||||
BModuleEvent *event)
|
||||
{
|
||||
BlOnDemand *on_demand = BL_ON_DEMAND (module);
|
||||
const gchar *movie;
|
||||
|
||||
/* in DAU mode, ignore keys when a movie has been started */
|
||||
if (!on_demand->advanced && on_demand->movie_active)
|
||||
return;
|
||||
|
||||
if (event->type != B_EVENT_TYPE_KEY)
|
||||
return;
|
||||
|
||||
switch (event->key)
|
||||
{
|
||||
case B_KEY_0 ... B_KEY_9:
|
||||
if (on_demand->chars < 0)
|
||||
return;
|
||||
|
||||
on_demand->code[on_demand->chars] = event->key + '0';
|
||||
on_demand->chars++;
|
||||
|
||||
if (on_demand->chars < MAX_ON_DEMAND_CHARS)
|
||||
break;
|
||||
/* else fallthru */
|
||||
|
||||
case B_KEY_HASH:
|
||||
if (on_demand->movie_active)
|
||||
{
|
||||
on_demand->movie_paused = (on_demand->movie_paused == FALSE);
|
||||
|
||||
if (!on_demand->movie_paused)
|
||||
{
|
||||
b_module_fill (module, 0);
|
||||
parent_class->start (module);
|
||||
}
|
||||
}
|
||||
|
||||
if (on_demand->chars <= 0)
|
||||
return;
|
||||
|
||||
if (on_demand->movie_active)
|
||||
{
|
||||
parent_class->relax (module);
|
||||
on_demand->movie_active = FALSE;
|
||||
}
|
||||
|
||||
on_demand->code[on_demand->chars] = '\0';
|
||||
on_demand->chars = -1;
|
||||
|
||||
movie = bl_loveletters_lookup (on_demand->loveletters, on_demand->code);
|
||||
if (movie)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_object_set (module, "movie", movie, NULL);
|
||||
|
||||
if (parent_class->prepare (module, &error))
|
||||
{
|
||||
g_printerr ("Starting loveletter for ID '%s'.\n",
|
||||
on_demand->code);
|
||||
|
||||
on_demand->movie_active = TRUE;
|
||||
on_demand->movie_paused = FALSE;
|
||||
|
||||
b_module_fill (module, 0);
|
||||
parent_class->start (module);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_printerr ("Error preparing BlOnDemand: %s\n", error->message);
|
||||
g_clear_error (&error);
|
||||
|
||||
on_demand->movie_active = FALSE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_printerr ("No loveletter found for ID '%s'.\n", on_demand->code);
|
||||
}
|
||||
break;
|
||||
|
||||
case B_KEY_ASTERISK:
|
||||
on_demand->chars = 0;
|
||||
if (on_demand->movie_active)
|
||||
{
|
||||
B_MOVIE_PLAYER (module)->current = NULL;
|
||||
on_demand->movie_paused = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
bl_on_demand_paint (module);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_on_demand_describe (BModule *module,
|
||||
const gchar **title,
|
||||
const gchar **description,
|
||||
const gchar **author)
|
||||
{
|
||||
*title = "BlOnDemand";
|
||||
*author = "Sven Neumann";
|
||||
|
||||
if (BL_ON_DEMAND (module)->advanced)
|
||||
*description = "Interactive movie player (advcanced)";
|
||||
else
|
||||
*description = "Interactive movie player (DAU mode)";
|
||||
}
|
||||
|
||||
static void
|
||||
bl_on_demand_paint (BModule *module)
|
||||
{
|
||||
gint n;
|
||||
gint w = module->width / 2;
|
||||
gint h = module->height / 2;
|
||||
gint v = module->maxval / 2;
|
||||
gint l = MIN (w / 2, h / 2);
|
||||
|
||||
b_module_fill (module, 0);
|
||||
|
||||
h--;
|
||||
|
||||
n = BL_ON_DEMAND (module)->chars;
|
||||
|
||||
if (n < 0)
|
||||
{
|
||||
b_module_draw_line (module, w - l, h , w + l, h , v + rand()%v);
|
||||
b_module_draw_line (module, w - l, h - l, w + l, h + l, v + rand()%v);
|
||||
b_module_draw_line (module, w - l, h + l, w + l, h -l , v + rand()%v);
|
||||
}
|
||||
else
|
||||
{
|
||||
guchar *d = module->buffer + (h / 2) * module->width;
|
||||
gint x, i;
|
||||
|
||||
x = w - MAX_ON_DEMAND_CHARS;
|
||||
|
||||
for (i = 0; i < MAX_ON_DEMAND_CHARS; i++, x += 2)
|
||||
d[x] = (i < n) ? module->maxval : module->maxval / 2;
|
||||
}
|
||||
|
||||
if (n > 0 || BL_ON_DEMAND (module)->movie_active)
|
||||
{
|
||||
b_module_draw_line (module,
|
||||
w - l , h + l/2, w + l , h + l/2 , v + rand()%v);
|
||||
b_module_draw_line (module,
|
||||
w - l , h + l , w + l , h + l , v + rand()%v);
|
||||
b_module_draw_line (module,
|
||||
w - l/2, h , w - l/2, h + 3*l/2, v + rand()%v);
|
||||
b_module_draw_line (module,
|
||||
w + l/2, h , w + l/2, h + 3*l/2, v + rand()%v);
|
||||
}
|
||||
|
||||
b_module_paint (module);
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_ON_DEMAND_H__
|
||||
#define __BL_ON_DEMAND_H__
|
||||
|
||||
#define MAX_ON_DEMAND_CHARS 8
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define BL_TYPE_ON_DEMAND (bl_on_demand_get_type ())
|
||||
#define BL_ON_DEMAND(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_ON_DEMAND, BlOnDemand))
|
||||
#define BL_ON_DEMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_ON_DEMAND, BlOnDemandClass))
|
||||
#define BL_IS_ON_DEMAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_ON_DEMAND))
|
||||
#define BL_IS_ON_DEMAND_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BL_TYPE_ON_DEMAND))
|
||||
#define BL_ON_DEMAND_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BL_TYPE_ON_DEMAND, BlOnDemandClass))
|
||||
|
||||
typedef struct _BlOnDemandClass BlOnDemandClass;
|
||||
|
||||
struct _BlOnDemand
|
||||
{
|
||||
BMoviePlayer parent_instance;
|
||||
|
||||
gchar *filename;
|
||||
BlLoveletters *loveletters;
|
||||
|
||||
gboolean advanced;
|
||||
|
||||
gint chars;
|
||||
gchar code[MAX_ON_DEMAND_CHARS + 1];
|
||||
|
||||
gboolean movie_active;
|
||||
gboolean movie_paused;
|
||||
};
|
||||
|
||||
struct _BlOnDemandClass
|
||||
{
|
||||
BMoviePlayerClass parent_class;
|
||||
};
|
||||
|
||||
GType bl_on_demand_get_type (void) G_GNUC_CONST;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_ON_DEMAND_H__ */
|
|
@ -0,0 +1,479 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "blconfig.h"
|
||||
#include "blplaylist.h"
|
||||
#include "blplaylist-parse.h"
|
||||
#include "blplaylistitem.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PARSER_IN_PLAYLIST = B_PARSER_STATE_USER,
|
||||
PARSER_IN_LIST,
|
||||
PARSER_IN_ITEM,
|
||||
PARSER_IN_PARAM,
|
||||
PARSER_FINISH
|
||||
} ParserState;
|
||||
|
||||
typedef struct _ParserData ParserData;
|
||||
|
||||
struct _ParserData
|
||||
{
|
||||
gchar *root;
|
||||
|
||||
GList *playlists;
|
||||
BlConfig *config;
|
||||
guchar *buffer;
|
||||
BModulePaintCallback paint_callback;
|
||||
gpointer paint_data;
|
||||
|
||||
BlPlaylistItem *item;
|
||||
};
|
||||
|
||||
|
||||
static BParserState parser_start_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar **attribute_names,
|
||||
const gchar **attribute_values,
|
||||
gpointer user_data,
|
||||
GError **error);
|
||||
static BParserState parser_end_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar *cdata,
|
||||
gsize cdata_len,
|
||||
gpointer user_data,
|
||||
GError **error);
|
||||
static GType item_parse_attributes (BlPlaylistItem *item,
|
||||
const gchar **names,
|
||||
const gchar **values);
|
||||
|
||||
|
||||
gboolean
|
||||
bl_playlist_parse (BlPlaylist *playlist,
|
||||
BModulePaintCallback paint_callback,
|
||||
gpointer paint_data,
|
||||
GError **error)
|
||||
{
|
||||
BParser *parser;
|
||||
ParserData data = { 0 };
|
||||
GIOChannel *io;
|
||||
const gchar *filename;
|
||||
gboolean retval;
|
||||
|
||||
g_return_val_if_fail (BL_IS_PLAYLIST (playlist), FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
filename = b_object_get_filename (B_OBJECT (playlist));
|
||||
|
||||
g_return_val_if_fail (filename != NULL, FALSE);
|
||||
|
||||
io = g_io_channel_new_file (filename, "r", error);
|
||||
if (! io)
|
||||
return FALSE;
|
||||
|
||||
data.playlists = g_list_prepend (NULL, playlist);
|
||||
data.config = playlist->config;
|
||||
data.buffer = playlist->buffer;
|
||||
data.paint_callback = paint_callback;
|
||||
data.paint_data = paint_data;
|
||||
|
||||
if (g_path_is_absolute (filename))
|
||||
{
|
||||
data.root = g_path_get_dirname (filename);
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *dir = g_get_current_dir ();
|
||||
gchar *tmp = g_build_filename (dir, filename, NULL);
|
||||
|
||||
data.root = g_path_get_dirname (tmp);
|
||||
|
||||
g_free (tmp);
|
||||
g_free (dir);
|
||||
}
|
||||
|
||||
parser = b_parser_new (parser_start_element, parser_end_element, &data);
|
||||
|
||||
retval = b_parser_parse_io_channel (parser, io, TRUE, error);
|
||||
|
||||
if (retval && b_parser_get_state (parser) != PARSER_FINISH)
|
||||
{
|
||||
g_set_error (error, G_MARKUP_ERROR, G_MARKUP_ERROR_INVALID_CONTENT,
|
||||
"This doesn't look like a Blinkenlights playlist");
|
||||
retval = FALSE;
|
||||
}
|
||||
|
||||
b_parser_free (parser);
|
||||
|
||||
g_free (data.root);
|
||||
|
||||
g_io_channel_unref (io);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static inline void
|
||||
parser_prepend_item (ParserData *data,
|
||||
BlPlaylistItem *item)
|
||||
{
|
||||
BlPlaylist *playlist;
|
||||
|
||||
playlist = BL_PLAYLIST (data->playlists->data);
|
||||
|
||||
playlist->items = g_list_prepend (playlist->items, item);
|
||||
}
|
||||
|
||||
static BParserState
|
||||
parser_start_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar **attribute_names,
|
||||
const gchar **attribute_values,
|
||||
gpointer user_data,
|
||||
GError **error)
|
||||
{
|
||||
ParserData *data = (ParserData *) user_data;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case PARSER_IN_PLAYLIST:
|
||||
if (! strcmp (element_name, "item"))
|
||||
{
|
||||
GType module_type;
|
||||
|
||||
data->item = bl_playlist_item_new ();
|
||||
|
||||
module_type = item_parse_attributes (data->item,
|
||||
attribute_names,
|
||||
attribute_values);
|
||||
|
||||
data->item->module = b_module_new (module_type,
|
||||
data->config->width,
|
||||
data->config->height,
|
||||
data->buffer,
|
||||
data->paint_callback,
|
||||
data->paint_data,
|
||||
NULL);
|
||||
if (data->item->module)
|
||||
b_module_set_aspect (data->item->module, data->config->aspect);
|
||||
|
||||
return PARSER_IN_ITEM;
|
||||
}
|
||||
|
||||
if (! strcmp (element_name, "list"))
|
||||
{
|
||||
/* just for storing the effects */
|
||||
data->item = bl_playlist_item_new ();
|
||||
|
||||
/* ignore GType return value */
|
||||
item_parse_attributes (data->item,
|
||||
attribute_names,
|
||||
attribute_values);
|
||||
|
||||
return PARSER_IN_LIST;
|
||||
}
|
||||
|
||||
/* fallthru */
|
||||
|
||||
case B_PARSER_STATE_TOPLEVEL:
|
||||
if (! strcmp (element_name, "playlist"))
|
||||
{
|
||||
BlPlaylist *playlist;
|
||||
BlPlaylistItem *item;
|
||||
|
||||
if (state == PARSER_IN_PLAYLIST)
|
||||
{
|
||||
playlist = bl_playlist_new (data->config);
|
||||
data->playlists = g_list_prepend (data->playlists, playlist);
|
||||
}
|
||||
else
|
||||
{
|
||||
playlist = BL_PLAYLIST (data->playlists->data);
|
||||
}
|
||||
|
||||
/* just for storing the effects */
|
||||
item = bl_playlist_item_new ();
|
||||
|
||||
/* ignore GType return value */
|
||||
item_parse_attributes (item,
|
||||
attribute_names,
|
||||
attribute_values);
|
||||
|
||||
g_object_set_data_full (G_OBJECT (playlist), "effect-item", item,
|
||||
(GDestroyNotify) g_object_unref);
|
||||
|
||||
return PARSER_IN_PLAYLIST;
|
||||
}
|
||||
break;
|
||||
|
||||
case PARSER_IN_ITEM:
|
||||
if (! strcmp (element_name, "param") && data->item->module)
|
||||
{
|
||||
if (!b_parse_param (G_OBJECT (data->item->module), data->root,
|
||||
attribute_names, attribute_values, error))
|
||||
{
|
||||
g_object_unref (data->item->module);
|
||||
data->item->module = NULL;
|
||||
break;
|
||||
}
|
||||
return PARSER_IN_PARAM;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return B_PARSER_STATE_UNKNOWN;
|
||||
}
|
||||
|
||||
static BParserState
|
||||
parser_end_element (BParserState state,
|
||||
const gchar *element_name,
|
||||
const gchar *cdata,
|
||||
gsize cdata_len,
|
||||
gpointer user_data,
|
||||
GError **error)
|
||||
{
|
||||
ParserData *data = (ParserData *) user_data;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case PARSER_IN_PLAYLIST:
|
||||
{
|
||||
BlPlaylist *playlist;
|
||||
BlPlaylistItem *item;
|
||||
|
||||
playlist = BL_PLAYLIST (data->playlists->data);
|
||||
|
||||
playlist->items = g_list_reverse (playlist->items);
|
||||
|
||||
item = g_object_get_data (G_OBJECT (playlist), "effect-item");
|
||||
|
||||
if (item)
|
||||
{
|
||||
bl_playlist_item_apply_effects (BL_PLAYLIST_ITEM (playlist),
|
||||
item->effects,
|
||||
item->loop,
|
||||
item->reverse,
|
||||
item->speed);
|
||||
|
||||
g_object_set_data (G_OBJECT (playlist), "effect-item", NULL);
|
||||
}
|
||||
|
||||
if (g_list_length (data->playlists) == 1)
|
||||
return PARSER_FINISH;
|
||||
|
||||
data->playlists = g_list_remove (data->playlists, playlist);
|
||||
|
||||
if (g_list_length (playlist->items) == 0)
|
||||
{
|
||||
g_object_unref (G_OBJECT (playlist));
|
||||
}
|
||||
else
|
||||
{
|
||||
parser_prepend_item (data, BL_PLAYLIST_ITEM (playlist));
|
||||
}
|
||||
}
|
||||
return PARSER_IN_PLAYLIST;
|
||||
|
||||
case PARSER_IN_LIST:
|
||||
{
|
||||
BlPlaylist *sublist = NULL;
|
||||
|
||||
if (cdata)
|
||||
{
|
||||
gchar *filename;
|
||||
|
||||
filename = b_filename_from_utf8 (cdata, data->root, NULL);
|
||||
|
||||
if (filename)
|
||||
{
|
||||
sublist = bl_playlist_new_from_file (filename,
|
||||
data->config,
|
||||
data->paint_callback,
|
||||
data->paint_data);
|
||||
g_free (filename);
|
||||
|
||||
if (sublist->items == NULL)
|
||||
{
|
||||
g_object_unref (G_OBJECT (sublist));
|
||||
sublist = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sublist)
|
||||
{
|
||||
bl_playlist_item_apply_effects (BL_PLAYLIST_ITEM (sublist),
|
||||
data->item->effects,
|
||||
data->item->loop,
|
||||
data->item->reverse,
|
||||
data->item->speed);
|
||||
|
||||
parser_prepend_item (data, BL_PLAYLIST_ITEM (sublist));
|
||||
}
|
||||
|
||||
g_object_unref (G_OBJECT (data->item));
|
||||
}
|
||||
data->item = NULL;
|
||||
return PARSER_IN_PLAYLIST;
|
||||
|
||||
case PARSER_IN_ITEM:
|
||||
if (data->item->module)
|
||||
{
|
||||
if (data->item->speed != 1.0 || data->item->module->speed != 1.0)
|
||||
{
|
||||
data->item->speed *= data->item->module->speed;
|
||||
|
||||
g_object_set (G_OBJECT (data->item->module),
|
||||
"speed", data->item->speed,
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (B_IS_MOVIE_PLAYER (data->item->module))
|
||||
{
|
||||
BMoviePlayer *player;
|
||||
|
||||
player = B_MOVIE_PLAYER (data->item->module);
|
||||
|
||||
if (data->item->reverse || player->reverse)
|
||||
{
|
||||
data->item->reverse ^= player->reverse;
|
||||
|
||||
player->reverse = data->item->reverse;
|
||||
}
|
||||
}
|
||||
|
||||
parser_prepend_item (data, data->item);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_object_unref (G_OBJECT (data->item));
|
||||
}
|
||||
|
||||
data->item = NULL;
|
||||
return PARSER_IN_PLAYLIST;
|
||||
|
||||
case PARSER_IN_PARAM:
|
||||
return PARSER_IN_ITEM;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return B_PARSER_STATE_UNKNOWN;
|
||||
}
|
||||
|
||||
static BEffectScope
|
||||
parse_effect_scope (const gchar *value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
if (! g_ascii_strcasecmp (value, "left"))
|
||||
return B_EFFECT_SCOPE_LEFT;
|
||||
else if (! g_ascii_strcasecmp (value, "right"))
|
||||
return B_EFFECT_SCOPE_RIGHT;
|
||||
}
|
||||
|
||||
return B_EFFECT_SCOPE_ALL;
|
||||
}
|
||||
|
||||
static GType
|
||||
item_parse_attributes (BlPlaylistItem *item,
|
||||
const gchar **names,
|
||||
const gchar **values)
|
||||
{
|
||||
const gchar *type_name = "BMoviePlayer";
|
||||
gint i;
|
||||
|
||||
for (i = 0; names[i] && values[i]; i++)
|
||||
{
|
||||
if (! strcmp (names[i], "type"))
|
||||
{
|
||||
type_name = values[i];
|
||||
}
|
||||
else if (! strcmp (names[i], "loop"))
|
||||
{
|
||||
gint loop;
|
||||
|
||||
if (b_parse_int (values[i], &loop) && loop > 1)
|
||||
item->loop = loop;
|
||||
}
|
||||
else if (! strcmp (names[i], "reverse"))
|
||||
{
|
||||
item->reverse = TRUE;
|
||||
}
|
||||
else if (! strcmp (names[i], "speed"))
|
||||
{
|
||||
gdouble speed;
|
||||
|
||||
if (b_parse_double (values[i], &speed) &&
|
||||
speed >= 0.1 && speed <= 10)
|
||||
item->speed = speed;
|
||||
}
|
||||
else if (! strcmp (names[i], "invert"))
|
||||
{
|
||||
item->effects->invert = parse_effect_scope (values[i]);
|
||||
}
|
||||
else if (! strcmp (names[i], "hflip"))
|
||||
{
|
||||
item->effects->hflip = parse_effect_scope (values[i]);
|
||||
}
|
||||
else if (! strcmp (names[i], "vflip"))
|
||||
{
|
||||
item->effects->vflip = parse_effect_scope (values[i]);
|
||||
}
|
||||
else if (! strcmp (names[i], "mirror"))
|
||||
{
|
||||
gboolean left = FALSE;
|
||||
gboolean right = FALSE;
|
||||
|
||||
if (! g_ascii_strcasecmp (values[i], "left"))
|
||||
left = TRUE;
|
||||
else if (! g_ascii_strcasecmp (values[i], "right"))
|
||||
right = TRUE;
|
||||
|
||||
if (left || right)
|
||||
{
|
||||
if (left)
|
||||
{
|
||||
item->effects->lmirror = TRUE;
|
||||
item->effects->rmirror = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
item->effects->rmirror = TRUE;
|
||||
item->effects->lmirror = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return g_type_from_name (type_name);
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_PLAYLIST_PARSE_H__
|
||||
#define __BL_PLAYLIST_PARSE_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
gboolean bl_playlist_parse (BlPlaylist *playlist,
|
||||
BModulePaintCallback paint_callback,
|
||||
gpointer paint_data,
|
||||
GError **error);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
#endif /* __BL_PLAYLIST_PARSE_H__ */
|
|
@ -0,0 +1,401 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
#include "blconfig.h"
|
||||
#include "blplaylist.h"
|
||||
#include "blplaylist-parse.h"
|
||||
|
||||
|
||||
static void bl_playlist_class_init (BlPlaylistClass *klass);
|
||||
static void bl_playlist_init (BlPlaylist *playlist);
|
||||
static void bl_playlist_finalize (GObject *object);
|
||||
|
||||
static gchar * bl_playlist_describe (BlPlaylistItem *item);
|
||||
static void bl_playlist_apply_effects (BlPlaylistItem *item,
|
||||
BEffects *effects,
|
||||
gint loop,
|
||||
gboolean reverse,
|
||||
gdouble speed);
|
||||
|
||||
|
||||
static BlPlaylistItemClass *parent_class = NULL;
|
||||
|
||||
|
||||
GType
|
||||
bl_playlist_get_type (void)
|
||||
{
|
||||
static GType playlist_type = 0;
|
||||
|
||||
if (!playlist_type)
|
||||
{
|
||||
static const GTypeInfo playlist_info =
|
||||
{
|
||||
sizeof (BlPlaylistClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) bl_playlist_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlPlaylist),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) bl_playlist_init,
|
||||
};
|
||||
|
||||
playlist_type = g_type_register_static (BL_TYPE_PLAYLIST_ITEM,
|
||||
"BlPlaylist",
|
||||
&playlist_info, 0);
|
||||
}
|
||||
|
||||
return playlist_type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_playlist_class_init (BlPlaylistClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
BlPlaylistItemClass *item_class;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
item_class = BL_PLAYLIST_ITEM_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = bl_playlist_finalize;
|
||||
|
||||
item_class->describe = bl_playlist_describe;
|
||||
item_class->apply_effects = bl_playlist_apply_effects;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_playlist_init (BlPlaylist *playlist)
|
||||
{
|
||||
playlist->config = NULL;
|
||||
playlist->buffer = NULL;
|
||||
playlist->items = NULL;
|
||||
playlist->current = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_playlist_finalize (GObject *object)
|
||||
{
|
||||
BlPlaylist *playlist;
|
||||
|
||||
playlist = BL_PLAYLIST (object);
|
||||
|
||||
g_list_foreach (playlist->items, (GFunc) g_object_unref, NULL);
|
||||
g_list_free (playlist->items);
|
||||
|
||||
playlist->items = NULL;
|
||||
playlist->current = NULL;
|
||||
|
||||
if (playlist->config)
|
||||
{
|
||||
g_object_unref (playlist->config);
|
||||
playlist->config = NULL;
|
||||
}
|
||||
if (playlist->buffer)
|
||||
{
|
||||
g_free (playlist->buffer);
|
||||
playlist->buffer = NULL;
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
BlPlaylist *
|
||||
bl_playlist_new (BlConfig *config)
|
||||
{
|
||||
BlPlaylist *playlist;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CONFIG (config), NULL);
|
||||
|
||||
playlist = g_object_new (BL_TYPE_PLAYLIST, NULL);
|
||||
|
||||
playlist->config = g_object_ref (config);
|
||||
playlist->buffer = g_new0 (guchar, config->width * config->height);
|
||||
|
||||
return playlist;
|
||||
}
|
||||
|
||||
BlPlaylist *
|
||||
bl_playlist_new_from_file (const gchar *filename,
|
||||
BlConfig *config,
|
||||
BModulePaintCallback paint_callback,
|
||||
gpointer paint_data)
|
||||
{
|
||||
BlPlaylist *playlist;
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_val_if_fail (filename != NULL, NULL);
|
||||
g_return_val_if_fail (BL_IS_CONFIG (config), NULL);
|
||||
g_return_val_if_fail (paint_callback != NULL, NULL);
|
||||
|
||||
if (! g_file_test (filename, G_FILE_TEST_IS_REGULAR))
|
||||
{
|
||||
g_printerr ("Playlist '%s' does not exist or is not a regular file\n",
|
||||
filename);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
playlist = bl_playlist_new (config);
|
||||
|
||||
b_object_set_filename (B_OBJECT (playlist), filename);
|
||||
|
||||
if (! bl_playlist_parse (playlist, paint_callback, paint_data, &error))
|
||||
{
|
||||
g_printerr ("Failed to parse playlist '%s': %s\n",
|
||||
b_object_get_name (B_OBJECT (playlist)), error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_printerr ("Successfully loaded playlist '%s' with %d items\n",
|
||||
b_object_get_name (B_OBJECT (playlist)),
|
||||
g_list_length (playlist->items));
|
||||
}
|
||||
|
||||
return playlist;
|
||||
}
|
||||
|
||||
static BlPlaylistItem *
|
||||
bl_playlist_load_item_internal (BlPlaylistItem *item)
|
||||
{
|
||||
if (BL_IS_PLAYLIST (item))
|
||||
return bl_playlist_load_next_item (BL_PLAYLIST (item), FALSE);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
BlPlaylistItem *
|
||||
bl_playlist_load_next_item (BlPlaylist *playlist,
|
||||
gboolean wrap_around)
|
||||
{
|
||||
BlPlaylistItem *item;
|
||||
BlPlaylistItem *return_item;
|
||||
GList *list;
|
||||
|
||||
g_return_val_if_fail (BL_IS_PLAYLIST (playlist), NULL);
|
||||
|
||||
if (playlist->current)
|
||||
{
|
||||
item = (BlPlaylistItem *) playlist->current->data;
|
||||
|
||||
if (BL_IS_PLAYLIST (item))
|
||||
{
|
||||
return_item = bl_playlist_load_item_internal (item);
|
||||
|
||||
if (return_item)
|
||||
return return_item;
|
||||
}
|
||||
|
||||
item->count++;
|
||||
|
||||
if (item->loop > item->count)
|
||||
{
|
||||
return_item = bl_playlist_load_item_internal (item);
|
||||
|
||||
if (return_item)
|
||||
return return_item;
|
||||
}
|
||||
|
||||
item->count = 0;
|
||||
|
||||
list = g_list_next (playlist->current);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = playlist->items;
|
||||
}
|
||||
|
||||
for (; list; list = g_list_next (list))
|
||||
{
|
||||
item = (BlPlaylistItem *) list->data;
|
||||
|
||||
return_item = bl_playlist_load_item_internal (item);
|
||||
|
||||
if (return_item)
|
||||
{
|
||||
playlist->current = list;
|
||||
return return_item;
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* dirty HACK
|
||||
so that I can go back to the party and drown myself in alcohol */
|
||||
wrap_around = TRUE;
|
||||
#endif
|
||||
|
||||
if (wrap_around)
|
||||
{
|
||||
/* start from the beginning */
|
||||
|
||||
for (list = playlist->items; list; list = g_list_next (list))
|
||||
{
|
||||
item = (BlPlaylistItem *) list->data;
|
||||
|
||||
return_item = bl_playlist_load_item_internal (item);
|
||||
|
||||
if (return_item)
|
||||
{
|
||||
playlist->current = list;
|
||||
return return_item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
playlist->current = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static BlPlaylistItem *
|
||||
bl_playlist_peek_item_internal (BlPlaylistItem *item)
|
||||
{
|
||||
if (BL_IS_PLAYLIST (item))
|
||||
return bl_playlist_peek_next_item (BL_PLAYLIST (item), FALSE);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
BlPlaylistItem *
|
||||
bl_playlist_peek_next_item (BlPlaylist *playlist,
|
||||
gboolean wrap_around)
|
||||
{
|
||||
BlPlaylistItem *item;
|
||||
BlPlaylistItem *return_item;
|
||||
GList *list;
|
||||
|
||||
g_return_val_if_fail (BL_IS_PLAYLIST (playlist), NULL);
|
||||
|
||||
if (playlist->current)
|
||||
{
|
||||
item = (BlPlaylistItem *) playlist->current->data;
|
||||
|
||||
if (BL_IS_PLAYLIST (item))
|
||||
{
|
||||
return_item = bl_playlist_peek_item_internal (item);
|
||||
|
||||
if (return_item)
|
||||
return return_item;
|
||||
}
|
||||
|
||||
if (item->loop > (item->count + 1))
|
||||
{
|
||||
return_item = bl_playlist_peek_item_internal (item);
|
||||
|
||||
if (return_item)
|
||||
return return_item;
|
||||
}
|
||||
|
||||
list = g_list_next (playlist->current);
|
||||
}
|
||||
else
|
||||
{
|
||||
list = playlist->items;
|
||||
}
|
||||
|
||||
for (; list; list = g_list_next (list))
|
||||
{
|
||||
item = (BlPlaylistItem *) list->data;
|
||||
|
||||
return_item = bl_playlist_peek_item_internal (item);
|
||||
|
||||
if (return_item)
|
||||
return return_item;
|
||||
}
|
||||
|
||||
if (wrap_around)
|
||||
{
|
||||
/* start from the beginning */
|
||||
|
||||
for (list = playlist->items; list; list = g_list_next (list))
|
||||
{
|
||||
item = (BlPlaylistItem *) list->data;
|
||||
|
||||
return_item = bl_playlist_peek_item_internal (item);
|
||||
|
||||
if (return_item)
|
||||
return return_item;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
static gchar *
|
||||
bl_playlist_describe (BlPlaylistItem *item)
|
||||
{
|
||||
BlPlaylist *playlist;
|
||||
BlPlaylistItem *child;
|
||||
GList *list;
|
||||
GString *str;
|
||||
gchar *tmp;
|
||||
|
||||
playlist = BL_PLAYLIST (item);
|
||||
|
||||
str = g_string_new (NULL);
|
||||
g_string_printf (str, "Playlist '%s':\n",
|
||||
b_object_get_name (B_OBJECT (playlist)));
|
||||
|
||||
for (list = playlist->items; list; list = g_list_next (list))
|
||||
{
|
||||
child = (BlPlaylistItem *) list->data;
|
||||
|
||||
tmp = bl_playlist_item_describe (child);
|
||||
g_string_append_printf (str, " %s\n", tmp);
|
||||
g_free (tmp);
|
||||
}
|
||||
|
||||
return g_string_free (str, FALSE);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_playlist_apply_effects (BlPlaylistItem *item,
|
||||
BEffects *effects,
|
||||
gint loop,
|
||||
gboolean reverse,
|
||||
gdouble speed)
|
||||
{
|
||||
BlPlaylist *playlist;
|
||||
BlPlaylistItem *child;
|
||||
GList *list;
|
||||
|
||||
playlist = BL_PLAYLIST (item);
|
||||
|
||||
BL_PLAYLIST_ITEM_CLASS (parent_class)->apply_effects (item, effects,
|
||||
loop, reverse, speed);
|
||||
|
||||
for (list = playlist->items; list; list = g_list_next (list))
|
||||
{
|
||||
child = (BlPlaylistItem *) list->data;
|
||||
|
||||
bl_playlist_item_apply_effects (child, effects, 0, reverse, speed);
|
||||
}
|
||||
|
||||
if (reverse)
|
||||
playlist->items = g_list_reverse (playlist->items);
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_PLAYLIST_H__
|
||||
#define __BL_PLAYLIST_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#include "blplaylistitem.h"
|
||||
|
||||
|
||||
#define BL_TYPE_PLAYLIST (bl_playlist_get_type ())
|
||||
#define BL_PLAYLIST(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_PLAYLIST, BlPlaylist))
|
||||
#define BL_PLAYLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_PLAYLIST, BlPlaylistClass))
|
||||
#define BL_IS_PLAYLIST(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_PLAYLIST))
|
||||
#define BL_IS_PLAYLIST_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BL_TYPE_PLAYLIST))
|
||||
|
||||
|
||||
typedef struct _BlPlaylistClass BlPlaylistClass;
|
||||
|
||||
struct _BlPlaylist
|
||||
{
|
||||
BlPlaylistItem parent_instance;
|
||||
|
||||
BlConfig *config;
|
||||
|
||||
guchar *buffer;
|
||||
|
||||
GList *items;
|
||||
GList *current;
|
||||
};
|
||||
|
||||
struct _BlPlaylistClass
|
||||
{
|
||||
BlPlaylistItemClass parent_class;
|
||||
};
|
||||
|
||||
|
||||
GType bl_playlist_get_type (void) G_GNUC_CONST;
|
||||
BlPlaylist * bl_playlist_new (BlConfig *config);
|
||||
BlPlaylist * bl_playlist_new_from_file (const gchar *filename,
|
||||
BlConfig *config,
|
||||
BModulePaintCallback paint_callback,
|
||||
gpointer paint_data);
|
||||
BlPlaylistItem * bl_playlist_load_next_item (BlPlaylist *playlist,
|
||||
gboolean wrap_around);
|
||||
|
||||
#if 0
|
||||
BlPlaylistItem * bl_playlist_peek_next_item (BlPlaylist *playlist,
|
||||
gboolean wrap_around);
|
||||
#endif
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_PLAYLIST_H__ */
|
|
@ -0,0 +1,202 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "blplaylistitem.h"
|
||||
|
||||
|
||||
static void bl_playlist_item_class_init (BlPlaylistItemClass *klass);
|
||||
static void bl_playlist_item_init (BlPlaylistItem *item);
|
||||
static void bl_playlist_item_finalize (GObject *object);
|
||||
|
||||
static gchar * bl_playlist_item_real_describe (BlPlaylistItem *item);
|
||||
static void bl_playlist_item_real_apply_effects (BlPlaylistItem *item,
|
||||
BEffects *effects,
|
||||
gint loop,
|
||||
gboolean reverse,
|
||||
gdouble speed);
|
||||
|
||||
|
||||
static BObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
GType
|
||||
bl_playlist_item_get_type (void)
|
||||
{
|
||||
static GType item_type = 0;
|
||||
|
||||
if (! item_type)
|
||||
{
|
||||
static const GTypeInfo item_info =
|
||||
{
|
||||
sizeof (BlPlaylistItemClass),
|
||||
NULL, /* base_init */
|
||||
NULL, /* base_finalize */
|
||||
(GClassInitFunc) bl_playlist_item_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlPlaylistItem),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) bl_playlist_item_init,
|
||||
};
|
||||
|
||||
item_type = g_type_register_static (B_TYPE_OBJECT,
|
||||
"BlPlaylistItem",
|
||||
&item_info, 0);
|
||||
}
|
||||
|
||||
return item_type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_playlist_item_class_init (BlPlaylistItemClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
object_class->finalize = bl_playlist_item_finalize;
|
||||
|
||||
klass->describe = bl_playlist_item_real_describe;
|
||||
klass->apply_effects = bl_playlist_item_real_apply_effects;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_playlist_item_init (BlPlaylistItem *item)
|
||||
{
|
||||
item->module = NULL;
|
||||
item->effects = b_effects_new ();
|
||||
item->loop = 0;
|
||||
item->count = 0;
|
||||
item->reverse = FALSE;
|
||||
item->speed = 1.0;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_playlist_item_finalize (GObject *object)
|
||||
{
|
||||
BlPlaylistItem *item;
|
||||
|
||||
item = BL_PLAYLIST_ITEM (object);
|
||||
|
||||
if (item->module)
|
||||
g_object_unref (item->module);
|
||||
|
||||
if (item->effects)
|
||||
g_object_unref (item->effects);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static gchar *
|
||||
bl_playlist_item_real_describe (BlPlaylistItem *item)
|
||||
{
|
||||
GString *str;
|
||||
|
||||
g_return_val_if_fail (BL_IS_PLAYLIST_ITEM (item), NULL);
|
||||
|
||||
str = g_string_new (NULL);
|
||||
|
||||
g_string_printf (str, "'%s'",
|
||||
g_type_name (G_TYPE_FROM_INSTANCE (item->module)));
|
||||
|
||||
if (B_IS_MOVIE_PLAYER (item->module))
|
||||
{
|
||||
if (B_MOVIE_PLAYER (item->module)->movie)
|
||||
{
|
||||
g_string_append_printf (str, " (%s)",
|
||||
b_object_get_name (B_OBJECT (B_MOVIE_PLAYER (item->module)->movie)));
|
||||
}
|
||||
else
|
||||
{
|
||||
g_string_append_printf (str, " (%s)",
|
||||
B_MOVIE_PLAYER (item->module)->filename);
|
||||
}
|
||||
}
|
||||
|
||||
if (item->loop > 1)
|
||||
g_string_append_printf (str, " (%dx)", item->loop);
|
||||
|
||||
return g_string_free (str, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
bl_playlist_item_real_apply_effects (BlPlaylistItem *item,
|
||||
BEffects *effects,
|
||||
gint loop,
|
||||
gboolean reverse,
|
||||
gdouble speed)
|
||||
{
|
||||
item->effects->invert ^= effects->invert;
|
||||
item->effects->vflip ^= effects->vflip;
|
||||
item->effects->hflip ^= effects->hflip;
|
||||
item->effects->lmirror ^= effects->lmirror;
|
||||
item->effects->rmirror ^= effects->rmirror;
|
||||
|
||||
if (loop > 0)
|
||||
item->loop = loop;
|
||||
|
||||
item->reverse ^= reverse;
|
||||
item->speed *= speed;
|
||||
|
||||
if (item->module)
|
||||
{
|
||||
g_object_set (G_OBJECT (item->module), "speed", item->speed, NULL);
|
||||
|
||||
if (B_IS_MOVIE_PLAYER (item->module))
|
||||
B_MOVIE_PLAYER (item->module)->reverse = item->reverse;
|
||||
}
|
||||
}
|
||||
|
||||
BlPlaylistItem *
|
||||
bl_playlist_item_new (void)
|
||||
{
|
||||
BlPlaylistItem *item;
|
||||
|
||||
item = g_object_new (BL_TYPE_PLAYLIST_ITEM, NULL);
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
gchar *
|
||||
bl_playlist_item_describe (BlPlaylistItem *item)
|
||||
{
|
||||
g_return_val_if_fail (BL_IS_PLAYLIST_ITEM (item), NULL);
|
||||
|
||||
return BL_PLAYLIST_ITEM_GET_CLASS (item)->describe (item);
|
||||
}
|
||||
|
||||
void
|
||||
bl_playlist_item_apply_effects (BlPlaylistItem *item,
|
||||
BEffects *effects,
|
||||
gint loop,
|
||||
gboolean reverse,
|
||||
gdouble speed)
|
||||
{
|
||||
g_return_if_fail (BL_IS_PLAYLIST_ITEM (item));
|
||||
g_return_if_fail (B_IS_EFFECTS (effects));
|
||||
|
||||
BL_PLAYLIST_ITEM_GET_CLASS (item)->apply_effects (item, effects,
|
||||
loop, reverse, speed);
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_PLAYLIST_ITEM_H__
|
||||
#define __BL_PLAYLIST_ITEM_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
#define BL_TYPE_PLAYLIST_ITEM (bl_playlist_item_get_type ())
|
||||
#define BL_PLAYLIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_PLAYLIST_ITEM, BlPlaylistItem))
|
||||
#define BL_PLAYLIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_PLAYLIST_ITEM, BlPlaylistItemClass))
|
||||
#define BL_IS_PLAYLIST_ITEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_PLAYLIST_ITEM))
|
||||
#define BL_IS_PLAYLIST_ITEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BL_TYPE_PLAYLIST_ITEM))
|
||||
#define BL_PLAYLIST_ITEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BL_TYPE_PLAYLIST_ITEM, BlPlaylistItemClass))
|
||||
|
||||
|
||||
typedef struct _BlPlaylistItemClass BlPlaylistItemClass;
|
||||
|
||||
struct _BLPlaylistItem
|
||||
{
|
||||
BObject parent_instance;
|
||||
|
||||
BModule *module;
|
||||
BEffects *effects;
|
||||
gint count;
|
||||
gint loop;
|
||||
gboolean reverse;
|
||||
gdouble speed;
|
||||
};
|
||||
|
||||
struct _BlPlaylistItemClass
|
||||
{
|
||||
BObjectClass parent_class;
|
||||
|
||||
/* virtual functions */
|
||||
gchar * (* describe) (BlPlaylistItem *item);
|
||||
void (* apply_effects) (BlPlaylistItem *item,
|
||||
BEffects *effects,
|
||||
gint loop,
|
||||
gboolean reverse,
|
||||
gdouble speed);
|
||||
};
|
||||
|
||||
|
||||
GType bl_playlist_item_get_type (void) G_GNUC_CONST;
|
||||
BlPlaylistItem * bl_playlist_item_new (void);
|
||||
|
||||
gchar * bl_playlist_item_describe (BlPlaylistItem *item);
|
||||
void bl_playlist_item_apply_effects (BlPlaylistItem *item,
|
||||
BEffects *effects,
|
||||
gint loop,
|
||||
gboolean reverse,
|
||||
gdouble speed);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_PLAYLIST_ITEM_H__ */
|
|
@ -0,0 +1,567 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "blmarshal.h"
|
||||
#include "blconfig.h"
|
||||
#include "bllogger.h"
|
||||
#include "blplaylist.h"
|
||||
#include "blplaylistitem.h"
|
||||
#include "bltheater.h"
|
||||
|
||||
|
||||
enum
|
||||
{
|
||||
ITEM_FINISHED,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
static void bl_theater_class_init (BlTheaterClass *klass);
|
||||
static void bl_theater_init (BlTheater *view);
|
||||
static void bl_theater_finalize (GObject *object);
|
||||
|
||||
static void bl_theater_set_item_internal (BlTheater *theater,
|
||||
BlPlaylistItem *item);
|
||||
static void bl_theater_set_frame_data_internal (BlTheater *theater,
|
||||
const guchar *data);
|
||||
static void bl_theater_item_finished (BlTheater *theater,
|
||||
gboolean relax);
|
||||
static void bl_theater_stop_callback (BModule *module,
|
||||
BlTheater *theater);
|
||||
|
||||
|
||||
static guint bl_theater_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static GObjectClass *parent_class = NULL;
|
||||
|
||||
|
||||
GType
|
||||
bl_theater_get_type (void)
|
||||
{
|
||||
static GType theater_type = 0;
|
||||
|
||||
if (!theater_type)
|
||||
{
|
||||
static const GTypeInfo theater_info =
|
||||
{
|
||||
sizeof (BlTheaterClass),
|
||||
(GBaseInitFunc) NULL,
|
||||
(GBaseFinalizeFunc) NULL,
|
||||
(GClassInitFunc) bl_theater_class_init,
|
||||
NULL, /* class_finalize */
|
||||
NULL, /* class_data */
|
||||
sizeof (BlTheater),
|
||||
0, /* n_preallocs */
|
||||
(GInstanceInitFunc) bl_theater_init,
|
||||
};
|
||||
|
||||
theater_type = g_type_register_static (G_TYPE_OBJECT,
|
||||
"BlTheater",
|
||||
&theater_info, 0);
|
||||
}
|
||||
|
||||
return theater_type;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_theater_class_init (BlTheaterClass *klass)
|
||||
{
|
||||
GObjectClass *object_class;
|
||||
|
||||
object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
parent_class = g_type_class_peek_parent (klass);
|
||||
|
||||
bl_theater_signals[ITEM_FINISHED] =
|
||||
g_signal_new ("item_finished",
|
||||
G_TYPE_FROM_CLASS (klass),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
G_STRUCT_OFFSET (BlTheaterClass, item_finished),
|
||||
NULL, NULL,
|
||||
bl_marshal_VOID__POINTER_BOOLEAN,
|
||||
G_TYPE_NONE, 2, G_TYPE_POINTER, G_TYPE_BOOLEAN);
|
||||
|
||||
object_class->finalize = bl_theater_finalize;
|
||||
|
||||
klass->item_finished = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_theater_init (BlTheater *theater)
|
||||
{
|
||||
theater->width = 0;
|
||||
theater->height = 0;
|
||||
|
||||
theater->stop_signal_id = 0;
|
||||
|
||||
theater->item = NULL;
|
||||
theater->item_stack = NULL;
|
||||
|
||||
theater->effects = NULL;
|
||||
theater->sender = b_sender_new ();
|
||||
theater->item_buffer = NULL;
|
||||
theater->frame_buffer = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
bl_theater_finalize (GObject *object)
|
||||
{
|
||||
BlTheater *theater;
|
||||
|
||||
theater = BL_THEATER (object);
|
||||
|
||||
bl_theater_pause (theater);
|
||||
|
||||
if (theater->item)
|
||||
g_object_unref (theater->item);
|
||||
|
||||
if (theater->item_stack)
|
||||
{
|
||||
g_list_foreach (theater->item_stack, (GFunc) g_object_unref, NULL);
|
||||
g_list_free (theater->item_stack);
|
||||
}
|
||||
|
||||
if (theater->effects)
|
||||
g_object_unref (theater->effects);
|
||||
|
||||
if (theater->sender)
|
||||
g_object_unref (theater->sender);
|
||||
|
||||
if (theater->item_buffer)
|
||||
g_free (theater->item_buffer);
|
||||
|
||||
if (theater->frame_buffer)
|
||||
g_free (theater->frame_buffer);
|
||||
|
||||
if (theater->logger)
|
||||
{
|
||||
bl_logger_stop (theater->logger);
|
||||
g_object_unref (theater->logger);
|
||||
}
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
void
|
||||
bl_theater_play (BlTheater *theater)
|
||||
{
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
|
||||
if (! theater->stop_signal_id && theater->item)
|
||||
{
|
||||
theater->stop_signal_id =
|
||||
g_signal_connect (G_OBJECT (theater->item->module), "stop",
|
||||
G_CALLBACK (bl_theater_stop_callback),
|
||||
theater);
|
||||
|
||||
b_module_start (theater->item->module);
|
||||
|
||||
if (theater->logger)
|
||||
bl_logger_start_module (theater->logger, theater->item->module);
|
||||
|
||||
{
|
||||
gchar *desc;
|
||||
|
||||
desc = bl_playlist_item_describe (theater->item);
|
||||
g_print ("started item: %s\n", desc);
|
||||
g_free (desc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
bl_theater_pause (BlTheater *theater)
|
||||
{
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
|
||||
if (theater->stop_signal_id && theater->item)
|
||||
{
|
||||
g_signal_handler_disconnect (G_OBJECT (theater->item->module),
|
||||
theater->stop_signal_id);
|
||||
theater->stop_signal_id = 0;
|
||||
|
||||
b_module_stop (theater->item->module);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
bl_theater_finish (BlTheater *theater)
|
||||
{
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
|
||||
if (theater->item)
|
||||
{
|
||||
bl_theater_pause (theater);
|
||||
bl_theater_item_finished (theater, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
bl_theater_kill (BlTheater *theater)
|
||||
{
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
|
||||
bl_theater_pause (theater);
|
||||
bl_theater_set_frame_data (theater, NULL);
|
||||
|
||||
if (theater->logger)
|
||||
bl_logger_stop (theater->logger);
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_theater_is_playing (BlTheater *theater)
|
||||
{
|
||||
g_return_val_if_fail (BL_IS_THEATER (theater), FALSE);
|
||||
|
||||
return (theater->stop_signal_id > 0);
|
||||
}
|
||||
|
||||
void
|
||||
bl_theater_event (BlTheater *theater,
|
||||
BModuleEvent *event)
|
||||
{
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
g_return_if_fail (event != NULL);
|
||||
|
||||
if (theater->item)
|
||||
b_module_event (theater->item->module, event);
|
||||
}
|
||||
|
||||
void
|
||||
bl_theater_set_frame_data (BlTheater *theater,
|
||||
const guchar *data)
|
||||
{
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
|
||||
if (theater->stop_signal_id)
|
||||
g_warning ("Someone tried to set frame data while a movie is running.");
|
||||
else
|
||||
bl_theater_set_frame_data_internal (theater, data);
|
||||
}
|
||||
|
||||
BlTheater *
|
||||
bl_theater_new (BlConfig *config)
|
||||
{
|
||||
BlTheater *theater;
|
||||
GList *list;
|
||||
GError *error = NULL;
|
||||
gint added_recipients = 0;
|
||||
|
||||
g_return_val_if_fail (BL_IS_CONFIG (config), NULL);
|
||||
|
||||
theater = BL_THEATER (g_object_new (BL_TYPE_THEATER, NULL));
|
||||
|
||||
theater->width = config->width;
|
||||
theater->height = config->height;
|
||||
|
||||
if (! b_sender_configure (theater->sender,
|
||||
config->width, config->height,
|
||||
config->channels, config->maxval))
|
||||
{
|
||||
g_object_unref (G_OBJECT (theater));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
for (list = config->recipients; list; list = list->next)
|
||||
{
|
||||
if (! bl_theater_add_recipient (theater, list->data, &error))
|
||||
{
|
||||
g_printerr ("Failed to add recipient: %s\n", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
else
|
||||
{
|
||||
added_recipients++;
|
||||
}
|
||||
}
|
||||
|
||||
if (added_recipients == 0)
|
||||
g_printerr ("No initial recipients, starting anyway ...\n");
|
||||
else
|
||||
g_printerr ("Sending to %d recipients ...\n", added_recipients);
|
||||
|
||||
theater->item_buffer = g_new0 (guchar, theater->width * theater->height);
|
||||
theater->frame_buffer = g_new0 (guchar, theater->width * theater->height);
|
||||
|
||||
if (config->logfile)
|
||||
theater->logger = bl_logger_new_from_file (config->logfile, NULL);
|
||||
|
||||
return theater;
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_theater_add_recipient (BlTheater *theater,
|
||||
const gchar *hostname,
|
||||
GError **error)
|
||||
{
|
||||
gchar *host;
|
||||
gchar *colon;
|
||||
gint port = MCU_LISTENER_PORT;
|
||||
gboolean retval;
|
||||
|
||||
g_return_val_if_fail (BL_IS_THEATER (theater), FALSE);
|
||||
g_return_val_if_fail (hostname != NULL, FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
host = g_strdup (hostname);
|
||||
|
||||
if ((colon = strrchr (host, ':')))
|
||||
{
|
||||
b_parse_int (colon + 1, &port);
|
||||
*colon = '\0';
|
||||
}
|
||||
|
||||
retval = b_sender_add_recipient (theater->sender, host, port, error);
|
||||
|
||||
g_free (host);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_theater_remove_recipient (BlTheater *theater,
|
||||
const gchar *hostname,
|
||||
GError **error)
|
||||
{
|
||||
gchar *host;
|
||||
gchar *colon;
|
||||
gint port = MCU_LISTENER_PORT;
|
||||
gboolean retval;
|
||||
|
||||
g_return_val_if_fail (BL_IS_THEATER (theater), FALSE);
|
||||
g_return_val_if_fail (hostname != NULL, FALSE);
|
||||
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
|
||||
|
||||
host = g_strdup (hostname);
|
||||
|
||||
if ((colon = strrchr (host, ':')))
|
||||
{
|
||||
b_parse_int (colon + 1, &port);
|
||||
*colon = '\0';
|
||||
}
|
||||
|
||||
retval = b_sender_remove_recipient (theater->sender, host, port, error);
|
||||
|
||||
g_free (host);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
void
|
||||
bl_theater_set_effects (BlTheater *theater,
|
||||
BEffects *effects)
|
||||
{
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
g_return_if_fail (! effects || B_IS_EFFECTS (effects));
|
||||
|
||||
if (theater->effects)
|
||||
g_object_unref (theater->effects);
|
||||
|
||||
theater->effects = effects;
|
||||
|
||||
if (theater->effects)
|
||||
g_object_ref (theater->effects);
|
||||
}
|
||||
|
||||
void
|
||||
bl_theater_set_item (BlTheater *theater,
|
||||
BlPlaylistItem *item)
|
||||
{
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
|
||||
if (item)
|
||||
g_return_if_fail (B_IS_MODULE (item->module) &&
|
||||
item->module->width == theater->width &&
|
||||
item->module->height == theater->height);
|
||||
|
||||
if (theater->item)
|
||||
{
|
||||
bl_theater_pause (theater);
|
||||
bl_theater_item_finished (theater, TRUE);
|
||||
}
|
||||
|
||||
if (item)
|
||||
bl_theater_set_item_internal (theater, item);
|
||||
}
|
||||
|
||||
void
|
||||
bl_theater_push_item (BlTheater *theater,
|
||||
BlPlaylistItem *item)
|
||||
{
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
g_return_if_fail (BL_IS_PLAYLIST_ITEM (item));
|
||||
g_return_if_fail (B_IS_MODULE (item->module) &&
|
||||
item->module->width == theater->width &&
|
||||
item->module->height == theater->height);
|
||||
|
||||
bl_theater_pause (theater);
|
||||
|
||||
if (theater->item)
|
||||
theater->item_stack = g_list_prepend (theater->item_stack,
|
||||
theater->item);
|
||||
|
||||
bl_theater_set_item_internal (theater, item);
|
||||
}
|
||||
|
||||
void
|
||||
bl_theater_pop_item (BlTheater *theater)
|
||||
{
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
|
||||
if (theater->item_stack)
|
||||
{
|
||||
bl_theater_pause (theater);
|
||||
|
||||
if (theater->item)
|
||||
g_object_unref (G_OBJECT (theater->item));
|
||||
|
||||
theater->item = theater->item_stack->data;
|
||||
|
||||
theater->item_stack = g_list_remove (theater->item_stack,
|
||||
theater->item);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
bl_theater_paint_callback (BModule *module,
|
||||
guchar *buffer,
|
||||
gpointer data)
|
||||
{
|
||||
BlTheater *theater;
|
||||
|
||||
g_return_val_if_fail (B_IS_MODULE (module), FALSE);
|
||||
g_return_val_if_fail (BL_IS_THEATER (data), FALSE);
|
||||
|
||||
theater = BL_THEATER (data);
|
||||
|
||||
if (theater->item && theater->item->effects)
|
||||
{
|
||||
memcpy (theater->item_buffer, buffer, theater->width * theater->height);
|
||||
|
||||
b_effects_apply (theater->item->effects,
|
||||
theater->item_buffer,
|
||||
theater->width, theater->height, 1, 255);
|
||||
|
||||
buffer = theater->item_buffer;
|
||||
}
|
||||
|
||||
bl_theater_set_frame_data_internal (BL_THEATER (data), buffer);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
bl_theater_set_item_internal (BlTheater *theater,
|
||||
BlPlaylistItem *item)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_if_fail (BL_IS_THEATER (theater));
|
||||
g_return_if_fail (BL_IS_PLAYLIST_ITEM (item));
|
||||
g_return_if_fail (B_IS_MODULE (item->module) &&
|
||||
item->module->width == theater->width &&
|
||||
item->module->height == theater->height);
|
||||
|
||||
theater->item = g_object_ref (G_OBJECT (item));
|
||||
|
||||
if (!b_module_prepare (item->module, &error))
|
||||
{
|
||||
gchar *title;
|
||||
|
||||
if (!error)
|
||||
{
|
||||
g_warning ("b_module_prepare didn't return an error ??\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
b_module_describe (item->module, &title, NULL, NULL);
|
||||
g_printerr ("Couldn't prepare module '%s': %s\n", title, error->message);
|
||||
g_free (title);
|
||||
}
|
||||
|
||||
bl_theater_item_finished (theater, FALSE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
bl_theater_set_frame_data_internal (BlTheater *theater,
|
||||
const guchar *data)
|
||||
{
|
||||
if (data && theater->effects)
|
||||
{
|
||||
memcpy (theater->frame_buffer, data, theater->width * theater->height);
|
||||
|
||||
b_effects_apply (theater->effects,
|
||||
theater->frame_buffer,
|
||||
theater->width, theater->height, 1, 255);
|
||||
|
||||
data = (const gchar *) theater->frame_buffer;
|
||||
}
|
||||
|
||||
b_sender_send_frame (theater->sender, data);
|
||||
}
|
||||
|
||||
static void
|
||||
bl_theater_item_finished (BlTheater *theater,
|
||||
gboolean relax)
|
||||
{
|
||||
BlPlaylistItem *item;
|
||||
gboolean pushed;
|
||||
|
||||
if (! theater->item)
|
||||
return;
|
||||
|
||||
item = theater->item;
|
||||
|
||||
if (relax)
|
||||
b_module_relax (item->module);
|
||||
|
||||
theater->item = NULL;
|
||||
|
||||
pushed = (theater->item_stack != NULL);
|
||||
|
||||
g_signal_emit (G_OBJECT (theater),
|
||||
bl_theater_signals[ITEM_FINISHED], 0,
|
||||
item, pushed);
|
||||
|
||||
g_object_unref (G_OBJECT (item));
|
||||
}
|
||||
|
||||
static void
|
||||
bl_theater_stop_callback (BModule *module,
|
||||
BlTheater *theater)
|
||||
{
|
||||
if (theater->stop_signal_id)
|
||||
{
|
||||
g_signal_handler_disconnect (G_OBJECT (theater->item->module),
|
||||
theater->stop_signal_id);
|
||||
theater->stop_signal_id = 0;
|
||||
}
|
||||
|
||||
bl_theater_item_finished (theater, TRUE);
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_THEATER_H__
|
||||
#define __BL_THEATER_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define BL_TYPE_THEATER (bl_theater_get_type ())
|
||||
#define BL_THEATER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BL_TYPE_THEATER, BlTheater))
|
||||
#define BL_THEATER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BL_TYPE_THEATER, BlTheaterClass))
|
||||
#define BL_IS_THEATER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BL_TYPE_THEATER))
|
||||
#define BL_IS_THEATER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BL_TYPE_THEATER))
|
||||
|
||||
|
||||
typedef struct _BlTheaterClass BlTheaterClass;
|
||||
|
||||
struct _BlTheaterClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
void (* item_finished) (BlTheater *theater,
|
||||
BlPlaylistItem *item,
|
||||
gboolean pushed);
|
||||
};
|
||||
|
||||
struct _BlTheater
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
guint stop_signal_id;
|
||||
|
||||
BlPlaylistItem *item;
|
||||
GList *item_stack;
|
||||
|
||||
BEffects *effects;
|
||||
BSender *sender;
|
||||
guchar *item_buffer;
|
||||
guchar *frame_buffer;
|
||||
|
||||
BlLogger *logger;
|
||||
};
|
||||
|
||||
|
||||
GType bl_theater_get_type (void) G_GNUC_CONST;
|
||||
BlTheater *bl_theater_new (BlConfig *config);
|
||||
gboolean bl_theater_add_recipient (BlTheater *theater,
|
||||
const gchar *hostname,
|
||||
GError **error);
|
||||
gboolean bl_theater_remove_recipient (BlTheater *theater,
|
||||
const gchar *hostname,
|
||||
GError **error);
|
||||
void bl_theater_set_effects (BlTheater *theater,
|
||||
BEffects *effects);
|
||||
void bl_theater_set_item (BlTheater *theater,
|
||||
BlPlaylistItem *item);
|
||||
void bl_theater_push_item (BlTheater *theater,
|
||||
BlPlaylistItem *item);
|
||||
void bl_theater_pop_item (BlTheater *theater);
|
||||
void bl_theater_play (BlTheater *theater);
|
||||
void bl_theater_pause (BlTheater *theater);
|
||||
void bl_theater_finish (BlTheater *theater);
|
||||
void bl_theater_kill (BlTheater *theater);
|
||||
gboolean bl_theater_is_playing (BlTheater *theater);
|
||||
void bl_theater_event (BlTheater *theater,
|
||||
BModuleEvent *event);
|
||||
void bl_theater_set_frame_data (BlTheater *theater,
|
||||
const guchar *data);
|
||||
gboolean bl_theater_paint_callback (BModule *module,
|
||||
guchar *buffer,
|
||||
gpointer data);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_THEATER_H__ */
|
|
@ -0,0 +1,42 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BL_TYPES_H__
|
||||
#define __BL_TYPES_H__
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
typedef struct _BlApp BlApp;
|
||||
typedef struct _BlCcc BlCcc;
|
||||
typedef struct _BlConfig BlConfig;
|
||||
typedef struct _BlEffects BlEffects;
|
||||
typedef struct _BlIsdn BlIsdn;
|
||||
typedef struct _BlIsdnLine BlIsdnLine;
|
||||
typedef struct _BlListen BlListen;
|
||||
typedef struct _BlLoveletters BlLoveletters;
|
||||
typedef struct _BlLogger BlLogger;
|
||||
typedef struct _BlOnDemand BlOnDemand;
|
||||
typedef struct _BlPlaylist BlPlaylist;
|
||||
typedef struct _BLPlaylistItem BlPlaylistItem;
|
||||
typedef struct _BlTheater BlTheater;
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __BL_TYPES_H__ */
|
|
@ -0,0 +1,222 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <blib/blib.h>
|
||||
|
||||
#include "bltypes.h"
|
||||
|
||||
#include "blccc.h"
|
||||
#include "blconfig.h"
|
||||
#include "bllisten.h"
|
||||
#include "blondemand.h"
|
||||
|
||||
|
||||
static BlCcc *ccc = NULL;
|
||||
|
||||
|
||||
static void
|
||||
sigterm_handler (gint signum)
|
||||
{
|
||||
sigset_t sigset;
|
||||
|
||||
sigemptyset (&sigset);
|
||||
sigprocmask (SIG_SETMASK, &sigset, NULL);
|
||||
|
||||
g_print ("Received signal %d, blanking and exiting ...\n", signum);
|
||||
|
||||
if (ccc)
|
||||
{
|
||||
bl_ccc_kill (ccc);
|
||||
ccc = NULL;
|
||||
}
|
||||
|
||||
exit (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
static void
|
||||
install_sighandlers (void)
|
||||
{
|
||||
struct sigaction sa;
|
||||
|
||||
/* handle SIGTERM */
|
||||
sigfillset (&sa.sa_mask);
|
||||
sa.sa_handler = sigterm_handler;
|
||||
sa.sa_flags = SA_RESTART;
|
||||
sigaction (SIGTERM, &sa, NULL);
|
||||
|
||||
/* handle SIGINT */
|
||||
sigfillset (&sa.sa_mask);
|
||||
sa.sa_handler = sigterm_handler;
|
||||
sa.sa_flags = SA_RESTART;
|
||||
sigaction (SIGINT, &sa, NULL);
|
||||
|
||||
/* ignore SIGPIPE */
|
||||
sigfillset (&sa.sa_mask);
|
||||
sa.sa_handler = SIG_IGN;
|
||||
sa.sa_flags = SA_RESTART;
|
||||
sigaction (SIGPIPE, &sa, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
GMainLoop *main_loop;
|
||||
BlConfig *config;
|
||||
BlListen *listen;
|
||||
GError *error = NULL;
|
||||
gboolean show_version = FALSE;
|
||||
gboolean show_help = FALSE;
|
||||
gint i;
|
||||
|
||||
g_thread_init (NULL);
|
||||
b_init ();
|
||||
|
||||
config = bl_config_new ();
|
||||
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
if (strcmp (argv[i], "--g-fatal-warnings") == 0)
|
||||
{
|
||||
GLogLevelFlags fatal_mask;
|
||||
|
||||
fatal_mask = g_log_set_always_fatal (G_LOG_FATAL_MASK);
|
||||
fatal_mask |= G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL;
|
||||
g_log_set_always_fatal (fatal_mask);
|
||||
argv[i] = NULL;
|
||||
}
|
||||
else if ((strcmp (argv[i], "--help") == 0) ||
|
||||
(strcmp (argv[i], "-?") == 0))
|
||||
{
|
||||
show_help = TRUE;
|
||||
argv[i] = NULL;
|
||||
}
|
||||
else if ((strcmp (argv[i], "--version") == 0) ||
|
||||
(strcmp (argv[i], "-v") == 0))
|
||||
{
|
||||
show_version = TRUE;
|
||||
argv[i] = NULL;
|
||||
}
|
||||
else if (argv[i][0] == '-')
|
||||
{
|
||||
/*
|
||||
* anything else starting with a '-' is an error.
|
||||
*/
|
||||
g_print ("\nInvalid option \"%s\"\n", argv[i]);
|
||||
show_help = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
if (! show_help)
|
||||
{
|
||||
for (i = 1; i < argc; i++)
|
||||
{
|
||||
gint k;
|
||||
|
||||
for (k = i; k < argc; k++)
|
||||
if (argv[k] != NULL)
|
||||
break;
|
||||
|
||||
if (k > i)
|
||||
{
|
||||
gint j;
|
||||
|
||||
k -= i;
|
||||
|
||||
for (j = i + k; j < argc; j++)
|
||||
argv[j-k] = argv[j];
|
||||
|
||||
argc -= k;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! show_version && argc < 1)
|
||||
show_help = TRUE;
|
||||
|
||||
if (show_version || show_help)
|
||||
g_print ("Blinkenlights Chaos Control Center version "VERSION"\n");
|
||||
|
||||
if (show_help)
|
||||
g_print ("\nUsage: %s [options] [configfile]\n\n"
|
||||
"Options:\n"
|
||||
" -?, --help Output this help.\n"
|
||||
" -v, --version Output version information.\n"
|
||||
" --g-fatal-warnings Crash on warnings (for debugging)\n"
|
||||
"\n",
|
||||
argv[0]);
|
||||
|
||||
if (show_version || show_help)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
/* make sure the module types are registered */
|
||||
b_module_infos_scan_dir (NULL);
|
||||
g_type_class_peek (BL_TYPE_ON_DEMAND);
|
||||
g_type_class_peek (B_TYPE_MOVIE_PLAYER);
|
||||
|
||||
if (argc > 1 && !bl_config_parse (config, argv[1], &error))
|
||||
{
|
||||
g_printerr ("Error parsing config file '%s': %s\n",
|
||||
argv[1], error->message);
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (config->channels != 1)
|
||||
{
|
||||
g_warning ("Sorry, channels != 1 is not supported.\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
if (config->maxval != 255)
|
||||
{
|
||||
g_warning ("Sorry, maxval != 255 is not supported.\n");
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
g_printerr ("Loaded config '%s' with %d application(s)\n",
|
||||
b_object_get_name (B_OBJECT (config)),
|
||||
g_list_length (config->applications));
|
||||
|
||||
ccc = bl_ccc_new (config);
|
||||
g_object_unref (config);
|
||||
|
||||
if (!ccc)
|
||||
return EXIT_FAILURE;
|
||||
|
||||
install_sighandlers ();
|
||||
|
||||
listen = bl_listen_new (config->telnet_port, ccc);
|
||||
|
||||
if (listen)
|
||||
{
|
||||
main_loop = g_main_loop_new (NULL, FALSE);
|
||||
g_main_loop_run (main_loop);
|
||||
|
||||
g_object_unref (listen);
|
||||
}
|
||||
|
||||
g_object_unref (ccc);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
## Makefile.am for blccc/src/modules
|
||||
|
||||
libdir = $(prefix)/lib/blccc/modules
|
||||
|
||||
AM_CPPFLAGS = -DG_DISABLE_DEPRECATED
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @BLIB_CFLAGS@
|
||||
|
||||
lib_LTLIBRARIES = libtest.la
|
||||
|
||||
libtest_la_SOURCES = test.c test.h
|
||||
libtest_la_LDFLAGS = -avoid-version -module
|
||||
libtest_la_LIBADD = @GLIB_LIBS@ @BLIB_LIBS@
|
|
@ -0,0 +1,331 @@
|
|||
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ../..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
DATADIR = @DATADIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACAKGE = @PACAKGE@
|
||||
PACKAGE = @PACKAGE@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
libdir = $(prefix)/lib/blccc/modules
|
||||
|
||||
AM_CPPFLAGS = -DG_DISABLE_DEPRECATED
|
||||
|
||||
INCLUDES = @GLIB_CFLAGS@ @BLIB_CFLAGS@
|
||||
|
||||
lib_LTLIBRARIES = libtest.la
|
||||
|
||||
libtest_la_SOURCES = test.c test.h
|
||||
libtest_la_LDFLAGS = -avoid-version -module
|
||||
libtest_la_LIBADD = @GLIB_LIBS@ @BLIB_LIBS@
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
LTLIBRARIES = $(lib_LTLIBRARIES)
|
||||
|
||||
|
||||
DEFS = @DEFS@ -I. -I$(srcdir) -I../..
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
libtest_la_DEPENDENCIES =
|
||||
libtest_la_OBJECTS = test.lo
|
||||
CFLAGS = @CFLAGS@
|
||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
SOURCES = $(libtest_la_SOURCES)
|
||||
OBJECTS = $(libtest_la_OBJECTS)
|
||||
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .S .c .lo .o .obj .s
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/modules/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
mostlyclean-libLTLIBRARIES:
|
||||
|
||||
clean-libLTLIBRARIES:
|
||||
-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
|
||||
|
||||
distclean-libLTLIBRARIES:
|
||||
|
||||
maintainer-clean-libLTLIBRARIES:
|
||||
|
||||
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
|
||||
$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
|
||||
else :; fi; \
|
||||
done
|
||||
|
||||
uninstall-libLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
list='$(lib_LTLIBRARIES)'; for p in $$list; do \
|
||||
$(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
|
||||
done
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
# FIXME: We should only use cygpath when building on Windows,
|
||||
# and only if it is available.
|
||||
.c.obj:
|
||||
$(COMPILE) -c `cygpath -w $<`
|
||||
|
||||
.s.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.S.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.o core *.core
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
clean-compile:
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
maintainer-clean-compile:
|
||||
|
||||
.c.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
.s.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
.S.lo:
|
||||
$(LIBTOOL) --mode=compile $(COMPILE) -c $<
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
|
||||
maintainer-clean-libtool:
|
||||
|
||||
libtest.la: $(libtest_la_OBJECTS) $(libtest_la_DEPENDENCIES)
|
||||
$(LINK) -rpath $(libdir) $(libtest_la_LDFLAGS) $(libtest_la_OBJECTS) $(libtest_la_LIBADD) $(LIBS)
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = src/modules
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
test.lo test.o : test.c
|
||||
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am: install-libLTLIBRARIES
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am: uninstall-libLTLIBRARIES
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
$(mkinstalldirs) $(DESTDIR)$(libdir)
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-libLTLIBRARIES mostlyclean-compile \
|
||||
mostlyclean-libtool mostlyclean-tags \
|
||||
mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-libLTLIBRARIES clean-compile clean-libtool clean-tags \
|
||||
clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-libLTLIBRARIES distclean-compile \
|
||||
distclean-libtool distclean-tags distclean-generic \
|
||||
clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-libLTLIBRARIES \
|
||||
maintainer-clean-compile maintainer-clean-libtool \
|
||||
maintainer-clean-tags maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
|
||||
clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
|
||||
uninstall-libLTLIBRARIES install-libLTLIBRARIES mostlyclean-compile \
|
||||
distclean-compile clean-compile maintainer-clean-compile \
|
||||
mostlyclean-libtool distclean-libtool clean-libtool \
|
||||
maintainer-clean-libtool tags mostlyclean-tags distclean-tags \
|
||||
clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \
|
||||
check-am installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,23 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2002 The Blinkenlights Crew
|
||||
* Daniel Mack <daniel@yoobay.net>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
#include <blib/blib.h>
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
/* blccc - Blinkenlights Chaos Control Center
|
||||
*
|
||||
* Copyright (c) 2002 The Blinkenlights Crew
|
||||
* Daniel Mack <daniel@yoobay.net>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
|
@ -0,0 +1 @@
|
|||
timestamp
|
|
@ -0,0 +1,5 @@
|
|||
## Makefile.am for blccc/stylesheets
|
||||
|
||||
SUBDIRS = examples
|
||||
|
||||
EXTRA_DIST = simple-playlist.xslt
|
|
@ -0,0 +1,295 @@
|
|||
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
DATADIR = @DATADIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACAKGE = @PACAKGE@
|
||||
PACKAGE = @PACKAGE@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
SUBDIRS = examples
|
||||
|
||||
EXTRA_DIST = simple-playlist.xslt
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps stylesheets/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
all-recursive install-data-recursive install-exec-recursive \
|
||||
installdirs-recursive install-recursive uninstall-recursive \
|
||||
check-recursive installcheck-recursive info-recursive dvi-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
mostlyclean-recursive clean-recursive distclean-recursive \
|
||||
maintainer-clean-recursive:
|
||||
@set fnord $(MAKEFLAGS); amf=$$2; \
|
||||
dot_seen=no; \
|
||||
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
rev="$$subdir $$rev"; \
|
||||
test "$$subdir" != "." || dot_seen=yes; \
|
||||
done; \
|
||||
test "$$dot_seen" = "no" && rev=". $$rev"; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
|
||||
tags: TAGS
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
here=`pwd` && cd $(srcdir) \
|
||||
&& mkid -f$$here/ID $$unique $(LISP)
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
|
||||
tags=; \
|
||||
here=`pwd`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS)'; \
|
||||
unique=`for i in $$list; do echo $$i; done | \
|
||||
awk ' { files[$$0] = 1; } \
|
||||
END { for (i in files) print i; }'`; \
|
||||
test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
|
||||
|| (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP))
|
||||
|
||||
mostlyclean-tags:
|
||||
|
||||
clean-tags:
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID
|
||||
|
||||
maintainer-clean-tags:
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = stylesheets
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
for subdir in $(SUBDIRS); do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test -d $(distdir)/$$subdir \
|
||||
|| mkdir $(distdir)/$$subdir \
|
||||
|| exit 1; \
|
||||
chmod 777 $(distdir)/$$subdir; \
|
||||
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \
|
||||
|| exit 1; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-recursive
|
||||
dvi-am:
|
||||
dvi: dvi-recursive
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
installcheck-am:
|
||||
installcheck: installcheck-recursive
|
||||
install-exec-am:
|
||||
install-exec: install-exec-recursive
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-recursive
|
||||
uninstall-am:
|
||||
uninstall: uninstall-recursive
|
||||
all-am: Makefile
|
||||
all-redirect: all-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-tags mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-recursive
|
||||
|
||||
clean-am: clean-tags clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-recursive
|
||||
|
||||
distclean-am: distclean-tags distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-recursive
|
||||
|
||||
maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \
|
||||
distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-recursive
|
||||
|
||||
.PHONY: install-data-recursive uninstall-data-recursive \
|
||||
install-exec-recursive uninstall-exec-recursive installdirs-recursive \
|
||||
uninstalldirs-recursive all-recursive check-recursive \
|
||||
installcheck-recursive info-recursive dvi-recursive \
|
||||
mostlyclean-recursive distclean-recursive clean-recursive \
|
||||
maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
|
||||
distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
|
||||
dvi-am dvi check check-am installcheck-am installcheck install-exec-am \
|
||||
install-exec install-data-am install-data install-am install \
|
||||
uninstall-am uninstall all-redirect all-am all installdirs-am \
|
||||
installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,3 @@
|
|||
## Makefile.am for blccc/stylesheets/examples
|
||||
|
||||
EXTRA_DIST = simple.xml
|
|
@ -0,0 +1,189 @@
|
|||
# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
|
||||
|
||||
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
|
||||
SHELL = @SHELL@
|
||||
|
||||
srcdir = @srcdir@
|
||||
top_srcdir = @top_srcdir@
|
||||
VPATH = @srcdir@
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
|
||||
bindir = @bindir@
|
||||
sbindir = @sbindir@
|
||||
libexecdir = @libexecdir@
|
||||
datadir = @datadir@
|
||||
sysconfdir = @sysconfdir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
localstatedir = @localstatedir@
|
||||
libdir = @libdir@
|
||||
infodir = @infodir@
|
||||
mandir = @mandir@
|
||||
includedir = @includedir@
|
||||
oldincludedir = /usr/include
|
||||
|
||||
DESTDIR =
|
||||
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
|
||||
top_builddir = ../..
|
||||
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
transform = @program_transform_name@
|
||||
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
host_alias = @host_alias@
|
||||
host_triplet = @host@
|
||||
AS = @AS@
|
||||
CC = @CC@
|
||||
DATADIR = @DATADIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
ECHO = @ECHO@
|
||||
EXEEXT = @EXEEXT@
|
||||
GLIB_CFLAGS = @GLIB_CFLAGS@
|
||||
GLIB_GENMARSHAL = @GLIB_GENMARSHAL@
|
||||
GLIB_LIBS = @GLIB_LIBS@
|
||||
GLIB_MKENUMS = @GLIB_MKENUMS@
|
||||
GOBJECT_QUERY = @GOBJECT_QUERY@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LN_S = @LN_S@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
PACAKGE = @PACAKGE@
|
||||
PACKAGE = @PACKAGE@
|
||||
PKG_CONFIG = @PKG_CONFIG@
|
||||
RANLIB = @RANLIB@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
|
||||
EXTRA_DIST = simple.xml
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = ../../config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
DIST_COMMON = Makefile.am Makefile.in
|
||||
|
||||
|
||||
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
|
||||
|
||||
TAR = tar
|
||||
GZIP_ENV = --best
|
||||
all: all-redirect
|
||||
.SUFFIXES:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
|
||||
cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps stylesheets/examples/Makefile
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
tags: TAGS
|
||||
TAGS:
|
||||
|
||||
|
||||
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
|
||||
|
||||
subdir = stylesheets/examples
|
||||
|
||||
distdir: $(DISTFILES)
|
||||
@for file in $(DISTFILES); do \
|
||||
d=$(srcdir); \
|
||||
if test -d $$d/$$file; then \
|
||||
cp -pr $$d/$$file $(distdir)/$$file; \
|
||||
else \
|
||||
test -f $(distdir)/$$file \
|
||||
|| ln $$d/$$file $(distdir)/$$file 2> /dev/null \
|
||||
|| cp -p $$d/$$file $(distdir)/$$file || :; \
|
||||
fi; \
|
||||
done
|
||||
info-am:
|
||||
info: info-am
|
||||
dvi-am:
|
||||
dvi: dvi-am
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
installcheck-am:
|
||||
installcheck: installcheck-am
|
||||
install-exec-am:
|
||||
install-exec: install-exec-am
|
||||
|
||||
install-data-am:
|
||||
install-data: install-data-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
install: install-am
|
||||
uninstall-am:
|
||||
uninstall: uninstall-am
|
||||
all-am: Makefile
|
||||
all-redirect: all-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
|
||||
installdirs:
|
||||
|
||||
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-rm -f Makefile $(CONFIG_CLEAN_FILES)
|
||||
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
|
||||
|
||||
maintainer-clean-generic:
|
||||
mostlyclean-am: mostlyclean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
clean-am: clean-generic mostlyclean-am
|
||||
|
||||
clean: clean-am
|
||||
|
||||
distclean-am: distclean-generic clean-am
|
||||
-rm -f libtool
|
||||
|
||||
distclean: distclean-am
|
||||
|
||||
maintainer-clean-am: maintainer-clean-generic distclean-am
|
||||
@echo "This command is intended for maintainers to use;"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
|
||||
.PHONY: tags distdir info-am info dvi-am dvi check check-am \
|
||||
installcheck-am installcheck install-exec-am install-exec \
|
||||
install-data-am install-data install-am install uninstall-am uninstall \
|
||||
all-redirect all-am all installdirs mostlyclean-generic \
|
||||
distclean-generic clean-generic maintainer-clean-generic clean \
|
||||
mostlyclean distclean maintainer-clean
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0"?>
|
||||
<simple-playlist>
|
||||
<movie file="foo.blm" reverse="no" />
|
||||
<movie movie="foo.blm" speed="0.2" />
|
||||
<movie movie="foo.blm" speed="2.4" reverse="yes" />
|
||||
|
||||
<pong />
|
||||
<pacman />
|
||||
<qix lines="8" speed="1.2" lifetime="10000" />
|
||||
<fire speed="0.6" lifetime="10000" />
|
||||
<tetris />
|
||||
</simple-playlist>
|
|
@ -0,0 +1,65 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
||||
|
||||
<xsl:output method="xml" encoding="utf-8" indent="yes" />
|
||||
|
||||
|
||||
|
||||
<xsl:template match="simple-playlist">
|
||||
<playlist>
|
||||
<xsl:apply-templates select="*" />
|
||||
</playlist>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<!-- map special elements to generic item elements -->
|
||||
|
||||
<xsl:template match="movie" >
|
||||
<item type="BMoviePlayer">
|
||||
<xsl:apply-templates select="@*" mode="param" />
|
||||
</item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="pong" >
|
||||
<item type="BPong">
|
||||
<xsl:apply-templates select="@*" mode="param" />
|
||||
</item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="pacman" >
|
||||
<item type="BPacman">
|
||||
<xsl:apply-templates select="@*" mode="param" />
|
||||
</item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="breakout" >
|
||||
<item type="BBreakout">
|
||||
<xsl:apply-templates select="@*" mode="param" />
|
||||
</item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="tetris" >
|
||||
<item type="BTetris">
|
||||
<xsl:apply-templates select="@*" mode="param" />
|
||||
</item>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="fire" >
|
||||
<item type="BFire">
|
||||
<xsl:apply-templates select="@*" mode="param" />
|
||||
</item>
|
||||
</xsl:template>
|
||||
|
||||
<!-- standard attribute to param key/value pair conversion -->
|
||||
|
||||
<xsl:template match="@*" mode="param" >
|
||||
<param key="{name()}" value="{.}" />
|
||||
</xsl:template>
|
||||
|
||||
<!-- parameter renaming -->
|
||||
|
||||
<xsl:template match="@file" mode="param" >
|
||||
<param key="movie" value="{.}" />
|
||||
</xsl:template>
|
||||
|
||||
</xsl:transform>
|
Loading…
Reference in New Issue