Initial revision
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@3 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
12
AUTHORS
Normal file
12
AUTHORS
Normal file
@@ -0,0 +1,12 @@
|
||||
Tobias Doerffel
|
||||
<tobydox@users.sourceforge.net>
|
||||
Maintainer, main-development, artwork etc.
|
||||
|
||||
|
||||
Sebastian Tilsch
|
||||
<djcompilation@gmx.de>
|
||||
recording of many samples
|
||||
|
||||
|
||||
...may be there're more here in the future...
|
||||
|
||||
340
COPYING
Normal file
340
COPYING
Normal file
@@ -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) 19yy <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 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) 19yy name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
182
INSTALL
Normal file
182
INSTALL
Normal file
@@ -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.
|
||||
304
Makefile.am
Normal file
304
Makefile.am
Normal file
@@ -0,0 +1,304 @@
|
||||
AUTOMAKE_OPTIONS = foreign 1.4
|
||||
|
||||
dist-hook:
|
||||
rm -rf `find $(distdir) -name \*.moc`
|
||||
|
||||
|
||||
install-exec-hook:
|
||||
cd $(DESTDIR)$(bindir) ; \
|
||||
strip lmms
|
||||
|
||||
|
||||
if HAVE_RPM
|
||||
$(PACKAGE)-$(VERSION).tar.gz: dist
|
||||
|
||||
# Rule to build RPM distribution package
|
||||
rpm: $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE).spec
|
||||
cp $(PACKAGE)-$(VERSION).tar.gz @RPMSOURCEDIR@
|
||||
rpmbuild -ba $(PACKAGE).spec
|
||||
endif
|
||||
|
||||
|
||||
noinst_PROGRAMS= bin2res
|
||||
bin2res_SOURCES = buildtools/bin2res.cpp
|
||||
|
||||
|
||||
INCLUDES = -I$(srcdir)/include -I.
|
||||
bin_PROGRAMS = lmms
|
||||
|
||||
|
||||
|
||||
AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS)
|
||||
|
||||
|
||||
%.moc: $(srcdir)/include/%.h
|
||||
$(MOC) -o $@ $<
|
||||
|
||||
%.ts:
|
||||
$(LUPDATE) $(lmms_SOURCES) -ts locale/$@
|
||||
|
||||
%.qm: %.ts
|
||||
$(LRELEASE) $<
|
||||
|
||||
|
||||
|
||||
lmms_MOC = \
|
||||
./about_dialog.moc \
|
||||
./arp_and_chords_tab_widget.moc \
|
||||
./audio_file_processor.moc \
|
||||
./bb_editor.moc \
|
||||
./bb_track.moc \
|
||||
./browser.moc \
|
||||
./channel_track.moc \
|
||||
./config_mgr.moc \
|
||||
./crystal_button.moc \
|
||||
./envelope_and_lfo_widget.moc \
|
||||
./envelope_tab_widget.moc \
|
||||
./export_project_dialog.moc \
|
||||
./kmultitabbar.moc \
|
||||
./group_box.moc \
|
||||
./knob.moc \
|
||||
./lcd_spinbox.moc \
|
||||
./lmms_main_win.moc \
|
||||
./midi_out.moc \
|
||||
./mixer.moc \
|
||||
./name_label.moc \
|
||||
./nstate_button.moc \
|
||||
./pattern.moc \
|
||||
./piano_roll.moc \
|
||||
./piano_widget.moc \
|
||||
./pixmap_button.moc \
|
||||
./plucked_string_synth.moc \
|
||||
./project_notes.moc \
|
||||
./rename_dialog.moc \
|
||||
./sample_buffer.moc \
|
||||
./sample_track.moc \
|
||||
./setup_dialog.moc \
|
||||
./side_bar.moc \
|
||||
./side_bar_widget.moc \
|
||||
./song_editor.moc \
|
||||
./sound_generator.moc \
|
||||
./surround_area.moc \
|
||||
./tab_bar.moc \
|
||||
./tab_button.moc \
|
||||
./tab_widget.moc \
|
||||
./timeline.moc \
|
||||
./track_container.moc \
|
||||
./track.moc \
|
||||
./triple_oscillator.moc \
|
||||
./visualization_widget.moc
|
||||
|
||||
|
||||
BUILT_SOURCES = $(lmms_MOC)
|
||||
|
||||
#lmms_TRANSLATIONS = $(wildcard $(srcdir)/locale/*.qm $(srcdir)/locale/*.ts)
|
||||
|
||||
lmms_EMBEDDED_RESOURCES = $(wildcard $(srcdir)/resources/*png AUTHORS COPYING)
|
||||
|
||||
./embedded_resources.h: $(lmms_EMBEDDED_RESOURCES) bin2res
|
||||
$(top_builddir)/bin2res $(lmms_EMBEDDED_RESOURCES) > $@
|
||||
|
||||
./embed.o: ./embedded_resources.h
|
||||
|
||||
|
||||
lmms_SOURCES = \
|
||||
$(srcdir)/src/audio/audio_alsa.cpp \
|
||||
$(srcdir)/src/audio/audio_device.cpp \
|
||||
$(srcdir)/src/audio/audio_file_device.cpp \
|
||||
$(srcdir)/src/audio/audio_file_ogg.cpp \
|
||||
$(srcdir)/src/audio/audio_file_wave.cpp \
|
||||
$(srcdir)/src/audio/audio_jack.cpp \
|
||||
$(srcdir)/src/audio/audio_oss.cpp \
|
||||
$(srcdir)/src/audio/audio_sample_recorder.cpp \
|
||||
$(srcdir)/src/audio/audio_sdl.cpp \
|
||||
$(srcdir)/src/core/about_dialog.cpp \
|
||||
$(srcdir)/src/core/arp_and_chords_tab_widget.cpp \
|
||||
$(srcdir)/src/core/bb_editor.cpp \
|
||||
$(srcdir)/src/core/browser.cpp \
|
||||
$(srcdir)/src/core/config_mgr.cpp \
|
||||
$(srcdir)/src/core/envelope_and_lfo_widget.cpp \
|
||||
$(srcdir)/src/core/envelope_tab_widget.cpp \
|
||||
$(srcdir)/src/core/export_project_dialog.cpp \
|
||||
$(srcdir)/src/core/lmms_main_win.cpp \
|
||||
$(srcdir)/src/core/main.cpp \
|
||||
$(srcdir)/src/core/mixer.cpp \
|
||||
$(srcdir)/src/core/name_label.cpp \
|
||||
$(srcdir)/src/core/note.cpp \
|
||||
$(srcdir)/src/core/note_play_handle.cpp \
|
||||
$(srcdir)/src/core/piano_roll.cpp \
|
||||
$(srcdir)/src/core/piano_widget.cpp \
|
||||
$(srcdir)/src/core/plugin_management.cpp \
|
||||
$(srcdir)/src/core/preset_preview_play_handle.cpp \
|
||||
$(srcdir)/src/core/sample_play_handle.cpp \
|
||||
$(srcdir)/src/core/setup_dialog.cpp \
|
||||
$(srcdir)/src/core/song_editor.cpp \
|
||||
$(srcdir)/src/core/sound_generator.cpp \
|
||||
$(srcdir)/src/core/track.cpp \
|
||||
$(srcdir)/src/core/track_container.cpp \
|
||||
$(srcdir)/src/core/surround_area.cpp \
|
||||
$(srcdir)/src/core/timeline.cpp \
|
||||
$(srcdir)/src/lib/buffer_allocator.cpp \
|
||||
$(srcdir)/src/lib/clipboard.cpp \
|
||||
$(srcdir)/src/lib/embed.cpp \
|
||||
$(srcdir)/src/lib/mmp.cpp \
|
||||
$(srcdir)/src/lib/oscillator.cpp \
|
||||
$(srcdir)/src/lib/sample_buffer.cpp \
|
||||
$(srcdir)/src/midi/midi_alsa_raw.cpp \
|
||||
$(srcdir)/src/midi/midi_device.cpp \
|
||||
$(srcdir)/src/midi/midi_file.cpp \
|
||||
$(srcdir)/src/midi/midi_mapper.cpp \
|
||||
$(srcdir)/src/midi/midi_oss.cpp \
|
||||
$(srcdir)/src/soundgenerators/audio_file_processor.cpp \
|
||||
$(srcdir)/src/soundgenerators/midi_out.cpp \
|
||||
$(srcdir)/src/soundgenerators/plucked_string_synth.cpp \
|
||||
$(srcdir)/src/soundgenerators/triple_oscillator.cpp \
|
||||
$(srcdir)/src/tracks/bb_track.cpp \
|
||||
$(srcdir)/src/tracks/channel_track.cpp \
|
||||
$(srcdir)/src/tracks/pattern.cpp \
|
||||
$(srcdir)/src/tracks/sample_track.cpp \
|
||||
$(srcdir)/src/widgets/crystal_button.cpp \
|
||||
$(srcdir)/src/widgets/group_box.cpp \
|
||||
$(srcdir)/src/widgets/kmultitabbar.cpp \
|
||||
$(srcdir)/src/widgets/knob.cpp \
|
||||
$(srcdir)/src/widgets/lcd_spinbox.cpp \
|
||||
$(srcdir)/src/widgets/led_checkbox.cpp \
|
||||
$(srcdir)/src/widgets/nstate_button.cpp \
|
||||
$(srcdir)/src/widgets/pixmap_button.cpp \
|
||||
$(srcdir)/src/widgets/project_notes.cpp \
|
||||
$(srcdir)/src/widgets/rename_dialog.cpp \
|
||||
$(srcdir)/src/widgets/side_bar_widget.cpp \
|
||||
$(srcdir)/src/widgets/tab_bar.cpp \
|
||||
$(srcdir)/src/widgets/tab_widget.cpp \
|
||||
$(srcdir)/src/widgets/text_float.cpp \
|
||||
$(srcdir)/src/widgets/tooltip.cpp \
|
||||
$(srcdir)/src/widgets/visualization_widget.cpp \
|
||||
$(srcdir)/include/pch.h \
|
||||
$(srcdir)/include/debug.h \
|
||||
$(srcdir)/include/lmms_main_win.h \
|
||||
$(srcdir)/include/audio_alsa.h \
|
||||
$(srcdir)/include/audio_device.h \
|
||||
$(srcdir)/include/audio_dummy.h \
|
||||
$(srcdir)/include/audio_file_device.h \
|
||||
$(srcdir)/include/audio_file_ogg.h \
|
||||
$(srcdir)/include/audio_file_wave.h \
|
||||
$(srcdir)/include/audio_jack.h \
|
||||
$(srcdir)/include/audio_oss.h \
|
||||
$(srcdir)/include/audio_sample_recorder.h \
|
||||
$(srcdir)/include/audio_sdl.h \
|
||||
$(srcdir)/include/interpolation.h \
|
||||
$(srcdir)/include/mixer.h \
|
||||
$(srcdir)/include/pattern.h \
|
||||
$(srcdir)/include/channel_track.h \
|
||||
$(srcdir)/include/note.h \
|
||||
$(srcdir)/include/volume.h \
|
||||
$(srcdir)/include/panning.h \
|
||||
$(srcdir)/include/song_editor.h \
|
||||
$(srcdir)/include/sound_generator.h \
|
||||
$(srcdir)/include/audio_file_processor.h \
|
||||
$(srcdir)/include/midi_time.h \
|
||||
$(srcdir)/include/bb_editor.h \
|
||||
$(srcdir)/include/piano_widget.h \
|
||||
$(srcdir)/include/effect_board.h \
|
||||
$(srcdir)/include/pixmap_button.h \
|
||||
$(srcdir)/include/triple_oscillator.h \
|
||||
$(srcdir)/include/settings.h \
|
||||
$(srcdir)/include/plucked_string_synth.h \
|
||||
$(srcdir)/include/rename_dialog.h \
|
||||
$(srcdir)/include/export_project_dialog.h \
|
||||
$(srcdir)/include/note_play_handle.h \
|
||||
$(srcdir)/include/piano_roll.h \
|
||||
$(srcdir)/include/basic_filters.h \
|
||||
$(srcdir)/include/envelope_tab_widget.h \
|
||||
$(srcdir)/include/envelope_and_lfo_widget.h \
|
||||
$(srcdir)/include/about_dialog.h \
|
||||
$(srcdir)/include/oscillator.h \
|
||||
$(srcdir)/include/crystal_button.h \
|
||||
$(srcdir)/include/arp_and_chords_tab_widget.h \
|
||||
$(srcdir)/include/export.h \
|
||||
$(srcdir)/include/group_box.h \
|
||||
$(srcdir)/include/tab_widget.h \
|
||||
$(srcdir)/include/knob.h \
|
||||
$(srcdir)/include/browser.h \
|
||||
$(srcdir)/include/templates.h \
|
||||
$(srcdir)/include/surround_area.h \
|
||||
$(srcdir)/include/kmultitabbar.h \
|
||||
$(srcdir)/include/side_bar.h \
|
||||
$(srcdir)/include/side_bar_widget.h \
|
||||
$(srcdir)/include/track.h \
|
||||
$(srcdir)/include/track_container.h \
|
||||
$(srcdir)/include/bb_track.h \
|
||||
$(srcdir)/include/sample_track.h \
|
||||
$(srcdir)/include/sample_buffer.h \
|
||||
$(srcdir)/include/name_label.h \
|
||||
$(srcdir)/include/play_handle.h \
|
||||
$(srcdir)/include/mmp.h \
|
||||
$(srcdir)/include/midi_device.h \
|
||||
$(srcdir)/include/midi_file.h \
|
||||
$(srcdir)/include/midi_alsa_raw.h \
|
||||
$(srcdir)/include/midi_oss.h \
|
||||
$(srcdir)/include/clipboard.h \
|
||||
$(srcdir)/include/types.h \
|
||||
$(srcdir)/include/qt3support.h \
|
||||
$(srcdir)/include/embed.h \
|
||||
$(srcdir)/include/timeline.h \
|
||||
$(srcdir)/include/config_mgr.h \
|
||||
$(srcdir)/include/spc_bg_hndl_widget.h \
|
||||
$(srcdir)/include/tab_bar.h \
|
||||
$(srcdir)/include/tab_button.h \
|
||||
$(srcdir)/include/project_notes.h \
|
||||
$(srcdir)/include/visualization_widget.h \
|
||||
$(srcdir)/include/endian_handling.h \
|
||||
$(srcdir)/include/preset_preview_play_handle.h \
|
||||
$(srcdir)/include/sample_play_handle.h \
|
||||
$(srcdir)/include/midi.h \
|
||||
$(srcdir)/include/midi_out.h \
|
||||
$(srcdir)/include/nstate_button.h \
|
||||
$(srcdir)/include/midi_dummy.h \
|
||||
$(srcdir)/include/midi_mapper.h \
|
||||
$(srcdir)/include/buffer_allocator.h \
|
||||
$(srcdir)/include/lcd_spinbox.h \
|
||||
$(srcdir)/include/tooltip.h \
|
||||
$(srcdir)/include/led_checkbox.h \
|
||||
$(srcdir)/include/text_float.h \
|
||||
$(srcdir)/include/setup_dialog.h
|
||||
|
||||
|
||||
EXTRA_DIST = \
|
||||
$(lmms_EMBEDDED_RESOURCES) \
|
||||
$(srcdir)/include/sgs
|
||||
|
||||
|
||||
CLEANFILES = $(lmms_MOC) ./embedded_resources.h
|
||||
|
||||
if HAVE_LIBSDL
|
||||
LIB_SDL_LDADD = -lSDL
|
||||
endif
|
||||
|
||||
if HAVE_LIBSDL_SOUND
|
||||
LIB_SDL_SOUND_LDADD = -lSDL_sound
|
||||
endif
|
||||
|
||||
if HAVE_LIBASOUND
|
||||
LIB_ASOUND_LDADD = -lasound
|
||||
endif
|
||||
|
||||
if HAVE_LIBJACK
|
||||
LIB_JACK_LDADD = -ljack
|
||||
endif
|
||||
|
||||
if HAVE_LIBVORBIS
|
||||
LIB_VORBIS_LDADD = -lvorbis -lvorbisenc -lvorbisfile
|
||||
endif
|
||||
|
||||
if HAVE_LIBSRC
|
||||
LIB_SRC_LDADD = -lsamplerate
|
||||
endif
|
||||
|
||||
if HAVE_LIBSF
|
||||
LIB_SF_LDADD = -lsndfile
|
||||
endif
|
||||
|
||||
lmms_LDADD = $(QT_LDADD) $(LIB_SDL_LDADD) $(LIB_ASOUND_LDADD) $(LIB_JACK_LDADD) $(LIB_SDL_SOUND_LDADD) $(LIB_VORBIS_LDADD) $(LIB_SRC_LDADD) $(LIB_SF_LDADD)
|
||||
|
||||
SUBDIRS = artwork locale midi-maps presets projects samples
|
||||
|
||||
97
README
Normal file
97
README
Normal file
@@ -0,0 +1,97 @@
|
||||
Linux MultiMedia Studio 0.1.0
|
||||
=============================
|
||||
|
||||
Copyright (c) 2004-2005 by Tobias Doerffel
|
||||
|
||||
|
||||
The whole 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
|
||||
|
||||
|
||||
|
||||
What is LMMS??
|
||||
--------------
|
||||
|
||||
LMMS aims to be a free alternative to popular (but commercial and closed-
|
||||
source) programs like FruityLoops, Cubase and Logic giving you the ability of
|
||||
producing music with your computer by creating/synthesizing sounds, arranging
|
||||
samples, playing live with keyboard and much more...
|
||||
|
||||
LMMS combines the features of a tracker-/sequencer-program (pattern-/channel-/
|
||||
sample-/song-/effect-management) and those of powerful synthesizers and
|
||||
samplers in a modern, user-friendly and easy to use graphical user-interface.
|
||||
|
||||
LMMS is still in heavy development, so with this version please don't expect a
|
||||
complete, ready and bugfree program!!
|
||||
|
||||
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
||||
The most important requirement is for sure a fast computer, so don't try to get
|
||||
LMMS working on a pentium one with 60 MHz... ;-) So you should have at least
|
||||
500 MHz, but for really enjoying LMMS less than 1 GHz makes no sense...
|
||||
(LMMS is currently developed on a PIII 450 MHz...!!)
|
||||
|
||||
Required libraries are:
|
||||
|
||||
- Qt 3.2 or higher (tested up to 4.0.0) with devel-files
|
||||
- SDL_sound (tested with 0.1.5 & 1.0.1) with devel-files
|
||||
|
||||
Optional, but strongly recommended:
|
||||
- libvorbis with devel-files
|
||||
- libalsa with devel-files
|
||||
- SDL with devel-files
|
||||
- libsamplerate with devel-files
|
||||
|
||||
For compiling you should have an up to date GCC with g++.
|
||||
LMMS has been (successfully) tested under Debian Sarge 3.1, Fedora Core 2-4,
|
||||
and SuSE Linux 9.0-9.3 with Qt 3.[23].x and Qt 4.0.0.
|
||||
It was compiled using GCC 3.3.x, GCC 3.4.x and GCC 4.0.0.
|
||||
|
||||
If you have problems with compiling or running LMMS, find any bug or have
|
||||
suggestions and so on, please feel free to e-mail me (for mail-address see
|
||||
below)!
|
||||
|
||||
|
||||
|
||||
|
||||
Help developing LMMS
|
||||
--------------------
|
||||
|
||||
If you are interested in LMMS, it's programming, artwork, testing, writing
|
||||
demo-songs, (and improving this f**** README...) or something like that,
|
||||
you're welcome to participate on the development of LMMS!
|
||||
|
||||
Just e-mail me: tobydox@users.sourceforge.net
|
||||
|
||||
The project-homepage of LMMS and mailingslists can be found at
|
||||
http://lmms.sourceforge.net
|
||||
|
||||
|
||||
Before coding a new big feature, please always post your idea and suggestions
|
||||
about your feature and about the actual implementation to the
|
||||
LMMS-devel-mailinglist (lmms-devel@lists.sourceforge.net) and wait for replies
|
||||
or email me! Maybe there're different ideas, improvements, hints or maybe your
|
||||
feature is not welcome/needed at the moment (but for sure this will be very
|
||||
seldom).
|
||||
|
||||
If you coded your feature, make sure, that it is running properly with the
|
||||
newest available version of LMMS and that it also runs with different
|
||||
configurations (e.g. different latency, disabled surround-support, missing
|
||||
package(s) etc.). Important is also, that you comment your
|
||||
source so that other people can fix bugs or improve your feature!
|
||||
|
||||
|
||||
40
TODO
Normal file
40
TODO
Normal file
@@ -0,0 +1,40 @@
|
||||
- make usable with Qt4
|
||||
- make LMMS an ALSA-sequencer-client
|
||||
- adchannel-toolbutton -> popup-menu with available soundgenerator-plugins
|
||||
- tempo-based arpeggio
|
||||
- pre-listen when opening sample with QFileDialog
|
||||
- level-meters in output-graph and channel-track
|
||||
- panning-editing in piano-roll
|
||||
- use midi-maps
|
||||
- process program-/channel-change-events from MIDI-files
|
||||
- setup MIDI-channel and -program in MIDI-Out
|
||||
- speed up painting of sampleTCO
|
||||
- save window-positions, -states and -sizes in files
|
||||
- solve problems with different keyboard-layouts when playing channel-track with pc-keyboard
|
||||
- balance env+lfo
|
||||
- autosave every 1 minute
|
||||
- audioDummy: always wait until the stuff normally would have been written (=simulate blocking IO)
|
||||
- plucked-string-synth: knob for metallic -> use noise as wave-shape
|
||||
- finish qt4-port and make LMMS usable when compiling with Qt4
|
||||
- rewrite export-project-dialog using layout-mechanism
|
||||
- dynamic pitch-change
|
||||
- make piano-roll use the global clipboard??
|
||||
- add languages:
|
||||
- Dutch
|
||||
- Italian
|
||||
- ...any other welcome
|
||||
|
||||
|
||||
|
||||
Things to be done anytime in the future
|
||||
- effect-board -> live-fx from input
|
||||
- event-system
|
||||
- chord-editor?
|
||||
- WAVE/OGG/MP3-Import -> FFT-analysis -> write notes
|
||||
- FLP-Import
|
||||
- classical note-edit-window -> also ability of printing and maybe later scanning & recognition of notes
|
||||
- add FLAC as export-format?
|
||||
- support of LADSPA for all plugins
|
||||
- better commented source...
|
||||
- optimize, optimize, optimize.....
|
||||
|
||||
266
acinclude.m4
Normal file
266
acinclude.m4
Normal file
@@ -0,0 +1,266 @@
|
||||
# Check for Qt compiler flags, linker flags, and binary packages
|
||||
AC_DEFUN([gw_CHECK_QT],
|
||||
[
|
||||
AC_REQUIRE([AC_PROG_CXX])
|
||||
AC_REQUIRE([AC_PATH_X])
|
||||
|
||||
AC_MSG_CHECKING([QTDIR])
|
||||
AC_ARG_WITH([qtdir], [ --with-qtdir=DIR Qt installation directory [default=$QTDIR]], QTDIR=$withval)
|
||||
# Check that QTDIR is defined or that --with-qtdir given
|
||||
if test x"$QTDIR" = x ; then
|
||||
# some usual Qt-locations
|
||||
QT_SEARCH="/usr /usr/lib/qt /usr/lib/qt3 /usr/lib/qt31 /usr/lib/qt32 /usr/lib/qt33 /usr/lib/qt-3.0 /usr/lib/qt-3.1 /usr/lib/qt-3.2 /usr/lib/qt-3.3 usr/local/qt /usr/local/qt3 /usr/local/qt31/ /usr/local/qt32 /usr/local/qt33 /usr/X11R6 /usr/local/Trolltech/Qt-4.0.0"
|
||||
else
|
||||
QT_SEARCH=$QTDIR
|
||||
QTDIR=""
|
||||
fi
|
||||
for i in $QT_SEARCH ; do
|
||||
QT_INCLUDE_SEARCH="include include/qt include/qt3 include/Qt"
|
||||
for j in $QT_INCLUDE_SEARCH ; do
|
||||
if test -f $i/$j/qglobal.h -a x$QTDIR = x ; then
|
||||
QTDIR=$i
|
||||
QT_INCLUDES=$i/$j
|
||||
fi
|
||||
done
|
||||
done
|
||||
if test x"$QTDIR" = x ; then
|
||||
AC_MSG_ERROR([*** QTDIR must be defined, or --with-qtdir option given])
|
||||
fi
|
||||
AC_MSG_RESULT([$QTDIR])
|
||||
|
||||
# Change backslashes in QTDIR to forward slashes to prevent escaping
|
||||
# problems later on in the build process, mainly for Cygwin build
|
||||
# environment using MSVC as the compiler
|
||||
# TODO: Use sed instead of perl
|
||||
QTDIR=`echo $QTDIR | perl -p -e 's/\\\\/\\//g'`
|
||||
|
||||
AC_MSG_CHECKING([Qt includes])
|
||||
# Check where includes are located
|
||||
if test x"$QT_INCLUDES" = x ; then
|
||||
AC_MSG_ERROR([*** could not find Qt-includes! Make sure you have the Qt-devel-files installed!])
|
||||
fi
|
||||
AC_MSG_RESULT([$QT_INCLUDES])
|
||||
|
||||
# Figure out which version of Qt we are using
|
||||
AC_MSG_CHECKING([Qt version])
|
||||
QT_VER=`grep 'define.*QT_VERSION_STR\W' $QT_INCLUDES/qglobal.h | perl -p -e 's/\D//g'`
|
||||
case "${QT_VER}" in
|
||||
2*)
|
||||
AC_MSG_ERROR([*** Qt 2 is not supported by iTALC. Please upgrade to Qt3!])
|
||||
;;
|
||||
3*)
|
||||
QT_MAJOR="3"
|
||||
;;
|
||||
4*)
|
||||
QT_MAJOR="4"
|
||||
;;
|
||||
*)
|
||||
AC_MSG_ERROR([*** Don't know how to handle this Qt major version])
|
||||
;;
|
||||
esac
|
||||
AC_MSG_RESULT([$QT_VER ($QT_MAJOR)])
|
||||
|
||||
# Check that moc is in path
|
||||
AC_CHECK_PROG(MOC, moc, $QTDIR/bin/moc,,$QTDIR/bin/)
|
||||
if test x$MOC = x ; then
|
||||
AC_CHECK_PROG(MOC, moc-qt3, $QTDIR/bin/moc-qt3,,$QTDIR/bin/)
|
||||
if test x$MOC = x ; then
|
||||
AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools installed!])
|
||||
fi
|
||||
fi
|
||||
|
||||
# uic is the Qt user interface compiler
|
||||
AC_CHECK_PROG(UIC, uic, $QTDIR/bin/uic,,$QTDIR/bin/)
|
||||
if test x$UIC = x ; then
|
||||
AC_MSG_WARN([*** not found! It's currently not needed but should be part of a proper Qt-devel-tools-installation!])
|
||||
fi
|
||||
|
||||
# qembed is the Qt data embedding utility.
|
||||
#AC_CHECK_PROG(QEMBED, qembed, $QTDIR/bin/qembed,,$QTDIR/bin/)
|
||||
#if test x$QEMBED = x ; then
|
||||
# AC_MSG_ERROR([*** not found! Make sure you have Qt-devel-tools/Qt-extensions installed! On some distributions (e.g. SuSE) the package, containing qembed is also called qt3-extensions.])
|
||||
#fi
|
||||
|
||||
# lupdate is the Qt translation-update utility.
|
||||
AC_CHECK_PROG(LUPDATE, lupdate, $QTDIR/bin/lupdate,,$QTDIR/bin/)
|
||||
if test x$LUPDATE = x ; then
|
||||
AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!])
|
||||
fi
|
||||
|
||||
# lrelease is the Qt translation-release utility.
|
||||
AC_CHECK_PROG(LRELEASE, lrelease, $QTDIR/bin/lrelease,,$QTDIR/bin/)
|
||||
if test x$LRELEASE = x ; then
|
||||
AC_MSG_WARN([*** not found! It's not needed just for compiling but should be part of a proper Qt-devel-tools-installation!])
|
||||
fi
|
||||
|
||||
# Calculate Qt include path
|
||||
QT_CXXFLAGS="-I$QT_INCLUDES"
|
||||
if test "$QT_MAJOR" = "4" ; then
|
||||
QT_CXXFLAGS="$QT_CXXFLAGS -I$QTDIR/include"
|
||||
fi
|
||||
|
||||
|
||||
QT_IS_EMBEDDED="no"
|
||||
# On unix, figure out if we're doing a static or dynamic link
|
||||
case "${host}" in
|
||||
*-cygwin)
|
||||
AC_DEFINE_UNQUOTED(WIN32, "", Defined if on Win32 platform)
|
||||
if test -f "$QTDIR/lib/qt.lib" ; then
|
||||
QT_LIB="qt.lib"
|
||||
QT_IS_STATIC="yes"
|
||||
QT_IS_MT="no"
|
||||
elif test -f "$QTDIR/lib/qt-mt.lib" ; then
|
||||
QT_LIB="qt-mt.lib"
|
||||
QT_IS_STATIC="yes"
|
||||
QT_IS_MT="yes"
|
||||
elif test -f "$QTDIR/lib/qt$QT_VER.lib" ; then
|
||||
QT_LIB="qt$QT_VER.lib"
|
||||
QT_IS_STATIC="no"
|
||||
QT_IS_MT="no"
|
||||
elif test -f "$QTDIR/lib/qt-mt$QT_VER.lib" ; then
|
||||
QT_LIB="qt-mt$QT_VER.lib"
|
||||
QT_IS_STATIC="no"
|
||||
QT_IS_MT="yes"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
QT_IS_STATIC=`ls $QTDIR/lib/*.a 2> /dev/null`
|
||||
if test "x$QT_IS_STATIC" = x; then
|
||||
QT_IS_STATIC="no"
|
||||
else
|
||||
QT_IS_STATIC="yes"
|
||||
fi
|
||||
if test x$QT_IS_STATIC = xno ; then
|
||||
QT_IS_DYNAMIC=`ls $QTDIR/lib/*.so 2> /dev/null`
|
||||
if test "x$QT_IS_DYNAMIC" = x; then
|
||||
AC_MSG_ERROR([*** Couldn't find any Qt libraries])
|
||||
fi
|
||||
fi
|
||||
if test "$QT_MAJOR" = "4" ; then
|
||||
QT_IS_MT="yes"
|
||||
QT_LIB="-lQtCore -lQtGui -lQtXml -lQt3Support"
|
||||
else
|
||||
if test "x`ls $QTDIR/lib/libqt-mt.* 2> /dev/null`" != x ; then
|
||||
QT_LIB="-lqt-mt"
|
||||
QT_IS_MT="yes"
|
||||
elif test "x`ls $QTDIR/lib/libqt.* 2> /dev/null`" != x ; then
|
||||
QT_LIB="-lqt"
|
||||
QT_IS_MT="no"
|
||||
elif test "x`ls $QTDIR/lib/libqte.* 2> /dev/null`" != x ; then
|
||||
QT_LIB="-lqte"
|
||||
QT_IS_MT="no"
|
||||
QT_IS_EMBEDDED="yes"
|
||||
elif test "x`ls $QTDIR/lib/libqte-mt.* 2> /dev/null`" != x ; then
|
||||
QT_LIB="-lqte-mt"
|
||||
QT_IS_MT="yes"
|
||||
QT_IS_EMBEDDED="yes"
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
AC_MSG_CHECKING([if Qt is static])
|
||||
AC_MSG_RESULT([$QT_IS_STATIC])
|
||||
AC_MSG_CHECKING([if Qt is multithreaded])
|
||||
if test "$QT_IS_MT" = "no"; then
|
||||
AC_MSG_ERROR([*** your Qt is not multithreaded. That's bad, because multithreading is required for compiling... Please install Qt-mt!])
|
||||
fi
|
||||
AC_MSG_RESULT([$QT_IS_MT])
|
||||
AC_MSG_CHECKING([if Qt is embedded])
|
||||
AC_MSG_RESULT([$QT_IS_EMBEDDED])
|
||||
|
||||
QT_GUILINK=""
|
||||
QASSISTANTCLIENT_LDADD="-lqassistantclient"
|
||||
QT_LIBS="$QT_LIB"
|
||||
|
||||
case "${host}" in
|
||||
*irix*)
|
||||
QT_LIBS="$QT_LIB"
|
||||
if test $QT_IS_STATIC = yes ; then
|
||||
QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE"
|
||||
fi
|
||||
;;
|
||||
|
||||
*linux*)
|
||||
QT_LIBS="$QT_LIB"
|
||||
if test $QT_IS_STATIC = yes && test $QT_IS_EMBEDDED = no; then
|
||||
QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE -ldl -ljpeg"
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
*osf*)
|
||||
# Digital Unix (aka DGUX aka Tru64)
|
||||
QT_LIBS="$QT_LIB"
|
||||
if test $QT_IS_STATIC = yes ; then
|
||||
QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE"
|
||||
fi
|
||||
;;
|
||||
|
||||
*solaris*)
|
||||
QT_LIBS="$QT_LIB"
|
||||
if test $QT_IS_STATIC = yes ; then
|
||||
QT_LIBS="$QT_LIBS -L$x_libraries -lXext -lX11 -lm -lSM -lICE -lresolv -lsocket -lnsl"
|
||||
fi
|
||||
;;
|
||||
|
||||
|
||||
*win*)
|
||||
# linker flag to suppress console when linking a GUI app on Win32
|
||||
QT_GUILINK="/subsystem:windows"
|
||||
|
||||
if test $QT_MAJOR = "3" ; then
|
||||
if test $QT_IS_MT = yes ; then
|
||||
QT_LIBS="/nodefaultlib:libcmt"
|
||||
else
|
||||
QT_LIBS="/nodefaultlib:libc"
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $QT_IS_STATIC = yes ; then
|
||||
QT_LIBS="$QT_LIBS $QT_LIB kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib shell32.lib imm32.lib advapi32.lib wsock32.lib winspool.lib winmm.lib netapi32.lib"
|
||||
if test $QT_MAJOR = "3" ; then
|
||||
QT_LIBS="$QT_LIBS qtmain.lib"
|
||||
fi
|
||||
else
|
||||
QT_LIBS="$QT_LIBS $QT_LIB"
|
||||
if test $QT_MAJOR = "3" ; then
|
||||
QT_CXXFLAGS="$QT_CXXFLAGS -DQT_DLL"
|
||||
QT_LIBS="$QT_LIBS qtmain.lib qui.lib user32.lib netapi32.lib"
|
||||
fi
|
||||
fi
|
||||
QASSISTANTCLIENT_LDADD="qassistantclient.lib"
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
|
||||
if test x"$QT_IS_EMBEDDED" = "xyes" ; then
|
||||
QT_CXXFLAGS="-DQWS $QT_CXXFLAGS"
|
||||
fi
|
||||
|
||||
if test x"$QT_IS_MT" = "xyes" ; then
|
||||
QT_CXXFLAGS="$QT_CXXFLAGS -D_REENTRANT -DQT_THREAD_SUPPORT"
|
||||
QT_LIBS="$QT_LIBS -lpthread"
|
||||
fi
|
||||
|
||||
QT_LDADD="-L$QTDIR/lib $QT_LIBS"
|
||||
|
||||
#if test x$QT_IS_STATIC = xyes ; then
|
||||
# OLDLIBS="$LIBS"
|
||||
# LIBS="$QT_LDADD"
|
||||
# AC_CHECK_LIB(Xft, XftFontOpen, QT_LDADD="$QT_LDADD -lXft")
|
||||
# LIBS="$LIBS"
|
||||
#fi
|
||||
|
||||
AC_MSG_CHECKING([QT_CXXFLAGS])
|
||||
AC_MSG_RESULT([$QT_CXXFLAGS])
|
||||
AC_MSG_CHECKING([QT_LDADD])
|
||||
AC_MSG_RESULT([$QT_LDADD])
|
||||
|
||||
AC_SUBST(QT_CXXFLAGS)
|
||||
AC_SUBST(QT_LDADD)
|
||||
AC_SUBST(QT_GUILINK)
|
||||
AC_SUBST(QASSISTANTCLIENT_LDADD)
|
||||
|
||||
])
|
||||
210
buildtools/bin2res.cpp
Normal file
210
buildtools/bin2res.cpp
Normal file
@@ -0,0 +1,210 @@
|
||||
/*
|
||||
* bin2res.cpp - generate embedded resources from binary data (based on qembed)
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
static void embedData( const char * _input, int _size, std::ostream & _output );
|
||||
static std::string convertFileNameToCIdentifier( const std::string & _s );
|
||||
|
||||
|
||||
struct embed
|
||||
{
|
||||
unsigned int size;
|
||||
std::string name;
|
||||
std::string cname;
|
||||
} ;
|
||||
|
||||
typedef std::vector<std::string> stringlist;
|
||||
|
||||
const int MAX_FILE_SIZE = 256*256*256; // = 16 MB
|
||||
|
||||
|
||||
int main( int argc, char * * argv )
|
||||
{
|
||||
if( argc < 2 )
|
||||
{
|
||||
std::cerr << "Usage:" << std::endl << "\t" << argv[0] <<
|
||||
" files" << std::endl;
|
||||
return( 1 );
|
||||
}
|
||||
|
||||
std::cout << "// Generated by bin2res" << std::endl;
|
||||
|
||||
std::vector<embed *> embedded_data;
|
||||
|
||||
std::cout << "#ifndef _EMBEDDED_RESOURCES_H" << std::endl;
|
||||
std::cout << "#define _EMBEDDED_RESOURCES_H" << std::endl;
|
||||
|
||||
stringlist files;
|
||||
for( int i = 1; i < argc; ++i )
|
||||
{
|
||||
files.push_back( argv[i] );
|
||||
}
|
||||
for( stringlist::iterator it = files.begin(); it != files.end(); ++it )
|
||||
{
|
||||
std::ifstream f( it->c_str() );
|
||||
if( f.fail() )
|
||||
{
|
||||
std::cerr << "Cannot open file " << *it <<
|
||||
", ignoring it" << std::endl;
|
||||
continue;
|
||||
}
|
||||
f.seekg( 0, std::ios::end );
|
||||
int fsize = f.tellg();
|
||||
f.seekg( 0 );
|
||||
if( fsize == 0 || fsize > MAX_FILE_SIZE )
|
||||
{
|
||||
std::cerr << "File " << *it << " has zero size or is "
|
||||
"too large to be processed with bin2res." <<
|
||||
std::endl;
|
||||
}
|
||||
char * data = new char[fsize];
|
||||
f.read( data, fsize );
|
||||
embed * e = new embed;
|
||||
e->size = fsize;
|
||||
if( it->rfind( '/' ) != std::string::npos )
|
||||
{
|
||||
e->name = std::string( it->c_str() +
|
||||
it->rfind( '/' ) + 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
e->name = *it;
|
||||
}
|
||||
e->cname = convertFileNameToCIdentifier( e->name );
|
||||
embedded_data.push_back( e );
|
||||
std::string s;
|
||||
std::cout << "static const unsigned char " << e->cname <<
|
||||
"_data[] = {";
|
||||
embedData( data, fsize, std::cout );
|
||||
std::cout << std::endl << "};" << std::endl << std::endl;
|
||||
delete[] data;
|
||||
}
|
||||
|
||||
if( embedded_data.size() > 0 )
|
||||
{
|
||||
std::cout << "static const unsigned char dummy_data[] ="
|
||||
"{ 0x00 };" << std::endl << std::endl;
|
||||
embed * dummy = new embed;
|
||||
dummy->size = 1;
|
||||
dummy->name = "dummy";
|
||||
dummy->cname = convertFileNameToCIdentifier( "dummy" );
|
||||
embedded_data.push_back( dummy );
|
||||
|
||||
std::cout << "#include <string.h>" << std::endl;
|
||||
std::cout << "static struct embedDesc" << std::endl
|
||||
<< "{" << std::endl
|
||||
<< " int size;" << std::endl
|
||||
<< " const unsigned char * data;" <<
|
||||
std::endl
|
||||
<< " const char * name;" << std::endl
|
||||
<< "} embed_vec[] = {" << std::endl;
|
||||
while( embedded_data.size() > 0 )
|
||||
{
|
||||
embed * e = embedded_data[0];
|
||||
std::cout << " { " << e->size << ", " << e->cname <<
|
||||
"_data, " << "\"" << e->name <<
|
||||
"\" }," << std::endl;
|
||||
delete e;
|
||||
embedded_data.erase( embedded_data.begin() );
|
||||
}
|
||||
std::cout << " { 0, 0, 0 }" << std::endl << "};" << std::endl
|
||||
<< std::endl
|
||||
<< "static const embedDesc & findEmbeddedData( "
|
||||
"const char * _name )" << std::endl
|
||||
<< "{" << std::endl
|
||||
<< " for( int i = 0; embed_vec[i].data; "
|
||||
"i++ )" << std::endl
|
||||
<< " {" << std::endl
|
||||
<< " if( strcmp( embed_vec[i].name, "
|
||||
"_name ) == 0 )" << std::endl
|
||||
<< " {" << std::endl
|
||||
<< " return( "
|
||||
"embed_vec[i] );" << std::endl
|
||||
<< " }" << std::endl
|
||||
<< " }" << std::endl
|
||||
/* << " printf( \"warning: embedded resource "
|
||||
"%s not found!\\n\", _name );"
|
||||
<< std::endl*/
|
||||
<< " return( findEmbeddedData( "
|
||||
"\"dummy\" ) );" << std::endl
|
||||
<< "}" << std::endl << std::endl;
|
||||
}
|
||||
std::cout << "#endif" << std::endl;
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
std::string convertFileNameToCIdentifier( const std::string & _s )
|
||||
{
|
||||
std::string r = _s;
|
||||
int len = r.length();
|
||||
if ( len > 0 && !isalpha( (char)r[0] ) )
|
||||
{
|
||||
r[0] = '_';
|
||||
}
|
||||
for ( int i = 1; i < len; i++ )
|
||||
{
|
||||
if ( !isalnum( (char)r[i] ) )
|
||||
{
|
||||
r[i] = '_';
|
||||
}
|
||||
}
|
||||
return( r );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void embedData( const char * _input, int _nbytes, std::ostream & _output )
|
||||
{
|
||||
static const char hexdigits[] = "0123456789abcdef";
|
||||
std::string s;
|
||||
for( int i = 0; i < _nbytes; i++ )
|
||||
{
|
||||
if( ( i%14 ) == 0 )
|
||||
{
|
||||
s += "\n ";
|
||||
_output << s;
|
||||
s = "";
|
||||
}
|
||||
unsigned int v = _input[i];
|
||||
s += "0x";
|
||||
s += hexdigits[(v >> 4) & 15];
|
||||
s += hexdigits[v & 15];
|
||||
if( i < _nbytes-1 )
|
||||
{
|
||||
s += ',';
|
||||
}
|
||||
}
|
||||
if ( s.length() )
|
||||
{
|
||||
_output << s;
|
||||
}
|
||||
}
|
||||
|
||||
496
configure.in
Normal file
496
configure.in
Normal file
@@ -0,0 +1,496 @@
|
||||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(lmms, 0.1.1, tobydox@users.sourceforge.net)
|
||||
#AC_INIT(acinclude.m4)
|
||||
AM_INIT_AUTOMAKE(lmms, 0.1.1)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AC_PROG_LN_S
|
||||
|
||||
|
||||
AC_PATH_XTRA
|
||||
gw_CHECK_QT
|
||||
|
||||
|
||||
# checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADERS([fcntl.h memory.h string.h sys/ioctl.h unistd.h stdlib.h])
|
||||
|
||||
# checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
AC_HEADER_TIME
|
||||
AC_STRUCT_TM
|
||||
AC_C_VOLATILE
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
# checks for library functions.
|
||||
AC_FUNC_ALLOCA
|
||||
AC_PROG_GCC_TRADITIONAL
|
||||
AC_FUNC_MALLOC
|
||||
AC_FUNC_MEMCMP
|
||||
AC_TYPE_SIGNAL
|
||||
|
||||
AC_CHECK_FUNCS([usleep])
|
||||
|
||||
|
||||
# search for include-path of SDL (just for supporting the FreeBSD-guys.... ;-)
|
||||
for i in SDL SDL10 SDL11 SDL12 ; do
|
||||
FOUND=""
|
||||
AC_CHECK_HEADER($i/SDL.h, FOUND="true")
|
||||
if test "$FOUND" = "true" ; then
|
||||
SDL_INC_PATH="$i"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
AH_TEMPLATE(SDL_SDL_H, [Define to location of SDL.h])
|
||||
AH_TEMPLATE(SDL_SDL_AUDIO_H, [Define to location of SD_audio.h])
|
||||
AH_TEMPLATE(SDL_SDL_SOUND_H, [Define to location of SDL_sound.h])
|
||||
|
||||
OLD_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lpthread"
|
||||
|
||||
# check for SDL-lib
|
||||
AC_ARG_WITH(sdl,
|
||||
AS_HELP_STRING([--without-sdl],
|
||||
[disable support for SDL-audio-output]), ,
|
||||
[ with_sdlaudio=yes ])
|
||||
AH_TEMPLATE(HAVE_SDL_SDL_AUDIO_H, [Define to 1 if you have the $SDL_INC_PATH/SDL_audio.h header file.])
|
||||
if test "x$with_sdlaudio" = "xyes" -a ! -z "$SDL_INC_PATH"; then
|
||||
AC_CHECK_HEADER($SDL_INC_PATH/SDL_audio.h, HAVE_SDL_SDL_AUDIO_H="true")
|
||||
AC_CHECK_LIB([SDL], [SDL_OpenAudio], HAVE_LIBSDL="true", HAVE_SDL_SDL_AUDIO_H="")
|
||||
fi
|
||||
if test ! -z "$HAVE_SDL_SDL_AUDIO_H" ; then
|
||||
AC_DEFINE_UNQUOTED(SDL_SDL_H, <$SDL_INC_PATH/SDL.h>)
|
||||
AC_DEFINE_UNQUOTED(SDL_SDL_AUDIO_H, <$SDL_INC_PATH/SDL_audio.h>)
|
||||
AC_DEFINE(HAVE_SDL_SDL_AUDIO_H)
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_LIBSDL, test ! -z "$HAVE_SDL_SDL_AUDIO_H")
|
||||
|
||||
|
||||
# check for SDL_sound-lib
|
||||
AC_ARG_WITH(sdlsound,
|
||||
AS_HELP_STRING([--without-sdlsound],
|
||||
[disable support for reading samples via SDL_sound]), ,
|
||||
[ with_sdlsound=yes ])
|
||||
AH_TEMPLATE(HAVE_SDL_SDL_SOUND_H, [Define to 1 if you have the $SDL_INCL_PATH/SDL_sound.h header file.])
|
||||
if test "x$with_sdlsound" = "xyes" -a ! -z "$SDL_INC_PATH"; then
|
||||
AC_CHECK_HEADER($SDL_INC_PATH/SDL_sound.h, HAVE_SDL_SDL_SOUND_H="true")
|
||||
AC_CHECK_LIB([SDL_sound], [Sound_Init], HAVE_LIBSDL_SOUND="true", HAVE_SDL_SDL_SOUND_H="")
|
||||
fi
|
||||
if test ! -z "$HAVE_SDL_SDL_SOUND_H" ; then
|
||||
AC_DEFINE_UNQUOTED(SDL_SDL_SOUND_H, <$SDL_INC_PATH/SDL_sound.h>)
|
||||
AC_DEFINE(HAVE_SDL_SDL_SOUND_H)
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_LIBSDL_SOUND, test ! -z "$HAVE_LIBSDL_SOUND")
|
||||
|
||||
LIBS="$OLD_LIBS"
|
||||
|
||||
|
||||
# check for ALSA-lib
|
||||
AC_ARG_WITH(asound,
|
||||
AS_HELP_STRING([--without-asound],
|
||||
[disable support for ALSA-sound-output]), ,
|
||||
[ with_asound=yes ])
|
||||
AH_TEMPLATE(HAVE_ALSA_ASOUNDLIB_H, [Define to 1 if you have the alsa/asoundlib.h header file.])
|
||||
if test "x$with_asound" = "xyes" ; then
|
||||
AC_CHECK_HEADER(alsa/asoundlib.h, HAVE_ALSA_ASOUNDLIB_H="true")
|
||||
AC_CHECK_LIB([asound], [snd_pcm_open], HAVE_LIBASOUND="true", HAVE_ALSA_ASOUNDLIB_H="")
|
||||
fi
|
||||
if test ! -z "$HAVE_ALSA_ASOUNDLIB_H" ; then
|
||||
AC_DEFINE(HAVE_ALSA_ASOUNDLIB_H)
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_LIBASOUND, test ! -z "$HAVE_ALSA_ASOUNDLIB_H")
|
||||
|
||||
|
||||
# check for JACK
|
||||
AC_ARG_WITH(jack,
|
||||
AS_HELP_STRING([--without-jack],
|
||||
[disable support for JACK-transport]), ,
|
||||
[ with_jack=yes ])
|
||||
AH_TEMPLATE(HAVE_JACK_JACK_H, [Define to 1 if you have the jack/jack.h header file.])
|
||||
AH_TEMPLATE(OLD_JACK, [Define to 1 if your JACK-version doesnt know about jack_client_open() etc.])
|
||||
if test "x$with_jack" = "xyes" ; then
|
||||
AC_CHECK_HEADER(jack/jack.h, HAVE_JACK_JACK_H="true")
|
||||
AC_CHECK_LIB([jack], [jack_client_new], HAVE_LIBJACK="true", HAVE_JACK_JACK_H="")
|
||||
AC_CHECK_LIB([jack], [jack_client_open], JACK_CLIENT_OPEN="true")
|
||||
if test -z "$JACK_CLIENT_OPEN" ; then
|
||||
AC_DEFINE(OLD_JACK)
|
||||
fi
|
||||
fi
|
||||
if test ! -z "$HAVE_JACK_JACK_H" ; then
|
||||
AC_DEFINE(HAVE_JACK_JACK_H)
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_LIBJACK, test ! -z "$HAVE_JACK_JACK_H")
|
||||
|
||||
|
||||
# check for vorbis-lib
|
||||
AC_ARG_WITH(vorbis,
|
||||
AS_HELP_STRING([--without-vorbis],
|
||||
[disable support for exporting song to OGG-files]), ,
|
||||
[ with_vorbis=yes ])
|
||||
AH_TEMPLATE(HAVE_VORBIS_CODEC_H, [Define to 1 if you have the vorbis/codec.h header file.])
|
||||
AH_TEMPLATE(HAVE_VORBIS_VORBISENC_H, [Define to 1 if you have the vorbis/vorbisenc.h header file.])
|
||||
AH_TEMPLATE(HAVE_VORBIS_VORBISFILE_H, [Define to 1 if you have the vorbis/vorbisfile.h header file.])
|
||||
if test "x$with_vorbis" = "xyes" ; then
|
||||
OGG_SUPPORT="true"
|
||||
AC_CHECK_HEADER(vorbis/codec.h, HAVE_VORBIS_CODEC_H="true",OGG_SUPPORT="")
|
||||
AC_CHECK_HEADER(vorbis/vorbisenc.h, HAVE_VORBIS_VORBISENC_H="true",OGG_SUPPORT="")
|
||||
AC_CHECK_HEADER(vorbis/vorbisfile.h, HAVE_VORBIS_VORBISFILE_H="true",OGG_SUPPORT="")
|
||||
AC_CHECK_LIB([vorbis], [vorbis_analysis], HAVE_LIBVORBIS="true", OGG_SUPPORT="")
|
||||
fi
|
||||
if test ! -z "$OGG_SUPPORT" ; then
|
||||
AC_DEFINE(HAVE_VORBIS_CODEC_H)
|
||||
AC_DEFINE(HAVE_VORBIS_VORBISENC_H)
|
||||
AC_DEFINE(HAVE_VORBIS_VORBISFILE_H)
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_LIBVORBIS, test ! -z "$OGG_SUPPORT")
|
||||
|
||||
|
||||
# check for libsamplerate
|
||||
AC_ARG_WITH(src,
|
||||
AS_HELP_STRING([--without-libsrc],
|
||||
[disable support for resampling via libsamplerate]), ,
|
||||
[ with_libsrc=yes ])
|
||||
AH_TEMPLATE(HAVE_SAMPLERATE_H, [Define to 1 if you have the samplerate.h header file.])
|
||||
if test "x$with_libsrc" = "xyes" ; then
|
||||
AC_CHECK_HEADER(samplerate.h, HAVE_SAMPLERATE_H="true")
|
||||
AC_CHECK_LIB([samplerate], [src_simple], HAVE_LIBSRC="true", HAVE_SAMPLERATE_H="")
|
||||
fi
|
||||
if test ! -z "$HAVE_SAMPLERATE_H" ; then
|
||||
AC_DEFINE(HAVE_SAMPLERATE_H)
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_LIBSRC, test ! -z "$HAVE_SAMPLERATE_H")
|
||||
|
||||
|
||||
# libsndfile-stuff
|
||||
AC_ARG_WITH(src,
|
||||
AS_HELP_STRING([--without-libsf],
|
||||
[disable support for importing files via libsndfile]), ,
|
||||
[ with_libsf=yes ])
|
||||
AH_TEMPLATE(HAVE_SNDFILE_H, [Define to 1 if you have the sndfile.h header file.])
|
||||
if test "x$with_libsf" = "xyes" ; then
|
||||
AC_CHECK_HEADER(sndfile.h, HAVE_SNDFILE_H="true")
|
||||
AC_CHECK_LIB([sndfile], [sf_command], HAVE_LIBSF="true", HAVE_SNDFILE_H="")
|
||||
AC_MSG_CHECKING([version of libsndfile])
|
||||
AH_TEMPLATE(OLD_SNDFILE, [Define to 1 if libsndfile < 1.0.11])
|
||||
OLD_LIBS="$LIBS"
|
||||
LIBS="$LIBS -lsndfile"
|
||||
AC_RUN_IFELSE([ #include <sndfile.h>
|
||||
int main( void )
|
||||
{
|
||||
SF_INFO si;
|
||||
( void )sf_open( "", SFM_READ, &si );
|
||||
return 0;
|
||||
}],
|
||||
AC_MSG_RESULT([>= 1.0.11]),
|
||||
AC_MSG_RESULT([< 1.0.11])
|
||||
AC_DEFINE(OLD_SNDFILE)
|
||||
)
|
||||
LIBS="$OLD_LIBS"
|
||||
fi
|
||||
if test ! -z "$HAVE_SNDFILE_H" ; then
|
||||
AC_DEFINE(HAVE_SNDFILE_H)
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_LIBSF, test ! -z "$HAVE_SNDFILE_H")
|
||||
|
||||
AC_ARG_WITH(nosmpdecs,
|
||||
AS_HELP_STRING([--without-sample-decoders],
|
||||
[force compiling LMMS even if libraries for sample-decoding were found]),
|
||||
[ with_smpdecs=yes ])
|
||||
|
||||
if test -z "$HAVE_SND_FILE" -a -z "$HAVE_SDL_SDL_SOUND_H" -a -z "$OGG_SUPPORT" -a ! -z "$with_smpdecs"; then
|
||||
AC_MSG_ERROR([*** neither libsndfile nor SDL_sound nor libvorbis (or according devel-files) were found which would make LMMS unable to load any samples, so please install at least one of the packages and try again! Use --without-sample-decoders to force compiling LMMS.])
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# check whether to disable surround-support
|
||||
AC_MSG_CHECKING([whether to disable surround-support])
|
||||
AH_TEMPLATE(DISABLE_SURROUND, [Define if you want to disable surround-support in LMMS.])
|
||||
AC_ARG_ENABLE([surround],
|
||||
AS_HELP_STRING([--disable-surround],
|
||||
[compile LMMS without surround-support]),
|
||||
DISABLE_SURROUND="yes")
|
||||
if test "x$DISABLE_SURROUND" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(DISABLE_SURROUND)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
|
||||
# check whether to enable high-quality sinc-resampling
|
||||
AC_MSG_CHECKING([whether to enable high quality sinc-resampling])
|
||||
AH_TEMPLATE(HQ_SINC, [Define if you want to enable high quality sinc-resampling.])
|
||||
AC_ARG_ENABLE([hqsinc],
|
||||
AS_HELP_STRING([--enable-hqsinc],
|
||||
[enable high quality sinc-resampling]), HQ_SINC="yes")
|
||||
if test "x$HQ_SINC" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(HQ_SINC)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
|
||||
# check whether compiler of current platform supports attribute regparm(x)
|
||||
AC_MSG_CHECKING([whether we can use function-attribute regparm(x) on current platform])
|
||||
AH_TEMPLATE(FASTCALL, [Define to any attribute, speeding up function-calls])
|
||||
AC_RUN_IFELSE([ int __attribute__((regparm(3))) foo( int a, int b, int c )
|
||||
{ return( a=b=c ); }
|
||||
int __attribute__((regparm(3))) main( void )
|
||||
{ return( foo(2,1,0) ); }],
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(FASTCALL, [__attribute__((regparm(3)))]),
|
||||
AC_MSG_RESULT(no)
|
||||
AC_DEFINE_UNQUOTED(FASTCALL,[])
|
||||
)
|
||||
|
||||
|
||||
AC_MSG_CHECKING([whether floorf is known by compiler])
|
||||
AH_TEMPLATE(floorf, [Define to floor if floorf is not known])
|
||||
AC_TRY_LINK([#include <math.h>], [ floorf ],
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT([no - will use floor instead])
|
||||
AC_DEFINE(floorf, floor)
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether powf is known by compiler])
|
||||
AH_TEMPLATE(powf, [Define to pow if powf is not known])
|
||||
AC_TRY_LINK([#include <math.h>], [ powf ],
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT([no - will use pow instead])
|
||||
AC_DEFINE(powf, pow)
|
||||
)
|
||||
|
||||
AC_MSG_CHECKING([whether fabsf is known by compiler])
|
||||
AH_TEMPLATE(fabsf, [Define to pow if fabsf is not known])
|
||||
AC_TRY_LINK([#include <math.h>], [ fabsf ],
|
||||
AC_MSG_RESULT(yes),
|
||||
AC_MSG_RESULT([no - will use fabs instead])
|
||||
AC_DEFINE(fabsf, fabs)
|
||||
)
|
||||
|
||||
|
||||
# check whether to enable debugging-code
|
||||
AC_MSG_CHECKING([whether to enable debugging-code])
|
||||
AH_TEMPLATE(LMMS_DEBUG, [Define if you want to disable debbuging-code in LMMS.])
|
||||
AC_ARG_ENABLE([debug],
|
||||
AS_HELP_STRING([--enable-debug],
|
||||
[compile LMMS with additional debugging support]), DEBUG="yes")
|
||||
if test "x$DEBUG" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
AC_DEFINE(LMMS_DEBUG)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
|
||||
|
||||
# check for rpm SOURCES path
|
||||
echo -n "checking for rpm sources path... "
|
||||
RPMSOURCEDIR="NOT-FOUND"
|
||||
for directory in packages OpenLinux redhat RedHat rpm RPM "" ; do
|
||||
if test -d /usr/src/${directory}/SOURCES ; then
|
||||
RPMSOURCEDIR="/usr/src/${directory}/SOURCES/"
|
||||
fi
|
||||
done
|
||||
echo "$RPMSOURCEDIR"
|
||||
AM_CONDITIONAL(HAVE_RPM, test "$RPMSOURCEDIR" != "NOT-FOUND")
|
||||
AC_SUBST(RPMSOURCEDIR)
|
||||
|
||||
lmmsdatadir="$datadir/$PACKAGE"
|
||||
AC_SUBST(lmmsdatadir)
|
||||
|
||||
|
||||
CXXFLAGS="$CXXFLAGS -g0"
|
||||
if test $CXX == "g++" ; then
|
||||
CXXFLAGS="$CXXFLAGS -ansi -Wall -fno-exceptions"
|
||||
fi
|
||||
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
artwork/Makefile
|
||||
locale/Makefile
|
||||
midi-maps/Makefile
|
||||
presets/Makefile
|
||||
presets/AudioFileProcessor/Makefile
|
||||
presets/MIDI-Out/Makefile
|
||||
presets/PluckedStringSynth/Makefile
|
||||
presets/TripleOscillator/Makefile
|
||||
projects/Makefile
|
||||
projects/cool_songs/Makefile
|
||||
projects/covers/Makefile
|
||||
projects/demos/Makefile
|
||||
projects/misc/Makefile
|
||||
projects/recorded_loops/Makefile
|
||||
projects/templates/Makefile
|
||||
projects/tutorials/Makefile
|
||||
samples/Makefile
|
||||
samples/basses/Makefile
|
||||
samples/bassloopes/Makefile
|
||||
samples/beats/Makefile
|
||||
samples/drums/Makefile
|
||||
samples/effects/Makefile
|
||||
samples/instruments/Makefile
|
||||
samples/latin/Makefile
|
||||
samples/misc/Makefile
|
||||
samples/shapes/Makefile
|
||||
samples/stringsnpads/Makefile
|
||||
lmms.spec])
|
||||
AC_OUTPUT
|
||||
|
||||
with_warnings="false"
|
||||
|
||||
echo
|
||||
echo
|
||||
|
||||
|
||||
if test -z "$OGG_SUPPORT" ; then
|
||||
echo " ========================"
|
||||
echo " === LMMS - WARNING ======================================================="
|
||||
echo " ========================"
|
||||
echo " ="
|
||||
echo " = You don't seem to have libvorbis installed and/or libvorbis-development-"
|
||||
echo " = package is missing. This will disable support for exporting songs to"
|
||||
echo " = OGG-files! If also SDL_sound is missing, you'll not be able to use the "
|
||||
echo " = samples coming with LMMS since libsndfile currently has no OGG-support!"
|
||||
echo " = Consider installing the missing packages for using the full power of LMMS."
|
||||
echo " ="
|
||||
with_warnings="true"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test -z "$HAVE_ALSA_ASOUNDLIB_H" ; then
|
||||
echo " ========================"
|
||||
echo " === LMMS - WARNING ======================================================="
|
||||
echo " ========================"
|
||||
echo " ="
|
||||
echo " = You don't seem to have ALSA-library installed and/or ALSA-lib-development-"
|
||||
echo " = package is missing. This will disable support for sound-output via ALSA!"
|
||||
echo " = If you use ALSA-driver for your soundcard there will be no sound-output!"
|
||||
echo " = Consider installing the missing packages for using the full power of LMMS."
|
||||
echo " ="
|
||||
with_warnings="true"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test -z "$HAVE_JACK_JACK_H" ; then
|
||||
echo " ========================"
|
||||
echo " === LMMS - WARNING ======================================================="
|
||||
echo " ========================"
|
||||
echo " ="
|
||||
echo " = You don't seem to have JACK-library installed and/or JACK-lib-development-"
|
||||
echo " = package is missing. This will disable support for JACK-transport."
|
||||
echo " = This is no problem but you'll miss the great possibilities of interacting"
|
||||
echo " = with other sound-applications in realtime!"
|
||||
echo " = Consider installing the missing packages for using the full power of LMMS."
|
||||
echo " ="
|
||||
with_warnings="true"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if test -z "$HAVE_SDL_SDL_AUDIO_H" ; then
|
||||
echo " ========================"
|
||||
echo " === LMMS - WARNING ======================================================="
|
||||
echo " ========================"
|
||||
echo " ="
|
||||
echo " = You don't seem to have SDL-library installed and/or SDL-lib-development-"
|
||||
echo " = package is missing. This will disable support for sound-output via SDL, "
|
||||
echo " = which is important, if you're using sound-daemons (arts, ESD, JACK etc.)"
|
||||
echo " = When compiling without SDL, you'll always have to kill your sound-daemon"
|
||||
echo " = before using LMMS...!"
|
||||
echo " = Consider installing the missing packages for using the full power of LMMS."
|
||||
echo " ="
|
||||
with_warnings="true"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
if test -z "$HAVE_SDL_SDL_SOUND_H" ; then
|
||||
echo " ========================"
|
||||
echo " === LMMS - WARNING ======================================================="
|
||||
echo " ========================"
|
||||
echo " ="
|
||||
echo " = You don't seem to have SDL_sound-library installed and/or SDL_sound-"
|
||||
echo " = development-package is missing. This means that you can only load samples"
|
||||
echo " = within LMMS if you have libsndfile and libvorbis installed!"
|
||||
echo " = Consider installing the missing packages for using the full power of LMMS."
|
||||
echo " ="
|
||||
with_warnings="true"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
if test -z "$HAVE_SNDFILE_H" ; then
|
||||
echo " ========================"
|
||||
echo " === LMMS - WARNING ======================================================="
|
||||
echo " ========================"
|
||||
echo " ="
|
||||
echo " = You don't seem to have libsndfile installed and/or libsndfile-development-"
|
||||
echo " = package is missing. This is not that fatal as long as you have SDL_sound"
|
||||
echo " = installed. Otherwise it's strongly recommended to install libsndfile and"
|
||||
echo " = libvorbis for being able to use samples within LMMS."
|
||||
echo " = Consider installing the missing packages for using the full power of LMMS."
|
||||
echo " ="
|
||||
with_warnings="true"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
if test -z "$HAVE_SAMPLERATE_H" ; then
|
||||
echo " ========================"
|
||||
echo " === LMMS - WARNING ======================================================="
|
||||
echo " ========================"
|
||||
echo " ="
|
||||
echo " = You don't seem to have libsamplerate installed and/or libsamplerate-"
|
||||
echo " = development-package is missing. This will disable resampling with"
|
||||
echo " = libsamplerate and results in worse quality! Currently LMMS will also"
|
||||
echo " = crash more often, because internal sample-rate-converter has some bugs..."
|
||||
echo " = Consider installing the missing packages for using the full power of LMMS."
|
||||
echo " ="
|
||||
with_warnings="true"
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
echo
|
||||
echo
|
||||
echo " ============================"
|
||||
echo " === LMMS - INFORMATION ==================================================="
|
||||
echo " ============================"
|
||||
echo " ="
|
||||
if test "$with_warnings" = "false" ; then
|
||||
echo " = LMMS has been configured successfully. Now you can build it by typing 'make'."
|
||||
echo " = After the compilation-process has finished, you can install LMMS by"
|
||||
echo " = typing 'make install'."
|
||||
else
|
||||
echo " = LMMS has been configured, but there were one or more warnings you should"
|
||||
echo " = not ignore. First try to solve the mentioned problems before"
|
||||
echo " = proceeding. Otherwise don't complain, if LMMS doesn't run the way"
|
||||
echo " = you might expect..."
|
||||
fi
|
||||
echo " ="
|
||||
echo " = If there're problems while compiling LMMS, please send a mail to "
|
||||
echo " = tobydox@users.sourceforge.net!"
|
||||
echo " ="
|
||||
echo
|
||||
|
||||
69
include/about_dialog.h
Normal file
69
include/about_dialog.h
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* about_dialog.h - declaration of class aboutDialog
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ABOUT_DIALOG_H
|
||||
#define _ABOUT_DIALOG_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdialog.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class QPushButton;
|
||||
class QLabel;
|
||||
class QTabWidget;
|
||||
|
||||
|
||||
class aboutDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
aboutDialog( void );
|
||||
~aboutDialog();
|
||||
|
||||
|
||||
protected:
|
||||
void keyPressEvent( QKeyEvent * _ke );
|
||||
void resizeEvent( QResizeEvent * _re );
|
||||
|
||||
|
||||
private:
|
||||
QPushButton * m_okBtn;
|
||||
QLabel * m_iconLbl;
|
||||
QLabel * m_appNameLbl;
|
||||
QTabWidget * m_aboutTabs;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
138
include/arp_and_chords_tab_widget.h
Normal file
138
include/arp_and_chords_tab_widget.h
Normal file
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* arp_and_chords_tab_widget.h - declaration of class arpAndChordWidget which
|
||||
* provides code for using arpeggio and chords
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ARP_AND_CHORDS_TAB_WIDGET_H
|
||||
#define _ARP_AND_CHORDS_TAB_WIDGET_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "settings.h"
|
||||
#include "types.h"
|
||||
|
||||
|
||||
class channelTrack;
|
||||
class groupBox;
|
||||
class knob;
|
||||
class pixmapButton;
|
||||
class QComboBox;
|
||||
class QPixmap;
|
||||
class notePlayHandle;
|
||||
|
||||
|
||||
const int MAX_CHORD_POLYPHONY = 10;
|
||||
|
||||
|
||||
class arpAndChordsTabWidget : public QWidget, public settings
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
arpAndChordsTabWidget( channelTrack * _channel_track,
|
||||
QWidget * _parent );
|
||||
~arpAndChordsTabWidget();
|
||||
|
||||
static struct chord
|
||||
{
|
||||
const QString name;
|
||||
Sint8 interval[MAX_CHORD_POLYPHONY];
|
||||
} s_chords[];
|
||||
|
||||
void FASTCALL processNote( notePlayHandle * _n );
|
||||
static inline int getChordSize( chord & _c )
|
||||
{
|
||||
int idx = 0;
|
||||
while( _c.interval[idx] != -1 )
|
||||
{
|
||||
++idx;
|
||||
}
|
||||
return( idx );
|
||||
}
|
||||
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "arpandchords" );
|
||||
}
|
||||
|
||||
|
||||
|
||||
protected slots:
|
||||
// void arpOffToggled( bool );
|
||||
void arpUpToggled( bool );
|
||||
void arpDownToggled( bool );
|
||||
void arpUpAndDownToggled( bool );
|
||||
void arpRandomToggled( bool );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum arpDirections
|
||||
{
|
||||
OFF,
|
||||
UP,
|
||||
DOWN,
|
||||
UP_AND_DOWN,
|
||||
RANDOM
|
||||
} m_arpDirection;
|
||||
|
||||
channelTrack * m_channelTrack;
|
||||
|
||||
// chord-stuff
|
||||
groupBox * m_chordsGroupBox;
|
||||
QComboBox * m_chordsComboBox;
|
||||
knob * m_chordRangeKnob;
|
||||
|
||||
// arpeggio-stuff
|
||||
groupBox * m_arpGroupBox;
|
||||
QComboBox * m_arpComboBox;
|
||||
knob * m_arpRangeKnob;
|
||||
knob * m_arpTimeKnob;
|
||||
knob * m_arpGateKnob;
|
||||
QLabel * m_arpDirectionLbl;
|
||||
//pixmapButton * m_arpOffBtn;
|
||||
pixmapButton * m_arpUpBtn;
|
||||
pixmapButton * m_arpDownBtn;
|
||||
pixmapButton * m_arpUpAndDownBtn;
|
||||
pixmapButton * m_arpRandomBtn;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
102
include/audio_alsa.h
Normal file
102
include/audio_alsa.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* audio_alsa.h - device-class that implements ALSA-PCM-output
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUDIO_ALSA_H
|
||||
#define _AUDIO_ALSA_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ALSA_ASOUNDLIB_H
|
||||
|
||||
#ifndef ALSA_SUPPORT
|
||||
#define ALSA_SUPPORT
|
||||
#endif
|
||||
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
#include "audio_device.h"
|
||||
|
||||
|
||||
class lcdSpinBox;
|
||||
class QLineEdit;
|
||||
|
||||
|
||||
class audioALSA : public audioDevice
|
||||
{
|
||||
public:
|
||||
audioALSA( Uint32 _sample_rate, bool & _success_ful );
|
||||
~audioALSA();
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
return( setupWidget::tr( "ALSA (Advanced Linux Sound "
|
||||
"Architecture)" ) );
|
||||
}
|
||||
|
||||
static QString probeDevice( void );
|
||||
|
||||
|
||||
class setupWidget : public audioDevice::setupWidget
|
||||
{
|
||||
public:
|
||||
setupWidget( QWidget * _parent );
|
||||
virtual ~setupWidget();
|
||||
|
||||
virtual void saveSettings( void );
|
||||
|
||||
private:
|
||||
QLineEdit * m_device;
|
||||
lcdSpinBox * m_channels;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
|
||||
Uint32 _frames,
|
||||
float _master_output );
|
||||
|
||||
int FASTCALL setHWParams( Uint32 _sample_rate, Uint32 _channels,
|
||||
snd_pcm_access_t _access );
|
||||
int setSWParams( void );
|
||||
int FASTCALL handleError( int _err );
|
||||
|
||||
|
||||
snd_pcm_t * m_handle;
|
||||
|
||||
snd_pcm_uframes_t m_bufferSize;
|
||||
snd_pcm_uframes_t m_periodSize;
|
||||
|
||||
snd_pcm_hw_params_t * m_hwParams;
|
||||
snd_pcm_sw_params_t * m_swParams;
|
||||
|
||||
bool m_littleEndian;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
143
include/audio_device.h
Normal file
143
include/audio_device.h
Normal file
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* audio_device.h - base-class for audio-devices, used by LMMS-mixer
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUDIO_DEVICE_H
|
||||
#define _AUDIO_DEVICE_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QMutex>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmutex.h>
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SAMPLERATE_H
|
||||
#include <samplerate.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "mixer.h"
|
||||
#include "tab_widget.h"
|
||||
|
||||
|
||||
class audioDevice
|
||||
{
|
||||
public:
|
||||
audioDevice( Uint32 _sample_rate, Uint8 _channels );
|
||||
virtual ~audioDevice();
|
||||
|
||||
inline void lock( void )
|
||||
{
|
||||
m_devMutex.lock();
|
||||
}
|
||||
|
||||
inline void unlock( void )
|
||||
{
|
||||
m_devMutex.unlock();
|
||||
}
|
||||
|
||||
void FASTCALL writeBuffer( surroundSampleFrame * _ab, Uint32 _frames,
|
||||
Uint32 _src_sample_rate,
|
||||
float _master_output );
|
||||
|
||||
inline Uint32 sampleRate( void ) const
|
||||
{
|
||||
return( m_sampleRate );
|
||||
}
|
||||
|
||||
Uint8 channels( void ) const
|
||||
{
|
||||
return( m_channels );
|
||||
}
|
||||
|
||||
|
||||
|
||||
class setupWidget : public tabWidget
|
||||
{
|
||||
public:
|
||||
setupWidget( const QString & _caption, QWidget * _parent ) :
|
||||
tabWidget( tabWidget::tr( "Settings for %1" ).arg(
|
||||
_caption ), _parent )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~setupWidget()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void saveSettings( void ) = 0;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
|
||||
Uint32 _frames,
|
||||
float _master_output ) = 0;
|
||||
|
||||
// convert a given audio-buffer to a buffer in signed 16-bit samples
|
||||
// returns num of bytes in outbuf
|
||||
int FASTCALL convertToS16( surroundSampleFrame * _ab, Uint32 _frames,
|
||||
float _master_output,
|
||||
outputSampleType * _output_buffer,
|
||||
bool _convert_endian = FALSE );
|
||||
|
||||
// clear given signed-int-16-buffer
|
||||
void FASTCALL clearS16Buffer( outputSampleType * _outbuf,
|
||||
Uint32 _frames );
|
||||
|
||||
// resample given buffer from samplerate _src_src to samplerate _dst_src
|
||||
void FASTCALL resample( surroundSampleFrame * _src, Uint32 _frames,
|
||||
surroundSampleFrame * _dst,
|
||||
Uint32 _src_sr, Uint32 _dst_sr );
|
||||
inline void setSampleRate( Uint32 _new_sr )
|
||||
{
|
||||
m_sampleRate = _new_sr;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
Uint32 m_sampleRate;
|
||||
Uint8 m_channels;
|
||||
QMutex m_devMutex;
|
||||
|
||||
#ifdef HAVE_SAMPLERATE_H
|
||||
SRC_DATA m_srcData;
|
||||
SRC_STATE * m_srcState;
|
||||
#endif
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
80
include/audio_dummy.h
Normal file
80
include/audio_dummy.h
Normal file
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* audio_dummy.h - dummy-audio-device
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUDIO_DUMMY_H
|
||||
#define _AUDIO_DUMMY_H
|
||||
|
||||
#include "audio_device.h"
|
||||
|
||||
|
||||
class audioDummy : public audioDevice
|
||||
{
|
||||
public:
|
||||
audioDummy( Uint32 _sample_rate, bool & _success_ful ) :
|
||||
audioDevice( _sample_rate, DEFAULT_CHANNELS )
|
||||
{
|
||||
_success_ful = TRUE;
|
||||
}
|
||||
|
||||
virtual ~audioDummy()
|
||||
{
|
||||
}
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
return( setupWidget::tr( "Dummy (no sound output)" ) );
|
||||
}
|
||||
|
||||
|
||||
class setupWidget : public audioDevice::setupWidget
|
||||
{
|
||||
public:
|
||||
setupWidget( QWidget * _parent ) :
|
||||
audioDevice::setupWidget( audioDummy::name(), _parent )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~setupWidget()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void saveSettings( void )
|
||||
{
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBufferToDev( surroundSampleFrame *,
|
||||
Uint32 /*_frames*/, float )
|
||||
{
|
||||
//usleep( (Uint32)( _frames * 1000.0f * 1000.0f /
|
||||
// DEFAULT_SAMPLE_RATE ) );
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
94
include/audio_file_device.h
Normal file
94
include/audio_file_device.h
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
* audio_file_device.h - base-class for audio-device-classes which write
|
||||
* their output into a file
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _AUDIO_FILE_DEVICE_H
|
||||
#define _AUDIO_FILE_DEVICE_H
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QFile>
|
||||
|
||||
#else
|
||||
|
||||
#include <qfile.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "audio_device.h"
|
||||
|
||||
|
||||
|
||||
class audioFileDevice : public audioDevice
|
||||
{
|
||||
public:
|
||||
audioFileDevice( Uint32 _sample_rate, Uint8 _channels,
|
||||
const QString & _file, bool _use_vbr,
|
||||
Uint16 _nom_bitrate, Uint16 _min_bitrate,
|
||||
Uint16 _max_bitrate );
|
||||
virtual ~audioFileDevice();
|
||||
|
||||
|
||||
protected:
|
||||
int FASTCALL writeData( const void * _data, int _len );
|
||||
void seekToBegin( void );
|
||||
|
||||
inline bool useVBR( void ) const
|
||||
{
|
||||
return( m_useVbr );
|
||||
}
|
||||
inline Uint16 nominalBitrate( void ) const
|
||||
{
|
||||
return( m_nomBitrate );
|
||||
}
|
||||
inline Uint16 minBitrate( void ) const
|
||||
{
|
||||
return( m_minBitrate );
|
||||
}
|
||||
inline Uint16 maxBitrate( void ) const
|
||||
{
|
||||
return( m_maxBitrate );
|
||||
}
|
||||
inline bool outputFileOpened( void ) const
|
||||
{
|
||||
return( m_outputFile.isOpen() );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
QFile m_outputFile;
|
||||
|
||||
bool m_useVbr;
|
||||
|
||||
Uint16 m_nomBitrate;
|
||||
Uint16 m_minBitrate;
|
||||
Uint16 m_maxBitrate;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
102
include/audio_file_ogg.h
Normal file
102
include/audio_file_ogg.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* audio_file_ogg.h - Audio-device which encodes wave-stream and writes it
|
||||
* into an OGG-file. This is used for song-export.
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUDIO_FILE_OGG_H
|
||||
#define _AUDIO_FILE_OGG_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_VORBIS_CODEC_H
|
||||
|
||||
#include <vorbis/codec.h>
|
||||
|
||||
#include "audio_file_device.h"
|
||||
|
||||
|
||||
|
||||
class audioFileOgg : public audioFileDevice
|
||||
{
|
||||
public:
|
||||
audioFileOgg( Uint32 _sample_rate, Uint32 _channels,
|
||||
bool & _success_ful, const QString & _file,
|
||||
bool _use_vbr, Uint16 _nom_bitrate,
|
||||
Uint16 _min_bitrate, Uint16 _max_bitrate );
|
||||
~audioFileOgg();
|
||||
|
||||
static audioDevice * getInst( Uint32 _sample_rate, Uint32 _channels,
|
||||
bool & _success_ful,
|
||||
const QString & _file,
|
||||
bool _use_vbr,
|
||||
Uint16 _nom_bitrate,
|
||||
Uint16 _min_bitrate,
|
||||
Uint16 _max_bitrate )
|
||||
{
|
||||
return( new audioFileOgg( _sample_rate, _channels, _success_ful,
|
||||
_file, _use_vbr, _nom_bitrate,
|
||||
_min_bitrate, _max_bitrate ) );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
|
||||
Uint32 _frames,
|
||||
float _master_output );
|
||||
|
||||
bool startEncoding( void );
|
||||
void finishEncoding( void );
|
||||
inline int writePage( void );
|
||||
|
||||
|
||||
|
||||
int m_channels;
|
||||
long m_rate;
|
||||
|
||||
// Various bitrate/quality options
|
||||
int m_managed;
|
||||
int m_bitrate;
|
||||
int m_minBitrate;
|
||||
int m_maxBitrate;
|
||||
|
||||
unsigned int m_serialNo;
|
||||
|
||||
vorbis_comment * m_comments;
|
||||
|
||||
// encoding setup - init by init_ogg_encoding
|
||||
ogg_stream_state m_os;
|
||||
ogg_page m_og;
|
||||
ogg_packet m_op;
|
||||
|
||||
vorbis_dsp_state m_vd;
|
||||
vorbis_block m_vb;
|
||||
vorbis_info m_vi;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
90
include/audio_file_wave.h
Normal file
90
include/audio_file_wave.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/*
|
||||
* audio_file_wave.h - Audio-device which encodes wave-stream and writes it
|
||||
* into an WAVE-file. This is used for song-export.
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUDIO_FILE_WAVE_H
|
||||
#define _AUDIO_FILE_WAVE_H
|
||||
|
||||
|
||||
#include "audio_file_device.h"
|
||||
|
||||
|
||||
|
||||
class audioFileWave : public audioFileDevice
|
||||
{
|
||||
public:
|
||||
audioFileWave( Uint32 _sample_rate, Uint32 _channels,
|
||||
bool & _success_ful, const QString & _file,
|
||||
bool _use_vbr, Uint16 _nom_bitrate,
|
||||
Uint16 _min_bitrate, Uint16 _max_bitrate );
|
||||
virtual ~audioFileWave();
|
||||
|
||||
static audioDevice * getInst( Uint32 _sample_rate, Uint32 _channels,
|
||||
bool & _success_ful,
|
||||
const QString & _file, bool _use_vbr,
|
||||
Uint16 _nom_bitrate,
|
||||
Uint16 _min_bitrate,
|
||||
Uint16 _max_bitrate )
|
||||
{
|
||||
return( new audioFileWave( _sample_rate, _channels,
|
||||
_success_ful, _file, _use_vbr,
|
||||
_nom_bitrate, _min_bitrate,
|
||||
_max_bitrate ) );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
|
||||
Uint32 _frames,
|
||||
float _master_output );
|
||||
|
||||
bool startEncoding( void );
|
||||
void finishEncoding( void );
|
||||
|
||||
|
||||
int m_bytesWritten;
|
||||
|
||||
struct waveFileHeader
|
||||
{
|
||||
char riff_id[4]; // "RIFF"
|
||||
Uint32 total_bytes; // total filesize-8
|
||||
char wave_fmt_str[8]; // "WAVEfmt"
|
||||
Uint32 bitrate_1; // bitrate, e.g. 16
|
||||
Uint16 uncompressed; // 1 if PCM
|
||||
Uint16 channels; // 1 = mono 2 = stereo
|
||||
Uint32 sample_rate; // sample-rate e.g. 44100
|
||||
Uint32 bytes_per_second; // sample-rate*channels*
|
||||
// (bitrate/8)
|
||||
Uint16 block_alignment; // channels*(bitrate/8)
|
||||
Uint16 bitrate_2; // bitrate, e.g. 16
|
||||
char data_chunk_id[4]; // "data"
|
||||
Uint32 data_bytes; // total size of sample-data
|
||||
} m_waveFileHeader;
|
||||
|
||||
//outputSampleType * m_outputBuffer;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
122
include/audio_jack.h
Normal file
122
include/audio_jack.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* audio_jack.h - support for JACK-transport
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUDIO_JACK_H
|
||||
#define _AUDIO_JACK_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_JACK_JACK_H
|
||||
|
||||
#define JACK_SUPPORT
|
||||
|
||||
#include <jack/jack.h>
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QMutex>
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmutex.h>
|
||||
#include <qvaluevector.h>
|
||||
#include <qvaluelist.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "audio_device.h"
|
||||
#include "tab_widget.h"
|
||||
|
||||
|
||||
class QLineEdit;
|
||||
class lcdSpinBox;
|
||||
|
||||
|
||||
class audioJACK : public audioDevice
|
||||
{
|
||||
public:
|
||||
audioJACK( Uint32 _sample_rate, bool & _success_ful );
|
||||
~audioJACK();
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
return( setupWidget::tr( "JACK (Jack Audio Connection Kit)" ) );
|
||||
}
|
||||
|
||||
|
||||
class setupWidget : public audioDevice::setupWidget
|
||||
{
|
||||
public:
|
||||
setupWidget( QWidget * _parent );
|
||||
virtual ~setupWidget();
|
||||
|
||||
virtual void saveSettings( void );
|
||||
|
||||
private:
|
||||
QLineEdit * m_clientName;
|
||||
lcdSpinBox * m_channels;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
|
||||
Uint32 _frames,
|
||||
float _master_output );
|
||||
|
||||
void clearBuffer( void );
|
||||
|
||||
static int processCallback( jack_nframes_t _nframes, void * _udata );
|
||||
static int bufSizeCallback( jack_nframes_t _nframes, void * _udata );
|
||||
|
||||
|
||||
jack_client_t * m_client;
|
||||
vvector<jack_port_t *> m_outputPorts;
|
||||
struct bufset
|
||||
{
|
||||
sampleType * buf;
|
||||
Uint32 frames;
|
||||
} ;
|
||||
|
||||
vlist<vvector<bufset> > m_bufferSets;
|
||||
Uint32 m_framesDoneInCurBuf;
|
||||
volatile Uint32 m_frameSync;
|
||||
|
||||
Uint32 m_jackBufSize;
|
||||
|
||||
QMutex m_bufMutex;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
79
include/audio_oss.h
Normal file
79
include/audio_oss.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* audio_oss.h - device-class that implements OSS-PCM-output
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUDIO_OSS_H
|
||||
#define _AUDIO_OSS_H
|
||||
|
||||
#include "audio_device.h"
|
||||
#include "tab_widget.h"
|
||||
|
||||
#define OSS_SUPPORT
|
||||
|
||||
|
||||
class lcdSpinBox;
|
||||
class QLineEdit;
|
||||
|
||||
|
||||
class audioOSS : public audioDevice
|
||||
{
|
||||
public:
|
||||
audioOSS( Uint32 _sample_rate, bool & _success_ful );
|
||||
~audioOSS();
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
return( setupWidget::tr( "OSS (Open Sound System)" ) );
|
||||
}
|
||||
|
||||
static QString probeDevice( void );
|
||||
|
||||
|
||||
class setupWidget : public audioDevice::setupWidget
|
||||
{
|
||||
public:
|
||||
setupWidget( QWidget * _parent );
|
||||
virtual ~setupWidget();
|
||||
|
||||
virtual void saveSettings( void );
|
||||
|
||||
private:
|
||||
QLineEdit * m_device;
|
||||
lcdSpinBox * m_channels;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
|
||||
Uint32 _frames,
|
||||
float _master_output );
|
||||
|
||||
int m_audioFD;
|
||||
|
||||
bool m_convertEndian;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
74
include/audio_sample_recorder.h
Normal file
74
include/audio_sample_recorder.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* audio_sample_recorder.h - device-class that implements recording
|
||||
* surround-audio-buffers into RAM, maybe later
|
||||
* also harddisk
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUDIO_SAMPLE_RECORDER_H
|
||||
#define _AUDIO_SAMPLE_RECORDER_H
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QVector>
|
||||
#include <QPair>
|
||||
|
||||
#else
|
||||
|
||||
#include <qvaluevector.h>
|
||||
#include <qpair.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "audio_device.h"
|
||||
|
||||
|
||||
class sampleBuffer;
|
||||
|
||||
|
||||
class audioSampleRecorder : public audioDevice
|
||||
{
|
||||
public:
|
||||
audioSampleRecorder( Uint32 _sample_rate, Uint32 _channels,
|
||||
bool & _success_ful );
|
||||
~audioSampleRecorder();
|
||||
|
||||
Uint32 framesRecorded( void ) const;
|
||||
void FASTCALL createSampleBuffer( sampleBuffer * * _sample_buf ) const;
|
||||
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
|
||||
Uint32 _frames,
|
||||
float _master_output );
|
||||
|
||||
typedef vvector<QPair<sampleFrame *, Uint32> > bufferVector;
|
||||
bufferVector m_buffers;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
110
include/audio_sdl.h
Normal file
110
include/audio_sdl.h
Normal file
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* audio_sdl.h - device-class that performs PCM-output via SDL
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUDIO_SDL_H
|
||||
#define _AUDIO_SDL_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SDL_SDL_AUDIO_H
|
||||
|
||||
#ifndef SDL_AUDIO_SUPPORT
|
||||
#define SDL_AUDIO_SUPPORT
|
||||
#endif
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QMutex>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmutex.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include SDL_SDL_H
|
||||
#include SDL_SDL_AUDIO_H
|
||||
|
||||
|
||||
#include "audio_device.h"
|
||||
#include "tab_widget.h"
|
||||
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
|
||||
class audioSDL : public audioDevice
|
||||
{
|
||||
public:
|
||||
audioSDL( Uint32 _sample_rate, bool & _success_ful );
|
||||
~audioSDL();
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
return( setupWidget::tr( "SDL (Simple DirectMedia Layer)" ) );
|
||||
}
|
||||
|
||||
|
||||
class setupWidget : public audioDevice::setupWidget
|
||||
{
|
||||
public:
|
||||
setupWidget( QWidget * _parent );
|
||||
virtual ~setupWidget();
|
||||
|
||||
virtual void saveSettings( void );
|
||||
|
||||
private:
|
||||
QLineEdit * m_device;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
private:
|
||||
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
|
||||
Uint32 _frames,
|
||||
float _master_output );
|
||||
|
||||
void clearBuffer( void );
|
||||
|
||||
static void sdlAudioCallback( void * _udata, Uint8 * _buf, int _len );
|
||||
|
||||
SDL_AudioSpec m_audioHandle;
|
||||
|
||||
outputSampleType * m_buffer;
|
||||
|
||||
QMutex m_bufMutex;
|
||||
QMutex m_callbackMutex;
|
||||
|
||||
bool m_convertEndian;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
258
include/basic_filters.h
Normal file
258
include/basic_filters.h
Normal file
@@ -0,0 +1,258 @@
|
||||
/*
|
||||
* basic_filters.h - simple but powerful filter-class with most used filters
|
||||
*
|
||||
* original file by ???
|
||||
* modified and enhanced by Tobias Doerffel, 2004
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BASIC_FILTERS_H
|
||||
#define _BASIC_FILTERS_H
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "types.h"
|
||||
#include "mixer.h"
|
||||
#include "templates.h"
|
||||
|
||||
|
||||
template<Uint8 CHANNELS = DEFAULT_CHANNELS>
|
||||
class basicFilters
|
||||
{
|
||||
public:
|
||||
|
||||
enum filterTypes
|
||||
{
|
||||
LOWPASS,
|
||||
HIPASS,
|
||||
BANDPASS_CSG,
|
||||
BANDPASS_CZPG,
|
||||
NOTCH,
|
||||
ALLPASS,
|
||||
MOOG,
|
||||
DOUBLE_LOWPASS,
|
||||
DOUBLE_MOOG
|
||||
} ;
|
||||
|
||||
inline basicFilters( const float _sampleRate ) :
|
||||
m_b0a0( 0.0f ),
|
||||
m_b1a0( 0.0f ),
|
||||
m_b2a0( 0.0f ),
|
||||
m_a1a0( 0.0f ),
|
||||
m_a2a0( 0.0f ),
|
||||
m_sampleRate( _sampleRate ),
|
||||
m_subFilter( NULL )
|
||||
{
|
||||
// reset in/out history
|
||||
for( Uint8 _chnl = 0; _chnl < CHANNELS; ++_chnl )
|
||||
{
|
||||
// reset in/out history for simple filters
|
||||
m_ou1[_chnl] = m_ou2[_chnl] = m_in1[_chnl] =
|
||||
m_in2[_chnl] = 0.0f;
|
||||
// reset in/out historey for moog-filter
|
||||
m_y1[_chnl] = m_y2[_chnl] = m_y3[_chnl] = m_y4[_chnl] =
|
||||
m_oldx[_chnl] = m_oldy1[_chnl] =
|
||||
m_oldy2[_chnl] = m_oldy3[_chnl] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
inline ~basicFilters()
|
||||
{
|
||||
delete m_subFilter;
|
||||
}
|
||||
|
||||
inline sampleType update( sampleType _in0, Uint8 _chnl )
|
||||
{
|
||||
sampleType out;
|
||||
if( m_type != MOOG )
|
||||
{
|
||||
// filter
|
||||
out = m_b0a0*_in0 + m_b1a0*m_in1[_chnl] +
|
||||
m_b2a0*m_in2[_chnl] - m_a1a0*m_ou1[_chnl] -
|
||||
m_a2a0*m_ou2[_chnl];
|
||||
|
||||
// push in/out buffers
|
||||
m_in2[_chnl] = m_in1[_chnl];
|
||||
m_in1[_chnl] = _in0;
|
||||
m_ou2[_chnl] = m_ou1[_chnl];
|
||||
|
||||
m_ou1[_chnl] = out;
|
||||
}
|
||||
else
|
||||
{
|
||||
sampleType x = _in0 - m_r*m_y4[_chnl];
|
||||
|
||||
// Four cascaded onepole filters (bilinear transform)
|
||||
m_y1[_chnl] = x*m_p + m_oldx[_chnl]*m_p -
|
||||
m_k*m_y1[_chnl];
|
||||
m_y2[_chnl] = m_y1[_chnl]*m_p+m_oldy1[_chnl]*m_p -
|
||||
m_k*m_y2[_chnl];
|
||||
m_y3[_chnl] = m_y2[_chnl]*m_p+m_oldy2[_chnl]*m_p -
|
||||
m_k*m_y3[_chnl];
|
||||
m_y4[_chnl] = m_y3[_chnl]*m_p+m_oldy3[_chnl]*m_p -
|
||||
m_k*m_y4[_chnl];
|
||||
|
||||
m_oldx[_chnl] = x;
|
||||
m_oldy1[_chnl] = m_y1[_chnl];
|
||||
m_oldy2[_chnl] = m_y2[_chnl];
|
||||
m_oldy3[_chnl] = m_y3[_chnl];
|
||||
out = m_y4[_chnl] - m_y4[_chnl] * m_y4[_chnl] *
|
||||
m_y4[_chnl] * ( 1.0f/6.0f );
|
||||
}
|
||||
if( m_subFilter != NULL )
|
||||
{
|
||||
return( m_subFilter->update( out, _chnl ) );
|
||||
}
|
||||
// Clipper band limited sigmoid
|
||||
return( out );
|
||||
}
|
||||
|
||||
|
||||
inline void calcFilterCoeffs( const filterTypes _type, float _freq,
|
||||
const float _q
|
||||
/*, const bool _q_is_bandwidth = FALSE*/ )
|
||||
{
|
||||
// temp coef vars
|
||||
m_type = _type;
|
||||
_freq = tMax( _freq, 0.01f );// limit freq for not getting
|
||||
// bad noise out of the filter...
|
||||
|
||||
if( m_type == MOOG || m_type == DOUBLE_MOOG )
|
||||
{
|
||||
const float f = 2 * _freq / m_sampleRate; // [0 - 1]
|
||||
m_k = 3.6f*f - 1.6f*f*f - 1; // (Empirical tunning)
|
||||
m_p = (m_k+1)*0.5f;
|
||||
m_r = _q*powf( M_E, ( ( 1-m_p ) * 1.386249f ) );
|
||||
if( m_type == DOUBLE_MOOG )
|
||||
{
|
||||
if( m_subFilter == NULL )
|
||||
{
|
||||
m_subFilter =
|
||||
new basicFilters<CHANNELS>(
|
||||
m_sampleRate );
|
||||
}
|
||||
m_subFilter->calcFilterCoeffs( MOOG, _freq,
|
||||
_q );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// other filters
|
||||
const float omega = 2.0f * M_PI * _freq /
|
||||
m_sampleRate;
|
||||
const float tsin = sinf( omega );
|
||||
const float tcos = cosf( omega );
|
||||
//float alpha;
|
||||
|
||||
//if (q_is_bandwidth)
|
||||
//alpha = tsin*sinhf(logf(2.0f)/2.0f*q*omega/tsin);
|
||||
//else
|
||||
const float alpha = tsin / ( 2.0f*_q );
|
||||
|
||||
const float a0 = 1.0f / ( 1.0f+alpha );
|
||||
|
||||
if( m_type == LOWPASS || m_type == DOUBLE_LOWPASS )
|
||||
{
|
||||
m_b0a0 = ((1.0f-tcos)/2.0f)*a0;
|
||||
m_b1a0 = (1.0f-tcos)*a0;
|
||||
m_b2a0 = m_b0a0;//((1.0f-tcos)/2.0f)*a0;
|
||||
m_a1a0 = (-2.0f*tcos)*a0;
|
||||
if( m_type == DOUBLE_LOWPASS )
|
||||
{
|
||||
if( m_subFilter == NULL )
|
||||
{
|
||||
m_subFilter =
|
||||
new basicFilters<CHANNELS>( m_sampleRate );
|
||||
}
|
||||
m_subFilter->calcFilterCoeffs( LOWPASS,
|
||||
_freq,
|
||||
_q );
|
||||
}
|
||||
}
|
||||
else if( m_type == HIPASS )
|
||||
{
|
||||
m_b0a0 = ((1.0f+tcos)/2.0f)*a0;
|
||||
m_b1a0 = (-1.0f-tcos)*a0;
|
||||
m_b2a0 = m_b0a0;//((1.0f+tcos)/2.0f)*a0;
|
||||
m_a1a0 = (-2.0f*tcos)*a0;
|
||||
}
|
||||
else if( m_type == BANDPASS_CSG )
|
||||
{
|
||||
m_b0a0 = (tsin/2.0f)*a0;
|
||||
m_b1a0 = 0.0f;
|
||||
m_b2a0 = (-tsin/2.0f)*a0;
|
||||
m_a1a0 = (-2.0f*tcos)*a0;
|
||||
}
|
||||
else if( m_type == BANDPASS_CZPG )
|
||||
{
|
||||
m_b0a0 = alpha*a0;
|
||||
m_b1a0 = 0.0f;
|
||||
m_b2a0 = (-alpha)*a0;
|
||||
m_a1a0 = (-2.0f*tcos)*a0;
|
||||
}
|
||||
else if( m_type == NOTCH )
|
||||
{
|
||||
m_b0a0 = a0;
|
||||
m_b1a0 = (-2.0f*tcos)*a0;
|
||||
m_b2a0 = a0;
|
||||
m_a1a0 = m_b1a0;//(-2.0f*tcos)*a0;
|
||||
}
|
||||
else if( m_type == ALLPASS )
|
||||
{
|
||||
m_b0a0 = (1.0f-alpha)*a0;
|
||||
m_b1a0 = (-2.0f*tcos)*a0;
|
||||
m_b2a0 = 1.0;//(1.0f+alpha)*a0;
|
||||
m_a1a0 = m_b1a0;//(-2.0f*tcos)*a0;
|
||||
//m_a2a0 = m_b0a0;//(1.0f-alpha)*a0;
|
||||
}
|
||||
m_a2a0 = (1.0f-alpha)*a0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
// filter coeffs
|
||||
float m_b0a0, m_b1a0, m_b2a0, m_a1a0, m_a2a0;
|
||||
|
||||
// coeffs for moog-filter
|
||||
float m_r, m_p, m_k;
|
||||
|
||||
typedef sampleType frame[CHANNELS];
|
||||
|
||||
// in/out history
|
||||
frame m_ou1, m_ou2, m_in1, m_in2;
|
||||
|
||||
// in/out history for moog-filter
|
||||
frame m_y1, m_y2, m_y3, m_y4, m_oldx, m_oldy1, m_oldy2, m_oldy3;
|
||||
|
||||
filterTypes m_type;
|
||||
|
||||
float m_sampleRate;
|
||||
basicFilters<CHANNELS> * m_subFilter;
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
119
include/bb_editor.h
Normal file
119
include/bb_editor.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* bb_editor.h - declaration of class bbEditor, a basic-component of LMMS
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BB_EDITOR_H
|
||||
#define _BB_EDITOR_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
|
||||
#include "track_container.h"
|
||||
#include "lmms_main_win.h"
|
||||
|
||||
|
||||
class pixmapButton;
|
||||
class songEditor;
|
||||
class QPixmap;
|
||||
|
||||
|
||||
class bbEditor : public trackContainer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static inline bbEditor * inst( void )
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new bbEditor();
|
||||
}
|
||||
return( s_instanceOfMe );
|
||||
}
|
||||
|
||||
virtual bool FASTCALL play( midiTime _start, Uint32 _start_frame,
|
||||
Uint32 _frames, Uint32 _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
virtual void updateAfterTrackAdd( void );
|
||||
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "bbeditor" );
|
||||
}
|
||||
|
||||
virtual inline bool fixedTCOs( void ) const
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
csize currentBB( void ) const;
|
||||
void FASTCALL setCurrentBB( csize _bb );
|
||||
tact FASTCALL lengthOfBB( csize _bb );
|
||||
inline tact lengthOfCurrentBB( void )
|
||||
{
|
||||
return( lengthOfBB( currentBB() ) );
|
||||
}
|
||||
void FASTCALL removeBB( csize _bb );
|
||||
csize numOfBBs( void ) const;
|
||||
|
||||
void FASTCALL swapBB( csize _bb1, csize _bb2 );
|
||||
|
||||
|
||||
protected:
|
||||
void closeEvent( QCloseEvent * _ce );
|
||||
void keyPressEvent (QKeyEvent * _ke);
|
||||
void wheelEvent( QWheelEvent * _we );
|
||||
void resizeEvent( QResizeEvent * _re );
|
||||
void updateBackground( void );
|
||||
|
||||
|
||||
protected slots:
|
||||
void play( void );
|
||||
void stop( void );
|
||||
|
||||
|
||||
private:
|
||||
bbEditor();
|
||||
//bbEditor( const bbEditor & );
|
||||
~bbEditor();
|
||||
|
||||
void FASTCALL createTCOsForBB( csize _bb );
|
||||
|
||||
|
||||
static bbEditor * s_instanceOfMe;
|
||||
static QPixmap * s_titleArtwork;
|
||||
|
||||
pixmapButton * m_playButton;
|
||||
pixmapButton * m_stopButton;
|
||||
|
||||
|
||||
friend class songEditor;
|
||||
friend lmmsMainWin::~lmmsMainWin();
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
150
include/bb_track.h
Normal file
150
include/bb_track.h
Normal file
@@ -0,0 +1,150 @@
|
||||
/*
|
||||
* bb_track.h - class bbTrack, a wrapper for using bbEditor
|
||||
* (which is a singleton-class) as track
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BB_TRACK_H
|
||||
#define _BB_TRACK_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QObject>
|
||||
#include <QMap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "track.h"
|
||||
|
||||
class nameLabel;
|
||||
class trackContainer;
|
||||
|
||||
|
||||
class bbTCO : public trackContentObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
bbTCO( track * _track, const QColor & _c = QColor() );
|
||||
virtual ~bbTCO();
|
||||
|
||||
virtual void FASTCALL movePosition( const midiTime & _pos );
|
||||
virtual void FASTCALL changeLength( const midiTime & _length );
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "bbtco" );
|
||||
}
|
||||
|
||||
const QColor & color( void ) const
|
||||
{
|
||||
return( m_color );
|
||||
}
|
||||
|
||||
|
||||
protected slots:
|
||||
void openInBBEditor( bool _c );
|
||||
void openInBBEditor( void );
|
||||
void resetName( void );
|
||||
void changeName( void );
|
||||
void changeColor( void );
|
||||
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent * );
|
||||
void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void constructContextMenu( QMenu * );
|
||||
|
||||
|
||||
private:
|
||||
QString m_name;
|
||||
QColor m_color;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class bbTrack : public QObject, public track
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
bbTrack( trackContainer * _tc );
|
||||
virtual ~bbTrack();
|
||||
|
||||
virtual trackTypes trackType( void ) const;
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
Uint32 _start_frame, Uint32 _frames,
|
||||
Uint32 _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
virtual trackContentObject * FASTCALL createTCO( const midiTime &
|
||||
_pos );
|
||||
|
||||
virtual void FASTCALL saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadTrackSpecificSettings( const QDomElement &
|
||||
_this );
|
||||
|
||||
static bbTrack * FASTCALL findBBTrack( csize _bb_num );
|
||||
static csize FASTCALL numOfBBTrack( track * _track );
|
||||
static void FASTCALL swapBBTracks( track * _track1, track * _track2 );
|
||||
|
||||
inline nameLabel * trackLabel( void )
|
||||
{
|
||||
return( m_trackLabel );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void clickedTrackLabel( void );
|
||||
|
||||
|
||||
protected:
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "bbtrack" );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
nameLabel * m_trackLabel;
|
||||
|
||||
struct bbInfoStruct
|
||||
{
|
||||
csize num;
|
||||
QString name;
|
||||
} ;
|
||||
static QMap<bbTrack *, bbInfoStruct> s_bbNums;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
78
include/buffer_allocator.h
Normal file
78
include/buffer_allocator.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* buffer_allocator.h - namespace bufferAllocator providing routines for own
|
||||
* optimized memory-management for audio-buffers
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BUFFER_ALLOCATOR_H
|
||||
#define _BUFFER_ALLOCATOR_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
|
||||
|
||||
namespace bufferAllocator
|
||||
{
|
||||
void * FASTCALL allocBytes( Uint32 _bytes );
|
||||
|
||||
template<class T>
|
||||
inline T * FASTCALL alloc( Uint32 _n )
|
||||
{
|
||||
return( (T *) allocBytes( sizeof( T ) * _n ) );
|
||||
}
|
||||
|
||||
void FASTCALL free( void * _buf );
|
||||
|
||||
void FASTCALL cleanUp( Uint16 _level );
|
||||
|
||||
|
||||
// simple class for automatically freeing buffer in complex functions
|
||||
template<class T = void>
|
||||
class autoCleaner
|
||||
{
|
||||
public:
|
||||
autoCleaner( T * _ptr ) :
|
||||
m_ptr( _ptr )
|
||||
{
|
||||
}
|
||||
~autoCleaner()
|
||||
{
|
||||
bufferAllocator::free( m_ptr );
|
||||
}
|
||||
inline const T * ptr( void ) const
|
||||
{
|
||||
return( m_ptr );
|
||||
}
|
||||
|
||||
private:
|
||||
T * m_ptr;
|
||||
} ;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
59
include/clipboard.h
Normal file
59
include/clipboard.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* clipboard.h - the clipboard for patterns, notes etc.
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _CLIPBOARD_H
|
||||
#define _CLIPBOARD_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QMap>
|
||||
#include <Qt/QtXml>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmap.h>
|
||||
#include <qdom.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class settings;
|
||||
|
||||
namespace clipboard
|
||||
{
|
||||
typedef QMap<QString, QDomElement> map;
|
||||
extern map content;
|
||||
|
||||
void FASTCALL copy( settings * _settings_object );
|
||||
const QDomElement * FASTCALL getContent( const QString & _node_name );
|
||||
} ;
|
||||
|
||||
#endif
|
||||
187
include/config_mgr.h
Normal file
187
include/config_mgr.h
Normal file
@@ -0,0 +1,187 @@
|
||||
/*
|
||||
* config_mgr.h - class configManager, a class for managing LMMS-configuration
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _CONFIG_MGR_H
|
||||
#define _CONFIG_MGR_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QDialog>
|
||||
#include <QMap>
|
||||
#include <QVector>
|
||||
#include <QPair>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdialog.h>
|
||||
#include <qmap.h>
|
||||
#include <qvaluevector.h>
|
||||
#include <qpair.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "lmms_main_win.h"
|
||||
|
||||
|
||||
class QLineEdit;
|
||||
class QLabel;
|
||||
class QRadioButton;
|
||||
class QHBoxLayout;
|
||||
class QVBoxLayout;
|
||||
class QFrame;
|
||||
|
||||
|
||||
const QString PROJECTS_PATH = "projects/";
|
||||
const QString PRESETS_PATH = "presets/";
|
||||
const QString SAMPLES_PATH = "samples/";
|
||||
const QString ARTWORK_PATH = "artwork/";
|
||||
const QString LOCALE_PATH = "locale/";
|
||||
|
||||
|
||||
class configManager : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static inline configManager * inst( void )
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new configManager();
|
||||
}
|
||||
return( s_instanceOfMe );
|
||||
}
|
||||
|
||||
const QString & lmmsWorkingDir( void ) const
|
||||
{
|
||||
return( m_lmmsWorkingDir );
|
||||
}
|
||||
QString projectsDir( void ) const
|
||||
{
|
||||
return( m_lmmsWorkingDir + PROJECTS_PATH );
|
||||
}
|
||||
QString presetsDir( void ) const
|
||||
{
|
||||
return( m_lmmsWorkingDir + PRESETS_PATH );
|
||||
}
|
||||
QString samplesDir( void ) const
|
||||
{
|
||||
return( m_lmmsWorkingDir + SAMPLES_PATH );
|
||||
}
|
||||
QString artworkDir( void ) const
|
||||
{
|
||||
return( m_lmmsDataDir + ARTWORK_PATH );
|
||||
}
|
||||
QString localeDir( void ) const
|
||||
{
|
||||
return( m_lmmsDataDir + LOCALE_PATH );
|
||||
}
|
||||
|
||||
const QString & value( const QString & _class,
|
||||
const QString & _attribute ) const;
|
||||
void setValue( const QString & _class, const QString & _attribute,
|
||||
const QString & _value );
|
||||
|
||||
bool loadConfigFile( void );
|
||||
void saveConfigFile( void );
|
||||
|
||||
|
||||
protected slots:
|
||||
void openWorkingDir( void );
|
||||
void setWorkingDir( const QString & _wd );
|
||||
|
||||
virtual void accept( void );
|
||||
|
||||
void backButtonClicked( void );
|
||||
void nextButtonClicked( void );
|
||||
void switchPage( csize _pg );
|
||||
void switchPage( QWidget * _pg );
|
||||
|
||||
|
||||
private:
|
||||
static configManager * s_instanceOfMe;
|
||||
|
||||
configManager( void );
|
||||
configManager( const configManager & _c );
|
||||
~configManager();
|
||||
|
||||
void createWidgets( void );
|
||||
|
||||
|
||||
void FASTCALL addPage( QWidget * _w, const QString & _title );
|
||||
|
||||
static void processFilesRecursively( const QString & _src_dir,
|
||||
const QString & _dst_dir,
|
||||
void( * _proc_func )( const QString & _src, const QString &
|
||||
_dst ) );
|
||||
|
||||
|
||||
const QString m_lmmsRcFile;
|
||||
QString m_lmmsWorkingDir;
|
||||
QString m_lmmsDataDir;
|
||||
|
||||
typedef vvector<QPair<QString, QString> > stringPairVector;
|
||||
typedef QMap<QString, stringPairVector> settingsMap;
|
||||
settingsMap m_settings;
|
||||
|
||||
|
||||
QWidget * m_pageIntro;
|
||||
QWidget * m_pageWorkingDir;
|
||||
QWidget * m_pageFiles;
|
||||
|
||||
QRadioButton * m_samplesCopyRB;
|
||||
QRadioButton * m_presetsCopyRB;
|
||||
QRadioButton * m_projectsCopyRB;
|
||||
|
||||
QLineEdit * m_wdLineEdit;
|
||||
|
||||
// wizard stuff
|
||||
vlist<QPair<QWidget *, QString> > m_pages;
|
||||
csize m_currentPage;
|
||||
QFrame * m_hbar;
|
||||
QWidget * m_contentWidget;
|
||||
QLabel * m_title;
|
||||
QPushButton * m_cancelButton;
|
||||
QPushButton * m_backButton;
|
||||
QPushButton * m_nextButton;
|
||||
QPushButton * m_finishButton;
|
||||
QHBoxLayout * m_buttonLayout;
|
||||
QHBoxLayout * m_mainLayout;
|
||||
QVBoxLayout * m_contentLayout;
|
||||
|
||||
|
||||
// lmmsMainWin-dtor is allowed to destroy us...
|
||||
friend lmmsMainWin::~lmmsMainWin();
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
41
include/debug.h
Normal file
41
include/debug.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* debug.h - header file to be included for debugging purposes
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _DEBUG_H
|
||||
#define _DEBUG_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
// set whether debug-stuff (like messages on the console, asserts and other
|
||||
// additional range-checkings) should be compiled
|
||||
|
||||
#ifdef LMMS_DEBUG
|
||||
#include <assert.h>
|
||||
#include <cstdio>
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
31
include/effect_board.h
Normal file
31
include/effect_board.h
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* effect_board.h - stuff for effect-board
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _EFFECT_BOARD_H
|
||||
#define _EFFECT_BOARD_H
|
||||
|
||||
const int MIN_EFFECT_CHANNEL = 0;
|
||||
const int MAX_EFFECT_CHANNEL = 63;
|
||||
const int DEFAULT_EFFECT_CHANNEL = (MIN_EFFECT_CHANNEL);
|
||||
|
||||
#endif
|
||||
51
include/embed.h
Normal file
51
include/embed.h
Normal file
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* embed.h - misc. stuff for using embedded data (resources linked into binary)
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _EMBED_H
|
||||
#define _EMBED_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QPixmap>
|
||||
#include <QString>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpixmap.h>
|
||||
#include <qstring.h>
|
||||
|
||||
#endif
|
||||
|
||||
namespace embed
|
||||
{
|
||||
|
||||
QPixmap getIconPixmap( const char * _name, int _w = -1, int _h = -1 );
|
||||
QString getText( const char * _name );
|
||||
void loadTranslation( const QString & _tname );
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
59
include/endian_handling.h
Normal file
59
include/endian_handling.h
Normal file
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* endian.h - handle endianess-problems
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ENDIAN_HANDLING_H
|
||||
#define _ENDIAN_HANDLING_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
inline bool isLittleEndian( void )
|
||||
{
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
return( FALSE );
|
||||
#else
|
||||
return( TRUE );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
inline Sint16 swap16IfBE( Sint16 _i )
|
||||
{
|
||||
return( isLittleEndian() ? _i : ( ( _i & 0xFF ) << 8) | ( ( _i >> 8 ) & 0xFF ) );
|
||||
}
|
||||
|
||||
|
||||
inline Sint32 swap32IfBE( Sint32 _i )
|
||||
{
|
||||
return( isLittleEndian() ? _i : ( ( _i & 0xff000000 ) >> 24 ) |
|
||||
( ( _i & 0x00ff0000 ) >> 8 ) |
|
||||
( ( _i & 0x0000ff00 ) << 8 ) |
|
||||
( ( _i & 0x000000ff ) << 24 ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
174
include/envelope_and_lfo_widget.h
Normal file
174
include/envelope_and_lfo_widget.h
Normal file
@@ -0,0 +1,174 @@
|
||||
/*
|
||||
* envelope_and_lfo_widget.h - declaration of class envelopeAndLFOWidget which
|
||||
* is used by envelope/lfo/filter-tab of
|
||||
* channel-window
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ENVELOPE_AND_LFO_WIDGET_H
|
||||
#define _ENVELOPE_AND_LFO_WIDGET_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "settings.h"
|
||||
#include "types.h"
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
|
||||
|
||||
class envelopeTabWidget;
|
||||
class pixmapButton;
|
||||
class knob;
|
||||
class QPaintEvent;
|
||||
class QPixmap;
|
||||
|
||||
|
||||
|
||||
class envelopeAndLFOWidget : public QWidget, public settings,
|
||||
public specialBgHandlingWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
envelopeAndLFOWidget( float _value_for_zero_amount, QWidget * _parent );
|
||||
~envelopeAndLFOWidget();
|
||||
|
||||
static inline float expKnobVal( float val )
|
||||
{
|
||||
return( ( ( val < 0 ) ? -1 : 1 ) * val*val );
|
||||
}
|
||||
static void triggerLFO( void );
|
||||
static void resetLFO( void );
|
||||
|
||||
float FASTCALL level( Uint32 _frame, Uint32 _release_begin,
|
||||
Uint32 _frame_offset ) const;
|
||||
|
||||
inline bool used( void ) const
|
||||
{
|
||||
return( m_used );
|
||||
}
|
||||
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "el" );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void updateSampleVars( void );
|
||||
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent * _pe );
|
||||
void mousePressEvent( QMouseEvent * _me );
|
||||
|
||||
float FASTCALL lfoLevel( Uint32 _frame, Uint32 _frame_offset ) const;
|
||||
|
||||
|
||||
protected slots:
|
||||
void updateAfterKnobChange( float );
|
||||
void lfoSinWaveCh( bool );
|
||||
void lfoTriangleWaveCh( bool );
|
||||
void lfoSawWaveCh( bool );
|
||||
void lfoSquareWaveCh( bool );
|
||||
void x100Toggled( bool );
|
||||
|
||||
|
||||
private:
|
||||
static Uint32 s_lfoFrame;
|
||||
|
||||
bool m_used;
|
||||
|
||||
// envelope-stuff
|
||||
knob * m_predelayKnob;
|
||||
knob * m_attackKnob;
|
||||
knob * m_holdKnob;
|
||||
knob * m_decayKnob;
|
||||
knob * m_sustainKnob;
|
||||
knob * m_releaseKnob;
|
||||
knob * m_amountKnob;
|
||||
static QPixmap * s_envGraph;
|
||||
|
||||
float m_sustainLevel;
|
||||
float m_amount;
|
||||
float m_valueForZeroAmount;
|
||||
float m_amountAdd;
|
||||
Uint32 m_pahdFrames;
|
||||
Uint32 m_rFrames;
|
||||
float * m_pahdEnv;
|
||||
float * m_rEnv;
|
||||
|
||||
// LFO-stuff
|
||||
knob * m_lfoPredelayKnob;
|
||||
knob * m_lfoAttackKnob;
|
||||
knob * m_lfoSpeedKnob;
|
||||
knob * m_lfoAmountKnob;
|
||||
pixmapButton * m_sinLfoBtn;
|
||||
pixmapButton * m_triangleLfoBtn;
|
||||
pixmapButton * m_sawLfoBtn;
|
||||
pixmapButton * m_sqrLfoBtn;
|
||||
static QPixmap * s_lfoGraph;
|
||||
|
||||
pixmapButton * m_x100Btn;
|
||||
pixmapButton * m_controlEnvAmountBtn;
|
||||
|
||||
Uint32 m_lfoPredelayFrames;
|
||||
Uint32 m_lfoAttackFrames;
|
||||
Uint32 m_lfoOscillationFrames;
|
||||
float m_lfoAmount;
|
||||
bool m_lfoAmountIsZero;
|
||||
float * m_lfoShapeData;
|
||||
|
||||
enum lfoShapes
|
||||
{
|
||||
SIN,
|
||||
TRIANGLE,
|
||||
SAW,
|
||||
SQUARE
|
||||
} m_lfoShape;
|
||||
|
||||
volatile bool m_busy;
|
||||
|
||||
|
||||
|
||||
friend class envelopeTabWidget;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
107
include/envelope_tab_widget.h
Normal file
107
include/envelope_tab_widget.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* envelope_tab_widget.h - declaration of class envelopeTabWidget which
|
||||
* provides UI- and DSP-code for using envelopes, LFOs
|
||||
* and a filter
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _ENVELOPE_TAB_WIDGET_H
|
||||
#define _ENVELOPE_TAB_WIDGET_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "settings.h"
|
||||
#include "basic_filters.h"
|
||||
#include "envelope_and_lfo_widget.h"
|
||||
|
||||
|
||||
class QComboBox;
|
||||
class groupBox;
|
||||
class tabWidget;
|
||||
class QLabel;
|
||||
class knob;
|
||||
class pixmapButton;
|
||||
class channelTrack;
|
||||
class notePlayHandle;
|
||||
|
||||
|
||||
class envelopeTabWidget : public QWidget, public settings
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
envelopeTabWidget( channelTrack * _channel_track, QWidget * parent );
|
||||
~envelopeTabWidget();
|
||||
|
||||
void FASTCALL processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
|
||||
notePlayHandle * _n );
|
||||
|
||||
enum targets
|
||||
{
|
||||
VOLUME,
|
||||
/* PANNING,
|
||||
PITCH,*/
|
||||
CUT,
|
||||
RES,
|
||||
TARGET_COUNT
|
||||
} ;
|
||||
|
||||
Uint32 envFrames( void );
|
||||
Uint32 releaseFrames( void );
|
||||
|
||||
float FASTCALL volumeLevel( notePlayHandle * _n, Uint32 _frame );
|
||||
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "eldata" );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
channelTrack * m_channelTrack;
|
||||
|
||||
tabWidget * m_targetsTabWidget;
|
||||
envelopeAndLFOWidget * m_envLFOWidgets[TARGET_COUNT];
|
||||
|
||||
// filter-stuff
|
||||
groupBox * m_filterGroupBox;
|
||||
QComboBox * m_filterComboBox;
|
||||
knob * m_filterCutKnob;
|
||||
knob * m_filterResKnob;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
61
include/export.h
Normal file
61
include/export.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* export.h - header which is needed for song-export
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _EXPORT_H
|
||||
#define _EXPORT_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class audioDevice;
|
||||
|
||||
|
||||
typedef audioDevice * ( * getDeviceInst)( Uint32 _sample_rate,
|
||||
Uint32 _channels,
|
||||
bool & _success_ful,
|
||||
const QString & _file,
|
||||
bool _use_vbr,
|
||||
Uint16 _nom_bitrate,
|
||||
Uint16 _min_bitrate,
|
||||
Uint16 _max_bitrate );
|
||||
|
||||
|
||||
enum fileTypes
|
||||
{
|
||||
WAVE_FILE,
|
||||
OGG_FILE,
|
||||
NULL_FILE = 0xFF
|
||||
} ;
|
||||
|
||||
|
||||
struct fileEncodeDevice
|
||||
{
|
||||
fileTypes m_fileType;
|
||||
const char * m_description;
|
||||
const char * m_extension;
|
||||
getDeviceInst m_getDevInst;
|
||||
} ;
|
||||
|
||||
extern fileEncodeDevice fileEncodeDevices[];
|
||||
|
||||
|
||||
#endif
|
||||
111
include/export_project_dialog.h
Normal file
111
include/export_project_dialog.h
Normal file
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* export_project_dialog.h - declaration of class exportProjectDialog which is
|
||||
* responsible for exporting project
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _EXPORT_PROJECT_DIALOG_H
|
||||
#define _EXPORT_PROJECT_DIALOG_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdialog.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "export.h"
|
||||
|
||||
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
class QComboBox;
|
||||
class QProgressBar;
|
||||
class QCheckBox;
|
||||
class pixmapButton;
|
||||
|
||||
|
||||
class exportProjectDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
exportProjectDialog( const QString & _file_name, QWidget * _parent );
|
||||
~exportProjectDialog();
|
||||
void FASTCALL updateProgressBar( int _new_val );
|
||||
|
||||
|
||||
public slots:
|
||||
void exportBtnClicked( void );
|
||||
|
||||
|
||||
protected:
|
||||
void keyPressEvent( QKeyEvent * _ke );
|
||||
void closeEvent( QCloseEvent * _ce );
|
||||
|
||||
|
||||
private slots:
|
||||
void changedType( const QString & );
|
||||
void cancelBtnClicked( void );
|
||||
void redrawProgressBar( void );
|
||||
|
||||
|
||||
private:
|
||||
QString m_fileName;
|
||||
QLabel * m_typeLbl;
|
||||
QComboBox * m_typeCombo;
|
||||
QLabel * m_kbpsLbl;
|
||||
QComboBox * m_kbpsCombo;
|
||||
QCheckBox * m_vbrCb;
|
||||
QCheckBox * m_hqmCb;
|
||||
QLabel * m_hourglassLbl;
|
||||
QPushButton * m_exportBtn;
|
||||
QPushButton * m_cancelBtn;
|
||||
QProgressBar * m_exportProgressBar;
|
||||
fileTypes m_fileType;
|
||||
bool m_deleteFile;
|
||||
int m_oldProgressVal;
|
||||
int m_progressVal;
|
||||
|
||||
QTimer * m_progressBarUpdateTimer;
|
||||
|
||||
static Sint16 s_availableBitrates[];
|
||||
|
||||
void finishProjectExport( void );
|
||||
void abortProjectExport( void );
|
||||
|
||||
static fileTypes FASTCALL getFileTypeFromExtension( const QString &
|
||||
_ext );
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
85
include/group_box.h
Normal file
85
include/group_box.h
Normal file
@@ -0,0 +1,85 @@
|
||||
/*
|
||||
* group_box.h - LMMS-groupbox
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _GROUP_BOX_H
|
||||
#define _GROUP_BOX_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "pixmap_button.h"
|
||||
|
||||
class QPixmap;
|
||||
|
||||
|
||||
class groupBox : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
groupBox( const QString & _caption, QWidget * _parent );
|
||||
~groupBox();
|
||||
|
||||
bool isActive( void ) const
|
||||
{
|
||||
#ifdef QT4
|
||||
return( m_led->isChecked() );
|
||||
#else
|
||||
return( m_led->isOn() );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void setState( bool _on, bool _anim = FALSE );
|
||||
void animate( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
|
||||
|
||||
private:
|
||||
void updatePixmap( void );
|
||||
|
||||
static QPixmap * s_ledBg;
|
||||
|
||||
pixmapButton * m_led;
|
||||
QString m_caption;
|
||||
|
||||
int m_origHeight;
|
||||
bool m_animating;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
93
include/interpolation.h
Normal file
93
include/interpolation.h
Normal file
@@ -0,0 +1,93 @@
|
||||
/*
|
||||
* interpolation.h - fast implementations of several interpolation-algorithms
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _INTERPOLATION_H
|
||||
#define _INTERPOLATION_H
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN
|
||||
#endif
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
inline float hermiteInterpolate( float x0, float x1, float x2, float x3,
|
||||
float frac_pos )
|
||||
{
|
||||
const float frsq = frac_pos*frac_pos;
|
||||
const float frsq2 = 2*frsq;
|
||||
return( ( (x2-x0) *0.5f ) * ( frac_pos * (frsq+1) -frsq2 ) +
|
||||
( frsq2*frac_pos - 3*frsq ) * ( x1-x2 ) +
|
||||
frsq2 * (frac_pos-1) * ( ( x3-x1 ) * 0.25f ) + x1 );
|
||||
|
||||
/*
|
||||
const float frsq = frac_pos*frac_pos;
|
||||
//const float frsq2 = 2*frsq;
|
||||
frac_pos *= 0.5;
|
||||
const float frcu = frsq*frac_pos;
|
||||
return (
|
||||
|
||||
(frcu - frsq + frac_pos) * ((x2 - x0)) +
|
||||
|
||||
(4*frcu - 3*frsq) * (x1 - x2)
|
||||
//frsq*(2*frac_pos-3) * (x1 - x2)
|
||||
|
||||
+ (frcu - 0.5*frsq)*((x3 - x1))
|
||||
|
||||
+ x1
|
||||
|
||||
);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline float cubicInterpolate( float v0, float v1, float v2, float v3, float x )
|
||||
{
|
||||
float frsq = x*x;
|
||||
float frcu = frsq*v0;
|
||||
float t1 = v3 + 3*v1;
|
||||
|
||||
return( v1 + 0.5f * frcu + x * ( v2 - frcu * ( 1.0f/6.0f ) -
|
||||
t1 * ( 1.0f/6.0f ) - v0 / 3.0f ) + frsq * x * ( t1 *
|
||||
( 1.0f/6.0f ) - 0.5f * v2 ) + frsq * ( 0.5f * v2 - v1 ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline float cosinusInterpolate( float v0, float v1, float x )
|
||||
{
|
||||
float f = cosf( x * ( M_PI*0.5f ) );
|
||||
return( v0*f + v1*( 1.0f-f ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
inline float linearInterpolate( float v0, float v1, float x )
|
||||
{
|
||||
return( v0*( 1.0f-x ) + v1*x );
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
320
include/kmultitabbar.h
Normal file
320
include/kmultitabbar.h
Normal file
@@ -0,0 +1,320 @@
|
||||
/***************************************************************************
|
||||
kmultitabbar.h - description
|
||||
-------------------
|
||||
begin : 2001
|
||||
copyright : (C) 2001,2002,2003 by Joseph Wenninger <jowenn@kde.org>
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _KMultitabbar_h_
|
||||
#define _KMultitabbar_h_
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
class KMultiTabBarButton;
|
||||
class KMultiTabBarTab;
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMenu>
|
||||
//#include <QVBoxWidget>
|
||||
#include <QString>
|
||||
#include <QBoxLayout>
|
||||
#include <QList>
|
||||
#include <QScrollArea>
|
||||
#include <QPushButton>
|
||||
|
||||
typedef QList<KMultiTabBarButton *> buttonList;
|
||||
typedef QList<KMultiTabBarTab *> tabList;
|
||||
|
||||
#else
|
||||
|
||||
#include <qscrollview.h>
|
||||
#include <qvbox.h>
|
||||
#include <qhbox.h>
|
||||
#include <qabstractlayout.h>
|
||||
#include <qstring.h>
|
||||
#include <qptrlist.h>
|
||||
#include <qpushbutton.h>
|
||||
|
||||
typedef QPtrList<KMultiTabBarButton> buttonList;
|
||||
typedef QPtrList<KMultiTabBarTab> tabList;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class QPixmap;
|
||||
class QPainter;
|
||||
class QFrame;
|
||||
|
||||
class KMultiTabBarPrivate;
|
||||
class KMultiTabBarTabPrivate;
|
||||
class KMultiTabBarButtonPrivate;
|
||||
class KMultiTabBarInternal;
|
||||
|
||||
/**
|
||||
* A Widget for horizontal and vertical tabs.
|
||||
* It is possible to add normal buttons to the top/left
|
||||
* The handling if only one tab at a time or multiple tabs
|
||||
* should be raisable is left to the "user".
|
||||
*@author Joseph Wenninger
|
||||
*/
|
||||
class KMultiTabBar: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//enum KMultiTabBarMode{ Horizontal, Vertical };
|
||||
enum KMultiTabBarPosition{DockLeft, DockRight, DockTop, DockBottom};
|
||||
|
||||
/**
|
||||
* VSNET == Visual Studio .Net like (only show the text of active tabs
|
||||
* KDEV3 == Kdevelop 3 like (always show the text)
|
||||
* KONQSBC == konqy's classic sidebar style (unthemed), this one is disabled
|
||||
* at the moment, but will be renabled soon too
|
||||
*/
|
||||
enum KMultiTabBarStyle{VSNET=0, KDEV3=1, KONQSBC=2, KDEV3ICON=3,STYLELAST=0xffff};
|
||||
|
||||
KMultiTabBar(Qt::Orientation o,QWidget *parent=0);
|
||||
virtual ~KMultiTabBar();
|
||||
|
||||
/**
|
||||
* append a new button to the button area. The button can later on be accessed with button(ID)
|
||||
* eg for connecting signals to it
|
||||
* @param pic a pixmap for the button
|
||||
* @param id an arbitraty ID value. It will be emitted in the clicked signal for identifying the button
|
||||
* if more than one button is connected to a signals.
|
||||
* @param popup A popup menu which should be displayed if the button is clicked
|
||||
* @param not_used_yet will be used for a popup text in the future
|
||||
*/
|
||||
int appendButton(const QPixmap &pic,int id=-1,QMenu* popup=0,const QString& not_used_yet=QString::null);
|
||||
/**
|
||||
* remove a button with the given ID
|
||||
*/
|
||||
void removeButton(int id);
|
||||
/**
|
||||
* append a new tab to the tab area. It can be accessed lateron with tabb(id);
|
||||
* @param pic a bitmap for the tab
|
||||
* @param id an arbitrary ID which can be used later on to identify the tab
|
||||
* @param text if a mode with text is used it will be the tab text, otherwise a mouse over hint
|
||||
*/
|
||||
int appendTab(const QPixmap &pic,int id=-1,const QString& text=QString::null);
|
||||
/**
|
||||
* remove a tab with a given ID
|
||||
*/
|
||||
void removeTab(int id);
|
||||
/**
|
||||
* set a tab to "raised"
|
||||
* @param id The ID of the tab to manipulate
|
||||
* @param state true == activated/raised, false == not active
|
||||
*/
|
||||
void setTab(int id ,bool state);
|
||||
/**
|
||||
* return the state of a tab, identified by it's ID
|
||||
*/
|
||||
bool isTabRaised(int id) const;
|
||||
/**
|
||||
* get a pointer to a button within the button area identified by its ID
|
||||
*/
|
||||
class KMultiTabBarButton *button(int id) const;
|
||||
|
||||
/**
|
||||
* get a pointer to a tab within the tab area, identiifed by its ID
|
||||
*/
|
||||
class KMultiTabBarTab *tab(int id) const;
|
||||
/**
|
||||
* set the real position of the widget.
|
||||
* @param pos if the mode is horizontal, only use top, bottom, if it is vertical use left or right
|
||||
*/
|
||||
void setPosition(KMultiTabBarPosition pos);
|
||||
/**
|
||||
* set the display style of the tabs
|
||||
*/
|
||||
void setStyle(KMultiTabBarStyle style);
|
||||
/**
|
||||
* be carefull, don't delete tabs yourself and don't delete the list itself
|
||||
*/
|
||||
tabList * tabs();
|
||||
/**
|
||||
* be carefull, don't delete buttons yourself and don't delete the list itself
|
||||
*/
|
||||
buttonList * buttons();
|
||||
|
||||
/**
|
||||
* might vanish, not sure yet
|
||||
*/
|
||||
void showActiveTabTexts(bool show=true);
|
||||
protected:
|
||||
friend class KMultiTabBarButton;
|
||||
virtual void fontChange( const QFont& );
|
||||
void updateSeparator();
|
||||
private:
|
||||
class KMultiTabBarInternal *m_internal;
|
||||
QBoxLayout *m_l;
|
||||
QFrame *m_btnTabSep;
|
||||
buttonList m_buttons;
|
||||
KMultiTabBarPosition m_position;
|
||||
KMultiTabBarPrivate *d;
|
||||
};
|
||||
|
||||
/**
|
||||
* This class should never be created except with the appendButton call of KMultiTabBar
|
||||
*/
|
||||
class KMultiTabBarButton: public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KMultiTabBarButton(const QPixmap& pic,const QString&, QMenu *popup,
|
||||
int id,QWidget *parent, KMultiTabBar::KMultiTabBarPosition pos, KMultiTabBar::KMultiTabBarStyle style);
|
||||
KMultiTabBarButton(const QString&, QMenu *popup,
|
||||
int id,QWidget *parent, KMultiTabBar::KMultiTabBarPosition pos, KMultiTabBar::KMultiTabBarStyle style);
|
||||
virtual ~KMultiTabBarButton();
|
||||
int id() const;
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* this is used internaly, but can be used by the user, if (s)he wants to
|
||||
* It the according call of KMultiTabBar is invoked though this modifications will be overwritten
|
||||
*/
|
||||
void setPosition(KMultiTabBar::KMultiTabBarPosition);
|
||||
/**
|
||||
* this is used internaly, but can be used by the user, if (s)he wants to
|
||||
* It the according call of KMultiTabBar is invoked though this modifications will be overwritten
|
||||
*/
|
||||
void setStyle(KMultiTabBar::KMultiTabBarStyle);
|
||||
|
||||
/**
|
||||
* modify the text of the button
|
||||
*/
|
||||
void setText(const QString &);
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
protected:
|
||||
KMultiTabBar::KMultiTabBarPosition m_position;
|
||||
KMultiTabBar::KMultiTabBarStyle m_style;
|
||||
QString m_text;
|
||||
virtual void hideEvent( class QHideEvent*);
|
||||
virtual void showEvent( class QShowEvent*);
|
||||
private:
|
||||
int m_id;
|
||||
KMultiTabBarButtonPrivate *d;
|
||||
signals:
|
||||
/**
|
||||
* this is emitted if the button is clicked
|
||||
* @param id the ID identifying the button
|
||||
*/
|
||||
void clicked(int id);
|
||||
protected slots:
|
||||
virtual void slotClicked();
|
||||
};
|
||||
|
||||
/**
|
||||
* This class should never be created except with the appendTab call of KMultiTabBar
|
||||
*/
|
||||
class KMultiTabBarTab: public KMultiTabBarButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KMultiTabBarTab(const QPixmap& pic,const QString&,int id,QWidget *parent,
|
||||
KMultiTabBar::KMultiTabBarPosition pos,KMultiTabBar::KMultiTabBarStyle style);
|
||||
virtual ~KMultiTabBarTab();
|
||||
/**
|
||||
* set the active state of the tab
|
||||
* @param state true==active false==not active
|
||||
*/
|
||||
void setState(bool state);
|
||||
/**
|
||||
* choose if the text should always be displayed
|
||||
* this is only used in classic mode if at all
|
||||
*/
|
||||
void showActiveTabText(bool show);
|
||||
void resize(){ setSize( neededSize() ); }
|
||||
#ifndef QT4
|
||||
virtual inline const QColorGroup & palette( void ) const
|
||||
{
|
||||
return( colorGroup() );
|
||||
}
|
||||
#endif
|
||||
private:
|
||||
bool m_showActiveTabText;
|
||||
int m_expandedSize;
|
||||
KMultiTabBarTabPrivate *d;
|
||||
protected:
|
||||
friend class KMultiTabBarInternal;
|
||||
void setSize(int);
|
||||
int neededSize();
|
||||
void updateState();
|
||||
virtual void drawButton(QPainter *);
|
||||
virtual void drawButtonLabel(QPainter *);
|
||||
void drawButtonStyled(QPainter *);
|
||||
void drawButtonClassic(QPainter *);
|
||||
protected slots:
|
||||
virtual void slotClicked();
|
||||
void setTabsPosition(KMultiTabBar::KMultiTabBarPosition);
|
||||
|
||||
public slots:
|
||||
virtual void setIcon(const QString&);
|
||||
virtual void setIcon(const QPixmap&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
class KMultiTabBarInternal: public Q3ScrollView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KMultiTabBarInternal(QWidget *parent,Qt::Orientation o);
|
||||
int appendTab(const QPixmap &,int=-1,const QString& =QString::null);
|
||||
KMultiTabBarTab *tab(int) const;
|
||||
void removeTab(int);
|
||||
void setPosition(enum KMultiTabBar::KMultiTabBarPosition pos);
|
||||
void setStyle(enum KMultiTabBar::KMultiTabBarStyle style);
|
||||
void showActiveTabTexts(bool show);
|
||||
tabList * tabs(){return &m_tabs;}
|
||||
#ifndef QT4
|
||||
virtual inline const QColorGroup & palette( void ) const
|
||||
{
|
||||
return( colorGroup() );
|
||||
}
|
||||
#endif
|
||||
private:
|
||||
friend class KMultiTabBar;
|
||||
QWidget *box;
|
||||
QBoxLayout *mainLayout;
|
||||
tabList m_tabs;
|
||||
enum KMultiTabBar::KMultiTabBarPosition m_position;
|
||||
bool m_showActiveTabTexts;
|
||||
enum KMultiTabBar::KMultiTabBarStyle m_style;
|
||||
int m_expandedTabSize;
|
||||
int m_lines;
|
||||
protected:
|
||||
virtual void drawContents ( QPainter *, int, int, int, int);
|
||||
|
||||
/**
|
||||
* [contentsM|m]ousePressEvent are reimplemented from QScrollView
|
||||
* in order to ignore all mouseEvents on the viewport, so that the
|
||||
* parent can handle them.
|
||||
*/
|
||||
virtual void contentsMousePressEvent(QMouseEvent *);
|
||||
virtual void mousePressEvent(QMouseEvent *);
|
||||
virtual void resizeEvent(QResizeEvent *);
|
||||
};
|
||||
|
||||
#endif
|
||||
191
include/knob.h
Normal file
191
include/knob.h
Normal file
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* knob.h - powerful knob-widget
|
||||
*
|
||||
* This file is based on the knob-widget of the Qwt Widget Library by Josef Wilgen
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _KNOB_H
|
||||
#define _KNOB_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPoint>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qpoint.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "templates.h"
|
||||
|
||||
|
||||
class QPixmap;
|
||||
class textFloat;
|
||||
|
||||
|
||||
enum knobTypes
|
||||
{
|
||||
knobDark_28, knobBright_26, knobSmall_17
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class knob : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
knob( int _knob_num, QWidget * _parent, const QString & _name );
|
||||
virtual ~knob();
|
||||
|
||||
enum ScrollMode
|
||||
{
|
||||
ScrNone,
|
||||
ScrMouse,
|
||||
ScrTimer,
|
||||
ScrDirect,
|
||||
ScrPage
|
||||
} ;
|
||||
|
||||
void setTracking( bool _enable );
|
||||
void setHintText( const QString & _txt_before,
|
||||
const QString & _txt_after );
|
||||
void setLabel( const QString & _txt );
|
||||
|
||||
void setTotalAngle( float _angle );
|
||||
|
||||
void setRange( float _vmin, float _vmax, float _vstep = 0.0,
|
||||
int _pagesize = 1 );
|
||||
|
||||
inline float value( void ) const
|
||||
{
|
||||
return( m_value );
|
||||
}
|
||||
|
||||
void setStep( float );
|
||||
|
||||
inline float maxValue( void ) const
|
||||
{
|
||||
return( m_maxValue );
|
||||
}
|
||||
inline float minValue( void ) const
|
||||
{
|
||||
return( m_minValue );
|
||||
}
|
||||
|
||||
inline void incPages( int _n_pages )
|
||||
{
|
||||
setNewValue( m_value + float( _n_pages ) * m_pageSize, 1 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
public slots:
|
||||
void setValue( float _val, bool _is_init_value = FALSE );
|
||||
void fitValue( float _val );
|
||||
void incValue( int _steps );
|
||||
void reset( void );
|
||||
void copyValue( void );
|
||||
void pasteValue( void );
|
||||
void connectToMidiDevice( void );
|
||||
void displayHelp( void );
|
||||
|
||||
|
||||
signals:
|
||||
void valueChanged( float value );
|
||||
void sliderPressed( void );
|
||||
void sliderReleased( void );
|
||||
void sliderMoved( float value );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _me );
|
||||
virtual void resizeEvent( QResizeEvent * _me );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void wheelEvent( QWheelEvent * _me );
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _me );
|
||||
|
||||
void drawKnob( QPainter * _p );
|
||||
void setPosition( const QPoint & _p );
|
||||
|
||||
|
||||
private:
|
||||
void layoutKnob( bool _update = TRUE );
|
||||
float getValue( const QPoint & _p );
|
||||
void getScrollMode( const QPoint & _p, int & _scroll_mode,
|
||||
int & _direction );
|
||||
void recalcAngle( void );
|
||||
|
||||
void valueChange( void );
|
||||
void rangeChange( void );
|
||||
|
||||
|
||||
void buttonReleased( void );
|
||||
|
||||
void setNewValue( float x, int align = 0 );
|
||||
|
||||
|
||||
static float s_copiedValue;
|
||||
static textFloat * s_textFloat;
|
||||
|
||||
|
||||
int m_knobWidth;
|
||||
int m_scrollMode;
|
||||
float m_mouseOffset;
|
||||
int m_direction;
|
||||
int m_tracking;
|
||||
QPoint m_origMousePos;
|
||||
|
||||
|
||||
float m_angle;
|
||||
float m_oldAngle;
|
||||
float m_totalAngle;
|
||||
float m_nTurns;
|
||||
|
||||
QPixmap * m_knobPixmap;
|
||||
int m_knobNum;
|
||||
QString m_hintTextBeforeValue;
|
||||
QString m_hintTextAfterValue;
|
||||
QString m_label;
|
||||
|
||||
|
||||
float m_minValue;
|
||||
float m_maxValue;
|
||||
float m_step;
|
||||
float m_pageSize;
|
||||
float m_value;
|
||||
float m_exactValue;
|
||||
float m_exactPrevValue;
|
||||
float m_prevValue;
|
||||
float m_initValue;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
84
include/lcd_spinbox.h
Normal file
84
include/lcd_spinbox.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/*
|
||||
* lcd_spinbox.h - class lcdSpinBox, an improved QLCDNumber
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _LCD_SPINBOX_H
|
||||
#define _LCD_SPINBOX_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QLCDNumber>
|
||||
|
||||
#else
|
||||
|
||||
#include <qlcdnumber.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
class lcdSpinBox : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
lcdSpinBox( int _min, int _max, int _num_digits, QWidget * _parent );
|
||||
virtual ~lcdSpinBox();
|
||||
|
||||
void setStep( int _step );
|
||||
|
||||
inline int value( void ) const
|
||||
{
|
||||
return( m_number->intValue() );
|
||||
}
|
||||
|
||||
void setValue( int _value );
|
||||
void setLabel( const QString & _txt );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
|
||||
|
||||
private:
|
||||
int m_value;
|
||||
int m_minValue;
|
||||
int m_maxValue;
|
||||
int m_step;
|
||||
|
||||
QLCDNumber * m_number;
|
||||
QLabel * m_label;
|
||||
|
||||
QPoint m_origMousePos;
|
||||
|
||||
|
||||
signals:
|
||||
void valueChanged( int );
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
67
include/led_checkbox.h
Normal file
67
include/led_checkbox.h
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* led_checkbox.h - class ledCheckBox, an improved QCheckBox
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _LED_CHECKBOX_H
|
||||
#define _LED_CHECKBOX_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QCheckBox>
|
||||
|
||||
#else
|
||||
|
||||
#include <qcheckbox.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class QPixmap;
|
||||
|
||||
|
||||
class ledCheckBox : public QCheckBox
|
||||
{
|
||||
public:
|
||||
enum ledColors
|
||||
{
|
||||
YELLOW, GREEN, TOTAL_COLORS
|
||||
} ;
|
||||
|
||||
ledCheckBox( const QString & _txt, QWidget * _parent,
|
||||
ledColors _color = YELLOW );
|
||||
virtual ~ledCheckBox();
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
|
||||
private:
|
||||
QPixmap * m_ledOnPixmap;
|
||||
QPixmap * m_ledOffPixmap;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
107
include/midi.h
Normal file
107
include/midi.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* midi.h - constants, structs etc. concerning MIDI
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MIDI_H
|
||||
#define _MIDI_H
|
||||
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
|
||||
enum midiEventTypes
|
||||
{
|
||||
// messages
|
||||
NOTE_OFF = 0x80,
|
||||
NOTE_ON = 0x90,
|
||||
KEY_PRESSURE = 0xA0,
|
||||
CONTROL_CHANGE = 0xB0,
|
||||
PROGRAM_CHANGE = 0xC0,
|
||||
CHANNEL_PRESSURE = 0xD0,
|
||||
PITCH_BEND = 0xE0,
|
||||
// system exclusive
|
||||
MIDI_SYSEX = 0xF0,
|
||||
// system common - never in midi files
|
||||
MIDI_TIME_CODE = 0xF1,
|
||||
MIDI_SONG_POSITION = 0xF2,
|
||||
MIDI_SONG_SELECT = 0xF3,
|
||||
MIDI_TUNE_REQUEST = 0xF6,
|
||||
MIDI_EOX = 0xF7,
|
||||
// system real-time - never in midi files
|
||||
MIDI_SYNC = 0xF8,
|
||||
MIDI_TICK = 0xF9,
|
||||
MIDI_START = 0xFA,
|
||||
MIDI_CONTINUE = 0xFB,
|
||||
MIDI_STOP = 0xFC,
|
||||
MIDI_ACTIVE_SENSING = 0xFE,
|
||||
MIDI_SYSTEM_RESET = 0xFF,
|
||||
// meta event - for midi files only
|
||||
MIDI_META_EVENT = 0xFF
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
struct midiEvent
|
||||
{
|
||||
midiEvent( midiEventTypes _type = MIDI_ACTIVE_SENSING,
|
||||
Uint8 _channel = 0,
|
||||
Uint16 _param1 = 0,
|
||||
Uint16 _param2 = 0 ) :
|
||||
m_type( _type ),
|
||||
m_channel( _channel ),
|
||||
m_sysExData( NULL )
|
||||
{
|
||||
m_data.m_param[0] = _param1;
|
||||
m_data.m_param[1] = _param2;
|
||||
}
|
||||
midiEvent( midiEventTypes _type, char * _sysex_data, int _data_len ) :
|
||||
m_type( _type ),
|
||||
m_channel( 0 ),
|
||||
m_sysExData( _sysex_data )
|
||||
{
|
||||
m_data.m_sysExDataLen = _data_len;
|
||||
}
|
||||
inline Uint16 key( void ) const
|
||||
{
|
||||
return( m_data.m_param[0] );
|
||||
}
|
||||
inline Uint32 velocity( void ) const
|
||||
{
|
||||
return( m_data.m_param[1] );
|
||||
}
|
||||
|
||||
midiEventTypes m_type; // MIDI event type
|
||||
Uint8 m_channel; // MIDI channel
|
||||
union
|
||||
{
|
||||
Uint16 m_param[2]; // first/second parameter (key/velocity)
|
||||
int m_sysExDataLen; // len of m_sysExData
|
||||
} m_data;
|
||||
|
||||
char * m_sysExData;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
107
include/midi_alsa_raw.h
Normal file
107
include/midi_alsa_raw.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
* midi_alsa_raw.h - midi-device-driver for RawMIDI via ALSA
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MIDI_ALSA_RAW_H
|
||||
#define _MIDI_ALSA_RAW_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_ALSA_ASOUNDLIB_H
|
||||
|
||||
#ifndef ALSA_SUPPORT
|
||||
#define ALSA_SUPPORT
|
||||
#endif
|
||||
|
||||
#include <alsa/asoundlib.h>
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QThread>
|
||||
|
||||
#else
|
||||
|
||||
#include <qthread.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "midi_device.h"
|
||||
|
||||
|
||||
struct pollfd;
|
||||
class QLineEdit;
|
||||
|
||||
|
||||
class midiALSARaw : public midiDevice, public QThread
|
||||
{
|
||||
public:
|
||||
midiALSARaw( channelTrack * _ct = NULL );
|
||||
~midiALSARaw();
|
||||
|
||||
static QString probeDevice( void );
|
||||
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
return( setupWidget::tr( "ALSA Raw-MIDI (Advanced Linux Sound "
|
||||
"Architecture)" ) );
|
||||
}
|
||||
|
||||
|
||||
class setupWidget : public midiDevice::setupWidget
|
||||
{
|
||||
public:
|
||||
setupWidget( QWidget * _parent );
|
||||
virtual ~setupWidget();
|
||||
|
||||
virtual void saveSettings( void );
|
||||
|
||||
private:
|
||||
QLineEdit * m_device;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
protected:
|
||||
virtual void FASTCALL sendByte( Uint8 _c );
|
||||
virtual void FASTCALL run( void );
|
||||
|
||||
|
||||
private:
|
||||
snd_rawmidi_t * m_input, * * m_inputp;
|
||||
snd_rawmidi_t * m_output, * * m_outputp;
|
||||
int m_npfds;
|
||||
pollfd * m_pfds;
|
||||
|
||||
volatile bool m_quit;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
77
include/midi_dummy.h
Normal file
77
include/midi_dummy.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* midi_dummy.h - dummy MIDI-driver
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MIDI_DUMMY_H
|
||||
#define _MIDI_DUMMY_H
|
||||
|
||||
|
||||
#include "midi_device.h"
|
||||
#include "tab_widget.h"
|
||||
|
||||
|
||||
class midiDummy : public midiDevice
|
||||
{
|
||||
public:
|
||||
midiDummy() :
|
||||
midiDevice()
|
||||
{
|
||||
}
|
||||
~midiDummy()
|
||||
{
|
||||
}
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
return( setupWidget::tr( "Dummy (no MIDI support)" ) );
|
||||
}
|
||||
|
||||
|
||||
class setupWidget : public midiDevice::setupWidget
|
||||
{
|
||||
public:
|
||||
setupWidget( QWidget * _parent ) :
|
||||
midiDevice::setupWidget( midiDummy::name(), _parent )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~setupWidget()
|
||||
{
|
||||
}
|
||||
|
||||
virtual void saveSettings( void )
|
||||
{
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
protected:
|
||||
virtual void FASTCALL sendByte( Uint8 )
|
||||
{
|
||||
}
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
112
include/midi_mapper.h
Normal file
112
include/midi_mapper.h
Normal file
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* midi_mapper.h - MIDI-mapper for any midiDevice
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MIDI_MAPPER_H
|
||||
#define _MIDI_MAPPER_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QPair>
|
||||
#include <QFile>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpair.h>
|
||||
#include <qfile.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
const Uint8 MIDI_PROGRAMS = 128;
|
||||
const Uint8 MIDI_KEYS = 128;
|
||||
const Uint8 MIDI_CHANNELS = 16;
|
||||
|
||||
class midiMapper
|
||||
{
|
||||
public:
|
||||
midiMapper( const QString & _map );
|
||||
~midiMapper();
|
||||
|
||||
inline const QString & programName( Uint8 _program ) const
|
||||
{
|
||||
return( m_patchMap[_program].second );
|
||||
}
|
||||
|
||||
inline Uint8 mappedProgramNumber( Uint8 _program ) const
|
||||
{
|
||||
return( m_patchMap[_program].first );
|
||||
}
|
||||
|
||||
inline const QString & drumsetKeyName( Uint8 _key ) const
|
||||
{
|
||||
return( m_drumsetKeyMap[_key].second );
|
||||
}
|
||||
inline Uint8 keyForDrumName( const QString & _name ) const
|
||||
{
|
||||
for( Uint8 i = 0; i < MIDI_KEYS; ++i )
|
||||
{
|
||||
if( m_drumsetKeyMap[i].second == _name )
|
||||
{
|
||||
return( i );
|
||||
}
|
||||
}
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
inline Uint8 drumsetChannel( void ) const
|
||||
{
|
||||
return( m_drumsetChannel );
|
||||
}
|
||||
|
||||
inline Uint8 drumsetPatch( void ) const
|
||||
{
|
||||
return( m_drumsetPatch );
|
||||
}
|
||||
|
||||
inline Uint8 mappedChannel( Uint8 _channel ) const
|
||||
{
|
||||
return( m_channelMap[_channel] );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void readPatchMap( QFile & _f );
|
||||
void readDrumsetKeyMap( QFile & _f );
|
||||
void readChannelMap( QFile & _f );
|
||||
|
||||
QPair<Uint8, QString> m_patchMap[MIDI_PROGRAMS];
|
||||
QPair<Uint8, QString> m_drumsetKeyMap[MIDI_KEYS];
|
||||
Uint8 m_channelMap[MIDI_CHANNELS];
|
||||
Uint8 m_drumsetChannel;
|
||||
Uint8 m_drumsetPatch;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
79
include/midi_oss.h
Normal file
79
include/midi_oss.h
Normal file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
* midi_oss.h - OSS-driver for MIDI-port
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MIDI_OSS_H
|
||||
#define _MIDI_OSS_H
|
||||
|
||||
#include <qthread.h>
|
||||
#include <qfile.h>
|
||||
|
||||
#include "midi_device.h"
|
||||
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
|
||||
class midiOSS : public midiDevice, public QThread
|
||||
{
|
||||
public:
|
||||
midiOSS( channelTrack * _ct = NULL );
|
||||
~midiOSS();
|
||||
|
||||
static QString probeDevice( void );
|
||||
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
return( setupWidget::tr( "OSS Raw-MIDI (Open Sound System)" ) );
|
||||
}
|
||||
|
||||
|
||||
class setupWidget : public midiDevice::setupWidget
|
||||
{
|
||||
public:
|
||||
setupWidget( QWidget * _parent );
|
||||
virtual ~setupWidget();
|
||||
|
||||
virtual void saveSettings( void );
|
||||
|
||||
private:
|
||||
QLineEdit * m_device;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
protected:
|
||||
virtual void FASTCALL sendByte( Uint8 _c );
|
||||
virtual void FASTCALL run( void );
|
||||
|
||||
|
||||
private:
|
||||
QFile m_midiDev;
|
||||
|
||||
volatile bool m_quit;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
122
include/midi_time.h
Normal file
122
include/midi_time.h
Normal file
@@ -0,0 +1,122 @@
|
||||
/*
|
||||
* midi_time.h - declaration of class midiTime which provides data-type for
|
||||
* position- and length-variables
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MIDI_TIME_H
|
||||
#define _MIDI_TIME_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
class midiTime
|
||||
{
|
||||
public:
|
||||
inline midiTime( tact _tact, tact64th _tact_64th ) :
|
||||
m_tact( _tact ),
|
||||
m_tact64th( _tact_64th )
|
||||
{
|
||||
}
|
||||
|
||||
inline midiTime( Sint32 _abs = 0 ) :
|
||||
m_tact( _abs / 64 ),
|
||||
m_tact64th( _abs % 64 )
|
||||
{
|
||||
}
|
||||
|
||||
inline midiTime( const midiTime & _t )
|
||||
{
|
||||
*this = _t;
|
||||
}
|
||||
|
||||
inline midiTime & operator=( const midiTime & _t )
|
||||
{
|
||||
m_tact = _t.m_tact;
|
||||
m_tact64th = _t.m_tact64th;
|
||||
return( *this );
|
||||
}
|
||||
|
||||
inline midiTime & operator+=( const midiTime & _t )
|
||||
{
|
||||
return( *this = static_cast<Sint32>( *this ) +
|
||||
static_cast<Sint32>( _t ) );
|
||||
}
|
||||
|
||||
inline midiTime & operator-=( const midiTime & _t )
|
||||
{
|
||||
return( *this = static_cast<Sint32>( *this ) -
|
||||
static_cast<Sint32>( _t ) );
|
||||
}
|
||||
|
||||
inline void setTact( tact _t )
|
||||
{
|
||||
m_tact = _t;
|
||||
}
|
||||
|
||||
inline tact getTact( void ) const
|
||||
{
|
||||
return( m_tact );
|
||||
}
|
||||
|
||||
inline void setTact64th( tact64th _t )
|
||||
{
|
||||
m_tact64th = _t;
|
||||
}
|
||||
|
||||
inline tact64th getTact64th( void ) const
|
||||
{
|
||||
return( m_tact64th );
|
||||
}
|
||||
|
||||
// converts time-class in an absolute value, useful for calculations,
|
||||
// comparisons and so on...
|
||||
inline operator Sint32( void ) const
|
||||
{
|
||||
return( static_cast<Sint32>( m_tact ) * 64 +
|
||||
static_cast<Sint32>( m_tact64th ) );
|
||||
}
|
||||
|
||||
// calculate number of frame that are needed this time
|
||||
inline Uint32 frames( float _frames_per_tact ) const
|
||||
{
|
||||
if( m_tact >= 0 )
|
||||
{
|
||||
return( static_cast<Uint32>( m_tact *
|
||||
_frames_per_tact +
|
||||
m_tact64th *
|
||||
_frames_per_tact /
|
||||
64.0f ) );
|
||||
}
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
tact m_tact;
|
||||
tact64th m_tact64th;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
341
include/mixer.h
Normal file
341
include/mixer.h
Normal file
@@ -0,0 +1,341 @@
|
||||
/*
|
||||
* mixer.h - audio-device-independent mixer for LMMS
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MIXER_H
|
||||
#define _MIXER_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QThread>
|
||||
#include <QMutex>
|
||||
#include <QVector>
|
||||
|
||||
#else
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qthread.h>
|
||||
#include <qmutex.h>
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "types.h"
|
||||
#include "volume.h"
|
||||
#include "panning.h"
|
||||
#include "note.h"
|
||||
#include "play_handle.h"
|
||||
|
||||
|
||||
class audioDevice;
|
||||
class midiDevice;
|
||||
class lmmsMainWin;
|
||||
|
||||
|
||||
const int DEFAULT_BUFFER_SIZE = 512;
|
||||
|
||||
const Uint16 MAX_SAMPLE_PACKETS = 256; // how many parallel audio-samples-
|
||||
// buffers shall be maximal exist and
|
||||
// mixed together?
|
||||
|
||||
const Uint8 DEFAULT_CHANNELS = 2;
|
||||
|
||||
const Uint8 SURROUND_CHANNELS =
|
||||
#ifndef DISABLE_SURROUND
|
||||
4;
|
||||
#else
|
||||
2;
|
||||
#endif
|
||||
|
||||
const Uint8 QUALITY_LEVELS = 2;
|
||||
const Uint32 DEFAULT_QUALITY_LEVEL = 0;
|
||||
const Uint32 HIGH_QUALITY_LEVEL = DEFAULT_QUALITY_LEVEL+1;
|
||||
extern Uint32 SAMPLE_RATES[QUALITY_LEVELS];
|
||||
const Uint32 DEFAULT_SAMPLE_RATE = 44100;//SAMPLE_RATES[DEFAULT_QUALITY_LEVEL];
|
||||
|
||||
|
||||
typedef sampleType sampleFrame[DEFAULT_CHANNELS];
|
||||
typedef sampleType surroundSampleFrame[SURROUND_CHANNELS];
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float vol[SURROUND_CHANNELS];
|
||||
} volumeVector;
|
||||
|
||||
|
||||
const Uint32 BYTES_PER_SAMPLE = sizeof( sampleType );
|
||||
const Uint32 BYTES_PER_FRAME = sizeof( sampleFrame );
|
||||
const Uint32 BYTES_PER_SURROUND_FRAME = sizeof( surroundSampleFrame );
|
||||
const Uint32 BYTES_PER_OUTPUT_SAMPLE = sizeof( outputSampleType );
|
||||
|
||||
const float OUTPUT_SAMPLE_MULTIPLIER = 32767.0f;
|
||||
|
||||
|
||||
const float BASE_FREQ = 440.0f;
|
||||
const tones BASE_TONE = A;
|
||||
const octaves BASE_OCTAVE = OCTAVE_4;
|
||||
|
||||
|
||||
|
||||
class mixer :
|
||||
#ifndef QT4
|
||||
public QObject,
|
||||
#endif
|
||||
public QThread
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static inline mixer * inst( void )
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new mixer();
|
||||
}
|
||||
return( s_instanceOfMe );
|
||||
}
|
||||
|
||||
|
||||
void FASTCALL addBuffer( sampleFrame * _buf, Uint32 _frames,
|
||||
Uint32 _framesAhead,
|
||||
volumeVector & _volumeVector );
|
||||
inline Uint32 framesPerAudioBuffer( void ) const
|
||||
{
|
||||
return( m_framesPerAudioBuffer );
|
||||
}
|
||||
|
||||
|
||||
inline bool highQuality( void ) const
|
||||
{
|
||||
return( m_qualityLevel > DEFAULT_QUALITY_LEVEL );
|
||||
}
|
||||
|
||||
|
||||
inline const surroundSampleFrame * currentAudioBuffer( void ) const
|
||||
{
|
||||
return( m_curBuf );
|
||||
}
|
||||
|
||||
// audio-device-stuff
|
||||
inline const QString & audioDevName( void ) const
|
||||
{
|
||||
return( m_audioDevName );
|
||||
}
|
||||
|
||||
void FASTCALL setAudioDevice( audioDevice * _dev, bool _hq );
|
||||
void restoreAudioDevice( void );
|
||||
|
||||
|
||||
// MIDI-device-stuff
|
||||
inline const QString & midiDevName( void ) const
|
||||
{
|
||||
return( m_midiDevName );
|
||||
}
|
||||
|
||||
inline midiDevice * getMIDIDevice( void )
|
||||
{
|
||||
return( m_midiDev );
|
||||
}
|
||||
|
||||
|
||||
inline void addPlayHandle( playHandle * _ph )
|
||||
{
|
||||
m_playHandles.push_back( _ph );
|
||||
}
|
||||
|
||||
inline void removePlayHandle( playHandle * _ph )
|
||||
{
|
||||
m_playHandlesToRemove.push_back( _ph );
|
||||
}
|
||||
|
||||
void FASTCALL checkValidityOfPlayHandles( void );
|
||||
|
||||
|
||||
inline int sampleRate( void )
|
||||
{
|
||||
return( SAMPLE_RATES[m_qualityLevel] );
|
||||
}
|
||||
|
||||
|
||||
inline float masterOutput( void ) const
|
||||
{
|
||||
return( m_masterOutput );
|
||||
}
|
||||
|
||||
inline void setMasterOutput( float _mo )
|
||||
{
|
||||
m_masterOutput = _mo;
|
||||
}
|
||||
|
||||
|
||||
static inline sampleType clip( sampleType _s )
|
||||
{
|
||||
if( _s > 1.0f )
|
||||
{
|
||||
return( 1.0f );
|
||||
}
|
||||
else if( _s < -1.0f )
|
||||
{
|
||||
return( -1.0f );
|
||||
}
|
||||
return( _s );
|
||||
}
|
||||
|
||||
|
||||
inline void pause( void )
|
||||
{
|
||||
m_safetySyncMutex.lock();
|
||||
}
|
||||
|
||||
inline void play( void )
|
||||
{
|
||||
m_safetySyncMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
void clear( void );
|
||||
|
||||
|
||||
void FASTCALL clearAudioBuffer( sampleFrame * _ab, Uint32 _frames );
|
||||
#ifndef DISABLE_SURROUND
|
||||
void FASTCALL clearAudioBuffer( surroundSampleFrame * _ab,
|
||||
Uint32 _frames );
|
||||
#endif
|
||||
|
||||
inline bool haveNoRunningNotes( void ) const
|
||||
{
|
||||
return( m_playHandles.size() == 0 );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void setHighQuality( bool _hq_on = FALSE );
|
||||
|
||||
|
||||
signals:
|
||||
void sampleRateChanged( void );
|
||||
void nextAudioBuffer( const surroundSampleFrame *, Uint32 _frames );
|
||||
|
||||
|
||||
private:
|
||||
struct samplePacket
|
||||
{
|
||||
surroundSampleFrame * m_buffer; // actual buffer for
|
||||
// wave-data
|
||||
Uint32 m_frames;
|
||||
Uint32 m_framesDone;
|
||||
Uint32 m_framesAhead; // number of frames, the buffer
|
||||
// should be mixed ahead
|
||||
volume m_vol;
|
||||
panning m_pan;
|
||||
enum samplePacketStates
|
||||
{
|
||||
READY, FILLING, UNUSED
|
||||
} m_state;
|
||||
} ;
|
||||
|
||||
|
||||
static mixer * s_instanceOfMe;
|
||||
|
||||
mixer();
|
||||
~mixer();
|
||||
|
||||
void quitThread( void );
|
||||
|
||||
|
||||
// we don't allow to create mixer by using copy-ctor
|
||||
mixer( const mixer & ) :
|
||||
#ifndef QT4
|
||||
QObject(),
|
||||
#endif
|
||||
QThread(),
|
||||
m_curBuf( m_buffer1 ),
|
||||
m_nextBuf( m_buffer2 )
|
||||
{
|
||||
}
|
||||
|
||||
virtual void run( void );
|
||||
|
||||
|
||||
void FASTCALL mixSamplePacket( samplePacket * _sp );
|
||||
|
||||
|
||||
audioDevice * tryAudioDevices( void );
|
||||
midiDevice * tryMIDIDevices( void );
|
||||
|
||||
|
||||
|
||||
sampleFrame * m_silence;
|
||||
#ifndef DISABLE_SURROUND
|
||||
surroundSampleFrame * m_surroundSilence;// cool, silence in surround ;-)
|
||||
#endif
|
||||
|
||||
|
||||
samplePacket m_samplePackets[MAX_SAMPLE_PACKETS];
|
||||
|
||||
Uint32 m_framesPerAudioBuffer;
|
||||
|
||||
surroundSampleFrame * m_buffer1;
|
||||
surroundSampleFrame * m_buffer2;
|
||||
|
||||
surroundSampleFrame * m_curBuf;
|
||||
surroundSampleFrame * m_nextBuf;
|
||||
|
||||
bool m_discardCurBuf;
|
||||
|
||||
|
||||
playHandleVector m_playHandles;
|
||||
playHandleVector m_playHandlesToRemove;
|
||||
|
||||
Uint8 m_qualityLevel;
|
||||
volatile float m_masterOutput;
|
||||
|
||||
volatile bool m_quit;
|
||||
|
||||
|
||||
|
||||
audioDevice * m_audioDev;
|
||||
audioDevice * m_oldAudioDev;
|
||||
QString m_audioDevName;
|
||||
|
||||
|
||||
midiDevice * m_midiDev;
|
||||
QString m_midiDevName;
|
||||
|
||||
|
||||
QMutex m_safetySyncMutex;
|
||||
QMutex m_devMutex;
|
||||
|
||||
|
||||
friend class lmmsMainWin;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
109
include/mmp.h
Normal file
109
include/mmp.h
Normal file
@@ -0,0 +1,109 @@
|
||||
/*
|
||||
* mmp.h - class for reading and writing multimedia-project-files
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MMP_H
|
||||
#define _MMP_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <Qt/QtXml>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdom.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "types.h"
|
||||
|
||||
|
||||
class multimediaProject : public QDomDocument
|
||||
{
|
||||
public:
|
||||
enum projectTypes
|
||||
{
|
||||
UNKNOWN,
|
||||
SONG_PROJECT,
|
||||
CHANNEL_SETTINGS,
|
||||
EFFECT_SETTINGS,
|
||||
VIDEO_PROJECT, // will come later...
|
||||
BURN_PROJECT, // will come later...
|
||||
PLAYLIST, // will come later...
|
||||
PROJ_TYPE_COUNT
|
||||
} ;
|
||||
|
||||
|
||||
multimediaProject( const QString & _in_file_name );
|
||||
multimediaProject( projectTypes _project_type );
|
||||
~multimediaProject();
|
||||
|
||||
bool FASTCALL writeFile( const QString & _fn,
|
||||
bool _overwrite_check = TRUE );
|
||||
|
||||
inline QDomElement & content( void )
|
||||
{
|
||||
return( m_content );
|
||||
}
|
||||
inline QDomElement & head( void )
|
||||
{
|
||||
return( m_head );
|
||||
}
|
||||
|
||||
inline projectTypes type( void ) const
|
||||
{
|
||||
return( m_type );
|
||||
}
|
||||
|
||||
static projectTypes FASTCALL typeOfFile( const QString & _fn );
|
||||
|
||||
|
||||
private:
|
||||
static projectTypes FASTCALL type( const QString & _type_name );
|
||||
static QString FASTCALL typeName( projectTypes _project_type );
|
||||
|
||||
struct typeDescStruct
|
||||
{
|
||||
projectTypes m_type;
|
||||
QString m_name;
|
||||
} ;
|
||||
static typeDescStruct s_types[PROJ_TYPE_COUNT];
|
||||
|
||||
QDomElement m_content;
|
||||
QDomElement m_head;
|
||||
projectTypes m_type;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
const Uint8 MMP_MAJOR_VERSION = 1;
|
||||
const Uint8 MMP_MINOR_VERSION = 0;
|
||||
const QString MMP_VERSION_STRING = QString::number( MMP_MAJOR_VERSION ) + "." +
|
||||
QString::number( MMP_MINOR_VERSION );
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
75
include/name_label.h
Normal file
75
include/name_label.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* name_label.h - class nameLabel, a label which is renamable by
|
||||
* double-clicking it
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NAME_LABEL_H
|
||||
#define _NAME_LABEL_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QLabel>
|
||||
#include <QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qlabel.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class nameLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
nameLabel( const QString & _initial_name, QWidget * _parent,
|
||||
const QPixmap & _pm = QPixmap() );
|
||||
~nameLabel();
|
||||
const QPixmap * pixmap( void ) const;
|
||||
|
||||
|
||||
public slots:
|
||||
void setPixmap( const QPixmap & _pm );
|
||||
void rename( void );
|
||||
|
||||
|
||||
signals:
|
||||
void nameChanged( const QString & _new_name );
|
||||
void clicked( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
|
||||
private:
|
||||
QPixmap m_pm;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
167
include/note.h
Normal file
167
include/note.h
Normal file
@@ -0,0 +1,167 @@
|
||||
/*
|
||||
* note.h - declaration of class note which contains all informations about a
|
||||
* note + definitions of several constants and enums
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NOTE_H
|
||||
#define _NOTE_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QVector>
|
||||
|
||||
#else
|
||||
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "volume.h"
|
||||
#include "panning.h"
|
||||
#include "midi_time.h"
|
||||
#include "settings.h"
|
||||
|
||||
enum tones
|
||||
{
|
||||
C = 0,
|
||||
CIS = 1, DES = 1,
|
||||
D = 2,
|
||||
DIS = 3, ES = 3,
|
||||
E = 4, FES = 4,
|
||||
F = 5,
|
||||
FIS = 6, GES = 6,
|
||||
G = 7,
|
||||
GIS = 8, AS = 8,
|
||||
A = 9,
|
||||
AIS = 10, B = 10,
|
||||
H = 11
|
||||
} ;
|
||||
|
||||
|
||||
enum octaves
|
||||
{
|
||||
OCTAVE_0,
|
||||
OCTAVE_1,
|
||||
OCTAVE_2,
|
||||
OCTAVE_3,
|
||||
OCTAVE_4, // default
|
||||
OCTAVE_5,
|
||||
OCTAVE_6,
|
||||
OCTAVE_7,
|
||||
OCTAVE_8
|
||||
} ;
|
||||
|
||||
const octaves DEFAULT_OCTAVE = OCTAVE_4;
|
||||
const octaves MIN_OCTAVE = OCTAVE_0;
|
||||
const octaves MAX_OCTAVE = OCTAVE_8;
|
||||
|
||||
const int WHITE_KEYS_PER_OCTAVE = 7;
|
||||
const int BLACK_KEYS_PER_OCTAVE = 5;
|
||||
const int NOTES_PER_OCTAVE = WHITE_KEYS_PER_OCTAVE + BLACK_KEYS_PER_OCTAVE;
|
||||
const int OCTAVES = 9;
|
||||
|
||||
|
||||
|
||||
class note : public settings
|
||||
{
|
||||
public:
|
||||
note( const midiTime & _length = 0, const midiTime & _pos = 0,
|
||||
tones _tone = A, octaves _octave = DEFAULT_OCTAVE,
|
||||
volume _volume = DEFAULT_VOLUME,
|
||||
panning _panning = DEFAULT_PANNING ) FASTCALL;
|
||||
~note();
|
||||
void FASTCALL setLength( const midiTime & _length );
|
||||
void FASTCALL setPos( const midiTime & _pos );
|
||||
void FASTCALL setTone( tones _tone = C );
|
||||
void FASTCALL setOctave( octaves _octave = DEFAULT_OCTAVE );
|
||||
void FASTCALL setKey( int _key );
|
||||
void FASTCALL setVolume( volume _volume = DEFAULT_VOLUME );
|
||||
void FASTCALL setPanning( panning _panning = DEFAULT_PANNING );
|
||||
inline midiTime endPos( void ) const
|
||||
{
|
||||
return( m_pos + m_length);
|
||||
}
|
||||
inline const midiTime & length( void ) const
|
||||
{
|
||||
return( m_length );
|
||||
}
|
||||
inline const midiTime & pos( void ) const
|
||||
{
|
||||
return( m_pos );
|
||||
}
|
||||
inline midiTime pos( midiTime _base_pos ) const
|
||||
{
|
||||
return( m_pos - _base_pos );
|
||||
}
|
||||
inline tones tone( void ) const
|
||||
{
|
||||
return( m_tone );
|
||||
}
|
||||
inline octaves octave( void ) const
|
||||
{
|
||||
return( m_octave );
|
||||
}
|
||||
inline int key( void ) const
|
||||
{
|
||||
return( m_octave * NOTES_PER_OCTAVE + m_tone );
|
||||
}
|
||||
inline volume getVolume( void ) const
|
||||
{
|
||||
return( m_volume );
|
||||
}
|
||||
inline panning getPanning( void ) const
|
||||
{
|
||||
return( m_panning );
|
||||
}
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "note" );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
tones m_tone;
|
||||
octaves m_octave;
|
||||
volume m_volume;
|
||||
panning m_panning;
|
||||
midiTime m_length;
|
||||
midiTime m_pos;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
typedef vvector<note *> noteVector;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
180
include/note_play_handle.h
Normal file
180
include/note_play_handle.h
Normal file
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* note_play_handle.h - declaration of class notePlayHandle which is needed
|
||||
* by LMMS-Play-Engine
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NOTE_PLAY_HANDLE_H
|
||||
#define _NOTE_PLAY_HANDLE_H
|
||||
|
||||
#include <qpair.h>
|
||||
|
||||
#include "play_handle.h"
|
||||
#include "basic_filters.h"
|
||||
#include "note.h"
|
||||
|
||||
|
||||
class channelTrack;
|
||||
class notePlayHandle;
|
||||
|
||||
typedef vvector<notePlayHandle *> notePlayHandleVector;
|
||||
|
||||
|
||||
class notePlayHandle : public playHandle, public note
|
||||
{
|
||||
public:
|
||||
void * m_pluginData;
|
||||
basicFilters<> * m_filter;
|
||||
|
||||
notePlayHandle( channelTrack * _chnl_trk, Uint32 _frames_ahead,
|
||||
Uint32 _frames, note * n,
|
||||
bool _arp_note = FALSE ) FASTCALL;
|
||||
~notePlayHandle();
|
||||
|
||||
|
||||
virtual void play( void );
|
||||
|
||||
virtual inline bool done( void ) const
|
||||
{
|
||||
return( ( m_released && m_framesBeforeRelease == 0 &&
|
||||
m_releaseFramesDone >= m_releaseFramesToDo ) ||
|
||||
m_channelTrack == NULL );
|
||||
}
|
||||
|
||||
virtual void checkValidity( void );
|
||||
|
||||
|
||||
void FASTCALL noteOff( Uint32 _s = 0 );
|
||||
|
||||
inline Uint32 framesBeforeRelease( void ) const
|
||||
{
|
||||
return( m_framesBeforeRelease );
|
||||
}
|
||||
|
||||
inline Uint32 releaseFramesDone( void ) const
|
||||
{
|
||||
return( m_releaseFramesDone );
|
||||
}
|
||||
|
||||
Uint32 actualReleaseFramesToDo( void ) const;
|
||||
|
||||
// returns how many samples this note is aligned ahead, i.e.
|
||||
// at which position it is inserted in the according buffer
|
||||
inline Uint32 framesAhead( void ) const
|
||||
{
|
||||
return ( m_framesAhead );
|
||||
}
|
||||
|
||||
// returns total numbers of frames to play
|
||||
inline Uint32 frames( void ) const
|
||||
{
|
||||
return( m_frames );
|
||||
}
|
||||
|
||||
void setFrames( Uint32 _frames );
|
||||
|
||||
// returns whether note was released
|
||||
inline bool released( void ) const
|
||||
{
|
||||
return( m_released );
|
||||
}
|
||||
|
||||
// returns total numbers of played frames
|
||||
inline Uint32 totalFramesPlayed( void ) const
|
||||
{
|
||||
return( m_totalFramesPlayed );
|
||||
}
|
||||
|
||||
// returns volume-level at frame _frame (envelope/LFO)
|
||||
float FASTCALL volumeLevel( Uint32 _frame );
|
||||
|
||||
// adds note-play-handle _n as subnote
|
||||
inline void addSubNote( notePlayHandle * _n )
|
||||
{
|
||||
m_subNotes.push_back( _n );
|
||||
_n->m_baseNote = FALSE;
|
||||
// if there was an arp-note added and this note is a base-note
|
||||
// we set arp-note-flag for indicating that this note is an
|
||||
// arpeggio-base-note
|
||||
m_arpNote = _n->arpNote() && baseNote();
|
||||
}
|
||||
|
||||
// returns channel-track this note-play-handle plays
|
||||
inline channelTrack * getChannelTrack( void )
|
||||
{
|
||||
return( m_channelTrack );
|
||||
}
|
||||
|
||||
// returns whether note is a base-note, e.g. is not part of an arpeggio
|
||||
// or a chord
|
||||
inline bool baseNote( void ) const
|
||||
{
|
||||
return( m_baseNote );
|
||||
}
|
||||
|
||||
// returns whether note is part of an arpeggio
|
||||
inline bool arpNote( void ) const
|
||||
{
|
||||
return( m_arpNote );
|
||||
}
|
||||
|
||||
// returns whether note is base-note for arpeggio
|
||||
inline bool arpBaseNote( void ) const
|
||||
{
|
||||
return( baseNote() && arpNote() );
|
||||
}
|
||||
|
||||
inline bool muted( void ) const
|
||||
{
|
||||
return( m_muted );
|
||||
}
|
||||
|
||||
void mute( void );
|
||||
|
||||
|
||||
private:
|
||||
channelTrack * m_channelTrack; // needed for calling
|
||||
// channelTrack::playNote
|
||||
Uint32 m_frames; // total frames to play
|
||||
Uint32 m_framesAhead; // numbers of frames ahead in buffer
|
||||
// to mix in
|
||||
Uint32 m_totalFramesPlayed; // total frame-counter - used for
|
||||
// figuring out whether a whole note
|
||||
// has been played
|
||||
Uint32 m_framesBeforeRelease; // number of frames after which note
|
||||
// is released
|
||||
Uint32 m_releaseFramesToDo; // total numbers of frames to be
|
||||
// played after release
|
||||
Uint32 m_releaseFramesDone; // number of frames done after
|
||||
// release of note
|
||||
notePlayHandleVector m_subNotes;// used for chords and arpeggios
|
||||
bool m_released; // indicates whether note is released
|
||||
bool m_baseNote; // indicates whether note is a
|
||||
// base-note (i.e. no sub-note)
|
||||
bool m_arpNote; // indicates whether note is part of
|
||||
// an arpeggio (either base-note or
|
||||
// sub-note)
|
||||
bool m_muted; // indicates whether note is muted
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
91
include/nstate_button.h
Normal file
91
include/nstate_button.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* nstate_button.h - declaration of class nStateButton
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _NSTATE_BUTTON_H
|
||||
#define _NSTATE_BUTTON_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPixmap>
|
||||
#include <QVector>
|
||||
#include <QPair>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qvaluevector.h>
|
||||
#include <qpair.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class nStateButton : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
nStateButton( QWidget * _parent );
|
||||
virtual ~nStateButton();
|
||||
void addState( const QPixmap & _pixmap, const QString & _tooltip = "" );
|
||||
|
||||
inline void setGeneralToolTip( const QString & _tooltip )
|
||||
{
|
||||
m_generalToolTip = _tooltip;
|
||||
}
|
||||
|
||||
inline int state( void ) const
|
||||
{
|
||||
return( m_curState );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void changeState( int _n );
|
||||
|
||||
|
||||
signals:
|
||||
void stateChanged( int _n );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
|
||||
|
||||
private:
|
||||
vvector<QPair<QPixmap *, QString> > m_states;
|
||||
QString m_generalToolTip;
|
||||
|
||||
int m_curState;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
211
include/oscillator.h
Normal file
211
include/oscillator.h
Normal file
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
* oscillator.h - header-file for oscillator.cpp, a powerful oscillator-class
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _OSCILLATOR_H
|
||||
#define _OSCILLATOR_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#include "mixer.h"
|
||||
#include "interpolation.h"
|
||||
|
||||
|
||||
// fwd-decl because we need it for the typedef below...
|
||||
class oscillator;
|
||||
|
||||
typedef void ( oscillator:: * oscFuncPtr )
|
||||
( sampleFrame * _ab, Uint32 _frames, Uint8 _chnl );
|
||||
|
||||
|
||||
|
||||
class oscillator
|
||||
{
|
||||
public:
|
||||
enum waveShapes
|
||||
{
|
||||
SIN_WAVE,
|
||||
TRIANGLE_WAVE,
|
||||
SAW_WAVE,
|
||||
SQUARE_WAVE,
|
||||
MOOG_SAW_WAVE,
|
||||
EXP_WAVE,
|
||||
WHITE_NOISE_WAVE,
|
||||
USER_DEF_WAVE
|
||||
} ;
|
||||
|
||||
enum modulationAlgos
|
||||
{
|
||||
FREQ_MODULATION, AMP_MODULATION, MIX, SYNC
|
||||
} ;
|
||||
|
||||
oscillator( modulationAlgos _modulation_algo, float _freq,
|
||||
Sint16 _phase_offset, float _volume_factor,
|
||||
oscillator * _m_subOsc );
|
||||
inline virtual ~oscillator()
|
||||
{
|
||||
delete m_subOsc;
|
||||
}
|
||||
inline void setUserWave( const sampleFrame * _data, Uint32 _frames )
|
||||
{
|
||||
m_userWaveData = _data;
|
||||
m_userWaveFrames = _frames;
|
||||
}
|
||||
inline void update( sampleFrame * _ab, Uint32 _frames, Uint8 _chnl )
|
||||
{
|
||||
( this->*m_callUpdate )( _ab, _frames, _chnl );
|
||||
}
|
||||
inline void setNewFreq( float _new_freq )
|
||||
{
|
||||
// save current state - we need it later for restoring same
|
||||
// phase (otherwise we'll get clicks in the audio-stream)
|
||||
const float v = m_sample * m_oscCoeff;
|
||||
m_freq = _new_freq;
|
||||
recalcOscCoeff( phase( v ) );
|
||||
}
|
||||
|
||||
static oscillator * FASTCALL createNewOsc( waveShapes _wave_shape,
|
||||
modulationAlgos _modulation_algo, float _freq,
|
||||
Sint16 _phase_offset, float _volume_factor,
|
||||
oscillator * _m_subOsc = NULL );
|
||||
|
||||
inline bool syncOk( void )
|
||||
{
|
||||
const float v1 = m_sample * m_oscCoeff;
|
||||
const float v2 = ++m_sample * m_oscCoeff;
|
||||
// check whether v2 is in next period
|
||||
return( floorf( v2 ) > floorf( v1 ) );
|
||||
}
|
||||
static inline float phase( float _sample )
|
||||
{
|
||||
float t;
|
||||
return( modff( _sample, &t ) );
|
||||
//return( _sample - floorf( _sample ) );
|
||||
}
|
||||
// now follow the wave-shape-routines...
|
||||
static inline sampleType sinSample( float _sample )
|
||||
{
|
||||
return( sinf( _sample * static_cast<sampleType>( 2.0f * M_PI
|
||||
) ) );
|
||||
}
|
||||
|
||||
static inline sampleType triangleSample( float _sample )
|
||||
{
|
||||
const float ph = phase( _sample );
|
||||
if( ph <= 0.25f )
|
||||
{
|
||||
return( ph * 4.0f );
|
||||
}
|
||||
else if( ph <= 0.75f )
|
||||
{
|
||||
return( 2.0f - ph * 4.0f );
|
||||
}
|
||||
return( ph * 4.0f - 4.0f );
|
||||
}
|
||||
|
||||
static inline sampleType sawSample( float _sample )
|
||||
{
|
||||
return( -1.0f + phase( _sample ) * 2.0f );
|
||||
}
|
||||
|
||||
static inline sampleType squareSample( float _sample )
|
||||
{
|
||||
return( ( phase( _sample ) > 0.5f ) ? -1.0f : 1.0f );
|
||||
}
|
||||
|
||||
static inline sampleType moogSawSample( float _sample )
|
||||
{
|
||||
const float ph= phase( _sample );
|
||||
if( ph < 0.5f )
|
||||
{
|
||||
return( -1.0f + ph * 4.0f );
|
||||
}
|
||||
return( 1.0f - 2.0f * ph );
|
||||
}
|
||||
|
||||
static inline sampleType expSample( float _sample )
|
||||
{
|
||||
float ph = phase( _sample );
|
||||
if( ph > 0.5f )
|
||||
{
|
||||
ph = 1.0f - ph;
|
||||
}
|
||||
return( -1.0f + 8.0f * ph * ph );
|
||||
}
|
||||
|
||||
static inline sampleType noiseSample( float )
|
||||
{
|
||||
return( 1.0f - 2.0f * ( ( float )rand() * ( 1.0f /
|
||||
RAND_MAX ) ) );
|
||||
}
|
||||
inline sampleType userWaveSample( float _sample )
|
||||
{
|
||||
const float frame = phase( _sample ) * m_userWaveFrames;
|
||||
const Uint32 f1 = static_cast<Uint32>( frame );
|
||||
const Uint32 f2 = ( f1 + 1 ) % m_userWaveFrames;
|
||||
return( linearInterpolate( m_userWaveData[f1][0],
|
||||
m_userWaveData[f2][0],
|
||||
frame - floorf( frame ) ) );
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
float m_freq;
|
||||
float m_volumeFactor;
|
||||
Sint16 m_phaseOffset;
|
||||
oscillator * m_subOsc;
|
||||
Uint32 m_sample;
|
||||
float m_oscCoeff;
|
||||
sampleFrame const * m_userWaveData;
|
||||
Uint32 m_userWaveFrames;
|
||||
oscFuncPtr m_callUpdate;
|
||||
|
||||
|
||||
virtual void FASTCALL updateNoSub( sampleFrame * _ab, Uint32 _frames,
|
||||
Uint8 _chnl ) = 0;
|
||||
virtual void FASTCALL updateFM( sampleFrame * _ab, Uint32 _frames,
|
||||
Uint8 _chnl ) = 0;
|
||||
virtual void FASTCALL updateAM( sampleFrame * _ab, Uint32 _frames,
|
||||
Uint8 _chnl ) = 0;
|
||||
virtual void FASTCALL updateMix( sampleFrame * _ab, Uint32 _frames,
|
||||
Uint8 _chnl ) = 0;
|
||||
virtual void FASTCALL updateSync( sampleFrame * _ab, Uint32 _frames,
|
||||
Uint8 _chnl ) = 0;
|
||||
|
||||
inline void sync( void )
|
||||
{
|
||||
m_sample = 0;
|
||||
}
|
||||
void FASTCALL recalcOscCoeff( const float _additional_phase_offset =
|
||||
0.0 );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
35
include/panning.h
Normal file
35
include/panning.h
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* panning.h - declaration of some constants and types, concerning the
|
||||
* panning of a note
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PANNING_H
|
||||
#define _PANNING_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
const panning PANNING_LEFT = ( 0 - 100);
|
||||
const panning PANNING_RIGHT = ( 0 + 100);
|
||||
const panning PANNING_CENTER = 0;
|
||||
const panning DEFAULT_PANNING = PANNING_CENTER;
|
||||
|
||||
#endif
|
||||
216
include/pattern.h
Normal file
216
include/pattern.h
Normal file
@@ -0,0 +1,216 @@
|
||||
/*
|
||||
* pattern.h - declaration of class pattern, which contains all informations
|
||||
* about a pattern
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PATTERN_H
|
||||
#define _PATTERN_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QVector>
|
||||
#include <QWidget>
|
||||
#include <QMutex>
|
||||
#include <QDialog>
|
||||
|
||||
#else
|
||||
|
||||
#include <qvaluevector.h>
|
||||
#include <qwidget.h>
|
||||
#include <qmutex.h>
|
||||
#include <qdialog.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "note.h"
|
||||
#include "track.h"
|
||||
#include "mixer.h"
|
||||
|
||||
|
||||
class channelTrack;
|
||||
class sampleBuffer;
|
||||
class audioSampleRecorder;
|
||||
class QTimer;
|
||||
class QProgressBar;
|
||||
class QPushButton;
|
||||
class QPixmap;
|
||||
class patternFreezeStatusDialog;
|
||||
|
||||
|
||||
|
||||
const int MAX_BEATS_PER_TACT = 16;
|
||||
const int MAIN_BEATS_PER_TACT = 4;
|
||||
|
||||
|
||||
class pattern : public trackContentObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum patternTypes
|
||||
{
|
||||
BEAT_PATTERN, MELODY_PATTERN/*, EVENT_PATTERN*/
|
||||
} ;
|
||||
|
||||
pattern( channelTrack * _channel_track );
|
||||
pattern( const pattern & _pat_to_copy ) FASTCALL;
|
||||
virtual ~pattern();
|
||||
|
||||
virtual void FASTCALL movePosition( const midiTime & _pos );
|
||||
|
||||
|
||||
virtual midiTime length( void ) const;
|
||||
note * FASTCALL addNote( const note & _new_note );
|
||||
void FASTCALL removeNote( const note * _note_to_del );
|
||||
note * FASTCALL rearrangeNote( const note * _note_to_proc );
|
||||
void clearNotes( void );
|
||||
|
||||
inline noteVector & notes( void )
|
||||
{
|
||||
return( m_notes );
|
||||
}
|
||||
|
||||
inline patternTypes type( void ) const
|
||||
{
|
||||
return( m_patternType );
|
||||
}
|
||||
void FASTCALL setType( patternTypes _new_pattern_type );
|
||||
inline const QString & name( void ) const
|
||||
{
|
||||
return( m_name );
|
||||
}
|
||||
inline void setName( const QString & _name )
|
||||
{
|
||||
m_name = _name;
|
||||
update();
|
||||
}
|
||||
inline channelTrack * getChannelTrack( void )
|
||||
{
|
||||
return( m_channelTrack );
|
||||
}
|
||||
|
||||
// functions which are part of freezing-feature
|
||||
inline bool frozen( void ) const
|
||||
{
|
||||
return( m_frozenPattern != NULL );
|
||||
}
|
||||
void FASTCALL playFrozenData( sampleFrame * _ab, Uint32 _start_frame,
|
||||
Uint32 _frames );
|
||||
inline bool isFreezing( void ) const
|
||||
{
|
||||
return( m_freezeRecorder != NULL );
|
||||
}
|
||||
void finishFreeze( void );
|
||||
|
||||
|
||||
note * FASTCALL noteAt( int _note_num );
|
||||
void FASTCALL setNoteAt( int _note_num, note _new_note );
|
||||
void checkType( void );
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "pattern" );
|
||||
}
|
||||
|
||||
|
||||
protected slots:
|
||||
void openInPianoRoll( bool _c );
|
||||
void openInPianoRoll( void );
|
||||
void clear( void );
|
||||
void resetName( void );
|
||||
void changeName( void );
|
||||
void freeze( void );
|
||||
void unfreeze( void );
|
||||
void updateFreezeStatusDialog( void );
|
||||
void abortFreeze( void );
|
||||
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent * _pe );
|
||||
void mousePressEvent( QMouseEvent * _me );
|
||||
void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void constructContextMenu( QMenu * );
|
||||
|
||||
void ensureBeatNotes( void );
|
||||
|
||||
|
||||
private:
|
||||
static QPixmap * s_patternBg;
|
||||
static QPixmap * s_stepBtnOn;
|
||||
static QPixmap * s_stepBtnOff;
|
||||
static QPixmap * s_stepBtnOffLight;
|
||||
static QPixmap * s_frozen;
|
||||
|
||||
static void initPixmaps( void );
|
||||
|
||||
|
||||
channelTrack * m_channelTrack;
|
||||
patternTypes m_patternType;
|
||||
QString m_name;
|
||||
noteVector m_notes;
|
||||
|
||||
QMutex m_frozenPatternMutex;
|
||||
sampleBuffer * m_frozenPattern;
|
||||
audioSampleRecorder * m_freezeRecorder;
|
||||
patternFreezeStatusDialog * m_freezeStatusDialog;
|
||||
QTimer * m_freezeStatusUpdateTimer;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
class patternFreezeStatusDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
patternFreezeStatusDialog();
|
||||
~patternFreezeStatusDialog();
|
||||
|
||||
void FASTCALL setProgress( int _p );
|
||||
|
||||
|
||||
protected:
|
||||
void closeEvent( QCloseEvent * _ce );
|
||||
|
||||
|
||||
protected slots:
|
||||
void cancelBtnClicked( void );
|
||||
|
||||
|
||||
private:
|
||||
QProgressBar * m_progressBar;
|
||||
QPushButton * m_cancelBtn;
|
||||
|
||||
|
||||
signals:
|
||||
void aborted( void );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
69
include/pch.h
Normal file
69
include/pch.h
Normal file
@@ -0,0 +1,69 @@
|
||||
// Qt-headers
|
||||
#include <qglobal.h>
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
|
||||
#include <QtCore/QtCore>
|
||||
#include <QtGui/QtGui>
|
||||
#include <QtXml/QtXml>
|
||||
|
||||
#else
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qpainter.h>
|
||||
#include <qfontmetrics.h>
|
||||
#include <qapplication.h>
|
||||
#include <qtextcodec.h>
|
||||
#include <qtextedit.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qbitmap.h>
|
||||
#include <qcursor.h>
|
||||
#include <qtooltip.h>
|
||||
#include <qspinbox.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qtoolbox.h>
|
||||
#include <qlabel.h>
|
||||
#include <qmainwindow.h>
|
||||
#include <qtabwidget.h>
|
||||
#include <qgroupbox.h>
|
||||
#include <qwidget.h>
|
||||
#include <qvbox.h>
|
||||
#include <qmenubar.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qtoolbar.h>
|
||||
#include <qtoolbutton.h>
|
||||
#include <qworkspace.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qwhatsthis.h>
|
||||
#include <qstatusbar.h>
|
||||
#include <qsplashscreen.h>
|
||||
#include <qscrollbar.h>
|
||||
#include <qlistbox.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qcheckbox.h>
|
||||
#include <qthread.h>
|
||||
#include <qtimer.h>
|
||||
#include <qpalette.h>
|
||||
#include <qsplitter.h>
|
||||
#include <qdatastream.h>
|
||||
#include <qbuffer.h>
|
||||
#include <qfile.h>
|
||||
#include <qmutex.h>
|
||||
#include <qdatetime.h>
|
||||
#include <qdom.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// C++ STL / C-stdlib
|
||||
#include <math.h>
|
||||
#include <memory>
|
||||
#include <fcntl.h>
|
||||
#include <fstream>
|
||||
#include <limits>
|
||||
#include <unistd.h>
|
||||
|
||||
237
include/piano_roll.h
Normal file
237
include/piano_roll.h
Normal file
@@ -0,0 +1,237 @@
|
||||
/*
|
||||
* piano_roll.h - declaration of class pianoRoll which is a window where you
|
||||
* can set and edit notes in an easy way
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PIANO_ROLL_H
|
||||
#define _PIANO_ROLL_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVector>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "types.h"
|
||||
#include "note.h"
|
||||
|
||||
|
||||
class QScrollBar;
|
||||
class QPainter;
|
||||
class QPixmap;
|
||||
|
||||
class crystalButton;
|
||||
class pattern;
|
||||
class notePlayHandle;
|
||||
class pixmapButton;
|
||||
class timeLine;
|
||||
|
||||
|
||||
|
||||
class pianoRoll : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
static inline pianoRoll * inst( void )
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new pianoRoll();
|
||||
}
|
||||
return( s_instanceOfMe );
|
||||
}
|
||||
|
||||
void FASTCALL setCurrentPattern( pattern * _new_pattern );
|
||||
inline const pattern * currentPattern( void ) const
|
||||
{
|
||||
return( m_pattern );
|
||||
}
|
||||
inline bool validPattern( void ) const
|
||||
{
|
||||
return( m_pattern != NULL );
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
void closeEvent( QCloseEvent * _ce );
|
||||
void paintEvent( QPaintEvent * _pe );
|
||||
void resizeEvent( QResizeEvent * _re );
|
||||
void mousePressEvent( QMouseEvent * _me );
|
||||
void mouseReleaseEvent( QMouseEvent * _me );
|
||||
void mouseMoveEvent( QMouseEvent * _me );
|
||||
void keyPressEvent( QKeyEvent * _ke );
|
||||
void keyReleaseEvent( QKeyEvent * _ke );
|
||||
void wheelEvent( QWheelEvent * _we );
|
||||
|
||||
int FASTCALL getKey( int _y );
|
||||
inline void drawNoteRect( QPainter & _p, Uint16 _x, Uint16 _y,
|
||||
Sint16 _width, bool _is_selected );
|
||||
void removeSelection( void );
|
||||
void selectAll( void );
|
||||
void FASTCALL getSelectedNotes( noteVector & _selected_notes );
|
||||
|
||||
|
||||
protected slots:
|
||||
void play( void );
|
||||
void record( void );
|
||||
void stop( void );
|
||||
|
||||
void recordNote( const note & _n );
|
||||
|
||||
void horScrolled( int _new_pos );
|
||||
void verScrolled( int _new_pos );
|
||||
|
||||
void drawButtonToggled( bool = FALSE );
|
||||
void eraseButtonToggled( bool = FALSE );
|
||||
void selectButtonToggled( bool = FALSE );
|
||||
void moveButtonToggled( bool = FALSE );
|
||||
|
||||
void copySelectedNotes( void );
|
||||
void cutSelectedNotes( void );
|
||||
void pasteNotes( void );
|
||||
void deleteSelectedNotes( void );
|
||||
|
||||
void updatePosition( const midiTime & _t );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
enum editModes
|
||||
{
|
||||
DRAW,
|
||||
ERASE,
|
||||
SELECT,
|
||||
MOVE
|
||||
} ;
|
||||
|
||||
enum actions
|
||||
{
|
||||
NONE,
|
||||
MOVE_NOTE,
|
||||
RESIZE_NOTE,
|
||||
SELECT_NOTES,
|
||||
MOVE_SELECTION,
|
||||
CHANGE_NOTE_VOLUME,
|
||||
CHANGE_NOTE_PANNING
|
||||
} ;
|
||||
|
||||
enum pianoRollKeyTypes
|
||||
{
|
||||
PR_WHITE_KEY_SMALL,
|
||||
PR_WHITE_KEY_BIG,
|
||||
PR_BLACK_KEY
|
||||
} ;
|
||||
|
||||
|
||||
static pianoRoll * s_instanceOfMe;
|
||||
|
||||
static QPixmap * s_whiteKeyBigPm;
|
||||
static QPixmap * s_whiteKeySmallPm;
|
||||
static QPixmap * s_artwork1;
|
||||
static QPixmap * s_artwork2;
|
||||
static QPixmap * s_blackKeyPm;
|
||||
static QPixmap * s_toolDraw;
|
||||
static QPixmap * s_toolErase;
|
||||
static QPixmap * s_toolSelect;
|
||||
static QPixmap * s_toolMove;
|
||||
|
||||
static pianoRollKeyTypes prKeyOrder[];
|
||||
|
||||
|
||||
pixmapButton * m_playButton;
|
||||
pixmapButton * m_recordButton;
|
||||
pixmapButton * m_stopButton;
|
||||
|
||||
crystalButton * m_drawButton;
|
||||
crystalButton * m_eraseButton;
|
||||
crystalButton * m_selectButton;
|
||||
crystalButton * m_moveButton;
|
||||
|
||||
crystalButton * m_cutButton;
|
||||
crystalButton * m_copyButton;
|
||||
crystalButton * m_pasteButton;
|
||||
|
||||
pattern * m_pattern;
|
||||
QScrollBar * m_leftRightScroll;
|
||||
QScrollBar * m_topBottomScroll;
|
||||
|
||||
midiTime m_currentPosition;
|
||||
bool m_recording;
|
||||
|
||||
note * m_currentNote;
|
||||
actions m_action;
|
||||
|
||||
Uint32 m_selectStartTact64th;
|
||||
int m_selectedTact64th;
|
||||
int m_selectStartKey;
|
||||
int m_selectedKeys;
|
||||
|
||||
int m_moveStartKey;
|
||||
int m_moveStartTact64th;
|
||||
int m_moveXOffset;
|
||||
|
||||
int m_notesEditHeight;
|
||||
int m_ppt;
|
||||
int m_totalKeysToScroll;
|
||||
|
||||
midiTime m_lenOfNewNotes;
|
||||
|
||||
bool m_shiftPressed;
|
||||
bool m_controlPressed;
|
||||
|
||||
int m_startKey; // first key when drawing
|
||||
|
||||
int m_lastKey;
|
||||
|
||||
noteVector m_notesToCopy;
|
||||
noteVector m_selNotesForMove;
|
||||
|
||||
|
||||
editModes m_editMode;
|
||||
|
||||
|
||||
timeLine * m_timeLine;
|
||||
bool m_scrollBack;
|
||||
|
||||
|
||||
pianoRoll( void );
|
||||
pianoRoll( const pianoRoll & );
|
||||
~pianoRoll();
|
||||
|
||||
|
||||
signals:
|
||||
void positionChanged( const midiTime & );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
104
include/piano_widget.h
Normal file
104
include/piano_widget.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/*
|
||||
* piano_widget.h - declaration of class pianoWidget, a widget which provides
|
||||
* an interactive piano/keyboard-widget
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PIANO_WIDGET_H
|
||||
#define _PIANO_WIDGET_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPixmap>
|
||||
#include <QScrollBar>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qscrollbar.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "note.h"
|
||||
|
||||
|
||||
class channelTrack;
|
||||
class notePlayHandle;
|
||||
|
||||
|
||||
enum keyTypes
|
||||
{
|
||||
WHITE_KEY,
|
||||
BLACK_KEY
|
||||
} ;
|
||||
|
||||
|
||||
class pianoWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
pianoWidget( channelTrack * _channel_track );
|
||||
~pianoWidget();
|
||||
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent * );
|
||||
void mousePressEvent( QMouseEvent * me );
|
||||
void mouseReleaseEvent( QMouseEvent * me );
|
||||
void mouseMoveEvent( QMouseEvent * me );
|
||||
void keyPressEvent( QKeyEvent * ke );
|
||||
void keyReleaseEvent( QKeyEvent * ke );
|
||||
void focusInEvent( QFocusEvent * _fe );
|
||||
void focusOutEvent( QFocusEvent * _fe );
|
||||
|
||||
|
||||
private:
|
||||
int FASTCALL getKeyFromMouse( const QPoint & _p );
|
||||
int FASTCALL getKeyFromKeyboard( int _k ) const;
|
||||
int FASTCALL getKeyX( int _key_num );
|
||||
|
||||
static QPixmap * s_whiteKeyPm;
|
||||
static QPixmap * s_blackKeyPm;
|
||||
static QPixmap * s_whiteKeyPressedPm;
|
||||
static QPixmap * s_blackKeyPressedPm;
|
||||
|
||||
QScrollBar * m_pianoScroll;
|
||||
channelTrack * m_channelTrack;
|
||||
tones m_startTone; // first key when drawing
|
||||
octaves m_startOctave;
|
||||
|
||||
int m_lastKey;
|
||||
|
||||
|
||||
private slots:
|
||||
void pianoScrolled( int _new_pos );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
78
include/pixmap_button.h
Normal file
78
include/pixmap_button.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/*
|
||||
* pixmap_button.h - declaration of class pixmapButton
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PIXMAP_BUTTON_H
|
||||
#define _PIXMAP_BUTTON_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QPushButton>
|
||||
#include <QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpushbutton.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
class pixmapButton : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
pixmapButton( QWidget * _parent );
|
||||
virtual ~pixmapButton();
|
||||
virtual void FASTCALL setActiveGraphic( const QPixmap & _pm );
|
||||
virtual void FASTCALL setInactiveGraphic( const QPixmap & _pm,
|
||||
bool _update = TRUE );
|
||||
void FASTCALL setBgGraphic( const QPixmap & _pm );
|
||||
|
||||
|
||||
signals:
|
||||
void doubleClicked( void );
|
||||
void clickedRight( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
|
||||
|
||||
private:
|
||||
QPixmap * m_activePixmap;
|
||||
QPixmap * m_inactivePixmap;
|
||||
QPixmap * m_bgPixmap;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
76
include/play_handle.h
Normal file
76
include/play_handle.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* play_handle.h - base-class playHandle which is needed by
|
||||
* LMMS-Play-Engine
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PLAY_HANDLE_H
|
||||
#define _PLAY_HANDLE_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QVector>
|
||||
|
||||
#else
|
||||
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class playHandle
|
||||
{
|
||||
public:
|
||||
inline playHandle( void )
|
||||
{
|
||||
}
|
||||
virtual inline ~playHandle()
|
||||
{
|
||||
}
|
||||
virtual void play( void ) = 0;
|
||||
virtual bool done( void ) const = 0;
|
||||
|
||||
// play-handles can invalidate themselves if an object they depend on
|
||||
// is going to be deleted or things like that - every of those objects
|
||||
// has to call mixer::inst()->checkValidityOfPlayHandles() in it's dtor
|
||||
// and set flag before, so LMMS doesn't crash because these play-handles
|
||||
// would continue using pointers to deleted objects...
|
||||
virtual void checkValidity( void )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
typedef vvector<playHandle *> playHandleVector;
|
||||
|
||||
|
||||
#endif
|
||||
60
include/preset_preview_play_handle.h
Normal file
60
include/preset_preview_play_handle.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* preset_preview_play_handle.h - play-handle for playing a short preview-sound
|
||||
* of a preset
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PRESET_PREVIEW_PLAY_HANDLE_H
|
||||
#define _PRESET_PREVIEW_PLAY_HANDLE_H
|
||||
|
||||
#include "play_handle.h"
|
||||
|
||||
|
||||
class channelTrack;
|
||||
class notePlayHandle;
|
||||
class QMutex;
|
||||
|
||||
|
||||
class presetPreviewPlayHandle : public playHandle
|
||||
{
|
||||
public:
|
||||
presetPreviewPlayHandle( const QString & _preset_file );
|
||||
virtual ~presetPreviewPlayHandle();
|
||||
|
||||
static void cleanUp( void );
|
||||
|
||||
|
||||
virtual void play( void );
|
||||
virtual bool done( void ) const;
|
||||
|
||||
|
||||
private:
|
||||
static channelTrack * s_globalChannelTrack;
|
||||
static notePlayHandle * s_globalPreviewNote;
|
||||
static QMutex * s_globalDataMutex;
|
||||
|
||||
notePlayHandle * m_previewNote;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
98
include/project_notes.h
Normal file
98
include/project_notes.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
* project_notes.h - header for project-notes-editor
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _PROJECT_NOTES_H
|
||||
#define _PROJECT_NOTES_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QMainWindow>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmainwindow.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "settings.h"
|
||||
|
||||
|
||||
class QAction;
|
||||
class QComboBox;
|
||||
class QTextEdit;
|
||||
|
||||
|
||||
class projectNotes : public QMainWindow, public settings
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
projectNotes();
|
||||
void clear( void );
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "projectnotes" );
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
void setupActions( void );
|
||||
|
||||
|
||||
private slots:
|
||||
void textBold( void );
|
||||
void textUnderline( void );
|
||||
void textItalic( void );
|
||||
void textFamily( const QString & _f );
|
||||
void textSize( const QString & _p );
|
||||
void textColor( void );
|
||||
void textAlign( QAction * _a );
|
||||
|
||||
void fontChanged( const QFont & _f );
|
||||
void colorChanged( const QColor & _c );
|
||||
void alignmentChanged( int _a );
|
||||
|
||||
|
||||
private:
|
||||
QTextEdit * m_edit;
|
||||
QAction * m_actionTextBold,
|
||||
* m_actionTextUnderline,
|
||||
* m_actionTextItalic,
|
||||
* m_actionTextColor,
|
||||
* m_actionAlignLeft,
|
||||
* m_actionAlignCenter,
|
||||
* m_actionAlignRight,
|
||||
* m_actionAlignJustify;
|
||||
QComboBox * m_comboFont;
|
||||
QComboBox * m_comboSize;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
177
include/qt3support.h
Normal file
177
include/qt3support.h
Normal file
@@ -0,0 +1,177 @@
|
||||
/*
|
||||
* qt3support.h - layer for supporting Qt3
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _QT3SUPPORT_H
|
||||
#define _QT3SUPPORT_H
|
||||
|
||||
// don't know why following line is neccessary, it's a bug in qt-headers -
|
||||
// otherwise LMMS sometimes fails to compile
|
||||
//#include <qmap.h>
|
||||
|
||||
#include <qglobal.h>
|
||||
//#include <qpair.h>
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
#ifndef QT4
|
||||
#define QT4
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
|
||||
class QColorGroup;
|
||||
#include <Qt3Support/Q3ListView>
|
||||
|
||||
|
||||
typedef int csize;
|
||||
#define QListViewItem Q3ListViewItem
|
||||
#define vvector QVector
|
||||
#define vlist QList
|
||||
|
||||
|
||||
#else
|
||||
|
||||
|
||||
#define vvector QValueVector
|
||||
#define vlist QValueList
|
||||
|
||||
#define QMenu QPopupMenu
|
||||
#define QAbstractButton QButton
|
||||
#define QScrollArea QScrollView
|
||||
|
||||
// QWidget
|
||||
#define setWindowTitle setCaption
|
||||
#define setWindowIcon setIcon
|
||||
#define isExplicitlyHidden isHidden
|
||||
#define accessibleName name
|
||||
#define ensurePolished constPolish
|
||||
|
||||
|
||||
// QMenu/QPopupMenu
|
||||
#define addAction insertItem
|
||||
//#define addSeparator insertSeparator
|
||||
|
||||
|
||||
// QFile/QIODevice
|
||||
#define seek at
|
||||
|
||||
|
||||
// QFileDialog
|
||||
#define setFileMode setMode
|
||||
#define setDirectory setDir
|
||||
#define selectFile setSelection
|
||||
|
||||
|
||||
// QThread
|
||||
#define isRunning running
|
||||
|
||||
|
||||
// QScrollView/QScrollArea
|
||||
#define setHorizontalScrollBarPolicy setHScrollBarMode
|
||||
|
||||
|
||||
// QScrollBar
|
||||
#define setMaximum setMaxValue
|
||||
#define setMinimum setMinValue
|
||||
|
||||
|
||||
// QAbstractButton/QButton
|
||||
#define setCheckable setToggleButton
|
||||
|
||||
|
||||
// QInputEvent/QKeyEvent
|
||||
#define modifiers state
|
||||
|
||||
|
||||
// QButtonGroup
|
||||
#define addButton insert
|
||||
|
||||
|
||||
// QProgressBar
|
||||
#define setTextVisible setPercentageVisible
|
||||
|
||||
|
||||
// QFileInfo
|
||||
//#define completeSuffix extension
|
||||
//#define suffix() extension( FALSE )
|
||||
|
||||
|
||||
// QComboBox
|
||||
#define addItem insertItem
|
||||
//#define currentIndex currentItem
|
||||
//#define setCurrentIndex setCurrentItem
|
||||
|
||||
|
||||
// QString
|
||||
#define toLower lower
|
||||
|
||||
|
||||
// QTextEdit
|
||||
#define setLineWrapMode setWordWrap
|
||||
#define setPlainText setText
|
||||
|
||||
|
||||
// QSlider
|
||||
#define setTickPosition setTickmarks
|
||||
|
||||
|
||||
// QStatusBar/QSplashScreen
|
||||
#define showMessage message
|
||||
#define clearMessage clear
|
||||
|
||||
|
||||
// QDir
|
||||
#define NoFilter DefaultFilter
|
||||
#define homePath homeDirPath
|
||||
#define rootPath rootDirPath
|
||||
//#define absolutePath absPath
|
||||
|
||||
|
||||
// QToolButton
|
||||
#define setMenu setPopup
|
||||
|
||||
|
||||
// QPixmap
|
||||
#define transformed xForm
|
||||
|
||||
|
||||
#define Q3ListView QListView
|
||||
#define Q3ListViewItem QListViewItem
|
||||
#define Q3ScrollView QScrollView
|
||||
|
||||
#define QMatrix QWMatrix
|
||||
#define QIcon QIconSet
|
||||
|
||||
#define ShiftModifier ShiftButton
|
||||
#define ControlModifier ControlButton
|
||||
|
||||
typedef unsigned int csize;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
70
include/rename_dialog.h
Normal file
70
include/rename_dialog.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* rename_dialog.h - declaration of class renameDialog, a simple dialog for
|
||||
* changing the content of a string
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _RENAME_DIALOG_H
|
||||
#define _RENAME_DIALOG_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdialog.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class QLineEdit;
|
||||
|
||||
|
||||
class renameDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
renameDialog( QString & _string );
|
||||
~renameDialog();
|
||||
|
||||
|
||||
protected:
|
||||
void keyPressEvent( QKeyEvent * _ke );
|
||||
|
||||
|
||||
protected slots:
|
||||
void textChanged( const QString & _new_string );
|
||||
|
||||
|
||||
private:
|
||||
QString & m_stringToEdit;
|
||||
QString m_originalString;
|
||||
QLineEdit * m_stringLE;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
168
include/sample_buffer.h
Normal file
168
include/sample_buffer.h
Normal file
@@ -0,0 +1,168 @@
|
||||
/*
|
||||
* sample_buffer.h - container-class sampleBuffer
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SAMPLE_BUFFER_H
|
||||
#define _SAMPLE_BUFFER_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QObject>
|
||||
#include <QMutex>
|
||||
|
||||
#else
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qmutex.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SAMPLERATE_H
|
||||
#include <samplerate.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "mixer.h"
|
||||
#include "types.h"
|
||||
|
||||
|
||||
class QPainter;
|
||||
|
||||
|
||||
class sampleBuffer : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum drawMethods
|
||||
{
|
||||
LINE_CONNECT,
|
||||
DOTS
|
||||
} ;
|
||||
|
||||
sampleBuffer( const QString & _audio_file = "" );
|
||||
sampleBuffer( const sampleFrame * _data, Uint32 _frames );
|
||||
|
||||
~sampleBuffer();
|
||||
|
||||
bool FASTCALL play( sampleFrame * _ab, Uint32 _start_frame,
|
||||
Uint32 _frames =
|
||||
mixer::inst()->framesPerAudioBuffer(),
|
||||
float _freq = BASE_FREQ, bool _looped = FALSE,
|
||||
void * * _resampling_data = NULL );
|
||||
void FASTCALL drawWaves( QPainter & _p, QRect _dr,
|
||||
drawMethods _dm = LINE_CONNECT );
|
||||
inline const QString & audioFile( void ) const
|
||||
{
|
||||
return( m_audioFile );
|
||||
}
|
||||
inline Uint32 startFrame( void ) const
|
||||
{
|
||||
return( m_startFrame );
|
||||
}
|
||||
inline Uint32 endFrame( void ) const
|
||||
{
|
||||
return( m_endFrame );
|
||||
}
|
||||
inline Uint32 frames( void ) const
|
||||
{
|
||||
return( m_frames );
|
||||
}
|
||||
inline float amplification( void ) const
|
||||
{
|
||||
return( m_amplification );
|
||||
}
|
||||
inline bool reversed( void ) const
|
||||
{
|
||||
return( m_reversed );
|
||||
}
|
||||
inline const sampleFrame * data( void ) const
|
||||
{
|
||||
return( m_data );
|
||||
}
|
||||
|
||||
void FASTCALL deleteResamplingData( void * * _ptr );
|
||||
|
||||
QString openAudioFile( void ) const;
|
||||
|
||||
|
||||
|
||||
public slots:
|
||||
void setAudioFile( const QString & _audio_file );
|
||||
void setStartFrame( Uint32 _s );
|
||||
void setEndFrame( Uint32 _e );
|
||||
void setAmplification( float _a );
|
||||
void setReversed( bool _on );
|
||||
|
||||
|
||||
private:
|
||||
void FASTCALL update( bool _keep_settings = FALSE );
|
||||
|
||||
#ifdef SDL_SDL_SOUND_H
|
||||
Uint32 FASTCALL decodeSampleSDL( const char * _f, Sint16 * & _buf,
|
||||
Uint8 & _channels );
|
||||
#endif
|
||||
#ifdef HAVE_SNDFILE_H
|
||||
Uint32 FASTCALL decodeSampleSF( const char * _f, Sint16 * & _buf,
|
||||
Uint8 & _channels );
|
||||
#endif
|
||||
#ifdef HAVE_VORBIS_VORBISFILE_H
|
||||
Uint32 FASTCALL decodeSampleOGG( const char * _f, Sint16 * & _buf,
|
||||
Uint8 & _channels );
|
||||
#endif
|
||||
|
||||
QString m_audioFile;
|
||||
sampleFrame * m_origData;
|
||||
Uint32 m_origFrames;
|
||||
sampleFrame * m_data;
|
||||
Uint32 m_frames;
|
||||
Uint32 m_startFrame;
|
||||
Uint32 m_endFrame;
|
||||
float m_amplification;
|
||||
bool m_reversed;
|
||||
QMutex m_dataMutex;
|
||||
|
||||
#ifdef HAVE_SAMPLERATE_H
|
||||
void initResampling( void );
|
||||
void quitResampling( void );
|
||||
SRC_STATE * createResamplingContext( void );
|
||||
void FASTCALL destroyResamplingContext( SRC_STATE * _context );
|
||||
|
||||
SRC_DATA m_srcData;
|
||||
SRC_STATE * m_srcState;
|
||||
#endif
|
||||
|
||||
|
||||
signals:
|
||||
void sampleUpdated( void );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
66
include/sample_play_handle.h
Normal file
66
include/sample_play_handle.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* sample_play_handle.h - play-handle for playing a sample
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SAMPLE_PLAY_HANDLE_H
|
||||
#define _SAMPLE_PLAY_HANDLE_H
|
||||
|
||||
#include "play_handle.h"
|
||||
#include "types.h"
|
||||
|
||||
|
||||
class sampleBuffer;
|
||||
|
||||
|
||||
class samplePlayHandle : public playHandle
|
||||
{
|
||||
public:
|
||||
samplePlayHandle( const QString & _sample_file );
|
||||
samplePlayHandle( sampleBuffer * _sample_buffer );
|
||||
virtual ~samplePlayHandle();
|
||||
|
||||
virtual void play( void );
|
||||
virtual bool done( void ) const;
|
||||
|
||||
Uint32 totalFrames( void ) const;
|
||||
inline Uint32 framesDone( void ) const
|
||||
{
|
||||
return( m_frame );
|
||||
}
|
||||
void setDoneMayReturnTrue( bool _enable )
|
||||
{
|
||||
m_doneMayReturnTrue = _enable;
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
sampleBuffer * m_sampleBuffer;
|
||||
const bool m_ownSampleBuffer;
|
||||
bool m_doneMayReturnTrue;
|
||||
|
||||
Uint32 m_frame;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
151
include/sample_track.h
Normal file
151
include/sample_track.h
Normal file
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* sample_track.h - class sampleTrack, a track which provides arrangement of
|
||||
* samples
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SAMPLE_TRACK_H
|
||||
#define _SAMPLE_TRACK_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdialog.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "track.h"
|
||||
#include "sample_buffer.h"
|
||||
|
||||
|
||||
class nameLabel;
|
||||
class QLabel;
|
||||
//class sampleTCOSettingsDialog;
|
||||
|
||||
|
||||
class sampleTCO : public trackContentObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
sampleTCO( track * _track );
|
||||
virtual ~sampleTCO();
|
||||
|
||||
virtual void FASTCALL changeLength( const midiTime & _length );
|
||||
void FASTCALL play( sampleFrame * _ab, Uint32 _start_frame,
|
||||
Uint32 _frames );
|
||||
const QString & sampleFile( void ) const;
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "sampletco" );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void setSampleFile( const QString & _sf );
|
||||
void updateLength( int = 0 );
|
||||
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent * );
|
||||
void mouseDoubleClickEvent( QMouseEvent * );
|
||||
midiTime getSampleLength( void ) const;
|
||||
|
||||
|
||||
private:
|
||||
sampleBuffer m_sampleBuffer;
|
||||
|
||||
|
||||
//friend class sampleTCOSettingsDialog;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
class sampleTCOSettingsDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
sampleTCOSettingsDialog( sampleTCO * _stco );
|
||||
~sampleTCOSettingsDialog();
|
||||
|
||||
|
||||
protected slots:
|
||||
void openSampleFile( void );
|
||||
void setSampleFile( const QString & _f );
|
||||
|
||||
|
||||
private:
|
||||
sampleTCO * m_sampleTCO;
|
||||
QLabel * m_fileLbl;
|
||||
|
||||
} ;
|
||||
*/
|
||||
|
||||
|
||||
|
||||
class sampleTrack : public QObject, public track
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
sampleTrack( trackContainer * _tc );
|
||||
virtual ~sampleTrack();
|
||||
|
||||
virtual trackTypes trackType( void ) const;
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
Uint32 _start_frame, Uint32 _frames,
|
||||
Uint32 _frame_base,
|
||||
Sint16 _tco_num = -1 );
|
||||
virtual trackContentObject * FASTCALL createTCO( const midiTime &
|
||||
_pos );
|
||||
|
||||
|
||||
virtual void FASTCALL saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadTrackSpecificSettings( const QDomElement &
|
||||
_this );
|
||||
|
||||
|
||||
public slots:
|
||||
virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "sampletrack" );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
nameLabel * m_trackLabel;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
113
include/setup_dialog.h
Normal file
113
include/setup_dialog.h
Normal file
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* setup_dialog.h - dialog for setting up LMMS
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SETUP_DIALOG_H
|
||||
#define _SETUP_DIALOG_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QDialog>
|
||||
#include <QMap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qdialog.h>
|
||||
#include <qmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include "audio_device.h"
|
||||
#include "midi_device.h"
|
||||
|
||||
|
||||
class QComboBox;
|
||||
class QLabel;
|
||||
class QSlider;
|
||||
|
||||
class tabBar;
|
||||
|
||||
|
||||
class setupDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum configTabs
|
||||
{
|
||||
GENERAL_SETTINGS, AUDIO_SETTINGS, MIDI_SETTINGS
|
||||
} ;
|
||||
|
||||
setupDialog( configTabs _tab_to_open = GENERAL_SETTINGS );
|
||||
~setupDialog();
|
||||
|
||||
|
||||
protected slots:
|
||||
virtual void accept( void );
|
||||
|
||||
|
||||
private slots:
|
||||
// general settings widget
|
||||
void setBufferSize( int _value );
|
||||
void resetBufSize( void );
|
||||
void displayBufSizeHelp( void );
|
||||
|
||||
// audio settings widget
|
||||
void audioInterfaceChanged( const QString & _driver );
|
||||
void displayAudioHelp( void );
|
||||
|
||||
// MIDI settings widget
|
||||
void midiInterfaceChanged( const QString & _driver );
|
||||
void displayMIDIHelp( void );
|
||||
|
||||
|
||||
void toggleToolTips( bool _disabled );
|
||||
void toggleKnobUsability( bool _classical );
|
||||
|
||||
|
||||
private:
|
||||
tabBar * m_tabBar;
|
||||
|
||||
QSlider * m_bufSizeSlider;
|
||||
QLabel * m_bufSizeLbl;
|
||||
int m_bufferSize;
|
||||
|
||||
bool m_disableToolTips;
|
||||
bool m_classicalKnobUsability;
|
||||
|
||||
|
||||
typedef QMap<QString, audioDevice::setupWidget *> aswMap;
|
||||
typedef QMap<QString, midiDevice::setupWidget *> mswMap;
|
||||
|
||||
QComboBox * m_audioInterfaces;
|
||||
aswMap m_audioIfaceSetupWidgets;
|
||||
|
||||
QComboBox * m_midiInterfaces;
|
||||
mswMap m_midiIfaceSetupWidgets;
|
||||
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
106
include/side_bar.h
Normal file
106
include/side_bar.h
Normal file
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* side_bar.h - code for side-bar in LMMS
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SIDE_BAR_H
|
||||
#define _SIDE_BAR_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QMap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "kmultitabbar.h"
|
||||
#include "side_bar_widget.h"
|
||||
|
||||
|
||||
class sideBar : public KMultiTabBar
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
sideBar( Qt::Orientation _o, QWidget * _parent ) :
|
||||
KMultiTabBar( _o, _parent )
|
||||
{
|
||||
}
|
||||
virtual ~sideBar()
|
||||
{
|
||||
}
|
||||
|
||||
inline int appendTab( sideBarWidget * _sbw, int _id )
|
||||
{
|
||||
int ret = KMultiTabBar::appendTab( _sbw->icon(), _id,
|
||||
_sbw->title() );
|
||||
m_widgets[_id] = _sbw;
|
||||
_sbw->hide();
|
||||
_sbw->setMinimumWidth( 200 );
|
||||
connect( tab( _id ), SIGNAL( clicked( int ) ), this,
|
||||
SLOT( tabClicked( int ) ) );
|
||||
return( ret );
|
||||
}
|
||||
|
||||
|
||||
private slots:
|
||||
inline void tabClicked( int _id )
|
||||
{
|
||||
// disable all other tabbar-buttons
|
||||
QMap<int, QWidget *>::Iterator it;
|
||||
for( it = m_widgets.begin(); it != m_widgets.end(); ++it )
|
||||
{
|
||||
if( it.key() != _id/* && isTabRaised(it.key()) == TRUE*/ )
|
||||
{
|
||||
setTab( it.key(), FALSE );
|
||||
}
|
||||
if( m_widgets[it.key()] != NULL )
|
||||
{
|
||||
m_widgets[it.key()]->hide();
|
||||
}
|
||||
}
|
||||
if( m_widgets[_id] != NULL )
|
||||
{
|
||||
if( isTabRaised( _id ) )
|
||||
{
|
||||
m_widgets[_id]->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_widgets[_id]->hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
QMap<int, QWidget *> m_widgets;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
88
include/side_bar_widget.h
Normal file
88
include/side_bar_widget.h
Normal file
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
* side_bar_widget.h - base-class for all side-bar-widgets
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SIDE_BAR_WIDGET_H
|
||||
#define _SIDE_BAR_WIDGET_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVBoxLayout>
|
||||
#include <QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qlayout.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class sideBarWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
sideBarWidget( const QString & _title, const QPixmap & _icon,
|
||||
QWidget * _parent );
|
||||
~sideBarWidget();
|
||||
inline const QPixmap & icon( void ) const
|
||||
{
|
||||
return( m_icon );
|
||||
}
|
||||
inline const QString & title( void ) const
|
||||
{
|
||||
return( m_title );
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent * _pe );
|
||||
void resizeEvent( QResizeEvent * _re );
|
||||
inline void contextMenuEvent( QContextMenuEvent * )
|
||||
{
|
||||
}
|
||||
|
||||
inline QWidget * contentParent( void )
|
||||
{
|
||||
return( m_contents );
|
||||
}
|
||||
inline void addContentWidget( QWidget * _w )
|
||||
{
|
||||
m_layout->addWidget( _w );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
QWidget * m_contents;
|
||||
QVBoxLayout * m_layout;
|
||||
QString m_title;
|
||||
QPixmap m_icon;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
342
include/song_editor.h
Normal file
342
include/song_editor.h
Normal file
@@ -0,0 +1,342 @@
|
||||
/*
|
||||
* song_editor.h - declaration of class songEditor, a window where you can
|
||||
* setup your songs
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SONG_EDITOR_H
|
||||
#define _SONG_EDITOR_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QMap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "lmms_main_win.h"
|
||||
#include "track_container.h"
|
||||
#include "types.h"
|
||||
|
||||
|
||||
class QLabel;
|
||||
class QPixmap;
|
||||
class QPushButton;
|
||||
class QScrollBar;
|
||||
class QSlider;
|
||||
class QToolButton;
|
||||
class exportProjectDialog;
|
||||
class lcdSpinBox;
|
||||
class pattern;
|
||||
class projectNotes;
|
||||
class timeLine;
|
||||
class visualizationWidget;
|
||||
|
||||
|
||||
|
||||
const int MIN_BPM = 10;
|
||||
const int DEFAULT_BPM = 140;
|
||||
const int MAX_BPM = 1000;
|
||||
const Uint16 MAX_SONG_LENGTH = 9999;
|
||||
|
||||
|
||||
|
||||
class songEditor : public trackContainer
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum playModes
|
||||
{
|
||||
PLAY_SONG,
|
||||
PLAY_TRACK,
|
||||
PLAY_BB,
|
||||
PLAY_PATTERN,
|
||||
PLAY_MODE_CNT
|
||||
} ;
|
||||
|
||||
|
||||
class playPos : public midiTime
|
||||
{
|
||||
public:
|
||||
playPos( Sint32 _abs = 0 ) :
|
||||
midiTime( _abs ),
|
||||
m_timeLine( NULL ),
|
||||
m_timeLineUpdate( TRUE ),
|
||||
m_currentFrame( 0 )
|
||||
{
|
||||
}
|
||||
inline void setCurrentFrame( Uint32 _f )
|
||||
{
|
||||
m_currentFrame = _f;
|
||||
}
|
||||
inline Uint32 currentFrame( void ) const
|
||||
{
|
||||
return( m_currentFrame );
|
||||
}
|
||||
timeLine * m_timeLine;
|
||||
bool m_timeLineUpdate;
|
||||
|
||||
private:
|
||||
Uint32 m_currentFrame;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
static inline songEditor * inst( void )
|
||||
{
|
||||
if( s_instanceOfMe == NULL )
|
||||
{
|
||||
s_instanceOfMe = new songEditor();
|
||||
}
|
||||
return( s_instanceOfMe );
|
||||
}
|
||||
|
||||
void processNextBuffer( void );
|
||||
|
||||
|
||||
inline bool paused( void ) const
|
||||
{
|
||||
return( m_paused );
|
||||
}
|
||||
|
||||
inline bool playing( void ) const
|
||||
{
|
||||
return( m_playing && m_exporting == FALSE );
|
||||
}
|
||||
|
||||
inline bool exporting( void ) const
|
||||
{
|
||||
return( m_exporting );
|
||||
}
|
||||
|
||||
inline bool exportDone( void ) const
|
||||
{
|
||||
return( m_exporting == TRUE &&
|
||||
m_playPos[PLAY_SONG].getTact() >= lengthInTacts() + 1 );
|
||||
}
|
||||
inline void setExportProjectDialog( exportProjectDialog * _epd )
|
||||
{
|
||||
m_epd = _epd;
|
||||
}
|
||||
inline playModes playMode( void ) const
|
||||
{
|
||||
return( m_playMode );
|
||||
}
|
||||
inline playPos & getPlayPos( playModes _pm )
|
||||
{
|
||||
return( m_playPos[_pm] );
|
||||
}
|
||||
|
||||
// every function that replaces current file (e.g. creates new file,
|
||||
// opens another file...) has to call this before and may only process
|
||||
// if this function returns true
|
||||
bool mayChangeProject( void );
|
||||
|
||||
|
||||
float framesPerTact( void ) const;
|
||||
|
||||
// file management
|
||||
void createNewProject( void );
|
||||
void FASTCALL createNewProjectFromTemplate( const QString & _template );
|
||||
void FASTCALL loadProject( const QString & _file_name );
|
||||
bool saveProject( void );
|
||||
bool FASTCALL saveProjectAs( const QString & _file_name );
|
||||
inline const QString & projectFileName( void ) const
|
||||
{
|
||||
return( m_fileName );
|
||||
}
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "songeditor" );
|
||||
}
|
||||
|
||||
virtual inline bool fixedTCOs( void ) const
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
int masterPitch( void ) const;
|
||||
|
||||
projectNotes * getProjectNotesWindow( void )
|
||||
{
|
||||
return( m_projectNotes );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void play( void );
|
||||
void stop( void );
|
||||
void playTrack( track * _trackToPlay );
|
||||
void playBB( void );
|
||||
void playPattern( pattern * _patternToPlay, bool _loop = TRUE );
|
||||
void pause( void );
|
||||
void resumeFromPause( void );
|
||||
|
||||
void importProject( void );
|
||||
void exportProject( void );
|
||||
|
||||
void startExport( void );
|
||||
void stopExport( void );
|
||||
// set BPM (beats per minute)
|
||||
void setBPM( int _new_bpm = DEFAULT_BPM );
|
||||
|
||||
inline void setModified( void )
|
||||
{
|
||||
m_modified = TRUE;
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
void closeEvent( QCloseEvent * _ce );
|
||||
void resizeEvent( QResizeEvent * _re );
|
||||
void keyPressEvent( QKeyEvent * _ke );
|
||||
void wheelEvent( QWheelEvent * _we );
|
||||
void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
|
||||
protected slots:
|
||||
void insertTact( void );
|
||||
void removeTact( void );
|
||||
void addChannelTrack( void );
|
||||
void addBBTrack( void );
|
||||
void addSampleTrack( void );
|
||||
void scrolled( int _new_pos );
|
||||
void updateTimeLinePosition( void );
|
||||
|
||||
void masterVolumeChanged( int _new_val );
|
||||
void masterVolumePressed( void );
|
||||
void masterVolumeMoved( int _new_val );
|
||||
void masterVolumeReleased( void );
|
||||
void masterPitchChanged( int _new_val );
|
||||
void masterPitchPressed( void );
|
||||
void masterPitchMoved( int _new_val );
|
||||
void masterPitchReleased( void );
|
||||
void toggleHQMode( void );
|
||||
|
||||
void updatePosition( const midiTime & _t );
|
||||
|
||||
|
||||
private:
|
||||
songEditor();
|
||||
songEditor( const songEditor & );
|
||||
virtual ~songEditor();
|
||||
|
||||
void clearProject( void );
|
||||
|
||||
|
||||
inline tact currentTact( void ) const
|
||||
{
|
||||
return( m_playPos[m_playMode].getTact() );
|
||||
}
|
||||
|
||||
midiTime length( void ) const;
|
||||
tact lengthInTacts( void ) const;
|
||||
inline tact64th currentTact64th( void ) const
|
||||
{
|
||||
return( m_playPos[m_playMode].getTact64th() );
|
||||
}
|
||||
void FASTCALL setPlayPos( tact _tact_num, tact64th _t_64th, playModes
|
||||
_play_mode );
|
||||
|
||||
|
||||
|
||||
static songEditor * s_instanceOfMe;
|
||||
|
||||
QScrollBar * m_leftRightScroll;
|
||||
|
||||
QToolButton * m_playButton;
|
||||
QToolButton * m_stopButton;
|
||||
lcdSpinBox * m_bpmSpinBox;
|
||||
|
||||
QSlider * m_masterVolumeSlider;
|
||||
QSlider * m_masterPitchSlider;
|
||||
|
||||
visualizationWidget * m_masterOutputGraph;
|
||||
|
||||
|
||||
QToolButton * m_addChannelTrackButton;
|
||||
QToolButton * m_addBBTrackButton;
|
||||
QToolButton * m_addSampleTrackButton;
|
||||
QToolButton * m_insertTactButton;
|
||||
QToolButton * m_removeTactButton;
|
||||
|
||||
|
||||
|
||||
QString m_fileName;
|
||||
QString m_oldFileName;
|
||||
bool m_modified;
|
||||
|
||||
volatile bool m_exporting;
|
||||
volatile bool m_playing;
|
||||
volatile bool m_paused;
|
||||
|
||||
playModes m_playMode;
|
||||
playPos m_playPos[PLAY_MODE_CNT];
|
||||
|
||||
track * m_trackToPlay;
|
||||
pattern * m_patternToPlay;
|
||||
bool m_loopPattern;
|
||||
|
||||
bool m_scrollBack;
|
||||
|
||||
exportProjectDialog * m_epd;
|
||||
|
||||
|
||||
projectNotes * m_projectNotes;
|
||||
|
||||
|
||||
|
||||
enum ACTIONS
|
||||
{
|
||||
ACT_STOP_PLAY, ACT_PLAY_SONG, ACT_PLAY_TRACK, ACT_PLAY_BB,
|
||||
ACT_PLAY_PATTERN, ACT_PAUSE, ACT_RESUME_FROM_PAUSE
|
||||
} ;
|
||||
vvector<ACTIONS> m_actions;
|
||||
|
||||
void doActions( void );
|
||||
|
||||
|
||||
bool m_shiftPressed;
|
||||
bool m_controlPressed;
|
||||
|
||||
|
||||
|
||||
friend lmmsMainWin::~lmmsMainWin();
|
||||
|
||||
|
||||
|
||||
signals:
|
||||
void bpmChanged( int _new_bpm );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
135
include/spc_bg_hndl_widget.h
Normal file
135
include/spc_bg_hndl_widget.h
Normal file
@@ -0,0 +1,135 @@
|
||||
/*
|
||||
* spc_bg_hndl_widget.h - class specialBgHandlingWidget
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SPC_BG_HNDL_WIDGET_H
|
||||
#define _SPC_BG_HNDL_WIDGET_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPainter>
|
||||
#include <QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class specialBgHandlingWidget
|
||||
{
|
||||
public:
|
||||
specialBgHandlingWidget( const QPixmap & _pm ) :
|
||||
m_backgroundPixmap( _pm ),
|
||||
m_backgroundColor( QColor( 0, 0, 0 ) )
|
||||
{
|
||||
}
|
||||
|
||||
specialBgHandlingWidget( const QColor & _c ) :
|
||||
m_backgroundPixmap(),
|
||||
m_backgroundColor( _c )
|
||||
{
|
||||
}
|
||||
|
||||
~specialBgHandlingWidget()
|
||||
{
|
||||
}
|
||||
|
||||
const QPixmap & backgroundPixmap( void ) const
|
||||
{
|
||||
return( m_backgroundPixmap );
|
||||
}
|
||||
const QColor & backgroundColor( void ) const
|
||||
{
|
||||
return( m_backgroundColor );
|
||||
}
|
||||
|
||||
static QPixmap getBackground( const QWidget * _w )
|
||||
{
|
||||
QPixmap pm( _w->size() );
|
||||
const QWidget * pw = _w->parentWidget();
|
||||
if( dynamic_cast<const specialBgHandlingWidget *>( pw ) )
|
||||
{
|
||||
const specialBgHandlingWidget * s = dynamic_cast<
|
||||
const specialBgHandlingWidget *>( pw );
|
||||
if( s->backgroundPixmap().isNull() == FALSE )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( &pm );
|
||||
p.drawPixmap( 0, 0, s->backgroundPixmap(),
|
||||
_w->x(), _w->y(), _w->width(),
|
||||
_w->height() );
|
||||
#else
|
||||
bitBlt( &pm, 0, 0, &s->backgroundPixmap(),
|
||||
_w->x(), _w->y(), _w->width(),
|
||||
_w->height() );
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.fill( s->backgroundColor() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( &pm );
|
||||
// TODO: fix that for background-pixmaps, because
|
||||
// drawing is started at the top left edge even
|
||||
// if this widget isn't posated there
|
||||
p.fillRect( _w->rect(), pw->palette().brush(
|
||||
pw->backgroundRole() ) );
|
||||
#else
|
||||
const QPixmap * pbp = pw->paletteBackgroundPixmap();
|
||||
if( pbp == NULL )
|
||||
{
|
||||
pbp = pw->erasePixmap();
|
||||
}
|
||||
if( pbp )
|
||||
{
|
||||
bitBlt( &pm, 0, 0, pbp, _w->x(), _w->y(),
|
||||
_w->width(), _w->height() );
|
||||
}
|
||||
else
|
||||
{
|
||||
pm.fill( pw->paletteBackgroundColor() );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return( pm );
|
||||
}
|
||||
|
||||
|
||||
|
||||
private:
|
||||
QPixmap m_backgroundPixmap;
|
||||
QColor m_backgroundColor;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
91
include/surround_area.h
Normal file
91
include/surround_area.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* surround_area.h - class surroundArea which provides widget for setting
|
||||
* position of a channel + calculation of volume for each
|
||||
* speaker
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _SURROUND_AREA_H
|
||||
#define _SURROUND_AREA_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "types.h"
|
||||
#include "mixer.h"
|
||||
#include "templates.h"
|
||||
|
||||
|
||||
class QPixmap;
|
||||
|
||||
const int SURROUND_AREA_SIZE = 1024;
|
||||
|
||||
|
||||
class surroundArea : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
surroundArea( QWidget * _parent = NULL );
|
||||
virtual ~surroundArea();
|
||||
volumeVector getVolumeVector( float _v_scale = 0.0f ) const;
|
||||
inline const QPoint & value( void ) const
|
||||
{
|
||||
return( m_sndSrcPos );
|
||||
}
|
||||
void FASTCALL setValue( const QPoint & _p );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
|
||||
|
||||
signals:
|
||||
void valueChanged( const QPoint & _p );
|
||||
|
||||
|
||||
private:
|
||||
float FASTCALL getVolume( const QPoint & _speaker_pos,
|
||||
float _v_scale ) const;
|
||||
|
||||
QPoint m_sndSrcPos;
|
||||
|
||||
static const QPoint s_defaultSpeakerPositions[SURROUND_CHANNELS];
|
||||
static QPixmap * s_backgroundArtwork;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
102
include/tab_bar.h
Normal file
102
include/tab_bar.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* tab_bar.h - class tabBar
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TAB_BAR_H
|
||||
#define _TAB_BAR_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMap>
|
||||
#include <QLayout>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qmap.h>
|
||||
#include <qlayout.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
class tabButton;
|
||||
|
||||
|
||||
class tabBar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
tabBar( QWidget * _parent,
|
||||
QBoxLayout::Direction _dir = QBoxLayout::LeftToRight );
|
||||
virtual ~tabBar();
|
||||
|
||||
tabButton * FASTCALL addTab( QWidget * _w, const QString & _text,
|
||||
int _id, bool _add_stretch = FALSE,
|
||||
bool _text_is_tooltip = FALSE );
|
||||
void FASTCALL removeTab( int _id );
|
||||
|
||||
inline void setExclusive( bool _on )
|
||||
{
|
||||
m_exclusive = _on;
|
||||
}
|
||||
|
||||
int activeTab( void );
|
||||
|
||||
|
||||
public slots:
|
||||
void setActiveTab( int _id );
|
||||
|
||||
|
||||
protected:
|
||||
bool FASTCALL tabState( int _id );
|
||||
void FASTCALL setTabState( int _id, bool _checked );
|
||||
bool allHidden( void );
|
||||
|
||||
|
||||
protected slots:
|
||||
void hideAll( int _exception = -1 );
|
||||
void tabClicked( int _id );
|
||||
|
||||
|
||||
private:
|
||||
QMap<int, QPair<tabButton *, QWidget *> > m_tabs;
|
||||
QBoxLayout * m_layout;
|
||||
bool m_exclusive;
|
||||
|
||||
|
||||
signals:
|
||||
void allWidgetsHidden( void );
|
||||
void widgetShown( void );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
75
include/tab_button.h
Normal file
75
include/tab_button.h
Normal file
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* tab_button.h - declaration of class tabButton
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TAB_BUTTON_H
|
||||
#define _TAB_BUTTON_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QPushButton>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpushbutton.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
class tabButton : public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
tabButton( const QString & _text, int _id, QWidget * _parent ) :
|
||||
QPushButton( _text, _parent ),
|
||||
m_id( _id )
|
||||
{
|
||||
setCheckable( TRUE );
|
||||
connect( this, SIGNAL( clicked() ), this,
|
||||
SLOT( slotClicked() ) );
|
||||
}
|
||||
virtual ~tabButton()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
signals:
|
||||
void clicked( int );
|
||||
|
||||
|
||||
protected slots:
|
||||
void slotClicked( void )
|
||||
{
|
||||
emit clicked( m_id );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
int m_id;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
74
include/tab_widget.h
Normal file
74
include/tab_widget.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* tab_widget.h - LMMS-tabwidget
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TAB_WIDGET_H
|
||||
#define _TAB_WIDGET_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVector>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class tabWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
tabWidget( const QString & _caption, QWidget * _parent );
|
||||
~tabWidget();
|
||||
|
||||
void addTab( QWidget * _w, const QString & _name );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
|
||||
|
||||
private:
|
||||
struct widgetDesc
|
||||
{
|
||||
QWidget * w; // ptr to widget
|
||||
QString name; // name for widget
|
||||
int nwidth; // width of name when painting
|
||||
} ;
|
||||
typedef vvector<widgetDesc> widgetStack;
|
||||
|
||||
widgetStack m_widgets;
|
||||
int m_curWidget;
|
||||
QString m_caption;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
102
include/templates.h
Normal file
102
include/templates.h
Normal file
@@ -0,0 +1,102 @@
|
||||
/*
|
||||
* templates.h - miscellanous templates and algorithms
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TEMPLATES_H
|
||||
#define _TEMPLATES_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QtAlgorithms>
|
||||
#include <QX11Info>
|
||||
#include <QFont>
|
||||
|
||||
#else
|
||||
|
||||
#include <qtl.h>
|
||||
#include <qpaintdevice.h>
|
||||
#include <qfont.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
template<class T>
|
||||
inline T tAbs( const T & x )
|
||||
{
|
||||
return( x < static_cast<T>( 0 ) ? -x : x );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<class T>
|
||||
inline T tMin( const T & x1, const T & x2 )
|
||||
{
|
||||
if( x1 < x2 )
|
||||
{
|
||||
return( x1 );
|
||||
}
|
||||
return( x2 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<class T>
|
||||
inline T tMax( const T & x1, const T & x2 )
|
||||
{
|
||||
if( x1 > x2 )
|
||||
{
|
||||
return( x1 );
|
||||
}
|
||||
return( x2 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template<class T>
|
||||
inline T tLimit( const T & x, const T & x1, const T & x2 )
|
||||
{
|
||||
return( tMin<T>( tMax<T>( x, tMin<T>( x1, x2 ) ),
|
||||
tMax<T>( x1, x2 ) ) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
template<int SIZE>
|
||||
inline QFont pointSize( QFont _f )
|
||||
{
|
||||
const int DPI = 96;
|
||||
#ifdef QT4
|
||||
_f.setPointSizeF( SIZE * DPI / QX11Info::appDpiX() );
|
||||
#else
|
||||
_f.setPointSizeFloat( SIZE * DPI / QPaintDevice::x11AppDpiX() );
|
||||
#endif
|
||||
return( _f );
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
66
include/text_float.h
Normal file
66
include/text_float.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* text_float.h - class textFloat, a floating text-label
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TEXT_FLOAT
|
||||
#define _TEXT_FLOAT
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class textFloat : public QWidget
|
||||
{
|
||||
public:
|
||||
textFloat( QWidget * _parent );
|
||||
virtual ~textFloat()
|
||||
{
|
||||
}
|
||||
|
||||
void setText( const QString & _text );
|
||||
|
||||
void reparent( QWidget * _new_parent );
|
||||
|
||||
void setVisibilityTimeOut( int _msecs );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _me );
|
||||
|
||||
|
||||
private:
|
||||
QString m_text;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
160
include/timeline.h
Normal file
160
include/timeline.h
Normal file
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* timeline.h - class timeLine, representing a time-line with position marker
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TIMELINE_H
|
||||
#define _TIMELINE_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "song_editor.h"
|
||||
|
||||
|
||||
class QPixmap;
|
||||
class nStateButton;
|
||||
|
||||
|
||||
class timeLine : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
timeLine( int _xoff, int _yoff, float _ppt, songEditor::playPos & _pos,
|
||||
const midiTime & _begin, QWidget * _parent );
|
||||
~timeLine();
|
||||
|
||||
inline songEditor::playPos & pos( void )
|
||||
{
|
||||
return( m_pos );
|
||||
}
|
||||
|
||||
enum behaviourAtStopStates
|
||||
{
|
||||
BACK_TO_ZERO, BACK_TO_START, KEEP_STOP_POSITION
|
||||
} ;
|
||||
|
||||
|
||||
behaviourAtStopStates behaviourAtStop( void ) const;
|
||||
|
||||
bool loopPointsEnabled( void ) const;
|
||||
inline const midiTime & loopBegin( void ) const
|
||||
{
|
||||
return( ( m_loopPos[0] < m_loopPos[1] ) ?
|
||||
m_loopPos[0] : m_loopPos[1] );
|
||||
}
|
||||
inline const midiTime & loopEnd( void ) const
|
||||
{
|
||||
return( ( m_loopPos[0] > m_loopPos[1] ) ?
|
||||
m_loopPos[0] : m_loopPos[1] );
|
||||
}
|
||||
|
||||
inline void savePos( const midiTime & _pos )
|
||||
{
|
||||
m_savedPos = _pos;
|
||||
}
|
||||
inline const midiTime & savedPos( void ) const
|
||||
{
|
||||
return( m_savedPos );
|
||||
}
|
||||
|
||||
inline void setPixelsPerTact( float _ppt )
|
||||
{
|
||||
m_ppt = _ppt;
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void updatePosition( const midiTime & = 0 );
|
||||
void toggleLoopPoints( int _n );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
|
||||
|
||||
private:
|
||||
inline int markerX( const midiTime & _t ) const
|
||||
{
|
||||
return( m_xOffset + static_cast<int>( ( _t - m_begin ) *
|
||||
m_ppt / 64.0f ) );
|
||||
}
|
||||
|
||||
|
||||
static QPixmap * s_timeLinePixmap;
|
||||
static QPixmap * s_posMarkerPixmap;
|
||||
static QPixmap * s_loopPointPixmap;
|
||||
|
||||
nStateButton * m_autoScroll;
|
||||
nStateButton * m_loopPoints;
|
||||
nStateButton * m_behaviourAtStop;
|
||||
|
||||
int m_xOffset;
|
||||
int m_posMarkerX;
|
||||
float m_ppt;
|
||||
songEditor::playPos & m_pos;
|
||||
const midiTime & m_begin;
|
||||
midiTime m_loopPos[2];
|
||||
|
||||
midiTime m_savedPos;
|
||||
|
||||
|
||||
enum actions
|
||||
{
|
||||
NONE, MOVE_POS_MARKER, MOVE_LOOP_BEGIN, MOVE_LOOP_END
|
||||
} m_action;
|
||||
|
||||
int m_moveXOff;
|
||||
|
||||
|
||||
enum autoScrollStates
|
||||
{
|
||||
AUTOSCROLL_ENABLED, AUTOSCROLL_DISABLED
|
||||
} ;
|
||||
|
||||
enum loopPointStates
|
||||
{
|
||||
LOOP_POINTS_DISABLED, LOOP_POINTS_ENABLED
|
||||
} ;
|
||||
|
||||
|
||||
signals:
|
||||
void positionChanged( const midiTime & _t );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
42
include/tooltip.h
Normal file
42
include/tooltip.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* tooltip.h - namespace toolTip, a tooltip-wrapper for LMMS
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TOOLTIP_H
|
||||
#define _TOOLTIP_H
|
||||
|
||||
#include <qstring.h>
|
||||
|
||||
class QWidget;
|
||||
|
||||
|
||||
namespace toolTip
|
||||
{
|
||||
|
||||
void add( QWidget * _w, const QString & _txt );
|
||||
//void remove( QWidget * _w );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
358
include/track.h
Normal file
358
include/track.h
Normal file
@@ -0,0 +1,358 @@
|
||||
/*
|
||||
* track.h - declaration of classes concerning tracks -> neccessary for all
|
||||
* track-like objects (beat/bassline, sample-track...)
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TRACK_H
|
||||
#define _TRACK_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QVector>
|
||||
#include <QList>
|
||||
#include <QWidget>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qvaluevector.h>
|
||||
#include <qvaluelist.h>
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "types.h"
|
||||
#include "midi_time.h"
|
||||
#include "settings.h"
|
||||
|
||||
|
||||
class track;
|
||||
class trackContainer;
|
||||
class trackContentWidget;
|
||||
class trackWidget;
|
||||
class pixmapButton;
|
||||
class QMenu;
|
||||
|
||||
typedef QWidget trackSettingsWidget;
|
||||
typedef QWidget trackOperationsWidget;
|
||||
|
||||
|
||||
|
||||
const Uint16 DEFAULT_SETTINGS_WIDGET_WIDTH = 224;
|
||||
const Uint16 TRACK_OP_WIDTH = 70;
|
||||
const Uint16 TCO_BORDER_WIDTH = 1;
|
||||
|
||||
|
||||
class trackContentObject : public QWidget, public settings
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
trackContentObject( track * _track );
|
||||
trackContentObject( const trackContentObject & _copy );
|
||||
virtual ~trackContentObject();
|
||||
inline track * getTrack( void )
|
||||
{
|
||||
return( m_track );
|
||||
}
|
||||
inline const midiTime & startPosition( void ) const
|
||||
{
|
||||
return( m_startPosition );
|
||||
}
|
||||
inline midiTime endPosition( void ) const
|
||||
{
|
||||
return( m_startPosition + m_length );
|
||||
}
|
||||
inline const midiTime & length( void ) const
|
||||
{
|
||||
return( m_length );
|
||||
}
|
||||
bool fixedTCOs( void );
|
||||
virtual void FASTCALL movePosition( const midiTime & _pos );
|
||||
virtual void FASTCALL changeLength( const midiTime & _length );
|
||||
|
||||
|
||||
public slots:
|
||||
virtual void close( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _cme );
|
||||
virtual void constructContextMenu( QMenu * )
|
||||
{
|
||||
}
|
||||
void setAutoResizeEnabled( bool _e = FALSE );
|
||||
float pixelsPerTact( void );
|
||||
|
||||
|
||||
protected slots:
|
||||
void cut( void );
|
||||
void copy( void );
|
||||
void paste( void );
|
||||
|
||||
|
||||
private:
|
||||
track * m_track;
|
||||
midiTime m_startPosition;
|
||||
midiTime m_length;
|
||||
bool m_moving;
|
||||
bool m_resizing;
|
||||
bool m_autoResize;
|
||||
Sint16 m_initialMouseX;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
class trackContentWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
trackContentWidget( trackWidget * _parent );
|
||||
virtual ~trackContentWidget();
|
||||
|
||||
trackContentObject * FASTCALL getTCO( csize _tco_num );
|
||||
csize numOfTCOs( void );
|
||||
trackContentObject * FASTCALL addTCO( trackContentObject * _tco );
|
||||
void FASTCALL removeTCO( csize _tco_num, bool _also_delete = TRUE );
|
||||
void FASTCALL removeTCO( trackContentObject * _tco,
|
||||
bool _also_delete = TRUE );
|
||||
void removeAllTCOs( void );
|
||||
void FASTCALL swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 );
|
||||
|
||||
inline Uint16 pixelsPerTact( void ) const
|
||||
{
|
||||
return( m_pixelsPerTact );
|
||||
}
|
||||
inline void setPixelsPerTact( Uint16 _ppt )
|
||||
{
|
||||
m_pixelsPerTact = _ppt;
|
||||
}
|
||||
tact length( void ) const;
|
||||
|
||||
|
||||
public slots:
|
||||
void insertTact( const midiTime & _pos );
|
||||
void removeTact( const midiTime & _pos );
|
||||
void updateTCOs( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
|
||||
|
||||
private:
|
||||
typedef vvector<trackContentObject *> tcoVector;
|
||||
|
||||
tcoVector m_trackContentObjects;
|
||||
trackWidget * m_trackWidget;
|
||||
Uint16 m_pixelsPerTact;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
// actual widget shown in trackContainer
|
||||
class trackWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
trackWidget( track * _track, QWidget * _parent );
|
||||
virtual ~trackWidget();
|
||||
|
||||
inline const track * getTrack( void ) const
|
||||
{
|
||||
return( m_track );
|
||||
}
|
||||
inline track * getTrack( void )
|
||||
{
|
||||
return( m_track );
|
||||
}
|
||||
inline const trackSettingsWidget & getTrackSettingsWidget( void ) const
|
||||
{
|
||||
return( m_trackSettingsWidget );
|
||||
}
|
||||
inline const trackContentWidget & getTrackContentWidget( void ) const
|
||||
{
|
||||
return( m_trackContentWidget );
|
||||
}
|
||||
inline trackSettingsWidget & getTrackSettingsWidget( void )
|
||||
{
|
||||
return( m_trackSettingsWidget );
|
||||
}
|
||||
inline trackContentWidget & getTrackContentWidget( void )
|
||||
{
|
||||
return( m_trackContentWidget );
|
||||
}
|
||||
bool muted( void ) const;
|
||||
|
||||
|
||||
public slots:
|
||||
void changePosition( const midiTime & _new_pos = -1 );
|
||||
void cloneTrack( void );
|
||||
void deleteTrack( void );
|
||||
void moveTrackUp( void );
|
||||
void moveTrackDown( void );
|
||||
void setMuted( bool _muted );
|
||||
void muteBtnRightClicked( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
midiTime FASTCALL endPosition( const midiTime & _pos_start );
|
||||
|
||||
|
||||
private:
|
||||
track * m_track;
|
||||
|
||||
trackOperationsWidget m_trackOperationsWidget;
|
||||
trackSettingsWidget m_trackSettingsWidget;
|
||||
trackContentWidget m_trackContentWidget;
|
||||
|
||||
pixmapButton * m_muteBtn;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
// base-class for all tracks
|
||||
class track : public settings
|
||||
{
|
||||
public:
|
||||
enum trackTypes
|
||||
{
|
||||
CHANNEL_TRACK,
|
||||
BB_TRACK,
|
||||
SAMPLE_TRACK,
|
||||
EVENT_TRACK,
|
||||
VIDEO_TRACK,
|
||||
NULL_TRACK,
|
||||
TOTAL_TRACK_TYPES
|
||||
} ;
|
||||
|
||||
track( trackContainer * _tc );
|
||||
virtual ~track();
|
||||
static track * FASTCALL createTrack( trackTypes _tt,
|
||||
trackContainer * _tc );
|
||||
static track * FASTCALL createTrack( const QDomElement & _this,
|
||||
trackContainer * _tc );
|
||||
static track * FASTCALL cloneTrack( track * _track );
|
||||
|
||||
tact length( void ) const;
|
||||
|
||||
inline bool muted( void ) const
|
||||
{
|
||||
return( m_trackWidget->muted() );
|
||||
}
|
||||
|
||||
// pure virtual functions
|
||||
virtual trackTypes trackType( void ) const = 0;
|
||||
|
||||
virtual bool FASTCALL play( const midiTime & _start,
|
||||
Uint32 _start_frame,
|
||||
Uint32 _frames,
|
||||
Uint32 _frame_base,
|
||||
Sint16 _tco_num = -1 ) = 0;
|
||||
|
||||
|
||||
virtual trackContentObject * FASTCALL createTCO(
|
||||
const midiTime & _pos ) = 0;
|
||||
|
||||
virtual void FASTCALL saveTrackSpecificSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent ) = 0;
|
||||
virtual void FASTCALL loadTrackSpecificSettings(
|
||||
const QDomElement & _this ) = 0;
|
||||
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
|
||||
|
||||
trackContentObject * FASTCALL addTCO( trackContentObject * _tco );
|
||||
void FASTCALL removeTCO( csize _tco_num );
|
||||
csize numOfTCOs( void );
|
||||
trackContentObject * FASTCALL getTCO( csize _tco_num );
|
||||
csize FASTCALL getTCONum( trackContentObject * _tco );
|
||||
void FASTCALL getTCOsInRange( vlist<trackContentObject *> & _tco_v,
|
||||
const midiTime & _start,
|
||||
const midiTime & _end );
|
||||
void FASTCALL swapPositionOfTCOs( csize _tco_num1, csize _tco_num2 );
|
||||
|
||||
inline trackWidget * getTrackWidget( void )
|
||||
{
|
||||
return( m_trackWidget );
|
||||
}
|
||||
inline trackContainer * getTrackContainer( void )
|
||||
{
|
||||
return( m_trackContainer );
|
||||
}
|
||||
inline const trackSettingsWidget * getTrackSettingsWidget( void ) const
|
||||
{
|
||||
return( &m_trackWidget->getTrackSettingsWidget() );
|
||||
}
|
||||
inline const trackContentWidget * getTrackContentWidget( void ) const
|
||||
{
|
||||
return( &m_trackWidget->getTrackContentWidget() );
|
||||
}
|
||||
inline trackSettingsWidget * getTrackSettingsWidget( void )
|
||||
{
|
||||
return( &m_trackWidget->getTrackSettingsWidget() );
|
||||
}
|
||||
inline trackContentWidget * getTrackContentWidget( void )
|
||||
{
|
||||
return( &m_trackWidget->getTrackContentWidget() );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
trackContainer * m_trackContainer;
|
||||
trackWidget * m_trackWidget;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
typedef vvector<track *> trackVector;
|
||||
typedef vvector<const track *> constTrackVector;
|
||||
|
||||
|
||||
#endif
|
||||
119
include/track_container.h
Normal file
119
include/track_container.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/*
|
||||
* track_container.h - base-class for all track-containers like Playlist-Editor, BB-Editor...
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _TRACK_CONTAINER_H
|
||||
#define _TRACK_CONTAINER_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QVector>
|
||||
#include <QMainWindow>
|
||||
|
||||
#else
|
||||
|
||||
#include <qscrollview.h>
|
||||
#include <qvaluevector.h>
|
||||
#include <qmainwindow.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "track.h"
|
||||
#include "settings.h"
|
||||
|
||||
|
||||
|
||||
class trackContainer : public QMainWindow, public settings
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
trackContainer();
|
||||
~trackContainer();
|
||||
inline QWidget * containerWidget( void )
|
||||
{
|
||||
return( m_scrollArea );
|
||||
}
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
|
||||
inline float pixelsPerTact( void ) const
|
||||
{
|
||||
return( m_ppt );
|
||||
}
|
||||
inline const midiTime & currentPosition( void ) const
|
||||
{
|
||||
return( m_currentPosition );
|
||||
}
|
||||
virtual bool fixedTCOs( void ) const
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
unsigned int FASTCALL countTracks( track::trackTypes _tt =
|
||||
track::TOTAL_TRACK_TYPES ) const;
|
||||
|
||||
void FASTCALL setMutedOfAllTracks( bool _muted );
|
||||
|
||||
|
||||
virtual void updateAfterTrackAdd( void );
|
||||
void FASTCALL setPixelsPerTact( Uint16 _ppt );
|
||||
void FASTCALL cloneTrack( track * _track );
|
||||
void FASTCALL addTrack( track * _track );
|
||||
void FASTCALL removeTrack( track * _track );
|
||||
void FASTCALL moveTrackUp( track * _track );
|
||||
void FASTCALL moveTrackDown( track * _track );
|
||||
void FASTCALL realignTracks( bool _complete_update = FALSE );
|
||||
|
||||
|
||||
protected:
|
||||
constTrackVector tracks( void ) const;
|
||||
trackVector tracks( void );
|
||||
|
||||
virtual void resizeEvent( QResizeEvent * );
|
||||
|
||||
midiTime m_currentPosition;
|
||||
|
||||
|
||||
protected slots:
|
||||
void updateScrollArea( void );
|
||||
|
||||
|
||||
private:
|
||||
QScrollArea * m_scrollArea;
|
||||
typedef vvector<trackWidget *> trackWidgetVector;
|
||||
|
||||
trackWidgetVector m_trackWidgets;
|
||||
float m_ppt;
|
||||
|
||||
|
||||
signals:
|
||||
void positionChanged( const midiTime & _pos );
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
48
include/types.h
Normal file
48
include/types.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
* types.h - typedefs for common types that are used in the whole app
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _TYPES_H
|
||||
#define _TYPES_H
|
||||
|
||||
|
||||
typedef unsigned char Uint8;
|
||||
typedef signed char Sint8;
|
||||
typedef unsigned short Uint16;
|
||||
typedef signed short Sint16;
|
||||
typedef unsigned int Uint32;
|
||||
typedef signed int Sint32;
|
||||
|
||||
|
||||
typedef Uint32 minute;
|
||||
typedef Sint8 second;
|
||||
typedef Sint32 tact;
|
||||
typedef Sint8 tact64th;
|
||||
typedef Uint8 volume;
|
||||
typedef Sint8 panning;
|
||||
|
||||
|
||||
typedef float sampleType;
|
||||
typedef Sint16 outputSampleType;
|
||||
|
||||
|
||||
#endif
|
||||
81
include/visualization_widget.h
Normal file
81
include/visualization_widget.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/*
|
||||
* visualization_widget.h - widget for visualization of waves
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _OUTPUT_GRAPH_H
|
||||
#define _OUTPUT_GRAPH_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "mixer.h"
|
||||
|
||||
class QTimer;
|
||||
|
||||
|
||||
class visualizationWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum visualizationTypes
|
||||
{
|
||||
SIMPLE // add more here
|
||||
} ;
|
||||
visualizationWidget( const QPixmap & _bg, QWidget * _parent,
|
||||
visualizationTypes _vtype = SIMPLE );
|
||||
virtual ~visualizationWidget();
|
||||
|
||||
|
||||
protected:
|
||||
void paintEvent( QPaintEvent * _pe );
|
||||
void mousePressEvent( QMouseEvent * _me );
|
||||
|
||||
|
||||
protected slots:
|
||||
void setAudioBuffer( const surroundSampleFrame * _ab, Uint32 _frames );
|
||||
|
||||
|
||||
private:
|
||||
QPixmap s_background;
|
||||
|
||||
bool m_enabled;
|
||||
surroundSampleFrame * m_buffer;
|
||||
Uint32 m_frames;
|
||||
|
||||
QTimer * m_updateTimer;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
33
include/volume.h
Normal file
33
include/volume.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* volume.h - declaration of some constants and types, concerning the volume of a note
|
||||
*
|
||||
* Linux MultiMedia Studio
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.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 (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _VOLUME_H
|
||||
#define _VOLUME_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
const volume MIN_VOLUME = 0;
|
||||
const volume MAX_VOLUME = 200;
|
||||
const volume DEFAULT_VOLUME = 100;
|
||||
|
||||
#endif
|
||||
122
lmms.spec.in
Normal file
122
lmms.spec.in
Normal file
@@ -0,0 +1,122 @@
|
||||
%define _suse %(if [ -f /etc/SuSE-release ] ; then echo 1 ; else echo 0 ; fi)
|
||||
|
||||
|
||||
Name: @PACKAGE@
|
||||
Version: @VERSION@
|
||||
Release: 0
|
||||
Summary: powerful sequencer-, synthesizer- and sample-studio for Linux
|
||||
Summary(de): Leistungsfaehiges Sequenzer-, Synthesizer- und Sample-Studio fuer Linux
|
||||
License: GPL
|
||||
URL: http://lmms.sourceforge.net/
|
||||
Group: Applications/Multimedia/Sound
|
||||
Packager: Tobias Doerffel <tobydox@users.sourceforge.net>
|
||||
Provides: lmms = %{version}-%{release}
|
||||
%if %_suse
|
||||
BuildRequires: gcc gcc-c++ libstdc++-devel autoconf automake libtool make alsa
|
||||
BuildRequires: alsa-devel SDL SDL-devel SDL_sound libvorbis libvorbis-devel
|
||||
BuildRequires: libsamplerate libsamplerate-devel libsndfile libsndfile-devel
|
||||
BuildRequires: jack-devel
|
||||
BuildRequires: qt3 qt3-devel qt3-devel-tools
|
||||
Requires: qt3 alsa SDL_sound libvorbis libsamplerate libsndfile jack
|
||||
%endif
|
||||
Requires: lmms-data
|
||||
Source: %{name}-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-buildroot
|
||||
Prefix: %{_prefix}
|
||||
|
||||
|
||||
%description
|
||||
LMMS aims to be a free alternative to popular (but commercial and closed-
|
||||
source) programs like FruityLoops, Cubase and Logic giving you the ability of
|
||||
producing music with your computer by creating/synthesizing sounds, arranging
|
||||
samples, playing live with keyboard and much more...
|
||||
|
||||
LMMS combines the features of a tracker-/sequencer-program (pattern-/channel-/
|
||||
sample-/song-/effect-management) and those of powerful synthesizers and
|
||||
samplers in a modern, user-friendly and easy to use graphical user-interface.
|
||||
|
||||
LMMS is still in heavy development, so with this version please don't expect a
|
||||
complete, ready and bugfree program!!
|
||||
|
||||
|
||||
%description -l de
|
||||
LMMS ist eine freie Alternative zu bekannten (aber kommerziellen und
|
||||
Closed-Source-) Programmen wie FruityLoops, Cubase und Logic, die Ihnen die
|
||||
Moeglichkeit geben, mit Ihrem Computer Musik zu produzieren, indem Sie
|
||||
Klaenge kreieren/synthetisieren, Samples anordnen, mit dem Keyboard live
|
||||
spielen usw....
|
||||
|
||||
LMMS kombiniert die Funktionen eines Tracker-/Sequenzer-Programms (Pattern-/
|
||||
Kanal-/Sample-/Song-/Effekt-Management) und die von leistungsfaehigen
|
||||
Synthesizern und Samplern in einer modernen, benutzerfreundlichen und einfach zu
|
||||
benutzenden grafischen Oberflaeche.
|
||||
|
||||
Derzeit befindet sich LMMS komplett in Entwicklung. Also erwarten Sie bitte mit
|
||||
dieser Version nicht ein vollstaendiges, fertiges und fehlerfreies Programm!!
|
||||
|
||||
|
||||
%package data
|
||||
Summary: samples, presets, demo-projects and localization-files for LMMS
|
||||
Summary(de): Samples, Presets, Demo-Projekte und Lokalisierungsdateien fuer LMMS
|
||||
Group: Applications/Multimedia/Sound
|
||||
Provides: lmms-data = %{version}-%{release}
|
||||
|
||||
%description data
|
||||
This package contains platform-independent data and resources for Linux
|
||||
MultiMedia Studio (LMMS), e.g. samples, presets and demo-projects.
|
||||
|
||||
|
||||
%description data -l de
|
||||
Dieses Paket beinhaltet plattform-unabhaengige Daten und Resourcen fuer Linux
|
||||
MultiMedia Studio (LMMS), wie z.B. Samples, Presets und Demo-Projekte.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -n %{name}-%{version}
|
||||
|
||||
|
||||
%build
|
||||
CXXFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=%{prefix}
|
||||
|
||||
make
|
||||
|
||||
|
||||
%install
|
||||
make DESTDIR=$RPM_BUILD_ROOT install
|
||||
|
||||
%clean
|
||||
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
|
||||
%pre
|
||||
%post
|
||||
%preun
|
||||
%postun
|
||||
|
||||
|
||||
%files
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/lmms
|
||||
|
||||
|
||||
%files data
|
||||
%defattr(-,root,root)
|
||||
%{_datadir}/lmms/
|
||||
|
||||
|
||||
|
||||
%changelog
|
||||
* Tue Sep 20 2005 Tobias Doerffel
|
||||
- added JACK-dependencies
|
||||
|
||||
* Fri Jul 22 2005 Tobias Doerffel
|
||||
- added more dependencies for builds under SuSE
|
||||
|
||||
* Sat Jun 25 2005 Tobias Doerffel
|
||||
- splitted package into lmms and lmms-data
|
||||
- additional requirements
|
||||
- updated project-homepage and email-address of packager
|
||||
|
||||
* Thu May 12 2005 Tobias Doerffel
|
||||
- created lmms.spec.in
|
||||
|
||||
BIN
resources/add_bb_track.png
Normal file
BIN
resources/add_bb_track.png
Normal file
Binary file not shown.
BIN
resources/add_sample_track.png
Normal file
BIN
resources/add_sample_track.png
Normal file
Binary file not shown.
BIN
resources/apply.png
Normal file
BIN
resources/apply.png
Normal file
Binary file not shown.
BIN
resources/arp_down_off.png
Normal file
BIN
resources/arp_down_off.png
Normal file
Binary file not shown.
BIN
resources/arp_down_on.png
Normal file
BIN
resources/arp_down_on.png
Normal file
Binary file not shown.
BIN
resources/arp_random_off.png
Normal file
BIN
resources/arp_random_off.png
Normal file
Binary file not shown.
BIN
resources/arp_random_on.png
Normal file
BIN
resources/arp_random_on.png
Normal file
Binary file not shown.
BIN
resources/arp_up_and_down_off.png
Normal file
BIN
resources/arp_up_and_down_off.png
Normal file
Binary file not shown.
BIN
resources/arp_up_and_down_on.png
Normal file
BIN
resources/arp_up_and_down_on.png
Normal file
Binary file not shown.
BIN
resources/arp_up_off.png
Normal file
BIN
resources/arp_up_off.png
Normal file
Binary file not shown.
BIN
resources/arp_up_on.png
Normal file
BIN
resources/arp_up_on.png
Normal file
Binary file not shown.
BIN
resources/autoscroll_off.png
Normal file
BIN
resources/autoscroll_off.png
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user