commit b28fc01c02823add5089b120ef503d4211caa157 Author: nebogeo Date: Sun Jul 28 23:18:14 2002 +0000 Initial revision diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..00d6088 --- /dev/null +++ b/CHANGES @@ -0,0 +1,196 @@ +Release 0.1.1 + +Main app changes: + +Back to one window GUI with seperate movable areas +Fixed Plugin window events/drawing bug +Echo/Delay crash bug fix +Less C code in SpiralSynthModular.C (Andy Preston) +Ability to load ssm files from command line (Dan Bethell) +gcc3.1 fixes + dynamic linking bugfix (Takashi Iwai) +configure + make fixes (Takashi Iwai) +configure option --with-plugindir=xxx added (Takashi Iwai) + +Plugin changes: + +LFOPlugin (Andy Preston) +MeterPlugin (Andy Preston) +StereoMixerPlugin fix (Andy Preston) +Scaling fix and name sorting for the LADSPAPlugin (Mike Rawes) +Sequencer bugfix for dragging note events +Matrix now 64X24 + tweaked GUI +Matrix can be controlled by an external clock pulse +Matrix copy/paste and transpose functionality (Andy Preston) +JackPlugin fixed for recent versions of jack (Takashi Iwai) + +Release 0.1.0 + +Main app changes: + +New GUI code, main app window has now become the editor window, with a new +window for plugin dialogues. (build fltk with ./configure --enable-shared) +New default theme. +New load/save system for external files like samples. (external files stored +in a directory) +configure fixes (Takashi Iwai) +ppc fix (Takashi Iwai) +gcc 3 fixes (Takashi Iwai) +wav loading fixes +Graph sorted node execution order to remove internal latency. + +Plugin changes: +Scope plugin bugfix +DistributorPlugin (Fade) +JoystickPlugin (Bill Bland) + +Release 0.0.9 Thursday Febuary 14 2002 + +Main app changes: + +Right click plugin menu +More error boxes, all asserts out of SSM app, better recovery from bad files +Audio engine can now be run in callback mode for plugins like the JackPlugin +Options save (Bill Bland) + +Plugin changes: + +PoshSampler, with loop points, editing and dirty timestretching +ComplexEnvelope, describe envelopes with arbitary lines or Bezier curves +MidiPlugin updated to support all controller channels, with multiple ports +Rewritten the midi parser +Controller plugin save problem fixed +Matrix stream out leaner +SpiralLoopPlugin Close file dialog crash fixed +StreamPlugin crash on mono wavs fixed + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +Release 0.0.8 Thursday Febuary 14 2002 + +Main app changes: + +All plugin communication now in 32bit floating point. +New configure/make system (Erik de Castro Lopo) +Warning and error dialogs +FLTK 1.1.0 supported (Takashi Iwai) +gcc-3 fixes (Takashi Iwai) +Proper tooltips implemented +Options GUI +Crash bug fix + +Plugin changes: + +OSS output now does input, and with duplex - simultaneous i/o. +StreamPlugin +XFadePlugin +SpiralLoopPlugin + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +Release 0.0.7 Tuesday November 21 2001. + +Main app changes: + +Wavfile fix for PPC machines. (Yves Usson) +PNG fix for images with an alpha channel. (Yves Usson) +All windows are now double buffered by default. +Misc gui tweaks + +Plugin changes: + +RiffWav loader attempts to decode non standard wavs +Ladspa plugin should compile whether ladspa is installed or not. +SampleHoldPlugin (Yves Usson) +NoteSnapPlugin +WaveShaperPlugin GUI updated. (Yves Usson) +AmpPlugin GUI updated. (Yves Usson) +Sampler plugin streams paths with spaces properly. + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +Release 0.0.6 Wednesday October 31 2001. + +Main app changes: + +Put a version number in the .SpiralSynthModular, so there's no need +to break the file format again. +Basic theme support - png loading needs libpng +Clear first buffer to stop noise on startup. +Different samplerates should be handled properly now. +RiffWav rewritten - automatically mixes stereo wavs into mono. +Deals with header much better, stores samplerate etc. + +Plugin changes: + +Output : Buffer size now handled correctly (Fragment settings in .rc file). +SeqSelector : Should always loop now. +SamplerPlugin : Individual sample outputs added. +SamplerPlugin : Pitch takes samplerate into account. +SequencerPlugin : Speed takes samplerate into account. + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +Release 0.0.5 Thursday October 20 2001. + +Main app changes: + +Plugin Tooltips +Layout text comments +Toolbox GUI sorted +Low level optimisation begun, to stop processing silent sample buffers. +Removed asserts from low level sample code (only for releases). +Removed tons of old SpiralSynth legacy code and dependancies. +File confirmation added. + +Plugin changes: + +WaveShaper Plugin added (thx to Yves Usson) +SeqSelector GUI finished +Oscillator & Wavetable octave fix (Yves Usson) +Oscillator, Echo and envelope GUI additions (Yves Usson) +Envelope plugin bug fixed (warning volume will need to be increased on saved layouts) +Controller plugin now much more versatile. +LADSPA plugin +Moog filter optimised +SVF filter optimised +Splitter plugin now has 4 outputs + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +Release 0.0.4 Thursday September 13 2001. + +Main app changes: + +Crash bugs related to deleting of devices located and fixed. +Big endian PPC support back in. + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +Release 0.0.3 Monday September 10 2001. + +Main app changes: + +Fixed an include problem that some people were getting. +Added functionality for plugind to change their device +properties while running. + +Plugin changes: + +Sequencer Plugin finished, records note CV input, and can hold up to 16 +different patterns. +Added the SeqSelecta, which can be used to step through patterns on the +sequencer or matrix plugins. +WaveTableOsc plugin - Sine, Square, Saw, InvSaw, Triangle, 2 Pulse and InvSine +waveshapes generated. Should be much faster than the old oscillator, but with +less modulation options. +Oscillator optimisations. +Improved the delay plugin (now linearly interpolated) +Sampler plugin now pitches samples offset from their input frequency, +for tuning of samples used in melodies. +Output no longer exits if it can't open the soundcard, +wav recording is still enabled. +Midi device wasn't opening the file in .SpiralSynthModular - fixed. + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +First release 0.0.2 Monday July 2 2001. diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..cb7811d --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + 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 + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + 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. + + , 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. diff --git a/Examples/BandpassShaper.ssm b/Examples/BandpassShaper.ssm new file mode 100644 index 0000000..dc8919d --- /dev/null +++ b/Examples/BandpassShaper.ssm @@ -0,0 +1,128 @@ +SpiralSynthModular File Ver 3 +253 149 724 420 253 501 724 420 +SectionList +23 + +Device 0 Plugin 0 +873 153 0 76 47 + + +Device 1 Plugin 13 +523 78 0 76 47 +1 1 0.36389 + +Device 2 Plugin 13 +522 150 0 76 47 +1 1 0.38383 + +Device 3 Plugin 13 +525 223 0 76 47 +1 1 0.36274 + +Device 7 Plugin 6 +420 102 0 0 0 + + +Device 8 Plugin 6 +455 189 0 0 0 + + +Device 12 Plugin 7 +611 156 0 76 47 +1 1 1 1 1 + +Device 13 Plugin 8 +783 153 0 76 47 +1 1 0.5 1 0.5 1 0.5 1 0.5 + +Device 16 Plugin 1 +697 153 1 445 67 + + +Device 17 Plugin 23 +276 198 1 186 73 +1 0 -3 0.0258332 1 + +Device 18 Plugin 23 +340 262 1 180 205 +1 0 -3 0.00586802 1 + +Device 19 Plugin 23 +410 331 1 432 205 +1 0 -3 0.0843751 1 + +Device 20 Plugin 3 +184 100 1 103 83 +3 1 -0.42 1 +1 +4 +Name -1 1 0.71 + + +Device 21 Plugin 23 +267 98 0 76 47 +1 0 -2 0.187005 1 + +Device 22 Plugin 23 +337 100 0 76 47 +1 2 -3 0.325557 1 + +Device 23 Plugin -1 +272 16 0 0 0 +1 53 This layout generates a signal with lots of harmonics + + +Device 24 Plugin -1 +278 30 0 0 0 +1 55 and filters the signal with three bandpass moog filters + + +Device 25 Plugin -1 +196 78 0 0 0 +1 26 Change this to alter pitch + + +Device 26 Plugin -1 +665 98 0 0 0 +1 43 Have a look at the waveform generated in an + + +Device 27 Plugin -1 +667 111 0 0 0 +1 47 audio editor such as audacity, that can display + + +Device 28 Plugin -1 +625 125 0 0 0 +1 27 the frequencies as colours. + + +Device 29 Plugin -1 +248 330 0 0 0 +1 39 These oscillators change the modulation + + +Device 30 Plugin -1 +202 345 0 0 0 +1 21 of the three filters. + + +17 +7 4 1 8 5 0 +8 5 0 2 2 0 +8 5 1 3 3 0 +7 4 0 1 1 0 +1 1 1 12 6 0 +2 2 1 12 6 1 +3 3 1 12 6 2 +13 7 0 0 0 0 +13 7 1 0 0 1 +12 6 0 16 8 0 +16 8 0 13 7 0 +17 9 0 1 1 1 +18 10 0 2 2 1 +19 11 0 3 3 1 +22 14 0 7 4 0 +21 13 0 22 14 0 +20 12 0 21 13 0 + diff --git a/Examples/Feedback.ssm b/Examples/Feedback.ssm new file mode 100644 index 0000000..72b1604 --- /dev/null +++ b/Examples/Feedback.ssm @@ -0,0 +1,78 @@ +SpiralSynthModular File Ver 3 +314 503 724 461 238 186 724 420 +SectionList +14 + +Device 0 Plugin 0 +612 241 0 100 100 + + +Device 2 Plugin 4 +348 109 1 95 160 +1 2 2 0.0149791 0.53 0 0.019 0.299 + +Device 4 Plugin 6 +240 254 0 0 0 + + +Device 5 Plugin 1 +419 246 1 349 157 + + +Device 7 Plugin 9 +276 109 1 447 33 +1 0.1132 0.0377 + +Device 8 Plugin 9 +420 109 1 448 291 +1 1.1698 0.566 + +Device 12 Plugin 8 +520 239 0 100 100 +1 0.27 0.5 0.8 0.5 1 0.5 1 0.5 + +Device 13 Plugin -1 +226 36 0 0 0 +1 40 This uses SSM's ability to feedback data + + +Device 14 Plugin -1 +198 49 0 0 0 +1 27 from one plugin to another. + + +Device 15 Plugin -1 +208 200 0 0 0 +1 37 This is where the signal is fed back. + + +Device 16 Plugin -1 +232 63 0 0 0 +1 41 Feedback generates quite a chaotic sound, + + +Device 17 Plugin -1 +221 76 0 0 0 +1 36 try changing some of the parameters. + + +Device 18 Plugin 23 +200 109 1 95 47 +1 0 -3 0.158165 1 + +Device 19 Plugin 23 +491 108 1 92 274 +1 0 -1 0.202252 1 + +10 +7 4 0 2 1 0 +2 1 0 8 5 0 +4 2 0 5 3 0 +12 6 0 0 0 0 +12 6 1 0 0 1 +5 3 0 12 6 0 +18 12 0 7 4 0 +8 5 0 19 13 0 +19 13 0 4 2 0 +4 2 1 18 12 0 + diff --git a/Examples/FourOsc.ssm b/Examples/FourOsc.ssm new file mode 100644 index 0000000..a0ee687 --- /dev/null +++ b/Examples/FourOsc.ssm @@ -0,0 +1,121 @@ +SpiralSynthModular File Ver 3 +134 396 750 484 601 192 724 420 +SectionList +21 + +Device 0 Plugin 4 +443 77 1 84 7 +1 2 0 1.47687 0 0 0 1 + +Device 1 Plugin 4 +445 11 1 84 119 +1 2 -1 0.960617 0 0 1.17928e-38 1 + +Device 2 Plugin 4 +442 144 1 84 232 +1 2 0 0.733381 0.23 0 2.2772e-38 1 + +Device 3 Plugin 4 +442 212 1 84 345 +1 2 0 0.983196 0.87 0 0 1 + +Device 4 Plugin 8 +729 107 0 100 100 +1 1 0.5 1 0.5 1 0.5 1 0.5 + +Device 5 Plugin 7 +593 106 0 100 100 +1 1 1 1 1 + +Device 6 Plugin 13 +662 107 1 539 157 +1 0.0943 0.07142 + +Device 8 Plugin 0 +799 105 0 100 100 + + +Device 9 Plugin 2 +157 127 0 100 100 +2 0 0 0 + + +Device 10 Plugin 6 +282 118 0 0 0 + + +Device 13 Plugin 6 +202 241 0 0 0 + + +Device 14 Plugin 5 +442 281 1 529 22 +1 0.3844 0.1156 0.91 2.1609 0.5 0.01 + +Device 15 Plugin 6 +282 186 0 0 0 + + +Device 18 Plugin 5 +513 214 1 331 345 +1 0.8281 3.2761 0 0 0.5 0.01 + +Device 19 Plugin 5 +513 145 1 331 234 +1 0.6241 0.3249 0 0 0.5 0.01 + +Device 20 Plugin 5 +512 79 1 330 122 +1 0.7225 1.8496 0 1 0.5 0.01 + +Device 21 Plugin 5 +514 11 1 332 9 +1 0.0529 2.6896 0 0 0.5 0.01 + +Device 22 Plugin 7 +512 284 1 417 208 +1 1.47 0.07 1 1 + +Device 24 Plugin -1 +216 36 0 0 0 +1 42 A fairly complicated synth, 4 oscillators, + + +Device 25 Plugin -1 +248 48 0 0 0 +1 53 with an extra envelope and LFO modulating the filter. + + +Device 26 Plugin 23 +446 347 1 486 344 +1 0 0 0.457092 1 + +27 +5 5 0 6 6 0 +4 4 0 8 7 0 +4 4 1 8 7 1 +9 8 0 10 9 0 +9 8 1 13 10 0 +6 6 0 4 4 0 +1 1 0 21 16 1 +0 0 0 20 15 1 +2 2 0 19 14 1 +3 3 0 18 13 1 +13 10 0 15 12 0 +21 16 1 5 5 0 +20 15 1 5 5 1 +19 14 1 5 5 2 +18 13 1 5 5 3 +14 11 0 22 17 0 +13 10 1 14 11 0 +22 17 0 6 6 1 +15 12 0 21 16 0 +15 12 1 20 15 0 +15 12 2 19 14 0 +15 12 3 18 13 0 +10 9 0 1 1 0 +10 9 1 0 0 0 +10 9 2 2 2 0 +10 9 3 3 3 0 +26 20 0 22 17 1 + diff --git a/Examples/Polyphonic.ssm b/Examples/Polyphonic.ssm new file mode 100644 index 0000000..9f189b4 --- /dev/null +++ b/Examples/Polyphonic.ssm @@ -0,0 +1,96 @@ +SpiralSynthModular File Ver 3 +283 72 724 482 284 586 724 420 +SectionList +16 + +Device 0 Plugin 86 +279 121 0 0 0 + + +Device 1 Plugin 2 +205 117 0 36 100 +2 0 0 0 + + +Device 2 Plugin 23 +372 242 1 97 350 +1 0 0 1 1 + +Device 3 Plugin 23 +373 51 1 98 15 +1 0 0 1 1 + +Device 4 Plugin 23 +372 114 1 97 127 +1 0 0 1 1 + +Device 5 Plugin 23 +373 179 1 97 238 +1 0 0 1 1 + +Device 6 Plugin 5 +439 245 1 344 349 +1 0 0.5 1 1 0.5 0.01 + +Device 7 Plugin 5 +439 181 1 344 237 +1 0 0.5 1 1 0.5 0.01 + +Device 8 Plugin 5 +439 115 1 344 126 +1 0 0.5 1 1 0.5 0.01 + +Device 9 Plugin 5 +441 52 1 344 15 +1 0 0.5 1 1 0.5 0.01 + +Device 10 Plugin 8 +515 125 1 491 147 +1 1 0.5 1 0.5 1 0.5 1 0.5 + +Device 11 Plugin 0 +580 139 0 36 100 + + +Device 12 Plugin -1 +227 29 0 0 0 +1 48 This patch uses the distributor plugin to create + + +Device 13 Plugin -1 +215 44 0 0 0 +1 24 a polyphonic synthesizer + + +Device 15 Plugin -1 +225 301 0 0 0 +1 46 The distributor sends each note recieved to a + + +Device 18 Plugin -1 +237 317 0 0 0 +1 51 different identical wavetable/envelope synth voice. + + +20 +1 1 0 0 0 0 +1 1 1 0 0 1 +10 10 0 11 11 0 +10 10 1 11 11 1 +0 0 0 3 3 0 +0 0 2 4 4 0 +0 0 4 5 5 0 +0 0 6 2 2 0 +3 3 0 9 9 1 +4 4 0 8 8 1 +5 5 0 7 7 1 +2 2 0 6 6 1 +0 0 1 9 9 0 +0 0 3 8 8 0 +0 0 5 7 7 0 +0 0 7 6 6 0 +6 6 1 10 10 3 +9 9 1 10 10 0 +8 8 1 10 10 1 +7 7 1 10 10 2 + diff --git a/Examples/Random.ssm b/Examples/Random.ssm new file mode 100644 index 0000000..9928ebd --- /dev/null +++ b/Examples/Random.ssm @@ -0,0 +1,74 @@ +SpiralSynthModular File Ver 3 +259 103 724 420 362 504 906 420 +SectionList +13 + +Device 3 Plugin 0 +772 162 0 100 100 + + +Device 5 Plugin 5 +560 161 1 530 87 +1 0.0289 0.3249 0 0 0.51 0 + +Device 7 Plugin 8 +702 162 0 100 100 +1 1 0.5 1 0.5 1 0.5 1 0.5 + +Device 9 Plugin 14 +631 162 1 376 21 +1 0.396 0.62 + +Device 12 Plugin 13 +491 162 1 380 141 +1 1 0.43934 + +Device 20 Plugin 4 +217 68 1 100 100 +1 3 -3 0.119661 0.5 0 2.98023e-09 1 + +Device 25 Plugin -1 +485 102 0 0 0 +1 37 A design that generates random events + + +Device 26 Plugin 51 +327 104 0 0 0 + + +Device 27 Plugin 23 +152 160 1 99 16 +1 0 1 0.0326008 1 + +Device 28 Plugin 6 +231 160 0 0 0 + + +Device 29 Plugin 23 +419 161 1 99 138 +1 1 -3 0.933262 1 + +Device 30 Plugin 4 +217 251 1 100 100 +1 3 0 1 0.5 0 1.70555e-38 1 + +Device 31 Plugin 51 +328 218 0 0 0 + + +14 +7 2 0 3 0 0 +7 2 1 3 0 1 +9 3 0 7 2 0 +12 4 0 5 1 1 +5 1 1 9 3 0 +27 8 0 28 9 0 +20 5 0 26 7 0 +29 10 0 12 4 0 +28 9 2 31 12 1 +30 11 0 31 12 0 +31 12 0 12 4 1 +28 9 0 5 1 0 +28 9 1 26 7 1 +26 7 0 29 10 0 + diff --git a/Examples/Sequence.ssm b/Examples/Sequence.ssm new file mode 100644 index 0000000..a6ae4ec --- /dev/null +++ b/Examples/Sequence.ssm @@ -0,0 +1,76 @@ +SpiralSynthModular File Ver 3 +314 503 724 461 238 186 724 420 +SectionList +10 + +Device 0 Plugin 18 +159 82 1 111 149 +2 0 0.0459186 21 1 0 +32 6.6 3 +1 1 7 1 13 1 15 1 19 1 23 1 25 1 29 1 30 3 0 4 2 4 6 4 10 4 12 4 14 4 18 4 20 4 24 4 28 4 31 6 4 11 8 11 16 11 22 11 26 11 -1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 + +Device 1 Plugin 4 +252 59 1 119 34 +1 2 1 1 0.21 0 nan 1 + +Device 2 Plugin 0 +629 79 0 100 100 + + +Device 3 Plugin 8 +557 79 0 100 100 +1 0.39 0 0.36 1 1 0.5 1 0.5 + +Device 4 Plugin 14 +472 51 0 100 100 +1 0.321 0.31 + +Device 5 Plugin 13 +330 83 1 382 35 +1 0 0.37002 + +Device 7 Plugin 5 +252 128 1 512 36 +1 0.0121 0.16 0 0 0.92 0 + +Device 8 Plugin 6 +403 83 0 0 0 + + +Device 9 Plugin 14 +473 119 0 100 100 +1 0.34 0.31 + +Device 11 Plugin -1 +396 224 0 0 0 +1 51 Using the Matrix plugin to create a robotic melody. + + +11 +0 0 0 1 1 0 +3 3 0 2 2 0 +3 3 1 2 2 1 +1 1 0 5 5 0 +0 0 1 7 6 0 +7 6 0 5 5 1 +5 5 0 8 7 0 +8 7 0 4 4 0 +8 7 1 9 8 0 +9 8 0 3 3 1 +4 4 0 3 3 0 + diff --git a/Examples/SpiralSynth.ssm b/Examples/SpiralSynth.ssm new file mode 100644 index 0000000..f497c3e --- /dev/null +++ b/Examples/SpiralSynth.ssm @@ -0,0 +1,109 @@ +SpiralSynthModular File Ver 3 +129 183 990 413 500 456 724 420 +SectionList +19 + +Device 0 Plugin 2 +144 177 0 103 22 +2 0 0 0 + + +Device 1 Plugin 4 +377 215 0 101 247 +1 2 -1 1 0 0 0 1 + +Device 2 Plugin 4 +375 147 0 103 134 +1 2 0 0.992771 0 0 0 1 + +Device 3 Plugin 4 +375 79 0 103 20 +1 2 1 1 0.5 0 0 1 + +Device 4 Plugin 6 +306 81 0 0 0 + + +Device 6 Plugin 7 +519 149 0 500 124 +1 0.77 0.67 0.31 1 + +Device 7 Plugin 13 +591 148 0 495 11 +1 0.6981 0.34483 + +Device 8 Plugin 5 +446 215 0 350 248 +1 0 0.9216 0.45 1 0.42 0.01 + +Device 9 Plugin 5 +447 147 0 350 134 +1 0 0.3844 0.08 1 0.5 0.01 + +Device 10 Plugin 5 +447 80 0 351 19 +1 0 0.9216 1 1.4161 0.28 0.01 + +Device 11 Plugin 6 +249 178 0 0 0 + + +Device 13 Plugin 5 +517 213 0 604 130 +1 0.9216 0.2601 0 3.0625 0.6 0.01 + +Device 15 Plugin 14 +662 149 0 618 11 +1 0.377 0.39 + +Device 17 Plugin 8 +804 151 0 103 22 +1 1 0.5 1 0.5 1 0.5 1 0.5 + +Device 18 Plugin 0 +876 149 0 751 11 + + +Device 19 Plugin 4 +305 12 0 720 256 +1 2 -3 0.0167674 0.5 0 0 1 + +Device 20 Plugin 1 +733 150 0 496 252 + + +Device 21 Plugin 20 +234 83 0 103 22 +1 0.114 0.151 + +Device 22 Plugin -1 +367 282 0 0 0 +1 63 SpiralSynth, with a moog filter. (and stuck in monophonic mode) + + +24 +4 4 0 3 3 0 +0 0 1 11 10 0 +3 3 0 10 9 1 +2 2 0 9 8 1 +1 1 0 8 7 1 +8 7 1 6 5 2 +9 8 1 6 5 1 +10 9 1 6 5 0 +6 5 0 7 6 0 +13 11 0 7 6 1 +7 6 0 15 12 0 +17 13 0 18 14 0 +17 13 1 18 14 1 +19 15 0 3 3 1 +15 12 0 20 16 0 +20 16 0 17 13 0 +21 17 0 4 4 0 +0 0 0 21 17 0 +4 4 1 2 2 0 +4 4 2 1 1 0 +11 10 0 10 9 0 +11 10 1 9 8 0 +11 10 2 8 7 0 +11 10 3 13 11 0 + diff --git a/Examples/Tutorial1-FirstThing.ssm b/Examples/Tutorial1-FirstThing.ssm new file mode 100644 index 0000000..2a29cca --- /dev/null +++ b/Examples/Tutorial1-FirstThing.ssm @@ -0,0 +1,205 @@ +SpiralSynthModular File Ver 3 +288 90 724 420 291 544 724 420 +SectionList +40 + +Device 0 Plugin -1 +371 24 0 0 0 +1 36 Tutorial 1 - First principles of SSM + + +Device 1 Plugin -1 +371 40 0 0 0 +1 90 This is a comment, click somewhere in the middle of me to move me, right click to edit me. + + +Device 2 Plugin 0 +541 115 1 493 101 + + +Device 3 Plugin 23 +216 115 1 178 106 +1 0 0 1 1 + +Device 4 Plugin -1 +230 81 0 0 0 +1 31 The simplest noisemaking layout + + +Device 5 Plugin -1 +230 81 0 0 0 +1 31 The simplest noisemaking layout + + +Device 6 Plugin -1 +254 93 0 0 0 +1 41 A sinewave generating wavetable plugin... + + +Device 7 Plugin -1 +537 93 0 0 0 +1 18 ... and an output. + + +Device 15 Plugin -1 +222 184 0 0 0 +1 36 Change the frequency and wave shape. + + +Device 16 Plugin -1 +540 176 0 0 0 +1 40 This outputs the sound to the soundcard. + + +Device 17 Plugin -1 +534 189 0 0 0 +1 55 You can change the volume, or record the sound to disk. + + +Device 18 Plugin -1 +374 133 0 0 0 +1 41 This connects the output of the wavetable + + +Device 21 Plugin -1 +374 133 0 0 0 +1 41 This connects the output of the wavetable + + +Device 22 Plugin -1 +370 144 0 0 0 +1 38 To the input of the OSS output plugin. + + +Device 23 Plugin -1 +373 114 0 0 0 +1 51 Create/Delete connections by clicking on the ports. + + +Device 24 Plugin 2 +198 286 0 158 214 +2 0 0 0 + + +Device 26 Plugin -1 +258 295 0 0 0 +1 9 <-------- + + +Device 27 Plugin -1 +165 65 0 0 0 +1 3 (1) + + +Device 28 Plugin -1 +166 250 0 0 0 +1 3 (2) + + +Device 29 Plugin -1 +389 288 0 0 0 +1 44 To get this to work, click on this port, and + + +Device 30 Plugin -1 +400 301 0 0 0 +1 45 then on the WaveTable's one free input above. + + +Device 31 Plugin -1 +266 264 0 0 0 +1 44 Controlling the sound with MIDI/PC keyboard. + + +Device 32 Plugin -1 +389 337 0 0 0 +1 50 To change the pitch of the tone, press keys in the + + +Device 35 Plugin -1 +389 362 0 0 0 +1 51 to have midi, just bash those black and white keys. + + +Device 37 Plugin -1 +396 226 0 0 0 +1 103 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + + +Device 38 Plugin 5 +401 470 1 313 235 +1 0.0529 0.8281 0 0 0.5 0.01 + +Device 39 Plugin -1 +386 394 0 0 0 +1 103 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + + +Device 40 Plugin -1 +168 421 0 0 0 +1 3 (3) + + +Device 41 Plugin -1 +248 435 0 0 0 +1 36 Using an envelope to shape the sound + + +Device 42 Plugin -1 +242 491 0 0 0 +1 47 Connect this to the WaveTable's output -------> + + +Device 43 Plugin -1 +270 466 0 0 0 +1 33 Connect this to the second output + + +Device 44 Plugin -1 +277 478 0 0 0 +1 33 down on the Midi plugin. -------> + + +Device 45 Plugin -1 +518 488 0 0 0 +1 34 <------ Connect this to one of the + + +Device 46 Plugin -1 +529 501 0 0 0 +1 20 OSS plugin's inputs. + + +Device 47 Plugin -1 +398 547 0 0 0 +1 65 The layout will now look a little messy, but should now cause the + + +Device 48 Plugin -1 +405 560 0 0 0 +1 67 sound to appear and then slowly die away after a note is triggered. + + +Device 49 Plugin -1 +420 573 0 0 0 +1 74 Try changing the [A]ttack [D]ecay [S]ustain and [R]elease of the envelope. + + +Device 51 Plugin -1 +325 447 0 0 0 +1 73 Click on the WaveTable's output port, so the first connection is deleted. + + +Device 52 Plugin -1 +394 532 0 0 0 +1 55 Now hit a key. (In the midi plugin window if necessary) + + +Device 53 Plugin -1 +387 349 0 0 0 +1 47 main window on your PC keyboard, or if you are + + +1 +3 3 0 2 2 0 + diff --git a/Examples/Tutorial2-Audio&CVs.ssm b/Examples/Tutorial2-Audio&CVs.ssm new file mode 100644 index 0000000..4cb25fa --- /dev/null +++ b/Examples/Tutorial2-Audio&CVs.ssm @@ -0,0 +1,133 @@ +SpiralSynthModular File Ver 3 +288 90 724 420 292 545 724 420 +SectionList +25 + +Device 2 Plugin 0 +631 196 1 539 111 + + +Device 3 Plugin 23 +236 103 1 104 120 +1 0 0 1 1 + +Device 24 Plugin 2 +171 176 0 100 100 +2 0 0 0 + + +Device 38 Plugin 5 +446 190 1 374 121 +1 0.0529 0.8281 0 0 0.5 0.01 + +Device 53 Plugin 1 +312 186 0 100 100 + + +Device 55 Plugin 1 +382 103 0 100 100 + + +Device 56 Plugin 1 +512 104 0 100 100 + + +Device 58 Plugin -1 +372 -32 0 0 0 +1 32 Tutorial 2 - CV's and Audio data + + +Device 59 Plugin -1 +371 -16 0 0 0 +1 107 This is a closer look at what is going on in tutorial 1. It's exactly the same design, but with some scopes + + +Device 60 Plugin -1 +377 -2 0 0 0 +1 60 to see what is beaing passed through the network of plugins. + + +Device 61 Plugin -1 +378 88 0 0 0 +1 7 Scope 1 + + +Device 62 Plugin -1 +307 170 0 0 0 +1 7 Scope 2 + + +Device 63 Plugin -1 +506 89 0 0 0 +1 7 Scope 3 + + +Device 64 Plugin -1 +390 21 0 0 0 +1 113 All data in SSM is treated the same, anything can be plugged into anything else. However, it is important to know + + +Device 65 Plugin -1 +199 33 0 0 0 +1 32 the different uses of this data. + + +Device 66 Plugin -1 +367 58 0 0 0 +1 104 Open Scope 1, you will see the output of the WaveTable oscillator, which is used here to generate audio. + + +Device 67 Plugin -1 +315 270 0 0 0 +1 76 Now open scope 2, and press a key. What you see is the value going from zero + + +Device 68 Plugin -1 +322 284 0 0 0 +1 85 in the center, to a high value (if using a midi keyboard - the velocity of the note). + + +Device 69 Plugin -1 +389 298 0 0 0 +1 109 This data is CV, or Control Voltage data (the name comes from old synths that acually used votages to control + + +Device 70 Plugin -1 +388 313 0 0 0 +1 112 bits of the synth.) You wouldn't actually want to output this data to the speaker, but you use it to control the + + +Device 71 Plugin -1 +168 327 0 0 0 +1 14 other plugins. + + +Device 72 Plugin -1 +395 341 0 0 0 +1 115 If you open Scope 3, you'll see the amount the envelope is amplifying the WaveTable's signal, triggered by the midi + + +Device 73 Plugin -1 +314 356 0 0 0 +1 80 Look at scope 4 (the actual output), and all together they make it much clearer. + + +Device 74 Plugin 1 +543 196 0 100 100 + + +Device 75 Plugin -1 +537 181 0 0 0 +1 7 Scope 4 + + +8 +24 2 0 3 1 0 +24 2 1 53 4 0 +53 4 0 38 3 0 +3 1 0 55 5 0 +55 5 0 38 3 1 +38 3 0 56 6 0 +38 3 1 74 23 0 +74 23 0 2 0 0 + diff --git a/Examples/Tutorial3-SubtractiveSynth.ssm b/Examples/Tutorial3-SubtractiveSynth.ssm new file mode 100644 index 0000000..cff556e --- /dev/null +++ b/Examples/Tutorial3-SubtractiveSynth.ssm @@ -0,0 +1,129 @@ +SpiralSynthModular File Ver 3 +401 127 724 420 402 579 724 420 +SectionList +24 + +Device 0 Plugin 23 +263 170 1 99 99 +1 3 0 1 1 + +Device 1 Plugin 2 +175 194 0 115 69 +2 0 0 0 + + +Device 2 Plugin 5 +264 238 1 335 227 +1 0.0289 0.16 0.08 1.0404 0.58 0.01 + +Device 3 Plugin 13 +379 171 1 349 100 +1 0 0.37137 + +Device 4 Plugin 0 +628 171 0 593 69 + + +Device 6 Plugin 1 +484 171 1 472 93 + + +Device 7 Plugin -1 +382 10 0 0 0 +1 17 Tutorial design 2 + + +Device 8 Plugin -1 +381 26 0 0 0 +1 19 A subtractive synth + + +Device 9 Plugin -1 +170 176 0 0 0 +1 15 Note in signals + + +Device 11 Plugin -1 +260 152 0 0 0 +1 15 Sound generator + + +Device 12 Plugin -1 +263 304 0 0 0 +1 43 Generates the signal to control the filter. + + +Device 13 Plugin -1 +377 235 0 0 0 +1 23 Filters the frequencies + + +Device 14 Plugin -1 +389 249 0 0 0 +1 26 from the WaveTable plugin, + + +Device 15 Plugin -1 +401 262 0 0 0 +1 32 the envelope passes the value to + + +Device 16 Plugin -1 +420 275 0 0 0 +1 43 control the cutoff frequency of the filter. + + +Device 17 Plugin -1 +332 50 0 0 0 +1 73 This synth uses what is known as subtractive synthesis to produce sounds. + + +Device 19 Plugin -1 +333 65 0 0 0 +1 81 The heart of a subtractive synths is the filter, as it is what the filter removes + + +Device 20 Plugin -1 +236 80 0 0 0 +1 32 that dictates the sound produced + + +Device 21 Plugin -1 +348 95 0 0 0 +1 81 The waveshape the oscillator uses should contain as many frequencies as possible, + + +Device 22 Plugin -1 +348 110 0 0 0 +1 86 (in this case a triangle wave) so that the filter has more of an effect on it's sound. + + +Device 25 Plugin 6 +561 171 0 0 0 + + +Device 28 Plugin -1 +339 352 0 0 0 +1 79 This is how many of the first analogue synths worked, such as the moogs - hence + + +Device 29 Plugin -1 +223 366 0 0 0 +1 32 the use of the moog filter here. + + +Device 30 Plugin -1 +238 317 0 0 0 +1 29 Triggered by keypress events. + + +8 +1 1 0 0 0 0 +1 1 1 2 2 0 +2 2 0 3 3 1 +0 0 0 3 3 0 +3 3 0 6 5 0 +6 5 0 25 20 0 +25 20 0 4 4 0 +25 20 1 4 4 1 + diff --git a/Examples/Tutorial4-AdditiveSynth.ssm b/Examples/Tutorial4-AdditiveSynth.ssm new file mode 100644 index 0000000..19cf878 --- /dev/null +++ b/Examples/Tutorial4-AdditiveSynth.ssm @@ -0,0 +1,110 @@ +SpiralSynthModular File Ver 3 +401 127 724 420 402 579 724 420 +SectionList +20 + +Device 0 Plugin 1 +495 175 1 477 128 + + +Device 1 Plugin 0 +629 174 0 100 100 + + +Device 2 Plugin 6 +562 175 0 0 0 + + +Device 3 Plugin 23 +219 175 1 95 14 +1 0 2 0.421244 1 + +Device 4 Plugin 23 +357 175 1 90 259 +1 0 -3 1 1 + +Device 5 Plugin 5 +289 165 1 143 134 +1 0 0.3249 0.96 1 1 0.01 + +Device 6 Plugin 5 +426 165 1 328 136 +1 0.0289 0.4624 0.26 1 0.5 0.01 + +Device 7 Plugin 2 +149 175 0 100 100 +2 0 0 0 + + +Device 8 Plugin 6 +200 93 0 0 0 + + +Device 9 Plugin -1 +362 11 0 0 0 +1 31 Tutorial 3 - Additive Synthesis + + +Device 10 Plugin -1 +362 30 0 0 0 +1 94 Additive synthesis works on the principle of building up sounds by combining simpler elements. + + +Device 11 Plugin -1 +357 44 0 0 0 +1 95 In this case, two oscillators are used, one modulating the pitch of the other. This is known as + + +Device 14 Plugin -1 +284 241 0 0 0 +1 10 Envelope 1 + + +Device 15 Plugin -1 +422 242 0 0 0 +1 10 Envelope 2 + + +Device 16 Plugin -1 +347 324 0 0 0 +1 80 Envelope 1 controls the amount of modulation that the second ocillator recieves, + + +Device 17 Plugin -1 +312 338 0 0 0 +1 60 The second envelope shapes the amplitude of the final sound. + + +Device 18 Plugin -1 +212 58 0 0 0 +1 28 frequency modulation, or FM. + + +Device 19 Plugin -1 +337 72 0 0 0 +1 84 The first digital synths used this technique, such as the DX range of Yamaha synths. + + +Device 22 Plugin -1 +216 246 0 0 0 +1 12 Oscillator 1 + + +Device 23 Plugin -1 +352 243 0 0 0 +1 12 Oscillator 2 + + +11 +2 2 0 1 1 0 +2 2 1 1 1 1 +0 0 0 2 2 0 +3 3 0 5 5 1 +4 4 0 6 6 1 +6 6 1 0 0 0 +7 7 1 8 8 0 +8 8 1 5 5 0 +8 8 0 6 6 0 +7 7 0 3 3 0 +5 5 1 4 4 0 + diff --git a/Examples/Tutorial5-Matrix&Sampler.ssm b/Examples/Tutorial5-Matrix&Sampler.ssm new file mode 100644 index 0000000..4caf1e4 --- /dev/null +++ b/Examples/Tutorial5-Matrix&Sampler.ssm @@ -0,0 +1,99 @@ +SpiralSynthModular File Ver 3 +225 58 903 467 306 558 724 420 +SectionList +12 + +Device 1 Plugin 0 +556 127 0 100 100 + + +Device 2 Plugin 18 +230 98 1 86 49 +2 0 0.127474 17 1 0 +32 5.4 0 +0 0 2 0 4 0 6 0 8 0 10 0 12 0 14 0 16 0 18 0 20 0 22 0 24 0 26 0 28 0 30 0 4 1 12 1 20 1 28 1 0 2 8 2 16 2 24 2 -1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 + +Device 3 Plugin 16 +316 97 1 634 10 +2 1 1 4 None 0 +1 1 4 None 1 +1 1 4 None 2 +1 1 4 None 3 +1 1 4 None 4 +1 1 4 None 5 +1 1 4 None 6 +1 1 4 None 7 + + +Device 4 Plugin 6 +481 128 0 0 0 + + +Device 5 Plugin -1 +358 21 0 0 0 +1 31 Tutorial 4 - Matrix and Sampler + + +Device 6 Plugin -1 +364 36 0 0 0 +1 99 This design won't produce sound by itself, you'll have to load some samples into the sampler first. + + +Device 7 Plugin -1 +342 50 0 0 0 +1 83 Open the sampler plugin window and load up samples (wav format) from your hardrive. + + +Device 8 Plugin -1 +375 65 0 0 0 +1 105 Hihat for the first sample, kickdrum and snare for the others (not that it really matters what they are). + + +Device 9 Plugin -1 +386 311 0 0 0 +1 104 This represents a very common combination of plugins in ssm, the matrix and sampler. This design is used + + +Device 10 Plugin -1 +361 325 0 0 0 +1 92 mainly creating drum loops. Open the matrix and change the trigger notes to change the beat. + + +Device 11 Plugin -1 +395 339 0 0 0 +1 108 If you move your mouse over the two columns of ports on the matrix and sampler, you'll see that the triggers + + +Device 12 Plugin -1 +256 353 0 0 0 +1 49 are connected up to fire the samples off. Simple! + + +11 +4 3 0 1 0 0 +4 3 1 1 0 1 +3 2 0 4 3 0 +2 1 2 3 2 1 +2 1 3 3 2 3 +2 1 4 3 2 5 +2 1 5 3 2 7 +2 1 6 3 2 9 +2 1 7 3 2 11 +2 1 8 3 2 13 +2 1 9 3 2 15 + diff --git a/Examples/Tutorial6-Sequencer.ssm b/Examples/Tutorial6-Sequencer.ssm new file mode 100644 index 0000000..33ca2d0 --- /dev/null +++ b/Examples/Tutorial6-Sequencer.ssm @@ -0,0 +1,101 @@ +SpiralSynthModular File Ver 3 +291 68 724 461 289 564 724 420 +SectionList +15 + +Device 0 Plugin 23 +300 144 0 100 100 +1 3 0 1 1 + +Device 1 Plugin 2 +152 170 0 100 100 +2 0 0 0 + + +Device 2 Plugin 5 +299 208 0 100 100 +1 0.0529 0.8281 0.49 0.3844 0.5 0.01 + +Device 3 Plugin 13 +367 153 1 350 26 +1 0 0.30583 + +Device 4 Plugin 0 +628 151 0 100 100 + + +Device 6 Plugin 1 +498 151 1 105 19 + + +Device 25 Plugin 6 +563 151 0 0 0 + + +Device 31 Plugin 14 +432 152 1 491 28 +1 0.321 0.56 + +Device 32 Plugin 17 +222 162 1 107 147 +2 1.73101 8.82 1 1 0 0 EventMap 1 2 0 10 50 1 8.82 86 0 100 8 19 5.48 63 0.1 1 5.96 66 0.1 1 6.4 70 0.14 1 6.92 63 0.14 1 7.46 66 0.14 1 7.94 70 0.2 1 0.1 63 0.14 1 0.46 66 0.1 1 0.86 70 0.1 1 1.5 63 0.2 1 2.14 66 0.14 1 2.58 70 0.2 1 3.74 63 0.1 1 4.02 66 0.14 1 4.46 70 0.14 1 8.34 39 0.2 1 1.24 39 0.14 1 3 46 0.3 1 4.86 42 0.2 1 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + + +Device 33 Plugin -1 +357 33 0 0 0 +1 32 Tutorial 5 - Using the sequencer + + +Device 34 Plugin -1 +368 58 0 0 0 +1 96 This is the same synth design as in tutorial 2, but with a sequencer controlling it's behavoiur. + + +Device 35 Plugin -1 +364 72 0 0 0 +1 93 (and some echo) This sequencer is quite different to the matrix, in that it is much better at + + +Device 36 Plugin -1 +374 86 0 0 0 +1 96 playing back melodies. The sequencer also records input, so keys you press while the midi plugin + + +Device 37 Plugin -1 +358 100 0 0 0 +1 89 is connected, will be played back. Open up the Sequencer plugin and scroll the piano roll + + +Device 38 Plugin -1 +363 113 0 0 0 +1 87 down, you should see the events. These can be moved, deleted or resized with the mouse. + + +11 +2 2 0 3 3 1 +0 0 0 3 3 0 +6 5 0 25 6 0 +25 6 0 4 4 0 +25 6 1 4 4 1 +3 3 0 31 7 0 +31 7 0 6 5 0 +1 1 0 32 8 2 +1 1 1 32 8 3 +32 8 0 0 0 0 +32 8 1 2 2 0 + diff --git a/Examples/Tutorial7-LADSPA.ssm b/Examples/Tutorial7-LADSPA.ssm new file mode 100644 index 0000000..a2467c6 --- /dev/null +++ b/Examples/Tutorial7-LADSPA.ssm @@ -0,0 +1,125 @@ +SpiralSynthModular File Ver 3 +291 68 724 461 289 564 724 420 +SectionList +19 + +Device 0 Plugin 23 +279 186 1 100 100 +1 3 1 1 1 + +Device 1 Plugin 2 +160 215 0 100 100 +2 0 0 0 + + +Device 2 Plugin 5 +280 251 1 481 220 +1 0.0036 0.3844 0 0.1156 0.5 0.01 + +Device 3 Plugin 13 +347 187 1 350 100 +1 0.3208 0.26683 + +Device 4 Plugin 0 +638 187 0 100 100 + + +Device 25 Plugin 6 +487 157 0 0 0 + + +Device 31 Plugin 6 +212 144 0 0 0 + + +Device 32 Plugin 5 +413 144 1 482 101 +1 0 0.0784 1 0.2601 0.43 0.01 + +Device 33 Plugin 22 +571 187 0 415 148 +2 0.714 /usr/local/lib/ladspa/cmt.so freeverb3 8 -1 -1 -1 0 0 0 0 0 1 1 1 1 1 1 1 1 + +Device 34 Plugin 3 +435 245 1 95 215 +3 6 -0.06 0.78 -0.52 0.5 0.22 0.82 1 +6 +6 +Freeze -1 1 0.53 +4 +Room -1 1 0.11 +4 +Damp -1 1 0.76 +3 +Wet -1 1 0.25 +3 +Dry -1 1 0.39 +5 +Width -1 1 0.09 + + +Device 35 Plugin -1 +374 13 0 0 0 +1 33 Tutorial 6 - Using LADSPA Plugins + + +Device 36 Plugin -1 +375 29 0 0 0 +1 71 If you have LADSPA installed, the plugins should be fully connected up. + + +Device 37 Plugin -1 +377 43 0 0 0 +1 36 If not, then this won't work at all. + + +Device 38 Plugin -1 +566 171 0 0 0 +1 10 (FreeVerb) + + +Device 40 Plugin -1 +370 72 0 0 0 +1 82 This shows you how you can set up the CV slider plugin to control a LADSPA plugin. + + +Device 41 Plugin -1 +380 86 0 0 0 +1 91 It's handy to name the sliders according to what they are controlling. Also important is to + + +Device 42 Plugin -1 +385 99 0 0 0 +1 92 tweak the input scales so the plugin behaves correctly. Most plugins set these automatically + + +Device 43 Plugin -1 +277 113 0 0 0 +1 45 as this one does, but you have to be careful. + + +Device 44 Plugin -1 +387 356 0 0 0 +1 112 Open the LADSPA plugin to load other plugins. When a new plugin is selected, all the connections will be broken. + + +18 +1 1 0 0 0 0 +2 2 0 3 3 1 +0 0 0 3 3 0 +1 1 1 31 6 0 +3 3 0 32 7 1 +31 6 0 32 7 0 +31 6 1 2 2 0 +34 9 0 33 8 2 +34 9 1 33 8 3 +34 9 2 33 8 4 +34 9 3 33 8 5 +34 9 4 33 8 6 +34 9 5 33 8 7 +33 8 0 4 4 0 +33 8 1 4 4 1 +25 5 0 33 8 0 +25 5 1 33 8 1 +32 7 1 25 5 0 + diff --git a/Examples/Tutorial8-AdvSequencing.ssm b/Examples/Tutorial8-AdvSequencing.ssm new file mode 100644 index 0000000..61e5002 --- /dev/null +++ b/Examples/Tutorial8-AdvSequencing.ssm @@ -0,0 +1,324 @@ +SpiralSynthModular File Ver 3 +24 32 1244 544 19 534 1248 481 +SectionList +48 + +Device 3 Plugin 0 +1092 304 0 265 123 + + +Device 5 Plugin 5 +792 123 1 763 66 +1 0 0.0529 1 0.16 0.5 0.01 + +Device 7 Plugin 8 +1024 304 0 265 123 +1 1.52 0.5 1.01 0.5 1.3 0.5 1 0.5 + +Device 9 Plugin 14 +927 124 1 1031 63 +1 0.321 0.5 + +Device 12 Plugin 13 +859 124 1 907 65 +1 0.2642 0.21074 + +Device 13 Plugin 18 +445 124 0 265 123 +2 0 0.0976591 6 1 0 +32 6 5 +16 0 20 0 21 0 24 0 28 0 0 2 1 2 4 2 5 2 8 2 12 2 17 5 19 5 27 5 29 5 18 12 22 12 23 12 26 12 30 12 2 14 3 14 6 14 10 14 14 14 -1 32 6 5 +20 0 22 0 24 0 26 0 28 0 30 0 0 2 2 2 4 2 6 2 8 2 10 2 12 2 14 2 16 2 18 2 17 7 25 12 7 14 15 14 -1 32 6 5 +6 0 8 0 10 0 0 2 30 2 2 4 28 4 18 5 4 7 26 7 12 14 16 14 20 14 22 14 24 14 -1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 + +Device 17 Plugin 6 +589 123 0 0 0 + + +Device 20 Plugin 23 +654 95 1 513 14 +1 2 0 1.01382 1 + +Device 21 Plugin 23 +653 164 1 513 129 +1 2 0 0.992295 1 + +Device 22 Plugin 7 +724 124 0 265 123 +1 1 1 1 1 + +Device 23 Plugin 21 +366 183 0 265 123 +1 8 0 1 0 0 0 0 0 0 0 1 -1 0 0 0 0 0 0 0 -1 0 0 0 0 0 2 0 -1 0 0 0 0 0 1 1 0 0 0 0 0 0 1 1 -1 0 0 0 0 0 1 0 -1 0 0 0 0 0 2 0 -1 0 0 0 0 0 + +Device 24 Plugin 18 +294 174 0 265 123 +2 0 0.0976591 6 1 0 +32 6 0 +31 0 -1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 + +Device 25 Plugin 23 +591 298 1 95 220 +1 2 1 1.00361 1 + +Device 26 Plugin 23 +590 362 1 95 333 +1 2 -1 1 1 + +Device 27 Plugin 6 +519 325 0 0 0 + + +Device 28 Plugin 7 +664 325 0 265 123 +1 1 1 1 1 + +Device 30 Plugin 13 +832 309 1 489 278 +1 0.4528 0.35798 + +Device 31 Plugin 5 +732 325 1 343 278 +1 0 0 1 0.2025 0.5 0.01 + +Device 32 Plugin 18 +450 325 0 265 123 +2 1 0.0860509 6 1 0 +32 6 3 +4 0 8 0 9 0 10 0 14 0 22 0 23 0 24 0 25 0 26 0 0 2 1 2 2 2 12 2 16 2 17 2 20 2 18 5 30 9 -1 32 6 3 +14 0 22 0 23 0 24 0 25 0 26 0 2 2 6 2 10 2 16 2 17 2 20 2 30 2 18 5 -1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 32 1 0 +-1 + +Device 33 Plugin 23 +732 391 0 265 123 +1 0 0 0.00163394 1 + +Device 34 Plugin 9 +802 391 0 265 123 +1 0.2642 0 + +Device 35 Plugin 23 +755 497 1 762 241 +1 2 0 1 1 + +Device 36 Plugin 20 +689 497 0 265 123 +1 0.16 0.17 + +Device 37 Plugin 17 +617 516 0 149 229 +2 7.05675 16.45 1 0 0 0 EventMap 1 2 0 10 50 1 16.45 352 0 100 8 10 4.04 74 0.2 1 5.3 77 0.4 1 6.86 79 -6.86 1 0.74 77 0.14 1 1.12 74 0.14 1 2.24 72 0.2 1 3 74 0.2 1 8.92 60 0.2 1 11.8 65 0.3 1 12.92 62 0.14 1 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + EventMap 1 1 0 10 100 1 2 0 0 100 8 0 + + +Device 38 Plugin 2 +546 539 0 265 123 +2 0 0 0 + + +Device 39 Plugin 5 +824 492 1 1015 352 +1 0.0784 0.0289 0.66 1.2769 0.28 0.01 + +Device 40 Plugin 11 +893 506 1 839 355 +1 1893.56 3.7 0 0 + +Device 41 Plugin -1 +637 22 0 0 0 +1 32 Tutorial 8 - Advanced Sequencing + + +Device 42 Plugin -1 +638 37 0 0 0 +1 59 This design shows you how to use sequencers to build songs. + + +Device 43 Plugin -1 +633 47 0 0 0 +1 59 Once the oscillators have settled onto the right frequency, + + +Device 44 Plugin -1 +641 58 0 0 0 +1 49 you should hear three patterns, playing together. + + +Device 45 Plugin -1 +302 123 0 0 0 +1 45 The SeqSelector is the main controlling part. + + +Device 46 Plugin -1 +286 138 0 0 0 +1 51 It tells the sequencers what part to play and when. + + +Device 47 Plugin -1 +298 375 0 0 0 +1 35 This matrix acts as the main clock. + + +Device 48 Plugin -1 +306 386 0 0 0 +1 39 It's one event triggers the seqselector + + +Device 49 Plugin -1 +305 397 0 0 0 +1 22 to move on a pattern. + + +Device 50 Plugin -1 +690 634 0 0 0 +1 39 This part was recorded from midi notes. + + +Device 51 Plugin -1 +695 646 0 0 0 +1 83 You can see them, if you open the Sequencer plugin window, and scroll around a bit. + + +Device 52 Plugin -1 +728 257 0 0 0 +1 92 Open the SeqSelector to see the patterns it's sending to the two matrixes and the sequencer. + + +Device 53 Plugin -1 +698 656 0 0 0 +1 77 The midi plugin is still connected, so it'll still record any incoming notes. + + +Device 55 Plugin -1 +637 69 0 0 0 +1 54 (The sequencer also takes some time to get in rhythm.) + + +Device 56 Plugin 7 +519 112 0 265 123 +1 0.46 1 1 1 + +Device 57 Plugin 23 +318 51 1 264 13 +1 0 -1 1.3716 1 + +Device 58 Plugin 9 +453 51 0 265 123 +1 -0.0377 0 + +Device 59 Plugin 9 +385 51 0 265 123 +1 0.0377 0 + +Device 60 Plugin 5 +824 559 1 1013 238 +1 0.1156 0.2025 1 1 0.23 0.01 + +Device 61 Plugin 6 +691 561 0 0 0 + + +Device 62 Plugin 14 +960 447 0 265 123 +1 0.415 0.58 + +43 +7 2 0 3 0 0 +7 2 1 3 0 1 +9 3 0 7 2 0 +13 5 1 5 1 0 +17 6 0 20 7 0 +17 6 1 21 8 0 +21 8 0 22 9 1 +20 7 0 22 9 0 +24 11 1 23 10 0 +23 10 0 13 5 0 +23 10 1 32 18 0 +32 18 0 27 14 0 +27 14 0 25 12 0 +27 14 1 26 13 0 +25 12 0 28 15 0 +26 13 0 28 15 1 +32 18 1 31 17 0 +28 15 0 31 17 1 +31 17 1 30 16 0 +30 16 0 7 2 1 +33 19 0 34 20 0 +34 20 0 30 16 1 +36 22 0 35 21 0 +38 24 0 37 23 2 +38 24 1 37 23 3 +37 23 0 36 22 0 +23 10 2 37 23 0 +35 21 0 39 25 1 +39 25 1 40 26 0 +22 9 0 5 1 1 +5 1 1 12 4 0 +12 4 0 9 3 0 +58 43 0 56 41 0 +13 5 0 56 41 1 +56 41 0 17 6 0 +57 42 0 59 44 0 +59 44 0 58 43 0 +37 23 1 61 46 0 +61 46 0 39 25 0 +61 46 1 60 45 0 +60 45 0 40 26 1 +40 26 0 62 47 0 +62 47 0 7 2 2 + diff --git a/GUI/SSM.xcf b/GUI/SSM.xcf new file mode 100644 index 0000000..5487769 Binary files /dev/null and b/GUI/SSM.xcf differ diff --git a/GUI/SSM.xpm b/GUI/SSM.xpm new file mode 100644 index 0000000..ed12fe9 --- /dev/null +++ b/GUI/SSM.xpm @@ -0,0 +1,1961 @@ +/* XPM */ +static char * SSM_xpm[] = { +"392 187 1771 2", +" c None", +". c #8CB9BB", +"+ c #90BDBF", +"@ c #94C1C4", +"# c #749698", +"$ c #52686A", +"% c #789A9C", +"& c #689597", +"* c #00B6BF", +"= c #283334", +"- c #803600", +"; c #222D2E", +"> c #263132", +", c #606060", +"' c #7DABAD", +") c #87B5B7", +"! c #445A5C", +"~ c #658889", +"{ c #2C9EA3", +"] c #7AA7A9", +"^ c #688A8B", +"/ c #465C5E", +"( c #6A8C8D", +"_ c #729FA1", +": c #38AAAF", +"< c #7CA9AC", +"[ c #709DA0", +"} c #569881", +"| c #9E9B82", +"1 c #B6CCD0", +"2 c #7D8597", +"3 c #7B7A7E", +"4 c #B2BCC3", +"5 c #A8A6B4", +"6 c #4D4D4D", +"7 c #808180", +"8 c #909090", +"9 c #1E1C26", +"0 c #B0AEB8", +"a c #A2C4C7", +"b c #FF6D00", +"c c #648688", +"d c #485E60", +"e c #6C8E8F", +"f c #84A5AD", +"g c #E4E2E7", +"h c #EDEDED", +"i c #2B2B2A", +"j c #1B1B1B", +"k c #827E8F", +"l c #6C6C6C", +"m c #151515", +"n c #585852", +"o c #0A0A04", +"p c #A09FA2", +"q c #9490A3", +"r c #7E929F", +"s c #303030", +"t c #C0C0C0", +"u c #88B5B8", +"v c #5C7E80", +"w c #401B00", +"x c #507274", +"y c #BE8B56", +"z c #A1AAB6", +"A c #FEFEFE", +"B c #989898", +"C c #000000", +"D c #7A7A7C", +"E c #696776", +"F c #252525", +"G c #555555", +"H c #131313", +"I c #424242", +"J c #B2B0BA", +"K c #838B9C", +"L c #85A6AE", +"M c #202B2C", +"N c #BF5200", +"O c #242F30", +"P c #60462C", +"Q c #B3814C", +"R c #809260", +"S c #BCB9C5", +"T c #FFFFFF", +"U c #DFDFDF", +"V c #434343", +"W c #030303", +"X c #0C0C00", +"Y c #BAC200", +"Z c #B4BA01", +"` c #3D3A46", +" . c #DBDAE0", +".. c #C9C7D0", +"+. c #16888E", +"@. c #684E34", +"#. c #3C5254", +"$. c #706248", +"%. c #8EA3AE", +"&. c #F4F4F6", +"*. c #FDFDFD", +"=. c #9C9C9C", +"-. c #0C0C0C", +";. c #080800", +">. c #484D00", +",. c #5A6100", +"'. c #252800", +"). c #100F12", +"!. c #93909E", +"~. c #F4F3F5", +"{. c #94A8B2", +"]. c #A4A188", +"^. c #ACA98F", +"/. c #F1F0F3", +"(. c #B5B5B5", +"_. c #686868", +":. c #6B6B6B", +"<. c #010200", +"[. c #B2B900", +"}. c #4E5100", +"|. c #C0C800", +"1. c #454547", +"2. c #A9B2BD", +"3. c #328286", +"4. c #5F8283", +"5. c #384E50", +"6. c #509FA3", +"7. c #89876D", +"8. c #C7C4AB", +"9. c #8CB9BC", +"0. c #84B1B4", +"a. c #9CC9CC", +"b. c #A4D1D3", +"c. c #A4D1D4", +"d. c #9E602A", +"e. c #304648", +"f. c #40A48F", +"g. c #958552", +"h. c #786A50", +"i. c #9B8B58", +"j. c #AEB7C1", +"k. c #F7F7F8", +"l. c #727272", +"m. c #666666", +"n. c #535353", +"o. c #B0BD00", +"p. c #9DAA00", +"q. c #7E8800", +"r. c #C6D600", +"s. c #4B5100", +"t. c #141414", +"u. c #96949C", +"v. c #8CADB4", +"w. c #C4915C", +"x. c #88A9B0", +"y. c #888498", +"z. c #2A2A2F", +"A. c #000001", +"B. c #020200", +"C. c #DAE200", +"D. c #BDC400", +"E. c #8C9100", +"F. c #D6DF00", +"G. c #2A3637", +"H. c #ACD8DC", +"I. c #566C6E", +"J. c #7C9EA0", +"K. c #86A7AA", +"L. c #607678", +"M. c #303B3C", +"N. c #86B3B5", +"O. c #928F75", +"P. c #AFDCDF", +"Q. c #8FB0B6", +"R. c #93B4BA", +"S. c #94A9B3", +"T. c #8EA2AD", +"U. c #C89560", +"V. c #86A6AE", +"W. c #BAD0D4", +"X. c #9EB3BB", +"Y. c #C6C4CE", +"Z. c #A2ABB7", +"`. c #8E96A6", +" + c #CAD4D9", +".+ c #96ABB4", +"++ c #8FBDBF", +"@+ c #848C9D", +"#+ c #6E6C7B", +"$+ c #0B0C00", +"%+ c #212300", +"&+ c #333700", +"*+ c #729496", +"=+ c #ABC0C6", +"-+ c #AAAAAA", +";+ c #969696", +">+ c #646464", +",+ c #7B8000", +"'+ c #6F7400", +")+ c #E0E900", +"!+ c #060506", +"~+ c #80ADB0", +"{+ c #608284", +"]+ c #405658", +"^+ c #887A60", +"/+ c #B8B5C1", +"(+ c #E7E6EA", +"_+ c #A1B6BE", +":+ c #3F3C4C", +"<+ c #FBFBFB", +"[+ c #F2CDB4", +"}+ c #BE7E4F", +"|+ c #8498A5", +"1+ c #EAEAEB", +"2+ c #B9CFD2", +"3+ c #C2C0CA", +"4+ c #616061", +"5+ c #858686", +"6+ c #DADADA", +"7+ c #757280", +"8+ c #97ACB5", +"9+ c #8BBABF", +"0+ c #E2E2E6", +"a+ c #E3E3E3", +"b+ c #8E8E8E", +"c+ c #A0A0A0", +"d+ c #343711", +"e+ c #768000", +"f+ c #96A100", +"g+ c #C1D000", +"h+ c #181A00", +"i+ c #EAFB00", +"j+ c #666E00", +"k+ c #4E6466", +"l+ c #EEEEF0", +"m+ c #8195A2", +"n+ c #98AEB6", +"o+ c #585858", +"p+ c #949A00", +"q+ c #B0B700", +"r+ c #0E0F00", +"s+ c #0A0A0A", +"t+ c #CBCAD2", +"u+ c #84A4AD", +"v+ c #76A3A5", +"w+ c #74A1A3", +"x+ c #C87E50", +"y+ c #EEA46F", +"z+ c #B27345", +"A+ c #E09862", +"B+ c #833A04", +"C+ c #EFA670", +"D+ c #4E2A0F", +"E+ c #555161", +"F+ c #6B8B73", +"G+ c #EDECEF", +"H+ c #94929C", +"I+ c #111013", +"J+ c #9C9AA2", +"K+ c #9895A6", +"L+ c #494949", +"M+ c #474747", +"N+ c #0E0E0F", +"O+ c #D1D1D2", +"P+ c #B5CBCF", +"Q+ c #81B5BF", +"R+ c #88B9BF", +"S+ c #D0CED6", +"T+ c #BEBEBE", +"U+ c #080808", +"V+ c #121400", +"W+ c #9AA500", +"X+ c #1A1C00", +"Y+ c #838D00", +"Z+ c #ACBA00", +"`+ c #77767A", +" @ c #9AA3B0", +".@ c #9BBCC1", +"+@ c #6C697B", +"@@ c #A8A7A8", +"#@ c #71788C", +"$@ c #C8C8C9", +"%@ c #040404", +"&@ c #ECECEC", +"*@ c #2C2C2C", +"=@ c #8094A1", +"-@ c #BCBCBC", +";@ c #202020", +">@ c #5A5D00", +",@ c #BEC600", +"'@ c #E2EC00", +")@ c #3A3A3B", +"!@ c #CAC8D1", +"~@ c #88A8B0", +"{@ c #77977F", +"]@ c #BC7D4E", +"^@ c #FCD8BD", +"/@ c #525252", +"(@ c #CBC9D2", +"_@ c #C9C9C9", +":@ c #282828", +"<@ c #353535", +"[@ c #1D1C22", +"}@ c #060600", +"|@ c #141500", +"1@ c #4D4C49", +"2@ c #79748B", +"3@ c #9C99AA", +"4@ c #869AA6", +"5@ c #7FB4BF", +"6@ c #B5B3BF", +"7@ c #5A5A5A", +"8@ c #090909", +"9@ c #050503", +"0@ c #6E7700", +"a@ c #D4E500", +"b@ c #E7F900", +"c@ c #B2C000", +"d@ c #212400", +"e@ c #B8B8B8", +"f@ c #F2F2F4", +"g@ c #97A0AD", +"h@ c #E3E2E7", +"i@ c #A9A8AE", +"j@ c #030204", +"k@ c #313131", +"l@ c #DDDDDD", +"m@ c #2A282E", +"n@ c #363800", +"o@ c #A5AB00", +"p@ c #050505", +"q@ c #646365", +"r@ c #D5D4DB", +"s@ c #90B1B7", +"t@ c #98957C", +"u@ c #5C9E87", +"v@ c #020202", +"w@ c #ADC2C8", +"x@ c #EEEEEE", +"y@ c #E5E5E5", +"z@ c #C6C6C6", +"A@ c #151508", +"B@ c #070800", +"C@ c #010100", +"D@ c #707072", +"E@ c #E8E8E8", +"F@ c #90A4AF", +"G@ c #985A24", +"H@ c #8EBCBF", +"I@ c #ACC1C7", +"J@ c #FCFBFC", +"K@ c #302E35", +"L@ c #A2A2A2", +"M@ c #929295", +"N@ c #111300", +"O@ c #161800", +"P@ c #080A00", +"Q@ c #010101", +"R@ c #0E0E0E", +"S@ c #D4D3D4", +"T@ c #FCFCFC", +"U@ c #3F4203", +"V@ c #464900", +"W@ c #444700", +"X@ c #0D0E00", +"Y@ c #A19DAE", +"Z@ c #8D8D8F", +"`@ c #D0D0D0", +" # c #E4E3E8", +".# c #68647D", +"+# c #CECECE", +"@# c #222222", +"## c #808075", +"$# c #9B9A9D", +"%# c #CCCAD2", +"&# c #3D3F00", +"*# c #7A7E00", +"=# c #3D4000", +"-# c #9A97A8", +";# c #BEBDC2", +"># c #E0E800", +",# c #7C8100", +"'# c #C2CA00", +")# c #1C1D00", +"!# c #768B92", +"~# c #98A1AF", +"{# c #BCBAC2", +"]# c #808081", +"^# c #8A869A", +"/# c #AEADB7", +"(# c #848484", +"_# c #29292B", +":# c #2B2B2C", +"<# c #F1F1F1", +"[# c #FCFCFD", +"}# c #96ABB5", +"|# c #A0622C", +"1# c #787D00", +"2# c #7A7F00", +"3# c #3B4000", +"4# c #7E9EA8", +"5# c #DCE8E9", +"6# c #9894A6", +"7# c #B2AFBC", +"8# c #F6F6F6", +"9# c #1C1C1C", +"0# c #9F9F9F", +"a# c #EAEAEA", +"b# c #0B0A0F", +"c# c #B2B2B5", +"d# c #98B9BE", +"e# c #AF887A", +"f# c #B7BE00", +"g# c #ADB6C0", +"h# c #8F8D98", +"i# c #101011", +"j# c #212121", +"k# c #E6EF00", +"l# c #000100", +"m# c #585B00", +"n# c #E8F000", +"o# c #808500", +"p# c #0C0D00", +"q# c #53696B", +"r# c #EEEEF1", +"s# c #5B5571", +"t# c #929293", +"u# c #787878", +"v# c #45444C", +"w# c #AEB8C2", +"x# c #B06630", +"y# c #0E0E00", +"z# c #BCC300", +"A# c #E9F200", +"B# c #B2BF00", +"C# c #C6D0D5", +"D# c #697086", +"E# c #F8F8F9", +"F# c #EFEFEF", +"G# c #313031", +"H# c #100F11", +"I# c #BDBDBE", +"J# c #7E929D", +"K# c #FFDABF", +"L# c #AD886D", +"M# c #DDDCE2", +"N# c #5E6110", +"O# c #A1A700", +"P# c #6D7100", +"Q# c #E3EC00", +"R# c #535E62", +"S# c #8DAEB4", +"T# c #9AAFB8", +"U# c #8BACB3", +"V# c #92B3B9", +"W# c #EAE9EC", +"X# c #A2ABB6", +"Y# c #A6A3B2", +"Z# c #949494", +"`# c #2E2E2E", +" $ c #898791", +".$ c #0A0B00", +"+$ c #C0C700", +"@$ c #A2B8BF", +"#$ c #E8E7EB", +"$$ c #EEEDF0", +"%$ c #89849A", +"&$ c #F6F5F7", +"*$ c #ABA8B6", +"=$ c #7D9DA7", +"-$ c #EEC9AE", +";$ c #C1BFCA", +">$ c #D1D1D1", +",$ c #070701", +"'$ c #080900", +")$ c #AAAAAB", +"!$ c #C8C6D0", +"~$ c #89AAB1", +"{$ c #8CA1AC", +"]$ c #F2F1F4", +"^$ c #B0C6CB", +"/$ c #D9D8DE", +"($ c #96949A", +"_$ c #92909A", +":$ c #CAC9D2", +"<$ c #F6F6F8", +"[$ c #8A869B", +"}$ c #ECECEF", +"|$ c #D7D6DC", +"1$ c #7E8698", +"2$ c #AB7944", +"3$ c #D8E100", +"4$ c #788100", +"5$ c #7C9CA6", +"6$ c #86A7AF", +"7$ c #9C531C", +"8$ c #B6BFC7", +"9$ c #191918", +"0$ c #404040", +"a$ c #646465", +"b$ c #FEFEFF", +"c$ c #D2D0D8", +"d$ c #889CA9", +"e$ c #8EAFB6", +"f$ c #17180B", +"g$ c #B1B800", +"h$ c #030300", +"i$ c #853C05", +"j$ c #8FA3AE", +"k$ c #605E6C", +"l$ c #19191A", +"m$ c #B7B4BF", +"n$ c #47464E", +"o$ c #363636", +"p$ c #545454", +"q$ c #0A090A", +"r$ c #7C7B7D", +"s$ c #DFDEE3", +"t$ c #97B8BE", +"u$ c #1F1F13", +"v$ c #BC8954", +"w$ c #FAB17B", +"x$ c #808080", +"y$ c #9BA4B1", +"z$ c #F9F9FA", +"A$ c #E6E6E7", +"B$ c #625C78", +"C$ c #E9E8EC", +"D$ c #515152", +"E$ c #101111", +"F$ c #EBEAEE", +"G$ c #9C9980", +"H$ c #26270C", +"I$ c #474A00", +"J$ c #262800", +"K$ c #151411", +"L$ c #644A30", +"M$ c #E29866", +"N$ c #CAC8D2", +"O$ c #C4C2CC", +"P$ c #7F7A90", +"Q$ c #868686", +"R$ c #1A1A1A", +"S$ c #B2B2B2", +"T$ c #2A2A2E", +"U$ c #81969F", +"V$ c #C5DCDD", +"W$ c #8AABB2", +"X$ c #3B3E00", +"Y$ c #9EA400", +"Z$ c #B5BE00", +"`$ c #90BDC0", +" % c #98C5C8", +".% c #664C32", +"+% c #E4EC00", +"@% c #646800", +"#% c #F8D4BA", +"$% c #EFCAAF", +"%% c #B3C9CD", +"&% c #94B6BB", +"*% c #D8D7D8", +"=% c #585662", +"-% c #9B9A9C", +";% c #A7A4B4", +">% c #A46630", +",% c #6A6E00", +"'% c #CFD700", +")% c #F1FE00", +"!% c #80ADAF", +"~% c #B98752", +"{% c #98C5C7", +"]% c #9FCDCF", +"^% c #A76A34", +"/% c #090A00", +"(% c #FEDABE", +"_% c #EEC8B0", +":% c #A7BCC3", +"<% c #ABB4BF", +"[% c #C8DEDF", +"}% c #8A9EAA", +"|% c #B4B1BE", +"1% c #C6D0D6", +"2% c #A0B6BD", +"3% c #7E9EA7", +"4% c #111111", +"5% c #0B0B00", +"6% c #454800", +"7% c #B6BF00", +"8% c #84B1B3", +"9% c #B7B59B", +"0% c #949177", +"a% c #ACD9DB", +"b% c #D4A16C", +"c% c #626500", +"d% c #E1EA00", +"e% c #908D74", +"f% c #A2937F", +"g% c #C08D58", +"h% c #4A4C00", +"i% c #9CA200", +"j% c #F0FE00", +"k% c #788000", +"l% c #778000", +"m% c #8AB7B9", +"n% c #D5A36E", +"o% c #7EABAD", +"p% c #16AAB1", +"q% c #78A5A7", +"r% c #78A5A8", +"s% c #6B999B", +"t% c #AA6C36", +"u% c #040500", +"v% c #E4EE00", +"w% c #707400", +"x% c #2A2B00", +"y% c #050500", +"z% c #B07D48", +"A% c #4C4E02", +"B% c #8F9400", +"C% c #CED600", +"D% c #7D8200", +"E% c #4A999D", +"F% c #A29F86", +"G% c #918F76", +"H% c #49999D", +"I% c #34A6AB", +"J% c #1AAEB5", +"K% c #E09660", +"L% c #DAB49F", +"M% c #565A00", +"N% c #727700", +"O% c #303200", +"P% c #020204", +"Q% c #040403", +"R% c #30A2A7", +"S% c #998956", +"T% c #323232", +"U% c #A66832", +"V% c #B2A48D", +"W% c #FCB27C", +"X% c #914812", +"Y% c #583E24", +"Z% c #CC9964", +"`% c #444709", +" & c #B88550", +".& c #BDBBA2", +"+& c #8F8D73", +"@& c #E69D67", +"#& c #FFB680", +"$& c #82AFB1", +"%& c #704B30", +"&& c #040400", +"*& c #B1653C", +"=& c #977258", +"-& c #B78550", +";& c #4C4F00", +">& c #8C896F", +",& c #CDA88E", +"'& c #8C420C", +")& c #8C430C", +"!& c #67876F", +"~& c #C1BFA5", +"{& c #C0BDA3", +"]& c #6F9D9F", +"^& c #1CB0B7", +"/& c #101010", +"(& c #4F5200", +"_& c #FEB57F", +":& c #639193", +"<& c #CF9D68", +"[& c #4D9DA1", +"}& c #5F8D8F", +"|& c #BF7F30", +"1& c #797C30", +"2& c #9A977D", +"3& c #83765C", +"4& c #B2AF96", +"5& c #E58332", +"6& c #A09D83", +"7& c #DB7928", +"8& c #0B9FA6", +"9& c #56765E", +"0& c #4B8D77", +"a& c #BD7E4F", +"b& c #F2A874", +"c& c #6A989A", +"d& c #ABA98F", +"e& c #9F9D83", +"f& c #77A5A7", +"g& c #BB8954", +"h& c #D28857", +"i& c #CB8052", +"j& c #A45B24", +"k& c #C07841", +"l& c #DB925C", +"m& c #9A4F21", +"n& c #CEA895", +"o& c #A6D3D5", +"p& c #BCB9A0", +"q& c #C5C2AA", +"r& c #B28B7B", +"s& c #A85C34", +"t& c #BD7E4E", +"u& c #7EABAE", +"v& c #B6A790", +"w& c #16170B", +"x& c #060700", +"y& c #C3915C", +"z& c #D28A53", +"A& c #7F7800", +"B& c #DD7B2A", +"C& c #95AAB4", +"D& c #B9C3CA", +"E& c #A3B9C0", +"F& c #748797", +"G& c #C5C3CD", +"H& c #BCD2D5", +"I& c #BF7300", +"J& c #FED000", +"K& c #403C00", +"L& c #84765C", +"M& c #D7A570", +"N& c #E3E2E6", +"O& c #8BA0AB", +"P& c #D8D8D8", +"Q& c #141314", +"R& c #F7F8F7", +"S& c #72798D", +"T& c #9CBDC1", +"U& c #FEF100", +"V& c #CAC000", +"W& c #B9C3CB", +"X& c #E5E4E7", +"Y& c #393740", +"Z& c #515151", +"`& c #706C84", +" * c #C2C2C3", +".* c #191919", +"+* c #C2C2C2", +"@* c #606062", +"#* c #ECEBEF", +"$* c #0E0E08", +"%* c #FEAF00", +"&* c #8A4100", +"** c #8A92A2", +"=* c #767676", +"-* c #424248", +";* c #0B0B0B", +">* c #121300", +",* c #121204", +"'* c #858290", +")* c #7A758C", +"!* c #D68D57", +"~* c #F2A974", +"{* c #807258", +"]* c #0D0E02", +"^* c #C6935E", +"/* c #FAFAFA", +"(* c #E7E7E7", +"_* c #939758", +":* c #8A8400", +"<* c #817A00", +"[* c #807900", +"}* c #5C591E", +"|* c #E0A26D", +"1* c #A8A58C", +"2* c #378BBC", +"3* c #388CBE", +"4* c #3483B7", +"5* c #5FA0D2", +"6* c #4789BA", +"7* c #296B9C", +"8* c #2A6C9D", +"9* c #397F7D", +"0* c #327173", +"a* c #357473", +"b* c #1B5D8F", +"c* c #4288BD", +"d* c #4E7D99", +"e* c #3A8EC0", +"f* c #2D7DAE", +"g* c #206B9C", +"h* c #2F7FB0", +"i* c #297DAE", +"j* c #008ABE", +"k* c #1180B3", +"l* c #3185B6", +"m* c #1C6799", +"n* c #2C80B2", +"o* c #1685B8", +"p* c #4599CA", +"q* c #4385AB", +"r* c #4081A8", +"s* c #317BB1", +"t* c #5294C8", +"u* c #216495", +"v* c #004273", +"w* c #2E7473", +"x* c #175B73", +"y* c #347473", +"z* c #115789", +"A* c #3988BB", +"B* c #3D91C3", +"C* c #4094C6", +"D* c #327C99", +"E* c #3584B8", +"F* c #3C81B8", +"G* c #4A8BBF", +"H* c #3274A5", +"I* c #64A6D6", +"J* c #3677AF", +"K* c #4486BB", +"L* c #3476A7", +"M* c #0D5080", +"N* c #5294C4", +"O* c #105284", +"P* c #115384", +"Q* c #5FA1D1", +"R* c #63A5D6", +"S* c #467DA7", +"T* c #2777A8", +"U* c #2A7AAB", +"V* c #599BCD", +"W* c #5D9FD0", +"X* c #115383", +"Y* c #0B4D7D", +"Z* c #3374AB", +"`* c #2A6D9D", +" = c #084A7B", +".= c #236593", +"+= c #044674", +"@= c #3F81B2", +"#= c #3A7BB3", +"$= c #317CB1", +"%= c #3589BB", +"&= c #1983AB", +"*= c #3C7895", +"== c #1483B6", +"-= c #237FA7", +";= c #2D7CA3", +">= c #0978AB", +",= c #37728F", +"'= c #3585B8", +")= c #3576AE", +"!= c #105385", +"~= c #105788", +"{= c #387BAB", +"]= c #135E8F", +"^= c #378BBD", +"/= c #4C7B97", +"(= c #3E8DBF", +"_= c #4586BC", +":= c #195B8D", +"<= c #094B7C", +"[= c #044778", +"}= c #3B85BA", +"|= c #64A6D7", +"1= c #5DA0D1", +"2= c #24649F", +"3= c #397CAD", +"4= c #0D4F80", +"5= c #2F71A2", +"6= c #1B5D91", +"7= c #60A3D3", +"8= c #448ABF", +"9= c #135586", +"0= c #4B8EBE", +"a= c #4A8BC0", +"b= c #579ACA", +"c= c #1A5C8D", +"d= c #074A74", +"e= c #024573", +"f= c #014373", +"g= c #054873", +"h= c #034573", +"i= c #18598E", +"j= c #5698CB", +"k= c #4F90C4", +"l= c #1475A7", +"m= c #2575A6", +"n= c #1F81B3", +"o= c #438EC1", +"p= c #4385B6", +"q= c #3B7DAE", +"r= c #27699A", +"s= c #024475", +"t= c #4B7A95", +"u= c #418CBF", +"v= c #62A4D5", +"w= c #004374", +"x= c #3B86BA", +"y= c #0F5586", +"z= c #266899", +"A= c #5C9ECF", +"B= c #4085BA", +"C= c #4182B9", +"D= c #3A7CAD", +"E= c #06497A", +"F= c #125485", +"G= c #3677AC", +"H= c #387AA0", +"I= c #1A5B73", +"J= c #3D7C73", +"K= c #4D8C73", +"L= c #054773", +"M= c #4397C9", +"N= c #226D9E", +"O= c #3584B6", +"P= c #2671A2", +"Q= c #456F8A", +"R= c #54829E", +"S= c #3C86BA", +"T= c #236595", +"U= c #044677", +"V= c #5091C5", +"W= c #3185B7", +"X= c #4F7D99", +"Y= c #1E699A", +"Z= c #2D81B2", +"`= c #4081A7", +" - c #4384AA", +".- c #3680B6", +"+- c #60A2D3", +"@- c #387AAB", +"#- c #07497A", +"$- c #377DB3", +"%- c #4F91C5", +"&- c #60A3D4", +"*- c #3677B0", +"=- c #5D9FD1", +"-- c #5496C9", +";- c #3177AE", +">- c #3C7DA4", +",- c #3D7995", +"'- c #0D4E73", +")- c #2F6F73", +"!- c #4E8C73", +"~- c #3E7C73", +"{- c #145573", +"]- c #3084B5", +"^- c #3286B8", +"/- c #2675A7", +"(- c #196495", +"_- c #325773", +":- c #487692", +"<- c #327CB2", +"[- c #4A8CBD", +"}- c #0D4F7F", +"|- c #1E6277", +"1- c #317773", +"2- c #1F8A8C", +"3- c #00B6BD", +"4- c #0F789B", +"5- c #3387B8", +"6- c #1BA5C0", +"7- c #07B2BE", +"8- c #507F9B", +"9- c #299DC1", +"0- c #0FA5BA", +"a- c #2B94BD", +"b- c #0CACBC", +"c- c #009DAD", +"d- c #1496AE", +"e- c #034674", +"f- c #0A4C7D", +"g- c #4F91C2", +"h- c #3C81B7", +"i- c #2C95BE", +"j- c #13A8BD", +"k- c #00A7BD", +"l- c #008FBE", +"m- c #0094BE", +"n- c #08A5B7", +"o- c #02B0BC", +"p- c #10A6BB", +"q- c #317FB4", +"r- c #357FB5", +"s- c #3887BA", +"t- c #3291BE", +"u- c #0DADBD", +"v- c #12A7BC", +"w- c #1F9FBE", +"x- c #3497C0", +"y- c #21B1C6", +"z- c #06B1BD", +"A- c #259ABE", +"B- c #00ACBD", +"C- c #0099BE", +"D- c #169CAD", +"E- c #00A2BD", +"F- c #00B1BD", +"G- c #2E82B4", +"H- c #186F9B", +"I- c #03ADB9", +"J- c #099BB0", +"K- c #0D5485", +"L- c #15789F", +"M- c #0C92AC", +"N- c #3F6985", +"O- c #1B6697", +"P- c #45738F", +"Q- c #148AB9", +"R- c #4284B7", +"S- c #014374", +"T- c #5799CA", +"U- c #105285", +"V- c #00A9B5", +"W- c #23719E", +"X- c #5495C9", +"Y- c #3888BB", +"Z- c #3588BA", +"`- c #1DA7C1", +" ; c #21A2B7", +".; c #4A8BB1", +"+; c #1190B9", +"@; c #369FC7", +"#; c #1091AE", +"$; c #1F6292", +"%; c #115484", +"&; c #195B8C", +"*; c #094C7D", +"=; c #599ACC", +"-; c #58A7D3", +";; c #2789A1", +">; c #37839B", +",; c #009DBE", +"'; c #05AFBB", +"); c #1678A1", +"!; c #139BB5", +"~; c #06A4B5", +"{; c #406A86", +"]; c #0AA0BB", +"^; c #3B85B9", +"/; c #3F80B7", +"(; c #377AAB", +"_; c #599BCE", +":; c #2969A4", +"<; c #366283", +"[; c #002C4D", +"}; c #009CAD", +"|; c #3685B1", +"1; c #0985B8", +"2; c #1D4259", +"3; c #071117", +"4; c #00A1A7", +"5; c #008D92", +"6; c #00797E", +"7; c #037F86", +"8; c #03A8B1", +"9; c #09B0B9", +"0; c #2B6384", +"a; c #153142", +"b; c #0797BC", +"c; c #006C94", +"d; c #091C27", +"e; c #006468", +"f; c #04838B", +"g; c #06AFBB", +"h; c #61A4D4", +"i; c #0C4E7F", +"j; c #004373", +"k; c #4183B4", +"l; c #5193C4", +"m; c #00345A", +"n; c #102637", +"o; c #0097A0", +"p; c #002729", +"q; c #002E3F", +"r; c #007BA9", +"s; c #001016", +"t; c #327DA9", +"u; c #0D1F2A", +"v; c #0F6B80", +"w; c #346885", +"x; c #132F3F", +"y; c #061016", +"z; c #0084A2", +"A; c #003E55", +"B; c #00586B", +"C; c #04474D", +"D; c #02A6AF", +"E; c #003C3F", +"F; c #193F55", +"G; c #195C88", +"H; c #070C0F", +"I; c #0F2B3B", +"J; c #07A6BB", +"K; c #007B9D", +"L; c #001F2A", +"M; c #00848C", +"N; c #3180B5", +"O; c #569DCE", +"P; c #3C7CB4", +"Q; c #4687BD", +"R; c #0B1318", +"S; c #1DACC2", +"T; c #14A8BD", +"U; c #1AA3B1", +"V; c #13A9BE", +"W; c #0FA3B8", +"X; c #0B9DB2", +"Y; c #10A4B9", +"Z; c #0EA3B8", +"`; c #04A0BB", +" > c #11374D", +".> c #005053", +"+> c #001314", +"@> c #0499A3", +"#> c #257AAB", +"$> c #040E13", +"%> c #099DA7", +"&> c #5EA0D1", +"*> c #3C7EAE", +"=> c #1A5580", +"-> c #006C72", +";> c #009DAF", +">> c #0092A1", +",> c #216785", +"'> c #11A2B6", +")> c #008892", +"!> c #004D6A", +"~> c #04A1AC", +"{> c #007E85", +"]> c #222C33", +"^> c #07A0B4", +"/> c #009AA5", +"(> c #4E94C6", +"_> c #296EA7", +":> c #61A4D5", +"<> c #05838B", +"[> c #00464D", +"}> c #068892", +"|> c #162C39", +"1> c #57A6D2", +"2> c #4082B4", +"3> c #226399", +"4> c #5496C7", +"5> c #2B485E", +"6> c #132F40", +"7> c #0D2333", +"8> c #192F3F", +"9> c #0E2A3A", +"0> c #0098A8", +"a> c #0D99A9", +"b> c #14A9BE", +"c> c #3C90C1", +"d> c #2D81B3", +"e> c #005C7F", +"f> c #006976", +"g> c #00A4B3", +"h> c #12A6BC", +"i> c #192126", +"j> c #0597A7", +"k> c #408ABE", +"l> c #5B9DCF", +"m> c #03A6AE", +"n> c #0CACBD", +"o> c #456F88", +"p> c #2BA6C4", +"q> c #4A95C6", +"r> c #3277AF", +"s> c #4E90C4", +"t> c #4B95C7", +"u> c #10293B", +"v> c #03939C", +"w> c #0B94A2", +"x> c #3797C3", +"y> c #3E93C4", +"z> c #2F83B4", +"A> c #0BAABB", +"B> c #58829D", +"C> c #597B93", +"D> c #385C78", +"E> c #255D7F", +"F> c #1F4E6A", +"G> c #00AAB3", +"H> c #0B1C22", +"I> c #017E85", +"J> c #00849A", +"K> c #008EAF", +"L> c #13A2B8", +"M> c #092233", +"N> c #02ABB4", +"O> c #088A94", +"P> c #19A3BD", +"Q> c #279BBF", +"R> c #2B9FC3", +"S> c #1B90B3", +"T> c #078A94", +"U> c #08B2BE", +"V> c #3C9AC8", +"W> c #5B809D", +"X> c #304C60", +"Y> c #007B8E", +"Z> c #004B5B", +"`> c #2D6E88", +" , c #007993", +"., c #1197A5", +"+, c #4586BB", +"@, c #408FC1", +"#, c #05858D", +"$, c #087984", +"%, c #04848C", +"&, c #06AFB9", +"*, c #3D5F79", +"=, c #161F25", +"-, c #005B69", +";, c #007984", +">, c #137F8C", +",, c #199FAD", +"', c #4687BC", +"), c #3379B0", +"!, c #090E11", +"~, c #1382B4", +"{, c #1275A2", +"], c #041D29", +"^, c #00A3A9", +"/, c #3D5A72", +"(, c #082C39", +"_, c #00A2AF", +":, c #0BA9B5", +"<, c #3A7693", +"[, c #0C1F2C", +"}, c #0190A4", +"|, c #2D88B4", +"1, c #3A84B9", +"2, c #2B4655", +"3, c #008D9A", +"4, c #112933", +"5, c #0F86B4", +"6, c #265574", +"7, c #0F9EA4", +"8, c #01AAB5", +"9, c #2196B6", +"0, c #3786B9", +"a, c #113D4D", +"b, c #027F85", +"c, c #16A6B7", +"d, c #00ABB5", +"e, c #00727A", +"f, c #00404A", +"g, c #0F8A90", +"h, c #00A4AB", +"i, c #003D4D", +"j, c #0D5C69", +"k, c #0D98A8", +"l, c #197A93", +"m, c #0D202B", +"n, c #00A6AF", +"o, c #03A1B7", +"p, c #07739C", +"q, c #05435F", +"r, c #012B3C", +"s, c #1EA0B5", +"t, c #03ACB8", +"u, c #1C7AA7", +"v, c #1F73A4", +"w, c #0A2637", +"x, c #0E6F88", +"y, c #0A8CBB", +"z, c #02A5AC", +"A, c #011C20", +"B, c #00A5AE", +"C, c #009BB4", +"D, c #0F97A4", +"E, c #2D95B1", +"F, c #062228", +"G, c #143041", +"H, c #088D9A", +"I, c #177992", +"J, c #061015", +"K, c #0C98A8", +"L, c #2993BB", +"M, c #0B87BB", +"N, c #21A1BF", +"O, c #143040", +"P, c #3594C1", +"Q, c #289DC0", +"R, c #507E9A", +"S, c #0F9BAB", +"T, c #17ACC1", +"U, c #124F5E", +"V, c #0B3545", +"W, c #12A6BB", +"X, c #2EA3C6", +"Y, c #236D9F", +"Z, c #2E6687", +"`, c #1FA9C3", +" ' c #0A7B86", +".' c #2480A8", +"+' c #060E11", +"@' c #007383", +"#' c #1199A8", +"$' c #0190A5", +"%' c #143642", +"&' c #002228", +"*' c #00A2B6", +"=' c #163243", +"-' c #3C86B3", +";' c #12384E", +">' c #0E212C", +",' c #1C4258", +"'' c #51809C", +")' c #4889B0", +"!' c #193E54", +"~' c #020A0F", +"{' c #1B5D89", +"]' c #1B6698", +"^' c #124465", +"/' c #155077", +"(' c #114363", +"_' c #317CA8", +":' c #4E7C98", +"<' c #1C4555", +"[' c #040C11", +"}' c #024474", +"|' c #044676", +"1' c #2D4D66", +"2' c #00080D", +"3' c #1476A4", +"4' c #1A2A33", +"5' c #061C2D", +"6' c #173343", +"7' c #122E3F", +"8' c #112D3E", +"9' c #153A55", +"0' c #102C3D", +"a' c #112D3D", +"b' c #21597B", +"c' c #276990", +"d' c #0D2738", +"e' c #082132", +"f' c #041C2C", +"g' c #2D6586", +"h' c #4C8DB4", +"i' c #49738B", +"j' c #193748", +"k' c #062B3C", +"l' c #23658C", +"m' c #3488B9", +"n' c #2E79A5", +"o' c #114364", +"p' c #1A6596", +"q' c #0C2D43", +"r' c #173D53", +"s' c #11354B", +"t' c #235B7B", +"u' c #4C7A96", +"v' c #163744", +"w' c #082131", +"x' c #132939", +"y' c #162F40", +"z' c #213747", +"A' c #114B79", +"B' c #456B86", +"C' c #001626", +"D' c #011727", +"E' c #021828", +"F' c #1C3242", +"G' c #152C3E", +"H' c #22648B", +"I' c #467591", +"J' c #2878A9", +"K' c #2F83B5", +"L' c #2A7EB0", +"M' c #2978A9", +"N' c #2A79AA", +"O' c #0481B4", +"P' c #41708C", +"Q' c #648AA5", +"R' c #36779E", +"S' c #4283AA", +"T' c #0A86BA", +"U' c #13598A", +"V' c #3E7BA2", +"W' c #3B789F", +"X' c #4D7B97", +"Y' c #316E95", +"Z' c #194D73", +"`' c #368ABB", +" ) c #6489A5", +".) c #646D73", +"+) c #316D94", +"@) c #3A89BC", +"#) c #3A85B9", +"$) c #3882B7", +"%) c #4B6273", +"&) c #2474A5", +"*) c #3583B7", +"=) c #4994C6", +"-) c #3E88BC", +";) c #4E8FC4", +">) c #4085BB", +",) c #387DB4", +"') c #4F95C8", +")) c #456A86", +"!) c #1F6FA0", +"~) c #4889BF", +"{) c #5B9CCF", +"]) c #3F8ABD", +"^) c #195A91", +"/) c #62A5D5", +"() c #337DB2", +"_) c #347EB4", +":) c #4993C5", +"<) c #4C8EC2", +"[) c #3477A7", +"}) c #5598C8", +"|) c #2E6FA5", +"1) c #3D8CBF", +"2) c #4792C4", +"3) c #2A6BA3", +"4) c #4284B5", +"5) c #2C71AA", +"6) c #4E91C2", +"7) c #5D9FCF", +"8) c #216299", +"9) c #3A7CB0", +"0) c #3D7FB2", +"a) c #3C7DB4", +"b) c #1D5F90", +"c) c #1C5E8F", +"d) c #054879", +"e) c #5294C5", +"f) c #166192", +"g) c #105283", +"h) c #155788", +"i) c #0B4D80", +"j) c #084A73", +"k) c #1E6090", +"l) c #2F70A9", +"m) c #3D7EB6", +"n) c #357FB4", +"o) c #2F6C92", +"p) c #4B7486", +"q) c #3E6883", +"r) c #C28F5A", +"s) c #DFAC78", +"t) c #AF723C", +"u) c #C79560", +"v) c #DA9C68", +"w) c #EEA66F", +"x) c #E59C66", +"y) c #813800", +"z) c #944B14", +"A) c #E89F69", +"B) c #C48554", +"C) c #6C7000", +"D) c #D9E100", +"E) c #B9C000", +"F) c #070700", +"G) c #707600", +"H) c #FEB57E", +"I) c #1F2000", +"J) c #AEB500", +"K) c #ACB300", +"L) c #616400", +"M) c #FAB07A", +"N) c #1E2000", +"O) c #636700", +"P) c #431E03", +"Q) c #924A13", +"R) c #B26933", +"S) c #F0A672", +"T) c #401C00", +"U) c #7B563B", +"V) c #99501A", +"W) c #D29360", +"X) c #F4AB76", +"Y) c #FFB67F", +"Z) c #49240A", +"`) c #823A03", +" ! c #ADB400", +".! c #6B4800", +"+! c #A3A900", +"@! c #757A00", +"#! c #FCB37D", +"$! c #4E2A0E", +"%! c #BB9B00", +"&! c #9E5600", +"*! c #9A7A00", +"=! c #777C00", +"-! c #848900", +";! c #B0A28B", +">! c #D8B29E", +",! c #8A644C", +"'! c #CFAA90", +")! c #472300", +"!! c #BD7600", +"~! c #939800", +"{! c #4A4D00", +"]! c #D49662", +"^! c #E3CAAF", +"/! c #958674", +"(! c #D7DF00", +"_! c #C68000", +":! c #813801", +"~ c #141400", +",~ c #111108", +"'~ c #48484B", +")~ c #BFB600", +"!~ c #403D00", +"~~ c #2B2D00", +"{~ c #585C00", +"]~ c #5B5E00", +"^~ c #2C2E00", +"/~ c #888C00", +"(~ c #BFC600", +"_~ c #E38130", +":~ c #BCC400", +"<~ c #8E9300", +"[~ c #292A11", +"}~ c #DFE800", +"|~ c #7E8300", +"1~ c #444608", +"2~ c #444600", +"3~ c #717500", +"4~ c #51A1A5", +"5~ c #BA9F8C", +"6~ c #F4AA76", +"7~ c #C48655", +"8~ c #C3A894", +"9~ c #439396", +"0~ c #89654A", +"a~ c #A95E2E", +"b~ c #97C5C7", +"c~ c #9FCCCF", +"d~ c #5E6109", +"e~ c #C2C900", +"f~ c #5E6100", +"g~ c #242500", +"h~ c #464A00", +"i~ c #9DA300", +"j~ c #B3BA00", +"k~ c #707500", +"l~ c #5E6200", +"m~ c #626600", +"n~ c #15150B", +"o~ c #B6BC00", +"p~ c #BEB500", +"q~ c #1B1A14", +"r~ c #404200", +"s~ c #434248", +"t~ c #868F01", +"u~ c #7B7C00", +"v~ c #1D1D1E", +"w~ c #929294", +"x~ c #7C909E", +"y~ c #555557", +"z~ c #2C3639", +"A~ c #9DBEC2", +"B~ c #B0ADBA", +"C~ c #403F42", +"D~ c #161617", +"E~ c #0B0B0C", +"F~ c #A6BBC2", +"G~ c #010102", +"H~ c #0C0C03", +"I~ c #0A0A00", +"J~ c #F5F5F5", +"K~ c #8C95A4", +"L~ c #87A8B0", +"M~ c #979797", +"N~ c #6A6A6A", +"O~ c #CACACB", +"P~ c #98A1AE", +"Q~ c #FFF200", +"R~ c #B8B6C2", +"S~ c #928EA2", +"T~ c #262528", +"U~ c #838383", +"V~ c #585466", +"W~ c #505050", +"X~ c #3F3F40", +"Y~ c #181819", +"Z~ c #E2E1E2", +"`~ c #B1BBC4", +" { c #E2E1E6", +".{ c #EAE9EA", +"+{ c #F8F8F8", +"@{ c #C3C0CB", +"#{ c #888499", +"${ c #1F1F1F", +"%{ c #A6A6A6", +"&{ c #7C7D7D", +"*{ c #B2BCC5", +"={ c #827B00", +"-{ c #16160A", +";{ c #9CB1BA", +">{ c #F5F4F6", +",{ c #6B667F", +"'{ c #F0F0F0", +"){ c #4A4A4A", +"!{ c #454F58", +"~{ c #B5CBD0", +"{{ c #A4B9C0", +"]{ c #494600", +"^{ c #3F3F3B", +"/{ c #AFC5CA", +"({ c #FAF9FA", +"_{ c #A4A3A5", +":{ c #575461", +"<{ c #D6D6D6", +"[{ c #798D9C", +"}{ c #9ABCC0", +"|{ c #9CA6B2", +"1{ c #C6DDDE", +"2{ c #808799", +"3{ c #C8C6CF", +"4{ c #BED4D7", +"5{ c #6E9B9D", +"6{ c #1F6A9C", +"7{ c #1D7EB0", +"8{ c #1C71A2", +"9{ c #1A7CAE", +"0{ c #197AAC", +"a{ c #3B90C1", +"b{ c #3E92C4", +"c{ c #0D5384", +"d{ c #2F84B5", +"e{ c #0E5586", +"f{ c #2A7EAF", +"g{ c #4195C6", +"h{ c #3B789E", +"i{ c #2C648A", +"j{ c #37789E", +"k{ c #00A8B8", +"l{ c #007086", +"m{ c #3F6984", +"n{ c #498FC2", +"o{ c #408BBE", +"p{ c #2D77AE", +"q{ c #4D8FC3", +"r{ c #006677", +"s{ c #4788BD", +"t{ c #3781B6", +"u{ c #5597C8", +"v{ c #4082B2", +"w{ c #2D72AA", +"x{ c #009EAA", +"y{ c #00515B", +"z{ c #008EA1", +"A{ c #5A9CCD", +"B{ c #16588C", +"C{ c #206293", +"D{ c #2C6DA7", +"E{ c #4C8EBF", +"F{ c #5D9ED1", +"G{ c #367CB2", +"H{ c #2E71A1", +"I{ c #1A5C8F", +"J{ c #044777", +"K{ c #074A73", +"L{ c #074974", +"M{ c #3475AB", +"N{ c #3070AA", +"O{ c #002F3A", +"P{ c #00595F", +"Q{ c #11A3B1", +"R{ c #5B9DCD", +"S{ c #064973", +"T{ c #0C4D73", +"U{ c #317173", +"V{ c #10527F", +"W{ c #00708C", +"X{ c #1C5D73", +"Y{ c #4B8A73", +"Z{ c #468573", +"`{ c #1B5D73", +" ] c #1E5E73", +".] c #619E73", +"+] c #5A9873", +"@] c #00343A", +"#] c #00808E", +"$] c #377773", +"%] c #559373", +"&] c #1A5D8D", +"*] c #0F5073", +"=] c #529073", +"-] c #236473", +";] c #135584", +">] c #185B73", +",] c #307473", +"'] c #60A2D4", +")] c #2A6C9C", +"!] c #488D73", +"~] c #488ABF", +"{] c #397AB2", +"]] c #0F5183", +"^] c #3376A6", +"/] c #23639B", +"(] c #458CC0", +". + + + + + + + + + + + + + + + + + + + + + + @ # $ % & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & = - ; . + + + + + + + + + + + + + + + + + + + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & ' ) ) ) ! ) ! ! ) ! ~ ! ) ! ~ ) ! ) ! ! ! ~ ! ! ! ) ~ ) ) ) & * { ] . . . . ; ! ^ / . / . / . / / / ( ! / / / / ( ! ( . . . . _ : * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * } | + + + + + + + + 1 2 3 4 5 6 7 8 9 0 a + + + + + + + + + + [ : * * * * & - b - + + + + + + + + + + + + + + + + + + + + + + + + - b - & * & c d e + + + + f g h i j k l m n o p q r + + + + + + + e d c ", +". + + + + + + + + + + + + + + + + + + + + + + @ s t s & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & - b - . + + + + + + + + + + + + + + + + + + + + + + @ , t , & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + e + e + d e + e + e e + e + e e d e e e + d + + + u & * { < + + + + + + + + + + + + + + + + + + + d + + + + + + + + + [ : * * * * * * * * * * * * { v w w e + + + + + + + + + + + + + + + + + + + + + + + e w w x : * * * * * * * * * * * * * * * * * * { y d d + + + + + z A B C D E F G H I J K L + + + + + + + + + [ : * * * * & M N O + + + + + + + + + + + + + + + + + + + + + + + + O - P Q R Q - b w + + + + S T T U V W C X Y Z ` ...+ + + + + + + s t s ", +". + + + + + + + + + + + + + + + + + + + + + + @ s t s & * * * +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.* * * * * & @.- ; . + + + + + + + + + + + + + + + + + + + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & c d e + + + + + + + + + + + + + + + + + + + + + + + + e d c & * { v w w e + + + + + + + + + + + + + + + + + + + + + + + e s s x : * * * * * * * * * * * * { #.b b d + + + + + + + + + + + + + + + + + + + + + + + d b b $.: * * * * * * * * * * * * * * * * * * { #.b N d + + + %.&.T *.=.-.;.>.,.'.).!.~.{.+ + + + + + + + + [ : * * * * & ].^.+ + + + + + + + + + + + + + + + + + + + + + + + + + + u & * & w b w + + + f /.(._.:.j C <.[.}.|.C 1.2.+ + + + + + + s t s ", +". + + + + + + + + + + + + + + + + + + + + + + @ # $ % & * * 3.) 4.5.) ) ) ) ) ) ) 4.5.) ) ) 4.) ) ) ) ) ) 4.) ) ) ) ) ) 6.* * * * 7.8.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & w b w + + + + + + + + + + + + + + + + + + + + + + + + w b w & * { d.b b d + + + + + + + + + + + + + + + + + + + + + + + d t t e.: * * * * * * * * * * * f.g.y - w e + + + + + + + + + + + + + + + + + + + + + + + e w w h.i.R R f.* * * * * * * * * * * * * * * { #.N N d + + + j.k.l.m.n.;.o.p.q.r.s.t.u.v.+ + + + + + + + + [ : * * * * & w.+ + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * & c d e + + + x.y.z.A.C B.C.D.E.C F.C G.+ + + + + + + + e d c ", +". + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * { . H.I.H.J.K.K.H.L.K.H.I.H.J.K.K.I.H.L.H.K.K.K.M.H.L.K.K.K.H.N.: * * f.O.P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * * * +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & w b - + + + + + + + + Q.R.S.+ T.+ + + + + + + + + U.U.N b b Q R g.v w w e + + + + + + V.W.X.Y.Z.`. +.++ + + + + + + + + e s s x : * * * * * * * * f.R R f.{ < + + + + + + + + + +++++ + + + + + + + + + + + + + + + + + [ : * * f.R R R R * * * * * * * * * * * { < d d + + + + @+#+A.C C $+'.%+s.&+r.C *++ + + + + + + + + + [ : * * * * 7.w - O + + + + + + + + Q.R.S.+ T.+ + + + + + + + + + + + + u & * & u + + + + + =+T -+;+>+C ,+'+'+C )+C !++ + + + + + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ # $ % & * { ] ~+{+]+{+M M ]+~+M ~+{+]+{+M M ]+]+]+]+]+{+~+]+]+~+]+]+{+~+[ : * f.f.& = , ; . + + + + + + + + + + + + + + + + + + + + + + @ > , > & * * 3.) ) ) ) ) ) ) 5.4.) ) ) 4.4.) 4.) 4.) ) ) ) ) ) ) ) ) ) ) 6.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & c d ^+^.+ + + + + + /+(+_+h :+<+[+}+U.U.U.U.U.U.U.+ + e d c Q f.{ < + + + + + + + + + |+1+2+3+4+5+6+7+8++ + + + + + + + + + + [ : * * * * * f.R R f.* * * { < + + + + + + + + ++9++++ + + + + + + + + + + + + + + + + + [ : * * * * * * * R R R R f.* * * * * * { < + + + + + + 0+a+b+c+d+e+e+f+g+h+i+j+k++ + + + + + + + + + [ : * * * * Q - b - + + + + + + + /+(+_+h :+<+l+m++ + + + + + + + + + + u & * & c d e + + + n+T T h o+C ,+p+q+r+)+C s+t+u++ + + + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ s t s & * { v+) ! ) ! ! ~ ! ) ; ) ! ) ! ! ~ ! ! ) ~ ! ~ ) ! ! ) ! ! ) ) w+: f.f.* & , t , . + + + + + + + + + + + + + + + + + + + + + + @ , t , & * { . H.H.H.H.H.H.I.H.J.K.K.K.I.K.K.M.K.M.H.L.H.K.K.H.H.H.H.H.H.N.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + U.+ + + + ^.U.x+y+z+A+B+C+D+E+ ++ + + + + + + + + + u & f.F+< + + + + + + + R.G+H+I+J+K+L+B M+N+O+P++ + + + + + + + + + [ : * * f.R R f.* * * * * * { v w w e + + + + ++Q+R++ + + + + + + + + + + + + + + + e s s x : * * * * * * * * * * * f.R R R R * * { < d d + + + + S+T A T+U+V+W+&+X+Y+Z+C `+ @+ + + + + + + + + [ : * * * f.O.M N O + + + + + .@1 +@@@#@$@%@&@*@E+ ++ + + + + + + + + + u & * & s t s + + + =@*.-@;@C -.C C >@,@'@C )@*.!@~@+ + + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ s t s & * { < + e d + e e + d d + e d + e e e + d + e e + d + d e e + + [ {@f.* * & = , ; . + + + + + + + + + + + + + + + + + + + + + + @ > , > & * { ] ~+~+~+~+~+~+~+]+]+]+{+]+]+]+~+]+~+]+]+]+]+M ~+~+~+~+~+~+~+[ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & w.U.U.U.b U.U.]@^@h i j k l m /@%@p q r + + + + + + + + + u & * } y w w e + + + f (@T _@:@<@[@C }@|@1@2@3@4@+ + + + + + e w w x {@R R f.* * * * * * * * * { #.b b d + + + ++Q+5@+++ + + + + + + + + + + + + + + + d t t e.: * * * * * * * * * * * * * * * * R R g.d.N N d + + + 6@A 7@%@8@9@0@a@b@c@d@C e@f@g@+ + + + + + + + [ : * * * R & u U.+ + + + + f g h i j k l m n o p q r + + + + + + + + + u & * & s t s + + + + h@i@j@k@l@m@C C n@o@p@C q@*.r@s@+ + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ # $ % & * { < d d + + + + + + e + + + + + + + + + + + + + + + + + + d d t@u@* * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * { v+) ) ) ) ) ) ! ) ! ! ~ ! ! ! ) ! ) ! ! ) ~ ! ) ) ) ) ) ) ) w+: * * * * * * * * * * * * * * * * * * * * * * * * R R R R R R R Q u + + + + U.+ S T T U V W C C C v@` ...+ + + + + + + + + u & * { #.b b d + + + w@T x@y@z@A@B@}@C@C C D@E@F@+ + + + + + d b b G@u@* * * * * * * * * * * * { v w - e + + ++H@+++ + + + + + + + + + + + + + + + + + e s s x : * * * * * * * * * * * * * * * * * * { #.N N d + + + I@J@K@C L@M@%@N@O@P@%@Q@R@S@T@z + + + + + + + [ : * * f.f.& ].^.+ + + + + S T T U V U@V@W@X@;.` ...+ + + + + + + + + u & * & c d e + + + + .+Y@Z@`@ #.#+#@#C ##$#C v@=.T %#+ + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * { #.N N d + + + + + + + + + + + + + + + + + + + + + + + d N N $.: * * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * { < + + + + + + + d e d e e e e + d + d + d + e + + + + + + + [ : * * * * * * * * * * * * * * * * R R R R R R R R * * * * * * * & u + + + + + ]@/.(._.:.j &#*#&#*#&#=#1.2.+ + + + + + + + + u & * { v w w e + + + -#;#W C C >#,#'#)#C C C !#+ + + + + + + e w w x : * * * * * * * * * * * * { < ^.^.+ + + +++ + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { < d d + + + + ~@~#{#]#A ^#/#(#C @#`@_#C :#<#[#}#+ + + + + + [ : * * R * & |#, O + + + f /.(._.:.j 1#2#C.3#C C 1.2.+ + + + + + + + + u & * & u + + + + + + 4#5#T T 6#7#8#9#v@0#a#R@b#c# .d#+ + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ # $ % & * { d.b N d + + + + + + + + + + + + + + + + + + + + + + + d N N e.: * * * & = , ; . + + + + + + + + + + + + + + + + + + + + + + @ > - > & * { < d d + + + + + + + e + + + + + + + + + + + + + + + + + d d [ : * * * * * * * f.R R R R R R R R * * * * * * * * * * * * * * * & u + + + + + ^.e#z.A.C C f#*#f#*#f#C G.+ + + + + + + + + + u & * { < + + + + + + g#h#i#j#U+k#l#m#n#o#p#C q#+ + + + + + + + + + [ : * * * * * * * * * * * * { < U.+ + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { < + + + + + + + }#T@T r#s#T t#C j#T u#C v#8#w#+ + + + + + + [ : * f.f.* & x#t , + + + x.y.z.A.C y#z#|.A#B#e+3#G.+ + + + + + + + + + u & * & u + + + + + + + u+C# #D#E#F#G#H#L@T I#J#+ + + + + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ w b - Q R g.< d d + + + + + + + + + + + + + + + + + + + + + + + + + d d [ : * * * & , t , . + + + + + + + + + + + + + + + + + + + + + + @ - b N Q R { #.N N d + + + + + + + + + + + + + + + + + + + + + + + d N N e.{@R R R R R R R f.* * * * * * * * * * * * * * * * * * * * * * * & u + + + + + =+K#L#;+>+C C &#C &#C &#!++ + + + + + + + + + u & * { < + + + + + + M#T@*.T N#O#C C C P#Q#X R#S#+ + + + + + + + + [ : * * * * * * * * * * * * { v - w e + + + + + + + + Q.T#S#U#V#+ + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { < + + + + + + + + }#W#X#Y#T Z#i#`#T a# $+ + + + + + + + + + [ : * R * * & - , O + + + =+T -+;+>+C .$C +$3#C C !++ + + + + + + + + + u & * & u + + + + + + + + + + @$#$A $$%$T &$*$=$+ + + + + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ w b w & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * & = , ; . + + + + + + + + + + + + + + + + + + + + + + @ > - > & * g.d.N N d + + + + + + + + Q.T#S#U#V#+ + + + + + + + + + d N N G@u@* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + n+T K#-$o+C *#&#*#&#*#C s+t+u++ + + + + + + + u & * { < + + + + + + ;$T >$V ,$}@C C C '$C C )$!$~$+ + + + + + + + [ : * * * * * * * * * * * * { #.b b d + + + + + + {$]$^$/$($_$A 5 + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + :$<$T [$}$T |$1$+ + + + + + + + + + [ : f.f.* * 2$u + + + + + n+T T h o+p#,+,+3$B#4$3#s+t+u++ + + + + + + + u & * & u + + + + + + + + + + + 5$+ + 6$F@+ + + + + + + + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ # $ % & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + d d [ : * * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * { < d d + + + + + + + {$]$^$/$($_$A 5 + + + + + + + + + + d d [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + =@*.-@7$C -.C C C C C C )@*.!@~@+ + + + + + + u & * { < + + + + + + 8$A 9$C 0$s C C B.C C C a$b$c$~@+ + + + + + + [ : * * * * * * * * * * * * { v N - e + + + + + 1 2 3 4 5 6 7 8 9 0 a + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + 5$+ + d$e$+ + + + + + + + + + + + [ : R * * * 2$u + + + + + =@*.-@;@C f$,+g$A#h$;.C )@*.!@~@+ + + + + + + u & * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * { < + + + + + + + + + + + + + + + + + + + + + + + + + + d N N e.: * * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * { < + + + + + + + + 1 2 3 4 5 6 7 8 9 0 a + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + h@i@j@i$l@m@C C C C p@C q@*.r@s@+ + + + + + u & * { < + + + + + + j$!$k$l$a#m$n$o$C R@p$q$C r$A s$t$+ + + + + + [ : * * * * * * * * * * * * { < U.U.+ + + + + z A B C D E F G u$I J K L + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ {@f.* * * v$M , O + + + + h@i@j@k@l@m@C C C C %@C q@*.r@s@+ + + + + + u & * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ # $ % & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + d N N e.: * * * & = , ; . + + + + + + + + + + + + + + + + + + + + + + @ > - > & * { < + + + + + + + z A B C D E F G u$I J K L + + + + + + + d d [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + .+Y@Z@`@w$.#+#@#C x$$#C v@=.T %#+ + + + + + u & * { < + + + + + + + y$z$A$A B$C$B C :@T D$C E$&@F$Q.+ + + + + + [ : * * * * * * * * * * * * { G$^.^.^.+ + + %.&.T *.=.H$V@I$J$;.K$!.~.{.+ + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ i.* * * * v$, t , + + + + .+Y@Z@`@ #.#+#@#C x$$#C v@=.T %#+ + + + + + u & * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u ", +". + + + + + + + + + + + + + + + + + + + + + + @ w b w & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + L$^+[ : * * * & , t , . + + + + + + + + + + + + + + + + + + + + + + @ - b - & * { < + + + + + + %.&.T *.=.-.C@C X ;.K$!.~.{.+ + + + + + d N N e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + 4#5#T T 6#M$8#9#v@0#a#R@b#c# .d#+ + + + + + u & * { < + + + + + + + + N$A O$P$T Q$C R$T S$T$U$V$W$+ + + + + + + [ : * * * * * * * * * * * * { v$w w U.+ + + j.k.l.m.n.X$2#Y$Z$C C t.u.v.+ + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t@u@* * * R & M , O + + + + 4#5#T T 6#7#8#9#v@0#a#R@b#c# .d#+ + + + + + u & * & `$ % % % % % % % % % % % % % % % % % % % % % % % % % % % %`$", +". + + + + + + + + + + + + + + + + + + + + + + @ w b w & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + U.+ [ : * * * & = , ; . + + + + + + + + + + + + + + + + + + + + + + @ > - .%Q f.{ < + + + + + + j.k.l.m.n.C l#+%|.@%C t.u.v.+ + + + + + d N N e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + u+C# #D##%$%G#H#L@T I#J#+ + + + + + + + + u & * { < + + + + + + + + + %%&%O$T *%=%-%T A ;%+ + + + + + + + + + [ : * * * * * * * * * * * * { v$b b >%+ + + @+#+A.C C ,%|.'%)%e+e+C *++ + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { !% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %~%: * * * R & u + + + + + + + u+C# #D#E#F#G#H#L@T I#J#+ + + + + + + + + u & * & {%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%{%", +". + + + + + + + + + + + + + + + + + + + + + + @ # ^%% & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + >%d [ : * * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& f.g.y + + + + + + @+#+A.C C /%l#)+C C C@C *++ + + + + + + + d >%[ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + + + + @$#$(%_%%$T &$*$=$+ + + + + + + + + u & * { < + + + + + + + + + + + :%<%[%}%|%1%2%3%+ + + + + + + + + + [ : * * * * * * * * * * * * { v$w - >%+ + + 0+a+b+c+4%5%C 6%7%C C C k++ + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { 8%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%9%0%: * * * R & u + + + + + + + + + + @$#$A $$%$T &$*$=$+ + + + + + + + + u & * & b.a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%b.", +". + + + + + + + + + + + + + + + + + + + + + + @ a.b%c.& * { < + + + + + + + + + V.W.X.Y.Z.`. +.++ + + + + + + + + d b N e.: * * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * { < U.U.+ + + + 0+a+b+c+4%c%,+d%C C /%C k++ + + + + + + + + ^.e%: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + + + + + 5$+ ^.f%F@+ + + + + + + + + + + + u & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * { g%+ U.^.^.+ + S+T A T+U+h%,+i%j%k%l%C `+ @+ + + + + + + + + [ : * * * * * * * * * * * * * * * * * * { m%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%n%o%: * * f.f.& M , O + + + + + + + + + 5$+ + 6$F@+ + + + + + + + + + + + u & * p%q%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%s%", +". + + + + + + + + + + + + + + + + + + + + + + @ # t%% & * { < + + + + + + + + + |+1+2+3+4+5+6+7+8++ + + + + + + + d b N e.: * * * & = , ; . + + + + + + + + + + + + + + + + + + + + + + @ > - > & * { < + + U.U.^.+ S+T A T+U+u%C v%w%x%y%C `+ @+ + + + + + + d d z%: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + + + + + + + + U.+ + + + + + + + + + + + + u & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * { g%+ U.+ U.+ + 6@A 7@%@8@A%B%C%D%;.C C e@f@g@+ + + + + + + + [ : * * * * * * * * * * * * * * * * * * * E%~+r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%F%G%H%* * * R * & , t , + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * p%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%J%", +". + + + + + + + + + + + + + + + + + + + + + + @ s K%s & * { < + + + + + + + R.G+H+I+J+K+L+B M+N+O+P++ + + + + + + + >%>%[ : * * * & , t , . + + + + + + + + + + + + + + + + + + + + + + @ - b - & * { < + + + + ^.U.L%A 7@%@8@W C M%N%O%C C e@f@g@+ + + + + d 8 8 - : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + + + + + + + + + U.+ + + + + + + + + + + + u & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * { |#s - e U.+ + I@J@K@C L@M@P%C C C Q%Q@R@S@T@z + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * R%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%S%I%* * * * R * & M , O + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + @ - t s & * { < + + + + + + f (@T _@:@T%[@C C |@1@2@3@4@+ + + + + + U.+ ^.e%: * * * & = , ; . + + + + + + + + + + + + + + + + + + + + + + @ > - U%& * { < + + + + + + V%W%X%C L@M@P%C C C Q%Q@R@S@T@z + + + + d 8 8 Y%u@* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + + + + + + + + + + U.+ + + + + + + + + + + u & * { o%@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ _ : * * * * * * * * * * * * R #.t K%d U.+ + ~@~#{#]#A ^#/#(#C @#`@_#C :#<#[#}#+ + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * R * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + @ Z%$ % & * { < + + + + + + w@T x@y@z@`%*#2#*#*#=#D@E@F@+ + + + + + U.d d &: * * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b..&+&* { < + + + + + + ~@~#{#@&#&^#/#(#C @#`@_#C :#<#[#}#+ + + + d d [ R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & `$ % % % % % % % % % % % % % % % % %Z% % % % % % % % % % %`$& * { $&a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.v+: * * * * * * * * * * * * R v %&w e ^.^.+ + }#T@T r#s#T t#C j#T u#C v#8#w#+ + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * R * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + @ Z%b.c.& * { < + + + + + + -#;#W C C &&C C C C C C !#+ + + + + + + >%8 8 - : * * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.Q * { < + + + + + + + }#T@T r#*&#&=&C j#T u#C v#8#w#+ + + + + + + [ -&* +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.* & {%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%9%9%]%]%]%]%]%]%]%]%]%{%& * { N.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.] : * * * * * * * * * * * * R < U.+ + + U.+ + + }#W#X#Y#T Z#i#`#T a# $+ + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * R * * & M , O + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + @ ^%$ % & * { < + + + + + + g#h#i#j#U+;&2#2#2#*#&#C q#+ + + + + + + - 8 8 e.R * * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ > - > >&f.{ < + + + + + + + + }#W#X#Y#T ,&'&)&T a# $+ + + + + + + + d d [ {@!&4.5.4.) ) ) ) ) ) ) ) ) ) 4.) ) ) ) ) ) 4.5.5.) ) ) ) ) ) 6.& b.a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%~&{&a%a%a%a%a%a%a%a%b.& * p%] c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.]&^&* * * * * * * * * * * * 2$< U.+ + + U.+ + + + + + :$<$T [$}$T |$1$+ + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * R * * & , t , + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + @ x#t s & * { < + + + + + + M#T@*.T /&(&,+*#*#*#&#C R#S#+ + + + + + U.d d [ i.* * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ - b N +&R { < + + + + + + + + + + + :$<$T [$}$#&_&1$+ + + + + + + d 8 8 e.:&<&I.H.J.H.L.K.K.L.K.K.K.K.K.I.H.L.H.K.H.K.I.H.H.K.K.K.K.H.K.N.[&q%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%G%F%r%r%r%r%r%r%r%s%J%* * p%:&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&J%* * * * * * * * * * * * * 2$v - s e + U.+ + + + + + + 5$+ + d$e$+ + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * f.f.* * & M , O + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + @ x#t s & * { < + + + + + + ;$T >$V Q@C C C C '$C C )$!$~$+ + + + U.+ + + [ {@f.* * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ > - > >&R |&y U.U.U.+ + + + + + + + + 5$+ + d$e$+ U.U.^.+ + + + + d 8 8 e.:&v$]+~+~+]+~+]+]+~+]+]+]+{+]+]+]+]+]+{+]+~+]+]+]+]+{+]+{+{+]+[ : p%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%S%I%I%I%I%I%I%I%J%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2$#.K%t d + ^.^.+ + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * R * * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + U.# $ % & * { < + + + + + + 8$A 9$C 0$1&,+*#*#*#=#C a$b$c$~@+ + + U.+ d d [ : R * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * } | + + + U.U.U.U.U.U.^.+ + + + + + + + + + ^.U.^.+ + + + d d [ :&2&3&) ~ ! ) ! ! ) ! ! ! ~ ! ! ! ) ~ ! ~ ~ ! ) ) ! ) ! ) ! ~ w+: * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R { v - s e + + U.+ + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * R * * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + U.a.b.c.& * { < + + + + + + j$!$k$l$a#m$n$o$C R@p$q$C r$A s$t$+ + U.d 8 8 e.: R * * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * { y + + + + + + + + + ^.U.U.U.U.U.U.^.+ + + + + ^.U.U.+ + + + [ :&< >%d e + d e e + e e d e e e + d + e + e e d d e + e + e + [ : * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R { < U.+ + + + U.+ + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * R * * * & M , O + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + U.# $ % & * { < + + + + + + + y$z$A$A B$C$B C :@T D$C E$&@F$Q.+ + U.d 8 8 e.: f.f.* & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ > , > & * { < U.+ + + + + + + + + + + + + + + ^.U.U.U.U.U.U.+ + U.U.+ + [ :&< >%d + + + + + + + + e + + + + + + + + + + + + + + + + d d [ : * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R { < U.+ + + + U.+ + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * f.f.* * * & , t , + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + Z%s t s & * { < + + + + + + + + N$A O$P$T Q$C R$T S$T$U$V$W$+ + + U.+ d d [ : * R * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ , t , & * { !%4&4& % % % % % % % % % % % % % % % % % % % % %Z%Z%Z%Z%b 5&O.:&#.N N d + + + + + + + + + + + + + + + + + + + + + + + d N N e.: * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R { v - s e + + ^.^.+ + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * R * * * * & M , O + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + Z%s t s & * { < + + + + + + + + + %%&%O$T *%=%-%T A ;%+ + + + + ^.^.+ + + [ : * R * & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ > , > & * { 8%]%<&]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%6&7&N N b >%U.^.+ + + + + + Q.T#S#U#V#+ + + + + + + + + + d N b e.: * * * * 8&+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.9&0&+.+.+.+.+.+.8&* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R { #.K%t d + + + U.+ + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * R * * * * & `$ % % % % % % % % % % % % % % % % % % % % % % % % % % % %`$& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + + Z%# $ % & * { < + + + + + + + + + + + :%<%[%}%|%1%2%3%+ + + + + U.+ + d d [ : * * R & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * { m%a%~&{&a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%o%:&G$U.- + + ^.U.U.U.U.a&b&^$/$($_$A 5 + + + + + + + + + + d d &: * * * 8&c&) ) ) ) ) ) ) ) ) ) 4.) ) ) ) ) ) ) ) ) ) d&e&) ) ) ) ) f&^&* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R { v - s e + + + U.+ + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * R * * * * & {%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%{%& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + U.@ a.b.c.& * { < + + + + + + + + + + + + + + + + + + + + + + + + U.+ d 8 8 e.: * * R & P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ a.b.c.& * * E%~+r%g&r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%H%{ < + + U.U.^.+ + + 1 2 3 h&i&j&k&l&m&n&a + + + + + + + + + + [ i.* * * & o&H.H.H.H.H.H.H.H.H.K.I.H.L.K.L.H.K.L.H.H.H.H.p&q&H.H.H.H.H.& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.{ < U.+ + + + + U.+ + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * R * * * * * & b.a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%b.& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + U.@ # $ % & * { < + + + + + + + + + + + + + + + + + + + + + + + + U.+ d 8 8 e.: * * f.O.P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ > , > & * * * R%I%I%S%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%* { < d d + + ^.U.^.z A B C D E F G u$I r&s&t&U.U.U.U.^.+ + d d [ : R * * & u&~+~+~+~+~+~+~+~+~+]+{+{+]+]+~+]+M ~+]+~+~+~+~+g%~+~+~+~+~+& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * { < U.+ + + + + ^.^.+ + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * R * * * * * p%q%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%s%J%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + U.@ s t s & * { < + + + + + + + + + + + + + + + + + + + + + + + + U.+ + d d [ : * * * v$P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ , t , & * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * { #.8 8 d + + + v&#&#&*.=.w&&&}@x&;.K$!.~.{.+ + + + ^.U.>%K%x#G@i.* R f.& ' ) ) ) ) ) ) ) ) ~ ! ! ! ! ! ) ! ; ) ! ) ) ) ) ) y&) ) ) ) & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * { v x#s e + + + + U.+ + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * R * * * * * * p%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%J%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + + + + + + + U.@ s t s & * { < + + + + + + + + + + + + + + + + + + + + + + + ^.^.+ + + + [ : * * * 2$P.9.0.. + + + + + + + + + + + + + + + + + + + + + + @ > , > & * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * { #.8 8 d + + + j.k.l.- z&C@C A&C C C t.u.v.+ + + + + + d 8 8 e.: R R R B&w.U.^.+ + + + + + e + + e e e + e d d + + + + + + + U.+ + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * { #.K%t d + + + + U.+ + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + Q.R.S.+ T.+ + + + + + + + + U.@ # $ % & * { < + + + + + + + + + + + + + + + + + + + + + + + U.+ + + d d [ : * * * 7.8.9.0.. + + + + + + C&D&E&!$F&G&H&V.+ + + + + + + + @ a.b.c.& * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * { < d d + + + + @+#+A.C C - I&J&K&C C@C *++ + + + + + + + d d [ : * * * 7.L&d ^+U.U.U.U.U.U.^.+ + + + + + + e + + + + + + + + + >%d c & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * { v x#s e + + + + U.+ + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + /+(+_+h :+<+l+m++ + + + + + + U.@ a.b.c.& * { < + + + + + + + + + + + + + + + + + + + + + + + U.+ + d 8 8 e.: * * * & M&9.0.. + + + + + + |%N&O&P&Q&R&L@S&T&+ + + + + + + @ a.b.c.& * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + 0+a+b+c+4%U&U&J&I&w V&<.k++ + + + + + + + + + [ : * * * & - b w + + + + + + ^.U.U.U.U.U.U.+ + + + + + + + + + + - b w & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * { !%Z% % % % % % %4&4& % % % % % % % % % % % % % % % % % % % %w+: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + .@1 +@@@#@$@%@&@*@E+ ++ + + + + U.+ @ # $ % & * { < + + + + + + + + + + + + + + + + + + + + + + + U.+ + d 8 8 e.: * * * & <&9.0.. + + + + W&X&Y&Z&`& *.*+*%@@*#*+ + + + + + + @ > , > & * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + S+T A T+$*U&U&U&U&J&%*&*`+ @+ + + + + + + + + [ : * * * & w b w + + + + + + + + Q.R.S.+ T.U.U.U.U.U.U.^.+ + + + w b w & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * { 8%<&]%]%]%]%]%]%]%<&]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%q%: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + f g h i j k l m n o p q r + + + + U.+ @ s t s & * { < + + + + + + + + + + + + + + + + + + + + + + + U.+ + + d d [ : * * * & P.g%0.. + + + ***.8#=*8@-*;*C >*,*'*)*6#+ + + + + + @ , t , & * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + 6@A 7@%@8@W C C h$;.C C !*~*g@+ + + + + + + + [ : * * * & c d e + + + + + + + /+(+_+h :+<+l+m++ + + + ^.U.U.U.U.>%- {*& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * { m%n%a%a%a%a%a%a%a%n%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%o%: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + S T T U I ]*C B.p#;.` ...+ + + + U.+ @ s t s & * { < + + + + + + + + + + + + + + + + + + + + + + + U.+ + + + + [ : * * * & P.^*0.. + + + #/*(*a#_*:*A&<*[*A&}*I#Y.+ + + + + + @ > , > & * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + I@J@K@C L@M@P%C C C Q%Q@R@S@#&|*^.+ + + + + + [ : * * * & u + + + + + + + .@1 +@@@#@$@%@&@*@E+ ++ + + + + + + + + + 1*Q R R R R R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * E%g&r%r%r%r%r%r%r%g&r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%H%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"2*3*3*4*5*6*7*8*9*0*0*0*0*0*a*b*c*3*3*3*3*d*3*e*f*g*h*i*j*k*l*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*3*m*m*n*o*j*j*j*i*p*q*r*2*3*3*s*t*u*v*v*w*x*x*w*x*x*y*z*A*3*3*3*3*3*3*e*B*C*C*i*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*k*l*3*3*3*3*3*3*E*F*G*H*I*J*K*L*v*M*N*O*v*P*Q*R*S*d*d*3*3*3*3*n*o*j*j*j*i*T*m*U*3*3*3*3*4*V*W*X*Y*Z*`* =.=+=@=#=$=3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*D*D*D*D*D*D*&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j**===============-=;=======================================j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=,=>=>=>=>=>=>=>=>=>=j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*'=)=!=v*v*w*x*x*w*x*x*0*~=3*3*3*3*3*d*3*e*B*C*C*i*j*k*l*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*m*{={=]=o*j*j*j*i*p*^=/=2*3*3*(=_=:=<=Y*w*x*x*w*x*x*0*[=3*3*3*3*3*3*3*e*B*C*C*i*j*j*j*j*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*k*l*3*3*3*3*3*3*3*}=R*|=1=2=|=3=v*4=|=5=v*6=7=8=3*3*3*d*d*3*3*n*o*j*j*j*i*9=0=9=3*3*3*3*a=|=|=b=c=d=e=f=g=h=i=j=k=3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*&=D*D*D*D*D*D*&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*D*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*l=%=%=%=%=%=%=%=%=%=%=m=%=%=%=%=%=%=%=%=/=%=%=%=%=%=%=%=%=%=n=D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*o=|=p=q=r=w*x*x*w*x*x*0*s=3*3*3*3*3*d*3*e*f*g*h*i*j*k*l*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*m*{={=]=o*j*j*j*i*p*^=t=2*3*3*u=|=v=|={=w*x*x*w*x*x*0*w=x=3*3*3*3*3*3*e*y=z=y=i*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*k*l*3*3*3*3*3*3*3*3*}=A=B=C=|=D=E=F=|=A=G=3*3*3*3*3*3*3*3*d*d*H=o*j*j*j*i*9=0=9=3*3*3*4*5*6*7*8*Y*v*v*I=J=K=L=b*c*3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=D*D*D*D*D*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*D*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*k*2*M=M=M=M=M=M=M=M=M=M=N=O=O=P=O=O=O=O=Q=M=M=M=M=M=M=M=M=M=M=R=o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*S=|=|=W*T=w*x*x*w*x*x*0*U=V=4*3*3*d*3*3*e*9=0=9=i*j*k*W=e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*e*X=e*e*e*e*Y=Y=Z=o*j*j*j*i*p*^=`= -3*3*.-|=+-@-#-w*w*w*w*w*w*0*P*R*$-3*3*3*3*3*e*z=0=z=i*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*k*l*3*3*3*3*3*3*3*3*3*3*3*%-&-|=*-=-|=--;-3*3*3*3*3*3*3*3*3*3*>-,-&=j*j*i*T*m*U*3*3*3*'=)=!=v*v*'-)-!-~-{-v*v*~=3*3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*D*D*D*D*D*&=j*j*j*j*j*j*j*D*j*j*j*j*D*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*k*]-^-^-^-^-^-^-^-^-^-/-/-(-(-^-(-(-(-/-_-^-^-^-^-^-^-^-^-^-^-:-o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*<-R*[-}-v*|-1-w*w*w*2-3-4-R*%-E*3*d*3*3*e*9=0=9=i*j*k*5-B*B*B*B*6-7-3-3-3-3-3-3-3-3-3-3-3-3-3-7-6-B*8-B*B*B*B*9-3-0-o*j*j*j*i*p*a-b-3-3-3-3-3-3-3-c-d-e-v*v*v*v*v*f-g-v=h-i-j-3-3-3-3-3-3-3-3-3-3-3-3-3-3-k-l-j*j*m-3-n-&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*l-o-p-3*3*3*3*3*3*3*3*3*3*3*3*q-3*3*r-s-3*t-u-u-3*3*3*3*3*3*3*3*n*o*&=D*D*i*v-3-w-3*3*3*x-y-3-3-3-3-3-3-3-3-3-3-3-3-3-3-z-t-3*3*A-z-3-3-3-3-3-3-3-3-3-3-3-B-C-j*j*m-3-k-j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=D*D*D-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-B-m-j*j*j*j*E-3-3-3-3-3-3-3-3-3-3-3-3-3-3-F-E-l-j*j*j*j*j*j*j*k*G-%=%=%=%=%=%=%=%=%=H-I-J-K-%=L-3-M-N-O-%=%=%=%=%=%=%=%=%=%=P-Q-F-k-j*j*m-3-k-j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*m-k-3-3-3-3-3-3-3-3-3-3-3-3-3-3-k-l-j*j*j*m-B-3-3-3-3-3-3-3-B-E-j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*V*R-S-9=T-U-v*v*v*V-3-3-W-R*X-Y-d*3*3*e*f*g*h*i*j*k*Z-C*C*C*`-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3- ;.;C*C*C*C*7-3-3-+;j*j*j*i*@;3-3-3-3-3-3-3-3-3-3-3-#;$;#-v*%;&;v**;=;-;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-F-j*j*k-3-3-;;j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*E-3-3-w-3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*A-3-3-t-3*3*3*3*3*3*3*n*o*j*j*j*>;3-3-3-3*3*A-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-u-3*3*3-3-3-3-3-3-3-3-3-3-3-3-3-3-k-j*j*k-3-3-k-j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*,;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-C-j*j*,;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-F-j*j*j*j*j*j*j*k*l*3*3*3*3*3*3*3*3*t-';3-3-);3*!;3-~;{;U*3*3*3*3*3*3*3*3*3*q*H=];3-3-l-j*k-3-3-m-j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*l-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-F-j*j*m-3-3-3-3-3-3-3-3-3-3-3-E-j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*^;/;(;N*_;:;<;C [;3-3-3-};|;|=V=d*3*3*e*B*C*C*i*j*1;]-C*2;3;4;3-3-3-5;6;6;6;6;6;6;6;6;7;8;3-3-3-9;C*C*0;C a;3-3-3-b;j*j*c;d;e;3-3-3-3-5;6;f;3-3-3-3-g;h;i;j;k;l;S-m;n;e;3-3-3-3-6;6;6;6;6;6;6;6;6;o;3-3-3-3-p;q;k-3-3-C-D*j*j*j*j*j*j*j*j*j*j*j*j*j*r;s;q;k-3-3-3-i-3*3*3*3*3*3*3*3*3*3*3*3*3*t;u;u;j-3-3-A-3*3*3*3*3*3*3*n*o*j*q;C v;3-3-3-w;x;5;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-y;C e;3-3-3-3-3-3-3-3-3-3-3-3-k-z;C q;k-3-3-3-k-m-j*j*j*j*j*j*j*j*j*j*j*j*j*A;C 6;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-B;C 6;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-m-j*j*j*j*j*j*k*l*m*m*3*3*3*3*t;C;D;3-3-3-E;F;j-3-3-3*3*3*3*3*3*3*3*3*3*G;H;I;J;3-3-E;q;k-3-3-C-j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*c;q;e;3-3-3-3-6;6;6;6;6;6;6;6;6;o;3-3-3-3-K;L;e;3-3-3-3-5;6;M;3-3-3-3-F-j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*N;O;|=|=P;Q;R;C C 3-3-3-3-3-S;T;U;j-j-V;W;X;Y;Z;k-k-`; >C C 3-3-3-.>C C C C C C C C C C +>@>3-3-3-#>#>$>C C 3-3-3-C-j*c;C C 6;3-3-3-p;C C C +>%>3-3-3-&> =S-*>R*=>C C 6;3-3-3-p;C C C C C C C C C C ->3-3-3-E;C ;>3-3-C-D*j*j*j*j*j*j*j*j*j*j*j*j*j*A;C C >>3-3-3-3-u-j-j-j-j-j-j-j-j-j-j-j-j-,>C C '>3-3-w-3*3*3*3*3*3*3*n*o*c;C C E;3-3-3-C C 3-3-3-4;E;C C +>.>3-3-3-3-3-3-3-3-3-3-C C C C +>E;.>3-3-3-3-4;p;q;j*j*q;C C )>3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-F-,;!>C C 6;3-3-3-3-3-3-3-3-3-5;E;5;3-3-3-3-6;p;C C C C C p;~>3-3-3-E;C 6;3-3-3-3-3-3-3-3-3-4;E;C C p;{>3-3-3-C-j*j*l-k-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-E;u;j-3-3-3*3*3*3*3*3*3*3*3*m*]>C C ^>3-3-E;C ;>3-3-C-j*j*j*j*j*j*j*j*j*j*j*j*j*j*r;C C 6;3-3-3-p;C C C C C C C C C C ->3-3-3-E;C 6;3-3-3-p;C C C +>/>3-3-3-j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*4*(>_;_>:>C C C <>3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-->C C 3-3-3-q;q;q;q;q;q;q;q;s;C C C [>3-3-3-j*j*C C C 3-3-3-C-j*A;C C 6;3-3-}>|>C C C C C;3-3-3-1>2>3>4>|=5>C C 6;3-3-}>x;6>7>8>7>9>q;L;C C C C 3-3-3-E;C 0>3-3-C-j*D*j*j*j*j*j*j*j*j*j*j*j*j*q;C C E;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-D;C C a>3-3-b>c>c>c>c>c>c>c>d>o*e>C C E;3-3-3-C C 3-3-3-+>C C C C C E;3-3-3-3-3-3-3-3-3-C C C C C C C .>3-3-3-.>q;e>j*j*q;C C 6;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-f>C C 6;3-3-3-3-3-3-3-3-6;C C +>3-3-3-5;C C C C C C C C +>3-3-3-E;C 6;3-3-3-3-3-3-3-3-6;C C C C C C g>3-3-C-j*l-F-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-E;C h>3-3-3*3*3*3*3*3*3*3*3*m*i>C C j>3-3-E;C 0>3-3-C-j*j*j*j*j*j*j*j*j*j*j*j*j*j*A;C C 6;3-3-)>q;q;q;q;q;q;q;L;C C C C 3-3-3-E;C 6;3-3-)>q;C C C C [>3-3-3-l-j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*k>l>C C C +>e;m>3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-4;C C 3-3-3-l-j*j*j*j*j*j*j*r;L;C C .>3-3-3-j*j*C C p;3-3-3-,;j*q;C C 6;3-3-n>3*o>u;C C .>3-3-3-p>q>r>s>t>u>C C 6;3-3-u-3*e*y=z=y=i*j*j*A;C C p;3-3-3-E;C 0>3-3-,;j*&=&=j*j*j*j*j*j*j*j*j*j*j*q;C C C .>v>3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-p;C w>3-3-3-x>y>y>y>y>y>y>z>o*e>C C .>3-3-3-C C 3-3-A>B>C>D>C C C C E;5;3-3-3-3-3-3-3-3*t;E>F>C C C C 3-3-3-C-j*j*j*j*q;C C 6;3-3-3-3-3-3-3-3-3-3-3-6;{>G>3-3-3-3-C C 6;3-3-3-3-3-3-3-0>L;C C C 3-3-3-,;j*j*j*j*c;H>C C C 0>3-3-E;C 6;3-3-3-3-3-5;I>J>j*j*c;q;C C C J>3-3-K>q;e;3-3-3-3-5;6;6;3-3-3-3-3-3-3-3-3-3-3-E;C L>3-3-3*3*3*3*3*3*3*3*3*3*M>C C N>3-3-E;C 0>3-3-,;j*j*j*j*j*j*j*j*j*j*j*j*j*j*q;C C 6;3-3-B-j*j*j*j*j*j*j*j*A;C C p;3-3-3-E;C 6;3-3-B-j*r;L;C C .>3-3-3-,;j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*q-x;C C C C C C C C C C E;4;3-3-3-3-3-3-3-3-3-C C 3-3-3-F-C-j*j*j*j*j*j*j*e>C p;4;3-3-3-j*j*C +>4;3-3-3-3-C-q;C C O>3-3-3-w-d*E>C p;4;3-3-3-3-P>A-3*3*x;C C }>3-3-3-u-Q>9-R>R>S>C-C-C-E;e;3-3-3-3-E;C 0>3-3-3-E-C-D*j*j*j*j*j*j*j*j*j*j*j*e>C C C C C C C C C C +>5;3-3-3-3-3-3-3-3-3-E;C T>3-3-3-U>V>M=M=M=M=M=W=o*e>+>.>3-3-3-3-C C 3-3-j-4*(>W>X>C C C C C C C p;4;3-3-3-3*3*3*3*F>C C C 3-3-3-F-l-j*j*j*q;C C 6;3-3-3-3-3-3-3-3-3-6;C C C C Y>3-3-3-E;C 6;3-3-3-e;E;Z>j*j*r;C C C 3-3-3-C-j*j*j*j*j*`>C C C 0>3-3-E;C 6;3-3-3-E;C q;&=D*D*D*D*D*H>C C ,3-3-[>C 6;3-3-3-+>C C C C 6;3-3-3-3-3-3-3-3-3-E;C .,3-3-+,@,3*3*3*3*3*3*3*3*x;+>6;3-3-3-E;C 0>3-3-3-E-C-j*j*j*j*j*j*j*j*j*j*j*j*q;C C )>3-3-3-B-C-C-C-C-C-C-C-C-E;e;3-3-3-3-E;C )>3-3-3-,;j*e>C p;4;3-3-3-3-E-C-j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*t;F;y;C C C C C C C C C .>3-3-3-3-3-3-3-3-3-C C 3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-B-j*c;+>4;3-3-3-3-3-3-)>C C #,3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-$,C C %,3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-E;C >>3-3-3-3-3-3-&,E-j*j*j*j*j*j*j*j*j*j*!>L;C C C C C C C C C +>3-3-3-3-3-3-3-3-3-E;C E;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-C u;3-3-j-3*3*3*k>*,=,C C C C C C +>3-3-3-3*3*3*3*3*C C C 3-3-3-3-3-3-B-k--,C C 6;3-3-3-3-3-3-3-3-;,q;s;C C C C B-3-3-E;C 6;3-3-e;C q;j*j*j*j*C C C 3-3-3-C-j*j*j*j*j*D*q;C C 0>3-3-E;C 6;3-3-M;q;!>j*j*j*j*j*j*j*!>C C >,3-3-E;C 6;3-3-)>q;C C C C p;3-3-3-3-3-3-3-3-3-E;C ,,3-3-',),4*3*3*3*3*t-j-z-3-3-3-3-3-3-E;C >>3-3-3-3-3-3-F-E-j*j*j*j*j*j*j*j*j*q;C C M;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-E;C M;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-E-j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*E>!,C C E;3-3-3-3-3-3-3-3-3-C C 3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-C-r;s;5;3-3-3-3-3-3-3-3-+>C 6;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-p;C 6;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-E;C 6;3-3-3-3-3-3-3-3-F-l-j*j*j*j*j*j*j*j*j*j*j*j*j*~,=={,],C C C 3-3-3-3-3-3-3-3-3-E;C +>^,3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-C x;3-3-j-3*3*3*3*q-3*3*d*/,y;C C C j-3-3-3*3*3*3*3*C C C 3-3-3-3-3-3-3-3-3-+>C 6;3-3-3-3-3-3-3-C-j*j*j*!>C C C 0>3-3-E;C 6;3-3-z;D*j*j*j*j*j*C C C 3-3-3-C-j*j*j*j*j*&=(,C C 0>3-3-E;C 6;3-3-B-j*j*j*j*j*j*j*j*j*e>C C _,3-3-E;C 6;3-3-:,D*<,[,C C E;3-3-3-3-3-3-3-3-3-E;C },3-3-|,+-1,3*3*3*3*u-3-3-3-3-3-3-3-3-E;C 6;3-3-3-3-3-3-3-3-F-l-j*j*j*j*j*j*j*q;C C 6;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-E;C 6;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-m-j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*2,C p;4;3-3-3-3-3-3-3-3-3-C C 3-3-3-3-3-3-3-3-3-3-3-5;6;6;6;M;E-;;r;s;C 3-3-3-3-3-3-3-3-3-E;C 6;3-3-3-3-3-3-3-3-3-3-4;6;6;3-3-3-3-3-E;C 6;3-3-3-4;.>E;.>5;3-3-3-3-3-3-3-3-3-3-E;C 6;3-3-3-3-3-3-3-3-3-F-C-j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*r;C +>6;3-3-3-3-3-3-3-3-3-E;C C +>.>6;6;6;6;6;5;3-3-3-3-3-3-3-3-3-3-3-C x;3-3-j-3*3*3*3*3*3*3*3*3*o>C C C j-3-3-3*3*3*3*3*C C C 3-3-3-3-3-3-3-3-3-E;C 6;3-3-3-e;+>A;j*j*j*j*j*j*L;C C 0>3-3-E;C 3,3-3-C-D*j*j*j*j*j*C C C 3-3-3-C-j*j*j*j*j*j*4,C C 0>3-3-E;C )>3-3-3-,;l-j*j*j*j*j*j*j*!>+>6;3-3-3-E;C )>3-3-3-,;5,6,C E;4;3-3-3-3-3-3-3-3-3-E;C 7,3-3-8,9,0,3*t;a,b,3-3-3-3-3-3-3-3-3-E;C 6;3-3-3-3-3-3-3-3-3-F-C-j*j*j*j*j*j*q;C C 6;3-3-3-4;.>E;.>5;3-3-3-3-3-3-3-3-3-3-E;C 6;3-3-3-3-3-3-3-3-3-3-4;6;6;3-3-3-3-3-C-j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*P>3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-C C 3-3-3-3-3-3-3-3-3-4;+>C C C C e>j*D*L;C C 3-3-3-3-3-3-3-3-3-p;C 6;3-3-3-3-3-3-3-3-3-E;C C C C .>3-3-3-E;C 6;3-3-4;+>C C C C 6;3-3-3-3-3-3-3-3-3-E;C 6;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-E-j*j*C-F-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-[>C C C C C C C C C C p;3-3-3-3-3-3-3-3-3-3-C x;3-3-j-3*3*3*3*3*3*3*3*3*3*x;C C c,3-3-3*3*3*3*3*C C C 3-3-3-3-3-3-3-3-3-E;C 6;3-3-6;C e>j*j*j*j*j*j*j*q;C C ,3-3-E;C 0>3-3-C-D*j*j*j*j*j*C C C d,3-3-C-j*j*j*j*j*j*4,C C 0>3-3-E;C e,3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-p;C f,3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-E;C g,3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-E;C 6;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-;,C C 6;3-3-4;+>C C C C 6;3-3-3-3-3-3-3-3-3-E;C 6;3-3-3-3-3-3-3-3-3-E;C C C C .>3-3-3-C-j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-5;C C e;3-3-3-3-3-3-3-h,i,q;q;q;A;c;j*j*D*C C C e;3-3-3-3-3-3-3-o;C C E;3-3-3-3-3-3-3-3-j,x;C C C C C k,3-3-+>C e;3-3-l,F>m,C C C C 6;3-3-3-3-3-3-3-n,C C E;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3->=>=o,3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-p,q,r,q;q;q;q;L;C C C C E;3-3-3-3-3-3-3-3-e;C x;u-3-P>3*3*3*3*3*3*3*3*3*3*x;C C s,3-3-3*3*3*3*3*C C C 5;3-3-3-3-3-3-3-3-C C e;3-t,u,v,v,v,v,v,v,v,v,v,w,C C x,3-3-p;C x,3-3-y,D*j*j*j*j*j*C C C J>3-3-l-j*j*j*j*j*j*4,C C ,3-3-p;C p;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-)>C C C >>3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-z,C C A,B,3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-+>C E;3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-3-C C e;3-3- ,!>L;C C C C 6;3-3-3-3-3-3-3-n,C C E;3-3-3-3-3-3-3-3--,q;C C C C C 0>3-3-l-j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*F;C C .>6;6;6;6;6;6;6;6;6;6;6;6;6;6;6;k-E-+>C C C e;6;6;6;6;{>C,l-j*j*j*j*j*j*j*D*j*C C C C e;6;6;6;6;;>k-i,C C C E;6;6;6;6;6;D,E,3*3*3*F>C C C E>P>$,C C F,'>A-3*3*e*G,C C C C .>6;6;6;6;0>E-i,C C C E;6;6;6;6;6;6;6;6;6;6;6;6;6;H,v-v-I,J,C p;6;6;6;6;6;6;6;6;6;6;6;6;6;6;6;K,v-L,%=%=z>M,j*j*j*j*c;C C C C p;6;6;6;6;6;j-N,C C O,P,b>P,c>c>c>c>c>c>c>c>c>c>O,C C P,b>Q,R,R,c>c>c>C C C +>e;6;6;6;6;S,T,U,C C V,W,X,p*p*p*p*p*p*p*Y,p*p*Z,C C Z,`, 'C C Z,`,X,r*.'j*j*j*j*j*+'C C e>C-l-j*j*j*j*j*j*j*(,C C e>E-@'C C C p;e;6;6;6;6;6;6;6;6;6;6;6;6;6;;>C-c;C C C C p;6;6;6;6;6;6;6;6;6;6;6;6;6;#'$'%'C C C C E;6;6;6;6;6;6;6;6;6;6;6;6;6;j>k-Z>C C C E;6;6;6;6;6;6;6;6;6;6;6;6;6;3,k-k--,C C &'*'C-j*j*j*q;C C C C .>6;6;6;6;0>E-i,C C C E;6;6;6;6;6;0>C-j*j*j*!>C C C e>E-E-j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*C C C C C C C C C C C C C C C C C C L;j*j*A;C C C C C C C s;r;j*j*j*j*j*j*j*j*j*D*j*A;C C C C C C C L;j*j*e>C C C C C C C C E>3*d*3*3*3*3*x;C C t;3*F;C C E>3*3*3*3*e*y=7>C C C C C C C s;j*j*e>C C C C C C C C C C C C C C C C C C M=M=='C C C C C C C C C C C C C C C C C C -'M=M=M=M=M=i*j*j*j*j*j*e>C C C C C C C C ;'c>y>>'C ,'y>y>y>y>y>y>y>y>y>y>y>y>y>,'C C y>y>y>y>y>'''')'m,C C C C C C C C ^=^=!'C ~'{'U*y=(-U*]'^=]']']']'U*(-^'C C /'U*('C C _'^=^=:'o*j*j*j*j*j*<'C C r;j*j*j*j*j*j*j*j*j*e>C C c;j*c;C C C C C C C C C C C C C C C C C q;j*j*j*q;C C C C C C C C C C C C C C C C ['}'|'1'2'C C C C C C C C C C C C C C C C C 3'j*e>C C C C C C C C C C C C C C C C C C j*j*A;C C e>j*j*j*j*j*j*q;C C C C C C C s;j*j*e>C C C C C C C C e>j*j*j*j*j*j*q;C C r;j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*F>x;x;x;x;x;x;x;4'x;x;x;x;6>5'8>5';'r;j*j*j*A;q;q;q;q;q;A;r;j*j*j*j*j*j*j*j*j*j*D*j*j*A;q;q;q;q;q;q;r;j*j*j*e>9>6'7'8'7'x;E>3*3*d*3*3*3*3*3*F;F;3*3*t;x;E>3*3*3*3*3*e*z=0=9'9>q;q;q;q;A;r;j*j*j*e>q;q;q;q;q;q;q;q;q;q;q;q;4,9>0'a'b'^-^-c'a'd'e'd'f'a'e'e'e'e'a'e'a'f'f'e'd'c'^-^-^-^-^-^-i*j*j*j*j*j*j*c;q;q;q;q;q;q;!>i*C*M=-'='-'M=M=M=M=M=M=M=M=M=M=M=M=M=-'='g'M=M=M=M=M=M=M=h'i'j'q;q;q;q;q;k'l'm'm'n'8'o'm'm'p'm'p'p'p'm'K-O-p'p'm'p'q'r'p'p'O-s't'm'm'm'u'o*j*j*j*j*j*D*e>r;j*j*j*j*j*j*j*j*j*j*j*v'!>j*j*j*c;A;q;q;q;q;q;q;q;q;q;q;q;q;q;q;e>j*j*j*j*j*c;q;q;q;q;q;k'w'x'x'M>x;4'x;y'z'A'v*B'3=S-[;C'C'D'C'E'F'z'G'x;x;x;x;x;x;x;H'o*j*j*e>q;q;q;q;q;q;q;q;q;q;q;q;q;q;q;q;e>j*j*r;q;e>j*j*j*j*j*j*j*j*!>q;q;q;q;q;A;r;j*j*j*e>q;q;q;q;q;q;e>j*j*j*j*j*j*j*j*A;A;j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*3*e*9=0=9=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*p*^=m'2*3*3*3*3*q*q*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*e*y=z=y=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*I'W=%=%=%=%=%=%=O-%=O-K-%=O-O-O-O-%=O-%=O-J'O-%=%=%=%=%=%=%=%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*1;z>K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'L'-=D*D*j*j*j*k*]-2*2*2*2*K-O-M']'2*]'2*]'2*]']']'N'O-]']']']'N'O-N'2*2*2*2*u'o*j*j*j*j*j*D*j*j*j*j*j*j*j*O'v,v,v,v,v,P'v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,M,j*j*j*j*j*j*j*j*k*l*m*m*3*3*d*3*E*F*G*H*Q'J*K*L*v*M*N*O*v*P*Q*R*}=3*3*3*3*3*3*n*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*3*e*f*g*h*i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*p*^=m'2*3*3*3*3*3*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*e*B*C*C*i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*R'S'3*3*3*3*3*3*U*m*3*m*m*3*U*U*U*U*U*U*U*U*U*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*1;========================================================T'j*j*j*D*D*&=k*l*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*m*3*3*3*3*3*3*3*3*3*P-o*j*j*j*j*j*D*j*j*j*j*j*j*1;i*p*p*p*p*U'V'W'p*p*p*p*p*p*p*p*Y,p*p*p*p*p*p*p*p*p*p*p*p*p*l*M,j*j*j*j*j*j*j*k*l*3*3*3*3*d*3*3*}=R*Q'1=2=|=3=v*4=|=5=v*6=7=8=3*3*3*3*3*3*3*n*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*3*3*e*B*C*C*i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*p*^=m'2*3*3*3*3*3*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*e*B*C*C*i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*X'm*U*3*3*3*3*3*3*3*U*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*U*m*T*i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=<,Y'Z'Z'U*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*U*9=9=P-o*j*j*j*j*j*D*j*j*j*j*j*j*k*`'^=^=^=^=y=Y=:'y=(-U*]'^=]']']']'U*(-]']']']'U*(-U*^=^=^=^=G-o*j*j*j*j*j*j*j*k*l*3*3*3*3*3*d*3*3*}= )B=C=|=D=E=F=|=A=G=3*3*3*3*3*3*3*3*3*3*n*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*3*3*e*f*g*h*i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*p*^=m'2*3*3*3*3*3*3*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*e*y=z=y=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*Z'.)Z'3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*Z'.)Z'i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*k*+).).)m*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*m*0=0=P-o*j*j*j*j*j*D*j*j*j*j*j*j*k*d>m'm'm'm'p'm'u'p'm'p'p'p'm'K-O-p'p'm'p'p'm'p'p'O-T*m'm'm'm'Z=o*j*j*j*j*j*j*j*k*l*3*3*3*3*3*d*3*3*d*3*3*%-&-|=*-=-|=--;-3*3*3*3*3*3*3*3*3*3*n*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*3*3*e*9=0=9=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*p*^=m'2*3*3*3*3*3*3*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*e*z=0=z=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*Z'.)Z'3*3*3*3*3*3*3*3*s-@)#)3*$)3*3*3*3*3*3*3*3*3*3*3*Z'.)%)i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*k*&)Z'Z'U*3*3*3*3*3*3**)=)-);)>),)')^;3*3*3*3*3*3*3*3*3*U*9=))!)o*j*j*j*j*j*D*j*j*j*j*j*j*k*]-2*2*2*2*K-O-N-]'2*]'2*]'2*]']']'N'O-]']']']'N'O-N'2*2*2*2*Z=o*j*j*j*j*j*j*j*k*l*3*3*3*3*3*d*3*3*d*3*3*3*q-3*3*r-s-3*3*3*3*3*3*3*3*3*3*3*3*n*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*3*3*e*9=0=9=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*p*^=m'2*3*3*3*3*3*3*q*q*3*3*3*3*3*3*3*3*3*3*3*3*3*3*e*y=z=y=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*T*m*U*3*3*3*3*3*3*3*~){)])W*^)/)1=()3*3*3*3*3*3*3*3*3*U*m*T*I'D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*k*l*3*3*3*3*3*3*3*3*3*_)A=:)<)z=[)})|)x=3*3*3*3*3*3*3*3*3*3*d*n*o*j*j*j*j*j*D*j*j*j*j*j*j*k*l*3*3*3*3*3*3*q*q*3*3*3*3*3*3*3*3*3*3*3*m*3*3*3*3*3*3*3*3*3*n*o*j*j*j*j*j*j*j*k*l*3*3*3*3*3*3*d*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*n*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*3*3*e*f*g*h*i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*p*^=m'2*3*3*3*3*3*3*3*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*e*B*C*C*i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*3*3*3*3*1)2)3)4)5)6)}'7)%;8)')3*3*3*3*3*3*3*3*3*3*%=i*j*D*&=j*j*j*j*j*j*j*j*j*j*j*j*j*>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=j*j*j*j*j*j*k*l*3*3*3*3*3*3*3*@)=-9)#-0)a)b)*>c)d)e)2)3*3*3*3*3*3*3*3*3*d*n*o*j*j*j*j*j*D*j*j*j*j*j*j*k*&)Z'Z'U*3*3*3*3*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*U*Z'Z'!)o*j*j*j*j*j*j*j*k*l*3*3*3*3*3*3*d*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*n*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"2*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*3*3*3*e*B*C*C*i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*p*^=m'2*3*3*3*3*3*3*3*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*e*B*C*C*i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*3*3*3*4*V*W*X*Y*Z*`* =.=+=@=#=$=3*3*3*3*3*3*3*U*m*T*i*j*j*&=D*&=j*j*j*j*j*j*j*j*j*j*l=%=%=%=%=m=f)m=%=%=%=%=%=m=m=m=%=%=%=m=%=%=%=%=%=%=%=%=%=%=n=j*j*j*j*j*k*&)Z'Z'U*3*3*3*4*V=|=g-g)h)i)v*e=j)k)l)m)n)3*3*3*3*3*3*U*Z'_-o),-D*D*D*D*D*p)D*D*D*D*D*D*<,q).).)m*3*3*3*3*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*m*.).)]=o*j*j*j*j*j*j*j*k*l*3*3*3*3*3*3*d*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*n*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +". + + + + + + + + + + + + + + + ^.^.+ + + + + @ # $ % & * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + ^.^.+ + + + + + + + + + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + S T T U V W C@y%X@;.` ...+ + + + + + + w b w & * * * * f.R * * * * * * * * } r)s)s)s)s)t)s)t)s)s)s)s)s)s)t)t)s)s)s)t)s)s)s)s)s)s)s)s)s)s)u)i.R R R R g.d.b b >%U.U.U.v)#&w)x)z&y)- - - - - z)A)B)U.U.U.U.U.U.>%b b $.: * * * * * R * * * * * * { v w w e + + + + U.+ V.W.X.Y.Z.`. +.++ + + + + + + + + e - w x : * * * * * * * { !% % % % % % %5&4& % % % % % % % % % % % % % % % % % % % % %w+: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + U.+ + + + + + @ s t s & * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + U.+ + + + + + + + + + + + + @ , t , & * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + f /.(._.:.j C C)D)E)X C 1.2.+ + + + + + + w b - Q R R R R R R R b R R R R R R F+] ~+~+~+~+]+~+]+{+]+{+]+{+]+]+]+~+]+]+]+~+]+~+]+M ~+~+~+~+~+[ : * * * * { d.- w e + + + -#;#W C C >#,#'#)#C C C !#+ + + + + + + e w w x : * * * * f.f.* * * * * * { < + + + + + + + ^.^.|+1+2+3+4+5+6+7+8++ + + + + + + + U.+ + [ : * * * * * * * { 8%]%]%]%]%]%<&]%<&]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%q%: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + U.+ + + + + + @ s t s & * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + U.+ + + + + + + + + + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + x.y.z.A.C B.F)G)w%C C@C G.+ + + + + + + + e d c & * * * * * * * * R R * * * * { v+) ) ) ) ! ) ! ~ ) ! ! ~ ! ! ! ! ) ! ! ) ! ) ! ! ) ) ) ) ) w+: * * * R g.< + + + + + + g#h#i#j#U+k#l#m#n#o#p#C q#+ + + + + + + + + + [ : * * * * R * * * * * * * { < + + + + + + + R.H)H+I+J+K+L+B M+N+O+P++ + + + + + U.+ + + [ : * * * * * * * { m%a%a%a%a%a%n%a%n%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%o%: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + U.+ + + + + + @ # $ % & * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + U.+ + + + + + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + =+T -+;+>+I)o#J)w%C /%C !++ + + + + + + + + + u & * * * * * * * * * * R f.* * { < + + + + e d e + d + e e e e e + d e e e e d + e + + + + + [ : * f.R * { < + + + + + + M#T@*.T N#O#C C C P#Q#X R#S#+ + + + + + + + + [ : * * * * R * * * * * * * { v s s e + + + f (@#&_@:@<@[@C }@|@1@2@3@4@+ + + + U.+ e s s x : * * * * * * * * E%~+r%r%r%g&r%r%g&r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%H%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + U.+ + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + U.+ + + + + + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + n+T T h o+C &&w%K)L)}@C s+t+u++ + + + + + e d c & * * * * * * * * * * * f.R f.{ < d d + + + + + + + + + + + + + + + + + + + + + + + + + d d [ {@R f.* * { < + + + + + + ;$T >$V ,$}@C C C '$C C )$!$~$+ + + + + + + + [ : * * * * R * * * * * * * { #.t t d + + + w@T M)y@z@A@B@}@C@C C D@E@F@+ + + U.+ + d t t e.: * * * * * * * * * R%I%I%I%S%I%I%I%S%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + + U.+ + + + + + @ # $ % & * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + ^.^.+ + + + + + + + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + =@*.-@;@C -.C N)w%O);.C )@*.!@~@+ + + + + s t s & * * * * * * * * * * * * * f.g.#.8 8 d + + + + + + + + + + + + + + + + + + + + + + + d N N G@u@* * * * { < + + + + + + 8$A 9$C 0$s C C B.C C C a$b$c$~@+ + + + + + + [ : * * * * R * * * * * * * { v s s e + + + -#;#P)w C >#,#'#)#C C C !#+ + + U.+ + + e s s x : * * * * * * * * * * * * R * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + ^.^.+ + + + + + @ s t s & * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + U.+ + + + + + + + + + + @ , t , & * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + h@i@j@k@l@m@C C C C %@C q@*.r@s@+ + + + s t s & * * * * * * * * * * * * * * { d.K%8 d + + + + + + + + Q.T#S#U#V#+ + + + + + + + + + d N N e.: * * * * { < + + + + + + j$!$k$l$a#m$n$o$C R@p$q$C r$A s$t$+ + + + + + [ : * * * * R * * * * * * * { < + + + + + + g#h#i#Q)U+k#l#m#n#o#p#C q#+ + U.+ + + + + + + [ : * * * * * * * * * * * * R * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + U.+ + + + + + + @ s t s & * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + U.+ + + + + + + + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + .+Y@Z@`@ #.#+#@#C x$$#C v@=.T %#+ + + + e d c & * * * * * * * * * * * * * * { < d U.^.+ + + + + + {$]$^$/$($_$A 5 + + + + + + + + + + d d [ : * * * * { < + + + + + + + y$z$A$A B$C$B C :@T D$C E$&@F$Q.+ + + + + + [ : * * * * R * * * * * * * { < + + + + + + M#T@*.#&N#O#C C C P#Q#X R#S#U.+ + + + + + + + [ : * * * * * * * * * * * R * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + U.+ + + + + + + @ # $ % & * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + ^.^.+ + + + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + 4#5#T T 6#7#8#9#v@0#a#R@b#c# .d#+ + + + + + u & * * * * * * * * * * * * * * { < + + ^.U.^.+ + + 1 2 3 4 5 6 7 8 9 0 a + + + + + + + + + + [ : * * * * { < + + + + + + + + N$A O$P$T Q$C R$T S$T$U$V$W$+ + + + + + + [ : * * * * R * * * * * * * { < + + + + + + ;$T >$R),$}@C C C '$C C )$S)~$+ + + + + + + + [ : * * * * * * * * * * * R * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + U.+ + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + U.+ + + + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + u+C# #D#E#F#G#H#L@T I#J#+ + + + + + + e d c & * * * * * * * * * * * * * * { < d d + + ^.U.+ z A B C D E F G H I J K L + + + + + + + + + [ : * * * * { < + + + + + + + + + %%&%O$T *%=%-%T A ;%+ + + + + + + + + + [ : * * * * R * * * * * * * { < + + + + + + 8$A 9$T)U)s C C B.C C C V)b$c$~@+ + + + + + + [ : * * * * * * * * * * R * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + U.+ + + + + + + @ # $ % & * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + U.+ + + + + + + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + + + + @$#$A $$%$T &$*$=$+ + + + + + + s t s & * * * * * * * * * * * * * * { #.8 8 d + + + W)X)T *.=.-.C C C C ).!.~.{.+ + + + + + + + + [ : * * * * { < + + + + + + + + + + + :%<%[%}%|%1%2%3%+ + + + + + + + + + [ : * * * * R * * * * * * * { < + + + + + + j$!$k$l$Y)m$n$o$C R@p$Z)w r$A s$t$+ + + + + + [ : * * * * * * * * * * R * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + + U.+ + + + + + + @ s t s & * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + U.+ + + + + + + + + @ , t , & * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + + + + + 5$+ + 6$F@+ + + + + + + + + + s t s & * * * * * * * * * * * * * * { #.8 8 d + + + j.k.`)x)n.C D% !X C C t.u.v.+ + + + + + + + + [ : * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * R * * * * * * * { < + + + + + + + y$z$A$#&B$C$B C :@K#%&C E$&@F$Q.+ + + + + + [ : * * * * * * * * * f.f.* * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + ^.^.+ + + + + + + @ s t s & * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + U.+ + + + + + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + e d c & * * * * * * * * * * * * * * { < d d + + + + @+#+A.C - .!+!@!w%C C C *++ + + + + + + + + + [ : * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * R * * * * * * * { < + + + + + + + + N$A #!P$T Q$C $!K#S$T$U$V$W$+ + + + + + + [ : * * * * * * * * * R * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + U.+ + + + + + + + @ # $ % & * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + ^.^.+ + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * { < + + + + + + 0+a+b+c+4%%!&!*!=!J$-!C k++ + + + + + + + + + [ : * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * R * * * * * * * { < + + + + + + + + + %%;!>!T *%,!'!T A ;%+ + + + + + + + + + [ : * * * * * * * * f.f.* * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + U.+ + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + + U.+ + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * { < d d + + + + S+T A T+U+X C )!!!~!{!C `+ @+ + + + + + + + + [ : * * * * { o%@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ _ : * * * * R * * * * * * * { < + + + + + + + + + + + ]!<%^!/!|%1%2%3%+ + + + + + + + + + [ : * * * * * * * * R * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + U.+ + + + + + + + @ # $ % & * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + + U.+ + + + + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * & `$ % % % % % % % % % % % % % % % % % % % % % % % % % % % %`$& * * * * * * * * * * * * * * { #.8 8 d + + + 6@A 7@%@8@W C C (!_!- C e@f@g@+ + + + + + + + [ : * * * * { $&a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.v+: * * * * R * * * * * * * { < + + + + + + + + + + + U.^.^.+ + + + + + + + + + + + + + + [ : * * * * * * * f.f.* * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + + U.+ + + + + + + + @ s t s & * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + + ^.^.+ + + + + + + @ , t , & * * * * * * * * * * * * * * * * * * * * * * * & {%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%{%& * * * * * * * * * * * * * * { #.8 8 d + + + I@J@K@C L@M@P%C C C %@:! , > & * * * * * * * * * * * * * * * * * * * * * * * & b.a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%b.& * * * * * * * * * * * * * * { < d d + + + + ~@~#{#]#A ^#/#(#C @#`@_#T)[!}![#}#+ + + + + + [ : * * * * p%] c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.]&^&* * * * R * * * * * * * { < + + + + + + + + + + ^.U.^.+ + + + + + + + + + + + + + + + [ : * * * * * * f.f.* * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + ^.^.+ + + + + + + + @ # $ % & * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + + + U.+ + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * p%q%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%s%J%* * * * * * * * * * * * * * { < + + + + + + + }#T@T r#s#T t#C j#T u#C v#|!1!^.+ + + + + + [ : * * * * * p%:&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&J%* * * * * R * * * * * * * { o%@ @ @ @ @ @ @ @ @ 2!3!@ 4!@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ _ : * * * * * * R * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + U.+ + + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + + + + U.+ + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * * p%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%J%* * * * * * * * * * * * * * * { < + + + + + + + + }#W#X#Y#T Z#i#`#T a# $+ + + ^.U.+ + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * { $&a.a.a.a.a.a.a.a.5!6!a.a.7!a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.v+: * * * * * f.f.* * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + U.+ + + + + + + + + @ # $ % & * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + + + + U.+ + + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + :$<$T [$}$T |$1$+ + + + + U.U.+ + + [ : * * * * * * 8&+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.8&* * * * * R * * * * * * * { N.b.b.b.b.b.b.b.8!9!b.b.b.0!b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.] : * * * * * R * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + U.+ + + + + + + + + @ s t s & * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + + + + ^.^.+ + + + + @ , t , & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + 5$+ + d$e$+ + + + + + + + + U.^.+ [ : * * * * * 8&c&) ) ) 4.5.5.) ) ) ) ) ) ) ) ) 4.) ) ) ) ) ) ) ) ) ) ) ) f&^&* * * * R * * * * * * * p%] c.c.c.c.c.c..&a!c.c.c.c.a!.&c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.]&^&* * * * f.f.* * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + U.+ + + + + + + + + @ s t s & * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + + + + + U.+ + + + + @ > , > & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + ^.U.e%: * * * * * & o&H.H.H.I.H.H.K.K.K.K.H.K.H.L.H.I.K.L.H.K.L.H.K.K.H.H.H.H.H.& * * * * R * * * * * * * * p%:&}&}&}&}&b!7.}&}&}&}&}&}&c!}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&J%* * * * * R * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + + U.+ + + + + + + + + @ # $ % & * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + + + + + U.+ + + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + t@i.* * * * * & u&~+~+~+]+]+]+]+{+]+{+{+]+]+]+]+]+]+~+]+M ~+]+M M ~+~+~+~+~+& * * * * R * * * * * * * * * * * * * f.f.* * * * * * * R * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + ^.^.+ + + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * & P.9.0.. + + + + + + + + + + + + + + + + ^.^.+ + + + @ a.b.c.& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : R R * * * & ' ) ) ) ! ) ) ! ) ! ) ! ~ ! ) ~ ! ! ) ! ; ) ! ! ~ ) ) ) ) ) & * * * * R * * * * * * * * * * * * f.f.* * * * * * * * R * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +". + + + + + + + + + + + U.+ + + + + + + + + + @ a.b.c.& * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * & P.9.0.d!u u u u u u u u u u u u u u u u u w.u u u u e!f!g!h!& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { !% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %w+: * * R f.* & u + + + e d d e + e + e + + d + e e d + d d + e e + + + + u & * * * f.f.* * * * * * * * * * * f.f.* * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"i!j!j!j!j!j!j!j!j!j!j!j!k!j!j!j!j!j!j!j!j!j!j!j!l!m!n!o!* * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * p%p!{ { { { { { { { { { { { { { { { { { { { g.{ { { { { { { q!J%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { 8%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%q%: * * * f.R O.c d e + + + + + + + + + + + + + + + + + e + + + + + + e d c & * * 8&r!s!s!s!s!s!s!s!s!s!s!s!t!u!s!s!s!s!s!s!s!s!s!s!s!r!s!s!s!^&* * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"}&}&}&}&}&}&}&}&}&}&}&}&c!}&}&}&}&}&}&}&}&}&}&}&}&}&H%* * * * * * * * * * * * * * +.+.v!+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.w!x!x!x!I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%S%I%I%I%I%I%I%J%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { m%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%o%: * * * * * 7.- b w + + + + + + + + + + + + + + + + + + + + + + + + s t s & * p%y!M&z!A!P.= P.P.P.P.P.P.B!8.P.P.P.z!L.L.C!z!z!P.P.P.M&P.P.P.D!^&* * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * 3.) E!~%r%r%r%r%F!r%r%F!r%r%r%F!r%r%r%F!r%r%r%r%r%r%r%G!!%H!6.* * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * 8&s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!^&* * * * * * * * * * * * * * * * * * * * * * * * * * E%~+r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%H%* * * * * * & w b w + + + + + + + + Q.R.S.+ T.+ + + + + + + + + + + s t s & * { m%^*/ / I!M I!]+/ I!]+J!J!]+> 9.9./ K!I!/ / M L!/ / ^*/ 9.9.M!: * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * { . H.~+y&+ + + + d d + C e d + O e e e e e + e + + + + %]%a%< : * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * p%y!P.P.z!P.z!P.z!P.P.P.P.P.P.P.P.L.M.C!P.P.z!P.P.z!P.P.P.P.P.D!^&* * * * * * * * * * * * * * * * * * * * * * * * * * R%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%* * * * * * * & c d e + + + + + + + /+(+_+h :+<+l+m++ + + + + + + + + e d c & * { w+N!O!c O!O!O!0.O!O!0.|#O!0.O!0.0.O!0.0.O!O!O!0.; ! P!F%0.0._ : * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * { . H.~+y&+ + + + d d d d + d d d + O + d e d + + + + + %]%a%< : * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * { m%9.9.9./ / 9./ ]+/ / 9./ I!]+I!9./ L!]+I!> ]+I!/ / / 9.9.9.M!: * * * * * * * * * * * * * * * * * * * * * * * * * * +.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.* * * * * * * & u + + + + + + + .@1 +@@@#@$@%@&@*@E+ ++ + + + + + + + + + u & * { ] Q!/ . / / ( ! / ( R!/ ( ! O . . / . . / / / ^ / / / Q!. . _ : * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * { . H.S!T!+ + + + d + d d d + d d + d + d d e e + + + + %]%a%< : * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * { w+0.0.0.O!c O!c O!; 0.O!O!O!! c 0.O!U!! O!O!0.O!O!; ! 0.0.0._ : * * * * * * * * * * * * * * * * * * * * * * * * * 3.) ) ) ) 4.5.4.) ) ) ) ) 4.4.4.) ) ) 4.) ) ) ) ) ) ) ) ) ) 6.* * * * * * & c d e + + + + f g h i j k l m n o p q r + + + + + + + e d c & * { < U.+ + + + + + + U.+ + + d d + + + + + + + + + + + + U.+ + [ : * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * { . H.g%) + + + + e + e e + d e e e e + e e + e + + + + %]%a%< : * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * { ] . . . / . / . / / ^ / . ( ! ( . / ( ! / O ! ( / / / . . . _ : * * * * * * * * * * * * * * * * * * * * * * * * { . H.H.H.H.I.H.I.H.L.H.K.K.K.I.I.K.L.H.M.K.K.L.H.K.K.H.H.H.H.N.: * * * * * & w b w + + + + S T T U I V!x&B.X@;.` ...+ + + + + + + w b w & * { v - w e + + + + U.+ + + + + + + + + + + + + + + + + + U.s s x : * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * { . I.|#) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * { ] ~+~+~+~+]+~+]+{+]+{+]+{+]+]+]+~+]+]+]+~+]+~+]+M ~+~+~+~+~+[ : * * * * * & N b w + + + f /.(._.:.X!,#Y!Z!C C C 1.2.+ + + + + + + w b - Q R g.d.b b d + + + U.+ + + + + + + + + + + + + + + + + + + ^+`!t e.: * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * { #.N N ! + + + + + + + + + + + + + + + + + + + + + + + K!N N e.: * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * { v w w e + + + + + + + + + + + + + + + + + + + + + + + e w w x : * * * * * * * * * * * * * * * * * * * * * * * * { v+) ) ) ) ! ) ! ~ ) ! ! ~ ! ! ! ! ) ! ! ) ! ) ! ! ) ) ) ) ) w+: * * * * R Q c d e + + + x.y.z.A.C ~ ~W@.~+~C@C G.+ + + + + + + + e d c & * { v - w e + + U.+ + + V.W.X.Y.Z.`. +.++ + + + + + + + + e x#s x : * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * { #.N N ! + + + + + + + + + + + + + + + + + + + + + + + K!N b e.: * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * { #.b b d + + + + + + + + + + + + + + + + + + + + + + + d b b e.: * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + e d e + d + e e e e e + d e e e e d + e + + + + + [ : * * R R * & u + + + + + =+T -+;+>+@~#~C $~%~z#&~!++ + + + + + + + + + u & * { < U.+ + + U.+ + + + |+1+2+3+4+5+6+7+8++ + + + + + + + + U.+ [ : * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * { . I.]+) + + + + + + + + + + + + + + + + + + + + + + + %W!*~=~: * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * { v - w e + + + + + + V.W.X.Y.Z.`. +.++ + + + + + + + + e w - x : * * * * * * * * * * * * * * * * * * * * * * * * { < d d + + + + + + + + + + + + + + + + + + + + + + + + + d d [ : R R * * * & u + + + + + n+T T h o+-~&&C C C ;~W@s+t+u++ + + + + + + + u & * { < U.+ + U.+ + + R.G+H+I+J+K+L+B M+N+O+P++ + + + + + + + U.+ [ : * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %]%a%y : * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * { G$^.+ + + + + + + + |+1+2+3+4+5+6+7+8++ + + + + + + + + + U.[ : * * * * * * * * * * * * * * * * * * * * * * * * { #.8 8 d + + + + + + + + + + + + + + + + + + + + + + + d N N G@i.* * * * * & u + + + + + =@*.-@;@C -.C C C h$;.C )@*.!@~@+ + + + + + + u & * { v N w U.+ + + f (@T _@:@<@[@C &&>~1@2@3@4@+ + + + + + e - w x : * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * { . I.]+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.].u@* * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * { y + + + + + + + R.G+H+I+J+K+L+B M+N+O+P++ + + + + + + + + U.[ : * * * * * * * * * * * * * * * * * * * * * * * * { #.8 8 d + + + + + + + + Q.T#S#U#V#+ + + + + + + + + + d N N e.: * * * * * & u + + + + + + h@i@j@k@l@m@C C C C %@C q@*.r@s@+ + + + + + u & * { #.b b d + + + w@T x@y@z@,~C@C C C C D@E@F@+ + + + + + d b b e.: * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * +.+.v!+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.* * { #.8 8 ! + + + + + + + + + + + + + + + + + + + + + + + K!N N e.-&* * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * R < + + + + + + f (@T _@:@<@[@C C C '~2@3@4@+ + + + + + + + U.[ : * * * * * * * * * * * * * * * * * * * * * * * * { < d d + + + + + + + {$]$^$/$($_$A 5 + + + + + + + + + + d d [ : * * * * * & u + + + + + + .+Y@Z@`@ #.#+#@#C x$$#C v@=.T %#+ + + + + + u & * { v N w e + + + -#;#W C C [*)~C C C C C !#+ + + + + + + e w w x : * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * 3.) ) y&) 5.5.4.) ) ) ) ) ) ) ) 4.) ) ) ) ) ) ) ) ) ) ) ) ) 6.* { #.8 8 ! + + + + + + + + + + + + + + + + + + + + + + + K!N N G@u@R * * 8&+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.9&0&+.+.+.+.+.+.+.+.+.+.8&* * * f.F+< + + + + + + w@T x@y@z@8@C C C C C D@E@F@+ + + + + + + + ^.e%: * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + 1 2 3 4 5 6 7 8 9 0 a + + + + + + + + + + [ : * * * * * & u + + + + + + 4#5#T T 6#7#8#9#v@0#a#R@b#c# .d#+ + + + + + u & * { < U.+ + + + + g#h#i#j#v@[*)~C C C C C q#+ + + + + + + + + + [ : * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { . H.H.n%H.I.H.H.K.L.H.K.H.K.K.K.I.H.L.K.K.K.K.H.L.H.H.H.H.H.N.: { . I.]+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< {@R R R c&) ) ) ) ) ) 4.5.) ) ) ) 4.4.4.) 4.y&) ) ) ) ) ) ) ) ) ) f&^&* * R { < + + + + + + -#;#W C C C f#*#f#*#f#C !#+ + + + + + + + + + z%: * * * * * * * * * * * * * * * * * * * * * * * * { < d d + + + + + z A B C D E F G H I J K L + + + + + + + + + [ : * * * * * & u + + + + + + + u+C# #D#E#F#G#H#L@T I#J#+ + + + + + + + + u & * { < U.+ + + + + M#T@*.T v@[*[*[*[*[*[*C R#S#+ + + + + + + + + [ : * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { ] ~+S!S!~+M ]+{+M ~+]+]+{+{+M M ]+]+~+]+]+{+]+]+]+]+~+~+~+~+[ : { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %]%a%< : * R & 0!n%s)H.H.H.H.I.H.J.K.L.H.I.K.M.K.M.t)K.K.K.K.H.H.H.H.H.H.H.& * R * { < + + + + + + g#h#i#j#U+&#&#*#&#*#&#C q#+ + + + + + + + + + z%: * * * * * * * * * * * * * * * * * * * * * * * * { #.8 8 d + + + %.&.T *.=.-.C C C C ).!.~.{.+ + + + + + + + + [ : * * * * * & u + + + + + + + + + + @$#$A $$%$T &$*$=$+ + + + + + + + + u & * { v x#s e + + + ;$T >$V C@K&K&K&K&K&)~)#)$!$~$+ + + + + e s s x : * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { v+) y&) ) ! ) ) ! ) ! ~ ! ) ! ~ ! ! ) ! ! ~ ! ! ) ~ ) ) ) ) w+: { . I.]+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * f.O.u&~+~+g%g%g%~+{+]+{+M ~+]+]+]+]+~+]+~+|#M ]+{+~+~+~+~+~+~+~+& f.f.* { < + + + + + + M#T@*.T /&C *#&#*#&#*#C R#S#+ + + + + + + + + &: * * * * * * * * * * * * * * * * * * * * * * * * { #.8 8 d + + + j.k.l.m.n.C D% !X C C t.u.v.+ + + + + + + + + [ : * * * * * & u + + + + + + + + + + + 5$+ + 6$F@+ + + + + + + + + + + + u & * { #.K%t d + + + 8$A 9$C 0$s C K&[*[*!~C a$b$c$~@+ + + + d t t e.: * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + U.+ + d d e e + e + e + e e e + d e d e e + d + + + + + [ : { #.8 8 ! + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * Q ' ) ) ) ) ) y&R!y&3&; ) ! ! ! ! ) ! ) R!~ ! ) ) ) ) ) ) ) ) & R * * { < + + + + + + ;$T >$V Q@&#C &#C &#C C )$!$~$+ + + + + + + + g%: * * * * * * * * * * * * * * * * * * * * * * * * { < d d + + + + @+#+A.C C ~~+!@!w%C C C *++ + + + + + + + + + [ : * * * * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * { v x#s e + + + j$!$k$l$a#m$n$o$C R@p$q$C r$A s$t$+ + + e s s x : * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < d >%+ + + + + + + + + + + + + + + + + e + + + + + + + d d [ : { #.8 8 ! + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * & U.+ + + + + + e d ^.>%- ^.e e e e e e U.e e + + + + + + + u Q * * * { < + + + + + + 8$A 9$C 0$s C C C C C C a$b$c$~@+ + + + + + + g%: * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + 0+a+b+c+4%f#{~]~=!J$-!C k++ + + + + + + + + + [ : * * * * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * { < U.+ + + + + + y$z$A$A B$C$B C :@T D$C E$&@F$Q.+ + + + + + [ : * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { #.N N d + + + + + + + + + + + + + + + + + + + + + + + d N N e.: { . I.]+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * & g%d e + + + + + + + e + ^.U.U.U.+ + + + U.+ + + + + + e d L&+&* * * { < + + + + + + j$!$k$l$a#m$n$o$C R@p$q$C r$A s$t$+ + + + + + t@u@* * * * * * * * * * * * * * * * * * * * * * * * { < d d + + + + S+T A T+U+X C ^~/~~!{!C `+ @+ + + + + + + + + [ : * * * * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * { < U.+ + + + + + + N$A O$P$T Q$C R$T S$T$U$V$W$+ + + + + + + [ : * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { #.N N d + + + + + + + + Q.T#S#U#V#+ + + + + + + + + + d N N e.: { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %]%a%< : * * & w b w + + + + + + + + + + + + + U.U.U.+ U.+ + + + + + w b - & * * * { < + + + + + + + y$z$A$A B$C$B C :@T D$C E$&@F$Q.+ + + + + + [ R * * * * * * * * * * * * * * * * * * * * * * * * { #.8 8 d + + + 6@A 7@%@8@W C C (!(~C C e@f@g@+ + + + + + + + [ : * * * * * & `$ % % % % % % % % % % % % % % % % % % % % % % % % % % % %`$& * { < U.+ + + + + + + + %%&%O$T *%=%-%T A ;%+ + + + + + + + + + [ : * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < d d + + + + + + + {$]$^$/$($_$A 5 + + + + + + + + + + d >%[ : { . I.]+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * & w b w + + + + + + + + Q.R.S.+ T.+ + + U._~U.+ + + + + w b w & * * * { < + + + + + + + + N$A O$P$T Q$C R$T S$T$U$V$W$+ + + + + + + [ R * * * * * * * * * * * * * * * * * * * * * * * * { #.8 8 d + + + I@J@K@C L@M@P%C C C %@Q@R@S@T@z + + + + + + + [ : * * * * * & {%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%{%& * { < U.+ + + + + + + + + + :%<%[%}%|%1%2%3%+ + + + + + + + + + [ : * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + + + 1 2 3 4 5 6 7 8 9 0 a + + + + + + + + + U.[ : { #.8 8 ! + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * & c d e + + + + + + + /+(+_+h :+<+l+m++ + + U.U.U.U.^.+ e d c & * * * { < + + + + + + + + + %%&%O$T *%=%-%T A ;%+ + + + + + + + + + [ i.* * * * * * * * * * * * * * * * * * * * * * * * { < d d + + + + ~@~#{#]#A ^#/#(#C @#`@_#C :#<#[#}#+ + + + + + [ : * * * * * & b.a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%b.& * { G$^.+ + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < d d + + + + + z A B C D E F G u$I J K L + + + + + + + d >%[ : { #.8 8 ! + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * & u + + + + + + + .@1 +@@@#@$@%@&@*@E+ ++ + U.+ + + ^.U.U.^.u & * * * { < + + + + + + + + + + + :%<%[%}%|%1%2%3%+ + + + + + + + + + [ -&* * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + }#T@T r#s#T t#C j#T u#C v#8#w#+ + + + + + + [ : * * * * * p%q%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%s%J%* { v$+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { #.8 8 d + + + %.&.T *.=.w&B@}@x&;.K$!.~.{.+ + + + + + d 8 x#e.: { . I.]+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * & u + + + + + + f g h i j k l m n o p q r + + U.+ + + + e L$|#Q f.* * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ -&* * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + }#W#X#Y#T Z#i#`#T a# $+ + + + + + + + + + [ : * * * * * * p%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%J%* * { v$+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { #.8 8 d + + + j.k.l.m.n.w%,+h%C C C t.u.v.+ + + + + + d 8 x#e.: { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %]%a%< : * * & u + + + + + + S T T U V W C@y%X@;.` ...+ + U.+ + + + w b w & f.R R g.< + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ -&* * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + :$<$T [$}$T |$1$+ + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { v$@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ _ : R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < d d + + + + @+#+A.C C +%B.:~<~p#C@C *++ + + + + + + + d >%[ : { . I.]+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * & u + + + + + f /.(._.:.j C C)D)E)X C 1.2.+ + U.+ + + + w b w & * * * { y U.U.+ + + + + + + + + + + + + + + + + + + + + + + + + + + [ : R * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + 5$+ + d$e$+ + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { v$a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.v+: R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + 0+a+b+c+[~(!C |@@!}~|~<.k++ + + + + + + + U.+ [ : { #.8 8 ! + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * & u + + + + + x.y.z.A.C B.F)G)w%C C@C G.+ + + + U.+ + + e d g%& * * * { o%@ @ Z%4!U.2!@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ _ : R * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { v$b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.] -&* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + S+T A T+1~2~C C C B.3~.$`+ @+ + + + + + + U.+ [ : { #.8 8 ! + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * & u + + + + + =+T -+;+>+I)o#J)w%C /%C !++ + + + U.+ + + + + w.& * * * { $&a.a.a.a.a.6!<&Z%5!a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.v+: R * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * p%Q c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.]&R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + 6@A 7@%@8@W C C h$;.C C e@f@g@+ + + + + + U.+ [ : { . I.]+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * & u + + + + + n+T T h o+C &&w%K)L)}@C s+t+u++ + ^.^.+ + e d >%& * * * { N.b.b.b.b.b.b.b.b.9!b%<&8!b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.] : R * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R :&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&S%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + I@J@K@C L@M@P%C C C Q%Q@R@S@T@z + + + + + U.+ [ : { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %]%a%< : * * & u + + + + + =@*.-@;@C -.C N)w%O);.C )@*.!@~@+ + U.+ + s t %&+&* * * p%] c.c.c.c.c.c.c.c.c.c.c.a!Z%M&M&c.c.c.c.c.c.c.c.c.c.c.c.c.c.]&^&R * * * * * * * * * * * * * * * * * * * * * * * { !% % % % % % % % % % % % % % % % % % % % % % % % % % % % % %w+: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + ~@~#{#]#A ^#/#(#C @#`@_#C :#<#[#}#+ + + + U.+ [ : { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * & u + + + + + + h@i@j@k@l@m@C C C C %@C q@*.r@s@+ U.+ + s t s -&* * * * p%:&}&}&}&}&}&}&}&}&}&}&}&}&}&}&Q c!2$}&}&}&}&}&}&}&}&}&}&}&J%* R * * * * * * * * * * * * * * * * * * * * * * * { 8%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%q%: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + + }#T@T r#s#T t#C j#T u#C v#8#w#+ + + + + U.+ [ : { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * & u + + + + + + .+Y@Z@`@ #.#+#@#C x$$#C v@=.T %#+ + U.+ e d c z%* * * * * * * * * * * * * * * * * * * * * * * R R R * * * * * * * * * * 8&r!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!g!a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%o%: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + + + }#W#X#Y#T Z#i#`#T a# $+ + + + + + + + U.+ [ : { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * & u + + + + + + 4#5#T T 6#7#8#9#v@0#a#R@b#c# .d#+ + U.+ + + u >&f.* * * * * * * * * * * * * * * * * * * * * * * * * R R R f.* * * * * p%y!M&P.P.P.P.P.P.P.z!A!P.= C!P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.P.D!u&r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%H%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + + + + + + :$<$T [$}$T |$1$+ + + + + + + + U.+ [ : { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * & u + + + + + + + u+C# #D#E#F#G#H#L@T I#J#+ + + + + U.+ e d c & R * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.R R f.* * { m%^*9.9.9.9.9.9.9./ / I!M / L!I!/ I!]+I!> L!9.9.9.9.9.9.9.9.M!4~I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + + + + + + + 5$+ + d$e$+ + + + + + + + + + U.+ [ : { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %]%a%< : * * & u + + + + + + + + + + @$#$A $$%$T &$*$=$+ + + + + + U.s t s & R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.R R g.w+N!0.0.0.0.0.0.0.O!c O!O!O!0.O!U!O!! c O!0.0.0.0.0.0.0.0.0._ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + U.+ [ : { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * & u + + + + + + + + + + + 5$+ + 6$F@+ + + + + + + + + U.s t s & f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { y _~y&. . . . . . / . / / / / . / ( ! ( / . . . . . . . . . _ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + U.+ [ : { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * & u + + + + + + + + + + + + + + + + + + + + + + + + + ^.^+d c & * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { < U.+ U.U.U.+ + + + + + + + + + + + + + + + + + + + + + + + [ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + U.+ [ : { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + U.+ u & * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { v w - e + + U.U.U.^.+ + + + + + + + + + + + + + + + + e w w x : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { !% % % % % % % % % % % % % % % % % % % % % % % % % % % %Z% %w+: { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * & u + + + + + + + + + + + + + + + + + + + + + + + + + + U.+ u & * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { #.b b d + + + + + ^.U.U.^.+ + + + + + + + + + + + + + d b b e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { 8%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%<&]%q%: { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %]%a%< : * * & `$ % % % % % % % % % % % % % % % % % % % % % % % % % % %Z%`$& * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { v w w e + + + + + + V.W.5~6~7~8~ +.++ + + + + + + + + e w N x : * * * 8&s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!^&* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * { m%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%n%a%o%: { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * & {%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%]%<&{%& * * R 3.s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!s!9~* * { < + + + + + + + + + |+1+2+3+4+0~l&a~U.+ + + + + + + + + + + z%: * * p%y!P.P.P.P.M.L.C!P.P.P.P.P.P.P.P.z!P.P.P.P.P.P.P.P.P.P.P.P.P.D!^&* * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * E%~+r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%g&r%H%* { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * & b.a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%a%n%b.& * * g.b~P.P.z!P.z!P.z!P.P.P.P.P.P.P.C!M.L.P.P.z!P.P.z!P.P.P.P.P.c~6.* { < + + + + + + + R.G+H+I+J+K+L+B M+N+O+v)U.U.+ + + + + + + + t@u@* * { m%9.9.9.9.> K!I!> ]+I!/ 9./ / / / I!]+/ / / / I!]+I!9.9.9.9.M!: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * R%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%S%I%* * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * p%q%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%r%c!J%* * & ^*9.9./ 9./ / L!]+I!/ 9./ / / 9./ 9.]+/ / / / / I!]+I!9.9.9.& * { v w w e + + + f (@T _@:@<@[@C }@|@1@2@3@4@+ U.U.U.^.+ + + + [ i.* * { w+0.0.0.0.O!0.0.O!0.O!O!O!0.; ! O!O!0.O!O!0.O!O!! c 0.0.0.0._ : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * { . H.~+) + + + + + + + + Q.T#S#U#V#+ + + + + + + + + + %W!I.< : * * * p%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%I%S%* * * & g&0.0.c O!c O!U!! O!O!O!0.; ! 0.O!0.O!; O!0.O!O!O!! c 0.0.0.& * { #.b b d + + + w@T x@y@z@d~+$e~f~C C D@E@F@+ + + + ^.U.U.^.+ [ : R * { ] . . . . ; ! ^ / . / . / . / / / ( ! / / / / ( ! ( . . . . _ : 8&+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.+.R * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * { . H.~+) + + + + + + {$]$^$/$($_$A 5 + + + + + + + + + %]%a%< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * & y . . . / . / ( ! / . / . / / . / . / / ; / / / ( ! ( . . d!& * { d.- w e + + + -#;#W C C g~h~1#*#C C C !#+ + + + + + + + ^.U. &u@R * { < + + + + + + + + + + + + + + + + + + + d + + + + + + + + + [ 9~c&) 4.) ) 4.) ) ) ) ) ) ) ) ) ) ) 5.5.5.4.) 4.) ) ) ) ) ) Q ^&* * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * { . H.~+) + + + + + 1 2 3 4 5 6 7 8 9 0 a + + + + + + + %W!I.< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * & ].^.+ + + + + + + + + + + + + + + + + + + + + + + + + + + u & f.g.< + + + + + + g#h#i#j#U+;&2#i~j~k~l~C q#+ + + + + + + + + + [ {@R R g.v w w e + + + + + + + + + + + + + + + + + + + + + + + e s s x w+o&H.C H.I.I.K.L.H.K.L.H.K.K.K.H.H.I.H.K.I.K.M.H.L.H.K.K.q&p&& * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * { . H.~+) + + + + z A B C D E F G u$I J K L + + + + + + K!8 8 e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * & M N O + + + + + + + + + + + + + + + + + + + + + + + + O - M Q f.{ < + + + + + + M#T@*.T /&(&,+i%[.k~m~C R#S#+ + + + + + + + + [ : * f.F+d.b b d + + + + + + + + + + + + + + + + + + + + + + + d t t e.w+u&~+]+]+]+]+]+~+]+]+~+]+]+{+]+~+~+M ]+]+]+~+]+]+]+]+M ~+g%~+& * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * { . H.~+) + + + %.&.T *.=.n~C@C ;.;.K$!.~.{.+ + + + + + K!8 8 e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * & - b - + + + + + + + + + + + + + + + + + + + + + + + + - b N & * { v s s e + + + ;$T >$V Q@C |@=!2#'$C C )$!$~$+ + + + + + + + [ : * * g.v w w e + + + + + + V.W.X.Y.Z.`. +.++ + + + + + + + + e s s x w+' ) ! ! ) ! ! ) ! ! ) ! ! ~ ! ) ) ! ) ! ! ) ! ! ) ~ ! ) y&) & * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * { . H.~+) + + + j.k.l.m.n.o~A&A&A&A&p~q~u.v.+ + + + + + %W!I.< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * & M - O + + + + + + + C&D&E&!$F&G&H&V.+ + + + + + + + + O - M & * { #.t t d + + + 8$A 9$C 0$1&,+*#r~C C C a$b$c$~@+ + + + + + + [ : * * { g%+ + + + + + + + + |+1+2+3+4+5+6+7+8++ + + + + + + + + + + [ w+u + e e + e e d + e d + e e d + + e + e e + d + d + e + U.u & * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * { . H.~+) + + + @+#+A.C C e+e+3#3#e+A&C *++ + + + + + + %]%a%< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * & u + + + + + + + + + |%N&O&P&Q&R&L@S&T&+ + + + + + + + + + u & * { v s s e + + + j$!$k$l$a#m$n$o$C R@p$q$C r$A s$t$+ + + + + + [ : * * { G$^.+ + + + + + R.G+H+I+J+K+L+B M+N+O+P++ + + + + + + + + + [ w+c d e + + + + + + + + + e d + + + + + + + + + + + + + e >%c & * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * { . H.~+) + + + 0+a+b+c+4%e+e+3#3#e+A&C k++ + + + + + + %W!I.< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R & u + + + + + + + W&X&Y&Z&`& *.*+*%@@*#*+ + + + + + + + + + u & * { < + + + + + + + y$z$A$A B$C$B C :@T D$C E$&@F$Q.+ + + + + + [ : * * { v - w e + + + f (@T _@:@<@[@C }@|@1@2@3@4@+ + + + + + e w w x w+w b w + + + + + + + + + + + + + + + + + + + + + + + + w b w & * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * { . H.~+) + + + S+T A T+U+e+e+3#3#e+A&C `+ @+ + + + + + K!8 8 e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R & u + + + + + + ***.8#=*8@s~;*C C p@'*)*6#+ + + + + + + + + u & * { < + + + + + + + + N$A O$P$T Q$C R$T S$T$U$V$W$+ + + + + + + [ : * * { #.b b d + + + w@T x@y@z@A@B@}@C@C C D@E@F@+ + + + + + d b b G@~%- b w + + + + + + + + Q.R.S.+ T.+ + + + + + + + + + + w b w & * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * { . H.~+) + + + 6@A 7@%@8@t~e+e+e+e+u~C e@f@g@+ + + + + K!8 8 e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.O.u + + + + + + #/*(*a#o+C C C C C v~I#Y.+ + + + + + + + + u & * { v s s e + + + + + + %%&%O$T *%=%-%T A ;%+ + + + + + + + + + [ : * * { v w w e + + + -#;#W C C >#,#'#)#C C C !#+ + + + + + + e w w x w+c d e + + + + + + + /+(+_+h :+<+l+m++ + + + + + + + + e d c & * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + I@J@K@C L@w~P%C C C Q%Q@R@S@T@z + + + + %W!I.< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * v$u + + + + + x~c$y~C C C *#f#*#f#*#&#z~V#+ + + + + + + + + u & * { #.t t d + + + + + + + + :%<%[%}%|%1%2%3%+ + + + + + + + + + [ : * * { < + + + + + + g#h#i#j#U+k#l#m#n#o#p#C q#+ + + + + + + + + + [ w+u + + + + + + + .@1 +@@@#@$@%@&@*@E+ ++ + + + + + + + + + u & * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + ~@~#{#]#A ^#/#(#C @#`@_#C :#<#[#}#+ + + %]%a%< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 2$u + + + + + A~B~C~D~j C *#&#*#&#*#C E~+ + + + + + + + + + u & * { v s s e + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * { < + + + + + + M#T@*.T N#O#C C C P#Q#X R#S#+ + + + + + + + + [ w+c d e + + + + f g h i j k l m n o p q r + + + + + + + e d c & * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + }#T@T r#s#T t#C j#T u#C v#8#w#+ + + + %W!I.< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & U.+ + + + + F~T /*T 8 C &#*#&#*#&#&#G~8++ + + + + + + + + u & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * { < + + + + + + ;$T >$V ,$}@C C C '$C C )$!$~$+ + + + + + + + [ w+w b w + + + + S T T U I H~C C I~;.` ...+ + + + + + + s t s & * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + }#W#X#Y#T Z#i#`#T a# $+ + + + + + + K!8 8 e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & w.+ + + + + }%T J~b+4%C &#C &#C &#C :#T@K~+ + + + + + + + u & * { < + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [ : * * { < + + + + + + 8$A 9$C 0$s C C B.C C C a$b$c$~@+ + + + + + + [ w+N b w + + + f /.(._.:.j !~K&C C C C 1.2.+ + + + + + + s t s & * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + :$<$T [$}$T |$1$+ + + + + + + K!8 8 e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & g%+ + + + + L~&$M~C p@N~v@C C C C C l$O~z$P~+ + + + + + + u & * { o%@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ _ : * * { < + + + + + + j$!$k$l$a#m$n$o$C R@p$q$C r$A s$t$+ + + + + + &~%c d e + + + x.y.z.A.C C Q~[*C C C C G.+ + + + + + + + e d c & * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + 5$+ + d$e$+ + + + + + + + + %W!I.< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u U.+ + + + + R~S~T~U~/*V~W~4%C *@X~C Y~Z~T@`~+ + + + + + u & * { $&a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.v+: * * { < + + + + + + + y$z$A$A B$C$B C :@T D$C E$&@F$Q.+ + + + U.U.[ w+u + + + + + =+T -+;+G C [*[*K&K&K&C !++ + + + + + + + + + u & * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %]%a%< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u U.+ + + + + 4# {.{+{@{#{+{${Q@%{+#W C &{T *{+ + + + + + u & * { N.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.] : * * { < + + + + + + + + N$A O$P$T Q$C R$T S$T$U$V$W$+ + + U.U.+ + [ w+c d e + + + n+T T h /@C@[*)~[*)~[*={-{t+u++ + + + + + e d c & * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u ^.^.+ + + + + ;{>{[#,{ .'{m v@B T@){!{~{{{+ + + + + + + u & * p%] c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.]&^&* * { < + + + + + + + + + %%&%O$T *%=%-%T A ;%+ + + + U.U.+ + + + [ w+s t s + + + =@*.-@;@C -.C C [*[*[*]{^{*.!@~@+ + + + + s t s & * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + U.+ + + + + + d#/{{$T ({_{:{<{T >{[{+ + + + + + + + + u & * * p%:&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&J%* * * { < + + + + + + + + + + + :%<%[%}%|%1%2%3%+ + U.U.+ + + + + + [ w+s t s + + + + h@i@j@k@l@m@C C C C %@C q@*.r@s@+ + + + s t s & * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + U.+ + + + + + + + }{|{1{H&2{3{4{x~+ + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + + + U.U.+ + + + + + + + [ w+c d e + + + + .+Y@Z@`@ #.#+#@#C x$$#C v@=.T %#+ + + + e d c & * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + U.+ + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + + + U.U.+ + + + + + + + + + [ w+u + + + + + + 4#5#T T 6#7#8#9#v@0#a#R@b#c# .d#+ + + + + + u & * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %]%a%< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + U.+ + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { < + + + + + + + + + + + + + + + U.U.+ + + + + + + + + + + + [ w+u + + + + + + + u+C# #D#E#F#G#H#L@T I#J#+ + + + + + + + + u & * * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & u + + U.+ + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { o%@ @ @ @ @ @ @ @ @ @ @ @ @ U.Z%@ @ @ @ @ @ @ @ @ @ @ @ @ @ _ w+u + + + + + + + + + + @$#$A $$%$T &$*$=$+ + + + + + + + + u & * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & 9.@ @ @ 4!@ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ 9.& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { $&a.a.a.a.a.a.a.a.a.a.5!Z%<&a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.v+w+u + + + + + + + + + + + 5$+ + 6$F@+ + + + + + + + + + + + u & * * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + K!8 8 e.: * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & f!a.a.a.7!a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.a.f!& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * { N.b.b.b.b.b.b.b.b.8!0!9!b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.] w+u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %W!I.< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * & g!b.b.b.9!8!b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.b.g!& * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * p%] c.c.c.c.c.c..&0!a!c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.]&5{u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * f.f.* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * { . H.~+) + + + + + + + + + + + + + + + + + + + + + + + %]%a%< : * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * E%{%c.c.c.c.0!c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.c.++o!* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * p%:&}&}&}&b!c!7.}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&}&J%& u + + + + + + + + + + + + + + + + + + + + + + + + + + + + u & * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * R * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>6{N=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*7{#>#>#>#>P-#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>#>8{v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,v,9{j*j*j*j*j*j*j*j*j*j*j*j*&=D*&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*3*c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>c>3*i*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*Y={={=]=o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*0{a{p*p*p*p*p*p*p*p*p*p*Y,p*p*p*p*p*p*p*p*p*p*p*p*p*p*p*p*p*b{n=j*j*j*j*j*j*j*j*j*&=D*&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*c>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>y>c>i*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*Y={={=]=o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*e*^=^=^=^=^=^=^=^=^=]']'^=c{]'(-U*y=(-U*^=^=^=^=^=^=^=^=^=^=i*j*j*j*j*j*j*j*&=D*&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*C*M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=M=C*i*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>6{N=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*d{m'm'm'm'm'm'm'm'm'c{(-p'p'p'm'p'p'm'p'm'm'm'm'm'm'm'm'm'm'i*j*j*j*j*j*&=D*&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*1;z>K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'K'L'T'j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>y>M=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*O'>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=>=,=>=>=>=>=>=>=O'j*j*j*j*j*j*j*j*j*j*j*j*j*i*m'2*2*2*2*2*2*2*2*]'2*2*]']']'2*]'e{O-N'2*2*2*2*2*2*2*2*2*%=i*j*j*j*&=D*&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*1;========================================================T'j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>6{N=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*O'f{%=%=m=%=m=%=m=%=%=%=%=%=%=%=m=f)f)%=%=m=%=/=m=%=%=%=%=%=z>M,j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*m*3*3*3*3*3*3*3*3*3*3*3*%=i*j*&=D*&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*l-3-m-j*j*j*j*j*j*j*l-F-m-l-F-3-3-3-3-3-3-3-3-3-3-E-j*E-3-3-3-3-3-B-l-j*j*j*j*l-3-m-j*j*j*j*j*j*j*j*j*j*j*j*l-3-C-j*j*l-F-3-3-3-3-3-3-3-3-3-B-l-j*,;F-3-3-3-3-3-3-3-3-F-j*j*j*j*j*j*C-B-3-3-3-3-3-3-3-3-3-k-j*j*j*j*j*j*C-3-l-j*j*j*j*j*j*j*l-F-,;j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*Y={={=]=o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*g{M=M=N=M=N=O=N=P=M=O=M=O=O=O=M=N=M=P=O=N=O=h{i{M=P=M=M=M=M=i*j*j*j*j*j*j*j*j*j*j*j*j*i*c{_-e{3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*e{_-c{j{D*&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*C-3-C-j*j*j*j*j*j*j*k-3-C-C-3-3-3-3-k-k-k-k-k-k-k-C-m-3-3-F-k-B-3-3-C-j*j*j*j*C-3-F-j*j*j*j*j*j*j*j*j*j*j*j*C-3-k-j*j*C-3-3-3-3-3-3-F-k-F-3-3-E-m-3-3-F-k-B-3-3-3-3-3-3-C-j*j*j*j*j*k-3-3-B-k-F-3-3-3-3-3-3-l-j*j*j*j*j*k-3-C-j*j*j*j*j*j*j*C-3-k-j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*Y={={=]=o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*W=^-^-(-/-(-(-^-(-(-(-/-/-c{c{^-(-^-/-c{(-/-(-_-(-(-(-^-^-^-i*j*j*j*j*j*j*j*j*j*j*j*j*i*_-.)_-3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*_-.)%)H=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*r;C z;3-C-j*j*j*j*,;*'^,3-3-[>E;3-3-3-6;C C C C C A;j*A;E;3-5;C C L;k{3-k-j*j*r;C z;3-3-F-k-k-k-k-k-k-k-E-j*r;C ,3-k-r;s;E;3-3-3-3-3-6;C C L;k{3->>[>3-4;+>C C E;3-3-3-3-3-C-j*j*j*e>L;6;3-e;C C C 6;3-3-3-3-3-C-j*j*j*e>C *'3-C-j*j*j*j*j*r;s;l{3-k-j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>6{N=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*W=%=%=%=O-%=O-O-%=O-J'O-%=O-J'%=O-%=O-O-O-J'O-/=O-%=J'%=%=%=i*j*j*j*j*j*j*j*j*j*j*D*D*I'm{_-e{3*3*3*3*3*3*3*#)n{o{s>p{q{q>*)3*3*3*3*3*3*3*3*3*e{_-c{i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*e>C ,3-B-j*j*j*k-3-3-3-3-3-E;E;3-3-3-3-)>)>)>)>-,e>c;C E;3-o;L;C C 0>3-F-j*j*e>C s;k-3-3-3-3-3-3-3-3-3-3-C-e>C ;,3-B-e>C E;3-3-5;6;[>q;s;C C r{3-6;E;3-)>L;C C C E;6;5;3-3-C-j*j*j*q;C 6;3--,s;C C C .>6;5;3-3-C-j*j*j*q;+>d,3-k-j*j*j*j*j*e>C )>3-F-l-j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>y>M=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*U*3*U*3*m*U*3*U*3*U*U*3*U*3*U*U*m*U*U*U*d*m*3*3*3*%=i*j*j*j*j*j*j*D*D*D*D*j*j*i*%=3*3*3*3*3*3*3*3*3*s{V*t{u{ =h;v{w{1)3*3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*e>C ,3-3-B-k-x{3-3-3-3-3-3-E;E;3-3-3-3-3-3-3-3-E-j*e>C y{3-3-k-e,6;3-3-3-F-k-z{C C s;q;q;q;q;)>3-3-3-3-3-C-e>e;3-3-3-0>+>E;3-6;C q;D*j*j*L;C -,3-6;[>3-k-j*e>C C C C C 0>3-C-j*j*j*q;C 3,3-C-j*q;C C C C C d,3-C-j*j*j*q;6;3-3-3-k-j*j*j*j*e>E;3-3-3-F-l-j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>6{N=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*T*m*U*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*U*m*T*i*j*j*&=D*D*D*j*j*j*j*j*j*i*%=3*3*3*3*3*3*3*n{A{B{C{D{E{f-E{}'z=F{3*3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*e>C L;B-3-3-3-3-3-3-3-3-3-d,+>E;3-5;q;q;q;q;e>j*j*j*e>C y{3-3-3-3-3-3-3-3-3-3-3-f>C C C C C C .>3-3-3-3-3-C-B;3-3-3-3-3-e;E;3-o;e>j*D*j*j*e>C o;3-6;-,3-k-j*j*e>q;L;C C ,3-C-j*j*j*q;C 0>3-E-j*j*!>q;L;C C 3-3-C-j*j*r;[>3-3-3-3-3-m-j*j*j*q;3-3-3-3-3-E-j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*Y={={=]=o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*9=0=9=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*d*3*3*Z'.)_-I'D*D*&=j*j*j*j*j*j*j*j*j*i*c{z=e{3*3*3*3*G{R*7=H{|'I{J{v*K{L{M{N{P;3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*e>C C O{n,3-3-3-4;p;C C e>e>C E;3-3-6;6;6;6;3,k-k-k-0>+>E;3-3-3-3-3-4;P{-,@'3-3-E-l-E-k-k-)>6;3-3-3-3-3-3-r{E;3-3-3-3-3-e;-,3-3-B-k-Q{k-k-0>5;3-3-e;-,3-k-j*j*j*j*j*q;C ,3-C-j*j*j*q;C 0>3-3-B-k-k-k-k-{>4;3-3-j*j*j*q;E;3-3-3-3-3-C-j*j*e>C 3-3-3-3-3-k-j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*Y={={=]=o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*9=0=9=3*3*3*3*3*3*3*3*s-@)#)3*$)3*3*3*3*3*3*3*3*3*d*3*Z'.)Z'i*j*j*j*j*j*j*j*j*j*j*j*j*i*z=0=z=3*3*3*3*_;v=R{A=T=S{e=f=T{U{V{[-;)3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*L;C C +>5;3-5;+>C C s;r;e>C L;E-3-3-3-3-3-3-3-3-3-3-p;+>4;3-3-3-4;p;C C C l{3-m-m-3-3-3-3-3-3-3-3-3-3-3-p;+>4;3-3-3-d,+>L;B-3-3-3-3-3-3-3-3-3-_,+>i,F-,;j*j*j*j*j*e>C W{3-m-j*j*j*q;C r{B-3-3-3-3-3-3-3-3-d,C-j*j*e>C C 4;3-3-3-F-j*j*j*C C e;3-3-3-3-m-j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>6{N=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*T*m*U*3*3*3*3*3*3*3*~){)])W*^)/)1=()3*3*3*3*3*3*3*d*3*U*m*T*i*j*j*j*j*j*j*j*j*j*j*j*j*i*c{z=e{3*3*3*s*t*u*v*v*v*v*X{Y{Z{`{v*z*A*3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*r;s;C C C s;c;j*j*j*j*j*e>C C q;q;q;q;q;q;q;q;q;r;e>C C C C C s;!>e>!>C C A;r;A;q;q;q;q;C C C C C C e>e>C C C C C A;e>C C L;q;q;q;q;4,L;C C A;e>C q;j*j*j*j*j*j*j*e>C e>j*j*j*j*j*q;C C L;q;q;q;q;q;s;C C j*j*j*E-3-p;C C C C e>j*j*m-3-e;C C C C q;j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>y>M=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*3*3*3*3*1)2)3)4)5)6)}'7)%;8)')3*3*3*3*3*3*q*q*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*3*3*(=_=:=<=Y* ].]+]'-v*v*v*[=3*3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*r;L;C L;r;j*j*j*j*j*j*j*A;C C C C C C C C C C c;r;s;C C C s;c;j*j*j*e>C c;c;C C C C C C C C C C C c;r;s;C C C s;r;j*L;C C C C C C C C C L;r;r;s;!>j*j*j*j*j*j*j*c;C c;j*j*j*j*j*e>L;C C C C C C C C s;e>j*j*j*E-3-@]C C C s;j*j*j*m-3-#]C C C C c;j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>6{N=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*3*3*3*4*V*W*X*Y*Z*`* =C{}'@=#=$=3*3*3*3*3*3*d*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*3*3*u=|=v=|={=e= ]$]%]{-v*v*w=x=3*3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*A;C c;j*j*j*j*j*j*j*c;C A;j*j*j*j*j*j*j*j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*Y={={=]=o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*3*3*3*a=|=|=b=&]S-v*v*v*S-i=j=k=3*3*3*3*3*3*d*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*i*c{z=e{3*3*3*.-|=+-@-#-v*v*v**]=]-]v*;]R*$-3*3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*A;C c;j*j*j*j*j*j*j*c;C A;j*j*j*j*j*j*j*j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*Y={={=]=o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*3*3*4*5*6*7*8*Y*>],]>],]>]>]b*c*3*3*3*3*3*3*q*q*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*i*z=0=z=3*3*3*E*']q=v*s=)]S-v*v*v*v*v*f-g-v=h-3*3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*", +"j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*k*2*M=^-%=3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*3*c>6{N=l*o*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*i*%=3*3*3*3*3*'=)=!=v*v*v*!],]!],]!]v*~=3*3*3*3*3*3*3*3*d*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*i*c{z=e{3*3*3*3*~]{]]]^]v=/]$;#-v*%;&;v**;=;R*(]3*3*3*3*3*3*%=i*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*&=&=j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*D*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*j*"}; diff --git a/GUI/SpiralIcon.xpm b/GUI/SpiralIcon.xpm new file mode 100644 index 0000000..b74a1f9 --- /dev/null +++ b/GUI/SpiralIcon.xpm @@ -0,0 +1,552 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"64 64 485 2", +" c None", +". c #393354", +"+ c #292247", +"@ c #221A41", +"# c #3B3556", +"$ c #352E50", +"% c #2E274B", +"& c #3A3355", +"* c #2F274B", +"= c #706C84", +"- c #928FA2", +"; c #C2C0CB", +"> c #FFFFFF", +", c #B0ACBA", +"' c #322B4E", +") c #3F395A", +"! c #2F284D", +"~ c #EFEEF1", +"{ c #8B879B", +"] c #352E51", +"^ c #757087", +"/ c #CBCAD3", +"( c #DCDAE0", +"_ c #2F284C", +": c #767189", +"< c #908C9F", +"[ c #2D264A", +"} c #726E85", +"| c #332C4F", +"1 c #393255", +"2 c #A9A6B5", +"3 c #251D43", +"4 c #261D47", +"5 c #D0CDD6", +"6 c #362F52", +"7 c #1E163D", +"8 c #21193E", +"9 c #030404", +"0 c #373636", +"a c #403F49", +"b c #626160", +"c c #383151", +"d c #C8C5CE", +"e c #1D153D", +"f c #231C42", +"g c #000000", +"h c #B0B1B0", +"i c #C1C1C1", +"j c #F3F3F0", +"k c #362D56", +"l c #40395A", +"m c #3B3454", +"n c #241E43", +"o c #E5E3E7", +"p c #DCDBE3", +"q c #C6C6C6", +"r c #FBFBFB", +"s c #444444", +"t c #5D557D", +"u c #332C50", +"v c #A6A2B2", +"w c #A2A0AE", +"x c #352F52", +"y c #B7B6C3", +"z c #252043", +"A c #3B3458", +"B c #9E99B2", +"C c #515050", +"D c #DFE0DF", +"E c #403A5B", +"F c #504B69", +"G c #ADADAD", +"H c #D2D2D2", +"I c #645B84", +"J c #9792A7", +"K c #ECEBEE", +"L c #3F3758", +"M c #322B4F", +"N c #C7C6D0", +"O c #1D143E", +"P c #8B85A2", +"Q c #0C0B1A", +"R c #342C4F", +"S c #4A4363", +"T c #262044", +"U c #AFAFAF", +"V c #191919", +"W c #040404", +"X c #151612", +"Y c #A8A3B4", +"Z c #989A93", +"` c #BABABA", +" . c #373053", +".. c #160E36", +"+. c #575757", +"@. c #ACACAC", +"#. c #333333", +"$. c #736E86", +"%. c #CDCDCD", +"&. c #020202", +"*. c #9E9CAC", +"=. c #120A32", +"-. c #B0B0B0", +";. c #C8C8C8", +">. c #8D8D8D", +",. c #BDBAC6", +"'. c #3E3959", +"). c #2E264C", +"!. c #DEDEE3", +"~. c #C3C3C3", +"{. c #919191", +"]. c #9895A7", +"^. c #0E062F", +"/. c #9F9F9F", +"(. c #D1D1D1", +"_. c #626262", +":. c #3C3556", +"<. c #271F45", +"[. c #31294D", +"}. c #30294D", +"|. c #383154", +"1. c #3E3859", +"2. c #9F9CAD", +"3. c #8F8F8F", +"4. c #FFFFFB", +"5. c #B7B4C5", +"6. c #150C36", +"7. c #EBEBED", +"8. c #2F2F2F", +"9. c #F4F4F4", +"0. c #2D2D2D", +"a. c #373736", +"b. c #9590A3", +"c. c #2C2449", +"d. c #6E6981", +"e. c #938FA1", +"f. c #848196", +"g. c #C7C7C7", +"h. c #B9B7C3", +"i. c #30284E", +"j. c #2D2F26", +"k. c #989997", +"l. c #C0BDCB", +"m. c #322A4D", +"n. c #292246", +"o. c #251E43", +"p. c #706A82", +"q. c #B8B5C1", +"r. c #CFCED6", +"s. c #726E86", +"t. c #E3E3E3", +"u. c #4B4B4B", +"v. c #09070F", +"w. c #40395C", +"x. c #342D51", +"y. c #352D53", +"z. c #645C83", +"A. c #696188", +"B. c #383057", +"C. c #171425", +"D. c #DBDDD6", +"E. c #9B97AA", +"F. c #1F183F", +"G. c #261F45", +"H. c #221A42", +"I. c #F3F4F5", +"J. c #2E274A", +"K. c #EEEDEF", +"L. c #010101", +"M. c #433F56", +"N. c #5E587E", +"O. c #80807F", +"P. c #211941", +"Q. c #170F37", +"R. c #0F072F", +"S. c #30284D", +"T. c #E0DFE1", +"U. c #827C9A", +"V. c #BEBDC7", +"W. c #30294C", +"X. c #66607A", +"Y. c #DDDDDD", +"Z. c #CFCFCF", +"`. c #C0C0C0", +" + c #BFBFBF", +".+ c #BEBEBE", +"++ c #CECECE", +"@+ c #5E5F54", +"#+ c #757770", +"$+ c #373835", +"%+ c #222222", +"&+ c #202020", +"*+ c #1D1D1D", +"=+ c #171717", +"-+ c #9E9E9F", +";+ c #B6B3C0", +">+ c #3D3658", +",+ c #9492A4", +"'+ c #0F1013", +")+ c #0C0A0F", +"!+ c #13130F", +"~+ c #635B82", +"{+ c #161422", +"]+ c #D3D0DC", +"^+ c #BDBAC4", +"/+ c #332D4F", +"(+ c #C5C2CC", +"_+ c #7F7E86", +":+ c #3D3758", +"<+ c #3B3456", +"[+ c #000004", +"}+ c #D9D7E3", +"|+ c #959591", +"1+ c #050505", +"2+ c #342D50", +"3+ c #241C43", +"4+ c #2E264A", +"5+ c #716A8D", +"6+ c #383153", +"7+ c #40385E", +"8+ c #969696", +"9+ c #090909", +"0+ c #656562", +"a+ c #373051", +"b+ c #2B2548", +"c+ c #514871", +"d+ c #070709", +"e+ c #211940", +"f+ c #ABA8B5", +"g+ c #E9E9E8", +"h+ c #C0BBCF", +"i+ c #100D21", +"j+ c #606161", +"k+ c #E9EAE4", +"l+ c #362E53", +"m+ c #7C788D", +"n+ c #363052", +"o+ c #CACAD1", +"p+ c #F8F7FE", +"q+ c #949496", +"r+ c #E4E4E4", +"s+ c #F1F1F1", +"t+ c #373052", +"u+ c #AFACB9", +"v+ c #3E3E40", +"w+ c #3D3D3D", +"x+ c #565656", +"y+ c #8F8F90", +"z+ c #BDB9C1", +"A+ c #40385B", +"B+ c #2F284B", +"C+ c #D0D0D0", +"D+ c #CECDD5", +"E+ c #332D50", +"F+ c #C4C3CD", +"G+ c #BDBDBD", +"H+ c #EAEAEA", +"I+ c #2D2A3E", +"J+ c #312A4E", +"K+ c #2A243B", +"L+ c #4B4757", +"M+ c #1A1139", +"N+ c #D2CFD7", +"O+ c #ADADAC", +"P+ c #02000C", +"Q+ c #60597D", +"R+ c #312A4F", +"S+ c #68627F", +"T+ c #B3B3B6", +"U+ c #020203", +"V+ c #373153", +"W+ c #BCBAC5", +"X+ c #FDFDFD", +"Y+ c #EFEFEF", +"Z+ c #080808", +"`+ c #686186", +" @ c #C5C7BF", +".@ c #4D4D51", +"+@ c #0A0814", +"@@ c #7D7C7F", +"#@ c #69657F", +"$@ c #393254", +"%@ c #CCCCD3", +"&@ c #3C3658", +"*@ c #3E3758", +"=@ c #6D6881", +"-@ c #040405", +";@ c #645C81", +">@ c #2A2248", +",@ c #424047", +"'@ c #4B4C4B", +")@ c #282146", +"!@ c #EDECEF", +"~@ c #6C6882", +"{@ c #878787", +"]@ c #625C7D", +"^@ c #F0EFF1", +"/@ c #D6D5DC", +"(@ c #322B4D", +"_@ c #2D274B", +":@ c #362F53", +"<@ c #231B42", +"[@ c #1E183E", +"}@ c #31294C", +"|@ c #3F3859", +"1@ c #928DA3", +"2@ c #7C798F", +"3@ c #312A4D", +"4@ c #21193F", +"5@ c #535353", +"6@ c #EEEDF0", +"7@ c #676085", +"8@ c #252239", +"9@ c #BFC0BF", +"0@ c #A29FB0", +"a@ c #292146", +"b@ c #FEFFFF", +"c@ c #3B3B3B", +"d@ c #F3F3F3", +"e@ c #443E5E", +"f@ c #1A133A", +"g@ c #322A50", +"h@ c #655D82", +"i@ c #6A628A", +"j@ c #EDEBEE", +"k@ c #362F51", +"l@ c #C1BEC9", +"m@ c #F0F0F0", +"n@ c #A5A4B3", +"o@ c #2A2247", +"p@ c #2E264B", +"q@ c #151518", +"r@ c #322D40", +"s@ c #333042", +"t@ c #1D182A", +"u@ c #888495", +"v@ c #9F9BB1", +"w@ c #4A4557", +"x@ c #151025", +"y@ c #373738", +"z@ c #CBC8D2", +"A@ c #989898", +"B@ c #261E44", +"C@ c #2B2348", +"D@ c #D9D8DE", +"E@ c #FBFBFA", +"F@ c #A7A8A3", +"G@ c #262723", +"H@ c #C3C1CB", +"I@ c #E8E7EA", +"J@ c #383053", +"K@ c #C3C3C1", +"L@ c #221C41", +"M@ c #181039", +"N@ c #121212", +"O@ c #F7F6FA", +"P@ c #E1E0E6", +"Q@ c #DFDEE5", +"R@ c #BCB8CB", +"S@ c #262434", +"T@ c #292929", +"U@ c #C1BECA", +"V@ c #F0F0F2", +"W@ c #716A84", +"X@ c #827D94", +"Y@ c #B4B1BE", +"Z@ c #292349", +"`@ c #534B73", +" # c #241D42", +".# c #3E3759", +"+# c #797979", +"@# c #F9F9F9", +"## c #CCC9D7", +"$# c #4A4853", +"%# c #A19EAE", +"&# c #918EA1", +"*# c #261E45", +"=# c #DAD7E4", +"-# c #B3B4B4", +";# c #A5A5A5", +"># c #AAA8B5", +",# c #A7A6B5", +"'# c #B9B9B9", +")# c #020009", +"!# c #9998A1", +"~# c #D5D4DC", +"{# c #3A3354", +"]# c #2E274C", +"^# c #2A2347", +"/# c #E7E5E9", +"(# c #403C50", +"_# c #3A3A3A", +":# c #20183F", +"<# c #463F5F", +"[# c #231B41", +"}# c #525252", +"|# c #7B7983", +"1# c #AEADB1", +"2# c #332C4D", +"3# c #FAFAFB", +"4# c #FAFAFA", +"5# c #8A869A", +"6# c #453E5F", +"7# c #343434", +"8# c #F1F0F6", +"9# c #5E5773", +"0# c #3C3557", +"a# c #F6F5F8", +"b# c #FDFDFF", +"c# c #332B4E", +"d# c #494362", +"e# c #2D2549", +"f# c #B1B1B1", +"g# c #353535", +"h# c #010202", +"i# c #B8B5C2", +"j# c #D5D4DA", +"k# c #2B2448", +"l# c #B4B4B4", +"m# c #2B2B2B", +"n# c #646566", +"o# c #0D0E0E", +"p# c #FCFBFD", +"q# c #403959", +"r# c #837E92", +"s# c #B4B4B5", +"t# c #070707", +"u# c #2C293F", +"v# c #FBFBFF", +"w# c #5F5A75", +"x# c #CAC7D1", +"y# c #46405F", +"z# c #1F173D", +"A# c #BABABC", +"B# c #060606", +"C# c #020100", +"D# c #676088", +"E# c #292148", +"F# c #EFEEF0", +"G# c #2E284B", +"H# c #7B768D", +"I# c #AFACBB", +"J# c #707070", +"K# c #BABBBA", +"L# c #3A3A37", +"M# c #60577E", +"N# c #E1DFE4", +"O# c #F2F2F5", +"P# c #FAFAFD", +"Q# c #342C53", +"R# c #3C3657", +"S# c #CFCED5", +"T# c #282045", +"U# c #D2D0D2", +"V# c #6F6F72", +"W# c #2C2549", +"X# c #DADAE2", +"Y# c #271F44", +"Z# c #79748B", +"`# c #4E456F", +" $ c #554C75", +".$ c #6E6983", +"+$ c #F2F1F3", +"@$ c #C3C2CC", +"#$ c #231C41", +"$$ c #878297", +"%$ c #E0DFE5", +"&$ c #817B92", +"*$ c #2A2348", +"=$ c #68627D", +"-$ c #8B879A", +";$ c #C5C4CD", +">$ c #BEBCC7", +",$ c #F8F8F9", +"'$ c #ABA9B7", +")$ c #CDCAD3", +"!$ c #66617B", +"~$ c #2D2649", +"{$ c #827E93", +"]$ c #3A3254", +"^$ c #BEBCC8", +"/$ c #CDCAD4", +"($ c #CECBD5", +"_$ c #9D9AAA", +":$ c #261F44", +" ", +" ", +" ", +" ", +" ", +" . + @ + # $ % & ", +" * = - ; > > > , ' ) ! > ~ { & ", +" ] ^ / > > ( _ : > > > > < & [ > > > > > > } | ", +" 1 2 > > > > > 3 > > > > > 4 > > > > > > > 5 6 ", +" > > > > > > 7 8 > > > > 9 0 a b > > > > > > > > c ", +" $ d > > > > > e f > > > > g g g g h > > > > i j k l ", +" m | n > > o > > ' p > > q g g g g r > > > s g g t u v w ", +" x y > > z A B C g D > > % E F > > G g g g g > > > H g g g g I J > > K L ", +" M N > > > o O P Q g g g > > R S T > > U g g g V > > > W g g g g g X > > > > ", +" | Y > > > > > > Z g g g g ` > ] ...> > U g g g +.> > @.g g g g g g #.> > > > v ", +" $.> > > > > %.&.g g g g g g > > *.=.> > -.g g g ;.> > g g &.g g g >.> > > > ,.'. ", +" ).!.> > > > > ~.g g g g g g g {.> ].^.> > /.g g g (.> %.g g g g g _.> > > :.<.[.}.|.1. ", +" u 2.> > > > > > > > 3.g g g g g g 4.5.6.7.> 8.g g g 9.> 0.g g g g a.> > b.@ _ % c.d.> e. ", +" |.f.> > > > > > > > > > g.g g g g g g h.i.> > j.g g g > > g g g g k.> l.m.n.o.p.q.> > > r.' ", +" s.> > > > > > > > > > > > t.u.g g g v. w.x.y. z.A. B. C.g g D.> E.F.G.H.I.> > > > > > n. ", +" J.K.> > > > > > > > > > > > > > > L.g M. N.O. P.Q.R.> > > > > > > > > S. ", +" .> > > > > > > > > > > > > > > > > T. U.> > > > > > > > > > V.W. ", +" X.> > > > > > Y.Z.`.i +.+++> > > > @+#+$+%+&+*+=+g g -+> > ;+>+ ", +" # ,+> > > > > g g g g g g g g g '+)+!+ ~+g g g g g g g g g {+]+^+ ", +" /+(+> > > > _+g g g g g g g g g g g g g g g g g g L.g g :+ ", +" <+> > > > > [+g g g g g g g g g g g g .}+|+g g g g g 1+g g ", +" 2+3+@ 4+5+g g g g g g g g g g g g g 6+u 7+ > > > 8+g g g 9+g 0+ ", +" a+b+T n c+g g g d+g g g g g g g g g . e+f+> g+g h+i+g j+> > > > %.L.g g k+l+ ", +" > > > > > g g g g g g g g g g g m+> n+o+> > p+g g > > g g g q+> > > > > r+s+> > t+ ", +" :+u+> > > > > v+g g g g w+s x+y+z+> > > A+ B+> > > g g g > > g g g g C+> > > > > > > D+ . ", +" E+F+> > > > > G+H+> > > > > > > > > > > I+ J+> > K+g g L+> > g g g g g > > > > > > M+6+ ", +" ' N+> > > > > > > > > > > > > > > > O+g P+Q+ ' R+S+g g T+> > U+g g g g g > > > > :+ ", +" V+W+> > > > > > > > X+> > > > > Y+Z+g g g `+ @> > > .@g g g +@@@> > > #@$@ c.%@&@l ", +" *@=@> > > > > > > > > > > > > x+g g -@g g ;@ >@> > > > ,@g '@ > > > $@ )@!@> > ", +" ~@> > > > X+> > > > > > {@g g g g g g g | > > > > ]@ 2+4+B+ % ^@> > > /@(@ ", +" _@> > > X+> > > > > Z.g g g g g g g g g > :@J+ | <@[@}@|@ 1@> > > > > 2@3@ ", +" 4@> > > > > > > > 5@g g g g g g g g g t.> > 6@|. 7@8@9@> > > > > > 0@V+ ", +" a@b@> > > > > c@g g g L.g g g g g g d@> > > > e@<+ f@g@ h@i@ g g &.> > > > > > > j@] ", +" k@l@> > > > m@g g g g g g g g g g ++> > > > n@o@p@> > > q@r@s@s@t@u@v@w@x@g g g g g g y@> > > > > > > z@V+ ", +" > > > > > g g g g &.g g g g A@> > > > > B@C@D@> > E@g g g g g F@> > G@g g g g g g g g H@> > > > > > I@V+ ", +" J@> > > > > K@g g g g g g g _.> > > > > L@' M@> > > > g g g g g g > > > N@g g g g g g g g O@> > > > > > P@ .*@ ", +" 4+Q@> > > > R@S@g g g g g T@> > > > > U@2+}.> > > > > g g g g g g > > > > g g g g g g g g g > > > > > > > V@W@] ", +" |@X@> > > Y@Z@`@g g g g g > > > > > > #.#e > > > > +#g g g g L.g @#> > > ##g g g g g g g g $#> > > > > > > > %#x. ", +" 6+> > &#*#c.=#-#g g g ;#> > > > > >#t+t+,#> > > > T@g g g g L.g '#> > > > )#g g g g g g g g !#> > > > > > > > ~#<+ ", +" {#]#^#u /#> > (#g _#> > > > > > :#<#[#> > X+> > g g g g g 1+g }#> > > > |#g g g g g g g g g 1#> > > > > > > > 2# ", +" 3#> > > > > > > 4#> > > 5#V+|@6#> > > > H g g g g g g g 7#> > > > 8#g g g g g &.g g g g > > > > > > > 9#0# ", +" .a#> > b#> > > > > > > > > c#d#e#> > > > > f#g g g g g g g g#> > > > > g g g g g g g g g h#> > > > > > i#M ", +" |.j#> > > > > > > > > > > > k#d#e > > > > > l#g g g g g 1+g m#> > > > > n#g g g g g g g o#> > > > > > i#[ ", +" p#> > > > > > > > > > q#1.$@r#> > > > > s#g g g g g t#g 9+> > > > > (.g g g g g g u#v#> > > > > w#M ", +" x#> > > > > > X+> 6@W.y#z#> > > > > > A#g g g g g B#g g > > > > > > g g g g C#D# E#> > > F#G#<+ ", +" % H#> > > > > > > o@ V+I#> > > > > > J#g g g g g B#g g > > > > > > K#g g L#M# * M ", +" V+ N#> > > > Y@6 o.> > > > > > > g g g g g g L.g g > > > > > > > O#P#> Q# ", +" l R#S#> > > T# e > > > > > X+> U#V#g g g g g B#1+> > > > > > > > > > W# ", +" ' X#Y# |@Z#> > > > > > > > > > > `# $> > > > > > > > > > > > .$>+ ", +" ' +$> > > > > > > > > > @$J+#$> > > > > > > > > > > > B+ ", +" k@> > > > > > > > > > > $$|@o@> > > > > > > > > %$&$*$ ", +" =$-$;$>$,$> > > > > <+'$> > > > > > )$!$~$|@ ", +" 0#6 _ n. {$ 1. ]$^$/$($_$ :$2+ ", +" :+| 2+0# ", +" ", +" ", +" ", +" ", +" "}; diff --git a/GUI/Widgets/Fl_Canvas.C b/GUI/Widgets/Fl_Canvas.C new file mode 100644 index 0000000..c4487e2 --- /dev/null +++ b/GUI/Widgets/Fl_Canvas.C @@ -0,0 +1,510 @@ +/* Canvas Widget + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl/fl_draw.H" +#include "Fl_Canvas.h" +#include "Fl_DeviceGUI.h" +#include +#include "../../SpiralSynthModularInfo.h" + +//#define IMG_BACKGROUND + +#ifdef IMG_BACKGROUND +#include +#endif + +//////////////////////////////////////////////////////////////////////// + +Fl_Canvas::Fl_Canvas(int x, int y, int w, int h, char *name) : +Fl_Group(x,y,w,h,name), +cb_Connection(NULL), +cb_Unconnect(NULL), +cb_AddDevice(NULL), +m_ToolMenu(false) +{ + m_IncompleteWire.OutputChild=-1; + m_IncompleteWire.OutputPort=-1; + m_IncompleteWire.InputChild=-1; + m_IncompleteWire.InputPort=-1; + + m_BG=NULL; + m_BGData=NULL; + +#ifdef IMG_BACKGROUND + if (SpiralSynthModularInfo::BGIMG=="None") return; + FILE *fp=fopen(SpiralSynthModularInfo::BGIMG.c_str(),"rb"); + if (!fp) + { + SpiralInfo::Alert("Couldn't open image ["+SpiralSynthModularInfo::BGIMG+"]"); + } + else + { + png_structp png_ptr; + png_infop info_ptr; + + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + info_ptr = png_create_info_struct(png_ptr); + png_init_io(png_ptr, fp); + png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_IDENTITY, NULL); + fclose(fp); + + m_BGData = new char[png_ptr->rowbytes*png_ptr->height]; + int p=0; + for (unsigned int row = 0; row < png_ptr->height; row++) + { + for (unsigned int i=0; irowbytes; i++) + { + m_BGData[p]=(char)info_ptr->row_pointers[row][i]; + p++; + } + } +#if FL_MAJOR_VERSION == 1 && FL_MINOR_VERSION == 0 + m_BG = new Fl_Image((unsigned char*)m_BGData, + (int)png_ptr->width, + (int)png_ptr->height,(int)png_ptr->rowbytes/(int)png_ptr->width); +#else + m_BG = new Fl_RGB_Image((unsigned char*)m_BGData,(int)png_ptr->width,(int)png_ptr->height); +#endif + png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); + } +#endif + +} + +Fl_Canvas::~Fl_Canvas() +{ +#ifdef IMG_BACKGROUND + if (m_BGData) delete[] m_BGData; +#endif +} + +void Fl_Canvas::draw() +{ + Fl_Widget*const* a = array(); + + if (damage() & ~FL_DAMAGE_CHILD) // redraw the entire thing: + { + if (m_BG) + { + int X=0,Y=0; + while (Ydraw(parent()->x()+X,parent()->y()+Y); +#if FL_MAJOR_VERSION == 1 && FL_MINOR_VERSION == 0 + X+=m_BG->w; +#else + X+=m_BG->w(); +#endif + } +#if FL_MAJOR_VERSION == 1 && FL_MINOR_VERSION == 0 + Y+=m_BG->h; +#else + Y+=m_BG->h(); +#endif + X=0; + } + } + else + { + draw_box(); + } + + for (int i=children(); i--;) + { + Fl_Widget& o = **a++; + draw_child(o); + draw_outside_label(o); + } + + DrawWires(); + } + else // only redraw the children that need it: + { + for (int i=children(); i--;) update_child(**a++); + } + + if (m_ToolMenu) + { + int Pos=0,X=0,Y=0,textw,texth; + int DegreesPerItem=30; + float conv=3.151/180.0f; + bool selected=false; + m_Selected=-1; + + fl_font(fl_font(),10); + for (vector< pair >::iterator i=m_PluginNameList.begin(); + i!=m_PluginNameList.end(); ++i) + { + textw=0; + fl_font(fl_font(),10); + fl_measure(i->first.c_str(), textw, texth); + + X=m_x-(textw/2); + Y=m_y-(m_PluginNameList.size()*5)+Pos*10; + + if (Fl::event_y()>Y-10 && Fl::event_y()X && Fl::event_x()first.c_str(), textw, texth); + X=m_x-(textw/2); + m_Selected=i->second; + selected=true; + } + else selected=false; + + fl_color(FL_GRAY); + + fl_color(FL_WHITE); + fl_draw(i->first.c_str(),X-1,Y+1); + + if (selected) fl_color(FL_BLUE); + else fl_color(FL_BLACK); + + fl_draw(i->first.c_str(),X,Y); + + Pos+=1; + } + } +} + +void Fl_Canvas::DrawWires() +{ + for(vector::iterator i=m_WireVec.begin(); + i!=m_WireVec.end(); i++) + { + if (i->OutputChild>children() || i->InputChild>children()) + { + cerr<<"wire output child = "<OutputChild<OutputChild)); + Fl_DeviceGUI* DestDevice = (Fl_DeviceGUI*)(child(i->InputChild)); + + if (!SourceDevice || !DestDevice) + { + SpiralInfo::Alert("Cant find source or dest device while drawing wires"); + return; + } + + //============================= + // wire colour stuff - dan b. + //============================= + Fl_Color col = (Fl_Color) WIRE_COL0; + switch (SourceDevice->GetPortType(i->OutputPort+SourceDevice->GetInfo()->NumInputs)) { + case 0: col = (Fl_Color) WIRE_COL0; + break; + case 1: col = (Fl_Color) WIRE_COL1; + break; + case 2: col = (Fl_Color) WIRE_COL2; + break; + case 3: col = (Fl_Color) WIRE_COL3; + break; + case 4: col = (Fl_Color) WIRE_COL4; + break; + default: col = (Fl_Color) WIRE_COL0; + } + fl_color(col); + //============================= + + fl_line(SourceDevice->GetPortX(i->OutputPort+SourceDevice->GetInfo()->NumInputs), + SourceDevice->GetPortY(i->OutputPort+SourceDevice->GetInfo()->NumInputs), + DestDevice->GetPortX(i->InputPort), + DestDevice->GetPortY(i->InputPort)); + } +} + +int Fl_Canvas::handle(int event) +{ + if (Fl_Group::handle(event)) return 1; + + if (Fl::event_button()==3) + { + if (event==FL_PUSH) + { + m_ToolMenu=true; + m_x=Fl::event_x(); + m_y=Fl::event_y(); + redraw(); + } + + if (event==FL_DRAG) redraw(); + + if (event==FL_RELEASE && Fl::event_button()==3) + { + m_ToolMenu=false; + if (m_Selected!=-1 && cb_AddDevice) + { + int args[3]; + args[0]=m_Selected; + args[1]=m_x; + args[2]=m_y; + cb_AddDevice(this,args); + } + redraw(); + } + } + + return 1; +} + +void Fl_Canvas::PortClicked(Fl_DeviceGUI* Device, int Type, int Port, bool Value) +{ + // find out which child this comes from. + int ChildNum=-1; + for(int n=0; noutput connection + if (m_IncompleteWire.OutputChild==-1) + { + m_IncompleteWire.OutputChild=ChildNum; + m_IncompleteWire.OutputPort=Port; + m_IncompleteWire.OutputID=Device->GetID(); + } + else + { + m_IncompleteWire.Clear(); + } + } + else + { + // make sure we don't make a input->input connection + if (m_IncompleteWire.InputChild==-1) + { + m_IncompleteWire.InputChild=ChildNum; + m_IncompleteWire.InputPort=Port; + m_IncompleteWire.InputID=Device->GetID(); + } + else + { + m_IncompleteWire.Clear(); + } + } + + // if both have now been set... + if (m_IncompleteWire.InputChild!=-1 && m_IncompleteWire.OutputChild!=-1) + { + m_WireVec.push_back(m_IncompleteWire); + + // send the connect callback + cb_Connection(this,(void*)&m_IncompleteWire); + m_Graph.AddConnection(m_IncompleteWire.OutputID,m_IncompleteWire.InputID); + + m_IncompleteWire.Clear(); + + redraw(); + } + } + } + else // Turned off the port + { + // Find the connection + for(vector::iterator i=m_WireVec.begin(); + i!=m_WireVec.end(); i++) + { + if ((Type==Fl_DeviceGUI::OUTPUT && i->OutputChild==ChildNum && i->OutputPort==Port) || + (Type==Fl_DeviceGUI::INPUT && i->InputChild==ChildNum && i->InputPort==Port)) + { + // Turn off both ports + ((Fl_DeviceGUI*)(child(i->OutputChild)))->ForcePortValue(i->OutputPort+ + ((Fl_DeviceGUI*)(child(i->OutputChild)))->GetInfo()->NumInputs,false); + ((Fl_DeviceGUI*)(child(i->InputChild)))->ForcePortValue(i->InputPort,false); + + // send the unconnect callback + cb_Unconnect(this,(void*)&(*i)); + m_Graph.RemoveConnection(i->OutputID,i->InputID); + + // Remove the wire + m_WireVec.erase(i); + + redraw(); + break; + } + } + + // Clear the current selection + m_IncompleteWire.Clear(); + } +} + +void Fl_Canvas::ClearConnections(Fl_DeviceGUI* Device) +{ + // find out which child this comes from. + int ChildNum=-1; + for(int n=0; n::iterator i=m_WireVec.begin(); + i!=m_WireVec.end(); i++) + { + if (i->OutputChild==ChildNum || + i->InputChild==ChildNum) + { + // Turn off both ports + ((Fl_DeviceGUI*)(child(i->OutputChild)))->ForcePortValue(i->OutputPort+ + ((Fl_DeviceGUI*)(child(i->OutputChild)))->GetInfo()->NumInputs,false); + ((Fl_DeviceGUI*)(child(i->InputChild)))->ForcePortValue(i->InputPort,false); + + // send the unconnect callback + cb_Unconnect(this,(void*)&(*i)); + m_Graph.RemoveConnection(i->OutputID,i->InputID); + + m_WireVec.erase(i); + removedall=false; + break; + } + } + } +} + +void Fl_Canvas::RemoveDevice(Fl_DeviceGUI* Device) +{ + // find out which child this comes from. + int ChildNum=-1; + for(int n=0; n::iterator i=m_WireVec.begin(); + i!=m_WireVec.end(); i++) + { + if (i->OutputChild>ChildNum) i->OutputChild--; + if (i->InputChild>ChildNum) i->InputChild--; + } + + remove(child(ChildNum)); + redraw(); +} + +void Fl_Canvas::Clear() +{ + m_Graph.Clear(); + + int kids=children(); + + for(int n=0; n>(istream &s, Fl_Canvas &o) +{ + int NumWires; + s>>NumWires; + + for(int n=0; n>NewWire.OutputID; + s>>NewWire.OutputChild; + s>>NewWire.OutputPort; + s>>NewWire.InputID; + s>>NewWire.InputChild; + s>>NewWire.InputPort; + + o.m_WireVec.push_back(NewWire); + + // Notify connection by callback + o.cb_Connection(&o,(void*)&NewWire); + o.m_Graph.AddConnection(NewWire.OutputID,NewWire.InputID); + + // Turn on both ports + ((Fl_DeviceGUI*)(o.child(NewWire.OutputChild)))->ForcePortValue(NewWire.OutputPort+ + ((Fl_DeviceGUI*)(o.child(NewWire.OutputChild)))->GetInfo()->NumInputs,true); + ((Fl_DeviceGUI*)(o.child(NewWire.InputChild)))->ForcePortValue(NewWire.InputPort,true); + } + + return s; +} + +ostream &operator<<(ostream &s, Fl_Canvas &o) +{ + s<::iterator i=o.m_WireVec.begin(); + i!=o.m_WireVec.end(); i++) + { + s<OutputID<<" "; + s<OutputChild<<" "; + s<OutputPort<<" "; + s<InputID<<" "; + s<InputChild<<" "; + s<InputPort< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include "../../GraphSort.h" + +#ifndef CANVAS_WIDGET +#define CANVAS_WIDGET + +using namespace std; + +class Fl_DeviceGUI; + +class CanvasWire +{ +public: + CanvasWire() { Clear(); } + + void Clear() + { + OutputChild=-1; + OutputPort=-1; + OutputID=-1; + InputChild=-1; + InputPort=-1; + InputID=-1; + } + + int OutputID; + int OutputChild; + int OutputPort; + int InputID; + int InputChild; + int InputPort; +}; + +class Fl_Canvas : public Fl_Group +{ +public: + Fl_Canvas(int x, int y, int w, int h, char *name); + ~Fl_Canvas(); + + virtual void draw(); + virtual int handle(int event); + void PortClicked(Fl_DeviceGUI* Device, int Type, int Port, bool Value); + + void SetConnectionCallback(Fl_Callback* s) { cb_Connection=s; } + void SetUnconnectCallback(Fl_Callback* s) { cb_Unconnect=s; } + void SetAddDeviceCallback(Fl_Callback* s) { cb_AddDevice=s; } + + void ClearConnections(Fl_DeviceGUI* Device); + void RemoveDevice(Fl_DeviceGUI* Device); + void Clear(); + void AddPluginName(const string &s, int ID) + { m_PluginNameList.push_back(pair(s,ID)); } + GraphSort* GetGraph() { return &m_Graph; } + +private: + + void DrawWires(); + + Fl_Image *m_BG; + char *m_BGData; + + void (*cb_Connection)(Fl_Widget*, void*); + void (*cb_Unconnect)(Fl_Widget*, void*); + void (*cb_AddDevice)(Fl_Widget*, void*); + + vector m_WireVec; + CanvasWire m_IncompleteWire; + + bool m_ToolMenu, m_ButtonDown; + int m_x,m_y,m_Selected; + vector< pair > m_PluginNameList; + + GraphSort m_Graph; + + friend istream &operator>>(istream &s, Fl_Canvas &o); + friend ostream &operator<<(ostream &s, Fl_Canvas &o); +}; + +istream &operator>>(istream &s, Fl_Canvas &o); +ostream &operator<<(ostream &s, Fl_Canvas &o); + +#endif diff --git a/GUI/Widgets/Fl_CommentGUI.C b/GUI/Widgets/Fl_CommentGUI.C new file mode 100644 index 0000000..f01f452 --- /dev/null +++ b/GUI/Widgets/Fl_CommentGUI.C @@ -0,0 +1,93 @@ +/* DeviceGUI composite Widget + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl_CommentGUI.h" +#include +#include +#include "../../SpiralSynthModularInfo.h" + +Fl_CommentGUI::Fl_CommentGUI(const DeviceGUIInfo& Info, Fl_Window *PW, Fl_Pixmap *Icon) : +Fl_DeviceGUI(Info,PW,Icon), +m_Comment("double click to edit.") +{ + box(FL_NO_BOX); + m_DragBar->box(FL_NO_BOX); + m_DragBar->label(m_Comment.c_str()); + m_DragBar->color(SpiralSynthModularInfo::GUICOL_Device); +// m_DragBar->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); +} + +int Fl_CommentGUI::handle(int event) +{ + if (Fl::event_button()==1 && event==FL_PUSH && Fl::event_clicks()==1) + { + const char *t=fl_input("and your comment is:", m_Comment.c_str()); + if (t) + { + string temp(t); + if (temp!="") + { + m_Comment=temp; + m_DragBar->label(m_Comment.c_str()); + redraw(); + //int x,y; + //fl_measure(m_Comment.c_str(),x,y); + //m_DragBar->size(x,y); + } + } + } + + return Fl_DeviceGUI::handle(event); +} + +void Fl_CommentGUI::Setup(const DeviceGUIInfo& Info, bool FirstTime) +{ + Fl_DeviceGUI::Setup(Info,FirstTime); +} + +void Fl_CommentGUI::Clear() +{ + Fl_DeviceGUI::Clear(); +} + +void Fl_CommentGUI::StreamOut(ostream &s) +{ + s<<1<<" "; + s<>version; + s>>size; + size++; // see below + char *str = new char[size+1]; + s.read(str,size); + str[size]='\0'; + // have to move the pointer on by one, as the string + // starts with " ", as the file pointer starts on + // a blank space (after streaming the size) + m_Comment=str+1; + delete[] str; + + m_DragBar->label(m_Comment.c_str()); +} diff --git a/GUI/Widgets/Fl_CommentGUI.h b/GUI/Widgets/Fl_CommentGUI.h new file mode 100644 index 0000000..62416e7 --- /dev/null +++ b/GUI/Widgets/Fl_CommentGUI.h @@ -0,0 +1,41 @@ +/* DeviceGUI composite Widget + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "Fl_DeviceGUI.h" + +#ifndef COMMENTGUI +#define COMMENTGUI + +class Fl_CommentGUI : public Fl_DeviceGUI +{ +public: + Fl_CommentGUI(const DeviceGUIInfo& Info, Fl_Window *PW, Fl_Pixmap *Icon); + + virtual int handle(int event); + virtual void Setup(const DeviceGUIInfo& Info, bool FirstTime = false); + virtual void Clear(); + + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); +protected: + + string m_Comment; +}; + +#endif diff --git a/GUI/Widgets/Fl_DeviceGUI.C b/GUI/Widgets/Fl_DeviceGUI.C new file mode 100644 index 0000000..b19b2f6 --- /dev/null +++ b/GUI/Widgets/Fl_DeviceGUI.C @@ -0,0 +1,214 @@ +/* DeviceGUI composite Widget + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl_DeviceGUI.h" +#include "Fl_Canvas.h" +#include "../../SpiralSynthModularInfo.h" + +int Fl_DeviceGUI::Numbers[512]; + +Fl_DeviceGUI::Fl_DeviceGUI(const DeviceGUIInfo& Info, Fl_Group *PW, Fl_Pixmap *Icon) : +Fl_Group(Info.XPos, Info.YPos, Info.Width+(PortGroupWidth*2), Info.Height+TitleBarHeight, ""), +m_PluginWindow(NULL), +m_Icon(NULL), +m_Name(Info.Name), +m_ID(-1), +m_DelMe(false) +{ + for (int n=0; n<512; n++) Numbers[n]=n; + + type(1); + box(FL_PLASTIC_UP_BOX); + labeltype(FL_ENGRAVED_LABEL); + align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + color(SpiralSynthModularInfo::GUICOL_Device); + + m_Icon=Icon; + + m_DragBar = new Fl_DragBar(Info.XPos, Info.YPos, Info.Width+PortGroupWidth*2, TitleBarHeight, m_Name.c_str()); + m_DragBar->labelsize(10); + m_DragBar->type(Fl_DragBar::FLDRAG); + m_DragBar->color(SpiralSynthModularInfo::GUICOL_Device); + + m_PluginWindow = PW; + + //Add the input/output ports + Setup(Info, true); +} + +void Fl_DeviceGUI::Clear() +{ + end(); +} + +int Fl_DeviceGUI::handle(int event) +{ + int t=Fl_Group::handle(event); + + if (t==0) + { + if (event==FL_PUSH && Fl::event_button()==1) + { + if (m_PluginWindow && !m_DelMe) + { + if(!m_PluginWindow->visible()) + { + m_PluginWindow->show(); + } + /*else + { + m_PluginWindow->hide(); + }*/ + } + } + if (event==FL_RELEASE && Fl::event_button()==2) + { + m_DelMe = true; + } + } + + return t; +} + +void Fl_DeviceGUI::draw() +{ + Fl_Group::draw(); + if (m_Icon) + { + int Centx=x()+w()/2; + int Centy=y()+h()/2; + m_Icon->draw(Centx-m_Icon->w()/2,Centy-m_Icon->h()/2); + } +} + +void Fl_DeviceGUI::Setup(const DeviceGUIInfo& Info, bool FirstTime) +{ + m_Info=Info; + + // Remove all current connections - it's the safest thing to do. + if (parent() && !FirstTime) + { + ((Fl_Canvas*)(parent()))->ClearConnections(this); + } + + // delete the current ports + for(vector::iterator i=m_PortVec.begin(); + i!=m_PortVec.end(); i++) + { + remove(*i); + delete(*i); + } + + m_PortVec.clear(); + + int InputX=x()+2; + int OutputX=x()+PortGroupWidth+Info.Width+4; + int StartY=y()+TitleBarHeight; + int PortDist=10; + int PortNum=0; + + h(Info.Height+TitleBarHeight); + + for (int n=0; ntype(1); + NewInput->value(false); + NewInput->box(FL_ROUNDED_BOX); + + Fl_Color col = (Fl_Color) WIRE_COL0; + switch (Info.PortTypes[n]) { + case 0: col = (Fl_Color) WIRE_COL0; + break; + case 1: col = (Fl_Color) WIRE_COL1; + break; + case 2: col = (Fl_Color) WIRE_COL2; + break; + case 3: col = (Fl_Color) WIRE_COL3; + break; + case 4: col = (Fl_Color) WIRE_COL4; + break; + default: col = (Fl_Color) WIRE_COL0; + } + NewInput->selection_color(col); + + NewInput->down_box(FL_ROUNDED_BOX); + NewInput->tooltip(Info.PortTips[n].c_str()); + NewInput->callback((Fl_Callback*)cb_Port,(void*)&Numbers[PortNum]); + m_PortVec.push_back(NewInput); + add(NewInput); + PortNum++; + } + + for (int n=0; ntype(1); + NewOutput->value(false); + NewOutput->box(FL_ROUNDED_BOX); + + Fl_Color col = (Fl_Color) WIRE_COL0; + switch (Info.PortTypes[n+Info.NumInputs]) { + case 0: col = (Fl_Color) WIRE_COL0; + break; + case 1: col = (Fl_Color) WIRE_COL1; + break; + case 2: col = (Fl_Color) WIRE_COL2; + break; + case 3: col = (Fl_Color) WIRE_COL3; + break; + case 4: col = (Fl_Color) WIRE_COL4; + break; + default: col = (Fl_Color) WIRE_COL0; + } + NewOutput->selection_color(col); + + + NewOutput->down_box(FL_ROUNDED_BOX); + NewOutput->tooltip(Info.PortTips[n+Info.NumInputs].c_str()); + NewOutput->callback((Fl_Callback*)cb_Port,(void*)&Numbers[PortNum]); + m_PortVec.push_back(NewOutput); + add(NewOutput); + PortNum++; + } +} + +inline void Fl_DeviceGUI::cb_Port_i(Fl_Button* o, void* v) +{ + int Port=*(int*)(v); + PortType Pt; + + if (m_DelMe) return; + + // Find out if this is an input or an output. + if (PortPortClicked(this,Pt,Port,o->value()); + + +} +void Fl_DeviceGUI::cb_Port(Fl_Button* o, void* v) +{((Fl_DeviceGUI*)(o->parent()))->cb_Port_i(o,v);} diff --git a/GUI/Widgets/Fl_DeviceGUI.h b/GUI/Widgets/Fl_DeviceGUI.h new file mode 100644 index 0000000..3e98251 --- /dev/null +++ b/GUI/Widgets/Fl_DeviceGUI.h @@ -0,0 +1,107 @@ +/* DeviceGUI composite Widget + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include "Fl_DragBar.H" +#include + +#ifndef DEVICEGUI +#define DEVICEGUI + +#define WIRE_COL0 91 +#define WIRE_COL1 FL_GREEN +#define WIRE_COL2 FL_YELLOW +#define WIRE_COL3 FL_BLUE +#define WIRE_COL4 FL_CYAN + +using namespace std; + +static const int TitleBarHeight = 12; +static const int PortGroupWidth = 12; +static const int PortSize=6; + +struct DeviceGUIInfo +{ + int XPos; + int YPos; + int Width; + int Height; + int NumInputs; + int NumOutputs; + vector PortTips; + string Name; + vector PortTypes; +}; + +class Fl_DeviceGUI : public Fl_Group +{ +public: + Fl_DeviceGUI(const DeviceGUIInfo& Info, Fl_Group *PW, Fl_Pixmap *Icon); + + virtual int handle(int event); + virtual void draw(); + + enum PortType {INPUT,OUTPUT}; + + int GetID() { return m_ID; } + void SetID(int s) { m_ID=s; /*DisplayID(s);*/ } + + /*char did[8]; + void DisplayID(int s) { sprintf(did,"%d",s); label(did); }*/ + + bool Killed() { return m_DelMe; } + int GetPortX(int n) { return m_PortVec[n]->x()+PortSize/2; } + int GetPortY(int n) { return m_PortVec[n]->y()+PortSize/2; } + void ForcePortValue(int n, bool v) { m_PortVec[n]->value(v); } + const DeviceGUIInfo* GetInfo() { return &m_Info; } + Fl_Group* GetPluginWindow() { return m_PluginWindow; } + + // automatically called from the constructor, but may be redone at any time. + virtual void Setup(const DeviceGUIInfo& Info, bool FirstTime = false); + virtual void Clear(); + int GetPortType(int n) { return m_Info.PortTypes[n]; } + +protected: + + DeviceGUIInfo m_Info; + + Fl_DragBar* m_DragBar; + Fl_Group* m_PluginWindow; + Fl_Pixmap* m_Icon; + +private: + + inline void cb_Port_i(Fl_Button* o, void* v); + static void cb_Port(Fl_Button* o, void* v); + + vector m_PortVec; + + static int Numbers[512]; + + string m_Name; + int m_ID; + bool m_DelMe; +}; + +#endif diff --git a/GUI/Widgets/Fl_DragBar.H b/GUI/Widgets/Fl_DragBar.H new file mode 100644 index 0000000..6a71588 --- /dev/null +++ b/GUI/Widgets/Fl_DragBar.H @@ -0,0 +1,23 @@ +// generated by Fast Light User Interface Designer (fluid) version 1.0010 + +#ifndef Fl_DragBar_H +#define Fl_DragBar_H +#include +#include +#include +#include + +class Fl_DragBar : public Fl_Widget { + int old_rx,old_ry; + int _type; +public: + enum DragType {WINDRAG=0,NICEWINDRAG,FLDRAG,NICEFLDRAG}; + Fl_DragBar(int x,int y,int w,int h,const char *l=0); + ~Fl_DragBar(); +private: + void draw(); + int handle(int event); +public: + void type(int t); +}; +#endif diff --git a/GUI/Widgets/Fl_DragBar.cxx b/GUI/Widgets/Fl_DragBar.cxx new file mode 100644 index 0000000..ea84825 --- /dev/null +++ b/GUI/Widgets/Fl_DragBar.cxx @@ -0,0 +1,166 @@ +// generated by Fast Light User Interface Designer (fluid) version 1.0010 + +#include "Fl_DragBar.H" +#include + +Fl_DragBar::Fl_DragBar(int x,int y,int w,int h,const char *l): Fl_Widget(x,y,w,h,l) { + _type = Fl_DragBar::NICEFLDRAG; +} + +Fl_DragBar::~Fl_DragBar() { +fl_cursor(FL_CURSOR_DEFAULT); +} + +void Fl_DragBar::draw() { + int ww,hh; + uchar r,g,b; + uchar rb,gb,bb; + uchar rd,gd,bd; + int val; + + draw_box(); + int x1 = x()+5; + int x2 = x()+w()-5; + int y1 = y()+5; + int y2 = y()+h()-5; + Fl::get_color(color(),r,g,b); + val = (int)r + 64; rb = val > 255 ? 255:val; + val = (int)g + 64; gb = val > 255 ? 255:val; + val = (int)b + 64; bb = val > 255 ? 255:val; + val = (int)r - 64; rd = val < 0 ? 0:val; + val = (int)g - 64; gd = val < 0 ? 0:val; + val = (int)b - 64; bd = val < 0 ? 0:val; + if (h()show(); + fl_cursor(FL_CURSOR_MOVE); + if (_type < (int)Fl_DragBar::FLDRAG) + { + old_rx = rx - window()->x(); + old_ry = ry - window()->y(); + } + else + { + old_rx = rx - parent()->x(); + old_ry = ry - parent()->y(); + } + return 1; + } + case FL_RELEASE: + { + fl_cursor(FL_CURSOR_DEFAULT); + do_callback(); + return 1; + } + case FL_DRAG: + { + if ((rx != old_rx) || (ry != old_ry)) + { + xx = rx - old_rx; + yy = ry - old_ry; + if (_type < (int)Fl_DragBar::FLDRAG) + { + window()->position(xx,yy); + } + else + { + parent()->position(xx,yy); + if (parent()->parent()) + parent()->parent()->redraw(); + else + window()->redraw(); + } + } + return 1; + } + case FL_MOVE: + { + return 0; + } + case FL_ENTER : + { + return 0; + } + + case FL_LEAVE : + { + fl_cursor(FL_CURSOR_DEFAULT); + return 1; + } + default : + return 0; + } +} + +void Fl_DragBar::type(int t) { + _type = t; +} diff --git a/GUI/Widgets/Fl_DragBar.fld b/GUI/Widgets/Fl_DragBar.fld new file mode 100644 index 0000000..c008883 --- /dev/null +++ b/GUI/Widgets/Fl_DragBar.fld @@ -0,0 +1,180 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0010 +header_name {.H} +code_name {.cxx} +gridx 2 +gridy 2 +snap 1 +decl {\#include } {public +} + +decl {\#include } {public +} + +decl {\#include } {public +} + +class Fl_DragBar {open : {public Fl_Widget} +} { + decl {int old_rx,old_ry;} {} + decl {int _type;} {} + decl {enum DragType {WINDRAG=0,NICEWINDRAG,FLDRAG,NICEFLDRAG};} {public + } + Function {Fl_DragBar(int x,int y,int w,int h,const char *l=0): Fl_Widget(x,y,w,h,l)} {open + } { + code {_type = Fl_DragBar::NICEFLDRAG;} {} + } + Function {~Fl_DragBar()} {} {} + Function {draw()} {private + } { + code {int ww,hh; + uchar r,g,b; + uchar rb,gb,bb; + uchar rd,gd,bd; + int val; + + draw_box(); + int x1 = x()+5; + int x2 = x()+w()-5; + int y1 = y()+5; + int y2 = y()+h()-5; + Fl::get_color(color(),r,g,b); + val = (int)r + 64; rb = val > 255 ? 255:val; + val = (int)g + 64; gb = val > 255 ? 255:val; + val = (int)b + 64; bb = val > 255 ? 255:val; + val = (int)r - 64; rd = val < 0 ? 0:val; + val = (int)g - 64; gd = val < 0 ? 0:val; + val = (int)b - 64; bd = val < 0 ? 0:val; + if (h()show(); + fl_cursor(FL_CURSOR_MOVE); + if (_type < (int)Fl_DragBar::FLDRAG) + { + old_rx = rx - window()->x(); + old_ry = ry - window()->y(); + } + else + { + old_rx = rx - parent()->x(); + old_ry = ry - parent()->y(); + } + return 1; + } + case FL_RELEASE: + { + fl_cursor(FL_CURSOR_DEFAULT); + do_callback(); + return 1; + } + case FL_DRAG: + { + if ((rx != old_rx) || (ry != old_ry)) + { + xx = rx - old_rx; + yy = ry - old_ry; + if (_type < (int)Fl_DragBar::FLDRAG) + { + window()->position(xx,yy); + } + else + { + parent()->position(xx,yy); + if (parent()->parent()) + parent()->parent()->redraw(); + else + window()->redraw(); + } + } + return 1; + } + case FL_MOVE: + { + return 0; + } + case FL_ENTER : + { + return 0; + } + + case FL_LEAVE : + { + fl_cursor(FL_CURSOR_DEFAULT); + return 1; + } + default : + return 0; + }} {} + } + Function {type(int t)} {} { + code {_type = t;} {} + } +} diff --git a/GUI/comment.xpm b/GUI/comment.xpm new file mode 100644 index 0000000..93a9ce9 --- /dev/null +++ b/GUI/comment.xpm @@ -0,0 +1,40 @@ +/* XPM */ +static char * comment_xpm[] = { +"15 15 22 1", +" c None", +". c #000000", +"+ c #191919", +"@ c #3D3D3D", +"# c #525252", +"$ c #343434", +"% c #FFFFFF", +"& c #FDFDFD", +"* c #080808", +"= c #E1E1E1", +"- c #DBDBDB", +"; c #C0C0C0", +"> c #9A9A9A", +", c #C8C8C8", +"' c #555555", +") c #9F9F9F", +"! c #121212", +"~ c #1F1F1F", +"{ c #ECECEC", +"] c #141414", +"^ c #020202", +"/ c #242424", +" ", +" .+@#.. ", +" ..$%&*.. ", +" ....=-.... ", +" ....;>.... ", +" ....,'.... ", +" ....)!.... ", +" .......... ", +" . ....'~.... ", +" .......>{].. ", +" ... ..^/.. ", +" .. ", +" ", +" .. ", +" "}; diff --git a/GUI/edit.xpm b/GUI/edit.xpm new file mode 100644 index 0000000..5f787cf --- /dev/null +++ b/GUI/edit.xpm @@ -0,0 +1,555 @@ +/* XPM */ +static char * edit_xpm[] = { +"48 51 501 2", +" c None", +". c #0E0F16", +"+ c #191B28", +"@ c #232538", +"# c #2C2F47", +"$ c #323552", +"% c #36395A", +"& c #3C3F65", +"* c #3B3F66", +"= c #000000", +"- c #2E3045", +"; c #7C82BD", +"> c #8389C9", +", c #8389CC", +"' c #8188CD", +") c #7E85CC", +"! c #7C83CA", +"~ c #7980C9", +"{ c #767DC8", +"] c #6F76BF", +"^ c #5E65AA", +"/ c #2A306C", +"( c #2D2F45", +"_ c #868DCF", +": c #838ACE", +"< c #8087CD", +"[ c #7E85CB", +"} c #7B82CA", +"| c #787FC9", +"1 c #757DC7", +"2 c #727AC6", +"3 c #615669", +"4 c #8C5717", +"5 c #333466", +"6 c #1F2131", +"7 c #7F85C7", +"8 c #7E85CA", +"9 c #7D84CB", +"0 c #7A81CA", +"a c #777FC8", +"b c #757CC7", +"c c #7279C6", +"d c #6F76C5", +"e c #5C62A3", +"f c #936E5D", +"g c #BE7210", +"h c #462900", +"i c #111119", +"j c #6E5138", +"k c #564C59", +"l c #7981C9", +"m c #777EC8", +"n c #747BC7", +"o c #7178C5", +"p c #6E76C4", +"q c #6B73C3", +"r c #6970C2", +"s c #636BBE", +"t c #564966", +"u c #C37200", +"v c #8D5200", +"w c #C77400", +"x c #A76E2D", +"y c #555274", +"z c #737AC6", +"A c #7078C5", +"B c #6D75C4", +"C c #6B72C3", +"D c #6870C1", +"E c #5B62AD", +"F c #5259A1", +"G c #2E346F", +"H c #0A0600", +"I c #A66100", +"J c #E28300", +"K c #5F3700", +"L c #696FB0", +"M c #6F77C5", +"N c #6D74C3", +"O c #6A72C2", +"P c #676FC1", +"Q c #646CC0", +"R c #584C60", +"S c #A76920", +"T c #403A5D", +"U c #754400", +"V c #DA7F00", +"W c #E48500", +"X c #DE8100", +"Y c #5A5F9A", +"Z c #6F76C4", +"` c #6C74C3", +" . c #6971C2", +".. c #666EC1", +"+. c #646CBF", +"@. c #6169BE", +"#. c #535AA6", +"$. c #786376", +"%. c #C57715", +"&. c #613900", +"*. c #020100", +"=. c #D77D00", +"-. c #CE7800", +";. c #4B5084", +">. c #6870C2", +",. c #666EC0", +"'. c #636BBF", +"). c #6068BE", +"!. c #5D65BC", +"~. c #5B63BB", +"{. c #575FB8", +"]. c #3F3E71", +"^. c #935600", +"/. c #B76A00", +"(. c #281700", +"_. c #C47200", +":. c #DD8100", +"<. c #3E426F", +"[. c #686FC1", +"}. c #656DC0", +"|. c #626ABF", +"1. c #5F67BD", +"2. c #5A62BB", +"3. c #575FB9", +"4. c #535CB7", +"5. c #303670", +"6. c #512F00", +"7. c #D07900", +"8. c #8E5200", +"9. c #E08300", +"0. c #161723", +"a. c #1A1C2A", +"b. c #0F1019", +"c. c #040407", +"d. c #31355B", +"e. c #5C64BC", +"f. c #5961BA", +"g. c #565FB9", +"h. c #535CB8", +"i. c #5059B6", +"j. c #30366E", +"k. c #190F00", +"l. c #B66A00", +"m. c #D67D00", +"n. c #AE7942", +"o. c #5A5C88", +"p. c #6F76BC", +"q. c #666DB1", +"r. c #555A95", +"s. c #414677", +"t. c #070711", +"u. c #1F223B", +"v. c #585FA9", +"w. c #5C64B5", +"x. c #5C64B8", +"y. c #5861BA", +"z. c #555EB9", +"A. c #535BB8", +"B. c #5058B6", +"C. c #4D56B5", +"D. c #30366C", +"E. c #7C4800", +"F. c #A45F00", +"G. c #805524", +"H. c #5C3808", +"I. c #777EC6", +"J. c #767EC8", +"K. c #7179C6", +"L. c #6D74C1", +"M. c #493013", +"N. c #535283", +"O. c #262B60", +"P. c #111321", +"Q. c #1D2038", +"R. c #1F233E", +"S. c #25294B", +"T. c #2A2E56", +"U. c #303667", +"V. c #353B72", +"W. c #3A4182", +"X. c #3D458D", +"Y. c #2F3569", +"Z. c #C57300", +"`. c #CD7700", +" + c #41456C", +".+ c #777EC7", +"++ c #6E75C4", +"@+ c #6A71C0", +"#+ c #7F5E4E", +"$+ c #A5785E", +"%+ c #2B306C", +"&+ c #010101", +"*+ c #010103", +"=+ c #D87E00", +"-+ c #876655", +";+ c #6066A3", +">+ c #696EBA", +",+ c #CC8127", +"'+ c #3B3B71", +")+ c #965D14", +"!+ c #412601", +"~+ c #6C73C0", +"{+ c #6C73C3", +"]+ c #9A756C", +"^+ c #81593F", +"/+ c #3B3F68", +"(+ c #535996", +"_+ c #5E66BD", +":+ c #6065B4", +"<+ c #C77918", +"[+ c #060300", +"}+ c #473F50", +"|+ c #564547", +"1+ c #666EBF", +"2+ c #626ABE", +"3+ c #5760BA", +"4+ c #986D58", +"5+ c #6E4000", +"6+ c #BE761D", +"7+ c #462F16", +"8+ c #626ABC", +"9+ c #5B64BC", +"0+ c #545CB8", +"a+ c #51529A", +"b+ c #C97608", +"c+ c #080500", +"d+ c #060608", +"e+ c #09090D", +"f+ c #0F0F16", +"g+ c #161722", +"h+ c #1D1E2C", +"i+ c #242637", +"j+ c #292B3F", +"k+ c #242638", +"l+ c #D97E00", +"m+ c #31355F", +"n+ c #6068BD", +"o+ c #5A63BB", +"p+ c #5860BA", +"q+ c #535BB7", +"r+ c #464EA3", +"s+ c #86551F", +"t+ c #6B3F00", +"u+ c #E38400", +"v+ c #787EB3", +"w+ c #868DC9", +"x+ c #8990CF", +"y+ c #8A91D1", +"z+ c #8990D1", +"A+ c #888FD0", +"B+ c #878ED0", +"C+ c #6E75B4", +"D+ c #1D1F41", +"E+ c #965700", +"F+ c #D47B00", +"G+ c #121424", +"H+ c #3C4276", +"I+ c #464D8D", +"J+ c #474E91", +"K+ c #474F96", +"L+ c #474F98", +"M+ c #474F9B", +"N+ c #464E9E", +"O+ c #464EA0", +"P+ c #424A99", +"Q+ c #29222C", +"R+ c #BE6F00", +"S+ c #202233", +"T+ c #181927", +"U+ c #06060A", +"V+ c #D37B00", +"W+ c #DC8000", +"X+ c #BB6D01", +"Y+ c #B68049", +"Z+ c #534C5A", +"`+ c #858CCF", +" @ c #848BCE", +".@ c #67658A", +"+@ c #A9826E", +"@@ c #C17515", +"#@ c #A86200", +"$@ c #050509", +"%@ c #040509", +"&@ c #06060C", +"*@ c #070810", +"=@ c #090A14", +"-@ c #0D0E1D", +";@ c #0D0F1E", +">@ c #05060C", +",@ c #8A5205", +"'@ c #9A828D", +")@ c #7178C3", +"!@ c #686FB7", +"~@ c #6066AA", +"{@ c #565C9C", +"]@ c #4D528C", +"^@ c #242744", +"/@ c #CC7700", +"(@ c #0D0A0A", +"_@ c #7E748B", +":@ c #444258", +"<@ c #8289CD", +"[@ c #6F4611", +"}@ c #8B6758", +"|@ c #2E2F60", +"1@ c #41383F", +"2@ c #AB6811", +"3@ c #6168A8", +"4@ c #676EBE", +"5@ c #4D424F", +"6@ c #76627E", +"7@ c #563922", +"8@ c #B46900", +"9@ c #C67300", +"0@ c #D17900", +"a@ c #D17A00", +"b@ c #B76C04", +"c@ c #996833", +"d@ c #44476A", +"e@ c #8087CC", +"f@ c #7F86CC", +"g@ c #696FAC", +"h@ c #626ABB", +"i@ c #262B61", +"j@ c #3E426B", +"k@ c #4C4968", +"l@ c #676EB5", +"m@ c #646BBD", +"n@ c #574750", +"o@ c #83656A", +"p@ c #684219", +"q@ c #9E5C00", +"r@ c #141520", +"s@ c #6C6A90", +"t@ c #575C8C", +"u@ c #5F649C", +"v@ c #59402C", +"w@ c #947577", +"x@ c #6D4B37", +"y@ c #6B3E00", +"z@ c #784600", +"A@ c #8A5000", +"B@ c #9D5B00", +"C@ c #AB6300", +"D@ c #AB6400", +"E@ c #A05D00", +"F@ c #895000", +"G@ c #834C00", +"H@ c #7F4A00", +"I@ c #7E4900", +"J@ c #7D4800", +"K@ c #7B4800", +"L@ c #7A4700", +"M@ c #724200", +"N@ c #78563A", +"O@ c #433C4F", +"P@ c #4D55AF", +"Q@ c #0E0F20", +"R@ c #1E1F2F", +"S@ c #7C83CB", +"T@ c #595F96", +"U@ c #655662", +"V@ c #806D8B", +"W@ c #523C38", +"X@ c #492B00", +"Y@ c #563200", +"Z@ c #683D00", +"`@ c #774500", +" # c #5A3400", +".# c #66504C", +"+# c #343043", +"@# c #6970C1", +"## c #4A53AB", +"$# c #0B0C1A", +"%# c #23253A", +"&# c #1C2046", +"*# c #525897", +"=# c #6169B5", +"-# c #5E66BC", +";# c #5962BB", +"># c #4851A7", +",# c #070811", +"'# c #2B2E48", +")# c #555DB7", +"!# c #171A3A", +"~# c #5B3500", +"{# c #9A6C46", +"]# c #5A3505", +"^# c #6169BD", +"/# c #565EB9", +"(# c #060710", +"_# c #2F3250", +":# c #7077C5", +"<# c #515AB3", +"[# c #151834", +"}# c #CA7500", +"|# c #8B5101", +"1# c #786577", +"2# c #343456", +"3# c #555DB8", +"4# c #444C9E", +"5# c #06070E", +"6# c #34385A", +"7# c #7179C5", +"8# c #4E56AF", +"9# c #111327", +"0# c #DF8200", +"a# c #DB7F00", +"b# c #C87400", +"c# c #010102", +"d# c #5259A2", +"e# c #5C64B9", +"f# c #5B64BB", +"g# c #515AB7", +"h# c #4F58B6", +"i# c #414998", +"j# c #030307", +"k# c #383C62", +"l# c #6A71C2", +"m# c #0D0E1F", +"n# c #E18300", +"o# c #080910", +"p# c #20233F", +"q# c #282C52", +"r# c #313767", +"s# c #3B417C", +"t# c #424990", +"u# c #474E9D", +"v# c #4850A3", +"w# c #4850A9", +"x# c #3F4691", +"y# c #020204", +"z# c #3C406C", +"A# c #676EC1", +"B# c #5F66B3", +"C# c #5F66B5", +"D# c #4850A6", +"E# c #241A16", +"F# c #653B00", +"G# c #AF6600", +"H# c #05060B", +"I# c #0C0D1A", +"J# c #13152A", +"K# c #181B38", +"L# c #2E2B41", +"M# c #9F631A", +"N# c #C07928", +"O# c #995A03", +"P# c #734300", +"Q# c #3C2300", +"R# c #464B83", +"S# c #3F4273", +"T# c #5A5171", +"U# c #424A9C", +"V# c #030408", +"W# c #4A508E", +"X# c #5C65BC", +"Y# c #3D4590", +"Z# c #4E559A", +"`# c #5760B9", +" $ c #3B4289", +".$ c #5259A4", +"+$ c #545CB6", +"@$ c #373D7E", +"#$ c #555DAF", +"$$ c #545DB8", +"%$ c #5058B2", +"&$ c #323872", +"*$ c #05050A", +"=$ c #555DB4", +"-$ c #525BB7", +";$ c #4C54AE", +">$ c #2F356B", +",$ c #0A0B15", +"'$ c #525AB7", +")$ c #4E57B5", +"!$ c #4951AA", +"~$ c #2B305F", +"{$ c #101123", +"]$ c #5159B7", +"^$ c #4F57B6", +"/$ c #4C55B5", +"($ c #4B54B4", +"_$ c #4A53B4", +":$ c #464EA5", +"<$ c #282D58", +"[$ c #1D203E", +"}$ c #3C427A", +"|$ c #3F4683", +"1$ c #404789", +"2$ c #41488E", +"3$ c #424993", +"4$ c #424A98", +"5$ c #404895", +"6$ c #24294F", +"7$ c #030306", +"8$ c #0C0D19", +"9$ c #101222", +"0$ c #131527", +"a$ c #171A31", +"b$ c #0E101E", +" ", +" ", +" . + @ # $ % & * = ", +" - ; > , ' ) ! ~ { ] ^ / ", +" ( _ : < [ } | 1 2 3 4 5 ", +" 6 7 8 9 0 a b c d e f g h ", +" i j k l m n o p q r s t u v ", +" w x y { z A B C D E F G H I w ", +" J K L b 2 M N O P Q R S T = = U V ", +"W X Y c Z ` ...+.@.#.$.%.&.*. =.-. ", +" ;.p q >.,.'.).!.~.{.].^./.(. _.:. ", +" <.O [.}.|.1.!.2.3.4.5.= 6.7.8. 9. 0.@ a.b.c. ", +" d.P Q @.1.e.f.g.h.i.j.= = k.l.-. m.n.o.! 0 m p.q.r.s.t. ", +" u.v.w.x.~.y.z.A.B.C.D.= = = E.V F. G.H.I.J.n K.L.M.N.O. ", +" P.Q.R.S.T.U.V.W.X.Y.= = Z.`. +.+1 z A ++@+#+$+%+ ", +" = = = = = = = &+*+= = =+-+;+c M N O P >+,+'+= ", +" = = = = = = = = = )+!+~+{+ ...+.@.]+^+= ", +" = = = = = = /+(+O D }.'.)._+:+<+[+= ", +" }+|+1+Q 2+1.!.2.3+4+5+= ", +" -.6+7+8+@._+9+f.g.0+a+b+c+ ", +" d+e+f+g+h+i+j+k+ J l+ m+|.n+!.o+p+z.q+i.r+s+t+ ", +"W u+X v+w+x+y+z+A+B+_ C+D+E+9.F+ G+H+I+J+K+L+M+N+O+P+Q+R+S+T+b.U+ ", +" V+W+X X+Y+Z+A+B+_ `+ @.@+@@@#@ = $@%@&@&@*@=@-@;@>@,@'@m b )@!@~@{@]@^@ ", +"l+/@ (@_@:@`+ @: <@' [@}@|@= = = = = = = = = = 1@2@3@K.M B q 4@5@6@7@ ", +" 8@9@0@a@b@c@d@<@' e@f@[ g@h@i@= = = = = = = = = = j@k@l@++` O D m@n@o@p@v q@", +" r@s@t@f@[ 9 ! u@v@w@x@y@z@A@B@C@ D@E@^.F@G@H@I@J@K@L@M@N@O@` O >...Q |.).P@Q@ ", +" R@) 9 S@} 0 ~ T@U@V@W@X@Y@Z@ `@M@ #.#+#@#P }.'.@.1.!.##$#= ", +" %#} 0 ~ | m { b n y.&#= = = *#=#,.+.2+n+-#9+;#>#,#= ", +" '#| m { b n z c o )#!#= = ~#{#]#^#)._+e.2.p+/#r+(#= ", +" _#1 n z c o :#Z ++<#[#= = }#l+F+|#1#2#1.!.~.f.3.3#q+4#5#= ", +" 6#2 7#:#Z ++N {+C 8#9#= = F+0#a#b# c#d#e#f#2.3+z.h.g#h#i#j#= ", +" k#M p B {+C l#r [.##m#= = l+n#X /@ o#p#q#r#s#t#u#v#w#x#y#= ", +" z#` q O .D A#B#C#D#E#F#G#7.a@_. = = = = c#H#I#J#K#= = ", +" s. .D P ,.}.+.L#M#N#O#P#Q# = = = = = = = = = = ", +" R#,.}.+.'.2+@.S#T#U#V#= = = = = = = = = ", +" W#'.2+@.n+1.-#X#~.Y#*+= = ", +" Z#).1._+!.e.o+;#`# $= = = ", +" .$!.e.~.2.f.3+g.+$@$= = ", +" c##$2.f.p+3.z.$$h.%$&$= = ", +" *$=$3./#3#0+-$g#i.;$>$= = ", +" ,$3#0+q+'$i.h#)$C.!$~$= = ", +" {$'$]$B.^$C./$($_$:$<$= = ", +" *$[$}$|$1$2$3$4$U#5$6$= = ", +" y#7$&@,$8$9$0$a$b$= = ", +" = = = = = = = = = ", +" = = = = = = = = ", +" ", +" ", +" ", +" ", +" "}; diff --git a/GUI/load.xpm b/GUI/load.xpm new file mode 100644 index 0000000..8965ec2 --- /dev/null +++ b/GUI/load.xpm @@ -0,0 +1,954 @@ +/* XPM */ +static char * load_xpm[] = { +"50 70 881 2", +" c None", +". c #E08300", +"+ c #E08200", +"@ c #E68600", +"# c #E88700", +"$ c #E28400", +"% c #DB7F00", +"& c #E48500", +"* c #E28300", +"= c #DF8100", +"- c #E58500", +"; c #C47200", +"> c #000000", +", c #DF8200", +"' c #B26800", +") c #D47B00", +"! c #A35F00", +"~ c #BD6E00", +"{ c #884F00", +"] c #353747", +"^ c #53566F", +"/ c #3F4155", +"( c #2D2F3D", +"_ c #1A1B21", +": c #A15E00", +"< c #7D4900", +"[ c #3D3F52", +"} c #959BCD", +"| c #7C83C0", +"1 c #9BA1D8", +"2 c #AEB3DF", +"3 c #EBEBED", +"4 c #E0E0E3", +"5 c #CECFD1", +"6 c #BFBFC0", +"7 c #ADADAE", +"8 c #A1A1A2", +"9 c #949494", +"0 c #888888", +"a c #7C7C7C", +"b c #6E6E6E", +"c c #5D5D5D", +"d c #4E4E4E", +"e c #373737", +"f c #563A13", +"g c #E78600", +"h c #5A3606", +"i c #0B0C12", +"j c #151622", +"k c #6A6E8F", +"l c #7B82C1", +"m c #282F68", +"n c #8D93C9", +"o c #B1B6E0", +"p c #EFEFEF", +"q c #EEEEEE", +"r c #ECECEC", +"s c #EBEBEB", +"t c #EAEAEA", +"u c #E9E9E9", +"v c #E7E7E7", +"w c #E5E5E5", +"x c #E0E0E0", +"y c #D7D7D7", +"z c #C8C8C8", +"A c #B1B1B1", +"B c #9C9386", +"C c #DE860C", +"D c #56402E", +"E c #393C5D", +"F c #505482", +"G c #262949", +"H c #878DB8", +"I c #989FD6", +"J c #7277A4", +"K c #9CA2D7", +"L c #B8BCE1", +"M c #EDEDED", +"N c #E8E8E8", +"O c #E6E6E6", +"P c #E4E4E4", +"Q c #D9D9D9", +"R c #CDCDCD", +"S c #B9B8B6", +"T c #D88E28", +"U c #47352F", +"V c #33375C", +"W c #505585", +"X c #3D4481", +"Y c #06070F", +"Z c #0F0F14", +"` c #9EA4D8", +" . c #A0A6DC", +".. c #9FA5DB", +"+. c #9DA4DA", +"@. c #C1C4E2", +"#. c #C2C2C2", +"$. c #D8D8D8", +"%. c #DCDCDC", +"&. c #DEDEDE", +"*. c #DFDFDF", +"=. c #D5A157", +"-. c #2A2537", +";. c #353960", +">. c #515687", +",. c #353D7D", +"'. c #060710", +"). c #333546", +"!. c #9FA6DB", +"~. c #9EA4DB", +"{. c #9DA3DA", +"]. c #9CA2DA", +"^. c #CACDE4", +"/. c #E2E2E2", +"(. c #D0D0D0", +"_. c #C7C7C7", +":. c #BDBDBD", +"<. c #B7B7B7", +"[. c #B3B3B3", +"}. c #AAAAAA", +"|. c #B6986E", +"1. c #E88802", +"2. c #E18300", +"3. c #4B2E06", +"4. c #BC6E02", +"5. c #E18302", +"6. c #2D2C40", +"7. c #3C4066", +"8. c #515689", +"9. c #2B316C", +"0. c #000001", +"a. c #4C4E68", +"b. c #9BA2DA", +"c. c #9AA1D9", +"d. c #D5D7E5", +"e. c #DDDDDD", +"f. c #D1C4B3", +"g. c #E68B0D", +"h. c #66400A", +"i. c #121212", +"j. c #221D15", +"k. c #AA6709", +"l. c #DA8004", +"m. c #2C2E49", +"n. c #3F436B", +"o. c #4C5186", +"p. c #222859", +"q. c #676B8E", +"r. c #9CA3DA", +"s. c #9BA1D9", +"t. c #9AA0D9", +"u. c #999FD8", +"v. c #E0E1E7", +"w. c #BBBBBB", +"x. c #B6B6B6", +"y. c #B5B5B5", +"z. c #C0C0C0", +"A. c #CBC7C2", +"B. c #E29426", +"C. c #9D5F09", +"D. c #1B1B1B", +"E. c #242424", +"F. c #2A2A2A", +"G. c #302F2C", +"H. c #8F5C17", +"I. c #C4760C", +"J. c #313352", +"K. c #434771", +"L. c #474D84", +"M. c #1B1F45", +"N. c #878DBD", +"O. c #99A0D9", +"P. c #989FD8", +"Q. c #9CA2D9", +"R. c #E6E6E7", +"S. c #E3E3E3", +"T. c #DADADA", +"U. c #CBCBCB", +"V. c #C48937", +"W. c #CB7703", +"X. c #26221C", +"Y. c #2B2B2B", +"Z. c #3B3B3B", +"`. c #454545", +" + c #484848", +".+ c #323446", +"++ c #6F4E2F", +"@+ c #B87116", +"#+ c #383B5F", +"$+ c #474C7A", +"%+ c #434984", +"&+ c #151937", +"*+ c #1A1B24", +"=+ c #999FD7", +"-+ c #989ED8", +";+ c #979DD7", +">+ c #A8ADDA", +",+ c #D1D1D1", +"'+ c #CECECE", +")+ c #D2D2D2", +"!+ c #D5B17F", +"~+ c #E38501", +"{+ c #463318", +"]+ c #292929", +"^+ c #383838", +"/+ c #4A4A4A", +"(+ c #636363", +"_+ c #686868", +":+ c #424565", +"<+ c #393D61", +"[+ c #3F4062", +"}+ c #414671", +"|+ c #4D5286", +"1+ c #404785", +"2+ c #101228", +"3+ c #3A3D53", +"4+ c #969DD7", +"5+ c #959CD7", +"6+ c #B5B8DC", +"7+ c #C5C5C5", +"8+ c #B2B2B2", +"9+ c #ADADAD", +"0+ c #B6A389", +"a+ c #E78907", +"b+ c #794D11", +"c+ c #414141", +"d+ c #5A5A5A", +"e+ c #717171", +"f+ c #818181", +"g+ c #838486", +"h+ c #4F5484", +"i+ c #4A4F7F", +"j+ c #494E7E", +"k+ c #4D5285", +"l+ c #555A94", +"m+ c #3E4588", +"n+ c #0A0B1A", +"o+ c #535675", +"p+ c #979ED8", +"q+ c #969CD7", +"r+ c #959BD7", +"s+ c #949AD6", +"t+ c #C1C4DD", +"u+ c #E1E1E1", +"v+ c #DBDBDB", +"w+ c #D5D5D5", +"x+ c #CEC8C0", +"y+ c #E3901D", +"z+ c #AB6606", +"A+ c #232221", +"B+ c #393939", +"C+ c #565656", +"D+ c #727272", +"E+ c #8A8A8A", +"F+ c #999999", +"G+ c #94959E", +"H+ c #5C629E", +"I+ c #585E99", +"J+ c #565C96", +"K+ c #585E9A", +"L+ c #5C63A3", +"M+ c #3C448A", +"N+ c #04050B", +"O+ c #7176A2", +"P+ c #949BD6", +"Q+ c #939AD6", +"R+ c #9299D5", +"S+ c #CED0DF", +"T+ c #D6D6D6", +"U+ c #CECDCB", +"V+ c #DF9A3A", +"W+ c #D17B03", +"X+ c #31291F", +"Y+ c #313131", +"Z+ c #434343", +"`+ c #595959", +" @ c #6F6F6F", +".@ c #838383", +"+@ c #ABABAB", +"@@ c #9A9CB0", +"#@ c #666DB1", +"$@ c #636AAD", +"%@ c #6167AA", +"&@ c #6167AB", +"*@ c #6369B0", +"=@ c #373F86", +"-@ c #010102", +";@ c #8D93CB", +">@ c #9399D6", +",@ c #9298D5", +"'@ c #DADBDF", +")@ c #AFAFAF", +"!@ c #A7A7A7", +"~@ c #C99B5A", +"{@ c #E58600", +"]@ c #553B17", +"^@ c #2F2F2F", +"/@ c #474747", +"(@ c #646464", +"_@ c #9A9A9A", +":@ c #999CBA", +"<@ c #6C73BC", +"[@ c #6970BA", +"}@ c #676EB7", +"|@ c #666EB7", +"1@ c #666DB8", +"2@ c #303779", +"3@ c #2B2D3E", +"4@ c #9399D5", +"5@ c #9198D5", +"6@ c #9097D4", +"7@ c #999FD5", +"8@ c #DEDEDF", +"9@ c #D2B58C", +"0@ c #89540A", +"a@ c #3D3D3D", +"b@ c #5C5C5C", +"c@ c #7A7A7A", +"d@ c #A8A8A8", +"e@ c #9296C0", +"f@ c #6E75C1", +"g@ c #6C73C0", +"h@ c #6A72BF", +"i@ c #6971BE", +"j@ c #646CBA", +"k@ c #2A306C", +"l@ c #454865", +"m@ c #9096D4", +"n@ c #8E95D4", +"o@ c #A7ABD6", +"p@ c #D4D4D4", +"q@ c #D0C2AE", +"r@ c #E68C0E", +"s@ c #BD7006", +"t@ c #282622", +"u@ c #343434", +"v@ c #747474", +"w@ c #909090", +"x@ c #BABABA", +"y@ c #888DC2", +"z@ c #6E75C4", +"A@ c #6C74C3", +"B@ c #6B72C2", +"C@ c #6A71C1", +"D@ c #5F67B8", +"E@ c #252A5F", +"F@ c #62668F", +"G@ c #9197D5", +"H@ c #8F96D4", +"I@ c #8E95D3", +"J@ c #8D94D3", +"K@ c #B5B8D7", +"L@ c #BCBCBC", +"M@ c #A6A6A6", +"N@ c #AA8D65", +"O@ c #E68703", +"P@ c #DC8002", +"Q@ c #3D2F1C", +"R@ c #323232", +"S@ c #4C4C4C", +"T@ c #696969", +"U@ c #858585", +"V@ c #9D9D9D", +"W@ c #AEAEAE", +"X@ c #BEBEBE", +"Y@ c #7E84C3", +"Z@ c #6D75C4", +"`@ c #6C73C3", +" # c #6A72C3", +".# c #6971C2", +"+# c #5B63B4", +"@# c #202551", +"## c #8187BE", +"$# c #8E94D3", +"%# c #8D93D3", +"&# c #8B92D2", +"*# c #C3C5D8", +"=# c #D3D3D3", +"-# c #B1A18A", +";# c #D88818", +"># c #644212", +",# c #2C2C2C", +"'# c #444444", +")# c #616161", +"!# c #7D7D7D", +"~# c #979797", +"{# c #A9A9A9", +"]# c #BDBDBE", +"^# c #737AC3", +"/# c #6B73C3", +"(# c #686FC2", +"_# c #555EAF", +":# c #1A1F44", +"<# c #202230", +"[# c #8C93D3", +"}# c #8A91D1", +"|# c #D0D1D9", +"1# c #B8B8B8", +"2# c #A0A0A0", +"3# c #85827E", +"4# c #AE782C", +"5# c #E68601", +"6# c #9E610C", +"7# c #252524", +"8# c #5F5F5F", +"9# c #767676", +"0# c #B9B9B9", +"a# c #B8B8BD", +"b# c #6A71C3", +"c# c #6970C2", +"d# c #676FC1", +"e# c #666EC1", +"f# c #5059AA", +"g# c #151836", +"h# c #3D405B", +"i# c #8C93D2", +"j# c #8B91D2", +"k# c #8990D1", +"l# c #8C92D1", +"m# c #D6D6D8", +"n# c #A2A2A2", +"o# c #666666", +"p# c #745C3A", +"q# c #D27E08", +"r# c #CE7B07", +"s# c #38332C", +"t# c #3C3C3C", +"u# c #535353", +"v# c #898989", +"w# c #9C9C9C", +"x# c #9E9E9E", +"y# c #989898", +"z# c #AEB0BC", +"A# c #6A71C2", +"B# c #6870C2", +"C# c #656CC0", +"D# c #4C54A6", +"E# c #0F1228", +"F# c #575B83", +"G# c #8C92D2", +"H# c #8A91D2", +"I# c #888FD1", +"J# c #878ED0", +"K# c #A9ADD2", +"L# c #C1C2D4", +"M# c #CFCFD3", +"N# c #CFCFCF", +"O# c #929292", +"P# c #777777", +"Q# c #5E5E5E", +"R# c #534E48", +"S# c #5B4D3A", +"T# c #6A6A6A", +"U# c #A4A6BC", +"V# c #676EC1", +"W# c #656DC1", +"X# c #646CC0", +"Y# c #636BBF", +"Z# c #4750A2", +"`# c #0B0D1C", +" $ c #787EB5", +".$ c #888ED0", +"+$ c #868DD0", +"@$ c #858CCF", +"#$ c #848BCF", +"$$ c #838ACE", +"%$ c #8289CD", +"&$ c #8B91CB", +"*$ c #979CC8", +"=$ c #A0A3C0", +"-$ c #A3A5B4", +";$ c #9E9FA2", +">$ c #8D8D8D", +",$ c #787878", +"'$ c #626262", +")$ c #969696", +"!$ c #999CBC", +"~$ c #656DC0", +"{$ c #6169BF", +"]$ c #434C9E", +"^$ c #181924", +"/$ c #8990D0", +"($ c #8289CE", +"_$ c #8188CD", +":$ c #8087CD", +"<$ c #7E85CB", +"[$ c #7B82C8", +"}$ c #777EC4", +"|$ c #7278BC", +"1$ c #6C72B0", +"2$ c #6C71A2", +"3$ c #6C7093", +"4$ c #6D6F86", +"5$ c #72737F", +"6$ c #7D7D7F", +"7$ c #A5A5A5", +"8$ c #B0B0B0", +"9$ c #8F93BC", +"0$ c #636BC0", +"a$ c #626ABF", +"b$ c #6169BE", +"c$ c #6068BE", +"d$ c #3F4898", +"e$ c #020306", +"f$ c #383A55", +"g$ c #868CCF", +"h$ c #7F86CC", +"i$ c #787FC4", +"j$ c #757CC1", +"k$ c #7A81C8", +"l$ c #787FC7", +"m$ c #757BC2", +"n$ c #7077BC", +"o$ c #6A71B3", +"p$ c #636AA9", +"q$ c #5D63A0", +"r$ c #5A609B", +"s$ c #5B619C", +"t$ c #686DA1", +"u$ c #7C80AA", +"v$ c #9194B1", +"w$ c #A6A7B7", +"x$ c #B6B6B9", +"y$ c #8388BC", +"z$ c #5F68BE", +"A$ c #5E66BD", +"B$ c #3A428F", +"C$ c #51557C", +"D$ c #6D74B3", +"E$ c #636689", +"F$ c #686977", +"G$ c #67697E", +"H$ c #6B6E8D", +"I$ c #6D719C", +"J$ c #6D72A9", +"K$ c #6C72B4", +"L$ c #6B71B8", +"M$ c #676EB3", +"N$ c #646BB0", +"O$ c #646AB0", +"P$ c #646BB3", +"Q$ c #666DB7", +"R$ c #686FBC", +"S$ c #6970BF", +"T$ c #6C74C1", +"U$ c #7980C0", +"V$ c #898DBE", +"W$ c #989BBB", +"X$ c #A6A8B8", +"Y$ c #A1A3B7", +"Z$ c #6870BE", +"`$ c #5F67BE", +" % c #5C64BC", +".% c #32397E", +"+% c #7176AF", +"@% c #747BBE", +"#% c #686978", +"$% c #757575", +"%% c #777A99", +"&% c #797B8D", +"*% c #7A7B7E", +"=% c #7B7B7B", +"-% c #7A7A7B", +";% c #767780", +">% c #73758C", +",% c #6F7398", +"'% c #6B70A5", +")% c #666DB3", +"!% c #6970BE", +"~% c #6971C0", +"{% c #6970C1", +"]% c #5F67BD", +"^% c #5961B9", +"/% c #2C3372", +"(% c #181925", +"_% c #838ACD", +":% c #7E86CC", +"<% c #6B709E", +"[% c #797979", +"}% c #747581", +"|% c #777EC8", +"1% c #767DC8", +"2% c #757CC7", +"3% c #757BB9", +"4% c #777BA8", +"5% c #7F7F80", +"6% c #808080", +"7% c #828282", +"8% c #7C7D88", +"9% c #757895", +"0% c #6B70A0", +"a% c #5F66AA", +"b% c #6068B7", +"c% c #646CBF", +"d% c #5E67BD", +"e% c #5D65BD", +"f% c #5B63BC", +"g% c #565EB6", +"h% c #282E67", +"i% c #363955", +"j% c #7F86CD", +"k% c #7E85CC", +"l% c #7C83CA", +"m% c #676981", +"n% c #737695", +"o% c #757DC8", +"p% c #747CC7", +"q% c #737AC7", +"r% c #7279C6", +"s% c #747ABA", +"t% c #848484", +"u% c #868686", +"v% c #8C8C8C", +"w% c #8B8B8C", +"x% c #717384", +"y% c #555A99", +"z% c #545BA5", +"A% c #555CA8", +"B% c #5A62B4", +"C% c #5A63BB", +"D% c #5961BB", +"E% c #525AB2", +"F% c #242A5D", +"G% c #51557F", +"H% c #8188CE", +"I% c #7C84CB", +"J% c #73737A", +"K% c #7075AB", +"L% c #747BC7", +"M% c #7179C6", +"N% c #7078C6", +"O% c #787CAC", +"P% c #878787", +"Q% c #8B8B8B", +"R% c #8E8E8E", +"S% c #8F8F8F", +"T% c #6E7193", +"U% c #5C64B9", +"V% c #535BA8", +"W% c #535AA8", +"X% c #5A62BB", +"Y% c #5860BA", +"Z% c #4F57AF", +"`% c #1E234F", +" & c #7076B3", +".& c #7D85CC", +"+& c #7C83CB", +"@& c #7B82CB", +"#& c #62689E", +"$& c #7C7C7D", +"%& c #7E7E7E", +"&& c #7F7F7F", +"*& c #79797C", +"=& c #7279C1", +"-& c #727AC7", +";& c #7077C5", +">& c #6F76C5", +",& c #7E819E", +"'& c #939393", +")& c #757789", +"!& c #5D66BD", +"~& c #4F56A2", +"{& c #5760BA", +"]& c #565EB9", +"^& c #4B54AC", +"/& c #1B1F46", +"(& c #1E2030", +"_& c #7F86CB", +":& c #7D84CB", +"<& c #7B82CA", +"[& c #7981CA", +"}& c #65688E", +"|& c #737589", +"1& c #7178C6", +"2& c #6F77C5", +"3& c #6E76C5", +"4& c #858693", +"5& c #959595", +"6& c #777988", +"7& c #5962BB", +"8& c #5158A8", +"9& c #545DB4", +"0& c #545DB9", +"a& c #4851A8", +"b& c #181C3E", +"c& c #393D5D", +"d& c #7B83CB", +"e& c #7A82CA", +"f& c #7980CA", +"g& c #767EC7", +"h& c #696B80", +"i& c #6E729B", +"j& c #6E76C4", +"k& c #6D74C4", +"l& c #6E75BE", +"m& c #8B8B8D", +"n& c #919191", +"o& c #71738E", +"p& c #5B64BC", +"q& c #4E56A4", +"r& c #555DB8", +"s& c #545CB9", +"t& c #535BB8", +"u& c #464EA5", +"v& c #131631", +"w& c #3F4367", +"x& c #7A81CA", +"y& c #7980C9", +"z& c #777FC9", +"A& c #6A71B6", +"B& c #797A81", +"C& c #696FAE", +"D& c #6C74C4", +"E& c #757AB3", +"F& c #666A94", +"G& c #565FB9", +"H& c #4D54A2", +"I& c #545CB8", +"J& c #525BB8", +"K& c #515AB7", +"L& c #434CA2", +"M& c #0F1227", +"N& c #292C44", +"O& c #7880C9", +"P& c #777EC9", +"Q& c #6268A5", +"R& c #78787F", +"S& c #6E75C3", +"T& c #6B72C3", +"U& c #7D81A8", +"V& c #9B9B9B", +"W& c #5A5F9B", +"X& c #5861BA", +"Y& c #575FBA", +"Z& c #555DB9", +"`& c #4B53A1", +" * c #5159B7", +".* c #5058B6", +"+* c #414AA0", +"@* c #0D0F21", +"#* c #5D629A", +"$* c #787FC9", +"%* c #666A96", +"&* c #6F728D", +"** c #87899E", +"=* c #565DA9", +"-* c #4B52A1", +";* c #4F58B6", +">* c #4E57B6", +",* c #3F489D", +"'* c #070813", +")* c #0E0F1B", +"!* c #434B90", +"~* c #575FAD", +"{* c #646CB9", +"]* c #4951A0", +"^* c #676A89", +"/* c #666B9C", +"(* c #686FC0", +"_* c #929297", +":* c #9F9F9F", +"<* c #87878C", +"[* c #565EB7", +"}* c #555EB9", +"|* c #4A51A2", +"1* c #4E56B6", +"2* c #4D55B5", +"3* c #3D469A", +"4* c #05060D", +"5* c #191D40", +"6* c #202552", +"7* c #434346", +"8* c #808081", +"9* c #88898A", +"0* c #7F829B", +"a* c #797EB0", +"b* c #6F76BA", +"c* c #6870C1", +"d* c #6F75B8", +"e* c #A1A1A1", +"f* c #797B8F", +"g* c #4F57B3", +"h* c #4A51A4", +"i* c #4D56B5", +"j* c #4C55B5", +"k* c #4B54B4", +"l* c #3B4497", +"m* c #020205", +"n* c #030304", +"o* c #202022", +"p* c #38393B", +"q* c #545458", +"r* c #707173", +"s* c #7F7F81", +"t* c #89898C", +"u* c #8F8F98", +"v* c #888BA3", +"w* c #898BA4", +"x* c #A4A4A4", +"y* c #6B6F93", +"z* c #535CB8", +"A* c #525AB8", +"B* c #4B53AA", +"C* c #4A52AB", +"D* c #4B53B4", +"E* c #4952B4", +"F* c #373F8C", +"G* c #040405", +"H* c #171719", +"I* c #303134", +"J* c #4B4B4E", +"K* c #69696F", +"L* c #7D7E82", +"M* c #898A8E", +"N* c #95969A", +"O* c #9D9D9E", +"P* c #5C6197", +"Q* c #525AB7", +"R* c #5059B7", +"S* c #4850A3", +"T* c #4B53B2", +"U* c #4A53B4", +"V* c #4952B3", +"W* c #4851B3", +"X* c #353D88", +"Y* c #010101", +"Z* c #0F1011", +"`* c #29292B", +" = c #424246", +".= c #606167", +"+= c #7C7D84", +"@= c #88898F", +"#= c #97979E", +"$= c #A2A3A5", +"%= c #4F559D", +"&= c #4F57B6", +"*= c #474EA0", +"== c #4951B3", +"-= c #4750B3", +";= c #464FB1", +">= c #2F3679", +",= c #0A0A0D", +"'= c #222226", +")= c #3A3A3C", +"!= c #575860", +"~= c #767781", +"{= c #878890", +"]= c #9798A0", +"^= c #8D8E92", +"/= c #474E94", +"(= c #4E56AF", +"_= c #4F57B5", +":= c #454C9E", +"<= c #464FB2", +"[= c #444DB0", +"}= c #2E3577", +"|= c #050507", +"1= c #1A1B1F", +"2= c #333337", +"3= c #47484E", +"4= c #262835", +"5= c #191C3F", +"6= c #2B3169", +"7= c #3F4794", +"8= c #474FA7", +"9= c #4750B2", +"0= c #464EB2", +"a= c #444DB1", +"b= c #424AAC", +"c= c #282E68", +"d= c #0E1024", +"e= c #242857", +"f= c #414AA8", +"g= c #434CB0", +"h= c #3E47A4", +"i= c #212654", +"j= c #374091", +"k= c #394294", +"l= c #12152E", +"m= c #010204", +"n= c #080A16", +" ", +" ", +" ", +" ", +" ", +" . ", +" + @ # # ", +" $ # # # # # # ", +" % & # # # # # # # # * ", +" = - # # # # # # # # # # # % ", +" @ # # # # # # # # # # # # # # ; > ", +" , # # # # # # # # # # # # # # ' > ", +" ) # # # # # # # # # # # # # ! > ", +" ~ # # # # # # # # # # # # { > ", +" ] ^ / ( _ : # # # # # # # # # # # < > ", +" [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e f g # # # # # # # # # # h i j ", +" k l m n o p q r s t u v w x y z A B C # # # # # # # # # # # D E F G ", +" H I J K L M r s t N v O P x Q R S T # # # # # # # # # # # # U V W X Y ", +" Z ` ...+.@.r y #.z R $.%.&.*.$.R =.# # # # # # # # # # # # # -.;.>.,.'. ", +" ).!.~.{.].^.t O /.$.(._.:.<.[.}.|.1.# # # # # # 2.3.4.# # # 5.6.7.8.9.0.> ", +" a.~.{.b.c.d.u v O w P /.x e.y f.g.# # # # # # # h.i.j.k.# # l.m.n.o.p.> > ", +" q.r.s.t.u.v.w w.<.x.y.<.z.z A.B.# # # # # # # C.D.E.F.G.H.# I.J.K.L.M.> > ", +" N.s.O.P.Q.R.O P S./.x T.U.<.V.# # # # # # # W.X.Y.Z.`. +.+++@+#+$+%+&+> > ", +" *+=+O.-+;+>+w ,+'+%.x &.T.)+!+# # # # # # # ~+{+]+^+/+(+_+:+<+[+}+|+1+2+> > ", +" 3+u.-+4+5+6+P T.7+x.8+9+}.0+a+# # # # # # # b+Y.c+d+e+f+g+h+i+j+k+l+m+n+> > ", +" o+p+q+r+s+t+/.u+x &.v+w+x+y+# # # # # # # z+A+B+C+D+E+F+G+H+I+J+K+L+M+N+> ", +" O+q+P+Q+R+S+x &.&.v+T+U+V+# # # # # # # W+X+Y+Z+`+ @.@+@@@#@$@%@&@*@=@-@> ", +" ;@P+>@,@,@'@,+[.)@+@!@~@# # # # # # # {@]@^@/@(@f+_@+@y.:@<@[@}@|@1@2@> > ", +" 3@s+4@5@6@7@8@e.v+$.,+9@1.# # # # # # # 0@E.a@b@c@9 d@y.w.e@f@g@h@i@j@k@> > ", +" l@R+5@m@n@o@e.)+Q p@q@r@# # # # # # # s@t@u@ +b@v@.@w@x@:.y@z@A@B@C@D@E@> > ", +" F@G@H@I@J@K@%.L@}.M@N@O@# # # # # # P@Q@R@S@T@U@V@W@<.L@X@Y@Z@`@ #.#+#@#> > ", +" ##H@$#%#&#*#T.$.=#U.L@-#;## # # # # >#,#'#)#!#~#{#y.w.:.]#^#/# #.#(#_#:#> > ", +" <#I@J@[#&#}#|#$.T+,+z 1#2#3#4#5## # 6#7#R@/@8#9#9 W@0#L@:.a#A@b#c#d#e#f#g#> > ", +" h#J@i#j#k#l#m#y w+(._.0#n#U@o#p#q#r#s#t#u#b v#w#x#y#y#M@L@z#A#B#d#e#C#D#E#> ", +" F#G#H#k#I#J#K#L#M#N#z L@}.O#P#Q#R#S#`.u#T#.@F+}.y.x@w.L@w.U#B#V#W#X#Y#Z#`#> ", +" $H#k#.$+$@$#$$$%$&$*$=$-$;$>$,$_+8#'$b f+)$M@8+1#w.w.x@0#!$e#~$X#Y#{$]$'.> ", +" ^$/$I#J#+$@$$$($_$:$<$[$}$|$1$2$3$4$5$6$0 )$7$8$x.x@w.x@0#1#9$~$0$a$b$c$d$e$> ", +" f$I#J#g$#$$$($_$h$i$j$k$l$m$n$o$p$q$r$s$t$u$v$w$x$x@x@0#<.x.y$Y#a$b$z$A$B$> > ", +" C$+$@$#$$$($:$D$E$F$F$G$H$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$a$c$`$A$ %.%> > ", +" +%@$#$($_$:$@%#%$%9#9#%%&%*%=%-%;%>%,%'%)%!%~%{%B#d#e#~$X#a${$c$]%A$ %^%/%> > ", +" (%_%$$($_$:$:%<%9#,$[%}%|%1%2%3%4%5%6%f+7%.@8%9%0%a%b%c%0$a$b$c$d%e% %f%g%h%> > ", +" i%$$($_$j%k%l%m%[%c@=%n%o%p%q%r%s%.@t%U@u%0 v#E+v%w%x%y%z%z%A%B%e% %C%D%E%F%> > ", +" G%H%:$h$k%I%o$J%=%a !#K%L%q%M%N%O%u%P%0 v#Q%v%>$R%S%w@T%c$`$U%V%W%X%D%Y%Z%`%> > ", +" &:$h$.&+&@&#&$&%&&&*&=&-&M%;&>&,&0 v#Q%v%>$R%S%w@O#'&)&]%!& %f%~&Y%{&]&^&/&> > ", +" (&_&k%:&+&<&[&}&&&6%f+|&r%1&2&3&Z@4&Q%v%>$R%S%w@O#'&9 5&6&e% %f%7&8&9&]&0&a&b&> > ", +" c&k%:&d&e&f&g&h&f+7%t%i&N%2&j&k&l&m&>$R%S%n&O#'&9 5&)$y#o&p&X%D%Y%q&r&s&t&u&v&> ", +" w&I%@&x&y&z&A&B&t%U@.@C&>&z@D&/#E&R%S%n&O#'&9 5&)$y#F+_@F&X%D%{&G&H&I&J&K&L&M&> ", +" N&<&x&O&P&1%Q&U@u%P%R&S&Z@D&T&A#U&n&O#'&9 5&)$y#F+_@V&V&W&X&Y&]&Z&`&J& *.*+*@*> ", +" #*$*P&1%p%%*P%0 E+&*Z@`@ #.#B#**'&9 5&~#y#F+_@V&w#x#9 =*Y&]&0&t&-* *;*>*,*'*> ", +" )*!*~*{*]*^*E+Q%v%/*/# #.#(#(*_*5&~#y#F+_@V&w#x#:*2#<*[*}*I&t&K&|*;*1*2*3*4*> ", +" e$@*5*6*7*8*9*>$0*a*b*c*e#d*~#y#F+_@V&w#x#:*2#e*n#f*Z&I&J&K&g*h*i*j*k*l*m*> ", +" > > > n*o*p*q*r*s*t*u*v*w*F+_@V&V@x#:*2#e*n#x*7$y*z*A* *.*B*C*j*D*E*F*-@> ", +" > > > > > G*H*I*J*K*L*M*N*O*:*2#e*n#x*7$M@!@P*Q*R*;*>*S*T*U*V*W*X*0.> ", +" > > > > > Y*Z*`* =.=+=@=#=$=M@!@d@M@%=R*&=1*j**=U*==-=;=>=> > ", +" > > > > > > > ,='=)=!=~={=]=^=/=(=_=j*D*:=W*-=<=[=}=> > ", +" > > > > > > > |=1=2=3=4=5=6=7=8=:=9=0=a=b=c=> > ", +" > > > > > > > > > m*d=e=f=[=g=h=i=> > ", +" > > > > > > > > M.k@j=k=l=> > ", +" > > > m=n=> > > ", +" > > > > ", +" > > ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/GUI/new.xpm b/GUI/new.xpm new file mode 100644 index 0000000..cd844f0 --- /dev/null +++ b/GUI/new.xpm @@ -0,0 +1,242 @@ +/* XPM */ +static char * new_xpm[] = { +"48 61 178 2", +" c None", +". c #000000", +"+ c #161616", +"@ c #9E9E9E", +"# c #ACACAC", +"$ c #B5B5B5", +"% c #AEAEAE", +"& c #ABABAB", +"* c #A7A7A7", +"= c #959595", +"- c #949494", +"; c #919191", +"> c #909090", +", c #808080", +"' c #7D7D7D", +") c #7E7E7E", +"! c #7F7F7F", +"~ c #9A9A9A", +"{ c #A2A2A2", +"] c #B8B8B8", +"^ c #717171", +"/ c #3B3B3B", +"( c #D5D5D5", +"_ c #FFFFFF", +": c #A1A1A1", +"< c #C3C3C3", +"[ c #C7C7C7", +"} c #C8C8C8", +"| c #C9C9C9", +"1 c #CACACA", +"2 c #CBCBCB", +"3 c #CCCCCC", +"4 c #CDCDCD", +"5 c #CECECE", +"6 c #CFCFCF", +"7 c #D0D0D0", +"8 c #D1D1D1", +"9 c #D2D2D2", +"0 c #D3D3D3", +"a c #D4D4D4", +"b c #D6D6D6", +"c c #636363", +"d c #6C6C6C", +"e c #F4F4F4", +"f c #9F9F9F", +"g c #C1C1C1", +"h c #D7D7D7", +"i c #5D5D5D", +"j c #131313", +"k c #A0A0A0", +"l c #FDFDFD", +"m c #FAFAFA", +"n c #989898", +"o c #9D9D9D", +"p c #D8D8D8", +"q c #4B4B4B", +"r c #333333", +"s c #F6F6F6", +"t c #F2F2F2", +"u c #EEEEEE", +"v c #929292", +"w c #C2C2C2", +"x c #454545", +"y c #5C5C5C", +"z c #BBBBBB", +"A c #AFAFAF", +"B c #EAEAEA", +"C c #E6E6E6", +"D c #E2E2E2", +"E c #8B8B8B", +"F c #D9D9D9", +"G c #3D3D3D", +"H c #8C8C8C", +"I c #6D6D6D", +"J c #A3A3A3", +"K c #C4C4C4", +"L c #DADADA", +"M c #2B2B2B", +"N c #888888", +"O c #B6B6B6", +"P c #B3B3B3", +"Q c #AAAAAA", +"R c #939393", +"S c #C0C0C0", +"T c #DBDBDB", +"U c #282828", +"V c #767676", +"W c #C5C5C5", +"X c #C6C6C6", +"Y c #969696", +"Z c #B2B2B2", +"` c #DCDCDC", +" . c #272727", +".. c #6F6F6F", +"+. c #A9A9A9", +"@. c #BDBDBD", +"#. c #DDDDDD", +"$. c #252525", +"%. c #5E5E5E", +"&. c #DEDEDE", +"*. c #202020", +"=. c #606060", +"-. c #B4B4B4", +";. c #DFDFDF", +">. c #B9B9B9", +",. c #BFBFBF", +"'. c #B7B7B7", +"). c #E0E0E0", +"!. c #5B5B5B", +"~. c #E1E1E1", +"{. c #212121", +"]. c #BABABA", +"^. c #E3E3E3", +"/. c #616161", +"(. c #E4E4E4", +"_. c #626262", +":. c #E5E5E5", +"<. c #E7E7E7", +"[. c #676767", +"}. c #E8E8E8", +"|. c #2A2A2A", +"1. c #757575", +"2. c #E9E9E9", +"3. c #2D2D2D", +"4. c #797979", +"5. c #3F3F3F", +"6. c #7C7C7C", +"7. c #BEBEBE", +"8. c #EBEBEB", +"9. c #484848", +"0. c #ECECEC", +"a. c #515151", +"b. c #EDEDED", +"c. c #999999", +"d. c #666666", +"e. c #EFEFEF", +"f. c #F0F0F0", +"g. c #838383", +"h. c #F1F1F1", +"i. c #8F8F8F", +"j. c #F3F3F3", +"k. c #070707", +"l. c #1A1A1A", +"m. c #F5F5F5", +"n. c #1F1F1F", +"o. c #060606", +"p. c #323232", +"q. c #F7F7F7", +"r. c #151515", +"s. c #F8F8F8", +"t. c #313131", +"u. c #464646", +"v. c #F9F9F9", +"w. c #505050", +"x. c #565656", +"y. c #5A5A5A", +"z. c #FBFBFB", +"A. c #979797", +"B. c #686868", +"C. c #FCFCFC", +"D. c #6E6E6E", +"E. c #090909", +"F. c #828282", +"G. c #424242", +"H. c #0F0F0F", +"I. c #0C0C0C", +"J. c #030303", +"K. c #191919", +"L. c #3A3A3A", +"M. c #898989", +"N. c #A8A8A8", +"O. c #595959", +"P. c #363636", +"Q. c #141414", +"R. c #020202", +"S. c #8A8A8A", +"T. c #1B1B1B", +"U. c #010101", +" ", +" ", +" . ", +" + @ # $ % & & * = - = ; > , ' ' ) ! ! ! , , , > ~ { ] ^ ", +" / ( _ : % < [ } } | 1 2 2 3 4 4 5 6 6 7 8 8 9 0 a a ( b c ", +" d e _ _ f { g } | | 1 2 2 3 4 5 5 6 7 7 8 9 9 0 a a ( b h i ", +" j k _ _ l m n o g | 1 1 2 3 3 4 5 6 6 7 8 8 9 0 0 a ( ( b h p q ", +" r 8 l m s t u v o w 1 2 2 3 4 4 5 6 6 7 8 9 9 0 a a ( b b h p p x . ", +" y 4 z A 2 B C D E @ < 2 3 3 4 5 5 6 7 7 8 9 9 0 a ( ( b h h p F F G . . ", +" H o H ! I ' 1 b ) J K 3 4 4 5 6 6 7 8 8 9 0 0 a ( b b h p p F L L M . . ", +" N O $ P Q R ! S ) # [ 4 4 5 6 7 7 8 9 9 0 a a ( b b h p F F L T T U . . ", +" V W X X K z J Y R Z w W X 6 7 7 8 9 0 0 a ( ( b h h p F F L T ` ` .. . ", +" ..} } | 1 | S +.$ S [ @.3 7 8 8 9 0 a a ( b b h p p F L L T ` #.#.$.. . ", +" %.| | 1 2 2 2 z 1 4 6 w S S S W 7 a a ( b h h p F F L T T ` #.#.&.*.. . ", +" =.1 1 2 3 3 4 -.5 6 7 4 < 9 9 5 K w W ( ( 1 1 2 7 L T ` ` #.&.&.;.*.. . ", +" =.2 2 3 4 4 5 ] 6 7 8 6 >.,.2 a ( b 0 < '.4 0 a K T ` #.#.&.;.;.).*.. . ", +" !.3 3 4 5 5 | $ 6 7 8 6 w a } g } b h p 7 K L T X ` #.&.&.;.).).~.{.. . ", +" y 3 4 5 6 6 S ].S g g w w ( ( b 7 < 1 F 9 7 T ` [ [ | 1 L ;.~.~.D {.. . ", +" y 4 5 6 7 7 ,.9 9 0 a a ( b b h p F 8 W W 8 ` #.6 F ;.#.7 2 a D ^.{.. . ", +" /.5 6 7 7 8 g 0 0 a ( ( b h h p F F L T a } a &.F 6 ).).~.D D ^.(.{.. . ", +" _.6 7 S K W @.0 a ( b b h p p F L L T 7 S 1 &.;.#.z 2 2 3 ~.^.(.:.{.. . ", +" c 7 8 S 7 7 O 8 ( b h h p F F L T L X 7 3 ,.T ).).1 D D ^.(.(.:.C U . . ", +" c 8 9 w 0 a 8 O X 0 h p F F L T b K L 8 4 2 ).).~.2 ^.^.(.:.:.C <.U . . ", +" [.9 0 < a ( b w a | W K ] [ z L K #.b 2 ;.1 ~.~.D 5 ^.(.:.C C <.}.|.. . ", +" 1.0 a '.( b h 2 7 F F L S W 1 w ` T [ ).( < &.` T K (.:.C <.<.}.2.3.. . ", +" 4.a ( < ( h p a O X } } z 1 ` X F X ;.).[ 3 ( b h ^.:.C <.<.}.2.B 5.. . ", +" 6.( b 7 g X X [ ,.7 F L | p &.` 7.;.~.2 &.` ^.(.:.C C <.}.}.2.B B x . . ", +" ! b h h p F F p F T ` #.p 3 ;.;.2 ;.( ( ^.(.:.:.C <.<.}.2.2.B 8.8.9.. . ", +" ; h p p F L L T ` ` #.&.&.3 4 4 4 L 4 ^.(.:.:.C <.}.}.2.B B 8.0.0.a.. . ", +" n p F F L T T ` #.#.&.;.;.).~.D ).| ^.(.:.C C <.}.}.2.B 8.8.0.b.b.=.. . ", +" c.F L L T ` ` #.&.&.` #.;.~.D ^.5 ;.:.:.C <.<.}.2.2.B 8.0.0.b.u u d.. . ", +" & L L T ` #.#.5 #.9 3 4 < D ^.T 8 :.C C <.}.}.2.B B 8.0.0.b.u e.e.1.. . ", +" $ T T ` #.#.&.2 #.).~.D F a D 1 :.C C <.}.2.2.B 8.8.0.b.b.u e.e.f.g.. . ", +" '.` ` #.&.&.;.3 &.~.D ^.^.2 1 ^.C <.&.D <.&.B T 2.0 0 ( p D f.f.h.i.. . ", +" . 3 #.#.&.;.;.).4 ;.D ^.(.(.p 6 C <.}.}.2.B B 8.0.b.b.u e.e.f.h.h.t : . . ", +" . a &.&.;.).).~.F a ~.D D ^.(.5 <.}.2.2.B D (.0.:.#.( ( b L h.t t j.Z . . ", +" k.h ;.;.).~.~.D ~.6 6 7 7 8 9 F }.2.B B 8.~.D b.(.C u e.f.h.t j.j.e < . . ", +" l.#.;.).~.D D ^.(.(.:.C C <.}.}.2.B 8.8.0.F a b p 8.f.u e.t j.e e m.&.. . ", +" n.).).~.D ^.^.(.:.:.C <.<.}.2.2.B 8.8.B b.u u e.f.f.h.(.:.j.e e m.s 0.o.. . ", +" p.~.~.D ^.^.(.:.C C <.}.}.2.B B 8.0.0.;.a h u b.F L L e.D ` j.m.s q.q.r.. . ", +" 5.D D ^.(.(.:.C C <.}.2.2.B 8.8.0.b.b.u e.e.f.h.t t h.h.t e e e q.s.s.t.. . ", +" u.^.^.(.:.:.C <.<.}.2.B B 8.0.0.b.<.L e.` h b 2.j.j.` T T 0.^.#.m.v.v.w.. . ", +" x.(.(.:.C C <.}.}.2.B B 8.0.b.b.u u u f.f.h.t j.j.e m.s s q.s.s.v.m m ^ . . ", +" y.(.:.C <.<.}.2.2.B 8.8.0.b.b.u e.f.f.h.t t j.e e m.s s q.s.v.v.m z.z.A.. . ", +" B.:.C <.}.}.2.B B 8.0.0.b.u u e.f.h.h.t j.j.e m.m.s q.q.s.v.v.m z.C.C.K . . ", +" D.C <.}.}.2.B 8.8.0.b.b.u e.e.f.h.h.t j.e e e t B C C ;.;.).~.2.0.s.l e E.. ", +" F.<.}.2.2.B 8.8.0.b.u b.~.X & v 6.[.a.G.3.{.H.I.J.. . . . . . . . I.K.L.H.. ", +" M.}.2.B B B 9 N.' O.P.Q.R.. . . . . . . . . . . . . . . . . . . . . . . . . ", +" f 2.4 S.w.T.U.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" %./ J.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . . . . . . . . . . . ", +" . . . . . . . . ", +" . . ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" "}; diff --git a/GUI/options.xpm b/GUI/options.xpm new file mode 100644 index 0000000..aa58451 --- /dev/null +++ b/GUI/options.xpm @@ -0,0 +1,843 @@ +/* XPM */ +static char * options_xpm[] = { +"48 51 789 2", +" c None", +". c #040508", +"+ c #0A0B12", +"@ c #141523", +"# c #1C1D2F", +"$ c #262940", +"% c #313451", +"& c #3C3F61", +"* c #474B71", +"= c #3B3E5C", +"- c #000000", +"; c #040405", +"> c #171929", +", c #6167AA", +"' c #686EB3", +") c #6B71B5", +"! c #6E74B6", +"~ c #7076B7", +"{ c #7379B9", +"] c #767BBA", +"^ c #787EBB", +"/ c #6F74AB", +"( c #0F0F15", +"_ c #6F729C", +": c #585A7A", +"< c #0E0E13", +"[ c #08090F", +"} c #24263D", +"| c #6A70B4", +"1 c #6D73B6", +"2 c #6F75B7", +"3 c #7278B8", +"4 c #757ABA", +"5 c #777DBB", +"6 c #7A7FBC", +"7 c #7D82BE", +"8 c #7F84BE", +"9 c #060609", +"0 c #171821", +"a c #7A7EAB", +"b c #8F94C7", +"c c #9296C8", +"d c #8A8DBB", +"e c #3B3C4F", +"f c #020203", +"g c #030406", +"h c #373B65", +"i c #5A60A4", +"j c #1E2035", +"k c #2F314E", +"l c #7177B8", +"m c #7479B9", +"n c #767CBA", +"o c #797EBC", +"p c #7C81BD", +"q c #7E83BE", +"r c #8186C0", +"s c #8388C1", +"t c #14151D", +"u c #22232F", +"v c #8387B6", +"w c #9195C8", +"x c #9398C9", +"y c #969ACA", +"z c #999DCC", +"A c #9B9FCD", +"B c #777A9B", +"C c #1B1C23", +"D c #0D0E19", +"E c #4C518A", +"F c #6369B1", +"G c #656BB2", +"H c #676DB1", +"I c #333656", +"J c #010102", +"K c #3B3E60", +"L c #7378B9", +"M c #757BBA", +"N c #787DBB", +"O c #7B80BC", +"P c #8085BF", +"Q c #8287C0", +"R c #858AC2", +"S c #888CC3", +"T c #1F202C", +"U c #303244", +"V c #8B8FC0", +"W c #9297C8", +"X c #9599CA", +"Y c #989CCB", +"Z c #9A9ECC", +"` c #9DA1CE", +" . c #A0A3CF", +".. c #A2A6D0", +"+. c #A0A3CB", +"@. c #545569", +"#. c #060608", +"$. c #1E2036", +"%. c #5A60A3", +"&. c #646AB1", +"*. c #676DB3", +"=. c #6C72B5", +"-. c #4B4E79", +";. c #4D507A", +">. c #777CBB", +",. c #797FBC", +"'. c #7F84BF", +"). c #8489C1", +"!. c #878BC3", +"~. c #898EC4", +"{. c #8C91C5", +"]. c #65688C", +"^. c #9094C6", +"/. c #9498C9", +"(. c #979BCB", +"_. c #9CA0CD", +":. c #9EA2CE", +"<. c #A1A5D0", +"[. c #A4A7D1", +"}. c #A6AAD2", +"|. c #A9ACD4", +"1. c #ACB0D3", +"2. c #31323A", +"3. c #030305", +"4. c #35385F", +"5. c #6369B0", +"6. c #666CB2", +"7. c #686FB4", +"8. c #7076B8", +"9. c #7B80BD", +"0. c #868AC2", +"a. c #888DC3", +"b. c #8B90C5", +"c. c #8E92C6", +"d. c #9095C7", +"e. c #9397C9", +"f. c #959ACA", +"g. c #A0A4CF", +"h. c #A3A6D1", +"i. c #A5A9D2", +"j. c #A8ACD3", +"k. c #ABAED5", +"l. c #B4B7DA", +"m. c #C4C8E5", +"n. c #40414B", +"o. c #0C0D16", +"p. c #4B4F86", +"q. c #676EB3", +"r. c #8589C2", +"s. c #878CC3", +"t. c #8A8FC4", +"u. c #8C91C6", +"v. c #9499C9", +"w. c #9FA3CF", +"x. c #A2A5D0", +"y. c #A4A8D1", +"z. c #A7AAD3", +"A. c #AAADD4", +"B. c #ACB0D5", +"C. c #B6B9DB", +"D. c #C0C4E2", +"E. c #BFC3E2", +"F. c #484A55", +"G. c #2D3044", +"H. c #7076B5", +"I. c #696FB4", +"J. c #8488C1", +"K. c #868BC2", +"L. c #8E93C6", +"M. c #A1A4D0", +"N. c #A3A7D1", +"O. c #ABAFD5", +"P. c #AEB1D6", +"Q. c #BABEDE", +"R. c #B9BDDD", +"S. c #B8BCDD", +"T. c #4F515F", +"U. c #20212C", +"V. c #8289B7", +"W. c #7C82B6", +"X. c #7379B7", +"Y. c #8D92C6", +"Z. c #9094C7", +"`. c #A5A8D2", +" + c #A8ABD3", +".+ c #AAAED4", +"++ c #ADB0D6", +"@+ c #AFB2D7", +"#+ c #B3B7D9", +"$+ c #B5B9DA", +"%+ c #B4B8D9", +"&+ c #B2B6D8", +"*+ c #565869", +"=+ c #0F1016", +"-+ c #7A80B0", +";+ c #7A81B1", +">+ c #787EB4", +",+ c #797FBB", +"'+ c #8F93C7", +")+ c #9196C8", +"!+ c #9FA2CF", +"~+ c #A9ADD4", +"{+ c #ACAFD5", +"]+ c #AEB2D6", +"^+ c #B1B4D8", +"/+ c #B4B7D9", +"(+ c #B6B9DA", +"_+ c #B9BBDB", +":+ c #BBBEDD", +"<+ c #BDC0DE", +"[+ c #BFC2DF", +"}+ c #B7B9D3", +"|+ c #AEB0C7", +"1+ c #A7A9BD", +"2+ c #494953", +"3+ c #6D73A4", +"4+ c #747BB1", +"5+ c #777DB5", +"6+ c #7A80BA", +"7+ c #969AC8", +"8+ c #9297C5", +"9+ c #8E93C1", +"0+ c #9095C3", +"a+ c #ADB1D6", +"b+ c #B0B3D7", +"c+ c #B3B6D9", +"d+ c #B5B8DA", +"e+ c #B8BBDB", +"f+ c #BBBDDD", +"g+ c #C0C2DF", +"h+ c #C3C5E1", +"i+ c #C5C7E2", +"j+ c #C8CAE3", +"k+ c #CACDE4", +"l+ c #CDCFE6", +"m+ c #525467", +"n+ c #3B3E5E", +"o+ c #606599", +"p+ c #777CBA", +"q+ c #8D91C6", +"r+ c #999DCB", +"s+ c #A3A8CF", +"t+ c #9BA0C8", +"u+ c #8C92BD", +"v+ c #7C83B2", +"w+ c #6D74A7", +"x+ c #656CA2", +"y+ c #8F94C1", +"z+ c #B2B5D8", +"A+ c #B7BADB", +"B+ c #BABCDC", +"C+ c #BCBFDD", +"D+ c #BFC1DF", +"E+ c #C2C4E0", +"F+ c #C4C7E1", +"G+ c #C7C9E3", +"H+ c #C9CCE4", +"I+ c #CCCEE5", +"J+ c #CFD1E7", +"K+ c #D1D3E8", +"L+ c #565A78", +"M+ c #06070A", +"N+ c #7278B4", +"O+ c #8C90C5", +"P+ c #989DCB", +"Q+ c #B0B5D8", +"R+ c #ACB1D4", +"S+ c #9DA2C9", +"T+ c #8D93BE", +"U+ c #7D84B3", +"V+ c #6E75A8", +"W+ c #5E669D", +"X+ c #525A95", +"Y+ c #A0A4CC", +"Z+ c #BEC0DE", +"`+ c #C0C3DF", +" @ c #C6C8E2", +".@ c #C8CBE3", +"+@ c #CBCDE5", +"@@ c #CED0E6", +"#@ c #D0D2E7", +"$@ c #D3D5E9", +"%@ c #CCCFE4", +"&@ c #666B91", +"*@ c #171823", +"=@ c #7D83BE", +"-@ c #BCC0E0", +";@ c #ADB2D5", +">@ c #9EA3CA", +",@ c #8E94BF", +"'@ c #7F85B4", +")@ c #6F77A9", +"!@ c #60689E", +"~@ c #505993", +"{@ c #858BB8", +"]@ c #BABDDC", +"^@ c #BDBFDE", +"/@ c #C2C5E0", +"(@ c #C7CAE3", +"_@ c #CACCE4", +":@ c #D2D4E8", +"<@ c #D5D6EA", +"[@ c #D7D9EB", +"}@ c #C0C3DC", +"|@ c #7B81AD", +"1@ c #030304", +"2@ c #282A3D", +"3@ c #A1A4CF", +"4@ c #AFB3D6", +"5@ c #9FA4CB", +"6@ c #9096C0", +"7@ c #8087B5", +"8@ c #7178AA", +"9@ c #61699F", +"0@ c #525A94", +"a@ c #9B9FC7", +"b@ c #BCBEDD", +"c@ c #BEC1DE", +"d@ c #C1C3E0", +"e@ c #C4C6E1", +"f@ c #C6C9E2", +"g@ c #C9CBE4", +"h@ c #D4D5E9", +"i@ c #D6D8EA", +"j@ c #D9DAEC", +"k@ c #DBDDED", +"l@ c #B3B7D4", +"m@ c #878DBA", +"n@ c #121218", +"o@ c #3C3E58", +"p@ c #9EA1CE", +"q@ c #A6A9D2", +"r@ c #AEB2D5", +"s@ c #A1A6CC", +"t@ c #9197C1", +"u@ c #8288B6", +"v@ c #7279AB", +"w@ c #636BA1", +"x@ c #8389B6", +"y@ c #C5C8E2", +"z@ c #CDCFE5", +"A@ c #D3D4E9", +"B@ c #D5D7EA", +"C@ c #D8D9EB", +"D@ c #DADCEC", +"E@ c #DDDEEE", +"F@ c #E0E1EF", +"G@ c #A6AACD", +"H@ c #272834", +"I@ c #4F5272", +"J@ c #8E93C3", +"K@ c #8A8EBD", +"L@ c #8388B7", +"M@ c #9498C4", +"N@ c #A5A8D1", +"O@ c #A7ABD3", +"P@ c #ADB0D5", +"Q@ c #A7ABD0", +"R@ c #9297C1", +"S@ c #A8ACD0", +"T@ c #B0B4D3", +"U@ c #A9ADCF", +"V@ c #C9CCE2", +"W@ c #D9DBEC", +"X@ c #DCDDED", +"Y@ c #DFE0EF", +"Z@ c #E1E3F0", +"`@ c #E3E4F0", +" # c #999EC6", +".# c #9399C2", +"+# c #3F4153", +"@# c #5E6288", +"## c #858ABF", +"$# c #8288BB", +"%# c #7F85B7", +"&# c #7A81B2", +"*# c #757CAD", +"=# c #787FB4", +"-# c #B9BBDC", +";# c #C3C6E1", +"># c #C8CBE4", +",# c #D4D6E9", +"'# c #979CC3", +")# c #7980B0", +"!# c #8C92BC", +"~# c #ADB1D0", +"{# c #CED0E4", +"]# c #D3D5E6", +"^# c #989DC6", +"/# c #999EC7", +"(# c #595C73", +"_# c #626893", +":# c #7078AA", +"<# c #7077AA", +"[# c #7077A9", +"}# c #7E84B8", +"|# c #9CA0CE", +"1# c #B8BADB", +"2# c #DADBEC", +"3# c #D8DAEB", +"4# c #898FB9", +"5# c #7178AB", +"6# c #7279A5", +"7# c #6F7393", +"8# c #9DA3CA", +"9# c #747893", +"0# c #494E71", +"a# c #6A72A6", +"b# c #6A71A5", +"c# c #6971A5", +"d# c #6B73A7", +"e# c #898EC0", +"f# c #B7B9DB", +"g# c #B9BCDC", +"h# c #C1C4E0", +"i# c #DEDFEE", +"j# c #E1E2F0", +"k# c #D8D9EA", +"l# c #7B81B0", +"m# c #6C73A7", +"n# c #6B72A6", +"o# c #7379A9", +"p# c #A3A8CE", +"q# c #A4A9CF", +"r# c #9195B6", +"s# c #010101", +"t# c #343854", +"u# c #646CA1", +"v# c #6D74A9", +"w# c #959AC8", +"x# c #B6B8DA", +"y# c #DBDCEC", +"z# c #DDDFEE", +"A# c #E2E4F0", +"B# c #E5E6F2", +"C# c #E8E9F3", +"D# c #D2D4E5", +"E# c #6E75A7", +"F# c #656DA2", +"G# c #676EA0", +"H# c #A9ADD2", +"I# c #AAAFD3", +"J# c #A4A8CA", +"K# c #030303", +"L# c #222539", +"M# c #60679F", +"N# c #9A9ECB", +"O# c #BBBDDA", +"P# c #D2D3E8", +"Q# c #D7D8EB", +"R# c #DCDEED", +"S# c #E4E5F1", +"T# c #E7E8F3", +"U# c #E9EAF4", +"V# c #ECEDF5", +"W# c #EFEFF7", +"X# c #C7CADE", +"Y# c #626AA0", +"Z# c #5F679E", +"`# c #5F679D", +" $ c #A8ACCF", +".$ c #B0B4D7", +"+$ c #8A8EA8", +"@$ c #586099", +"#$ c #878DBC", +"$$ c #CACDE8", +"%$ c #C3C5E0", +"&$ c #D6D7EA", +"*$ c #BFC1D2", +"=$ c #D1D3E2", +"-$ c #E0E2EF", +";$ c #E3E4F1", +">$ c #E6E7F2", +",$ c #EBECF5", +"'$ c #EEEEF6", +")$ c #F0F1F7", +"!$ c #F3F3F9", +"~$ c #F6F6FA", +"{$ c #9BA0C2", +"]$ c #59629A", +"^$ c #596199", +"/$ c #A3A8CC", +"($ c #B5BADB", +"_$ c #67697C", +":$ c #07080D", +"<$ c #505992", +"[$ c #767DAF", +"}$ c #9095C2", +"|$ c #CACEE9", +"1$ c #D0D3ED", +"2$ c #C2C5DF", +"3$ c #888CA5", +"4$ c #D8DAE6", +"5$ c #EAEBF4", +"6$ c #EDEDF6", +"7$ c #EFF0F7", +"8$ c #F2F2F8", +"9$ c #F4F5F9", +"0$ c #F7F7FB", +"a$ c #D2D5E7", +"b$ c #545C96", +"c$ c #535B95", +"d$ c #9A9FC6", +"e$ c #BBBFDF", +"f$ c #41424D", +"g$ c #444C83", +"h$ c #4B5490", +"i$ c #6B72A8", +"j$ c #787FB0", +"k$ c #9CA1CA", +"l$ c #C1C3DF", +"m$ c #C8CBE6", +"n$ c #CED1EC", +"o$ c #CCCFE9", +"p$ c #DEE0EE", +"q$ c #8F95C0", +"r$ c #898DA9", +"s$ c #DDDEE8", +"t$ c #ECECF5", +"u$ c #EEEFF6", +"v$ c #F1F1F8", +"w$ c #F3F4F9", +"x$ c #F7F7FA", +"y$ c #C4C7DF", +"z$ c #8389B7", +"A$ c #4E5792", +"B$ c #4D5691", +"C$ c #8D93BD", +"D$ c #1A1B1F", +"E$ c #353C6A", +"F$ c #454E8B", +"G$ c #6067A0", +"H$ c #747BAD", +"I$ c #ACB0D4", +"J$ c #C2C5E1", +"K$ c #C6C9E5", +"L$ c #C8CCE8", +"M$ c #C7CBE7", +"N$ c #CACDE7", +"O$ c #DBDCED", +"P$ c #CBCEE7", +"Q$ c #888EBB", +"R$ c #8C90B0", +"S$ c #E1E2EA", +"T$ c #F2F3F8", +"U$ c #F5F5FA", +"V$ c #F8F8FB", +"W$ c #F4F4F9", +"X$ c #B5B9D6", +"Y$ c #999FC7", +"Z$ c #989EC6", +"`$ c #8B91BD", +" % c #48518E", +".% c #48518D", +"+% c #7E84B2", +"@% c #B3B6D0", +"#% c #020202", +"$% c #272D52", +"%% c #3F4887", +"&% c #555D99", +"*% c #6B73A6", +"=% c #BBBEDC", +"-% c #C2C5E3", +";% c #C3C7E4", +">% c #C2C6E4", +",% c #C1C5E3", +"'% c #CDCFE7", +")% c #E7E7F3", +"!% c #C5C8E5", +"~% c #7F86B5", +"{% c #898EB1", +"]% c #E6E7EC", +"^% c #F9FAFC", +"/% c #EDEDF5", +"(% c #A7ACCE", +"_% c #969BC4", +":% c #949AC3", +"<% c #9399C3", +"[% c #464F8C", +"}% c #424B89", +"|% c #6B72A5", +"1% c #8C8EA1", +"2% c #1B1F3C", +"3% c #394283", +"4% c #4A5391", +"5% c #666DA2", +"6% c #646CA2", +"7% c #BFC2E1", +"8% c #BEC2E0", +"9% c #BDC1E0", +"0% c #BCC0DF", +"a% c #BBBFDE", +"b% c #D2D4E9", +"c% c #D8DAEC", +"d% c #787FAF", +"e% c #777EAF", +"f% c #767DAE", +"g% c #8187AD", +"h% c #CDD0DF", +"i% c #9BA0C7", +"j% c #9096C1", +"k% c #3C4685", +"l% c #555D96", +"m% c #626470", +"n% c #14162A", +"o% c #323B7A", +"p% c #374079", +"q% c #60679E", +"r% c #5D659A", +"s% c #B2B6D5", +"t% c #B7BBDC", +"u% c #B6BBDB", +"v% c #DFE1EF", +"w% c #E2E3F0", +"x% c #E3E5F1", +"y% c #B8BCDC", +"z% c #8F95BF", +"A% c #6F76A9", +"B% c #8289B5", +"C% c #8A90BC", +"D% c #898FBB", +"E% c #404567", +"F% c #232952", +"G% c #394179", +"H% c #32333A", +"I% c #555D93", +"J% c #586199", +"K% c #575F98", +"L% c #A0A5C8", +"M% c #B1B5D8", +"N% c #AFB4D6", +"O% c #AAAFD2", +"P% c #B6B9D6", +"Q% c #BABDD8", +"R% c #BBBED9", +"S% c #BFC2DB", +"T% c #C2C5DD", +"U% c #C4C7DD", +"V% c #C9CCE0", +"W% c #C8CBE2", +"X% c #6870A4", +"Y% c #686FA4", +"Z% c #676FA3", +"`% c #666EA3", +" & c #787FAE", +".& c #888EBA", +"+& c #868DB9", +"@& c #858BB9", +"#& c #848AB8", +"$& c #44475F", +"%& c #070708", +"&& c #454C7B", +"*& c #525B95", +"=& c #515A94", +"-& c #8D92BB", +";& c #ABAFD3", +">& c #AAAED2", +",& c #A4A9CE", +"'& c #8188B6", +")& c #8187B5", +"!& c #8086B5", +"~& c #7E85B4", +"{& c #AEB3D5", +"]& c #61689F", +"^& c #7E84B3", +"/& c #565B7C", +"(& c #353B64", +"_& c #4D5591", +":& c #4C5590", +"<& c #4C5490", +"[& c #7980AE", +"}& c #A2A7CD", +"|& c #A1A6CD", +"1& c #7B81B1", +"2& c #757CAE", +"3& c #A9AED2", +"4& c #59619A", +"5& c #7B82B1", +"6& c #7A80B1", +"7& c #797FB0", +"8& c #676D97", +"9& c #000001", +"0& c #20233E", +"a& c #47508D", +"b& c #454E8C", +"c& c #666DA0", +"d& c #9CA1C9", +"e& c #747BAC", +"f& c #737AAC", +"g& c #A1A7CD", +"h& c #565F98", +"i& c #515994", +"j& c #4F5893", +"k& c #545D96", +"l& c #2C325C", +"m& c #404988", +"n& c #3F4987", +"o& c #525A92", +"p& c #979CC5", +"q& c #959AC4", +"r& c #6D74A8", +"s& c #6970A4", +"t& c #9EA4CA", +"u& c #5D659C", +"v& c #49528E", +"w& c #737AAB", +"x& c #6E76A9", +"y& c #5E6490", +"z& c #08090D", +"A& c #030407", +"B& c #2F376B", +"C& c #394383", +"D& c #3E4785", +"E& c #9095C0", +"F& c #797FAE", +"G& c #636AA0", +"H& c #60689F", +"I& c #383A4D", +"J& c #323867", +"K& c #414A88", +"L& c #4F557C", +"M& c #09090E", +"N& c #070811", +"O& c #2F3773", +"P& c #333C7E", +"Q& c #8087B4", +"R& c #71769B", +"S& c #26283A", +"T& c #5C649B", +"U& c #5B639B", +"V& c #5A629A", +"W& c #9499C3", +"X& c #121319", +"Y& c #020204", +"Z& c #262C55", +"`& c #384282", +" * c #384182", +".* c #5B649B", +"+* c #6970A5", +"@* c #3E4363", +"#* c #0B0E1E", +"$* c #2E3778", +"%* c #6C73A5", +"&* c #6D7298", +"** c #0C0D11", +"=* c #09090F", +"-* c #576098", +";* c #565E97", +">* c #555D97", +",* c #535C95", +"'* c #7F84AB", +")* c #1A1F42", +"!* c #303A7C", +"~* c #61699E", +"{* c #2D3048", +"]* c #121630", +"^* c #5A6298", +"/* c #696F96", +"(* c #0D0D12", +"_* c #4B5287", +":* c #505893", +"<* c #4F5892", +"[* c #4C5591", +"}* c #5E6280", +"|* c #131631", +"1* c #434B88", +"2* c #5A6195", +"3* c #1D1F30", +"4* c #262A41", +"5* c #0C0D12", +"6* c #393F6D", +"7* c #4A538F", +"8* c #3D4055", +"9* c #171A2B", +"0* c #10121C", +"a* c #282E53", +"b* c #434C8A", +"c* c #414A89", +"d* c #404A88", +"e* c #404987", +"f* c #3E4786", +"g* c #1E202B", +"h* c #0E101D", +"i* c #1C203D", +"j* c #1E2343", +"k* c #202549", +"l* c #202548", +"m* c #20254A", +"n* c #232950", +" ", +" ", +" . + @ # $ % & * = - ; - ", +" > , ' ) ! ~ { ] ^ / - ( _ : < ", +" - [ } | 1 2 3 4 5 6 7 8 9 0 a b c d e f ", +" g h i j - k ! l m n o p q r s t - u v w x y z A B C - ", +" D E F G H I J K L M N O 7 P Q R S T U V W X Y Z ` ...+.@.#. ", +" - $.%.&.*.| =.2 -.;.>.,.p '.r ).!.~.{.].^./.(.z _.:.<.[.}.|.1.2. ", +" 3.4.5.6.7.) ! 8.{ ] ^ 9.q P s 0.a.b.c.d.e.f.Y A ` g.h.i.j.k.l.m.n. ", +" o.p.G q.| 1 2 3 4 5 6 7 '.Q r.s.t.u.b c v.(.Z _.w.x.y.z.A.B.C.D.E.F.- ", +" G.H.I.=.! l m n o p q r J.K.~.b.L.w x y z A :.M.N.}.|.O.P.C.Q.R.S.T.- ", +" U.V.W.X.L M N 9.7 P Q R a.t.Y.Z.W X Y Z ` ...`. +.+++@+#+$+%+#+&+*+- - - ", +" =+-+;+;+>+,+p '.r ).s.~.{.'+)+/.(.z _.!+<.y.}.~+{+]+^+/+(+_+:+<+[+}+|+1+2+ ", +" 3.3+4+5+6+q P s K.a.b.c.d.e.f.7+8+9+0+g.i.j.k.a+b+c+d+e+f+<+g+h+i+j+k+l+m+- ", +" - n+o+p+6 7 '.Q R s.t.q+b c X r+s+t+u+v+w+x+y+B.@+z+/+A+B+C+D+E+F+G+H+I+J+K+L+- ", +" M+N+o p q r ).K.~.O+L.w x y P+Q+R+S+T+U+V+W+X+Y+c+(+_+:+Z+`+h+ @.@+@@@#@$@%@&@- ", +" *@9.=@P s R a.t.Y.Z.W X Y Z g.-@;@>@,@'@)@!@~@{@A+]@^@[+/@i+(@_@l+J+:@<@[@}@|@1@ ", +" 2@'.Q ).s.~.{.'+)+/.(.z _.!+3@R.4@5@6@7@8@9@0@a@b@c@d@e@f@g@I+@@K+h@i@j@k@l@m@n@- ", +" o@s K.a.b.c.d.e.y Y A p@g.N.q@.+r@s@t@u@v@w@x@<+`+h+y@j++@z@#@A@B@C@D@E@F@G@T+H@- ", +" I@s.t.q+b c J@K@L@M@w...N@O@A.B.P@Q@t+R@6@S@D+E+F+G+_@I+J+T@U@V@W@X@Y@Z@`@ #.#+#- ", +" - @###$#%#&#*#*#=#/.<.N.}.|.O.P.^+c+(+-#:+Z+d@;# @>#+@@@#@$@,#'#)#!#~#{#`@]#^#/#(#- ", +" - _#:#<#<#[#)@}#|#..i. +.+++b+z+d+1#]@^@[+/@i+(@_@l+J+:@<@[@2#3#4#v@5#8@6#7#8#5@9#- ", +" - 0#a#b#c#d#e#<.y.z.~+{+@+^+/+f#g#b@c@h#e@f@g@I+@@K+h@i@j@X@i#j#k#l#m#n#a#o#p#q#r#s#- ", +" t#u#u#v#w#N.q@j.k.P.b+c+x#e+f+<+`+h+y@j++@l+#@A@B@C@y#z#F@A#B#C#D#E#F#x+G#H#I#J#K#- ", +" L#W+M#N#`.O@A.++@+z+/+A+]@^@O#E+F+G+_@I+J+P#,#Q#W@R#Y@Z@S#T#U#V#W#X#Y#Z#`# $.$+$- - ", +" @ @$@$#$O@O.P.^+c+(+-#:+c@$$%$ @g@+@@@#@$@&$*$=$i#-$;$>$C#,$'$)$!$~${$]$^$/$($_$- - ", +" :$<$0@[$}$b+z+d+1#]@<+[+|$1$j+_@l+J+:@<@[@D@2$3$4$B#T#5$6$7$8$9$0$a$v+b$c$d$e$f$- - ", +" - g$h$i$j$k$f#g#C+D+l$m$n$o$I+@@K+h@i@W@X@p$>#q$r$s$t$u$v$w$~$x$y$8#z$A$B$C$D.D$- - ", +" - E$F$G$v@H$I$Z+`+J$K$L$M$N$#@A@B@C@O$z#F@`@P$Q$m@R$S$T$U$V$W$X$Y$Z$`$ %.%+%@%#%- - ", +" $%%%&%m#*%[$=%e@-%;%>%,%'%,#[@2#R#Y@Z@S#)%!%Q$~%'@{%]%^%/%(%_%:%<%6@[%}%|%1%- - ", +" 2%3%4%5%F#6%u@7%8%9%0%a%b%c%k@i#-$;$>$C#T#9%`$d%e%f%g%h%i%R@j%q$,@T+h$k%l%m%- - ", +" n%o%p%q%Z#W+r%s%t%u%($$+W@E@v%w%B#T#5$6$x%y%z%<#)@A%V+B%,@T+`$C%D%Q$E%F%G%H%- - ", +" #%3.J I%^$J%K%L%M%.$N%O%l@P%Q%R%S%T%U%V%W%#+<%X%Y%Z%`% &D%.&+&@&#&z$$&- 1@%&- - ", +" - &&c$*&=&-&;&>&H#,&z$'&)&!&'@~&U+v+:%{& #]&!@Z#Z#w+#&V.'&!&'@^&/&- - - - ", +" - (&_&:&<&[&q#p#}&|&~&1&;+)#d%e%f%2&m@3&5@4&J%@$K%9@~&U+v+5&6&7&8&9&- - - ", +" - 0&a&[%b&c&>@S+d&t+^&e&f&v@5#<#)@A%7&q#g&h&i&~@j&k&)#j$e%f%*#f&[#M+- - ", +" J l&m&n&o&^#p&_%q&U+r&m#*%a#c#s&Y%n#t&>@u&v& %.% %w&f&v@8@[#x&y&z&- - ", +" A&B&C&D&E&6@q$,@F&`%F#u#w@G&Y#9@H&:%Y$I&J&K&m&m&X%V+w+m#a#L&M&- - ", +" - N&O&P&Q&C%D%R&S&Z#W+W+u&T&U&V&4&m@W&X&Y&Z&`& *.*+*Y%`%@*3.- - - ", +" - #*$*%*#&&***=*@$-*K%;*>*b$,**&d%'*J - 9&)*!*A$u#~*{*- - - - ", +" - ]*^*/*(*- J _*i&:*<*A$B$[*<&X%}*- - - - |*1*2*3*- - - - ", +" - 4*5*- - - 6*7*v& %a&[%b&F$^$8*- - - - - 9*0*- - - - ", +" - - - - - a*b*}%c*d*e*%%f* %g*- - - - - - - - - - ", +" - - - h*i*j*j*j*k*l*m*n*:$- - - - - ", +" - - - - - - - - - - - ", +" - - - - - - - - ", +" - - - ", +" ", +" ", +" ", +" "}; diff --git a/GUI/save.xpm b/GUI/save.xpm new file mode 100644 index 0000000..ebe5d89 --- /dev/null +++ b/GUI/save.xpm @@ -0,0 +1,957 @@ +/* XPM */ +static char * save_xpm[] = { +"48 60 894 2", +" c None", +". c #E38400", +"+ c #E68600", +"@ c #E88700", +"# c #D37B00", +"$ c #E78600", +"% c #DF8200", +"& c #E28400", +"* c #AD6500", +"= c #D77D00", +"- c #9C5B00", +"; c #AC6400", +"> c #E58500", +", c #C17000", +"' c #0B0600", +") c #000000", +"! c #DE8100", +"~ c #D97E00", +"{ c #201300", +"] c #E48500", +"^ c #452800", +"/ c #E78700", +"( c #774500", +"_ c #353747", +": c #53566F", +"< c #3F4155", +"[ c #2D2F3D", +"} c #1A1B21", +"| c #A56000", +"1 c #020100", +"2 c #3D3F52", +"3 c #959BCD", +"4 c #7C83C0", +"5 c #9BA1D8", +"6 c #AEB3DF", +"7 c #EBEBED", +"8 c #E0E0E3", +"9 c #CECFD1", +"0 c #BFBFC0", +"a c #ADADAE", +"b c #A0A0A1", +"c c #929292", +"d c #AD7C39", +"e c #88612B", +"f c #707070", +"g c #686868", +"h c #676767", +"i c #5C5C5C", +"j c #595959", +"k c #4D4D4D", +"l c #AE6909", +"m c #CC7701", +"n c #140D05", +"o c #050609", +"p c #0A0B10", +"q c #12131D", +"r c #020304", +"s c #6A6E8F", +"t c #7B82C1", +"u c #282F68", +"v c #8D93C9", +"w c #B1B6E0", +"x c #EFEFEF", +"y c #EEEEEE", +"z c #ECECEC", +"A c #EBEBEB", +"B c #E9E9E9", +"C c #E6E6E6", +"D c #E0E0E0", +"E c #E3AA5B", +"F c #DEA75B", +"G c #CDCCCC", +"H c #CECECE", +"I c #CFCFCF", +"J c #D3B386", +"K c #E88701", +"L c #E48501", +"M c #3E2C19", +"N c #1D1F2F", +"O c #2C2F47", +"P c #3E4164", +"Q c #4F5482", +"R c #252847", +"S c #878DB8", +"T c #989FD6", +"U c #7277A4", +"V c #9CA2D7", +"W c #B8BCE1", +"X c #EDEDED", +"Y c #E1E1E1", +"Z c #DADADA", +"` c #E29C3A", +" . c #DC9736", +".. c #BEB7AE", +"+. c #BDBDBD", +"@. c #C3B6A4", +"#. c #E58B0D", +"$. c #6A4513", +"%. c #1D1E2A", +"&. c #24263F", +"*. c #2C2F57", +"=. c #414676", +"-. c #5B6096", +";. c #404788", +">. c #060710", +",. c #0F0F14", +"'. c #9EA4D8", +"). c #A0A6DC", +"!. c #9FA5DB", +"~. c #9DA4DA", +"{. c #C1C4E2", +"]. c #D7D7D7", +"^. c #C2C2C2", +"/. c #C8C8C8", +"(. c #CBCBCB", +"_. c #D0D0D0", +":. c #E0962D", +"<. c #DC8E20", +"[. c #B0A08A", +"}. c #DD8E20", +"|. c #9E600B", +"1. c #262626", +"2. c #25273B", +"3. c #2C3052", +"4. c #32376A", +"5. c #4C528B", +"6. c #646AA6", +"7. c #3C438A", +"8. c #070811", +"9. c #333546", +"0. c #9FA6DB", +"a. c #9EA4DB", +"b. c #9DA3DA", +"c. c #9CA2DA", +"d. c #CACDE4", +"e. c #EAEAEA", +"f. c #E2E2E2", +"g. c #CDCDCD", +"h. c #A8A8A8", +"i. c #DE8A16", +"j. c #E68703", +"k. c #C37405", +"l. c #2A2622", +"m. c #313136", +"n. c #313450", +"o. c #40446C", +"p. c #4E5387", +"q. c #5F65A1", +"r. c #696FB1", +"s. c #31397C", +"t. c #000001", +"u. c #4C4E68", +"v. c #9BA2DA", +"w. c #9AA1D9", +"x. c #D5D7E5", +"y. c #E7E7E7", +"z. c #E4E4E4", +"A. c #DEDEDE", +"B. c #D4D4D4", +"C. c #C3C3C3", +"D. c #E78805", +"E. c #DA8002", +"F. c #3F301B", +"G. c #303030", +"H. c #3D3E49", +"I. c #3E4266", +"J. c #4F5483", +"K. c #5E639C", +"L. c #686FAF", +"M. c #656DB3", +"N. c #282E68", +"O. c #676B8E", +"P. c #9CA3DA", +"Q. c #9BA1D9", +"R. c #9AA0D9", +"S. c #999FD8", +"T. c #E0E1E7", +"U. c #E5E5E5", +"V. c #BBBBBB", +"W. c #B7B7B7", +"X. c #B5B5B5", +"Y. c #B0B0B0", +"Z. c #AAAAAA", +"`. c #A7A5A2", +" + c #614113", +".+ c #2B2B2B", +"++ c #424242", +"@+ c #484A5E", +"#+ c #4B4F7C", +"$+ c #5A5F97", +"%+ c #656CAB", +"&+ c #6D74B9", +"*+ c #5F67B1", +"=+ c #202552", +"-+ c #878DBD", +";+ c #99A0D9", +">+ c #989FD8", +",+ c #9CA2D9", +"'+ c #E6E6E7", +")+ c #E3E3E3", +"!+ c #CACACA", +"~+ c #B6A996", +"{+ c #8D560A", +"]+ c #232323", +"^+ c #393939", +"/+ c #555555", +"(+ c #515474", +"_+ c #565B90", +":+ c #6369A6", +"<+ c #6B72B6", +"[+ c #6F77BF", +"}+ c #5861AD", +"|+ c #191D40", +"1+ c #1A1B24", +"2+ c #999FD7", +"3+ c #989ED8", +"4+ c #979DD7", +"5+ c #A8ADDA", +"6+ c #D1D1D1", +"7+ c #DCDCDC", +"8+ c #D8D8D8", +"9+ c #C2AC8E", +"0+ c #925807", +"a+ c #282726", +"b+ c #474747", +"c+ c #666666", +"d+ c #565A85", +"e+ c #5E649F", +"f+ c #686EB1", +"g+ c #6E75BC", +"h+ c #7078C2", +"i+ c #515AA8", +"j+ c #12152F", +"k+ c #3A3D53", +"l+ c #969DD7", +"m+ c #959CD7", +"n+ c #B5B8DC", +"o+ c #C5C5C5", +"p+ c #B6B6B6", +"q+ c #B1B1B1", +"r+ c #A9A9A9", +"s+ c #A0A0A0", +"t+ c #A88D68", +"u+ c #AB6C13", +"v+ c #58544F", +"w+ c #707072", +"x+ c #575C90", +"y+ c #6268A8", +"z+ c #6A71B7", +"A+ c #6E76C0", +"B+ c #7077C3", +"C+ c #4B53A2", +"D+ c #0B0D1D", +"E+ c #535675", +"F+ c #979ED8", +"G+ c #969CD7", +"H+ c #959BD7", +"I+ c #949AD6", +"J+ c #C1C4DD", +"K+ c #D3D3D3", +"L+ c #C8A069", +"M+ c #C37C19", +"N+ c #716E71", +"O+ c #565B93", +"P+ c #6269AA", +"Q+ c #6A71B8", +"R+ c #6D75C0", +"S+ c #6E76C3", +"T+ c #444C9C", +"U+ c #05060D", +"V+ c #7176A2", +"W+ c #949BD6", +"X+ c #939AD6", +"Y+ c #9299D5", +"Z+ c #CED0DF", +"`+ c #D9D9D9", +" @ c #C99D5F", +".@ c #C37C20", +"+@ c #575989", +"@@ c #5E65A4", +"#@ c #676DB4", +"$@ c #6B72BD", +"%@ c #6C74C2", +"&@ c #3B4490", +"*@ c #010102", +"=@ c #8D93CB", +"-@ c #9399D6", +";@ c #9298D5", +">@ c #DADBDF", +",@ c #B4B4B4", +"'@ c #AFAFAF", +")@ c #ADADAD", +"!@ c #A6A6A6", +"~@ c #A1A1A1", +"{@ c #C69146", +"]@ c #E48502", +"^@ c #896652", +"/@ c #585E9C", +"(@ c #6269AE", +"_@ c #686FBA", +":@ c #6970BE", +"<@ c #31397D", +"[@ c #2B2D3E", +"}@ c #9399D5", +"|@ c #9198D5", +"1@ c #9097D4", +"2@ c #999FD5", +"3@ c #DEDEDF", +"4@ c #DDDDDD", +"5@ c #DBDBDB", +"6@ c #D5D5D5", +"7@ c #CCCCCC", +"8@ c #B3B3B3", +"9@ c #CD8D34", +"0@ c #E38401", +"a@ c #B9700B", +"b@ c #885E24", +"c@ c #4F4A54", +"d@ c #444978", +"e@ c #525893", +"f@ c #5D64A8", +"g@ c #646BB6", +"h@ c #636BB9", +"i@ c #2A316D", +"j@ c #454865", +"k@ c #9096D4", +"l@ c #8E95D4", +"m@ c #A7ABD6", +"n@ c #B8B8B8", +"o@ c #D59132", +"p@ c #E08301", +"q@ c #A76406", +"r@ c #66400C", +"s@ c #2A2218", +"t@ c #2E2E2E", +"u@ c #414141", +"v@ c #3E415A", +"w@ c #424776", +"x@ c #50558F", +"y@ c #5B61A5", +"z@ c #6269B3", +"A@ c #5D64B3", +"B@ c #242A5E", +"C@ c #62668F", +"D@ c #9197D5", +"E@ c #8F96D4", +"F@ c #8E95D3", +"G@ c #8D94D3", +"H@ c #B5B8D7", +"I@ c #BCBCBC", +"J@ c #B2B2B2", +"K@ c #DD8C1D", +"L@ c #D67D02", +"M@ c #995C08", +"N@ c #563810", +"O@ c #241F18", +"P@ c #1F1F1F", +"Q@ c #272727", +"R@ c #313131", +"S@ c #3F3F3F", +"T@ c #4F4F4F", +"U@ c #414466", +"V@ c #464A7E", +"W@ c #515794", +"X@ c #5B62A7", +"Y@ c #6168B4", +"Z@ c #575FAE", +"`@ c #1F2450", +" # c #8187BE", +".# c #8E94D3", +"+# c #8D93D3", +"@# c #8B92D2", +"## c #C3C5D8", +"$# c #D6D6D6", +"%# c #939393", +"&# c #DD840A", +"*# c #E78601", +"=# c #875510", +"-# c #4C3617", +";# c #201F1D", +"># c #222222", +",# c #282828", +"'# c #676768", +")# c #484D7B", +"!# c #4E538E", +"~# c #565C9F", +"{# c #5D64AD", +"]# c #6169B7", +"^# c #535BAA", +"/# c #1A1E43", +"(# c #202230", +"_# c #8C93D3", +":# c #8A91D1", +"<# c #D0D1D9", +"[# c #C4C4C4", +"}# c #D08D30", +"|# c #A67F47", +"1# c #6C5F4E", +"2# c #292929", +"3# c #373737", +"4# c #454545", +"5# c #565656", +"6# c #636363", +"7# c #6D6D6D", +"8# c #787878", +"9# c #7F7F83", +"0# c #525894", +"a# c #575DA0", +"b# c #5C63AB", +"c# c #6067B4", +"d# c #626ABA", +"e# c #4F57A7", +"f# c #141835", +"g# c #3D405B", +"h# c #8C93D2", +"i# c #8B91D2", +"j# c #8990D1", +"k# c #8C92D1", +"l# c #D6D6D8", +"m# c #9D9D9D", +"n# c #828282", +"o# c #4E4E4E", +"p# c #545454", +"q# c #5D5D5D", +"r# c #656565", +"s# c #6B6B6B", +"t# c #7B7B7B", +"u# c #8F909B", +"v# c #5B62A8", +"w# c #5E65AF", +"x# c #6068B5", +"y# c #6269B9", +"z# c #626ABC", +"A# c #4B53A4", +"B# c #0F1228", +"C# c #575B83", +"D# c #8C92D2", +"E# c #8A91D2", +"F# c #888FD1", +"G# c #878ED0", +"H# c #A9ADD2", +"I# c #C1C2D4", +"J# c #CFD0D4", +"K# c #D2D2D2", +"L# c #A5A5A5", +"M# c #909090", +"N# c #7D7D7D", +"O# c #717171", +"P# c #6C6C6C", +"Q# c #6F6F6F", +"R# c #767676", +"S# c #7E7E7E", +"T# c #878787", +"U# c #8F8F8F", +"V# c #969696", +"W# c #9C9C9C", +"X# c #9597AC", +"Y# c #6168B6", +"Z# c #626ABB", +"`# c #626ABD", +" $ c #626ABE", +".$ c #4750A2", +"+$ c #0B0D1C", +"@$ c #787EB5", +"#$ c #888ED0", +"$$ c #868DD0", +"%$ c #858CCF", +"&$ c #848BCF", +"*$ c #838ACE", +"=$ c #8289CE", +"-$ c #8D93CE", +";$ c #9CA1CE", +">$ c #ABAECD", +",$ c #B8BACA", +"'$ c #C1C1C5", +")$ c #949494", +"!$ c #8D8D8D", +"~$ c #8B8B8B", +"{$ c #8E8E8E", +"]$ c #9A9A9A", +"^$ c #ACACAC", +"/$ c #9497B5", +"($ c #646BBC", +"_$ c #636BBD", +":$ c #636BBE", +"<$ c #6169BF", +"[$ c #434C9E", +"}$ c #181924", +"|$ c #8990D0", +"1$ c #8188CD", +"2$ c #8087CD", +"3$ c #7F86CC", +"4$ c #7D85CC", +"5$ c #7C83CB", +"6$ c #7A81C9", +"7$ c #797FC6", +"8$ c #8086C0", +"9$ c #898DB8", +"0$ c #9093B0", +"a$ c #989AA8", +"b$ c #A0A1A4", +"c$ c #A3A3A3", +"d$ c #8D91BA", +"e$ c #646CBF", +"f$ c #636BBF", +"g$ c #626ABF", +"h$ c #6169BE", +"i$ c #6068BE", +"j$ c #3F4898", +"k$ c #020306", +"l$ c #383A55", +"m$ c #868CCF", +"n$ c #787FC4", +"o$ c #757CC1", +"p$ c #7B82CA", +"q$ c #7A82CA", +"r$ c #7980C9", +"s$ c #777EC7", +"t$ c #747BC4", +"u$ c #7078C0", +"v$ c #6D74BB", +"w$ c #767BB6", +"x$ c #8589B7", +"y$ c #9699B7", +"z$ c #A6A8B8", +"A$ c #B4B4B7", +"B$ c #8388BC", +"C$ c #5F68BE", +"D$ c #5E66BD", +"E$ c #3A428F", +"F$ c #51557C", +"G$ c #6D74B3", +"H$ c #636689", +"I$ c #686977", +"J$ c #67697E", +"K$ c #6C6F8E", +"L$ c #6F739F", +"M$ c #7075AE", +"N$ c #7077BC", +"O$ c #7179C3", +"P$ c #7077C2", +"Q$ c #6E75C0", +"R$ c #6D74BF", +"S$ c #6C73BF", +"T$ c #6B73C0", +"U$ c #6B72C0", +"V$ c #6A72C1", +"W$ c #6C74C1", +"X$ c #797FC0", +"Y$ c #898DBE", +"Z$ c #989BBB", +"`$ c #A1A3B7", +" % c #6870BE", +".% c #5F67BE", +"+% c #5C64BC", +"@% c #32397E", +"#% c #7176AF", +"$% c #747BBE", +"%% c #686978", +"&% c #757575", +"*% c #777A99", +"=% c #797B8D", +"-% c #7B7B7F", +";% c #7C7C7C", +">% c #7C7C7D", +",% c #797A83", +"'% c #777A91", +")% c #74779F", +"!% c #7075AC", +"~% c #6A71B9", +"{% c #6C73C3", +"]% c #6B72C3", +"^% c #6A71C2", +"/% c #6970C2", +"(% c #676FC1", +"_% c #666EC1", +":% c #656DC0", +"<% c #646CC0", +"[% c #5F67BD", +"}% c #5961B9", +"|% c #2C3372", +"1% c #181925", +"2% c #838ACD", +"3% c #7E86CC", +"4% c #6B709E", +"5% c #797979", +"6% c #747581", +"7% c #777EC8", +"8% c #767DC8", +"9% c #757CC7", +"0% c #757BBA", +"a% c #777CA9", +"b% c #818182", +"c% c #838383", +"d% c #858585", +"e% c #858586", +"f% c #7D7E89", +"g% c #767896", +"h% c #6B70A0", +"i% c #5F66AA", +"j% c #6068B7", +"k% c #636BC0", +"l% c #5E67BD", +"m% c #5D65BD", +"n% c #5B63BC", +"o% c #565EB6", +"p% c #282E67", +"q% c #363955", +"r% c #7F86CD", +"s% c #7E85CC", +"t% c #7C83CA", +"u% c #676981", +"v% c #7A7A7A", +"w% c #737695", +"x% c #757DC8", +"y% c #747CC7", +"z% c #737AC7", +"A% c #7279C6", +"B% c #747ABA", +"C% c #838384", +"D% c #868686", +"E% c #888888", +"F% c #898989", +"G% c #8A8A8A", +"H% c #8C8C8C", +"I% c #8B8B8C", +"J% c #717384", +"K% c #555A99", +"L% c #545BA5", +"M% c #555CA8", +"N% c #5A62B4", +"O% c #5A63BB", +"P% c #5961BB", +"Q% c #525AB2", +"R% c #242A5D", +"S% c #51557F", +"T% c #8188CE", +"U% c #7C84CB", +"V% c #6A71B3", +"W% c #73737A", +"X% c #7075AB", +"Y% c #747BC7", +"Z% c #7179C6", +"`% c #7078C6", +" & c #787CAC", +".& c #6E7193", +"+& c #5C64B9", +"@& c #535BA8", +"#& c #535AA8", +"$& c #5A62BB", +"%& c #5860BA", +"&& c #4F57AF", +"*& c #1E234F", +"=& c #7076B3", +"-& c #7B82CB", +";& c #62689E", +">& c #7F7F7F", +",& c #79797C", +"'& c #7279C1", +")& c #727AC7", +"!& c #7077C5", +"~& c #6F76C5", +"{& c #7E819E", +"]& c #757789", +"^& c #5D66BD", +"/& c #4F56A2", +"(& c #5760BA", +"_& c #565EB9", +":& c #4B54AC", +"<& c #1B1F46", +"[& c #1E2030", +"}& c #7F86CB", +"|& c #7D84CB", +"1& c #7981CA", +"2& c #65688E", +"3& c #808080", +"4& c #818181", +"5& c #737589", +"6& c #7178C6", +"7& c #6F77C5", +"8& c #6E76C5", +"9& c #6D75C4", +"0& c #858693", +"a& c #959595", +"b& c #777988", +"c& c #5962BB", +"d& c #5158A8", +"e& c #545DB4", +"f& c #545DB9", +"g& c #4851A8", +"h& c #181C3E", +"i& c #393D5D", +"j& c #7B83CB", +"k& c #7980CA", +"l& c #767EC7", +"m& c #696B80", +"n& c #848484", +"o& c #6E729B", +"p& c #6E76C4", +"q& c #6D74C4", +"r& c #6E75BE", +"s& c #8B8B8D", +"t& c #919191", +"u& c #989898", +"v& c #71738E", +"w& c #5B64BC", +"x& c #4E56A4", +"y& c #555DB8", +"z& c #545CB9", +"A& c #535BB8", +"B& c #464EA5", +"C& c #131631", +"D& c #3F4367", +"E& c #7A81CA", +"F& c #777FC9", +"G& c #6A71B6", +"H& c #797A81", +"I& c #696FAE", +"J& c #6E75C4", +"K& c #6C74C4", +"L& c #6B73C3", +"M& c #757AB3", +"N& c #999999", +"O& c #666A94", +"P& c #565FB9", +"Q& c #4D54A2", +"R& c #545CB8", +"S& c #525BB8", +"T& c #515AB7", +"U& c #434CA2", +"V& c #0F1227", +"W& c #292C44", +"X& c #7880C9", +"Y& c #777EC9", +"Z& c #6268A5", +"`& c #78787F", +" * c #6E75C3", +".* c #7D81A8", +"+* c #9B9B9B", +"@* c #5A5F9B", +"#* c #5861BA", +"$* c #575FBA", +"%* c #555DB9", +"&* c #4B53A1", +"** c #5159B7", +"=* c #5058B6", +"-* c #414AA0", +";* c #0D0F21", +">* c #5D629A", +",* c #787FC9", +"'* c #666A96", +")* c #6F728D", +"!* c #6A72C3", +"~* c #6971C2", +"{* c #6870C2", +"]* c #87899E", +"^* c #979797", +"/* c #9E9E9E", +"(* c #565DA9", +"_* c #4B52A1", +":* c #4F58B6", +"<* c #4E57B6", +"[* c #3F489D", +"}* c #070813", +"|* c #0E0F1B", +"1* c #434B90", +"2* c #575FAD", +"3* c #646CB9", +"4* c #4951A0", +"5* c #676A89", +"6* c #666B9C", +"7* c #686FC2", +"8* c #686FC0", +"9* c #929297", +"0* c #9F9F9F", +"a* c #87878C", +"b* c #565EB7", +"c* c #555EB9", +"d* c #4A51A2", +"e* c #4E56B6", +"f* c #4D55B5", +"g* c #3D469A", +"h* c #434346", +"i* c #808081", +"j* c #88898A", +"k* c #7F829B", +"l* c #797EB0", +"m* c #6F76BA", +"n* c #6870C1", +"o* c #6F75B8", +"p* c #A2A2A2", +"q* c #797B8F", +"r* c #4F57B3", +"s* c #4A51A4", +"t* c #4D56B5", +"u* c #4C55B5", +"v* c #4B54B4", +"w* c #3B4497", +"x* c #020205", +"y* c #030304", +"z* c #202022", +"A* c #38393B", +"B* c #545458", +"C* c #707173", +"D* c #7F7F81", +"E* c #89898C", +"F* c #8F8F98", +"G* c #888BA3", +"H* c #898BA4", +"I* c #A4A4A4", +"J* c #6B6F93", +"K* c #535CB8", +"L* c #525AB8", +"M* c #4B53AA", +"N* c #4A52AB", +"O* c #4B53B4", +"P* c #4952B4", +"Q* c #373F8C", +"R* c #040405", +"S* c #171719", +"T* c #303134", +"U* c #4B4B4E", +"V* c #69696F", +"W* c #7D7E82", +"X* c #898A8E", +"Y* c #95969A", +"Z* c #9D9D9E", +"`* c #A7A7A7", +" = c #5C6197", +".= c #525AB7", +"+= c #5059B7", +"@= c #4850A3", +"#= c #4B53B2", +"$= c #4A53B4", +"%= c #4952B3", +"&= c #4851B3", +"*= c #353D88", +"== c #010101", +"-= c #0F1011", +";= c #29292B", +">= c #424246", +",= c #606167", +"'= c #7C7D84", +")= c #88898F", +"!= c #97979E", +"~= c #A2A3A5", +"{= c #4F559D", +"]= c #4F57B6", +"^= c #474EA0", +"/= c #4951B3", +"(= c #4750B3", +"_= c #464FB1", +":= c #2F3679", +"<= c #0A0A0D", +"[= c #222226", +"}= c #3A3A3C", +"|= c #575860", +"1= c #767781", +"2= c #878890", +"3= c #9798A0", +"4= c #8D8E92", +"5= c #474E94", +"6= c #4E56AF", +"7= c #4F57B5", +"8= c #454C9E", +"9= c #464FB2", +"0= c #444DB0", +"a= c #2E3577", +"b= c #050507", +"c= c #1A1B1F", +"d= c #333337", +"e= c #47484E", +"f= c #262835", +"g= c #191C3F", +"h= c #2B3169", +"i= c #3F4794", +"j= c #474FA7", +"k= c #4750B2", +"l= c #464EB2", +"m= c #444DB1", +"n= c #424AAC", +"o= c #0E1024", +"p= c #242857", +"q= c #414AA8", +"r= c #434CB0", +"s= c #3E47A4", +"t= c #212654", +"u= c #1B1F45", +"v= c #2A306C", +"w= c #374091", +"x= c #394294", +"y= c #12152E", +"z= c #010204", +"A= c #080A16", +" ", +" . + ", +" @ @ @ # ", +" $ @ @ @ @ % ", +" & @ @ @ @ @ @ + * ", +" = @ @ @ @ @ @ @ @ - ", +" @ @ @ @ @ @ @ @ ; ", +" > @ @ @ @ @ @ @ , ' ) ", +" ! @ @ @ @ @ @ @ ~ { ) ) ", +" @ @ @ @ @ @ @ ] ^ ) ) ", +" / @ @ @ @ @ @ @ ( ) ) ) ", +" _ : < [ } ] @ @ @ @ @ @ @ | 1 ) ) ", +" 2 3 4 5 6 7 8 9 0 a b c d e f g h i j k l @ @ @ @ @ @ @ m n o p q r ", +" s t u v w x y z A B C D E @ F G H I H J K @ @ @ @ @ @ L M N O P Q R ", +" S T U V W X z A B C Y Z ` @ @ ...+.@.#.@ @ @ @ @ @ @ $.%.&.*.=.-.;.>. ", +" ,.'.).!.~.{.z ].^./.(._.(.:.@ @ @ <.[.}.@ @ @ @ @ @ @ |.1.2.3.4.5.6.7.8. ", +" 9.0.a.b.c.d.e.C f.].g.+.h.i.@ @ @ @ j.@ @ @ @ @ @ @ k.l.m.n.o.p.q.r.s.t.) ", +" u.a.b.v.w.x.B y.C z.A.B.C.D.@ @ @ @ @ @ @ @ @ @ @ E.F.G.H.I.J.K.L.M.N.) ) ", +" O.P.Q.R.S.T.U.V.W.X.Y.Z.`.@ @ @ @ @ @ @ @ @ @ @ @ +.+++@+#+$+%+&+*+=+) ) ", +" -+Q.;+>+,+'+C z.)+D Z !+~+@ @ @ @ @ @ @ @ @ @ @ {+]+^+/+(+_+:+<+[+}+|+) ) ", +" 1+2+;+3+4+5+U.6+H 7+A.8+(.9+@ @ @ @ @ @ @ @ @ @ @ 0+a+b+c+d+e+f+g+h+i+j+) ) ", +" k+S.3+l+m+n+z.Z o+p+q+r+s+t+@ @ @ @ @ @ @ @ @ @ @ @ u+v+w+x+y+z+A+B+C+D+) ) ", +" E+F+G+H+I+J+f.Y D A.Z K+o+L+@ @ @ @ @ @ @ @ @ @ @ @ @ M+N+O+P+Q+R+S+T+U+) ", +" V+G+W+X+Y+Z+D A.A.7+`+6+^. @@ @ @ @ @ @ @ @ @ @ @ @ @ @ .@+@@@#@$@%@&@*@) ", +" =@W+-@;@;@>@6+,@Y.'@)@!@~@{@@ @ @ @ @ @ @ @ @ @ @ @ @ @ ]@^@/@(@_@:@<@) ) ", +" [@I+}@|@1@2@3@4@7+5@`+6@7@8@9@@ @ @ @ @ @ @ @ @ @ @ 0@a@b@c@d@e@f@g@h@i@) ) ", +" j@Y+|@k@l@m@4@K+5@`+].K+!+n@o@@ @ @ @ @ @ @ @ p@q@r@s@t@u@v@w@x@y@z@A@B@) ) ", +" C@D@E@F@G@H@7+I@)@)@Z.h.J@J@K@@ @ @ @ @ L@M@N@O@P@Q@R@S@T@U@V@W@X@Y@Z@`@) ) ", +" #E@.#+#@###Z `+8+$#B.7@8@%#&#@ *#k.=#-#;#>#,#G.^+++k j '#)#!#~#{#]#^#/#) ) ", +" (#F@G@_#@#:#<#8+].$#6@K+g.[#8@}#|#1#S@t@2#.+G.3#4#5#6#7#8#9#0#a#b#c#d#e#f#) ) ", +" g#G@h#i#j#k#l#].$#B.K+6+7@[#,@m#n#g 5#o#o#p#q#r#h c+s#t#%#u#v#w#x#y#z#A#B#) ", +" C#D#E#j#F#G#H#I#J#K+K#_.(.[#W.L#M#N#O#P#Q#R#S#T#U#V#W#~@!@X#Y#y#Z#`# $.$+$) ", +" @$E#j##$$$%$&$*$=$-$;$>$,$'$I@'@s+)$!$~${$)$]$s+L#r+^$'@Y./$($_$:$ $<$[$>.) ", +" }$|$F#G#$$%$*$=$1$2$3$4$5$6$7$8$9$0$a$b$c$!@r+^$'@J@8@,@X.X.d$e$f$g$h$i$j$k$) ", +" l$F#G#m$&$*$=$1$3$n$o$p$q$r$s$t$u$v$Q+<+w$x$y$z$A$W.W.W.p+p+B$f$g$h$C$D$E$) ) ", +" F$$$%$&$*$=$2$G$H$I$I$J$K$L$M$N$O$P$Q$R$S$T$U$V$W$X$Y$Z$z$`$ %g$i$.%D$+%@%) ) ", +" #%%$&$=$1$2$$%%%&%R#R#*%=%-%;%>%,%'%)%!%~%{%]%^%/%(%_%:%<%g$<$i$[%D$+%}%|%) ) ", +" 1%2%*$=$1$2$3%4%R#8#5%6%7%8%9%0%a%b%n#c%d%e%f%g%h%i%j%e$k%g$h$i$l%m%+%n%o%p%) ) ", +" q%*$=$1$r%s%t%u%5%v%t#w%x%y%z%A%B%C%d%D%T#E%F%G%H%I%J%K%L%L%M%N%m%+%O%P%Q%R%) ) ", +" S%T%2$3$s%U%V%W%t#;%N#X%Y%z%Z%`% &D%T#E%F%~$H%!${$U#M#.&i$.%+&@&#&$&P%%&&&*&) ) ", +" =&2$3$4$5$-&;&>%S#>&,&'&)&Z%!&~&{&E%F%~$H%!${$U#M#c %#]&[%^&+%n%/&%&(&_&:&<&) ) ", +" [&}&s%|&5$p$1&2&>&3&4&5&A%6&7&8&9&0&~$H%!${$U#M#c %#)$a&b&m%+%n%c&d&e&_&f&g&h&) ) ", +" i&s%|&j&q$k&l&m&4&n#n&o&`%7&p&q&r&s&!${$U#t&c %#)$a&V#u&v&w&$&P%%&x&y&z&A&B&C&) ", +" D&U%-&E&r$F&G&H&n&d%c%I&~&J&K&L&M&{$U#t&c %#)$a&V#u&N&]$O&$&P%(&P&Q&R&S&T&U&V&) ", +" W&p$E&X&Y&8%Z&d%D%T#`& *9&K&]%^%.*t&c %#)$a&V#u&N&]$+*+*@*#*$*_&%*&*S&**=*-*;*) ", +" >*,*Y&8%y%'*T#E%G%)*9&{%!*~*{*]*%#)$a&^*u&N&]$+*W#/*)$(*$*_&f&A&_***:*<*[*}*) ", +" |*1*2*3*4*5*G%~$H%6*L&!*~*7*8*9*a&^*u&N&]$+*W#/*0*s+a*b*c*R&A&T&d*:*e*f*g*U+) ", +" k$;*|+=+h*i*j*!$k*l*m*n*_%o*^*u&N&]$+*W#/*0*s+~@p*q*%*R&S&T&r*s*t*u*v*w*x*) ", +" ) ) ) y*z*A*B*C*D*E*F*G*H*N&]$+*m#/*0*s+~@p*I*L#J*K*L***=*M*N*u*O*P*Q**@) ", +" ) ) ) ) ) R*S*T*U*V*W*X*Y*Z*0*s+~@p*I*L#!@`* =.=+=:*<*@=#=$=%=&=*=t.) ", +" ) ) ) ) ) ==-=;=>=,='=)=!=~=!@`*h.!@{=+=]=e*u*^=$=/=(=_=:=) ) ", +" ) ) ) ) ) ) ) <=[=}=|=1=2=3=4=5=6=7=u*O*8=&=(=9=0=a=) ) ", +" ) ) ) ) ) ) ) b=c=d=e=f=g=h=i=j=8=k=l=m=n=N.) ) ", +" ) ) ) ) ) ) ) ) ) x*o=p=q=0=r=s=t=) ) ", +" ) ) ) ) ) ) ) ) u=v=w=x=y=) ) ", +" ) ) ) z=A=) ) ) ", +" ) ) ) ) ", +" ) ) ", +" ", +" "}; diff --git a/GraphSort.C b/GraphSort.C new file mode 100644 index 0000000..ab9f057 --- /dev/null +++ b/GraphSort.C @@ -0,0 +1,192 @@ +/* Graph Sort + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "GraphSort.h" + +//#define GRAPHSORT_TRACE + +////////////////////////////////////////////////////////// + +GraphSort::GraphSort() +{ +} + +GraphSort::~GraphSort() +{ +} + +void GraphSort::Clear() +{ + //m_Sorted.clear(); + m_Graph.clear(); +} + + +const list &GraphSort::GetSortedList() +{ + return m_Sorted; +} + +void GraphSort::Sort() +{ + // walk back from all the roots + m_Sorted.clear(); + list RootNodes; + for (map::iterator i=m_Graph.begin(); + i!=m_Graph.end(); i++) + { + // if there are no outputs, this must be a root + if (i->second.Outputs.empty()) + { + RecursiveWalk(i->first); + } + } + + #ifdef GRAPHSORT_TRACE + for(list::iterator i=m_Sorted.begin(); + i!=m_Sorted.end(); i++) + { + cerr<<*i<<" "; + } + cerr<::iterator i=m_Graph.find(node); + for(list::iterator ii=i->second.Inputs.begin(); + ii!=i->second.Inputs.end(); ii++) + { + RecursiveWalk(*ii); + } +} + +void GraphSort::Dump() +{ + for (map::iterator i=m_Graph.begin(); + i!=m_Graph.end(); i++) + { + cerr<<"Node "<first<::iterator si=m_Graph.find(SID); + if (si==m_Graph.end()) + { + Node newnode; + m_Graph[SID]=newnode; + #ifdef GRAPHSORT_TRACE + cerr<<"added "<::iterator di=m_Graph.find(DID); + if (di==m_Graph.end()) + { + Node newnode; + m_Graph[DID]=newnode; + #ifdef GRAPHSORT_TRACE + cerr<<"added "<::iterator si=m_Graph.find(SID); + if (si==m_Graph.end()) + { + cerr<<"GraphSort::RemoveConnection - can't find source node"<::iterator di=m_Graph.find(DID); + if (di==m_Graph.end()) + { + cerr<<"GraphSort::RemoveConnection - can't find dest node"<::iterator soi = find(si->second.Outputs.begin(), si->second.Outputs.end(), DID); + if (soi==si->second.Outputs.end()) cerr<<"GraphSort::RemoveConnection - can't find soi"<second.Outputs.erase(soi); + + list::iterator dii = find(di->second.Inputs.begin(), di->second.Inputs.end(), SID); + if (dii==di->second.Inputs.end()) cerr<<"GraphSort::RemoveConnection - can't find dii"<second.Inputs.erase(dii); + + // check to remove the nodes + if (si->second.Outputs.empty() && si->second.Inputs.empty()) + { + m_Graph.erase(si); + #ifdef GRAPHSORT_TRACE + cerr<<"removed "<second.Outputs.empty() && di->second.Inputs.empty()) + { + m_Graph.erase(di); + #ifdef GRAPHSORT_TRACE + cerr<<"removed "< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include + +#ifndef GRAPH_SORT +#define GRAPH_SORT + +using namespace std; + +class GraphSort +{ +public: + GraphSort(); + ~GraphSort(); + const list &GetSortedList(); + void Sort(); + void AddConnection(int SID, int DID); + void RemoveConnection(int SID, int DID); + void Clear(); + void Dump(); + + struct Node + { + list Inputs; + list Outputs; + }; + +private: + void RecursiveWalk(int node); + + map m_Graph; + list m_Sorted; +}; + +#endif diff --git a/Makefile.in b/Makefile.in new file mode 100644 index 0000000..429b994 --- /dev/null +++ b/Makefile.in @@ -0,0 +1,264 @@ +############################################################################# +# Makefile for building SpiralSynthModular +# Generated by tmake at 20:13, 2001/10/04 +# Project: SpiralSynthModular +# Template: app +############################################################################# + +SHELL = @SHELL@ + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ @FLTK_CFLAGS@ +CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ +INCPATH = +LINK = g++ +LFLAGS = +LIBS = @FLTK_LIBS@ -lm -ldl -lpng -lpthread +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +SpiralPlugins = @PLUGINDIR@ + +####### Files + +HEADERS = SpiralSynthModular.h \ + SpiralSynthModularInfo.h \ + GraphSort.h \ + GUI/Widgets/Fl_DeviceGUI.h \ + GUI/Widgets/Fl_CommentGUI.h \ + GUI/Widgets/Fl_DragBar.H \ + GUI/Widgets/Fl_Canvas.h \ + SpiralSound/SpiralInfo.h \ + SpiralSound/Sample.h \ + SpiralSound/Plugins/SpiralPlugin.h \ + SpiralSound/Plugins/SpiralPluginGUI.h \ + SpiralSound/PluginManager.h \ + SettingsWindow.h \ + SpiralSynthPluginLocation.h +SOURCES = SpiralSynthModular.C \ + SpiralSynthModularInfo.C \ + GraphSort.C \ + GUI/Widgets/Fl_DeviceGUI.C \ + GUI/Widgets/Fl_CommentGUI.C \ + GUI/Widgets/Fl_DragBar.cxx \ + GUI/Widgets/Fl_Canvas.C \ + SpiralSound/SpiralInfo.C \ + SpiralSound/Sample.C \ + SpiralSound/Plugins/SpiralPlugin.C \ + SpiralSound/Plugins/SpiralPluginGUI.C \ + SpiralSound/PluginManager.C \ + SettingsWindow.C +OBJECTS = SpiralSynthModular.o \ + SpiralSynthModularInfo.o \ + GraphSort.o \ + GUI/Widgets/Fl_DeviceGUI.o \ + GUI/Widgets/Fl_CommentGUI.o \ + GUI/Widgets/Fl_DragBar.o \ + GUI/Widgets/Fl_Canvas.o \ + SpiralSound/SpiralInfo.o \ + SpiralSound/Sample.o \ + SpiralSound/Plugins/SpiralPlugin.o \ + SpiralSound/Plugins/SpiralPluginGUI.o \ + SpiralSound/PluginManager.o \ + SettingsWindow.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SpiralSynthModular + +SUBDIRS = @PLUGINLIST@ + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + list='$(SUBDIRS)'; \ + for subdir in $$list; do \ + (cd SpiralSound/Plugins/$$subdir ; make) \ + done; + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: Makefile + +Makefile: SpiralSynthModular.pro + tmake SpiralSynthModular.pro -o Makefile + +dist: + $(TAR) SpiralSynthModular.tar SpiralSynthModular.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) SpiralSynthModular.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + list='$(SUBDIRS)'; \ + for subdir in $$list; do \ + (cd SpiralSound/Plugins/$$subdir ; make clean) \ + done; + +install: SpiralSynthModular + $(INSTALL) SpiralSynthModular $(bindir) + $(INSTALL) -d $(SpiralPlugins) + list='$(SUBDIRS)'; \ + for subdir in $$list; do \ + (cd SpiralSound/Plugins/$$subdir ; make install) \ + done; + +uninstall: + rm -f $(bindir)/SpiralSynthModular + rm -rf $(SpiralPlugins) + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +SpiralSynthModular.o: SpiralSynthModular.C \ + SpiralSynthModular.h \ + SpiralSynthModularInfo.h \ + SpiralSound/SpiralInfo.h \ + GUI/Widgets/Fl_DeviceGUI.h \ + GUI/Widgets/Fl_CommentGUI.h \ + GUI/Widgets/Fl_Canvas.h \ + SpiralSound/Plugins/SpiralPlugin.h \ + SettingsWindow.h \ + SpiralSound/PluginManager.h \ + GUI/SSM.xpm \ + GUI/load.xpm \ + GUI/save.xpm \ + GUI/new.xpm \ + GUI/options.xpm \ + GUI/edit.xpm \ + GUI/comment.xpm + +SpiralSynthModularInfo.o: SpiralSynthModularInfo.C \ + SpiralSynthModularInfo.h \ + SpiralSound/SpiralInfo.h \ + SpiralSynthPluginLocation.h + +GraphSort.o: GraphSort.C \ + GraphSort.h + +GUI/Widgets/Fl_DeviceGUI.o: GUI/Widgets/Fl_DeviceGUI.C \ + GUI/Widgets/Fl_DeviceGUI.h \ + GUI/Widgets/Fl_DragBar.H \ + GUI/Widgets/Fl_Canvas.h \ + GUI/Widgets/../../GraphSort.h \ + GUI/Widgets/../../SpiralSynthModularInfo.h \ + SpiralSound/SpiralInfo.h + +GUI/Widgets/Fl_CommentGUI.o: GUI/Widgets/Fl_CommentGUI.C \ + GUI/Widgets/Fl_CommentGUI.h \ + GUI/Widgets/Fl_DeviceGUI.h \ + GUI/Widgets/Fl_DragBar.H \ + GUI/Widgets/../../SpiralSynthModularInfo.h \ + SpiralSound/SpiralInfo.h + +GUI/Widgets/Fl_DragBar.o: GUI/Widgets/Fl_DragBar.cxx \ + GUI/Widgets/Fl_DragBar.H + +GUI/Widgets/Fl_Canvas.o: GUI/Widgets/Fl_Canvas.C \ + GUI/Widgets/Fl_Canvas.h \ + GUI/Widgets/../../GraphSort.h \ + GUI/Widgets/Fl_DeviceGUI.h \ + GUI/Widgets/Fl_DragBar.H \ + GUI/Widgets/../../SpiralSynthModularInfo.h \ + SpiralSound/SpiralInfo.h + +SpiralSound/SpiralInfo.o: SpiralSound/SpiralInfo.C \ + SpiralSound/SpiralInfo.h \ + SpiralSound/Sample.h + +SpiralSound/Sample.o: SpiralSound/Sample.C \ + SpiralSound/Sample.h \ + SpiralSound/SpiralInfo.h + +SpiralSound/Plugins/SpiralPlugin.o: SpiralSound/Plugins/SpiralPlugin.C \ + SpiralSound/Plugins/SpiralPlugin.h \ + SpiralSound/Plugins/../Sample.h \ + SpiralSound/SpiralInfo.h \ + SpiralSound/Sample.h + +SpiralSound/Plugins/SpiralPluginGUI.o: SpiralSound/Plugins/SpiralPluginGUI.C \ + SpiralSound/Plugins/SpiralPluginGUI.h \ + SpiralSound/Plugins/Widgets/Fl_DragBar.H \ + SpiralSound/Plugins/SpiralPlugin.h \ + SpiralSound/Plugins/../Sample.h \ + SpiralSound/SpiralInfo.h \ + SpiralSound/Sample.h + +SpiralSound/PluginManager.o: SpiralSound/PluginManager.C \ + SpiralSound/PluginManager.h \ + SpiralSound/Plugins/SpiralPlugin.h \ + SpiralSound/Plugins/../Sample.h \ + SpiralSound/SpiralInfo.h \ + SpiralSound/Sample.h + +SettingsWindow.o: SettingsWindow.C \ + SettingsWindow.h \ + SpiralSynthModular.h \ + SpiralSynthModularInfo.h \ + SpiralSound/SpiralInfo.h \ + SpiralSound/Sample.h \ + SpiralSound/SpiralInfo.h \ + GUI/Widgets/Fl_DeviceGUI.h \ + GUI/Widgets/Fl_DragBar.H \ + GUI/Widgets/Fl_CommentGUI.h \ + GUI/Widgets/Fl_DeviceGUI.h \ + GUI/Widgets/Fl_Canvas.h \ + GUI/Widgets/../../GraphSort.h \ + SpiralSound/Plugins/SpiralPlugin.h \ + SpiralSound/Plugins/../Sample.h \ + GUI/options.xpm diff --git a/README b/README new file mode 100644 index 0000000..1ececf4 --- /dev/null +++ b/README @@ -0,0 +1,63 @@ +** SpiralSynthModular ** + +Last changed Saturday March 23 2002. + +SpiralSynthModular is open source software, distributed under the General +Public License (GPL). See the file COPYING. + +It uses the OSS /dev/dsp driver, (although this is configurable) and the GUI +it uses is FLTK (www.fltk.org). + +See www.pawfal.org for more details. + +** Installing ** + +To build the SpiralSynthModular application, and all the plugins: + +./configure +make +make install + +Check out the designs in the Examples directory. + +The GUI requires FLTK to be installed (www.fltk.org), Which in turn +require Mesa or OpenGL. + +*** Jack support *** + +This release of SSM comes with an experimental JackPlugin. JACK stands for +Jack Audio Connection Kit and aims to connect Linux audio apps together. +For more information on Jack, and other apps supporting it, see: +http://jackit.sourceforge.net + +To build the JackPlugin, use the configure option: +./configure --enable-jack + +To load the plugin, add it to .SpiralSynthModular's plugin list. + +*** Setting up your .SpiralSynthModular file *** + +This file contains all the setup variables for the program. Thes values can be +edited with the options window whilst running SSM, but they will default to the +values in the file. +The following variables in the are the ones to play with to get a good playback +on your machine. This is usually tradeoff between quality and responsiveness +(latency). You can build designs and songs at low quality (22050 samplerate etc) +and then record them at higher settings. The wav file will sound fine, even if +the realtime output doesn't. + +BufferSize = 512 - Size of sample buffer to be calculated each cycle. +FragmentSize = 256 - Subbuffer size sent to the soundcard +FragmentCount = -1 - Subbuffer count, -1 computes a suitable size, + setting to 4 or 8 gets better latencies. +Samplerate = 44100 - Sets the samplerate + + +Disclaimer: +No representations are made about the suitability of this software +for any purpose. This software is provided "as is" without express +or implied warranty. +(Damage to ears, speakers or buildings are not my fault :)) + +Dave Griffiths - dave@pawfal.org +www.pawfal.org diff --git a/SettingsWindow.C b/SettingsWindow.C new file mode 100644 index 0000000..4c18e09 --- /dev/null +++ b/SettingsWindow.C @@ -0,0 +1,208 @@ +/* SpiralSynthModular + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include + +#include "SettingsWindow.h" +#include "SpiralSynthModularInfo.h" +#include "GUI/options.xpm" + +SettingsWindow::SettingsWindow() : +Fl_Double_Window(250,275,"SSM Options"), +m_App(NULL) +{ + color(SpiralSynthModularInfo::GUICOL_Tool); + box(FL_FLAT_BOX); + + Fl_Pixmap *Icon = new Fl_Pixmap(options_xpm); + Fl_Box *IconBox = new Fl_Box(25,30,50,50,""); + IconBox->image(Icon); + + Fl_Box *TextBox = new Fl_Box(180,10,50,20,"SpiralSynth Modular"); + TextBox->align(FL_ALIGN_RIGHT | FL_ALIGN_INSIDE); + TextBox = new Fl_Box(180,30,50,20,"Constructed by Dave Griffiths"); + TextBox->align(FL_ALIGN_RIGHT | FL_ALIGN_INSIDE); + TextBox->labelsize(10); + TextBox = new Fl_Box(192,40,50,20,"dave@@pawfal.org"); + TextBox->align(FL_ALIGN_RIGHT | FL_ALIGN_INSIDE); + TextBox->labelsize(10); + TextBox = new Fl_Box(180,50,50,20,"www.pawfal.org"); + TextBox->align(FL_ALIGN_RIGHT | FL_ALIGN_INSIDE); + TextBox->labelsize(10); + TextBox = new Fl_Box(180,63,50,20,"We are the music makers"); + TextBox->align(FL_ALIGN_RIGHT | FL_ALIGN_INSIDE); + TextBox->labelsize(10); + TextBox = new Fl_Box(180,73,50,20,"We are the dreamers of dreams"); + TextBox->align(FL_ALIGN_RIGHT | FL_ALIGN_INSIDE); + TextBox->labelsize(10); + + + Fl_Group *OptionsGrp = new Fl_Group(5,95,240,150,""); + OptionsGrp->box(FL_FLAT_BOX); + OptionsGrp->color(SpiralSynthModularInfo::GUICOL_Button); + + m_Options = new Fl_Pack(5,115,230,100,"Settings"); + m_Options->color(SpiralSynthModularInfo::GUICOL_Button); + OptionsGrp->add(m_Options); + + Fl_Box *Name; + Fl_Pack *Line; + + char BufferSize[256]; + sprintf(BufferSize,"%d",SpiralSynthModularInfo::BUFSIZE); + + char FragmentSize[256]; + sprintf(FragmentSize,"%d",SpiralSynthModularInfo::FRAGSIZE); + + char FragmentCount[256]; + sprintf(FragmentCount,"%d",SpiralSynthModularInfo::FRAGCOUNT); + + char Samplerate[256]; + sprintf(Samplerate,"%d",SpiralSynthModularInfo::SAMPLERATE); + + char OutputDevice[256]; + sprintf(OutputDevice,"%s",SpiralSynthModularInfo::OUTPUTFILE.c_str()); + + char MidiDevice[256]; + sprintf(MidiDevice,"%s",SpiralSynthModularInfo::MIDIFILE.c_str()); + + Line = new Fl_Pack(0,0,100,20,""); + Line->type(FL_HORIZONTAL); + Name = new Fl_Box(55,0,150,20,"Buffer Size"); + Name->labelsize(10); + Name->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + Line->add(Name); + m_BufferSize = new Fl_Int_Input(0,0,80,20,""); + m_BufferSize->value(BufferSize); + Line->add(m_BufferSize); + Line->end(); + m_Options->add(Line); + + Line = new Fl_Pack(0,0,100,20,""); + Line->type(FL_HORIZONTAL); + Name = new Fl_Box(55,0,150,20,"Fragment Size"); + Name->labelsize(10); + Name->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + Line->add(Name); + m_FragmentSize = new Fl_Int_Input(0,0,80,20,""); + m_FragmentSize->value(FragmentSize); + Line->add(m_FragmentSize); + Line->end(); + m_Options->add(Line); + + Line = new Fl_Pack(0,0,100,20,""); + Line->type(FL_HORIZONTAL); + Name = new Fl_Box(55,0,150,20,"Fragment Count (-1 = auto)"); + Name->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + Name->labelsize(10); + Line->add(Name); + m_FragmentCount = new Fl_Int_Input(0,0,80,20,""); + m_FragmentCount->value(FragmentCount); + Line->add(m_FragmentCount); + Line->end(); + m_Options->add(Line); + + Line = new Fl_Pack(0,0,100,20,""); + Line->type(FL_HORIZONTAL); + Name = new Fl_Box(55,0,150,20,"SampleRate"); + Name->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + Name->labelsize(10); + Line->add(Name); + m_Samplerate = new Fl_Int_Input(0,0,80,20,""); + m_Samplerate->value(Samplerate); + Line->add(m_Samplerate); + Line->end(); + m_Options->add(Line); + + Line = new Fl_Pack(0,0,100,20,""); + Line->type(FL_HORIZONTAL); + Name = new Fl_Box(55,0,150,20,"Output Device"); + Name->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + Name->labelsize(10); + Line->add(Name); + m_OutputDevice = new Fl_Input(0,0,80,20,""); + m_OutputDevice->value(OutputDevice); + Line->add(m_OutputDevice); + Line->end(); + m_Options->add(Line); + + Line = new Fl_Pack(0,0,100,20,""); + Line->type(FL_HORIZONTAL); + Name = new Fl_Box(55,0,150,20,"Midi Device"); + Name->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE); + Name->labelsize(10); + Line->add(Name); + m_MidiDevice = new Fl_Input(0,0,80,20,""); + m_MidiDevice->value(MidiDevice); + Line->add(m_MidiDevice); + Line->end(); + m_Options->add(Line); + + m_Options->end(); + + m_Save = new Fl_Button(140,250,50,20,"Save"); + m_Save->labelsize(10); + m_Save->tooltip("Save these settings"); + m_Save->callback((Fl_Callback*)cb_Save); + add(m_Save); + + m_Apply = new Fl_Button(195,250,50,20,"Apply"); + m_Apply->labelsize(10); + m_Apply->tooltip("Some plugins may request to save data first"); + m_Apply->callback((Fl_Callback*)cb_Apply); + add(m_Apply); + + end(); +} + +SettingsWindow::~SettingsWindow() +{ +} + +inline void SettingsWindow::cb_Apply_i(Fl_Button* o, void* v) +{ + SpiralSynthModularInfo::BUFSIZE=(int)atof(m_BufferSize->value()); + SpiralSynthModularInfo::FRAGSIZE=(int)atof(m_FragmentSize->value()); + SpiralSynthModularInfo::FRAGCOUNT=(int)atof(m_FragmentCount->value()); + SpiralSynthModularInfo::SAMPLERATE=(int)atof(m_Samplerate->value()); + SpiralSynthModularInfo::OUTPUTFILE=m_OutputDevice->value(); + SpiralSynthModularInfo::MIDIFILE=m_MidiDevice->value(); + + assert(m_App); + if (m_App) + { + m_App->UpdateHostInfo(); + } +} +void SettingsWindow::cb_Apply(Fl_Button* o, void* v) +{ ((SettingsWindow*)(o->parent()))->cb_Apply_i(o,v); } + +inline void SettingsWindow::cb_Save_i(Fl_Button* o, void* v) +{ + SpiralSynthModularInfo::BUFSIZE=(int)atof(m_BufferSize->value()); + SpiralSynthModularInfo::FRAGSIZE=(int)atof(m_FragmentSize->value()); + SpiralSynthModularInfo::FRAGCOUNT=(int)atof(m_FragmentCount->value()); + SpiralSynthModularInfo::SAMPLERATE=(int)atof(m_Samplerate->value()); + SpiralSynthModularInfo::OUTPUTFILE=m_OutputDevice->value(); + SpiralSynthModularInfo::MIDIFILE=m_MidiDevice->value(); + SpiralSynthModularInfo::Get()->SavePrefs(); +} +void SettingsWindow::cb_Save(Fl_Button* o, void* v) +{ ((SettingsWindow*)(o->parent()))->cb_Save_i(o,v); } diff --git a/SettingsWindow.h b/SettingsWindow.h new file mode 100644 index 0000000..6e19fbd --- /dev/null +++ b/SettingsWindow.h @@ -0,0 +1,60 @@ +/* SpiralSynthModular + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef SETTINGSWINDOW +#define SETTINGSWINDOW + +#include +#include +#include +#include +#include +#include + +#include "SpiralSynthModular.h" + +class SynthModular; + +class SettingsWindow : public Fl_Double_Window +{ +public: + SettingsWindow(); + ~SettingsWindow(); + + void RegisterApp(SynthModular *s) { m_App=s; } + +private: + SynthModular *m_App; + + Fl_Pack *m_Options; + Fl_Int_Input *m_BufferSize; + Fl_Int_Input *m_FragmentSize; + Fl_Int_Input *m_FragmentCount; + Fl_Int_Input *m_Samplerate; + Fl_Input *m_OutputDevice; + Fl_Input *m_MidiDevice; + Fl_Button *m_Save; + Fl_Button *m_Apply; + + inline void cb_Apply_i(Fl_Button* o, void* v); + static void cb_Apply(Fl_Button* o, void* v); + inline void cb_Save_i(Fl_Button* o, void* v); + static void cb_Save(Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Midi.C b/SpiralSound/Midi.C new file mode 100644 index 0000000..ed39ec5 --- /dev/null +++ b/SpiralSound/Midi.C @@ -0,0 +1,406 @@ +/* + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Midi.h" +#include "NoteTable.h" +#include "unistd.h" +#include "sys/types.h" +#include "signal.h" +#include "pthread.h" + +#ifdef KEYBOARD_SUPPORT +#include +#endif + +static const int MIDI_SCANBUFSIZE=256; +static const int MIDI_KEYOFFSET=0; + +static const unsigned char STATUS_START = 0x80; +static const unsigned char STATUS_NOTE_OFF = 0x80; +static const unsigned char STATUS_NOTE_ON = 0x90; +static const unsigned char STATUS_AFTERTOUCH = 0xa0; +static const unsigned char STATUS_CONTROL_CHANGE = 0xb0; +static const unsigned char STATUS_PROG_CHANGE = 0xc0; +static const unsigned char STATUS_CHANNEL_PRESSURE = 0xd0; +static const unsigned char STATUS_PITCH_WHEEL = 0xe0; +static const unsigned char STATUS_END = 0xf0; +static const unsigned char SYSEX_START = 0xf0; +static const unsigned char SYSEX_TERMINATOR = 0xf7; +static const unsigned char MIDI_CLOCK = 0xf8; +static const unsigned char ACTIVE_SENSE = 0xfe; + +static int NKEYS = 30; +static char KEYMAP[30]={'z','s','x','d','c','v','g','b','h','n','j','m','q', + '2','w','3','e','r','5','t','6','y','7','u','i','9', + 'o','0','p','['}; + +MidiDevice *MidiDevice::m_Singleton; +string MidiDevice::m_DeviceName; + +MidiDevice::MidiDevice() : +m_Poly(1) +{ + Open(); + +#ifdef KEYBOARD_SUPPORT + m_Oct=4; + m_CurrentVoice=0; + + for (int n=0; n<256; n++) + { + m_KeyVoice[n]=' '; + } +#endif +} + +MidiDevice::~MidiDevice() +{ + Close(); +} + +void MidiDevice::Close() +{ + pthread_mutex_lock(m_Mutex); + pthread_cancel(m_MidiReader); + pthread_mutex_unlock(m_Mutex); + pthread_mutex_destroy(m_Mutex); + + close(m_MidiFd); + close(m_MidiWrFd); + cerr<<"Closed midi device"<15) + { + cerr<<"GetEvent: Invalid Midi device "<15) + { + cerr<<"SendEvent: Invalid Midi device "<=STATUS_END); +} + +// collect events deals with the byte level messages, and sorts +// and filters them into distinct messages we can handle easily +void MidiDevice::CollectEvents() +{ + unsigned char buf[1]; + int count,n,nn; + bool MessageSent; + unsigned char data[3],last=0; + + // constantly scan for relevent input, + // and write it to the pipe + + // filters out unhandled messages, and attempts to build + // coherent messages to send to the midi handler + bool InSysex=false; + + for(;;) + { + ReadByte(buf); + + if (*buf>=STATUS_START) // we've got a status byte + { + if (*buf==SYSEX_TERMINATOR) InSysex=false; + + // find out if it's an opcode + if(*buf>=STATUS_START && *buf<=STATUS_END) + { + InSysex=false; + last=data[0]=*buf; + + if (data[0]>=STATUS_PROG_CHANGE && data[0]=STATUS_PROG_CHANGE && data[0]= STATUS_NOTE_OFF && midi[0] < STATUS_NOTE_ON) + { + MessageType=MidiEvent::OFF; + Note=midi[1]-MIDI_KEYOFFSET; + EventDevice=midi[0]-STATUS_NOTE_OFF; + } + // note on + else if (midi[0] >= STATUS_NOTE_ON && midi[0] < STATUS_AFTERTOUCH) + { + Volume = midi[2]; + + // cope with Roland equipment, where note on's + // with zero velocity are sent as note offs. + if (Volume) MessageType=MidiEvent::ON; + else MessageType=MidiEvent::OFF; + + Note=midi[1]-MIDI_KEYOFFSET; + EventDevice=midi[0]-STATUS_NOTE_ON; + } + // aftertouch + else if (midi[0] >= STATUS_AFTERTOUCH && midi[0] < STATUS_CONTROL_CHANGE) + { + MessageType=MidiEvent::AFTERTOUCH; + Note=midi[1]-MIDI_KEYOFFSET; + Volume=midi[2]; + EventDevice=midi[0]-STATUS_AFTERTOUCH; + } + // parameter + else if (midi[0] >= STATUS_CONTROL_CHANGE && midi[0] < STATUS_PROG_CHANGE) + { + MessageType=MidiEvent::PARAMETER; + Note=midi[1]; + Volume=midi[2]; + EventDevice=midi[0]-STATUS_CONTROL_CHANGE; + } + // channel pressure + else if (midi[0] >= STATUS_CHANNEL_PRESSURE && midi[0] < STATUS_PITCH_WHEEL) + { + MessageType=MidiEvent::CHANNELPRESSURE; + Volume=midi[1]; + EventDevice=midi[0]-STATUS_CHANNEL_PRESSURE; + } + // note pitchbend + else if (midi[0] >= STATUS_PITCH_WHEEL && midi[0] < STATUS_END) + { + MessageType=MidiEvent::PITCHBEND; + // should probably take the first byte into account too? + Volume=midi[2]; + EventDevice=midi[0]-STATUS_PITCH_WHEEL; + } + + if (EventDevice<0 || EventDevice>15) + { + cerr<<"Error - Midi device "<=m_Poly) + { + m_CurrentVoice=0; + } + + // this should be the current voice we are using + m_KeyVoice[m_CurrentVoice]=KeyChar; + } + } + else // it's not pressed down + { + //see if the note was pressed down last time + for (int n=0; n + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef MIDI +#define MIDI + +using namespace std; + +#define KEYBOARD_SUPPORT + + +class MidiEvent +{ +public: + enum type{NONE,ON,OFF,AFTERTOUCH,PARAMETER,CHANNELPRESSURE,PITCHBEND}; + + MidiEvent() {m_Type=NONE;} + MidiEvent(type t, int note, float v) + {m_Type=t; m_Note=note; m_Volume=v;} + + type GetType() const {return m_Type;} + float GetVolume() const {return m_Volume;} + int GetNote() const {return m_Note;} +private: + float m_Volume; + type m_Type; + int m_Note; +}; + +class MidiDevice +{ +public: + ~MidiDevice(); + + static void SetDeviceName(string s) { m_DeviceName=s; } + static MidiDevice *Get() { if(!m_Singleton) m_Singleton=new MidiDevice; return m_Singleton; } + static void PackUpAndGoHome() { if(m_Singleton) delete m_Singleton; m_Singleton=NULL; } + + static void *MidiReaderCallback(void *o) { ((MidiDevice*)o)->CollectEvents(); return NULL; } + + MidiEvent GetEvent(int Device); + void SendEvent(int Device,const MidiEvent &Event); + + void SetPoly(int s) { m_Poly=s; } + +private: + MidiDevice(); + + void Open(); + void Close(); + void CollectEvents(); + void AddEvent(unsigned char* midi); + + void ReadByte(unsigned char *c); + + int m_MidiFd; + int m_MidiWrFd; + static string m_DeviceName; + int m_Poly; + + queue m_EventVec[16]; + + static MidiDevice *m_Singleton; + + pthread_t m_MidiReader; + pthread_mutex_t* m_Mutex; + +#ifdef KEYBOARD_SUPPORT + void CheckKeyboard(); + char m_KeyVoice[256]; + int m_Oct; + int m_CurrentVoice; +#endif +}; + +#endif diff --git a/SpiralSound/NoteTable.C b/SpiralSound/NoteTable.C new file mode 100644 index 0000000..246e6ac --- /dev/null +++ b/SpiralSound/NoteTable.C @@ -0,0 +1,19 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "NoteTable.h" + diff --git a/SpiralSound/NoteTable.h b/SpiralSound/NoteTable.h new file mode 100644 index 0000000..84fc17d --- /dev/null +++ b/SpiralSound/NoteTable.h @@ -0,0 +1,37 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef NOTETABLE +#define NOTETABLE + +static const float NoteTable [132]= +{ +8.176, 8.662,9.177,9.723,10.301,10.913, 11.562,12.250,12.978,13.750,14.568,15.434, +16.352,17.324,18.354,19.445,20.602,21.827,23.125,24.500,25.957,27.500,29.135,30.868, +32.703,34.648,36.708,38.891,41.203,43.654,46.249,48.999,51.913,55.000,58.270,61.735, +65.406,69.296,73.416,77.782,82.407,87.307,92.499,97.999,103.826,110.000,116.541,123.471, +130.813,138.591,146.832,155.563,164.814,174.614,184.997,195.998,207.652,220.000,233.082,246.942, +261.626,277.183,293.665,311.127,329.628,349.228,369.994,391.995,415.305,440.000,466.164,493.883, +523.251,554.365,587.330,622.254,659.255,698.456,739.989,783.991,830.609,880.000,932.328,987.767, +1046.502,1108.731,1174.659,1244.508,1318.510,1396.913,1479.978,1567.982,1661.219,1760.000,1864.655,1975.533, +2093.005,2217.461,2349.318,2489.016,2637.020,2793.826,2959.955,3135.963,3322.438,3520.000,3729.310,3951.066, +4186.009,4434.922,4698.636,4978.032,5274.041,5587.652,5919.911,6271.927,6644.875,7040.000,7458.620,7902.133, +8372.018,8869.844,9397.273,9956.063,10548.08,11175.30,11839.82,12543.85,0,0,0,0 +}; + +#endif diff --git a/SpiralSound/PluginManager.C b/SpiralSound/PluginManager.C new file mode 100644 index 0000000..ffccfa0 --- /dev/null +++ b/SpiralSound/PluginManager.C @@ -0,0 +1,135 @@ +/* SpiralSound + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include "PluginManager.h" + +PluginManager *PluginManager::m_Singleton = NULL; + +PluginManager::PluginManager() +{ +} + +PluginManager::~PluginManager() +{ + UnloadAll(); +} + +PluginID PluginManager::LoadPlugin(const char *PluginName) +{ + // Make a new plugin + HostsideInfo *NewPlugin = new HostsideInfo; + NewPlugin->Handle=NULL; + NewPlugin->ID=PluginError; + + // Attempt to open the plugin + NewPlugin->Handle = dlopen (PluginName, RTLD_NOW); + + if (NewPlugin->Handle==NULL) + { + SpiralInfo::Alert("Error loading plugin: \n"+string(dlerror())); + return PluginError; + } + + // Link the neccesary functions + NewPlugin->CreateInstance = (SpiralPlugin*(*)()) dlsym(NewPlugin->Handle, "CreateInstance"); + NewPlugin->GetIcon = (char **(*)()) dlsym(NewPlugin->Handle, "GetIcon"); + NewPlugin->GetID = (int(*)()) dlsym(NewPlugin->Handle, "GetID"); + + char *error; + if ((error = dlerror()) != NULL) + { + SpiralInfo::Alert("Error linking to plugin: \n"+string(error)); + return PluginError; + } + + // We've succesfully open and linked the + // plugin, so add it to the vector. + int ID; + ID = NewPlugin->GetID(); + NewPlugin->ID = ID; + m_PluginVec.push_back(NewPlugin); + + return ID; +} + +void PluginManager::UnLoadPlugin(PluginID ID) +{ + if (IsValid(ID)) + { + dlclose(GetPlugin(ID)->Handle); + char *error; + if ((error = dlerror()) != NULL) + { + SpiralInfo::Alert("Error unlinking plugin: \n"+string(error)); + } + } +} + +void PluginManager::UnloadAll() +{ + for (vector::iterator i=m_PluginVec.begin(); + i!=m_PluginVec.end(); i++) + { + dlclose((*i)->Handle); + char *error; + if ((error = dlerror()) != NULL) + { + SpiralInfo::Alert("Error unlinking plugin: \n"+string(error)); + } + } +} + +const HostsideInfo *PluginManager::GetPlugin(PluginID ID) +{ + return GetPlugin_i(ID); +} + +HostsideInfo *PluginManager::GetPlugin_i(PluginID ID) +{ + + HostsideInfo *ret = NULL; + + for (vector::iterator i=m_PluginVec.begin(); + i!=m_PluginVec.end(); i++) + { + if ((*i)->ID==ID) + { + ret = *i; + break; + } + } + + if (!ret) + { + char t[256]; + sprintf(t,"%d",ID); + SpiralInfo::Alert("Plugin "+string(t)+" not found."); + } + + return ret; +} + +bool PluginManager::IsValid(PluginID ID) +{ + const HostsideInfo *t = GetPlugin(ID); + return (t && t->Handle!=NULL); +} + + diff --git a/SpiralSound/PluginManager.h b/SpiralSound/PluginManager.h new file mode 100644 index 0000000..7c825eb --- /dev/null +++ b/SpiralSound/PluginManager.h @@ -0,0 +1,60 @@ +/* SpiralSound + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include "Plugins/SpiralPlugin.h" + +struct HostsideInfo +{ + void* Handle; + int ID; + char **(*GetIcon)(void); + SpiralPlugin *(*CreateInstance)(void); + int (*GetID)(void); +}; + +////////////////////////////////////////////////////////// + +typedef int PluginID; +#define PluginError -1 + +class PluginManager +{ +public: + static PluginManager *Get() { if(!m_Singleton) m_Singleton=new PluginManager; return m_Singleton; } + static void PackUpAndGoHome() { if(m_Singleton) delete m_Singleton; } + + PluginID LoadPlugin(const char *PluginName); + void UnLoadPlugin(PluginID ID); + void UnloadAll(); + const HostsideInfo* GetPlugin(PluginID ID); + bool IsValid(PluginID ID); + int GetIdByName(string Name); + +private: + + PluginManager(); + ~PluginManager(); + HostsideInfo *GetPlugin_i(PluginID ID); + + vector m_PluginVec; + static PluginManager *m_Singleton; +}; diff --git a/SpiralSound/Plugins/AmpPlugin/AmpPlugin.C b/SpiralSound/Plugins/AmpPlugin/AmpPlugin.C new file mode 100644 index 0000000..223b59e --- /dev/null +++ b/SpiralSound/Plugins/AmpPlugin/AmpPlugin.C @@ -0,0 +1,105 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include +#include "AmpPlugin.h" +#include "AmpPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +#define PI 3.141592654 + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new AmpPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0009; +} +} + +/////////////////////////////////////////////////////// + +AmpPlugin::AmpPlugin() : +m_Amp(1.0f), +m_DC(0.0f) +{ + m_PluginInfo.Name="Amp"; + m_PluginInfo.Width=120; + m_PluginInfo.Height=110; + m_PluginInfo.NumInputs=3; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Amp CV"); + m_PluginInfo.PortTips.push_back("DC Offset CV"); + m_PluginInfo.PortTips.push_back("Output"); +} + +AmpPlugin::~AmpPlugin() +{ +} + +PluginInfo &AmpPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *AmpPlugin::CreateGUI() +{ + m_GUI = new AmpPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void AmpPlugin::Execute() +{ + float in; + + for (int n=0; nBUFSIZE; n++) + { + in = GetInput(0,n); + in *= m_Amp+GetInput(1,n); + in += (-m_DC)+GetInput(2,n); + SetOutput(0,n,in); + } +} + +void AmpPlugin::Randomise() +{ +} + +void AmpPlugin::StreamOut(ostream &s) +{ + s<>version; + s>>m_Amp>>m_DC; +} diff --git a/SpiralSound/Plugins/AmpPlugin/AmpPlugin.h b/SpiralSound/Plugins/AmpPlugin/AmpPlugin.h new file mode 100644 index 0000000..80737df --- /dev/null +++ b/SpiralSound/Plugins/AmpPlugin/AmpPlugin.h @@ -0,0 +1,57 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef AMPPLUGIN +#define AMPPLUGIN + +class AmpPlugin : public SpiralPlugin +{ +public: + AmpPlugin(); + virtual ~AmpPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetAmp(float s) { m_Amp=s; } + void SetDC(float s) { m_DC=s; } + float GetAmp() { return m_Amp; } + float GetDC() { return m_DC; } + + void Randomise(); + +private: + float m_Amp; + float m_DC; + + friend istream &operator>>(istream &s, AmpPlugin &o); + friend ostream &operator<<(ostream &s, AmpPlugin &o); +}; +istream &operator>>(istream &s, AmpPlugin &o); +ostream &operator<<(ostream &s, AmpPlugin &o); + +#endif diff --git a/SpiralSound/Plugins/AmpPlugin/AmpPlugin.pro b/SpiralSound/Plugins/AmpPlugin/AmpPlugin.pro new file mode 100644 index 0000000..9bd711d --- /dev/null +++ b/SpiralSound/Plugins/AmpPlugin/AmpPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + AmpPlugin.h \ + AmpPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + AmpPlugin.C \ + AmpPluginGUI.C + +TARGET = AmpPlugin.so diff --git a/SpiralSound/Plugins/AmpPlugin/AmpPluginGUI.C b/SpiralSound/Plugins/AmpPlugin/AmpPluginGUI.C new file mode 100644 index 0000000..408d3ca --- /dev/null +++ b/SpiralSound/Plugins/AmpPlugin/AmpPluginGUI.C @@ -0,0 +1,136 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "AmpPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +AmpPluginGUI::AmpPluginGUI(int w, int h,AmpPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_Amp = new Fl_Slider(15, 20, 20, 70, "Amp"); + m_Amp->type(4); + m_Amp->selection_color(GUI_COLOUR); + m_Amp->labelsize(10); + m_Amp->maximum(4); + m_Amp->step(0.0001); + m_Amp->value(2); + m_Amp->callback((Fl_Callback*)cb_Amp); + + m_DC = new Fl_Slider(70, 20, 20, 70, "DC Offset"); + m_DC->type(4); + m_DC->selection_color(GUI_COLOUR); + m_DC->labelsize(10); + m_DC->maximum(4); + m_DC->step(0.0001); + m_DC->value(2); + m_DC->callback((Fl_Callback*)cb_DC); + + m_pop = new Fl_Button(1,h-14, 13, 13, "@>"); + m_pop->type(1); + m_pop->box(FL_FLAT_BOX); + m_pop->down_box(FL_FLAT_BOX); + m_pop->labeltype(FL_SYMBOL_LABEL); + m_pop->labelsize(10); + m_pop->labelcolor(25); + m_pop->callback((Fl_Callback*)cb_pop); + + m_out_gain = new Fl_Output(25,h+5,36, 15, "Gain"); + m_out_gain->box(FL_ENGRAVED_BOX); + m_out_gain->color(16); + m_out_gain->labelsize(10); + m_out_gain->textsize(10); + m_out_gain->hide(); + m_out_gain->set_output(); + + m_out_DC = new Fl_Output(82,h+5,36, 15, "DC"); + m_out_DC->box(FL_ENGRAVED_BOX); + m_out_DC->color(16); + m_out_DC->labelsize(10); + m_out_DC->textsize(10); + m_out_DC->hide(); + m_out_DC->set_output(); + + end(); +} + +extern "C" int sprintf(char *,const char *,...); + +void AmpPluginGUI::UpdateValues() +{ + m_Amp->value(2.0f-m_Plugin->GetAmp()); + m_DC->value(2.0f-m_Plugin->GetDC()); + char str[10]; + sprintf(str,"%4.2f",m_Plugin->GetAmp()); + m_out_gain->value(str); + sprintf(str,"%4.2f",m_Plugin->GetDC()); + m_out_DC->value(str); +} + +inline void AmpPluginGUI::cb_Amp_i(Fl_Slider* o, void* v) +{ + +char str[10]; + float value=2.0f-o->value(); + m_Plugin->SetAmp(value); + sprintf(str,"%4.2f",value); + m_out_gain->value(str); +} +void AmpPluginGUI::cb_Amp(Fl_Slider* o, void* v) +{ ((AmpPluginGUI*)(o->parent()))->cb_Amp_i(o,v); } + +inline void AmpPluginGUI::cb_DC_i(Fl_Slider* o, void* v) +{ +char str[10]; + float value=2.0f-o->value(); + m_Plugin->SetDC(value); + sprintf(str,"%4.2f",value); + m_out_DC->value(str); +} +void AmpPluginGUI::cb_DC(Fl_Slider* o, void* v) +{ ((AmpPluginGUI*)(o->parent()))->cb_DC_i(o,v); } + +inline void AmpPluginGUI::cb_pop_i(Fl_Button *o, void*) { + if (o->value()) + { + o->label("@2>"); + m_out_gain->show(); + m_out_DC->show(); + redraw(); + } + else + { + o->label("@>"); + m_out_gain->hide(); + m_out_DC->hide(); + redraw(); + parent()->redraw(); + } +} +void AmpPluginGUI::cb_pop(Fl_Button* o, void* v) { + ((AmpPluginGUI*)(o->parent()))->cb_pop_i(o,v); +} + diff --git a/SpiralSound/Plugins/AmpPlugin/AmpPluginGUI.h b/SpiralSound/Plugins/AmpPlugin/AmpPluginGUI.h new file mode 100644 index 0000000..0e59fde --- /dev/null +++ b/SpiralSound/Plugins/AmpPlugin/AmpPluginGUI.h @@ -0,0 +1,62 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include + +#include "AmpPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef AmpGUI +#define AmpGUI + + +class AmpPluginGUI : public SpiralPluginGUI +{ +public: + AmpPluginGUI(int w, int h, AmpPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + AmpPlugin *m_Plugin; + +private: + + Fl_Group *GUIFilterGroup; + Fl_Slider *m_Amp; + Fl_Slider *m_DC; + Fl_Button *m_pop; + Fl_Output *m_out_gain; + Fl_Output *m_out_DC; + + + //// Callbacks //// + + inline void cb_Amp_i(Fl_Slider* o, void* v); + static void cb_Amp(Fl_Slider*, void*); + inline void cb_DC_i(Fl_Slider* o, void* v); + static void cb_DC(Fl_Slider* o, void* v); + inline void cb_pop_i(Fl_Button* o, void*); + static void cb_pop(Fl_Button* o, void*); +}; + +#endif diff --git a/SpiralSound/Plugins/AmpPlugin/Makefile.in b/SpiralSound/Plugins/AmpPlugin/Makefile.in new file mode 100644 index 0000000..25e0632 --- /dev/null +++ b/SpiralSound/Plugins/AmpPlugin/Makefile.in @@ -0,0 +1,164 @@ +############################################################################# +# Makefile for building AmpPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: AmpPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + AmpPlugin.h \ + AmpPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + AmpPlugin.C \ + AmpPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + AmpPlugin.o \ + AmpPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = AmpPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake AmpPlugin.pro + +dist: + $(TAR) AmpPlugin.tar AmpPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) AmpPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +AmpPlugin.o: AmpPlugin.C \ + AmpPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + AmpPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +AmpPluginGUI.o: AmpPluginGUI.C \ + AmpPluginGUI.h \ + AmpPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/AmpPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/AmpPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..4e33e7e --- /dev/null +++ b/SpiralSound/Plugins/AmpPlugin/SpiralIcon.xpm @@ -0,0 +1,347 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 308 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #2D2F00", +"!. c #111200", +"~. c #0B0C00", +"{. c #0F0F00", +"]. c #090A00", +"^. c #040400", +"/. c #727175", +"(. c #FEFEFF", +"_. c #9D99AA", +":. c #DBD9E0", +"<. c #E9E9E9", +"[. c #CBCBCB", +"}. c #E0E0E0", +"|. c #6C6C6C", +"1. c #726C00", +"2. c #FEF100", +"3. c #FCEF00", +"4. c #322F00", +"5. c #515151", +"6. c #A6A6A7", +"7. c #827E93", +"8. c #615C77", +"9. c #EAEAED", +"0. c #DFDFE1", +"a. c #302D00", +"b. c #DCD000", +"c. c #FFF200", +"d. c #1E1C00", +"e. c #1E1D24", +"f. c #9894A7", +"g. c #B1AEBB", +"h. c #69686F", +"i. c #000001", +"j. c #EFE200", +"k. c #F6E900", +"l. c #C6BB00", +"m. c #060500", +"n. c #615C76", +"o. c #5F5A75", +"p. c #413E4D", +"q. c #020203", +"r. c #7E7700", +"s. c #E5D900", +"t. c #F8EB00", +"u. c #1A1A1C", +"v. c #C3C1CB", +"w. c #9D9D9D", +"x. c #202020", +"y. c #383838", +"z. c #4C4C4C", +"A. c #B1A800", +"B. c #A9A000", +"C. c #111112", +"D. c #C9C7D0", +"E. c #F1F1F1", +"F. c #F8F8F8", +"G. c #232323", +"H. c #191700", +"I. c #827B00", +"J. c #ACA300", +"K. c #F2E500", +"L. c #050408", +"M. c #AEACB9", +"N. c #FEFEFE", +"O. c #1D1D1D", +"P. c #444000", +"Q. c #F1E400", +"R. c #B7B5C1", +"S. c #9390A2", +"T. c #BBBBBB", +"U. c #414141", +"V. c #030303", +"W. c #948C00", +"X. c #756F00", +"Y. c #28272A", +"Z. c #F4F4F6", +"`. c #605B76", +" + c #736E86", +".+ c #D8D8D8", +"++ c #727272", +"@+ c #101010", +"#+ c #645E00", +"$+ c #F5E800", +"%+ c #848486", +"&+ c #CCCBD3", +"*+ c #747087", +"=+ c #6D6881", +"-+ c #1C1C1C", +";+ c #242424", +">+ c #656566", +",+ c #F6F6F6", +"'+ c #E8E6EA", +")+ c #706B84", +"!+ c #E3E1E6", +"~+ c #474746", +"{+ c #151515", +"]+ c #C8C8C8", +"^+ c #AEAEAE", +"/+ c #080808", +"(+ c #010100", +"_+ c #373639", +":+ c #FDFCFE", +"<+ c #ABA8B7", +"[+ c #F1F0F3", +"}+ c #6D6980", +"|+ c #0A090E", +"1+ c #95929E", +"2+ c #0A0810", +"3+ c #0D0D0D", +"4+ c #050505", +"5+ c #5B5A5C", +"6+ c #F7F6F7", +"7+ c #F4F3F5", +"8+ c #908C9F", +"9+ c #C8C6D0", +"0+ c #837E96", +"a+ c #86868A", +"b+ c #070608", +"c+ c #ECEBEE", +"d+ c #5B5571", +"e+ c #646078", +"f+ c #AFAFB0", +"g+ c #454545", +"h+ c #363636", +"i+ c #7A7A7A", +"j+ c #C8C8C9", +"k+ c #212025", +"l+ c #060607", +"m+ c #969699", +"n+ c #FAFAFA", +"o+ c #F8F8F9", +"p+ c #A29EAF", +"q+ c #F7F6F8", +"r+ c #F0F0F1", +"s+ c #B8B7B9", +"t+ c #E4E4E4", +"u+ c #FDFDFD", +"v+ c #A5A2B2", +"w+ c #3B3456", +"x+ c #A8A5B4", +"y+ c #525252", +"z+ c #848387", +"A+ c #CDCDCD", +"B+ c #8D899C", +"C+ c #494262", +"D+ c #68627C", +"E+ c #40395A", +"F+ c #ECECEC", +"G+ c #020202", +"H+ c #B4B5B5", +"I+ c #0B0B0B", +"J+ c #313232", +"K+ c #E3E3E3", +"L+ c #B1AEBC", +"M+ c #BDBBC6", +"N+ c #3C3556", +"O+ c #898599", +"P+ c #EDEDED", +"Q+ c #39393A", +"R+ c #040404", +"S+ c #333333", +"T+ c #F5F5F5", +"U+ c #2B2B2B", +"V+ c #2D2A3D", +"W+ c #B6B4C1", +"X+ c #F5F5F6", +"Y+ c #605A76", +"Z+ c #DAD8DF", +"`+ c #F5F4F6", +" @ c #615B76", +".@ c #524D6A", +"+@ c #E4E3E8", +"@@ c #D5D5D5", +"#@ c #1B1B1B", +"$@ c #303030", +"%@ c #AAABAB", +"&@ c #585464", +"*@ c #B0AEBB", +"=@ c #A29FAF", +"-@ c #E9E8E9", +";@ c #787779", +">@ c #0F0E15", +",@ c #2D2D2E", +"'@ c #595959", +")@ c #FAFAFB", +"!@ c #807B92", +"~@ c #B0ADBB", +"{@ c #E8E7EB", +"]@ c #3A3258", +"^@ c #E6E5EA", +"/@ c #DFDEE3", +"(@ c #443E5E", +"_@ c #BAB8C4", +":@ c #C1BFCA", +"<@ c #E0E0E5", +"[@ c #D0CED6", +"}@ c #362F52", +"|@ c #CECCD5", +"1@ c #413A5B", +"2@ c #6A657F", +"3@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.{.].6 ^.6 6 6 E /.(.; ; _. ", +" :.; ; <.R h [.}.|.6 6 6 6 6 6 6 6 1.2.3.4.E 5.6.4 7. ", +" 8.9.; 0...6 6 6 6 6 6 6 6 6 6 a.b.2.c.3.d.6 6 6 e.f. ", +" V @ g.h.i.6 6 6 6 6 6 6 6 a.j.c.k.l.m.6 6 6 6 6 ", +" n.o.p.6 q.6 6 6 6 r.s.3.c.t.r.6 6 6 6 6 6 6 6 u. ", +" v.; ; w.x.x.y.z.x.6 A.2.2.k.B.6 6 6 6 6 6 6 6 6 C. ", +" D.; ; E.F.; ; ; G.6 H.I.J.K.2.k.r.6 6 6 6 6 6 6 L. ", +" M.; ; ; ; N.; ; O.6 6 6 6 6 P.Q.c.l.6 6 6 6 6 6 6 R., ", +" S.; ; N.; : T.U.V.6 6 6 6 6 6 6 W.2.t.X.6 6 6 6 Y.N.Z.`. ", +" +; ; ; .+++@+6 6 6 6 6 6 6 6 6 6 #+j.$+6 6 6 Q %+; ; &+*+ ", +" =+J ; : -+6 6 6 6 ;+..6 6 6 6 6 6 6 6 6 6 6 6 6 >+,+; ; '+)+ ", +" !+; ; ~+6 E 6 {+]+^+/+6 6 6 6 6 6 6 6 (+6 6 6 6 _+:+; ; > )+ ", +" <+; [+}+|+6 6 ^+N.; 1+2+6 6 6 6 6 6 6 6 3+4+6 6 6 5+6+; ; 7+8+ ", +" )+9+! 0+a+b+x ; ; c+d+e+f+l g+6 6 6 h+i+j+k+6 6 6 l+m+n+; ; o+@ ", +" p+q+r+s+t+u+; v+w+x+; ,+g+6 6 E y+; ; z+6 6 E 6 o A+; ; = B+ ", +" C+> ; ; ; ; ; ; D+E+; ; F+y.6 6 G+D ; ; H+I+6 6 6 J+K+; ; L+ ", +" > ; ; ; ; M+N+O+; ; P+Q+6 6 R+S+; ; T+U+6 6 V+W+; X+3 ", +" Y+Z+= ; `+ @.@+@; ; @@#@6 6 G+$@; ; ; %@y+&@ ", +" *@4 =@ X ; ; ; -@;@$@>@,@'@; ; ; N.)@!@ ", +" ~@; ; ; ; ; {@]@^@; ; ; ; = /@(@ ", +" _@:@<@4 ; ; [@}@|@; ; ; s O+T ", +" 1@ 2@3@O+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.C b/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.C new file mode 100644 index 0000000..a00441c --- /dev/null +++ b/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.C @@ -0,0 +1,102 @@ +/* Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Bezier.h" + +void Bezier(Vec2 &Out, Vec2 a, Vec2 b, Vec2 c, Vec2 d, float t) +{ + float tc=t*t*t; + float ts=t*t; + + Out.x=(-a.x+3*b.x-3*c.x+d.x)*tc + (3*a.x-6*b.x+3*c.x)*ts + (-3*a.x+3*b.x)*t + a.x; + Out.y=(-a.y+3*b.y-3*c.y+d.y)*tc + (3*a.y-6*b.y+3*c.y)*ts + (-3*a.y+3*b.y)*t + a.y; +} + +void CalculateBezierCurve(vector *List, float x1,float y1,float x2,float y2,float x3,float y3,float x4,float y4,int Sections) +{ + Vec2 g1(x1,y1); Vec2 g2(x2,y2); Vec2 g3(x3,y3); Vec2 g4(x4,y4); + + float t=0; + Vec2 p(0,0),lp(0,0); + + for (int n=0; n<=Sections; n++) + { + Bezier(p,g1,g2,g3,g4,t); + List->push_back(Vec2(p.x,p.y)); + lp.x=p.x; lp.y=p.y; + t+=0.1; + } +} + +void AddToSpline(const Vec2 &CV) +{ + Spline.push_back(CV); +} + +void CalculateBezierSpline(vector *List,int Sections) +{ + + if (Spline.size()==0) return; + + Vec2 SplineSection[4]; + SplineSection[0].x=Spline[0].x; + SplineSection[0].y=Spline[0].y; + SplineSection[1].x=Spline[0].x; + SplineSection[1].y=Spline[0].y; + SplineSection[2].x=Spline[0].x; + SplineSection[2].y=Spline[0].y; + SplineSection[3].x=Spline[0].x; + SplineSection[3].y=Spline[0].y; + int SCount=0; + + for(vector::iterator i=Spline.begin(); + i!=Spline.end(); ++i) + { + + SplineSection[3].x=i->x; + SplineSection[3].y=i->y; + + if (SCount>3) + { + vector BezierLineList; + CalculateBezierCurve(&BezierLineList, + SplineSection[0].x,SplineSection[0].y, + SplineSection[1].x,SplineSection[1].y, + SplineSection[2].x,SplineSection[2].y, + SplineSection[3].x,SplineSection[3].y, + Sections); + + for (vector::iterator bi=BezierLineList.begin(); + bi!=BezierLineList.end(); bi++) + { + List->push_back(*bi); + } + + SCount=1; + } + + for (int m=0; m<3; m++) + { + SplineSection[m].x=SplineSection[m+1].x; + SplineSection[m].y=SplineSection[m+1].y; + } + + SCount++; + } + + Spline.clear(); +} diff --git a/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.h b/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.h new file mode 100644 index 0000000..248fdf2 --- /dev/null +++ b/SpiralSound/Plugins/ComplexEnvelopePlugin/Bezier.h @@ -0,0 +1,43 @@ +/* Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include + +#ifndef BEZIER_CURVE_STUFF +#define BEZIER_CURVE_STUFF + +struct Vec2 +{ + Vec2(float a=0, float b=0) { x=a; y=b;} + float x; float y; +}; + +using std::vector; + +static vector Spline; + +void Bezier(Vec2 &Out, Vec2 a, Vec2 b, Vec2 c, Vec2 d, float t); + +void CalculateBezierCurve(vector *List, + float x1,float y1,float x2,float y2, + float x3,float y3,float x4,float y4, + int Sections=16); + +void AddToSpline(const Vec2 &CV); +void CalculateBezierSpline(vector *List,int Sections=16); + +#endif diff --git a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.C b/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.C new file mode 100644 index 0000000..caf25e9 --- /dev/null +++ b/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.C @@ -0,0 +1,233 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "ComplexEnvelopePlugin.h" +#include "ComplexEnvelopePluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new ComplexEnvelopePlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 33; +} +} + +/////////////////////////////////////////////////////// + +ComplexEnvelopePlugin::ComplexEnvelopePlugin() : +m_Triggered(0), +m_Position(-1), +m_SampleTime(2.0f) +{ + m_PluginInfo.Name="ComplexEnv"; + m_PluginInfo.Width=320; + m_PluginInfo.Height=200; + m_PluginInfo.NumInputs=2; + m_PluginInfo.NumOutputs=2; + m_PluginInfo.PortTips.push_back("Trigger CV"); + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("CV"); + m_PluginInfo.PortTips.push_back("Output"); +} + +ComplexEnvelopePlugin::~ComplexEnvelopePlugin() +{ +} + +PluginInfo &ComplexEnvelopePlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + CVListToEnvelope(m_CVVec); + return Info; +} + +SpiralGUIType *ComplexEnvelopePlugin::CreateGUI() +{ + m_GUI = new ComplexEnvelopePluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void ComplexEnvelopePlugin::CVListToEnvelope(const vector &CVVec) +{ + m_EnvSample.Zero(); + + m_CVVec=CVVec; + + // check length + if (m_EnvSample.GetLength()/m_HostInfo->SAMPLERATE!=m_SampleTime) + { + m_EnvSample.Clear(); + m_EnvSample.Allocate((int)m_SampleTime*m_HostInfo->SAMPLERATE); + } + + vector Lines; + + if (m_Bezier) + { + // calculate the bezier spline that forms the line segments + for (vector::const_iterator i=CVVec.begin(); + i!=CVVec.end(); i++) + { + AddToSpline(*i); + } + CalculateBezierSpline(&Lines,10); + } + else + { + // use the CV's as line endpoints for straight line interpolation + Lines=CVVec; + } + + vector::const_iterator i=Lines.begin(); + if (i==Lines.end()) return; // no lines + vector::const_iterator ni=i+1; + if (ni==Lines.end()) return; // no lines + + for (int n=0; nx)/(ni->x-i->x); + if (t<0) t=0; + + // see if we need to find the next line + if (gt>=ni->x) + { + i++; + ni++; + // env has ended before the sample length + if (ni==Lines.end()) + { + // todo: fill the rest with last value + return; + } + t=Linear(i->x,ni->x,gt,0.0f,1.0f); + if (t<0) t=0; + } + float aa=Linear(0.0f,1.0f,t,ni->y,i->y); + m_EnvSample.Set(n,aa); + } +} + +void ComplexEnvelopePlugin::Execute() +{ + float temp=0; + bool Freeze=false; + + if (m_EnvSample.GetLength()==0) return; + + if (GetInput(0,0)>0) + { + if(!m_Triggered) + { + m_Triggered=1.0f; + m_Position=0; + } + } + else + { + if(m_Triggered) + { + m_Triggered=0; + } + } + + if (m_Position==-1) + { + GetOutputBuf(0)->Zero(); + return; + } + + + if (!InputExists(1)) + { + for (int n=0; nBUFSIZE; n++) + { + // see if we've fallen off the end + if (m_Position>m_EnvSample.GetLength()) + { + m_Position=-1; + break; + } + + SetOutput(0,n,m_EnvSample[m_Position]); + m_Position++; + } + } + else + { + for (int n=0; nBUFSIZE; n++) + { + // see if we've fallen off the end + if (m_Position>m_EnvSample.GetLength()) + { + m_Position=-1; + break; + } + + SetOutput(0,n,m_EnvSample[m_Position]); + SetOutput(1,n,GetInput(1,n)*m_EnvSample[m_Position]); + m_Position++; + } + } +} + +void ComplexEnvelopePlugin::StreamOut(ostream &s) +{ + s<::iterator i=m_CVVec.begin(); + i!=m_CVVec.end(); i++) + { + s<x<<" "<y<>version; + s>>m_Position>>m_SampleTime>>m_Bezier; + + m_CVVec.clear(); + int size; + s>>size; + for(int n=0; n>t.x>>t.y; + m_CVVec.push_back(t); + } + + ((ComplexEnvelopePluginGUI*)m_GUI)->SetCVList(m_CVVec); + CVListToEnvelope(m_CVVec); +} diff --git a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.h b/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.h new file mode 100644 index 0000000..e22a217 --- /dev/null +++ b/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.h @@ -0,0 +1,63 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include "Bezier.h" +#include + +#ifndef ComplexEnvelopePLUGIN +#define ComplexEnvelopePLUGIN + +static const int NUM_CHANNELS = 4; + +class ComplexEnvelopePlugin : public SpiralPlugin +{ +public: + ComplexEnvelopePlugin(); + virtual ~ComplexEnvelopePlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + void CVListToEnvelope(const vector &Lines); + + void SetLength(float s) { m_SampleTime=s; } + void SetBezier(bool s) { m_Bezier=s; } + +private: + + float m_Triggered; // should scale envelope + int m_Position; + bool m_Bezier; + Sample m_EnvSample; + float m_SampleTime; + + vector m_CVVec; + + friend istream &operator>>(istream &s, ComplexEnvelopePlugin &o); + friend ostream &operator<<(ostream &s, ComplexEnvelopePlugin &o); +}; +istream &operator>>(istream &s, ComplexEnvelopePlugin &o); +ostream &operator<<(ostream &s, ComplexEnvelopePlugin &o); + +#endif diff --git a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.pro b/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.pro new file mode 100644 index 0000000..eceea65 --- /dev/null +++ b/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePlugin.pro @@ -0,0 +1,19 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + Bezier.h \ + ComplexEnvelopePlugin.h \ + ComplexEnvelopePluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + Bezier.C \ + ComplexEnvelopePlugin.C \ + ComplexEnvelopePluginGUI.C + +TARGET = ComplexEnvelopePlugin.so diff --git a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.C b/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.C new file mode 100644 index 0000000..e7afc71 --- /dev/null +++ b/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.C @@ -0,0 +1,369 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "ComplexEnvelopePluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; +static const float TIMED_SLIDER_MAX = 3.0f; + +///////////////////////////////////////////////////////////////////////// + +Fl_Envelope::Fl_Handle::Fl_Handle(int x,int y, int w, int h, char *Name) : +Fl_Widget(x,y,w,h,Name), +m_DelMe(false), +m_Changed(false), +m_Coincident(false) +{ +} + +Fl_Envelope::Fl_Handle::~Fl_Handle() +{ +} + +int Fl_Envelope::Fl_Handle::handle(int event) +{ + int Mousebutton=Fl::event_button(); + if (event==FL_DRAG && Mousebutton==1) + { + x(Fl::event_x()-(w()/2)); + y(Fl::event_y()-(h()/2)); + + // restrict the movement to the parent's area + if (x()x()) x(parent()->x()); + if (x()>parent()->x()+parent()->w()-w()) x(parent()->x()+parent()->w()-w()); + if (y()y()) y(parent()->y()); + if (y()>parent()->y()+parent()->h()-h()) y(parent()->y()+parent()->h()-h()); + + m_Changed=true; + + parent()->redraw(); + redraw(); + } + + if (event==FL_PUSH && Mousebutton==3) + { + m_DelMe=true; + } + + return 1; +} + +void Fl_Envelope::Fl_Handle::draw() +{ + if (m_Coincident) + { + fl_color(FL_BLACK); + fl_rect(x(),y(),w()+1,h()+1); + fl_line(x(),y(),x()+w(),y()+h()); + fl_line(x(),y()+h(),x()+w(),y()); + } + else + { + fl_color(FL_RED); + fl_arc( x(),y(),w()+1,h()+1,0,360); + } +} + + + +Fl_Envelope::Fl_Envelope(int x,int y, int w, int h, char *Name) : +Fl_Group(x,y,w,h,Name), +m_Length(1.0), +m_Bezier(true) +{ + m_Origin_x=x+10; + m_Origin_y=y+h-10; + + // default setting + Fl_Handle * newhandle = new Fl_Handle(28,20,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(14,122,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(48,63,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(76,91,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(131,86,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(194,81,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(294,131,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + newhandle = new Fl_Handle(216,124 ,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + + show(); +} + +Fl_Envelope::~Fl_Envelope() +{ + end(); +} + +int Fl_Envelope::handle(int event) +{ + int ret=Fl_Group::handle(event); + + // search for deleted handles + for(list::iterator i = m_HandleList.begin(); + i!=m_HandleList.end(); ++i) + { + // if it's been modified, update the env via the callback + if ((*i)->Changed()) do_callback(); + + if ((*i)->Deleted()) + { + remove(*i); + m_HandleList.erase(i); + break; // one at a time + } + } + + if (!ret) + { + int Mousebutton=Fl::event_button(); + if (event==FL_PUSH && Mousebutton==2) + { + Fl_Handle * newhandle = new + Fl_Handle(Fl::event_x()-5,Fl::event_y()-5,10,10,""); + m_HandleList.push_back(newhandle); + add(newhandle); + } + + redraw(); + } + + return ret; +} + +void Fl_Envelope::draw() +{ + fl_push_clip(x(),y(),w()+1,h()+1); + fl_color(FL_GRAY); + fl_rectf(x(),y(),w()+1,h()+1); + + fl_color(FL_BLACK); + fl_rect(x(),y(),w()+1,h()+1); + + fl_color(FL_WHITE); + + int last_x=m_Origin_x, last_y=m_Origin_y, closest=INT_MAX, dist; + list::iterator ClosestHandle=m_HandleList.end(); + + // draw second markers + fl_color(150,150,150); + + for (int n=0; n<5; n++) + { + int p=(int)(m_Origin_x+(w()/m_Length*n)); + fl_line(p,y(),p,y()+h()); + } + + m_HandlePos.clear(); + + m_HandlePos.push_back(Vec2(m_Origin_x,m_Origin_y)); + if (m_Bezier) AddToSpline(Vec2(m_Origin_x,m_Origin_y)); + + for (unsigned int n=0; n::iterator i = m_HandleList.begin(); + i!=m_HandleList.end(); ++i) + { + dist=(*i)->x()-last_x; + if (dist>-5 && distx()+5,(*ClosestHandle)->y()+5); + + (*ClosestHandle)->SetIsCoincident(false); + + last_x=(*ClosestHandle)->x()+5; + last_y=(*ClosestHandle)->y()+5; + + m_HandlePos.push_back(Vec2((*ClosestHandle)->x()+5,(*ClosestHandle)->y()+5)); + + if (m_Bezier) + { + if (!(n%3)) (*ClosestHandle)->SetIsCoincident(true); + AddToSpline(Vec2((*ClosestHandle)->x()+5,(*ClosestHandle)->y()+5)); + } + } + } + + if (m_Bezier) + { + vector BezierLineList; + CalculateBezierSpline(&BezierLineList,10); + + vector::iterator bi=BezierLineList.begin(); + bi++; + fl_color(FL_BLUE); + for (;bi!=BezierLineList.end(); bi++) + { + fl_line((int)(bi-1)->x,(int)(bi-1)->y,(int)bi->x,(int)bi->y); + } + } + + fl_color(FL_BLACK); + fl_line(m_Origin_x,m_Origin_y,m_Origin_x,y()+10); + fl_line(m_Origin_x,m_Origin_y,x()+w()-10,m_Origin_y); + + Fl_Group::draw(); + fl_pop_clip(); +} + +void Fl_Envelope::Clear() +{ + for(list::iterator i = m_HandleList.begin(); + i!=m_HandleList.end(); ++i) + { + remove(*i); + } + + m_HandleList.clear(); +} + +vector Fl_Envelope::GetCVList() +{ + vector m_CV; + for(vector::iterator i = m_HandlePos.begin(); + i!=m_HandlePos.end(); ++i) + { + // convert to 0->1 + Vec2 vec((i->x-m_Origin_x)/(float)(w()-m_Origin_x), + (m_Origin_y-i->y)/(float)(m_Origin_y-y())); + + m_CV.push_back(vec); + } + + return m_CV; +} + +void Fl_Envelope::SetCVList(const vector &CV) +{ + Clear(); + + for(vector::const_iterator i = CV.begin(); + i!=CV.end(); ++i) + { + int minx=m_Origin_x, width=w()-m_Origin_x; + int miny=m_Origin_y, height=m_Origin_y-y(); + + // convert from 0->1 screen coords + Vec2 vec(minx+(i->x*width), + miny-(i->y*height)); + + Fl_Handle *nh = new Fl_Handle((int)vec.x,(int)vec.y,10,10,""); + add(nh); + m_HandleList.push_back(nh); + } + + redraw(); +} + +///////////////////////////////////////////////////////////////////////// + +ComplexEnvelopePluginGUI::ComplexEnvelopePluginGUI(int w, int h,ComplexEnvelopePlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_Type = new Fl_Button(15,h-35,100,20,"Bezier Curve"); + m_Type->type(1); + m_Type->value(1); + m_Type->labelsize(10); + m_Type->callback((Fl_Callback*)cb_Type); + + m_Length = new Fl_Knob(w-60,h-55,40,40,"Length"); + m_Length->color(GUI_COLOUR); + m_Length->labelsize(10); + m_Length->maximum(5); + m_Length->step(0.001); + m_Length->value(1); + m_Length->callback((Fl_Callback*)cb_Length); + + m_TLength = new Fl_Output(w-130,h-45,60,20,""); + m_TLength->value("1.0"); + + m_Envelope = new Fl_Envelope(5,20,w-10,h-75,""); + m_Envelope->callback((Fl_Callback*)cb_UpdateEnv); + + end(); +} + +void ComplexEnvelopePluginGUI::UpdateValues() +{ + +} + +inline void ComplexEnvelopePluginGUI::cb_UpdateEnv_i(Fl_Envelope *o, void* v) +{ + m_Plugin->CVListToEnvelope(o->GetCVList()); +} +void ComplexEnvelopePluginGUI::cb_UpdateEnv(Fl_Envelope* o, void* v) +{((ComplexEnvelopePluginGUI*)(o->parent()))->cb_UpdateEnv_i(o,v);} + +inline void ComplexEnvelopePluginGUI::cb_Type_i(Fl_Button *o, void *v) +{ + m_Envelope->SetBezier(o->value()); + m_Plugin->SetBezier(o->value()); + m_Envelope->redraw(); +} +void ComplexEnvelopePluginGUI::cb_Type(Fl_Button *o, void *v) +{((ComplexEnvelopePluginGUI*)(o->parent()))->cb_Type_i(o,v);} + +inline void ComplexEnvelopePluginGUI::cb_Length_i(Fl_Knob *o, void *v) +{ + m_Plugin->SetLength(o->value()); + m_Envelope->SetLength(o->value()); + static char text[16]; + sprintf(text,"%f",o->value()); + m_TLength->value(text); + m_Envelope->redraw(); +} +void ComplexEnvelopePluginGUI::cb_Length(Fl_Knob *o, void *v) +{((ComplexEnvelopePluginGUI*)(o->parent()))->cb_Length_i(o,v);} diff --git a/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.h b/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.h new file mode 100644 index 0000000..a279955 --- /dev/null +++ b/SpiralSound/Plugins/ComplexEnvelopePlugin/ComplexEnvelopePluginGUI.h @@ -0,0 +1,109 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ComplexEnvelopePlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" +#include "Bezier.h" + +#ifndef EnvelopeGUI +#define EnvelopeGUI + +class Fl_Envelope : public Fl_Group +{ +public: + Fl_Envelope(int x,int y, int w, int h, char *Name); + ~Fl_Envelope(); + + virtual int handle(int event); + virtual void draw(); + void Clear(); + void SetBezier(bool s) { m_Bezier=s; } + void SetLength(float s) { m_Length=s; } + vector GetCVList(); + void SetCVList(const vector &CV); + +private: + + class Fl_Handle : public Fl_Widget + { + public: + Fl_Handle(int x,int y, int w, int h, char *Name); + ~Fl_Handle(); + virtual int handle(int event); + virtual void draw(); + bool Deleted() { return m_DelMe; } + void DelMe() { m_DelMe=true; } + void SetIsCoincident(bool s) { m_Coincident=s; } + bool Changed() { bool t=m_Changed; m_Changed=false; return t; } + + private: + bool m_DelMe; + bool m_Changed; + bool m_Coincident; + }; + + float m_Length; + float m_Time; + bool m_Bezier; + + list m_HandleList; + vector m_HandlePos; + int m_Origin_x; + int m_Origin_y; +}; + + +class ComplexEnvelopePluginGUI : public SpiralPluginGUI +{ +public: + ComplexEnvelopePluginGUI(int w, int h, ComplexEnvelopePlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + void SetCVList(const vector &CV) { m_Envelope->SetCVList(CV); } + + ComplexEnvelopePlugin *m_Plugin; +private: + + Fl_Envelope *m_Envelope; + Fl_Button *m_Type; + Fl_Knob *m_Length; + Fl_Output *m_TLength; + + //// Callbacks //// + + inline void cb_Type_i(Fl_Button *o, void *v); + static void cb_Type(Fl_Button *o, void *v); + inline void cb_Length_i(Fl_Knob *o, void *v); + static void cb_Length(Fl_Knob *o, void *v); + inline void cb_UpdateEnv_i(Fl_Envelope *o, void*v); + static void cb_UpdateEnv(Fl_Envelope* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/ComplexEnvelopePlugin/Makefile.in b/SpiralSound/Plugins/ComplexEnvelopePlugin/Makefile.in new file mode 100644 index 0000000..2936e0f --- /dev/null +++ b/SpiralSound/Plugins/ComplexEnvelopePlugin/Makefile.in @@ -0,0 +1,172 @@ +############################################################################# +# Makefile for building ComplexEnvelopePlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: ComplexEnvelopePlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ @FLTK_CFLAGS@ +CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ +INCPATH = +LINK = g++ -shared +LFLAGS = +LIBS = @FLTK_LIBS@ -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + Bezier.h \ + ComplexEnvelopePlugin.h \ + ComplexEnvelopePluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + Bezier.C \ + ComplexEnvelopePlugin.C \ + ComplexEnvelopePluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + Bezier.o \ + ComplexEnvelopePlugin.o \ + ComplexEnvelopePluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = ComplexEnvelopePlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake ComplexEnvelopePlugin.pro + +dist: + $(TAR) ComplexEnvelopePlugin.tar ComplexEnvelopePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) ComplexEnvelopePlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +Bezier.o: Bezier.C \ + Bezier.h \ + +ComplexEnvelopePlugin.o: ComplexEnvelopePlugin.C \ + ComplexEnvelopePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ComplexEnvelopePluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + Bezier.h \ + SpiralIcon.xpm + +ComplexEnvelopePluginGUI.o: ComplexEnvelopePluginGUI.C \ + ComplexEnvelopePluginGUI.h \ + ComplexEnvelopePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + Bezier.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/ComplexEnvelopePlugin/SpiralIcon.xpm b/SpiralSound/Plugins/ComplexEnvelopePlugin/SpiralIcon.xpm new file mode 100644 index 0000000..e9d89d0 --- /dev/null +++ b/SpiralSound/Plugins/ComplexEnvelopePlugin/SpiralIcon.xpm @@ -0,0 +1,327 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 288 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #2D2F00", +"!. c #111200", +"~. c #0F0F00", +"{. c #090A00", +"]. c #040400", +"^. c #727175", +"/. c #FEFEFF", +"(. c #9D99AA", +"_. c #DBD9E0", +":. c #E9E9E9", +"<. c #CBCBCB", +"[. c #E0E0E0", +"}. c #6C6C6C", +"|. c #050500", +"1. c #515151", +"2. c #A6A6A7", +"3. c #827E93", +"4. c #615C77", +"5. c #EAEAED", +"6. c #DFDFE1", +"7. c #FEF100", +"8. c #010100", +"9. c #1E1D24", +"0. c #9894A7", +"a. c #B1AEBB", +"b. c #69686F", +"c. c #000001", +"d. c #615C76", +"e. c #5F5A75", +"f. c #413E4D", +"g. c #020203", +"h. c #1A1A1C", +"i. c #C3C1CB", +"j. c #9D9D9D", +"k. c #202020", +"l. c #383838", +"m. c #4C4C4C", +"n. c #2C2E00", +"o. c #111112", +"p. c #C9C7D0", +"q. c #F1F1F1", +"r. c #F8F8F8", +"s. c #232323", +"t. c #050600", +"u. c #050408", +"v. c #AEACB9", +"w. c #FEFEFE", +"x. c #1D1D1D", +"y. c #292B00", +"z. c #B7B5C1", +"A. c #9390A2", +"B. c #BBBBBB", +"C. c #414141", +"D. c #030303", +"E. c #28272A", +"F. c #F4F4F6", +"G. c #605B76", +"H. c #736E86", +"I. c #D8D8D8", +"J. c #727272", +"K. c #101010", +"L. c #020200", +"M. c #1E2000", +"N. c #848486", +"O. c #CCCBD3", +"P. c #747087", +"Q. c #6D6881", +"R. c #1C1C1C", +"S. c #242424", +"T. c #0A0A00", +"U. c #656566", +"V. c #F6F6F6", +"W. c #E8E6EA", +"X. c #706B84", +"Y. c #E3E1E6", +"Z. c #474746", +"`. c #151515", +" + c #C8C8C8", +".+ c #AEAEAE", +"++ c #080808", +"@+ c #373639", +"#+ c #FDFCFE", +"$+ c #ABA8B7", +"%+ c #F1F0F3", +"&+ c #6D6980", +"*+ c #0A090E", +"=+ c #95929E", +"-+ c #0A0810", +";+ c #0D0D0D", +">+ c #050505", +",+ c #5B5A5C", +"'+ c #F7F6F7", +")+ c #F4F3F5", +"!+ c #908C9F", +"~+ c #C8C6D0", +"{+ c #837E96", +"]+ c #86868A", +"^+ c #070608", +"/+ c #ECEBEE", +"(+ c #5B5571", +"_+ c #646078", +":+ c #AFAFB0", +"<+ c #454545", +"[+ c #363636", +"}+ c #7A7A7A", +"|+ c #C8C8C9", +"1+ c #212025", +"2+ c #060607", +"3+ c #969699", +"4+ c #FAFAFA", +"5+ c #F8F8F9", +"6+ c #A29EAF", +"7+ c #F7F6F8", +"8+ c #F0F0F1", +"9+ c #B8B7B9", +"0+ c #E4E4E4", +"a+ c #FDFDFD", +"b+ c #A5A2B2", +"c+ c #3B3456", +"d+ c #A8A5B4", +"e+ c #525252", +"f+ c #848387", +"g+ c #CDCDCD", +"h+ c #8D899C", +"i+ c #494262", +"j+ c #68627C", +"k+ c #40395A", +"l+ c #ECECEC", +"m+ c #020202", +"n+ c #B4B5B5", +"o+ c #0B0B0B", +"p+ c #313232", +"q+ c #E3E3E3", +"r+ c #B1AEBC", +"s+ c #BDBBC6", +"t+ c #3C3556", +"u+ c #898599", +"v+ c #EDEDED", +"w+ c #39393A", +"x+ c #040404", +"y+ c #333333", +"z+ c #F5F5F5", +"A+ c #2B2B2B", +"B+ c #2D2A3D", +"C+ c #B6B4C1", +"D+ c #F5F5F6", +"E+ c #605A76", +"F+ c #DAD8DF", +"G+ c #F5F4F6", +"H+ c #615B76", +"I+ c #524D6A", +"J+ c #E4E3E8", +"K+ c #D5D5D5", +"L+ c #1B1B1B", +"M+ c #303030", +"N+ c #AAABAB", +"O+ c #585464", +"P+ c #B0AEBB", +"Q+ c #A29FAF", +"R+ c #E9E8E9", +"S+ c #787779", +"T+ c #0F0E15", +"U+ c #2D2D2E", +"V+ c #595959", +"W+ c #FAFAFB", +"X+ c #807B92", +"Y+ c #B0ADBB", +"Z+ c #E8E7EB", +"`+ c #3A3258", +" @ c #E6E5EA", +".@ c #DFDEE3", +"+@ c #443E5E", +"@@ c #BAB8C4", +"#@ c #C1BFCA", +"$@ c #E0E0E5", +"%@ c #D0CED6", +"&@ c #362F52", +"*@ c #CECCD5", +"=@ c #413A5B", +"-@ c #6A657F", +";@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 ~.{.6 ].6 6 6 E ^./.; ; (. ", +" _.; ; :.R h <.[.}.6 |.6 6 6 6 6 6 6 6 6 6 E 1.2.4 3. ", +" 4.5.; 6...6 6 6 6 6 6 6 6 6 7.7.8.6 6 6 6 6 6 6 9.0. ", +" V @ a.b.c.6 6 6 6 6 6 6 6 7.7.7.6 6 6 6 6 6 6 6 ", +" d.e.f.6 g.6 6 6 6 6 6 7.7.7.7.7.6 6 6 |.6 6 6 h. ", +" i.; ; j.k.k.l.m.k.6 7.7.7.7.7.7.7.6 6 6 n.7.6 6 o. ", +" p.; ; q.r.; ; ; s.6 7.7.7.7.7.7.7.7.6 6 7.7.t.6 u. ", +" v.; ; ; ; w.; ; x.6 7.7.7.7.7.7.7.7.7.7.7.7.y.6 6 z., ", +" A.; ; w.; : B.C.D.Q 7.7.7.7.7.7.7.7.7.7.7.7.6 6 E.w.F.G. ", +" H.; ; ; I.J.K.6 6 6 6 6 6 6 6 6 6 L.6 M.6 6 6 6 N.; ; O.P. ", +" Q.J ; : R.6 6 6 6 S...6 6 6 6 6 6 T.6 6 8.6 6 6 U.V.; ; W.X. ", +" Y.; ; Z.6 E 6 `. +.+++6 6 6 6 6 6 6 6 8.6 6 6 6 @+#+; ; > X. ", +" $+; %+&+*+6 6 .+w.; =+-+6 6 6 6 6 6 6 6 ;+>+6 6 6 ,+'+; ; )+!+ ", +" X.~+! {+]+^+x ; ; /+(+_+:+l <+6 6 6 [+}+|+1+6 6 6 2+3+4+; ; 5+@ ", +" 6+7+8+9+0+a+; b+c+d+; V.<+6 6 E e+; ; f+6 6 E 6 o g+; ; = h+ ", +" i+> ; ; ; ; ; ; j+k+; ; l+l.6 6 m+D ; ; n+o+6 6 6 p+q+; ; r+ ", +" > ; ; ; ; s+t+u+; ; v+w+6 6 x+y+; ; z+A+6 6 B+C+; D+3 ", +" E+F+= ; G+H+I+J+; ; K+L+6 6 m+M+; ; ; N+e+O+ ", +" P+4 Q+ X ; ; ; R+S+M+T+U+V+; ; ; w.W+X+ ", +" Y+; ; ; ; ; Z+`+ @; ; ; ; = .@+@ ", +" @@#@$@4 ; ; %@&@*@; ; ; s u+T ", +" =@ -@;@u+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/ControllerPlugin/ControllerPlugin.C b/SpiralSound/Plugins/ControllerPlugin/ControllerPlugin.C new file mode 100644 index 0000000..61d7b87 --- /dev/null +++ b/SpiralSound/Plugins/ControllerPlugin/ControllerPlugin.C @@ -0,0 +1,236 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "ControllerPlugin.h" +#include "ControllerPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new ControllerPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0003; +} +} + +/////////////////////////////////////////////////////// + +ControllerPlugin::ControllerPlugin() : +m_Num(4) +{ + m_Version=3; + + m_PluginInfo.Name="CV Control"; + m_PluginInfo.Width=240; + m_PluginInfo.Height=224; + m_PluginInfo.NumInputs=0; + m_PluginInfo.NumOutputs=4; + m_PluginInfo.PortTips.push_back("CV 1"); + m_PluginInfo.PortTips.push_back("CV 2"); + m_PluginInfo.PortTips.push_back("CV 3"); + m_PluginInfo.PortTips.push_back("CV 4"); + + for (int n=0; nhide(); + return m_GUI; +} + +void ControllerPlugin::Execute() +{ + for(int c=0; cBUFSIZE; n++) + { + SetOutput(c,n,m_ChannelVal[c]); + } + } +} + +void ControllerPlugin::SetNum(int n) +{ + // once to clear the connections with the current info + UpdatePluginInfoWithHost(); + + if (m_Num::iterator i=m_PluginInfo.PortTips.end(); + m_PluginInfo.PortTips.erase(i--); + RemoveOutput(); + m_PluginInfo.NumOutputs--; + } + + m_Num=n; + m_PluginInfo.NumOutputs=n; + + // do the actual update + UpdatePluginInfoWithHost(); +} + +// use with caution +void ControllerPlugin::Clear() +{ + m_PluginInfo.PortTips.clear(); + RemoveAllOutputs(); + m_PluginInfo.NumOutputs=0; +} + +void ControllerPlugin::StreamOut(ostream &s) +{ + s<StreamOut(s); + } break; + + case 3: + { + s<StreamOut(s); + } break; + } +} + +void ControllerPlugin::StreamIn(istream &s) +{ + int version; + s>>version; + + switch (version) + { + case 1: + { + for (int n=0; n<4; n++) + { + s>>m_ChannelVal[n]; + } + } break; + + case 2: + { + Clear(); + + s>>m_Num; + + for (int n=0; n>m_ChannelVal[n]; + } + + s>>*(ControllerPluginGUI*)m_GUI; + + // add the channels one by one + for (int n=0; n>m_Num; + + for (int n=0; n>m_ChannelVal[n]; + } + + ((ControllerPluginGUI*)m_GUI)->StreamIn(s); + + // add the channels one by one + for (int n=0; n + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef ControllerPLUGIN +#define ControllerPLUGIN + +static const int MAX_CHANNELS = 99; + +class ControllerPlugin : public SpiralPlugin +{ +public: + ControllerPlugin(); + virtual ~ControllerPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetChannel(int n, float s) { m_ChannelVal[n]=s; } + void SetNum(int n); + +private: + + void Clear(); + + int m_Num; + float m_ChannelVal[MAX_CHANNELS]; +}; + +#endif diff --git a/SpiralSound/Plugins/ControllerPlugin/ControllerPlugin.pro b/SpiralSound/Plugins/ControllerPlugin/ControllerPlugin.pro new file mode 100644 index 0000000..ca56fe8 --- /dev/null +++ b/SpiralSound/Plugins/ControllerPlugin/ControllerPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ControllerPlugin.h \ + ControllerPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ControllerPlugin.C \ + ControllerPluginGUI.C + +TARGET = ControllerPlugin.so diff --git a/SpiralSound/Plugins/ControllerPlugin/ControllerPluginGUI.C b/SpiralSound/Plugins/ControllerPlugin/ControllerPluginGUI.C new file mode 100644 index 0000000..ab8cc5e --- /dev/null +++ b/SpiralSound/Plugins/ControllerPlugin/ControllerPluginGUI.C @@ -0,0 +1,244 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "ControllerPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +ControllerPluginGUI::CVGUI::CVGUI(int n, ControllerPluginGUI *p) +{ + m_SliderGroup = new Fl_Group(0,0,60,153,""); + m_SliderGroup->box(FL_UP_BOX); + m_SliderGroup->user_data((void *)p); + + m_Title = new Fl_Input(5,2,50,15,""); + m_Title->value("Name"); + m_Title->textsize(10); + m_SliderGroup->add(m_Title); + + m_Max = new Fl_Int_Input(5,18,50,15,""); + char t[64]; + sprintf(t,"%d",1); + m_Max->value(t); + m_Max->textsize(10); + m_SliderGroup->add(m_Max); + + m_Chan = new Fl_Slider(20, 34, 20, 100, ""); + m_Chan->type(4); + m_Chan->selection_color(GUI_COLOUR); + m_Chan->maximum(1); + m_Chan->step(0.01); + m_Chan->value(0.5); + + m_Chan->callback((Fl_Callback*)ControllerPluginGUI::cb_Chan, + (void*)&Numbers[n]); + m_SliderGroup->add(m_Chan); + + m_Min = new Fl_Int_Input(5,136,50,15,""); + char t2[64]; + sprintf(t2,"%d",-1); + m_Min->value(t2); + m_Min->textsize(10); + m_SliderGroup->add(m_Min); +} + +//////////////////////////////////////////// + +ControllerPluginGUI::ControllerPluginGUI(int w, int h,ControllerPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o), +m_CVCount(0) +{ + m_Plugin=o; + + for (int n=0; ntype(FL_HORIZONTAL); + + // start with four... + AddCV(); + AddCV(); + AddCV(); + AddCV(); + + m_Delete = new Fl_Button(2,h-22,20,20,"-"); + m_Delete->user_data(this); + m_Delete->callback((Fl_Callback*)cb_Delete); + add(m_Delete); + m_Add = new Fl_Button(24,h-22,20,20,"+"); + m_Add->user_data(this); + m_Add->callback((Fl_Callback*)cb_Add); + add(m_Add); +} + +void ControllerPluginGUI::AddCV() +{ + CVGUI *NewCV = new CVGUI(m_CVCount,this); + m_GuiVec.push_back(NewCV); + m_MainPack->add(NewCV->m_SliderGroup); + m_CVCount++; +} + +void ControllerPluginGUI::DeleteCV() +{ + vector::iterator i=m_GuiVec.end(); + i--; + m_MainPack->remove((*i)->m_SliderGroup); + delete *i; + m_GuiVec.erase(i); + m_CVCount--; +} + +void ControllerPluginGUI::Clear() +{ + for (vector::iterator i=m_GuiVec.begin(); + i!=m_GuiVec.end(); i++) + { + m_MainPack->remove((*i)->m_SliderGroup); + delete *i; + } + m_GuiVec.clear(); + m_CVCount=0; +} + +void ControllerPluginGUI::UpdateValues() +{ +} + +inline void ControllerPluginGUI::cb_Chan_i(Fl_Slider* o, void* v) +{ + int num=*(int*)(v); + // swap em over, cos it's the easiqest way to reverse + // the fltk slider, which is upside down imho + long max=strtol(m_GuiVec[num]->m_Min->value(),NULL,10); + long min=strtol(m_GuiVec[num]->m_Max->value(),NULL,10); + float val=o->value()*(max-min)+min; + m_Plugin->SetChannel(num,val); +} +void ControllerPluginGUI::cb_Chan(Fl_Slider* o, void* v) +{ ((ControllerPluginGUI*)(o->parent()->user_data()))->cb_Chan_i(o,v);} + +inline void ControllerPluginGUI::cb_Add_i(Fl_Button* o, void* v) +{ + if (m_CVCountSetNum(m_GuiVec.size()); + } +} +void ControllerPluginGUI::cb_Add(Fl_Button* o, void* v) +{ ((ControllerPluginGUI*)(o->parent()))->cb_Add_i(o,v);} + +inline void ControllerPluginGUI::cb_Delete_i(Fl_Button* o, void* v) +{ + if (m_GuiVec.size()>1) + { + DeleteCV(); + resize(x(),y(),w()-60,h()); + redraw(); + + m_Plugin->SetNum(m_GuiVec.size()); + } +} +void ControllerPluginGUI::cb_Delete(Fl_Button* o, void* v) +{ ((ControllerPluginGUI*)(o->parent()))->cb_Delete_i(o,v);} + +// call for version <3 +istream &operator>>(istream &s, ControllerPluginGUI &o) +{ + int c; + string Title,Min,Max; + float Val; + + o.Clear(); + + s>>c; + for (int n=0; n>Title>>Min>>Max>>Val; + o.AddCV(); + o.m_GuiVec[n]->m_Title->value(Title.c_str()); + o.m_GuiVec[n]->m_Min->value(Min.c_str()); + o.m_GuiVec[n]->m_Max->value(Max.c_str()); + o.m_GuiVec[n]->m_Chan->value(Val); + } + + o.resize(o.x(),o.y(),c*60,o.h()); + + return s; +} + +// call for version >=3 +// another version of the stream to fix the old style string streaming problem +void ControllerPluginGUI::StreamIn(istream &s) +{ + int c,version,size; + string Title,Min,Max; + float Val; + char Buf[4096]; + + Clear(); + s>>version; + s>>c; + for (int n=0; n>size; + s.ignore(1); + s.get(Buf,size+1); + m_GuiVec[n]->m_Title->value(Buf); + + s>>Min>>Max>>Val; + + m_GuiVec[n]->m_Min->value(Min.c_str()); + m_GuiVec[n]->m_Max->value(Max.c_str()); + m_GuiVec[n]->m_Chan->value(Val); + } + + resize(x(),y(),c*60,h()); +} + +void ControllerPluginGUI::StreamOut(ostream &s) +{ + // version + s<<1<::iterator i=m_GuiVec.begin(); + i!=m_GuiVec.end(); i++) + { + s<m_Title->value())<m_Title->value()<<" "; + s<<(*i)->m_Min->value()<<" "; + s<<(*i)->m_Max->value()<<" "; + s<<(*i)->m_Chan->value()< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "ControllerPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef MixerGUI +#define MixerGUI + +static int Numbers[MAX_CHANNELS]; + +class ControllerPluginGUI : public SpiralPluginGUI +{ +public: + ControllerPluginGUI(int w, int h, ControllerPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + ControllerPlugin *m_Plugin; + + void StreamIn(istream &s); + void StreamOut(ostream &s); + +private: + + void Clear(); + + class CVGUI + { + public: + CVGUI::CVGUI(int n, ControllerPluginGUI *p); + + Fl_Group *m_SliderGroup; + Fl_Input *m_Title; + Fl_Int_Input *m_Min; + Fl_Int_Input *m_Max; + Fl_Slider *m_Chan; + }; + + friend class CVGUI; + + Fl_Pack *m_MainPack; + Fl_Button *m_Add; + Fl_Button *m_Delete; + + vector m_GuiVec; + void AddCV(); + void DeleteCV(); + + int m_CVCount; + + //// Callbacks //// + inline void cb_Chan_i(Fl_Slider* o, void* v); + static void cb_Chan(Fl_Slider* o, void* v); + inline void cb_Add_i(Fl_Button* o, void* v); + static void cb_Add(Fl_Button* o, void* v); + inline void cb_Delete_i(Fl_Button* o, void* v); + static void cb_Delete(Fl_Button* o, void* v); + + friend istream &operator>>(istream &s, ControllerPluginGUI &o); +}; + +istream &operator>>(istream &s, ControllerPluginGUI &o); + +#endif diff --git a/SpiralSound/Plugins/ControllerPlugin/Makefile.in b/SpiralSound/Plugins/ControllerPlugin/Makefile.in new file mode 100644 index 0000000..7327393 --- /dev/null +++ b/SpiralSound/Plugins/ControllerPlugin/Makefile.in @@ -0,0 +1,164 @@ +############################################################################# +# Makefile for building ControllerPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: ControllerPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ControllerPlugin.h \ + ControllerPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ControllerPlugin.C \ + ControllerPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + ControllerPlugin.o \ + ControllerPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = ControllerPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake ControllerPlugin.pro + +dist: + $(TAR) ControllerPlugin.tar ControllerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) ControllerPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +ControllerPlugin.o: ControllerPlugin.C \ + ControllerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ControllerPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +ControllerPluginGUI.o: ControllerPluginGUI.C \ + ControllerPluginGUI.h \ + ControllerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/ControllerPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/ControllerPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..44e8801 --- /dev/null +++ b/SpiralSound/Plugins/ControllerPlugin/SpiralIcon.xpm @@ -0,0 +1,352 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 313 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0A0A0A", +"+. c #151700", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #282900", +"!. c #030300", +"~. c #070700", +"{. c #020200", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #515151", +"|. c #A6A6A7", +"1. c #827E93", +"2. c #615C77", +"3. c #EAEAED", +"4. c #DFDFE1", +"5. c #0C0C0C", +"6. c #645E00", +"7. c #F9EC00", +"8. c #FDF100", +"9. c #FDF000", +"0. c #807900", +"a. c #E0D400", +"b. c #191700", +"c. c #1E1D24", +"d. c #9894A7", +"e. c #B1AEBB", +"f. c #69686F", +"g. c #000001", +"h. c #EFE200", +"i. c #FCEF00", +"j. c #CBC000", +"k. c #8E8600", +"l. c #1E1C00", +"m. c #F3E600", +"n. c #615C76", +"o. c #5F5A75", +"p. c #413E4D", +"q. c #020203", +"r. c #010100", +"s. c #FEF100", +"t. c #8C8400", +"u. c #CCC100", +"v. c #D0C500", +"w. c #1A1A1C", +"x. c #C3C1CB", +"y. c #9D9D9D", +"z. c #202020", +"A. c #383838", +"B. c #4C4C4C", +"C. c #FFF200", +"D. c #060500", +"E. c #534E00", +"F. c #111112", +"G. c #C9C7D0", +"H. c #F1F1F1", +"I. c #F8F8F8", +"J. c #232323", +"K. c #736D00", +"L. c #F2E500", +"M. c #050408", +"N. c #AEACB9", +"O. c #FEFEFE", +"P. c #1D1D1D", +"Q. c #E4D800", +"R. c #C1B700", +"S. c #DDD100", +"T. c #9A9200", +"U. c #FAED00", +"V. c #A9A000", +"W. c #B7B5C1", +"X. c #9390A2", +"Y. c #BBBBBB", +"Z. c #414141", +"`. c #030303", +" + c #C6BB00", +".+ c #7E7700", +"++ c #28272A", +"@+ c #F4F4F6", +"#+ c #605B76", +"$+ c #736E86", +"%+ c #D8D8D8", +"&+ c #727272", +"*+ c #101010", +"=+ c #848486", +"-+ c #CCCBD3", +";+ c #747087", +">+ c #6D6881", +",+ c #1C1C1C", +"'+ c #242424", +")+ c #212205", +"!+ c #1B1D00", +"~+ c #000100", +"{+ c #656566", +"]+ c #F6F6F6", +"^+ c #E8E6EA", +"/+ c #706B84", +"(+ c #E3E1E6", +"_+ c #474746", +":+ c #151515", +"<+ c #C8C8C8", +"[+ c #AEAEAE", +"}+ c #070707", +"|+ c #373639", +"1+ c #FDFCFE", +"2+ c #ABA8B7", +"3+ c #F1F0F3", +"4+ c #6D6980", +"5+ c #0A090E", +"6+ c #95929E", +"7+ c #0A0810", +"8+ c #0D0D0D", +"9+ c #050505", +"0+ c #5B5A5C", +"a+ c #F7F6F7", +"b+ c #F4F3F5", +"c+ c #908C9F", +"d+ c #C8C6D0", +"e+ c #837E96", +"f+ c #86868A", +"g+ c #070608", +"h+ c #ECEBEE", +"i+ c #5B5571", +"j+ c #646078", +"k+ c #AFAFB0", +"l+ c #454545", +"m+ c #363636", +"n+ c #7A7A7A", +"o+ c #C8C8C9", +"p+ c #212025", +"q+ c #060607", +"r+ c #969699", +"s+ c #FAFAFA", +"t+ c #F8F8F9", +"u+ c #A29EAF", +"v+ c #F7F6F8", +"w+ c #F0F0F1", +"x+ c #B8B7B9", +"y+ c #E4E4E4", +"z+ c #FDFDFD", +"A+ c #A5A2B2", +"B+ c #3B3456", +"C+ c #A8A5B4", +"D+ c #525252", +"E+ c #848387", +"F+ c #CDCDCD", +"G+ c #8D899C", +"H+ c #494262", +"I+ c #68627C", +"J+ c #40395A", +"K+ c #ECECEC", +"L+ c #020202", +"M+ c #B4B5B5", +"N+ c #0B0B0B", +"O+ c #313232", +"P+ c #E3E3E3", +"Q+ c #B1AEBC", +"R+ c #BDBBC6", +"S+ c #3C3556", +"T+ c #898599", +"U+ c #EDEDED", +"V+ c #39393A", +"W+ c #040404", +"X+ c #333333", +"Y+ c #F5F5F5", +"Z+ c #2B2B2B", +"`+ c #2D2A3D", +" @ c #B6B4C1", +".@ c #F5F5F6", +"+@ c #605A76", +"@@ c #DAD8DF", +"#@ c #F5F4F6", +"$@ c #615B76", +"%@ c #524D6A", +"&@ c #E4E3E8", +"*@ c #D5D5D5", +"=@ c #1B1B1B", +"-@ c #303030", +";@ c #AAABAB", +">@ c #585464", +",@ c #B0AEBB", +"'@ c #A29FAF", +")@ c #E9E8E9", +"!@ c #787779", +"~@ c #0F0E15", +"{@ c #2D2D2E", +"]@ c #595959", +"^@ c #FAFAFB", +"/@ c #807B92", +"(@ c #B0ADBB", +"_@ c #E8E7EB", +":@ c #3A3258", +"<@ c #E6E5EA", +"[@ c #DFDEE3", +"}@ c #443E5E", +"|@ c #BAB8C4", +"1@ c #C1BFCA", +"2@ c #E0E0E5", +"3@ c #D0CED6", +"4@ c #362F52", +"5@ c #CECCD5", +"6@ c #413A5B", +"7@ c #6A657F", +"8@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 6 6 ~.{.6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 !.6 6 6 6 6 6 6 6 6 6 E }.|.4 1. ", +" 2.3.; 4.5.6 6 6 6 6 6 6.7.8.9.0.6 a.6.6 6.a.b.6 c.d. ", +" V @ e.f.g.6 6 6 6 6 {.h.i.j.k.l.6 m.a.6 a.7.b.6 ", +" n.o.p.6 q.6 6 6 6 r.s.t.6 6 6 6 u.i.6 s.v.6 6 w. ", +" x.; ; y.z.z.A.B.z.6 6 C.D.6 6 6 6 l.C.E.C.l.6 6 F. ", +" G.; ; H.I.; ; ; J.6 6 s.K.6 6 6 6 6 s.L.L.6 6 6 M. ", +" N.; ; ; ; O.; ; P.6 6 Q.s.R.S.T.6 6 U.C.V.6 6 6 6 W., ", +" X.; ; O.; : Y.Z.`.6 6 6 +9.s..+6 6 u.C.D.6 6 6 ++O.@+#+ ", +" $+; ; ; %+&+*+6 6 6 6 6 6 6 6 6 6 6 6 {.6 6 6 6 =+; ; -+;+ ", +" >+J ; : ,+6 6 6 6 '+)+!+6 ~+6 6 6 6 6 6 6 6 6 6 {+]+; ; ^+/+ ", +" (+; ; _+6 E 6 :+<+[+}+6 6 6 6 6 6 6 6 r.6 6 6 6 |+1+; ; > /+ ", +" 2+; 3+4+5+6 6 [+O.; 6+7+6 6 6 6 6 6 6 6 8+9+6 6 6 0+a+; ; b+c+ ", +" /+d+! e+f+g+x ; ; h+i+j+k+l l+6 6 6 m+n+o+p+6 6 6 q+r+s+; ; t+@ ", +" u+v+w+x+y+z+; A+B+C+; ]+l+6 6 E D+; ; E+6 6 E 6 o F+; ; = G+ ", +" H+> ; ; ; ; ; ; I+J+; ; K+A.6 6 L+D ; ; M+N+6 6 6 O+P+; ; Q+ ", +" > ; ; ; ; R+S+T+; ; U+V+6 6 W+X+; ; Y+Z+6 6 `+ @; .@3 ", +" +@@@= ; #@$@%@&@; ; *@=@6 6 L+-@; ; ; ;@D+>@ ", +" ,@4 '@ X ; ; ; )@!@-@~@{@]@; ; ; O.^@/@ ", +" (@; ; ; ; ; _@:@<@; ; ; ; = [@}@ ", +" |@1@2@4 ; ; 3@4@5@; ; ; s T+T ", +" 6@ 7@8@T+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/DelayPlugin/DelayPlugin.C b/SpiralSound/Plugins/DelayPlugin/DelayPlugin.C new file mode 100644 index 0000000..6b45c11 --- /dev/null +++ b/SpiralSound/Plugins/DelayPlugin/DelayPlugin.C @@ -0,0 +1,141 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "DelayPlugin.h" +#include "DelayPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +static const float MAX_DELAY=1.0f; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new DelayPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x000f; +} +} + +/////////////////////////////////////////////////////// + +DelayPlugin::DelayPlugin() : +m_Delay(0.75), +m_Mix(0.4), +m_ReadHeadPos(0), +m_WriteHeadPos(0) +{ + m_PluginInfo.Name="Delay"; + m_PluginInfo.Width=120; + m_PluginInfo.Height=110; + m_PluginInfo.NumInputs=3; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Delay CV"); + m_PluginInfo.PortTips.push_back("ReadHead CV"); + m_PluginInfo.PortTips.push_back("Output"); +} + +DelayPlugin::~DelayPlugin() +{ +} + +PluginInfo &DelayPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + m_Buffer.Allocate((int)(m_HostInfo->SAMPLERATE*MAX_DELAY)); + return Info; +} + +SpiralGUIType *DelayPlugin::CreateGUI() +{ + m_GUI = new DelayPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void DelayPlugin::Execute() +{ + int Delay; + + for (int n=0; nBUFSIZE; n++) + { + Delay=(int)((m_Delay+GetInput(1,n)*0.5f)*(float)m_HostInfo->SAMPLERATE); + + if (Delay>=MAX_DELAY*m_HostInfo->SAMPLERATE) + { + Delay=(int)(MAX_DELAY*m_HostInfo->SAMPLERATE)-1; + } + + if (Delay<0) Delay=0; + + if (m_ReadHeadPos<0 || m_ReadHeadPos>=MAX_DELAY*m_HostInfo->SAMPLERATE) + cerr<<"read agh! "<=MAX_DELAY*m_HostInfo->SAMPLERATE) + cerr<<"write agh! "<0) + { + if (m_ReadHeadPos>=Delay) m_ReadHeadPos=m_ReadHeadPos-Delay; + if (m_WriteHeadPos>=Delay) m_WriteHeadPos=m_WriteHeadPos-Delay; + } + else + { + m_ReadHeadPos=0; + m_WriteHeadPos=0; + } + } + +} + +void DelayPlugin::Randomise() +{ +} + +void DelayPlugin::StreamOut(ostream &s) +{ + s<>version; + s>>m_Delay>>m_Mix; +} diff --git a/SpiralSound/Plugins/DelayPlugin/DelayPlugin.h b/SpiralSound/Plugins/DelayPlugin/DelayPlugin.h new file mode 100644 index 0000000..0d65fe5 --- /dev/null +++ b/SpiralSound/Plugins/DelayPlugin/DelayPlugin.h @@ -0,0 +1,63 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef DelayPLUGIN +#define DelayPLUGIN + +class DelayPlugin : public SpiralPlugin +{ +public: + DelayPlugin(); + virtual ~DelayPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + + void SetDelay(float s) { m_Delay=s; } + void SetMix(float s) { m_Mix=s; } + float GetDelay() { return m_Delay; } + float GetMix() { return m_Mix; } + + void Randomise(); + +private: + float m_Delay; + float m_Mix; + + float m_ReadHeadPos; + float m_WriteHeadPos; + + Sample m_Buffer; + + friend istream &operator>>(istream &s, DelayPlugin &o); + friend ostream &operator<<(ostream &s, DelayPlugin &o); +}; +istream &operator>>(istream &s, DelayPlugin &o); +ostream &operator<<(ostream &s, DelayPlugin &o); + +#endif diff --git a/SpiralSound/Plugins/DelayPlugin/DelayPlugin.pro b/SpiralSound/Plugins/DelayPlugin/DelayPlugin.pro new file mode 100644 index 0000000..9d811b9 --- /dev/null +++ b/SpiralSound/Plugins/DelayPlugin/DelayPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + DelayPlugin.h \ + DelayPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + DelayPlugin.C \ + DelayPluginGUI.C + +TARGET = DelayPlugin.so diff --git a/SpiralSound/Plugins/DelayPlugin/DelayPluginGUI.C b/SpiralSound/Plugins/DelayPlugin/DelayPluginGUI.C new file mode 100644 index 0000000..e142745 --- /dev/null +++ b/SpiralSound/Plugins/DelayPlugin/DelayPluginGUI.C @@ -0,0 +1,72 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "DelayPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +DelayPluginGUI::DelayPluginGUI(int w, int h,DelayPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_Delay = new Fl_Slider(15, 20, 20, 70, "Delay"); + m_Delay->type(4); + m_Delay->selection_color(GUI_COLOUR); + m_Delay->labelsize(10); + m_Delay->maximum(1); + m_Delay->step(0.001); + m_Delay->value(0.5); + m_Delay->callback((Fl_Callback*)cb_Delay); + + m_Mix = new Fl_Knob(58, 28, 45, 45, "Mix"); + m_Mix->color(GUI_COLOUR); + m_Mix->type(Fl_Knob::DOTLIN); + m_Mix->labelsize(10); + m_Mix->maximum(1); + m_Mix->step(0.01); + m_Mix->value(0); + m_Mix->callback((Fl_Callback*)cb_Mix); + + end(); +} + +void DelayPluginGUI::UpdateValues() +{ + m_Delay->value(m_Plugin->GetDelay()-5.0f); + m_Mix->value(m_Plugin->GetMix()); +} + +inline void DelayPluginGUI::cb_Delay_i(Fl_Slider* o, void* v) +{ + float value=1.0f-o->value(); + m_Plugin->SetDelay(value); +} +void DelayPluginGUI::cb_Delay(Fl_Slider* o, void* v) +{ ((DelayPluginGUI*)(o->parent()))->cb_Delay_i(o,v); } + +inline void DelayPluginGUI::cb_Mix_i(Fl_Knob* o, void* v) +{ m_Plugin->SetMix(o->value()); } +void DelayPluginGUI::cb_Mix(Fl_Knob* o, void* v) +{ ((DelayPluginGUI*)(o->parent()))->cb_Mix_i(o,v); } diff --git a/SpiralSound/Plugins/DelayPlugin/DelayPluginGUI.h b/SpiralSound/Plugins/DelayPlugin/DelayPluginGUI.h new file mode 100644 index 0000000..182f6a3 --- /dev/null +++ b/SpiralSound/Plugins/DelayPlugin/DelayPluginGUI.h @@ -0,0 +1,56 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "DelayPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" + +#ifndef FilterGUI +#define FilterGUI + + +class DelayPluginGUI : public SpiralPluginGUI +{ +public: + DelayPluginGUI(int w, int h, DelayPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + DelayPlugin *m_Plugin; + +private: + + Fl_Slider *m_Delay; + Fl_Knob *m_Mix; + + //// Callbacks //// + + inline void cb_Delay_i(Fl_Slider* o, void* v); + static void cb_Delay(Fl_Slider*, void*); + inline void cb_Mix_i(Fl_Knob* o, void* v); + static void cb_Mix(Fl_Knob* o, void* v); + +}; + +#endif diff --git a/SpiralSound/Plugins/DelayPlugin/Makefile.in b/SpiralSound/Plugins/DelayPlugin/Makefile.in new file mode 100644 index 0000000..45f475d --- /dev/null +++ b/SpiralSound/Plugins/DelayPlugin/Makefile.in @@ -0,0 +1,166 @@ +############################################################################# +# Makefile for building DelayPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: DelayPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + DelayPlugin.h \ + DelayPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + DelayPlugin.C \ + DelayPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + DelayPlugin.o \ + DelayPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = DelayPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake DelayPlugin.pro + +dist: + $(TAR) DelayPlugin.tar DelayPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) DelayPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +DelayPlugin.o: DelayPlugin.C \ + DelayPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + DelayPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + SpiralIcon.xpm + +DelayPluginGUI.o: DelayPluginGUI.C \ + DelayPluginGUI.h \ + DelayPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H + diff --git a/SpiralSound/Plugins/DelayPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/DelayPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..dbbd03a --- /dev/null +++ b/SpiralSound/Plugins/DelayPlugin/SpiralIcon.xpm @@ -0,0 +1,341 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 302 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #2D2F00", +"!. c #111200", +"~. c #9C9500", +"{. c #080800", +"]. c #030400", +"^. c #020200", +"/. c #727175", +"(. c #FEFEFF", +"_. c #9D99AA", +":. c #DBD9E0", +"<. c #E9E9E9", +"[. c #CBCBCB", +"}. c #E0E0E0", +"|. c #6C6C6C", +"1. c #050500", +"2. c #FFF200", +"3. c #000100", +"4. c #0F1000", +"5. c #515151", +"6. c #A6A6A7", +"7. c #827E93", +"8. c #615C77", +"9. c #EAEAED", +"0. c #DFDFE1", +"a. c #1E1D24", +"b. c #9894A7", +"c. c #B1AEBB", +"d. c #69686F", +"e. c #000001", +"f. c #040400", +"g. c #010100", +"h. c #615C76", +"i. c #5F5A75", +"j. c #413E4D", +"k. c #020203", +"l. c #1E1C00", +"m. c #807900", +"n. c #1A1A1C", +"o. c #C3C1CB", +"p. c #9D9D9D", +"q. c #202020", +"r. c #383838", +"s. c #4C4C4C", +"t. c #8F8700", +"u. c #FDF000", +"v. c #111112", +"w. c #C9C7D0", +"x. c #F1F1F1", +"y. c #F8F8F8", +"z. c #121212", +"A. c #918900", +"B. c #050408", +"C. c #AEACB9", +"D. c #FEFEFE", +"E. c #B7B5C1", +"F. c #9390A2", +"G. c #BBBBBB", +"H. c #414141", +"I. c #020202", +"J. c #141500", +"K. c #534E00", +"L. c #E2D600", +"M. c #E9DD00", +"N. c #FEF100", +"O. c #E5D900", +"P. c #F1E500", +"Q. c #E8DC00", +"R. c #D1C600", +"S. c #191700", +"T. c #2F3100", +"U. c #28272A", +"V. c #F4F4F6", +"W. c #605B76", +"X. c #736E86", +"Y. c #D8D8D8", +"Z. c #727272", +"`. c #101010", +" + c #EDE100", +".+ c #131400", +"++ c #848486", +"@+ c #CCCBD3", +"#+ c #747087", +"$+ c #6D6881", +"%+ c #1C1C1C", +"&+ c #070707", +"*+ c #656566", +"=+ c #F6F6F6", +"-+ c #E8E6EA", +";+ c #706B84", +">+ c #E3E1E6", +",+ c #474746", +"'+ c #151515", +")+ c #C8C8C8", +"!+ c #AEAEAE", +"~+ c #080808", +"{+ c #373639", +"]+ c #FDFCFE", +"^+ c #ABA8B7", +"/+ c #F1F0F3", +"(+ c #6D6980", +"_+ c #0A090E", +":+ c #95929E", +"<+ c #0A0810", +"[+ c #0D0D0D", +"}+ c #050505", +"|+ c #5B5A5C", +"1+ c #F7F6F7", +"2+ c #F4F3F5", +"3+ c #908C9F", +"4+ c #C8C6D0", +"5+ c #837E96", +"6+ c #86868A", +"7+ c #070608", +"8+ c #ECEBEE", +"9+ c #5B5571", +"0+ c #646078", +"a+ c #AFAFB0", +"b+ c #454545", +"c+ c #363636", +"d+ c #7A7A7A", +"e+ c #C8C8C9", +"f+ c #212025", +"g+ c #060607", +"h+ c #969699", +"i+ c #FAFAFA", +"j+ c #F8F8F9", +"k+ c #A29EAF", +"l+ c #F7F6F8", +"m+ c #F0F0F1", +"n+ c #B8B7B9", +"o+ c #E4E4E4", +"p+ c #FDFDFD", +"q+ c #A5A2B2", +"r+ c #3B3456", +"s+ c #A8A5B4", +"t+ c #525252", +"u+ c #848387", +"v+ c #CDCDCD", +"w+ c #8D899C", +"x+ c #494262", +"y+ c #68627C", +"z+ c #40395A", +"A+ c #ECECEC", +"B+ c #B4B5B5", +"C+ c #0B0B0B", +"D+ c #313232", +"E+ c #E3E3E3", +"F+ c #B1AEBC", +"G+ c #BDBBC6", +"H+ c #3C3556", +"I+ c #898599", +"J+ c #EDEDED", +"K+ c #39393A", +"L+ c #040404", +"M+ c #333333", +"N+ c #F5F5F5", +"O+ c #2B2B2B", +"P+ c #2D2A3D", +"Q+ c #B6B4C1", +"R+ c #F5F5F6", +"S+ c #605A76", +"T+ c #DAD8DF", +"U+ c #F5F4F6", +"V+ c #615B76", +"W+ c #524D6A", +"X+ c #E4E3E8", +"Y+ c #D5D5D5", +"Z+ c #1B1B1B", +"`+ c #303030", +" @ c #AAABAB", +".@ c #585464", +"+@ c #B0AEBB", +"@@ c #A29FAF", +"#@ c #E9E8E9", +"$@ c #787779", +"%@ c #0F0E15", +"&@ c #2D2D2E", +"*@ c #595959", +"=@ c #FAFAFB", +"-@ c #807B92", +";@ c #B0ADBB", +">@ c #E8E7EB", +",@ c #3A3258", +"'@ c #E6E5EA", +")@ c #DFDEE3", +"!@ c #443E5E", +"~@ c #BAB8C4", +"{@ c #C1BFCA", +"]@ c #E0E0E5", +"^@ c #D0CED6", +"/@ c #362F52", +"(@ c #CECCD5", +"_@ c #413A5B", +":@ c #6A657F", +"<@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.{.].6 ^.6 6 6 E /.(.; ; _. ", +" :.; ; <.R h [.}.|.6 1.6 2.6 6 3.4.6 6 6 6 E 5.6.4 7. ", +" 8.9.; 0...6 6 6 6 6 6 6 6 2.6 6 6 6 6 6 6 6 6 6 a.b. ", +" V @ c.d.e.6 6 6 6 6 f.g.6 2.6 6 6 6 6 6 6 6 6 6 ", +" h.i.j.6 k.6 6 6 6 6 6 6 2.6 6 l.m.6 6 6 6 6 6 n. ", +" o.; ; p.q.q.r.s. .6 6 6 6 2.6 6 t.u.6 6 6 6 6 6 v. ", +" w.; ; x.y.; ; ; z.6 6 6 6 2.6 6 A.u.6 6 6 6 6 6 B. ", +" C.; ; ; ; D.; ; M 6 6 6 6 2.6 6 A.u.6 6 6 6 6 6 6 E., ", +" F.; ; D.; : G.H.I.J.K.L.M.N.M.O.P.N.Q.Q.R.S.g.T.U.D.V.W. ", +" X.; ; ; Y.Z.`.6 6 6 K.L.M. +M.O.Q.Q.Q.Q.R.S.@..+++; ; @+#+ ", +" $+J ; : %+6 6 6 6 q.&+6 6 6 6 6 6 6 6 6 6 6 6 6 *+=+; ; -+;+ ", +" >+; ; ,+6 E 6 '+)+!+~+6 6 6 6 6 6 6 6 g.6 6 6 6 {+]+; ; > ;+ ", +" ^+; /+(+_+6 6 !+D.; :+<+6 6 6 6 6 6 6 6 [+}+6 6 6 |+1+; ; 2+3+ ", +" ;+4+! 5+6+7+x ; ; 8+9+0+a+l b+6 6 6 c+d+e+f+6 6 6 g+h+i+; ; j+@ ", +" k+l+m+n+o+p+; q+r+s+; =+b+6 6 E t+; ; u+6 6 E 6 o v+; ; = w+ ", +" x+> ; ; ; ; ; ; y+z+; ; A+r.6 6 I.D ; ; B+C+6 6 6 D+E+; ; F+ ", +" > ; ; ; ; G+H+I+; ; J+K+6 6 L+M+; ; N+O+6 6 P+Q+; R+3 ", +" S+T+= ; U+V+W+X+; ; Y+Z+6 6 I.`+; ; ; @t+.@ ", +" +@4 @@ X ; ; ; #@$@`+%@&@*@; ; ; D.=@-@ ", +" ;@; ; ; ; ; >@,@'@; ; ; ; = )@!@ ", +" ~@{@]@4 ; ; ^@/@(@; ; ; s I+T ", +" _@ :@<@I+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.C b/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.C new file mode 100644 index 0000000..80666d3 --- /dev/null +++ b/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.C @@ -0,0 +1,136 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "DistributorPlugin.h" +#include "DistributorPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new DistributorPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0056; +} +} + +/////////////////////////////////////////////////////// + +DistributorPlugin::DistributorPlugin() +{ + m_PluginInfo.Name="Distributor"; + m_PluginInfo.Width=220; + m_PluginInfo.Height=250; + m_PluginInfo.NumInputs=2; + m_PluginInfo.NumOutputs=8; + m_PluginInfo.PortTips.push_back("Stream (A)"); + m_PluginInfo.PortTips.push_back("Switcher (B)"); + m_PluginInfo.PortTips.push_back("Out A1"); + m_PluginInfo.PortTips.push_back("Out B1"); + m_PluginInfo.PortTips.push_back("Out A2"); + m_PluginInfo.PortTips.push_back("Out B2"); + m_PluginInfo.PortTips.push_back("Out A3"); + m_PluginInfo.PortTips.push_back("Out B3"); + m_PluginInfo.PortTips.push_back("Out A4"); + m_PluginInfo.PortTips.push_back("Out B4"); +} + +DistributorPlugin::~DistributorPlugin() +{ +} + +PluginInfo &DistributorPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *DistributorPlugin::CreateGUI() +{ + m_GUI=NULL; + return m_GUI; +} + +void DistributorPlugin::Execute() +{ + if (! m_Defined) + { + m_Triggeronce=false; + m_Previous=0; + m_Now=0; + m_Defined=true; + m_ChannelSelect=0; + m_trigdelay=0; + } + for (int n=0; nBUFSIZE; n++) + { + // detect the trigger + if ((GetInput(1,n))!=0) + { + if (GetInput(0,n)!=m_Previous) + { + GetOutputBuf(m_ChannelSelect+1)->Zero(); + m_ChannelSelect=m_ChannelSelect+2; + if (m_ChannelSelect>6) + { + m_ChannelSelect=0; + } + //zero the outputs first... + GetOutputBuf(m_ChannelSelect)->Zero(); + GetOutputBuf(m_ChannelSelect+1)->Zero(); + //and copy the inputs as well + if (InputExists(0)) //unless you want segmentation faults... + GetOutputBuf(m_ChannelSelect)->Mix(*GetInput(0),0); + GetOutputBuf(m_ChannelSelect+1)->Mix(*GetInput(1),0); + //now save the present pitch value, because we'll need it next time around. + m_Previous=GetInput(0,n); + m_Triggeronce=true; + } + else if (m_Triggeronce==false) + { + //just copy the trigger in this case. + GetOutputBuf(m_ChannelSelect+1)->Zero(); + GetOutputBuf(m_ChannelSelect+1)->Mix(*GetInput(1),0); + m_Triggeronce=true; + } + } + else + { + m_Triggeronce=false; + m_trigdelay++; + if (m_trigdelay>=10) + { + GetOutputBuf(m_ChannelSelect+1)->Zero(); + m_trigdelay=0; + } + } + + } + +} + + + + diff --git a/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.h b/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.h new file mode 100644 index 0000000..c719665 --- /dev/null +++ b/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.h @@ -0,0 +1,57 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef DistributorPLUGIN +#define DistributorPLUGIN + +class DistributorPlugin : public SpiralPlugin +{ +public: + DistributorPlugin(); + virtual ~DistributorPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s) {} + virtual void StreamIn(istream &s) {} + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + +private: +bool m_Triggered; +bool m_Switch; +bool m_Triggeronce; +int m_ChannelSelect; +int m_trigdelay; +bool m_Defined; +float m_Previous; +float m_Now; +}; + +#endif + + + + + + diff --git a/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.pro b/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.pro new file mode 100644 index 0000000..26836db --- /dev/null +++ b/SpiralSound/Plugins/DistributorPlugin/DistributorPlugin.pro @@ -0,0 +1,18 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + DistributorPlugin.h \ + DistributorPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + DistributorPlugin.C \ + DistributorPluginGUI.C + +TARGET = DistributorPlugin.so + diff --git a/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.C b/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.C new file mode 100644 index 0000000..2917a63 --- /dev/null +++ b/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.C @@ -0,0 +1,42 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "DistributorPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +DistributorPluginGUI::DistributorPluginGUI(int w, int h,DistributorPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + end(); +} + + + +void DistributorPluginGUI::UpdateValues() +{ +} + + diff --git a/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.h b/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.h new file mode 100644 index 0000000..3cd6f2d --- /dev/null +++ b/SpiralSound/Plugins/DistributorPlugin/DistributorPluginGUI.h @@ -0,0 +1,48 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "DistributorPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef DistributorGUI +#define DistributorGUI + + +class DistributorPluginGUI : public SpiralPluginGUI +{ +public: + DistributorPluginGUI(int w, int h, DistributorPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + DistributorPlugin *m_Plugin; +private: + + //// Callbacks //// +}; + +#endif + diff --git a/SpiralSound/Plugins/DistributorPlugin/Makefile.in b/SpiralSound/Plugins/DistributorPlugin/Makefile.in new file mode 100644 index 0000000..d7c7ad1 --- /dev/null +++ b/SpiralSound/Plugins/DistributorPlugin/Makefile.in @@ -0,0 +1,170 @@ +# Generated automatically from Makefile.in by configure. +############################################################################# +# Makefile for building DistributorPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: DistributorPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + DistributorPlugin.h \ + DistributorPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + DistributorPlugin.C \ + DistributorPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + DistributorPlugin.o \ + DistributorPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = DistributorPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake DistributorPlugin.pro + +dist: + $(TAR) DistributorPlugin.tar DistributorPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) DistributorPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +DistributorPlugin.o: DistributorPlugin.C \ + DistributorPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + DistributorPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +DistributorPluginGUI.o: DistributorPluginGUI.C \ + DistributorPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + DistributorPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + + diff --git a/SpiralSound/Plugins/DistributorPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/DistributorPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..832697b --- /dev/null +++ b/SpiralSound/Plugins/DistributorPlugin/SpiralIcon.xpm @@ -0,0 +1,328 @@ +/* XPM */ +static char *SpiralIcon_xpm []={ +"36 36 289 2", +"Qt c None", +".G c #000000", +"aa c #000001", +"aV c #010100", +"#d c #010101", +"#Z c #010200", +"aH c #020200", +"bQ c #020202", +"ah c #020203", +"aG c #030303", +"#Q c #040400", +"b1 c #040404", +"ai c #040500", +"ax c #050408", +"ak c #050500", +"bd c #050505", +"#F c #060600", +"bv c #060607", +"bl c #070608", +"a5 c #080808", +"bb c #0a0810", +"b# c #0a090e", +"ab c #0a0a00", +"bS c #0b0b0b", +"#B c #0c0c0c", +"bc c #0d0d0d", +".X c #0e0e0e", +"cl c #0f0e15", +"#l c #0f0f0f", +".0 c #100e15", +"aO c #101010", +"aB c #101100", +".Z c #111111", +"as c #111112", +"ar c #121300", +"aw c #141500", +"a2 c #151515", +"#A c #161616", +"#D c #161800", +"ac c #171800", +"#p c #181900", +".R c #191919", +"#G c #191a00", +"al c #1a1a1c", +"#E c #1a1b00", +"cd c #1b1b1b", +"aT c #1c1c1c", +".t c #1d1c1d", +"aA c #1d1d1d", +"#8 c #1e1d24", +"ao c #202020", +"bu c #212025", +"aU c #242424", +"#P c #252525", +"aI c #28272a", +"#e c #282828", +".m c #2a2248", +".J c #2a2a2b", +".Q c #2b2932", +"b4 c #2b2b2b", +"#o c #2b2b2c", +"b5 c #2d2a3d", +"cm c #2d2d2e", +"ce c #303030", +"#t c #31294d", +".u c #313134", +"bT c #313232", +"b2 c #333333", +"cA c #362f52", +"br c #363636", +"a6 c #373639", +"ap c #383838", +"#H c #393643", +"b0 c #39393a", +"cs c #3a3258", +"bG c #3b3456", +".U c #3b3556", +"bX c #3c3556", +".K c #403958", +"bO c #40395a", +"ad c #404000", +"cC c #413a5b", +"ag c #413e4d", +"aF c #414141", +"#. c #423c5c", +"cv c #443e5e", +"bq c #454545", +".z c #464060", +"#s c #474060", +"#I c #47415f", +"a1 c #474746", +"#n c #48445c", +"bM c #494262", +"#c c #4a4a4a", +"aq c #4c4c4c", +"#0 c #515151", +"ca c #524d6a", +"bI c #525252", +"#k c #545454", +"#b c #555555", +".7 c #575755", +"cg c #585464", +"cn c #595959", +"bn c #5b5571", +"be c #5b5a5c", +".8 c #5e5e5e", +"af c #5f5a75", +"b8 c #605a76", +"aK c #605b76", +"c# c #615b76", +"ae c #615c76", +"#3 c #615c77", +"#h c #615c78", +".P c #625c79", +"#w c #625d78", +"bo c #646078", +"#v c #65607a", +"aW c #656566", +".f c #67627c", +"bN c #68627c", +".o c #68637d", +"a# c #69686f", +"cD c #6a657f", +"#Y c #6c6c6c", +"aS c #6d6881", +"b. c #6d6980", +"aZ c #706b84", +"#u c #716c85", +"#R c #727175", +"aN c #727272", +"aL c #736e86", +"aR c #747087", +".I c #747474", +"ck c #787779", +".D c #79758c", +"bs c #7a7a7a", +".y c #7b768d", +".L c #7d788f", +".d c #7d7990", +".T c #807b91", +"cp c #807b92", +"#6 c #808000", +"#7 c #808080", +"#2 c #827e93", +"bj c #837e96", +".c c #837f94", +".l c #848095", +"bJ c #848387", +"aP c #848486", +".1 c #868689", +"bk c #86868a", +"bY c #898599", +".# c #8b889b", +"#z c #8b8b8b", +"bL c #8d899c", +"bh c #908c9f", +"#M c #918da0", +".W c #929292", +"aD c #9390a2", +"#a c #939393", +".r c #9490a2", +"ba c #95929e", +"#J c #9692a4", +"bw c #969699", +"cE c #9793a6", +"#9 c #9894a7", +".e c #9995a7", +".4 c #9c98aa", +".a c #9c99aa", +"#T c #9d99aa", +"an c #9d9d9d", +"bz c #a29eaf", +"ci c #a29faf", +".F c #a2a2a2", +"bF c #a5a2b2", +"#1 c #a6a6a7", +"bH c #a8a5b4", +"cf c #aaabab", +".p c #aba8b6", +"a8 c #aba8b7", +".b c #adaab9", +"ay c #aeacb9", +"a4 c #aeaeae", +"bp c #afafb0", +"cq c #b0adbb", +"ch c #b0aebb", +"a. c #b1aebb", +"bV c #b1aebc", +"bR c #b4b5b5", +"b6 c #b6b4c1", +"aC c #b7b5c1", +"#N c #b8b5c1", +"bC c #b8b7b9", +"#m c #b8b8b8", +"cw c #bab8c4", +"aE c #bbbbbb", +".O c #bcbac5", +".N c #bcbac6", +"bW c #bdbbc6", +".Y c #bfbfbf", +".M c #c0bec8", +"aj c #c0c000", +"#r c #c1bec9", +"cx c #c1bfca", +"#f c #c2c2c2", +"am c #c3c1cb", +".9 c #c4c2cd", +".s c #c4c4c4", +"bi c #c8c6d0", +"a3 c #c8c8c8", +"bt c #c8c8c9", +"at c #c9c7d0", +".B c #cbcacc", +"#W c #cbcbcb", +"aQ c #cccbd3", +".S c #cccccc", +".g c #cdcbd4", +"bK c #cdcdcd", +"cB c #ceccd5", +".n c #cfced6", +"cz c #d0ced6", +".i c #d1d0d8", +"#O c #d1d1d1", +"#q c #d3d3d3", +".q c #d5d3db", +"#x c #d5d4db", +"cc c #d5d5d5", +"aM c #d8d8d8", +".3 c #d9d7de", +"#K c #d9d8de", +"b9 c #dad8df", +"#j c #dadada", +"#U c #dbd9e0", +"#g c #dbdae0", +".6 c #dddddd", +".A c #dedee1", +"cu c #dfdee3", +"#5 c #dfdfe1", +"#X c #e0e0e0", +"cy c #e0e0e5", +"a0 c #e3e1e6", +"bU c #e3e3e3", +"cb c #e4e3e8", +"bD c #e4e4e4", +"ct c #e6e5ea", +"aY c #e8e6ea", +"cr c #e8e7eb", +"cj c #e9e8e9", +"#V c #e9e9e9", +"#4 c #eaeaed", +"bm c #ecebee", +"bP c #ececec", +"bZ c #ededed", +".C c #eeeef1", +".v c #eeefee", +".x c #efefef", +"bB c #f0f0f1", +"## c #f0f0f2", +"a9 c #f1f0f3", +"au c #f1f1f1", +".k c #f1f1f3", +".V c #f2f2f4", +"bg c #f4f3f5", +"aJ c #f4f4f6", +"c. c #f5f4f6", +"b3 c #f5f5f5", +"b7 c #f5f5f6", +".H c #f5f6f5", +"aX c #f6f6f6", +"#i c #f6f6f7", +"bf c #f7f6f7", +"bA c #f7f6f8", +"#y c #f7f7f7", +"#L c #f7f7f8", +"av c #f8f8f8", +"by c #f8f8f9", +"bx c #fafafa", +"co c #fafafb", +".w c #fbfbfb", +".E c #fbfbfc", +".h c #fcfcfc", +".5 c #fdfcfd", +"a7 c #fdfcfe", +"bE c #fdfdfd", +".2 c #fefdfe", +"az c #fefefe", +"#S c #fefeff", +"#C c #ffff00", +".j c #ffffff", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQt.#Qt.a.b.cQtQt.d.eQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.f.g.h.gQt.i.j.k.l.m.j.j.j.n.oQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.p.j.j.qQt.r.j.s.t.u.v.j.w.x.yQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQt.z.A.B.CQt.D.E.F.G.G.H.w.I.J.K.L.MQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQt.N.w.O.P.Q.R.S.T.U.V.W.G.X.j.Y.Z.G.0.1.2.3QtQtQtQtQtQtQtQtQtQt", +"QtQtQtQt.4.5.j.6.7.G.G.8.9#.###a.G#b.j#c#d.G#e#f.j#gQtQtQtQtQtQtQtQtQtQt", +"QtQtQt#h#i.j.j#j#k.G.G#l#m#n#o#d.G.G.G#p#p#l#q#r#s#t#u#vQtQtQtQtQtQtQtQt", +"QtQt#w#x.j.j.j.j#y#z#A.G#B.G.G.G#C#C#D#E#F#G#H#I#J#K#L#MQtQtQtQtQtQtQtQt", +"QtQt#N.j.j.j.j.j.j.h#O#P.G.G#Q.G#C#C#Q.G.G.G#d#R#S.j.j#TQtQtQtQtQtQtQtQt", +"QtQt#U.j.j#V#q.S#W#X#Y.G.G.G#Z.G.G.G.G.G.G.G.G#d#0#1.E#2QtQtQtQtQtQtQtQt", +"Qt#3#4.j#5#B.G.G.G.G.G.G.G.G#Z.G.G.G.G#6#C#7.G.G.G#8#9QtQtQtQtQtQtQtQtQt", +"Qt#u.ba.a#aa.G.G.G.G.Gabac.G#Z.G.Gad#6#C#6#7#7.G.GQtQtQtQtQtQtQtQtQtQtQt", +"QtQtaeafag.Gah.G.G.G.G.Gai.G#Z.G#6aj#C#6.Gakaj#C.GalQtQtQtQtQtQtQtQtQtQt", +"Qtam.j.janaoaoapaqao#C#C.G.G.G#6aj#Cajad.Gar#Caj.GasQtQtQtQtQtQtQtQtQtQt", +"Qtat.j.jauav.j.j.j.G#C#Caw.G.Gaj#Caj#6.G.Gar#7#7.GaxQtQtQtQtQtQtQtQtQtQt", +"Qtay.j.j.j.jaz.j.jaA.G.GaB.G.G#6aj#6.G.G.Gar#7#7.G.GaC.lQtQtQtQtQtQtQtQt", +"QtaD.j.jaz.j.waEaFaG.G.G.G.G.G.G.G.G.G.G.GaH#7.G.GaIazaJaKQtQtQtQtQtQtQt", +"QtaL.j.j.jaMaNaO.G.G.G.G.G.G.G.G.G.G.G.G.G.G.G.G.GaP.j.jaQaRQtQtQtQtQtQt", +"QtaS#i.j.waT.G.G.G.GaU#B.G.G.G.G#C#Cab.G.GaV.G.G.GaWaX.j.jaYaZQtQtQtQtQt", +"QtQta0.j.ja1.G#d.Ga2a3a4a5.G.G.G#C#C.G.G.GaV.G.G.G.Ga6a7.j.j.kaZQtQtQtQt", +"QtQta8.ja9b.b#.G.Ga4az.jbabb.G.G.G.G.G.G.G.Gbcbd.G.G.Gbebf.j.jbgbhQtQtQt", +"QtQtaZbi.objbkbl.8.j.jbmbnbobp.Wbq.G.G.Gbrbsbtbu.G.G.Gbvbwbx.j.jby.bQtQt", +"QtQtQtQtbzbAbBbCbDbE.jbFbGbH.jaXbq.G.G#dbI.j.jbJ.G.G#d.G.ZbK.j.j.hbLQtQt", +"QtQtQtbM.k.j.j.j.j.j.jbNbO.j.jbPap.G.GbQ#c.j.jbRbS.G.G.GbTbU.j.jbVQtQtQt", +"QtQtQtQtQt.k.j.j.j.jbWbXbY.j.jbZb0.G.Gb1b2.j.jb3b4.G.Gb5b6.jb7.DQtQtQtQt", +"QtQtQtQtQtb8b9.h.jc.c#cacb.j.jcccd.G.GbQce.j.j.jcfbIcgQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtch.EciQt#w.j.j.jcjckceclcmcn.j.j.jazcocpQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtcq.j.j.j.j.jcrcsct.j.j.j.j.hcucvQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtcwcxcy.E.j.jczcAcB.j.j.j.3bY#sQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtcCQtQtQtQtQtcDcEbYQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt", +"QtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQtQt"}; diff --git a/SpiralSound/Plugins/EchoPlugin/EchoPlugin.C b/SpiralSound/Plugins/EchoPlugin/EchoPlugin.C new file mode 100644 index 0000000..21738dd --- /dev/null +++ b/SpiralSound/Plugins/EchoPlugin/EchoPlugin.C @@ -0,0 +1,125 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "EchoPlugin.h" +#include "EchoPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +static const float MAX_DELAY=1.0f; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new EchoPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x000e; +} +} + +/////////////////////////////////////////////////////// + +EchoPlugin::EchoPlugin() : +m_Delay(0.75), +m_Feedback(0.4), +m_HeadPos(0) +{ + m_PluginInfo.Name="Echo"; + m_PluginInfo.Width=120; + m_PluginInfo.Height=110; + m_PluginInfo.NumInputs=3; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Delay CV"); + m_PluginInfo.PortTips.push_back("Feedback CV"); + m_PluginInfo.PortTips.push_back("Output"); +} + +EchoPlugin::~EchoPlugin() +{ +} + +PluginInfo &EchoPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + m_Buffer.Allocate((int)(m_HostInfo->SAMPLERATE*MAX_DELAY)); + return Info; +} + +SpiralGUIType *EchoPlugin::CreateGUI() +{ + m_GUI = new EchoPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void EchoPlugin::Execute() +{ + float Delay; + + for (int n=0; nBUFSIZE; n++) + { + Delay=(m_Delay+GetInput(1,n)*0.5)*(float)m_HostInfo->SAMPLERATE-1; + + if (Delay>=MAX_DELAY*m_HostInfo->SAMPLERATE) + { + Delay=(MAX_DELAY*m_HostInfo->SAMPLERATE)-1; + } + + if (Delay<0) Delay=0; + + if (m_HeadPos>Delay) + { + m_HeadPos=0; + } + + // Write to the buffer + m_Buffer.Set(m_HeadPos,GetInput(0,n)+(m_Buffer[m_HeadPos]*(m_Feedback+GetInput(2,n)))); + + // Read from the buffer + SetOutput(0,n,m_Buffer[m_HeadPos]); + + m_HeadPos++; + } + +} + +void EchoPlugin::Randomise() +{ +} + +void EchoPlugin::StreamOut(ostream &s) +{ + s<>version; + s>>m_Delay>>m_Feedback; +} diff --git a/SpiralSound/Plugins/EchoPlugin/EchoPlugin.h b/SpiralSound/Plugins/EchoPlugin/EchoPlugin.h new file mode 100644 index 0000000..729010f --- /dev/null +++ b/SpiralSound/Plugins/EchoPlugin/EchoPlugin.h @@ -0,0 +1,61 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef ECHOPLUGIN +#define ECHOPLUGIN + +class EchoPlugin : public SpiralPlugin +{ +public: + EchoPlugin(); + virtual ~EchoPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + + void SetDelay(float s) { m_Delay=s; } + void SetFeedback(float s) { m_Feedback=s; } + float GetDelay() { return m_Delay; } + float GetFeedback() { return m_Feedback; } + + void Randomise(); + +private: + float m_Delay; + float m_Feedback; + + int m_HeadPos; + Sample m_Buffer; + + friend istream &operator>>(istream &s, EchoPlugin &o); + friend ostream &operator<<(ostream &s, EchoPlugin &o); +}; +istream &operator>>(istream &s, EchoPlugin &o); +ostream &operator<<(ostream &s, EchoPlugin &o); + +#endif diff --git a/SpiralSound/Plugins/EchoPlugin/EchoPlugin.pro b/SpiralSound/Plugins/EchoPlugin/EchoPlugin.pro new file mode 100644 index 0000000..c85fd32 --- /dev/null +++ b/SpiralSound/Plugins/EchoPlugin/EchoPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + EchoPlugin.h \ + EchoPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + EchoPlugin.C \ + EchoPluginGUI.C + +TARGET = EchoPlugin.so diff --git a/SpiralSound/Plugins/EchoPlugin/EchoPluginGUI.C b/SpiralSound/Plugins/EchoPlugin/EchoPluginGUI.C new file mode 100644 index 0000000..243cd23 --- /dev/null +++ b/SpiralSound/Plugins/EchoPlugin/EchoPluginGUI.C @@ -0,0 +1,135 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "EchoPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +EchoPluginGUI::EchoPluginGUI(int w, int h,EchoPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_Delay = new Fl_Slider(15, 20, 20, 70, "Delay"); + m_Delay->type(4); + m_Delay->selection_color(GUI_COLOUR); + m_Delay->labelsize(10); + m_Delay->maximum(1); + m_Delay->step(0.001); + m_Delay->value(0.5); + m_Delay->callback((Fl_Callback*)cb_Delay); + + m_Feedback = new Fl_Slider(75, 20, 20, 70, "Feedback"); + m_Feedback->type(4); + m_Feedback->selection_color(GUI_COLOUR); + m_Feedback->labelsize(10); + m_Feedback->maximum(1.1); + m_Feedback->step(0.01); + m_Feedback->value(0.4); + m_Feedback->callback((Fl_Callback*)cb_Feedback); + + m_pop = new Fl_Button(1,h-14, 13, 13, "@>"); + m_pop->type(1); + m_pop->box(FL_FLAT_BOX); + m_pop->down_box(FL_FLAT_BOX); + m_pop->labeltype(FL_SYMBOL_LABEL); + m_pop->labelsize(10); + m_pop->labelcolor(25); + m_pop->callback((Fl_Callback*)cb_pop); + + m_out_delay = new Fl_Output(50, h+5, 55, 15, "Delay"); + m_out_delay->box(FL_ENGRAVED_BOX); + m_out_delay->color(16); + m_out_delay->labelsize(10); + m_out_delay->textsize(10); + m_out_delay->hide(); + m_out_delay->set_output(); + + m_out_feedback = new Fl_Output(50, h+22, 55, 15, "Feedback"); + m_out_feedback->box(FL_ENGRAVED_BOX); + m_out_feedback->color(16); + m_out_feedback->labelsize(10); + m_out_feedback->textsize(10); + m_out_feedback->hide(); + m_out_feedback->set_output(); + + end(); +} + +extern "C" int sprintf(char *,const char *,...); + +void EchoPluginGUI::UpdateValues() +{ + m_Delay->value(1.0f-m_Plugin->GetDelay()); + m_Feedback->value(1.1f-m_Plugin->GetFeedback()); + char str[10]; + sprintf(str,"%5.3f s", m_Plugin->GetDelay()); + m_out_delay->value(str); + sprintf(str,"%5.1f %%", 100*m_Plugin->GetFeedback()); + m_out_feedback->value(str); +} + +inline void EchoPluginGUI::cb_Delay_i(Fl_Slider* o, void* v) +{ +char str[10]; +float value=1.0f-o->value(); + m_Plugin->SetDelay(value); + sprintf(str,"%5.3f s", value); + m_out_delay->value(str); +} + +void EchoPluginGUI::cb_Delay(Fl_Slider* o, void* v) +{ ((EchoPluginGUI*)(o->parent()))->cb_Delay_i(o,v); } + +inline void EchoPluginGUI::cb_Feedback_i(Fl_Slider* o, void* v) +{ +char str[10]; + m_Plugin->SetFeedback(1.1f-o->value()); + sprintf(str,"%5.1f %%", 100*(1.1f-o->value())); + m_out_feedback->value(str); +} + +void EchoPluginGUI::cb_Feedback(Fl_Slider* o, void* v) +{ ((EchoPluginGUI*)(o->parent()))->cb_Feedback_i(o,v); } + +inline void EchoPluginGUI::cb_pop_i(Fl_Button *o, void*) { + if (o->value()) + { + o->label("@2>"); + m_out_delay->show(); + m_out_feedback->show(); + redraw(); + } + else + { + o->label("@>"); + m_out_delay->hide(); + m_out_feedback->hide(); + redraw(); + parent()->redraw(); + } +} +void EchoPluginGUI::cb_pop(Fl_Button* o, void* v) { + ((EchoPluginGUI*)(o->parent()))->cb_pop_i(o,v); +} diff --git a/SpiralSound/Plugins/EchoPlugin/EchoPluginGUI.h b/SpiralSound/Plugins/EchoPlugin/EchoPluginGUI.h new file mode 100644 index 0000000..a4d9d39 --- /dev/null +++ b/SpiralSound/Plugins/EchoPlugin/EchoPluginGUI.h @@ -0,0 +1,63 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "EchoPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" + +#ifndef FilterGUI +#define FilterGUI + + +class EchoPluginGUI : public SpiralPluginGUI +{ +public: + EchoPluginGUI(int w, int h, EchoPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + EchoPlugin *m_Plugin; + +private: + + Fl_Slider *m_Delay; + Fl_Slider *m_Feedback; + Fl_Button *m_pop; + Fl_Output *m_out_delay; + Fl_Output *m_out_feedback; + + //// Callbacks //// + + inline void cb_Delay_i(Fl_Slider* o, void* v); + static void cb_Delay(Fl_Slider*, void*); + inline void cb_Feedback_i(Fl_Slider* o, void* v); + static void cb_Feedback(Fl_Slider* o, void* v); + inline void cb_pop_i(Fl_Button* o, void*); + static void cb_pop(Fl_Button* o, void*); +}; + +#endif diff --git a/SpiralSound/Plugins/EchoPlugin/Makefile.in b/SpiralSound/Plugins/EchoPlugin/Makefile.in new file mode 100644 index 0000000..611e56d --- /dev/null +++ b/SpiralSound/Plugins/EchoPlugin/Makefile.in @@ -0,0 +1,166 @@ +############################################################################# +# Makefile for building EchoPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: EchoPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + EchoPlugin.h \ + EchoPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + EchoPlugin.C \ + EchoPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + EchoPlugin.o \ + EchoPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = EchoPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake EchoPlugin.pro + +dist: + $(TAR) EchoPlugin.tar EchoPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) EchoPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +EchoPlugin.o: EchoPlugin.C \ + EchoPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + EchoPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + SpiralIcon.xpm + +EchoPluginGUI.o: EchoPluginGUI.C \ + EchoPluginGUI.h \ + EchoPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H + diff --git a/SpiralSound/Plugins/EchoPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/EchoPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..f723e46 --- /dev/null +++ b/SpiralSound/Plugins/EchoPlugin/SpiralIcon.xpm @@ -0,0 +1,341 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 302 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #2D2F00", +"!. c #101100", +"~. c #090A00", +"{. c #0C0C00", +"]. c #070800", +"^. c #030300", +"/. c #727175", +"(. c #FEFEFF", +"_. c #9D99AA", +":. c #DBD9E0", +"<. c #E9E9E9", +"[. c #CBCBCB", +"}. c #E0E0E0", +"|. c #6C6C6C", +"1. c #CCC200", +"2. c #CCC100", +"3. c #030400", +"4. c #0E0F00", +"5. c #515151", +"6. c #A6A6A7", +"7. c #827E93", +"8. c #615C77", +"9. c #EAEAED", +"0. c #DFDFE1", +"a. c #EADE00", +"b. c #1E1D24", +"c. c #9894A7", +"d. c #B1AEBB", +"e. c #69686F", +"f. c #000001", +"g. c #615C76", +"h. c #5F5A75", +"i. c #413E4D", +"j. c #020203", +"k. c #706A00", +"l. c #131314", +"m. c #C3C1CB", +"n. c #9D9D9D", +"o. c #202020", +"p. c #383838", +"q. c #4C4C4C", +"r. c #080808", +"s. c #E7DB00", +"t. c #09090A", +"u. c #C9C7D0", +"v. c #F1F1F1", +"w. c #F8F8F8", +"x. c #070707", +"y. c #B1A700", +"z. c #020103", +"A. c #AEACB9", +"B. c #FEFEFE", +"C. c #0A0A0A", +"D. c #E8DC00", +"E. c #E0D400", +"F. c #BFB500", +"G. c #D1C600", +"H. c #B7B5C1", +"I. c #9390A2", +"J. c #BBBBBB", +"K. c #414141", +"L. c #020202", +"M. c #131400", +"N. c #807900", +"O. c #FDF000", +"P. c #FFF200", +"Q. c #999100", +"R. c #1D1C1E", +"S. c #F4F4F6", +"T. c #605B76", +"U. c #736E86", +"V. c #D8D8D8", +"W. c #727272", +"X. c #101010", +"Y. c #1E1C00", +"Z. c #8F8700", +"`. c #918900", +" + c #8E8600", +".+ c #090900", +"++ c #848486", +"@+ c #CCCBD3", +"#+ c #747087", +"$+ c #6D6881", +"%+ c #1C1C1C", +"&+ c #242424", +"*+ c #656566", +"=+ c #F6F6F6", +"-+ c #E8E6EA", +";+ c #706B84", +">+ c #E3E1E6", +",+ c #474746", +"'+ c #151515", +")+ c #C8C8C8", +"!+ c #AEAEAE", +"~+ c #010100", +"{+ c #373639", +"]+ c #FDFCFE", +"^+ c #ABA8B7", +"/+ c #F1F0F3", +"(+ c #6D6980", +"_+ c #0A090E", +":+ c #95929E", +"<+ c #0A0810", +"[+ c #0D0D0D", +"}+ c #050505", +"|+ c #5B5A5C", +"1+ c #F7F6F7", +"2+ c #F4F3F5", +"3+ c #908C9F", +"4+ c #C8C6D0", +"5+ c #837E96", +"6+ c #86868A", +"7+ c #070608", +"8+ c #ECEBEE", +"9+ c #5B5571", +"0+ c #646078", +"a+ c #AFAFB0", +"b+ c #454545", +"c+ c #363636", +"d+ c #7A7A7A", +"e+ c #C8C8C9", +"f+ c #212025", +"g+ c #060607", +"h+ c #969699", +"i+ c #FAFAFA", +"j+ c #F8F8F9", +"k+ c #A29EAF", +"l+ c #F7F6F8", +"m+ c #F0F0F1", +"n+ c #B8B7B9", +"o+ c #E4E4E4", +"p+ c #FDFDFD", +"q+ c #A5A2B2", +"r+ c #3B3456", +"s+ c #A8A5B4", +"t+ c #525252", +"u+ c #848387", +"v+ c #CDCDCD", +"w+ c #8D899C", +"x+ c #494262", +"y+ c #68627C", +"z+ c #40395A", +"A+ c #ECECEC", +"B+ c #B4B5B5", +"C+ c #0B0B0B", +"D+ c #313232", +"E+ c #E3E3E3", +"F+ c #B1AEBC", +"G+ c #BDBBC6", +"H+ c #3C3556", +"I+ c #898599", +"J+ c #EDEDED", +"K+ c #39393A", +"L+ c #040404", +"M+ c #333333", +"N+ c #F5F5F5", +"O+ c #2B2B2B", +"P+ c #2D2A3D", +"Q+ c #B6B4C1", +"R+ c #F5F5F6", +"S+ c #605A76", +"T+ c #DAD8DF", +"U+ c #F5F4F6", +"V+ c #615B76", +"W+ c #524D6A", +"X+ c #E4E3E8", +"Y+ c #D5D5D5", +"Z+ c #1B1B1B", +"`+ c #303030", +" @ c #AAABAB", +".@ c #585464", +"+@ c #B0AEBB", +"@@ c #A29FAF", +"#@ c #E9E8E9", +"$@ c #787779", +"%@ c #0F0E15", +"&@ c #2D2D2E", +"*@ c #595959", +"=@ c #FAFAFB", +"-@ c #807B92", +";@ c #B0ADBB", +">@ c #E8E7EB", +",@ c #3A3258", +"'@ c #E6E5EA", +")@ c #DFDEE3", +"!@ c #443E5E", +"~@ c #BAB8C4", +"{@ c #C1BFCA", +"]@ c #E0E0E5", +"^@ c #D0CED6", +"/@ c #362F52", +"(@ c #CECCD5", +"_@ c #413A5B", +":@ c #6A657F", +"<@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.{.].6 ^.6 6 6 E /.(.; ; _. ", +" :.; ; <.R h [.}.|.6 1.2.6 6 6 3.4.6 6 6 6 E 5.6.4 7. ", +" 8.9.; 0...6 6 6 6 6 6 a.a.6 6 6 6 6 6 6 6 6 6 6 b.c. ", +" V @ d.e.f.6 6 6 6 6 6 a.a.6 2.2.6 6 6 6 6 6 6 6 ", +" g.h.i.6 j.6 6 6 6 6 a.a.6 a.a.6 k.k.6 6 6 6 6 l. ", +" m.; ; n.o.o.p.q.r.6 6 a.a.6 a.a.6 s.s.6 6 6 6 6 t. ", +" u.; ; v.w.; ; ; x.6 6 a.a.6 a.a.6 a.a.6 y.y.6 6 z. ", +" A.; ; ; ; B.; ; C.6 6 D.D.6 E.E.6 F.F.6 G.G.6 6 6 H., ", +" I.; ; B.; : J.K.L.M.N.O.O.O.O.O.O.P.P.P.P.P.Q.!.R.B.S.T. ", +" U.; ; ; V.W.X.6 6 6 Y.Z.`.`.`.`. +Y.6 6 6 6 .+4.++; ; @+#+ ", +" $+J ; : %+6 6 6 6 &+r.6 6 6 6 6 6 6 6 6 6 6 6 6 *+=+; ; -+;+ ", +" >+; ; ,+6 E 6 '+)+!+r.6 6 6 6 6 6 6 6 ~+6 6 6 6 {+]+; ; > ;+ ", +" ^+; /+(+_+6 6 !+B.; :+<+6 6 6 6 6 6 6 6 [+}+6 6 6 |+1+; ; 2+3+ ", +" ;+4+! 5+6+7+x ; ; 8+9+0+a+l b+6 6 6 c+d+e+f+6 6 6 g+h+i+; ; j+@ ", +" k+l+m+n+o+p+; q+r+s+; =+b+6 6 E t+; ; u+6 6 E 6 o v+; ; = w+ ", +" x+> ; ; ; ; ; ; y+z+; ; A+p.6 6 L.D ; ; B+C+6 6 6 D+E+; ; F+ ", +" > ; ; ; ; G+H+I+; ; J+K+6 6 L+M+; ; N+O+6 6 P+Q+; R+3 ", +" S+T+= ; U+V+W+X+; ; Y+Z+6 6 L.`+; ; ; @t+.@ ", +" +@4 @@ X ; ; ; #@$@`+%@&@*@; ; ; B.=@-@ ", +" ;@; ; ; ; ; >@,@'@; ; ; ; = )@!@ ", +" ~@{@]@4 ; ; ^@/@(@; ; ; s I+T ", +" _@ :@<@I+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/Edit.sh b/SpiralSound/Plugins/Edit.sh new file mode 100755 index 0000000..c501616 --- /dev/null +++ b/SpiralSound/Plugins/Edit.sh @@ -0,0 +1,10 @@ +#! /bin/sh + +for file in `cat PluginList.txt` +do +echo $file +cd $file/ +nedit $file.h +nedit $file.C +cd .. +done diff --git a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.C b/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.C new file mode 100644 index 0000000..b7bdca8 --- /dev/null +++ b/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.C @@ -0,0 +1,98 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "EnvFollowerPlugin.h" +#include "EnvFollowerPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new EnvFollowerPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0013; +} +} + +/////////////////////////////////////////////////////// + +EnvFollowerPlugin::EnvFollowerPlugin() : +m_Attack(0.5), +m_Decay(0.5), +m_Value(0) +{ + m_PluginInfo.Name="EnvFollower"; + m_PluginInfo.Width=140; + m_PluginInfo.Height=100; + m_PluginInfo.NumInputs=1; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Output"); +} + +EnvFollowerPlugin::~EnvFollowerPlugin() +{ +} + +PluginInfo &EnvFollowerPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *EnvFollowerPlugin::CreateGUI() +{ + m_GUI = new EnvFollowerPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void EnvFollowerPlugin::Execute() +{ + float Value; + for (int n=0; nBUFSIZE; n++) + { + Value = fabs(GetInput(0,n)); + + if (Value>m_Value) m_Value+=(m_Attack*100); + else m_Value-=(m_Decay*100); + + SetOutput(0,n,m_Value); + } +} + +void EnvFollowerPlugin::StreamOut(ostream &s) +{ + s<>m_Version; + s>>m_Attack>>m_Decay; +} diff --git a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.h b/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.h new file mode 100644 index 0000000..7eb21b9 --- /dev/null +++ b/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.h @@ -0,0 +1,51 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef EnvFollowerPLUGIN +#define EnvFollowerPLUGIN + +class EnvFollowerPlugin : public SpiralPlugin +{ +public: + EnvFollowerPlugin(); + virtual ~EnvFollowerPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetAttack(float v) { m_Attack=v; } + float GetAttack() { return m_Attack; } + void SetDecay(float v) { m_Decay=v; } + float GetDecay() { return m_Decay; } + +private: + float m_Attack; + float m_Decay; + float m_Value; +}; + +#endif diff --git a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.pro b/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.pro new file mode 100644 index 0000000..fc987ec --- /dev/null +++ b/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + EnvFollowerPlugin.h \ + EnvFollowerPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + EnvFollowerPlugin.C \ + EnvFollowerPluginGUI.C + +TARGET = EnvFollowerPlugin.so diff --git a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPluginGUI.C b/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPluginGUI.C new file mode 100644 index 0000000..dcf596d --- /dev/null +++ b/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPluginGUI.C @@ -0,0 +1,73 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "EnvFollowerPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +EnvFollowerPluginGUI::EnvFollowerPluginGUI(int w, int h,EnvFollowerPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_Attack = new Fl_Knob(20, 25, 40, 40, "Attack"); + m_Attack->color(GUI_COLOUR); + m_Attack->type(Fl_Knob::DOTLIN); + m_Attack->labelsize(10); + m_Attack->maximum(1); + m_Attack->step(0.001); + m_Attack->value(0.5); + m_Attack->callback((Fl_Callback*)cb_Attack); + add(m_Attack); + + m_Decay = new Fl_Knob(75, 25, 40, 40, "Decay"); + m_Decay->color(GUI_COLOUR); + m_Decay->type(Fl_Knob::DOTLIN); + m_Decay->labelsize(10); + m_Decay->maximum(1); + m_Decay->step(0.001); + m_Decay->value(0.5); + m_Decay->callback((Fl_Callback*)cb_Decay); + add(m_Decay); + + end(); +} + + + +void EnvFollowerPluginGUI::UpdateValues() +{ + m_Attack->value(m_Plugin->GetAttack()); + m_Decay->value(m_Plugin->GetDecay()); +} + +inline void EnvFollowerPluginGUI::cb_Decay_i(Fl_Knob* o, void* v) +{ m_Plugin->SetDecay(o->value()); } +void EnvFollowerPluginGUI::cb_Decay(Fl_Knob* o, void* v) +{ ((EnvFollowerPluginGUI*)(o->parent()))->cb_Decay_i(o,v);} + +inline void EnvFollowerPluginGUI::cb_Attack_i(Fl_Knob* o, void* v) +{ m_Plugin->SetAttack(o->value()); } +void EnvFollowerPluginGUI::cb_Attack(Fl_Knob* o, void* v) +{ ((EnvFollowerPluginGUI*)(o->parent()))->cb_Attack_i(o,v);} diff --git a/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPluginGUI.h b/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPluginGUI.h new file mode 100644 index 0000000..e864a6c --- /dev/null +++ b/SpiralSound/Plugins/EnvFollowerPlugin/EnvFollowerPluginGUI.h @@ -0,0 +1,54 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "EnvFollowerPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef SplitterGUI +#define SplitterGUI + + +class EnvFollowerPluginGUI : public SpiralPluginGUI +{ +public: + EnvFollowerPluginGUI(int w, int h, EnvFollowerPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + EnvFollowerPlugin *m_Plugin; +private: + + Fl_Knob* m_Attack; + Fl_Knob* m_Decay; + + //// Callbacks //// + inline void cb_Attack_i(Fl_Knob* o, void* v); + static void cb_Attack(Fl_Knob* o, void* v); + inline void cb_Decay_i(Fl_Knob* o, void* v); + static void cb_Decay(Fl_Knob* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/EnvFollowerPlugin/Makefile.in b/SpiralSound/Plugins/EnvFollowerPlugin/Makefile.in new file mode 100644 index 0000000..f2ddda2 --- /dev/null +++ b/SpiralSound/Plugins/EnvFollowerPlugin/Makefile.in @@ -0,0 +1,168 @@ +############################################################################# +# Makefile for building EnvFollowerPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: EnvFollowerPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + EnvFollowerPlugin.h \ + EnvFollowerPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + EnvFollowerPlugin.C \ + EnvFollowerPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + EnvFollowerPlugin.o \ + EnvFollowerPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = EnvFollowerPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake EnvFollowerPlugin.pro + +dist: + $(TAR) EnvFollowerPlugin.tar EnvFollowerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) EnvFollowerPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +EnvFollowerPlugin.o: EnvFollowerPlugin.C \ + EnvFollowerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + EnvFollowerPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +EnvFollowerPluginGUI.o: EnvFollowerPluginGUI.C \ + EnvFollowerPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + EnvFollowerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/EnvFollowerPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/EnvFollowerPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..d9dfc0a --- /dev/null +++ b/SpiralSound/Plugins/EnvFollowerPlugin/SpiralIcon.xpm @@ -0,0 +1,321 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 282 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #252525", +"). c #040400", +"!. c #141500", +"~. c #727175", +"{. c #FEFEFF", +"]. c #9D99AA", +"^. c #DBD9E0", +"/. c #E9E9E9", +"(. c #CBCBCB", +"_. c #E0E0E0", +":. c #6C6C6C", +"<. c #010200", +"[. c #292B00", +"}. c #515151", +"|. c #A6A6A7", +"1. c #827E93", +"2. c #615C77", +"3. c #EAEAED", +"4. c #DFDFE1", +"5. c #EDFF00", +"6. c #1E1D24", +"7. c #9894A7", +"8. c #B1AEBB", +"9. c #69686F", +"0. c #000001", +"a. c #615C76", +"b. c #5F5A75", +"c. c #413E4D", +"d. c #020203", +"e. c #040500", +"f. c #050500", +"g. c #1A1A1C", +"h. c #C3C1CB", +"i. c #9D9D9D", +"j. c #202020", +"k. c #383838", +"l. c #4C4C4C", +"m. c #111112", +"n. c #C9C7D0", +"o. c #F1F1F1", +"p. c #F8F8F8", +"q. c #232323", +"r. c #050408", +"s. c #AEACB9", +"t. c #FEFEFE", +"u. c #1D1D1D", +"v. c #B7B5C1", +"w. c #9390A2", +"x. c #BBBBBB", +"y. c #414141", +"z. c #030303", +"A. c #28272A", +"B. c #F4F4F6", +"C. c #605B76", +"D. c #736E86", +"E. c #D8D8D8", +"F. c #727272", +"G. c #101010", +"H. c #848486", +"I. c #CCCBD3", +"J. c #747087", +"K. c #6D6881", +"L. c #1C1C1C", +"M. c #242424", +"N. c #656566", +"O. c #F6F6F6", +"P. c #E8E6EA", +"Q. c #706B84", +"R. c #E3E1E6", +"S. c #474746", +"T. c #151515", +"U. c #C8C8C8", +"V. c #AEAEAE", +"W. c #080808", +"X. c #010100", +"Y. c #373639", +"Z. c #FDFCFE", +"`. c #ABA8B7", +" + c #F1F0F3", +".+ c #6D6980", +"++ c #0A090E", +"@+ c #95929E", +"#+ c #0A0810", +"$+ c #0D0D0D", +"%+ c #050505", +"&+ c #5B5A5C", +"*+ c #F7F6F7", +"=+ c #F4F3F5", +"-+ c #908C9F", +";+ c #C8C6D0", +">+ c #837E96", +",+ c #86868A", +"'+ c #070608", +")+ c #ECEBEE", +"!+ c #5B5571", +"~+ c #646078", +"{+ c #AFAFB0", +"]+ c #454545", +"^+ c #363636", +"/+ c #7A7A7A", +"(+ c #C8C8C9", +"_+ c #212025", +":+ c #060607", +"<+ c #969699", +"[+ c #FAFAFA", +"}+ c #F8F8F9", +"|+ c #A29EAF", +"1+ c #F7F6F8", +"2+ c #F0F0F1", +"3+ c #B8B7B9", +"4+ c #E4E4E4", +"5+ c #FDFDFD", +"6+ c #A5A2B2", +"7+ c #3B3456", +"8+ c #A8A5B4", +"9+ c #525252", +"0+ c #848387", +"a+ c #CDCDCD", +"b+ c #8D899C", +"c+ c #494262", +"d+ c #68627C", +"e+ c #40395A", +"f+ c #ECECEC", +"g+ c #020202", +"h+ c #B4B5B5", +"i+ c #0B0B0B", +"j+ c #313232", +"k+ c #E3E3E3", +"l+ c #B1AEBC", +"m+ c #BDBBC6", +"n+ c #3C3556", +"o+ c #898599", +"p+ c #EDEDED", +"q+ c #39393A", +"r+ c #040404", +"s+ c #333333", +"t+ c #F5F5F5", +"u+ c #2B2B2B", +"v+ c #2D2A3D", +"w+ c #B6B4C1", +"x+ c #F5F5F6", +"y+ c #605A76", +"z+ c #DAD8DF", +"A+ c #F5F4F6", +"B+ c #615B76", +"C+ c #524D6A", +"D+ c #E4E3E8", +"E+ c #D5D5D5", +"F+ c #1B1B1B", +"G+ c #303030", +"H+ c #AAABAB", +"I+ c #585464", +"J+ c #B0AEBB", +"K+ c #A29FAF", +"L+ c #E9E8E9", +"M+ c #787779", +"N+ c #0F0E15", +"O+ c #2D2D2E", +"P+ c #595959", +"Q+ c #FAFAFB", +"R+ c #807B92", +"S+ c #B0ADBB", +"T+ c #E8E7EB", +"U+ c #3A3258", +"V+ c #E6E5EA", +"W+ c #DFDEE3", +"X+ c #443E5E", +"Y+ c #BAB8C4", +"Z+ c #C1BFCA", +"`+ c #E0E0E5", +" @ c #D0CED6", +".@ c #362F52", +"+@ c #CECCD5", +"@@ c #413A5B", +"#@ c #6A657F", +"$@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.6 6 ).6 6 !.).6 6 6 E ~.{.; ; ]. ", +" ^.; ; /.R h (._.:.6 6 6 <.6 6 6 6 6 [.6 6 E }.|.4 1. ", +" 2.3.; 4...6 6 6 6 6 6 6 5.5.5.6 6 6 6 6 6 6 6 6 6.7. ", +" V @ 8.9.0.6 6 6 6 6 5.5.6 <.6 5.5.6 6 6 6 6 6 6 ", +" a.b.c.6 d.6 6 6 6 6 e.6 5.6 6 6 5.5.5.f.6 6 6 g. ", +" h.; ; i.j.j.k.l.j.6 6 6 5.6 5.6 6 6 6 6 5.5.5.6 m. ", +" n.; ; o.p.; ; ; q.6 6 5.6 6 6 5.6 6 6 6 6 6 6 6 r. ", +" s.; ; ; ; t.; ; u.6 6 5.6 6 6 5.6 6 6 6 5.5.5.6 6 v., ", +" w.; ; t.; : x.y.z.6 5.6 6 6 6 6 5.6 5.5.6 6 6 6 A.t.B.C. ", +" D.; ; ; E.F.G.6 6 6 6 6 6 6 6 6 6 5.5.6 6 6 6 6 H.; ; I.J. ", +" K.J ; : L.6 6 6 6 M...6 6 6 6 6 6 6 6 6 6 6 6 6 N.O.; ; P.Q. ", +" R.; ; S.6 E 6 T.U.V.W.6 6 6 6 6 6 6 6 X.6 6 6 6 Y.Z.; ; > Q. ", +" `.; +.+++6 6 V.t.; @+#+6 6 6 6 6 6 6 6 $+%+6 6 6 &+*+; ; =+-+ ", +" Q.;+! >+,+'+x ; ; )+!+~+{+l ]+6 6 6 ^+/+(+_+6 6 6 :+<+[+; ; }+@ ", +" |+1+2+3+4+5+; 6+7+8+; O.]+6 6 E 9+; ; 0+6 6 E 6 o a+; ; = b+ ", +" c+> ; ; ; ; ; ; d+e+; ; f+k.6 6 g+D ; ; h+i+6 6 6 j+k+; ; l+ ", +" > ; ; ; ; m+n+o+; ; p+q+6 6 r+s+; ; t+u+6 6 v+w+; x+3 ", +" y+z+= ; A+B+C+D+; ; E+F+6 6 g+G+; ; ; H+9+I+ ", +" J+4 K+ X ; ; ; L+M+G+N+O+P+; ; ; t.Q+R+ ", +" S+; ; ; ; ; T+U+V+; ; ; ; = W+X+ ", +" Y+Z+`+4 ; ; @.@+@; ; ; s o+T ", +" @@ #@$@o+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.C b/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.C new file mode 100644 index 0000000..3be0aab --- /dev/null +++ b/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.C @@ -0,0 +1,188 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "EnvelopePlugin.h" +#include "EnvelopePluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new EnvelopePlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0005; +} +} + +/////////////////////////////////////////////////////// + +EnvelopePlugin::EnvelopePlugin() : +m_Trigger(false), +m_t(-1.0f), +m_Attack(0.0f), +m_Decay(0.5f), +m_Sustain(1.0f), +m_Release(1.0f), +m_Volume(0.5f), +m_TrigThresh(0.01) +{ + m_PluginInfo.Name="Envelope"; + m_PluginInfo.Width=142; + m_PluginInfo.Height=110; + m_PluginInfo.NumInputs=2; + m_PluginInfo.NumOutputs=2; + m_PluginInfo.PortTips.push_back("Trigger CV"); + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("CV"); + m_PluginInfo.PortTips.push_back("Output"); +} + +EnvelopePlugin::~EnvelopePlugin() +{ +} + +PluginInfo &EnvelopePlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + m_SampleTime=1.0/(float)(m_HostInfo->SAMPLERATE); + return Info; +} + +SpiralGUIType *EnvelopePlugin::CreateGUI() +{ + m_GUI = new EnvelopePluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void EnvelopePlugin::Execute() +{ + float temp=0; + bool Freeze=false; + + // Early out? + /*if (m_t<0 && (!m_Input[0] || m_Input[0]->IsEmpty())) + { + m_Output[0]->Zero(); + m_Output[1]->Zero(); + return; + }*/ + + for (int n=0; nBUFSIZE; n++) + { + // Check the trigger CV values + if (GetInput(0,n)>m_TrigThresh) + { + if (m_Trigger==false) + { + m_t=0.0f; + m_Trigger=true; + } + } + else + { + m_Trigger=false; + } + + // if we are in the envelope... + if (m_t>=0 && m_tm_Decay range + float nt=(m_t-m_Attack)/m_Decay; + + // volume between 1 and m_Sustain + temp=(1-nt)+(m_Sustain*nt); + } + else + // in the release + { + //if (n==0) cerr<<"in release"<m_Release range + float nt=(m_t-(m_Attack+m_Decay))/m_Release; + + // volume between m_Sustain and 0 + temp=m_Sustain*(1-nt); + + if (m_Release<0.2f) + { + temp=m_Sustain; + } + + if (m_Trigger) Freeze=true; + } + + temp*=m_Volume; + + SetOutput(0,n,temp); + SetOutput(1,n,GetInput(1,n)*temp); + + if (!Freeze) m_t+=m_SampleTime; + } + else + { + SetOutput(0,n,0); + SetOutput(1,n,0); + + // if we've run off the end + if (m_t>m_Attack+m_Decay+m_Release) + { + m_t=-1; + //m_Output[0]->Zero(); + //m_Output[1]->Zero(); + return; + } + + } + } +} + +void EnvelopePlugin::StreamOut(ostream &s) +{ + s<>version; + s>>m_Attack>>m_Decay>>m_Sustain>>m_Release>>m_Volume>>m_TrigThresh; +} diff --git a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.h b/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.h new file mode 100644 index 0000000..58f54f2 --- /dev/null +++ b/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.h @@ -0,0 +1,76 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef EnvelopePLUGIN +#define EnvelopePLUGIN + +static const int NUM_CHANNELS = 4; + +class EnvelopePlugin : public SpiralPlugin +{ +public: + EnvelopePlugin(); + virtual ~EnvelopePlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetAttack(float s) { m_Attack=s; } + void SetDecay(float s) { m_Decay=s; } + void SetSustain(float s) { m_Sustain=s; } + void SetRelease(float s) { m_Release=s; } + void SetVolume(float s) { m_Volume=s; } + void SetTrigThresh(float s) { m_TrigThresh=s; } + + float GetAttack() { return m_Attack; } + float GetDecay() { return m_Decay; } + float GetSustain() { return m_Sustain; } + float GetRelease() { return m_Release; } + float GetVolume() { return m_Volume; } + float GetTrigThresh() { return m_TrigThresh; } + +private: + // Voice specific parameters + bool m_Trigger; + float m_t; + + // Common voice parameters + float m_Attack; + float m_Decay; + float m_Sustain; + float m_Release; + float m_Volume; + float m_TrigThresh; + float m_SampleTime; + + friend istream &operator>>(istream &s, EnvelopePlugin &o); + friend ostream &operator<<(ostream &s, EnvelopePlugin &o); +}; +istream &operator>>(istream &s, EnvelopePlugin &o); +ostream &operator<<(ostream &s, EnvelopePlugin &o); + +#endif diff --git a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.pro b/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.pro new file mode 100644 index 0000000..b59a8c1 --- /dev/null +++ b/SpiralSound/Plugins/EnvelopePlugin/EnvelopePlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + EnvelopePlugin.h \ + EnvelopePluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + EnvelopePlugin.C \ + EnvelopePluginGUI.C + +TARGET = EnvelopePlugin.so diff --git a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePluginGUI.C b/SpiralSound/Plugins/EnvelopePlugin/EnvelopePluginGUI.C new file mode 100644 index 0000000..f19df7b --- /dev/null +++ b/SpiralSound/Plugins/EnvelopePlugin/EnvelopePluginGUI.C @@ -0,0 +1,275 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "EnvelopePluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; +static const float TIMED_SLIDER_MAX = 3.0f; + +//////////////////////////////////////////// + +EnvelopePluginGUI::EnvelopePluginGUI(int w, int h,EnvelopePlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + Thresh = new Fl_Slider(10, 20, 20, 70, "T"); + Thresh->type(4); + Thresh->selection_color(GUI_COLOUR); + Thresh->labelsize(10); + Thresh->maximum(1.0); + Thresh->step(0.01); + Thresh->value(0.98f); + Thresh->callback((Fl_Callback*)cb_Thresh); + add(Thresh); + + Attack = new Fl_Slider(30, 20, 20, 70, "A"); + Attack->type(4); + Attack->selection_color(GUI_COLOUR); + Attack->labelsize(10); + Attack->maximum(TIMED_SLIDER_MAX); + Attack->step(0.01); + Attack->value(1.0f); + Attack->callback((Fl_Callback*)cb_Attack); + add(Attack); + + Decay = new Fl_Slider(50, 20, 20, 70, "D"); + Decay->type(4); + Decay->selection_color(GUI_COLOUR); + Decay->labelsize(10); + Decay->maximum(TIMED_SLIDER_MAX); + Decay->step(0.01); + Decay->value(0.1); + Decay->callback((Fl_Callback*)cb_Decay); + add(Decay); + + Sustain = new Fl_Slider(70, 20, 20, 70, "S"); + Sustain->type(4); + Sustain->selection_color(GUI_COLOUR); + Sustain->labelsize(10); + Sustain->maximum(1); + Sustain->step(0.01); + Sustain->value(0.5); + Sustain->callback((Fl_Callback*)cb_Sustain); + add(Sustain); + + Release = new Fl_Slider(90, 20, 20, 70, "R"); + Release->type(4); + Release->selection_color(GUI_COLOUR); + Release->labelsize(10); + Release->maximum(TIMED_SLIDER_MAX); + Release->step(0.01); + Release->value(0.5); + Release->callback((Fl_Callback*)cb_Release); + add(Release); + + Volume = new Fl_Slider(110, 20, 20, 70, "V"); + Volume->type(4); + Volume->selection_color(GUI_COLOUR); + Volume->labelsize(10); + Volume->maximum(1); + Volume->step(0.01); + Volume->value(0.5f); + Volume->callback((Fl_Callback*)cb_Volume); + add(Volume); + + m_pop = new Fl_Button(1,h-14, 13, 13, "@>"); + m_pop->type(1); + m_pop->box(FL_FLAT_BOX); + m_pop->down_box(FL_FLAT_BOX); + m_pop->labeltype(FL_SYMBOL_LABEL); + m_pop->labelsize(10); + m_pop->labelcolor(25); + m_pop->callback((Fl_Callback*)cb_pop); + + m_out_thresh = new Fl_Output(15,h+5, 48, 15, "T"); + m_out_thresh->box(FL_ENGRAVED_BOX); + m_out_thresh->color(16); + m_out_thresh->labelsize(10); + m_out_thresh->textsize(10); + m_out_thresh->hide(); + m_out_thresh->set_output(); + + m_out_attack = new Fl_Output(15,h+22, 48, 15, "A"); + m_out_attack->box(FL_ENGRAVED_BOX); + m_out_attack->color(16); + m_out_attack->labelsize(10); + m_out_attack->textsize(10); + m_out_attack->hide(); + m_out_attack->set_output(); + + m_out_decay = new Fl_Output(15,h+39, 48, 15, "D"); + m_out_decay->box(FL_ENGRAVED_BOX); + m_out_decay->color(16); + m_out_decay->labelsize(10); + m_out_decay->textsize(10); + m_out_decay->hide(); + m_out_decay->set_output(); + + m_out_sustain = new Fl_Output(87,h+5, 48, 15, "S"); + m_out_sustain->box(FL_ENGRAVED_BOX); + m_out_sustain->color(16); + m_out_sustain->labelsize(10); + m_out_sustain->textsize(10); + m_out_sustain->hide(); + m_out_sustain->set_output(); + + m_out_release = new Fl_Output(87,h+22, 48, 15, "R"); + m_out_release->box(FL_ENGRAVED_BOX); + m_out_release->color(16); + m_out_release->labelsize(10); + m_out_release->textsize(10); + m_out_release->hide(); + m_out_release->set_output(); + + m_out_volume = new Fl_Output(87,h+39, 48, 15, "V"); + m_out_volume->box(FL_ENGRAVED_BOX); + m_out_volume->color(16); + m_out_volume->labelsize(10); + m_out_volume->textsize(10); + m_out_volume->hide(); + m_out_volume->set_output(); + + end(); +} + +extern "C" int sprintf(char *,const char *,...); + +void EnvelopePluginGUI::UpdateValues() +{ + Thresh->value(1.0f-sqrt(m_Plugin->GetAttack())); + Attack->value(TIMED_SLIDER_MAX-sqrt(m_Plugin->GetAttack())); + Decay->value(TIMED_SLIDER_MAX-sqrt(m_Plugin->GetDecay())); + Sustain->value(1.0f-m_Plugin->GetSustain()); + Release->value(TIMED_SLIDER_MAX-sqrt(m_Plugin->GetRelease())); + Volume->value(1.0f-m_Plugin->GetVolume()); + char str[10]; + sprintf(str,"%4.0f %%", 100*m_Plugin->GetTrigThresh()); + m_out_thresh->value(str); + sprintf(str,"%5.3f s", m_Plugin->GetAttack()); + m_out_attack->value(str); + sprintf(str,"%5.3f s", m_Plugin->GetDecay()); + m_out_decay->value(str); + sprintf(str,"%4.0f %%", 100*m_Plugin->GetSustain()); + m_out_sustain->value(str); + sprintf(str,"%5.3f s", m_Plugin->GetRelease()); + m_out_release->value(str); + sprintf(str,"%4.0f %%", 100*m_Plugin->GetVolume()); + m_out_volume->value(str); +} + + +inline void EnvelopePluginGUI::cb_Thresh_i(Fl_Slider* o, void* v) +{ +char str[10]; + m_Plugin->SetTrigThresh(1.0f-o->value()); + sprintf(str,"%4.0f %%", 100*(1.0f-o->value())); + m_out_thresh->value(str); +} + +void EnvelopePluginGUI::cb_Thresh(Fl_Slider* o, void* v) +{ ((EnvelopePluginGUI*)(o->parent()))->cb_Thresh_i(o,v); } + +inline void EnvelopePluginGUI::cb_Attack_i(Fl_Slider* o, void* v) +{ +char str[10]; + float value=TIMED_SLIDER_MAX-o->value(); + m_Plugin->SetAttack(value*value); + sprintf(str,"%5.3f s", value*value); + m_out_attack->value(str); +} +void EnvelopePluginGUI::cb_Attack(Fl_Slider* o, void* v) +{ ((EnvelopePluginGUI*)(o->parent()))->cb_Attack_i(o,v); } + +inline void EnvelopePluginGUI::cb_Decay_i(Fl_Slider* o, void* v) +{ +char str[10]; + float value=TIMED_SLIDER_MAX-o->value(); + m_Plugin->SetDecay(value*value); + sprintf(str,"%5.3f s", value*value); + m_out_decay->value(str); +} +void EnvelopePluginGUI::cb_Decay(Fl_Slider* o, void* v) +{ ((EnvelopePluginGUI*)(o->parent()))->cb_Decay_i(o,v); } + +inline void EnvelopePluginGUI::cb_Sustain_i(Fl_Slider* o, void* v) +{ +char str[10]; + m_Plugin->SetSustain(1.0f-o->value()); + sprintf(str,"%4.0f %%", 100*(1.0f-o->value())); + m_out_sustain->value(str); +} + +void EnvelopePluginGUI::cb_Sustain(Fl_Slider* o, void* v) +{ ((EnvelopePluginGUI*)(o->parent()))->cb_Sustain_i(o,v); } + +inline void EnvelopePluginGUI::cb_Release_i(Fl_Slider* o, void* v) +{ +char str[10]; + float value=TIMED_SLIDER_MAX-o->value(); + m_Plugin->SetRelease(value*value); + sprintf(str,"%5.3f s", value*value); + m_out_release->value(str); +} +void EnvelopePluginGUI::cb_Release(Fl_Slider* o, void* v) +{ ((EnvelopePluginGUI*)(o->parent()))->cb_Release_i(o,v); } + +inline void EnvelopePluginGUI::cb_Volume_i(Fl_Slider* o, void* v) +{ +char str[10]; + + m_Plugin->SetVolume(1.0f-o->value()); + sprintf(str,"%4.0f %%", 100*(1.0f-o->value())); + m_out_volume->value(str); +} + +void EnvelopePluginGUI::cb_Volume(Fl_Slider* o, void* v) +{ ((EnvelopePluginGUI*)(o->parent()))->cb_Volume_i(o,v); } + + +inline void EnvelopePluginGUI::cb_pop_i(Fl_Button *o, void*) { + if (o->value()) + { + o->label("@2>"); + m_out_thresh->show(); + m_out_attack->show(); + m_out_decay->show(); + m_out_sustain->show(); + m_out_release->show(); + redraw(); + } + else + { + o->label("@>"); + m_out_thresh->hide(); + m_out_attack->hide(); + m_out_decay->hide(); + m_out_sustain->hide(); + m_out_release->hide(); + redraw(); + parent()->redraw(); + } +} +void EnvelopePluginGUI::cb_pop(Fl_Button* o, void* v) { + ((EnvelopePluginGUI*)(o->parent()))->cb_pop_i(o,v); +} + diff --git a/SpiralSound/Plugins/EnvelopePlugin/EnvelopePluginGUI.h b/SpiralSound/Plugins/EnvelopePlugin/EnvelopePluginGUI.h new file mode 100644 index 0000000..79c5f31 --- /dev/null +++ b/SpiralSound/Plugins/EnvelopePlugin/EnvelopePluginGUI.h @@ -0,0 +1,77 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "EnvelopePlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef EnvelopeGUI +#define EnvelopeGUI + + +class EnvelopePluginGUI : public SpiralPluginGUI +{ +public: + EnvelopePluginGUI(int w, int h, EnvelopePlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + EnvelopePlugin *m_Plugin; +private: + + Fl_Slider *Thresh; + Fl_Slider *Attack; + Fl_Slider *Decay; + Fl_Slider *Sustain; + Fl_Slider *Release; + Fl_Slider *Volume; + Fl_Button *m_pop; + Fl_Output *m_out_thresh; + Fl_Output *m_out_attack; + Fl_Output *m_out_decay; + Fl_Output *m_out_sustain; + Fl_Output *m_out_release; + Fl_Output *m_out_volume; + + //// Callbacks //// + inline void cb_Thresh_i(Fl_Slider* o, void* v); + static void cb_Thresh(Fl_Slider*, void*); + inline void cb_Attack_i(Fl_Slider* o, void* v); + static void cb_Attack(Fl_Slider*, void*); + inline void cb_Decay_i(Fl_Slider* o, void* v); + static void cb_Decay(Fl_Slider* o, void* v); + inline void cb_Sustain_i(Fl_Slider* o, void* v); + static void cb_Sustain(Fl_Slider* o, void* v); + inline void cb_Release_i(Fl_Slider* o, void* v); + static void cb_Release(Fl_Slider* o, void* v); + inline void cb_Volume_i(Fl_Slider* o, void* v); + static void cb_Volume(Fl_Slider* o, void* v); + inline void cb_pop_i(Fl_Button *o, void *v); + static void cb_pop(Fl_Button *o, void *v); + +}; + +#endif diff --git a/SpiralSound/Plugins/EnvelopePlugin/Makefile.in b/SpiralSound/Plugins/EnvelopePlugin/Makefile.in new file mode 100644 index 0000000..8e66576 --- /dev/null +++ b/SpiralSound/Plugins/EnvelopePlugin/Makefile.in @@ -0,0 +1,164 @@ +############################################################################# +# Makefile for building EnvelopePlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: EnvelopePlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + EnvelopePlugin.h \ + EnvelopePluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + EnvelopePlugin.C \ + EnvelopePluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + EnvelopePlugin.o \ + EnvelopePluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = EnvelopePlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake EnvelopePlugin.pro + +dist: + $(TAR) EnvelopePlugin.tar EnvelopePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) EnvelopePlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +EnvelopePlugin.o: EnvelopePlugin.C \ + EnvelopePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + EnvelopePluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +EnvelopePluginGUI.o: EnvelopePluginGUI.C \ + EnvelopePluginGUI.h \ + EnvelopePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/EnvelopePlugin/SpiralIcon.xpm b/SpiralSound/Plugins/EnvelopePlugin/SpiralIcon.xpm new file mode 100644 index 0000000..ffaee5d --- /dev/null +++ b/SpiralSound/Plugins/EnvelopePlugin/SpiralIcon.xpm @@ -0,0 +1,354 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 315 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #2D2F00", +"!. c #111200", +"~. c #0B0C00", +"{. c #0F0F00", +"]. c #090A00", +"^. c #040400", +"/. c #727175", +"(. c #FEFEFF", +"_. c #9D99AA", +":. c #DBD9E0", +"<. c #E9E9E9", +"[. c #CBCBCB", +"}. c #E0E0E0", +"|. c #6C6C6C", +"1. c #050500", +"2. c #515151", +"3. c #A6A6A7", +"4. c #827E93", +"5. c #615C77", +"6. c #EAEAED", +"7. c #DFDFE1", +"8. c #C4CC00", +"9. c #F6FF00", +"0. c #F5FE00", +"a. c #323400", +"b. c #010100", +"c. c #1E1D24", +"d. c #9894A7", +"e. c #B1AEBB", +"f. c #69686F", +"g. c #000001", +"h. c #E2EA00", +"i. c #E3EB00", +"j. c #050600", +"k. c #EDF600", +"l. c #6E7300", +"m. c #615C76", +"n. c #5F5A75", +"o. c #413E4D", +"p. c #020203", +"q. c #E5EE00", +"r. c #010200", +"s. c #1C1E00", +"t. c #F3FC00", +"u. c #F4FD00", +"v. c #D5DD00", +"w. c #1A1A1C", +"x. c #C3C1CB", +"y. c #9D9D9D", +"z. c #202020", +"A. c #383838", +"B. c #4C4C4C", +"C. c #E8F100", +"D. c #E7EF00", +"E. c #505300", +"F. c #F0F900", +"G. c #DAE200", +"H. c #2C2E00", +"I. c #111112", +"J. c #C9C7D0", +"K. c #F1F1F1", +"L. c #F8F8F8", +"M. c #232323", +"N. c #606400", +"O. c #979C00", +"P. c #BAC100", +"Q. c #D7DF00", +"R. c #050408", +"S. c #AEACB9", +"T. c #FEFEFE", +"U. c #1D1D1D", +"V. c #D8E000", +"W. c #E6EF00", +"X. c #101100", +"Y. c #D9E100", +"Z. c #292B00", +"`. c #B7B5C1", +" + c #9390A2", +".+ c #BBBBBB", +"++ c #414141", +"@+ c #030303", +"#+ c #020200", +"$+ c #28272A", +"%+ c #F4F4F6", +"&+ c #605B76", +"*+ c #736E86", +"=+ c #D8D8D8", +"-+ c #727272", +";+ c #101010", +">+ c #1E2000", +",+ c #848486", +"'+ c #CCCBD3", +")+ c #747087", +"!+ c #6D6881", +"~+ c #1C1C1C", +"{+ c #242424", +"]+ c #0A0A00", +"^+ c #656566", +"/+ c #F6F6F6", +"(+ c #E8E6EA", +"_+ c #706B84", +":+ c #E3E1E6", +"<+ c #474746", +"[+ c #151515", +"}+ c #C8C8C8", +"|+ c #AEAEAE", +"1+ c #080808", +"2+ c #373639", +"3+ c #FDFCFE", +"4+ c #ABA8B7", +"5+ c #F1F0F3", +"6+ c #6D6980", +"7+ c #0A090E", +"8+ c #95929E", +"9+ c #0A0810", +"0+ c #0D0D0D", +"a+ c #050505", +"b+ c #5B5A5C", +"c+ c #F7F6F7", +"d+ c #F4F3F5", +"e+ c #908C9F", +"f+ c #C8C6D0", +"g+ c #837E96", +"h+ c #86868A", +"i+ c #070608", +"j+ c #ECEBEE", +"k+ c #5B5571", +"l+ c #646078", +"m+ c #AFAFB0", +"n+ c #454545", +"o+ c #363636", +"p+ c #7A7A7A", +"q+ c #C8C8C9", +"r+ c #212025", +"s+ c #060607", +"t+ c #969699", +"u+ c #FAFAFA", +"v+ c #F8F8F9", +"w+ c #A29EAF", +"x+ c #F7F6F8", +"y+ c #F0F0F1", +"z+ c #B8B7B9", +"A+ c #E4E4E4", +"B+ c #FDFDFD", +"C+ c #A5A2B2", +"D+ c #3B3456", +"E+ c #A8A5B4", +"F+ c #525252", +"G+ c #848387", +"H+ c #CDCDCD", +"I+ c #8D899C", +"J+ c #494262", +"K+ c #68627C", +"L+ c #40395A", +"M+ c #ECECEC", +"N+ c #020202", +"O+ c #B4B5B5", +"P+ c #0B0B0B", +"Q+ c #313232", +"R+ c #E3E3E3", +"S+ c #B1AEBC", +"T+ c #BDBBC6", +"U+ c #3C3556", +"V+ c #898599", +"W+ c #EDEDED", +"X+ c #39393A", +"Y+ c #040404", +"Z+ c #333333", +"`+ c #F5F5F5", +" @ c #2B2B2B", +".@ c #2D2A3D", +"+@ c #B6B4C1", +"@@ c #F5F5F6", +"#@ c #605A76", +"$@ c #DAD8DF", +"%@ c #F5F4F6", +"&@ c #615B76", +"*@ c #524D6A", +"=@ c #E4E3E8", +"-@ c #D5D5D5", +";@ c #1B1B1B", +">@ c #303030", +",@ c #AAABAB", +"'@ c #585464", +")@ c #B0AEBB", +"!@ c #A29FAF", +"~@ c #E9E8E9", +"{@ c #787779", +"]@ c #0F0E15", +"^@ c #2D2D2E", +"/@ c #595959", +"(@ c #FAFAFB", +"_@ c #807B92", +":@ c #B0ADBB", +"<@ c #E8E7EB", +"[@ c #3A3258", +"}@ c #E6E5EA", +"|@ c #DFDEE3", +"1@ c #443E5E", +"2@ c #BAB8C4", +"3@ c #C1BFCA", +"4@ c #E0E0E5", +"5@ c #D0CED6", +"6@ c #362F52", +"7@ c #CECCD5", +"8@ c #413A5B", +"9@ c #6A657F", +"0@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.{.].6 ^.6 6 6 E /.(.; ; _. ", +" :.; ; <.R h [.}.|.6 1.6 6 6 6 6 6 6 6 6 6 E 2.3.4 4. ", +" 5.6.; 7...6 6 6 6 6 8.9.9.9.0.a.b.6 6 6 6 6 6 6 c.d. ", +" V @ e.f.g.6 6 6 6 6 h.i.6 j.k.0.l.6 6 6 6 6 6 6 ", +" m.n.o.6 p.6 6 6 6 q.q.6 r.s.t.u.v.a.6 1.6 6 6 w. ", +" x.; ; y.z.z.A.B.z.6 C.D.6 r.6 E.q.F.0.G.H.6 6 6 I. ", +" J.; ; K.L.; ; ; M.N.9.O.6 6 6 6 6 6 P.u.0.Q.j.6 R. ", +" S.; ; ; ; T.; ; U.V.W.X.6 6 6 6 6 6 6 j.Y.C.Z.6 6 `., ", +" +; ; T.; : .+++@+Q Q 6 6 6 6 6 6 6 6 ^.#+6 6 6 $+T.%+&+ ", +" *+; ; ; =+-+;+6 6 6 6 6 6 6 6 6 6 #+6 >+6 6 6 6 ,+; ; '+)+ ", +" !+J ; : ~+6 6 6 6 {+..6 6 6 6 6 6 ]+6 6 b.6 6 6 ^+/+; ; (+_+ ", +" :+; ; <+6 E 6 [+}+|+1+6 6 6 6 6 6 6 6 b.6 6 6 6 2+3+; ; > _+ ", +" 4+; 5+6+7+6 6 |+T.; 8+9+6 6 6 6 6 6 6 6 0+a+6 6 6 b+c+; ; d+e+ ", +" _+f+! g+h+i+x ; ; j+k+l+m+l n+6 6 6 o+p+q+r+6 6 6 s+t+u+; ; v+@ ", +" w+x+y+z+A+B+; C+D+E+; /+n+6 6 E F+; ; G+6 6 E 6 o H+; ; = I+ ", +" J+> ; ; ; ; ; ; K+L+; ; M+A.6 6 N+D ; ; O+P+6 6 6 Q+R+; ; S+ ", +" > ; ; ; ; T+U+V+; ; W+X+6 6 Y+Z+; ; `+ @6 6 .@+@; @@3 ", +" #@$@= ; %@&@*@=@; ; -@;@6 6 N+>@; ; ; ,@F+'@ ", +" )@4 !@ X ; ; ; ~@{@>@]@^@/@; ; ; T.(@_@ ", +" :@; ; ; ; ; <@[@}@; ; ; ; = |@1@ ", +" 2@3@4@4 ; ; 5@6@7@; ; ; s V+T ", +" 8@ 9@0@V+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/FilterPlugin/FilterPlugin.C b/SpiralSound/Plugins/FilterPlugin/FilterPlugin.C new file mode 100644 index 0000000..23d948a --- /dev/null +++ b/SpiralSound/Plugins/FilterPlugin/FilterPlugin.C @@ -0,0 +1,186 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "FilterPlugin.h" +#include "FilterPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +static const float MAX_RES = 10; +static const float MIN_RES = 1; +static const float MAX_CUTOFF = 3000; +static const float MIN_CUTOFF = 500; +static const int FILTERGRAN = 50; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new FilterPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x000b; +} +} + +/////////////////////////////////////////////////////// + +FilterPlugin::FilterPlugin() : +fs(0), // Sampling frequency +fc(100), // Filter cutoff +Q(1), // Resonance +m_LastFC(0), +m_LastQ(1), +k(1.0), // Set overall filter gain +m_RevCutoffMod(false), +m_RevResonanceMod(false) +{ + m_PluginInfo.Name="Filter"; + m_PluginInfo.Width=120; + m_PluginInfo.Height=110; + m_PluginInfo.NumInputs=3; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Cutoff CV"); + m_PluginInfo.PortTips.push_back("Emphasis CV"); + m_PluginInfo.PortTips.push_back("Output"); +} + +FilterPlugin::~FilterPlugin() +{ +} + +PluginInfo &FilterPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + + fs=m_HostInfo->SAMPLERATE; + + SetupCoeffs(); + + iir.length = FILTER_SECTIONS; + iir.coef = (float *) calloc(4 * iir.length + 1 , sizeof(float)); + + if (!iir.coef) + { + printf("Unable to allocate coef array, exiting\n"); + exit(1); + } + + return Info; +} + +SpiralGUIType *FilterPlugin::CreateGUI() +{ + m_GUI = new FilterPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void FilterPlugin::Execute() +{ + float Cutoff; + float Resonance; + + if (fc<0) return; + + for (int n=0; nBUFSIZE; n++) + { + coef = iir.coef + 1; /* Skip k, or gain */ + k=0.25; + + Cutoff = fc + (GetInput(1,n) * 1000); + Resonance = Q + GetInput(2,n); + + Cutoff/=2; + + if (Resonance>MAX_RES) Resonance=MAX_RES; + if (Cutoff>MAX_CUTOFF) Cutoff=MAX_CUTOFF; + if (ResonanceSet(n,0); + //} + } + +} + +void FilterPlugin::StreamOut(ostream &s) +{ + s<>version; + s>>fc>>Q>>m_RevCutoffMod>>m_RevResonanceMod; +} + +void FilterPlugin::SetupCoeffs() +{ + ProtoCoef[0].a0 = 1.0; + ProtoCoef[0].a1 = 0; + ProtoCoef[0].a2 = 0; + ProtoCoef[0].b0 = 1.0; + ProtoCoef[0].b1 = 0.765367; + ProtoCoef[0].b2 = 1.0; + + ProtoCoef[1].a0 = 1.0; + ProtoCoef[1].a1 = 0; + ProtoCoef[1].a2 = 0; + ProtoCoef[1].b0 = 1.0; + ProtoCoef[1].b1 = 1.847759; + ProtoCoef[1].b2 = 1.0; +} diff --git a/SpiralSound/Plugins/FilterPlugin/FilterPlugin.h b/SpiralSound/Plugins/FilterPlugin/FilterPlugin.h new file mode 100644 index 0000000..7ed15f0 --- /dev/null +++ b/SpiralSound/Plugins/FilterPlugin/FilterPlugin.h @@ -0,0 +1,77 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include +#include "iir_filter.h" + +#ifndef FilterPLUGIN +#define FilterPLUGIN + +static const int NUM_CHANNELS = 4; + +class FilterPlugin : public SpiralPlugin +{ +public: + FilterPlugin(); + virtual ~FilterPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void Reset(); + void SetupCoeffs(); + + void SetCutoff(double s) {fc=s;} + void SetResonance(double s) {Q=s;} + void SetRevCutoffMod(bool s) {m_RevCutoffMod=s;} + void SetRevResonanceMod(bool s) {m_RevResonanceMod=s;} + double GetCutoff() {return fc;} + double GetResonance() {return Q;} + bool GetRevCutoffMod() {return m_RevCutoffMod;} + bool GetRevResonanceMod() {return m_RevResonanceMod;} + +private: + // Voice specifics + FILTER iir; + + // Voice independant + float *coef; + double fs, fc; // Sampling frequency, cutoff frequency + double Q; // Resonance > 1.0 < 1000 + double m_LastFC; + double m_LastQ; + unsigned nInd; + double a0, a1, a2, b0, b1, b2; + double k; // overall gain factor + bool m_RevCutoffMod; + bool m_RevResonanceMod; + + friend istream &operator>>(istream &s, FilterPlugin &o); + friend ostream &operator<<(ostream &s, FilterPlugin &o); +}; +istream &operator>>(istream &s, FilterPlugin &o); +ostream &operator<<(ostream &s, FilterPlugin &o); + +#endif diff --git a/SpiralSound/Plugins/FilterPlugin/FilterPlugin.pro b/SpiralSound/Plugins/FilterPlugin/FilterPlugin.pro new file mode 100644 index 0000000..3d12371 --- /dev/null +++ b/SpiralSound/Plugins/FilterPlugin/FilterPlugin.pro @@ -0,0 +1,19 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + iir_filter.h \ + FilterPlugin.h \ + FilterPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + iir_filter.C \ + FilterPlugin.C \ + FilterPluginGUI.C + +TARGET = FilterPlugin.so diff --git a/SpiralSound/Plugins/FilterPlugin/FilterPluginGUI.C b/SpiralSound/Plugins/FilterPlugin/FilterPluginGUI.C new file mode 100644 index 0000000..e389571 --- /dev/null +++ b/SpiralSound/Plugins/FilterPlugin/FilterPluginGUI.C @@ -0,0 +1,101 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "FilterPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +FilterPluginGUI::FilterPluginGUI(int w, int h,FilterPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + Cutoff = new Fl_Slider(15, 20, 20, 70, "Cutoff"); + Cutoff->type(4); + Cutoff->selection_color(GUI_COLOUR); + Cutoff->labelsize(10); + Cutoff->maximum(100); + Cutoff->step(0.01); + Cutoff->value(10); + Cutoff->callback((Fl_Callback*)cb_Cutoff); + + Resonance = new Fl_Knob(58, 28, 45, 45, "Emphasis"); + Resonance->color(GUI_COLOUR); + Resonance->type(Fl_Knob::DOTLIN); + Resonance->labelsize(10); + Resonance->maximum(10); + Resonance->step(0.1); + Resonance->value(0); + Resonance->callback((Fl_Callback*)cb_Resonance); + + RevCutoff = new Fl_Button(57, 72, 50, 15, "RvCMod"); + RevCutoff->type(1); + RevCutoff->down_box(FL_DOWN_BOX); + RevCutoff->labelsize(10); + RevCutoff->callback((Fl_Callback*)cb_RevCutoff); + + RevResonance = new Fl_Button(57, 88, 50, 15, "RvRMod"); + RevResonance->type(1); + RevResonance->down_box(FL_DOWN_BOX); + RevResonance->labelsize(10); + RevResonance->callback((Fl_Callback*)cb_RevResonance); + + end(); +} + +void FilterPluginGUI::UpdateValues() +{ + Cutoff->value(100.0f-sqrt(m_Plugin->GetCutoff()-10.0f)); + Resonance->value(m_Plugin->GetResonance()-1.0f); + + RevCutoff->value(0); + RevResonance->value(0); + + if (m_Plugin->GetRevCutoffMod()) RevCutoff->value(1); + if (m_Plugin->GetRevResonanceMod()) RevResonance->value(1); +} + +inline void FilterPluginGUI::cb_Cutoff_i(Fl_Slider* o, void* v) +{ + float value=100.0f-o->value(); + m_Plugin->SetCutoff((value*value)+10.0f); +} +void FilterPluginGUI::cb_Cutoff(Fl_Slider* o, void* v) +{ ((FilterPluginGUI*)(o->parent()))->cb_Cutoff_i(o,v); } + +inline void FilterPluginGUI::cb_Resonance_i(Fl_Knob* o, void* v) +{ m_Plugin->SetResonance(o->value()+1.0f); } +void FilterPluginGUI::cb_Resonance(Fl_Knob* o, void* v) +{ ((FilterPluginGUI*)(o->parent()))->cb_Resonance_i(o,v); } + +inline void FilterPluginGUI::cb_RevCutoff_i(Fl_Button* o, void* v) +{ m_Plugin->SetRevCutoffMod(o->value()); } +void FilterPluginGUI::cb_RevCutoff(Fl_Button* o, void* v) +{ ((FilterPluginGUI*)(o->parent()))->cb_RevCutoff_i(o,v); } + +inline void FilterPluginGUI::cb_RevResonance_i(Fl_Button* o, void* v) +{ m_Plugin->SetRevResonanceMod(o->value()); } +void FilterPluginGUI::cb_RevResonance(Fl_Button* o, void* v) +{ ((FilterPluginGUI*)(o->parent()))->cb_RevResonance_i(o,v); } + diff --git a/SpiralSound/Plugins/FilterPlugin/FilterPluginGUI.h b/SpiralSound/Plugins/FilterPlugin/FilterPluginGUI.h new file mode 100644 index 0000000..4441115 --- /dev/null +++ b/SpiralSound/Plugins/FilterPlugin/FilterPluginGUI.h @@ -0,0 +1,63 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "FilterPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" + +#ifndef FilterGUI +#define FilterGUI + + +class FilterPluginGUI : public SpiralPluginGUI +{ +public: + FilterPluginGUI(int w, int h, FilterPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + FilterPlugin *m_Plugin; + +private: + + Fl_Group *GUIFilterGroup; + Fl_Slider *Cutoff; + Fl_Knob *Resonance; + Fl_Button *RevCutoff; + Fl_Button *RevResonance; + + //// Callbacks //// + + inline void cb_Cutoff_i(Fl_Slider* o, void* v); + static void cb_Cutoff(Fl_Slider*, void*); + inline void cb_Resonance_i(Fl_Knob* o, void* v); + static void cb_Resonance(Fl_Knob* o, void* v); + inline void cb_RevCutoff_i(Fl_Button* o, void* v); + static void cb_RevCutoff(Fl_Button*, void*); + inline void cb_RevResonance_i(Fl_Button* o, void* v); + static void cb_RevResonance(Fl_Button* o, void* v); + +}; + +#endif diff --git a/SpiralSound/Plugins/FilterPlugin/Makefile.in b/SpiralSound/Plugins/FilterPlugin/Makefile.in new file mode 100644 index 0000000..2ff9abb --- /dev/null +++ b/SpiralSound/Plugins/FilterPlugin/Makefile.in @@ -0,0 +1,174 @@ +############################################################################# +# Makefile for building FilterPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: FilterPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + iir_filter.h \ + FilterPlugin.h \ + FilterPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + iir_filter.C \ + FilterPlugin.C \ + FilterPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + iir_filter.o \ + FilterPlugin.o \ + FilterPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = FilterPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake FilterPlugin.pro + +dist: + $(TAR) FilterPlugin.tar FilterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) FilterPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +iir_filter.o: iir_filter.C \ + iir_filter.h + +FilterPlugin.o: FilterPlugin.C \ + FilterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + iir_filter.h \ + FilterPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + SpiralIcon.xpm + +FilterPluginGUI.o: FilterPluginGUI.C \ + FilterPluginGUI.h \ + FilterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + iir_filter.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H + diff --git a/SpiralSound/Plugins/FilterPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/FilterPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..16bbcef --- /dev/null +++ b/SpiralSound/Plugins/FilterPlugin/SpiralIcon.xpm @@ -0,0 +1,355 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 316 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #2D2F00", +"!. c #111200", +"~. c #0B0C00", +"{. c #0F0F00", +"]. c #090A00", +"^. c #040400", +"/. c #727175", +"(. c #FEFEFF", +"_. c #9D99AA", +":. c #DBD9E0", +"<. c #E9E9E9", +"[. c #CBCBCB", +"}. c #E0E0E0", +"|. c #6C6C6C", +"1. c #050500", +"2. c #050600", +"3. c #F2FB00", +"4. c #F6FF00", +"5. c #E8F100", +"6. c #515151", +"7. c #A6A6A7", +"8. c #827E93", +"9. c #615C77", +"0. c #EAEAED", +"a. c #DFDFE1", +"b. c #F5FE00", +"c. c #F3FC00", +"d. c #323400", +"e. c #1E1D24", +"f. c #9894A7", +"g. c #B1AEBB", +"h. c #69686F", +"i. c #000001", +"j. c #0A0A00", +"k. c #171800", +"l. c #000100", +"m. c #020200", +"n. c #666A00", +"o. c #615C76", +"p. c #5F5A75", +"q. c #413E4D", +"r. c #020203", +"s. c #040500", +"t. c #010200", +"u. c #F4FD00", +"v. c #8B9100", +"w. c #1A1A1C", +"x. c #C3C1CB", +"y. c #9D9D9D", +"z. c #202020", +"A. c #383838", +"B. c #4C4C4C", +"C. c #161700", +"D. c #2F3100", +"E. c #121300", +"F. c #111112", +"G. c #C9C7D0", +"H. c #F1F1F1", +"I. c #F8F8F8", +"J. c #232323", +"K. c #010100", +"L. c #141500", +"M. c #A0A600", +"N. c #EFF800", +"O. c #B9C000", +"P. c #050408", +"Q. c #AEACB9", +"R. c #FEFEFE", +"S. c #1D1D1D", +"T. c #1E1F00", +"U. c #E3EB00", +"V. c #D0D800", +"W. c #B7B5C1", +"X. c #9390A2", +"Y. c #BBBBBB", +"Z. c #414141", +"`. c #030303", +" + c #C4CC00", +".+ c #868B00", +"++ c #606400", +"@+ c #626600", +"#+ c #28272A", +"$+ c #F4F4F6", +"%+ c #605B76", +"&+ c #736E86", +"*+ c #D8D8D8", +"=+ c #727272", +"-+ c #101010", +";+ c #232500", +">+ c #737800", +",+ c #8C9200", +"'+ c #7E8300", +")+ c #848486", +"!+ c #CCCBD3", +"~+ c #747087", +"{+ c #6D6881", +"]+ c #1C1C1C", +"^+ c #242424", +"/+ c #656566", +"(+ c #F6F6F6", +"_+ c #E8E6EA", +":+ c #706B84", +"<+ c #E3E1E6", +"[+ c #474746", +"}+ c #151515", +"|+ c #C8C8C8", +"1+ c #AEAEAE", +"2+ c #080808", +"3+ c #373639", +"4+ c #FDFCFE", +"5+ c #ABA8B7", +"6+ c #F1F0F3", +"7+ c #6D6980", +"8+ c #0A090E", +"9+ c #95929E", +"0+ c #0A0810", +"a+ c #0D0D0D", +"b+ c #050505", +"c+ c #5B5A5C", +"d+ c #F7F6F7", +"e+ c #F4F3F5", +"f+ c #908C9F", +"g+ c #C8C6D0", +"h+ c #837E96", +"i+ c #86868A", +"j+ c #070608", +"k+ c #ECEBEE", +"l+ c #5B5571", +"m+ c #646078", +"n+ c #AFAFB0", +"o+ c #454545", +"p+ c #363636", +"q+ c #7A7A7A", +"r+ c #C8C8C9", +"s+ c #212025", +"t+ c #060607", +"u+ c #969699", +"v+ c #FAFAFA", +"w+ c #F8F8F9", +"x+ c #A29EAF", +"y+ c #F7F6F8", +"z+ c #F0F0F1", +"A+ c #B8B7B9", +"B+ c #E4E4E4", +"C+ c #FDFDFD", +"D+ c #A5A2B2", +"E+ c #3B3456", +"F+ c #A8A5B4", +"G+ c #525252", +"H+ c #848387", +"I+ c #CDCDCD", +"J+ c #8D899C", +"K+ c #494262", +"L+ c #68627C", +"M+ c #40395A", +"N+ c #ECECEC", +"O+ c #020202", +"P+ c #B4B5B5", +"Q+ c #0B0B0B", +"R+ c #313232", +"S+ c #E3E3E3", +"T+ c #B1AEBC", +"U+ c #BDBBC6", +"V+ c #3C3556", +"W+ c #898599", +"X+ c #EDEDED", +"Y+ c #39393A", +"Z+ c #040404", +"`+ c #333333", +" @ c #F5F5F5", +".@ c #2B2B2B", +"+@ c #2D2A3D", +"@@ c #B6B4C1", +"#@ c #F5F5F6", +"$@ c #605A76", +"%@ c #DAD8DF", +"&@ c #F5F4F6", +"*@ c #615B76", +"=@ c #524D6A", +"-@ c #E4E3E8", +";@ c #D5D5D5", +">@ c #1B1B1B", +",@ c #303030", +"'@ c #AAABAB", +")@ c #585464", +"!@ c #B0AEBB", +"~@ c #A29FAF", +"{@ c #E9E8E9", +"]@ c #787779", +"^@ c #0F0E15", +"/@ c #2D2D2E", +"(@ c #595959", +"_@ c #FAFAFB", +":@ c #807B92", +"<@ c #B0ADBB", +"[@ c #E8E7EB", +"}@ c #3A3258", +"|@ c #E6E5EA", +"1@ c #DFDEE3", +"2@ c #443E5E", +"3@ c #BAB8C4", +"4@ c #C1BFCA", +"5@ c #E0E0E5", +"6@ c #D0CED6", +"7@ c #362F52", +"8@ c #CECCD5", +"9@ c #413A5B", +"0@ c #6A657F", +"a@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.{.].6 ^.6 6 6 E /.(.; ; _. ", +" :.; ; <.R h [.}.|.6 1.6 6 2.3.4.5.6 6 6 6 E 6.7.4 8. ", +" 9.0.; a...6 6 6 6 6 6 6 6 6 b.c.d.4.6 6 6 6 6 6 e.f. ", +" V @ g.h.i.6 6 6 6 6 j.k.6 l.4.m.6 b.n.6 6 6 6 6 ", +" o.p.q.6 r.6 6 6 6 6 s.6 t.4.6 6 u.v.6 1.6 6 6 w. ", +" x.; ; y.z.z.A.B.z.6 6 C.6 D.4.6 6 u.v.6 E.6 6 6 F. ", +" G.; ; H.I.; ; ; J.6 K.L.M.b.N.6 6 b.O.6 E.6 6 6 P. ", +" Q.; ; ; ; R.; ; S.6 T.U.4.V.2.6 6 5.N.2.E.6 6 6 6 W., ", +" X.; ; R.; : Y.Z.`. +4.b..+6 6 6 6 ++u.4.b.u.3.@+#+R.$+%+ ", +" &+; ; ; *+=+-+6 6 6 6 6 6 6 6 6 6 m.6 ;+>+,+'+Q )+; ; !+~+ ", +" {+J ; : ]+6 6 6 6 ^+..6 6 6 6 6 6 j.6 6 K.6 6 6 /+(+; ; _+:+ ", +" <+; ; [+6 E 6 }+|+1+2+6 6 6 6 6 6 6 6 K.6 6 6 6 3+4+; ; > :+ ", +" 5+; 6+7+8+6 6 1+R.; 9+0+6 6 6 6 6 6 6 6 a+b+6 6 6 c+d+; ; e+f+ ", +" :+g+! h+i+j+x ; ; k+l+m+n+l o+6 6 6 p+q+r+s+6 6 6 t+u+v+; ; w+@ ", +" x+y+z+A+B+C+; D+E+F+; (+o+6 6 E G+; ; H+6 6 E 6 o I+; ; = J+ ", +" K+> ; ; ; ; ; ; L+M+; ; N+A.6 6 O+D ; ; P+Q+6 6 6 R+S+; ; T+ ", +" > ; ; ; ; U+V+W+; ; X+Y+6 6 Z+`+; ; @.@6 6 +@@@; #@3 ", +" $@%@= ; &@*@=@-@; ; ;@>@6 6 O+,@; ; ; '@G+)@ ", +" !@4 ~@ X ; ; ; {@]@,@^@/@(@; ; ; R._@:@ ", +" <@; ; ; ; ; [@}@|@; ; ; ; = 1@2@ ", +" 3@4@5@4 ; ; 6@7@8@; ; ; s W+T ", +" 9@ 0@a@W+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/FilterPlugin/iir_filter.C b/SpiralSound/Plugins/FilterPlugin/iir_filter.C new file mode 100644 index 0000000..18a4bcc --- /dev/null +++ b/SpiralSound/Plugins/FilterPlugin/iir_filter.C @@ -0,0 +1,128 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * 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. +*/ + +/* +Resonant low pass filter source code. +This code was originally written by baltrax@hotmail.com + +See +for the full version with explanatory comments, and the maths! +*/ + +#include "iir_filter.h" + +BIQUAD ProtoCoef[FILTER_SECTIONS]; + +float iir_filter(float input,FILTER *iir) + { + unsigned int i; + float *hist1_ptr,*hist2_ptr,*coef_ptr; + float output,new_hist,history1,history2; + +/* allocate history array if different size than last call */ + + if(!iir->history) { + iir->history = (float *) calloc(2*iir->length,sizeof(float)); + if(!iir->history) { + printf("\nUnable to allocate history array in iir_filter\n"); + exit(1); + } + } + + coef_ptr = iir->coef; /* coefficient pointer */ + + hist1_ptr = iir->history; /* first history */ + hist2_ptr = hist1_ptr + 1; /* next history */ + + /* 1st number of coefficients array is overall input scale factor, + * or filter gain */ + output = input * (*coef_ptr++); + + for (i = 0 ; i < iir->length; i++) + { + history1 = *hist1_ptr; /* history values */ + history2 = *hist2_ptr; + + output = output - history1 * (*coef_ptr++); + new_hist = output - history2 * (*coef_ptr++); /* poles */ + + output = new_hist + history1 * (*coef_ptr++); + output = output + history2 * (*coef_ptr++); /* zeros */ + + *hist2_ptr++ = *hist1_ptr; + *hist1_ptr++ = new_hist; + hist1_ptr++; + hist2_ptr++; + } + + return(output); +} + +void prewarp( + double *a0, double *a1, double *a2, + double fc, double fs) +{ + double wp, pi; + + pi = 4.0 * atan(1.0); + wp = 2.0 * fs * tan(pi * fc / fs); + + *a2 = (*a2) / (wp * wp); + *a1 = (*a1) / wp; +} + +void bilinear( + double a0, double a1, double a2, /* numerator coefficients */ + double b0, double b1, double b2, /* denominator coefficients */ + double *k, /* overall gain factor */ + double fs, /* sampling rate */ + float *coef /* pointer to 4 iir coefficients */ +) +{ + double ad, bd; + + /* alpha (Numerator in s-domain) */ + ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0; + /* beta (Denominator in s-domain) */ + bd = 4. * b2 * fs * fs + 2. * b1* fs + b0; + + /* update gain constant for this section */ + *k *= ad/bd; + + /* Denominator */ + *coef++ = (2. * b0 - 8. * b2 * fs * fs) / bd; /* beta1 */ + *coef++ = (4. * b2 * fs * fs - 2. * b1 * fs + b0) / bd; /* beta2 */ + /* Nominator */ + *coef++ = (2. * a0 - 8. * a2 * fs * fs) / ad; /* alpha1 */ + *coef = (4. * a2 * fs * fs - 2. * a1 * fs + a0) / ad; /* alpha2 */ +} + +void szxform( + double *a0, double *a1, double *a2, /* numerator coefficients */ + double *b0, double *b1, double *b2, /* denominator coefficients */ + double fc, /* Filter cutoff frequency */ + double fs, /* sampling rate */ + double *k, /* overall gain factor */ + float *coef) /* pointer to 4 iir coefficients */ +{ + /* Calculate a1 and a2 and overwrite the original values */ + prewarp(a0, a1, a2, fc, fs); + prewarp(b0, b1, b2, fc, fs); + bilinear(*a0, *a1, *a2, *b0, *b1, *b2, k, fs, coef); +} + diff --git a/SpiralSound/Plugins/FilterPlugin/iir_filter.h b/SpiralSound/Plugins/FilterPlugin/iir_filter.h new file mode 100644 index 0000000..c912e5e --- /dev/null +++ b/SpiralSound/Plugins/FilterPlugin/iir_filter.h @@ -0,0 +1,75 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * 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. +*/ + +/* +Resonant low pass filter source code. +This code was originally written by baltrax@hotmail.com + +See +for the full version with explanatory comments, and the maths! +*/ + + +#include +#include +#include + + +#ifndef _IIR_FILTER +#define _IIR_FILTER + +/* FILTER INFORMATION STRUCTURE FOR FILTER ROUTINES */ + +class FILTER{ + public: + FILTER() {history=coef=NULL;} + unsigned int length; /* size of filter */ + float *history; /* pointer to history in filter */ + float *coef; /* pointer to coefficients of filter */ +}; + +#define FILTER_SECTIONS 2 /* 2 filter sections for 24 db/oct filter */ + +typedef struct { + double a0, a1, a2; /* numerator coefficients */ + double b0, b1, b2; /* denominator coefficients */ +} BIQUAD; + +extern BIQUAD ProtoCoef[FILTER_SECTIONS]; /* Filter prototype coefficients, + 1 for each filter section */ + +float iir_filter(float input,FILTER *iir); + +void szxform( + double *a0, double *a1, double *a2, /* numerator coefficients */ + double *b0, double *b1, double *b2, /* denominator coefficients */ + double fc, /* Filter cutoff frequency */ + double fs, /* sampling rate */ + double *k, /* overall gain factor */ + float *coef); /* pointer to 4 iir coefficients */ + +void prewarp(double *a0, double *a1, double *a2, double fc, double fs); + +void bilinear( + double a0, double a1, double a2, /* numerator coefficients */ + double b0, double b1, double b2, /* denominator coefficients */ + double *k, /* overall gain factor */ + double fs, /* sampling rate */ + float *coef); + +#endif diff --git a/SpiralSound/Plugins/JackPlugin/JackPlugin.C b/SpiralSound/Plugins/JackPlugin/JackPlugin.C new file mode 100644 index 0000000..3573b48 --- /dev/null +++ b/SpiralSound/Plugins/JackPlugin/JackPlugin.C @@ -0,0 +1,403 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include + +#include "JackPlugin.h" +#include "JackPluginGUI.h" +#include "SpiralIcon.xpm" + +static const HostInfo* host; +JackClient* JackClient::m_Singleton = NULL; +bool JackClient::m_Attached = false; +long unsigned int JackClient::m_BufferSize = 0; +long unsigned int JackClient::m_SampleRate = 0; +void (*JackClient::RunCallback)(void*, bool m)=NULL; +void *JackClient::RunContext = NULL; +jack_client_t *JackClient::m_Client = NULL; +map JackClient::m_InputPortMap; +map JackClient::m_OutputPortMap; + +int JackPlugin::m_RefCount = 0; +int JackPlugin::m_NoExecuted = 0; + +/////////////////////////////////////////////////////// + +JackClient::JackClient() +{ +} + +///////////////////////////////////////////////////////////////////////////////////////////// + +JackClient::~JackClient() +{ + Detach(); +} + +///////////////////////////////////////////////////////////////////////////////////////////// + +bool JackClient::Attach() +{ + if (m_Attached) return true; + + cerr<<"Attach"<Name=Name; + NewPort->Buf=NULL; + NewPort->Port = jack_port_register (m_Client, Name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0); + m_InputPortMap[n]=NewPort; + } + + for (int n=0; nName=Name; + NewPort->Buf=NULL; + NewPort->Port = jack_port_register (m_Client, Name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0); + m_OutputPortMap[n]=NewPort; + } + + // tell the JACK server that we are ready to roll + if (jack_activate (m_Client)) + { + cerr<<"cannot activate client"<Connected) + { + if (m_InputPortMap[n]->Buf) + { + sample_t *in = (sample_t *) jack_port_get_buffer(m_InputPortMap[n]->Port, m_BufferSize); + memcpy (m_InputPortMap[n]->Buf, in, sizeof (sample_t) * m_BufferSize); + + //cerr<<"got "<Buf[0]<<" from "<Name<Connected) + { + if (m_OutputPortMap[n]->Buf) + { + sample_t *out = (sample_t *) jack_port_get_buffer(m_OutputPortMap[n]->Port, m_BufferSize); + memcpy (out, m_OutputPortMap[n]->Buf, sizeof (sample_t) * m_BufferSize); + } + else // no output availible, clear + { + sample_t *out = (sample_t *) jack_port_get_buffer(m_OutputPortMap[n]->Port, m_BufferSize); + memset (out, 0, sizeof (sample_t) * m_BufferSize); + } + } + } + + + if(RunCallback&&RunContext) + { + // do the work + RunCallback(RunContext, true); + } + + return 1; +} + +///////////////////////////////////////////////////////////////////////////////////////////// + +int JackClient::OnBufSizeChange(long unsigned int n, void *o) +{ + m_BufferSize=n; + return 1; +} + +///////////////////////////////////////////////////////////////////////////////////////////// + +int JackClient::OnSRateChange(long unsigned int n, void *o) +{ + m_SampleRate=n; + return 1; +} + +///////////////////////////////////////////////////////////////////////////////////////////// + +void JackClient::OnJackShutdown(void *o) +{ + cerr<<"Shutdown"< &InputNames, vector &OutputNames) +{ + InputNames.clear(); + OutputNames.clear(); + + if (!m_Attached) return; + + //Outputs first + const char **PortNameList=jack_get_ports(m_Client,NULL,NULL,JackPortIsOutput); + + int n=0; + while(PortNameList[n]!=NULL) + { + OutputNames.push_back(PortNameList[n]); + n++; + } + + delete PortNameList; + + //Inputs second + PortNameList=jack_get_ports(m_Client,NULL,NULL,JackPortIsInput); + + n=0; + while(PortNameList[n]!=NULL) + { + InputNames.push_back(PortNameList[n]); + n++; + } + + delete PortNameList; +} + +///////////////////////////////////////////////////////////////////////////////////////////// + +void JackClient::ConnectInput(int n, const string &JackPort) +{ + cerr<<"JackClient::ConnectInput: connecting source ["<Name<<"]"<ConnectedTo!="") + { + if (jack_disconnect (m_Client, m_InputPortMap[n]->ConnectedTo.c_str(), jack_port_name(m_InputPortMap[n]->Port))) + cerr<<"JackClient::ConnectInput: cannot disconnect input port [" + <ConnectedTo<<"] from ["<Name<<"]"<ConnectedTo = JackPort; + + if (jack_connect (m_Client, JackPort.c_str(), jack_port_name(m_InputPortMap[n]->Port))) + cerr<<"JackClient::ConnectInput: cannot connect input port [" + <Name<<"]"<Connected=true; +} + +///////////////////////////////////////////////////////////////////////////////////////////// + +void JackClient::ConnectOutput(int n, const string &JackPort) +{ + cerr<<"JackClient::ConnectOutput: connecting source ["<Name<<"] to dest ["<ConnectedTo!="") + { + if (jack_disconnect (m_Client, jack_port_name(m_OutputPortMap[n]->Port), m_OutputPortMap[n]->ConnectedTo.c_str())) + cerr<<"JackClient::ConnectOutput: cannot disconnect output port [" + <ConnectedTo<<"] from ["<Name<<"]"<ConnectedTo = JackPort; + + if (jack_connect (m_Client, jack_port_name(m_OutputPortMap[n]->Port), JackPort.c_str())) + cerr<<"JackClient::ConnectOutput: cannot connect output port [" + <Name<<"] to ["<Connected=true; +} + +///////////////////////////////////////////////////////////////////////////////////////////// + +void JackClient::SetInputBuf(int ID, float* s) +{ + if(m_InputPortMap.find(ID)!=m_InputPortMap.end()) m_InputPortMap[ID]->Buf=s; +} + +///////////////////////////////////////////////////////////////////////////////////////////// + +void JackClient::SetOutputBuf(int ID, float* s) +{ + if(m_OutputPortMap.find(ID)!=m_OutputPortMap.end()) m_OutputPortMap[ID]->Buf=s; +} + +///////////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////////// + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new JackPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 31; +} +} + +/////////////////////////////////////////////////////// + +JackPlugin::JackPlugin() +{ + m_RefCount++; + + m_PluginInfo.Name="Jack"; + m_PluginInfo.Width=200; + m_PluginInfo.Height=415; + m_PluginInfo.NumInputs=NUM_OUTPUTS; + m_PluginInfo.NumOutputs=NUM_INPUTS; + + for (int n=0; nDetach(); + JackClient::PackUpAndGoHome(); + } +} + +PluginInfo &JackPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info= SpiralPlugin::Initialise(Host); + host=Host; + + JackClient::Get()->SetCallback(cb_Update,m_Parent); + + return Info; +} + +SpiralGUIType *JackPlugin::CreateGUI() +{ + m_GUI = new JackPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void JackPlugin::Execute() +{ + for (int n=0; nZero(); + } + + JackClient* pJack=JackClient::Get(); + + ((JackPluginGUI*)m_GUI)->SetAttached(pJack->IsAttached()); + + // connect the buffers up if we are plugged into something + for (int n=0; nSetOutputBuf(n,(float*)GetInput(n)->GetBuffer()); + } + else JackClient::Get()->SetOutputBuf(n,NULL); + } + + // don't really want to do this all the time, as it only needs to + // be done once per attach. + for (int n=0; nSetInputBuf(n,(float*)GetOutputBuf(n)->GetBuffer()); + } + +} + diff --git a/SpiralSound/Plugins/JackPlugin/JackPlugin.h b/SpiralSound/Plugins/JackPlugin/JackPlugin.h new file mode 100644 index 0000000..c18d58f --- /dev/null +++ b/SpiralSound/Plugins/JackPlugin/JackPlugin.h @@ -0,0 +1,115 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include "../../RiffWav.h" +#include +#include +#include +#include + +typedef jack_default_audio_sample_t sample_t; + +#ifndef JackPLUGIN +#define JackPLUGIN + +const int NUM_INPUTS = 8; +const int NUM_OUTPUTS = 8; + +class JackClient +{ +public: + static JackClient *Get() { if(!m_Singleton) m_Singleton=new JackClient; return m_Singleton; } + static void PackUpAndGoHome() { if(m_Singleton) { delete m_Singleton; m_Singleton=NULL; } } + + bool Attach(); + void Detach(); + bool IsAttached() { return m_Attached; } + void SetCallback(void(*Run)(void*, bool m),void *Context) { RunCallback=Run; RunContext=Context; } + void GetPortNames(vector &InputNames,vector &OutputNames); + void ConnectInput(int n, const string &JackPort); + void ConnectOutput(int n, const string &JackPort); + string GetInputName(int ID) { return m_InputPortMap[ID]->Name; } + string GetOutputName(int ID) { return m_OutputPortMap[ID]->Name; } + void SetInputBuf(int ID, float* s); + void SetOutputBuf(int ID, float* s); + +protected: + JackClient(); + ~JackClient(); + + static int Process(long unsigned int n, void *o); + static int OnBufSizeChange(long unsigned int n, void *o); + static int OnSRateChange(long unsigned int n, void *o); + static void OnJackShutdown(void *o); + +private: + + class JackPort + { + public: + JackPort::JackPort() : + Connected(false),Buf(NULL),Port(NULL) {} + + string Name; + bool Connected; + float* Buf; + jack_port_t* Port; + string ConnectedTo; + }; + + static JackClient* m_Singleton; + static jack_client_t* m_Client; + static map m_InputPortMap; + static map m_OutputPortMap; + static long unsigned int m_BufferSize; + static long unsigned int m_SampleRate; + static bool m_Attached; + + static void(*RunCallback)(void*, bool m); + static void *RunContext; +}; + +/////////////////////////////////////////////////// + +class JackPlugin : public SpiralPlugin +{ +public: + JackPlugin(); + virtual ~JackPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s) {} + virtual void StreamIn(istream &s) {} + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void Attach() { JackClient::Get()->Attach(); } + void Detach() { JackClient::Get()->Detach(); } + void GetPortNames(vector &InputNames,vector &OutputNames) { JackClient::Get()->GetPortNames(InputNames,OutputNames); } + void ConnectInput(int n, const string &JackPort) { JackClient::Get()->ConnectInput(n,JackPort); } + void ConnectOutput(int n, const string &JackPort) { JackClient::Get()->ConnectOutput(n,JackPort); } +private: + static int m_RefCount; + static int m_NoExecuted; +}; + +#endif diff --git a/SpiralSound/Plugins/JackPlugin/JackPlugin.pro b/SpiralSound/Plugins/JackPlugin/JackPlugin.pro new file mode 100644 index 0000000..435a826 --- /dev/null +++ b/SpiralSound/Plugins/JackPlugin/JackPlugin.pro @@ -0,0 +1,21 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_LED_Button.H \ + ../../Sample.h \ + ../../RiffWav.h \ + JackPlugin.h \ + JackPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_LED_Button.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + JackPlugin.C \ + JackPluginGUI.C + +TARGET = JackPlugin.so diff --git a/SpiralSound/Plugins/JackPlugin/JackPluginGUI.C b/SpiralSound/Plugins/JackPlugin/JackPluginGUI.C new file mode 100644 index 0000000..b9839c1 --- /dev/null +++ b/SpiralSound/Plugins/JackPlugin/JackPluginGUI.C @@ -0,0 +1,179 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "JackPluginGUI.h" +#include +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +static int Numbers[255]; + +//////////////////////////////////////////////////////////////////////// + +int OptionsList(const vector &List) +{ + Fl_Double_Window *Win = new Fl_Double_Window(300,300); + Fl_Button *Ok = new Fl_Button(10,275,40,20,"Ok"); + Ok->labelsize(10); + Fl_Button *Cancel = new Fl_Button(50,275,40,20,"Cancel"); + Cancel->labelsize(10); + Fl_Hold_Browser* Browser = new Fl_Hold_Browser(5,5,290,265,""); + + for (vector::const_iterator i = List.begin(); + i!=List.end(); i++) + { + Browser->add(i->c_str()); + } + + Win->show(); + + int Choice=-1; + + for (;;) + { + Fl::wait(); + Fl_Widget* o = Fl::readqueue(); + if (o==Ok || o==Browser) + { + Choice=Browser->value(); + Win->hide(); + delete Win; + break; + } + if (o==Cancel) + { + Choice=-1; + Win->hide(); + delete Win; + break; + } + + if (o==Win) break; + } + + return Choice; +} + +//////////////////////////////////////////////////////////////////////// + +JackPluginGUI::JackPluginGUI(int w, int h,JackPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + for (int n=0; n<255; n++) Numbers[n]=n; + + m_Plugin=o; + m_Indicator = new Fl_LED_Button(85,17,30,30,""); + m_Indicator->value(0); + m_Indicator->color(FL_RED); + + m_Attach = new Fl_Button(5,50,190,20,"Attach"); + m_Attach->type(0); + m_Attach->labelsize(10); + m_Attach->callback((Fl_Callback*)cb_Attach); + + m_Detach = new Fl_Button(5,70,190,20,"Detach"); + m_Detach->type(0); + m_Detach->labelsize(10); + m_Detach->callback((Fl_Callback*)cb_Detach); + + int yoff=90; + + for (int n=0; nlabelsize(10); + m_InputLabel[n]->labeltype(FL_ENGRAVED_LABEL); + m_InputButton[n] = new Fl_Button(100,n*40+yoff+20,95,20,"None yet"); + m_InputButton[n]->labelsize(10); + m_InputButton[n]->callback((Fl_Callback*)cb_InputConnect,&Numbers[n]); + } + + for (int n=0; nlabelsize(10); + m_OutputLabel[n]->labeltype(FL_ENGRAVED_LABEL); + m_OutputButton[n] = new Fl_Button(5,n*40+yoff+20,95,20,"None yet"); + m_OutputButton[n]->labelsize(10); + m_OutputButton[n]->callback((Fl_Callback*)cb_OutputConnect,&Numbers[n]); + } + + end(); +} + +void JackPluginGUI::UpdateValues() +{ + +} + +//// Callbacks //// +inline void JackPluginGUI::cb_Attach_i(Fl_Button* o, void* v) +{ + m_Plugin->Attach(); +} +void JackPluginGUI::cb_Attach(Fl_Button* o, void* v) +{ ((JackPluginGUI*)(o->parent()))->cb_Attach_i(o,v);} + +inline void JackPluginGUI::cb_Detach_i(Fl_Button* o, void* v) +{ + m_Plugin->Detach(); +} +void JackPluginGUI::cb_Detach(Fl_Button* o, void* v) +{ ((JackPluginGUI*)(o->parent()))->cb_Detach_i(o,v);} + +inline void JackPluginGUI::cb_OutputConnect_i(Fl_Button* o, void* v) +{ +cerr<<"cb_OutputConnect_i"< Inputs,Outputs; + m_Plugin->GetPortNames(Inputs,Outputs); + + // connect this plugin's output to a jack input + int choice=OptionsList(Inputs); + if (choice>0) + { + m_Plugin->ConnectOutput(*(int*)v,Inputs[choice-1]); + o->label(Inputs[choice-1].c_str()); + o->redraw(); + } +} +void JackPluginGUI::cb_OutputConnect(Fl_Button* o, void* v) +{ ((JackPluginGUI*)(o->parent()))->cb_OutputConnect_i(o,v);} + +inline void JackPluginGUI::cb_InputConnect_i(Fl_Button* o, void* v) +{ +cerr<<"cb_InputConnect_i"< Inputs,Outputs; + m_Plugin->GetPortNames(Inputs,Outputs); + + // connect this plugin's input to a jack output + int choice=OptionsList(Outputs); + if (choice>0) + { + m_Plugin->ConnectInput(*(int*)v,Outputs[choice-1]); + o->label(Outputs[choice-1].c_str()); + o->redraw(); + } +} +void JackPluginGUI::cb_InputConnect(Fl_Button* o, void* v) +{ ((JackPluginGUI*)(o->parent()))->cb_InputConnect_i(o,v);} diff --git a/SpiralSound/Plugins/JackPlugin/JackPluginGUI.h b/SpiralSound/Plugins/JackPlugin/JackPluginGUI.h new file mode 100644 index 0000000..5296361 --- /dev/null +++ b/SpiralSound/Plugins/JackPlugin/JackPluginGUI.h @@ -0,0 +1,72 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "../Widgets/Fl_LED_Button.H" +#include "JackPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef SCOPEGUI +#define SCOPEGUI + +class JackPluginGUI : public SpiralPluginGUI +{ +public: + JackPluginGUI(int w, int h, JackPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + void SetAttached(bool s) { m_Indicator->value(s); } + + JackPlugin *m_Plugin; + +private: + + Fl_LED_Button *m_Indicator; + Fl_Button *m_Attach; + Fl_Button *m_Detach; + + char m_InputName[NUM_INPUTS][256]; + Fl_Box *m_InputLabel[NUM_INPUTS]; + Fl_Button *m_InputButton[NUM_INPUTS]; + + char m_OutputName[NUM_INPUTS][256]; + Fl_Box *m_OutputLabel[NUM_OUTPUTS]; + Fl_Button *m_OutputButton[NUM_OUTPUTS]; + + //// Callbacks //// + inline void cb_Attach_i(Fl_Button* o, void* v); + static void cb_Attach(Fl_Button* o, void* v); + inline void cb_Detach_i(Fl_Button* o, void* v); + static void cb_Detach(Fl_Button* o, void* v); + inline void cb_OutputConnect_i(Fl_Button* o, void* v); + static void cb_OutputConnect(Fl_Button* o, void* v); + inline void cb_InputConnect_i(Fl_Button* o, void* v); + static void cb_InputConnect(Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/JackPlugin/Makefile.in b/SpiralSound/Plugins/JackPlugin/Makefile.in new file mode 100644 index 0000000..99ab422 --- /dev/null +++ b/SpiralSound/Plugins/JackPlugin/Makefile.in @@ -0,0 +1,189 @@ +############################################################################# +# Makefile for building JackPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: JackPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include -I/usr/lib/glib/include/ +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -L/usr/local/lib/ -lfltk -lGL -lXext -lX11 -lm -ldl -ljack -lpthread +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_LED_Button.H \ + ../../Sample.h \ + ../../RiffWav.h \ + JackPlugin.h \ + JackPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_LED_Button.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + JackPlugin.C \ + JackPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../Widgets/Fl_LED_Button.o \ + ../../Sample.o \ + ../../RiffWav.o \ + JackPlugin.o \ + JackPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = JackPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake JackPlugin.pro + +dist: + $(TAR) JackPlugin.tar JackPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) JackPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_LED_Button.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../Widgets/Fl_LED_Button.o: ../Widgets/Fl_LED_Button.cxx \ + ../Widgets/Fl_LED_Button.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +../../RiffWav.o: ../../RiffWav.C \ + ../../RiffWav.h \ + ../../Sample.h \ + ../../SpiralInfo.h + +JackPlugin.o: JackPlugin.C \ + JackPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../../RiffWav.h \ + JackPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_LED_Button.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +JackPluginGUI.o: JackPluginGUI.C \ + JackPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_LED_Button.H \ + JackPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../../RiffWav.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/JackPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/JackPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..6dbb22e --- /dev/null +++ b/SpiralSound/Plugins/JackPlugin/SpiralIcon.xpm @@ -0,0 +1,337 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 298 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #393643", +"@. c #47415F", +"#. c #9692A4", +"$. c #D9D8DE", +"%. c #F7F7F8", +"&. c #918DA0", +"*. c #B8B5C1", +"=. c #D1D1D1", +"-. c #252525", +";. c #6F7300", +">. c #8C9100", +",. c #888D00", +"'. c #363800", +"). c #010100", +"!. c #727175", +"~. c #FEFEFF", +"{. c #9D99AA", +"]. c #DBD9E0", +"^. c #E9E9E9", +"/. c #CBCBCB", +"(. c #E0E0E0", +"_. c #6C6C6C", +":. c #ECF500", +"<. c #F1FA00", +"[. c #F0F900", +"}. c #F2FB00", +"|. c #0B0C00", +"1. c #020300", +"2. c #515151", +"3. c #A6A6A7", +"4. c #827E93", +"5. c #615C77", +"6. c #EAEAED", +"7. c #DFDFE1", +"8. c #EFF800", +"9. c #B1B700", +"0. c #1E1D24", +"a. c #9894A7", +"b. c #B1AEBB", +"c. c #69686F", +"d. c #000001", +"e. c #0A0A00", +"f. c #DEE600", +"g. c #615C76", +"h. c #5F5A75", +"i. c #413E4D", +"j. c #020203", +"k. c #1A1A1C", +"l. c #C3C1CB", +"m. c #9D9D9D", +"n. c #202020", +"o. c #383838", +"p. c #4C4C4C", +"q. c #111112", +"r. c #C9C7D0", +"s. c #F1F1F1", +"t. c #F8F8F8", +"u. c #232323", +"v. c #282A00", +"w. c #050500", +"x. c #050408", +"y. c #AEACB9", +"z. c #FEFEFE", +"A. c #1D1D1D", +"B. c #EDF600", +"C. c #717500", +"D. c #B7B5C1", +"E. c #9390A2", +"F. c #BBBBBB", +"G. c #414141", +"H. c #030303", +"I. c #EEF700", +"J. c #DAE200", +"K. c #404300", +"L. c #BCC300", +"M. c #28272A", +"N. c #F4F4F6", +"O. c #605B76", +"P. c #736E86", +"Q. c #D8D8D8", +"R. c #727272", +"S. c #101010", +"T. c #B7BE00", +"U. c #F3FC00", +"V. c #EAF300", +"W. c #848486", +"X. c #CCCBD3", +"Y. c #747087", +"Z. c #6D6881", +"`. c #1C1C1C", +" + c #242424", +".+ c #575A00", +"++ c #898E00", +"@+ c #4F5200", +"#+ c #656566", +"$+ c #F6F6F6", +"%+ c #E8E6EA", +"&+ c #706B84", +"*+ c #E3E1E6", +"=+ c #474746", +"-+ c #151515", +";+ c #C8C8C8", +">+ c #AEAEAE", +",+ c #080808", +"'+ c #373639", +")+ c #FDFCFE", +"!+ c #ABA8B7", +"~+ c #F1F0F3", +"{+ c #6D6980", +"]+ c #0A090E", +"^+ c #95929E", +"/+ c #0A0810", +"(+ c #050505", +"_+ c #5B5A5C", +":+ c #F7F6F7", +"<+ c #F4F3F5", +"[+ c #908C9F", +"}+ c #C8C6D0", +"|+ c #837E96", +"1+ c #86868A", +"2+ c #070608", +"3+ c #ECEBEE", +"4+ c #5B5571", +"5+ c #646078", +"6+ c #AFAFB0", +"7+ c #454545", +"8+ c #333408", +"9+ c #7A7A7A", +"0+ c #C8C8C9", +"a+ c #212025", +"b+ c #060607", +"c+ c #969699", +"d+ c #FAFAFA", +"e+ c #F8F8F9", +"f+ c #A29EAF", +"g+ c #F7F6F8", +"h+ c #F0F0F1", +"i+ c #B8B7B9", +"j+ c #E4E4E4", +"k+ c #FDFDFD", +"l+ c #A5A2B2", +"m+ c #3B3456", +"n+ c #A8A5B4", +"o+ c #525252", +"p+ c #848387", +"q+ c #CDCDCD", +"r+ c #8D899C", +"s+ c #494262", +"t+ c #68627C", +"u+ c #40395A", +"v+ c #ECECEC", +"w+ c #020202", +"x+ c #B4B5B5", +"y+ c #0B0B0B", +"z+ c #313232", +"A+ c #E3E3E3", +"B+ c #B1AEBC", +"C+ c #BDBBC6", +"D+ c #3C3556", +"E+ c #898599", +"F+ c #EDEDED", +"G+ c #39393A", +"H+ c #040404", +"I+ c #333333", +"J+ c #F5F5F5", +"K+ c #2B2B2B", +"L+ c #2D2A3D", +"M+ c #B6B4C1", +"N+ c #F5F5F6", +"O+ c #605A76", +"P+ c #DAD8DF", +"Q+ c #F5F4F6", +"R+ c #615B76", +"S+ c #524D6A", +"T+ c #E4E3E8", +"U+ c #D5D5D5", +"V+ c #1B1B1B", +"W+ c #303030", +"X+ c #AAABAB", +"Y+ c #585464", +"Z+ c #B0AEBB", +"`+ c #A29FAF", +" @ c #E9E8E9", +".@ c #787779", +"+@ c #0F0E15", +"@@ c #2D2D2E", +"#@ c #595959", +"$@ c #FAFAFB", +"%@ c #807B92", +"&@ c #B0ADBB", +"*@ c #E8E7EB", +"=@ c #3A3258", +"-@ c #E6E5EA", +";@ c #DFDEE3", +">@ c #443E5E", +",@ c #BAB8C4", +"'@ c #C1BFCA", +")@ c #E0E0E5", +"!@ c #D0CED6", +"~@ c #362F52", +"{@ c #CECCD5", +"]@ c #413A5B", +"^@ c #6A657F", +"/@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 6 6 6 6 +.@.#.$.%.&. ", +" *.; ; ; ; ; ; = =.-.6 ;.>.,.,.,.,.,.'.6 ).!.~.; ; {. ", +" ].; ; ^.R h /.(._.6 6 :.<.[.[.}.<.[.[.|.1.E 2.3.4 4. ", +" 5.6.; 7...6 6 6 6 6 6 6 6 6 6 6 8.9.6 6 6 6 6 6 0.a. ", +" V @ b.c.d.6 6 6 6 6 e.6 6 6 6 6 f.f.6 6 6 6 6 6 ", +" g.h.i.6 j.6 6 6 6 6 6 6 6 6 6 f.f.6 6 6 6 6 6 k. ", +" l.; ; m.n.n.o.p.n.6 6 6 6 6 6 6 f.f.6 6 6 6 6 6 q. ", +" r.; ; s.t.; ; ; u.6 6 6 v.w.6 6 f.f.6 6 6 6 6 6 x. ", +" y.; ; ; ; z.; ; A.6 6 6 B.C.6 6 f.f.6 6 6 6 6 6 6 D., ", +" E.; ; z.; : F.G.H.6 6 6 I.J.6 K.}.L.6 6 6 6 6 6 M.z.N.O. ", +" P.; ; ; Q.R.S.6 6 6 6 6 T.U.<.U.V.w.6 6 6 6 6 6 W.; ; X.Y. ", +" Z.J ; : `.6 6 6 6 +..6 6 .+++@+6 6 6 6 6 6 6 6 #+$+; ; %+&+ ", +" *+; ; =+6 E 6 -+;+>+,+6 6 6 6 6 6 6 6 6 6 6 6 6 '+)+; ; > &+ ", +" !+; ~+{+]+6 6 >+z.; ^+/+6 6 6 6 6 6 6 6 m (+6 6 6 _+:+; ; <+[+ ", +" &+}+! |+1+2+x ; ; 3+4+5+6+l 7+6 6 6 8+9+0+a+6 6 6 b+c+d+; ; e+@ ", +" f+g+h+i+j+k+; l+m+n+; $+7+6 6 E o+; ; p+6 6 E 6 o q+; ; = r+ ", +" s+> ; ; ; ; ; ; t+u+; ; v+o.6 6 w+D ; ; x+y+6 6 6 z+A+; ; B+ ", +" > ; ; ; ; C+D+E+; ; F+G+6 6 H+I+; ; J+K+6 6 L+M+; N+3 ", +" O+P+= ; Q+R+S+T+; ; U+V+6 6 w+W+; ; ; X+o+Y+ ", +" Z+4 `+ X ; ; ; @.@W++@@@#@; ; ; z.$@%@ ", +" &@; ; ; ; ; *@=@-@; ; ; ; = ;@>@ ", +" ,@'@)@4 ; ; !@~@{@; ; ; s E+T ", +" ]@ ^@/@E+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/JackPlugin/jack.h b/SpiralSound/Plugins/JackPlugin/jack.h new file mode 100644 index 0000000..4f34f33 --- /dev/null +++ b/SpiralSound/Plugins/JackPlugin/jack.h @@ -0,0 +1,367 @@ +/* + Copyright (C) 2001 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser 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. + + $Id: jack.h,v 1.1 2002-07-28 23:18:15 nebogeo Exp $ +*/ + +#ifndef __jack_h__ +#define __jack_h__ + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include + +jack_client_t *jack_client_new (const char *client_name); +int jack_client_close (jack_client_t *client); + +/* register a function (and argument) to be called if and when the + JACK server shuts down the client thread. the function must + be written as if it were an asynchonrous POSIX signal + handler - use only async-safe functions, and remember that it + is executed from another thread. a typical function might + set a flag or write to a pipe so that the rest of the + application knows that the JACK client thread has shut + down. + + NOTE: clients do not need to call this. it exists only + to help more complex clients understand what is going + on. if called, it must be called before jack_client_activate(). +*/ + +void jack_on_shutdown (jack_client_t *, void (*function)(void *arg), void *arg); + +/* see simple_client.c to understand what these do. + */ + +int jack_set_process_callback (jack_client_t *, JackProcessCallback, void *arg); +int jack_set_buffer_size_callback (jack_client_t *, JackBufferSizeCallback, void *arg); +int jack_set_sample_rate_callback (jack_client_t *, JackSampleRateCallback, void *arg); +int jack_set_port_registration_callback (jack_client_t *, JackPortRegistrationCallback, void *); + +int jack_activate (jack_client_t *client); +int jack_deactivate (jack_client_t *client); + +/* this creates a new port for the client. + + a port is an object used for moving data in or out of the client. + the data may be of any type. ports may be connected to each other + in various ways. + + a port has a short name, which may be any non-NULL and non-zero + length string, and is passed as the first argument. a port's full + name is the name of the client concatenated with a colon (:) and + then its short name. + + a port has a type, which may be any non-NULL and non-zero length + string, and is passed as the second argument. for types that are + not built into the jack API (currently just + JACK_DEFAULT_AUDIO_TYPE) the client MUST supply a non-zero size + for the buffer as the fourth argument. for builtin types, the + fourth argument is ignored. + + a port has a set of flags, enumerated below and passed as the third + argument in the form of a bitmask created by AND-ing together the + desired flags. the flags "IsInput" and "IsOutput" are mutually + exclusive and it is an error to use them both. + +*/ + +enum JackPortFlags { + + JackPortIsInput = 0x1, + JackPortIsOutput = 0x2, + JackPortIsPhysical = 0x4, /* refers to a physical connection */ + + /* if JackPortCanMonitor is set, then a call to + jack_port_request_monitor() makes sense. + + Precisely what this means is dependent on the client. A typical + result of it being called with TRUE as the second argument is + that data that would be available from an output port (with + JackPortIsPhysical set) is sent to a physical output connector + as well, so that it can be heard/seen/whatever. + + Clients that do not control physical interfaces + should never create ports with this bit set. + */ + + JackPortCanMonitor = 0x8, + + /* JackPortIsTerminal means: + + for an input port: the data received by the port + will not be passed on or made + available at any other port + + for an output port: the data available at the port + does not originate from any + other port + + Audio synthesizers, i/o h/w interface clients, HDR + systems are examples of things that would set this + flag for their ports. + */ + + JackPortIsTerminal = 0x10 + +}; + +#define JACK_DEFAULT_AUDIO_TYPE "32 bit float mono audio" + +jack_port_t * +jack_port_register (jack_client_t *, + const char *port_name, + const char *port_type, + unsigned long flags, + unsigned long buffer_size); + +/* this removes the port from the client, disconnecting + any existing connections at the same time. +*/ + +int jack_port_unregister (jack_client_t *, jack_port_t *); + +/* a port is an opaque type. these help with a few things */ + +const char * jack_port_name (const jack_port_t *port); +const char * jack_port_short_name (const jack_port_t *port); +int jack_port_flags (const jack_port_t *port); +const char * jack_port_type (const jack_port_t *port); + +/* this returns TRUE or FALSE to indicate if there are + any connections to/from the port argument. +*/ + +int jack_port_connected (const jack_port_t *port); + +/* this returns TRUE or FALSE if the port argument is + DIRECTLY connected to the port with the name given in + `portname' +*/ + +int jack_port_connected_to (const jack_port_t *port, const char *portname); +int jack_port_connected_to_port (const jack_port_t *port, const jack_port_t *other_port); + +/* this returns a null-terminated array of port names to + which the argument port is connected. if there are no + connections, it returns NULL. + + the caller is responsible for calling free(3) on any + non-NULL returned value. +*/ + +const char ** jack_port_get_connections (const jack_port_t *port); + +/* this modifies a port's name, and may be called at any + time. +*/ + +int jack_port_set_name (jack_port_t *port, const char *name); + +/* This returns a pointer to the memory area associated with the + specified port. It can only be called from within the client's + "process" callback. For an output port, it will be a memory area + that can be written to; for an input port, it will be an area + containing the data from the port's connection(s), or + zero-filled. if there are multiple inbound connections, the data + will be mixed appropriately. + + You may not cache the values returned across process() callbacks. + There is no guarantee that the values will not change from + process() callback to process() callback. +*/ + +void *jack_port_get_buffer (jack_port_t *, nframes_t); + +/* these two functions establish and disestablish a connection + between two ports. when a connection exists, data written + to the source port will be available to be read at the destination + port. + + the types of both ports must be identical to establish a connection. + + the flags of the source port must include PortIsOutput. + the flags of the destination port must include PortIsInput. +*/ + +int jack_connect (jack_client_t *, + const char *source_port, + const char *destination_port); + +int jack_disconnect (jack_client_t *, + const char *source_port, + const char *destination_port); + +/* these two functions perform the exact same function + as the jack_connect() and jack_disconnect(), but they + use port handles rather than names, which avoids + the name lookup inherent in the name-based versions. + + it is envisaged that clients (dis)connecting their own + ports will use these two, wherease generic connection + clients (e.g. patchbays) will use the name-based + versions +*/ + +int jack_port_connect (jack_client_t *, jack_port_t *src, jack_port_t *dst); +int jack_port_disconnect (jack_client_t *, jack_port_t *); + +/* A client may call this on a pair of its own ports to + semi-permanently wire them together. This means that + a client that wants to direct-wire an input port to + an output port can call this and then no longer + have to worry about moving data between them. Any data + arriving at the input port will appear automatically + at the output port. + + The `destination' port must be an output port. The `source' + port must be an input port. Both ports must belong to + the same client. You cannot use this to tie ports between + clients. Thats what a connection is for. +*/ + +int jack_port_tie (jack_port_t *src, jack_port_t *dst); + +/* This undoes the effect of jack_port_tie(). The port + should be same as the `destination' port passed to + jack_port_tie(). +*/ + +int jack_port_untie (jack_port_t *port); + +/* a client may call this function to prevent other objects + from changing the connection status of a port. the port + must be owned by the calling client. +*/ + +int jack_port_lock (jack_client_t *, jack_port_t *); +int jack_port_unlock (jack_client_t *, jack_port_t *); + +/* returns the time (in frames) between data being available + or delivered at/to a port, and the time at which it + arrived at or is delivered to the "other side" of the port. + + e.g. for a physical audio output port, this is the time between + writing to the port and when the audio will be audible. + + for a physical audio input port, this is the time between the sound + being audible and the corresponding frames being readable from the + port. +*/ + +nframes_t jack_port_get_latency (jack_port_t *port); + +/* the port latency is zero by default. clients that control + physical hardware with non-zero latency should call this + to set the latency to its correct value. note that the value + should include any systemic latency present "outside" the + physical hardware controlled by the client. for example, + for a client controlling a digital audio interface connected + to an external digital converter, the latency setting should + include both buffering by the audio interface *and* the converter. +*/ + +void jack_port_set_latency (jack_port_t *, nframes_t); + +/* if JackPortCanMonitor is set for a port, then these 2 functions will + turn on/off input monitoring for the port. if JackPortCanMonitor + is not set, then these functions will have no effect. +*/ + +int jack_port_request_monitor (jack_port_t *port, int onoff); +int jack_port_request_monitor_by_name (jack_client_t *client, const char *port_name, int onoff); + +/* if JackPortCanMonitor is set for a port, then this function will + turn on input monitoring if it was off, and will turn it off it + only one request has been made to turn it on. if JackPortCanMonitor + is not set, then this function will do nothing. +*/ + +int jack_port_ensure_monitor (jack_port_t *port, int onoff); + +/* returns a true or false value depending on whether or not + input monitoring has been requested for `port'. +*/ + +int jack_port_monitoring_input (jack_port_t *port); + +/* this returns the sample rate of the jack system */ + +unsigned long jack_get_sample_rate (jack_client_t *); + +/* this returns the current maximum size that will + ever be passed to the "process" callback. it should only + be used *before* the client has been activated. after activation, + the client will be notified of buffer size changes if it + registers a buffer_size callback. +*/ + +nframes_t jack_get_buffer_size (jack_client_t *); + +/* This function returns a NULL-terminated array of ports that match the + specified arguments. + + port_name_pattern: a regular expression used to select ports by name. + if NULL or of zero length, no selection based on + name will be carried out. + + type_name_pattern: a regular expression used to select ports by type. + if NULL or of zero length, no selection based on + type will be carried out. + + flags: a value used to select ports by their flags. if + zero, no selection based on flags will be carried out. + + The caller is responsible for calling free(3) any non-NULL returned + value. +*/ + +const char ** jack_get_ports (jack_client_t *, + const char *port_name_pattern, + const char *type_name_pattern, + unsigned long flags); + +jack_port_t *jack_port_by_name (jack_client_t *, const char *portname); + +/* If a client is told (by the user) to become the timebase + for the entire system, it calls this function. If it + returns zero, then the client has the responsibility to + call jack_update_time() at the end of its process() + callback. Whatever time it provides (in frames since its + reference zero time) becomes the current timebase for the + entire system. +*/ + +int jack_engine_takeover_timebase (jack_client_t *); +void jack_update_time (jack_client_t *, nframes_t); + +/* this estimates the time that has passed since the + start jack server started calling the process() + callbacks of all its clients. +*/ + +nframes_t jack_frames_since_cycle_start (jack_client_t *); + +#ifdef __cplusplus +} +#endif + +#endif /* __jack_h__ */ + diff --git a/SpiralSound/Plugins/JackPlugin/port.h b/SpiralSound/Plugins/JackPlugin/port.h new file mode 100644 index 0000000..dcf4655 --- /dev/null +++ b/SpiralSound/Plugins/JackPlugin/port.h @@ -0,0 +1,102 @@ +/* + Copyright (C) 2001 Paul Davis + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser 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. + + $Id: port.h,v 1.1 2002-07-28 23:18:15 nebogeo Exp $ +*/ + +#ifndef __jack_port_h__ +#define __jack_port_h__ + +#include +#include + +typedef struct _jack_port_type_info { + const char type_name[32]; /* what do you think ? */ + + void (*mixdown)(jack_port_t *, nframes_t); /* function to mixdown multiple inputs to a buffer. can be + NULL, indicating that multiple input connections + are not legal for this data type. + */ + + long buffer_scale_factor; /* If == 1, then a buffer to handle nframes worth of + data is sizeof(sample_t) * nframes bytes large. + + If anything other than 1, the buffer allocated + for input mixing will be this value times + sizeof (sample_t) * nframes bytes in size. + + Obviously, for non-audio data types, it may have + a different value. + + if < 0, then the value should be ignored, and + port->shared->buffer_size should be used. + */ +} jack_port_type_info_t; + +/* This is the data structure allocated in shared memory + by the engine. +*/ + +typedef struct _jack_port_shared { + int shm_key; + size_t offset; + + unsigned long flags; + unsigned long buffer_size; + jack_port_id_t id; + char name[JACK_CLIENT_NAME_SIZE+JACK_PORT_NAME_SIZE+2]; + jack_port_type_info_t type_info; + jack_client_id_t client_id; + nframes_t latency; + unsigned char monitor_requests; + + char in_use : 1; + char locked : 1; + +} jack_port_shared_t; + +/* This is the data structure allocated by the client + in local memory. The `shared' pointer points + the the corresponding structure in shared memory. +*/ + +struct _jack_port { + char *client_segment_base; + struct _jack_port_shared *shared; + pthread_mutex_t connection_lock; + GSList *connections; + struct _jack_port *tied; +}; + +/* inline would be cleaner, but it needs to be fast even in non-optimized + code. +*/ + +#define jack_port_buffer(p) ((void *) ((p)->client_segment_base + (p)->shared->offset)) + +/* this is the structure allocated by the engine in local + memory. +*/ + +typedef struct _jack_port_internal { + struct _jack_port_shared *shared; + GSList *connections; + void *buffer_info; +} jack_port_internal_t; + +#endif /* __jack_port_h__ */ + diff --git a/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.C b/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.C new file mode 100644 index 0000000..0698870 --- /dev/null +++ b/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.C @@ -0,0 +1,221 @@ +/* JoystickPlugin + * Copyleft (C) 2002 William Bland + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "JoystickPlugin.h" +#include "JoystickPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +LowLevelJoystick* LowLevelJoystick::m_Singleton = NULL; +int JoystickPlugin::m_RefCount=0; +int JoystickPlugin::m_NoExecuted=0; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new JoystickPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0070; +} +} + +/////////////////////////////////////////////////////// + +JoystickPlugin::JoystickPlugin() +{ + m_RefCount++; + + m_PluginInfo.Name = "Joystick"; + m_PluginInfo.Width = 150; + m_PluginInfo.Height = 60; + m_PluginInfo.NumInputs = 0; + m_PluginInfo.NumOutputs = JP_NUMBER_OF_AXES + JP_NUMBER_OF_BUTTONS; + m_PluginInfo.PortTips.push_back("X-axis CV Out"); + m_PluginInfo.PortTips.push_back("Y-axis CV Out"); + m_PluginInfo.PortTips.push_back("Z-axis CV Out"); + m_PluginInfo.PortTips.push_back("Button 1 trigger Out"); + m_PluginInfo.PortTips.push_back("Button 2 trigger Out"); + m_PluginInfo.PortTips.push_back("Button 3 trigger Out"); + + for( int i=0; iGetJoystickAxis( i ); + LowLevelJoystick::Get()->m_invert_axis[i] = 0; + } +} + +JoystickPlugin::~JoystickPlugin() +{ + m_RefCount--; + if (m_RefCount==0) + { + LowLevelJoystick::PackUpAndGoHome(); + } +} + +PluginInfo &JoystickPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info= SpiralPlugin::Initialise(Host); + return Info; +} + +SpiralGUIType *JoystickPlugin::CreateGUI() +{ + m_GUI = new JoystickPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + + +void JoystickPlugin::Execute() +{ + // Only Read() once per set of plugins + m_NoExecuted++; + if (m_NoExecuted==m_RefCount) + { + LowLevelJoystick::Get()->Read(); + m_NoExecuted=0; + } + + float stepsize[JP_NUMBER_OF_AXES]; + float newvalue[JP_NUMBER_OF_AXES]; + + for( int i=0; iGetJoystickAxis( i ); + stepsize[i] = (newvalue[i] - m_last_axis[i]) / m_HostInfo->BUFSIZE; + } + + for( int n=0; nBUFSIZE; n++ ) + { + for( int i=0; iGetJoystickButton( i ) ); + } + + for( int i=0; iredraw(); +} + +////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////// + +LowLevelJoystick::LowLevelJoystick() : + m_InputOk(true) +{ + OpenRead(); +} + +////////////////////////////////////////////////////////////////////// + +LowLevelJoystick::~LowLevelJoystick() +{ + Close(); +} + +////////////////////////////////////////////////////////////////////// + +void LowLevelJoystick::Read() +{ + struct js_event js; + if (m_InputOk) + { + int ret = read( m_Joyfd, &js, sizeof(struct js_event) ); + if (ret == sizeof(struct js_event)) + { + switch ((js.type&3)) + { + case JS_EVENT_BUTTON: + m_button[js.number] = (float)js.value; + break; + case JS_EVENT_AXIS: + m_axis[js.number] = ((float)js.value) / 32767; + break; + } + } + } +} + +////////////////////////////////////////////////////////////////////// + +float LowLevelJoystick::GetJoystickAxis( int i ) +{ + if( m_invert_axis[i] ) + return( -m_axis[i] ); + else + return( m_axis[i] ); +} + +////////////////////////////////////////////////////////////////////// + +float LowLevelJoystick::GetJoystickButton( int i ) +{ + return( m_button[i] ); +} + +////////////////////////////////////////////////////////////////////// + +void LowLevelJoystick::Close() +{ + cerr<<"Closing joystick"< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include +#include + +#ifndef JoystickPLUGIN +#define JoystickPLUGIN + +#define JP_NUMBER_OF_AXES 3 +#define JP_NUMBER_OF_BUTTONS 3 + +class LowLevelJoystick +{ +public: + static LowLevelJoystick *Get() { if(!m_Singleton) m_Singleton=new LowLevelJoystick; return m_Singleton; } + static void PackUpAndGoHome() { if(m_Singleton) { delete m_Singleton; m_Singleton=NULL; } } + ~LowLevelJoystick(); + + void Read(); + void OpenRead(); + void Close(); + float GetJoystickAxis( int ); + float GetJoystickButton( int ); + + bool m_invert_axis[JP_NUMBER_OF_AXES]; + +private: + static LowLevelJoystick* m_Singleton; + + LowLevelJoystick(); + float m_button[JP_NUMBER_OF_BUTTONS]; + float m_axis[JP_NUMBER_OF_AXES]; + + int m_Joyfd; + bool m_InputOk; +}; + + +class JoystickPlugin : public SpiralPlugin +{ +public: + JoystickPlugin(); + virtual ~JoystickPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s) {} + virtual void StreamIn(istream &s) {} + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + +private: + static int m_RefCount; + static int m_NoExecuted; + float m_last_axis[JP_NUMBER_OF_AXES]; +}; + +#endif diff --git a/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.pro b/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.pro new file mode 100644 index 0000000..63f3a5c --- /dev/null +++ b/SpiralSound/Plugins/JoystickPlugin/JoystickPlugin.pro @@ -0,0 +1,19 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../RiffWav.h \ + JoystickPlugin.h \ + JoystickPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + JoystickPlugin.C \ + JoystickPluginGUI.C + +TARGET = JoystickPlugin.so diff --git a/SpiralSound/Plugins/JoystickPlugin/JoystickPluginGUI.C b/SpiralSound/Plugins/JoystickPlugin/JoystickPluginGUI.C new file mode 100644 index 0000000..f0b56d4 --- /dev/null +++ b/SpiralSound/Plugins/JoystickPlugin/JoystickPluginGUI.C @@ -0,0 +1,90 @@ +/* JoystickPlugin + * Copyleft (C) 2002 William Bland + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "JoystickPluginGUI.h" +#include + +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +JoystickPluginGUI::JoystickPluginGUI(int w, int h,JoystickPlugin *o,const HostInfo *Info) : + SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + Invertx = new Fl_Button(0, 20, 50, 20, "Invert x"); + Invertx->type(1); + Invertx->down_box(FL_DOWN_BOX); + Invertx->labelsize(10); + Invertx->callback((Fl_Callback*)cb_Invertx); + + Inverty = new Fl_Button(50, 20, 50, 20, "Invert y"); + Inverty->type(1); + Inverty->down_box(FL_DOWN_BOX); + Inverty->labelsize(10); + Inverty->callback((Fl_Callback*)cb_Inverty); + + Invertz = new Fl_Button(100, 20, 50, 20, "Invert z"); + Invertz->type(1); + Invertz->down_box(FL_DOWN_BOX); + Invertz->labelsize(10); + Invertz->callback((Fl_Callback*)cb_Invertz); + + valuex = new Fl_Box( 0, 40, 50, 20 ); + valuey = new Fl_Box( 50, 40, 50, 20 ); + valuez = new Fl_Box( 100, 40, 50, 20 ); + + end(); +} + +char xbuffer[20]; +char ybuffer[20]; +char zbuffer[20]; + +void JoystickPluginGUI::UpdateValues() +{ + snprintf( xbuffer, 20, "%.3f", LowLevelJoystick::Get()->GetJoystickAxis( 0 ) ); + valuex->label( xbuffer ); + snprintf( ybuffer, 20, "%.3f", LowLevelJoystick::Get()->GetJoystickAxis( 1 ) ); + valuey->label( ybuffer ); + snprintf( zbuffer, 20, "%.3f", LowLevelJoystick::Get()->GetJoystickAxis( 2 ) ); + valuez->label( zbuffer ); + Fl::check(); +} + +void JoystickPluginGUI::draw() +{ + SpiralGUIType::draw(); + UpdateValues(); +} + +inline void JoystickPluginGUI::cb_Invert_ix(Fl_Button* o, void* v) +{ LowLevelJoystick::Get()->m_invert_axis[0] = o->value(); } +void JoystickPluginGUI::cb_Invertx(Fl_Button* o, void* v) +{ ((JoystickPluginGUI*)(o->parent()))->cb_Invert_ix(o,v); } + +inline void JoystickPluginGUI::cb_Invert_iy(Fl_Button* o, void* v) +{ LowLevelJoystick::Get()->m_invert_axis[1] = o->value(); } +void JoystickPluginGUI::cb_Inverty(Fl_Button* o, void* v) +{ ((JoystickPluginGUI*)(o->parent()))->cb_Invert_iy(o,v); } + +inline void JoystickPluginGUI::cb_Invert_iz(Fl_Button* o, void* v) +{ LowLevelJoystick::Get()->m_invert_axis[2] = o->value(); } +void JoystickPluginGUI::cb_Invertz(Fl_Button* o, void* v) +{ ((JoystickPluginGUI*)(o->parent()))->cb_Invert_iz(o,v); } diff --git a/SpiralSound/Plugins/JoystickPlugin/JoystickPluginGUI.h b/SpiralSound/Plugins/JoystickPlugin/JoystickPluginGUI.h new file mode 100644 index 0000000..ca4dd19 --- /dev/null +++ b/SpiralSound/Plugins/JoystickPlugin/JoystickPluginGUI.h @@ -0,0 +1,64 @@ +/* JoystickPlugin + * Copyleft (C) 2002 William Bland + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include + +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "JoystickPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef SCOPEGUI +#define SCOPEGUI + +class JoystickPluginGUI : public SpiralPluginGUI +{ +public: + JoystickPluginGUI(int w, int h, JoystickPlugin *o,const HostInfo *Info); + + virtual void draw(); + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + JoystickPlugin *m_Plugin; + +private: + Fl_Button *Invertx; + Fl_Button *Inverty; + Fl_Button *Invertz; + Fl_Box *valuex; + Fl_Box *valuey; + Fl_Box *valuez; + + //// Callbacks //// + inline void cb_Invert_ix(Fl_Button* o, void* v); + static void cb_Invertx(Fl_Button* o, void* v); + inline void cb_Invert_iy(Fl_Button* o, void* v); + static void cb_Inverty(Fl_Button* o, void* v); + inline void cb_Invert_iz(Fl_Button* o, void* v); + static void cb_Invertz(Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/JoystickPlugin/Makefile.in b/SpiralSound/Plugins/JoystickPlugin/Makefile.in new file mode 100644 index 0000000..0935d33 --- /dev/null +++ b/SpiralSound/Plugins/JoystickPlugin/Makefile.in @@ -0,0 +1,169 @@ +############################################################################# +# Makefile for building JoystickPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: JoystickPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + JoystickPlugin.h \ + JoystickPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + JoystickPlugin.C \ + JoystickPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + JoystickPlugin.o \ + JoystickPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = JoystickPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake JoystickPlugin.pro + +dist: + $(TAR) JoystickPlugin.tar JoystickPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) JoystickPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +JoystickPlugin.o: JoystickPlugin.C \ + JoystickPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + JoystickPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +JoystickPluginGUI.o: JoystickPluginGUI.C \ + JoystickPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + JoystickPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + + diff --git a/SpiralSound/Plugins/JoystickPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/JoystickPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..e1448a5 --- /dev/null +++ b/SpiralSound/Plugins/JoystickPlugin/SpiralIcon.xpm @@ -0,0 +1,313 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 274 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #5B5571", +"@. c #393643", +"#. c #47415F", +"$. c #9692A4", +"%. c #D9D8DE", +"&. c #F7F7F8", +"*. c #918DA0", +"=. c #B8B5C1", +"-. c #D1D1D1", +";. c #252525", +">. c #5C5C00", +",. c #727175", +"'. c #FEFEFF", +"). c #9D99AA", +"!. c #DBD9E0", +"~. c #E9E9E9", +"{. c #CBCBCB", +"]. c #E0E0E0", +"^. c #6C6C6C", +"/. c #FFFF00", +"(. c #515151", +"_. c #A6A6A7", +":. c #827E93", +"<. c #615C77", +"[. c #EAEAED", +"}. c #DFDFE1", +"|. c #1E1D24", +"1. c #9894A7", +"2. c #B1AEBB", +"3. c #69686F", +"4. c #000001", +"5. c #0A0A00", +"6. c #615C76", +"7. c #5F5A75", +"8. c #413E4D", +"9. c #020203", +"0. c #1A1A1C", +"a. c #C3C1CB", +"b. c #9D9D9D", +"c. c #202020", +"d. c #383838", +"e. c #4C4C4C", +"f. c #111112", +"g. c #C9C7D0", +"h. c #F1F1F1", +"i. c #F8F8F8", +"j. c #232323", +"k. c #010100", +"l. c #050408", +"m. c #AEACB9", +"n. c #FEFEFE", +"o. c #1D1D1D", +"p. c #020200", +"q. c #B7B5C1", +"r. c #9390A2", +"s. c #BBBBBB", +"t. c #414141", +"u. c #030303", +"v. c #28272A", +"w. c #F4F4F6", +"x. c #605B76", +"y. c #736E86", +"z. c #D8D8D8", +"A. c #727272", +"B. c #101010", +"C. c #848486", +"D. c #CCCBD3", +"E. c #747087", +"F. c #6D6881", +"G. c #1C1C1C", +"H. c #242424", +"I. c #656566", +"J. c #F6F6F6", +"K. c #E8E6EA", +"L. c #706B84", +"M. c #E3E1E6", +"N. c #474746", +"O. c #151515", +"P. c #C8C8C8", +"Q. c #AEAEAE", +"R. c #080808", +"S. c #373639", +"T. c #FDFCFE", +"U. c #ABA8B7", +"V. c #F1F0F3", +"W. c #6D6980", +"X. c #0A090E", +"Y. c #95929E", +"Z. c #0A0810", +"`. c #050505", +" + c #5B5A5C", +".+ c #F7F6F7", +"++ c #F4F3F5", +"@+ c #908C9F", +"#+ c #C8C6D0", +"$+ c #837E96", +"%+ c #86868A", +"&+ c #070608", +"*+ c #ECEBEE", +"=+ c #646078", +"-+ c #AFAFB0", +";+ c #454545", +">+ c #333408", +",+ c #7A7A7A", +"'+ c #C8C8C9", +")+ c #212025", +"!+ c #060607", +"~+ c #969699", +"{+ c #FAFAFA", +"]+ c #F8F8F9", +"^+ c #A29EAF", +"/+ c #F7F6F8", +"(+ c #F0F0F1", +"_+ c #B8B7B9", +":+ c #E4E4E4", +"<+ c #FDFDFD", +"[+ c #A5A2B2", +"}+ c #3B3456", +"|+ c #A8A5B4", +"1+ c #525252", +"2+ c #848387", +"3+ c #CDCDCD", +"4+ c #8D899C", +"5+ c #494262", +"6+ c #68627C", +"7+ c #40395A", +"8+ c #ECECEC", +"9+ c #020202", +"0+ c #B4B5B5", +"a+ c #0B0B0B", +"b+ c #313232", +"c+ c #E3E3E3", +"d+ c #B1AEBC", +"e+ c #BDBBC6", +"f+ c #3C3556", +"g+ c #898599", +"h+ c #EDEDED", +"i+ c #39393A", +"j+ c #040404", +"k+ c #333333", +"l+ c #F5F5F5", +"m+ c #2B2B2B", +"n+ c #2D2A3D", +"o+ c #B6B4C1", +"p+ c #F5F5F6", +"q+ c #605A76", +"r+ c #DAD8DF", +"s+ c #F5F4F6", +"t+ c #615B76", +"u+ c #524D6A", +"v+ c #E4E3E8", +"w+ c #D5D5D5", +"x+ c #1B1B1B", +"y+ c #303030", +"z+ c #AAABAB", +"A+ c #585464", +"B+ c #B0AEBB", +"C+ c #A29FAF", +"D+ c #E9E8E9", +"E+ c #787779", +"F+ c #0F0E15", +"G+ c #2D2D2E", +"H+ c #595959", +"I+ c #FAFAFB", +"J+ c #807B92", +"K+ c #B0ADBB", +"L+ c #E8E7EB", +"M+ c #3A3258", +"N+ c #E6E5EA", +"O+ c #DFDEE3", +"P+ c #443E5E", +"Q+ c #BAB8C4", +"R+ c #C1BFCA", +"S+ c #E0E0E5", +"T+ c #D0CED6", +"U+ c #362F52", +"V+ c #CECCD5", +"W+ c #413A5B", +"X+ c #6A657F", +"Y+ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 6 6 6 +.@.#.$.%.&.*. ", +" =.; ; ; ; ; ; = -.;.6 6 6 >.>.>.6 6 6 6 E ,.'.; ; ). ", +" !.; ; ~.R h {.].^.6 6 6 >./././.6 6 6 6 6 E (._.4 :. ", +" <.[.; }...6 6 6 6 6 6 6 6 /./././.>.6 6 6 6 6 6 |.1. ", +" V @ 2.3.4.6 6 6 6 6 5.6 6 >././././.6 6 6 6 6 6 ", +" 6.7.8.6 9.6 6 6 6 6 6 6 6 6 /././.6 6 6 6 6 6 0. ", +" a.; ; b.c.c.d.e.c.6 6 6 6 6 6 >././.6 6 6 6 6 6 f. ", +" g.; ; h.i.; ; ; j.6 k.6 6 6 6 /././.6 6 6 6 6 6 l. ", +" m.; ; ; ; n.; ; o.6 p.6 6 6 6 >././.6 6 6 6 6 6 6 q., ", +" r.; ; n.; : s.t.u.6 6 6 6 6 6 /././.6 6 6 6 6 6 v.n.w.x. ", +" y.; ; ; z.A.B.6 6 6 6 6 6 6 >.>././.>.6 6 6 6 6 C.; ; D.E. ", +" F.J ; : G.6 6 6 6 H...6 >./././././././.>.6 6 6 I.J.; ; K.L. ", +" M.; ; N.6 E 6 O.P.Q.R./././././././././.6 6 6 6 S.T.; ; > L. ", +" U.; V.W.X.6 6 Q.n.; Y.Z.6 6 6 6 6 6 6 +.m `.6 6 6 +.+; ; ++@+ ", +" L.#+! $+%+&+x ; ; *++.=+-+l ;+6 6 6 >+,+'+)+6 6 6 !+~+{+; ; ]+@ ", +" ^+/+(+_+:+<+; [+}+|+; J.;+6 6 E 1+; ; 2+6 6 E 6 o 3+; ; = 4+ ", +" 5+> ; ; ; ; ; ; 6+7+; ; 8+d.6 6 9+D ; ; 0+a+6 6 6 b+c+; ; d+ ", +" > ; ; ; ; e+f+g+; ; h+i+6 6 j+k+; ; l+m+6 6 n+o+; p+3 ", +" q+r+= ; s+t+u+v+; ; w+x+6 6 9+y+; ; ; z+1+A+ ", +" B+4 C+ X ; ; ; D+E+y+F+G+H+; ; ; n.I+J+ ", +" K+; ; ; ; ; L+M+N+; ; ; ; = O+P+ ", +" Q+R+S+4 ; ; T+U+V+; ; ; s g+T ", +" W+ X+Y+g+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.C b/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.C new file mode 100644 index 0000000..14e2ca6 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.C @@ -0,0 +1,470 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "LADSPAPlugin.h" +#include "LADSPAPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "utils.h" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new LADSPAPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0016; +} +} + +/////////////////////////////////////////////////////// + +LADSPAPlugin::LADSPAPlugin() : +PlugHandle(0), +PlugDesc(NULL), +m_Gain(1.0f), +m_Amped(false) +{ + m_Version=3; + + m_PluginInfo.Name="LADSPA"; + m_PluginInfo.Width=600; + m_PluginInfo.Height=300; + m_PluginInfo.NumInputs=0; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Nuffink yet"); +} + +LADSPAPlugin::~LADSPAPlugin() +{ +} + +PluginInfo &LADSPAPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + LADSPA_Data *NewPort = new LADSPA_Data[m_HostInfo->BUFSIZE]; + m_LADSPABufVec.push_back(NewPort); + return Info; +} + +SpiralGUIType *LADSPAPlugin::CreateGUI() +{ + m_GUI = new LADSPAPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void LADSPAPlugin::Execute() +{ + if (PlugDesc) + { + // convert inputs if exist (zero if not) + for (int n=0; nBUFSIZE; i++) + { + m_LADSPABufVec[n][i]=Offset+(GetInput(n,i)*0.5f+0.5f)*Scale; + //cerr<BUFSIZE; i++) + { + m_LADSPABufVec[n][i]=GetInput(n,i); + } + } + // Update the GUI outputs with the first value in the buffer + ((LADSPAPluginGUI*)m_GUI)->UpdatePortDisplay(n,m_LADSPABufVec[n][0]); + } + else // zero + { + for (int i=0; iBUFSIZE; i++) m_LADSPABufVec[n][i]=0; + } + } + + // run plugin + PlugDesc->run(PlugInstHandle,m_HostInfo->BUFSIZE); + + // convert outputs + for (int n=0; nBUFSIZE; i++) + { + SetOutput(n,i,m_LADSPABufVec[n+m_PluginInfo.NumInputs][i]*m_Gain*10); + } + } + else*/ + { + for (int i=0; iBUFSIZE; i++) + { + SetOutput(n,i,m_LADSPABufVec[n+m_PluginInfo.NumInputs][i]*m_Gain); + } + } + } + } +} + +void LADSPAPlugin::StreamOut(ostream &s) +{ + s<GetFilename()<<" "; + s<<((LADSPAPluginGUI*)m_GUI)->GetLabel()<<" "; + s<::iterator i=m_PortMin.begin(); + i!=m_PortMin.end(); i++) + { + s<<*i<<" "; + } + for (vector::iterator i=m_PortMax.begin(); + i!=m_PortMax.end(); i++) + { + s<<*i<<" "; + } + for (vector::iterator i=m_PortClamp.begin(); + i!=m_PortClamp.end(); i++) + { + s<<*i<<" "; + } + } + break; + case 2: +// Here for consistency - should never actually happen, as +// version is always 3! + { + s<GetFilename()<<" "; + s<<((LADSPAPluginGUI*)m_GUI)->GetLabel()<<" "; + s<::iterator i=m_PortMin.begin(); + i!=m_PortMin.end(); i++) + { + s<<*i<<" "; + } + for (vector::iterator i=m_PortMax.begin(); + i!=m_PortMax.end(); i++) + { + s<<*i<<" "; + } + } + break; + + case 1: + { + s<GetFilename()<<" "; + s<<((LADSPAPluginGUI*)m_GUI)->GetLabel()<<" "; + } + break; + } +} + +void LADSPAPlugin::StreamIn(istream &s) +{ + int version; + s>>version; + + switch (version) + { + case 3: + { + s>>m_Gain; + + string Filename,Label; + s>>Filename>>Label; + int PortCount; + s>>PortCount; + float min,max; + bool clamp; + + for (int n=0; n>min; + m_PortMin.push_back(min); + } + + for (int n=0; n>max; + m_PortMax.push_back(max); + } + for (int n=0; n>clamp; + m_PortClamp.push_back(clamp); + } + + if (Filename!="None") + { + UpdatePlugin(Filename.c_str(), Label.c_str(), false); + } + + for (int n=0; nSetMinMax(n,m_PortMin[n],m_PortMax[n],m_PortClamp[n]); + } + } + break; + + case 2: + { + s>>m_Gain; + + string Filename,Label; + s>>Filename>>Label; + int PortCount; + s>>PortCount; + float min,max; + for (int n=0; n>min; + m_PortMin.push_back(min); + } + + for (int n=0; n>max; + m_PortMax.push_back(max); + } + + for (int n=0; nSetMinMax(n,m_PortMin[n],m_PortMax[n],m_PortClamp[n]); + } + } + break; + + case 1: + { + s>>m_Gain; + + string Filename,Label; + s>>Filename>>Label; + + if (Filename!="None") + { + UpdatePlugin(Filename.c_str(), Label.c_str()); + } + } + break; + } +} + +bool LADSPAPlugin::UpdatePlugin(const char * filename, const char * label, bool PortClampReset) +{ + // first call with same info, to clear the ports + UpdatePluginInfoWithHost(); + + if (PlugHandle) { + if (PlugDesc->deactivate) PlugDesc->deactivate(PlugInstHandle); + PlugDesc->cleanup(PlugInstHandle); + unloadLADSPAPluginLibrary(PlugHandle); + PlugHandle = 0; + } + + if ((PlugHandle = loadLADSPAPluginLibrary(filename))) { + if (!(PlugDesc = findLADSPAPluginDescriptor(PlugHandle, filename, label))) { + unloadLADSPAPluginLibrary(PlugHandle); + PlugHandle = 0; + } else { + /* Now we can instantiate the LADSPA Plugin and wire it to the datas bytes */ + if (!(PlugInstHandle = PlugDesc->instantiate(PlugDesc, m_HostInfo->SAMPLERATE))) { + cerr << "LADSPA Plugin error to instantiate...\n"; + unloadLADSPAPluginLibrary(PlugHandle); + PlugDesc = 0; + PlugHandle = 0; + return 0; + } + + m_PluginInfo.NumInputs=getPortCountByType(PlugDesc, LADSPA_PORT_INPUT); + m_PluginInfo.NumOutputs=getPortCountByType(PlugDesc, LADSPA_PORT_OUTPUT); + +///////////////////////////////// +// LADSPA Buffers + + for(vector::iterator i=m_LADSPABufVec.begin(); + i!=m_LADSPABufVec.end(); i++) + { + if (*i) delete[] (*i); + } + m_LADSPABufVec.clear(); + + unsigned long c=0; + for (unsigned int n=0; nPortCount; n++) + { + if (LADSPA_IS_PORT_INPUT(PlugDesc->PortDescriptors[n])) + { + LADSPA_Data *NewPort = new LADSPA_Data[m_HostInfo->BUFSIZE]; + m_LADSPABufVec.push_back(NewPort); + PlugDesc->connect_port(PlugInstHandle, n, m_LADSPABufVec[c]); + m_PortID.push_back(n); + c++; + } + } + + for (unsigned int n=0; nPortCount; n++) + { + if (LADSPA_IS_PORT_OUTPUT(PlugDesc->PortDescriptors[n])) + { + LADSPA_Data *NewPort = new LADSPA_Data[m_HostInfo->BUFSIZE]; + m_LADSPABufVec.push_back(NewPort); + PlugDesc->connect_port(PlugInstHandle, n, m_LADSPABufVec[c]); + m_PortID.push_back(n); + c++; + } + } + + // activate the plugin now + if (PlugDesc->activate) + PlugDesc->activate(PlugInstHandle); + +///////////////////////////////// +// SSM Buffers + + // Clear i/o buffers + RemoveAllInputs(); + RemoveAllOutputs(); + + // Reallocate the i/o buffers required + for (int n=0; nSetName(PlugDesc->Name); + ((LADSPAPluginGUI*)m_GUI)->SetMaker(PlugDesc->Maker); + + m_PluginInfo.PortTips.clear(); + ((LADSPAPluginGUI*)m_GUI)->ClearPortInfo(); + + string desc; + c=0; + for (unsigned int i = 0; i < PlugDesc->PortCount; i++) + { + if (LADSPA_IS_PORT_INPUT(PlugDesc->PortDescriptors[i])) + { + desc = string(PlugDesc->PortNames[i]) + + (LADSPA_IS_PORT_CONTROL(PlugDesc->PortDescriptors[i]) ? " (CV)" : " (AU)"); + m_PluginInfo.PortTips.push_back(desc.c_str()); + ((LADSPAPluginGUI*)m_GUI)->AddPortInfo(m_PluginInfo.PortTips[c].c_str()); + c++; + } + } + + for (unsigned int i = 0; i < PlugDesc->PortCount; i++) + { + if (LADSPA_IS_PORT_OUTPUT(PlugDesc->PortDescriptors[i])) { + + desc = string(PlugDesc->PortNames[i]) + + (LADSPA_IS_PORT_CONTROL(PlugDesc->PortDescriptors[i]) ? " (CV)" : " (AU)"); + + m_PluginInfo.PortTips.push_back(desc.c_str()); + } + } + + ((LADSPAPluginGUI*)m_GUI)->SetFilename(filename); + ((LADSPAPluginGUI*)m_GUI)->SetLabel(label); + + UpdatePluginInfoWithHost(); + + if (PortClampReset) + { + m_PortMin.clear(); + m_PortMax.clear(); + m_PortClamp.clear(); + + for (int n=0; nPortRangeHints[Port].HintDescriptor; + if (LADSPA_IS_HINT_BOUNDED_BELOW(HintDesc)) + { + Min=PlugDesc->PortRangeHints[Port].LowerBound; + if (LADSPA_IS_HINT_SAMPLE_RATE(HintDesc)) + { + Min*=m_HostInfo->SAMPLERATE; + } + } + if (LADSPA_IS_HINT_BOUNDED_ABOVE(HintDesc)) + { + Max=PlugDesc->PortRangeHints[Port].UpperBound; + if (LADSPA_IS_HINT_SAMPLE_RATE(HintDesc)) + { + Max*=m_HostInfo->SAMPLERATE; + } + } + + m_PortMin.push_back(Min); + m_PortMax.push_back(Max); +// PortClamp defaults to true + m_PortClamp.push_back(true); + + ((LADSPAPluginGUI*)m_GUI)->SetMinMax(n, Min, Max, true); + } + } + return true; + } + } + + cerr << "Error loading LADSPA Plugin.\n"; + + return false; +} + diff --git a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.h b/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.h new file mode 100644 index 0000000..22aba89 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.h @@ -0,0 +1,69 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include +#include "ladspa.h" + +#ifndef LADSPAPLUGIN +#define LADSPAPLUGIN + +static const unsigned int NUM_PORTS = 8; + +class LADSPAPlugin : public SpiralPlugin +{ +public: + LADSPAPlugin(); + virtual ~LADSPAPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetGain(float s) { m_Gain=s; } + float GetGain() { return m_Gain; } + void SetMin(int n,float min) { m_PortMin[n]=min; } + void SetMax(int n,float max) { m_PortMax[n]=max; } + void SetPortClamp(int n,bool i) { m_PortClamp[n]=i; } + void SetAmped(bool s) { m_Amped=s; } + bool GetAmped() { return m_Amped; } + + bool UpdatePlugin(const char * filename, const char * label, bool PortClampReset=true); + const LADSPA_Descriptor * GetPlugDesc(void) { return PlugDesc; } + +private: + void * PlugHandle; + const LADSPA_Descriptor * PlugDesc; + + vector m_LADSPABufVec; + LADSPA_Handle PlugInstHandle; + vector m_PortID; + vector m_PortMin; + vector m_PortMax; + vector m_PortClamp; + + float m_Gain; + bool m_Amped; +}; + +#endif diff --git a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.pro b/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.pro new file mode 100644 index 0000000..5ea4fa5 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/LADSPAPlugin.pro @@ -0,0 +1,23 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + LADSPAPlugin.h \ + LADSPAPluginGUI.h \ + String.h \ + utils.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + LADSPAPlugin.C \ + LADSPAPluginGUI.C \ + String.cc \ + load.c \ + misc.c \ + search.c + +TARGET = LADSPAPlugin.so diff --git a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPluginGUI.C b/SpiralSound/Plugins/LADSPAPlugin/LADSPAPluginGUI.C new file mode 100644 index 0000000..9f45af7 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/LADSPAPluginGUI.C @@ -0,0 +1,334 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * LADSPA Plugin by Nicolas Noble + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "LADSPAPluginGUI.h" +#include +#include +#include "ladspa.h" +#include +#include +#include +#include +#include +#include "utils.h" + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +/* FIXME: No matter what, I can't let this as it!! */ +static LADSPAPluginGUI * lg = NULL; + +void describePluginLibrary(const char * pcFullFilename, void * pvPluginHandle, + LADSPA_Descriptor_Function pfDescriptorFunction) { + const LADSPA_Descriptor * psDescriptor; + long lIndex; + unsigned long lPluginIndex; + unsigned long lPortIndex; + unsigned long lLength; + LADSPA_PortRangeHintDescriptor iHintDescriptor; + LADSPA_Data fBound; + +#define testcond(c,s) { \ + if (!(c)) { \ + cerr << (s); \ + failure = 1; \ + } \ +} + for (lIndex = 0; (psDescriptor = pfDescriptorFunction(lIndex)) != NULL; lIndex++) { + int failure = 0; + testcond(!LADSPA_IS_REALTIME(psDescriptor->Properties), "ERROR: PLUGIN MUST RUN REAL TIME.\n"); + testcond(psDescriptor->instantiate, "ERROR: PLUGIN HAS NO INSTANTIATE FUNCTION.\n"); + testcond(psDescriptor->connect_port, "ERROR: PLUGIN HAS NO CONNECT_PORT FUNCTION.\n"); + testcond(psDescriptor->run, "ERROR: PLUGIN HAS NO RUN FUNCTION.\n"); + testcond(!(psDescriptor->run_adding != 0 && psDescriptor->set_run_adding_gain == 0), + "ERROR: PLUGIN HAS RUN_ADDING FUNCTION BUT NOT SET_RUN_ADDING_GAIN.\n"); + testcond(!(psDescriptor->run_adding == 0 && psDescriptor->set_run_adding_gain != 0), + "ERROR: PLUGIN HAS SET_RUN_ADDING_GAIN FUNCTION BUT NOT RUN_ADDING.\n"); + testcond(psDescriptor->cleanup, "ERROR: PLUGIN HAS NO CLEANUP FUNCTION.\n"); + testcond(!LADSPA_IS_INPLACE_BROKEN(psDescriptor->Properties), + "ERROR: THIS PLUGIN CANNOT USE IN-PLACE PROCESSING.\n"); + testcond(psDescriptor->PortCount, "ERROR: PLUGIN HAS NO PORTS.\n"); + + if (!failure) { + LPluginInfo pi; + pi.Filename = pcFullFilename; + pi.Label = psDescriptor->Label; + pi.Name = psDescriptor->Name; + /* ARGH! I really can't stand this ugly hack */ + lg->PluginList.push_back(pi); + } else { + cerr << "Plugin ignored...\n\n"; + } + } + + dlclose(pvPluginHandle); +} + +void LADSPAPluginGUI::refreshPluginList(void) +{ + PluginList.clear(); + CurrentPlugin.Name = ""; + CurrentPlugin.Filename = ""; + CurrentPlugin.Label = ""; + + lg = this; + LADSPAPluginSearch(describePluginLibrary); + lg = NULL; + + m_Browser->clear(); + + sort(PluginList.begin(), PluginList.end(), LPluginInfoSortAsc()); + + for (vector::iterator i = PluginList.begin(); i != PluginList.end(); i++) + { + m_Browser->add((*i).Name.c_str()); + } +} + +LADSPAPluginGUI::LADSPAPluginGUI(int w, int h,LADSPAPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Filename="None"; + + m_Plugin=o; + + int Width=20; + int Height=100; + + m_Browser= new Fl_Hold_Browser(5,20,290,260,"LADSPA Plugins"); + m_Browser->callback((Fl_Callback*)cb_Select); + + m_InputScroll = new Fl_Scroll(300,80,290,150," Value Min Max Clamp?"); + m_InputScroll->align(FL_ALIGN_TOP_LEFT); + m_InputScroll->type(Fl_Scroll::VERTICAL); + m_InputScroll->box(FL_DOWN_BOX); + add(m_InputScroll); + m_InputPack = new Fl_Pack(300,85,300,100,""); + m_InputScroll->add(m_InputPack); + + m_Name = new Fl_Box(290,20,10,20,"None"); + m_Name->align(FL_ALIGN_RIGHT); + m_Name->labelcolor(GUI_COLOUR); + m_Name->labelsize(10); + add(m_Name); + + m_Maker = new Fl_Box(290,40,10,20,"None"); + m_Maker->align(FL_ALIGN_RIGHT); + m_Maker->labelcolor(GUI_COLOUR); + m_Maker->labelsize(10); + add(m_Maker); + + m_OutputGain = new Fl_Knob(545,240,40,40,"Output Gain"); + m_OutputGain->color(GUI_COLOUR); + m_OutputGain->type(Fl_Knob::DOTLIN); + m_OutputGain->maximum(2); + m_OutputGain->step(0.001); + m_OutputGain->value(1.0); + m_OutputGain->labelsize(10); + m_OutputGain->callback((Fl_Callback*)cb_Gain); + add(m_OutputGain); + + m_UpdateInputs = new Fl_Button(480,252,50,25,"Refresh"); + m_UpdateInputs->labelsize(10); + m_UpdateInputs->value(1); + m_UpdateInputs->type(1); + add(m_UpdateInputs); + + m_UpdateMinMax = new Fl_Button(400,252,85,25,"Update Min/Max"); + m_UpdateMinMax->labelsize(10); + m_UpdateMinMax->callback((Fl_Callback*)cb_MinMax); + add(m_UpdateMinMax); + + m_PowerAmp = new Fl_Button(320,252,80,25,"PowerAmp"); + m_PowerAmp->labelsize(10); + m_PowerAmp->value(0); + m_PowerAmp->type(1); + m_PowerAmp->callback((Fl_Callback*)cb_PowerAmp); + add(m_PowerAmp); + + inited = 0; + refreshPluginList(); + inited = 1; + + end(); +} + +LADSPAPluginGUI::~LADSPAPluginGUI(void) +{ + Fl::check(); +} + +void LADSPAPluginGUI::UpdatePortDisplay(int n, float v) +{ + if (!m_UpdateInputs->value()) return; + + char temp[256]; + sprintf(temp,"%f",v); + m_PortOutput[n]->value(temp); +} + +void LADSPAPluginGUI::SetMinMax(int n, float min, float max, bool clamp) +{ + char temp[256]; + sprintf(temp,"%f",min); + m_PortMin[n]->value(temp); + + sprintf(temp,"%f",max); + m_PortMax[n]->value(temp); + + sprintf(temp, "%d",clamp); + m_PortClamp[n]->value(atoi(temp)); +} + +void LADSPAPluginGUI::GetMinMax(int n, float &min, float &max, bool &clamp) +{ + min = atof(m_PortMin[n]->value()); + max = atof(m_PortMax[n]->value()); + clamp = m_PortClamp[n]->value(); +} + +void LADSPAPluginGUI::SetName(const char *s) +{ + m_Name->label(s); +} + +void LADSPAPluginGUI::SetMaker(const char *s) +{ + m_Maker->label(s); +} + +void LADSPAPluginGUI::ClearPortInfo() +{ + for (vector::iterator i=m_PackVec.begin(); + i!=m_PackVec.end(); i++) + { + m_InputPack->remove((*i)); + } + + m_InputScroll->remove(m_InputPack); + delete m_InputPack; + m_InputPack = new Fl_Pack(300,85,300,100,""); + m_InputScroll->add(m_InputPack); + + m_PortOutput.clear(); + m_PackVec.clear(); + m_PortMin.clear(); + m_PortMax.clear(); + m_PortClamp.clear(); +} + +void LADSPAPluginGUI::AddPortInfo(const char *Info) +{ + Fl_Group* NewGroup = new Fl_Group(0,85,150,15,""); + NewGroup->box(FL_FLAT_BOX); + m_InputPack->add(NewGroup); + m_PackVec.push_back(NewGroup); + + Fl_Box* NewText = new Fl_Box(100,85,80,15,""); + NewText->label(Info); + NewText->labelsize(8); + NewText->align(FL_ALIGN_LEFT|FL_ALIGN_INSIDE); + NewGroup->add(NewText); + + Fl_Output* NewOutput = new Fl_Output(5,85,20,15,""); + NewOutput->value(0); + NewOutput->textsize(10); + NewGroup->add(NewOutput); + m_PortOutput.push_back(NewOutput); + + Fl_Input* NewInput = new Fl_Input(26,85,20,15,""); + NewInput->value(0); + NewInput->textsize(10); + NewGroup->add(NewInput); + m_PortMin.push_back(NewInput); + + NewInput = new Fl_Input(47,85,20,15,""); + NewInput->value(0); + NewInput->textsize(10); + NewGroup->add(NewInput); + m_PortMax.push_back(NewInput); + + Fl_Check_Button* NewCheckButton = new Fl_Check_Button(80,85,15,15,""); + NewCheckButton->value(0); + NewGroup->add(NewCheckButton); + m_PortClamp.push_back(NewCheckButton); + + NewGroup->redraw(); + m_InputPack->redraw(); + m_InputScroll->redraw(); + + redraw(); +} + + +void LADSPAPluginGUI::UpdateValues() +{ + m_OutputGain->value(m_Plugin->GetGain()); +} + +inline void LADSPAPluginGUI::cb_Gain_i(Fl_Knob* o, void* v) +{ m_Plugin->SetGain(o->value()); } +void LADSPAPluginGUI::cb_Gain(Fl_Knob* o, void* v) +{ ((LADSPAPluginGUI*)(o->parent()))->cb_Gain_i(o,v); } + +inline void LADSPAPluginGUI::cb_Select_i(Fl_Hold_Browser* o) +{ + m_Filename=PluginList[o->value()-1].Filename; + m_Label=PluginList[o->value()-1].Label; + m_Plugin->UpdatePlugin(m_Filename.c_str(), m_Label.c_str()); +} +void LADSPAPluginGUI::cb_Select(Fl_Hold_Browser* o) +{ ((LADSPAPluginGUI*)(o->parent()))->cb_Select_i(o);} + +inline void LADSPAPluginGUI::cb_MinMax_i(Fl_Button* o, void* v) +{ + int n=0; + for (vector::iterator i=m_PortMin.begin(); + i!=m_PortMin.end(); i++) + { + m_Plugin->SetMin(n,atof((*i)->value())); + n++; + } + n=0; + for (vector::iterator i=m_PortMax.begin(); + i!=m_PortMax.end(); i++) + { + m_Plugin->SetMax(n,atof((*i)->value())); + n++; + } + n=0; + for (vector::iterator i=m_PortClamp.begin(); + i!=m_PortClamp.end(); i++) + { + m_Plugin->SetPortClamp(n,(*i)->value()); + n++; + } +} +void LADSPAPluginGUI::cb_MinMax(Fl_Button* o, void* v) +{ ((LADSPAPluginGUI*)(o->parent()))->cb_MinMax_i(o,v);} + +inline void LADSPAPluginGUI::cb_PowerAmp_i(Fl_Button* o, void* v) +{ + m_Plugin->SetAmped(o->value()); +} +void LADSPAPluginGUI::cb_PowerAmp(Fl_Button* o, void* v) +{ ((LADSPAPluginGUI*)(o->parent()))->cb_PowerAmp_i(o,v);} diff --git a/SpiralSound/Plugins/LADSPAPlugin/LADSPAPluginGUI.h b/SpiralSound/Plugins/LADSPAPlugin/LADSPAPluginGUI.h new file mode 100644 index 0000000..5c20424 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/LADSPAPluginGUI.h @@ -0,0 +1,135 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../Widgets/Fl_Knob.H" + +#include +#include "ladspa.h" +#include + +#include "LADSPAPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef LADSPAGUI +#define LADSPAGUI + +#include "ladspa.h" +#include +#include +#include +#include +#include "utils.h" + +class LPluginInfo { +public: + string Filename; + string Label; + string Name; + bool operator<(const LPluginInfo & li) { return (Name < li.Name); } + bool operator==(const LPluginInfo& li) { return (Name == li.Name); } +}; + +// For sorting vectors of LPluginInfo's +struct LPluginInfoSortAsc +{ + bool operator()(const LPluginInfo & begin, const LPluginInfo & end) + { + return begin.Name < end.Name; + } +}; + +class LADSPAPluginGUI : public SpiralPluginGUI +{ +public: + LADSPAPluginGUI(int w, int h, LADSPAPlugin *o,const HostInfo *Info); + ~LADSPAPluginGUI(); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + void SetName(const char *s); + void SetMaker(const char *s); + + void ClearPortInfo(); + void AddPortInfo(const char *Info); + void UpdatePortDisplay(int n, float v); + void SetMinMax(int n, float min, float max, bool clamp); + void GetMinMax(int n, float &min, float &max, bool &clamp); + + string GetFilename() { return m_Filename; } + string GetLabel() { return m_Label; } + void SetFilename(string s) { m_Filename=s; } + void SetLabel(string s) { m_Label=s; } + + LADSPAPlugin *m_Plugin; + +private: + vector PluginList; + LPluginInfo CurrentPlugin; + friend void describePluginLibrary(const char * pcFullFilename, void * pvPluginHandle, LADSPA_Descriptor_Function pfDescriptorFunction); + void refreshPluginList(void); + + Fl_Scroll *m_InputScroll; + Fl_Pack *m_InputPack; + Fl_Hold_Browser *m_Browser; + Fl_Knob *m_OutputGain; + Fl_Box *m_Name; + Fl_Box *m_Maker; + Fl_Button *m_UpdateInputs; + Fl_Button *m_UpdateMinMax; + Fl_Button *m_PowerAmp; + vector m_PortOutput; + vector m_PortMin; + vector m_PortMax; + vector m_PortClamp; + + // this is needed as fltk seems to crash if you delete + // the pack, is won't delete the children properly??? + vector m_PackVec; + + int inited; + + string m_Filename; + string m_Label; + + inline void cb_Select_i(Fl_Hold_Browser* o); + static void cb_Select(Fl_Hold_Browser* o); + inline void cb_Gain_i(Fl_Knob* o, void* v); + static void cb_Gain(Fl_Knob* o, void* v); + inline void cb_MinMax_i(Fl_Button* o, void* v); + static void cb_MinMax(Fl_Button* o, void* v); + inline void cb_PowerAmp_i(Fl_Button* o, void* v); + static void cb_PowerAmp(Fl_Button* o, void* v); + +}; + + + +#endif diff --git a/SpiralSound/Plugins/LADSPAPlugin/Makefile.in b/SpiralSound/Plugins/LADSPAPlugin/Makefile.in new file mode 100644 index 0000000..d168d58 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/Makefile.in @@ -0,0 +1,192 @@ +############################################################################# +# Makefile for building LADSPAPlugin.so +# Generated by tmake at 08:03, 2001/10/05 +# Project: LADSPAPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + LADSPAPlugin.h \ + LADSPAPluginGUI.h \ + String.h \ + utils.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + LADSPAPlugin.C \ + LADSPAPluginGUI.C \ + String.cc \ + load.c \ + misc.c \ + search.c +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + LADSPAPlugin.o \ + LADSPAPluginGUI.o \ + String.o \ + load.o \ + misc.o \ + search.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = LADSPAPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: Makefile + +Makefile: LADSPAPlugin.pro + tmake LADSPAPlugin.pro -o Makefile + +dist: + $(TAR) LADSPAPlugin.tar LADSPAPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) LADSPAPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +LADSPAPlugin.o: LADSPAPlugin.C \ + LADSPAPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + LADSPAPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + utils.h \ + SpiralIcon.xpm + +LADSPAPluginGUI.o: LADSPAPluginGUI.C \ + LADSPAPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + LADSPAPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + utils.h + +String.o: String.cc \ + String.h + +load.o: load.c \ + utils.h + +misc.o: misc.c \ + utils.h + +search.o: search.c \ + utils.h + diff --git a/SpiralSound/Plugins/LADSPAPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/LADSPAPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..854bce1 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/SpiralIcon.xpm @@ -0,0 +1,358 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 319 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #D3D3D3", +"R c #C1BEC9", +"S c #474060", +"T c #31294D", +"U c #716C85", +"V c #65607A", +"W c #625D78", +"X c #D5D4DB", +"Y c #F7F7F7", +"Z c #8B8B8B", +"` c #161616", +" . c #0C0C0C", +".. c #060606", +"+. c #393643", +"@. c #47415F", +"#. c #9692A4", +"$. c #D9D8DE", +"%. c #F7F7F8", +"&. c #918DA0", +"*. c #B8B5C1", +"=. c #D1D1D1", +"-. c #252525", +";. c #1F2200", +">. c #747D00", +",. c #AAB700", +"'. c #BDCC00", +"). c #727175", +"!. c #FEFEFF", +"~. c #9D99AA", +"{. c #DBD9E0", +"]. c #E9E9E9", +"^. c #CBCBCB", +"/. c #E0E0E0", +"(. c #6C6C6C", +"_. c #414600", +":. c #C5D400", +"<. c #D9EA00", +"[. c #E7F900", +"}. c #ECFE00", +"|. c #515151", +"1. c #A6A6A7", +"2. c #827E93", +"3. c #615C77", +"4. c #EAEAED", +"5. c #DFDFE1", +"6. c #CDDD00", +"7. c #8F9A00", +"8. c #262900", +"9. c #1E1D24", +"0. c #9894A7", +"a. c #B1AEBB", +"b. c #69686F", +"c. c #000001", +"d. c #2C3000", +"e. c #333700", +"f. c #4C5200", +"g. c #7B8500", +"h. c #615C76", +"i. c #5F5A75", +"j. c #413E4D", +"k. c #020203", +"l. c #030300", +"m. c #131400", +"n. c #212300", +"o. c #626900", +"p. c #ADBB00", +"q. c #7F8900", +"r. c #171900", +"s. c #C5D500", +"t. c #1A1A1C", +"u. c #C3C1CB", +"v. c #9D9D9D", +"w. c #202020", +"x. c #383838", +"y. c #4C4C4C", +"z. c #8E9900", +"A. c #EDFF00", +"B. c #EBFD00", +"C. c #E8FA00", +"D. c #DAEB00", +"E. c #2A2E00", +"F. c #A0AD00", +"G. c #111112", +"H. c #C9C7D0", +"I. c #F1F1F1", +"J. c #F8F8F8", +"K. c #232323", +"L. c #676F00", +"M. c #101200", +"N. c #E1F200", +"O. c #0B0C00", +"P. c #050408", +"Q. c #AEACB9", +"R. c #FEFEFE", +"S. c #1D1D1D", +"T. c #0E1000", +"U. c #5B6200", +"V. c #191B00", +"W. c #010200", +"X. c #9EAA00", +"Y. c #B7B5C1", +"Z. c #9390A2", +"`. c #BBBBBB", +" + c #414141", +".+ c #030303", +"++ c #3B4000", +"@+ c #28272A", +"#+ c #F4F4F6", +"$+ c #605B76", +"%+ c #736E86", +"&+ c #D8D8D8", +"*+ c #727272", +"=+ c #101010", +"-+ c #070800", +";+ c #6F7800", +">+ c #848486", +",+ c #CCCBD3", +"'+ c #747087", +")+ c #6D6881", +"!+ c #1C1C1C", +"~+ c #242424", +"{+ c #0F1100", +"]+ c #4E5400", +"^+ c #A2AF00", +"/+ c #D8E900", +"(+ c #656566", +"_+ c #F6F6F6", +":+ c #E8E6EA", +"<+ c #706B84", +"[+ c #E3E1E6", +"}+ c #474746", +"|+ c #151515", +"1+ c #C8C8C8", +"2+ c #AEAEAE", +"3+ c #080808", +"4+ c #1B1E00", +"5+ c #292D00", +"6+ c #2E3200", +"7+ c #373639", +"8+ c #FDFCFE", +"9+ c #ABA8B7", +"0+ c #F1F0F3", +"a+ c #6D6980", +"b+ c #0A090E", +"c+ c #95929E", +"d+ c #0A0810", +"e+ c #050505", +"f+ c #5B5A5C", +"g+ c #F7F6F7", +"h+ c #F4F3F5", +"i+ c #908C9F", +"j+ c #C8C6D0", +"k+ c #837E96", +"l+ c #86868A", +"m+ c #070608", +"n+ c #ECEBEE", +"o+ c #5B5571", +"p+ c #646078", +"q+ c #AFAFB0", +"r+ c #454545", +"s+ c #363636", +"t+ c #7A7A7A", +"u+ c #C8C8C9", +"v+ c #212025", +"w+ c #060607", +"x+ c #969699", +"y+ c #FAFAFA", +"z+ c #F8F8F9", +"A+ c #A29EAF", +"B+ c #F7F6F8", +"C+ c #F0F0F1", +"D+ c #B8B7B9", +"E+ c #E4E4E4", +"F+ c #FDFDFD", +"G+ c #A5A2B2", +"H+ c #3B3456", +"I+ c #A8A5B4", +"J+ c #525252", +"K+ c #848387", +"L+ c #CDCDCD", +"M+ c #8D899C", +"N+ c #494262", +"O+ c #68627C", +"P+ c #40395A", +"Q+ c #ECECEC", +"R+ c #020202", +"S+ c #B4B5B5", +"T+ c #0B0B0B", +"U+ c #313232", +"V+ c #E3E3E3", +"W+ c #B1AEBC", +"X+ c #BDBBC6", +"Y+ c #3C3556", +"Z+ c #898599", +"`+ c #EDEDED", +" @ c #39393A", +".@ c #040404", +"+@ c #333333", +"@@ c #F5F5F5", +"#@ c #2B2B2B", +"$@ c #2D2A3D", +"%@ c #B6B4C1", +"&@ c #F5F5F6", +"*@ c #605A76", +"=@ c #DAD8DF", +"-@ c #F5F4F6", +";@ c #615B76", +">@ c #524D6A", +",@ c #E4E3E8", +"'@ c #D5D5D5", +")@ c #1B1B1B", +"!@ c #303030", +"~@ c #AAABAB", +"{@ c #585464", +"]@ c #B0AEBB", +"^@ c #A29FAF", +"/@ c #E9E8E9", +"(@ c #787779", +"_@ c #0F0E15", +":@ c #2D2D2E", +"<@ c #595959", +"[@ c #FAFAFB", +"}@ c #807B92", +"|@ c #B0ADBB", +"1@ c #E8E7EB", +"2@ c #3A3258", +"3@ c #E6E5EA", +"4@ c #DFDEE3", +"5@ c #443E5E", +"6@ c #BAB8C4", +"7@ c #C1BFCA", +"8@ c #E0E0E5", +"9@ c #D0CED6", +"0@ c #362F52", +"a@ c #CECCD5", +"b@ c #413A5B", +"c@ c #6A657F", +"d@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 6 6 M Q R S T U V ", +" W X ; ; ; ; Y Z ` 6 .6 6 6 6 6 6 6 6 ..+.@.#.$.%.&. ", +" *.; ; ; ; ; ; = =.-.6 6 ;.>.,.'.,.>.;.6 E ).!.; ; ~. ", +" {.; ; ].Q h ^./.(.6 6 _.:.<.[.}.[.<.:._.6 E |.1.4 2. ", +" 3.4.; 5. .6 6 6 6 6 6 ;.6.}.7.8.6 8.7.}.6.;.6 6 9.0. ", +" U @ a.b.c.6 6 6 6 6 6 d.e.f.6 6 6 6 6 7.}.g.6 6 ", +" h.i.j.6 k.6 6 6 6 6 6 l.m.n.o.p.q.r.8.}.s.6 6 t. ", +" u.; ; v.w.w.x.y.w.z.A.A.A.A.B.}.C.D.E.6 }.A.A.F.G. ", +" H.; ; I.J.; ; ; K.6 6 6 6 6 6 q.D.L.M.8.}.N.O.6 P. ", +" Q.; ; ; ; R.; ; S.6 6 T.e.U.6 r.E.V.W.7.}.X.6 6 6 Y., ", +" Z.; ; R.; : `. +.+6 6 ++}.}.7.8.6 8.7.}.}.++6 6 @+R.#+$+ ", +" %+; ; ; &+*+=+6 6 6 6 -+;+}.}.}.}.}.}.}.;+-+6 6 >+; ; ,+'+ ", +" )+J ; : !+6 6 6 6 ~+ .6 {+]+^+/+}./+^+]+{+6 6 6 (+_+; ; :+<+ ", +" [+; ; }+6 E 6 |+1+2+3+6 -+4+5+6+5+4+-+6 6 6 6 6 7+8+; ; > <+ ", +" 9+; 0+a+b+6 6 2+R.; c+d+6 6 6 6 6 6 6 6 m e+6 6 6 f+g+; ; h+i+ ", +" <+j+! k+l+m+x ; ; n+o+p+q+l r+6 6 6 s+t+u+v+6 6 6 w+x+y+; ; z+@ ", +" A+B+C+D+E+F+; G+H+I+; _+r+6 6 E J+; ; K+6 6 E 6 o L+; ; = M+ ", +" N+> ; ; ; ; ; ; O+P+; ; Q+x.6 6 R+D ; ; S+T+6 6 6 U+V+; ; W+ ", +" > ; ; ; ; X+Y+Z+; ; `+ @6 6 .@+@; ; @@#@6 6 $@%@; &@3 ", +" *@=@= ; -@;@>@,@; ; '@)@6 6 R+!@; ; ; ~@J+{@ ", +" ]@4 ^@ W ; ; ; /@(@!@_@:@<@; ; ; R.[@}@ ", +" |@; ; ; ; ; 1@2@3@; ; ; ; = 4@5@ ", +" 6@7@8@4 ; ; 9@0@a@; ; ; s Z+S ", +" b@ c@d@Z+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/LADSPAPlugin/String.cc b/SpiralSound/Plugins/LADSPAPlugin/String.cc new file mode 100644 index 0000000..75d96c8 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/String.cc @@ -0,0 +1,285 @@ +#include +#include +#include +#include "String.h" +//#include "Exceptions.h" +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#if 0 + +char String::t[BUFSIZ]; + +String::String(const String & s) : str(strdup(s.str)) { } + +String::String(char c) { + char t[2]; + + sprintf(t, "%c", c); + str = strdup(t); +} + +String::String(const char * s) : str(s ? strdup(s) : NULL) { } + +String::String(int i) { + char t[20]; + + sprintf(t, "%i", i); + str = strdup(t); +} + +String::String(double d) { + char t[30]; + + sprintf(t, "%g", d); + str = strdup(t); +} + +String::~String() { + free(str); +} + +char * String::set(char * s, ...) { + va_list ap; + + va_start(ap, s); + vsprintf(t, s, ap); + free(str); + str = strdup(t); + va_end(ap); + return t; +} + +char * String::to_charp(size_t from, ssize_t to) const { + if (to < 0) { + strcpy(t, &(str[from])); + } else { + if (to >= strlen()) { + to = strlen() - 1; + } + if (to >= from) { + int i; + for (i = 0; i <= to - from; i++) { + t[i] = str[i + from]; + } + t[i] = '\0'; + } else { + t[0] = '\0'; + } + } + return t; +} + +int String::to_int(void) const { + int r; + + sscanf(str, "%i", &r); + return r; +} + +double String::to_double(void) const { + double r; + + sscanf(str, "%lf", &r); + return r; +} + +string String::to_string(void) const { + return string(str); +} + +String & String::operator=(const String & s) { + if (str != s.str) { + // On évite l'autodestruction... + free(str); + str = strdup(s.str); + } + return *this; +} + +String String::operator+(const String & s) const { + strcpy(t, str); + strcat(t, s.str); + return String(t); +} + +String & String::operator+=(const String & s) { + strcpy(t, str); + strcat(t, s.str); + free(str); + str = strdup(t); + return (*this); +} + +ostream & operator<<(ostream & os, const String & s) { + return (os << s.to_charp()); +} + +istream & operator>>(istream & is, String & s) { + char c = 0; + + s.set(""); + + while (!is.eof() && (c != '\n') && (c != '\r')) { + is >> c; + s += c; + } + + return is; +} + +bool String::operator!=(const String & s) const { + return (strcmp(str, s.str) != 0); +} + +bool String::operator==(const String & s) const { + return (strcmp(str, s.str) == 0); +} + +bool String::operator<=(const String & s) const { + return (strcmp(str, s.str) <= 0); +} + +bool String::operator>=(const String & s) const { + return (strcmp(str, s.str) >= 0); +} + +bool String::operator<(const String & s) const { + return (strcmp(str, s.str) < 0); +} + +bool String::operator>(const String & s) const { + return (strcmp(str, s.str) > 0); +} + +size_t String::strlen() const { + return (str ? ::strlen(str) : 0); +} + +char String::operator[](size_t i) const { + if (i >= strlen()) { + return 0; + } else { + return str[i]; + } +} + +ssize_t String::strchr(char c, size_t from) const { + size_t s = strlen(); + + for (size_t i = from; i < s; i++) { + if (str[i] == c) return i; + } + + return -1; +} + +ssize_t String::strrchr(char c) const { + size_t s = strlen(); + + for (size_t i = s - 1; i >= 0; i--) { + if (str[i] == c) return i; + } + + return -1; +} + +ssize_t String::strstr(const String & s) const { + char * p = ::strstr(str, s.str); + + if (p) { + return p - str; + } else { + return -1; + } +} + +int String::strchrcnt(char c) const { + size_t i, cnt = 0; + size_t s = strlen(); + + for (i = 0; i < s; i++) { + if (str[i] == c) cnt++; + } + + return cnt; +} + +String String::to_sqldate(void) const { +/* DD/MM/YYYY ==> YYYYMMMDD */ + return (is_date() ? String(to_charp(6, 9)) + to_charp(3, 4) + to_charp(0, 1) : ""); +} + +String String::to_sqltime(void) const { +/* h:m ==> h * 60 + m */ + int p = strchr(':'); + return (is_time() ? String(String(to_charp(0, p - 1)).to_int() * 60 + String(to_charp(p + 1)).to_int()) : ""); +} + +String String::from_sqldate(void) const { +/* YYYYMMDD ==> DD/MM/YYYY */ + return ((strlen() == 8) && is_number() ? String(to_charp(6, 7)) + '/' + to_charp(4, 5) + '/' + to_charp(0, 3) : ""); +} + +String String::from_sqltime(void) const { +/* t ==> (t / 60):(t % 60) */ + int t = to_int(); + return (is_number() ? String((int) (t / 60)) + ':' + (t % 60) : ""); +} + +bool String::is_date(void) const { +/* 'DD/MM/YYYY' + 0123456789 */ + + if (strlen() != 10) return false; + if ((str[2] != '/') || (str[5] != '/') || + (!String(to_charp(0, 1)).is_number()) || + (!String(to_charp(3, 4)).is_number()) || + (!String(to_charp(6, 9)).is_number())) { + return false; + } + + return true; +} + +bool String::is_number(void) const { + size_t s = strlen(); + + + for (size_t i = ((str[i] == '-') ? 1 : 0); i < s; i++) { + if ((str[i] > '9') || (str[i] < '0')) return false; + } + return true; +} + +bool String::is_float(void) const { + size_t s = strlen(); + bool seendot = false; + + for (size_t i = ((str[i] == '-') ? 1 : 0); i < s; i++) { + if ((str[i] > '9') || (str[i] < '0')) { + if ((str[i] == '.') && !seendot) { + seendot = true; + } else { + return false; + } + } + } + + return true; +} + +bool String::is_time(void) const { + int p = strchr(':'); + + if (p == -1) return false; + + // On accepte les heures sous le format xxxxxx:yy pour pouvoir indiquer des durées. + + if ((!String(to_charp(0, p - 1)).is_number()) || (!String(to_charp(p + 1)).is_number())) + return false; + + return (String(to_charp(p + 1)).to_int() < 60) ? true : false; +} +#endif diff --git a/SpiralSound/Plugins/LADSPAPlugin/String.h b/SpiralSound/Plugins/LADSPAPlugin/String.h new file mode 100644 index 0000000..13c14b7 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/String.h @@ -0,0 +1,89 @@ +#ifndef __STRING_H__ +#define __STRING_H__ +#ifdef __cplusplus + +#include +#include +#include +#include +#include + +/* + * Cette classe permet de stocker des chaînes de caractères simplement. + * Elle est une base essentielle et permet d'effectuer énormément d'opérations: + * - set fonctionne comme sprintf, et réassigne la chaîne. + * - to_charp() transforme la chaîne en pointeur. + * - to_charp(from) extrait la chaîne depuis le caractère numéro from + * - to_charp(from, to) extrait la chaîne depuis le caractère numéro from + * jusqu'au caractère numéro to. + * ATTENTION: les fonctions to_charp renvoie un pointeur sur un tableau + * statique, et ce tableau sera modifié au prochain + * appel à to_charp ou a set. + * - to_int transforme la chaîne en int. + * - to_double transforme la chaîne en double + * - to_sqldate effectue la conversion suivante: DD/MM/YYYY ==> YYYYMMDD + * - to_sqltime effectue la conversion suivante: h:m ==> h * 60 + m + * - from_sqldate et from_sqltime effectue les conversions inverses. + * - is_date, is_number, is_float, is_time renvoient des booléens de test. + * - strlen renvoie la longueur de la chaine + * - strchr(c) renvoie la position du caractère c + * - strchr(c, p) recherche le caractère c à partir de la position p + * - strrchr(c) renvoie la position du caractère c, en recherchant depuis la droite. + * - strstr(s) renvoie la position de la chaine s + * NOTE: les fonctions de recherche renvoient un résultat négatif si pas trouvé. + * - strchrcnt(c) compte le nombre d'occurences du caractère c. + * + * Les opérateurs !=, ==, <=, >=, < et > permettent de comparer deux chaînes, en mode + * 'case sensitive'. L'operateur [] renvoie un caractère de la chaîne. + * + * Les opérateurs << et >> vers un ostream ou depuis un istream sont supportés. + */ +/* +class String { + public: + String(const String &); + String(const char * = NULL); + String(char); + String(int); + String(double); + ~String(); + char * set(char *, ...); + char * to_charp(size_t = 0, ssize_t = -1) const; + int to_int() const; + string to_string() const; + double to_double() const; + String to_sqldate() const; + String to_sqltime() const; + String from_sqldate() const; + String from_sqltime() const; + bool is_date() const; + bool is_number() const; + bool is_float() const; + bool is_time() const; + size_t strlen() const; + ssize_t strchr(char, size_t = 0) const; + ssize_t strrchr(char) const; + ssize_t strstr(const String &) const; + int strchrcnt(char) const; + String & operator=(const String &); + String operator+(const String &) const; + String & operator+=(const String &); + bool operator!=(const String &) const; + bool operator==(const String &) const; + bool operator<=(const String &) const; + bool operator>=(const String &) const; + bool operator<(const String &) const; + bool operator>(const String &) const; + char operator[](size_t i) const; + private: + static char t[BUFSIZ]; + char * str; +}; + +ostream & operator<<(ostream &, const String &); +istream & operator>>(istream &, String &); +*/ +#else +#error This only works with a C++ compiler +#endif +#endif diff --git a/SpiralSound/Plugins/LADSPAPlugin/ladspa.h b/SpiralSound/Plugins/LADSPAPlugin/ladspa.h new file mode 100644 index 0000000..5ed8d08 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/ladspa.h @@ -0,0 +1,497 @@ +/* ladspa.h + + Version 1. Copyright 2000 Richard W.E. Furse, Paul Barton-Davis, + Stefan Westerfeld. */ + +#ifndef LADSPA_INCLUDED +#define LADSPA_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +/*****************************************************************************/ + +/* Overview: + + There is a large number of synthesis packages in use or development + on the Linux platform at this time. This API (`The Linux Audio + Developer's Simple Plugin API') attempts to give programmers the + ability to write simple `plugin' audio processors in C/C++ and link + them dynamically (`plug') into a range of these packages (`hosts'). + It should be possible for any host and any plugin to communicate + completely through this interface. The LADSPA plugin API is free to + use. + + This API is deliberately short and simple. To achieve compatibility + with a range of promising Linux sound synthesis packages it + attempts to find the `greatest common divisor' in their logical + behaviour. Having said this, certain limiting decisions are + implicit, notably the use of a fixed type (LADSPA_Data) for all + data transfer and absence of a parameterised `initialisation' + phase. See below for the LADSPA_Data typedef. + + Plugins are expected to distinguish between control and audio + data. Plugins have `ports' that are inputs or outputs for audio or + control data and each plugin is `run' for a `block' corresponding + to a short time interval measured in samples. Audio data is + communicated using arrays of LADSPA_Data, allowing a block of audio + to be processed by the plugin in a single pass. Control data is + communicated using single LADSPA_Data values. Control data has a + single value at the start of a call to the `run()' or `run_adding()' + function, and may be considered to remain this value for its + duration. The plugin may assume that all its input and output ports + have been connected to the relevant data location (see the + `connect_port()' function below) before it is asked to run. + + Plugins will reside in shared object files suitable for dynamic + linking by dlopen() and family. The file will provide a number of + `plugin types' that can be used to instantiate actual plugins + (sometimes known as `plugin instances') that can be connected + together to perform tasks. + + This API contains very limited error-handling. */ + +/*****************************************************************************/ + +/* Fundamental data type passed in and out of plugin. This data type + is used to communicate audio samples and control values. It is + assumed that the plugin will work sensibly given any numeric input + value although it may have a preferred range (see hints below). */ + +typedef float LADSPA_Data; + +/*****************************************************************************/ + +/* Special Plugin Properties: + + Optional features of the plugin type are encapsulated in the + LADSPA_Properties type. This is assembled by ORing individual + properties together. */ + +typedef int LADSPA_Properties; + +/* Property LADSPA_PROPERTY_REALTIME indicates that the plugin has a + real-time dependency (e.g. listens to a MIDI device) and so its + output must not be cached or subject to significant latency. */ +#define LADSPA_PROPERTY_REALTIME 0x1 + +/* Property LADSPA_PROPERTY_INPLACE_BROKEN indicates that the plugin + may cease to work correctly if the host elects to use the same data + location for both input and output (see connect_port()). This + should be avoided as enabling this flag makes it impossible for + hosts to use the plugin to process audio `in-place.' */ +#define LADSPA_PROPERTY_INPLACE_BROKEN 0x2 + +/* Property LADSPA_PROPERTY_HARD_RT_CAPABLE indicates that the plugin + is capable of running not only in a conventional host but also in a + `hard real-time' environment. To qualify for this the plugin must + satisfy all of the following: + + (1) The plugin must not use malloc(), free() or other heap memory + management within its run() or run_adding() functions. All new + memory used in run() must be managed via the stack. These + restrictions only apply to the run() function. + + (2) The plugin will not attempt to make use of any library + functions with the exceptions of functions in the ANSI standard C + and C maths libraries, which the host is expected to provide. + + (3) The plugin will not access files, devices, pipes, sockets, IPC + or any other mechanism that might result in process or thread + blocking. + + (4) The plugin will take an amount of time to execute a run() or + run_adding() call approximately of form (A+B*SampleCount) where A + and B depend on the machine and host in use. This amount of time + may not depend on input signals or plugin state. The host is left + the responsibility to perform timings to estimate upper bounds for + A and B. */ +#define LADSPA_PROPERTY_HARD_RT_CAPABLE 0x4 + +#define LADSPA_IS_REALTIME(x) ((x) & LADSPA_PROPERTY_REALTIME) +#define LADSPA_IS_INPLACE_BROKEN(x) ((x) & LADSPA_PROPERTY_INPLACE_BROKEN) +#define LADSPA_IS_HARD_RT_CAPABLE(x) ((x) & LADSPA_PROPERTY_HARD_RT_CAPABLE) + +/*****************************************************************************/ + +/* Plugin Ports: + + Plugins have `ports' that are inputs or outputs for audio or + data. Ports can communicate arrays of LADSPA_Data (for audio + inputs/outputs) or single LADSPA_Data values (for control + input/outputs). This information is encapsulated in the + LADSPA_PortDescriptor type which is assembled by ORing individual + properties together. + + Note that a port must be an input or an output port but not both + and that a port must be a control or audio port but not both. */ + +typedef int LADSPA_PortDescriptor; + +/* Property LADSPA_PORT_INPUT indicates that the port is an input. */ +#define LADSPA_PORT_INPUT 0x1 + +/* Property LADSPA_PORT_OUTPUT indicates that the port is an output. */ +#define LADSPA_PORT_OUTPUT 0x2 + +/* Property LADSPA_PORT_CONTROL indicates that the port is a control + port. */ +#define LADSPA_PORT_CONTROL 0x4 + +/* Property LADSPA_PORT_AUDIO indicates that the port is a audio + port. */ +#define LADSPA_PORT_AUDIO 0x8 + +#define LADSPA_IS_PORT_INPUT(x) ((x) & LADSPA_PORT_INPUT) +#define LADSPA_IS_PORT_OUTPUT(x) ((x) & LADSPA_PORT_OUTPUT) +#define LADSPA_IS_PORT_CONTROL(x) ((x) & LADSPA_PORT_CONTROL) +#define LADSPA_IS_PORT_AUDIO(x) ((x) & LADSPA_PORT_AUDIO) + +/*****************************************************************************/ + +/* Plugin Port Range Hints: + + The host may wish to provide a representation of data entering or + leaving a plugin (e.g. to generate a GUI automatically). To make + this more meaningful, the plugin should provide `hints' to the host + describing the usual values taken by the data. + + Note that these are only hints. The host may ignore them and the + plugin must not assume that data supplied to it is meaningful. If + the plugin receives invalid input data it is expected to continue + to run without failure and, where possible, produce a sensible + output (e.g. a high-pass filter given a negative cutoff frequency + might switch to an all-pass mode). + + Hints are meaningful for all input and output ports but hints for + input control ports are expected to be particularly useful. + + More hint information is encapsulated in the + LADSPA_PortRangeHintDescriptor type which is assembled by ORing + individual hint types together. Hints may require further + LowerBound and UpperBound information. + + All the hint information for a particular port is aggregated in the + LADSPA_PortRangeHint structure. */ + +typedef int LADSPA_PortRangeHintDescriptor; + +/* Hint LADSPA_HINT_BOUNDED_BELOW indicates that the LowerBound field + of the LADSPA_PortRangeHint should be considered meaningful. The + value in this field should be considered the (inclusive) lower + bound of the valid range. If LADSPA_HINT_SAMPLE_RATE is also + specified then the value of LowerBound should be multiplied by the + sample rate. */ +#define LADSPA_HINT_BOUNDED_BELOW 0x1 + +/* Hint LADSPA_HINT_BOUNDED_ABOVE indicates that the UpperBound field + of the LADSPA_PortRangeHint should be considered meaningful. The + value in this field should be considered the (inclusive) upper + bound of the valid range. If LADSPA_HINT_SAMPLE_RATE is also + specified then the value of UpperBound should be multiplied by the + sample rate. */ +#define LADSPA_HINT_BOUNDED_ABOVE 0x2 + +/* Hint LADSPA_HINT_TOGGLED indicates that the data item should be + considered a Boolean toggle. Data less than or equal to zero should + be considered `off' or `false,' and data above zero should be + considered `on' or `true.' LADSPA_HINT_TOGGLED may not be used in + conjunction with any other hint. */ +#define LADSPA_HINT_TOGGLED 0x4 + +/* Hint LADSPA_HINT_SAMPLE_RATE indicates that any bounds specified + should be interpreted as multiples of the sample rate. For + instance, a frequency range from 0Hz to the Nyquist frequency (half + the sample rate) could be requested by this hint in conjunction + with LowerBound = 0 and UpperBound = 0.5. Hosts that support bounds + at all must support this hint to retain meaning. */ +#define LADSPA_HINT_SAMPLE_RATE 0x8 + +/* Hint LADSPA_HINT_LOGARITHMIC indicates that it is likely that the + user will find it more intuitive to view values using a logarithmic + scale. This is particularly useful for frequencies and gains. */ +#define LADSPA_HINT_LOGARITHMIC 0x10 + +/* Hint LADSPA_HINT_INTEGER indicates that a user interface would + probably wish to provide a stepped control taking only integer + values. Any bounds set should be slightly wider than the actual + integer range required to avoid floating point rounding errors. For + instance, the integer set {0,1,2,3} might be described as [-0.1, + 3.1]. */ +#define LADSPA_HINT_INTEGER 0x20 + +#define LADSPA_IS_HINT_BOUNDED_BELOW(x) ((x) & LADSPA_HINT_BOUNDED_BELOW) +#define LADSPA_IS_HINT_BOUNDED_ABOVE(x) ((x) & LADSPA_HINT_BOUNDED_ABOVE) +#define LADSPA_IS_HINT_TOGGLED(x) ((x) & LADSPA_HINT_TOGGLED) +#define LADSPA_IS_HINT_SAMPLE_RATE(x) ((x) & LADSPA_HINT_SAMPLE_RATE) +#define LADSPA_IS_HINT_LOGARITHMIC(x) ((x) & LADSPA_HINT_LOGARITHMIC) +#define LADSPA_IS_HINT_INTEGER(x) ((x) & LADSPA_HINT_INTEGER) + +typedef struct _LADSPA_PortRangeHint { + + /* Hints about the port. */ + LADSPA_PortRangeHintDescriptor HintDescriptor; + + /* Meaningful when hint LADSPA_HINT_BOUNDED_BELOW is active. When + LADSPA_HINT_SAMPLE_RATE is also active then this value should be + multiplied by the relevant sample rate. */ + LADSPA_Data LowerBound; + + /* Meaningful when hint LADSPA_HINT_BOUNDED_ABOVE is active. When + LADSPA_HINT_SAMPLE_RATE is also active then this value should be + multiplied by the relevant sample rate. */ + LADSPA_Data UpperBound; + +} LADSPA_PortRangeHint; + +/*****************************************************************************/ + +/* Plugin Handles: + + This plugin handle indicates a particular instance of the plugin + concerned. It is valid to compare this to NULL (0 for C++) but + otherwise the host should not attempt to interpret it. The plugin + may use it to reference internal instance data. */ + +typedef void * LADSPA_Handle; + +/*****************************************************************************/ + +/* Descriptor for a Type of Plugin: + + This structure is used to describe a plugin type. It provides a + number of functions to examine the type, instantiate it, link it to + buffers and workspaces and to run it. */ + +typedef struct _LADSPA_Descriptor { + + /* This numeric identifier indicates the plugin type + uniquely. Plugin programmers may reserve ranges of IDs from a + central body to avoid clashes. Hosts may assume that IDs are + below 0x1000000. */ + unsigned long UniqueID; + + /* This identifier can be used as a unique, case-sensitive + identifier for the plugin type within the plugin file. Plugin + types should be identified by file and label rather than by index + or plugin name, which may be changed in new plugin + versions. Labels must not contain white-space characters. */ + const char * Label; + + /* This indicates a number of properties of the plugin. */ + LADSPA_Properties Properties; + + /* This member points to the null-terminated name of the plugin + (e.g. "Sine Oscillator"). */ + const char * Name; + + /* This member points to the null-terminated string indicating the + maker of the plugin. This can be an empty string but not NULL. */ + const char * Maker; + + /* This member points to the null-terminated string indicating any + copyright applying to the plugin. If no Copyright applies the + string "None" should be used. */ + const char * Copyright; + + /* This indicates the number of ports (input AND output) present on + the plugin. */ + unsigned long PortCount; + + /* This member indicates an array of port descriptors. Valid indices + vary from 0 to PortCount-1. */ + const LADSPA_PortDescriptor * PortDescriptors; + + /* This member indicates an array of null-terminated strings + describing ports (e.g. "Frequency (Hz)"). Valid indices vary from + 0 to PortCount-1. */ + const char * const * PortNames; + + /* This member indicates an array of range hints for each port (see + above). Valid indices vary from 0 to PortCount-1. */ + const LADSPA_PortRangeHint * PortRangeHints; + + /* This may be used by the plugin developer to pass any custom + implementation data into an instantiate call. It must not be used + or interpreted by the host. It is expected that most plugin + writers will not use this facility as LADSPA_Handle should be + used to hold instance data. */ + void * ImplementationData; + + /* This member is a function pointer that instantiates a plugin. A + handle is returned indicating the new plugin instance. The + instantiation function accepts a sample rate as a parameter. The + plugin descriptor from which this instantiate function was found + must also be passed. This function must return NULL if + instantiation fails. + + Note that instance initialisation should generally occur in + activate() rather than here. */ + LADSPA_Handle (*instantiate)(const struct _LADSPA_Descriptor * Descriptor, + unsigned long SampleRate); + + /* This member is a function pointer that connects a port on an + instantiated plugin to a memory location at which a block of data + for the port will be read/written. The data location is expected + to be an array of LADSPA_Data for audio ports or a single + LADSPA_Data value for control ports. Memory issues will be + managed by the host. The plugin must read/write the data at these + locations every time run() or run_adding() is called and the data + present at the time of this connection call should not be + considered meaningful. + + connect_port() may be called more than once for a plugin instance + to allow the host to change the buffers that the plugin is + reading or writing. These calls may be made before or after + activate() or deactivate() calls. + + connect_port() must be called at least once for each port before + run() or run_adding() is called. When working with blocks of + LADSPA_Data the plugin should pay careful attention to the block + size passed to the run function as the block allocated may only + just be large enough to contain the block of samples. + + Plugin writers should be aware that the host may elect to use the + same buffer for more than one port and even use the same buffer + for both input and output (see LADSPA_PROPERTY_INPLACE_BROKEN). + However, overlapped buffers or use of a single buffer for both + audio and control data may result in unexpected behaviour. */ + void (*connect_port)(LADSPA_Handle Instance, + unsigned long Port, + LADSPA_Data * DataLocation); + + /* This member is a function pointer that initialises a plugin + instance and activates it for use. This is separated from + instantiate() to aid real-time support and so that hosts can + reinitialise a plugin instance by calling deactivate() and then + activate(). In this case the plugin instance must reset all state + information dependent on the history of the plugin instance + except for any data locations provided by connect_port() and any + gain set by set_run_adding_gain(). If there is nothing for + activate() to do then the plugin writer may provide a NULL rather + than an empty function. + + When present, hosts must call this function once before run() (or + run_adding()) is called for the first time. This call should be + made as close to the run() call as possible and indicates to + real-time plugins that they are now live. Plugins should not rely + on a prompt call to run() after activate(). activate() may not be + called again unless deactivate() is called first. Note that + connect_port() may be called before or after a call to + activate(). */ + void (*activate)(LADSPA_Handle Instance); + + /* This method is a function pointer that runs an instance of a + plugin for a block. Two parameters are required: the first is a + handle to the particular instance to be run and the second + indicates the block size (in samples) for which the plugin + instance may run. + + Note that if an activate() function exists then it must be called + before run() or run_adding(). If deactivate() is called for a + plugin instance then the plugin instance may not be reused until + activate() has been called again. + + If the plugin has the property LADSPA_PROPERTY_HARD_RT_CAPABLE + then there are various things that the plugin should not do + within the run() or run_adding() functions (see above). */ + void (*run)(LADSPA_Handle Instance, + unsigned long SampleCount); + + /* This method is a function pointer that runs an instance of a + plugin for a block. This has identical behaviour to run() except + in the way data is output from the plugin. When run() is used, + values are written directly to the memory areas associated with + the output ports. However when run_adding() is called, values + must be added to the values already present in the memory + areas. Furthermore, output values written must be scaled by the + current gain set by set_run_adding_gain() (see below) before + addition. + + run_adding() is optional. When it is not provided by a plugin, + this function pointer must be set to NULL. When it is provided, + the function set_run_adding_gain() must be provided also. */ + void (*run_adding)(LADSPA_Handle Instance, + unsigned long SampleCount); + + /* This method is a function pointer that sets the output gain for + use when run_adding() is called (see above). If this function is + never called the gain is assumed to default to 1. Gain + information should be retained when activate() or deactivate() + are called. + + This function should be provided by the plugin if and only if the + run_adding() function is provided. When it is absent this + function pointer must be set to NULL. */ + void (*set_run_adding_gain)(LADSPA_Handle Instance, + LADSPA_Data Gain); + + /* This is the counterpart to activate() (see above). If there is + nothing for deactivate() to do then the plugin writer may provide + a NULL rather than an empty function. + + Hosts must deactivate all activated units after they have been + run() (or run_adding()) for the last time. This call should be + made as close to the last run() call as possible and indicates to + real-time plugins that they are no longer live. Plugins should + not rely on prompt deactivation. Note that connect_port() may be + called before or after a call to deactivate(). + + Deactivation is not similar to pausing as the plugin instance + will be reinitialised when activate() is called to reuse it. */ + void (*deactivate)(LADSPA_Handle Instance); + + /* Once an instance of a plugin has been finished with it can be + deleted using the following function. The instance handle passed + ceases to be valid after this call. + + If activate() was called for a plugin instance then a + corresponding call to deactivate() must be made before cleanup() + is called. */ + void (*cleanup)(LADSPA_Handle Instance); + +} LADSPA_Descriptor; + +/**********************************************************************/ + +/* Accessing a Plugin: */ + +/* The exact mechanism by which plugins are loaded is host-dependent, + however all most hosts will need to know is the name of shared + object file containing the plugin types. To allow multiple hosts to + share plugin types, hosts may wish to check for environment + variable LADSPA_PATH. If present, this should contain a + colon-separated path indicating directories that should be searched + (in order) when loading plugin types. + + A plugin programmer must include a function called + "ladspa_descriptor" with the following function prototype within + the shared object file. This function will have C-style linkage (if + you are using C++ this is taken care of by the `extern "C"' clause + at the top of the file). + + A host will find the plugin shared object file by one means or + another, find the ladspa_descriptor() function, call it, and + proceed from there. + + Plugin types are accessed by index (not ID) using values from 0 + upwards. Out of range indexes must result in this function + returning NULL, so the plugin count can be determined by checking + for the least index that results in NULL being returned. */ + +const LADSPA_Descriptor * ladspa_descriptor(unsigned long Index); + +/* Datatype corresponding to the ladspa_descriptor() function. */ +typedef const LADSPA_Descriptor * +(*LADSPA_Descriptor_Function)(unsigned long Index); + +/**********************************************************************/ + +#ifdef __cplusplus +}; +#endif + +#endif /* LADSPA_INCLUDED */ + +/* EOF */ diff --git a/SpiralSound/Plugins/LADSPAPlugin/load.c b/SpiralSound/Plugins/LADSPAPlugin/load.c new file mode 100644 index 0000000..830e5f3 --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/load.c @@ -0,0 +1,186 @@ +/* load.c + + Free software by Richard W.E. Furse. Do with as you will. No + warranty. */ + +/*****************************************************************************/ + +#include +#include +#include +#include + +/*****************************************************************************/ + +#include "ladspa.h" +#include "utils.h" + +/*****************************************************************************/ + +/* This function provides a wrapping of dlopen(). When the filename is + not an absolute path (i.e. does not begin with / character), this + routine will search the LADSPA_PATH for the file. */ +static void * +dlopenLADSPA(const char * pcFilename, int iFlag) { + + char * pcBuffer; + const char * pcEnd; + const char * pcLADSPAPath; + const char * pcStart; + int iEndsInSO; + int iNeedSlash; + size_t iFilenameLength; + void * pvResult; + + iFilenameLength = strlen(pcFilename); + pvResult = NULL; + + if (pcFilename[0] == '/') { + + /* The filename is absolute. Assume the user knows what he/she is + doing and simply dlopen() it. */ + + pvResult = dlopen(pcFilename, iFlag); + if (pvResult != NULL) + return pvResult; + + } + else { + + /* If the filename is not absolute then we wish to check along the + LADSPA_PATH path to see if we can find the file there. We do + NOT call dlopen() directly as this would find plugins on the + LD_LIBRARY_PATH, whereas the LADSPA_PATH is the correct place + to search. */ + + pcLADSPAPath = getenv("LADSPA_PATH"); + + if (pcLADSPAPath) { + + pcStart = pcLADSPAPath; + while (*pcStart != '\0') { + pcEnd = pcStart; + while (*pcEnd != ':' && *pcEnd != '\0') + pcEnd++; + + pcBuffer = malloc(iFilenameLength + 2 + (pcEnd - pcStart)); + if (pcEnd > pcStart) + strncpy(pcBuffer, pcStart, pcEnd - pcStart); + iNeedSlash = 0; + if (pcEnd > pcStart) + if (*(pcEnd - 1) != '/') { + iNeedSlash = 1; + pcBuffer[pcEnd - pcStart] = '/'; + } + strcpy(pcBuffer + iNeedSlash + (pcEnd - pcStart), pcFilename); + + pvResult = dlopen(pcBuffer, iFlag); + + free (pcBuffer); + if (pvResult != NULL) + return pvResult; + + pcStart = pcEnd; + if (*pcStart == ':') + pcStart++; + } + } + } + + /* As a last ditch effort, check if filename does not end with + ".so". In this case, add this suffix and recurse. */ + iEndsInSO = 0; + if (iFilenameLength > 3) + iEndsInSO = (strcmp(pcFilename + iFilenameLength - 3, ".so") == 0); + if (!iEndsInSO) { + pcBuffer = malloc(iFilenameLength + 4); + strcpy(pcBuffer, pcFilename); + strcat(pcBuffer, ".so"); + pvResult = dlopenLADSPA(pcBuffer, iFlag); + free(pcBuffer); + } + + if (pvResult != NULL) + return pvResult; + + /* If nothing has worked, then at least we can make sure we set the + correct error message - and this should correspond to a call to + dlopen() with the actual filename requested. The dlopen() manual + page does not specify whether the first or last error message + will be kept when multiple calls are made to dlopen(). We've + covered the former case - now we can handle the latter by calling + dlopen() again here. */ + return dlopen(pcFilename, iFlag); +} + +/*****************************************************************************/ + +void * +loadLADSPAPluginLibrary(const char * pcPluginFilename) { + + void * pvPluginHandle; + + pvPluginHandle = dlopenLADSPA(pcPluginFilename, RTLD_NOW); + if (!pvPluginHandle) { + fprintf(stderr, + "Failed to load plugin \"%s\": %s\n", + pcPluginFilename, + dlerror()); + return NULL; + } + + return pvPluginHandle; +} + +/*****************************************************************************/ + +void +unloadLADSPAPluginLibrary(void * pvLADSPAPluginLibrary) { + dlclose(pvLADSPAPluginLibrary); +} + +/*****************************************************************************/ + +const LADSPA_Descriptor * +findLADSPAPluginDescriptor(void * pvLADSPAPluginLibrary, + const char * pcPluginLibraryFilename, + const char * pcPluginLabel) { + + const LADSPA_Descriptor * psDescriptor; + LADSPA_Descriptor_Function pfDescriptorFunction; + unsigned long lPluginIndex; + + dlerror(); + pfDescriptorFunction + = (LADSPA_Descriptor_Function)dlsym(pvLADSPAPluginLibrary, + "ladspa_descriptor"); + if (!pfDescriptorFunction) { + const char * pcError = dlerror(); + if (pcError) { + fprintf(stderr, + "Unable to find ladspa_descriptor() function in plugin " + "library file \"%s\": %s.\n" + "Are you sure this is a LADSPA plugin file?\n", + pcPluginLibraryFilename, + pcError); + return NULL; + } + } + + for (lPluginIndex = 0;; lPluginIndex++) { + psDescriptor = pfDescriptorFunction(lPluginIndex); + if (psDescriptor == NULL) { + fprintf(stderr, + "Unable to find label \"%s\" in plugin library file \"%s\".\n", + pcPluginLabel, + pcPluginLibraryFilename); + return NULL; + } + if (strcmp(psDescriptor->Label, pcPluginLabel) == 0) + return psDescriptor; + } +} + +/*****************************************************************************/ + +/* EOF */ diff --git a/SpiralSound/Plugins/LADSPAPlugin/misc.c b/SpiralSound/Plugins/LADSPAPlugin/misc.c new file mode 100644 index 0000000..5fcbedd --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/misc.c @@ -0,0 +1,32 @@ +/* misc.c + + Free software by Richard W.E. Furse. Do with as you will. No + warranty. */ + +/*****************************************************************************/ + +#include +#include +#include +#include + +/*****************************************************************************/ + +#include "ladspa.h" +#include "utils.h" + +/*****************************************************************************/ + +unsigned long +getPortCountByType(const LADSPA_Descriptor * psDescriptor, + const LADSPA_PortDescriptor iType) { + unsigned long lCount; + unsigned long lIndex; + + lCount = 0; + for (lIndex = 0; lIndex < psDescriptor->PortCount; lIndex++) + if ((psDescriptor->PortDescriptors[lIndex] & iType) == iType) + lCount++; + + return lCount; +} diff --git a/SpiralSound/Plugins/LADSPAPlugin/search.c b/SpiralSound/Plugins/LADSPAPlugin/search.c new file mode 100644 index 0000000..2aff3ec --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/search.c @@ -0,0 +1,127 @@ +/* search.c + + Free software by Richard W.E. Furse. Do with as you will. No + warranty. */ + +/*****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +/*****************************************************************************/ + +#include "ladspa.h" +#include "utils.h" + +/*****************************************************************************/ + +/* Search just the one directory. */ +static void +LADSPADirectoryPluginSearch +(const char * pcDirectory, + LADSPAPluginSearchCallbackFunction fCallbackFunction) { + + char * pcFilename; + DIR * psDirectory; + LADSPA_Descriptor_Function fDescriptorFunction; + long lDirLength; + long iNeedSlash; + struct dirent * psDirectoryEntry; + void * pvPluginHandle; + + lDirLength = strlen(pcDirectory); + if (!lDirLength) + return; + if (pcDirectory[lDirLength - 1] == '/') + iNeedSlash = 0; + else + iNeedSlash = 1; + + psDirectory = opendir(pcDirectory); + if (!psDirectory) + return; + + while (1) { + + psDirectoryEntry = readdir(psDirectory); + if (!psDirectoryEntry) { + closedir(psDirectory); + return; + } + + pcFilename = malloc(lDirLength + + strlen(psDirectoryEntry->d_name) + + 1 + iNeedSlash); + strcpy(pcFilename, pcDirectory); + if (iNeedSlash) + strcat(pcFilename, "/"); + strcat(pcFilename, psDirectoryEntry->d_name); + + pvPluginHandle = dlopen(pcFilename, RTLD_LAZY); + if (pvPluginHandle) { + /* This is a file and the file is a shared library! */ + + dlerror(); + fDescriptorFunction + = (LADSPA_Descriptor_Function)dlsym(pvPluginHandle, + "ladspa_descriptor"); + if (dlerror() == NULL && fDescriptorFunction) { + /* We've successfully found a ladspa_descriptor function. Pass + it to the callback function. */ + fCallbackFunction(pcFilename, + pvPluginHandle, + fDescriptorFunction); + } + else { + /* It was a library, but not a LADSPA one. Unload it. */ + dlclose(pcFilename); + } + } + } +} + +/*****************************************************************************/ + +void +LADSPAPluginSearch(LADSPAPluginSearchCallbackFunction fCallbackFunction) { + + char * pcBuffer; + const char * pcEnd; + const char * pcLADSPAPath; + const char * pcStart; + + pcLADSPAPath = getenv("LADSPA_PATH"); + if (!pcLADSPAPath) { + fprintf(stderr, + "Warning: You do not have a LADSPA_PATH " + "environment variable set.\n"); + return; + } + + pcStart = pcLADSPAPath; + while (*pcStart != '\0') { + pcEnd = pcStart; + while (*pcEnd != ':' && *pcEnd != '\0') + pcEnd++; + + pcBuffer = malloc(1 + pcEnd - pcStart); + if (pcEnd > pcStart) + strncpy(pcBuffer, pcStart, pcEnd - pcStart); + pcBuffer[pcEnd - pcStart] = '\0'; + + LADSPADirectoryPluginSearch(pcBuffer, fCallbackFunction); + + pcStart = pcEnd; + if (*pcStart == ':') + pcStart++; + } +} + +/*****************************************************************************/ + +/* EOF */ diff --git a/SpiralSound/Plugins/LADSPAPlugin/utils.h b/SpiralSound/Plugins/LADSPAPlugin/utils.h new file mode 100644 index 0000000..8c3c8bd --- /dev/null +++ b/SpiralSound/Plugins/LADSPAPlugin/utils.h @@ -0,0 +1,80 @@ +/* utils.h + + Free software by Richard W.E. Furse. Do with as you will. No + warranty. */ + +#ifndef LADSPA_SDK_LOAD_PLUGIN_LIB +#define LADSPA_SDK_LOAD_PLUGIN_LIB + +/*****************************************************************************/ + +#include "ladspa.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/*****************************************************************************/ + +/* Functions in load.c: */ + +/* This function call takes a plugin library filename, searches for + the library along the LADSPA_PATH, loads it with dlopen() and + returns a plugin handle for use with findPluginDescriptor() or + unloadLADSPAPluginLibrary(). Errors are handled by writing a + message to stderr and calling exit(1). It is alright (although + inefficient) to call this more than once for the same file. */ +void * loadLADSPAPluginLibrary(const char * pcPluginFilename); + +/* This function unloads a LADSPA plugin library. */ +void unloadLADSPAPluginLibrary(void * pvLADSPAPluginLibrary); + +/* This function locates a LADSPA plugin within a plugin library + loaded with loadLADSPAPluginLibrary(). Errors are handled by + writing a message to stderr and calling exit(1). Note that the + plugin library filename is only included to help provide + informative error messages. */ +const LADSPA_Descriptor * +findLADSPAPluginDescriptor(void * pvLADSPAPluginLibrary, + const char * pcPluginLibraryFilename, + const char * pcPluginLabel); + +/*****************************************************************************/ + +/* Functions in search.c: */ + +/* Callback function for use with LADSPAPluginSearch(). The callback + function passes the filename (full path), a plugin handle (dlopen() + style) and a LADSPA_DescriptorFunction (from which + LADSPA_Descriptors can be acquired). */ +typedef void LADSPAPluginSearchCallbackFunction +(const char * pcFullFilename, + void * pvPluginHandle, + LADSPA_Descriptor_Function fDescriptorFunction); + +/* Search through the $(LADSPA_PATH) (or a default path) for any + LADSPA plugin libraries. Each plugin library is tested using + dlopen() and dlsym(,"ladspa_descriptor"). After loading each + library, the callback function is called to process it. This + function leaves items passed to the callback function open. */ +void LADSPAPluginSearch(LADSPAPluginSearchCallbackFunction fCallbackFunction); + +/*****************************************************************************/ + +/* Functions in misc.c: */ + +/* Count the ports of a plugin matching a given type */ + +unsigned long +getPortCountByType(const LADSPA_Descriptor * psDescriptor, + const LADSPA_PortDescriptor iType); + +/*****************************************************************************/ + +#ifdef __cplusplus +} +#endif + +#endif + +/* EOF */ diff --git a/SpiralSound/Plugins/LFOPlugin/LFOPlugin.C b/SpiralSound/Plugins/LFOPlugin/LFOPlugin.C new file mode 100644 index 0000000..4c05c4b --- /dev/null +++ b/SpiralSound/Plugins/LFOPlugin/LFOPlugin.C @@ -0,0 +1,132 @@ +/* SpiralSound + * Copyleft (C) 2002 Andy Preston + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "LFOPlugin.h" +#include "LFOPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() { return new LFOPlugin; } + +char** GetIcon() { return SpiralIcon_xpm; } + +int GetID() { return 124; } +} + +/////////////////////////////////////////////////////// + +LFOPlugin::LFOPlugin() : +m_Type (SINE), +m_Freq (0.1), +m_TableLength (DEFAULT_TABLE_LEN) { + m_CyclePos = 0; + m_Note = 0; + m_PluginInfo.Name = "LFO"; + m_PluginInfo.Width = 165; + m_PluginInfo.Height = 150; + m_PluginInfo.NumInputs = 0; + m_PluginInfo.NumOutputs = 3; + m_PluginInfo.PortTips.push_back ("Output"); + m_PluginInfo.PortTips.push_back ("'Cosine' Output"); + m_PluginInfo.PortTips.push_back ("Inverted Output"); +} + +LFOPlugin::~LFOPlugin() { +} + +PluginInfo &LFOPlugin::Initialise (const HostInfo *Host) { + PluginInfo& Info= SpiralPlugin::Initialise (Host); + for (int n=0; nhide(); + return m_GUI; +} + +void LFOPlugin::WriteWaves() { + float RadCycle = (M_PI/180) * 360; + float Pos = 0; + float v = 0; + float HalfTab = m_TableLength / 2; + int QuatTab = m_TableLength / 4; + int ThreeQuatTab = m_TableLength - QuatTab; + int Shift; + + for (int n=0; nThreeQuatTab) v = (((Shift-HalfTab) / HalfTab) * 2) - 1; + else v = 1 - (Shift/HalfTab * 2); + m_Table[TRIANGLE].Set (n, v); + + if (n=m_TableLength) pos -= m_TableLength; + if (pos<0 || pos>=m_TableLength) pos = 0; + return pos; +} + +void LFOPlugin::Execute() { + float Incr, Pos; + for (int n=0; nBUFSIZE; n++) { + Incr = m_Freq * (m_TableLength / (float)m_HostInfo->SAMPLERATE); + // Raw Output + m_CyclePos = AdjustPos (m_CyclePos + Incr); + SetOutput (0, n, m_Table[m_Type][m_CyclePos]); + // 'Cosine' Output + Pos = AdjustPos (m_CyclePos + (m_TableLength * 0.25)); + SetOutput (1, n, m_Table[m_Type][Pos]); + // Inverted Output + Pos = AdjustPos (m_TableLength - m_CyclePos); + SetOutput (2, n, m_Table[m_Type][Pos]); + } +} + +void LFOPlugin::StreamOut(ostream &s) { + s << m_Version << " " << *this; +} + +void LFOPlugin::StreamIn(istream &s) { + int version; + s >> version >> *this; +} + +istream &operator>> (istream &s, LFOPlugin &o) { + s >> (int&)o.m_Type >> o.m_Freq; + return s; +} + +ostream &operator<< (ostream &s, LFOPlugin &o) { + s << (int)o.m_Type << " " << o.m_Freq << " "; + return s; +} diff --git a/SpiralSound/Plugins/LFOPlugin/LFOPlugin.h b/SpiralSound/Plugins/LFOPlugin/LFOPlugin.h new file mode 100644 index 0000000..d18f631 --- /dev/null +++ b/SpiralSound/Plugins/LFOPlugin/LFOPlugin.h @@ -0,0 +1,63 @@ +/* SpiralSound + * Copyleft (C) 2002 Andy Preston + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef LFOPLUGIN +#define LFOPLUGIN + +#include "../SpiralPlugin.h" +#include + +static const int NUM_TABLES = 6; +static const int DEFAULT_TABLE_LEN = 1024; + +class LFOPlugin : public SpiralPlugin { + public: + LFOPlugin(); + virtual ~LFOPlugin(); + virtual PluginInfo &Initialise (const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut (ostream &s); + virtual void StreamIn (istream &s); + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + enum Type {SINE, TRIANGLE, SQUARE, SAW}; + void WriteWaves(); + void NoteTrigger (int V, int s, int v); + void SetFreq (float s) { m_Freq=s; } + float GetFreq() { return m_Freq; } + void SetType (Type t) { m_Type=t; } + Type GetType() { return m_Type; } + private: + float AdjustPos (float pos); + // Voice specific parameter + int m_Note; + float m_CyclePos; + // Common voice parameters + Type m_Type; + float m_Freq; + Sample m_Table[NUM_TABLES]; + int m_TableLength; + friend istream &operator>> (istream &s, LFOPlugin &o); + friend ostream &operator<< (ostream &s, LFOPlugin &o); +}; + +istream &operator>> (istream &s, LFOPlugin &o); +ostream &operator<< (ostream &s, LFOPlugin &o); + +#endif diff --git a/SpiralSound/Plugins/LFOPlugin/LFOPlugin.pro b/SpiralSound/Plugins/LFOPlugin/LFOPlugin.pro new file mode 100644 index 0000000..0b74373 --- /dev/null +++ b/SpiralSound/Plugins/LFOPlugin/LFOPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + LFOPlugin.h \ + LFOPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + LFOPlugin.C \ + LFOPluginGUI.C + +TARGET = LFOPlugin.so diff --git a/SpiralSound/Plugins/LFOPlugin/LFOPluginGUI.C b/SpiralSound/Plugins/LFOPlugin/LFOPluginGUI.C new file mode 100644 index 0000000..87455be --- /dev/null +++ b/SpiralSound/Plugins/LFOPlugin/LFOPluginGUI.C @@ -0,0 +1,278 @@ +/* SpiralPlugin + * Copyleft (C) 2002 Andy Preston + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#include "LFOPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +static unsigned char *image_Sine[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" .. ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . . ", +(unsigned char*)" . . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" .. ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_Tri[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" . ", +(unsigned char*)" . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . ", +(unsigned char*)" . ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_Square[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" ...... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ... . ... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ...... ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_Saw[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" .. ", +(unsigned char*)" .. ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ... . .... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" .. ", +(unsigned char*)" .. ", +(unsigned char*)" ", +(unsigned char*)" "}; + +LFOPluginGUI::LFOPluginGUI(int w, int h,LFOPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o), +pixmap_Sine(image_Sine), +pixmap_Tri(image_Tri), +pixmap_Square(image_Square), +pixmap_Saw(image_Saw) { + + m_Plugin=o; + + ShapeSine = new Fl_Check_Button (5, 15, 55, 30); + ShapeSine->type (FL_RADIO_BUTTON); + ShapeSine->down_box (FL_DIAMOND_DOWN_BOX); + ShapeSine->selection_color (GUI_COLOUR); + pixmap_Sine.label (ShapeSine); + ShapeSine->set(); + ShapeSine->callback ((Fl_Callback*)cb_Sine); + + ShapeTri = new Fl_Check_Button (5, 46, 55, 30); + ShapeTri->type (FL_RADIO_BUTTON); + ShapeTri->down_box (FL_DIAMOND_DOWN_BOX); + ShapeTri->selection_color (GUI_COLOUR); + pixmap_Tri.label (ShapeTri); + ShapeTri->callback ((Fl_Callback*)cb_Tri); + + ShapeSquare = new Fl_Check_Button (5, 77, 55, 30); + ShapeSquare->type (FL_RADIO_BUTTON); + ShapeSquare->down_box (FL_DIAMOND_DOWN_BOX); + ShapeSquare->selection_color (GUI_COLOUR); + pixmap_Square.label (ShapeSquare); + ShapeSquare->callback ((Fl_Callback*)cb_Square); + + ShapeSaw = new Fl_Check_Button (5, 108, 55, 30); + ShapeSaw->type (FL_RADIO_BUTTON); + ShapeSaw->down_box (FL_DIAMOND_DOWN_BOX); + ShapeSaw->selection_color (GUI_COLOUR); + pixmap_Saw.label (ShapeSaw); + ShapeSaw->callback ((Fl_Callback*)cb_Saw); + + Perd = new Fl_Knob (75, 15, 60, 60, ""); + Perd->color (GUI_COLOUR); + Perd->type (Fl_Knob::LINELIN); + Perd->labelsize (10); + Perd->scaleticks (20); + Perd->maximum (120); + Perd->minimum (0.1); + Perd->step (0.001); + Perd->value (10); + Perd->callback ((Fl_Callback*)cb_Perd); + + NumPerd = new Fl_Counter (50, 80, 110, 20, "Period (Secs)"); + NumPerd->textsize (10); + NumPerd->labelsize (10); + NumPerd->value (Perd->value()); + NumPerd->step (Perd->step()); + NumPerd->lstep (0.1); + NumPerd->maximum (Perd->maximum()); + NumPerd->minimum (Perd->minimum()); + NumPerd->callback ((Fl_Callback*)cb_NumPerd); + + NumFreq = new Fl_Counter (50, 115, 110, 20, "Freq (Hz)"); + NumFreq->textsize (10); + NumFreq->labelsize (10); + NumFreq->value (1 / Perd->value()); + NumFreq->step (0.001); + NumFreq->lstep (0.1); + NumFreq->maximum (1 / Perd->minimum()); + NumFreq->minimum (1 / Perd->maximum()); + NumFreq->callback ((Fl_Callback*)cb_NumFreq); + + end(); +} + +void LFOPluginGUI::UpdateValues() { + ShapeSine->value (0); + ShapeTri->value (0); + ShapeSquare->value (0); + ShapeSaw->value (0); + switch (m_Plugin->GetType()) { + case LFOPlugin::SINE : ShapeSine->value (1); break; + case LFOPlugin::TRIANGLE : ShapeTri->value (1); break; + case LFOPlugin::SQUARE : ShapeSquare->value (1); break; + case LFOPlugin::SAW : ShapeSaw->value (1); break; + } + float x = m_Plugin->GetFreq(); + NumFreq->value (x); + x = 1 / x; + Perd->value (x); + NumPerd->value (x); +} + +// Callbacks for knobs and counters + +inline void LFOPluginGUI::cb_Perd_i (Fl_Knob* o, void* v) { + m_Plugin->SetFreq (1 / o->value()); + UpdateValues(); +} +void LFOPluginGUI::cb_Perd (Fl_Knob* o, void* v) { + ((LFOPluginGUI*)(o->parent()))->cb_Perd_i (o, v); +} + + +inline void LFOPluginGUI::cb_NumPerd_i (Fl_Knob* o, void* v) { + m_Plugin->SetFreq (1 / o->value()); + UpdateValues(); +} +void LFOPluginGUI::cb_NumPerd (Fl_Knob* o, void* v) { + ((LFOPluginGUI*)(o->parent()))->cb_NumPerd_i (o, v); +} + + +inline void LFOPluginGUI::cb_NumFreq_i (Fl_Knob* o, void* v) { + m_Plugin->SetFreq (o->value()); + UpdateValues(); +} + +void LFOPluginGUI::cb_NumFreq (Fl_Knob* o, void* v) { + ((LFOPluginGUI*)(o->parent()))->cb_NumFreq_i (o, v); +} + +// Callbacks for waveform buttons + +inline void LFOPluginGUI::cb_Sine_i (Fl_Check_Button* o, void* v) { + m_Plugin->SetType (LFOPlugin::SINE); +} +void LFOPluginGUI::cb_Sine(Fl_Check_Button* o, void* v) { + ((LFOPluginGUI*)(o->parent()))->cb_Sine_i (o, v); +} + + +inline void LFOPluginGUI::cb_Tri_i (Fl_Check_Button* o, void* v) { + m_Plugin->SetType (LFOPlugin::TRIANGLE); +} +void LFOPluginGUI::cb_Tri (Fl_Check_Button* o, void* v) { + ((LFOPluginGUI*)(o->parent()))->cb_Tri_i (o, v); +} + + +inline void LFOPluginGUI::cb_Square_i (Fl_Check_Button* o, void* v) { + m_Plugin->SetType (LFOPlugin::SQUARE); +} +void LFOPluginGUI::cb_Square (Fl_Check_Button* o, void* v) { + ((LFOPluginGUI*)(o->parent()))->cb_Square_i (o, v); +} + + +inline void LFOPluginGUI::cb_Saw_i (Fl_Check_Button* o, void* v) { + m_Plugin->SetType (LFOPlugin::SAW); +} +void LFOPluginGUI::cb_Saw (Fl_Check_Button* o, void* v) { + ((LFOPluginGUI*)(o->parent()))->cb_Saw_i (o, v); +} + diff --git a/SpiralSound/Plugins/LFOPlugin/LFOPluginGUI.h b/SpiralSound/Plugins/LFOPlugin/LFOPluginGUI.h new file mode 100644 index 0000000..f0bd36a --- /dev/null +++ b/SpiralSound/Plugins/LFOPlugin/LFOPluginGUI.h @@ -0,0 +1,63 @@ +/* SpiralPlugin + * Copyleft (C) 2002 Andy Preston + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef LFOGUI +#define LFOGUI + +#include +#include +#include +#include "../Widgets/Fl_Knob.H" +#include "../SpiralPluginGUI.h" +#include "LFOPlugin.h" + +class LFOPluginGUI : public SpiralPluginGUI { + public: + LFOPluginGUI(int w, int h, LFOPlugin *o,const HostInfo *Info); + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + LFOPlugin *m_Plugin; + private: + Fl_Check_Button* ShapeSine; + Fl_Pixmap pixmap_Sine; + Fl_Check_Button* ShapeTri; + Fl_Pixmap pixmap_Tri; + Fl_Check_Button* ShapeSquare; + Fl_Pixmap pixmap_Square; + Fl_Check_Button* ShapeSaw; + Fl_Pixmap pixmap_Saw; + Fl_Knob* Perd; + Fl_Counter* NumFreq; + Fl_Counter* NumPerd; + inline void cb_Perd_i (Fl_Knob* o, void* v); + static void cb_Perd (Fl_Knob* o, void* v); + inline void cb_NumFreq_i (Fl_Knob* o, void* v); + static void cb_NumFreq (Fl_Knob* o, void* v); + inline void cb_NumPerd_i (Fl_Knob* o, void* v); + static void cb_NumPerd (Fl_Knob* o, void* v); + inline void cb_Sine_i (Fl_Check_Button* o, void* v); + static void cb_Sine (Fl_Check_Button* o, void* v); + inline void cb_Tri_i (Fl_Check_Button* o, void* v); + static void cb_Tri (Fl_Check_Button* o, void* v); + inline void cb_Square_i (Fl_Check_Button* o, void* v); + static void cb_Square (Fl_Check_Button*, void*); + inline void cb_Saw_i (Fl_Check_Button* o, void* v); + static void cb_Saw (Fl_Check_Button*, void*); +}; + +#endif diff --git a/SpiralSound/Plugins/LFOPlugin/Makefile b/SpiralSound/Plugins/LFOPlugin/Makefile new file mode 100644 index 0000000..0bb3b8b --- /dev/null +++ b/SpiralSound/Plugins/LFOPlugin/Makefile @@ -0,0 +1,167 @@ +# Generated automatically from Makefile.in by configure. +############################################################################# +# Makefile for building LFOPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: LFOPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = -pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused +CXXFLAGS= -pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = /usr/bin/install -c + +###### Autoconf variables + +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + LFOPlugin.h \ + LFOPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + LFOPlugin.C \ + LFOPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + LFOPlugin.o \ + LFOPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = LFOPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake LFOPlugin.pro + +dist: + $(TAR) LFOPlugin.tar LFOPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) LFOPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +LFOPlugin.o: LFOPlugin.C \ + LFOPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + LFOPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +LFOPluginGUI.o: LFOPluginGUI.C \ + LFOPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + LFOPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h + diff --git a/SpiralSound/Plugins/LFOPlugin/Makefile.in b/SpiralSound/Plugins/LFOPlugin/Makefile.in new file mode 100644 index 0000000..542db95 --- /dev/null +++ b/SpiralSound/Plugins/LFOPlugin/Makefile.in @@ -0,0 +1,166 @@ +############################################################################# +# Makefile for building LFOPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: LFOPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + LFOPlugin.h \ + LFOPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + LFOPlugin.C \ + LFOPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + LFOPlugin.o \ + LFOPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = LFOPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake LFOPlugin.pro + +dist: + $(TAR) LFOPlugin.tar LFOPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) LFOPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +LFOPlugin.o: LFOPlugin.C \ + LFOPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + LFOPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +LFOPluginGUI.o: LFOPluginGUI.C \ + LFOPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + LFOPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h + diff --git a/SpiralSound/Plugins/LFOPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/LFOPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..3c49c4b --- /dev/null +++ b/SpiralSound/Plugins/LFOPlugin/SpiralIcon.xpm @@ -0,0 +1,310 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 271 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #D3D3D3", +"R c #C1BEC9", +"S c #474060", +"T c #31294D", +"U c #716C85", +"V c #65607A", +"W c #625D78", +"X c #D5D4DB", +"Y c #F7F7F7", +"Z c #8B8B8B", +"` c #161616", +" . c #0C0C0C", +".. c #060606", +"+. c #393643", +"@. c #47415F", +"#. c #9692A4", +"$. c #D9D8DE", +"%. c #F7F7F8", +"&. c #918DA0", +"*. c #B8B5C1", +"=. c #D1D1D1", +"-. c #252525", +";. c #727175", +">. c #FEFEFF", +",. c #9D99AA", +"'. c #DBD9E0", +"). c #E9E9E9", +"!. c #CBCBCB", +"~. c #E0E0E0", +"{. c #6C6C6C", +"]. c #515151", +"^. c #A6A6A7", +"/. c #827E93", +"(. c #615C77", +"_. c #EAEAED", +":. c #DFDFE1", +"<. c #F5FE00", +"[. c #1C1E00", +"}. c #1E1D24", +"|. c #9894A7", +"1. c #B1AEBB", +"2. c #69686F", +"3. c #000001", +"4. c #615C76", +"5. c #5F5A75", +"6. c #413E4D", +"7. c #020203", +"8. c #1A1A1C", +"9. c #C3C1CB", +"0. c #9D9D9D", +"a. c #202020", +"b. c #383838", +"c. c #4C4C4C", +"d. c #111112", +"e. c #C9C7D0", +"f. c #F1F1F1", +"g. c #F8F8F8", +"h. c #232323", +"i. c #181900", +"j. c #050408", +"k. c #AEACB9", +"l. c #FEFEFE", +"m. c #1D1D1D", +"n. c #B7B5C1", +"o. c #9390A2", +"p. c #BBBBBB", +"q. c #414141", +"r. c #030303", +"s. c #28272A", +"t. c #F4F4F6", +"u. c #605B76", +"v. c #736E86", +"w. c #D8D8D8", +"x. c #727272", +"y. c #101010", +"z. c #848486", +"A. c #CCCBD3", +"B. c #747087", +"C. c #6D6881", +"D. c #1C1C1C", +"E. c #656566", +"F. c #F6F6F6", +"G. c #E8E6EA", +"H. c #706B84", +"I. c #E3E1E6", +"J. c #474746", +"K. c #151515", +"L. c #C8C8C8", +"M. c #AEAEAE", +"N. c #080808", +"O. c #373639", +"P. c #FDFCFE", +"Q. c #ABA8B7", +"R. c #F1F0F3", +"S. c #6D6980", +"T. c #0A090E", +"U. c #95929E", +"V. c #0A0810", +"W. c #050505", +"X. c #5B5A5C", +"Y. c #F7F6F7", +"Z. c #F4F3F5", +"`. c #908C9F", +" + c #C8C6D0", +".+ c #837E96", +"++ c #86868A", +"@+ c #070608", +"#+ c #ECEBEE", +"$+ c #5B5571", +"%+ c #646078", +"&+ c #AFAFB0", +"*+ c #454545", +"=+ c #363636", +"-+ c #7A7A7A", +";+ c #C8C8C9", +">+ c #212025", +",+ c #060607", +"'+ c #969699", +")+ c #FAFAFA", +"!+ c #F8F8F9", +"~+ c #A29EAF", +"{+ c #F7F6F8", +"]+ c #F0F0F1", +"^+ c #B8B7B9", +"/+ c #E4E4E4", +"(+ c #FDFDFD", +"_+ c #A5A2B2", +":+ c #3B3456", +"<+ c #A8A5B4", +"[+ c #525252", +"}+ c #848387", +"|+ c #CDCDCD", +"1+ c #8D899C", +"2+ c #494262", +"3+ c #68627C", +"4+ c #40395A", +"5+ c #ECECEC", +"6+ c #020202", +"7+ c #B4B5B5", +"8+ c #0B0B0B", +"9+ c #313232", +"0+ c #E3E3E3", +"a+ c #B1AEBC", +"b+ c #BDBBC6", +"c+ c #3C3556", +"d+ c #898599", +"e+ c #EDEDED", +"f+ c #39393A", +"g+ c #040404", +"h+ c #333333", +"i+ c #F5F5F5", +"j+ c #2B2B2B", +"k+ c #2D2A3D", +"l+ c #B6B4C1", +"m+ c #F5F5F6", +"n+ c #605A76", +"o+ c #DAD8DF", +"p+ c #F5F4F6", +"q+ c #615B76", +"r+ c #524D6A", +"s+ c #E4E3E8", +"t+ c #D5D5D5", +"u+ c #1B1B1B", +"v+ c #303030", +"w+ c #AAABAB", +"x+ c #585464", +"y+ c #B0AEBB", +"z+ c #A29FAF", +"A+ c #E9E8E9", +"B+ c #787779", +"C+ c #0F0E15", +"D+ c #2D2D2E", +"E+ c #595959", +"F+ c #FAFAFB", +"G+ c #807B92", +"H+ c #B0ADBB", +"I+ c #E8E7EB", +"J+ c #3A3258", +"K+ c #E6E5EA", +"L+ c #DFDEE3", +"M+ c #443E5E", +"N+ c #BAB8C4", +"O+ c #C1BFCA", +"P+ c #E0E0E5", +"Q+ c #D0CED6", +"R+ c #362F52", +"S+ c #CECCD5", +"T+ c #413A5B", +"U+ c #6A657F", +"V+ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 6 6 M Q R S T U V ", +" W X ; ; ; ; Y Z ` 6 .6 6 6 6 6 6 6 6 ..+.@.#.$.%.&. ", +" *.; ; ; ; ; ; = =.-.6 6 6 6 6 6 6 6 6 6 E ;.>.; ; ,. ", +" '.; ; ).Q h !.~.{.6 6 6 6 6 6 6 6 6 6 6 6 E ].^.4 /. ", +" (._.; :. .6 6 6 6 <.6 [.6 <.<.<.<.6 6 6 <.6 6 6 }.|. ", +" U @ 1.2.3.6 6 6 6 <.6 6 6 <.6 6 6 6 6 <.6 <.6 6 ", +" 4.5.6.6 7.6 6 6 <.6 6 6 <.6 6 6 6 <.6 6 6 <.6 8. ", +" 9.; ; 0.a.a.b.c.a.<.6 6 6 <.<.<.6 6 <.6 6 6 <.6 d. ", +" e.; ; f.g.; ; ; h.<.i.i.6 <.6 6 6 6 <.6 6 6 <.6 j. ", +" k.; ; ; ; l.; ; m.<.6 6 6 <.6 [.6 6 <.6 6 6 <.6 6 n., ", +" o.; ; l.; : p.q.r.<.6 6 6 <.6 6 6 6 6 <.6 <.6 6 s.l.t.u. ", +" v.; ; ; w.x.y.6 6 <.<.<.6 <.6 6 6 6 6 6 <.6 6 6 z.; ; A.B. ", +" C.J ; : D.6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 E.F.; ; G.H. ", +" I.; ; J.6 E 6 K.L.M.N.6 6 6 6 6 6 6 6 6 6 6 6 6 O.P.; ; > H. ", +" Q.; R.S.T.6 6 M.l.; U.V.6 6 6 6 6 6 6 6 m W.6 6 6 X.Y.; ; Z.`. ", +" H. +! .+++@+x ; ; #+$+%+&+l *+6 6 6 =+-+;+>+6 6 6 ,+'+)+; ; !+@ ", +" ~+{+]+^+/+(+; _+:+<+; F.*+6 6 E [+; ; }+6 6 E 6 o |+; ; = 1+ ", +" 2+> ; ; ; ; ; ; 3+4+; ; 5+b.6 6 6+D ; ; 7+8+6 6 6 9+0+; ; a+ ", +" > ; ; ; ; b+c+d+; ; e+f+6 6 g+h+; ; i+j+6 6 k+l+; m+3 ", +" n+o+= ; p+q+r+s+; ; t+u+6 6 6+v+; ; ; w+[+x+ ", +" y+4 z+ W ; ; ; A+B+v+C+D+E+; ; ; l.F+G+ ", +" H+; ; ; ; ; I+J+K+; ; ; ; = L+M+ ", +" N+O+P+4 ; ; Q+R+S+; ; ; s d+S ", +" T+ U+V+d+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/MatrixPlugin/Makefile.in b/SpiralSound/Plugins/MatrixPlugin/Makefile.in new file mode 100644 index 0000000..8ef6738 --- /dev/null +++ b/SpiralSound/Plugins/MatrixPlugin/Makefile.in @@ -0,0 +1,176 @@ +############################################################################# +# Makefile for building MatrixPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: MatrixPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_LED_Button.H \ + ../../Sample.h \ + MatrixPlugin.h \ + MatrixPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_LED_Button.cxx \ + ../../Sample.C \ + MatrixPlugin.C \ + MatrixPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../Widgets/Fl_LED_Button.o \ + ../../Sample.o \ + MatrixPlugin.o \ + MatrixPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = MatrixPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake MatrixPlugin.pro + +dist: + $(TAR) MatrixPlugin.tar MatrixPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) MatrixPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../Widgets/Fl_LED_Button.o: ../Widgets/Fl_LED_Button.cxx \ + ../Widgets/Fl_LED_Button.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +MatrixPlugin.o: MatrixPlugin.C \ + MatrixPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + MatrixPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_LED_Button.H \ + SpiralIcon.xpm \ + ../../RiffWav.h \ + ../../NoteTable.h + +MatrixPluginGUI.o: MatrixPluginGUI.C \ + MatrixPluginGUI.h \ + MatrixPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_LED_Button.H + diff --git a/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C b/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C new file mode 100644 index 0000000..194c40b --- /dev/null +++ b/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.C @@ -0,0 +1,367 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "MatrixPlugin.h" +#include "MatrixPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../RiffWav.h" +#include "../../NoteTable.h" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new MatrixPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0012; +} +} + +/////////////////////////////////////////////////////// + +MatrixPlugin::MatrixPlugin() : +m_TickTime(1.0f), +m_StepTime(1.0f), +m_Time(0.0f), +m_Step(0), +m_Loop(true), +m_NoteCut(false), +m_Current(0), +m_CurrentNoteCV(0), +m_CurrentTriggerCV(0), +m_Triggered(false), +m_ClockHigh(false), +m_CopyPattern(0) +{ +cerr<SAMPLERATE; + return Info; +} + +SpiralGUIType *MatrixPlugin::CreateGUI() +{ + m_GUI = new MatrixPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void MatrixPlugin::Execute() +{ + for (int n=0; nBUFSIZE; n++) + { + if (InputExists(1)) m_StepTime = GetInput(1,n); + + // inc time + m_Time+=m_TickTime; + + SetOutputPitch(0,n,m_CurrentNoteCV); + SetOutput(1,n,m_CurrentTriggerCV); + + if (m_Step+1 >= m_Matrix[m_Current].Length) SetOutput(18, n, 1); + else SetOutput(18, n, 0); + + if (GetInputPitch(0,n)>0) + { + if (!m_Triggered) + { + float Freq=GetInputPitch(0,n); + // Notes 0 to 16 trigger patterns 0 to 16 + // No other notes catered for + for (int i=0; iUpdateValues(); + + m_Time=m_StepTime*(1/m_Matrix[m_Current].Speed); + m_Step=-1; + + m_Triggered=true; + } + } + else + { + m_Triggered=false; + } + + + // set the individual triggers + for (int t=0; t0) + { + if(!m_ClockHigh) + { + m_ClockHigh=true; + ExternalClockTriggered=true; + } + } + else + { + if (m_ClockHigh) + { + m_ClockHigh=false; + ExternalClockTriggered=true; + } + } + } + + // An external clock pulse overrides the internal timing + if ((!ExternalClock && m_Time>=m_StepTime*(1/m_Matrix[m_Current].Speed)) || + (ExternalClock && ExternalClockTriggered)) + { + m_Time=0; + m_Step++; + + if (m_Step >= m_Matrix[m_Current].Length) m_Step=0; + + if (m_GUI) ((MatrixPluginGUI*)m_GUI)->SetLED(m_Step); + + // Reset the values + m_CurrentTriggerCV=0; + if (m_NoteCut) m_CurrentNoteCV=0; + for (int t=0; t=0; y--) { + for (x=0; x>version; + + switch (version) + { + case 1: + { + s>>m_Current>>m_Time>>m_Step>>m_Loop>>m_NoteCut; + + for (int n=0; n>m_Matrix[n].Length>>m_Matrix[n].Speed>>m_Matrix[n].Octave; + + for (int y=0; y>m_Matrix[n].Matrix[x][y]; + } + } + } break; + + case 2: + { + s>>m_Current>>m_Time>>m_Step>>m_Loop>>m_NoteCut; + + for (int n=0; n>m_Matrix[n].Length>>m_Matrix[n].Speed>>m_Matrix[n].Octave; + + int x=0,y=0; + while(x!=-1) + { + s>>x; + if (x!=-1) + { + s>>y; + if (y!=-1) m_Matrix[n].Matrix[x][y]=true; + } + } + } + } break; + } +} diff --git a/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.h b/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.h new file mode 100644 index 0000000..6886eac --- /dev/null +++ b/SpiralSound/Plugins/MatrixPlugin/MatrixPlugin.h @@ -0,0 +1,89 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef MatrixPLUGIN +#define MatrixPLUGIN + +static const int MATX = 64; +static const int MATY = 32; +static const int NUM_PATTERNS = 16; + +struct Pattern +{ + int Length; + float Speed; + int Octave; + bool Matrix[MATX][MATY]; +}; + +class MatrixPlugin : public SpiralPlugin +{ +public: + MatrixPlugin(); + virtual ~MatrixPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetNoteCut(bool s) { m_NoteCut=s; } + bool GetNoteCut() { return m_NoteCut; } + void SetCurrent(int s) { m_Current=s; } + int GetCurrent() { return m_Current; } + void SetStepTime(float s) { m_StepTime=s; } + float GetStepTime() { return m_StepTime; } + Pattern* GetPattern() { return &m_Matrix[m_Current]; } + + void CopyPattern() { m_CopyPattern = m_Current; cerr< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "MatrixPluginGUI.h" +#include +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +MatrixPluginGUI::MatrixPluginGUI(int w, int h,MatrixPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + //size_range(10,10); + m_NoteCut = new Fl_Button (5, h-30, 85, 20,"NoteCut"); + m_NoteCut->type(1); + m_NoteCut->labelsize(10); + m_NoteCut->value(0); + m_NoteCut->callback((Fl_Callback*)cb_NoteCut); + add(m_NoteCut); + + m_Pattern = new Fl_Counter(5, 20, 40, 20, "Pattern"); + m_Pattern->labelsize(10); + m_Pattern->type(FL_SIMPLE_COUNTER); + m_Pattern->step(1); + m_Pattern->value(0); + m_Pattern->callback((Fl_Callback*)cb_Pattern); + add(m_Pattern); + + m_Length = new Fl_Counter(5, 55, 40, 20, "Length"); + m_Length->labelsize(10); + m_Length->type(FL_SIMPLE_COUNTER); + m_Length->step(1); + m_Length->value(64); + m_Length->callback((Fl_Callback*)cb_Length); + add(m_Length); + + m_Speed = new Fl_Knob (50, 60, 40, 40, "Speed"); + m_Speed->color(GUI_COLOUR); + m_Speed->type(Fl_Knob::DOTLIN); + m_Speed->labelsize(10); + m_Speed->maximum(200); + m_Speed->step(0.01); + m_Speed->value(1.0); + m_Speed->callback((Fl_Callback*)cb_Speed); + add(m_Speed); + + m_SpeedVal = new Fl_Counter (5, 125, 85, 20, ""); + m_SpeedVal->labelsize(10); + m_SpeedVal->value(10); + + m_Octave = new Fl_Counter(5, 90, 40, 20, "Octave"); + m_Octave->labelsize(10); + m_Octave->type(FL_SIMPLE_COUNTER); + m_Octave->step(1); + m_Octave->value(0); + m_Octave->callback((Fl_Callback*)cb_Octave); + add(m_Octave); + + m_CopyBtn = new Fl_Button (5, 150, 40, 20, "Copy"); + m_CopyBtn->labelsize (10); + m_CopyBtn->callback ((Fl_Callback*)cb_CopyBtn); + add (m_CopyBtn); + + m_PasteBtn = new Fl_Button (50, 150, 40, 20, "Paste"); + m_PasteBtn->labelsize (10); + m_PasteBtn->deactivate(); + m_PasteBtn->callback ((Fl_Callback*)cb_PasteBtn); + add (m_PasteBtn); + + m_ClearBtn = new Fl_Button (5, 175, 85, 20, "Clear"); + m_ClearBtn->labelsize (10); + m_ClearBtn->callback ((Fl_Callback*)cb_ClearBtn); + add (m_ClearBtn); + + m_TransUpBtn = new Fl_Button (5, 200, 40, 20, "Up"); + m_TransUpBtn->labelsize (10); + m_TransUpBtn->callback ((Fl_Callback*)cb_TransUpBtn); + add (m_TransUpBtn); + + m_TransDnBtn = new Fl_Button (50, 200, 40, 20, "Down"); + m_TransDnBtn->labelsize (10); + m_TransDnBtn->callback ((Fl_Callback*)cb_TransDnBtn); + add (m_TransDnBtn); + + m_TransLbl = new Fl_Box (5, 216, 85, 20, "Transpose"); + m_TransLbl->labelsize(10); + add (m_TransLbl); + + int xoff=95; + int yoff=40; + int butsize=7; + int n=0; + + for(int x=0; xtype(1); + m_Matrix[x][y]->box(FL_BORDER_BOX); + if ((x%8)==0) m_Matrix[x][y]->color(FL_WHITE); + else m_Matrix[x][y]->color(FL_GRAY); + m_Matrix[x][y]->selection_color(FL_BLACK); + m_Matrix[x][y]->callback((Fl_Callback*)cb_Matrix,(void*)&Numbers[n]); + add(m_Matrix[x][y]); + n++; + } + + xoff=93; + for(int x=0; xselection_color(FL_WHITE); + add(m_Flash[x]); + } + + end(); +} + +void MatrixPluginGUI::UpdateValues() +{ + m_Pattern->value(m_Plugin->GetCurrent()); + m_Length->value(m_Plugin->GetPattern()->Length); + m_Speed->value(m_Plugin->GetPattern()->Speed*10); + m_SpeedVal->value((int)m_Speed->value()); + m_Octave->value(m_Plugin->GetPattern()->Octave); + + for(int x=0; xvalue(m_Plugin->GetPattern()->Matrix[x][y]); + } + + if (m_Plugin->CanTransposeUp()) m_TransUpBtn->activate(); else m_TransUpBtn->deactivate(); + if (m_Plugin->CanTransposeDown()) m_TransDnBtn->activate(); else m_TransDnBtn->deactivate(); +} + +void MatrixPluginGUI::SetLED(int n) +{ + for (int i=0; ivalue(false); + } + + m_Flash[n]->value(true); +} + + +inline void MatrixPluginGUI::cb_NoteCut_i(Fl_Button* o, void* v) +{ + m_Plugin->SetNoteCut(o->value()); +} +void MatrixPluginGUI::cb_NoteCut(Fl_Button* o, void* v) +{ ((MatrixPluginGUI*)(o->parent()))->cb_NoteCut_i(o,v);} + +inline void MatrixPluginGUI::cb_Matrix_i(Fl_Button* o, void* v) +{ + m_Plugin->GetPattern()->Matrix[*(int*)v/MATY][*(int*)v%MATY]=o->value(); + UpdateValues(); +} +void MatrixPluginGUI::cb_Matrix(Fl_Button* o, void* v) +{ ((MatrixPluginGUI*)(o->parent()))->cb_Matrix_i(o,v);} + +inline void MatrixPluginGUI::cb_Pattern_i(Fl_Counter* o, void* v) +{ + if (o->value()<0) o->value(0); + if (o->value()>NUM_PATTERNS-1) o->value(NUM_PATTERNS-1); + m_Plugin->SetCurrent((int)o->value()); + UpdateValues(); +} +void MatrixPluginGUI::cb_Pattern(Fl_Counter* o, void* v) +{ ((MatrixPluginGUI*)(o->parent()))->cb_Pattern_i(o,v);} + +inline void MatrixPluginGUI::cb_Length_i(Fl_Counter* o, void* v) +{ + if (o->value()<1) o->value(1); + if (o->value()>64) o->value(64); + m_Plugin->GetPattern()->Length=(int)o->value(); +} +void MatrixPluginGUI::cb_Length(Fl_Counter* o, void* v) +{ ((MatrixPluginGUI*)(o->parent()))->cb_Length_i(o,v);} + +inline void MatrixPluginGUI::cb_Speed_i(Fl_Knob* o, void* v) +{ + // Round off value, but it should be a float for tweaking + float value=o->value()+((int)o->value()-o->value()); + m_Plugin->GetPattern()->Speed=o->value(); + m_SpeedVal->value(value); +} +void MatrixPluginGUI::cb_Speed(Fl_Knob* o, void* v) +{ ((MatrixPluginGUI*)(o->parent()))->cb_Speed_i(o,v);} + +inline void MatrixPluginGUI::cb_Octave_i(Fl_Counter* o, void* v) +{ + if (o->value()<0) o->value(0); + if (o->value()>6) o->value(6); + m_Plugin->GetPattern()->Octave=(int)o->value(); +} +void MatrixPluginGUI::cb_Octave(Fl_Counter* o, void* v) +{ ((MatrixPluginGUI*)(o->parent()))->cb_Octave_i(o,v);} + +inline void MatrixPluginGUI::cb_SpeedVal_i (Fl_Counter* o, void* v) +{ + m_Speed->value (o->value()); + m_Plugin->GetPattern()->Speed = (float)o->value() * 0.1; +} + +void MatrixPluginGUI::cb_SpeedVal (Fl_Counter* o, void* v) +{ + ((MatrixPluginGUI*)(o->parent())) -> cb_SpeedVal_i (o, v); +} + +inline void MatrixPluginGUI::cb_CopyBtn_i (Fl_Button* o, void* v) +{ + m_PasteBtn->activate(); + m_Plugin->CopyPattern(); +} + +void MatrixPluginGUI::cb_CopyBtn (Fl_Button* o, void* v) +{ + ((MatrixPluginGUI*)(o->parent())) -> cb_CopyBtn_i (o, v); +} + +inline void MatrixPluginGUI::cb_PasteBtn_i (Fl_Button* o, void* v) +{ + m_Plugin->PastePattern(); + UpdateValues(); +} + +void MatrixPluginGUI::cb_PasteBtn (Fl_Button* o, void* v) +{ + ((MatrixPluginGUI*)(o->parent())) -> cb_PasteBtn_i (o, v); +} + +inline void MatrixPluginGUI::cb_ClearBtn_i (Fl_Button* o, void* v) +{ + m_Plugin->ClearPattern(); + UpdateValues(); +} + +void MatrixPluginGUI::cb_ClearBtn (Fl_Button* o, void* v) +{ + ((MatrixPluginGUI*)(o->parent())) -> cb_ClearBtn_i (o, v); +} + +inline void MatrixPluginGUI::cb_TransUpBtn_i (Fl_Button* o, void* v) +{ + m_Plugin->TransposeUp(); + UpdateValues(); +} + +void MatrixPluginGUI::cb_TransUpBtn (Fl_Button* o, void* v) +{ + ((MatrixPluginGUI*)(o->parent())) -> cb_TransUpBtn_i (o, v); +} + +inline void MatrixPluginGUI::cb_TransDnBtn_i (Fl_Button* o, void* v) +{ + m_Plugin->TransposeDown(); + UpdateValues(); +} + +void MatrixPluginGUI::cb_TransDnBtn (Fl_Button* o, void* v) +{ + ((MatrixPluginGUI*)(o->parent())) -> cb_TransDnBtn_i (o, v); +} diff --git a/SpiralSound/Plugins/MatrixPlugin/MatrixPluginGUI.h b/SpiralSound/Plugins/MatrixPlugin/MatrixPluginGUI.h new file mode 100644 index 0000000..8774553 --- /dev/null +++ b/SpiralSound/Plugins/MatrixPlugin/MatrixPluginGUI.h @@ -0,0 +1,94 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "MatrixPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_LED_Button.H" + +#ifndef MatrixGUI +#define MatrixGUI + + +class MatrixPluginGUI : public SpiralPluginGUI +{ +public: + MatrixPluginGUI(int w, int h, MatrixPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + void SetLED(int n); + + MatrixPlugin *m_Plugin; +private: + + int Numbers[MATX*MATY]; + + Fl_Button* m_NoteCut; + Fl_Counter* m_Pattern; + Fl_Counter* m_Length; + Fl_Knob* m_Speed; + Fl_Button* m_Matrix[MATX][MATY]; + Fl_Counter* m_Octave; + Fl_Counter* m_SpeedVal; + Fl_LED_Button* m_Flash[MATX]; + Fl_Button* m_CopyBtn; + Fl_Button* m_PasteBtn; + Fl_Button* m_ClearBtn; + Fl_Box* m_TransLbl; + Fl_Button* m_TransUpBtn; + Fl_Button* m_TransDnBtn; + + //// Callbacks //// + inline void cb_Matrix_i(Fl_Button* o, void* v); + static void cb_Matrix(Fl_Button* o, void* v); + inline void cb_Pattern_i(Fl_Counter* o, void* v); + static void cb_Pattern(Fl_Counter* o, void* v); + inline void cb_Length_i(Fl_Counter* o, void* v); + static void cb_Length(Fl_Counter* o, void* v); + inline void cb_Speed_i(Fl_Knob* o, void* v); + static void cb_Speed(Fl_Knob* o, void* v); + inline void cb_NoteCut_i(Fl_Button* o, void* v); + static void cb_NoteCut(Fl_Button* o, void* v); + inline void cb_Octave_i(Fl_Counter* o, void* v); + static void cb_Octave(Fl_Counter* o, void* v); + inline void cb_SpeedVal_i (Fl_Counter* o, void* v); + static void cb_SpeedVal (Fl_Counter* o, void* v); + inline void cb_CopyBtn_i (Fl_Button* o, void* v); + static void cb_CopyBtn (Fl_Button* o, void* v); + inline void cb_PasteBtn_i (Fl_Button* o, void* v); + static void cb_PasteBtn (Fl_Button* o, void* v); + inline void cb_ClearBtn_i (Fl_Button* o, void* v); + static void cb_ClearBtn (Fl_Button* o, void* v); + inline void cb_TransUpBtn_i (Fl_Button* o, void* v); + static void cb_TransUpBtn (Fl_Button* o, void* v); + inline void cb_TransDnBtn_i (Fl_Button* o, void* v); + static void cb_TransDnBtn (Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/MatrixPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/MatrixPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..18a7222 --- /dev/null +++ b/SpiralSound/Plugins/MatrixPlugin/SpiralIcon.xpm @@ -0,0 +1,325 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 286 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0A0A0A", +"+. c #151700", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #282900", +"!. c #030300", +"~. c #070700", +"{. c #020200", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #EDFF00", +"|. c #FEF100", +"1. c #515151", +"2. c #A6A6A7", +"3. c #827E93", +"4. c #615C77", +"5. c #EAEAED", +"6. c #DFDFE1", +"7. c #0C0C0C", +"8. c #191700", +"9. c #1E1D24", +"0. c #9894A7", +"a. c #B1AEBB", +"b. c #69686F", +"c. c #000001", +"d. c #615C76", +"e. c #5F5A75", +"f. c #413E4D", +"g. c #020203", +"h. c #1A1A1C", +"i. c #C3C1CB", +"j. c #9D9D9D", +"k. c #202020", +"l. c #383838", +"m. c #4C4C4C", +"n. c #111112", +"o. c #C9C7D0", +"p. c #F1F1F1", +"q. c #F8F8F8", +"r. c #232323", +"s. c #050408", +"t. c #AEACB9", +"u. c #FEFEFE", +"v. c #1D1D1D", +"w. c #B7B5C1", +"x. c #9390A2", +"y. c #BBBBBB", +"z. c #414141", +"A. c #030303", +"B. c #28272A", +"C. c #F4F4F6", +"D. c #605B76", +"E. c #736E86", +"F. c #D8D8D8", +"G. c #727272", +"H. c #101010", +"I. c #848486", +"J. c #CCCBD3", +"K. c #747087", +"L. c #6D6881", +"M. c #1C1C1C", +"N. c #242424", +"O. c #212205", +"P. c #1B1D00", +"Q. c #000100", +"R. c #656566", +"S. c #F6F6F6", +"T. c #E8E6EA", +"U. c #706B84", +"V. c #E3E1E6", +"W. c #474746", +"X. c #151515", +"Y. c #C8C8C8", +"Z. c #AEAEAE", +"`. c #070707", +" + c #010100", +".+ c #373639", +"++ c #FDFCFE", +"@+ c #ABA8B7", +"#+ c #F1F0F3", +"$+ c #6D6980", +"%+ c #0A090E", +"&+ c #95929E", +"*+ c #0A0810", +"=+ c #0D0D0D", +"-+ c #050505", +";+ c #5B5A5C", +">+ c #F7F6F7", +",+ c #F4F3F5", +"'+ c #908C9F", +")+ c #C8C6D0", +"!+ c #837E96", +"~+ c #86868A", +"{+ c #070608", +"]+ c #ECEBEE", +"^+ c #5B5571", +"/+ c #646078", +"(+ c #AFAFB0", +"_+ c #454545", +":+ c #363636", +"<+ c #7A7A7A", +"[+ c #C8C8C9", +"}+ c #212025", +"|+ c #060607", +"1+ c #969699", +"2+ c #FAFAFA", +"3+ c #F8F8F9", +"4+ c #A29EAF", +"5+ c #F7F6F8", +"6+ c #F0F0F1", +"7+ c #B8B7B9", +"8+ c #E4E4E4", +"9+ c #FDFDFD", +"0+ c #A5A2B2", +"a+ c #3B3456", +"b+ c #A8A5B4", +"c+ c #525252", +"d+ c #848387", +"e+ c #CDCDCD", +"f+ c #8D899C", +"g+ c #494262", +"h+ c #68627C", +"i+ c #40395A", +"j+ c #ECECEC", +"k+ c #020202", +"l+ c #B4B5B5", +"m+ c #0B0B0B", +"n+ c #313232", +"o+ c #E3E3E3", +"p+ c #B1AEBC", +"q+ c #BDBBC6", +"r+ c #3C3556", +"s+ c #898599", +"t+ c #EDEDED", +"u+ c #39393A", +"v+ c #040404", +"w+ c #333333", +"x+ c #F5F5F5", +"y+ c #2B2B2B", +"z+ c #2D2A3D", +"A+ c #B6B4C1", +"B+ c #F5F5F6", +"C+ c #605A76", +"D+ c #DAD8DF", +"E+ c #F5F4F6", +"F+ c #615B76", +"G+ c #524D6A", +"H+ c #E4E3E8", +"I+ c #D5D5D5", +"J+ c #1B1B1B", +"K+ c #303030", +"L+ c #AAABAB", +"M+ c #585464", +"N+ c #B0AEBB", +"O+ c #A29FAF", +"P+ c #E9E8E9", +"Q+ c #787779", +"R+ c #0F0E15", +"S+ c #2D2D2E", +"T+ c #595959", +"U+ c #FAFAFB", +"V+ c #807B92", +"W+ c #B0ADBB", +"X+ c #E8E7EB", +"Y+ c #3A3258", +"Z+ c #E6E5EA", +"`+ c #DFDEE3", +" @ c #443E5E", +".@ c #BAB8C4", +"+@ c #C1BFCA", +"@@ c #E0E0E5", +"#@ c #D0CED6", +"$@ c #362F52", +"%@ c #CECCD5", +"&@ c #413A5B", +"*@ c #6A657F", +"=@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 6 6 ~.{.6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.}.|.|.|.|.|.|.|.|.|.|.|.E 1.2.4 3. ", +" 4.5.; 6.7.6 6 6 6 6 }.6 6 6 6 6 6 6 6 6 6 |.8.6 9.0. ", +" V @ a.b.c.6 6 6 6 6 }.6 }.}.6 }.}.6 }.}.6 |.6 6 ", +" d.e.f.6 g.6 6 6 6 }.6 6 6 6 6 6 6 6 6 6 |.6 6 h. ", +" i.; ; j.k.k.l.m.k.6 }.6 }.}.6 }.}.6 }.}.6 |.6 6 n. ", +" o.; ; p.q.; ; ; r.6 }.6 6 6 6 6 6 6 6 6 6 |.6 6 s. ", +" t.; ; ; ; u.; ; v.6 }.6 }.}.6 }.}.6 }.}.6 |.6 6 6 w., ", +" x.; ; u.; : y.z.A.6 }.6 6 6 6 6 6 6 6 6 6 |.6 6 B.u.C.D. ", +" E.; ; ; F.G.H.6 6 6 }.}.}.}.}.}.}.}.}.}.}.|.6 6 I.; ; J.K. ", +" L.J ; : M.6 6 6 6 N.O.P.6 Q.6 6 6 6 6 6 6 6 6 6 R.S.; ; T.U. ", +" V.; ; W.6 E 6 X.Y.Z.`.6 6 6 6 6 6 6 6 +6 6 6 6 .+++; ; > U. ", +" @+; #+$+%+6 6 Z.u.; &+*+6 6 6 6 6 6 6 6 =+-+6 6 6 ;+>+; ; ,+'+ ", +" U.)+! !+~+{+x ; ; ]+^+/+(+l _+6 6 6 :+<+[+}+6 6 6 |+1+2+; ; 3+@ ", +" 4+5+6+7+8+9+; 0+a+b+; S._+6 6 E c+; ; d+6 6 E 6 o e+; ; = f+ ", +" g+> ; ; ; ; ; ; h+i+; ; j+l.6 6 k+D ; ; l+m+6 6 6 n+o+; ; p+ ", +" > ; ; ; ; q+r+s+; ; t+u+6 6 v+w+; ; x+y+6 6 z+A+; B+3 ", +" C+D+= ; E+F+G+H+; ; I+J+6 6 k+K+; ; ; L+c+M+ ", +" N+4 O+ X ; ; ; P+Q+K+R+S+T+; ; ; u.U+V+ ", +" W+; ; ; ; ; X+Y+Z+; ; ; ; = `+ @ ", +" .@+@@@4 ; ; #@$@%@; ; ; s s+T ", +" &@ *@=@s+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/MeterPlugin/Makefile b/SpiralSound/Plugins/MeterPlugin/Makefile new file mode 100644 index 0000000..0f899c9 --- /dev/null +++ b/SpiralSound/Plugins/MeterPlugin/Makefile @@ -0,0 +1,172 @@ +# Generated automatically from Makefile.in by configure. +############################################################################# +# Makefile for building MeterPlugin.so +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = -pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused +CXXFLAGS= -pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = /usr/bin/install -c + +###### Autoconf variables + +prefix = /usr/local +exec_prefix = ${prefix} + +bindir = ${exec_prefix}/bin +sbindir = ${exec_prefix}/sbin +libexecdir = ${exec_prefix}/libexec +datadir = ${prefix}/share +sysconfdir = ${prefix}/etc +sharedstatedir = ${prefix}/com +localstatedir = ${prefix}/var +libdir = ${exec_prefix}/lib +infodir = ${prefix}/info +mandir = ${prefix}/man + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_SevenSeg.H \ + ../Widgets/Fl_VU_Meter.h \ + ../../Sample.h \ + MeterPlugin.h \ + MeterPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_SevenSeg.cxx \ + ../Widgets/Fl_VU_Meter.cxx \ + ../../Sample.C \ + MeterPlugin.C \ + MeterPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_DragBar.o \ + ../Widgets/Fl_SevenSeg.o \ + ../Widgets/Fl_VU_Meter.o \ + ../../Sample.o \ + MeterPlugin.o \ + MeterPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = MeterPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake MeterPlugin.pro + +dist: + $(TAR) MeterPlugin.tar MeterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) MeterPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../Widgets/Fl_VU_Meter.o: ../Widgets/Fl_VU_Meter.cxx \ + ../Widgets/Fl_VU_Meter.h + +../Widgets/Fl_SevenSeg.o: ../Widgets/Fl_SevenSeg.cxx \ + ../Widgets/Fl_SevenSeg.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +MeterPlugin.o: MeterPlugin.C \ + MeterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + MeterPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_VU_Meter.h \ + ../Widgets/Fl_SevenSeg.H \ + ../SpiralPluginGUI.h \ + SpiralIcon.xpm + +MeterPluginGUI.o: MeterPluginGUI.C \ + MeterPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_VU_Meter.h \ + ../Widgets/Fl_SevenSeg.H \ + MeterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h + diff --git a/SpiralSound/Plugins/MeterPlugin/Makefile.in b/SpiralSound/Plugins/MeterPlugin/Makefile.in new file mode 100644 index 0000000..404555c --- /dev/null +++ b/SpiralSound/Plugins/MeterPlugin/Makefile.in @@ -0,0 +1,171 @@ +############################################################################# +# Makefile for building MeterPlugin.so +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_SevenSeg.H \ + ../Widgets/Fl_VU_Meter.h \ + ../../Sample.h \ + MeterPlugin.h \ + MeterPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_SevenSeg.cxx \ + ../Widgets/Fl_VU_Meter.cxx \ + ../../Sample.C \ + MeterPlugin.C \ + MeterPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_DragBar.o \ + ../Widgets/Fl_SevenSeg.o \ + ../Widgets/Fl_VU_Meter.o \ + ../../Sample.o \ + MeterPlugin.o \ + MeterPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = MeterPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake MeterPlugin.pro + +dist: + $(TAR) MeterPlugin.tar MeterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) MeterPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../Widgets/Fl_VU_Meter.o: ../Widgets/Fl_VU_Meter.cxx \ + ../Widgets/Fl_VU_Meter.h + +../Widgets/Fl_SevenSeg.o: ../Widgets/Fl_SevenSeg.cxx \ + ../Widgets/Fl_SevenSeg.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +MeterPlugin.o: MeterPlugin.C \ + MeterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + MeterPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_VU_Meter.h \ + ../Widgets/Fl_SevenSeg.H \ + ../SpiralPluginGUI.h \ + SpiralIcon.xpm + +MeterPluginGUI.o: MeterPluginGUI.C \ + MeterPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_VU_Meter.h \ + ../Widgets/Fl_SevenSeg.H \ + MeterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h + diff --git a/SpiralSound/Plugins/MeterPlugin/MeterPlugin.C b/SpiralSound/Plugins/MeterPlugin/MeterPlugin.C new file mode 100644 index 0000000..d55abf1 --- /dev/null +++ b/SpiralSound/Plugins/MeterPlugin/MeterPlugin.C @@ -0,0 +1,61 @@ +/* SpiralSound + * Copyleft (C) 2002 Andy Preston + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "MeterPlugin.h" +#include "MeterPluginGUI.h" +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() { return new MeterPlugin; } + +char** GetIcon() { return SpiralIcon_xpm; } + +int GetID() { return 123; } +} + +/////////////////////////////////////////////////////// + +MeterPlugin::MeterPlugin() { + m_PluginInfo.Name = "Meter"; + m_PluginInfo.Width = 230; + m_PluginInfo.Height = 108; + m_PluginInfo.NumInputs = 1; + m_PluginInfo.NumOutputs = 1; + m_PluginInfo.PortTips.push_back ("Input"); + m_PluginInfo.PortTips.push_back ("Output"); +} + +MeterPlugin::~MeterPlugin() { +} + +PluginInfo &MeterPlugin::Initialise (const HostInfo *Host) { + PluginInfo& Info = SpiralPlugin::Initialise (Host); + return Info; +} + +SpiralGUIType *MeterPlugin::CreateGUI() { + m_GUI = new MeterPluginGUI (m_PluginInfo.Width, m_PluginInfo.Height, this, m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void MeterPlugin::Execute() { + // Just copy the data through. + if (GetOutputBuf (0)) GetOutputBuf (0)->Zero(); + if (GetInput (0)) GetOutputBuf (0)->Mix (*GetInput(0), 0); + m_GUI->redraw(); +} diff --git a/SpiralSound/Plugins/MeterPlugin/MeterPlugin.h b/SpiralSound/Plugins/MeterPlugin/MeterPlugin.h new file mode 100644 index 0000000..fda5619 --- /dev/null +++ b/SpiralSound/Plugins/MeterPlugin/MeterPlugin.h @@ -0,0 +1,38 @@ +/* SpiralSound + * Copyleft (C) 2002 Andy Preston + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef METERPLUGIN +#define METERPLUGIN + +#include "../SpiralPlugin.h" +#include + +class MeterPlugin : public SpiralPlugin { + public: + MeterPlugin(); + virtual ~MeterPlugin(); + virtual PluginInfo& Initialise (const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut (ostream &s) {} + virtual void StreamIn (istream &s) {} + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } +}; + +#endif diff --git a/SpiralSound/Plugins/MeterPlugin/MeterPlugin.pro b/SpiralSound/Plugins/MeterPlugin/MeterPlugin.pro new file mode 100644 index 0000000..decac14 --- /dev/null +++ b/SpiralSound/Plugins/MeterPlugin/MeterPlugin.pro @@ -0,0 +1,19 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_VU_Meter.h \ + ../Widgets/Fl_SevenSeg.H \ + ../../Sample.h \ + MeterPlugin.h \ + MeterPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_VU_Meter.cxx \ + ../Widgets/Fl_SevenSeg.cxx \ + ../../Sample.C \ + MeterPlugin.C \ + MeterPluginGUI.C + +TARGET = MeterPlugin.so diff --git a/SpiralSound/Plugins/MeterPlugin/MeterPluginGUI.C b/SpiralSound/Plugins/MeterPlugin/MeterPluginGUI.C new file mode 100644 index 0000000..4624459 --- /dev/null +++ b/SpiralSound/Plugins/MeterPlugin/MeterPluginGUI.C @@ -0,0 +1,126 @@ +/* SpiralPlugin + * Copyleft (C) 2002 Andy Preston + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "MeterPluginGUI.h" +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +char label_buf[10]; + +MeterPluginGUI::MeterPluginGUI(int w, int h, MeterPlugin *o, const HostInfo *Info) : +SpiralPluginGUI (w, h, o), +m_Bypass(0) { + m_Plugin=o; + Bypass = new Fl_Button (175, 2, 40, 16, "Bypass"); + Bypass -> labelsize (10); + Bypass -> type (1); + Bypass -> callback ((Fl_Callback*)cb_Bypass); + add (Bypass); + for (int display=0; display<8; display++) { + Digits[display] = new Fl_SevenSeg ((display*28)+2, 20, 28, 40); + Digits[display] -> bar_width (4); + Digits[display] -> color (FL_WHITE); + Digits[display] -> color2 (GUI_COLOUR); + add (Digits[display]); + } + MinBox = new Fl_Output (2, 84, 84, 20); + MinBox -> box (FL_ENGRAVED_BOX); + MinBox -> color (16); + MinBox -> set_output(); + add (MinBox); + Reset = new Fl_Button (88, 84, 54, 20, "Reset"); + Reset -> labelsize (10); + Reset -> type (0); + Reset -> callback ((Fl_Callback*)cb_Reset); + add (Reset); + MaxBox = new Fl_Output (144, 84, 84, 20); + MaxBox->set_output(); + MaxBox->box (FL_ENGRAVED_BOX); + MaxBox->color (16); + add (MaxBox); + Meter = new Fl_VU_Meter (2, 62, 226, 20); + Meter->color (FL_BLACK); + cb_Reset_i (Reset, NULL); + add (Reset); + end(); +} + +void MeterPluginGUI::Display (const float *data) { + if (! m_Bypass) { + snprintf (label_buf, 64, "%1.5f", *data); + if (Meter->minimum() > *data) SetMin (*data); + if (Meter->maximum() < *data) SetMax (*data); + Meter->value (*data); + Meter->redraw(); + char* c = label_buf; + for (int display=0; display<8; display++) { + Digits[display] -> dp (off); + if (*c == 0) Digits[display] -> value (0); + else { + if (*c == '.') { + Digits[display] -> dp (point); + c++; + } + int val; + if (*c == '-') val = -1; else val = (int)*c - (int)'0'; + Digits[display] -> value (val); + c++; + } + } + } +} + +void MeterPluginGUI::draw() { + SpiralGUIType::draw(); + if (m_Plugin->GetInput(0) != NULL) { + Display (m_Plugin->GetInput(0)->GetBuffer()); + } +} + +void MeterPluginGUI::UpdateValues() { +} + +void MeterPluginGUI::SetMax (float NewValue) { + Meter->maximum (NewValue); + MaxBox->value (label_buf); +} + +void MeterPluginGUI::SetMin (float NewValue) { + Meter->minimum (NewValue); + MinBox->value (label_buf); +} + +void MeterPluginGUI::cb_Bypass_i (Fl_Button* o, void* v) { + m_Bypass = o->value(); +} + +void MeterPluginGUI::cb_Bypass (Fl_Button* o, void* v) { + ((MeterPluginGUI*)(o->parent()))->cb_Bypass_i (o,v); +} + +void MeterPluginGUI::cb_Reset_i (Fl_Button* o, void* v) { + SetMin (10); // Yes, I know that LOOKS the wrong way round, but it isn't! + SetMax (-10); +} + +void MeterPluginGUI::cb_Reset (Fl_Button* o, void* v) { + ((MeterPluginGUI*)(o->parent()))->cb_Reset_i (o,v); +} diff --git a/SpiralSound/Plugins/MeterPlugin/MeterPluginGUI.h b/SpiralSound/Plugins/MeterPlugin/MeterPluginGUI.h new file mode 100644 index 0000000..fc830de --- /dev/null +++ b/SpiralSound/Plugins/MeterPlugin/MeterPluginGUI.h @@ -0,0 +1,52 @@ +/* SpiralPlugin + * Copyleft (C) 2002 Andy Preston + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef METERGUI +#define METERGUI + +#include +#include "../Widgets/Fl_VU_Meter.h" +#include "../Widgets/Fl_SevenSeg.H" +#include +#include +#include "MeterPlugin.h" +#include "../SpiralPluginGUI.h" + +class MeterPluginGUI : public SpiralPluginGUI { + public: + MeterPluginGUI (int w, int h, MeterPlugin *o, const HostInfo *Info); + virtual void UpdateValues(); + virtual void draw(); + void Display (const float *data); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + MeterPlugin *m_Plugin; + private: + int m_Bypass; + void SetMax (float NewValue); + void SetMin (float NewValue); + Fl_SevenSeg *Digits[8]; + Fl_Output *MaxBox, *MinBox; + Fl_Button *Reset, *Bypass; + Fl_VU_Meter *Meter; + inline void cb_Reset_i (Fl_Button* o, void* v); + static void cb_Reset (Fl_Button* o, void* v); + inline void cb_Bypass_i (Fl_Button* o, void* v); + static void cb_Bypass (Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/MeterPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/MeterPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..0e4bbcc --- /dev/null +++ b/SpiralSound/Plugins/MeterPlugin/SpiralIcon.xpm @@ -0,0 +1,266 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 227 2", +" c None", +". c #8D8D8D", +"+ c #9C9C9C", +"@ c #ADADAD", +"# c #828282", +"$ c #808080", +"% c #989898", +"& c #5F5F5F", +"* c #CDCDCD", +"= c #FCFCFC", +"- c #4D4D4D", +"; c #CFCFCF", +"> c #FFFFFF", +", c #F1F1F1", +"' c #777777", +") c #353535", +"! c #666666", +"~ c #B3B3B3", +"{ c #D4D4D4", +"] c #343434", +"^ c #949494", +"/ c #C4C4C4", +"( c #1F1F1F", +"_ c #323232", +": c #EEEEEE", +"< c #FBFBFB", +"[ c #EFEFEF", +"} c #747474", +"| c #959595", +"1 c #575757", +"2 c #4B4B4B", +"3 c #DEDEDE", +"4 c #CBCBCB", +"5 c #F3F3F3", +"6 c #787878", +"7 c #A2A2A2", +"8 c #000000", +"9 c #F5F5F5", +"0 c #2B2B2B", +"a c #474747", +"b c #7A7A7A", +"c c #C2C2C2", +"d c #B8B8B8", +"e c #BBBBBB", +"f c #636363", +"g c #2A2A2A", +"h c #191919", +"i c #CCCCCC", +"j c #7F7F7F", +"k c #393939", +"l c #F2F2F2", +"m c #929292", +"n c #0E0E0E", +"o c #BFBFBF", +"p c #111111", +"q c #0F0F0F", +"r c #868686", +"s c #FDFDFD", +"t c #D5D5D5", +"u c #979797", +"v c #DDDDDD", +"w c #5E5E5E", +"x c #414141", +"y c #F0F0F0", +"z c #939393", +"A c #555555", +"B c #4A4A4A", +"C c #010101", +"D c #282828", +"E c #D7D7D7", +"F c #6D6D6D", +"G c #606060", +"H c #F6F6F6", +"I c #DADADA", +"J c #545454", +"K c #5A5A5A", +"L c #1E1E1E", +"M c #0B0B0B", +"N c #040404", +"O c #D3D3D3", +"P c #C0C0C0", +"Q c #454545", +"R c #2F2F2F", +"S c #707070", +"T c #656565", +"U c #646464", +"V c #F7F7F7", +"W c #8B8B8B", +"X c #181818", +"Y c #0D0D0D", +"Z c #030303", +"` c #141414", +" . c #6E6E6E", +".. c #D9D9D9", +"+. c #909090", +"@. c #B6B6B6", +"#. c #1D1D1D", +"$. c #181800", +"%. c #B6B600", +"&. c #BFBF00", +"*. c #333300", +"=. c #101010", +"-. c #080808", +";. c #D0D0D0", +">. c #FEFEFE", +",. c #E9E9E9", +"'. c #E0E0E0", +"). c #B1B1B1", +"!. c #090909", +"~. c #646400", +"{. c #C7C700", +"]. c #B9B900", +"^. c #606000", +"/. c #9E9E00", +"(. c #D6D600", +"_. c #818100", +":. c #686868", +"<. c #A9A9A9", +"[. c #EAEAEA", +"}. c #DFDFDF", +"|. c #0C0C0C", +"1. c #050505", +"2. c #404000", +"3. c #282800", +"4. c #303000", +"5. c #8C8C8C", +"6. c #B0B0B0", +"7. c #3C3C00", +"8. c #898900", +"9. c #E6E600", +"0. c #404040", +"a. c #020202", +"b. c #BCBC00", +"c. c #4B4B00", +"d. c #EFEF00", +"e. c #C3C3C3", +"f. c #9D9D9D", +"g. c #202020", +"h. c #383838", +"i. c #4C4C4C", +"j. c #1E1E00", +"k. c #B8B800", +"l. c #494900", +"m. c #121212", +"n. c #C8C8C8", +"o. c #F8F8F8", +"p. c #373737", +"q. c #1C1C00", +"r. c #C4C400", +"s. c #3F3F00", +"t. c #070707", +"u. c #383800", +"v. c #F6F600", +"w. c #FFFF00", +"x. c #5F5F00", +"y. c #6F6F00", +"z. c #B7B7B7", +"A. c #7D7D7D", +"B. c #DFDF00", +"C. c #7A7A00", +"D. c #202000", +"E. c #BEBE00", +"F. c #E8E800", +"G. c #545400", +"H. c #060606", +"I. c #616161", +"J. c #727272", +"K. c #D8D8D8", +"L. c #A8A800", +"M. c #262626", +"N. c #DCDCDC", +"O. c #1C1C1C", +"P. c #E7E7E7", +"Q. c #464646", +"R. c #151515", +"S. c #A7A7A7", +"T. c #6C6C6C", +"U. c #0A0A0A", +"V. c #AEAEAE", +"W. c #242424", +"X. c #161616", +"Y. c #8E8E8E", +"Z. c #6F6F6F", +"`. c #676767", +" + c #818181", +".+ c #EBEBEB", +"++ c #D6D6D6", +"@+ c #535353", +"#+ c #DBDBDB", +"$+ c #222222", +"%+ c #969696", +"&+ c #FAFAFA", +"*+ c #ACACAC", +"=+ c #A1A1A1", +"-+ c #E4E4E4", +";+ c #A5A5A5", +">+ c #3A3A3A", +",+ c #525252", +"'+ c #838383", +")+ c #3E3E3E", +"!+ c #ECECEC", +"~+ c #B4B4B4", +"{+ c #313131", +"]+ c #E3E3E3", +"^+ c #BCBCBC", +"/+ c #888888", +"(+ c #EDEDED", +"_+ c #333333", +":+ c #B2B2B2", +"<+ c #F4F4F4", +"[+ c #1B1B1B", +"}+ c #303030", +"|+ c #AAAAAA", +"1+ c #AFAFAF", +"2+ c #F9F9F9", +"3+ c #A3A3A3", +"4+ c #E8E8E8", +"5+ c #2D2D2D", +"6+ c #595959", +"7+ c #7E7E7E", +"8+ c #E6E6E6", +"9+ c #C9C9C9", +"0+ c #3F3F3F", +"a+ c #CECECE", +"b+ c #848484", +"c+ c #585858", +"d+ c #898989", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ) > > > ; ! ", +" ~ > > { ] ^ > / ( _ : > < [ } ", +" | 1 2 3 4 5 $ 6 < 7 8 8 9 < } 0 a b c ", +" d < e f g h i j k l m 8 n > o p 8 q r s t ", +" u s > v 1 8 8 w / x y z 8 A > B C 8 D c > E F ", +" G H > > I J 8 8 q d K L 8 8 8 8 M N L O P Q R S T ", +" U t > > > > V W ( q X Y 8 8 8 8 8 8 Z ` .a | ..V +. ", +" d > > > > > > = @.#.8 $.%.&.&.&.&.*.=.-.p ;.>.> > + ", +" t > > ,.O i 4 '.).!.~.{.].^.^.^./.(._.8 8 :.U <.< $ ", +" G [.> }.|.8 8 8 8 1.$.{.2.8 8 8 8 8 3.{.4.8 8 q x 5. ", +" S @ 6.:.8 8 8 8 8 8 %.].4.7.8 8 8 8 8 8.9.8 8 8 q ", +" & w 0.8 a.8 8 Z 8 &.^.$.b.c.8 8 8 8 4.d.8 8 8 =. ", +" e.> > f.g.g.h.i.X 8 &.^.8 j.k.l.8 8 8 4.d.8 8 8 m. ", +" n.> > , o.> > > p.a.&.^.8 8 q.r.s.8 8 4.d.8 8 8 t. ", +" @ > > > > >.> > h.Z &./.u.v.w.w.w.w.x.y.d.8 8 C L z.A. ", +" m > > >.> < e x p C *.B.{.C.D.D.D.x.E.F.G.8 H.m.).>.y I. ", +" J.> > > K.J.=.8 8 Z C _.{.8.4.4.4.y.r.L.8 8 a.M.N.> > i } ", +" F 9 > < O.8 8 8 8 M.X H.4.9.d.d.d.d.G.8 8 8 8 C T H > > P.S ", +" }.> > Q.8 C 8 R.n.> S.8 8 8 8 8 8 8 8 8 C C 8 8 p.= > > , . ", +" S.> , T.U.8 8 V.>.> 6.W.X.R.n N a.N -.=.#.U.8 8 8 K H > > 5 Y. ", +" Z.n.`. +r t.w > > .+K F ++K.@+C 8 C S E #+$+8 8 8 H.%+&+> > o.*+ ", +" 2 =+H y d -+s > ;+>+S.> H Q 8 8 C ,+> > '+8 8 C 8 p * > > = 5. ", +" a , > > > > > > `.)+> > !+h.8 8 a.B > > ~+M 8 8 8 {+]+> > 6. ", +" , > > > > ^+>+/+> > (+k 8 8 N _+> > 9 0 8 8 _ :+> 9 6 ", +" & #+= > <+& J ]+> > t [+8 8 a.}+> > > |+,+1 ", +" I.1+2+3+1 G > > > 4+' }+q 5+6+> > > >.&+7+ ", +" *+> > > > > 4+h.8+> > > > = }.Q ", +" e P '.< > > 9+0+a+> > > { b+a ", +" 0+c+ :.^ d+Z. ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/MidiPlugin/Makefile.in b/SpiralSound/Plugins/MidiPlugin/Makefile.in new file mode 100644 index 0000000..6c7e590 --- /dev/null +++ b/SpiralSound/Plugins/MidiPlugin/Makefile.in @@ -0,0 +1,177 @@ +############################################################################# +# Makefile for building MidiPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: MidiPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl -pthread +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../Midi.h \ + MidiPlugin.h \ + MidiPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../Midi.C \ + MidiPlugin.C \ + MidiPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + ../../Midi.o \ + MidiPlugin.o \ + MidiPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = MidiPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake MidiPlugin.pro + +dist: + $(TAR) MidiPlugin.tar MidiPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) MidiPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +../../Midi.o: ../../Midi.C \ + ../../Midi.h \ + ../../NoteTable.h + +MidiPlugin.o: MidiPlugin.C \ + MidiPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + MidiPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../../NoteTable.h \ + ../../Midi.h \ + SpiralIcon.xpm + +MidiPluginGUI.o: MidiPluginGUI.C \ + MidiPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + MidiPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/MidiPlugin/MidiPlugin.C b/SpiralSound/Plugins/MidiPlugin/MidiPlugin.C new file mode 100644 index 0000000..26470d0 --- /dev/null +++ b/SpiralSound/Plugins/MidiPlugin/MidiPlugin.C @@ -0,0 +1,296 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "MidiPlugin.h" +#include "MidiPluginGUI.h" +#include +#include "../../NoteTable.h" +#include "../../Midi.h" +#include "SpiralIcon.xpm" + +int MidiPlugin::m_RefCount = 0; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new MidiPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0002; +} +} + +/////////////////////////////////////////////////////// + +MidiPlugin::MidiPlugin() : +m_DeviceNum(0), +m_NoteLevel(0), +m_TriggerLevel(0), +m_PitchBendLevel(0), +m_ChannelPressureLevel(0), +m_AfterTouchLevel(0), +m_NoteCut(false), +m_ContinuousNotes(false), +m_CurrentNote(0) +{ + m_Version=2; + + m_RefCount++; + + m_PluginInfo.Name="Midi"; + m_PluginInfo.Width=85; + m_PluginInfo.Height=155; + m_PluginInfo.NumInputs=2; + m_PluginInfo.NumOutputs=5; + m_PluginInfo.PortTips.push_back("Note CV"); + m_PluginInfo.PortTips.push_back("Trigger CV"); + m_PluginInfo.PortTips.push_back("Note CV"); + m_PluginInfo.PortTips.push_back("Trigger CV"); + m_PluginInfo.PortTips.push_back("PitchBend CV"); + m_PluginInfo.PortTips.push_back("ChannelPressure CV"); + m_PluginInfo.PortTips.push_back("Aftertouch CV"); + + for (int n=0; n<128; n++) m_ControlLevel[n]=0; +} + +MidiPlugin::~MidiPlugin() +{ + m_RefCount--; + if (m_RefCount==0) MidiDevice::PackUpAndGoHome(); +} + +PluginInfo &MidiPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info= SpiralPlugin::Initialise(Host); + MidiDevice::SetDeviceName(Host->MIDIFILE); + + return Info; +} + +SpiralGUIType *MidiPlugin::CreateGUI() +{ + m_GUI = new MidiPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); +// m_GUI->show(); + m_GUI->hide(); + return m_GUI; +} + +void MidiPlugin::Execute() +{ + // Done to clear IsEmpty field... + GetOutputBuf(0)->Zero(); + GetOutputBuf(1)->Zero(); + GetOutputBuf(2)->Zero(); + GetOutputBuf(3)->Zero(); + GetOutputBuf(4)->Zero(); + + for (unsigned int c=0; cZero(); + } + + bool Triggered=false; + + // midi output + if (InputExists(0) && InputExists(1)) + { + static bool TriggeredOut=false; + if (GetInput(1,0)>0) + { + if (!TriggeredOut) // note on + { + // get the midi note + float Freq=GetInputPitch(0,0); + int Note=0; + for (int n=0; n<132; n++) + { + if (feq(Freq,NoteTable[n],0.01f)) + { + Note=n; + break; + } + } + + MidiEvent NewEvent(MidiEvent::ON,Note,GetInput(1,0)*128.0f); + MidiDevice::Get()->SendEvent(m_DeviceNum,NewEvent); + TriggeredOut=true; + } + } + else + { + if (TriggeredOut) // note off + { + // get the midi note + float Freq=GetInputPitch(0,0); + int Note=0; + for (int n=0; n<132; n++) + { + if (feq(Freq,NoteTable[n],0.01f)) + { + Note=n; + break; + } + } + + MidiEvent NewEvent(MidiEvent::OFF,Note,0.0f); + MidiDevice::Get()->SendEvent(m_DeviceNum,NewEvent); + TriggeredOut=false; + } + } + } + + MidiEvent Event=MidiDevice::Get()->GetEvent(m_DeviceNum); + // get all the midi events since the last check + while(Event.GetType()!=MidiEvent::NONE) + { + if (Event.GetType()==MidiEvent::ON) + { + Triggered=true; + m_CurrentNote=Event.GetNote(); + m_NoteLevel=NoteTable[m_CurrentNote]; + m_TriggerLevel=Event.GetVolume()/127.0f; + } + + if (Event.GetType()==MidiEvent::OFF) + { + if (Event.GetNote()==m_CurrentNote) + { + m_TriggerLevel=0; + if (m_NoteCut) m_NoteLevel=0; + } + } + + if (Event.GetType()==MidiEvent::PITCHBEND) + { + m_PitchBendLevel=Event.GetVolume()/127.0f*2.0f-1.0f; + } + + if (Event.GetType()==MidiEvent::CHANNELPRESSURE) + { + m_ChannelPressureLevel=Event.GetVolume()/127.0f; + } + + if (Event.GetType()==MidiEvent::AFTERTOUCH) + { + m_AfterTouchLevel=Event.GetVolume()/127.0f; + } + + if (Event.GetType()==MidiEvent::PARAMETER) + { + // just to make sure + if (Event.GetNote()>=0 && Event.GetNote()<128) + { + m_ControlLevel[Event.GetNote()]=Event.GetVolume()/127.0f; + } + } + + Event=MidiDevice::Get()->GetEvent(m_DeviceNum); + } + for (int n=0; nBUFSIZE; n++) + { + SetOutputPitch(0,n,m_NoteLevel); + SetOutput(1,n,m_TriggerLevel); + SetOutput(2,n,m_PitchBendLevel); + SetOutput(3,n,m_ChannelPressureLevel); + SetOutput(4,n,m_AfterTouchLevel); + } + + for (unsigned int c=0; cSet(m_ControlLevel[m_ControlList[c]]); + } + + // make sure the trigger is registered if it's + // note is pressed before releasing the previous one. + if (Triggered && !m_ContinuousNotes) SetOutput(1,0,0); +} + +void MidiPlugin::AddControl(int s, const string &Name) +{ + m_ControlList.push_back(s); + AddOutput(); + m_PluginInfo.NumOutputs++; + m_PluginInfo.PortTips.push_back(Name); + UpdatePluginInfoWithHost(); +} + +void MidiPlugin::DeleteControl() +{ + if (m_ControlList.size()==0) return; + + m_ControlList.pop_back(); + RemoveOutput(); + m_PluginInfo.NumOutputs--; + m_PluginInfo.PortTips.pop_back(); + UpdatePluginInfoWithHost(); +} + +void MidiPlugin::StreamOut(ostream &s) +{ + s<>version; + + switch (version) + { + case 1: s>>m_DeviceNum>>m_NoteCut; break; + + case 2: + { + s>>m_DeviceNum>>m_NoteCut; + + int Num; + s>>Num; + + for (int n=0; n>Control; + + char Buf[4096]; + int size; + s>>size; + s.ignore(1); + s.get(Buf,size+1); + + AddControl(Control, Buf); + } + } + } +} + diff --git a/SpiralSound/Plugins/MidiPlugin/MidiPlugin.h b/SpiralSound/Plugins/MidiPlugin/MidiPlugin.h new file mode 100644 index 0000000..2cab207 --- /dev/null +++ b/SpiralSound/Plugins/MidiPlugin/MidiPlugin.h @@ -0,0 +1,67 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef OscillatorPLUGIN +#define OscillatorPLUGIN + +class MidiPlugin : public SpiralPlugin +{ +public: + MidiPlugin(); + virtual ~MidiPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetDeviceNum(int s) { m_DeviceNum=s; } + int GetDeviceNum() { return m_DeviceNum; } + void SetNoteCut(bool s) { m_NoteCut=s; } + bool GetNoteCut() { return m_NoteCut; } + void SetContinuousNotes(bool s) { m_ContinuousNotes=s; } + bool GetContinuousNotes() { return m_ContinuousNotes; } + void AddControl(int s,const string &Name); + void DeleteControl(); + +private: + + int m_DeviceNum; + + float m_NoteLevel; + float m_TriggerLevel; + float m_PitchBendLevel; + float m_ChannelPressureLevel; + float m_AfterTouchLevel; + float m_ControlLevel[128]; + bool m_NoteCut; + bool m_ContinuousNotes; + int m_CurrentNote; + static int m_RefCount; + + vector m_ControlList; +}; + +#endif diff --git a/SpiralSound/Plugins/MidiPlugin/MidiPlugin.pro b/SpiralSound/Plugins/MidiPlugin/MidiPlugin.pro new file mode 100644 index 0000000..df33d3f --- /dev/null +++ b/SpiralSound/Plugins/MidiPlugin/MidiPlugin.pro @@ -0,0 +1,19 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../Midi.h \ + MidiPlugin.h \ + MidiPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../Midi.C \ + MidiPlugin.C \ + MidiPluginGUI.C + +TARGET = MidiPlugin.so diff --git a/SpiralSound/Plugins/MidiPlugin/MidiPluginGUI.C b/SpiralSound/Plugins/MidiPlugin/MidiPluginGUI.C new file mode 100644 index 0000000..6db805a --- /dev/null +++ b/SpiralSound/Plugins/MidiPlugin/MidiPluginGUI.C @@ -0,0 +1,269 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "MidiPluginGUI.h" +#include +#include +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////////////////////////////////// + +int OptionsList(const vector &List) +{ + Fl_Double_Window *Win = new Fl_Double_Window(300,300); + Fl_Button *Ok = new Fl_Button(10,275,40,20,"Ok"); + Ok->labelsize(10); + Fl_Button *Cancel = new Fl_Button(50,275,40,20,"Cancel"); + Cancel->labelsize(10); + Fl_Hold_Browser* Browser = new Fl_Hold_Browser(5,5,290,265,""); + + for (vector::const_iterator i = List.begin(); + i!=List.end(); i++) + { + Browser->add(i->c_str()); + } + + Win->show(); + + int Choice=-1; + + for (;;) + { + Fl::wait(); + Fl_Widget* o = Fl::readqueue(); + if (o==Ok || o==Browser) + { + Choice=Browser->value(); + Win->hide(); + delete Win; + break; + } + if (o==Cancel) + { + Choice=-1; + Win->hide(); + delete Win; + break; + } + + if (o==Win) break; + } + + return Choice; +} + +//////////////////////////////////////////////////////////////////////// + +MidiPluginGUI::MidiPluginGUI(int w, int h,MidiPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_DeviceNum = new Fl_Counter(20,30,40,20,"Channel"); + m_DeviceNum->type(FL_SIMPLE_COUNTER); + m_DeviceNum->step(1); + m_DeviceNum->callback((Fl_Callback*)cb_DeviceNum, NULL); + + m_NoteCut = new Fl_Button(5,70,75,20,"Note Cut"); + m_NoteCut->type(1); + m_NoteCut->labelsize(10); + m_NoteCut->callback((Fl_Callback*)cb_NoteCut, NULL); + + m_ContinuousNotes = new Fl_Button(5,90,75,20,"Cont Notes"); + m_ContinuousNotes->type(1); + m_ContinuousNotes->labelsize(10); + m_ContinuousNotes->callback((Fl_Callback*)cb_ContinuousNotes, NULL); + + m_AddControl = new Fl_Button(5,110,75,20,"Add Control"); + m_AddControl->labelsize(10); + m_AddControl->callback((Fl_Callback*)cb_AddControl, NULL); + + m_RemoveControl = new Fl_Button(5,130,75,20,"Remove Control"); + m_RemoveControl->labelsize(10); + m_RemoveControl->callback((Fl_Callback*)cb_RemoveControl, NULL); +} + +void MidiPluginGUI::UpdateValues() +{ + m_DeviceNum->value(m_Plugin->GetDeviceNum()); +} + +//// Callbacks //// +inline void MidiPluginGUI::cb_DeviceNum_i(Fl_Counter* o, void* v) +{ m_Plugin->SetDeviceNum((int)o->value()); } +void MidiPluginGUI::cb_DeviceNum(Fl_Counter* o, void* v) +{ ((MidiPluginGUI*)(o->parent()))->cb_DeviceNum_i(o,v);} + +inline void MidiPluginGUI::cb_NoteCut_i(Fl_Button* o, void* v) +{ m_Plugin->SetNoteCut(o->value()); } +void MidiPluginGUI::cb_NoteCut(Fl_Button* o, void* v) +{ ((MidiPluginGUI*)(o->parent()))->cb_NoteCut_i(o,v);} + +inline void MidiPluginGUI::cb_ContinuousNotes_i(Fl_Button* o, void* v) +{ m_Plugin->SetContinuousNotes(o->value()); } +void MidiPluginGUI::cb_ContinuousNotes(Fl_Button* o, void* v) +{ ((MidiPluginGUI*)(o->parent()))->cb_ContinuousNotes_i(o,v);} + +inline void MidiPluginGUI::cb_AddControl_i(Fl_Button* o, void* v) +{ + vector List; + + List.push_back("0 Bank Select"); + List.push_back("1 Modulation Wheel (coarse)"); + List.push_back("2 Breath controller (coarse)"); + List.push_back("3 None"); + List.push_back("4 Foot Pedal (coarse)"); + List.push_back("5 Portamento Time (coarse)"); + List.push_back("6 Data Entry (coarse)"); + List.push_back("7 Volume (coarse)"); + List.push_back("8 Balance (coarse)"); + List.push_back("9 None"); + List.push_back("10 Pan position (coarse)"); + List.push_back("11 Expression (coarse)"); + List.push_back("12 Effect Control 1 (coarse)"); + List.push_back("13 Effect Control 2 (coarse)"); + List.push_back("14 None"); + List.push_back("15 None"); + List.push_back("16 General Purpose Slider 1"); + List.push_back("17 General Purpose Slider 2"); + List.push_back("18 General Purpose Slider 3"); + List.push_back("19 General Purpose Slider 4"); + List.push_back("20 None"); + List.push_back("21 None"); + List.push_back("22 None"); + List.push_back("23 None"); + List.push_back("24 None"); + List.push_back("25 None"); + List.push_back("26 None"); + List.push_back("27 None"); + List.push_back("28 None"); + List.push_back("29 None"); + List.push_back("30 None"); + List.push_back("31 None"); + List.push_back("32 Bank Select (fine)"); + List.push_back("33 Modulation Wheel (fine)"); + List.push_back("34 Breath controller (fine)"); + List.push_back("35 None"); + List.push_back("36 Foot Pedal (fine)"); + List.push_back("37 Portamento Time (fine)"); + List.push_back("38 Data Entry (fine)"); + List.push_back("39 Volume (fine)"); + List.push_back("40 Balance (fine)"); + List.push_back("41 None"); + List.push_back("42 Pan position (fine)"); + List.push_back("43 Expression (fine)"); + List.push_back("44 Effect Control 1 (fine)"); + List.push_back("45 Effect Control 2 (fine)"); + List.push_back("46 None"); + List.push_back("47 None"); + List.push_back("48 None"); + List.push_back("49 None"); + List.push_back("50 None"); + List.push_back("51 None"); + List.push_back("52 None"); + List.push_back("53 None"); + List.push_back("54 None"); + List.push_back("55 None"); + List.push_back("56 None"); + List.push_back("57 None"); + List.push_back("58 None"); + List.push_back("59 None"); + List.push_back("60 None"); + List.push_back("61 None"); + List.push_back("62 None"); + List.push_back("63 None"); + List.push_back("64 Hold Pedal (on/off)"); + List.push_back("65 Portamento (on/off)"); + List.push_back("66 Sustenuto Pedal (on/off)"); + List.push_back("67 Soft Pedal (on/off)"); + List.push_back("68 Legato Pedal (on/off)"); + List.push_back("69 Hold 2 Pedal (on/off)"); + List.push_back("70 Sound Variation"); + List.push_back("71 Sound Timbre"); + List.push_back("72 Sound Release Time"); + List.push_back("73 Sound Attack Time"); + List.push_back("74 Sound Brightness"); + List.push_back("75 Sound Control 6"); + List.push_back("76 Sound Control 7"); + List.push_back("77 Sound Control 8"); + List.push_back("78 Sound Control 9"); + List.push_back("79 Sound Control 10"); + List.push_back("80 General Purpose Button 1 (on/off)"); + List.push_back("81 General Purpose Button 2 (on/off)"); + List.push_back("82 General Purpose Button 3 (on/off)"); + List.push_back("83 General Purpose Button 4 (on/off)"); + List.push_back("84 None"); + List.push_back("85 None"); + List.push_back("86 None"); + List.push_back("87 None"); + List.push_back("88 None"); + List.push_back("89 None"); + List.push_back("90 None"); + List.push_back("91 Effects Level"); + List.push_back("92 Tremulo Level"); + List.push_back("93 Chorus Level"); + List.push_back("94 Celeste Level"); + List.push_back("95 Phaser Level"); + List.push_back("96 Data Button increment"); + List.push_back("97 Data Button decrement"); + List.push_back("98 Non-registered Parameter (fine)"); + List.push_back("99 Non-registered Parameter (coarse)"); + List.push_back("100 Registered Parameter (fine)"); + List.push_back("101 Registered Parameter (coarse)"); + List.push_back("102 None"); + List.push_back("103 None"); + List.push_back("104 None"); + List.push_back("105 None"); + List.push_back("106 None"); + List.push_back("107 None"); + List.push_back("108 None"); + List.push_back("109 None"); + List.push_back("110 None"); + List.push_back("111 None"); + List.push_back("112 None"); + List.push_back("113 None"); + List.push_back("114 None"); + List.push_back("115 None"); + List.push_back("116 None"); + List.push_back("117 None"); + List.push_back("118 None"); + List.push_back("119 None"); + List.push_back("120 All Sound Off"); + List.push_back("121 All Controllers Off"); + List.push_back("122 Local Keyboard (on/off)"); + List.push_back("123 All Notes Off"); + List.push_back("124 Omni Mode Off"); + List.push_back("125 Omni Mode On"); + List.push_back("126 Mono Operation"); + List.push_back("127 Poly Operation"); + + int c=OptionsList(List)-1; + if (c>-1) m_Plugin->AddControl(c,List[c]); +} +void MidiPluginGUI::cb_AddControl(Fl_Button* o, void* v) +{ ((MidiPluginGUI*)(o->parent()))->cb_AddControl_i(o,v);} + +inline void MidiPluginGUI::cb_RemoveControl_i(Fl_Button* o, void* v) +{ m_Plugin->DeleteControl(); } +void MidiPluginGUI::cb_RemoveControl(Fl_Button* o, void* v) +{ ((MidiPluginGUI*)(o->parent()))->cb_RemoveControl_i(o,v);} diff --git a/SpiralSound/Plugins/MidiPlugin/MidiPluginGUI.h b/SpiralSound/Plugins/MidiPlugin/MidiPluginGUI.h new file mode 100644 index 0000000..c2063fc --- /dev/null +++ b/SpiralSound/Plugins/MidiPlugin/MidiPluginGUI.h @@ -0,0 +1,67 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "MidiPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef MIDIGUI +#define MIDIGUI + +int OptionsList(const vector &List); + +class MidiPluginGUI : public SpiralPluginGUI +{ +public: + MidiPluginGUI(int w, int h, MidiPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + MidiPlugin *m_Plugin; + +private: + + Fl_Counter* m_DeviceNum; + Fl_Button* m_NoteCut; + Fl_Button* m_ContinuousNotes; + Fl_Button* m_AddControl; + Fl_Button* m_RemoveControl; + + //// Callbacks //// + inline void cb_DeviceNum_i(Fl_Counter* o, void* v); + static void cb_DeviceNum(Fl_Counter* o, void* v); + inline void cb_NoteCut_i(Fl_Button* o, void* v); + static void cb_NoteCut(Fl_Button* o, void* v); + inline void cb_ContinuousNotes_i(Fl_Button* o, void* v); + static void cb_ContinuousNotes(Fl_Button* o, void* v); + inline void cb_AddControl_i(Fl_Button* o, void* v); + static void cb_AddControl(Fl_Button* o, void* v); + inline void cb_RemoveControl_i(Fl_Button* o, void* v); + static void cb_RemoveControl(Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/MidiPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/MidiPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..8fa60ca --- /dev/null +++ b/SpiralSound/Plugins/MidiPlugin/SpiralIcon.xpm @@ -0,0 +1,354 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 315 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #252525", +"). c #040400", +"!. c #141500", +"~. c #727175", +"{. c #FEFEFF", +"]. c #9D99AA", +"^. c #DBD9E0", +"/. c #E9E9E9", +"(. c #CBCBCB", +"_. c #E0E0E0", +":. c #6C6C6C", +"<. c #DAE300", +"[. c #B9C000", +"}. c #D0D800", +"|. c #B3BA00", +"1. c #E2EB00", +"2. c #E1EA00", +"3. c #D8E000", +"4. c #949900", +"5. c #515151", +"6. c #A6A6A7", +"7. c #827E93", +"8. c #615C77", +"9. c #EAEAED", +"0. c #DFDFE1", +"a. c #F6FF00", +"b. c #F1FA00", +"c. c #050600", +"d. c #F0F900", +"e. c #050500", +"f. c #F4FD00", +"g. c #BFC700", +"h. c #1E1D24", +"i. c #9894A7", +"j. c #B1AEBB", +"k. c #69686F", +"l. c #000001", +"m. c #CDD500", +"n. c #E4ED00", +"o. c #020200", +"p. c #615C76", +"q. c #5F5A75", +"r. c #413E4D", +"s. c #020203", +"t. c #E9F200", +"u. c #F5FE00", +"v. c #323400", +"w. c #1A1A1C", +"x. c #C3C1CB", +"y. c #9D9D9D", +"z. c #202020", +"A. c #383838", +"B. c #4C4C4C", +"C. c #E5EE00", +"D. c #111112", +"E. c #C9C7D0", +"F. c #F1F1F1", +"G. c #F8F8F8", +"H. c #4A4C1C", +"I. c #E8F100", +"J. c #838800", +"K. c #D5DD00", +"L. c #F3FC00", +"M. c #050408", +"N. c #AEACB9", +"O. c #FEFEFE", +"P. c #D8DF03", +"Q. c #515400", +"R. c #101100", +"S. c #7B8000", +"T. c #646800", +"U. c #B7B5C1", +"V. c #9390A2", +"W. c #BBBBBB", +"X. c #414141", +"Y. c #E1E900", +"Z. c #E0E900", +"`. c #1C1E00", +" + c #EBF400", +".+ c #28272A", +"++ c #F4F4F6", +"@+ c #605B76", +"#+ c #736E86", +"$+ c #D8D8D8", +"%+ c #727272", +"&+ c #101010", +"*+ c #797E00", +"=+ c #CBD300", +"-+ c #E2EA00", +";+ c #848486", +">+ c #CCCBD3", +",+ c #747087", +"'+ c #6D6881", +")+ c #1C1C1C", +"!+ c #242424", +"~+ c #414400", +"{+ c #0A0A00", +"]+ c #010100", +"^+ c #656566", +"/+ c #F6F6F6", +"(+ c #E8E6EA", +"_+ c #706B84", +":+ c #E3E1E6", +"<+ c #474746", +"[+ c #151515", +"}+ c #C8C8C8", +"|+ c #AEAEAE", +"1+ c #080808", +"2+ c #373639", +"3+ c #FDFCFE", +"4+ c #ABA8B7", +"5+ c #F1F0F3", +"6+ c #6D6980", +"7+ c #0A090E", +"8+ c #95929E", +"9+ c #0A0810", +"0+ c #0D0D0D", +"a+ c #050505", +"b+ c #5B5A5C", +"c+ c #F7F6F7", +"d+ c #F4F3F5", +"e+ c #908C9F", +"f+ c #C8C6D0", +"g+ c #837E96", +"h+ c #86868A", +"i+ c #070608", +"j+ c #ECEBEE", +"k+ c #5B5571", +"l+ c #646078", +"m+ c #AFAFB0", +"n+ c #454545", +"o+ c #363636", +"p+ c #7A7A7A", +"q+ c #C8C8C9", +"r+ c #212025", +"s+ c #060607", +"t+ c #969699", +"u+ c #FAFAFA", +"v+ c #F8F8F9", +"w+ c #A29EAF", +"x+ c #F7F6F8", +"y+ c #F0F0F1", +"z+ c #B8B7B9", +"A+ c #E4E4E4", +"B+ c #FDFDFD", +"C+ c #A5A2B2", +"D+ c #3B3456", +"E+ c #A8A5B4", +"F+ c #525252", +"G+ c #848387", +"H+ c #CDCDCD", +"I+ c #8D899C", +"J+ c #494262", +"K+ c #68627C", +"L+ c #40395A", +"M+ c #ECECEC", +"N+ c #020202", +"O+ c #B4B5B5", +"P+ c #0B0B0B", +"Q+ c #313232", +"R+ c #E3E3E3", +"S+ c #B1AEBC", +"T+ c #BDBBC6", +"U+ c #3C3556", +"V+ c #898599", +"W+ c #EDEDED", +"X+ c #39393A", +"Y+ c #040404", +"Z+ c #333333", +"`+ c #F5F5F5", +" @ c #2B2B2B", +".@ c #2D2A3D", +"+@ c #B6B4C1", +"@@ c #F5F5F6", +"#@ c #605A76", +"$@ c #DAD8DF", +"%@ c #F5F4F6", +"&@ c #615B76", +"*@ c #524D6A", +"=@ c #E4E3E8", +"-@ c #D5D5D5", +";@ c #1B1B1B", +">@ c #303030", +",@ c #AAABAB", +"'@ c #585464", +")@ c #B0AEBB", +"!@ c #A29FAF", +"~@ c #E9E8E9", +"{@ c #787779", +"]@ c #0F0E15", +"^@ c #2D2D2E", +"/@ c #595959", +"(@ c #FAFAFB", +"_@ c #807B92", +":@ c #B0ADBB", +"<@ c #E8E7EB", +"[@ c #3A3258", +"}@ c #E6E5EA", +"|@ c #DFDEE3", +"1@ c #443E5E", +"2@ c #BAB8C4", +"3@ c #C1BFCA", +"4@ c #E0E0E5", +"5@ c #D0CED6", +"6@ c #362F52", +"7@ c #CECCD5", +"8@ c #413A5B", +"9@ c #6A657F", +"0@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.6 6 ).6 6 !.).6 6 6 E ~.{.; ; ]. ", +" ^.; ; /.R h (._.:.<.[.6 }.|.6 1.6 2.3.Q 6 4.5.6.4 7. ", +" 8.9.; 0...6 6 6 6 6 a.b.c.a.d.e.a.6 a.f.g.6 a.6 h.i. ", +" V @ j.k.l.6 6 6 6 6 f.a.m.a.n.o.a.6 a.m.f.6 a.6 ", +" p.q.r.6 s.6 6 6 6 f.a.t.u.2.6 a.6 a.v.a.6 a.6 w. ", +" x.; ; y.z.z.A.B.z.6 a.b.u.u.C.6 a.6 a.6 a.6 a.6 D. ", +" E.; ; F.G.; ; ; H.I.a.J.b.K.L.6 a.6 a.6 a.6 a.6 M. ", +" N.; ; ; ; O.; ; P.d.Q.R.6 S.f.6 a.6 a.T.u.6 a.6 6 U., ", +" V.; ; O.; : W.X.Y.Z.6 6 6 `.a.6 6 6 a.f. +6 a.6 .+O.++@+ ", +" #+; ; ; $+%+&+6 *+*+6 6 6 6 u.=+6 o.b.-+c.6 1.6 ;+; ; >+,+ ", +" '+J ; : )+6 6 6 6 !+..6 6 6 ~+~+6 {+6 6 ]+6 6 6 ^+/+; ; (+_+ ", +" :+; ; <+6 E 6 [+}+|+1+6 6 6 6 6 6 6 6 ]+6 6 6 6 2+3+; ; > _+ ", +" 4+; 5+6+7+6 6 |+O.; 8+9+6 6 6 6 6 6 6 6 0+a+6 6 6 b+c+; ; d+e+ ", +" _+f+! g+h+i+x ; ; j+k+l+m+l n+6 6 6 o+p+q+r+6 6 6 s+t+u+; ; v+@ ", +" w+x+y+z+A+B+; C+D+E+; /+n+6 6 E F+; ; G+6 6 E 6 o H+; ; = I+ ", +" J+> ; ; ; ; ; ; K+L+; ; M+A.6 6 N+D ; ; O+P+6 6 6 Q+R+; ; S+ ", +" > ; ; ; ; T+U+V+; ; W+X+6 6 Y+Z+; ; `+ @6 6 .@+@; @@3 ", +" #@$@= ; %@&@*@=@; ; -@;@6 6 N+>@; ; ; ,@F+'@ ", +" )@4 !@ X ; ; ; ~@{@>@]@^@/@; ; ; O.(@_@ ", +" :@; ; ; ; ; <@[@}@; ; ; ; = |@1@ ", +" 2@3@4@4 ; ; 5@6@7@; ; ; s V+T ", +" 8@ 9@0@V+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/MixerPlugin/Makefile.in b/SpiralSound/Plugins/MixerPlugin/Makefile.in new file mode 100644 index 0000000..0fd661b --- /dev/null +++ b/SpiralSound/Plugins/MixerPlugin/Makefile.in @@ -0,0 +1,164 @@ +############################################################################# +# Makefile for building MixerPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: MixerPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + MixerPlugin.h \ + MixerPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + MixerPlugin.C \ + MixerPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + MixerPlugin.o \ + MixerPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = MixerPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake MixerPlugin.pro + +dist: + $(TAR) MixerPlugin.tar MixerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) MixerPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +MixerPlugin.o: MixerPlugin.C \ + MixerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + MixerPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +MixerPluginGUI.o: MixerPluginGUI.C \ + MixerPluginGUI.h \ + MixerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/MixerPlugin/MixerPlugin.C b/SpiralSound/Plugins/MixerPlugin/MixerPlugin.C new file mode 100644 index 0000000..79c4da8 --- /dev/null +++ b/SpiralSound/Plugins/MixerPlugin/MixerPlugin.C @@ -0,0 +1,108 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "MixerPlugin.h" +#include "MixerPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new MixerPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0007; +} +} + +/////////////////////////////////////////////////////// + +MixerPlugin::MixerPlugin() +{ + m_PluginInfo.Name="Mixer"; + m_PluginInfo.Width=100; + m_PluginInfo.Height=125; + m_PluginInfo.NumInputs=4; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input one"); + m_PluginInfo.PortTips.push_back("Input two"); + m_PluginInfo.PortTips.push_back("Input three"); + m_PluginInfo.PortTips.push_back("Input four"); + m_PluginInfo.PortTips.push_back("Output"); + + for (int n=0; nhide(); + return m_GUI; +} + +void MixerPlugin::Execute() +{ + // Mix the inputs + for (int n=0; nBUFSIZE; n++) + { + SetOutput(0,n,(GetInput(0,n)*m_ChannelVal[0])+ + (GetInput(1,n)*m_ChannelVal[1])+ + (GetInput(2,n)*m_ChannelVal[2])+ + (GetInput(3,n)*m_ChannelVal[3])); + } +} + +void MixerPlugin::StreamOut(ostream &s) +{ + s<>version; + for (int n=0; n>m_ChannelVal[n]; + } +} diff --git a/SpiralSound/Plugins/MixerPlugin/MixerPlugin.h b/SpiralSound/Plugins/MixerPlugin/MixerPlugin.h new file mode 100644 index 0000000..c8853b7 --- /dev/null +++ b/SpiralSound/Plugins/MixerPlugin/MixerPlugin.h @@ -0,0 +1,49 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef MixerPLUGIN +#define MixerPLUGIN + +static const int NUM_CHANNELS = 4; + +class MixerPlugin : public SpiralPlugin +{ +public: + MixerPlugin(); + virtual ~MixerPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetChannel(int n, float s) { m_ChannelVal[n]=s; } + float GetChannel(int n) { return m_ChannelVal[n]; } + +private: + float m_ChannelVal[NUM_CHANNELS]; +}; + +#endif diff --git a/SpiralSound/Plugins/MixerPlugin/MixerPlugin.pro b/SpiralSound/Plugins/MixerPlugin/MixerPlugin.pro new file mode 100644 index 0000000..37ba841 --- /dev/null +++ b/SpiralSound/Plugins/MixerPlugin/MixerPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + MixerPlugin.h \ + MixerPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + MixerPlugin.C \ + MixerPluginGUI.C + +TARGET = MixerPlugin.so diff --git a/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.C b/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.C new file mode 100644 index 0000000..cb6da84 --- /dev/null +++ b/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.C @@ -0,0 +1,66 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "MixerPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +MixerPluginGUI::MixerPluginGUI(int w, int h,MixerPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + int Width=20; + int Height=100; + + for (int n=0; ntype(4); + m_Chan[n]->selection_color(GUI_COLOUR); + m_Chan[n]->labelsize(10); + m_Chan[n]->maximum(2); + m_Chan[n]->step(0.01); + m_Chan[n]->value(1.0); + m_Chan[n]->callback((Fl_Callback*)cb_Chan,(void*)&Numbers[n]); + add(m_Chan[n]); + } + + end(); +} + +void MixerPluginGUI::UpdateValues() +{ + for (int n=0; nvalue(2.0f-m_Plugin->GetChannel(n)); + } +} + +inline void MixerPluginGUI::cb_Chan_i(Fl_Slider* o, void* v) +{ m_Plugin->SetChannel(*(int*)(v),2.0f-o->value()); } +void MixerPluginGUI::cb_Chan(Fl_Slider* o, void* v) +{ ((MixerPluginGUI*)(o->parent()))->cb_Chan_i(o,v);} diff --git a/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.h b/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.h new file mode 100644 index 0000000..365563b --- /dev/null +++ b/SpiralSound/Plugins/MixerPlugin/MixerPluginGUI.h @@ -0,0 +1,52 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "MixerPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef MixerGUI +#define MixerGUI + + +class MixerPluginGUI : public SpiralPluginGUI +{ +public: + MixerPluginGUI(int w, int h, MixerPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + MixerPlugin *m_Plugin; +private: + + int Numbers[NUM_CHANNELS]; + + Fl_Slider* m_Chan[NUM_CHANNELS]; + + //// Callbacks //// + inline void cb_Chan_i(Fl_Slider* o, void* v); + static void cb_Chan(Fl_Slider* o, void* v); + +}; + +#endif diff --git a/SpiralSound/Plugins/MixerPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/MixerPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..cd51533 --- /dev/null +++ b/SpiralSound/Plugins/MixerPlugin/SpiralIcon.xpm @@ -0,0 +1,346 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 307 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #252525", +"). c #666A00", +"!. c #8B9100", +"~. c #8D9200", +"{. c #929900", +"]. c #7E8200", +"^. c #040400", +"/. c #727175", +"(. c #FEFEFF", +"_. c #9D99AA", +":. c #DBD9E0", +"<. c #E9E9E9", +"[. c #CBCBCB", +"}. c #E0E0E0", +"|. c #6C6C6C", +"1. c #EDF600", +"2. c #F4FD00", +"3. c #F5FE00", +"4. c #515151", +"5. c #A6A6A7", +"6. c #827E93", +"7. c #615C77", +"8. c #EAEAED", +"9. c #DFDFE1", +"0. c #010200", +"a. c #010100", +"b. c #1E1D24", +"c. c #9894A7", +"d. c #B1AEBB", +"e. c #69686F", +"f. c #000001", +"g. c #0F0F00", +"h. c #7F8400", +"i. c #8C9200", +"j. c #C6CE00", +"k. c #615C76", +"l. c #5F5A75", +"m. c #413E4D", +"n. c #020203", +"o. c #292B00", +"p. c #F0F900", +"q. c #050500", +"r. c #1A1A1C", +"s. c #C3C1CB", +"t. c #9D9D9D", +"u. c #202020", +"v. c #383838", +"w. c #4C4C4C", +"x. c #161700", +"y. c #8A9000", +"z. c #E1EA00", +"A. c #E3EB00", +"B. c #929800", +"C. c #111112", +"D. c #C9C7D0", +"E. c #F1F1F1", +"F. c #F8F8F8", +"G. c #232323", +"H. c #141500", +"I. c #050408", +"J. c #AEACB9", +"K. c #FEFEFE", +"L. c #1D1D1D", +"M. c #313300", +"N. c #F6FF00", +"O. c #121300", +"P. c #B7B5C1", +"Q. c #9390A2", +"R. c #BBBBBB", +"S. c #414141", +"T. c #030303", +"U. c #020200", +"V. c #28272A", +"W. c #F4F4F6", +"X. c #605B76", +"Y. c #736E86", +"Z. c #D8D8D8", +"`. c #727272", +" + c #101010", +".+ c #505300", +"++ c #C8CF00", +"@+ c #1E2000", +"#+ c #848486", +"$+ c #CCCBD3", +"%+ c #747087", +"&+ c #6D6881", +"*+ c #1C1C1C", +"=+ c #242424", +"-+ c #393B09", +";+ c #0A0A00", +">+ c #656566", +",+ c #F6F6F6", +"'+ c #E8E6EA", +")+ c #706B84", +"!+ c #E3E1E6", +"~+ c #474746", +"{+ c #151515", +"]+ c #C8C8C8", +"^+ c #AEAEAE", +"/+ c #080808", +"(+ c #373639", +"_+ c #FDFCFE", +":+ c #ABA8B7", +"<+ c #F1F0F3", +"[+ c #6D6980", +"}+ c #0A090E", +"|+ c #95929E", +"1+ c #0A0810", +"2+ c #0D0D0D", +"3+ c #050505", +"4+ c #5B5A5C", +"5+ c #F7F6F7", +"6+ c #F4F3F5", +"7+ c #908C9F", +"8+ c #C8C6D0", +"9+ c #837E96", +"0+ c #86868A", +"a+ c #070608", +"b+ c #ECEBEE", +"c+ c #5B5571", +"d+ c #646078", +"e+ c #AFAFB0", +"f+ c #454545", +"g+ c #363636", +"h+ c #7A7A7A", +"i+ c #C8C8C9", +"j+ c #212025", +"k+ c #060607", +"l+ c #969699", +"m+ c #FAFAFA", +"n+ c #F8F8F9", +"o+ c #A29EAF", +"p+ c #F7F6F8", +"q+ c #F0F0F1", +"r+ c #B8B7B9", +"s+ c #E4E4E4", +"t+ c #FDFDFD", +"u+ c #A5A2B2", +"v+ c #3B3456", +"w+ c #A8A5B4", +"x+ c #525252", +"y+ c #848387", +"z+ c #CDCDCD", +"A+ c #8D899C", +"B+ c #494262", +"C+ c #68627C", +"D+ c #40395A", +"E+ c #ECECEC", +"F+ c #020202", +"G+ c #B4B5B5", +"H+ c #0B0B0B", +"I+ c #313232", +"J+ c #E3E3E3", +"K+ c #B1AEBC", +"L+ c #BDBBC6", +"M+ c #3C3556", +"N+ c #898599", +"O+ c #EDEDED", +"P+ c #39393A", +"Q+ c #040404", +"R+ c #333333", +"S+ c #F5F5F5", +"T+ c #2B2B2B", +"U+ c #2D2A3D", +"V+ c #B6B4C1", +"W+ c #F5F5F6", +"X+ c #605A76", +"Y+ c #DAD8DF", +"Z+ c #F5F4F6", +"`+ c #615B76", +" @ c #524D6A", +".@ c #E4E3E8", +"+@ c #D5D5D5", +"@@ c #1B1B1B", +"#@ c #303030", +"$@ c #AAABAB", +"%@ c #585464", +"&@ c #B0AEBB", +"*@ c #A29FAF", +"=@ c #E9E8E9", +"-@ c #787779", +";@ c #0F0E15", +">@ c #2D2D2E", +",@ c #595959", +"'@ c #FAFAFB", +")@ c #807B92", +"!@ c #B0ADBB", +"~@ c #E8E7EB", +"{@ c #3A3258", +"]@ c #E6E5EA", +"^@ c #DFDEE3", +"/@ c #443E5E", +"(@ c #BAB8C4", +"_@ c #C1BFCA", +":@ c #E0E0E5", +"<@ c #D0CED6", +"[@ c #362F52", +"}@ c #CECCD5", +"|@ c #413A5B", +"1@ c #6A657F", +"2@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.!.{.].^.6 6 6 E /.(.; ; _. ", +" :.; ; <.R h [.}.|.6 1.2.2.2.3.2.6 6 6 6 6 E 4.5.4 6. ", +" 7.8.; 9...6 6 6 6 6 6 6 6 0.a.~.2.6 6 6 6 6 6 6 b.c. ", +" V @ d.e.f.6 6 6 6 6 g.h.i.~.i.j.2.6 6 6 6 6 6 6 ", +" k.l.m.6 n.6 6 6 6 o.p.2.2.2.3.3.6 6 6 q.6 6 6 r. ", +" s.; ; t.u.u.v.w.u.6 6 x.6 0.6 y.3.z.z.z.A.B.6 6 C. ", +" D.; ; E.F.; ; ; G.6 a.H.6 6 6 y.3.z.z.z.A.B.6 6 I. ", +" J.; ; ; ; K.; ; L.6 M.N.N.N.N.p.2.6 6 6 O.6 6 6 6 P., ", +" Q.; ; K.; : R.S.T.6 6 6 6 6 6 y.2.6 6 ^.U.6 6 6 V.K.W.X. ", +" Y.; ; ; Z.`. +6 6 6 6 6 6 .+y.++2.U.6 @+6 6 6 6 #+; ; $+%+ ", +" &+J ; : *+6 6 6 6 =+-+N.N.N.2.2.2.;+6 6 a.6 6 6 >+,+; ; '+)+ ", +" !+; ; ~+6 E 6 {+]+^+/+6 6 6 6 6 6 6 6 a.6 6 6 6 (+_+; ; > )+ ", +" :+; <+[+}+6 6 ^+K.; |+1+6 6 6 6 6 6 6 6 2+3+6 6 6 4+5+; ; 6+7+ ", +" )+8+! 9+0+a+x ; ; b+c+d+e+l f+6 6 6 g+h+i+j+6 6 6 k+l+m+; ; n+@ ", +" o+p+q+r+s+t+; u+v+w+; ,+f+6 6 E x+; ; y+6 6 E 6 o z+; ; = A+ ", +" B+> ; ; ; ; ; ; C+D+; ; E+v.6 6 F+D ; ; G+H+6 6 6 I+J+; ; K+ ", +" > ; ; ; ; L+M+N+; ; O+P+6 6 Q+R+; ; S+T+6 6 U+V+; W+3 ", +" X+Y+= ; Z+`+ @.@; ; +@@@6 6 F+#@; ; ; $@x+%@ ", +" &@4 *@ X ; ; ; =@-@#@;@>@,@; ; ; K.'@)@ ", +" !@; ; ; ; ; ~@{@]@; ; ; ; = ^@/@ ", +" (@_@:@4 ; ; <@[@}@; ; ; s N+T ", +" |@ 1@2@N+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/MoogFilterPlugin/Makefile.in b/SpiralSound/Plugins/MoogFilterPlugin/Makefile.in new file mode 100644 index 0000000..e4932ab --- /dev/null +++ b/SpiralSound/Plugins/MoogFilterPlugin/Makefile.in @@ -0,0 +1,166 @@ +############################################################################# +# Makefile for building MoogFilterPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: MoogFilterPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + MoogFilterPlugin.h \ + MoogFilterPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + MoogFilterPlugin.C \ + MoogFilterPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + MoogFilterPlugin.o \ + MoogFilterPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = MoogFilterPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake MoogFilterPlugin.pro + +dist: + $(TAR) MoogFilterPlugin.tar MoogFilterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) MoogFilterPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +MoogFilterPlugin.o: MoogFilterPlugin.C \ + MoogFilterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + MoogFilterPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + SpiralIcon.xpm + +MoogFilterPluginGUI.o: MoogFilterPluginGUI.C \ + MoogFilterPluginGUI.h \ + MoogFilterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H + diff --git a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.C b/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.C new file mode 100644 index 0000000..996f204 --- /dev/null +++ b/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.C @@ -0,0 +1,166 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include +#include "MoogFilterPlugin.h" +#include "MoogFilterPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +#define PI 3.141592654 + +static const int GRANULARITY = 10; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new MoogFilterPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x000d; +} +} + +/////////////////////////////////////////////////////// + +MoogFilterPlugin::MoogFilterPlugin() : +Cutoff(0.5f), +Resonance(0.0f), +fs(44100.0f), +fc(1000.0f), +f(0.0f), +p(0.0f), +q(0.0f), +b0(0.1f), +b1(0.1f), +b2(0.0f), +b3(0.0f), +b4(0.0f), +t1(0.0f), +t2(0.0f) +{ + m_PluginInfo.Name="Moog Filter"; + m_PluginInfo.Width=120; + m_PluginInfo.Height=110; + m_PluginInfo.NumInputs=3; + m_PluginInfo.NumOutputs=3; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Cutoff CV"); + m_PluginInfo.PortTips.push_back("Emphasis CV"); + m_PluginInfo.PortTips.push_back("LowPass output"); + m_PluginInfo.PortTips.push_back("BandPass output"); + m_PluginInfo.PortTips.push_back("HighPass output"); +} + +MoogFilterPlugin::~MoogFilterPlugin() +{ +} + +PluginInfo &MoogFilterPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + fs = m_HostInfo->SAMPLERATE; + return Info; +} + +SpiralGUIType *MoogFilterPlugin::CreateGUI() +{ + m_GUI = new MoogFilterPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void MoogFilterPlugin::Execute() +{ + float in, Q; + + // Early out? + // We don't want to early out if the resonance is set to + // self oscillation, as this turns into an generator + // in it's own right... + /*if (Resonance<0.5 && !GetInput(2)) + { + if (!m_Input[0] || m_Input[0]->IsEmpty()) + { + cerr<<"moog early out"<Zero(); + m_Output[1]->Zero(); + m_Output[2]->Zero(); + return; + } + }*/ + + for (int n=0; nBUFSIZE; n++) + { + if (n%GRANULARITY==0) + { + fc = (Cutoff+GetInput(1,n))*0.25; + if (fc<0) fc=0; + + q = 1.0f - fc; + p = fc + 0.8f * fc * q; + f = p + p - 1.0f; + Q = ((Resonance+GetInput(2,n))*6)-3.0f; + q = Q + (1.0f + 0.5f * q * (1.0f - q + 5.6f * q * q)); + } + + in = GetInput(0,n); + + in -= q * b4; + + if (in>1) in=1; + if (in<-1) in=-1; + + t1 = b1; b1 = (in + b0) * p - b1 * f; + t2 = b2; b2 = (b1 + t1) * p - b2 * f; + t1 = b3; b3 = (b2 + t2) * p - b3 * f; + b4 = (b3 + t1) * p - b4 * f; + b4 = b4 - b4 * b4 * b4 * 0.166667f; + + b0 = in; + + SetOutput(0,n,b4); + SetOutput(1,n,(in-b4)); + SetOutput(2,n,3.0f * (b3 - b4)); + } +} + +void MoogFilterPlugin::Randomise() +{ +} + +void MoogFilterPlugin::StreamOut(ostream &s) +{ + s<>version; + s>>Cutoff>>Resonance; +} diff --git a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.h b/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.h new file mode 100644 index 0000000..54ff9ee --- /dev/null +++ b/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.h @@ -0,0 +1,63 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef MOOGFILTERPLUGIN +#define MOOGFILTERPLUGIN + +class MoogFilterPlugin : public SpiralPlugin +{ +public: + MoogFilterPlugin(); + virtual ~MoogFilterPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetCutoff(float s) { Cutoff=s; } + void SetResonance(float s) { Resonance=s; } + float GetCutoff() { return Cutoff; } + float GetResonance() { return Resonance; } + + void Randomise(); + +private: + float Cutoff, Resonance; + + float fs, fc; + float f,p,q; + float b0,b1,b2,b3,b4; + float t1,t2; + + float in1,in2,in3,in4,out1,out2,out3,out4; + + friend istream &operator>>(istream &s, MoogFilterPlugin &o); + friend ostream &operator<<(ostream &s, MoogFilterPlugin &o); +}; +istream &operator>>(istream &s, MoogFilterPlugin &o); +ostream &operator<<(ostream &s, MoogFilterPlugin &o); + +#endif diff --git a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.pro b/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.pro new file mode 100644 index 0000000..ccc1db2 --- /dev/null +++ b/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + MoogFilterPlugin.h \ + MoogFilterPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + MoogFilterPlugin.C \ + MoogFilterPluginGUI.C + +TARGET = MoogFilterPlugin.so diff --git a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPluginGUI.C b/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPluginGUI.C new file mode 100644 index 0000000..fe30d80 --- /dev/null +++ b/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPluginGUI.C @@ -0,0 +1,73 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "MoogFilterPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +MoogFilterPluginGUI::MoogFilterPluginGUI(int w, int h,MoogFilterPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + Cutoff = new Fl_Slider(15, 20, 20, 70, "Cutoff"); + Cutoff->type(4); + Cutoff->selection_color(GUI_COLOUR); + Cutoff->labelsize(10); + Cutoff->maximum(1); + Cutoff->step(0.0001); + Cutoff->value(1); + Cutoff->callback((Fl_Callback*)cb_Cutoff); + + Resonance = new Fl_Knob(58, 28, 45, 45, "Emphasis"); + Resonance->color(GUI_COLOUR); + Resonance->type(Fl_Knob::DOTLIN); + Resonance->labelsize(10); + Resonance->maximum(1); + Resonance->step(0.00001); + Resonance->value(0); + Resonance->callback((Fl_Callback*)cb_Resonance); + + end(); +} + +void MoogFilterPluginGUI::UpdateValues() +{ + Cutoff->value(1.0f-m_Plugin->GetCutoff()); + Resonance->value(m_Plugin->GetResonance()); +} + +inline void MoogFilterPluginGUI::cb_Cutoff_i(Fl_Slider* o, void* v) +{ + float value=1.0f-o->value(); +// m_Plugin->SetCutoff((value*value)+10.0f); + m_Plugin->SetCutoff(value); +} +void MoogFilterPluginGUI::cb_Cutoff(Fl_Slider* o, void* v) +{ ((MoogFilterPluginGUI*)(o->parent()))->cb_Cutoff_i(o,v); } + +inline void MoogFilterPluginGUI::cb_Resonance_i(Fl_Knob* o, void* v) +{ m_Plugin->SetResonance(o->value()); } +void MoogFilterPluginGUI::cb_Resonance(Fl_Knob* o, void* v) +{ ((MoogFilterPluginGUI*)(o->parent()))->cb_Resonance_i(o,v); } diff --git a/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPluginGUI.h b/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPluginGUI.h new file mode 100644 index 0000000..5a51a5f --- /dev/null +++ b/SpiralSound/Plugins/MoogFilterPlugin/MoogFilterPluginGUI.h @@ -0,0 +1,56 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "MoogFilterPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" + +#ifndef SVFilterGUI +#define SVFilterGUI + + +class MoogFilterPluginGUI : public SpiralPluginGUI +{ +public: + MoogFilterPluginGUI(int w, int h, MoogFilterPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + MoogFilterPlugin *m_Plugin; + +private: + + Fl_Group *GUIFilterGroup; + Fl_Slider *Cutoff; + Fl_Knob *Resonance; + + //// Callbacks //// + + inline void cb_Cutoff_i(Fl_Slider* o, void* v); + static void cb_Cutoff(Fl_Slider*, void*); + inline void cb_Resonance_i(Fl_Knob* o, void* v); + static void cb_Resonance(Fl_Knob* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/MoogFilterPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/MoogFilterPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..ed86235 --- /dev/null +++ b/SpiralSound/Plugins/MoogFilterPlugin/SpiralIcon.xpm @@ -0,0 +1,320 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 281 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #0F1100", +"@. c #060600", +"#. c #191A00", +"$. c #393643", +"%. c #47415F", +"&. c #9692A4", +"*. c #D9D8DE", +"=. c #F7F7F8", +"-. c #918DA0", +";. c #B8B5C1", +">. c #D1D1D1", +",. c #212121", +"'. c #212300", +"). c #030300", +"!. c #727175", +"~. c #FEFEFF", +"{. c #9D99AA", +"]. c #DBD9E0", +"^. c #E9E9E9", +"/. c #CBCBCB", +"(. c #E0E0E0", +"_. c #6C6C6C", +":. c #010100", +"<. c #515151", +"[. c #A6A6A7", +"}. c #827E93", +"|. c #615C77", +"1. c #EAEAED", +"2. c #DFDFE1", +"3. c #FFF200", +"4. c #1E1D24", +"5. c #9894A7", +"6. c #B1AEBB", +"7. c #69686F", +"8. c #000001", +"9. c #615C76", +"0. c #5F5A75", +"a. c #413E4D", +"b. c #020203", +"c. c #1A1A1C", +"d. c #C3C1CB", +"e. c #9D9D9D", +"f. c #202020", +"g. c #383838", +"h. c #4C4C4C", +"i. c #060606", +"j. c #111112", +"k. c #C9C7D0", +"l. c #F1F1F1", +"m. c #F8F8F8", +"n. c #030303", +"o. c #050408", +"p. c #AEACB9", +"q. c #FEFEFE", +"r. c #050505", +"s. c #B7B5C1", +"t. c #9390A2", +"u. c #BBBBBB", +"v. c #414141", +"w. c #040400", +"x. c #080800", +"y. c #2F3100", +"z. c #28272A", +"A. c #F4F4F6", +"B. c #605B76", +"C. c #736E86", +"D. c #D8D8D8", +"E. c #727272", +"F. c #101010", +"G. c #262800", +"H. c #131400", +"I. c #848486", +"J. c #CCCBD3", +"K. c #747087", +"L. c #6D6881", +"M. c #1C1C1C", +"N. c #242424", +"O. c #656566", +"P. c #F6F6F6", +"Q. c #E8E6EA", +"R. c #706B84", +"S. c #E3E1E6", +"T. c #474746", +"U. c #151515", +"V. c #C8C8C8", +"W. c #AEAEAE", +"X. c #080808", +"Y. c #373639", +"Z. c #FDFCFE", +"`. c #ABA8B7", +" + c #F1F0F3", +".+ c #6D6980", +"++ c #0A090E", +"@+ c #95929E", +"#+ c #0A0810", +"$+ c #0D0D0D", +"%+ c #5B5A5C", +"&+ c #F7F6F7", +"*+ c #F4F3F5", +"=+ c #908C9F", +"-+ c #C8C6D0", +";+ c #837E96", +">+ c #86868A", +",+ c #070608", +"'+ c #ECEBEE", +")+ c #5B5571", +"!+ c #646078", +"~+ c #AFAFB0", +"{+ c #454545", +"]+ c #363636", +"^+ c #7A7A7A", +"/+ c #C8C8C9", +"(+ c #212025", +"_+ c #060607", +":+ c #969699", +"<+ c #FAFAFA", +"[+ c #F8F8F9", +"}+ c #A29EAF", +"|+ c #F7F6F8", +"1+ c #F0F0F1", +"2+ c #B8B7B9", +"3+ c #E4E4E4", +"4+ c #FDFDFD", +"5+ c #A5A2B2", +"6+ c #3B3456", +"7+ c #A8A5B4", +"8+ c #525252", +"9+ c #848387", +"0+ c #CDCDCD", +"a+ c #8D899C", +"b+ c #494262", +"c+ c #68627C", +"d+ c #40395A", +"e+ c #ECECEC", +"f+ c #020202", +"g+ c #B4B5B5", +"h+ c #0B0B0B", +"i+ c #313232", +"j+ c #E3E3E3", +"k+ c #B1AEBC", +"l+ c #BDBBC6", +"m+ c #3C3556", +"n+ c #898599", +"o+ c #EDEDED", +"p+ c #39393A", +"q+ c #040404", +"r+ c #333333", +"s+ c #F5F5F5", +"t+ c #2B2B2B", +"u+ c #2D2A3D", +"v+ c #B6B4C1", +"w+ c #F5F5F6", +"x+ c #605A76", +"y+ c #DAD8DF", +"z+ c #F5F4F6", +"A+ c #615B76", +"B+ c #524D6A", +"C+ c #E4E3E8", +"D+ c #D5D5D5", +"E+ c #1B1B1B", +"F+ c #303030", +"G+ c #AAABAB", +"H+ c #585464", +"I+ c #B0AEBB", +"J+ c #A29FAF", +"K+ c #E9E8E9", +"L+ c #787779", +"M+ c #0F0E15", +"N+ c #2D2D2E", +"O+ c #595959", +"P+ c #FAFAFB", +"Q+ c #807B92", +"R+ c #B0ADBB", +"S+ c #E8E7EB", +"T+ c #3A3258", +"U+ c #E6E5EA", +"V+ c #DFDEE3", +"W+ c #443E5E", +"X+ c #BAB8C4", +"Y+ c #C1BFCA", +"Z+ c #E0E0E5", +"`+ c #D0CED6", +" @ c #362F52", +".@ c #CECCD5", +"+@ c #413A5B", +"@@ c #6A657F", +"#@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.Q @.#.$.%.&.*.=.-. ", +" ;.; ; ; ; ; ; = >.,.'.).6 6 6 6 6 6 6 6 E !.~.; ; {. ", +" ].; ; ^.R h /.(._.6 :.6 6 6 6 6 6 6 6 6 6 E <.[.4 }. ", +" |.1.; 2...6 6 6 6 6 6 3.6 3.6 6 6 6 6 6 6 6 6 6 4.5. ", +" V @ 6.7.8.6 6 6 6 6 6 3.3.3.6 6 6 6 6 6 6 6 6 6 ", +" 9.0.a.6 b.6 6 6 6 6 3.3.3.6 6 6 6 6 6 6 6 6 6 c. ", +" d.; ; e.f.f.g.h.i.6 6 3.6 3.6 6 6 6 6 6 6 6 6 6 j. ", +" k.; ; l.m.; ; ; n.6 6 3.6 3.6 3.6 3.6 6 3.6 6 6 o. ", +" p.; ; ; ; q.; ; r.6 6 3.6 3.3.6 3.6 3.3.6 3.6 6 6 s., ", +" t.; ; q.; : u.v.E w.6 3.6 3.6 3.6 3.3.6 3.3.x.y.z.q.A.B. ", +" C.; ; ; D.E.F.6 6 6 6 6 6 6 6 6 6 6 6 6 6 3.G.H.I.; ; J.K. ", +" L.J ; : M.6 6 6 6 N...6 6 6 6 3.3.3.3.3.3.6 6 6 O.P.; ; Q.R. ", +" S.; ; T.6 E 6 U.V.W.X.6 6 6 6 6 6 6 6 :.6 6 6 6 Y.Z.; ; > R. ", +" `.; +.+++6 6 W.q.; @+#+6 6 6 6 6 6 6 6 $+r.6 6 6 %+&+; ; *+=+ ", +" R.-+! ;+>+,+x ; ; '+)+!+~+l {+6 6 6 ]+^+/+(+6 6 6 _+:+<+; ; [+@ ", +" }+|+1+2+3+4+; 5+6+7+; P.{+6 6 E 8+; ; 9+6 6 E 6 o 0+; ; = a+ ", +" b+> ; ; ; ; ; ; c+d+; ; e+g.6 6 f+D ; ; g+h+6 6 6 i+j+; ; k+ ", +" > ; ; ; ; l+m+n+; ; o+p+6 6 q+r+; ; s+t+6 6 u+v+; w+3 ", +" x+y+= ; z+A+B+C+; ; D+E+6 6 f+F+; ; ; G+8+H+ ", +" I+4 J+ X ; ; ; K+L+F+M+N+O+; ; ; q.P+Q+ ", +" R+; ; ; ; ; S+T+U+; ; ; ; = V+W+ ", +" X+Y+Z+4 ; ; `+ @.@; ; ; s n+T ", +" +@ @@#@n+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/NoteSnapPlugin/Makefile.in b/SpiralSound/Plugins/NoteSnapPlugin/Makefile.in new file mode 100644 index 0000000..9ad0250 --- /dev/null +++ b/SpiralSound/Plugins/NoteSnapPlugin/Makefile.in @@ -0,0 +1,150 @@ +############################################################################# +# Makefile for building NoteSnapPlugin.so +# Generated by tmake at 21:08, 2001/11/12 +# Project: NoteSnapPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + NoteSnapPlugin.h \ + NoteSnapPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + NoteSnapPlugin.C \ + NoteSnapPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + NoteSnapPlugin.o \ + NoteSnapPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = NoteSnapPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: Makefile + +Makefile: NoteSnapPlugin.pro + tmake NoteSnapPlugin.pro -o Makefile + +dist: + $(TAR) NoteSnapPlugin.tar NoteSnapPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) NoteSnapPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +NoteSnapPlugin.o: NoteSnapPlugin.C \ + SpiralIcon.xpm + +NoteSnapPluginGUI.o: NoteSnapPluginGUI.C + diff --git a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.C b/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.C new file mode 100644 index 0000000..3fab738 --- /dev/null +++ b/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.C @@ -0,0 +1,120 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "NoteSnapPlugin.h" +#include "NoteSnapPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../NoteTable.h" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new NoteSnapPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0018; +} +} + +/////////////////////////////////////////////////////// + +NoteSnapPlugin::NoteSnapPlugin() +{ + m_PluginInfo.Name="Note Snap"; + m_PluginInfo.Width=220; + m_PluginInfo.Height=125; + m_PluginInfo.NumInputs=1; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Output"); +} + +NoteSnapPlugin::~NoteSnapPlugin() +{ +} + +PluginInfo &NoteSnapPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *NoteSnapPlugin::CreateGUI() +{ + m_GUI=NULL; + return m_GUI; +} + +void NoteSnapPlugin::Execute() +{ + float Freq=0, OldFreq=0; + float Out=0; + + for (int n=0; nBUFSIZE; n++) + { + Freq=GetInputPitch(0,n); + + if (Freq!=OldFreq) // if it's changed + { + for (int i=0; i<131; i++) // for every note + { + if (Freq>=NoteTable[i] && FreqInitialise(&host); + test->CreateGUI(); + + for (;;) + { + if (!Fl::check()) break; + test->Execute(); + } + + delete test; + + return 1; +} diff --git a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.h b/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.h new file mode 100644 index 0000000..b2eb52c --- /dev/null +++ b/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.h @@ -0,0 +1,43 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef NoteSnapPLUGIN +#define NoteSnapPLUGIN + +class NoteSnapPlugin : public SpiralPlugin +{ +public: + NoteSnapPlugin(); + virtual ~NoteSnapPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s) {} + virtual void StreamIn(istream &s) {} + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + +private: +}; + +#endif diff --git a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.pro b/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.pro new file mode 100644 index 0000000..a848c58 --- /dev/null +++ b/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + NoteSnapPlugin.h \ + NoteSnapPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + NoteSnapPlugin.C \ + NoteSnapPluginGUI.C + +TARGET = NoteSnapPlugin.so diff --git a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPluginGUI.C b/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPluginGUI.C new file mode 100644 index 0000000..7ce1b6d --- /dev/null +++ b/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPluginGUI.C @@ -0,0 +1,41 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "NoteSnapPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +NoteSnapPluginGUI::NoteSnapPluginGUI(int w, int h,NoteSnapPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + end(); +} + + + +void NoteSnapPluginGUI::UpdateValues() +{ +} + diff --git a/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPluginGUI.h b/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPluginGUI.h new file mode 100644 index 0000000..e81717f --- /dev/null +++ b/SpiralSound/Plugins/NoteSnapPlugin/NoteSnapPluginGUI.h @@ -0,0 +1,47 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "NoteSnapPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef SplitterGUI +#define SplitterGUI + + +class NoteSnapPluginGUI : public SpiralPluginGUI +{ +public: + NoteSnapPluginGUI(int w, int h, NoteSnapPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + NoteSnapPlugin *m_Plugin; +private: + + //// Callbacks //// +}; + +#endif diff --git a/SpiralSound/Plugins/NoteSnapPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/NoteSnapPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..c093983 --- /dev/null +++ b/SpiralSound/Plugins/NoteSnapPlugin/SpiralIcon.xpm @@ -0,0 +1,327 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 288 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #111300", +"@. c #151600", +"#. c #050500", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #252525", +"). c #0A0B00", +"!. c #101000", +"~. c #070800", +"{. c #F6FF00", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #0B0B00", +"|. c #515151", +"1. c #A6A6A7", +"2. c #827E93", +"3. c #615C77", +"4. c #EAEAED", +"5. c #DFDFE1", +"6. c #060700", +"7. c #060600", +"8. c #1E1D24", +"9. c #9894A7", +"0. c #B1AEBB", +"a. c #69686F", +"b. c #000001", +"c. c #101100", +"d. c #615C76", +"e. c #5F5A75", +"f. c #413E4D", +"g. c #020203", +"h. c #050600", +"i. c #1A1A1C", +"j. c #C3C1CB", +"k. c #9D9D9D", +"l. c #202020", +"m. c #383838", +"n. c #4C4C4C", +"o. c #111112", +"p. c #C9C7D0", +"q. c #F1F1F1", +"r. c #F8F8F8", +"s. c #232323", +"t. c #020200", +"u. c #050408", +"v. c #AEACB9", +"w. c #FEFEFE", +"x. c #1D1D1D", +"y. c #090900", +"z. c #B7B5C1", +"A. c #9390A2", +"B. c #BBBBBB", +"C. c #414141", +"D. c #030303", +"E. c #070700", +"F. c #28272A", +"G. c #F4F4F6", +"H. c #605B76", +"I. c #736E86", +"J. c #D8D8D8", +"K. c #727272", +"L. c #101010", +"M. c #040400", +"N. c #848486", +"O. c #CCCBD3", +"P. c #747087", +"Q. c #6D6881", +"R. c #1C1C1C", +"S. c #242424", +"T. c #010100", +"U. c #656566", +"V. c #F6F6F6", +"W. c #E8E6EA", +"X. c #706B84", +"Y. c #E3E1E6", +"Z. c #474746", +"`. c #151515", +" + c #C8C8C8", +".+ c #AEAEAE", +"++ c #080808", +"@+ c #373639", +"#+ c #FDFCFE", +"$+ c #ABA8B7", +"%+ c #F1F0F3", +"&+ c #6D6980", +"*+ c #0A090E", +"=+ c #95929E", +"-+ c #0A0810", +";+ c #0D0D0D", +">+ c #050505", +",+ c #5B5A5C", +"'+ c #F7F6F7", +")+ c #F4F3F5", +"!+ c #908C9F", +"~+ c #C8C6D0", +"{+ c #837E96", +"]+ c #86868A", +"^+ c #070608", +"/+ c #ECEBEE", +"(+ c #5B5571", +"_+ c #646078", +":+ c #AFAFB0", +"<+ c #454545", +"[+ c #363636", +"}+ c #7A7A7A", +"|+ c #C8C8C9", +"1+ c #212025", +"2+ c #060607", +"3+ c #969699", +"4+ c #FAFAFA", +"5+ c #F8F8F9", +"6+ c #A29EAF", +"7+ c #F7F6F8", +"8+ c #F0F0F1", +"9+ c #B8B7B9", +"0+ c #E4E4E4", +"a+ c #FDFDFD", +"b+ c #A5A2B2", +"c+ c #3B3456", +"d+ c #A8A5B4", +"e+ c #525252", +"f+ c #848387", +"g+ c #CDCDCD", +"h+ c #8D899C", +"i+ c #494262", +"j+ c #68627C", +"k+ c #40395A", +"l+ c #ECECEC", +"m+ c #020202", +"n+ c #B4B5B5", +"o+ c #0B0B0B", +"p+ c #313232", +"q+ c #E3E3E3", +"r+ c #B1AEBC", +"s+ c #BDBBC6", +"t+ c #3C3556", +"u+ c #898599", +"v+ c #EDEDED", +"w+ c #39393A", +"x+ c #040404", +"y+ c #333333", +"z+ c #F5F5F5", +"A+ c #2B2B2B", +"B+ c #2D2A3D", +"C+ c #B6B4C1", +"D+ c #F5F5F6", +"E+ c #605A76", +"F+ c #DAD8DF", +"G+ c #F5F4F6", +"H+ c #615B76", +"I+ c #524D6A", +"J+ c #E4E3E8", +"K+ c #D5D5D5", +"L+ c #1B1B1B", +"M+ c #303030", +"N+ c #AAABAB", +"O+ c #585464", +"P+ c #B0AEBB", +"Q+ c #A29FAF", +"R+ c #E9E8E9", +"S+ c #787779", +"T+ c #0F0E15", +"U+ c #2D2D2E", +"V+ c #595959", +"W+ c #FAFAFB", +"X+ c #807B92", +"Y+ c #B0ADBB", +"Z+ c #E8E7EB", +"`+ c #3A3258", +" @ c #E6E5EA", +".@ c #DFDEE3", +"+@ c #443E5E", +"@@ c #BAB8C4", +"#@ c #C1BFCA", +"$@ c #E0E0E5", +"%@ c #D0CED6", +"&@ c #362F52", +"*@ c #CECCD5", +"=@ c #413A5B", +"-@ c #6A657F", +";@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.6 ).!.~.{.{.{.{.{.6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 }.~.6 6 6 6 6 {.{.6 6 E |.1.4 2. ", +" 3.4.; 5...6 6 6 6 6 6.7.6 6 6 {.{.{.{.{.6 6 6 6 8.9. ", +" V @ 0.a.b.6 6 6 6 6 c.6 6 6 6 6 6 6 {.{.6 6 6 6 ", +" d.e.f.6 g.6 6 6 6 h.6 6 6 6 {.{.{.{.{.6 6 6 6 i. ", +" j.; ; k.l.l.m.n.l.6 {.6 6 6 6 6 6 6 {.{.6 6 6 6 o. ", +" p.; ; q.r.; ; ; s.{.6 {.6 {.6 {.{.{.{.{.t.6 6 6 u. ", +" v.; ; ; ; w.; ; x.6 c.6 {.6 6 {.{.{.{.{.y.6 6 6 6 z., ", +" A.; ; w.; : B.C.D.6 6 E.6 6 6 6 6 6 {.{.t.6 6 6 F.w.G.H. ", +" I.; ; ; J.K.L.6 6 6 6 6 M.6 6 {.{.{.{.{.6 6 6 6 N.; ; O.P. ", +" Q.J ; : R.6 6 6 6 S...6 6 6 6 6 6 6 {.{.T.6 6 6 U.V.; ; W.X. ", +" Y.; ; Z.6 E 6 `. +.+++6 6 6 {.{.{.{.{.T.6 6 6 6 @+#+; ; > X. ", +" $+; %+&+*+6 6 .+w.; =+-+6 6 6 6 6 6 6 6 ;+>+6 6 6 ,+'+; ; )+!+ ", +" X.~+! {+]+^+x ; ; /+(+_+:+l <+6 6 6 [+}+|+1+6 6 6 2+3+4+; ; 5+@ ", +" 6+7+8+9+0+a+; b+c+d+; V.<+6 6 E e+; ; f+6 6 E 6 o g+; ; = h+ ", +" i+> ; ; ; ; ; ; j+k+; ; l+m.6 6 m+D ; ; n+o+6 6 6 p+q+; ; r+ ", +" > ; ; ; ; s+t+u+; ; v+w+6 6 x+y+; ; z+A+6 6 B+C+; D+3 ", +" E+F+= ; G+H+I+J+; ; K+L+6 6 m+M+; ; ; N+e+O+ ", +" P+4 Q+ X ; ; ; R+S+M+T+U+V+; ; ; w.W+X+ ", +" Y+; ; ; ; ; Z+`+ @; ; ; ; = .@+@ ", +" @@#@$@4 ; ; %@&@*@; ; ; s u+T ", +" =@ -@;@u+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/OscillatorPlugin/Makefile.in b/SpiralSound/Plugins/OscillatorPlugin/Makefile.in new file mode 100644 index 0000000..bef604c --- /dev/null +++ b/SpiralSound/Plugins/OscillatorPlugin/Makefile.in @@ -0,0 +1,166 @@ +############################################################################# +# Makefile for building OscillatorPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: OscillatorPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + OscillatorPlugin.h \ + OscillatorPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + OscillatorPlugin.C \ + OscillatorPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + OscillatorPlugin.o \ + OscillatorPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = OscillatorPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake OscillatorPlugin.pro + +dist: + $(TAR) OscillatorPlugin.tar OscillatorPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) OscillatorPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +OscillatorPlugin.o: OscillatorPlugin.C \ + OscillatorPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + OscillatorPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +OscillatorPluginGUI.o: OscillatorPluginGUI.C \ + OscillatorPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + OscillatorPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h + diff --git a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.C b/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.C new file mode 100644 index 0000000..1d4e875 --- /dev/null +++ b/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.C @@ -0,0 +1,198 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "OscillatorPlugin.h" +#include "OscillatorPluginGUI.h" +#include +#include +#include "SpiralIcon.xpm" + +static const int IN_FREQ = 0; +static const int IN_PW = 1; +static const int IN_SHLEN = 2; + +static const int OUT_MAIN = 0; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new OscillatorPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0004; +} +} + +/////////////////////////////////////////////////////// + +OscillatorPlugin::OscillatorPlugin() : +m_Type(SQUARE), +m_Octave(0), +m_FineFreq(1.0f), +m_PulseWidth(0.5f), +m_ModAmount(1.0f), +m_Noisev(0), +m_FreqModBuf(NULL), +m_PulseWidthModBuf(NULL), +m_SHModBuf(NULL) +{ + + m_CyclePos=0; + m_Note=0; + m_LastFreq=0; + + m_PluginInfo.Name="Oscillator"; + m_PluginInfo.Width=245; + m_PluginInfo.Height=110; + m_PluginInfo.NumInputs=3; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Frequency CV"); + m_PluginInfo.PortTips.push_back("PulseWidth CV"); + m_PluginInfo.PortTips.push_back("Sample & Hold length CV"); + m_PluginInfo.PortTips.push_back("Output"); +} + +OscillatorPlugin::~OscillatorPlugin() +{ +} + +PluginInfo &OscillatorPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *OscillatorPlugin::CreateGUI() +{ + m_GUI = new OscillatorPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void OscillatorPlugin::Execute() +{ + short noisev=0; + float Freq=0; + float CycleLen=0; + int samplelen, PW; + + switch (m_Type) + { + case SQUARE: + for (int n=0; nBUFSIZE; n++) + { + if (InputExists(0)) Freq=GetInputPitch(0,n); + else Freq=110; + Freq*=m_FineFreq; + if (m_Octave>0) Freq*=1<<(m_Octave); + if (m_Octave<0) Freq/=1<<(-m_Octave); + CycleLen = m_HostInfo->SAMPLERATE/Freq; + PW = (int)((m_PulseWidth+GetInput(IN_PW,n)*m_ModAmount) * CycleLen); + + // calculate square wave pattern + m_CyclePos++; + if (m_CyclePos>CycleLen) m_CyclePos=0; + + if (m_CyclePosBUFSIZE; n++) + { + if (InputExists(0)) Freq=GetInputPitch(0,n); + else Freq=110; + Freq*=m_FineFreq; + if (m_Octave>0) Freq*=1<<(m_Octave); + if (m_Octave<0) Freq/=1<<(-m_Octave); + CycleLen = m_HostInfo->SAMPLERATE/Freq; + PW = (int)((m_PulseWidth+GetInput(IN_PW,n)*m_ModAmount) * CycleLen); + + // get normailise position between cycle + m_CyclePos++; + if (m_CyclePos>CycleLen) m_CyclePos=0; + + if (m_CyclePos1 + SetOutput(OUT_MAIN,n,Linear(0,PW,m_CyclePos,-1,1)); + } + else + { + // after pw 1->-1 + SetOutput(OUT_MAIN,n,Linear(PW,CycleLen,m_CyclePos,1,-1)); + } + } + break; + + case NOISE: + for (int n=0; nBUFSIZE; n++) + { + m_CyclePos++; + + //modulate the sample & hold length + samplelen = (int)((m_SHLen+GetInput(IN_SHLEN,n)*m_ModAmount)*m_HostInfo->SAMPLERATE); + + // do sample & hold on the noise + if (m_CyclePos>samplelen) + { + m_Noisev=(short)((rand()%SHRT_MAX*2)-SHRT_MAX); + m_CyclePos=0; + } + SetOutput(OUT_MAIN,n,m_Noisev/(float)SHRT_MAX); + } + break; + + case NONE: break; + } +} + +void OscillatorPlugin::StreamOut(ostream &s) +{ + s<>version>>*this; +} + +istream &operator>>(istream &s, OscillatorPlugin &o) +{ + float dummy=0; + s>>(int&)o.m_Type>>o.m_Octave>>o.m_FineFreq>>o.m_PulseWidth>>dummy>> + o.m_SHLen>>o.m_ModAmount; + return s; +} + +ostream &operator<<(ostream &s, OscillatorPlugin &o) +{ + float dummy=0; + s<<(int)o.m_Type<<" "< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef OscillatorPLUGIN +#define OscillatorPLUGIN + +class OscillatorPlugin : public SpiralPlugin +{ +public: + OscillatorPlugin(); + virtual ~OscillatorPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + enum Type{NONE,SQUARE,SAW,NOISE}; + + void ModulateFreq(Sample *data) {m_FreqModBuf=data;} + void ModulatePulseWidth(Sample *data) {m_PulseWidthModBuf=data;} + void ModulateSHLen(Sample *data) {m_SHModBuf=data;} + + void NoteTrigger(int V,int s,int v); + void SetOctave(int o) {m_Octave=o;} + void SetFineFreq(float s) {m_FineFreq=s;} + void SetPulseWidth(float p) {m_PulseWidth=p;} + void SetType(Type t) {m_Type=t;} + void SetSHLen(float s) {m_SHLen=s;} + void SetModAmount(float s) {m_ModAmount=s;} + int GetOctave() {return m_Octave;} + float GetFineFreq() {return m_FineFreq;} + float GetPulseWidth() {return m_PulseWidth;} + Type GetType() {return m_Type;} + float GetSHLen() {return m_SHLen;} + float GetModAmount() {return m_ModAmount;} + +private: + + // Voice specific parameter + int m_Note; + int m_CyclePos; + float m_LastFreq; + + // Common voice parameters + Type m_Type; + int m_Octave; + float m_FineFreq; + float m_PulseWidth; + float m_SHLen; + float m_ModAmount; + short m_Noisev; + + Sample *m_FreqModBuf; + Sample *m_PulseWidthModBuf; + Sample *m_SHModBuf; + + static const int FIXED; + + friend istream &operator>>(istream &s, OscillatorPlugin &o); + friend ostream &operator<<(ostream &s, OscillatorPlugin &o); +}; + +istream &operator>>(istream &s, OscillatorPlugin &o); +ostream &operator<<(ostream &s, OscillatorPlugin &o); + +#endif diff --git a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.pro b/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.pro new file mode 100644 index 0000000..f0360d8 --- /dev/null +++ b/SpiralSound/Plugins/OscillatorPlugin/OscillatorPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + OscillatorPlugin.h \ + OscillatorPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + OscillatorPlugin.C \ + OscillatorPluginGUI.C + +TARGET = OscillatorPlugin.so diff --git a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPluginGUI.C b/SpiralSound/Plugins/OscillatorPlugin/OscillatorPluginGUI.C new file mode 100644 index 0000000..2b41ab0 --- /dev/null +++ b/SpiralSound/Plugins/OscillatorPlugin/OscillatorPluginGUI.C @@ -0,0 +1,368 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "OscillatorPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +static unsigned char *image_Square[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" ...... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ... . ... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ...... ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_Noise[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" . ", +(unsigned char*)" . . ", +(unsigned char*)" . . . ", +(unsigned char*)" . . . ", +(unsigned char*)" . . . . ", +(unsigned char*)" . . . . ", +(unsigned char*)" ... . . . . .. ", +(unsigned char*)" . . . . .. ", +(unsigned char*)" . . . . . ", +(unsigned char*)" . . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_Saw[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" .. ", +(unsigned char*)" .. ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ... . .... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" .. ", +(unsigned char*)" .. ", +(unsigned char*)" ", +(unsigned char*)" "}; + + +OscillatorPluginGUI::OscillatorPluginGUI(int w, int h,OscillatorPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o), +pixmap_Square(image_Square), +pixmap_Noise(image_Noise), +pixmap_Saw(image_Saw) +{ + m_Plugin=o; + + ShapeSquare = new Fl_Check_Button(5, 15, 55, 30); + ShapeSquare->type(102); + ShapeSquare->down_box(FL_DIAMOND_DOWN_BOX); + ShapeSquare->selection_color(GUI_COLOUR); + ShapeSquare->set(); + pixmap_Square.label(ShapeSquare); + ShapeSquare->callback((Fl_Callback*)cb_Square); + + ShapeNoise = new Fl_Check_Button(5, 65, 55, 30); + ShapeNoise->type(102); + ShapeNoise->down_box(FL_DIAMOND_DOWN_BOX); + ShapeNoise->selection_color(GUI_COLOUR); + pixmap_Noise.label(ShapeNoise); + ShapeNoise->callback((Fl_Callback*)cb_Noise); + + ShapeSaw = new Fl_Check_Button(5, 40, 55, 30); + ShapeSaw->type(102); + ShapeSaw->down_box(FL_DIAMOND_DOWN_BOX); + ShapeSaw->selection_color(GUI_COLOUR); + pixmap_Saw.label(ShapeSaw); + ShapeSaw->callback((Fl_Callback*)cb_Saw); + + Freq = new Fl_Knob(188, 2, 40, 40, "Octave"); + Freq->color(GUI_COLOUR); + Freq->type(Fl_Knob::LINELIN); + Freq->labelsize(10); + Freq->maximum(6); + Freq->step(1); + Freq->value(3); + Freq->scaleticks(6); + Freq->cursor(50); + Freq->callback((Fl_Callback*)cb_Freq); + + FineTune = new Fl_Knob(112, 22, 65, 65, "Fine Tune"); + FineTune->color(GUI_COLOUR); + FineTune->type(Fl_Knob::LINELIN); + FineTune->labelsize(10); + FineTune->scaleticks(20); + FineTune->maximum(1.414); + FineTune->step(0.000001); + FineTune->value(1); + FineTune->callback((Fl_Callback*)cb_FineTune); + + ModAmount = new Fl_Knob(188, 54, 40, 40, "Mod Depth"); + ModAmount->color(GUI_COLOUR); + ModAmount->type(Fl_Knob::LINELIN); + ModAmount->labelsize(10); + ModAmount->maximum(2.0f); + ModAmount->step(0.001); + ModAmount->value(1.0); + ModAmount->callback((Fl_Callback*)cb_ModAmount); + + PulseWidth = new Fl_Slider(60, 20, 20, 70, "PW"); + PulseWidth->type(4); + PulseWidth->selection_color(GUI_COLOUR); + PulseWidth->labelsize(10); + PulseWidth->maximum(1); + PulseWidth->step(0.01); + PulseWidth->value(0.5); + PulseWidth->callback((Fl_Callback*)cb_PulseWidth); + + SHLen = new Fl_Slider(80, 20, 20, 70, "SH"); + SHLen->type(4); + SHLen->selection_color(GUI_COLOUR); + SHLen->labelsize(10); + SHLen->maximum(0.2); + SHLen->step(0.001); + SHLen->value(0.1); + SHLen->callback((Fl_Callback*)cb_SHLen); + + m_pop = new Fl_Button(1,h-14, 13, 13, "@>"); + m_pop->type(1); + m_pop->box(FL_FLAT_BOX); + m_pop->down_box(FL_FLAT_BOX); + m_pop->labeltype(FL_SYMBOL_LABEL); + m_pop->labelsize(10); + m_pop->labelcolor(25); + m_pop->callback((Fl_Callback*)cb_pop); + + m_out_freq = new Fl_Output(65,h+5, 58, 15, "Frequency"); + m_out_freq->box(FL_ENGRAVED_BOX); + m_out_freq->color(16); + m_out_freq->labelsize(10); + m_out_freq->textsize(10); + m_out_freq->hide(); + m_out_freq->set_output(); + + m_out_mod = new Fl_Output(65,h+22, 48, 15, "Modulation"); + m_out_mod->box(FL_ENGRAVED_BOX); + m_out_mod->color(16); + m_out_mod->labelsize(10); + m_out_mod->textsize(10); + m_out_mod->hide(); + m_out_mod->set_output(); + + m_out_pulseW = new Fl_Output(190,h+5, 48, 15, "Pulse width"); + m_out_pulseW->box(FL_ENGRAVED_BOX); + m_out_pulseW->color(16); + m_out_pulseW->labelsize(10); + m_out_pulseW->textsize(10); + m_out_pulseW->hide(); + m_out_pulseW->set_output(); + + m_out_SHlen = new Fl_Output(190,h+22, 48, 15, "Sampling"); + m_out_SHlen->box(FL_ENGRAVED_BOX); + m_out_SHlen->color(16); + m_out_SHlen->labelsize(10); + m_out_SHlen->textsize(10); + m_out_SHlen->hide(); + m_out_SHlen->set_output(); + + end(); +} + +extern "C" int sprintf(char *,const char *,...); + +void OscillatorPluginGUI::UpdateValues() +{ + ShapeSquare->value(0); + ShapeNoise->value(0); + ShapeSaw->value(0); + + switch (m_Plugin->GetType()) + { + case OscillatorPlugin::SQUARE : ShapeSquare->value(1); break; + case OscillatorPlugin::NOISE : ShapeNoise->value(1); break; + case OscillatorPlugin::SAW : ShapeSaw->value(1); break; + case OscillatorPlugin::NONE : break; + } + + Freq->value(m_Plugin->GetOctave()+3); + ModAmount->value(m_Plugin->GetModAmount()); + FineTune->value(sqrt(m_Plugin->GetFineFreq())); + PulseWidth->value(m_Plugin->GetPulseWidth()); + + SHLen->value(0.2f-m_Plugin->GetSHLen()); + + char str[10]; + float fr = 110.0f * m_Plugin->GetFineFreq(); + int oc = m_Plugin->GetOctave(); + if (oc > 0) fr *= 1 << oc; + if (oc < 0) fr /= 1 << (-oc); + sprintf(str,"%4.1f Hz", fr); + m_out_freq->value(str); + sprintf(str,"%4.0f %%", 100*m_Plugin->GetPulseWidth()); + m_out_pulseW->value(str); + sprintf(str,"%4.0f %%", 100*m_Plugin->GetModAmount()); + m_out_mod->value(str); + sprintf(str,"%4.3f s", m_Plugin->GetSHLen()); + m_out_SHlen->value(str); +} + + +//// Callbacks //// + +inline void OscillatorPluginGUI::cb_Freq_i(Fl_Knob* o, void* v) +{ +char str[10]; + m_Plugin->SetOctave((int)o->value()-3); + float fr = 110.0f * m_Plugin->GetFineFreq(); + int oc = m_Plugin->GetOctave(); + if (oc > 0) fr *= 1 << oc; + if (oc < 0) fr /= 1 << (-oc); + sprintf(str,"%4.1f Hz", fr); + m_out_freq->value(str); +} + +void OscillatorPluginGUI::cb_Freq(Fl_Knob* o, void* v) +{ ((OscillatorPluginGUI*)(o->parent()))->cb_Freq_i(o,v); } + +inline void OscillatorPluginGUI::cb_FineTune_i(Fl_Knob* o, void* v) +{ +char str[10]; + m_Plugin->SetFineFreq(o->value()*o->value()); + float fr = 110.0f * m_Plugin->GetFineFreq(); + int oc = m_Plugin->GetOctave(); + if (oc > 0) fr *= 1 << oc; + if (oc < 0) fr /= 1 << (-oc); + sprintf(str,"%4.1f Hz", fr); + m_out_freq->value(str); +} + +void OscillatorPluginGUI::cb_FineTune(Fl_Knob* o, void* v) +{ ((OscillatorPluginGUI*)(o->parent()))->cb_FineTune_i(o,v); } + +inline void OscillatorPluginGUI::cb_PulseWidth_i(Fl_Slider* o, void* v) +{ +char str[10]; + m_Plugin->SetPulseWidth(o->value()); + sprintf(str,"%4.0f %%", 100*o->value()); + m_out_pulseW->value(str); +} + +void OscillatorPluginGUI::cb_PulseWidth(Fl_Slider* o, void* v) +{ ((OscillatorPluginGUI*)(o->parent()))->cb_PulseWidth_i(o,v);} + +inline void OscillatorPluginGUI::cb_Square_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(OscillatorPlugin::SQUARE); } +void OscillatorPluginGUI::cb_Square(Fl_Check_Button* o, void* v) +{ ((OscillatorPluginGUI*)(o->parent()))->cb_Square_i(o,v); } + +inline void OscillatorPluginGUI::cb_Saw_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(OscillatorPlugin::SAW); } +void OscillatorPluginGUI::cb_Saw(Fl_Check_Button* o, void* v) +{ ((OscillatorPluginGUI*)(o->parent()))->cb_Saw_i(o,v); } + +inline void OscillatorPluginGUI::cb_Noise_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(OscillatorPlugin::NOISE); } +void OscillatorPluginGUI::cb_Noise(Fl_Check_Button* o, void* v) +{ ((OscillatorPluginGUI*)(o->parent()))->cb_Noise_i(o,v); } + +inline void OscillatorPluginGUI::cb_SHLen_i(Fl_Slider* o, void* v) +{ +char str[10]; + m_Plugin->SetSHLen(0.2f-o->value()); + sprintf(str,"%4.3f s", 0.2f-o->value()); + m_out_SHlen->value(str); +} + +void OscillatorPluginGUI::cb_SHLen(Fl_Slider* o, void* v) +{ ((OscillatorPluginGUI*)(o->parent()))->cb_SHLen_i(o,v); } + +inline void OscillatorPluginGUI::cb_ModAmount_i(Fl_Knob* o, void* v) +{ +char str[10]; + m_Plugin->SetModAmount(o->value()); + sprintf(str,"%4.0f %%", 100*o->value()); + m_out_mod->value(str); +} + +void OscillatorPluginGUI::cb_ModAmount(Fl_Knob* o, void* v) +{ ((OscillatorPluginGUI*)(o->parent()))->cb_ModAmount_i(o,v); } + +inline void OscillatorPluginGUI::cb_pop_i(Fl_Button *o, void*) { + if (o->value()) + { + o->label("@2>"); + m_out_freq->show(); + m_out_mod->show(); + m_out_SHlen->show(); + m_out_pulseW->show(); + redraw(); + } + else + { + o->label("@>"); + m_out_freq->hide(); + m_out_mod->hide(); + m_out_SHlen->hide(); + m_out_pulseW->hide(); + redraw(); + parent()->redraw(); + } +} +void OscillatorPluginGUI::cb_pop(Fl_Button* o, void* v) { + ((OscillatorPluginGUI*)(o->parent()))->cb_pop_i(o,v); +} + diff --git a/SpiralSound/Plugins/OscillatorPlugin/OscillatorPluginGUI.h b/SpiralSound/Plugins/OscillatorPlugin/OscillatorPluginGUI.h new file mode 100644 index 0000000..671252e --- /dev/null +++ b/SpiralSound/Plugins/OscillatorPlugin/OscillatorPluginGUI.h @@ -0,0 +1,83 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../SpiralPluginGUI.h" +#include "OscillatorPlugin.h" + +#ifndef SCOPEGUI +#define SCOPEGUI + +class OscillatorPluginGUI : public SpiralPluginGUI +{ +public: + OscillatorPluginGUI(int w, int h, OscillatorPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + OscillatorPlugin *m_Plugin; + +private: + + Fl_Check_Button *ShapeSquare; + Fl_Pixmap pixmap_Square; + Fl_Check_Button *ShapeNoise; + Fl_Pixmap pixmap_Noise; + Fl_Check_Button *ShapeSaw; + Fl_Pixmap pixmap_Saw; + Fl_Knob *Freq; + Fl_Knob *ModAmount; + Fl_Knob *FineTune; + Fl_Slider *PulseWidth; + Fl_Slider *SHLen; + Fl_Button *m_pop; + Fl_Output *m_out_freq; + Fl_Output *m_out_mod; + Fl_Output *m_out_pulseW; + Fl_Output *m_out_SHlen; + + //// Callbacks //// + inline void cb_Freq_i(Fl_Knob* o, void* v); + static void cb_Freq(Fl_Knob*, void*); + inline void cb_FineTune_i(Fl_Knob* o, void* v); + static void cb_FineTune(Fl_Knob* o, void* v); + inline void cb_ModAmount_i(Fl_Knob* o, void* v); + static void cb_ModAmount(Fl_Knob* o, void* v); + inline void cb_PulseWidth_i(Fl_Slider* o, void* v); + static void cb_PulseWidth(Fl_Slider* o, void* v); + inline void cb_SHLen_i(Fl_Slider* o, void* v); + static void cb_SHLen(Fl_Slider* o, void* v); + inline void cb_Square_i(Fl_Check_Button* o, void* v); + static void cb_Square(Fl_Check_Button*, void*); + inline void cb_Saw_i(Fl_Check_Button* o, void* v); + static void cb_Saw(Fl_Check_Button*, void*); + inline void cb_Noise_i(Fl_Check_Button* o, void* v); + static void cb_Noise(Fl_Check_Button* o, void* v); + inline void cb_pop_i(Fl_Button* o, void*); + static void cb_pop(Fl_Button* o, void*); +}; + +#endif diff --git a/SpiralSound/Plugins/OscillatorPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/OscillatorPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..a7da419 --- /dev/null +++ b/SpiralSound/Plugins/OscillatorPlugin/SpiralIcon.xpm @@ -0,0 +1,342 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 303 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #D3D3D3", +"R c #C1BEC9", +"S c #474060", +"T c #31294D", +"U c #716C85", +"V c #65607A", +"W c #625D78", +"X c #D5D4DB", +"Y c #F7F7F7", +"Z c #8B8B8B", +"` c #161616", +" . c #0C0C0C", +".. c #060606", +"+. c #393643", +"@. c #47415F", +"#. c #9692A4", +"$. c #D9D8DE", +"%. c #F7F7F8", +"&. c #918DA0", +"*. c #B8B5C1", +"=. c #D1D1D1", +"-. c #252525", +";. c #727175", +">. c #FEFEFF", +",. c #9D99AA", +"'. c #DBD9E0", +"). c #E9E9E9", +"!. c #CBCBCB", +"~. c #E0E0E0", +"{. c #6C6C6C", +"]. c #1C1E00", +"^. c #898F00", +"/. c #414400", +"(. c #515151", +"_. c #A6A6A7", +":. c #827E93", +"<. c #615C77", +"[. c #EAEAED", +"}. c #DFDFE1", +"|. c #E1EA00", +"1. c #F6FF00", +"2. c #F4FD00", +"3. c #F5FE00", +"4. c #2E3000", +"5. c #1E1D24", +"6. c #9894A7", +"7. c #B1AEBB", +"8. c #69686F", +"9. c #000001", +"0. c #A2A800", +"a. c #EFF800", +"b. c #DAE300", +"c. c #615C76", +"d. c #5F5A75", +"e. c #413E4D", +"f. c #020203", +"g. c #919700", +"h. c #E5EE00", +"i. c #1A1A1C", +"j. c #C3C1CB", +"k. c #9D9D9D", +"l. c #202020", +"m. c #383838", +"n. c #4C4C4C", +"o. c #F0F900", +"p. c #E9F200", +"q. c #D9E100", +"r. c #EAF300", +"s. c #5C6000", +"t. c #111112", +"u. c #C9C7D0", +"v. c #F1F1F1", +"w. c #F8F8F8", +"x. c #232323", +"y. c #CED600", +"z. c #797E00", +"A. c #929800", +"B. c #F3FC00", +"C. c #999F00", +"D. c #7B8000", +"E. c #050408", +"F. c #AEACB9", +"G. c #FEFEFE", +"H. c #1D1D1D", +"I. c #181900", +"J. c #939900", +"K. c #F1FA00", +"L. c #E6EF00", +"M. c #B7B5C1", +"N. c #9390A2", +"O. c #BBBBBB", +"P. c #414141", +"Q. c #030303", +"R. c #333500", +"S. c #656900", +"T. c #28272A", +"U. c #F4F4F6", +"V. c #605B76", +"W. c #736E86", +"X. c #D8D8D8", +"Y. c #727272", +"Z. c #101010", +"`. c #ECF500", +" + c #848486", +".+ c #CCCBD3", +"++ c #747087", +"@+ c #6D6881", +"#+ c #1C1C1C", +"$+ c #242424", +"%+ c #8E9400", +"&+ c #E8F100", +"*+ c #323400", +"=+ c #656566", +"-+ c #F6F6F6", +";+ c #E8E6EA", +">+ c #706B84", +",+ c #E3E1E6", +"'+ c #474746", +")+ c #151515", +"!+ c #C8C8C8", +"~+ c #AEAEAE", +"{+ c #080808", +"]+ c #373639", +"^+ c #FDFCFE", +"/+ c #ABA8B7", +"(+ c #F1F0F3", +"_+ c #6D6980", +":+ c #0A090E", +"<+ c #95929E", +"[+ c #0A0810", +"}+ c #050505", +"|+ c #5B5A5C", +"1+ c #F7F6F7", +"2+ c #F4F3F5", +"3+ c #908C9F", +"4+ c #C8C6D0", +"5+ c #837E96", +"6+ c #86868A", +"7+ c #070608", +"8+ c #ECEBEE", +"9+ c #5B5571", +"0+ c #646078", +"a+ c #AFAFB0", +"b+ c #454545", +"c+ c #363636", +"d+ c #7A7A7A", +"e+ c #C8C8C9", +"f+ c #212025", +"g+ c #060607", +"h+ c #969699", +"i+ c #FAFAFA", +"j+ c #F8F8F9", +"k+ c #A29EAF", +"l+ c #F7F6F8", +"m+ c #F0F0F1", +"n+ c #B8B7B9", +"o+ c #E4E4E4", +"p+ c #FDFDFD", +"q+ c #A5A2B2", +"r+ c #3B3456", +"s+ c #A8A5B4", +"t+ c #525252", +"u+ c #848387", +"v+ c #CDCDCD", +"w+ c #8D899C", +"x+ c #494262", +"y+ c #68627C", +"z+ c #40395A", +"A+ c #ECECEC", +"B+ c #020202", +"C+ c #B4B5B5", +"D+ c #0B0B0B", +"E+ c #313232", +"F+ c #E3E3E3", +"G+ c #B1AEBC", +"H+ c #BDBBC6", +"I+ c #3C3556", +"J+ c #898599", +"K+ c #EDEDED", +"L+ c #39393A", +"M+ c #040404", +"N+ c #333333", +"O+ c #F5F5F5", +"P+ c #2B2B2B", +"Q+ c #2D2A3D", +"R+ c #B6B4C1", +"S+ c #F5F5F6", +"T+ c #605A76", +"U+ c #DAD8DF", +"V+ c #F5F4F6", +"W+ c #615B76", +"X+ c #524D6A", +"Y+ c #E4E3E8", +"Z+ c #D5D5D5", +"`+ c #1B1B1B", +" @ c #303030", +".@ c #AAABAB", +"+@ c #585464", +"@@ c #B0AEBB", +"#@ c #A29FAF", +"$@ c #E9E8E9", +"%@ c #787779", +"&@ c #0F0E15", +"*@ c #2D2D2E", +"=@ c #595959", +"-@ c #FAFAFB", +";@ c #807B92", +">@ c #B0ADBB", +",@ c #E8E7EB", +"'@ c #3A3258", +")@ c #E6E5EA", +"!@ c #DFDEE3", +"~@ c #443E5E", +"{@ c #BAB8C4", +"]@ c #C1BFCA", +"^@ c #E0E0E5", +"/@ c #D0CED6", +"(@ c #362F52", +"_@ c #CECCD5", +":@ c #413A5B", +"<@ c #6A657F", +"[@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 6 6 M Q R S T U V ", +" W X ; ; ; ; Y Z ` 6 .6 6 6 6 6 6 6 6 ..+.@.#.$.%.&. ", +" *.; ; ; ; ; ; = =.-.6 6 6 6 6 6 6 6 6 6 E ;.>.; ; ,. ", +" '.; ; ).Q h !.~.{.6 6 6 ].^./.6 6 6 6 6 6 E (._.4 :. ", +" <.[.; }. .6 6 6 6 6 6 6 |.1.2.3.4.6 6 6 6 6 6 6 5.6. ", +" U @ 7.8.9.6 6 6 6 6 6 ].1.0.6 a.b.6 6 6 6 6 6 6 ", +" c.d.e.6 f.6 6 6 6 6 g.3.6 6 h.h.6 6 6 6 6 6 6 i. ", +" j.; ; k.l.l.m.n.l.6 4.o.p.6 6 q.r.6 6 6 s./.6 6 t. ", +" u.; ; v.w.; ; ; x.6 y.o.z.6 6 A.B.6 6 C.1.D.6 6 E. ", +" F.; ; ; ; G.; ; H.6 I.I.6 6 6 J.1.6 6 K.L.6 6 6 6 M., ", +" N.; ; G.; : O.P.Q.6 6 6 6 6 6 ].3.R.S.3./.6 6 6 T.G.U.V. ", +" W.; ; ; X.Y.Z.6 6 6 6 6 6 6 6 6 3.`.2.a.6 6 6 6 +; ; .+++ ", +" @+J ; : #+6 6 6 6 $+ .6 6 6 6 6 %+`.&+*+6 6 6 6 =+-+; ; ;+>+ ", +" ,+; ; '+6 E 6 )+!+~+{+6 6 6 6 6 6 6 6 6 6 6 6 6 ]+^+; ; > >+ ", +" /+; (+_+:+6 6 ~+G.; <+[+6 6 6 6 6 6 6 6 m }+6 6 6 |+1+; ; 2+3+ ", +" >+4+! 5+6+7+x ; ; 8+9+0+a+l b+6 6 6 c+d+e+f+6 6 6 g+h+i+; ; j+@ ", +" k+l+m+n+o+p+; q+r+s+; -+b+6 6 E t+; ; u+6 6 E 6 o v+; ; = w+ ", +" x+> ; ; ; ; ; ; y+z+; ; A+m.6 6 B+D ; ; C+D+6 6 6 E+F+; ; G+ ", +" > ; ; ; ; H+I+J+; ; K+L+6 6 M+N+; ; O+P+6 6 Q+R+; S+3 ", +" T+U+= ; V+W+X+Y+; ; Z+`+6 6 B+ @; ; ; .@t++@ ", +" @@4 #@ W ; ; ; $@%@ @&@*@=@; ; ; G.-@;@ ", +" >@; ; ; ; ; ,@'@)@; ; ; ; = !@~@ ", +" {@]@^@4 ; ; /@(@_@; ; ; s J+S ", +" :@ <@[@J+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/OutputPlugin/Makefile.in b/SpiralSound/Plugins/OutputPlugin/Makefile.in new file mode 100644 index 0000000..fba73f0 --- /dev/null +++ b/SpiralSound/Plugins/OutputPlugin/Makefile.in @@ -0,0 +1,178 @@ +############################################################################# +# Makefile for building OutputPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: OutputPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../RiffWav.h \ + OutputPlugin.h \ + OutputPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + OutputPlugin.C \ + OutputPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + ../../RiffWav.o \ + OutputPlugin.o \ + OutputPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = OutputPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake OutputPlugin.pro + +dist: + $(TAR) OutputPlugin.tar OutputPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) OutputPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +../../RiffWav.o: ../../RiffWav.C \ + ../../RiffWav.h \ + ../../Sample.h \ + ../../SpiralInfo.h + +OutputPlugin.o: OutputPlugin.C \ + OutputPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../../RiffWav.h \ + OutputPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +OutputPluginGUI.o: OutputPluginGUI.C \ + OutputPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + OutputPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../../RiffWav.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/OutputPlugin/OutputPlugin.C b/SpiralSound/Plugins/OutputPlugin/OutputPlugin.C new file mode 100644 index 0000000..ac908a0 --- /dev/null +++ b/SpiralSound/Plugins/OutputPlugin/OutputPlugin.C @@ -0,0 +1,477 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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. +*/ + +// for lrintf() +#define _ISOC9X_SOURCE 1 +#define _ISOC99_SOURCE 1 +#include + +#include +#include +#include +#include +#include +#if defined (__FreeBSD__) + #include +#else +#if defined (__NetBSD__) || defined (__OpenBSD__) + #include /* OSS emulation */ +#undef ioctl +#else /* BSDI, Linux, Solaris */ + #include +#endif /* __NetBSD__ or __OpenBSD__ */ +#endif /* __FreeBSD__ */ +#include +#include + +#include "OutputPlugin.h" +#include "OutputPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +static const int IN_FREQ = 0; +static const int IN_PW = 1; +static const int IN_SHLEN = 2; + +static const int OUT_MAIN = 0; + +static const HostInfo* host; +OSSOutput* OSSOutput::m_Singleton = NULL; +int OutputPlugin::m_RefCount=0; +int OutputPlugin::m_NoExecuted=0; + + +#define CHECK_AND_REPORT_ERROR if (result<0) \ + { \ + perror("Sound device did not accept settings"); \ + m_OutputOk=false; \ + return; \ + } + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new OutputPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0000; +} +} + +/////////////////////////////////////////////////////// + +OutputPlugin::OutputPlugin() +{ + m_RefCount++; + + m_PluginInfo.Name="OSS"; + m_PluginInfo.Width=100; + m_PluginInfo.Height=130; + m_PluginInfo.NumInputs=3; + m_PluginInfo.NumOutputs=2; + m_PluginInfo.PortTips.push_back("Left Out"); + m_PluginInfo.PortTips.push_back("Right Out"); + m_PluginInfo.PortTips.push_back("Record Controller"); + m_PluginInfo.PortTips.push_back("Left In"); + m_PluginInfo.PortTips.push_back("Right In"); + + m_Mode=OUTPUT; +} + +OutputPlugin::~OutputPlugin() +{ + m_RefCount--; + if (m_RefCount==0) + { + OSSOutput::PackUpAndGoHome(); + } +} + +PluginInfo &OutputPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info= SpiralPlugin::Initialise(Host); + host=Host; + OSSOutput::Get()->AllocateBuffer(); + return Info; +} + +SpiralGUIType *OutputPlugin::CreateGUI() +{ + m_GUI = new OutputPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void OutputPlugin::Execute() +{ + // Only Play() once per set of plugins + m_NoExecuted++; + if (m_NoExecuted==m_RefCount) + { + if (m_Mode==INPUT || m_Mode==DUPLEX) OSSOutput::Get()->Read(); + if (m_Mode==OUTPUT || m_Mode==DUPLEX) OSSOutput::Get()->Play(); + m_NoExecuted=0; + } + + if (m_Mode==OUTPUT || m_Mode==DUPLEX) + { + OSSOutput::Get()->SendStereo(GetInput(0),GetInput(1)); + for (int n=0; nBUFSIZE;n++) + { + if (GetInput(2,n)!=0) + { + if (! m_CheckedAlready) + { + m_CheckedAlready=true; +// an experimental line, should *theoretically* cut down on CPU time. + n=m_HostInfo->BUFSIZE; + if (! m_Recmode) + { + char *fn=fl_file_chooser("Pick a Wav file to save to", "*.wav", NULL); + if (fn && fn!="") + { + OSSOutput::Get()->WavOpen(fn); + } + m_Recmode=true; + } + else + { + OSSOutput::Get()->WavClose(); + m_Recmode=false; + } + + } + } + else + m_CheckedAlready=false; + } + } + + if (m_Mode==INPUT || m_Mode==DUPLEX) OSSOutput::Get()->GetStereo(GetOutputBuf(0),GetOutputBuf(1)); +} + +////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////// + +OSSOutput::OSSOutput() : +m_Amp(0.5), +m_Channels(2), +m_ReadBufferNum(0), +m_WriteBufferNum(0), +m_OutputOk(true) +{ + m_Buffer[0]=NULL; + m_Buffer[1]=NULL; + m_InBuffer[0]=NULL; + m_InBuffer[1]=NULL; + + OpenWrite(); +} + +////////////////////////////////////////////////////////////////////// + +OSSOutput::~OSSOutput() +{ + Close(); +} + +////////////////////////////////////////////////////////////////////// + +void OSSOutput::AllocateBuffer() +{ + if (m_Buffer[0]==NULL) + { + m_BufSizeBytes=host->BUFSIZE*m_Channels*2; + + // initialise for stereo + m_Buffer[0] = (short*) calloc(m_BufSizeBytes/2,m_BufSizeBytes); + m_Buffer[1] = (short*) calloc(m_BufSizeBytes/2,m_BufSizeBytes); + m_InBuffer[0] = (short*) calloc(m_BufSizeBytes/2,m_BufSizeBytes); + m_InBuffer[1] = (short*) calloc(m_BufSizeBytes/2,m_BufSizeBytes); + } + + m_Wav.SetSamplerate(host->SAMPLERATE); +} + +////////////////////////////////////////////////////////////////////// + +void OSSOutput::SendStereo(const Sample *ldata,const Sample *rdata) +{ + if (m_Channels!=2) return; + + int on=0; + float t; + for (int n=0; nBUFSIZE; n++) + { + // stereo channels - interleave + if (ldata) + { + t=(*ldata)[n]*m_Amp; + if (t>1) t=1; + if (t<-1) t=-1; + m_Buffer[m_WriteBufferNum][on]+=lrintf(t*SHRT_MAX); + } + on++; + + if (rdata) + { + t=(*rdata)[n]*m_Amp; + if (t>1) t=1; + if (t<-1) t=-1; + m_Buffer[m_WriteBufferNum][on]+=lrintf(t*SHRT_MAX); + } + on++; + } +} + +////////////////////////////////////////////////////////////////////// + +void OSSOutput::Play() +{ + int BufferToSend=!m_WriteBufferNum; + + #if __BYTE_ORDER == BIG_ENDIAN + for (int n=0; nBUFSIZE*m_Channels; n++) + { + m_Buffer[BufferToSend][n]=(short)((m_Buffer[BufferToSend][n]<<8)&0xff00)| + ((m_Buffer[BufferToSend][n]>>8)&0xff); + } + #endif + + if (m_OutputOk) + write(m_Dspfd,m_Buffer[BufferToSend],m_BufSizeBytes); + + if(m_Wav.Recording()) + { + m_Wav.Save(m_Buffer[BufferToSend],m_BufSizeBytes); + } + + memset(m_Buffer[BufferToSend],0,m_BufSizeBytes); + m_WriteBufferNum=BufferToSend; +} + +////////////////////////////////////////////////////////////////////// + +void OSSOutput::GetStereo(Sample *ldata,Sample *rdata) +{ + if (m_Channels!=2) return; + + int on=0; + for (int n=0; nBUFSIZE; n++) + { + // stereo channels - interleave + if (ldata) ldata->Set(n,(m_InBuffer[m_ReadBufferNum][on]*m_Amp)/(float)SHRT_MAX); + on++; + if (rdata) rdata->Set(n,(m_InBuffer[m_ReadBufferNum][on]*m_Amp)/(float)SHRT_MAX); + on++; + } +} + +////////////////////////////////////////////////////////////////////// + +void OSSOutput::Read() +{ + int BufferToRead=!m_ReadBufferNum; + + if (m_OutputOk) + read(m_Dspfd,m_InBuffer[BufferToRead],m_BufSizeBytes); + + #if __BYTE_ORDER == BIG_ENDIAN + for (int n=0; nBUFSIZE*m_Channels; n++) + { + m_InBuffer[BufferToRead][n]=(short)((m_InBuffer[BufferToRead][n]<<8)&0xff00)| + ((m_InBuffer[BufferToRead][n]>>8)&0xff); + } + #endif + + m_ReadBufferNum=BufferToRead; +} + +////////////////////////////////////////////////////////////////////// + +void OSSOutput::Close() +{ + cerr<<"Closing dsp output"<OUTPUTFILE.c_str(),O_WRONLY); + if(m_Dspfd<0) + { + fprintf(stderr,"Can't open audio driver for writing.\n"); + m_OutputOk=false; + return; + } + + result = ioctl(m_Dspfd,SNDCTL_DSP_RESET,NULL); + + CHECK_AND_REPORT_ERROR; + + short fgmtsize=0; + int numfgmts=host->FRAGCOUNT; + if (host->FRAGCOUNT==-1) numfgmts=0x7fff; + + for (int i=0; i<32; i++) + { + if ((host->FRAGSIZE)==(1<FRAGSIZE<<"] must be power of two!"<SAMPLERATE; + result = ioctl(m_Dspfd,SNDCTL_DSP_SPEED,&val); + CHECK_AND_REPORT_ERROR; +} + +////////////////////////////////////////////////////////////////////// + +void OSSOutput::OpenRead() +{ + int result,val; + + cerr<<"Opening dsp input"<OUTPUTFILE.c_str(),O_RDONLY); + if(m_Dspfd<0) + { + fprintf(stderr,"Can't open audio driver for reading.\n"); + m_OutputOk=false; + return; + } + + result = ioctl(m_Dspfd,SNDCTL_DSP_RESET,NULL); + CHECK_AND_REPORT_ERROR; + + val = 1; + result = ioctl(m_Dspfd, SOUND_PCM_READ_CHANNELS, &val); + CHECK_AND_REPORT_ERROR; + + val = AFMT_S16_LE; + result = ioctl(m_Dspfd,SNDCTL_DSP_SETFMT,&val); + CHECK_AND_REPORT_ERROR; + + val = host->SAMPLERATE; + result = ioctl(m_Dspfd,SNDCTL_DSP_SPEED,&val); + CHECK_AND_REPORT_ERROR; +} + +////////////////////////////////////////////////////////////////////// + +void OSSOutput::OpenReadWrite() +{ + int result,val; + cerr<<"Opening dsp output (duplex)"<OUTPUTFILE.c_str(),O_RDWR); + if(m_Dspfd<0) + { + fprintf(stderr,"Can't open audio driver for writing.\n"); + m_OutputOk=false; + return; + } + + result = ioctl(m_Dspfd,SNDCTL_DSP_RESET,NULL); + + CHECK_AND_REPORT_ERROR; + + short fgmtsize=0; + int numfgmts=host->FRAGCOUNT; + if (host->FRAGCOUNT==-1) numfgmts=0x7fff; + + for (int i=0; i<32; i++) + { + if ((host->FRAGSIZE)==(1<FRAGSIZE<<"] must be power of two!"<SAMPLERATE; + result = ioctl(m_Dspfd,SNDCTL_DSP_SPEED,&val); + CHECK_AND_REPORT_ERROR; +} + + + diff --git a/SpiralSound/Plugins/OutputPlugin/OutputPlugin.h b/SpiralSound/Plugins/OutputPlugin/OutputPlugin.h new file mode 100644 index 0000000..bab0d21 --- /dev/null +++ b/SpiralSound/Plugins/OutputPlugin/OutputPlugin.h @@ -0,0 +1,95 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include "../../RiffWav.h" +#include + +#ifndef OscillatorPLUGIN +#define OscillatorPLUGIN + +class OSSOutput +{ +public: + static OSSOutput *Get() { if(!m_Singleton) m_Singleton=new OSSOutput; return m_Singleton; } + static void PackUpAndGoHome() { if(m_Singleton) { delete m_Singleton; m_Singleton=NULL; } } + ~OSSOutput(); + + void AllocateBuffer(); + void SendStereo(const Sample *ldata,const Sample *rdata); + void GetStereo(Sample *ldata,Sample *rdata); + void SetVolume(float s) {m_Amp=s;} + void SetNumChannels(int s) {m_Channels=s;} + float GetVolume() {return m_Amp;} + void Play(); + void Read(); + void WavOpen(char* name) {m_Wav.Open(name,WavFile::WRITE, WavFile::STEREO);} + void WavClose() {m_Wav.Close();} + short *GetBuffer() {return m_Buffer[m_WriteBufferNum];} + + void OpenReadWrite(); + void OpenWrite(); + void OpenRead(); + void Close(); + +private: + static OSSOutput* m_Singleton; + + OSSOutput(); + + short *m_Buffer[2]; + short *m_InBuffer[2]; + int m_BufSizeBytes; + int m_Dspfd; + float m_Amp; + int m_Channels; + WavFile m_Wav; + int m_ReadBufferNum; + int m_WriteBufferNum; + bool m_OutputOk; +}; + + +class OutputPlugin : public SpiralPlugin +{ +public: + enum Mode{INPUT,OUTPUT,DUPLEX}; + + OutputPlugin(); + virtual ~OutputPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s) {} + virtual void StreamIn(istream &s) {} + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetMode(Mode s) { m_Mode=s; } + +private: + static int m_RefCount; + static int m_NoExecuted; + Mode m_Mode; + bool m_CheckedAlready; + bool m_Recmode; +}; + +#endif diff --git a/SpiralSound/Plugins/OutputPlugin/OutputPlugin.pro b/SpiralSound/Plugins/OutputPlugin/OutputPlugin.pro new file mode 100644 index 0000000..2447ae4 --- /dev/null +++ b/SpiralSound/Plugins/OutputPlugin/OutputPlugin.pro @@ -0,0 +1,19 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../RiffWav.h \ + OutputPlugin.h \ + OutputPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + OutputPlugin.C \ + OutputPluginGUI.C + +TARGET = OutputPlugin.so diff --git a/SpiralSound/Plugins/OutputPlugin/OutputPluginGUI.C b/SpiralSound/Plugins/OutputPlugin/OutputPluginGUI.C new file mode 100644 index 0000000..46f56d4 --- /dev/null +++ b/SpiralSound/Plugins/OutputPlugin/OutputPluginGUI.C @@ -0,0 +1,156 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "OutputPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +OutputPluginGUI::OutputPluginGUI(int w, int h,OutputPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + Volume = new Fl_Knob(30, 22, 40, 40, "Volume"); + Volume->color(GUI_COLOUR); + Volume->type(Fl_Knob::DOTLIN); + Volume->labelsize(10); + Volume->maximum(1); + Volume->step(0.001); + Volume->value(0.5); + Volume->callback((Fl_Callback*)cb_Volume); + + Record = new Fl_Button(30, 80, 40, 25, "Record"); + Record->type(1); + Record->down_box(FL_DOWN_BOX); + Record->labelsize(10); + Record->callback((Fl_Callback*)cb_Record); + + OpenRead = new Fl_Button(2, 110, 30, 15, "Read"); + OpenRead->type(1); + OpenRead->down_box(FL_DOWN_BOX); + OpenRead->labelsize(10); + OpenRead->callback((Fl_Callback*)cb_OpenRead); + + OpenDuplex = new Fl_Button(34, 110, 31, 15, "Dplx"); + OpenDuplex->type(1); + OpenDuplex->down_box(FL_DOWN_BOX); + OpenDuplex->labelsize(10); + OpenDuplex->callback((Fl_Callback*)cb_OpenDuplex); + + OpenWrite = new Fl_Button(68, 110, 30, 15, "Write"); + OpenWrite->type(1); + OpenWrite->down_box(FL_DOWN_BOX); + OpenWrite->labelsize(10); + OpenWrite->callback((Fl_Callback*)cb_OpenWrite); + + end(); +} + +void OutputPluginGUI::UpdateValues() +{ + Volume->value(OSSOutput::Get()->GetVolume()); +} + +//// Callbacks //// + +inline void OutputPluginGUI::cb_Volume_i(Fl_Knob* o, void* v) +{ OSSOutput::Get()->SetVolume(o->value()); } +void OutputPluginGUI::cb_Volume(Fl_Knob* o, void* v) +{ ((OutputPluginGUI*)(o->parent()))->cb_Volume_i(o,v); } + +inline void OutputPluginGUI::cb_Record_i(Fl_Button* o, void* v) +{ + if (o->value()) + { + char *fn=fl_file_chooser("Pick a Wav file to save to", "*.wav", NULL); + + if (fn && fn!="") + { + OSSOutput::Get()->WavOpen(fn); + } + else + { + OSSOutput::Get()->WavClose(); + o->value(false); + } + } + else + { + OSSOutput::Get()->WavClose(); + } +} +void OutputPluginGUI::cb_Record(Fl_Button* o, void* v) +{ ((OutputPluginGUI*)(o->parent()))->cb_Record_i(o,v); } + +inline void OutputPluginGUI::cb_OpenRead_i(Fl_Button* o, void* v) +{ + if (o->value()) + { + OpenWrite->value(0); + OSSOutput::Get()->Close(); + OSSOutput::Get()->OpenRead(); + m_Plugin->SetMode(OutputPlugin::INPUT); + } + else + { + OpenWrite->value(0); + OSSOutput::Get()->Close(); + } +} +void OutputPluginGUI::cb_OpenRead(Fl_Button* o, void* v) +{ ((OutputPluginGUI*)(o->parent()))->cb_OpenRead_i(o,v); } + +inline void OutputPluginGUI::cb_OpenDuplex_i(Fl_Button* o, void* v) +{ + if (o->value()) + { + OpenRead->value(0); + OSSOutput::Get()->Close(); + OSSOutput::Get()->OpenReadWrite(); + m_Plugin->SetMode(OutputPlugin::DUPLEX); + } + else + { + OpenRead->value(0); + OSSOutput::Get()->Close(); + } +} +void OutputPluginGUI::cb_OpenDuplex(Fl_Button* o, void* v) +{ ((OutputPluginGUI*)(o->parent()))->cb_OpenDuplex_i(o,v); } + +inline void OutputPluginGUI::cb_OpenWrite_i(Fl_Button* o, void* v) +{ + if (o->value()) + { + OpenRead->value(0); + OSSOutput::Get()->Close(); + OSSOutput::Get()->OpenWrite(); + m_Plugin->SetMode(OutputPlugin::OUTPUT); + } + else + { + OpenRead->value(0); + OSSOutput::Get()->Close(); + } +} +void OutputPluginGUI::cb_OpenWrite(Fl_Button* o, void* v) +{ ((OutputPluginGUI*)(o->parent()))->cb_OpenWrite_i(o,v); } diff --git a/SpiralSound/Plugins/OutputPlugin/OutputPluginGUI.h b/SpiralSound/Plugins/OutputPlugin/OutputPluginGUI.h new file mode 100644 index 0000000..4c4885f --- /dev/null +++ b/SpiralSound/Plugins/OutputPlugin/OutputPluginGUI.h @@ -0,0 +1,69 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "OutputPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef SCOPEGUI +#define SCOPEGUI + +class OutputPluginGUI : public SpiralPluginGUI +{ +public: + OutputPluginGUI(int w, int h, OutputPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + OutputPlugin *m_Plugin; + +private: + + Fl_Group *GUIMixGroup; + Fl_Knob *Volume; + Fl_Button *Record; + + Fl_Button *OpenRead; + Fl_Button *OpenWrite; + Fl_Button *OpenDuplex; + + //// Callbacks //// + + inline void cb_Volume_i(Fl_Knob* o, void* v); + static void cb_Volume(Fl_Knob*, void*); + inline void cb_Record_i(Fl_Button* o, void* v); + static void cb_Record(Fl_Button* o, void* v); + + inline void cb_OpenRead_i(Fl_Button* o, void* v); + static void cb_OpenRead(Fl_Button* o, void* v); + inline void cb_OpenDuplex_i(Fl_Button* o, void* v); + static void cb_OpenDuplex(Fl_Button* o, void* v); + inline void cb_OpenWrite_i(Fl_Button* o, void* v); + static void cb_OpenWrite(Fl_Button* o, void* v); + +}; + +#endif diff --git a/SpiralSound/Plugins/OutputPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/OutputPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..92bdbef --- /dev/null +++ b/SpiralSound/Plugins/OutputPlugin/SpiralIcon.xpm @@ -0,0 +1,347 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 308 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #1C1E00", +"@. c #EBF400", +"#. c #F3FC00", +"$. c #5C5F03", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #252525", +"). c #2E3000", +"!. c #F0F900", +"~. c #F2FB00", +"{. c #F4FD00", +"]. c #8C9200", +"^. c #727175", +"/. c #FEFEFF", +"(. c #9D99AA", +"_. c #DBD9E0", +":. c #E9E9E9", +"<. c #CBCBCB", +"[. c #E0E0E0", +"}. c #6C6C6C", +"|. c #050600", +"1. c #EDF600", +"2. c #515151", +"3. c #A6A6A7", +"4. c #827E93", +"5. c #615C77", +"6. c #EAEAED", +"7. c #DFDFE1", +"8. c #E3EC00", +"9. c #F1FA00", +"0. c #1E1D24", +"a. c #9894A7", +"b. c #B1AEBB", +"c. c #69686F", +"d. c #000001", +"e. c #0A0A00", +"f. c #C7CF00", +"g. c #606400", +"h. c #A4AB00", +"i. c #615C76", +"j. c #5F5A75", +"k. c #413E4D", +"l. c #020203", +"m. c #F6FF00", +"n. c #8B9100", +"o. c #666A00", +"p. c #DAE200", +"q. c #E5EE00", +"r. c #DDE600", +"s. c #1A1A1C", +"t. c #C3C1CB", +"u. c #9D9D9D", +"v. c #202020", +"w. c #383838", +"x. c #4C4C4C", +"y. c #E1EA00", +"z. c #E0E900", +"A. c #111112", +"B. c #C9C7D0", +"C. c #F1F1F1", +"D. c #F8F8F8", +"E. c #232323", +"F. c #010100", +"G. c #DCE500", +"H. c #050408", +"I. c #AEACB9", +"J. c #FEFEFE", +"K. c #1D1D1D", +"L. c #020200", +"M. c #E1E900", +"N. c #E8F000", +"O. c #B7B5C1", +"P. c #9390A2", +"Q. c #BBBBBB", +"R. c #414141", +"S. c #030303", +"T. c #797E00", +"U. c #F5FE00", +"V. c #3A3D00", +"W. c #28272A", +"X. c #F4F4F6", +"Y. c #605B76", +"Z. c #736E86", +"`. c #D8D8D8", +" + c #727272", +".+ c #101010", +"++ c #757A00", +"@+ c #848486", +"#+ c #CCCBD3", +"$+ c #747087", +"%+ c #6D6881", +"&+ c #1C1C1C", +"*+ c #242424", +"=+ c #B3BA00", +"-+ c #EAF300", +";+ c #656566", +">+ c #F6F6F6", +",+ c #E8E6EA", +"'+ c #706B84", +")+ c #E3E1E6", +"!+ c #474746", +"~+ c #151515", +"{+ c #C8C8C8", +"]+ c #AEAEAE", +"^+ c #080808", +"/+ c #D9E100", +"(+ c #DAE100", +"_+ c #373639", +":+ c #FDFCFE", +"<+ c #ABA8B7", +"[+ c #F1F0F3", +"}+ c #6D6980", +"|+ c #0A090E", +"1+ c #95929E", +"2+ c #0A0810", +"3+ c #515400", +"4+ c #050505", +"5+ c #5B5A5C", +"6+ c #F7F6F7", +"7+ c #F4F3F5", +"8+ c #908C9F", +"9+ c #C8C6D0", +"0+ c #837E96", +"a+ c #86868A", +"b+ c #070608", +"c+ c #ECEBEE", +"d+ c #5B5571", +"e+ c #646078", +"f+ c #AFAFB0", +"g+ c #454545", +"h+ c #333408", +"i+ c #7A7A7A", +"j+ c #C8C8C9", +"k+ c #212025", +"l+ c #060607", +"m+ c #969699", +"n+ c #FAFAFA", +"o+ c #F8F8F9", +"p+ c #A29EAF", +"q+ c #F7F6F8", +"r+ c #F0F0F1", +"s+ c #B8B7B9", +"t+ c #E4E4E4", +"u+ c #FDFDFD", +"v+ c #A5A2B2", +"w+ c #3B3456", +"x+ c #A8A5B4", +"y+ c #525252", +"z+ c #848387", +"A+ c #CDCDCD", +"B+ c #8D899C", +"C+ c #494262", +"D+ c #68627C", +"E+ c #40395A", +"F+ c #ECECEC", +"G+ c #020202", +"H+ c #B4B5B5", +"I+ c #0B0B0B", +"J+ c #313232", +"K+ c #E3E3E3", +"L+ c #B1AEBC", +"M+ c #BDBBC6", +"N+ c #3C3556", +"O+ c #898599", +"P+ c #EDEDED", +"Q+ c #39393A", +"R+ c #040404", +"S+ c #333333", +"T+ c #F5F5F5", +"U+ c #2B2B2B", +"V+ c #2D2A3D", +"W+ c #B6B4C1", +"X+ c #F5F5F6", +"Y+ c #605A76", +"Z+ c #DAD8DF", +"`+ c #F5F4F6", +" @ c #615B76", +".@ c #524D6A", +"+@ c #E4E3E8", +"@@ c #D5D5D5", +"#@ c #1B1B1B", +"$@ c #303030", +"%@ c #AAABAB", +"&@ c #585464", +"*@ c #B0AEBB", +"=@ c #A29FAF", +"-@ c #E9E8E9", +";@ c #787779", +">@ c #0F0E15", +",@ c #2D2D2E", +"'@ c #595959", +")@ c #FAFAFB", +"!@ c #807B92", +"~@ c #B0ADBB", +"{@ c #E8E7EB", +"]@ c #3A3258", +"^@ c #E6E5EA", +"/@ c #DFDEE3", +"(@ c #443E5E", +"_@ c #BAB8C4", +":@ c #C1BFCA", +"<@ c #E0E0E5", +"[@ c #D0CED6", +"}@ c #362F52", +"|@ c #CECCD5", +"1@ c #413A5B", +"2@ c #6A657F", +"3@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.6 6 6 6 6 ).!.~.{.].E ^./.; ; (. ", +" _.; ; :.R h <.[.}.6 6 6 6 6 |.!.1.).{.].6 E 2.3.4 4. ", +" 5.6.; 7...6 6 6 6 6 6 6 6 6 |.8.9.+.6 {.].6 6 6 0.a. ", +" V @ b.c.d.6 6 6 6 6 e.#.{.1.f.{.g.6 6 #.h.6 6 6 ", +" i.j.k.6 l.6 6 6 6 6 m.n.o.p.p.6 6 6 q.r.6 6 6 s. ", +" t.; ; u.v.v.w.x.v.6 6 m.6 6 y.y.6 6 6 z.z.6 6 6 A. ", +" B.; ; C.D.; ; ; E.6 F.m.6 6 G.G.6 6 6 z.z.6 6 6 H. ", +" I.; ; ; ; J.; ; K.6 L.m.m.m.M.N.6 6 6 z.z.6 6 6 6 O., ", +" P.; ; J.; : Q.R.S.6 6 6 6 6 T.U.q.V.6 z.z.6 6 6 W.J.X.Y. ", +" Z.; ; ; `. +.+6 6 6 6 6 6 6 6 T.1.r.++z.z.6 6 6 @+; ; #+$+ ", +" %+J ; : &+6 6 6 6 *+..6 6 6 6 6 6 =+U.-+z.6 6 6 ;+>+; ; ,+'+ ", +" )+; ; !+6 E 6 ~+{+]+^+6 6 6 6 6 6 /+9.(+6 6 6 6 _+:+; ; > '+ ", +" <+; [+}+|+6 6 ]+J.; 1+2+6 6 6 6 6 6 3+T.m 4+6 6 6 5+6+; ; 7+8+ ", +" '+9+! 0+a+b+x ; ; c+d+e+f+l g+6 6 6 h+i+j+k+6 6 6 l+m+n+; ; o+@ ", +" p+q+r+s+t+u+; v+w+x+; >+g+6 6 E y+; ; z+6 6 E 6 o A+; ; = B+ ", +" C+> ; ; ; ; ; ; D+E+; ; F+w.6 6 G+D ; ; H+I+6 6 6 J+K+; ; L+ ", +" > ; ; ; ; M+N+O+; ; P+Q+6 6 R+S+; ; T+U+6 6 V+W+; X+3 ", +" Y+Z+= ; `+ @.@+@; ; @@#@6 6 G+$@; ; ; %@y+&@ ", +" *@4 =@ X ; ; ; -@;@$@>@,@'@; ; ; J.)@!@ ", +" ~@; ; ; ; ; {@]@^@; ; ; ; = /@(@ ", +" _@:@<@4 ; ; [@}@|@; ; ; s O+T ", +" 1@ 2@3@O+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/PoshSamplerPlugin/Makefile.in b/SpiralSound/Plugins/PoshSamplerPlugin/Makefile.in new file mode 100644 index 0000000..6232853 --- /dev/null +++ b/SpiralSound/Plugins/PoshSamplerPlugin/Makefile.in @@ -0,0 +1,176 @@ +############################################################################# +# Makefile for building PoshSamplerPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: PoshSamplerPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ @FLTK_CFLAGS@ +CXXFLAGS= @CXXFLAGS@ @FLTK_CXXFLAGS@ +INCPATH = +LINK = g++ -shared +LFLAGS = +LIBS = @FLTK_LIBS@ -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../RiffWav.h \ + PoshSamplerPlugin.h \ + PoshSamplerPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + PoshSamplerPlugin.C \ + PoshSamplerPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + ../../RiffWav.o \ + PoshSamplerPlugin.o \ + PoshSamplerPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = PoshSamplerPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake PoshSamplerPlugin.pro + +dist: + $(TAR) PoshSamplerPlugin.tar PoshSamplerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) PoshSamplerPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +../../RiffWav.o: ../../RiffWav.C \ + ../../RiffWav.h \ + ../../Sample.h \ + ../../SpiralInfo.h + +PoshSamplerPlugin.o: PoshSamplerPlugin.C \ + PoshSamplerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + PoshSamplerPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + SpiralIcon.xpm \ + ../../RiffWav.h \ + ../../NoteTable.h + +PoshSamplerPluginGUI.o: PoshSamplerPluginGUI.C \ + PoshSamplerPluginGUI.h \ + PoshSamplerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H + diff --git a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C new file mode 100644 index 0000000..bbf29b6 --- /dev/null +++ b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.C @@ -0,0 +1,446 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "PoshSamplerPlugin.h" +#include "PoshSamplerPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../RiffWav.h" +#include "../../NoteTable.h" +#include + +static const int NOTETRIG = NUM_SAMPLES*2+1; +static const int REC_INPUT = 16; + +static const int S1_INPUT = 18; +static const int S2_INPUT = 19; +static const int S3_INPUT = 20; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new PoshSamplerPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 32; +} +} + +/////////////////////////////////////////////////////// + +PoshSamplerPlugin::PoshSamplerPlugin() : +m_Recording(false) +{ + m_PluginInfo.Name="PoshSampler"; + m_PluginInfo.Width=400; + m_PluginInfo.Height=215; + m_PluginInfo.NumInputs=21; + m_PluginInfo.NumOutputs=9; + m_PluginInfo.PortTips.push_back("Sample 1 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 1 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 2 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 2 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 3 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 3 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 4 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 4 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 5 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 5 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 6 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 6 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 7 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 7 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 8 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 8 Trigger"); + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Sample trigger pitch"); + m_PluginInfo.PortTips.push_back("Sample 1 Start Pos"); + m_PluginInfo.PortTips.push_back("Sample 2 Start Pos"); + m_PluginInfo.PortTips.push_back("Sample 3 Start Pos"); + m_PluginInfo.PortTips.push_back("Mixed Output"); + m_PluginInfo.PortTips.push_back("Sample 1 Output"); + m_PluginInfo.PortTips.push_back("Sample 2 Output"); + m_PluginInfo.PortTips.push_back("Sample 3 Output"); + m_PluginInfo.PortTips.push_back("Sample 4 Output"); + m_PluginInfo.PortTips.push_back("Sample 5 Output"); + m_PluginInfo.PortTips.push_back("Sample 6 Output"); + m_PluginInfo.PortTips.push_back("Sample 7 Output"); + m_PluginInfo.PortTips.push_back("Sample 8 Output"); + + for (int n=0; nPathname = temp; + NewDesc->Volume = 1.0f; + NewDesc->Velocity = 1.0f; + NewDesc->Pitch = 1.0f; + NewDesc->PitchMod = 1.0f; + NewDesc->SamplePos = -1; + NewDesc->Loop = false; + NewDesc->PingPong = false; + NewDesc->Note = n; + NewDesc->Octave = 0; + NewDesc->TriggerUp = true; + NewDesc->SamplePos = -1; + NewDesc->SampleRate = 44100; + NewDesc->Stereo = false; + NewDesc->PlayStart = 0; + NewDesc->LoopStart = 0; + NewDesc->LoopEnd = INT_MAX; + + m_SampleDescVec.push_back(NewDesc); + } + + m_Version=3; +} + +PoshSamplerPlugin::~PoshSamplerPlugin() +{ + for (vector::iterator i=m_SampleVec.begin(); + i!=m_SampleVec.end(); i++) + { + delete(*i); + } + + for (vector::iterator i=m_SampleDescVec.begin(); + i!=m_SampleDescVec.end(); i++) + { + delete(*i); + } +} + +PluginInfo &PoshSamplerPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host);; +} + +SpiralGUIType *PoshSamplerPlugin::CreateGUI() +{ + m_GUI = new PoshSamplerPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void PoshSamplerPlugin::Execute() +{ + static bool Pong=false; + + for (int s=0; sZero(); + } + + float Freq=0; + + for (int n=0; nBUFSIZE; n++) + { + Freq=GetInputPitch(NOTETRIG,n); + + for (int s=0; sGetLength()) + { + // Convert the CV input into a useable trigger + + if (GetInput(s*2+1,n)>0 || feq(Freq,NoteTable[S->Note],0.01f)) + { + if (S->TriggerUp) + { + if (s==0 && InputExists(S1_INPUT)) + S->PlayStart=(long int)((GetInput(S1_INPUT,n)*0.5+0.5f)*(S->LoopEnd-S->LoopStart))+S->LoopStart; + if (s==1 && InputExists(S2_INPUT)) + S->PlayStart=(long int)((GetInput(S2_INPUT,n)*0.5+0.5f)*(S->LoopEnd-S->LoopStart))+S->LoopStart; + if (s==2 && InputExists(S3_INPUT)) + S->PlayStart=(long int)((GetInput(S3_INPUT,n)*0.5+0.5f)*(S->LoopEnd-S->LoopStart))+S->LoopStart; + + if (S->PlayStart<0) S->PlayStart=0; + + S->SamplePos=S->PlayStart; + S->TriggerUp=false; + S->Velocity=GetInput(s*2+1,n); + } + } + else + { + S->TriggerUp=true; + + // end it if it's looping + if (S->Loop) + { + S->SamplePos=-1; + } + } + + // if the sample has ended + if (S->SamplePos>=S->LoopEnd || S->SamplePos>=m_SampleVec[s]->GetLength()) + { + if (S->Loop) + { + if (S->PingPong) Pong=true; + else S->SamplePos=S->LoopStart; + } + else + { + S->SamplePos=-1; + } + } + + // if the sample has ended ponging + if (Pong && S->SamplePos<=S->LoopStart) + { + Pong=false; + } + + if (S->SamplePos!=-1) + { + if (InputExists(s*2)) + { + // Get the pitch from the CV + float PlayFreq=GetInputPitch(s*2,n); + + // assumtion: base frequency = 440 (middle A) + S->Pitch = PlayFreq/440; + S->Pitch *= S->SampleRate/(float)m_HostInfo->SAMPLERATE; + } + + // mix the sample to the output. + MixOutput(0,n,(*m_SampleVec[s])[S->SamplePos]*S->Volume*S->Velocity); + // copy the sample to it's individual output. + SetOutput(s+1,n,((*m_SampleVec[s])[S->SamplePos]*S->Volume)); + + float Freq=S->Pitch; + if (S->Octave>0) Freq*=1<<(S->Octave); + if (S->Octave<0) Freq/=1<<(-S->Octave); + + if (Pong) S->SamplePos-=Freq*S->PitchMod; + else S->SamplePos+=Freq*S->PitchMod; + } + } + } + } + + PoshSamplerPluginGUI *GUI=(PoshSamplerPluginGUI *)m_GUI; + + // record + static int LastRecording=false; + if(m_Recording && InputExists(REC_INPUT)) + { + int s=GUI->GetCurrentSample(); + + if (!LastRecording) m_SampleVec[s]->Clear(); + + // new sample + if (m_SampleVec[s]->GetLength()==0) + { + *m_SampleVec[s]=*GetInput(REC_INPUT); + + m_SampleDescVec[s]->SampleRate=m_HostInfo->SAMPLERATE; + m_SampleDescVec[s]->Stereo=false; + m_SampleDescVec[s]->Pitch *= 1.0f; + m_SampleDescVec[s]->LoopEnd=m_SampleVec[s]->GetLength(); + + } + else + { + m_SampleVec[s]->Add(*GetInput(REC_INPUT)); + m_SampleDescVec[s]->LoopEnd=m_SampleVec[s]->GetLength(); + } + } + LastRecording=m_Recording; + + if (m_SampleDescVec[GUI->GetCurrentSample()]->SamplePos>0) + { + GUI->SetPlayPos((int)m_SampleDescVec[GUI->GetCurrentSample()]->SamplePos); + } +} + +#include + +void PoshSamplerPlugin::StreamOut(ostream &s) +{ + s<Volume<<" "<< + m_SampleDescVec[n]->PitchMod<<" "<< + m_SampleDescVec[n]->Loop<<" "<< + m_SampleDescVec[n]->PingPong<<" "<< + m_SampleDescVec[n]->Note<<" "<< + m_SampleDescVec[n]->Octave<<" "<< + m_SampleDescVec[n]->SamplePos<<" "<< + m_SampleDescVec[n]->PlayStart<<" "<< + m_SampleDescVec[n]->LoopStart<<" "<< + m_SampleDescVec[n]->LoopEnd<<" "<< + m_SampleDescVec[n]->Note<<" "; + } +} + +void PoshSamplerPlugin::StreamIn(istream &s) +{ + int version; + s>>version; + + for (int n=0; n>m_SampleDescVec[n]->Volume>> + m_SampleDescVec[n]->PitchMod>> + m_SampleDescVec[n]->Loop>> + m_SampleDescVec[n]->PingPong>> + m_SampleDescVec[n]->Note>> + m_SampleDescVec[n]->Octave>> + m_SampleDescVec[n]->SamplePos>> + m_SampleDescVec[n]->PlayStart>> + m_SampleDescVec[n]->LoopStart>> + m_SampleDescVec[n]->LoopEnd>> + m_SampleDescVec[n]->Note; + + if (version<3) + { + int size; + s>>size; + s.ignore(1); + char Buf[4096]; + s.get(Buf,size+1); + } + } + + ((PoshSamplerPluginGUI*)m_GUI)->UpdateValues(); +} + +void PoshSamplerPlugin::LoadSample(int n, const string &Name) +{ + WavFile Wav; + if (Wav.Open(Name,WavFile::READ)) + { + m_SampleVec[n]->Allocate(Wav.GetSize()); + Wav.Load(*m_SampleVec[n]); + m_SampleDescVec[n]->Pathname=Name; + m_SampleDescVec[n]->SampleRate=Wav.GetSamplerate(); + m_SampleDescVec[n]->Stereo=Wav.IsStereo(); + m_SampleDescVec[n]->Pitch *= m_SampleDescVec[n]->SampleRate/(float)m_HostInfo->SAMPLERATE; + m_SampleDescVec[n]->LoopEnd=m_SampleVec[n]->GetLength()-1; + } +} + +void PoshSamplerPlugin::SaveSample(int n, const string &Name) +{ + if (m_SampleVec[n]->GetLength()==0) return; + + WavFile Wav; + Wav.Open(Name,WavFile::WRITE,WavFile::MONO); + Wav.Save(*m_SampleVec[n]); +} + +void PoshSamplerPlugin::Cut(int n, long s, long e) +{ + if (m_SampleVec[n]->GetLength()==0) return; + m_SampleVec[n]->GetRegion(m_CopyBuffer, s, e); + m_SampleVec[n]->Remove(s, e); +} + +void PoshSamplerPlugin::Copy(int n, long s, long e) +{ + if (m_SampleVec[n]->GetLength()==0) return; + m_SampleVec[n]->GetRegion(m_CopyBuffer, s, e); +} + +void PoshSamplerPlugin::Paste(int n, long s, long e) +{ + if (m_SampleVec[n]->GetLength()==0) return; + m_SampleVec[n]->Insert(m_CopyBuffer, s); +} + +void PoshSamplerPlugin::Mix(int n, long s, long e) +{ + if (m_SampleVec[n]->GetLength()==0) return; + m_SampleVec[n]->Mix(m_CopyBuffer, s); +} + +void PoshSamplerPlugin::Crop(int n, long s, long e) +{ + if (m_SampleVec[n]->GetLength()==0) return; + m_SampleVec[n]->Remove(0, s); + m_SampleVec[n]->Remove(e, m_SampleVec[n]->GetLength()-1); +} + +void PoshSamplerPlugin::Reverse(int n, long s, long e) +{ + if (m_SampleVec[n]->GetLength()==0) return; + m_SampleVec[n]->Reverse(s, e); +} + +void PoshSamplerPlugin::Amp(int n, long s, long e) +{ + if (m_SampleVec[n]->GetLength()==0) return; + for (int m=0; mGetLength(); m++) + { + m_SampleVec[n]->Set(m,(*m_SampleVec[n])[m]*m_SampleDescVec[n]->Volume); + } +} + + +bool PoshSamplerPlugin::SaveExternalFiles(const string &Dir) +{ + for (int n=0; nPathname = temp; + } + + for (int n=0; nGetLength()!=0) + { + SaveSample(n,Dir+m_SampleDescVec[n]->Pathname); + } + } + return true; +} + +void PoshSamplerPlugin::LoadExternalFiles(const string &Dir) +{ + for (int n=0; nPathname = temp; + } + + for (int n=0; nPathname); + } +} diff --git a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h new file mode 100644 index 0000000..dbf6ca7 --- /dev/null +++ b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.h @@ -0,0 +1,105 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef PoshSamplerPLUGIN +#define PoshSamplerPLUGIN + +static const int NUM_SAMPLES = 8; + +struct SampleDesc +{ + string Pathname; + float Volume; + float Velocity; + float Pitch; + float PitchMod; + bool Loop; + bool PingPong; + int Note; + int Octave; + bool TriggerUp; + float SamplePos; + int SampleRate; + bool Stereo; + long PlayStart; + long LoopStart; + long LoopEnd; +}; + +class PoshSamplerPlugin : public SpiralPlugin +{ +public: + PoshSamplerPlugin(); + virtual ~PoshSamplerPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + virtual bool SaveExternalFiles(const string &Dir); + virtual void LoadExternalFiles(const string &Dir); + + void LoadSample(int n, const string &Name); + void SaveSample(int n, const string &Name); + Sample* GetSample(int n) { return m_SampleVec[n]; } + + void SetVolume(int n, float s) { m_SampleDescVec[n]->Volume=s; } + float GetVolume(int n) { return m_SampleDescVec[n]->Volume; } + void SetPitch(int n, float s) { m_SampleDescVec[n]->PitchMod=s; } + float GetPitch(int n) { return m_SampleDescVec[n]->PitchMod; } + void SetLoop(int n, bool s) { m_SampleDescVec[n]->Loop=s; } + bool GetLoop(int n) { return m_SampleDescVec[n]->Loop; } + void SetPingPong(int n, bool s){ m_SampleDescVec[n]->PingPong=s; } + bool GetPingPong(int n) { return m_SampleDescVec[n]->PingPong; } + void SetNote(int n, int s) { m_SampleDescVec[n]->Note=s; } + int GetNote(int n) { return m_SampleDescVec[n]->Note; } + void SetOctave(int n, int s) { m_SampleDescVec[n]->Octave=s-6; } + int GetOctave(int n) { return m_SampleDescVec[n]->Octave+6; } + //void SetSampleNum(int n, int s){ m_SampleDescVec[n]->Note=s; } + //int GetSampleNum(int n) { return m_SampleDescVec[n]->Note; } + + void SetPlayStart(int n, long s) { m_SampleDescVec[n]->PlayStart=s; } + long GetPlayStart(int n) { return m_SampleDescVec[n]->PlayStart; } + void SetLoopStart(int n, long s) { m_SampleDescVec[n]->LoopStart=s; } + long GetLoopStart(int n) { return m_SampleDescVec[n]->LoopStart; } + void SetLoopEnd(int n, long s) { m_SampleDescVec[n]->LoopEnd=s; } + long GetLoopEnd(int n) { return m_SampleDescVec[n]->LoopEnd; } + void SetRecord(bool s) { m_Recording=s; } + + void Cut(int n, long s, long e); + void Copy(int n, long s, long e); + void Paste(int n, long s, long e); + void Mix(int n, long s, long e); + void Crop(int n, long s, long e); + void Reverse(int n, long s, long e); + void Amp(int n, long s, long e); + + vector m_SampleVec; + vector m_SampleDescVec; + +private: + Sample m_CopyBuffer; + bool m_Recording; +}; + +#endif diff --git a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.pro b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.pro new file mode 100644 index 0000000..4503018 --- /dev/null +++ b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPlugin.pro @@ -0,0 +1,19 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../RiffWav.h \ + PoshSamplerPlugin.h \ + PoshSamplerPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + PoshSamplerPlugin.C \ + PoshSamplerPluginGUI.C + +TARGET = PoshSamplerPlugin.so diff --git a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPluginGUI.C b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPluginGUI.C new file mode 100644 index 0000000..8ad2d08 --- /dev/null +++ b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPluginGUI.C @@ -0,0 +1,545 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "PoshSamplerPluginGUI.h" +#include +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +Fl_WaveDisplay::Fl_WaveDisplay(int x,int y,int w,int h, char *Name) : +Fl_Widget(x,y,w,h,Name), +m_Sample(NULL), +m_StartPos(1), +m_EndPos(10), +m_ViewStart(0), +m_ViewEnd(INT_MAX), +m_PlayPos(0), +m_PlayStart(0), +m_LoopStart(0), +m_LoopEnd(INT_MAX), +m_PosMarker(true) +{ +} + +Fl_WaveDisplay::~Fl_WaveDisplay() +{ +} + +void Fl_WaveDisplay::draw() +{ + int ho=h()/2; + fl_color(GUIBG_COLOUR); + fl_rectf(x(), y(), w(), h()); + if (!m_Sample || m_Sample->GetLength()==0) return; + + if (m_ViewStart<0) m_ViewStart=0; + if (m_ViewEnd>m_Sample->GetLength()-1) m_ViewEnd=m_Sample->GetLength()-1; + + if (m_PlayStart<0) m_PlayStart=0; + if (m_PlayStart>m_Sample->GetLength()-1) m_PlayStart=m_Sample->GetLength()-1; + if (m_LoopStart<0) m_LoopStart=0; + if (m_LoopStart>m_Sample->GetLength()-1) m_LoopStart=m_Sample->GetLength()-1; + if (m_LoopEnd<0) m_LoopEnd=0; + if (m_LoopEnd>m_Sample->GetLength()-1) m_LoopEnd=m_Sample->GetLength()-1; + + float Value=0,NextValue=0; + int pos=0; + int Jump=(m_ViewEnd-m_ViewStart)/w(); + if (Jump==0) Jump=1; + + for(int n=m_ViewStart; n=n && m_PlayPos=n && m_PlayStart=n && m_LoopStart=n && m_LoopEndm_StartPos && nm_EndPos) m_EndPos=MousePos; + else m_StartPos=MousePos; + } break; + + case 1: + { + m_StartPos=MousePos; + if (m_StartPos>m_EndPos) Holding=2; // swap + } break; + + + case 2: + { + m_EndPos=MousePos; + if (m_StartPos>m_EndPos) Holding=1; // swap + } break; + + case 3: m_PlayStart=MousePos; break; + case 4: m_LoopStart=MousePos; break; + case 5: m_LoopEnd=MousePos; break; + } + } + + if (Mousebutton==2) + { + int Dist=(DragX-xx)*((m_ViewEnd-m_ViewStart)/w()); + if (m_ViewStart>0 && m_ViewEndGetLength()-1) + { + m_ViewStart+=Dist; + m_ViewEnd+=Dist; + } + else // stop it sticking when at end/beginning + { + if ((Dist>0 && m_ViewStart<=0) || + (Dist<0 && m_ViewEnd>=m_Sample->GetLength()-1)) + { + m_ViewStart+=Dist; + m_ViewEnd+=Dist; + } + } + DragX=xx; + DragY=yy; + } + + if (Mousebutton==3) + { + // only draw wave at 1 pixel = 1 sample + if ((m_ViewEnd-m_ViewStart)/w()==1) + { + int MousePos=(xx-x())*((m_ViewEnd-m_ViewStart)/w())+m_ViewStart; + float Value=-(yy-y())/((float)h()/2.0f)+1.0f; + m_Sample->Set(MousePos,Value); + redraw(); + } + } + + do_callback(); + redraw(); + } + + if (event==FL_KEYBOARD || event==FL_SHORTCUT) + { + if (Fl::event_key('+')) + { + int Zoom=(int)((m_ViewEnd-m_ViewStart)*0.03f); + if ((m_ViewEnd-m_ViewStart)/w()>1) + { + m_ViewStart+=Zoom; + m_ViewEnd-=Zoom; + } + + redraw(); + } + + if (Fl::event_key('-')) + { + int Zoom=(int)((m_ViewEnd-m_ViewStart)*0.03f); + m_ViewStart-=Zoom; + m_ViewEnd+=Zoom; + redraw(); + } + } + + if (m_EndPos>=m_Sample->GetLength()) m_EndPos=m_Sample->GetLength()-1; + + return 1; +} + +//////////////////////////////////////////// + +PoshSamplerPluginGUI::PoshSamplerPluginGUI(int w, int h,PoshSamplerPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + int n=0; + + m_Load = new Fl_Button(5, 20, 70, 20, "Load"); + m_Load->labelsize(10); + m_Load->callback((Fl_Callback*)cb_Load); + add(m_Load); + + m_Save = new Fl_Button(5, 40, 70, 20, "Save"); + m_Save->labelsize(10); + m_Save->callback((Fl_Callback*)cb_Save); + add(m_Save); + + m_Record = new Fl_Button(5, 60, 70, 20, "Record"); + m_Record->type(1); + m_Record->labelsize(10); + m_Record->labelcolor(FL_RED); + m_Record->callback((Fl_Callback*)cb_Record); + add(m_Record); + + m_Loop = new Fl_Button(80, 20, 70, 20, "Loop"); + m_Loop->labelsize(10); + m_Loop->type(1); + m_Loop->callback((Fl_Callback*)cb_Loop); + add(m_Loop); + + m_PingPong = new Fl_Button(80, 40, 70, 20, "PingPong"); + m_PingPong->labelsize(10); + m_PingPong->type(1); + m_PingPong->callback((Fl_Callback*)cb_PingPong); + add(m_PingPong); + + m_PosMarker = new Fl_Button(80, 60, 70, 20, "PosMarker"); + m_PosMarker->labelsize(10); + m_PosMarker->type(1); + m_PosMarker->value(1); + m_PosMarker->callback((Fl_Callback*)cb_PosMarker); + add(m_PosMarker); + + + m_Volume = new Fl_Knob(160, 20, 50, 50, "Volume"); + m_Volume->color(GUI_COLOUR); + m_Volume->type(Fl_Knob::LINELIN); + m_Volume->labelsize(10); + m_Volume->maximum(2); + m_Volume->step(0.001); + m_Volume->value(1); + m_Volume->callback((Fl_Callback*)cb_Volume); + add(m_Volume); + + m_Pitch = new Fl_Knob(220, 20, 50, 50, "Pitch"); + m_Pitch->color(GUI_COLOUR); + m_Pitch->type(Fl_Knob::LINELIN); + m_Pitch->labelsize(10); + m_Pitch->maximum(10); + m_Pitch->step(0.001); + m_Pitch->value(1); + m_Pitch->callback((Fl_Callback*)cb_Pitch); + add(m_Pitch); + + m_Octave = new Fl_Knob(280, 20, 50, 50, "Octave"); + m_Octave->color(GUI_COLOUR); + m_Octave->type(Fl_Knob::LINELIN); + m_Octave->labelsize(10); + m_Octave->maximum(12); + m_Octave->step(1); + m_Octave->value(6); + m_Octave->callback((Fl_Callback*)cb_Octave); + add(m_Octave); + + m_Note = new Fl_Counter(w-45, 50, 30, 20, "Trig Note"); + m_Note->labelsize(10); + m_Note->type(FL_SIMPLE_COUNTER); + m_Note->step(1); + m_Note->value(n); + m_Note->callback((Fl_Callback*)cb_Note); + add(m_Note); + + m_SampleNum = new Fl_Counter(w-45, 15, 30, 20, "Sample"); + m_SampleNum->labelsize(10); + m_SampleNum->type(FL_SIMPLE_COUNTER); + m_SampleNum->step(1); + m_SampleNum->value(n); + m_SampleNum->callback((Fl_Callback*)cb_SampleNum); + add(m_SampleNum); + + m_Display = new Fl_WaveDisplay(5,85,w-10,100,""); + m_Display->SetSample(m_Plugin->GetSample(0)); + m_Display->callback((Fl_Callback*)cb_WaveDisplay); + + int bx=5,by=190,bw=w/7-2,bh=20,bs=w/7-2; + n=0; + + m_Cut = new Fl_Button(bx+(n++*bs),by,bw,bh,"Cut"); + m_Cut->labelsize(10); + m_Cut->callback((Fl_Callback*)cb_Cut); + + m_Copy = new Fl_Button(bx+(n++*bs),by,bw,bh,"Copy"); + m_Copy->labelsize(10); + m_Copy->callback((Fl_Callback*)cb_Copy); + + m_Paste = new Fl_Button(bx+(n++*bs),by,bw,bh,"Paste"); + m_Paste->labelsize(10); + m_Paste->callback((Fl_Callback*)cb_Paste); + + m_Mix = new Fl_Button(bx+(n++*bs),by,bw,bh,"Mix"); + m_Mix->labelsize(10); + m_Mix->callback((Fl_Callback*)cb_Mix); + + m_Crop = new Fl_Button(bx+(n++*bs),by,bw,bh,"Crop"); + m_Crop->labelsize(10); + m_Crop->callback((Fl_Callback*)cb_Crop); + + m_Reverse = new Fl_Button(bx+(n++*bs),by,bw,bh,"Reverse"); + m_Reverse->labelsize(10); + m_Reverse->callback((Fl_Callback*)cb_Reverse); + + m_Amp = new Fl_Button(bx+(n++*bs),by,bw,bh,"Amp"); + m_Amp->labelsize(10); + m_Amp->callback((Fl_Callback*)cb_Amp); + + end(); + + redraw(); +} + +void PoshSamplerPluginGUI::UpdateValues() +{ + m_Volume->value(m_Plugin->GetVolume((int)m_SampleNum->value())); + m_Pitch->value(m_Plugin->GetPitch((int)m_SampleNum->value())); + m_Note->value(m_Plugin->GetNote((int)m_SampleNum->value())); + m_Loop->value(m_Plugin->GetLoop((int)m_SampleNum->value())); + m_Display->SetSample(m_Plugin->GetSample((int)m_SampleNum->value())); + m_Display->SetPlayStart(m_Plugin->GetPlayStart((int)m_SampleNum->value())); + m_Display->SetLoopStart(m_Plugin->GetLoopStart((int)m_SampleNum->value())); + m_Display->SetLoopEnd(m_Plugin->GetLoopEnd((int)m_SampleNum->value())); + m_Display->redraw(); +} + +inline void PoshSamplerPluginGUI::cb_Load_i(Fl_Button* o, void* v) +{ + char *fn=fl_file_chooser("Load a sample", "{*.wav,*.WAV}", NULL); + + if (fn && fn!='\0') + { + m_Plugin->LoadSample((int)m_SampleNum->value(),fn); + m_Display->SetSample(m_Plugin->GetSample((int)m_SampleNum->value())); + UpdateValues(); + m_Display->redraw(); + redraw(); + } +} +void PoshSamplerPluginGUI::cb_Load(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Load_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Save_i(Fl_Button* o, void* v) +{ + char *fn=fl_file_chooser("Save sample", "{*.wav,*.WAV}", NULL); + + if (fn && fn!='\0') + { + m_Plugin->SaveSample((int)m_SampleNum->value(),fn); + } +} +void PoshSamplerPluginGUI::cb_Save(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Save_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Volume_i(Fl_Knob* o, void* v) +{ m_Plugin->SetVolume((int)m_SampleNum->value(),o->value()); } +void PoshSamplerPluginGUI::cb_Volume(Fl_Knob* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Volume_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Pitch_i(Fl_Knob* o, void* v) +{ m_Plugin->SetPitch((int)m_SampleNum->value(),o->value()); } +void PoshSamplerPluginGUI::cb_Pitch(Fl_Knob* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Pitch_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Octave_i(Fl_Knob* o, void* v) +{ m_Plugin->SetOctave((int)m_SampleNum->value(), (int)o->value()); } +void PoshSamplerPluginGUI::cb_Octave(Fl_Knob* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Octave_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Loop_i(Fl_Button* o, void* v) +{ m_Plugin->SetLoop((int)m_SampleNum->value(),o->value()); } +void PoshSamplerPluginGUI::cb_Loop(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Loop_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_PingPong_i(Fl_Button* o, void* v) +{ m_Plugin->SetPingPong((int)m_SampleNum->value(), o->value()); } +void PoshSamplerPluginGUI::cb_PingPong(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_PingPong_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Record_i(Fl_Button* o, void* v) +{ + m_Plugin->SetRecord(o->value()); + redraw(); +} +void PoshSamplerPluginGUI::cb_Record(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Record_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_PosMarker_i(Fl_Button* o, void* v) +{ m_Display->SetPosMarker(o->value()); } +void PoshSamplerPluginGUI::cb_PosMarker(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_PosMarker_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Note_i(Fl_Counter* o, void* v) +{ m_Plugin->SetNote((int)m_SampleNum->value(),(int)o->value()); } +void PoshSamplerPluginGUI::cb_Note(Fl_Counter* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Note_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_SampleNum_i(Fl_Counter* o, void* v) +{ + if (m_SampleNum->value()<0) m_SampleNum->value(0); + if (m_SampleNum->value()>7) m_SampleNum->value(7); + UpdateValues(); +} +void PoshSamplerPluginGUI::cb_SampleNum(Fl_Counter* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_SampleNum_i(o,v);} + + +inline void PoshSamplerPluginGUI::cb_Cut_i(Fl_Button* o, void* v) +{ + m_Plugin->Cut((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd()); + m_Display->redraw(); +} +void PoshSamplerPluginGUI::cb_Cut(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Cut_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Copy_i(Fl_Button* o, void* v) +{ + m_Plugin->Copy((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd()); + m_Display->redraw(); +} +void PoshSamplerPluginGUI::cb_Copy(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Copy_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Paste_i(Fl_Button* o, void* v) +{ + m_Plugin->Paste((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd()); + m_Display->redraw(); +} +void PoshSamplerPluginGUI::cb_Paste(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Paste_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Mix_i(Fl_Button* o, void* v) +{ + m_Plugin->Mix((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd()); + m_Display->redraw(); +} +void PoshSamplerPluginGUI::cb_Mix(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Mix_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Crop_i(Fl_Button* o, void* v) +{ + m_Plugin->Crop((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd()); + m_Display->redraw(); +} +void PoshSamplerPluginGUI::cb_Crop(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Crop_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Reverse_i(Fl_Button* o, void* v) +{ + m_Plugin->Reverse((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd()); + m_Display->redraw(); +} +void PoshSamplerPluginGUI::cb_Reverse(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Reverse_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_Amp_i(Fl_Button* o, void* v) +{ + m_Plugin->Amp((int)m_SampleNum->value(),m_Display->GetRangeStart(),m_Display->GetRangeEnd()); + m_Display->redraw(); +} +void PoshSamplerPluginGUI::cb_Amp(Fl_Button* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_Amp_i(o,v);} + +inline void PoshSamplerPluginGUI::cb_WaveDisplay_i(Fl_WaveDisplay* o, void* v) +{ + m_Plugin->SetPlayStart((int)m_SampleNum->value(),o->GetPlayStart()); + m_Plugin->SetLoopStart((int)m_SampleNum->value(),o->GetLoopStart()); + m_Plugin->SetLoopEnd((int)m_SampleNum->value(),o->GetLoopEnd()); +} +void PoshSamplerPluginGUI::cb_WaveDisplay(Fl_WaveDisplay* o, void* v) +{ ((PoshSamplerPluginGUI*)(o->parent()))->cb_WaveDisplay_i(o,v);} diff --git a/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPluginGUI.h b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPluginGUI.h new file mode 100644 index 0000000..a5c614d --- /dev/null +++ b/SpiralSound/Plugins/PoshSamplerPlugin/PoshSamplerPluginGUI.h @@ -0,0 +1,149 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "PoshSamplerPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" + +#ifndef MixerGUI +#define MixerGUI + +class Fl_WaveDisplay : public Fl_Widget +{ + public: + Fl_WaveDisplay(int x,int y,int w,int h, char* Name); + ~Fl_WaveDisplay(); + virtual void draw(); + virtual int handle(int event); + void SetSample(Sample* s) { m_Sample=s; } + long GetRangeStart() { return m_StartPos; } + long GetRangeEnd() { return m_EndPos; } + long GetViewStart() { return m_ViewStart; } + void SetViewStart(long s) { m_ViewStart=s; } + long GetViewEnd() { return m_ViewEnd; } + void SetViewEnd(long s) { m_ViewEnd=s; } + void SetPlayPos(long s) { m_PlayPos=s; if(m_PosMarker) redraw(); } + void SetPlayStart(long s) { m_PlayStart=s; } + long GetPlayStart() { return m_PlayStart; } + void SetLoopStart(long s) { m_LoopStart=s; } + long GetLoopStart() { return m_LoopStart; } + void SetLoopEnd(long s) { m_LoopEnd=s; } + long GetLoopEnd() { return m_LoopEnd; } + void SetPosMarker(bool s) { m_PosMarker=s; } + + private: + Sample *m_Sample; + long m_StartPos; + long m_EndPos; + + long m_ViewStart; + long m_ViewEnd; + long m_PlayPos; + + long m_PlayStart; + long m_LoopStart; + long m_LoopEnd; + bool m_PosMarker; +}; + + +class PoshSamplerPluginGUI : public SpiralPluginGUI +{ +public: + PoshSamplerPluginGUI(int w, int h, PoshSamplerPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + void SetPlayPos(long s) { m_Display->SetPlayPos(s); } + int GetCurrentSample() { return (int)m_SampleNum->value(); } + + PoshSamplerPlugin *m_Plugin; +private: + + int Numbers[NUM_SAMPLES]; + + Fl_Button* m_Load; + Fl_Button* m_Save; + Fl_Button* m_PosMarker; + Fl_Knob* m_Volume; + Fl_Knob* m_Pitch; + Fl_Knob* m_Octave; + Fl_Button* m_Loop; + Fl_Button* m_PingPong; + Fl_Button* m_Record; + Fl_Counter* m_Note; + Fl_WaveDisplay* m_Display; + Fl_Counter* m_SampleNum; + + Fl_Button* m_Cut; + Fl_Button* m_Copy; + Fl_Button* m_Paste; + Fl_Button* m_Mix; + Fl_Button* m_Crop; + Fl_Button* m_Reverse; + Fl_Button* m_Amp; + + //// Callbacks //// + inline void cb_Load_i(Fl_Button* o, void* v); + static void cb_Load(Fl_Button* o, void* v); + inline void cb_Save_i(Fl_Button* o, void* v); + static void cb_Save(Fl_Button* o, void* v); + inline void cb_PosMarker_i(Fl_Button* o, void* v); + static void cb_PosMarker(Fl_Button* o, void* v); + inline void cb_Record_i(Fl_Button* o, void* v); + static void cb_Record(Fl_Button* o, void* v); + inline void cb_Volume_i(Fl_Knob* o, void* v); + static void cb_Volume(Fl_Knob* o, void* v); + inline void cb_Pitch_i(Fl_Knob* o, void* v); + static void cb_Pitch(Fl_Knob* o, void* v); + inline void cb_Octave_i(Fl_Knob* o, void* v); + static void cb_Octave(Fl_Knob* o, void* v); + inline void cb_Loop_i(Fl_Button* o, void* v); + static void cb_Loop(Fl_Button* o, void* v); + inline void cb_PingPong_i(Fl_Button* o, void* v); + static void cb_PingPong(Fl_Button* o, void* v); + inline void cb_Note_i(Fl_Counter* o, void* v); + static void cb_Note(Fl_Counter* o, void* v); + inline void cb_SampleNum_i(Fl_Counter* o, void* v); + static void cb_SampleNum(Fl_Counter* o, void* v); + + inline void cb_Cut_i(Fl_Button* o, void* v); + static void cb_Cut(Fl_Button* o, void* v); + inline void cb_Copy_i(Fl_Button* o, void* v); + static void cb_Copy(Fl_Button* o, void* v); + inline void cb_Paste_i(Fl_Button* o, void* v); + static void cb_Paste(Fl_Button* o, void* v); + inline void cb_Mix_i(Fl_Button* o, void* v); + static void cb_Mix(Fl_Button* o, void* v); + inline void cb_Crop_i(Fl_Button* o, void* v); + static void cb_Crop(Fl_Button* o, void* v); + inline void cb_Reverse_i(Fl_Button* o, void* v); + static void cb_Reverse(Fl_Button* o, void* v); + inline void cb_Amp_i(Fl_Button* o, void* v); + static void cb_Amp(Fl_Button* o, void* v); + inline void cb_WaveDisplay_i(Fl_WaveDisplay* o, void* v); + static void cb_WaveDisplay(Fl_WaveDisplay* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/PoshSamplerPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/PoshSamplerPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..d81d611 --- /dev/null +++ b/SpiralSound/Plugins/PoshSamplerPlugin/SpiralIcon.xpm @@ -0,0 +1,322 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 283 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0A0A0A", +"+. c #151700", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #282900", +"!. c #030300", +"~. c #070700", +"{. c #020200", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #FEF100", +"|. c #515151", +"1. c #A6A6A7", +"2. c #827E93", +"3. c #615C77", +"4. c #EAEAED", +"5. c #DFDFE1", +"6. c #0C0C0C", +"7. c #191700", +"8. c #1E1D24", +"9. c #9894A7", +"0. c #B1AEBB", +"a. c #69686F", +"b. c #000001", +"c. c #615C76", +"d. c #5F5A75", +"e. c #413E4D", +"f. c #020203", +"g. c #1A1900", +"h. c #1A1A1C", +"i. c #C3C1CB", +"j. c #9D9D9D", +"k. c #202020", +"l. c #383838", +"m. c #4C4C4C", +"n. c #111112", +"o. c #C9C7D0", +"p. c #F1F1F1", +"q. c #F8F8F8", +"r. c #232323", +"s. c #050408", +"t. c #AEACB9", +"u. c #FEFEFE", +"v. c #1D1D1D", +"w. c #B7B5C1", +"x. c #9390A2", +"y. c #BBBBBB", +"z. c #414141", +"A. c #030303", +"B. c #28272A", +"C. c #F4F4F6", +"D. c #605B76", +"E. c #736E86", +"F. c #D8D8D8", +"G. c #727272", +"H. c #101010", +"I. c #848486", +"J. c #CCCBD3", +"K. c #747087", +"L. c #6D6881", +"M. c #1C1C1C", +"N. c #242424", +"O. c #656566", +"P. c #F6F6F6", +"Q. c #E8E6EA", +"R. c #706B84", +"S. c #E3E1E6", +"T. c #474746", +"U. c #151515", +"V. c #C8C8C8", +"W. c #AEAEAE", +"X. c #070707", +"Y. c #010100", +"Z. c #373639", +"`. c #FDFCFE", +" + c #ABA8B7", +".+ c #F1F0F3", +"++ c #6D6980", +"@+ c #0A090E", +"#+ c #95929E", +"$+ c #0A0810", +"%+ c #0D0D0D", +"&+ c #050505", +"*+ c #5B5A5C", +"=+ c #F7F6F7", +"-+ c #F4F3F5", +";+ c #908C9F", +">+ c #C8C6D0", +",+ c #837E96", +"'+ c #86868A", +")+ c #070608", +"!+ c #ECEBEE", +"~+ c #5B5571", +"{+ c #646078", +"]+ c #AFAFB0", +"^+ c #454545", +"/+ c #363636", +"(+ c #7A7A7A", +"_+ c #C8C8C9", +":+ c #212025", +"<+ c #060607", +"[+ c #969699", +"}+ c #FAFAFA", +"|+ c #F8F8F9", +"1+ c #A29EAF", +"2+ c #F7F6F8", +"3+ c #F0F0F1", +"4+ c #B8B7B9", +"5+ c #E4E4E4", +"6+ c #FDFDFD", +"7+ c #A5A2B2", +"8+ c #3B3456", +"9+ c #A8A5B4", +"0+ c #525252", +"a+ c #848387", +"b+ c #CDCDCD", +"c+ c #8D899C", +"d+ c #494262", +"e+ c #68627C", +"f+ c #40395A", +"g+ c #ECECEC", +"h+ c #020202", +"i+ c #B4B5B5", +"j+ c #0B0B0B", +"k+ c #313232", +"l+ c #E3E3E3", +"m+ c #B1AEBC", +"n+ c #BDBBC6", +"o+ c #3C3556", +"p+ c #898599", +"q+ c #EDEDED", +"r+ c #39393A", +"s+ c #040404", +"t+ c #333333", +"u+ c #F5F5F5", +"v+ c #2B2B2B", +"w+ c #2D2A3D", +"x+ c #B6B4C1", +"y+ c #F5F5F6", +"z+ c #605A76", +"A+ c #DAD8DF", +"B+ c #F5F4F6", +"C+ c #615B76", +"D+ c #524D6A", +"E+ c #E4E3E8", +"F+ c #D5D5D5", +"G+ c #1B1B1B", +"H+ c #303030", +"I+ c #AAABAB", +"J+ c #585464", +"K+ c #B0AEBB", +"L+ c #A29FAF", +"M+ c #E9E8E9", +"N+ c #787779", +"O+ c #0F0E15", +"P+ c #2D2D2E", +"Q+ c #595959", +"R+ c #FAFAFB", +"S+ c #807B92", +"T+ c #B0ADBB", +"U+ c #E8E7EB", +"V+ c #3A3258", +"W+ c #E6E5EA", +"X+ c #DFDEE3", +"Y+ c #443E5E", +"Z+ c #BAB8C4", +"`+ c #C1BFCA", +" @ c #E0E0E5", +".@ c #D0CED6", +"+@ c #362F52", +"@@ c #CECCD5", +"#@ c #413A5B", +"$@ c #6A657F", +"%@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 6 6 ~.{.6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 }.}.}.}.}.}.}.}.}.}.6 E |.1.4 2. ", +" 3.4.; 5.6.6 6 6 6 6 6 }.6 6 6 6 6 6 6 6 }.6 7.6 8.9. ", +" V @ 0.a.b.6 6 6 6 6 6 }.6 6 6 6 6 6 6 6 }.6 7.6 ", +" c.d.e.6 f.6 6 6 6 6 }.6 }.6 6 6 }.6 g.}.6 6 6 h. ", +" i.; ; j.k.k.l.m.k.6 6 }.}.6 }.6 }.6 }.6 }.6 6 6 n. ", +" o.; ; p.q.; ; ; r.6 6 }.6 6 6 }.6 6 6 }.}.6 6 6 s. ", +" t.; ; ; ; u.; ; v.6 6 }.6 6 6 6 6 6 6 6 }.6 6 6 6 w., ", +" x.; ; u.; : y.z.A.6 6 }.6 6 6 6 6 6 6 6 }.6 6 6 B.u.C.D. ", +" E.; ; ; F.G.H.6 6 6 6 }.}.}.}.}.}.}.}.}.}.6 6 6 I.; ; J.K. ", +" L.J ; : M.6 6 6 6 N.6 6 6 6 6 6 6 6 6 6 6 6 6 6 O.P.; ; Q.R. ", +" S.; ; T.6 E 6 U.V.W.X.6 6 6 6 6 6 6 6 Y.6 6 6 6 Z.`.; ; > R. ", +" +; .+++@+6 6 W.u.; #+$+6 6 6 6 6 6 6 6 %+&+6 6 6 *+=+; ; -+;+ ", +" R.>+! ,+'+)+x ; ; !+~+{+]+l ^+6 6 6 /+(+_+:+6 6 6 <+[+}+; ; |+@ ", +" 1+2+3+4+5+6+; 7+8+9+; P.^+6 6 E 0+; ; a+6 6 E 6 o b+; ; = c+ ", +" d+> ; ; ; ; ; ; e+f+; ; g+l.6 6 h+D ; ; i+j+6 6 6 k+l+; ; m+ ", +" > ; ; ; ; n+o+p+; ; q+r+6 6 s+t+; ; u+v+6 6 w+x+; y+3 ", +" z+A+= ; B+C+D+E+; ; F+G+6 6 h+H+; ; ; I+0+J+ ", +" K+4 L+ X ; ; ; M+N+H+O+P+Q+; ; ; u.R+S+ ", +" T+; ; ; ; ; U+V+W+; ; ; ; = X+Y+ ", +" Z+`+ @4 ; ; .@+@@@; ; ; s p+T ", +" #@ $@%@p+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/RingModPlugin/Makefile.in b/SpiralSound/Plugins/RingModPlugin/Makefile.in new file mode 100644 index 0000000..48c4ada --- /dev/null +++ b/SpiralSound/Plugins/RingModPlugin/Makefile.in @@ -0,0 +1,166 @@ +############################################################################# +# Makefile for building RingModPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: RingModPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + RingModPlugin.h \ + RingModPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + RingModPlugin.C \ + RingModPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + RingModPlugin.o \ + RingModPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = RingModPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake RingModPlugin.pro + +dist: + $(TAR) RingModPlugin.tar RingModPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) RingModPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +RingModPlugin.o: RingModPlugin.C \ + RingModPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + RingModPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + SpiralIcon.xpm + +RingModPluginGUI.o: RingModPluginGUI.C \ + RingModPluginGUI.h \ + RingModPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H + diff --git a/SpiralSound/Plugins/RingModPlugin/RingModPlugin.C b/SpiralSound/Plugins/RingModPlugin/RingModPlugin.C new file mode 100644 index 0000000..a571bb8 --- /dev/null +++ b/SpiralSound/Plugins/RingModPlugin/RingModPlugin.C @@ -0,0 +1,97 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include +#include "RingModPlugin.h" +#include "RingModPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new RingModPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x000a; +} +} + +/////////////////////////////////////////////////////// + +RingModPlugin::RingModPlugin() : +m_Amount(1.0f) +{ + m_PluginInfo.Name="Ring Mod"; + m_PluginInfo.Width=120; + m_PluginInfo.Height=110; + m_PluginInfo.NumInputs=2; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input 1"); + m_PluginInfo.PortTips.push_back("Input 2"); + m_PluginInfo.PortTips.push_back("Output"); +} + +RingModPlugin::~RingModPlugin() +{ +} + +PluginInfo &RingModPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *RingModPlugin::CreateGUI() +{ + m_GUI = new RingModPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void RingModPlugin::Execute() +{ + for (int n=0; nBUFSIZE; n++) + { + SetOutput(0,n,GetInput(0,n)*GetInput(1,n)*m_Amount); + } +} + +void RingModPlugin::Randomise() +{ +} + +void RingModPlugin::StreamOut(ostream &s) +{ + s<>version; + s>>m_Amount; +} + diff --git a/SpiralSound/Plugins/RingModPlugin/RingModPlugin.h b/SpiralSound/Plugins/RingModPlugin/RingModPlugin.h new file mode 100644 index 0000000..d33c361 --- /dev/null +++ b/SpiralSound/Plugins/RingModPlugin/RingModPlugin.h @@ -0,0 +1,54 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef RINGMODPLUGIN +#define RINGMODPLUGIN + +class RingModPlugin : public SpiralPlugin +{ +public: + RingModPlugin(); + virtual ~RingModPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetAmount(float s) { m_Amount=s; } + float GetAmount() { return m_Amount; } + + void Randomise(); + +private: + float m_Amount; + + friend istream &operator>>(istream &s, RingModPlugin &o); + friend ostream &operator<<(ostream &s, RingModPlugin &o); +}; +istream &operator>>(istream &s, RingModPlugin &o); +ostream &operator<<(ostream &s, RingModPlugin &o); + +#endif diff --git a/SpiralSound/Plugins/RingModPlugin/RingModPlugin.pro b/SpiralSound/Plugins/RingModPlugin/RingModPlugin.pro new file mode 100644 index 0000000..0179402 --- /dev/null +++ b/SpiralSound/Plugins/RingModPlugin/RingModPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + RingModPlugin.h \ + RingModPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + RingModPlugin.C \ + RingModPluginGUI.C + +TARGET = RingModPlugin.so diff --git a/SpiralSound/Plugins/RingModPlugin/RingModPluginGUI.C b/SpiralSound/Plugins/RingModPlugin/RingModPluginGUI.C new file mode 100644 index 0000000..d30e042 --- /dev/null +++ b/SpiralSound/Plugins/RingModPlugin/RingModPluginGUI.C @@ -0,0 +1,56 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "RingModPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +RingModPluginGUI::RingModPluginGUI(int w, int h,RingModPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_Amount = new Fl_Knob(34, 24, 50, 50, "Amount"); + m_Amount->color(GUI_COLOUR); + m_Amount->type(Fl_Knob::DOTLIN); + m_Amount->labelsize(10); + m_Amount->maximum(3); + m_Amount->step(0.0001); + m_Amount->value(1); + m_Amount->callback((Fl_Callback*)cb_Amount); + + end(); +} + +void RingModPluginGUI::UpdateValues() +{ + m_Amount->value(m_Plugin->GetAmount()); +} + +inline void RingModPluginGUI::cb_Amount_i(Fl_Knob* o, void* v) +{ + m_Plugin->SetAmount(o->value()); +} +void RingModPluginGUI::cb_Amount(Fl_Knob* o, void* v) +{ ((RingModPluginGUI*)(o->parent()))->cb_Amount_i(o,v); } diff --git a/SpiralSound/Plugins/RingModPlugin/RingModPluginGUI.h b/SpiralSound/Plugins/RingModPlugin/RingModPluginGUI.h new file mode 100644 index 0000000..5120d43 --- /dev/null +++ b/SpiralSound/Plugins/RingModPlugin/RingModPluginGUI.h @@ -0,0 +1,52 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "RingModPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" + +#ifndef AmpGUI +#define AmpGUI + + +class RingModPluginGUI : public SpiralPluginGUI +{ +public: + RingModPluginGUI(int w, int h, RingModPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + RingModPlugin *m_Plugin; + +private: + + Fl_Group *GUIFilterGroup; + Fl_Knob *m_Amount; + + //// Callbacks //// + inline void cb_Amount_i(Fl_Knob* o, void* v); + static void cb_Amount(Fl_Knob*, void*); +}; + +#endif diff --git a/SpiralSound/Plugins/RingModPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/RingModPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..f794006 --- /dev/null +++ b/SpiralSound/Plugins/RingModPlugin/SpiralIcon.xpm @@ -0,0 +1,350 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 311 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #2D2F00", +"!. c #111200", +"~. c #0B0C00", +"{. c #0F0F00", +"]. c #090A00", +"^. c #040400", +"/. c #060500", +"(. c #2B2800", +"_. c #727175", +":. c #FEFEFF", +"<. c #9D99AA", +"[. c #DBD9E0", +"}. c #E9E9E9", +"|. c #CBCBCB", +"1. c #E0E0E0", +"2. c #6C6C6C", +"3. c #ADA400", +"4. c #444000", +"5. c #302D00", +"6. c #F9EC00", +"7. c #E8DC00", +"8. c #515151", +"9. c #A6A6A7", +"0. c #827E93", +"a. c #615C77", +"b. c #EAEAED", +"c. c #DFDFE1", +"d. c #E9DD00", +"e. c #FEF100", +"f. c #FBEE00", +"g. c #F7EA00", +"h. c #1E1C00", +"i. c #1E1D24", +"j. c #9894A7", +"k. c #B1AEBB", +"l. c #69686F", +"m. c #000001", +"n. c #EDE000", +"o. c #948C00", +"p. c #645E00", +"q. c #FDF000", +"r. c #F1E400", +"s. c #615C76", +"t. c #5F5A75", +"u. c #413E4D", +"v. c #020203", +"w. c #C6BB00", +"x. c #FFF200", +"y. c #F1E500", +"z. c #1A1A1C", +"A. c #C3C1CB", +"B. c #9D9D9D", +"C. c #202020", +"D. c #383838", +"E. c #4C4C4C", +"F. c #C8BE00", +"G. c #111112", +"H. c #C9C7D0", +"I. c #F1F1F1", +"J. c #F8F8F8", +"K. c #9C9400", +"L. c #C5BB00", +"M. c #D9CD00", +"N. c #7E7700", +"O. c #050408", +"P. c #AEACB9", +"Q. c #FEFEFE", +"R. c #D1C600", +"S. c #B5AB00", +"T. c #B7B5C1", +"U. c #9390A2", +"V. c #BBBBBB", +"W. c #414141", +"X. c #F4E700", +"Y. c #736D00", +"Z. c #C4BA00", +"`. c #28272A", +" + c #F4F4F6", +".+ c #605B76", +"++ c #736E86", +"@+ c #D8D8D8", +"#+ c #727272", +"$+ c #101010", +"%+ c #8B8300", +"&+ c #C1B700", +"*+ c #848486", +"=+ c #CCCBD3", +"-+ c #747087", +";+ c #6D6881", +">+ c #1C1C1C", +",+ c #242424", +"'+ c #0A0A00", +")+ c #010100", +"!+ c #656566", +"~+ c #F6F6F6", +"{+ c #E8E6EA", +"]+ c #706B84", +"^+ c #E3E1E6", +"/+ c #474746", +"(+ c #151515", +"_+ c #C8C8C8", +":+ c #AEAEAE", +"<+ c #080808", +"[+ c #373639", +"}+ c #FDFCFE", +"|+ c #ABA8B7", +"1+ c #F1F0F3", +"2+ c #6D6980", +"3+ c #0A090E", +"4+ c #95929E", +"5+ c #0A0810", +"6+ c #0D0D0D", +"7+ c #050505", +"8+ c #5B5A5C", +"9+ c #F7F6F7", +"0+ c #F4F3F5", +"a+ c #908C9F", +"b+ c #C8C6D0", +"c+ c #837E96", +"d+ c #86868A", +"e+ c #070608", +"f+ c #ECEBEE", +"g+ c #5B5571", +"h+ c #646078", +"i+ c #AFAFB0", +"j+ c #454545", +"k+ c #363636", +"l+ c #7A7A7A", +"m+ c #C8C8C9", +"n+ c #212025", +"o+ c #060607", +"p+ c #969699", +"q+ c #FAFAFA", +"r+ c #F8F8F9", +"s+ c #A29EAF", +"t+ c #F7F6F8", +"u+ c #F0F0F1", +"v+ c #B8B7B9", +"w+ c #E4E4E4", +"x+ c #FDFDFD", +"y+ c #A5A2B2", +"z+ c #3B3456", +"A+ c #A8A5B4", +"B+ c #525252", +"C+ c #848387", +"D+ c #CDCDCD", +"E+ c #8D899C", +"F+ c #494262", +"G+ c #68627C", +"H+ c #40395A", +"I+ c #ECECEC", +"J+ c #020202", +"K+ c #B4B5B5", +"L+ c #0B0B0B", +"M+ c #313232", +"N+ c #E3E3E3", +"O+ c #B1AEBC", +"P+ c #BDBBC6", +"Q+ c #3C3556", +"R+ c #898599", +"S+ c #EDEDED", +"T+ c #39393A", +"U+ c #040404", +"V+ c #333333", +"W+ c #F5F5F5", +"X+ c #2B2B2B", +"Y+ c #2D2A3D", +"Z+ c #B6B4C1", +"`+ c #F5F5F6", +" @ c #605A76", +".@ c #DAD8DF", +"+@ c #F5F4F6", +"@@ c #615B76", +"#@ c #524D6A", +"$@ c #E4E3E8", +"%@ c #D5D5D5", +"&@ c #1B1B1B", +"*@ c #303030", +"=@ c #AAABAB", +"-@ c #585464", +";@ c #B0AEBB", +">@ c #A29FAF", +",@ c #E9E8E9", +"'@ c #787779", +")@ c #0F0E15", +"!@ c #2D2D2E", +"~@ c #595959", +"{@ c #FAFAFB", +"]@ c #807B92", +"^@ c #B0ADBB", +"/@ c #E8E7EB", +"(@ c #3A3258", +"_@ c #E6E5EA", +":@ c #DFDEE3", +"<@ c #443E5E", +"[@ c #BAB8C4", +"}@ c #C1BFCA", +"|@ c #E0E0E5", +"1@ c #D0CED6", +"2@ c #362F52", +"3@ c #CECCD5", +"4@ c #413A5B", +"5@ c #6A657F", +"6@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.{.].6 ^.6 /.(.E _.:.; ; <. ", +" [.; ; }.R h |.1.2.6 3.4.6 6 6 6 6 5.6.7.6 E 8.9.4 0. ", +" a.b.; c...6 6 6 6 6 6 d.e.4.6 6 6 5.f.g.h.6 6 6 i.j. ", +" V @ k.l.m.6 6 6 6 6 6 6 n.e.o.6 p.q.r.h.6 6 6 6 ", +" s.t.u.6 v.6 6 6 6 6 6 6 w.x.y.e.n./.6 6 6 6 6 z. ", +" A.; ; B.C.C.D.E.6 6 6 6 6 6 F.x.e.o.6 6 6 6 6 6 G. ", +" H.; ; I.J.; ; ; 6 6 6 6 6 K.x.L.M.e.N.6 6 6 6 6 O. ", +" P.; ; ; ; Q.; ; 6 6 6 /.d.x.K.6 6 R.x.S.6 6 6 6 6 T., ", +" U.; ; Q.; : V.W.6 6 6 X.e.Y.6 6 6 6 Z.e.4.6 6 6 `.Q. +.+ ", +" ++; ; ; @+#+$+6 6 6 6 M.%+6 6 6 6 6 6 d.&+6 6 Q *+; ; =+-+ ", +" ;+J ; : >+6 6 6 6 ,+..6 6 6 6 6 6 '+6 6 )+6 6 6 !+~+; ; {+]+ ", +" ^+; ; /+6 E 6 (+_+:+<+6 6 6 6 6 6 6 6 )+6 6 6 6 [+}+; ; > ]+ ", +" |+; 1+2+3+6 6 :+Q.; 4+5+6 6 6 6 6 6 6 6 6+7+6 6 6 8+9+; ; 0+a+ ", +" ]+b+! c+d+e+x ; ; f+g+h+i+l j+6 6 6 k+l+m+n+6 6 6 o+p+q+; ; r+@ ", +" s+t+u+v+w+x+; y+z+A+; ~+j+6 6 E B+; ; C+6 6 E 6 o D+; ; = E+ ", +" F+> ; ; ; ; ; ; G+H+; ; I+D.6 6 J+D ; ; K+L+6 6 6 M+N+; ; O+ ", +" > ; ; ; ; P+Q+R+; ; S+T+6 6 U+V+; ; W+X+6 6 Y+Z+; `+3 ", +" @.@= ; +@@@#@$@; ; %@&@6 6 J+*@; ; ; =@B+-@ ", +" ;@4 >@ X ; ; ; ,@'@*@)@!@~@; ; ; Q.{@]@ ", +" ^@; ; ; ; ; /@(@_@; ; ; ; = :@<@ ", +" [@}@|@4 ; ; 1@2@3@; ; ; s R+T ", +" 4@ 5@6@R+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/SVFilterPlugin/Makefile.in b/SpiralSound/Plugins/SVFilterPlugin/Makefile.in new file mode 100644 index 0000000..f475e82 --- /dev/null +++ b/SpiralSound/Plugins/SVFilterPlugin/Makefile.in @@ -0,0 +1,166 @@ +############################################################################# +# Makefile for building SVFilterPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: SVFilterPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + SVFilterPlugin.h \ + SVFilterPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + SVFilterPlugin.C \ + SVFilterPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + SVFilterPlugin.o \ + SVFilterPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SVFilterPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake SVFilterPlugin.pro + +dist: + $(TAR) SVFilterPlugin.tar SVFilterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) SVFilterPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +SVFilterPlugin.o: SVFilterPlugin.C \ + SVFilterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + SVFilterPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + SpiralIcon.xpm + +SVFilterPluginGUI.o: SVFilterPluginGUI.C \ + SVFilterPluginGUI.h \ + SVFilterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H + diff --git a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.C b/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.C new file mode 100644 index 0000000..58889b6 --- /dev/null +++ b/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.C @@ -0,0 +1,174 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include +#include "SVFilterPlugin.h" +#include "SVFilterPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +#define DENORMALISE(fv) (((*(unsigned int*)&(fv))&0x7f800000)==0)?0.0f:(fv) +#define PI 3.141592654 + +static const int GRANULARITY = 10; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new SVFilterPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x000c; +} +} + +/////////////////////////////////////////////////////// + +SVFilterPlugin::SVFilterPlugin() : +Cutoff(50.0f), +Resonance(0.0f), +fs(44100.0f), +fc(1000.0f), +q(1.0f), +m_f(0.0f), +m_q(0.0f), +m_qnrm(0.0f), +m_h(1.0f), +m_b(1.0f), +m_l(1.0f), +m_p(1.0f), +m_n(1.0f) +{ + m_PluginInfo.Name="SVF"; + m_PluginInfo.Width=120; + m_PluginInfo.Height=110; + m_PluginInfo.NumInputs=3; + m_PluginInfo.NumOutputs=5; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Cutoff CV"); + m_PluginInfo.PortTips.push_back("Emphasis CV"); + m_PluginInfo.PortTips.push_back("LowPass output"); + m_PluginInfo.PortTips.push_back("BandPass output"); + m_PluginInfo.PortTips.push_back("HighPass output"); + m_PluginInfo.PortTips.push_back("Notch output"); + m_PluginInfo.PortTips.push_back("Peaking output"); +} + +SVFilterPlugin::~SVFilterPlugin() +{ +} + +PluginInfo &SVFilterPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + fs = m_HostInfo->SAMPLERATE; + return Info; +} + +SpiralGUIType *SVFilterPlugin::CreateGUI() +{ + m_GUI = new SVFilterPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void SVFilterPlugin::Execute() +{ + float in; + + for (int n=0; nBUFSIZE; n++) + { + if (n%GRANULARITY==0) + { + fc = 220.0*(float)pow(2.0f, Cutoff+GetInput(1,n))*5.0f; + q = 1-Resonance+GetInput(2,n); + + m_f = 2.0*sin(PI*fc/fs); + m_q = 2.0*cos(pow(q,0.1)*PI*0.5); + m_qnrm = sqrt(m_q/2.0+0.01); + } + + in = m_qnrm*GetInput(0,n); + + //if (in!=0) + //{ + in = DENORMALISE(in); + m_l = DENORMALISE(m_l); + + // Protect the filter from breaking + if (m_b>10) m_b=10; + if (m_b<-10) m_b=-10; + + m_b = m_b - m_b*m_b*m_b*0.001; + m_h = in - m_l - q*m_b; + + m_b = m_b + m_f*m_h; + m_l = m_l + m_f*m_b; + m_n = m_l + m_h; + m_p = m_l - m_h; + + SetOutput(0,n,m_l); + SetOutput(1,n,m_b); + SetOutput(2,n,m_h); + SetOutput(3,n,m_n); + SetOutput(4,n,m_p); + //} + //else + //{ + // m_Output[0]->Set(n,0); + // m_Output[1]->Set(n,0); + // m_Output[2]->Set(n,0); + // m_Output[3]->Set(n,0); + // m_Output[4]->Set(n,0); + //} + } + +} + +void SVFilterPlugin::Randomise() +{ +} + +void SVFilterPlugin::StreamOut(ostream &s) +{ + s<>version; + s>>fc>>q; +} + +void SVFilterPlugin::Clear() +{ + m_h=0.0f; + m_b=0.1f; + m_l=0.0f; + m_p=0.0f; + m_n=0.0f; +} diff --git a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.h b/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.h new file mode 100644 index 0000000..02b409c --- /dev/null +++ b/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.h @@ -0,0 +1,70 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef SVFILTERPLUGIN +#define SVFILTERPLUGIN + +static const int NUM_CHANNELS = 4; + +// A State Variable Filter +class SVFilterPlugin : public SpiralPlugin +{ +public: + SVFilterPlugin(); + virtual ~SVFilterPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetCutoff(float s) { Cutoff=s; } + void SetResonance(float s) { Resonance=s; } + float GetCutoff() { return Cutoff; } + float GetResonance() { return Resonance; } + + void Randomise(); + void Clear(); + +private: + float Cutoff, Resonance; + + double fs; // Sample Rate + double fc; // Cutoff + double q; // Resonance + + // Calculation + double m_f, m_q, m_qnrm; + + // Outputs + double m_h, m_b, m_l, m_p, m_n; + + friend istream &operator>>(istream &s, SVFilterPlugin &o); + friend ostream &operator<<(ostream &s, SVFilterPlugin &o); +}; +istream &operator>>(istream &s, SVFilterPlugin &o); +ostream &operator<<(ostream &s, SVFilterPlugin &o); + +#endif diff --git a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.pro b/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.pro new file mode 100644 index 0000000..4b02242 --- /dev/null +++ b/SpiralSound/Plugins/SVFilterPlugin/SVFilterPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + SVFilterPlugin.h \ + SVFilterPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + SVFilterPlugin.C \ + SVFilterPluginGUI.C + +TARGET = SVFilterPlugin.so diff --git a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPluginGUI.C b/SpiralSound/Plugins/SVFilterPlugin/SVFilterPluginGUI.C new file mode 100644 index 0000000..19024cc --- /dev/null +++ b/SpiralSound/Plugins/SVFilterPlugin/SVFilterPluginGUI.C @@ -0,0 +1,82 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "SVFilterPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +SVFilterPluginGUI::SVFilterPluginGUI(int w, int h,SVFilterPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + Cutoff = new Fl_Slider(15, 20, 20, 70, "Cutoff"); + Cutoff->type(4); + Cutoff->selection_color(GUI_COLOUR); + Cutoff->labelsize(10); + Cutoff->maximum(1); + Cutoff->step(0.0001); + Cutoff->value(1); + Cutoff->callback((Fl_Callback*)cb_Cutoff); + + Resonance = new Fl_Knob(58, 18, 45, 45, "Emphasis"); + Resonance->color(GUI_COLOUR); + Resonance->type(Fl_Knob::DOTLIN); + Resonance->labelsize(10); + Resonance->maximum(1); + Resonance->step(0.00001); + Resonance->value(0); + Resonance->callback((Fl_Callback*)cb_Resonance); + + Reset = new Fl_Button(60,80,40,20,"Reset"); + Reset->labelsize(10); + Reset->callback((Fl_Callback*)cb_Reset); + + end(); +} + +void SVFilterPluginGUI::UpdateValues() +{ + Cutoff->value(100.0f-sqrt(m_Plugin->GetCutoff()-10.0f)); + Resonance->value(m_Plugin->GetResonance()-1.0f); +} + +inline void SVFilterPluginGUI::cb_Cutoff_i(Fl_Slider* o, void* v) +{ + float value=1.0f-o->value(); +// m_Plugin->SetCutoff((value*value)+10.0f); + m_Plugin->SetCutoff(value); +} +void SVFilterPluginGUI::cb_Cutoff(Fl_Slider* o, void* v) +{ ((SVFilterPluginGUI*)(o->parent()))->cb_Cutoff_i(o,v); } + +inline void SVFilterPluginGUI::cb_Resonance_i(Fl_Knob* o, void* v) +{ m_Plugin->SetResonance(o->value()); } +void SVFilterPluginGUI::cb_Resonance(Fl_Knob* o, void* v) +{ ((SVFilterPluginGUI*)(o->parent()))->cb_Resonance_i(o,v); } + +inline void SVFilterPluginGUI::cb_Reset_i(Fl_Button* o, void* v) +{ m_Plugin->Clear(); } +void SVFilterPluginGUI::cb_Reset(Fl_Button* o, void* v) +{ ((SVFilterPluginGUI*)(o->parent()))->cb_Reset_i(o,v); } diff --git a/SpiralSound/Plugins/SVFilterPlugin/SVFilterPluginGUI.h b/SpiralSound/Plugins/SVFilterPlugin/SVFilterPluginGUI.h new file mode 100644 index 0000000..031b795 --- /dev/null +++ b/SpiralSound/Plugins/SVFilterPlugin/SVFilterPluginGUI.h @@ -0,0 +1,59 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "SVFilterPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" + +#ifndef SVFilterGUI +#define SVFilterGUI + + +class SVFilterPluginGUI : public SpiralPluginGUI +{ +public: + SVFilterPluginGUI(int w, int h, SVFilterPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + SVFilterPlugin *m_Plugin; + +private: + + Fl_Group *GUIFilterGroup; + Fl_Slider *Cutoff; + Fl_Knob *Resonance; + Fl_Button *Reset; + + //// Callbacks //// + + inline void cb_Cutoff_i(Fl_Slider* o, void* v); + static void cb_Cutoff(Fl_Slider*, void*); + inline void cb_Resonance_i(Fl_Knob* o, void* v); + static void cb_Resonance(Fl_Knob* o, void* v); + inline void cb_Reset_i(Fl_Button* o, void* v); + static void cb_Reset(Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/SVFilterPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/SVFilterPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..1a40e26 --- /dev/null +++ b/SpiralSound/Plugins/SVFilterPlugin/SpiralIcon.xpm @@ -0,0 +1,314 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 275 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #2D2F00", +"!. c #111200", +"~. c #0B0C00", +"{. c #FFF200", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #050500", +"|. c #515151", +"1. c #A6A6A7", +"2. c #827E93", +"3. c #615C77", +"4. c #EAEAED", +"5. c #DFDFE1", +"6. c #1E1D24", +"7. c #9894A7", +"8. c #B1AEBB", +"9. c #69686F", +"0. c #000001", +"a. c #615C76", +"b. c #5F5A75", +"c. c #413E4D", +"d. c #020203", +"e. c #1A1A1C", +"f. c #C3C1CB", +"g. c #9D9D9D", +"h. c #202020", +"i. c #383838", +"j. c #4C4C4C", +"k. c #C9C7D0", +"l. c #F1F1F1", +"m. c #F8F8F8", +"n. c #232323", +"o. c #AEACB9", +"p. c #FEFEFE", +"q. c #1D1D1D", +"r. c #B7B5C1", +"s. c #9390A2", +"t. c #BBBBBB", +"u. c #414141", +"v. c #030303", +"w. c #F4F4F6", +"x. c #605B76", +"y. c #736E86", +"z. c #D8D8D8", +"A. c #727272", +"B. c #101010", +"C. c #CCCBD3", +"D. c #747087", +"E. c #6D6881", +"F. c #1C1C1C", +"G. c #242424", +"H. c #656566", +"I. c #F6F6F6", +"J. c #E8E6EA", +"K. c #706B84", +"L. c #E3E1E6", +"M. c #474746", +"N. c #151515", +"O. c #C8C8C8", +"P. c #AEAEAE", +"Q. c #010100", +"R. c #373639", +"S. c #FDFCFE", +"T. c #ABA8B7", +"U. c #F1F0F3", +"V. c #6D6980", +"W. c #0A090E", +"X. c #95929E", +"Y. c #0A0810", +"Z. c #0D0D0D", +"`. c #050505", +" + c #5B5A5C", +".+ c #F7F6F7", +"++ c #F4F3F5", +"@+ c #908C9F", +"#+ c #C8C6D0", +"$+ c #837E96", +"%+ c #86868A", +"&+ c #070608", +"*+ c #ECEBEE", +"=+ c #5B5571", +"-+ c #646078", +";+ c #AFAFB0", +">+ c #454545", +",+ c #363636", +"'+ c #7A7A7A", +")+ c #C8C8C9", +"!+ c #212025", +"~+ c #060607", +"{+ c #969699", +"]+ c #FAFAFA", +"^+ c #F8F8F9", +"/+ c #A29EAF", +"(+ c #F7F6F8", +"_+ c #F0F0F1", +":+ c #B8B7B9", +"<+ c #E4E4E4", +"[+ c #FDFDFD", +"}+ c #A5A2B2", +"|+ c #3B3456", +"1+ c #A8A5B4", +"2+ c #525252", +"3+ c #848387", +"4+ c #CDCDCD", +"5+ c #8D899C", +"6+ c #494262", +"7+ c #68627C", +"8+ c #40395A", +"9+ c #ECECEC", +"0+ c #020202", +"a+ c #B4B5B5", +"b+ c #0B0B0B", +"c+ c #313232", +"d+ c #E3E3E3", +"e+ c #B1AEBC", +"f+ c #BDBBC6", +"g+ c #3C3556", +"h+ c #898599", +"i+ c #EDEDED", +"j+ c #39393A", +"k+ c #040404", +"l+ c #333333", +"m+ c #F5F5F5", +"n+ c #2B2B2B", +"o+ c #2D2A3D", +"p+ c #B6B4C1", +"q+ c #F5F5F6", +"r+ c #605A76", +"s+ c #DAD8DF", +"t+ c #F5F4F6", +"u+ c #615B76", +"v+ c #524D6A", +"w+ c #E4E3E8", +"x+ c #D5D5D5", +"y+ c #1B1B1B", +"z+ c #303030", +"A+ c #AAABAB", +"B+ c #585464", +"C+ c #B0AEBB", +"D+ c #A29FAF", +"E+ c #E9E8E9", +"F+ c #787779", +"G+ c #0F0E15", +"H+ c #2D2D2E", +"I+ c #595959", +"J+ c #FAFAFB", +"K+ c #807B92", +"L+ c #B0ADBB", +"M+ c #E8E7EB", +"N+ c #3A3258", +"O+ c #E6E5EA", +"P+ c #DFDEE3", +"Q+ c #443E5E", +"R+ c #BAB8C4", +"S+ c #C1BFCA", +"T+ c #E0E0E5", +"U+ c #D0CED6", +"V+ c #362F52", +"W+ c #CECCD5", +"X+ c #413A5B", +"Y+ c #6A657F", +"Z+ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.6 {.{.6 6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 }.6 6 6 {.{.6 6 6 6 6 E |.1.4 2. ", +" 3.4.; 5...6 6 6 6 6 6 6 6 6 6 {.{.6 6 6 6 6 6 6 6.7. ", +" V @ 8.9.0.6 6 6 6 6 6 6 6 6 6 {.{.6 6 6 6 6 6 6 ", +" a.b.c.6 d.6 6 6 6 6 6 6 {.{.6 {.{.6 6 6 6 6 6 e. ", +" f.; ; g.h.h.i.j.h.6 6 6 6 {.6 6 6 {.{.6 6 6 6 6 6 ", +" k.; ; l.m.; ; ; n.6 {.{.{.6 6 6 6 6 {.{.{.{.{.6 6 ", +" o.; ; ; ; p.; ; q.6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 r., ", +" s.; ; p.; : t.u.v.6 6 6 {.6 {.6 {.6 {.{.{.6 6 6 6 p.w.x. ", +" y.; ; ; z.A.B.6 6 6 6 {.6 6 {.6 {.6 {.6 6 6 6 6 6 ; ; C.D. ", +" E.J ; : F.6 6 6 6 G...6 {.6 {.6 {.6 {.{.{.6 6 6 H.I.; ; J.K. ", +" L.; ; M.6 E 6 N.O.P.{.6 6 6 {.6 6 {.6 Q.6 6 6 6 R.S.; ; > K. ", +" T.; U.V.W.6 6 P.p.; X.Y.6 6 6 6 6 6 6 6 Z.`.6 6 6 +.+; ; ++@+ ", +" K.#+! $+%+&+x ; ; *+=+-+;+l >+6 6 6 ,+'+)+!+6 6 6 ~+{+]+; ; ^+@ ", +" /+(+_+:+<+[+; }+|+1+; I.>+6 6 E 2+; ; 3+6 6 E 6 o 4+; ; = 5+ ", +" 6+> ; ; ; ; ; ; 7+8+; ; 9+i.6 6 0+D ; ; a+b+6 6 6 c+d+; ; e+ ", +" > ; ; ; ; f+g+h+; ; i+j+6 6 k+l+; ; m+n+6 6 o+p+; q+3 ", +" r+s+= ; t+u+v+w+; ; x+y+6 6 0+z+; ; ; A+2+B+ ", +" C+4 D+ X ; ; ; E+F+z+G+H+I+; ; ; p.J+K+ ", +" L+; ; ; ; ; M+N+O+; ; ; ; = P+Q+ ", +" R+S+T+4 ; ; U+V+W+; ; ; s h+T ", +" X+ Y+Z+h+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/SampleHoldPlugin/Makefile.in b/SpiralSound/Plugins/SampleHoldPlugin/Makefile.in new file mode 100644 index 0000000..2ad9cc0 --- /dev/null +++ b/SpiralSound/Plugins/SampleHoldPlugin/Makefile.in @@ -0,0 +1,169 @@ +# Generated automatically from Makefile.in by configure. +############################################################################# +# Makefile for building SampleHoldPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: SampleHoldPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + SampleHoldPlugin.h \ + SampleHoldPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + SampleHoldPlugin.C \ + SampleHoldPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + SampleHoldPlugin.o \ + SampleHoldPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SampleHoldPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake SampleHoldPlugin.pro + +dist: + $(TAR) SampleHoldPlugin.tar SampleHoldPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) SampleHoldPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +SampleHoldPlugin.o: SampleHoldPlugin.C \ + SampleHoldPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + SampleHoldPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +SampleHoldPluginGUI.o: SampleHoldPluginGUI.C \ + SampleHoldPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + SampleHoldPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.C b/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.C new file mode 100644 index 0000000..e5b189e --- /dev/null +++ b/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.C @@ -0,0 +1,101 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "SampleHoldPlugin.h" +#include "SampleHoldPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new SampleHoldPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0033; +} +} + +/////////////////////////////////////////////////////// + +SampleHoldPlugin::SampleHoldPlugin() +{ + m_PluginInfo.Name="SampleHold"; + m_PluginInfo.Width=220; + m_PluginInfo.Height=125; + m_PluginInfo.NumInputs=2; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Clock"); + m_PluginInfo.PortTips.push_back("Out"); +} + +SampleHoldPlugin::~SampleHoldPlugin() +{ +} + +PluginInfo &SampleHoldPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + m_val = 0; + m_flag = 0; + return Info; +} + +SpiralGUIType *SampleHoldPlugin::CreateGUI() +{ + m_GUI=NULL; + return m_GUI; +} + +void SampleHoldPlugin::Execute() +{ + // Just copy the data through. + GetOutputBuf(0)->Zero(); + if (InputExists(0) && InputExists(1)) + { + for (int i=0;iBUFSIZE;i++) + { + float v = GetInput(0,i); + float c = GetInput(1,i); + if (c > 0.666) + { + if (!m_flag) + { + m_val = v; + SetOutput(0,i,v); + m_flag = 1; + } + else + SetOutput(0,i,m_val); + } + else + SetOutput(0,i,m_val); + if (c < 0.333) + { + m_flag = 0; + } + } + } +} diff --git a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.h b/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.h new file mode 100644 index 0000000..8cf6372 --- /dev/null +++ b/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.h @@ -0,0 +1,45 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef SampleHoldPLUGIN +#define SampleHoldPLUGIN + +class SampleHoldPlugin : public SpiralPlugin +{ +public: + SampleHoldPlugin(); + virtual ~SampleHoldPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s) {} + virtual void StreamIn(istream &s) {} + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + +private: + float m_val; + short m_flag; +}; + +#endif diff --git a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.pro b/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.pro new file mode 100644 index 0000000..e31c146 --- /dev/null +++ b/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + SampleHoldPlugin.h \ + SampleHoldPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + SampleHoldPlugin.C \ + SampleHoldPluginGUI.C + +TARGET = SampleHoldPlugin.so diff --git a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPluginGUI.C b/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPluginGUI.C new file mode 100644 index 0000000..0b12fa7 --- /dev/null +++ b/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPluginGUI.C @@ -0,0 +1,41 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "SampleHoldPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +SampleHoldPluginGUI::SampleHoldPluginGUI(int w, int h,SampleHoldPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + end(); +} + + + +void SampleHoldPluginGUI::UpdateValues() +{ +} + diff --git a/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPluginGUI.h b/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPluginGUI.h new file mode 100644 index 0000000..0ae1fbf --- /dev/null +++ b/SpiralSound/Plugins/SampleHoldPlugin/SampleHoldPluginGUI.h @@ -0,0 +1,47 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "SampleHoldPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef SampleHoldGUI +#define SampleHoldGUI + + +class SampleHoldPluginGUI : public SpiralPluginGUI +{ +public: + SampleHoldPluginGUI(int w, int h, SampleHoldPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + SampleHoldPlugin *m_Plugin; +private: + + //// Callbacks //// +}; + +#endif diff --git a/SpiralSound/Plugins/SampleHoldPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/SampleHoldPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..9028783 --- /dev/null +++ b/SpiralSound/Plugins/SampleHoldPlugin/SpiralIcon.xpm @@ -0,0 +1,288 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 249 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #BFBFBF", +"n c #010102", +"o c #868689", +"p c #FEFDFE", +"q c #D9D7DE", +"r c #9C98AA", +"s c #FDFCFD", +"t c #DDDDDD", +"u c #575755", +"v c #5E5E5E", +"w c #C4C2CD", +"x c #423C5C", +"y c #F0F0F2", +"z c #939393", +"A c #555555", +"B c #4A4A4A", +"C c #282828", +"D c #C2C2C2", +"E c #DBDAE0", +"F c #615C78", +"G c #F6F6F7", +"H c #DADADA", +"I c #545454", +"J c #B8B8B8", +"K c #48445C", +"L c #2B2B2C", +"M c #D3D3D3", +"N c #C1BEC9", +"O c #474060", +"P c #31294D", +"Q c #716C85", +"R c #65607A", +"S c #625D78", +"T c #D5D4DB", +"U c #F7F7F7", +"V c #8B8B8B", +"W c #0D0D0D", +"X c #ADAD08", +"Y c #393643", +"Z c #47415F", +"` c #9692A4", +" . c #D9D8DE", +".. c #F7F7F8", +"+. c #918DA0", +"@. c #B8B5C1", +"#. c #D1D1D1", +"$. c #252525", +"%. c #E0E900", +"&. c #727175", +"*. c #FEFEFF", +"=. c #9D99AA", +"-. c #DBD9E0", +";. c #E9E9E9", +">. c #CBCBCB", +",. c #E0E0E0", +"'. c #6C6C6C", +"). c #515151", +"!. c #A6A6A7", +"~. c #827E93", +"{. c #615C77", +"]. c #EAEAED", +"^. c #DFDFE1", +"/. c #1E1D24", +"(. c #9894A7", +"_. c #B1AEBB", +":. c #69686F", +"<. c #615C76", +"[. c #5F5A75", +"}. c #413E4D", +"|. c #1A1A1C", +"1. c #C3C1CB", +"2. c #9D9D9D", +"3. c #202020", +"4. c #383838", +"5. c #4C4C4C", +"6. c #C9C7D0", +"7. c #F1F1F1", +"8. c #F8F8F8", +"9. c #232323", +"0. c #AEACB9", +"a. c #FEFEFE", +"b. c #1D1D1D", +"c. c #B7B5C1", +"d. c #9390A2", +"e. c #BBBBBB", +"f. c #414141", +"g. c #28272A", +"h. c #F4F4F6", +"i. c #605B76", +"j. c #736E86", +"k. c #D8D8D8", +"l. c #727272", +"m. c #848486", +"n. c #CCCBD3", +"o. c #747087", +"p. c #6D6881", +"q. c #1C1C1C", +"r. c #242424", +"s. c #656566", +"t. c #F6F6F6", +"u. c #E8E6EA", +"v. c #706B84", +"w. c #E3E1E6", +"x. c #474746", +"y. c #020202", +"z. c #C8C8C8", +"A. c #AEAEAE", +"B. c #373639", +"C. c #FDFCFE", +"D. c #ABA8B7", +"E. c #F1F0F3", +"F. c #6D6980", +"G. c #95929E", +"H. c #5B5A5C", +"I. c #F7F6F7", +"J. c #F4F3F5", +"K. c #908C9F", +"L. c #C8C6D0", +"M. c #837E96", +"N. c #86868A", +"O. c #ECEBEE", +"P. c #5B5571", +"Q. c #646078", +"R. c #AFAFB0", +"S. c #454545", +"T. c #363636", +"U. c #7A7A7A", +"V. c #C8C8C9", +"W. c #212025", +"X. c #969699", +"Y. c #FAFAFA", +"Z. c #F8F8F9", +"`. c #A29EAF", +" + c #F7F6F8", +".+ c #F0F0F1", +"++ c #B8B7B9", +"@+ c #E4E4E4", +"#+ c #FDFDFD", +"$+ c #A5A2B2", +"%+ c #3B3456", +"&+ c #A8A5B4", +"*+ c #525252", +"=+ c #848387", +"-+ c #CDCDCD", +";+ c #8D899C", +">+ c #494262", +",+ c #68627C", +"'+ c #40395A", +")+ c #ECECEC", +"!+ c #B4B5B5", +"~+ c #313232", +"{+ c #E3E3E3", +"]+ c #B1AEBC", +"^+ c #BDBBC6", +"/+ c #3C3556", +"(+ c #898599", +"_+ c #EDEDED", +":+ c #39393A", +"<+ c #333333", +"[+ c #F5F5F5", +"}+ c #2B2B2B", +"|+ c #2D2A3D", +"1+ c #B6B4C1", +"2+ c #F5F5F6", +"3+ c #605A76", +"4+ c #DAD8DF", +"5+ c #F5F4F6", +"6+ c #615B76", +"7+ c #524D6A", +"8+ c #E4E3E8", +"9+ c #D5D5D5", +"0+ c #1B1B1B", +"a+ c #303030", +"b+ c #AAABAB", +"c+ c #585464", +"d+ c #B0AEBB", +"e+ c #A29FAF", +"f+ c #E9E8E9", +"g+ c #787779", +"h+ c #2D2D2E", +"i+ c #595959", +"j+ c #FAFAFB", +"k+ c #807B92", +"l+ c #B0ADBB", +"m+ c #E8E7EB", +"n+ c #3A3258", +"o+ c #E6E5EA", +"p+ c #DFDEE3", +"q+ c #443E5E", +"r+ c #BAB8C4", +"s+ c #C1BFCA", +"t+ c #E0E0E5", +"u+ c #D0CED6", +"v+ c #362F52", +"w+ c #CECCD5", +"x+ c #413A5B", +"y+ c #6A657F", +"z+ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 6 ; m 6 6 n o p q ", +" r s ; t u 6 6 v w x y z 6 A ; B 6 6 C D ; E ", +" F G ; ; H I 6 6 6 J K L 6 6 6 6 6 6 6 M N O P Q R ", +" S T ; ; ; ; U V W 6 6 6 6 6 X X 6 6 6 6 Y Z ` ...+. ", +" @.; ; ; ; ; ; = #.$.6 6 6 X %.%.6 6 6 6 6 &.*.; ; =. ", +" -.; ; ;.M h >.,.'.6 6 6 6 %.6 %.6 6 6 6 6 6 ).!.4 ~. ", +" {.].; ^.6 6 6 6 6 6 6 6 6 6 %.6 %.6 6 6 6 6 6 6 /.(. ", +" Q @ _.:.6 6 6 6 6 6 6 6 6 6 %.6 %.6 6 6 6 6 6 6 ", +" <.[.}.6 6 6 6 6 6 6 6 6 6 %.6 %.6 6 6 6 6 6 6 |. ", +" 1.; ; 2.3.3.4.5.3.6 X %.X 6 %.6 X %.X 6 6 6 6 6 6 ", +" 6.; ; 7.8.; ; ; 9.6 %.6 %.%.X 6 6 X %.6 6 X X 6 6 ", +" 0.; ; ; ; a.; ; b.6 %.6 6 6 6 6 6 6 %.6 %.%.%.X 6 c., ", +" d.; ; a.; : e.f.%.%.X 6 6 6 6 6 6 6 %.%.%.6 %.X g.a.h.i. ", +" j.; ; ; k.l.6 6 X X 6 6 6 6 6 6 6 6 6 6 6 6 %.X m.; ; n.o. ", +" p.G ; : q.6 6 6 6 r.6 6 6 6 6 6 6 6 6 6 6 6 X %.s.t.; ; u.v. ", +" w.; ; x.6 6 6 y.z.A.6 6 6 6 6 6 6 6 6 6 6 6 6 6 B.C.; ; > v. ", +" D.; E.F.6 6 6 A.a.; G.6 6 6 6 6 6 6 6 6 6 6 6 6 6 H.I.; ; J.K. ", +" v.L.! M.N.6 v ; ; O.P.Q.R.l S.6 6 6 T.U.V.W.6 6 6 6 X.Y.; ; Z.@ ", +" `. +.+++@+#+; $+%+&+; t.S.6 6 6 *+; ; =+6 6 6 6 6 -+; ; = ;+ ", +" >+> ; ; ; ; ; ; ,+'+; ; )+4.6 6 6 B ; ; !+6 6 6 6 ~+{+; ; ]+ ", +" > ; ; ; ; ^+/+(+; ; _+:+6 6 6 <+; ; [+}+6 6 |+1+; 2+3 ", +" 3+4+= ; 5+6+7+8+; ; 9+0+6 6 6 a+; ; ; b+*+c+ ", +" d+4 e+ S ; ; ; f+g+a+n h+i+; ; ; a.j+k+ ", +" l+; ; ; ; ; m+n+o+; ; ; ; = p+q+ ", +" r+s+t+4 ; ; u+v+w+; ; ; q (+O ", +" x+ y+z+(+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/SamplerPlugin/Makefile.in b/SpiralSound/Plugins/SamplerPlugin/Makefile.in new file mode 100644 index 0000000..2651a11 --- /dev/null +++ b/SpiralSound/Plugins/SamplerPlugin/Makefile.in @@ -0,0 +1,176 @@ +############################################################################# +# Makefile for building SamplerPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: SamplerPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../RiffWav.h \ + SamplerPlugin.h \ + SamplerPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + SamplerPlugin.C \ + SamplerPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + ../../RiffWav.o \ + SamplerPlugin.o \ + SamplerPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SamplerPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake SamplerPlugin.pro + +dist: + $(TAR) SamplerPlugin.tar SamplerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) SamplerPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +../../RiffWav.o: ../../RiffWav.C \ + ../../RiffWav.h \ + ../../Sample.h \ + ../../SpiralInfo.h + +SamplerPlugin.o: SamplerPlugin.C \ + SamplerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + SamplerPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + SpiralIcon.xpm \ + ../../RiffWav.h \ + ../../NoteTable.h + +SamplerPluginGUI.o: SamplerPluginGUI.C \ + SamplerPluginGUI.h \ + SamplerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H + diff --git a/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.C b/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.C new file mode 100644 index 0000000..1f47ad0 --- /dev/null +++ b/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.C @@ -0,0 +1,286 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "SamplerPlugin.h" +#include "SamplerPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../RiffWav.h" +#include "../../NoteTable.h" + +static const int NOTETRIG = NUM_SAMPLES*2+1; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new SamplerPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0010; +} +} + +/////////////////////////////////////////////////////// + +SamplerPlugin::SamplerPlugin() +{ + m_PluginInfo.Name="Sampler"; + m_PluginInfo.Width=245; + m_PluginInfo.Height=420; + m_PluginInfo.NumInputs=18; + m_PluginInfo.NumOutputs=9; + m_PluginInfo.PortTips.push_back("Sample 1 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 1 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 2 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 2 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 3 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 3 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 4 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 4 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 5 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 5 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 6 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 6 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 7 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 7 Trigger"); + m_PluginInfo.PortTips.push_back("Sample 8 Pitch"); + m_PluginInfo.PortTips.push_back("Sample 8 Trigger"); + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Sample trigger pitch"); + m_PluginInfo.PortTips.push_back("Mixed Output"); + m_PluginInfo.PortTips.push_back("Sample 1 Output"); + m_PluginInfo.PortTips.push_back("Sample 2 Output"); + m_PluginInfo.PortTips.push_back("Sample 3 Output"); + m_PluginInfo.PortTips.push_back("Sample 4 Output"); + m_PluginInfo.PortTips.push_back("Sample 5 Output"); + m_PluginInfo.PortTips.push_back("Sample 6 Output"); + m_PluginInfo.PortTips.push_back("Sample 7 Output"); + m_PluginInfo.PortTips.push_back("Sample 8 Output"); + + for (int n=0; nVolume = 1.0f; + NewDesc->Pitch = 1.0f; + NewDesc->PitchMod = 1.0f; + NewDesc->SamplePos = -1; + NewDesc->Loop = false; + NewDesc->Note = n; + NewDesc->Pathname = "None"; + NewDesc->TriggerUp = true; + NewDesc->SampleRate = 44100; + NewDesc->Stereo = false; + + m_SampleDescVec.push_back(NewDesc); + } + + m_Version=2; +} + +SamplerPlugin::~SamplerPlugin() +{ + for (vector::iterator i=m_SampleVec.begin(); + i!=m_SampleVec.end(); i++) + { + delete(*i); + } + + for (vector::iterator i=m_SampleDescVec.begin(); + i!=m_SampleDescVec.end(); i++) + { + delete(*i); + } +} + +PluginInfo &SamplerPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host);; +} + +SpiralGUIType *SamplerPlugin::CreateGUI() +{ + m_GUI = new SamplerPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void SamplerPlugin::Execute() +{ + for (int s=0; sZero(); + } + + float Freq=0; + + for (int n=0; nBUFSIZE; n++) + { + Freq=GetInputPitch(NOTETRIG,n); + + for (int s=0; sGetLength()) + { + // Convert the CV input into a useable trigger + + if (GetInput(s*2+1,n)>0 || feq(Freq,NoteTable[S->Note],0.01f)) + { + if (S->TriggerUp) + { + S->SamplePos=0; + S->TriggerUp=false; + + if (InputExists(s*2)) + { + // Get the pitch from the CV + float PlayFreq=GetInputPitch(s*2,n); + + // assumtion: base frequency = 440 (middle A) + S->Pitch = PlayFreq/440; + S->Pitch *= S->SampleRate/(float)m_HostInfo->SAMPLERATE; + + // sort of legacy + if (S->Stereo) S->Pitch/=2; + } + } + } + else + { + S->TriggerUp=true; + + // end it if it's looping + if (S->Loop) + { + S->SamplePos=-1; + } + } + + // if the sample has ended + if (S->SamplePos>=m_SampleVec[s]->GetLength()) + { + if (S->Loop) S->SamplePos=0; + else + { + S->SamplePos=-1; + } + } + + if (S->SamplePos!=-1) + { + // mix the sample to the output. + MixOutput(0,n,(*m_SampleVec[s])[S->SamplePos]*S->Volume); + // copy the sample to it's individual output. + SetOutput(s+1,n,((*m_SampleVec[s])[S->SamplePos]*S->Volume)); + + S->SamplePos+=S->Pitch*S->PitchMod; + } + } + } + } +} + +void SamplerPlugin::StreamOut(ostream &s) +{ + s<1) + { + for (int n=0; nVolume<<" "<< + m_SampleDescVec[n]->PitchMod<<" "<< + m_SampleDescVec[n]->Pathname.size()<<" "<< + m_SampleDescVec[n]->Pathname<<" "<< + m_SampleDescVec[n]->Note<Volume<<" "<< + m_SampleDescVec[n]->PitchMod<<" "<< + m_SampleDescVec[n]->Pathname<<" "<< + m_SampleDescVec[n]->Note<>version; + if (version>1) + { + char Buf[4096]; + + for (int n=0; n>m_SampleDescVec[n]->Volume>> + m_SampleDescVec[n]->PitchMod; + + int size; + s>>size; + s.ignore(1); + s.get(Buf,size+1); + m_SampleDescVec[n]->Pathname=Buf; + + s>>m_SampleDescVec[n]->Note; + if (m_SampleDescVec[n]->Pathname!="None") LoadSample(n, m_SampleDescVec[n]->Pathname); + } + } + else + { + for (int n=0; n>m_SampleDescVec[n]->Volume>> + m_SampleDescVec[n]->PitchMod>> + m_SampleDescVec[n]->Pathname>> + m_SampleDescVec[n]->Note; + if (m_SampleDescVec[n]->Pathname!="None") LoadSample(n, m_SampleDescVec[n]->Pathname); + } + } +} + +void SamplerPlugin::LoadSample(int n, const string &Name) +{ + WavFile Wav; + if (Wav.Open(Name,WavFile::READ)) + { + m_SampleVec[n]->Allocate(Wav.GetSize()); + Wav.Load(*m_SampleVec[n]); + m_SampleDescVec[n]->Pathname=Name; + m_SampleDescVec[n]->SampleRate=Wav.GetSamplerate(); + m_SampleDescVec[n]->Stereo=Wav.IsStereo(); + m_SampleDescVec[n]->Pitch *= m_SampleDescVec[n]->SampleRate/(float)m_HostInfo->SAMPLERATE; + } +} diff --git a/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.h b/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.h new file mode 100644 index 0000000..dcb6af9 --- /dev/null +++ b/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.h @@ -0,0 +1,73 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef SamplerPLUGIN +#define SamplerPLUGIN + +static const int NUM_SAMPLES = 8; + +struct SampleDesc +{ + string Pathname; + float Volume; + float Pitch; + float PitchMod; + bool Loop; + int Note; + bool TriggerUp; + float SamplePos; + int SampleRate; + bool Stereo; +}; + +class SamplerPlugin : public SpiralPlugin +{ +public: + SamplerPlugin(); + virtual ~SamplerPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void LoadSample(int n, const string &Name); + + void SetVolume(int n, float s) { m_SampleDescVec[n]->Volume=s; } + float GetVolume(int n) { return m_SampleDescVec[n]->Volume; } + void SetPitch(int n, float s) { m_SampleDescVec[n]->PitchMod=s; } + float GetPitch(int n) { return m_SampleDescVec[n]->PitchMod; } + void SetLoop(int n, bool s) { m_SampleDescVec[n]->Loop=s; } + bool GetLoop(int n) { return m_SampleDescVec[n]->Loop; } + void SetNote(int n, int s) { m_SampleDescVec[n]->Note=s; } + int GetNote(int n) { return m_SampleDescVec[n]->Note; } + + vector m_SampleVec; + vector m_SampleDescVec; + +private: +}; + +#endif diff --git a/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.pro b/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.pro new file mode 100644 index 0000000..ef317e9 --- /dev/null +++ b/SpiralSound/Plugins/SamplerPlugin/SamplerPlugin.pro @@ -0,0 +1,19 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../RiffWav.h \ + SamplerPlugin.h \ + SamplerPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + SamplerPlugin.C \ + SamplerPluginGUI.C + +TARGET = SamplerPlugin.so diff --git a/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.C b/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.C new file mode 100644 index 0000000..46da9e8 --- /dev/null +++ b/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.C @@ -0,0 +1,124 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "SamplerPluginGUI.h" +#include +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +SamplerPluginGUI::SamplerPluginGUI(int w, int h,SamplerPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + for (int n=0; nlabelsize(10); + m_Load[n]->callback((Fl_Callback*)cb_Load,(void*)&Numbers[n]); + add(m_Load[n]); + + m_Volume[n] = new Fl_Knob(60, 15+n*50, 38, 38, "Volume"); + m_Volume[n]->color(GUI_COLOUR); + m_Volume[n]->type(Fl_Knob::LINELIN); + m_Volume[n]->labelsize(10); + m_Volume[n]->maximum(2); + m_Volume[n]->step(0.001); + m_Volume[n]->value(1); + m_Volume[n]->callback((Fl_Callback*)cb_Volume,(void*)&Numbers[n]); + add(m_Volume[n]); + + m_Pitch[n] = new Fl_Knob(100, 15+n*50, 38, 38, "Pitch"); + m_Pitch[n]->color(GUI_COLOUR); + m_Pitch[n]->type(Fl_Knob::LINELIN); + m_Pitch[n]->labelsize(10); + m_Pitch[n]->maximum(10); + m_Pitch[n]->step(0.001); + m_Pitch[n]->value(1); + m_Pitch[n]->callback((Fl_Callback*)cb_Pitch,(void*)&Numbers[n]); + add(m_Pitch[n]); + + m_Loop[n] = new Fl_Button(140, 20+n*50, 50, 30, "Loop"); + m_Loop[n]->labelsize(10); + m_Loop[n]->type(1); + m_Loop[n]->callback((Fl_Callback*)cb_Loop,(void*)&Numbers[n]); + add(m_Loop[n]); + + m_Note[n] = new Fl_Counter(190, 20+n*50, 50, 30, "Trig Note"); + m_Note[n]->labelsize(10); + m_Note[n]->type(FL_SIMPLE_COUNTER); + m_Note[n]->step(1); + m_Note[n]->value(n); + m_Note[n]->callback((Fl_Callback*)cb_Note,(void*)&Numbers[n]); + add(m_Note[n]); + } + + end(); +} + +void SamplerPluginGUI::UpdateValues() +{ + for (int n=0; nvalue(m_Plugin->GetVolume(n)); + m_Pitch[n]->value(m_Plugin->GetPitch(n)); + m_Note[n]->value(m_Plugin->GetNote(n)); + m_Loop[n]->value(m_Plugin->GetLoop(n)); + } +} + +inline void SamplerPluginGUI::cb_Load_i(Fl_Button* o, void* v) +{ + char *fn=fl_file_chooser("Load a sample", "{*.wav,*.WAV}",NULL); + + if (fn && fn!='\0') + { + m_Plugin->LoadSample(*(int*)v,fn); + } +} +void SamplerPluginGUI::cb_Load(Fl_Button* o, void* v) +{ ((SamplerPluginGUI*)(o->parent()))->cb_Load_i(o,v);} + +inline void SamplerPluginGUI::cb_Volume_i(Fl_Knob* o, void* v) +{ m_Plugin->SetVolume(*(int*)v,o->value()); } +void SamplerPluginGUI::cb_Volume(Fl_Knob* o, void* v) +{ ((SamplerPluginGUI*)(o->parent()))->cb_Volume_i(o,v);} + +inline void SamplerPluginGUI::cb_Pitch_i(Fl_Knob* o, void* v) +{ m_Plugin->SetPitch(*(int*)v,o->value()); } +void SamplerPluginGUI::cb_Pitch(Fl_Knob* o, void* v) +{ ((SamplerPluginGUI*)(o->parent()))->cb_Pitch_i(o,v);} + +inline void SamplerPluginGUI::cb_Loop_i(Fl_Button* o, void* v) +{ m_Plugin->SetLoop(*(int*)v,o->value()); } +void SamplerPluginGUI::cb_Loop(Fl_Button* o, void* v) +{ ((SamplerPluginGUI*)(o->parent()))->cb_Loop_i(o,v);} + +inline void SamplerPluginGUI::cb_Note_i(Fl_Counter* o, void* v) +{ m_Plugin->SetNote(*(int*)v,(int)o->value()); } +void SamplerPluginGUI::cb_Note(Fl_Counter* o, void* v) +{ ((SamplerPluginGUI*)(o->parent()))->cb_Note_i(o,v);} + diff --git a/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.h b/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.h new file mode 100644 index 0000000..76a2163 --- /dev/null +++ b/SpiralSound/Plugins/SamplerPlugin/SamplerPluginGUI.h @@ -0,0 +1,65 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "SamplerPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" + +#ifndef MixerGUI +#define MixerGUI + + +class SamplerPluginGUI : public SpiralPluginGUI +{ +public: + SamplerPluginGUI(int w, int h, SamplerPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + SamplerPlugin *m_Plugin; +private: + + int Numbers[NUM_SAMPLES]; + + Fl_Button* m_Load[NUM_SAMPLES]; + Fl_Knob* m_Volume[NUM_SAMPLES]; + Fl_Knob* m_Pitch[NUM_SAMPLES]; + Fl_Button* m_Loop[NUM_SAMPLES]; + Fl_Counter* m_Note[NUM_SAMPLES]; + + //// Callbacks //// + inline void cb_Load_i(Fl_Button* o, void* v); + static void cb_Load(Fl_Button* o, void* v); + inline void cb_Volume_i(Fl_Knob* o, void* v); + static void cb_Volume(Fl_Knob* o, void* v); + inline void cb_Pitch_i(Fl_Knob* o, void* v); + static void cb_Pitch(Fl_Knob* o, void* v); + inline void cb_Loop_i(Fl_Button* o, void* v); + static void cb_Loop(Fl_Button* o, void* v); + inline void cb_Note_i(Fl_Counter* o, void* v); + static void cb_Note(Fl_Counter* o, void* v); + +}; + +#endif diff --git a/SpiralSound/Plugins/SamplerPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/SamplerPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..acaec93 --- /dev/null +++ b/SpiralSound/Plugins/SamplerPlugin/SpiralIcon.xpm @@ -0,0 +1,322 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 283 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0A0A0A", +"+. c #151700", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #282900", +"!. c #030300", +"~. c #070700", +"{. c #020200", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #FEF100", +"|. c #515151", +"1. c #A6A6A7", +"2. c #827E93", +"3. c #615C77", +"4. c #EAEAED", +"5. c #DFDFE1", +"6. c #0C0C0C", +"7. c #191700", +"8. c #1E1D24", +"9. c #9894A7", +"0. c #B1AEBB", +"a. c #69686F", +"b. c #000001", +"c. c #615C76", +"d. c #5F5A75", +"e. c #413E4D", +"f. c #020203", +"g. c #1A1900", +"h. c #1A1A1C", +"i. c #C3C1CB", +"j. c #9D9D9D", +"k. c #202020", +"l. c #383838", +"m. c #4C4C4C", +"n. c #111112", +"o. c #C9C7D0", +"p. c #F1F1F1", +"q. c #F8F8F8", +"r. c #232323", +"s. c #050408", +"t. c #AEACB9", +"u. c #FEFEFE", +"v. c #1D1D1D", +"w. c #B7B5C1", +"x. c #9390A2", +"y. c #BBBBBB", +"z. c #414141", +"A. c #030303", +"B. c #28272A", +"C. c #F4F4F6", +"D. c #605B76", +"E. c #736E86", +"F. c #D8D8D8", +"G. c #727272", +"H. c #101010", +"I. c #848486", +"J. c #CCCBD3", +"K. c #747087", +"L. c #6D6881", +"M. c #1C1C1C", +"N. c #242424", +"O. c #656566", +"P. c #F6F6F6", +"Q. c #E8E6EA", +"R. c #706B84", +"S. c #E3E1E6", +"T. c #474746", +"U. c #151515", +"V. c #C8C8C8", +"W. c #AEAEAE", +"X. c #070707", +"Y. c #010100", +"Z. c #373639", +"`. c #FDFCFE", +" + c #ABA8B7", +".+ c #F1F0F3", +"++ c #6D6980", +"@+ c #0A090E", +"#+ c #95929E", +"$+ c #0A0810", +"%+ c #0D0D0D", +"&+ c #050505", +"*+ c #5B5A5C", +"=+ c #F7F6F7", +"-+ c #F4F3F5", +";+ c #908C9F", +">+ c #C8C6D0", +",+ c #837E96", +"'+ c #86868A", +")+ c #070608", +"!+ c #ECEBEE", +"~+ c #5B5571", +"{+ c #646078", +"]+ c #AFAFB0", +"^+ c #454545", +"/+ c #363636", +"(+ c #7A7A7A", +"_+ c #C8C8C9", +":+ c #212025", +"<+ c #060607", +"[+ c #969699", +"}+ c #FAFAFA", +"|+ c #F8F8F9", +"1+ c #A29EAF", +"2+ c #F7F6F8", +"3+ c #F0F0F1", +"4+ c #B8B7B9", +"5+ c #E4E4E4", +"6+ c #FDFDFD", +"7+ c #A5A2B2", +"8+ c #3B3456", +"9+ c #A8A5B4", +"0+ c #525252", +"a+ c #848387", +"b+ c #CDCDCD", +"c+ c #8D899C", +"d+ c #494262", +"e+ c #68627C", +"f+ c #40395A", +"g+ c #ECECEC", +"h+ c #020202", +"i+ c #B4B5B5", +"j+ c #0B0B0B", +"k+ c #313232", +"l+ c #E3E3E3", +"m+ c #B1AEBC", +"n+ c #BDBBC6", +"o+ c #3C3556", +"p+ c #898599", +"q+ c #EDEDED", +"r+ c #39393A", +"s+ c #040404", +"t+ c #333333", +"u+ c #F5F5F5", +"v+ c #2B2B2B", +"w+ c #2D2A3D", +"x+ c #B6B4C1", +"y+ c #F5F5F6", +"z+ c #605A76", +"A+ c #DAD8DF", +"B+ c #F5F4F6", +"C+ c #615B76", +"D+ c #524D6A", +"E+ c #E4E3E8", +"F+ c #D5D5D5", +"G+ c #1B1B1B", +"H+ c #303030", +"I+ c #AAABAB", +"J+ c #585464", +"K+ c #B0AEBB", +"L+ c #A29FAF", +"M+ c #E9E8E9", +"N+ c #787779", +"O+ c #0F0E15", +"P+ c #2D2D2E", +"Q+ c #595959", +"R+ c #FAFAFB", +"S+ c #807B92", +"T+ c #B0ADBB", +"U+ c #E8E7EB", +"V+ c #3A3258", +"W+ c #E6E5EA", +"X+ c #DFDEE3", +"Y+ c #443E5E", +"Z+ c #BAB8C4", +"`+ c #C1BFCA", +" @ c #E0E0E5", +".@ c #D0CED6", +"+@ c #362F52", +"@@ c #CECCD5", +"#@ c #413A5B", +"$@ c #6A657F", +"%@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 6 6 ~.{.6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 6 }.}.6 6 6 6 6 6 6 6 E |.1.4 2. ", +" 3.4.; 5.6.6 6 6 6 6 6 }.6 }.6 6 6 6 6 6 6 6 7.6 8.9. ", +" V @ 0.a.b.6 6 6 6 6 6 }.6 6 }.6 6 6 }.}.6 6 7.6 ", +" c.d.e.6 f.6 6 6 6 6 }.6 6 }.6 6 }.6 g.}.6 6 6 h. ", +" i.; ; j.k.k.l.m.k.6 }.}.}.}.}.}.}.}.}.}.}.}.6 6 n. ", +" o.; ; p.q.; ; ; r.6 6 }.6 6 }.6 6 }.6 6 }.}.6 6 s. ", +" t.; ; ; ; u.; ; v.6 6 }.6 6 }.6 6 }.6 6 6 6 6 6 6 w., ", +" x.; ; u.; : y.z.A.6 }.6 6 6 6 }.}.6 6 6 6 6 6 6 B.u.C.D. ", +" E.; ; ; F.G.H.6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 I.; ; J.K. ", +" L.J ; : M.6 6 6 6 N.6 6 6 6 6 6 6 6 6 6 6 6 6 6 O.P.; ; Q.R. ", +" S.; ; T.6 E 6 U.V.W.X.6 6 6 6 6 6 6 6 Y.6 6 6 6 Z.`.; ; > R. ", +" +; .+++@+6 6 W.u.; #+$+6 6 6 6 6 6 6 6 %+&+6 6 6 *+=+; ; -+;+ ", +" R.>+! ,+'+)+x ; ; !+~+{+]+l ^+6 6 6 /+(+_+:+6 6 6 <+[+}+; ; |+@ ", +" 1+2+3+4+5+6+; 7+8+9+; P.^+6 6 E 0+; ; a+6 6 E 6 o b+; ; = c+ ", +" d+> ; ; ; ; ; ; e+f+; ; g+l.6 6 h+D ; ; i+j+6 6 6 k+l+; ; m+ ", +" > ; ; ; ; n+o+p+; ; q+r+6 6 s+t+; ; u+v+6 6 w+x+; y+3 ", +" z+A+= ; B+C+D+E+; ; F+G+6 6 h+H+; ; ; I+0+J+ ", +" K+4 L+ X ; ; ; M+N+H+O+P+Q+; ; ; u.R+S+ ", +" T+; ; ; ; ; U+V+W+; ; ; ; = X+Y+ ", +" Z+`+ @4 ; ; .@+@@@; ; ; s p+T ", +" #@ $@%@p+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/ScopePlugin/Makefile.in b/SpiralSound/Plugins/ScopePlugin/Makefile.in new file mode 100644 index 0000000..ed84711 --- /dev/null +++ b/SpiralSound/Plugins/ScopePlugin/Makefile.in @@ -0,0 +1,168 @@ +############################################################################# +# Makefile for building ScopePlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: ScopePlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ScopePlugin.h \ + ScopePluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ScopePlugin.C \ + ScopePluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + ScopePlugin.o \ + ScopePluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = ScopePlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake ScopePlugin.pro + +dist: + $(TAR) ScopePlugin.tar ScopePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) ScopePlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +ScopePlugin.o: ScopePlugin.C \ + ScopePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ScopePluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +ScopePluginGUI.o: ScopePluginGUI.C \ + ScopePluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ScopePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/ScopePlugin/ScopePlugin.C b/SpiralSound/Plugins/ScopePlugin/ScopePlugin.C new file mode 100644 index 0000000..ce662a0 --- /dev/null +++ b/SpiralSound/Plugins/ScopePlugin/ScopePlugin.C @@ -0,0 +1,81 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "ScopePlugin.h" +#include "ScopePluginGUI.h" +#include +#include "SpiralIcon.xpm" + + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new ScopePlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0001; +} +} + +/////////////////////////////////////////////////////// + +ScopePlugin::ScopePlugin() +{ + m_PluginInfo.Name="Scope"; + m_PluginInfo.Width=220; + m_PluginInfo.Height=125; + m_PluginInfo.NumInputs=1; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Output"); +} + +ScopePlugin::~ScopePlugin() +{ +} + +PluginInfo &ScopePlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + return Info; +} + +SpiralGUIType *ScopePlugin::CreateGUI() +{ + m_GUI = new ScopePluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void ScopePlugin::Execute() +{ + // Just copy the data through. + if (GetOutputBuf(0)) GetOutputBuf(0)->Zero(); + if (GetInput(0)) GetOutputBuf(0)->Mix(*GetInput(0),0); + + m_GUI->redraw(); +} + diff --git a/SpiralSound/Plugins/ScopePlugin/ScopePlugin.h b/SpiralSound/Plugins/ScopePlugin/ScopePlugin.h new file mode 100644 index 0000000..2a40534 --- /dev/null +++ b/SpiralSound/Plugins/ScopePlugin/ScopePlugin.h @@ -0,0 +1,43 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef SCOPEPLUGIN +#define SCOPEPLUGIN + +class ScopePlugin : public SpiralPlugin +{ +public: + ScopePlugin(); + virtual ~ScopePlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s) {} + virtual void StreamIn(istream &s) {} + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + +private: +}; + +#endif diff --git a/SpiralSound/Plugins/ScopePlugin/ScopePlugin.pro b/SpiralSound/Plugins/ScopePlugin/ScopePlugin.pro new file mode 100644 index 0000000..efd7469 --- /dev/null +++ b/SpiralSound/Plugins/ScopePlugin/ScopePlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ScopePlugin.h \ + ScopePluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ScopePlugin.C \ + ScopePluginGUI.C + +TARGET = ScopePlugin.so diff --git a/SpiralSound/Plugins/ScopePlugin/ScopePluginGUI.C b/SpiralSound/Plugins/ScopePlugin/ScopePluginGUI.C new file mode 100644 index 0000000..9843eff --- /dev/null +++ b/SpiralSound/Plugins/ScopePlugin/ScopePluginGUI.C @@ -0,0 +1,103 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "ScopePluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +ScopeWidget::ScopeWidget(int x,int y,int w,int h,const char *l, int BUFSIZE) : +Fl_Widget(x,y,w,h,l), +m_Data(NULL), +m_Channels(1), +m_Bufsize(BUFSIZE) +{ +} + + +void ScopeWidget::draw() +{ + int ho=h()/2; + fl_color(GUIBG_COLOUR); + fl_rectf(x(), y(), w(), h()); + if (!m_Data) return; + fl_push_clip(x(), y(), w(), h()); + + float Value=0,NextValue=0; + + fl_color(FL_WHITE); + for(int n=0; nBUFSIZE); + Bypass = new Fl_Button(175, 107, 40, 16, "Bypass"); + Bypass->labelsize(10); + Bypass->type(1); + Bypass->callback((Fl_Callback*)cb_Bypass); + end(); +} + +void ScopePluginGUI::Display(const float *data) +{ + m_Scope->m_Data=data; + if (!m_Bypass) m_Scope->redraw(); +} + +void ScopePluginGUI::draw() +{ + SpiralGUIType::draw(); + + if (m_Plugin->GetInput(0)!=NULL) + { + Display(m_Plugin->GetInput(0)->GetBuffer()); + } + else + { + Display(NULL); + } +} + +void ScopePluginGUI::UpdateValues() +{ +} + +void ScopePluginGUI::cb_Bypass_i(Fl_Button* o, void* v) +{m_Bypass=o->value();} +void ScopePluginGUI::cb_Bypass(Fl_Button* o, void* v) +{((ScopePluginGUI*)(o->parent()))->cb_Bypass_i(o,v);} diff --git a/SpiralSound/Plugins/ScopePlugin/ScopePluginGUI.h b/SpiralSound/Plugins/ScopePlugin/ScopePluginGUI.h new file mode 100644 index 0000000..9895a5e --- /dev/null +++ b/SpiralSound/Plugins/ScopePlugin/ScopePluginGUI.h @@ -0,0 +1,74 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "ScopePlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef SCOPEGUI +#define SCOPEGUI + +class ScopeWidget : public Fl_Widget +{ +public: + ScopeWidget(int x,int y,int w,int h,const char *l, int BUFSIZE); + + void draw(); + void SetNumChannels(int s) {m_Channels=s;} + + const float *m_Data; + int m_Channels; +private: + + int m_GUIColour; + int m_GUIBGColour; + int m_Bufsize; +}; + + +class ScopePluginGUI : public SpiralPluginGUI +{ +public: + ScopePluginGUI(int w, int h, ScopePlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual void draw(); + void Display(const float *data); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + ScopePlugin *m_Plugin; +private: + + bool m_Bypass; + + Fl_Button *Bypass; + ScopeWidget *m_Scope; + + //// Callbacks //// + + inline void cb_Bypass_i(Fl_Button* o, void* v); + static void cb_Bypass(Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/ScopePlugin/SpiralIcon.xpm b/SpiralSound/Plugins/ScopePlugin/SpiralIcon.xpm new file mode 100644 index 0000000..b4a88a4 --- /dev/null +++ b/SpiralSound/Plugins/ScopePlugin/SpiralIcon.xpm @@ -0,0 +1,346 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 307 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #D3D3D3", +"R c #C1BEC9", +"S c #474060", +"T c #31294D", +"U c #716C85", +"V c #65607A", +"W c #625D78", +"X c #D5D4DB", +"Y c #F7F7F7", +"Z c #8B8B8B", +"` c #161616", +" . c #0C0C0C", +".. c #060606", +"+. c #393643", +"@. c #47415F", +"#. c #9692A4", +"$. c #D9D8DE", +"%. c #F7F7F8", +"&. c #918DA0", +"*. c #B8B5C1", +"=. c #D1D1D1", +"-. c #252525", +";. c #727175", +">. c #FEFEFF", +",. c #9D99AA", +"'. c #DBD9E0", +"). c #E9E9E9", +"!. c #CBCBCB", +"~. c #E0E0E0", +"{. c #6C6C6C", +"]. c #181900", +"^. c #C9D100", +"/. c #DFE800", +"(. c #AAB100", +"_. c #515151", +":. c #A6A6A7", +"<. c #827E93", +"[. c #615C77", +"}. c #EAEAED", +"|. c #DFDFE1", +"1. c #BEC500", +"2. c #EAF300", +"3. c #E9F200", +"4. c #F4FD00", +"5. c #1E1D24", +"6. c #9894A7", +"7. c #B1AEBB", +"8. c #69686F", +"9. c #000001", +"0. c #E0E900", +"a. c #8C9200", +"b. c #615C76", +"c. c #5F5A75", +"d. c #413E4D", +"e. c #020203", +"f. c #BAC100", +"g. c #F5FE00", +"h. c #8E9400", +"i. c #1A1A1C", +"j. c #C3C1CB", +"k. c #9D9D9D", +"l. c #202020", +"m. c #383838", +"n. c #4C4C4C", +"o. c #E6EF00", +"p. c #F2FB00", +"q. c #DCE500", +"r. c #C8D000", +"s. c #A0A600", +"t. c #909600", +"u. c #EBF400", +"v. c #ECF500", +"w. c #111112", +"x. c #C9C7D0", +"y. c #F1F1F1", +"z. c #F8F8F8", +"A. c #232323", +"B. c #585C00", +"C. c #7E8300", +"D. c #E1EA00", +"E. c #ABB200", +"F. c #F6FF00", +"G. c #6E7300", +"H. c #525600", +"I. c #050408", +"J. c #AEACB9", +"K. c #FEFEFE", +"L. c #1D1D1D", +"M. c #DDE600", +"N. c #666A00", +"O. c #414400", +"P. c #B7B5C1", +"Q. c #9390A2", +"R. c #BBBBBB", +"S. c #414141", +"T. c #030303", +"U. c #C3CA00", +"V. c #D9E100", +"W. c #505300", +"X. c #28272A", +"Y. c #F4F4F6", +"Z. c #605B76", +"`. c #736E86", +" + c #D8D8D8", +".+ c #727272", +"++ c #101010", +"@+ c #848486", +"#+ c #CCCBD3", +"$+ c #747087", +"%+ c #6D6881", +"&+ c #1C1C1C", +"*+ c #242424", +"=+ c #050600", +"-+ c #8B9100", +";+ c #888E00", +">+ c #1C1E00", +",+ c #656566", +"'+ c #F6F6F6", +")+ c #E8E6EA", +"!+ c #706B84", +"~+ c #E3E1E6", +"{+ c #474746", +"]+ c #151515", +"^+ c #C8C8C8", +"/+ c #AEAEAE", +"(+ c #080808", +"_+ c #373639", +":+ c #FDFCFE", +"<+ c #ABA8B7", +"[+ c #F1F0F3", +"}+ c #6D6980", +"|+ c #0A090E", +"1+ c #95929E", +"2+ c #0A0810", +"3+ c #050505", +"4+ c #5B5A5C", +"5+ c #F7F6F7", +"6+ c #F4F3F5", +"7+ c #908C9F", +"8+ c #C8C6D0", +"9+ c #837E96", +"0+ c #86868A", +"a+ c #070608", +"b+ c #ECEBEE", +"c+ c #5B5571", +"d+ c #646078", +"e+ c #AFAFB0", +"f+ c #454545", +"g+ c #363636", +"h+ c #7A7A7A", +"i+ c #C8C8C9", +"j+ c #212025", +"k+ c #060607", +"l+ c #969699", +"m+ c #FAFAFA", +"n+ c #F8F8F9", +"o+ c #A29EAF", +"p+ c #F7F6F8", +"q+ c #F0F0F1", +"r+ c #B8B7B9", +"s+ c #E4E4E4", +"t+ c #FDFDFD", +"u+ c #A5A2B2", +"v+ c #3B3456", +"w+ c #A8A5B4", +"x+ c #525252", +"y+ c #848387", +"z+ c #CDCDCD", +"A+ c #8D899C", +"B+ c #494262", +"C+ c #68627C", +"D+ c #40395A", +"E+ c #ECECEC", +"F+ c #020202", +"G+ c #B4B5B5", +"H+ c #0B0B0B", +"I+ c #313232", +"J+ c #E3E3E3", +"K+ c #B1AEBC", +"L+ c #BDBBC6", +"M+ c #3C3556", +"N+ c #898599", +"O+ c #EDEDED", +"P+ c #39393A", +"Q+ c #040404", +"R+ c #333333", +"S+ c #F5F5F5", +"T+ c #2B2B2B", +"U+ c #2D2A3D", +"V+ c #B6B4C1", +"W+ c #F5F5F6", +"X+ c #605A76", +"Y+ c #DAD8DF", +"Z+ c #F5F4F6", +"`+ c #615B76", +" @ c #524D6A", +".@ c #E4E3E8", +"+@ c #D5D5D5", +"@@ c #1B1B1B", +"#@ c #303030", +"$@ c #AAABAB", +"%@ c #585464", +"&@ c #B0AEBB", +"*@ c #A29FAF", +"=@ c #E9E8E9", +"-@ c #787779", +";@ c #0F0E15", +">@ c #2D2D2E", +",@ c #595959", +"'@ c #FAFAFB", +")@ c #807B92", +"!@ c #B0ADBB", +"~@ c #E8E7EB", +"{@ c #3A3258", +"]@ c #E6E5EA", +"^@ c #DFDEE3", +"/@ c #443E5E", +"(@ c #BAB8C4", +"_@ c #C1BFCA", +":@ c #E0E0E5", +"<@ c #D0CED6", +"[@ c #362F52", +"}@ c #CECCD5", +"|@ c #413A5B", +"1@ c #6A657F", +"2@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 6 6 M Q R S T U V ", +" W X ; ; ; ; Y Z ` 6 .6 6 6 6 6 6 6 6 ..+.@.#.$.%.&. ", +" *.; ; ; ; ; ; = =.-.6 6 6 6 6 6 6 6 6 6 E ;.>.; ; ,. ", +" '.; ; ).Q h !.~.{.6 ].^././././././.(.6 6 E _.:.4 <. ", +" [.}.; |. .6 6 6 6 6 6 1.2./././././.3.4.6 6 6 6 5.6. ", +" U @ 7.8.9.6 6 6 6 6 6 0.0.6 6 6 6 6 a.4.6 6 6 6 ", +" b.c.d.6 e.6 6 6 6 6 0.0.f.g.h.6 6 a.4.6 6 6 6 i. ", +" j.; ; k.l.l.m.n.l.o.p.o.q.r.p./.s.t.a.4.u.g.v.6 w. ", +" x.; ; y.z.; ; ; A.B.C.D./.].E.g.F.s.a.4.G.H.6 6 I. ", +" J.; ; ; ; K.; ; L.6 6 M.M.6 6 N.O.6 a.4.6 6 6 6 6 P., ", +" Q.; ; K.; : R.S.T.6 6 U.V.W.6 6 6 6 a.4.6 6 6 6 X.K.Y.Z. ", +" `.; ; ; +.+++6 6 6 6 s.4.F.4.4.4.4.F.g.6 6 6 6 @+; ; #+$+ ", +" %+J ; : &+6 6 6 6 *+ .6 6 =+C.-+-+;+>+6 6 6 6 6 ,+'+; ; )+!+ ", +" ~+; ; {+6 E 6 ]+^+/+(+6 6 6 6 6 6 6 6 6 6 6 6 6 _+:+; ; > !+ ", +" <+; [+}+|+6 6 /+K.; 1+2+6 6 6 6 6 6 6 6 m 3+6 6 6 4+5+; ; 6+7+ ", +" !+8+! 9+0+a+x ; ; b+c+d+e+l f+6 6 6 g+h+i+j+6 6 6 k+l+m+; ; n+@ ", +" o+p+q+r+s+t+; u+v+w+; '+f+6 6 E x+; ; y+6 6 E 6 o z+; ; = A+ ", +" B+> ; ; ; ; ; ; C+D+; ; E+m.6 6 F+D ; ; G+H+6 6 6 I+J+; ; K+ ", +" > ; ; ; ; L+M+N+; ; O+P+6 6 Q+R+; ; S+T+6 6 U+V+; W+3 ", +" X+Y+= ; Z+`+ @.@; ; +@@@6 6 F+#@; ; ; $@x+%@ ", +" &@4 *@ W ; ; ; =@-@#@;@>@,@; ; ; K.'@)@ ", +" !@; ; ; ; ; ~@{@]@; ; ; ; = ^@/@ ", +" (@_@:@4 ; ; <@[@}@; ; ; s N+S ", +" |@ 1@2@N+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/SeqPlugin/Makefile.in b/SpiralSound/Plugins/SeqPlugin/Makefile.in new file mode 100644 index 0000000..3a0ff1c --- /dev/null +++ b/SpiralSound/Plugins/SeqPlugin/Makefile.in @@ -0,0 +1,194 @@ +############################################################################# +# Makefile for building SeqPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: SeqPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h \ + ../../Sample.h \ + ../../RiffWav.h \ + SeqPlugin.h \ + SeqPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_EventMap.C \ + ../Widgets/Fl_SEvent.C \ + ../../Sample.C \ + ../../RiffWav.C \ + SeqPlugin.C \ + SeqPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../Widgets/Fl_EventMap.o \ + ../Widgets/Fl_SEvent.o \ + ../../Sample.o \ + ../../RiffWav.o \ + SeqPlugin.o \ + SeqPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SeqPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake SeqPlugin.pro + +dist: + $(TAR) SeqPlugin.tar SeqPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) SeqPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../Widgets/Fl_EventMap.o: ../Widgets/Fl_EventMap.C \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h + +../Widgets/Fl_SEvent.o: ../Widgets/Fl_SEvent.C \ + ../Widgets/Fl_SEvent.h \ + ../Widgets/Fl_EventMap.h + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +../../RiffWav.o: ../../RiffWav.C \ + ../../RiffWav.h \ + ../../Sample.h \ + ../../SpiralInfo.h + +SeqPlugin.o: SeqPlugin.C \ + SeqPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h \ + SeqPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + SpiralIcon.xpm \ + ../../RiffWav.h \ + ../../NoteTable.h + +SeqPluginGUI.o: SeqPluginGUI.C \ + SeqPluginGUI.h \ + SeqPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H + diff --git a/SpiralSound/Plugins/SeqPlugin/SeqPlugin.C b/SpiralSound/Plugins/SeqPlugin/SeqPlugin.C new file mode 100644 index 0000000..f458652 --- /dev/null +++ b/SpiralSound/Plugins/SeqPlugin/SeqPlugin.C @@ -0,0 +1,267 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "SeqPlugin.h" +#include "SeqPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../RiffWav.h" +#include "../../NoteTable.h" + +// for note on's +static const float TRIGGER_LEV=0.1; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new SeqPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0011; +} +} + +/////////////////////////////////////////////////////// + +SeqPlugin::SeqPlugin() : +m_Time(0.0f), +m_Length(10.0f), +m_SpeedMod(1.0f), +m_CurrentNoteCV(0), +m_CurrentTriggerCV(0), +m_InNoteDown(false), +m_InNoteID(0), +m_CurrentPattern(0), +m_Triggered(false) +{ + m_Version=2; + + m_PluginInfo.Name="Sequencer"; + m_PluginInfo.Width=540; + m_PluginInfo.Height=290; + m_PluginInfo.NumInputs=4; + m_PluginInfo.NumOutputs=2; + m_PluginInfo.PortTips.push_back("Play Trigger"); + m_PluginInfo.PortTips.push_back("Speed CV"); + m_PluginInfo.PortTips.push_back("Input Pitch CV"); + m_PluginInfo.PortTips.push_back("Input Trigger CV"); + m_PluginInfo.PortTips.push_back("Output Pitch"); + m_PluginInfo.PortTips.push_back("Output Trigger"); +} + +SeqPlugin::~SeqPlugin() +{ +} + +PluginInfo &SeqPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *SeqPlugin::CreateGUI() +{ + m_GUI = new SeqPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void SeqPlugin::SetPattern(int s) +{ + m_Eventmap[m_CurrentPattern]->hide(); + m_CurrentPattern=s; + m_Eventmap[m_CurrentPattern]->show(); +} + + +void SeqPlugin::Execute() +{ + float Speed; + + for (int n=0; nBUFSIZE; n++) + { + if (GetInputPitch(0,n)>0) + { + if (!m_Triggered) + { + float Freq=GetInputPitch(0,n); + + // Notes 0 to 16 trigger patterns 0 to 16 + // No other notes catered for + for (int i=0; iSAMPLERATE) * (GetInput(1,n)+1.0f); + else + Speed =1.1025f/m_HostInfo->SAMPLERATE; + + if (!m_InNoteDown) + { + // Check trigger + if (GetInput(3,n)>TRIGGER_LEV) + { + m_InNoteDown=true; + + float Freq=GetInputPitch(2,n); + + int NoteNum=0; + for (int i=0; i<131; i++) + { + if (feq(Freq,NoteTable[i],0.01f)) + { + NoteNum=i; + break; + } + } + + /*cerr<<"note recieved ="<>version; + + switch (version) + { + case 2: + { + s>>m_Time; + s>>m_Length; + s>>m_SpeedMod; + s>>m_Loop; + s>>m_NoteCut; + s>>m_CurrentPattern; + } + // fallthrough + + case 1: + { + for(int n=0; n>*m_Eventmap[n]; + } + } break; + } +} diff --git a/SpiralSound/Plugins/SeqPlugin/SeqPlugin.h b/SpiralSound/Plugins/SeqPlugin/SeqPlugin.h new file mode 100644 index 0000000..c179485 --- /dev/null +++ b/SpiralSound/Plugins/SeqPlugin/SeqPlugin.h @@ -0,0 +1,72 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include +#include "../Widgets/Fl_EventMap.h" + +#ifndef SeqPLUGIN +#define SeqPLUGIN + +const int NUM_PATTERNS = 16; + +class SeqPlugin : public SpiralPlugin +{ +public: + SeqPlugin(); + virtual ~SeqPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetEventMap(int n, Fl_EventMap* s) { m_Eventmap[n]=s; } + Fl_EventMap* GetEventMap(int n) { return m_Eventmap[n]; } + void SetUpdate(bool s) { m_Eventmap[m_CurrentPattern]->SetUpdate(s); } + void SetZoom(float s) { m_Eventmap[m_CurrentPattern]->SetZoomLevel(s); } + void SetNoteCut(bool s) { m_NoteCut=s; } + bool GetNoteCut() { return m_NoteCut; } + void SetEndTime(float s) { m_Eventmap[m_CurrentPattern]->SetEndTime(s); m_Length=s; } + void SetSpeed(float s) { m_SpeedMod=s; } + void ClearAll() { m_Eventmap[m_CurrentPattern]->RemoveAllEvents(); } + void SetPattern(int s); + int GetCurrentPattern() { return m_CurrentPattern; } + +private: + Fl_EventMap* m_Eventmap[NUM_PATTERNS]; + + float m_Time; + float m_Length; + bool m_Loop; + bool m_NoteCut; + float m_SpeedMod; + float m_CurrentNoteCV; + float m_CurrentTriggerCV; + bool m_InNoteDown; + int m_InNoteID; + float m_InNoteTime; + int m_CurrentPattern; + bool m_Triggered; +}; + +#endif diff --git a/SpiralSound/Plugins/SeqPlugin/SeqPlugin.pro b/SpiralSound/Plugins/SeqPlugin/SeqPlugin.pro new file mode 100644 index 0000000..b745c3d --- /dev/null +++ b/SpiralSound/Plugins/SeqPlugin/SeqPlugin.pro @@ -0,0 +1,23 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_EventMap.h \ + ../Widgets/Fl_SEvent.h \ + ../../Sample.h \ + ../../RiffWav.h \ + SeqPlugin.h \ + SeqPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_EventMap.C \ + ../Widgets/Fl_SEvent.C \ + ../../Sample.C \ + ../../RiffWav.C \ + SeqPlugin.C \ + SeqPluginGUI.C + +TARGET = SeqPlugin.so diff --git a/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.C b/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.C new file mode 100644 index 0000000..69df97d --- /dev/null +++ b/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.C @@ -0,0 +1,171 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "SeqPluginGUI.h" +#include +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +SeqPluginGUI::SeqPluginGUI(int w, int h,SeqPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + //size_range(10,10); + + m_Scroll = new Fl_Scroll(50, 20, w-57, h-26, ""); + add(m_Scroll); + + for (int n=0; nSetEventMap(n,new Fl_EventMap(0, 0, 1000, 1000, "")); + m_Plugin->GetEventMap(n)->SetType(Fl_EventMap::MELODY_MAP); + m_Scroll->add(m_Plugin->GetEventMap(n)); + m_Plugin->GetEventMap(n)->CreateWindow(); + m_Plugin->GetEventMap(n)->SetUpdateLineClip(0, 18, w, h-38); + m_Plugin->GetEventMap(n)->hide(); + } + + m_Plugin->GetEventMap(0)->show(); + + m_Pattern = new Fl_Counter(5, 20, 40, 20, "Pattern"); + m_Pattern->labelsize(10); + m_Pattern->type(FL_SIMPLE_COUNTER); + m_Pattern->step(1); + m_Pattern->value(0); + m_Pattern->callback((Fl_Callback*)cb_Pattern); + add(m_Pattern); + + m_Length = new Fl_Knob(5, 60, 40, 40, "Length"); + m_Length->color(GUI_COLOUR); + m_Length->type(Fl_Knob::DOTLIN); + m_Length->labelsize(10); + m_Length->maximum(30); + m_Length->step(0.01); + m_Length->value(1.0); + m_Length->callback((Fl_Callback*)cb_Length); + add(m_Length); + + m_Speed = new Fl_Knob(5, 115, 40, 40, "Speed"); + m_Speed->color(GUI_COLOUR); + m_Speed->type(Fl_Knob::DOTLIN); + m_Speed->labelsize(10); + m_Speed->maximum(4); + m_Speed->step(0.01); + m_Speed->value(2.0); + m_Speed->callback((Fl_Callback*)cb_Speed); + add(m_Speed); + + m_Zoom = new Fl_Knob(5,170,40,40,"Zoom"); + m_Zoom->color(GUI_COLOUR); + m_Zoom->type(Fl_Knob::DOTLIN); + m_Zoom->labelsize(10); + m_Zoom->maximum(2); + m_Zoom->step(0.01); + m_Zoom->value(1.0); + m_Zoom->callback((Fl_Callback*)cb_Zoom); + add(m_Zoom); + + m_Update = new Fl_Button(2,225,45,20,"Update"); + m_Update->type(1); + m_Update->labelsize(10); + m_Update->value(1); + m_Update->callback((Fl_Callback*)cb_Update,NULL); + add(m_Update); + + m_NoteCut = new Fl_Button(2,245,45,20,"NoteCut"); + m_NoteCut->type(1); + m_NoteCut->labelsize(10); + m_NoteCut->value(0); + m_NoteCut->callback((Fl_Callback*)cb_NoteCut); + add(m_NoteCut); + + m_Clear = new Fl_Button(2,265,45,20,"Clear"); + m_Clear->type(0); + m_Clear->labelsize(10); + m_Clear->value(0); + m_Clear->callback((Fl_Callback*)cb_Clear); + add(m_Clear); + + end(); +} + +void SeqPluginGUI::UpdateValues() +{ +} + +inline void SeqPluginGUI::cb_Update_i(Fl_Button* o, void* v) +{ + m_Plugin->SetUpdate(o->value()); +} +void SeqPluginGUI::cb_Update(Fl_Button* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Update_i(o,v);} + +inline void SeqPluginGUI::cb_NoteCut_i(Fl_Button* o, void* v) +{ + m_Plugin->SetNoteCut(o->value()); +} +void SeqPluginGUI::cb_NoteCut(Fl_Button* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_NoteCut_i(o,v);} + +inline void SeqPluginGUI::cb_Zoom_i(Fl_Knob* o, void* v) +{ + m_Plugin->SetZoom(o->value()); +} +void SeqPluginGUI::cb_Zoom(Fl_Knob* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Zoom_i(o,v);} + + + +inline void SeqPluginGUI::cb_Pattern_i(Fl_Counter* o, void* v) +{ + if (o->value()<0) o->value(0); + if (o->value()>NUM_PATTERNS-1) o->value(NUM_PATTERNS-1); + m_Plugin->SetPattern((int)o->value()); + //UpdateValues(); +} +void SeqPluginGUI::cb_Pattern(Fl_Counter* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Pattern_i(o,v);} + +inline void SeqPluginGUI::cb_Length_i(Fl_Knob* o, void* v) +{ + m_Plugin->SetEndTime(o->value()); +} +void SeqPluginGUI::cb_Length(Fl_Knob* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Length_i(o,v);} + +inline void SeqPluginGUI::cb_Speed_i(Fl_Knob* o, void* v) +{ + m_Plugin->SetSpeed(o->value()-2.0f); +} +void SeqPluginGUI::cb_Speed(Fl_Knob* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Speed_i(o,v);} + +inline void SeqPluginGUI::cb_Clear_i(Fl_Button* o, void* v) +{ + m_Plugin->ClearAll(); +} +void SeqPluginGUI::cb_Clear(Fl_Button* o, void* v) +{ ((SeqPluginGUI*)(o->parent()))->cb_Clear_i(o,v);} + diff --git a/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.h b/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.h new file mode 100644 index 0000000..f450ddf --- /dev/null +++ b/SpiralSound/Plugins/SeqPlugin/SeqPluginGUI.h @@ -0,0 +1,73 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "SeqPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_EventMap.h" + +#ifndef MixerGUI +#define MixerGUI + + +class SeqPluginGUI : public SpiralPluginGUI +{ +public: + SeqPluginGUI(int w, int h, SeqPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + SeqPlugin *m_Plugin; +private: + + Fl_Scroll* m_Scroll; + Fl_Button* m_Update; + Fl_Button* m_NoteCut; + Fl_Knob* m_Zoom; + Fl_Counter* m_Pattern; + Fl_Knob* m_Length; + Fl_Knob* m_Speed; + Fl_Button* m_Clear; + + //// Callbacks //// + inline void cb_Update_i(Fl_Button* o, void* v); + static void cb_Update(Fl_Button* o, void* v); + inline void cb_Zoom_i(Fl_Knob* o, void* v); + static void cb_Zoom(Fl_Knob* o, void* v); + inline void cb_NoteCut_i(Fl_Button* o, void* v); + static void cb_NoteCut(Fl_Button* o, void* v); + inline void cb_Pattern_i(Fl_Counter* o, void* v); + static void cb_Pattern(Fl_Counter* o, void* v); + inline void cb_Length_i(Fl_Knob* o, void* v); + static void cb_Length(Fl_Knob* o, void* v); + inline void cb_Speed_i(Fl_Knob* o, void* v); + static void cb_Speed(Fl_Knob* o, void* v); + inline void cb_Clear_i(Fl_Button* o, void* v); + static void cb_Clear(Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/SeqPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/SeqPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..0a92f13 --- /dev/null +++ b/SpiralSound/Plugins/SeqPlugin/SpiralIcon.xpm @@ -0,0 +1,325 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 286 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0A0A0A", +"+. c #151700", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #282900", +"!. c #030300", +"~. c #070700", +"{. c #020200", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #FEF100", +"|. c #515151", +"1. c #A6A6A7", +"2. c #827E93", +"3. c #615C77", +"4. c #EAEAED", +"5. c #DFDFE1", +"6. c #0C0C0C", +"7. c #191700", +"8. c #1E1D24", +"9. c #9894A7", +"0. c #B1AEBB", +"a. c #69686F", +"b. c #000001", +"c. c #615C76", +"d. c #5F5A75", +"e. c #413E4D", +"f. c #020203", +"g. c #010100", +"h. c #1A1A1C", +"i. c #C3C1CB", +"j. c #9D9D9D", +"k. c #202020", +"l. c #383838", +"m. c #4C4C4C", +"n. c #1E1C00", +"o. c #111112", +"p. c #C9C7D0", +"q. c #F1F1F1", +"r. c #F8F8F8", +"s. c #232323", +"t. c #050408", +"u. c #AEACB9", +"v. c #FEFEFE", +"w. c #1D1D1D", +"x. c #B7B5C1", +"y. c #9390A2", +"z. c #BBBBBB", +"A. c #414141", +"B. c #030303", +"C. c #28272A", +"D. c #F4F4F6", +"E. c #605B76", +"F. c #736E86", +"G. c #D8D8D8", +"H. c #727272", +"I. c #101010", +"J. c #848486", +"K. c #CCCBD3", +"L. c #747087", +"M. c #6D6881", +"N. c #1C1C1C", +"O. c #242424", +"P. c #212205", +"Q. c #1B1D00", +"R. c #000100", +"S. c #656566", +"T. c #F6F6F6", +"U. c #E8E6EA", +"V. c #706B84", +"W. c #E3E1E6", +"X. c #474746", +"Y. c #151515", +"Z. c #C8C8C8", +"`. c #AEAEAE", +" + c #070707", +".+ c #373639", +"++ c #FDFCFE", +"@+ c #ABA8B7", +"#+ c #F1F0F3", +"$+ c #6D6980", +"%+ c #0A090E", +"&+ c #95929E", +"*+ c #0A0810", +"=+ c #0D0D0D", +"-+ c #050505", +";+ c #5B5A5C", +">+ c #F7F6F7", +",+ c #F4F3F5", +"'+ c #908C9F", +")+ c #C8C6D0", +"!+ c #837E96", +"~+ c #86868A", +"{+ c #070608", +"]+ c #ECEBEE", +"^+ c #5B5571", +"/+ c #646078", +"(+ c #AFAFB0", +"_+ c #454545", +":+ c #363636", +"<+ c #7A7A7A", +"[+ c #C8C8C9", +"}+ c #212025", +"|+ c #060607", +"1+ c #969699", +"2+ c #FAFAFA", +"3+ c #F8F8F9", +"4+ c #A29EAF", +"5+ c #F7F6F8", +"6+ c #F0F0F1", +"7+ c #B8B7B9", +"8+ c #E4E4E4", +"9+ c #FDFDFD", +"0+ c #A5A2B2", +"a+ c #3B3456", +"b+ c #A8A5B4", +"c+ c #525252", +"d+ c #848387", +"e+ c #CDCDCD", +"f+ c #8D899C", +"g+ c #494262", +"h+ c #68627C", +"i+ c #40395A", +"j+ c #ECECEC", +"k+ c #020202", +"l+ c #B4B5B5", +"m+ c #0B0B0B", +"n+ c #313232", +"o+ c #E3E3E3", +"p+ c #B1AEBC", +"q+ c #BDBBC6", +"r+ c #3C3556", +"s+ c #898599", +"t+ c #EDEDED", +"u+ c #39393A", +"v+ c #040404", +"w+ c #333333", +"x+ c #F5F5F5", +"y+ c #2B2B2B", +"z+ c #2D2A3D", +"A+ c #B6B4C1", +"B+ c #F5F5F6", +"C+ c #605A76", +"D+ c #DAD8DF", +"E+ c #F5F4F6", +"F+ c #615B76", +"G+ c #524D6A", +"H+ c #E4E3E8", +"I+ c #D5D5D5", +"J+ c #1B1B1B", +"K+ c #303030", +"L+ c #AAABAB", +"M+ c #585464", +"N+ c #B0AEBB", +"O+ c #A29FAF", +"P+ c #E9E8E9", +"Q+ c #787779", +"R+ c #0F0E15", +"S+ c #2D2D2E", +"T+ c #595959", +"U+ c #FAFAFB", +"V+ c #807B92", +"W+ c #B0ADBB", +"X+ c #E8E7EB", +"Y+ c #3A3258", +"Z+ c #E6E5EA", +"`+ c #DFDEE3", +" @ c #443E5E", +".@ c #BAB8C4", +"+@ c #C1BFCA", +"@@ c #E0E0E5", +"#@ c #D0CED6", +"$@ c #362F52", +"%@ c #CECCD5", +"&@ c #413A5B", +"*@ c #6A657F", +"=@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 6 6 ~.{.6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 }.}.}.}.}.}.}.}.}.}.}.E |.1.4 2. ", +" 3.4.; 5.6.6 6 6 6 6 6 }.6 6 6 6 6 6 6 6 6 }.7.6 8.9. ", +" V @ 0.a.b.6 6 6 6 6 {.}.6 6 6 6 }.}.}.6 6 }.6 6 ", +" c.d.e.6 f.6 6 6 6 g.}.}.}.6 6 6 6 6 6 6 }.6 6 h. ", +" i.; ; j.k.k.l.m.k.6 6 }.6 6 6 6 6 n.6 6 6 }.6 6 o. ", +" p.; ; q.r.; ; ; s.6 6 }.6 6 }.}.}.6 6 }.}.}.6 6 t. ", +" u.; ; ; ; v.; ; w.6 6 }.6 6 6 6 6 6 6 6 6 }.6 6 6 x., ", +" y.; ; v.; : z.A.B.6 6 }.6 6 6 6 6 6 6 6 6 }.6 6 C.v.D.E. ", +" F.; ; ; G.H.I.6 6 6 6 }.}.}.}.}.}.}.}.}.}.}.6 6 J.; ; K.L. ", +" M.J ; : N.6 6 6 6 O.P.Q.6 R.6 6 6 6 6 6 6 6 6 6 S.T.; ; U.V. ", +" W.; ; X.6 E 6 Y.Z.`. +6 6 6 6 6 6 6 6 g.6 6 6 6 .+++; ; > V. ", +" @+; #+$+%+6 6 `.v.; &+*+6 6 6 6 6 6 6 6 =+-+6 6 6 ;+>+; ; ,+'+ ", +" V.)+! !+~+{+x ; ; ]+^+/+(+l _+6 6 6 :+<+[+}+6 6 6 |+1+2+; ; 3+@ ", +" 4+5+6+7+8+9+; 0+a+b+; T._+6 6 E c+; ; d+6 6 E 6 o e+; ; = f+ ", +" g+> ; ; ; ; ; ; h+i+; ; j+l.6 6 k+D ; ; l+m+6 6 6 n+o+; ; p+ ", +" > ; ; ; ; q+r+s+; ; t+u+6 6 v+w+; ; x+y+6 6 z+A+; B+3 ", +" C+D+= ; E+F+G+H+; ; I+J+6 6 k+K+; ; ; L+c+M+ ", +" N+4 O+ X ; ; ; P+Q+K+R+S+T+; ; ; v.U+V+ ", +" W+; ; ; ; ; X+Y+Z+; ; ; ; = `+ @ ", +" .@+@@@4 ; ; #@$@%@; ; ; s s+T ", +" &@ *@=@s+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/SeqSelectorPlugin/Makefile.in b/SpiralSound/Plugins/SeqSelectorPlugin/Makefile.in new file mode 100644 index 0000000..671bf54 --- /dev/null +++ b/SpiralSound/Plugins/SeqSelectorPlugin/Makefile.in @@ -0,0 +1,173 @@ +############################################################################# +# Makefile for building SeqSelectorPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: SeqSelectorPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../Widgets/Fl_LED_Button.H \ + SeqSelectorPlugin.h \ + SeqSelectorPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../Widgets/Fl_LED_Button.cxx \ + SeqSelectorPlugin.C \ + SeqSelectorPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + ../Widgets/Fl_LED_Button.o \ + SeqSelectorPlugin.o \ + SeqSelectorPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SeqSelectorPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake SeqSelectorPlugin.pro + +dist: + $(TAR) SeqSelectorPlugin.tar SeqSelectorPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) SeqSelectorPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +../Widgets/Fl_LED_Button.o: ../Widgets/Fl_LED_Button.cxx \ + ../Widgets/Fl_LED_Button.H + +SeqSelectorPlugin.o: SeqSelectorPlugin.C \ + SeqSelectorPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + SeqSelectorPluginGUI.h \ + ../Widgets/Fl_LED_Button.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm \ + ../../NoteTable.h + +SeqSelectorPluginGUI.o: SeqSelectorPluginGUI.C \ + SeqSelectorPluginGUI.h \ + ../Widgets/Fl_LED_Button.H \ + SeqSelectorPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.C b/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.C new file mode 100644 index 0000000..edd3910 --- /dev/null +++ b/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.C @@ -0,0 +1,154 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "SeqSelectorPlugin.h" +#include "SeqSelectorPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../NoteTable.h" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new SeqSelectorPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0015; +} +} + +/////////////////////////////////////////////////////// + +SeqSelectorPlugin::SeqSelectorPlugin() +{ + m_PluginInfo.Name="SeqSelector"; + m_PluginInfo.Width=400; + m_PluginInfo.Height=300; + m_PluginInfo.NumInputs=1; + m_PluginInfo.NumOutputs=8; + m_PluginInfo.PortTips.push_back("Trigger"); + m_PluginInfo.PortTips.push_back("CV One"); + m_PluginInfo.PortTips.push_back("CV Two"); + m_PluginInfo.PortTips.push_back("CV Three"); + m_PluginInfo.PortTips.push_back("CV Four"); + m_PluginInfo.PortTips.push_back("CV Five"); + m_PluginInfo.PortTips.push_back("CV Six"); + m_PluginInfo.PortTips.push_back("CV Seven"); + m_PluginInfo.PortTips.push_back("CV Eight"); + + m_Pos=0; + m_Triggered=false; + m_UseRange=false; + + for(int i=0; i<8; i++) + { + m_OutTemp[i]=0; + } +} + +SeqSelectorPlugin::~SeqSelectorPlugin() +{ +} + +PluginInfo &SeqSelectorPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *SeqSelectorPlugin::CreateGUI() +{ + m_GUI = new SeqSelectorPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void SeqSelectorPlugin::Execute() +{ + + SeqSelectorPluginGUI *ssp=(SeqSelectorPluginGUI*)m_GUI; + + for (int n=0; nBUFSIZE; n++) + { + // Sends momentary spike of value when triggered, + // works on the note off, rather than the first + // detection of a trigger value + if (GetInput(0,n)>0.1) + { + m_Triggered=true; + } + else + { + if (m_Triggered==true && ssp->GetNumLines()>0) + { + m_Pos++; + + if (m_UseRange) + { + if (m_Pos>=m_End) + { + m_Pos=m_Begin; + } + } + else + { + if (m_Pos>=ssp->GetNumLines()) + { + m_Pos=0; + } + } + + for(int i=0; i<8; i++) + { + SetOutputPitch(i,n,NoteTable[(int)ssp->GetVal(m_Pos,i)]); + } + ssp->SetLED(m_Pos); + } + else + { + for(int i=0; i<8; i++) + { + // zero frequency + SetOutputPitch(i,n,-1); + } + } + + m_Triggered=false; + } + } +} + +void SeqSelectorPlugin::StreamOut(ostream &s) +{ + s<StreamOut(s); +} + +void SeqSelectorPlugin::StreamIn(istream &s) +{ + int version; + s>>version; + ((SeqSelectorPluginGUI*)m_GUI)->StreamIn(s); +} diff --git a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.h b/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.h new file mode 100644 index 0000000..02acf2c --- /dev/null +++ b/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.h @@ -0,0 +1,56 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef SEQSELECTORPlugin +#define SEQSELECTORPlugin + +class SeqSelectorPlugin : public SpiralPlugin +{ +public: + SeqSelectorPlugin(); + virtual ~SeqSelectorPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetBegin(int s) { m_Begin=s; } + void SetEnd(int s) { m_End=s; } + int GetBegin() { return m_Begin; } + int GetEnd() { return m_End; } + void UseRange(bool s) { m_UseRange=s; } + +private: + int m_Pos; + short m_OutTemp[8]; + + int m_Begin; + int m_End; + bool m_UseRange; + bool m_Triggered; +}; + +#endif diff --git a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.pro b/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.pro new file mode 100644 index 0000000..3a2c266 --- /dev/null +++ b/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPlugin.pro @@ -0,0 +1,19 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../Widgets/Fl_LED_Button.H \ + SeqSelectorPlugin.h \ + SeqSelectorPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../Widgets/Fl_LED_Button.cxx \ + SeqSelectorPlugin.C \ + SeqSelectorPluginGUI.C + +TARGET = SeqSelectorPlugin.so diff --git a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPluginGUI.C b/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPluginGUI.C new file mode 100644 index 0000000..2d2ab8c --- /dev/null +++ b/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPluginGUI.C @@ -0,0 +1,282 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "SeqSelectorPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +CountLine::CountLine(int n) : +Fl_Group(0,0,330,25,"") +{ + box(FL_FLAT_BOX); + if (n%4==0) color(GUIBG2_COLOUR); + if (n%8==0) color(GUI_COLOUR); + + sprintf(m_Count,"%d",n); + Fl_Box *Num = new Fl_Box(5,2,30,20,m_Count); + Num->labelsize(10); + Num->labeltype(FL_ENGRAVED_LABEL); + Num->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + add(Num); + + m_Flasher = new Fl_LED_Button(15,2,20,20,""); + m_Flasher->selection_color(FL_BLUE); + add(m_Flasher); + + for (int n=0; nlabelsize(10); + m_Counter[n]->type(FL_SIMPLE_COUNTER); + m_Counter[n]->step(1); + m_Counter[n]->value(0); + add(m_Counter[n]); + } + end(); + redraw(); +} + +CountLine::~CountLine() +{ +} + +void CountLine::SetVal(int n, float val) +{ + // range check + assert(n>=0 && n<8); + m_Counter[n]->value(val); +} + +float CountLine::GetVal(int n) +{ + // range check + assert(n>=0 && n<8); + return m_Counter[n]->value(); +} + +//////////////////////////////////////////// + +SeqSelectorPluginGUI::SeqSelectorPluginGUI(int w, int h,SeqSelectorPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_Scroll = new Fl_Scroll(0, 20, w, h-50, ""); + m_Scroll->type(Fl_Scroll::VERTICAL_ALWAYS); + m_Scroll->box(FL_NO_BOX); + m_Scroll->position(0,0); + add(m_Scroll); + + m_Main = new Fl_Pack(0,20,w,h-50,""); + m_Main->box(FL_NO_BOX); + m_Scroll->add(m_Main); + + m_New = new Fl_Button(5,h-25,100,20,"New"); + m_New->labelsize(10); + m_New->callback((Fl_Callback*)cb_New); + add(m_New); + + m_Delete = new Fl_Button(110,h-25,100,20,"Delete"); + m_Delete->labelsize(10); + m_Delete->callback((Fl_Callback*)cb_Delete); + add(m_Delete); + + m_Begin = new Fl_Counter(220,h-28,50,15,"Begin"); + m_Begin->labelsize(10); + m_Begin->type(FL_SIMPLE_COUNTER); + m_Begin->step(1); + m_Begin->value(0); + m_Begin->callback((Fl_Callback*)cb_Begin); + add(m_Begin); + + m_End = new Fl_Counter(280,h-28,50,15,"End"); + m_End->labelsize(10); + m_End->type(FL_SIMPLE_COUNTER); + m_End->step(1); + m_End->value(0); + m_End->callback((Fl_Callback*)cb_End); + add(m_End); + + m_UseRange = new Fl_Button(340,h-25,55,20,"UseRange"); + m_UseRange->labelsize(10); + m_UseRange->type(1); + m_UseRange->value(0); + m_UseRange->callback((Fl_Callback*)cb_UseRange); + add(m_UseRange); + + + end(); +} + +float SeqSelectorPluginGUI::GetVal(int l, int v) +{ + int c=0; + list::iterator i = m_LineVec.end(); + do + { + i--; + if (l==c) return (*i)->GetVal(v); + c++; + } + while (i!=m_LineVec.begin()); + + return 0; +} + +void SeqSelectorPluginGUI::AddLine(int* Val) +{ + CountLine *NewLine = new CountLine(m_LineVec.size()); + + // copy the last line + list::iterator i=m_LineVec.begin(); + + if (Val) + { + for (int n=0; nSetVal(n,Val[n]); + } + } + else + { + if (m_LineVec.size()>0) + { + for (int n=0; nSetVal(n,(*i)->GetVal(n)); + } + } + } + + m_Main->add(NewLine); + m_LineVec.push_front(NewLine); + redraw(); + + Fl::check(); +} + +void SeqSelectorPluginGUI::RemoveLine() +{ + list::iterator i=m_LineVec.begin(); + if (m_LineVec.size()>0) + { + m_Main->remove(*i); + delete(*i); + m_LineVec.erase(i); + m_Main->redraw(); + m_Scroll->redraw(); + } +} + +void SeqSelectorPluginGUI::SetLED(int n) +{ + int c=0; + + list::iterator i = m_LineVec.end(); + do + { + i--; + if (n==c) (*i)->SetLED(true); + else (*i)->SetLED(false); + c++; + } + while (i!=m_LineVec.begin()); +} + +void SeqSelectorPluginGUI::UpdateValues() +{ +} + +inline void SeqSelectorPluginGUI::cb_New_i(Fl_Button* o, void* v) +{ + AddLine(); +} +void SeqSelectorPluginGUI::cb_New(Fl_Button* o, void* v) +{ ((SeqSelectorPluginGUI*)(o->parent()))->cb_New_i(o,v); } + +inline void SeqSelectorPluginGUI::cb_Delete_i(Fl_Button* o, void* v) +{ + RemoveLine(); +} +void SeqSelectorPluginGUI::cb_Delete(Fl_Button* o, void* v) +{ ((SeqSelectorPluginGUI*)(o->parent()))->cb_Delete_i(o,v); } + +inline void SeqSelectorPluginGUI::cb_Begin_i(Fl_Counter* o, void* v) +{ + m_Plugin->SetBegin((int)o->value()); +} +void SeqSelectorPluginGUI::cb_Begin(Fl_Counter* o, void* v) +{ ((SeqSelectorPluginGUI*)(o->parent()))->cb_Begin_i(o,v); } + +inline void SeqSelectorPluginGUI::cb_End_i(Fl_Counter* o, void* v) +{ + m_Plugin->SetEnd((int)o->value()); +} +void SeqSelectorPluginGUI::cb_End(Fl_Counter* o, void* v) +{ ((SeqSelectorPluginGUI*)(o->parent()))->cb_End_i(o,v); } + +inline void SeqSelectorPluginGUI::cb_UseRange_i(Fl_Button* o, void* v) +{ + m_Plugin->UseRange(o->value()); +} +void SeqSelectorPluginGUI::cb_UseRange(Fl_Button* o, void* v) +{ ((SeqSelectorPluginGUI*)(o->parent()))->cb_UseRange_i(o,v); } + +void SeqSelectorPluginGUI::StreamOut(ostream &s) +{ + s<0) + { + // Stream out in reverse + list::iterator i = m_LineVec.end(); + do + { + i--; + for (int n=0; nGetVal(n)<<" "; + } + } + while (i!=m_LineVec.begin()); + } +} + +void SeqSelectorPluginGUI::StreamIn(istream &s) +{ + int Num; + s>>Num; + + for (int i=0; i>Val[n]; + } + + AddLine(Val); + } +} diff --git a/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPluginGUI.h b/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPluginGUI.h new file mode 100644 index 0000000..1233c5a --- /dev/null +++ b/SpiralSound/Plugins/SeqSelectorPlugin/SeqSelectorPluginGUI.h @@ -0,0 +1,100 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "list" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../Widgets/Fl_LED_Button.H" + +#include "SeqSelectorPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef MixerGUI +#define MixerGUI + +static const int NUM_VALUES = 8; + +class CountLine : public Fl_Group +{ +public: + CountLine(int n); + ~CountLine(); + + void SetVal(int n, float val); + float GetVal(int n); + void SetLED(bool s) { m_Flasher->value(s); } + +private: + Fl_LED_Button *m_Flasher; + Fl_Counter *m_Counter[NUM_VALUES]; + + char m_Count[32]; +}; + +class SeqSelectorPluginGUI : public SpiralPluginGUI +{ +public: + SeqSelectorPluginGUI(int w, int h, SeqSelectorPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + SeqSelectorPlugin *m_Plugin; + + void AddLine(int* Val=NULL); + void RemoveLine(); + float GetVal(int l, int v); + int GetNumLines() { return m_LineVec.size(); } + void SetLED(int n); + + void StreamOut(ostream &s); + void StreamIn(istream &s); + +private: + + Fl_Pack *m_Main; + Fl_Scroll *m_Scroll; + Fl_Button *m_New; + Fl_Button *m_Delete; + Fl_Counter *m_Begin; + Fl_Counter *m_End; + Fl_Button *m_UseRange; + + list m_LineVec; + + //// Callbacks //// + inline void cb_New_i(Fl_Button* o, void* v); + static void cb_New(Fl_Button* o, void* v); + inline void cb_Delete_i(Fl_Button* o, void* v); + static void cb_Delete(Fl_Button* o, void* v); + inline void cb_Begin_i(Fl_Counter* o, void* v); + static void cb_Begin(Fl_Counter* o, void* v); + inline void cb_End_i(Fl_Counter* o, void* v); + static void cb_End(Fl_Counter* o, void* v); + inline void cb_UseRange_i(Fl_Button* o, void* v); + static void cb_UseRange(Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/SeqSelectorPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/SeqSelectorPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..c40566a --- /dev/null +++ b/SpiralSound/Plugins/SeqSelectorPlugin/SpiralIcon.xpm @@ -0,0 +1,328 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 289 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #1A1B00", +"+. c #060600", +"@. c #191A00", +"#. c #393643", +"$. c #47415F", +"%. c #9692A4", +"&. c #D9D8DE", +"*. c #F7F7F8", +"=. c #918DA0", +"-. c #B8B5C1", +";. c #D1D1D1", +">. c #252525", +",. c #727175", +"'. c #FEFEFF", +"). c #9D99AA", +"!. c #DBD9E0", +"~. c #E9E9E9", +"{. c #CBCBCB", +"]. c #E0E0E0", +"^. c #6C6C6C", +"/. c #EDF600", +"(. c #F4FD00", +"_. c #F5FE00", +":. c #515151", +"<. c #A6A6A7", +"[. c #827E93", +"}. c #615C77", +"|. c #EAEAED", +"1. c #DFDFE1", +"2. c #0C0C0C", +"3. c #1E1D24", +"4. c #9894A7", +"5. c #B1AEBB", +"6. c #69686F", +"7. c #000001", +"8. c #0F0F00", +"9. c #615C76", +"0. c #5F5A75", +"a. c #413E4D", +"b. c #020203", +"c. c #292B00", +"d. c #F0F900", +"e. c #1A1A1C", +"f. c #C3C1CB", +"g. c #9D9D9D", +"h. c #202020", +"i. c #383838", +"j. c #4C4C4C", +"k. c #161700", +"l. c #010200", +"m. c #111112", +"n. c #C9C7D0", +"o. c #F1F1F1", +"p. c #F8F8F8", +"q. c #232323", +"r. c #010100", +"s. c #141500", +"t. c #050408", +"u. c #AEACB9", +"v. c #FEFEFE", +"w. c #1D1D1D", +"x. c #313300", +"y. c #F6FF00", +"z. c #B7B5C1", +"A. c #9390A2", +"B. c #BBBBBB", +"C. c #414141", +"D. c #030303", +"E. c #040400", +"F. c #020200", +"G. c #28272A", +"H. c #F4F4F6", +"I. c #605B76", +"J. c #736E86", +"K. c #D8D8D8", +"L. c #727272", +"M. c #101010", +"N. c #1E2000", +"O. c #848486", +"P. c #CCCBD3", +"Q. c #747087", +"R. c #6D6881", +"S. c #1C1C1C", +"T. c #242424", +"U. c #393B09", +"V. c #656566", +"W. c #F6F6F6", +"X. c #E8E6EA", +"Y. c #706B84", +"Z. c #E3E1E6", +"`. c #474746", +" + c #151515", +".+ c #C8C8C8", +"++ c #AEAEAE", +"@+ c #080808", +"#+ c #373639", +"$+ c #FDFCFE", +"%+ c #ABA8B7", +"&+ c #F1F0F3", +"*+ c #6D6980", +"=+ c #0A090E", +"-+ c #95929E", +";+ c #0A0810", +">+ c #0D0D0D", +",+ c #050505", +"'+ c #5B5A5C", +")+ c #F7F6F7", +"!+ c #F4F3F5", +"~+ c #908C9F", +"{+ c #C8C6D0", +"]+ c #837E96", +"^+ c #86868A", +"/+ c #070608", +"(+ c #ECEBEE", +"_+ c #5B5571", +":+ c #646078", +"<+ c #AFAFB0", +"[+ c #454545", +"}+ c #363636", +"|+ c #7A7A7A", +"1+ c #C8C8C9", +"2+ c #212025", +"3+ c #060607", +"4+ c #969699", +"5+ c #FAFAFA", +"6+ c #F8F8F9", +"7+ c #A29EAF", +"8+ c #F7F6F8", +"9+ c #F0F0F1", +"0+ c #B8B7B9", +"a+ c #E4E4E4", +"b+ c #FDFDFD", +"c+ c #A5A2B2", +"d+ c #3B3456", +"e+ c #A8A5B4", +"f+ c #525252", +"g+ c #848387", +"h+ c #CDCDCD", +"i+ c #8D899C", +"j+ c #494262", +"k+ c #68627C", +"l+ c #40395A", +"m+ c #ECECEC", +"n+ c #020202", +"o+ c #B4B5B5", +"p+ c #0B0B0B", +"q+ c #313232", +"r+ c #E3E3E3", +"s+ c #B1AEBC", +"t+ c #BDBBC6", +"u+ c #3C3556", +"v+ c #898599", +"w+ c #EDEDED", +"x+ c #39393A", +"y+ c #040404", +"z+ c #333333", +"A+ c #F5F5F5", +"B+ c #2B2B2B", +"C+ c #2D2A3D", +"D+ c #B6B4C1", +"E+ c #F5F5F6", +"F+ c #605A76", +"G+ c #DAD8DF", +"H+ c #F5F4F6", +"I+ c #615B76", +"J+ c #524D6A", +"K+ c #E4E3E8", +"L+ c #D5D5D5", +"M+ c #1B1B1B", +"N+ c #303030", +"O+ c #AAABAB", +"P+ c #585464", +"Q+ c #B0AEBB", +"R+ c #A29FAF", +"S+ c #E9E8E9", +"T+ c #787779", +"U+ c #0F0E15", +"V+ c #2D2D2E", +"W+ c #595959", +"X+ c #FAFAFB", +"Y+ c #807B92", +"Z+ c #B0ADBB", +"`+ c #E8E7EB", +" @ c #3A3258", +".@ c #E6E5EA", +"+@ c #DFDEE3", +"@@ c #443E5E", +"#@ c #BAB8C4", +"$@ c #C1BFCA", +"%@ c #E0E0E5", +"&@ c #D0CED6", +"*@ c #362F52", +"=@ c #CECCD5", +"-@ c #413A5B", +";@ c #6A657F", +">@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 6 6 6 6 6 6 6 ..+.@.#.$.%.&.*.=. ", +" -.; ; ; ; ; ; = ;.>.6 6 6 6 6 6 6 6 6 6 E ,.'.; ; ). ", +" !.; ; ~.R h {.].^.6 /.(.(.(._.(.(.(.(.(.6 E :.<.4 [. ", +" }.|.; 1.2.6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 3.4. ", +" V @ 5.6.7.6 6 6 6 6 8.6 6 6 6 6 6 6 6 6 6 6 6 6 ", +" 9.0.a.6 b.6 6 6 6 c.d.(.(.(._._.(.(.(.(.6 6 6 e. ", +" f.; ; g.h.h.i.j.h.6 6 k.6 l.6 6 6 6 6 6 6 6 6 6 m. ", +" n.; ; o.p.; ; ; q.6 r.s.6 6 6 6 6 6 6 6 6 6 6 6 t. ", +" u.; ; ; ; v.; ; w.6 x.y.y.y.y.d.(.(.(.(.(.6 6 6 6 z., ", +" A.; ; v.; : B.C.D.6 6 6 6 6 6 6 6 6 6 E.F.6 6 6 G.v.H.I. ", +" J.; ; ; K.L.M.6 6 6 6 6 6 6 6 6 6 F.6 N.6 6 6 6 O.; ; P.Q. ", +" R.J ; : S.6 6 6 6 T.U.y.y.y.(.(.(.(.(.(.(.6 6 6 V.W.; ; X.Y. ", +" Z.; ; `.6 E 6 +.+++@+6 6 6 6 6 6 6 6 r.6 6 6 6 #+$+; ; > Y. ", +" %+; &+*+=+6 6 ++v.; -+;+6 6 6 6 6 6 6 6 >+,+6 6 6 '+)+; ; !+~+ ", +" Y.{+! ]+^+/+x ; ; (+_+:+<+l [+6 6 6 }+|+1+2+6 6 6 3+4+5+; ; 6+@ ", +" 7+8+9+0+a+b+; c+d+e+; W.[+6 6 E f+; ; g+6 6 E 6 o h+; ; = i+ ", +" j+> ; ; ; ; ; ; k+l+; ; m+i.6 6 n+D ; ; o+p+6 6 6 q+r+; ; s+ ", +" > ; ; ; ; t+u+v+; ; w+x+6 6 y+z+; ; A+B+6 6 C+D+; E+3 ", +" F+G+= ; H+I+J+K+; ; L+M+6 6 n+N+; ; ; O+f+P+ ", +" Q+4 R+ X ; ; ; S+T+N+U+V+W+; ; ; v.X+Y+ ", +" Z+; ; ; ; ; `+ @.@; ; ; ; = +@@@ ", +" #@$@%@4 ; ; &@*@=@; ; ; s v+T ", +" -@ ;@>@v+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/SmoothPlugin/Makefile.in b/SpiralSound/Plugins/SmoothPlugin/Makefile.in new file mode 100644 index 0000000..1a3bda3 --- /dev/null +++ b/SpiralSound/Plugins/SmoothPlugin/Makefile.in @@ -0,0 +1,168 @@ +############################################################################# +# Makefile for building SmoothPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: SmoothPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + SmoothPlugin.h \ + SmoothPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + SmoothPlugin.C \ + SmoothPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + SmoothPlugin.o \ + SmoothPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SmoothPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake SmoothPlugin.pro + +dist: + $(TAR) SmoothPlugin.tar SmoothPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) SmoothPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +SmoothPlugin.o: SmoothPlugin.C \ + SmoothPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + SmoothPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +SmoothPluginGUI.o: SmoothPluginGUI.C \ + SmoothPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + SmoothPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.C b/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.C new file mode 100644 index 0000000..a94e6a9 --- /dev/null +++ b/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.C @@ -0,0 +1,100 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "SmoothPlugin.h" +#include "SmoothPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new SmoothPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0014; +} +} + +/////////////////////////////////////////////////////// + +SmoothPlugin::SmoothPlugin() : +m_Up(0.5), +m_Down(0.5), +m_Value(0) +{ + m_PluginInfo.Name="Smooth"; + m_PluginInfo.Width=140; + m_PluginInfo.Height=100; + m_PluginInfo.NumInputs=1; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Output"); +} + +SmoothPlugin::~SmoothPlugin() +{ +} + +PluginInfo &SmoothPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *SmoothPlugin::CreateGUI() +{ + m_GUI = new SmoothPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void SmoothPlugin::Execute() +{ + float Value; + for (int n=0; nBUFSIZE; n++) + { + Value = GetInput(0,n); + + if (Value>m_Value) m_Value+=m_Up*0.0001f; + else m_Value-=m_Down*0.0001f; + + SetOutput(0,n,m_Value); + } +} + +void SmoothPlugin::StreamOut(ostream &s) +{ + s<>m_Version; + s>>m_Up>>m_Down; +} + + diff --git a/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.h b/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.h new file mode 100644 index 0000000..3bee0f5 --- /dev/null +++ b/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.h @@ -0,0 +1,52 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef SmoothPLUGIN +#define SmoothPLUGIN + +class SmoothPlugin : public SpiralPlugin +{ +public: + SmoothPlugin(); + virtual ~SmoothPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetUp(float v) { m_Up=v; } + float GetUp() { return m_Up; } + void SetDown(float v) { m_Down=v; } + float GetDown() { return m_Down; } + +private: + + float m_Up; + float m_Down; + float m_Value; +}; + +#endif diff --git a/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.pro b/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.pro new file mode 100644 index 0000000..7eaf1d1 --- /dev/null +++ b/SpiralSound/Plugins/SmoothPlugin/SmoothPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + SmoothPlugin.h \ + SmoothPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + SmoothPlugin.C \ + SmoothPluginGUI.C + +TARGET = SmoothPlugin.so diff --git a/SpiralSound/Plugins/SmoothPlugin/SmoothPluginGUI.C b/SpiralSound/Plugins/SmoothPlugin/SmoothPluginGUI.C new file mode 100644 index 0000000..2dd97be --- /dev/null +++ b/SpiralSound/Plugins/SmoothPlugin/SmoothPluginGUI.C @@ -0,0 +1,73 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "SmoothPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +SmoothPluginGUI::SmoothPluginGUI(int w, int h,SmoothPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_Up = new Fl_Knob(20, 25, 40, 40, "Up"); + m_Up->color(GUI_COLOUR); + m_Up->type(Fl_Knob::DOTLIN); + m_Up->labelsize(10); + m_Up->maximum(1); + m_Up->step(0.001); + m_Up->value(0.5); + m_Up->callback((Fl_Callback*)cb_Up); + add(m_Up); + + m_Down = new Fl_Knob(75, 25, 40, 40, "Down"); + m_Down->color(GUI_COLOUR); + m_Down->type(Fl_Knob::DOTLIN); + m_Down->labelsize(10); + m_Down->maximum(1); + m_Down->step(0.001); + m_Down->value(0.5); + m_Down->callback((Fl_Callback*)cb_Down); + add(m_Down); + + end(); +} + + + +void SmoothPluginGUI::UpdateValues() +{ + m_Up->value(m_Plugin->GetUp()); + m_Down->value(m_Plugin->GetDown()); +} + +inline void SmoothPluginGUI::cb_Down_i(Fl_Knob* o, void* v) +{ m_Plugin->SetDown(o->value()); } +void SmoothPluginGUI::cb_Down(Fl_Knob* o, void* v) +{ ((SmoothPluginGUI*)(o->parent()))->cb_Down_i(o,v);} + +inline void SmoothPluginGUI::cb_Up_i(Fl_Knob* o, void* v) +{ m_Plugin->SetUp(o->value()); } +void SmoothPluginGUI::cb_Up(Fl_Knob* o, void* v) +{ ((SmoothPluginGUI*)(o->parent()))->cb_Up_i(o,v);} diff --git a/SpiralSound/Plugins/SmoothPlugin/SmoothPluginGUI.h b/SpiralSound/Plugins/SmoothPlugin/SmoothPluginGUI.h new file mode 100644 index 0000000..4578f29 --- /dev/null +++ b/SpiralSound/Plugins/SmoothPlugin/SmoothPluginGUI.h @@ -0,0 +1,54 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "SmoothPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef SplitterGUI +#define SplitterGUI + + +class SmoothPluginGUI : public SpiralPluginGUI +{ +public: + SmoothPluginGUI(int w, int h, SmoothPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + SmoothPlugin *m_Plugin; +private: + + Fl_Knob* m_Up; + Fl_Knob* m_Down; + + //// Callbacks //// + inline void cb_Up_i(Fl_Knob* o, void* v); + static void cb_Up(Fl_Knob* o, void* v); + inline void cb_Down_i(Fl_Knob* o, void* v); + static void cb_Down(Fl_Knob* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/SmoothPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/SmoothPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..b4211bf --- /dev/null +++ b/SpiralSound/Plugins/SmoothPlugin/SpiralIcon.xpm @@ -0,0 +1,328 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 289 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #252525", +"). c #040400", +"!. c #141500", +"~. c #727175", +"{. c #FEFEFF", +"]. c #9D99AA", +"^. c #DBD9E0", +"/. c #E9E9E9", +"(. c #CBCBCB", +"_. c #E0E0E0", +":. c #6C6C6C", +"<. c #EDFF00", +"[. c #292B00", +"}. c #515151", +"|. c #A6A6A7", +"1. c #827E93", +"2. c #615C77", +"3. c #EAEAED", +"4. c #DFDFE1", +"5. c #010200", +"6. c #050600", +"7. c #1E1D24", +"8. c #9894A7", +"9. c #B1AEBB", +"0. c #69686F", +"a. c #000001", +"b. c #0A0A00", +"c. c #171800", +"d. c #615C76", +"e. c #5F5A75", +"f. c #413E4D", +"g. c #020203", +"h. c #040500", +"i. c #050500", +"j. c #1A1A1C", +"k. c #C3C1CB", +"l. c #9D9D9D", +"m. c #202020", +"n. c #383838", +"o. c #4C4C4C", +"p. c #121300", +"q. c #111112", +"r. c #C9C7D0", +"s. c #F1F1F1", +"t. c #F8F8F8", +"u. c #232323", +"v. c #010100", +"w. c #050408", +"x. c #AEACB9", +"y. c #FEFEFE", +"z. c #1D1D1D", +"A. c #020200", +"B. c #101100", +"C. c #B7B5C1", +"D. c #9390A2", +"E. c #BBBBBB", +"F. c #414141", +"G. c #030303", +"H. c #28272A", +"I. c #F4F4F6", +"J. c #605B76", +"K. c #736E86", +"L. c #D8D8D8", +"M. c #727272", +"N. c #101010", +"O. c #1E2000", +"P. c #848486", +"Q. c #CCCBD3", +"R. c #747087", +"S. c #6D6881", +"T. c #1C1C1C", +"U. c #242424", +"V. c #656566", +"W. c #F6F6F6", +"X. c #E8E6EA", +"Y. c #706B84", +"Z. c #E3E1E6", +"`. c #474746", +" + c #151515", +".+ c #C8C8C8", +"++ c #AEAEAE", +"@+ c #080808", +"#+ c #373639", +"$+ c #FDFCFE", +"%+ c #ABA8B7", +"&+ c #F1F0F3", +"*+ c #6D6980", +"=+ c #0A090E", +"-+ c #95929E", +";+ c #0A0810", +">+ c #0D0D0D", +",+ c #050505", +"'+ c #5B5A5C", +")+ c #F7F6F7", +"!+ c #F4F3F5", +"~+ c #908C9F", +"{+ c #C8C6D0", +"]+ c #837E96", +"^+ c #86868A", +"/+ c #070608", +"(+ c #ECEBEE", +"_+ c #5B5571", +":+ c #646078", +"<+ c #AFAFB0", +"[+ c #454545", +"}+ c #363636", +"|+ c #7A7A7A", +"1+ c #C8C8C9", +"2+ c #212025", +"3+ c #060607", +"4+ c #969699", +"5+ c #FAFAFA", +"6+ c #F8F8F9", +"7+ c #A29EAF", +"8+ c #F7F6F8", +"9+ c #F0F0F1", +"0+ c #B8B7B9", +"a+ c #E4E4E4", +"b+ c #FDFDFD", +"c+ c #A5A2B2", +"d+ c #3B3456", +"e+ c #A8A5B4", +"f+ c #525252", +"g+ c #848387", +"h+ c #CDCDCD", +"i+ c #8D899C", +"j+ c #494262", +"k+ c #68627C", +"l+ c #40395A", +"m+ c #ECECEC", +"n+ c #020202", +"o+ c #B4B5B5", +"p+ c #0B0B0B", +"q+ c #313232", +"r+ c #E3E3E3", +"s+ c #B1AEBC", +"t+ c #BDBBC6", +"u+ c #3C3556", +"v+ c #898599", +"w+ c #EDEDED", +"x+ c #39393A", +"y+ c #040404", +"z+ c #333333", +"A+ c #F5F5F5", +"B+ c #2B2B2B", +"C+ c #2D2A3D", +"D+ c #B6B4C1", +"E+ c #F5F5F6", +"F+ c #605A76", +"G+ c #DAD8DF", +"H+ c #F5F4F6", +"I+ c #615B76", +"J+ c #524D6A", +"K+ c #E4E3E8", +"L+ c #D5D5D5", +"M+ c #1B1B1B", +"N+ c #303030", +"O+ c #AAABAB", +"P+ c #585464", +"Q+ c #B0AEBB", +"R+ c #A29FAF", +"S+ c #E9E8E9", +"T+ c #787779", +"U+ c #0F0E15", +"V+ c #2D2D2E", +"W+ c #595959", +"X+ c #FAFAFB", +"Y+ c #807B92", +"Z+ c #B0ADBB", +"`+ c #E8E7EB", +" @ c #3A3258", +".@ c #E6E5EA", +"+@ c #DFDEE3", +"@@ c #443E5E", +"#@ c #BAB8C4", +"$@ c #C1BFCA", +"%@ c #E0E0E5", +"&@ c #D0CED6", +"*@ c #362F52", +"=@ c #CECCD5", +"-@ c #413A5B", +";@ c #6A657F", +">@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.6 6 ).6 6 !.).6 6 6 E ~.{.; ; ]. ", +" ^.; ; /.R h (._.:.<.<.<.<.<.<.<.6 6 [.6 6 E }.|.4 1. ", +" 2.3.; 4...6 6 6 6 6 6 <.6 5.6 6 <.6 6 6.6 6 6 6 7.8. ", +" V @ 9.0.a.6 6 6 6 6 b.c.<.<.6 6 <.6 6 6 6 6 6 6 ", +" d.e.f.6 g.6 6 6 6 6 h.6 5.<.6 <.6 6 6 i.6 6 6 j. ", +" k.; ; l.m.m.n.o.m.6 6 6 6 6 6 <.<.6 6 6 p.6 6 6 q. ", +" r.; ; s.t.; ; ; u.6 v.!.6 6 6 6 <.6 6 6 p.6 6 6 w. ", +" x.; ; ; ; y.; ; z.6 A.B.6 6 6 6 <.<.6 6 p.6 6 6 6 C., ", +" D.; ; y.; : E.F.G.6 6 6 6 6 6 6 <.6 <.<.A.6 6 6 H.y.I.J. ", +" K.; ; ; L.M.N.6 6 6 6 6 6 6 6 6 <.6 6 O.<.<.6 6 P.; ; Q.R. ", +" S.J ; : T.6 6 6 6 U...6 6 6 6 6 <.<.<.<.<.<.<.6 V.W.; ; X.Y. ", +" Z.; ; `.6 E 6 +.+++@+6 6 6 6 6 6 6 6 v.6 6 6 6 #+$+; ; > Y. ", +" %+; &+*+=+6 6 ++y.; -+;+6 6 6 6 6 6 6 6 >+,+6 6 6 '+)+; ; !+~+ ", +" Y.{+! ]+^+/+x ; ; (+_+:+<+l [+6 6 6 }+|+1+2+6 6 6 3+4+5+; ; 6+@ ", +" 7+8+9+0+a+b+; c+d+e+; W.[+6 6 E f+; ; g+6 6 E 6 o h+; ; = i+ ", +" j+> ; ; ; ; ; ; k+l+; ; m+n.6 6 n+D ; ; o+p+6 6 6 q+r+; ; s+ ", +" > ; ; ; ; t+u+v+; ; w+x+6 6 y+z+; ; A+B+6 6 C+D+; E+3 ", +" F+G+= ; H+I+J+K+; ; L+M+6 6 n+N+; ; ; O+f+P+ ", +" Q+4 R+ X ; ; ; S+T+N+U+V+W+; ; ; y.X+Y+ ", +" Z+; ; ; ; ; `+ @.@; ; ; ; = +@@@ ", +" #@$@%@4 ; ; &@*@=@; ; ; s v+T ", +" -@ ;@>@v+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.C b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.C new file mode 100644 index 0000000..5df2edf --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.C @@ -0,0 +1,95 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "DelayGUI.h" + +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = FL_GRAY; + +DelayGUI::DelayGUI(Delay *o) +{ + m_delay=o; + if (!m_delay) cerr<<"WARNING: Delay not correctly set up"<type(1); + o->color(GUIBG2_COLOUR); + o->box(FL_UP_BOX); + o->labeltype(FL_ENGRAVED_LABEL); + o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + o->user_data((void*)(this)); + + DelayA = new Fl_Knob(xoff+50, yoff+5, 40, 40, "Delay"); + DelayA->color(GUI_COLOUR); + DelayA->labelsize(10); + DelayA->maximum(1); + DelayA->step(0.01); + DelayA->value(0.5); + DelayA->callback((Fl_Callback*)cb_Delay); + + Feedback = new Fl_Knob(xoff+100, yoff+5, 40, 40, "Feedback"); + Feedback->color(GUI_COLOUR); + Feedback->labelsize(10); + Feedback->maximum(1.0); + Feedback->step(0.01); + Feedback->value(0.5); + Feedback->callback((Fl_Callback*)cb_Feedback); + + Bypass = new Fl_Button(xoff+5, yoff+25, 40, 20, "Bypass"); + Bypass->color(GUIBG2_COLOUR); + Bypass->labelsize(10); + Bypass->type(1); + Bypass->value(1); + Bypass->callback((Fl_Callback*)cb_Bypass); + + o->end(); + +} + +void DelayGUI::UpdateValues() +{ + DelayA->value(m_delay->GetDelay()); + Feedback->value(m_delay->GetFeedback()); + Bypass->value((int)m_delay->GetBypass()); +} + +//// Callbacks //// + +inline void DelayGUI::cb_Delay_i(Fl_Knob* o, void* v) +{ m_delay->SetDelay(o->value()); } +void DelayGUI::cb_Delay(Fl_Knob* o, void* v) +{ ((DelayGUI*)(o->parent()->user_data()))->cb_Delay_i(o,v); } + +inline void DelayGUI::cb_Feedback_i(Fl_Knob* o, void* v) +{ m_delay->SetFeedback(o->value()); } +void DelayGUI::cb_Feedback(Fl_Knob* o, void* v) +{ ((DelayGUI*)(o->parent()->user_data()))->cb_Feedback_i(o,v); } + +inline void DelayGUI::cb_Bypass_i(Fl_Button* o, void* v) +{ m_delay->SetBypass(o->value()); } +void DelayGUI::cb_Bypass(Fl_Button* o, void* v) +{ ((DelayGUI*)(o->parent()->user_data()))->cb_Bypass_i(o,v); } diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.h b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.h new file mode 100644 index 0000000..8381361 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/DelayGUI.h @@ -0,0 +1,61 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include "../../Widgets/Fl_Knob.H" + +#include "GUIBase.h" +#include "../SpiralSound/Delay.h" + +#ifndef DELAYGUI +#define DELAYGUI + +class DelayGUI : public GUIBase +{ +public: + DelayGUI(Delay *o); + ~DelayGUI(); + + virtual void CreateGUI(int xoff, int yoff, char *name); + virtual void UpdateValues(); + Fl_Group* GetGroup() { return GUIDelayGroup; } + + Delay *m_delay; + +private: + + Fl_Group *GUIDelayGroup; + Fl_Knob *DelayA; + Fl_Knob *Feedback; + Fl_Button *Bypass; + + //// Callbacks //// + + inline void cb_Delay_i(Fl_Knob* o, void* v); + static void cb_Delay(Fl_Knob*, void*); + inline void cb_Feedback_i(Fl_Knob* o, void* v); + static void cb_Feedback(Fl_Knob* o, void* v); + inline void cb_Bypass_i(Fl_Button* o, void* v); + static void cb_Bypass(Fl_Button* o, void* v); + +}; + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.C b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.C new file mode 100644 index 0000000..ca37073 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.C @@ -0,0 +1,109 @@ +/* SpiralLoops + * Copyright (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "FilterGUI.h" + +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = FL_GRAY; + + +FilterGUI::FilterGUI(Filter *o) +{ + m_filter=o; + if (!m_filter) cerr<<"WARNING: Filter not correctly set up"<type(1); + o->box(FL_UP_BOX); + o->labeltype(FL_ENGRAVED_LABEL); + o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + o->user_data((void*)(this)); + + Cutoff = new Fl_Slider(xoff+15, yoff+20, 20, 70, "Cutoff"); + Cutoff->type(4); + Cutoff->selection_color(GUI_COLOUR); + Cutoff->labelsize(10); + Cutoff->maximum(10000); + Cutoff->step(0.1); + Cutoff->value(1000); + Cutoff->callback((Fl_Callback*)cb_Cutoff); + + Resonance = new Fl_Knob(xoff+58, yoff+8, 45, 45, "Emphasis"); + Resonance->color(GUI_COLOUR); + Resonance->type(Fl_Knob::DOTLIN); + Resonance->labelsize(10); + Resonance->maximum(10); + Resonance->step(0.1); + Resonance->value(0); + Resonance->callback((Fl_Callback*)cb_Resonance); + + RevCutoff = new Fl_Button(xoff+57, yoff+72, 50, 15, "RvCMod"); + RevCutoff->type(1); + RevCutoff->down_box(FL_DOWN_BOX); + RevCutoff->labelsize(10); + RevCutoff->callback((Fl_Callback*)cb_RevCutoff); + + RevResonance = new Fl_Button(xoff+57, yoff+88, 50, 15, "RvRMod"); + RevResonance->type(1); + RevResonance->down_box(FL_DOWN_BOX); + RevResonance->labelsize(10); + RevResonance->callback((Fl_Callback*)cb_RevResonance); + + + o->end(); + +} + +void FilterGUI::UpdateValues() +{ + Cutoff->value(10000.0f-m_filter->GetCutoff()-10.0f); + Resonance->value(m_filter->GetResonance()-1.0f); + + RevCutoff->value(0); + RevResonance->value(0); + + if (m_filter->GetRevCutoffMod()) RevCutoff->value(1); + if (m_filter->GetRevResonanceMod()) RevResonance->value(1); +} + +//// Callbacks //// + +inline void FilterGUI::cb_Cutoff_i(Fl_Slider* o, void* v) +{ m_filter->SetCutoff((10000.0f-o->value())+10.0f); } +void FilterGUI::cb_Cutoff(Fl_Slider* o, void* v) +{ ((FilterGUI*)(o->parent()->user_data()))->cb_Cutoff_i(o,v); } + +inline void FilterGUI::cb_Resonance_i(Fl_Knob* o, void* v) +{ m_filter->SetResonance(o->value()+1.0f); } +void FilterGUI::cb_Resonance(Fl_Knob* o, void* v) +{ ((FilterGUI*)(o->parent()->user_data()))->cb_Resonance_i(o,v); } + +inline void FilterGUI::cb_RevCutoff_i(Fl_Button* o, void* v) +{ m_filter->SetRevCutoffMod(o->value()); } +void FilterGUI::cb_RevCutoff(Fl_Button* o, void* v) +{ ((FilterGUI*)(o->parent()->user_data()))->cb_RevCutoff_i(o,v); } + +inline void FilterGUI::cb_RevResonance_i(Fl_Button* o, void* v) +{ m_filter->SetRevResonanceMod(o->value()); } +void FilterGUI::cb_RevResonance(Fl_Button* o, void* v) +{ ((FilterGUI*)(o->parent()->user_data()))->cb_RevResonance_i(o,v); } + diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.h b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.h new file mode 100644 index 0000000..82753ea --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/FilterGUI.h @@ -0,0 +1,62 @@ +/* SpiralLoops + * Copyright (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include "Widgets/Fl_Knob.H" +#include +#include + +#include "GUIBase.h" +#include "../SpiralSound/Filter.h" + +#ifndef FILTERGUI +#define FILTERGUI + +class FilterGUI : public GUIBase +{ +public: + FilterGUI(Filter *o); + + virtual void CreateGUI(int xoff, int yoff, char *name); + virtual void UpdateValues(); + + Filter *m_filter; + +private: + + Fl_Group *GUIFilterGroup; + Fl_Slider *Cutoff; + Fl_Knob *Resonance; + Fl_Button *RevCutoff; + Fl_Button *RevResonance; + + //// Callbacks //// + + inline void cb_Cutoff_i(Fl_Slider* o, void* v); + static void cb_Cutoff(Fl_Slider*, void*); + inline void cb_Resonance_i(Fl_Knob* o, void* v); + static void cb_Resonance(Fl_Knob* o, void* v); + inline void cb_RevCutoff_i(Fl_Button* o, void* v); + static void cb_RevCutoff(Fl_Button*, void*); + inline void cb_RevResonance_i(Fl_Button* o, void* v); + static void cb_RevResonance(Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.C b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.C new file mode 100644 index 0000000..52d492a --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.C @@ -0,0 +1,27 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "GUIBase.h" + +GUIBase::GUIBase() +{ +} + +GUIBase::~GUIBase() +{ +} diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.h b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.h new file mode 100644 index 0000000..9072cbc --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/GUIBase.h @@ -0,0 +1,42 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../../../SpiralInfo.h" + +#ifndef GUIBASE +#define GUIBASE + +class GUIBase +{ + public: + + GUIBase(); + virtual ~GUIBase(); + + // todo: these should be pure virtual funcs, to force + // GUI's to instantiate them + virtual void CreateGUI(int xoff, int yoff, char *name) {} // =0; + virtual void UpdateValues() {} // =0; + + protected: + + private: + +}; + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.C b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.C new file mode 100644 index 0000000..2cf5435 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.C @@ -0,0 +1,653 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include +#include "../../../SpiralInfo.h" + +#include "Widgets/Fl_Loop.h" +#include "LoopGUI.h" +#include "../Loop.h" +#include + +static const int EFFECT_ADDITION = 130; +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = FL_GRAY; +static const int GUIBG2_COLOUR = FL_GRAY; + +static const int MAX_TRIGGERS = 8; + +//static const int GUIBG_COLOUR = 144; +//static const int GUIBG2_COLOUR = 145; + +///////////////////////////////////////////////////////////////////////////// + +LoopGUI::LoopGUI(Loop *o) : +m_TriggerCount(0), +GUILoopGroup(NULL) +{ + m_loop=o; + m_LastAngle=0; + + if (!m_loop) cerr<<"WARNING: Loop not correctly set up"<box(FL_NO_BOX); + GUILoopGroup->color(GUIBG2_COLOUR); + GUILoopGroup->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + GUILoopGroup->user_data((void*)(this)); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->SetPos(m_loop->GetPosPtr()); + GUILoopGroup->callback((Fl_Callback*)cb_Loop); + GUILoopGroup->SetupCopyBufFuncs((Fl_Loop::cb_CopyBuf1*)cb_Cut, + (Fl_Loop::cb_CopyBuf1*)cb_Copy, + (Fl_Loop::cb_CopyBuf2*)cb_Paste, + (Fl_Loop::cb_CopyBuf2*)cb_PasteMix, + (Fl_Loop::cb_CopyBuf1*)cb_ZeroRange, + (Fl_Loop::cb_CopyBuf1*)cb_ReverseRange, + (Fl_Loop::cb_CopyBuf1*)cb_Halve, + (Fl_Loop::cb_CopyBuf1*)cb_Hold, + (Fl_Loop::cb_CopyBuf1*)cb_SelectAll, + (Fl_Loop::cb_CopyBuf1*)cb_NewTrigger, + (Fl_Loop::cb_CopyBuf1*)cb_Move); + + //GUILoopGroup->SetMainWin(m_loop->GetParent()->GetPluginWindow()); + + Volume = new Fl_Slider(60, y+100, 20, 70, "Volume"); + Volume->type(4); + Volume->color(GUIBG2_COLOUR); + Volume->selection_color(GUI_COLOUR); + Volume->labelsize(10); + Volume->maximum(1.0f); + Volume->step(0.001); + Volume->value(0); + Volume->callback((Fl_Callback*)cb_Volume); + GUILoopGroup->add(Volume); + + Cutoff = new Fl_Slider(220, y+100, 20, 70, "Cutoff"); + Cutoff->type(4); + Cutoff->color(GUIBG2_COLOUR); + Cutoff->selection_color(GUI_COLOUR); + Cutoff->labelsize(10); + Cutoff->maximum(100); + Cutoff->step(0.1); + Cutoff->value(0); + Cutoff->callback((Fl_Callback*)cb_Cutoff); + GUILoopGroup->add(Cutoff); + + Resonance = new Fl_Knob(160, y+140, 45, 45, "Emphasis"); + Resonance->color(GUI_COLOUR); + Resonance->type(Fl_Knob::DOTLIN); + Resonance->labelsize(10); + Resonance->maximum(10); + Resonance->step(0.1); + Resonance->value(0); + Resonance->callback((Fl_Callback*)cb_Resonance); + GUILoopGroup->add(Resonance); + + Balance = new Fl_Knob(95, y+140, 45, 45, "Balance"); + Balance->color(GUI_COLOUR); + Balance->type(Fl_Knob::DOTLIN); + Balance->labelsize(10); + Balance->maximum(2); + Balance->step(0.001); + Balance->value(1.0); + Balance->callback((Fl_Callback*)cb_Balance); + GUILoopGroup->add(Balance); + + Speed = new Fl_Knob(95, y+60, 45, 45, "Speed"); + Speed->color(GUI_COLOUR); + Speed->type(Fl_Knob::DOTLIN); + Speed->labelsize(10); + Speed->maximum(3); + Speed->step(0.0001); + Speed->value(1); + Speed->callback((Fl_Callback*)cb_Speed); + GUILoopGroup->add(Speed); + + Length = new Fl_Knob(160, y+60, 45, 45, "Length"); + Length->color(GUI_COLOUR); + Length->type(Fl_Knob::DOTLIN); + Length->labelsize(10); + Length->maximum(1); + Length->step(0.0001); + Length->value(1); + Length->callback((Fl_Callback*)cb_Length); + GUILoopGroup->add(Length); + + Record = new Fl_Button(85, y+200, 60, 14, "Record"); + Record->type(1); + Record->color(GUIBG2_COLOUR); + Record->down_box(FL_DOWN_BOX); + Record->labelsize(10); + Record->callback((Fl_Callback*)cb_Record); + GUILoopGroup->add(Record); + + Load = new Fl_Button(155, y+200, 60, 14, "Load"); + Load->color(GUIBG2_COLOUR); + Load->type(0); + Load->down_box(FL_DOWN_BOX); + Load->labelsize(10); + Load->callback((Fl_Callback*)cb_Load); + GUILoopGroup->add(Load); + + //Effects = new Fl_Button(130, y+200, 40, 14, "Effects"); + //Effects->color(GUIBG2_COLOUR); + //Effects->type(1); + //Effects->down_box(FL_DOWN_BOX); + //Effects->labelsize(10); + //Effects->callback((Fl_Callback*)cb_Effects); + + Double = new Fl_Button(85, y+218, 60, 14, "Double"); + Double->color(GUIBG2_COLOUR); + Double->type(0); + Double->down_box(FL_DOWN_BOX); + Double->labelsize(10); + Double->callback((Fl_Callback*)cb_Double); + GUILoopGroup->add(Double); + + //Match = new Fl_Button(130, y+218, 40, 14, "Match"); + //Match->color(GUIBG2_COLOUR); + //Match->type(0); + //Match->down_box(FL_DOWN_BOX); + //Match->labelsize(10); + //Match->callback((Fl_Callback*)cb_Match); + + Save = new Fl_Button(155, y+218, 60, 14, "Save"); + Save->color(GUIBG2_COLOUR); + Save->type(0); + Save->down_box(FL_DOWN_BOX); + Save->labelsize(10); + Save->callback((Fl_Callback*)cb_Save); + GUILoopGroup->add(Save); + + Play = new Fl_LED_Button(255, y+275, 40, 25, "Play"); + Play->color(GUIBG2_COLOUR); + Play->type(1); + Play->value(1); + Play->down_box(FL_DOWN_BOX); + Play->labelsize(10); + Play->callback((Fl_Callback*)cb_Play); + GUILoopGroup->add(Play); + + SpeedOutput = new Fl_Value_Output(93, y+120, 50, 15); + SpeedOutput->labelsize(10); + SpeedOutput->textsize(10); + GUILoopGroup->add(SpeedOutput); + + LengthOutput = new Fl_Value_Output(157, y+120, 50, 15); + LengthOutput->labelsize(10); + LengthOutput->textsize(10); + GUILoopGroup->add(LengthOutput); + + MagicOutput = new Fl_Value_Output(125, y+235, 50, 15); + MagicOutput->labelsize(10); + MagicOutput->textsize(10); + GUILoopGroup->add(MagicOutput); + + //Master = new Fl_LED_Button(2, y+5, 40, 25, "Master"); + //Master->type(1); + //Master->color(GUIBG2_COLOUR); + //Master->down_box(FL_DOWN_BOX); + //Master->labelsize(10); + //Master->callback((Fl_Callback*)cb_Master); + + Update = new Fl_LED_Button(2, y+275, 40, 25, "Update"); + Update->type(1); + Update->value(0); + Update->selection_color(3); + Update->down_box(FL_DOWN_BOX); + Update->labelsize(10); + Update->callback((Fl_Callback*)cb_Update); + GUILoopGroup->add(Update); + + WaveSize = new Fl_Knob(262, y+5, 30, 30, "WaveSize"); + WaveSize->color(GUI_COLOUR); + WaveSize->type(Fl_Knob::DOTLIN); + WaveSize->labelsize(8); + WaveSize->maximum(10.0); + WaveSize->step(0.01); + WaveSize->value(0.0); + WaveSize->callback((Fl_Callback*)cb_WaveSize); + GUILoopGroup->add(WaveSize); + + GUILoopGroup->show(); + GUILoopGroup->end(); + } +} + +void LoopGUI::SetMasterStatus(bool m) +{ + m_loop->SetMasterStatus(m); + Master->value(m); + GUILoopGroup->redraw(); +} + +void LoopGUI::CheckTriggers(float CurrentAngle, vector &LoopTriggers) +{ + for (vector::iterator i=m_TriggerVec.begin(); + i!=m_TriggerVec.end(); i++) + { + // Todo: Better detection needed + + if (CurrentAngle>(*i)->GetAngle() && + m_LastAngle<(*i)->GetAngle()) + { + if ((*i)->Completed() && (*i)->GetPass()!=0) + { + m_loop->SetPlaying(false); + Play->value(false); + } + + LoopTriggers.push_back((*i)->GetID()); + (*i)->IncCount(); + } + } + + m_LastAngle=CurrentAngle; +} + +void LoopGUI::SetSnapAngle(int Angle) +{ + m_SnapAngle = Angle; + + for (vector::iterator i=m_TriggerVec.begin(); + i!=m_TriggerVec.end(); i++) + { + (*i)->SetSnapAngle(Angle); + } + + GUILoopGroup->SetSnapAngle(Angle); + GUILoopGroup->redraw(); +} + + +void LoopGUI::SetSnap(bool s) +{ + for (vector::iterator i=m_TriggerVec.begin(); + i!=m_TriggerVec.end(); i++) + { + (*i)->SetSnap(s); + } + + GUILoopGroup->SetSnap(s); +} + +void LoopGUI::UpdateValues() +{ + Volume->value(1.0f-m_loop->GetVolume()); + Cutoff->value(100.0f-sqrt(m_loop->GetCutoff()-10.0f)); + Resonance->value(m_loop->GetResonance()-1.0f); + Balance->value(m_loop->GetBalance()); + Speed->value(m_loop->GetSpeed()); + Length->value(m_loop->GetLoopLength()/(float)m_loop->GetTotalLength()); + Effects->value(m_loop->GetEffects()); + Play->value(m_loop->IsPlaying()); + Master->value(m_loop->IsMaster()); +} + +void LoopGUI::UpdateDataPtr() +{ + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); +} + + +//// Callbacks //// + +inline void LoopGUI::cb_Loop_i(Fl_Loop* o, void* v) +{ + o->hide(); + m_loop->DelMe(); +} +void LoopGUI::cb_Loop(Fl_Loop* o, void* v) +{ ((LoopGUI*)(o->user_data()))->cb_Loop_i(o,v); } + +inline void LoopGUI::cb_Volume_i(Fl_Slider* o, void* v) +{ + m_loop->SetVolume(1.0f-o->value()); +} +void LoopGUI::cb_Volume(Fl_Slider* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Volume_i(o,v); } + +inline void LoopGUI::cb_Cutoff_i(Fl_Slider* o, void* v) +{ + m_loop->FilterBypass(o->value()==0); + float value=100.0f-o->value(); + m_loop->SetCutoff((int)(value*value+10.0f)); +} +void LoopGUI::cb_Cutoff(Fl_Slider* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Cutoff_i(o,v); } + +inline void LoopGUI::cb_Balance_i(Fl_Knob* o, void* v) +{ + /*float rvalue=1+o->value()-1.0f; + float lvalue=2-o->value(); + + m_loop->SetLeftVol(lvalue/2.0f); + m_loop->SetRightVol(rvalue/2.0f);*/ + + m_loop->SetBalance(o->value()); + +} +void LoopGUI::cb_Balance(Fl_Knob* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Balance_i(o,v); } + +inline void LoopGUI::cb_Length_i(Fl_Knob* o, void* v) +{ + m_loop->SetLength((int)(o->value()*m_loop->GetTotalLength())); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + + //LengthOutput->value((float)m_loop->GetLoopLength()/(float)SpiralLoopsInfo::SAMPLERATE); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Length(Fl_Knob* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Length_i(o,v); } + +inline void LoopGUI::cb_Speed_i(Fl_Knob* o, void* v) +{ + m_loop->SetSpeed(o->value()); + SpeedOutput->value(o->value()); +} +void LoopGUI::cb_Speed(Fl_Knob* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Speed_i(o,v); } + +inline void LoopGUI::cb_Resonance_i(Fl_Knob* o, void* v) +{ + m_loop->SetResonance((int)(o->value()+1.0f)); +} +void LoopGUI::cb_Resonance(Fl_Knob* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Resonance_i(o,v); } + +inline void LoopGUI::cb_Record_i(Fl_Button* o, void* v) +{ + m_loop->Record(o->value()); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Record(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Record_i(o,v); } + +inline void LoopGUI::cb_Load_i(Fl_Button* o, void* v) +{ + //GUILoopGroup->UnsetIdle(); + char *fn=fl_file_chooser("Pick a Wav file to load", "*.wav", NULL); + + if (fn && fn!="") + { + m_loop->LoadWav(fn); + } + + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + + //LengthOutput->value(m_loop->GetLoopLength()/(float)SpiralLoopsInfo::SAMPLERATE); + //GUILoopGroup->SetIdle(); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Load(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Load_i(o,v); } + +inline void LoopGUI::cb_Play_i(Fl_LED_Button* o, void* v) +{ + m_loop->SetPlaying(o->value()); +} +void LoopGUI::cb_Play(Fl_LED_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Play_i(o,v); } + +inline void LoopGUI::cb_Master_i(Fl_LED_Button* o, void* v) +{ +} +void LoopGUI::cb_Master(Fl_LED_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Master_i(o,v); } + +inline void LoopGUI::cb_Effects_i(Fl_Button* o, void* v) +{ + Fl_Widget *p=GUILoopGroup->parent(); + + if (o->value()) + { + p->size(p->w(),p->h()+EFFECT_ADDITION); + } + else + { + p->size(p->w(),p->h()-EFFECT_ADDITION); + } + + m_loop->SetEffects(o->value()); +} +void LoopGUI::cb_Effects(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Effects_i(o,v); } + +inline void LoopGUI::cb_Update_i(Fl_LED_Button* o, void* v) +{ + GUILoopGroup->SetUpdate(o->value()); +} +void LoopGUI::cb_Update(Fl_LED_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Update_i(o,v); } + +inline void LoopGUI::cb_Double_i(Fl_Button* o, void* v) +{ + m_loop->Double(); + + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); + +} +void LoopGUI::cb_Double(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Double_i(o,v); } + +inline void LoopGUI::cb_Match_i(Fl_Button* o, void* v) +{ +} +void LoopGUI::cb_Match(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Match_i(o,v); } + +inline void LoopGUI::cb_Save_i(Fl_Button* o, void* v) +{ + char *fn=fl_file_chooser("Save loop as Wav file", "*.wav", NULL); + + if (fn && fn!="") + { + m_loop->SaveWav(fn); + } +} +void LoopGUI::cb_Save(Fl_Button* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_Save_i(o,v); } + +inline void LoopGUI::cb_WaveSize_i(Fl_Knob* o, void* v) +{ + GUILoopGroup->SetWaveSize(1+o->value()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_WaveSize(Fl_Knob* o, void* v) +{ ((LoopGUI*)(o->parent()->user_data()))->cb_WaveSize_i(o,v); } + + +//////////////////////////////////////////////////////////////// + + +inline void LoopGUI::cb_Cut_i(Fl_Loop *o, int Start, int End) +{ + m_loop->Cut(Start,End); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Cut(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_Cut_i(o,Start,End); } + +void LoopGUI::cb_Copy_i(Fl_Loop *o, int Start, int End) +{ + m_loop->Copy(Start,End); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Copy(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_Copy_i(o,Start,End); } + +inline void LoopGUI::cb_Paste_i(Fl_Loop *o, int Start) +{ + m_loop->Paste(Start); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Paste(Fl_Loop *o, int Start) +{ ((LoopGUI*)(o->user_data()))->cb_Paste_i(o,Start); } + +inline void LoopGUI::cb_PasteMix_i(Fl_Loop *o, int Start) +{ + m_loop->PasteMix(Start); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_PasteMix(Fl_Loop *o, int Start) +{ ((LoopGUI*)(o->user_data()))->cb_PasteMix_i(o,Start); } + + +inline void LoopGUI::cb_ZeroRange_i(Fl_Loop *o, int Start, int End) +{ + m_loop->ZeroRange(Start,End); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_ZeroRange(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_ZeroRange_i(o,Start,End); } + +inline void LoopGUI::cb_ReverseRange_i(Fl_Loop *o, int Start, int End) +{ + m_loop->ReverseRange(Start,End); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_ReverseRange(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_ReverseRange_i(o,Start,End); } + +inline void LoopGUI::cb_Halve_i(Fl_Loop *o, int Start, int End) +{ + m_loop->Halve(); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Halve(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_Halve_i(o,Start,End); } + +inline void LoopGUI::cb_Hold_i(Fl_Loop *o, int Start, int End) +{ + m_loop->Hold(); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Hold(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_Hold_i(o,Start,End); } + +inline void LoopGUI::cb_SelectAll_i(Fl_Loop *o, int Start, int End) +{ + m_loop->SelectAll(); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_SelectAll(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_SelectAll_i(o,Start,End); } + +inline void LoopGUI::cb_NewTrigger_i(Fl_Loop *o, int Start, int End) +{ + if (m_TriggerCount>=8) return; + + Fl_Trigger *NewTrigger = new Fl_Trigger(0, 0, 20, 20); + NewTrigger->SetCentreX(150); + NewTrigger->SetCentreY(170); + NewTrigger->SetCentreRadius(125); + NewTrigger->SetID(m_TriggerCount); + + GUILoopGroup->add(NewTrigger); + m_TriggerVec.push_back(NewTrigger); + GUILoopGroup->redraw(); + GUILoopGroup->parent()->redraw(); + + m_TriggerCount++; +} +void LoopGUI::cb_NewTrigger(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_NewTrigger_i(o,Start,End); } + +inline void LoopGUI::cb_Move_i(Fl_Loop *o, int Start, int End) +{ + m_loop->Move(Start); + GUILoopGroup->SetData(m_loop->GetLoopPtr()); + GUILoopGroup->SetLength(m_loop->GetLoopLength()); + GUILoopGroup->redraw(); +} +void LoopGUI::cb_Move(Fl_Loop *o, int Start, int End) +{ ((LoopGUI*)(o->user_data()))->cb_Move_i(o,Start,End); } + +///////////////////////////////////////////////////// + +istream &operator>>(istream &s, LoopGUI &o) +{ + int x,y,w,h; + s>>x>>y>>w>>h; + //o.GUILoopGroup->resize(x,y,w,h); + + int Num; + s>>Num; + + for (int n=0; n>*NewTrigger; + o.GUILoopGroup->add(NewTrigger); + o.m_TriggerVec.push_back(NewTrigger); + } + + return s; +} + +ostream &operator<<(ostream &s, LoopGUI &o) +{ + s<GetX()<<" "<GetY()<<" "<< + o.GUILoopGroup->GetW()<<" "<GetH()<<" "; + + s<::iterator i=o.m_TriggerVec.begin(); + i!=o.m_TriggerVec.end(); i++) + { + s<<**i; + } + + return s; +} diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.h b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.h new file mode 100644 index 0000000..c055d44 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/LoopGUI.h @@ -0,0 +1,162 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include "Widgets/Fl_Knob.H" +#include "Widgets/Fl_Loop.h" +#include "Widgets/Fl_LED_Button.H" +#include "Widgets/Fl_Trigger.h" + +#include "GUIBase.h" +#include "../SpiralSound/Filter.h" +#include "../SpiralSound/Delay.h" +#include "../SpiralSound/Reverb.h" +#include + +#ifndef LOOPGUI +#define LOOPGUI + +class Loop; + +class LoopGUI : public GUIBase +{ +public: + LoopGUI(Loop *o); + ~LoopGUI(); + + virtual void CreateGUI(char *name=""); + virtual void UpdateValues(); + + int GetPos(); + void SetMasterStatus(bool m); + void RefreshWave() {} + void CheckTriggers(float CurrentAngle, vector &LoopTriggers); + void StopUpdate(bool s) {GUILoopGroup->StopUpdate(s);} + void Trigger() {Play->value(true);} + void UpdateDataPtr(); + void SetSnap(bool s); + void SetSnapAngle(int Angle); + void UpdatePos() { GUILoopGroup->DrawPosMarker(); } + + Fl_Group *GetGUI() { return GUILoopGroup; } + +private: + Loop *m_loop; + + float m_LastAngle; + int m_SnapAngle; + int m_TriggerCount; + + Fl_Loop *GUILoopGroup; + Fl_Group *InnerGroup; + Fl_Slider *Cutoff; + Fl_Slider *Volume; + Fl_Knob *Balance; + Fl_Knob *Length; + Fl_Knob *Speed; + Fl_Knob *Resonance; + Fl_Value_Output *SpeedOutput; + Fl_Value_Output *LengthOutput; + Fl_Value_Output *MagicOutput; + Fl_Knob *WaveSize; + + Fl_Button *Record; + Fl_Button *Load; + Fl_LED_Button *Play; + Fl_LED_Button *Master; + Fl_LED_Button *Update; + Fl_Button *Effects; + Fl_Button *Double; + Fl_Button *Match; + Fl_Button *Save; + + vector m_TriggerVec; + + //// Callbacks //// + inline void cb_Loop_i(Fl_Loop* o, void* v); + static void cb_Loop(Fl_Loop* o, void* v); + inline void cb_Volume_i(Fl_Slider* o, void* v); + static void cb_Volume(Fl_Slider* o, void* v); + inline void cb_Cutoff_i(Fl_Slider* o, void* v); + static void cb_Cutoff(Fl_Slider* o, void* v); + inline void cb_Balance_i(Fl_Knob* o, void* v); + static void cb_Balance(Fl_Knob* o, void* v); + inline void cb_Length_i(Fl_Knob* o, void* v); + static void cb_Length(Fl_Knob* o, void* v); + inline void cb_Speed_i(Fl_Knob* o, void* v); + static void cb_Speed(Fl_Knob* o, void* v); + inline void cb_Resonance_i(Fl_Knob* o, void* v); + static void cb_Resonance(Fl_Knob* o, void* v); + inline void cb_Record_i(Fl_Button* o, void* v); + static void cb_Record(Fl_Button* o, void* v); + inline void cb_Load_i(Fl_Button* o, void* v); + static void cb_Load(Fl_Button* o, void* v); + inline void cb_Play_i(Fl_LED_Button* o, void* v); + static void cb_Play(Fl_LED_Button* o, void* v); + inline void cb_Master_i(Fl_LED_Button* o, void* v); + static void cb_Master(Fl_LED_Button* o, void* v); + inline void cb_Effects_i(Fl_Button* o, void* v); + static void cb_Effects(Fl_Button* o, void* v); + inline void cb_Update_i(Fl_LED_Button* o, void* v); + static void cb_Update(Fl_LED_Button* o, void* v); + inline void cb_Double_i(Fl_Button* o, void* v); + static void cb_Double(Fl_Button* o, void* v); + inline void cb_Match_i(Fl_Button* o, void* v); + static void cb_Match(Fl_Button* o, void* v); + inline void cb_Save_i(Fl_Button* o, void* v); + static void cb_Save(Fl_Button* o, void* v); + inline void cb_WaveSize_i(Fl_Knob* o, void* v); + static void cb_WaveSize(Fl_Knob* o, void* v); + + inline void cb_Cut_i(Fl_Loop *o, int Start, int End); + static void cb_Cut(Fl_Loop *o, int Start, int End); + inline void cb_Copy_i(Fl_Loop *o, int Start, int End); + static void cb_Copy(Fl_Loop *o, int Start, int End); + inline void cb_Paste_i(Fl_Loop *o, int Start); + static void cb_Paste(Fl_Loop *o, int Start); + inline void cb_PasteMix_i(Fl_Loop *o, int Start); + static void cb_PasteMix(Fl_Loop *o, int Start); + inline void cb_ZeroRange_i(Fl_Loop *o, int Start, int End); + static void cb_ZeroRange(Fl_Loop *o, int Start, int End); + inline void cb_ReverseRange_i(Fl_Loop *o, int Start, int End); + static void cb_ReverseRange(Fl_Loop *o, int Start, int End); + inline void cb_Halve_i(Fl_Loop *o, int Start, int End); + static void cb_Halve(Fl_Loop *o, int Start, int End); + inline void cb_Hold_i(Fl_Loop *o, int Start, int End); + static void cb_Hold(Fl_Loop *o, int Start, int End); + inline void cb_SelectAll_i(Fl_Loop *o, int Start, int End); + static void cb_SelectAll(Fl_Loop *o, int Start, int End); + inline void cb_NewTrigger_i(Fl_Loop *o, int Start, int End); + static void cb_NewTrigger(Fl_Loop *o, int Start, int End); + inline void cb_Move_i(Fl_Loop *o, int Start, int End); + static void cb_Move(Fl_Loop *o, int Start, int End); + + friend istream &operator>>(istream &s, LoopGUI &o); + friend ostream &operator<<(ostream &s, LoopGUI &o); +}; + +istream &operator>>(istream &s, LoopGUI &o); +ostream &operator<<(ostream &s, LoopGUI &o); + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.C b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.C new file mode 100644 index 0000000..2b29756 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.C @@ -0,0 +1,107 @@ +/* SpiralSynth + * Copyright (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "MixerGUI.h" + +MixerGUI::MixerGUI(Mixer *o) +{ + m_mix=o; + if (!m_mix) cerr<<"WARNING: Mixer not correctly set up"<type(1); + o->box(FL_UP_BOX); + o->labeltype(FL_ENGRAVED_LABEL); + o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + o->user_data((void*)(this)); + + Balance = new Fl_Knob(xoff+55, yoff+35, 40, 40, "Amount"); + Balance->color(SynthInfo::GUI_COLOUR); + Balance->type(Fl_Knob::LINELIN); + Balance->labelsize(10); + Balance->maximum(0.002); + Balance->step(0.00001); + Balance->value(0.001); + Balance->callback((Fl_Callback*)cb_Balance); + + Add = new Fl_Check_Button(xoff, yoff+15, 55, 30, "Add"); + Add->type(102); + Add->down_box(FL_DIAMOND_DOWN_BOX); + Add->selection_color(SynthInfo::GUI_COLOUR); + Add->set(); + Add->callback((Fl_Callback*)cb_Add); + + XMod = new Fl_Check_Button(xoff, yoff+40, 55, 30, "XM"); + XMod->type(102); + XMod->down_box(FL_DIAMOND_DOWN_BOX); + XMod->selection_color(SynthInfo::GUI_COLOUR); + XMod->callback((Fl_Callback*)cb_XMod); + + Ring = new Fl_Check_Button(xoff, yoff+65, 55, 30, "Ring"); + Ring->type(102); + Ring->down_box(FL_DIAMOND_DOWN_BOX); + Ring->selection_color(SynthInfo::GUI_COLOUR); + Ring->callback((Fl_Callback*)cb_Ring); + + o->end(); + +} + +void MixerGUI::UpdateValues() +{ + Balance->value(m_mix->GetAmount()); + + Add->value(0); + XMod->value(0); + Ring->value(0); + + switch(m_mix->GetType()) + { + case Mixer::ADD: Add->value(1); break; + case Mixer::XMOD: XMod->value(1); break; + case Mixer::RING: Ring->value(1); break; + case Mixer::NONE: break; + } + +} + +//// Callbacks //// + +inline void MixerGUI::cb_Balance_i(Fl_Knob* o, void* v) +{ m_mix->SetAmount(o->value()); } +void MixerGUI::cb_Balance(Fl_Knob* o, void* v) +{ ((MixerGUI*)(o->parent()->user_data()))->cb_Balance_i(o,v); } + +inline void MixerGUI::cb_Add_i(Fl_Check_Button* o, void* v) +{ m_mix->SetType(Mixer::ADD); } +void MixerGUI::cb_Add(Fl_Check_Button* o, void* v) +{ ((MixerGUI*)(o->parent()->user_data()))->cb_Add_i(o,v); } + +inline void MixerGUI::cb_XMod_i(Fl_Check_Button* o, void* v) +{ m_mix->SetType(Mixer::XMOD); } +void MixerGUI::cb_XMod(Fl_Check_Button* o, void* v) +{ ((MixerGUI*)(o->parent()->user_data()))->cb_XMod_i(o,v); } + +inline void MixerGUI::cb_Ring_i(Fl_Check_Button* o, void* v) +{ m_mix->SetType(Mixer::RING); } +void MixerGUI::cb_Ring(Fl_Check_Button* o, void* v) +{ ((MixerGUI*)(o->parent()->user_data()))->cb_Ring_i(o,v); } + diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.h b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.h new file mode 100644 index 0000000..1fe29e9 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/MixerGUI.h @@ -0,0 +1,69 @@ +/* SpiralSynth + * Copyright (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include "Widgets/Fl_Knob.H" + +#include "GUIBase.h" + +#ifndef MIXGUI +#define MIXGUI + +class MixerGUI : public GUIBase +{ +public: + MixerGUI(Mixer *o); + + virtual void CreateGUI(int xoff=0, int yoff=0, char *name=""); + virtual void UpdateValues(); + + Mixer *m_mix; + +private: + + Fl_Group *GUIMixGroup; + Fl_Check_Button *Add; + Fl_Check_Button *XMod; + Fl_Check_Button *Ring; + + Fl_Knob *Balance; + + //// Callbacks //// + + inline void cb_Balance_i(Fl_Knob* o, void* v); + static void cb_Balance(Fl_Knob*, void*); + inline void cb_XModAmount_i(Fl_Knob* o, void* v); + static void cb_XModAmount(Fl_Knob* o, void* v); + inline void cb_Add_i(Fl_Check_Button* o, void* v); + static void cb_Add(Fl_Check_Button*, void*); + inline void cb_Mult_i(Fl_Check_Button* o, void* v); + static void cb_Mult(Fl_Check_Button*, void*); + inline void cb_Sub_i(Fl_Check_Button* o, void* v); + static void cb_Sub(Fl_Check_Button* o, void* v); + inline void cb_XMod_i(Fl_Check_Button* o, void* v); + static void cb_XMod(Fl_Check_Button* o, void* v); + inline void cb_Ring_i(Fl_Check_Button* o, void* v); + static void cb_Ring(Fl_Check_Button* o, void* v); + + +}; + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.C b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.C new file mode 100644 index 0000000..72b24b9 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.C @@ -0,0 +1,109 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "ReverbGUI.h" + +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = FL_GRAY; + +ReverbGUI::ReverbGUI(Reverb *o) +{ + m_reverb=o; + if (!m_reverb) cerr<<"WARNING: Reverb not correctly set up"<type(1); + o->color(GUIBG2_COLOUR); + o->box(FL_UP_BOX); + o->labeltype(FL_ENGRAVED_LABEL); + o->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + o->user_data((void*)(this)); + + Time = new Fl_Knob(xoff+50, yoff+5, 40, 40, "Time"); + Time->color(GUI_COLOUR); + Time->labelsize(10); + Time->maximum(0.25); + Time->step(0.01); + Time->value(0.0); + Time->callback((Fl_Callback*)cb_Time); + + FeedBack = new Fl_Knob(xoff+100, yoff+5, 40, 40, "FeedBack"); + FeedBack->color(GUI_COLOUR); + FeedBack->labelsize(10); + FeedBack->maximum(1); + FeedBack->step(0.01); + FeedBack->value(0.01); + FeedBack->callback((Fl_Callback*)cb_Feedback); + + Randomness = new Fl_Knob(xoff+150, yoff+5, 40, 40, "Random"); + Randomness->color(GUI_COLOUR); + Randomness->labelsize(10); + Randomness->maximum(0.01); + Randomness->step(0.00001); + Randomness->value(0.002); + Randomness->callback((Fl_Callback*)cb_Randomness); + + Bypass = new Fl_Button(xoff+5, yoff+25, 40, 20, "Bypass"); + Bypass->color(GUIBG2_COLOUR); + Bypass->labelsize(10); + Bypass->type(1); + Bypass->value(1); + Bypass->callback((Fl_Callback*)cb_Bypass); + + o->end(); + +} + +void ReverbGUI::UpdateValues() +{ + Time->value(m_reverb->GetTime()); + FeedBack->value(m_reverb->GetFeedback()); + Randomness->value(m_reverb->GetRandomness()); + Bypass->value(m_reverb->IsBypassed()); +} + +//// Callbacks //// + +inline void ReverbGUI::cb_Time_i(Fl_Knob* o, void* v) +{ m_reverb->SetTime(o->value()); } +void ReverbGUI::cb_Time(Fl_Knob* o, void* v) +{ ((ReverbGUI*)(o->parent()->user_data()))->cb_Time_i(o,v); } + +inline void ReverbGUI::cb_Feedback_i(Fl_Knob* o, void* v) +{ m_reverb->SetFeedback(o->value()); } +void ReverbGUI::cb_Feedback(Fl_Knob* o, void* v) +{ ((ReverbGUI*)(o->parent()->user_data()))->cb_Feedback_i(o,v); } + +inline void ReverbGUI::cb_Randomness_i(Fl_Knob* o, void* v) +{ m_reverb->SetRandomness(o->value()); } +void ReverbGUI::cb_Randomness(Fl_Knob* o, void* v) +{ ((ReverbGUI*)(o->parent()->user_data()))->cb_Randomness_i(o,v); } + +inline void ReverbGUI::cb_Bypass_i(Fl_Button* o, void* v) +{ m_reverb->SetBypass(o->value()); } +void ReverbGUI::cb_Bypass(Fl_Button* o, void* v) +{ ((ReverbGUI*)(o->parent()->user_data()))->cb_Bypass_i(o,v); } diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.h b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.h new file mode 100644 index 0000000..9f5f3ac --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/ReverbGUI.h @@ -0,0 +1,63 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include "Widgets/Fl_Knob.H" + +#include "GUIBase.h" +#include "../SpiralSound/Reverb.h" + +#ifndef REVERBGUI +#define REVERBGUI + +class ReverbGUI : public GUIBase +{ +public: + ReverbGUI(Reverb *o); + ~ReverbGUI(); + + virtual void CreateGUI(int xoff, int yoff, char *name); + virtual void UpdateValues(); + Fl_Group* GetGroup() { return GUIReverbGroup; } + + Reverb *m_reverb; + +private: + + Fl_Group *GUIReverbGroup; + Fl_Knob *FeedBack; + Fl_Knob *Time; + Fl_Knob *Randomness; + Fl_Button *Bypass; + + //// Callbacks //// + + inline void cb_Time_i(Fl_Knob* o, void* v); + static void cb_Time(Fl_Knob*, void*); + inline void cb_Feedback_i(Fl_Knob* o, void* v); + static void cb_Feedback(Fl_Knob*, void*); + inline void cb_Randomness_i(Fl_Knob* o, void* v); + static void cb_Randomness(Fl_Knob*, void*); + inline void cb_Bypass_i(Fl_Button* o, void* v); + static void cb_Bypass(Fl_Button* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.H b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.H new file mode 100644 index 0000000..f2b5f86 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.H @@ -0,0 +1,33 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#ifndef Fl_Knob_H +#define Fl_Knob_H +#include +#include +#include + +class Fl_Knob : public Fl_Valuator { +public: + enum Fl_Knobtype {DOTLIN=0,DOTLOG_1,DOTLOG_2,DOTLOG_3,LINELIN,LINELOG_1,LINELOG_2,LINELOG_3,NONE}; +private: + int _type; + float _percent; + int _scaleticks; + short a1,a2; +public: + Fl_Knob(int xx,int yy,int ww,int hh,const char *l=0); + ~Fl_Knob(); +private: + void draw(); + int handle(int event); +public: + void type(int ty); +private: + void shadow(const int offs,const uchar r,uchar g,uchar b); + void draw_scale(const int ox,const int oy,const int side); + void draw_cursor(const int ox,const int oy,const int side); +public: + void cursor(const int pc); + void scaleticks(const int tck); +}; +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.cxx b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.cxx new file mode 100644 index 0000000..49b1584 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.cxx @@ -0,0 +1,268 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#include "Fl_Knob.H" +#include +#include +#include + +Fl_Knob::Fl_Knob(int xx,int yy,int ww,int hh,const char *l): Fl_Valuator(xx,yy,ww,hh,l) { + a1 = 35; + a2 = 325; + _type = DOTLIN; + _percent = 0.3; + _scaleticks = 10; +} + +Fl_Knob::~Fl_Knob() { +} + +void Fl_Knob::draw() { + int ox,oy,ww,hh,side; +float sa,ca,a_r; +unsigned char rr,gg,bb; + + ox = x(); + oy = y(); + ww = w(); + hh = h(); + draw_label(); + fl_clip(ox,oy,ww,hh); + if (ww > hh) + { + side = hh; + ox = ox + (ww - side) / 2; + } + else + { + side = ww; + oy = oy + (hh - side) / 2; + } + side = w() > h () ? hh:ww; + int dam = damage(); + if (dam & FL_DAMAGE_ALL) + { + int col = parent()->color(); + fl_color(col); + fl_rectf(ox,oy,side,side); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(-60,rr,gg,bb); + fl_pie(ox+9,oy+9,side-12,side-12,0,360); + if (_type!=NONE) draw_scale(ox,oy,side); + col = color(); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,40,80); + shadow(30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,80,220); + shadow(-15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,220,260); + shadow(-30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,260,400); + fl_color(FL_BLACK); + fl_arc(ox+6,oy+6,side-11,side-11,0,360); + fl_color(col); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + else + { + fl_color(color()); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + Fl::get_color((Fl_Color)color(),rr,gg,bb); + shadow(10,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,110,150); + fl_pie(ox+10,oy+10,side-20,side-20,290,330); + shadow(17,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,120,140); + fl_pie(ox+10,oy+10,side-20,side-20,300,320); + shadow(25,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,127,133); + fl_pie(ox+10,oy+10,side-20,side-20,307,313); + draw_cursor(ox,oy,side); + fl_pop_clip(); +} + +int Fl_Knob::handle(int event) { + int ox,oy,ww,hh; + + ox = x() + 10; oy = y() + 10; + ww = w() - 20; + hh = h()-20; + switch (event) + { + case FL_PUSH: + handle_push(); + case FL_DRAG: + { + int mx = Fl::event_x()-ox-ww/2; + int my = Fl::event_y()-oy-hh/2; + if (!mx && !my) return 1; + double angle = 270-atan2((float)-my, (float)mx)*180/M_PI; + double oldangle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + while (angle < oldangle-180) angle += 360; + while (angle > oldangle+180) angle -= 360; + double val; + if ((a1= a1)) + { + val = minimum(); + } + else + if ((a1= a2) : (angle <= a2)) + { + val = maximum(); + } + else + { + val = minimum() + (maximum()-minimum())*(angle-a1)/(a2-a1); + } + handle_drag(clamp(round(val))); + } + return 1; + case FL_RELEASE: + handle_release(); + return 1; + default: + return 0; + } + return 0; +} + +void Fl_Knob::type(int ty) { + _type = ty; +} + +void Fl_Knob::shadow(const int offs,const uchar r,uchar g,uchar b) { + int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb); +} + +void Fl_Knob::draw_scale(const int ox,const int oy,const int side) { + float x1,y1,x2,y2,rds,cx,cy,ca,sa; + + rds = side / 2; + cx = ox + side / 2; + cy = oy + side / 2; + if (!(_type & DOTLOG_3)) + { + if (_scaleticks == 0) return; + double a_step = (10.0*3.14159/6.0) / _scaleticks; + double a_orig = -(3.14159/3.0); + for (int a = 0; a <= _scaleticks; a++) + { + double na = a_orig + a * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx + rds * ca; + y1 = cy - rds * sa; + x2 = cx + (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line(x1,y1,x2,y2); + fl_color(FL_WHITE); + if (sa*ca >=0) + fl_line(x1+1,y1+1,x2+1,y2+1); + else + fl_line(x1+1,y1-1,x2+1,y2-1); + } + } + else + { + int nb_dec = (_type & DOTLOG_3); + for (int k = 0; k < nb_dec; k++) + { + double a_step = (10.0*3.14159/6.0) / nb_dec; + double a_orig = -(3.14159/3.0) + k * a_step; + for (int a = (k) ? 2:1; a <= 10; ) + { + double na = a_orig + log10((double)a) * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx - rds * ca; + y1 = cy - rds * sa; + x2 = cx - (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line(x1,y1,x2,y2); + fl_color(FL_WHITE); + if (sa*ca <0) + fl_line(x1+1,y1+1,x2+1,y2+1); + else + fl_line(x1+1,y1-1,x2+1,y2-1); + if ((a == 1) || (nb_dec == 1)) + a += 1; + else + a += 2; + } + } + } +} + +void Fl_Knob::draw_cursor(const int ox,const int oy,const int side) { + float rds,cur,cx,cy; +double angle; + + rds = (side - 20) / 2.0; + cur = _percent * rds / 2; + cx = ox + side / 2; + cy = oy + side / 2; + angle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + fl_push_matrix(); + fl_scale(1,1); + fl_translate(cx,cy); + fl_rotate(-angle); + fl_translate(0,rds-cur-2.0); + if (_type 1.0) _percent = 1.0; + if (visible()) damage(FL_DAMAGE_CHILD); +} + +void Fl_Knob::scaleticks(const int tck) { + _scaleticks = tck; + if (_scaleticks < 0) _scaleticks = 0; + if (_scaleticks > 31) _scaleticks = 31; + if (visible()) damage(FL_DAMAGE_ALL); +} diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.fld b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.fld new file mode 100644 index 0000000..df3b717 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Knob.fld @@ -0,0 +1,280 @@ +# data file for the Fltk User Interface Designer (fluid) +version 2.00 +header_name {.H} +code_name {.cxx} +gridx 5 +gridy 5 +snap 3 +decl {\#include } {public +} + +decl {\#include } {} + +decl {\#include } {} + +class Fl_Knob {open : {public Fl_Valuator} +} { + decl {enum Fl_Knobtype {DOTLIN=0,DOTLOG_1,DOTLOG_2,DOTLOG_3,LINELIN,LINELOG_1,LINELOG_2,LINELOG_3};} {public + } + decl {int _type;} {} + decl {float _percent;} {} + decl {int _scaleticks;} {} + decl {short a1,a2;} {} + Function {Fl_Knob(int xx,int yy,int ww,int hh,const char *l=0): Fl_Valuator(xx,yy,ww,hh,l)} {} { + code {a1 = 35; + a2 = 325; + _type = DOTLIN; + _percent = 0.3; + _scaleticks = 10;} {} + } + Function {~Fl_Knob()} {} {} + Function {draw()} {open private + } { + code {int ox,oy,ww,hh,side; +float sa,ca,a_r; +unsigned char rr,gg,bb; + + ox = x(); + oy = y(); + ww = w(); + hh = h(); + draw_label(); + fl_clip(ox,oy,ww,hh); + if (ww > hh) + { + side = hh; + ox = ox + (ww - side) / 2; + } + else + { + side = ww; + oy = oy + (hh - side) / 2; + } + side = w() > h () ? hh:ww; + int dam = damage(); + if (dam & FL_DAMAGE_ALL) + { + int col = parent()->color(); + fl_color(col); + fl_rectf(ox,oy,side,side); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(-60,rr,gg,bb); + fl_pie(ox+9,oy+9,side-12,side-12,0,360); + draw_scale(ox,oy,side); + col = color(); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,40,80); + shadow(30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,80,220); + shadow(-15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,220,260); + shadow(-30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,260,400); + fl_color(FL_BLACK); + fl_arc(ox+6,oy+6,side-11,side-11,0,360); + fl_color(col); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + else + { + fl_color(color()); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + Fl::get_color((Fl_Color)color(),rr,gg,bb); + shadow(10,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,110,150); + fl_pie(ox+10,oy+10,side-20,side-20,290,330); + shadow(17,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,120,140); + fl_pie(ox+10,oy+10,side-20,side-20,300,320); + shadow(25,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,127,133); + fl_pie(ox+10,oy+10,side-20,side-20,307,313); + draw_cursor(ox,oy,side); + fl_pop_clip();} {selected + } + } + Function {handle(int event)} {private return_type int + } { + code {int ox,oy,ww,hh; + + ox = x() + 10; oy = y() + 10; + ww = w() - 20; + hh = h()-20; + switch (event) + { + case FL_PUSH: + handle_push(); + case FL_DRAG: + { + int mx = Fl::event_x()-ox-ww/2; + int my = Fl::event_y()-oy-hh/2; + if (!mx && !my) return 1; + double angle = 270-atan2((float)-my, (float)mx)*180/M_PI; + double oldangle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + while (angle < oldangle-180) angle += 360; + while (angle > oldangle+180) angle -= 360; + double val; + if ((a1= a1)) + { + val = minimum(); + } + else + if ((a1= a2) : (angle <= a2)) + { + val = maximum(); + } + else + { + val = minimum() + (maximum()-minimum())*(angle-a1)/(a2-a1); + } + handle_drag(clamp(round(val))); + } + return 1; + case FL_RELEASE: + handle_release(); + return 1; + default: + return 0; + } + return 0;} {} + } + Function {type(int ty)} {} { + code {_type = ty;} {} + } + Function {shadow(const int offs,const uchar r,uchar g,uchar b)} {private + } { + code {int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb);} {} + } + Function {draw_scale(const int ox,const int oy,const int side)} {private + } { + code {float x1,y1,x2,y2,rds,cx,cy,ca,sa; + + rds = side / 2; + cx = ox + side / 2; + cy = oy + side / 2; + if (!(_type & DOTLOG_3)) + { + if (_scaleticks == 0) return; + double a_step = (10.0*3.14159/6.0) / _scaleticks; + double a_orig = -(3.14159/3.0); + for (int a = 0; a <= _scaleticks; a++) + { + double na = a_orig + a * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx + rds * ca; + y1 = cy - rds * sa; + x2 = cx + (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line(x1,y1,x2,y2); + fl_color(FL_WHITE); + if (sa*ca >=0) + fl_line(x1+1,y1+1,x2+1,y2+1); + else + fl_line(x1+1,y1-1,x2+1,y2-1); + } + } + else + { + int nb_dec = (_type & DOTLOG_3); + for (int k = 0; k < nb_dec; k++) + { + double a_step = (10.0*3.14159/6.0) / nb_dec; + double a_orig = -(3.14159/3.0) + k * a_step; + for (int a = (k) ? 2:1; a <= 10; ) + { + double na = a_orig + log10((double)a) * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx - rds * ca; + y1 = cy - rds * sa; + x2 = cx - (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line(x1,y1,x2,y2); + fl_color(FL_WHITE); + if (sa*ca <0) + fl_line(x1+1,y1+1,x2+1,y2+1); + else + fl_line(x1+1,y1-1,x2+1,y2-1); + if ((a == 1) || (nb_dec == 1)) + a += 1; + else + a += 2; + } + } + }} {} + } + Function {draw_cursor(const int ox,const int oy,const int side)} {private + } { + code {float rds,cur,cx,cy; +double angle; + + rds = (side - 20) / 2.0; + cur = _percent * rds / 2; + cx = ox + side / 2; + cy = oy + side / 2; + angle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + fl_push_matrix(); + fl_scale(1,1); + fl_translate(cx,cy); + fl_rotate(-angle); + fl_translate(0,rds-cur-2.0); + if (_type 1.0) _percent = 1.0; + if (visible()) damage(FL_DAMAGE_CHILD);} {} + } + Function {scaleticks(const int tck)} {} { + code {_scaleticks = tck; + if (_scaleticks < 0) _scaleticks = 0; + if (_scaleticks > 31) _scaleticks = 31; + if (visible()) damage(FL_DAMAGE_ALL);} {} + } +} diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.H b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.H new file mode 100644 index 0000000..850ef61 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.H @@ -0,0 +1,17 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#ifndef Fl_LED_Button_H +#define Fl_LED_Button_H +#include +#include +#include + +class Fl_LED_Button : public Fl_Light_Button { +public: + Fl_LED_Button(int x, int y, int w, int h, const char* l=0); + ~Fl_LED_Button(); +private: + void draw(); + void modulate(const int offs,const uchar r,uchar g,uchar b); +}; +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.cxx b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.cxx new file mode 100644 index 0000000..fae03a8 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.cxx @@ -0,0 +1,63 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#include "Fl_LED_Button.H" +#include + +Fl_LED_Button::Fl_LED_Button(int x, int y, int w, int h, const char* l):Fl_Light_Button(x,y,w,h,l) { + box(FL_NO_BOX); + down_box(FL_ROUND_DOWN_BOX); + selection_color(FL_RED); +} + +Fl_LED_Button::~Fl_LED_Button() { +} + +void Fl_LED_Button::draw() { + uchar r,g,b; + + //if (box()) draw_box(this==Fl::pushed() ? down(box()) : box(), color()); + Fl_Color col = value() ? selection_color() : color(); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + int d = h()/6; + int W = w()color(),r,g,b); + modulate(-90,r,g,b); + fl_pie(x1-1,y1-1,ww+2,hh+2,0,360); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + if (value()) modulate(-90,r,g,b); else modulate(-210,r,g,b); + fl_pie(x1,y1,ww,hh,0,360); + if (value()) modulate(-60,r,g,b); else modulate(-190,r,g,b); + fl_pie(x1+1,y1+1,ww-2,hh-2,0,360); + if (value()) modulate(-20,r,g,b); else modulate(-150,r,g,b); + fl_pie(x1+1,y1+1,ww-3,hh-3,0,360); + if (value()) modulate(0,r,g,b); else modulate(-130,r,g,b); + fl_pie(x1+3,y1+3,ww-5,hh-5,0,360); + if (value()) modulate(160,r,g,b); else modulate(-30,r,g,b); + fl_arc(x1+3,y1+3,ww-5,hh-5,250,350); + if (value()) modulate(250,r,g,b); else modulate(100,r,g,b); + fl_pie((int)(x1+ww/2-(0.3*ww)/2),(int)(y1+ww/2-(0.3*ww)/2), + (int)((0.45*ww)/2),(int)((0.45*ww)/2),0,360); + fl_color(FL_BLACK); + fl_arc(x1,y1,ww+1,hh+1,0,360); + draw_label(x()+W-d, y(), w()-W+d, h());//,labelcolor()); +} + +void Fl_LED_Button::modulate(const int offs,const uchar r,uchar g,uchar b) { + int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb); +} diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.fld b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.fld new file mode 100644 index 0000000..afa02a0 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_LED_Button.fld @@ -0,0 +1,74 @@ +# data file for the Fltk User Interface Designer (fluid) +version 2.00 +header_name {.H} +code_name {.cxx} +gridx 5 +gridy 5 +snap 3 +decl {\#include } {} + +decl {\#include } {public +} + +class Fl_LED_Button {open : {public Fl_Light_Button} +} { + Function {Fl_LED_Button(int x, int y, int w, int h, const char* l=0):Fl_Light_Button(x,y,w,h,l)} {open + } { + code {box(FL_NO_BOX); + down_box(FL_ROUND_DOWN_BOX); + selection_color(FL_RED);} {} + } + Function {~Fl_LED_Button()} {open + } {} + Function {draw()} {open private + } { + code {uchar r,g,b; + + if (box()) draw_box(this==Fl::pushed() ? down(box()) : box(), color()); + Fl_Color col = value() ? selection_color() : color(); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + int d = h()/6; + int W = w()color(),r,g,b); + modulate(-90,r,g,b); + fl_pie(x1-1,y1-1,ww+2,hh+2,0,360); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + if (value()) modulate(-90,r,g,b); else modulate(-210,r,g,b); + fl_pie(x1,y1,ww,hh,0,360); + if (value()) modulate(-60,r,g,b); else modulate(-190,r,g,b); + fl_pie(x1+1,y1+1,ww-2,hh-2,0,360); + if (value()) modulate(-20,r,g,b); else modulate(-150,r,g,b); + fl_pie(x1+1,y1+1,ww-3,hh-3,0,360); + if (value()) modulate(0,r,g,b); else modulate(-130,r,g,b); + fl_pie(x1+3,y1+3,ww-5,hh-5,0,360); + if (value()) modulate(160,r,g,b); else modulate(-30,r,g,b); + fl_arc(x1+3,y1+3,ww-5,hh-5,250,350); + if (value()) modulate(250,r,g,b); else modulate(100,r,g,b); + fl_pie((int)(x1+ww/2-(0.3*ww)/2),(int)(y1+ww/2-(0.3*ww)/2), + (int)((0.45*ww)/2),(int)((0.45*ww)/2),0,360); + fl_color(FL_BLACK); + fl_arc(x1,y1,ww+1,hh+1,0,360); + draw_label(x()+W-d, y(), w()-W+d, h(),labelcolor());} {selected + } + } + Function {modulate(const int offs,const uchar r,uchar g,uchar b)} {open private + } { + code {int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb);} {} + } +} diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.C b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.C new file mode 100644 index 0000000..47eca7e --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.C @@ -0,0 +1,406 @@ +/* LoopWidget + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl_Loop.h" +#include +#include +#include +#include + +///////////////////////////////////////////////////////////////////////////// + +static const int REZ = 1000; +static const float RADCONV = 0.017453292; +static const int INDW = 3; // indicator width +static const int UPDATECYCLES = 4; + +static const int POSMARKER_MAX = 50; + +Fl_Loop::Fl_Loop(int x, int y, int w, int h, const char* label) : +Fl_Group(x,y,w,h,label), +m_data(NULL), +m_MainWin(NULL), +m_Length(1000), +m_InnerRad((int)(w/2*0.75f)), +m_OuterRad((int)(w/2*0.95f)), +m_BorderRad(w/2), +m_IndSX(0), +m_IndSY(0), +m_IndEX(0), +m_IndEY(0), +m_StartAngle(0), +m_EndAngle(1), +m_MoveAngle(0.0f), +m_RangeStart(0), +m_RangeEnd(0), +m_Angle(0), +m_Pos(NULL), +m_Update(false), +m_StopUpdate(false), +m_WaveSize(1.0f), +m_Move(0), +m_LastMove(0), +m_Snap(false), +m_SnapDegrees(45), +m_PosMarkerCount(0) +{ + m_MidX=(w/2)+x; + m_MidY=(h/2)+y; +} + +void Fl_Loop::SetupCopyBufFuncs(cb_CopyBuf1 *Cut, + cb_CopyBuf1 *Copy, + cb_CopyBuf2 *Paste, + cb_CopyBuf2 *PasteMix, + cb_CopyBuf1 *ZeroRange, + cb_CopyBuf1 *ReverseRange, + cb_CopyBuf1 *Halve, + cb_CopyBuf1 *Hold, + cb_CopyBuf1 *SelectAll, + cb_CopyBuf1 *NewTrigger, + cb_CopyBuf1 *Move) + +{ + cb_Cut = Cut; + cb_Copy = Copy; + cb_Paste = Paste; + cb_PasteMix = PasteMix; + cb_ZeroRange = ZeroRange; + cb_ReverseRange = ReverseRange; + cb_Halve = Halve; + cb_Hold = Hold; + cb_SelectAll = SelectAll; + cb_NewTrigger = NewTrigger; + cb_Move = Move; +} + + + +void Fl_Loop::SetLength(const int Len) +{ + m_Length=Len; + + // recalc start and end points + m_RangeStart=(int)(m_StartAngle*(m_Length/360.0f)); + while (m_RangeStart < 0) m_RangeStart += m_Length; + while (m_RangeStart > m_Length) m_RangeStart -= m_Length; + + m_RangeEnd=(int)(m_EndAngle*(m_Length/360.0f)); + while (m_RangeEnd < 0) m_RangeEnd += m_Length; + while (m_RangeEnd > m_Length) m_RangeEnd -= m_Length; +} + +void Fl_Loop::DrawWav() +{ + int Thickness=(m_OuterRad-m_InnerRad)/2; + int n=0,x=0,y=0,ox=0,oy=0, c=0, skip=0; + bool FirstTime=true; + float Angle=0; + float Sample=0; + float SampleAngle=360.0f/(float)(REZ); + + skip=m_Length/REZ; + if (skip<1) skip=1; + + fl_color(100,155,100); + + while(m_Length>0 && n1) Sample=1; + if (Sample<-1) Sample=-1; + } + + Angle=c*SampleAngle; + + ox=x; + oy=y; + + float pos=Sample*Thickness+m_InnerRad+Thickness; + + x=(int)(m_MidX+sin(Angle*RADCONV)*pos); + y=(int)(m_MidY+cos(Angle*RADCONV)*pos); + + if (Angle>m_StartAngle && Anglevisible() || !parent()->visible()) return; + window()->make_current(); + + if (m_Pos) + { + float Angle=(*m_Pos/m_Length)*360.0; + fl_line_style(FL_SOLID, 3, NULL); + XSetFunction(fl_display,fl_gc,GXxor); + fl_line(m_IndSX,m_IndSY,m_IndEX,m_IndEY); + + fl_color(FL_BLUE); + + m_IndSX=(int)(m_MidX+sin(Angle*RADCONV)*m_InnerRad); + m_IndSY=(int)(m_MidY+cos(Angle*RADCONV)*m_InnerRad); + m_IndEX=(int)(m_MidX+sin(Angle*RADCONV)*m_OuterRad); + m_IndEY=(int)(m_MidY+cos(Angle*RADCONV)*m_OuterRad); + + + fl_line(m_IndSX,m_IndSY,m_IndEX,m_IndEY); + fl_line_style(FL_SOLID, 1, NULL); + XSetFunction(fl_display,fl_gc,GXcopy); + } + + if (m_PosMarkerCount>POSMARKER_MAX) + { + redraw(); + m_PosMarkerCount=0; + } + + m_PosMarkerCount++; + + //Last->make_current(); +} + +void Fl_Loop::DrawWidgets() +{ + Fl_Group::draw(); +} + +void Fl_Loop::DrawEveryThing() +{ + if (damage() & (FL_DAMAGE_EXPOSE|FL_DAMAGE_ALL)) + { + if (m_PosMarkerCount>POSMARKER_MAX) + { + m_PosMarkerCount=0; + } + + fl_color(color()); + fl_rectf(x(),y(),w(),h()); + + m_InnerRad-=5; + m_OuterRad+=5; + fl_color(20,60,20); + fl_pie(m_MidX-m_OuterRad, m_MidY-m_OuterRad, m_OuterRad*2, m_OuterRad*2, 0, 360); + fl_color(color()); + fl_pie(m_MidX-m_InnerRad, m_MidY-m_InnerRad, m_InnerRad*2, m_InnerRad*2, 0, 360); + m_OuterRad-=5; + m_InnerRad+=5; + + DrawWav(); + } + + DrawWidgets(); +} + +void Fl_Loop::draw() +{ + DrawEveryThing(); +} + +int Fl_Loop::handle(int event) +{ + static int LastButtonPushed=0; + + // call base + if (!Fl_Group::handle(event)) + { + switch (event) + { + case FL_PUSH: + LastButtonPushed=Fl::event_button(); + // fall through + case FL_DRAG: + { + int mx = Fl::event_x()-m_MidX; + int my = Fl::event_y()-m_MidY; + if (!mx && !my) break; + + double angle = 90+atan2((float)-my, (float)mx)*180/M_PI; + while (angle < m_Angle-180) angle += 360; + while (angle > m_Angle+180) angle -= 360; + + while (angle < 0) angle += 360; + while (angle > 360) angle -= 360; + + m_Angle=angle; + + // snap + if (m_Snap) + { + m_Angle-=(int)m_Angle%m_SnapDegrees; + } + + if (LastButtonPushed==2) + { + if (m_Pos) + { + *m_Pos=m_Angle*(m_Length/360.0f); + + while (*m_Pos < 0) *m_Pos += m_Length; + while (*m_Pos > m_Length) *m_Pos -= m_Length; + } + } + else if (LastButtonPushed==1) + { + switch (event) + { + case FL_PUSH: + { + m_StartAngle=m_Angle; + m_EndAngle=m_Angle; + redraw(); + } + break; + + case FL_DRAG: + { + if (m_Angle>m_StartAngle) + { + m_EndAngle=m_Angle; + } + else + { + m_StartAngle=m_Angle; + } + redraw(); + } + break; + } + + // convert angle to sample data + m_RangeStart=(int)(m_StartAngle*(m_Length/360.0f)); + while (m_RangeStart < 0) m_RangeStart += m_Length; + while (m_RangeStart > m_Length) m_RangeStart -= m_Length; + + m_RangeEnd=(int)(m_EndAngle*(m_Length/360.0f)); + while (m_RangeEnd < 0) m_RangeEnd += m_Length; + while (m_RangeEnd > m_Length) m_RangeEnd -= m_Length; + + }else if (LastButtonPushed==3) + { + switch (event) + { + case FL_PUSH: + { + m_MoveAngle=m_Angle; + + // reset the last + // convert angle to sample data + m_LastMove=(int)(m_MoveAngle*(m_Length/360.0f)); + while (m_LastMove < 0) m_LastMove += m_Length; + while (m_LastMove > m_Length) m_Move -= m_Length; + } + break; + + case FL_DRAG: + { + m_MoveAngle=m_Angle; + redraw(); + } + break; + } + + // convert angle to sample data + m_Move=(int)(m_MoveAngle*(m_Length/360.0f)); + while (m_Move < 0) m_Move += m_Length; + while (m_Move > m_Length) m_Move -= m_Length; + + // do the move + cb_Move(this,m_LastMove-m_Move,0); + + m_LastMove=m_Move; + } + } + break; + + case FL_RELEASE: + break; + + case FL_KEYBOARD: + case FL_SHORTCUT: + { + if (Fl::event_key(FL_Control_L) || Fl::event_key(FL_Control_R)) + { + if (Fl::event_key('c')) cb_Copy(this,m_RangeStart,m_RangeEnd); + if (Fl::event_key('v')) cb_Paste(this,m_RangeStart); + if (Fl::event_key('x')) cb_Cut(this,m_RangeStart,m_RangeEnd); + if (Fl::event_key('b')) cb_PasteMix(this,m_RangeStart); + if (Fl::event_key('z')) cb_ZeroRange(this,m_RangeStart,m_RangeEnd); + if (Fl::event_key('r')) cb_ReverseRange(this,m_RangeStart,m_RangeEnd); + if (Fl::event_key('h')) cb_Halve(this,0,0); + if (Fl::event_key('s')) cb_Hold(this,0,0); + if (Fl::event_key('a')) + { + m_StartAngle=0.0f; + m_RangeStart=0; + m_EndAngle=360.0f; + m_RangeEnd=m_Length; + redraw(); + } + if (Fl::event_key('t')) cb_NewTrigger(this,0,0); + // move? + } + } + break; + + default: + return 0; + } + + } + return 1; +} diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.h b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.h new file mode 100644 index 0000000..7baf403 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Loop.h @@ -0,0 +1,115 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include + +#ifndef LOOPWIDGET +#define LOOPWIDGET + +class Fl_Loop : public Fl_Group +{ +public: + Fl_Loop(int x, int y, int w, int h, const char* label=0); + + virtual void draw(); + virtual int handle(int event); + + void SetData(float const *set) {m_data=set;} + void SetLength(const int Len); + void SetPos(float *p) {m_Pos=p;} + void SetUpdate(bool p) {m_Update=p;} + void StopUpdate(bool p) {m_StopUpdate=p;} + void SetWaveSize(float s) {m_WaveSize=s;} + void SetMainWin(Fl_Window *s) {m_MainWin=s;} + void SetIdle(); + void UnsetIdle(); + void DrawWav(); + void DrawWidgets(); + void DrawEveryThing(); + void DrawPosMarker(); + void SetSnap(bool s) {m_Snap=s;} + void SetSnapAngle(int s) {m_SnapDegrees=s;} + + typedef void (cb_CopyBuf1)(Fl_Loop *, int, int); + typedef void (cb_CopyBuf2)(Fl_Loop *, int); + + void SetupCopyBufFuncs(cb_CopyBuf1 *Cut, + cb_CopyBuf1 *Copy, + cb_CopyBuf2 *Paste, + cb_CopyBuf2 *PasteMix, + cb_CopyBuf1 *cb_ZeroRange, + cb_CopyBuf1 *cb_ReverseRange, + cb_CopyBuf1 *cb_Halve, + cb_CopyBuf1 *cb_Hold, + cb_CopyBuf1 *cb_SelectAll, + cb_CopyBuf1 *cb_NewTrigger, + cb_CopyBuf1 *cb_Move); + + int GetX() {return x();} + int GetY() {return y();} + int GetW() {return w();} + int GetH() {return h();} + +private: + + float const *m_data; + + Fl_Window *m_MainWin; + + int m_Length; + int m_InnerRad; + int m_OuterRad; + int m_BorderRad; + int m_IndSX,m_IndSY,m_IndEX,m_IndEY; + int m_MidX,m_MidY; + + float m_StartAngle; + float m_EndAngle; + float m_MoveAngle; + int m_RangeStart; + int m_RangeEnd; + float m_Angle; + float *m_Pos; + bool m_Update; + bool m_StopUpdate; + float m_WaveSize; + int m_Move; + int m_LastMove; + bool m_Snap; + int m_SnapDegrees; + int m_PosMarkerCount; + + static void cb_Idle(void* o); + + cb_CopyBuf1 *cb_Cut; + cb_CopyBuf1 *cb_Copy; + cb_CopyBuf2 *cb_Paste; + cb_CopyBuf2 *cb_PasteMix; + cb_CopyBuf1 *cb_ZeroRange; + cb_CopyBuf1 *cb_ReverseRange; + cb_CopyBuf1 *cb_Halve; + cb_CopyBuf1 *cb_Hold; + cb_CopyBuf1 *cb_SelectAll; + cb_CopyBuf1 *cb_NewTrigger; + cb_CopyBuf1 *cb_Move; + +}; + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Trigger.C b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Trigger.C new file mode 100644 index 0000000..1a943d9 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/GUI/Widgets/Fl_Trigger.C @@ -0,0 +1,202 @@ +/* TriggerWidget + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl_Trigger.h" +#include +#include +#include +#include +#include "Fl_Loop.h" + +///////////////////////////////////////////////////////////////////////////// + +static const float RADCONV = 0.017453292; + +Fl_Trigger::Fl_Trigger(int x, int y, int w, int h, const char* label) : +Fl_Widget(x,y,w,h,label), +m_ID(0), +m_CentreX(0), +m_CentreY(0), +m_CentreRadius(0), +m_Dragging(false), +m_Loop(0), +m_Passes(0), +m_Count(0), +m_Angle(0), +m_MaxLoops(10), +m_MaxPasses(10), +m_Snap(false), +m_SnapDegrees(45) +{ +} + +void Fl_Trigger::draw() +{ + x((int)((sin(m_Angle*RADCONV)*m_CentreRadius)+m_CentreX-w()/2)); + y((int)((cos(m_Angle*RADCONV)*m_CentreRadius)+m_CentreY-h()/2)); + + fl_font(fl_font(),8); + + fl_color(255,255,255); + fl_arc(x(), y(), w(), h(), 0, 360); + + int cx=x()+w()/2; + int cy=y()+h()/2; + + char text[32]; + //sprintf(text,"%d",m_Loop); + //fl_draw(text, cx-2, cy-h()+5); + + //sprintf(text,"%d",m_Passes); + //fl_draw(text, cx+w()-5, cy+3); + + sprintf(text,"%d",m_ID); + fl_draw(text, cx, cy); + + //char t[32]; + //sprintf(t,"%d",m_Count); + //fl_draw(t, cx-2, cy-h()+5); +} + +int Fl_Trigger::handle(int event) +{ + static int LastButtonPushed=0; + + // call base + if (!Fl_Widget::handle(event)) + { + int ww,hh; + + ww = w(); + hh = h(); + + int mx = Fl::event_x(); + int my = Fl::event_y(); + + switch (event) + { + case FL_PUSH: + LastButtonPushed=Fl::event_button(); + + if (LastButtonPushed==1) + { + if (sqrt((float)(mx-x()*my-y()))7) + { + m_ID=0; + } + redraw(); + Fl_Loop *p=(Fl_Loop*)parent(); + p->DrawEveryThing(); + p->redraw(); + } + + if (LastButtonPushed==3) + { + /*m_Passes++; + if (m_Passes>m_MaxPasses) + { + m_Passes=0; + } + redraw(); + Fl_Loop *p=(Fl_Loop*)parent(); + p->DrawEveryThing(); + p->redraw();*/ + } + + // fall through + + case FL_DRAG: + { + if (LastButtonPushed==2) + { + + } + else if (LastButtonPushed==1) + { + if (m_Dragging) + { + int px = mx-m_CentreX; + int py = my-m_CentreY; + + double angle = 90+atan2((float)-py, (float)px)*180/M_PI; + while (angle < m_Angle-180) angle += 360; + while (angle > m_Angle+180) angle -= 360; + + while (angle < 0) angle += 360; + while (angle > 360) angle -= 360; + + m_Angle=angle; + + // snap + if (m_Snap) + { + m_Angle-=(int)m_Angle%m_SnapDegrees; + } + + redraw(); + } + } + else if (LastButtonPushed==3) + { + + } + } + break; + + case FL_RELEASE: + { + m_Dragging=false; + Fl_Loop *p=(Fl_Loop*)parent(); + p->DrawEveryThing(); + p->redraw(); + } + break; + + default: + return 0; + } + + } + return 1; +} + +istream &operator>>(istream &s, Fl_Trigger &o) +{ + s>>o.m_CentreX>>o.m_CentreY>>o.m_CentreRadius>>o.m_Dragging>>o.m_ID>>o.m_Passes>> + o.m_Count>>o.m_Angle>>o.m_MaxLoops>>o.m_MaxPasses; + + return s; +} + +ostream &operator<<(ostream &s, Fl_Trigger &o) +{ + s< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + +#include +#include +#include + +#ifndef TRIGGERWIDGET +#define TRIGGERWIDGET + +using namespace std; + +class Fl_Trigger : public Fl_Widget +{ +public: + Fl_Trigger(int x, int y, int w, int h, const char* label=0); + + virtual void draw(); + virtual int handle(int event); + + void SetID(int s) {m_ID=s;} + int GetID() { return m_ID;} + void SetCentreX(int s) {m_CentreX=s;} + void SetCentreY(int s) {m_CentreY=s;} + void SetCentreRadius(int s) {m_CentreRadius=s;} + void IncCount() + { + m_Count++; if (m_Count>m_Passes) m_Count=0; + } + bool Completed() {return (m_Count==m_Passes); } + + float GetAngle() {return m_Angle;} + int GetLoop() {return m_Loop;} + int GetPass() {return m_Passes;} + void SetSnap(bool s) {m_Snap=s;} + void SetSnapAngle(int s) {m_SnapDegrees=s;} + +private: + + int m_ID; + int m_CentreX; + int m_CentreY; + int m_CentreRadius; + + bool m_Dragging; + int m_Loop; + int m_Passes; + int m_Count; + + float m_Angle; + + int m_MaxLoops; + int m_MaxPasses; + + bool m_Snap; + int m_SnapDegrees; + + friend istream &operator>>(istream &s, Fl_Trigger &o); + friend ostream &operator<<(ostream &s, Fl_Trigger &o); +}; + +istream &operator>>(istream &s, Fl_Trigger &o); +ostream &operator<<(ostream &s, Fl_Trigger &o); + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/Loop.C b/SpiralSound/Plugins/SpiralLoopPlugin/Loop.C new file mode 100644 index 0000000..b2092bd --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/Loop.C @@ -0,0 +1,464 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include + +#include "Loop.h" +#include "../../RiffWav.h" +//#include "SpiralLoopsInfo.h" + +static const int RECBUFFERSIZE = 16384; +static const float RECORD_GAIN = 1.0f; + +Loop::Loop() : +m_Id(0), +m_Pos(0), +m_IntPos(0), +m_PlayBufPos(0), +m_Playing(true), +m_Recording(false), +m_Master(false), +m_DelMe(false), +m_LoopPoint(0), +m_Speed(1.0f), +m_Volume(1.0f), +m_RecordingSource(NULL), +m_Balance(1.0f), +m_LeftVol(1.0f), +m_RightVol(1.0f), +m_FirstRecord(true), +m_FixedRecord(false), +m_RecLength(0), +m_EffectsOn(false) +{ +} + +Loop::~Loop() +{ +} + +void Loop::LoadWav(const char *Filename) +{ + WavFile wav; + if (wav.Open(Filename, WavFile::READ)) + { + Clear(); + AllocateMem(wav.GetSize()); + wav.Load(m_StoreBuffer); + //((Fl_Loop*)(m_GUI->GetGUI()))->DrawEveryThing(); + m_GUI->UpdateDataPtr(); + } +} + +void Loop::SaveWav(const char *Filename) +{ + WavFile wav; + if (wav.Open(Filename, WavFile::WRITE, WavFile::MONO)) + { + wav.Save(m_StoreBuffer); + } + + m_Sample=Filename; +} + +bool Loop::GetOutput(Sample &data) +{ + if (!m_Recording && !m_Playing) + { + return false; + } + + if (!m_Recording && m_StoreBuffer.GetLength()==0) + { + return false; + } + + if (m_Recording) + { + RecordBuf(m_Pos, data.GetLength()); + + if (!m_StoreBuffer.GetLength()) + { + return false; + } + } + + int Pos; + + for (int n=0; n(m_Pos); + + // brute force fix + if (Pos>0 && Pos(m_Pos)>=m_LoopPoint) + { + m_Pos=0; + } + } + + m_Filter.GetOutput(0,data); + + // causes problems if we save to a hold buffer + // while we're recording, as we might not know + // the size of the final buffer + if (!m_Recording) + { + for (int n=0; n=m_LoopPoint) + { + m_PlayBufPos=0; + } + + m_HoldBuffer.Set(m_PlayBufPos,data[n]); + m_PlayBufPos++; + } + } + + m_IntPos=static_cast(m_Pos); + + m_GUI->UpdatePos(); + + return true; +} + +void Loop::AllocateMem(int Length) +{ + // We might need to keep these values (if loading workspace) + if (m_LoopPoint>Length) m_LoopPoint=Length; + if (m_Pos>Length) m_Pos=0; + + if (m_LoopPoint==0) m_LoopPoint=Length; + + if (!m_StoreBuffer.Allocate(Length) || + !m_HoldBuffer.Allocate(Length)) + { + cerr<<"AllocateMem can't allocate any more memory!"<=m_StoreBuffer.GetLength()) + { + Pos=0; + } + + for (int n=0; n(Pos)]+m_RecordingSource[n]*RECORD_GAIN; + + + // fill in all the samples between the speed jump with the same value + m_StoreBuffer.Set((int)Pos,temp); + + for (int i=static_cast(OldPos); i<=static_cast(Pos); i++) + { + m_StoreBuffer.Set(i,temp); + } + + OldPos=Pos; + Pos+=m_Speed; + + if (Pos>=m_StoreBuffer.GetLength()) + { + Pos-=m_StoreBuffer.GetLength(); + + // remember to fill up to the end of the last buffer + for (int i=static_cast(OldPos); i=RECBUFFERSIZE) + { + // put the two buffers together + m_StoreBuffer.Add(m_RecBuffer); + m_RecPos=0; + } + + long temp=(long)(m_RecordingSource[n]*RECORD_GAIN); + m_RecBuffer.Set(m_RecPos,temp); + + m_RecLength++; + m_RecPos++; + } + } +} + +void Loop::EndRecordBuf() +{ + m_FirstRecord=true; + m_LoopPoint=m_StoreBuffer.GetLength(); + + if (!m_FixedRecord) + { + // reallocate the hold buffer for the new size + // (if the size has changed) + m_HoldBuffer.Allocate(m_LoopPoint); + } +} + +void Loop::Crop() +{ + if (m_LoopPointLen) + { + SetLength(Len); + return; + } + else + { + // if it's empty + if (!m_StoreBuffer.GetLength()) + { + AllocateMem(Len); + m_StoreBuffer.Zero(); + } + else + // there is something in the buffer already, but we need to + // add on some extra data to make the length the same + { + int ExtraLen=Len-m_StoreBuffer.GetLength(); + m_StoreBuffer.Expand(ExtraLen); + m_HoldBuffer.Expand(ExtraLen); + } + } +} + +void Loop::Cut(int Start, int End) +{ + //m_Parent->Cut(m_StoreBuffer,Start,End); + if (m_StoreBuffer.GetLength()m_LoopPoint) + { + m_Pos=0; + } + + m_HoldBuffer.Allocate(m_StoreBuffer.GetLength()); +} + +void Loop::Copy(int Start, int End) +{ + //m_Parent->Copy(m_StoreBuffer,Start,End); +} + +void Loop::Paste(int Start) +{ + //m_Parent->Paste(m_StoreBuffer,Start); + if (m_StoreBuffer.GetLength()m_LoopPoint) + { + m_Pos=0; + } + + m_HoldBuffer.Allocate(m_StoreBuffer.GetLength()); +} + +void Loop::PasteMix(int Start) +{ + //m_Parent->PasteMix(m_StoreBuffer,Start); +} + +void Loop::ZeroRange(int Start, int End) +{ + for (int n=Start; nm_LoopPoint) + { + m_Pos=0; + } +} + +void Loop::SelectAll() +{ +} + +void Loop::Move(int Start) +{ + m_StoreBuffer.Move(Start); +} + +void Loop::StreamIn(istream &s) +{ + s>>m_Id>>m_Pos>>m_IntPos>>m_PlayBufPos>>m_Playing>>m_Master>>m_LoopPoint>> + m_Speed>>m_Volume>>m_Balance>>m_LeftVol>>m_RightVol>>m_Filter>> + m_EffectsOn; +} + +void Loop::StreamOut(ostream &s) +{ + s<>(istream &s, Loop &o) +{ + s>>o.m_Id>>o.m_Pos>>o.m_IntPos>>o.m_PlayBufPos>>o.m_Playing>>o.m_Master>>o.m_LoopPoint>> + o.m_Speed>>o.m_Volume>>o.m_Balance>>o.m_LeftVol>>o.m_RightVol>>o.m_Filter>> + o.m_EffectsOn; + + char Buf[4096]; + int size; + s>>size; + s.ignore(1); + s.get(Buf,size+1); + o.m_Sample=Buf; + + if (o.m_Sample!="") + { + o.LoadWav(o.m_Sample.c_str()); + } + + return s; +} + +ostream &operator<<(ostream &s, Loop &o) +{ + // if this sample is not saved, get the user to pick a filename. + if (o.m_Sample=="") + { + char *fn=fl_file_chooser("Save loop as Wav file", "*.wav", NULL); + if (fn && fn!="") + { + o.m_Sample=fn; + o.SaveWav(o.m_Sample.c_str()); + } + } + else + { + if (fl_ask("Save loop sample %s?",o.m_Sample.c_str())) + { + o.SaveWav(o.m_Sample.c_str()); + } + } + + s< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef LOOP +#define LOOP + +#include "SpiralSound/Filter.h" +#include "GUI/LoopGUI.h" +#include "../../Sample.h" + +class Loop +{ +public: + Loop(); + ~Loop(); + + void LoadWav(const char *Filename); + void SaveWav(const char *Filename); + bool GetOutput(Sample &data); + void AllocateMem(int Length); + void Clear(); + void Hold() {m_StoreBuffer=m_HoldBuffer;} + void Double(); + void MatchLength(int Len); + void Crop(); + void StreamIn(istream &s); + void StreamOut(ostream &s); + + void SetGUI(LoopGUI *s) { m_GUI=s; } + void SetId(int Id) { m_Id=Id; } + void SetCutoff(int c) { m_Filter.SetCutoff(c); } + void SetResonance(int r) { m_Filter.SetResonance(r); } + void SetPos(int Pos) { m_Pos=Pos; } + void SetLength(int Len) { m_LoopPoint=Len; } + void SetSpeed(float Speed) { m_Speed=Speed; } + void SetVolume(float Vol) { m_Volume=Vol; } + void SetPlaying(bool Playing) { m_Playing=Playing; } + void SetRecordingSource(const float *s) { m_RecordingSource=s; } + void Record(bool r) { m_Recording=r; if (!r) EndRecordBuf(); } + void SetMasterStatus(bool m) { m_Master=m; } + void FilterBypass(bool s) { m_Filter.FilterBypass(s); } + void DelMe() { m_DelMe=true; } + void SetBalance(float s) { m_Balance=s; m_LeftVol=(2-s)/2; m_RightVol=(1+s-1.0f)/2;} + void Trigger() { m_Pos=0; SetPlaying(true); } + void SetEffects(bool s) { m_EffectsOn=s; } + + const float GetVolume() {return m_Volume;} + const float GetCutoff() {return m_Filter.GetCutoff();} + const float GetResonance() {return m_Filter.GetCutoff();} + const float GetBalance() {return m_Balance;} + const bool GetEffects() {return m_EffectsOn;} + const bool IsPlaying() {return m_Playing;} + const float *GetLoopPtr() {return m_StoreBuffer.GetBuffer();} + const int GetId() {return m_Id;} + const int GetLoopLength() {return m_LoopPoint;} + float *GetPosPtr() {return &m_Pos;} + const int GetTotalLength() {assert(m_StoreBuffer.GetLength()==m_HoldBuffer.GetLength()); return m_StoreBuffer.GetLength();} + const bool IsMaster() {return m_Master;} + const bool Delete() {return m_DelMe; } + const float GetSpeed() {return m_Speed;} + const float GetLeftVol() { return m_LeftVol; } + const float GetRightVol() { return m_RightVol; } + const float GetCurrentAngle() { return m_LoopPoint?(m_Pos/m_LoopPoint)*360.0f:0; } + const string& GetSampleName() { return m_Sample; } + + void Cut(int Start, int End); + void Copy(int Start, int End); + void Paste(int Start); + void PasteMix(int Start); + + void ZeroRange(int Start, int End); + void ReverseRange(int Start, int End); + void Halve(); + void SelectAll(); + void Move(int Start); + +private: + + void RecordBuf(float Pos, int Length); + void EndRecordBuf(); + + Filter m_Filter; + + int m_Id; + float m_Pos; + int m_IntPos; + int m_PlayBufPos; + bool m_Playing; + bool m_Recording; + bool m_Master; + bool m_DelMe; + long int m_LoopPoint; + float m_Speed; + float m_Volume; + const float *m_RecordingSource; + Sample m_StoreBuffer; + Sample m_HoldBuffer; + Sample m_RecBuffer; + int m_RecPos; + float m_Balance; + float m_LeftVol,m_RightVol; + + bool m_FirstRecord; + bool m_FixedRecord; + int m_RecLength; + bool m_EffectsOn; + + string m_Sample; + + LoopGUI *m_GUI; + + friend istream &operator>>(istream &s, Loop &o); + friend ostream &operator<<(ostream &s, Loop &o); +}; + +istream &operator>>(istream &s, Loop &o); +ostream &operator<<(ostream &s, Loop &o); + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/Makefile.in b/SpiralSound/Plugins/SpiralLoopPlugin/Makefile.in new file mode 100644 index 0000000..7222878 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/Makefile.in @@ -0,0 +1,380 @@ +############################################################################# +# Makefile for building SpiralLoopPlugin.so +# Generated by tmake at 22:23, 2002/02/03 +# Project: SpiralLoopPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../RiffWav.h \ + SpiralSound/Delay.h \ + SpiralSound/Filter.h \ + SpiralSound/Reverb.h \ + SpiralSound/iir_filter.h \ + GUI/DelayGUI.h \ + GUI/FilterGUI.h \ + GUI/GUIBase.h \ + GUI/LoopGUI.h \ + GUI/ReverbGUI.h \ + GUI/Widgets/Fl_LED_Button.H \ + GUI/Widgets/Fl_Loop.h \ + GUI/Widgets/Fl_Trigger.h \ + Loop.h \ + SpiralLoopPlugin.h \ + SpiralLoopPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + SpiralSound/Delay.C \ + SpiralSound/Filter.C \ + SpiralSound/Reverb.C \ + SpiralSound/iir_filter.C \ + GUI/DelayGUI.C \ + GUI/FilterGUI.C \ + GUI/GUIBase.C \ + GUI/LoopGUI.C \ + GUI/ReverbGUI.C \ + GUI/Widgets/Fl_LED_Button.cxx \ + GUI/Widgets/Fl_Loop.C \ + GUI/Widgets/Fl_Trigger.C \ + Loop.C \ + SpiralLoopPlugin.C \ + SpiralLoopPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + ../../RiffWav.o \ + SpiralSound/Delay.o \ + SpiralSound/Filter.o \ + SpiralSound/Reverb.o \ + SpiralSound/iir_filter.o \ + GUI/DelayGUI.o \ + GUI/FilterGUI.o \ + GUI/GUIBase.o \ + GUI/LoopGUI.o \ + GUI/ReverbGUI.o \ + GUI/Widgets/Fl_LED_Button.o \ + GUI/Widgets/Fl_Loop.o \ + GUI/Widgets/Fl_Trigger.o \ + Loop.o \ + SpiralLoopPlugin.o \ + SpiralLoopPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SpiralLoopPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake SpiralLoopPlugin.pro + +dist: + $(TAR) SpiralLoopPlugin.tar SpiralLoopPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) SpiralLoopPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +../../RiffWav.o: ../../RiffWav.C \ + ../../RiffWav.h \ + ../../Sample.h \ + ../../SpiralInfo.h + +SpiralSound/Delay.o: SpiralSound/Delay.C \ + SpiralSound/Delay.h \ + SpiralSound/../../../SpiralInfo.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + SpiralSound/../../../Sample.h + +SpiralSound/Filter.o: SpiralSound/Filter.C \ + SpiralSound/Filter.h \ + SpiralSound/../../../NoteTable.h \ + SpiralSound/../../../SpiralInfo.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + SpiralSound/iir_filter.h \ + SpiralSound/../../../Sample.h + +SpiralSound/Reverb.o: SpiralSound/Reverb.C \ + SpiralSound/Reverb.h \ + SpiralSound/../../../SpiralInfo.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + SpiralSound/Delay.h + +SpiralSound/iir_filter.o: SpiralSound/iir_filter.C \ + SpiralSound/iir_filter.h + +GUI/DelayGUI.o: GUI/DelayGUI.C \ + GUI/DelayGUI.h \ + GUI/../../Widgets/Fl_Knob.H \ + GUI/GUIBase.h \ + SpiralSound/../../../SpiralInfo.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + GUI/../SpiralSound/Delay.h + +GUI/FilterGUI.o: GUI/FilterGUI.C \ + GUI/FilterGUI.h \ + GUI/Widgets/Fl_Knob.H \ + GUI/GUIBase.h \ + SpiralSound/../../../SpiralInfo.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + GUI/../SpiralSound/Filter.h \ + GUI/../../../NoteTable.h \ + SpiralSound/iir_filter.h + +GUI/GUIBase.o: GUI/GUIBase.C \ + GUI/GUIBase.h \ + SpiralSound/../../../SpiralInfo.h \ + ../../Sample.h \ + ../../SpiralInfo.h + +GUI/LoopGUI.o: GUI/LoopGUI.C \ + SpiralSound/../../../SpiralInfo.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + GUI/Widgets/Fl_Loop.h \ + GUI/LoopGUI.h \ + GUI/Widgets/Fl_Knob.H \ + GUI/Widgets/Fl_LED_Button.H \ + GUI/Widgets/Fl_Trigger.h \ + GUI/DelayGUI.h \ + GUI/../../Widgets/Fl_Knob.H \ + GUI/GUIBase.h \ + GUI/../SpiralSound/Delay.h \ + GUI/ReverbGUI.h \ + GUI/../SpiralSound/Reverb.h \ + SpiralSound/Delay.h \ + GUI/../SpiralSound/Filter.h \ + GUI/../../../NoteTable.h \ + SpiralSound/iir_filter.h \ + GUI/../Loop.h \ + SpiralSound/Filter.h \ + SpiralSound/Delay.h \ + SpiralSound/Reverb.h \ + GUI/LoopGUI.h \ + ../../Sample.h + +GUI/ReverbGUI.o: GUI/ReverbGUI.C \ + GUI/ReverbGUI.h \ + GUI/Widgets/Fl_Knob.H \ + GUI/GUIBase.h \ + SpiralSound/../../../SpiralInfo.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + GUI/../SpiralSound/Reverb.h \ + SpiralSound/Delay.h + +GUI/Widgets/Fl_LED_Button.o: GUI/Widgets/Fl_LED_Button.cxx \ + GUI/Widgets/Fl_LED_Button.H + +GUI/Widgets/Fl_Loop.o: GUI/Widgets/Fl_Loop.C \ + GUI/Widgets/Fl_Loop.h + +GUI/Widgets/Fl_Trigger.o: GUI/Widgets/Fl_Trigger.C \ + GUI/Widgets/Fl_Trigger.h \ + GUI/Widgets/Fl_Loop.h + +Loop.o: Loop.C \ + Loop.h \ + SpiralSound/Filter.h \ + GUI/../../../NoteTable.h \ + SpiralSound/../../../SpiralInfo.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + SpiralSound/iir_filter.h \ + SpiralSound/Delay.h \ + SpiralSound/Reverb.h \ + SpiralSound/Delay.h \ + GUI/LoopGUI.h \ + GUI/Widgets/Fl_Knob.H \ + GUI/Widgets/Fl_Loop.h \ + GUI/Widgets/Fl_LED_Button.H \ + GUI/Widgets/Fl_Trigger.h \ + GUI/DelayGUI.h \ + GUI/../../Widgets/Fl_Knob.H \ + GUI/GUIBase.h \ + GUI/../SpiralSound/Delay.h \ + GUI/ReverbGUI.h \ + GUI/../SpiralSound/Reverb.h \ + GUI/../SpiralSound/Filter.h \ + ../../Sample.h \ + ../../RiffWav.h + +SpiralLoopPlugin.o: SpiralLoopPlugin.C \ + SpiralLoopPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + Loop.h \ + SpiralSound/Filter.h \ + GUI/../../../NoteTable.h \ + SpiralSound/../../../SpiralInfo.h \ + SpiralSound/iir_filter.h \ + SpiralSound/Delay.h \ + SpiralSound/Reverb.h \ + SpiralSound/Delay.h \ + GUI/LoopGUI.h \ + GUI/Widgets/Fl_Knob.H \ + GUI/Widgets/Fl_Loop.h \ + GUI/Widgets/Fl_LED_Button.H \ + GUI/Widgets/Fl_Trigger.h \ + GUI/DelayGUI.h \ + GUI/../../Widgets/Fl_Knob.H \ + GUI/GUIBase.h \ + GUI/../SpiralSound/Delay.h \ + GUI/ReverbGUI.h \ + GUI/../SpiralSound/Reverb.h \ + GUI/../SpiralSound/Filter.h \ + ../../Sample.h \ + SpiralLoopPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + SpiralIcon.xpm \ + ../../RiffWav.h \ + ../../NoteTable.h + +SpiralLoopPluginGUI.o: SpiralLoopPluginGUI.C \ + SpiralLoopPluginGUI.h \ + SpiralLoopPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + Loop.h \ + SpiralSound/Filter.h \ + GUI/../../../NoteTable.h \ + SpiralSound/../../../SpiralInfo.h \ + SpiralSound/iir_filter.h \ + SpiralSound/Delay.h \ + SpiralSound/Reverb.h \ + SpiralSound/Delay.h \ + GUI/LoopGUI.h \ + GUI/Widgets/Fl_Knob.H \ + GUI/Widgets/Fl_Loop.h \ + GUI/Widgets/Fl_LED_Button.H \ + GUI/Widgets/Fl_Trigger.h \ + GUI/DelayGUI.h \ + GUI/../../Widgets/Fl_Knob.H \ + GUI/GUIBase.h \ + GUI/../SpiralSound/Delay.h \ + GUI/ReverbGUI.h \ + GUI/../SpiralSound/Reverb.h \ + GUI/../SpiralSound/Filter.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H + diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..7f6b62d --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralIcon.xpm @@ -0,0 +1,365 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 326 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0A0A0A", +"+. c #151700", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #282900", +"!. c #030300", +"~. c #655F00", +"{. c #E5D900", +"]. c #FFF200", +"^. c #FEF100", +"/. c #E8DC00", +"(. c #978F00", +"_. c #2A2700", +":. c #727175", +"<. c #FEFEFF", +"[. c #9D99AA", +"}. c #DBD9E0", +"|. c #E9E9E9", +"1. c #CBCBCB", +"2. c #E0E0E0", +"3. c #6C6C6C", +"4. c #030200", +"5. c #867F00", +"6. c #FDF000", +"7. c #F9EC00", +"8. c #756F00", +"9. c #515151", +"0. c #A6A6A7", +"a. c #827E93", +"b. c #615C77", +"c. c #EAEAED", +"d. c #DFDFE1", +"e. c #0C0C0C", +"f. c #6B6600", +"g. c #F7EA00", +"h. c #F2E500", +"i. c #262300", +"j. c #1E1D24", +"k. c #9894A7", +"l. c #B1AEBB", +"m. c #69686F", +"n. c #000001", +"o. c #ADA400", +"p. c #CEC300", +"q. c #847D00", +"r. c #C7BC00", +"s. c #898200", +"t. c #615C76", +"u. c #5F5A75", +"v. c #413E4D", +"w. c #020203", +"x. c #EBDF00", +"y. c #F5E800", +"z. c #0F0E00", +"A. c #020200", +"B. c #FAED00", +"C. c #D8CC00", +"D. c #1A1A1C", +"E. c #C3C1CB", +"F. c #9D9D9D", +"G. c #202020", +"H. c #383838", +"I. c #4C4C4C", +"J. c #CABF00", +"K. c #F0E300", +"L. c #E9DD00", +"M. c #111112", +"N. c #C9C7D0", +"O. c #F1F1F1", +"P. c #F8F8F8", +"Q. c #232323", +"R. c #FBEE00", +"S. c #C5BB00", +"T. c #F8EB00", +"U. c #D5CA00", +"V. c #050408", +"W. c #AEACB9", +"X. c #FEFEFE", +"Y. c #1D1D1D", +"Z. c #EEE100", +"`. c #F3E600", +" + c #373400", +".+ c #1C1B00", +"++ c #BBB100", +"@+ c #B7B5C1", +"#+ c #9390A2", +"$+ c #BBBBBB", +"%+ c #414141", +"&+ c #030303", +"*+ c #050500", +"=+ c #B7AD00", +"-+ c #F1E400", +";+ c #1D1B00", +">+ c #28272A", +",+ c #F4F4F6", +"'+ c #605B76", +")+ c #736E86", +"!+ c #D8D8D8", +"~+ c #727272", +"{+ c #101010", +"]+ c #4B4700", +"^+ c #FCEF00", +"/+ c #848486", +"(+ c #CCCBD3", +"_+ c #747087", +":+ c #6D6881", +"<+ c #1C1C1C", +"[+ c #242424", +"}+ c #7B7400", +"|+ c #EFE200", +"1+ c #F4E700", +"2+ c #656566", +"3+ c #F6F6F6", +"4+ c #E8E6EA", +"5+ c #706B84", +"6+ c #E3E1E6", +"7+ c #474746", +"8+ c #151515", +"9+ c #C8C8C8", +"0+ c #AEAEAE", +"a+ c #070707", +"b+ c #010100", +"c+ c #373639", +"d+ c #FDFCFE", +"e+ c #ABA8B7", +"f+ c #F1F0F3", +"g+ c #6D6980", +"h+ c #0A090E", +"i+ c #95929E", +"j+ c #0A0810", +"k+ c #0D0D0D", +"l+ c #050505", +"m+ c #5B5A5C", +"n+ c #F7F6F7", +"o+ c #F4F3F5", +"p+ c #908C9F", +"q+ c #C8C6D0", +"r+ c #837E96", +"s+ c #86868A", +"t+ c #070608", +"u+ c #ECEBEE", +"v+ c #5B5571", +"w+ c #646078", +"x+ c #AFAFB0", +"y+ c #454545", +"z+ c #363636", +"A+ c #7A7A7A", +"B+ c #C8C8C9", +"C+ c #212025", +"D+ c #060607", +"E+ c #969699", +"F+ c #FAFAFA", +"G+ c #F8F8F9", +"H+ c #A29EAF", +"I+ c #F7F6F8", +"J+ c #F0F0F1", +"K+ c #B8B7B9", +"L+ c #E4E4E4", +"M+ c #FDFDFD", +"N+ c #A5A2B2", +"O+ c #3B3456", +"P+ c #A8A5B4", +"Q+ c #525252", +"R+ c #848387", +"S+ c #CDCDCD", +"T+ c #8D899C", +"U+ c #494262", +"V+ c #68627C", +"W+ c #40395A", +"X+ c #ECECEC", +"Y+ c #020202", +"Z+ c #B4B5B5", +"`+ c #0B0B0B", +" @ c #313232", +".@ c #E3E3E3", +"+@ c #B1AEBC", +"@@ c #BDBBC6", +"#@ c #3C3556", +"$@ c #898599", +"%@ c #EDEDED", +"&@ c #39393A", +"*@ c #040404", +"=@ c #333333", +"-@ c #F5F5F5", +";@ c #2B2B2B", +">@ c #2D2A3D", +",@ c #B6B4C1", +"'@ c #F5F5F6", +")@ c #605A76", +"!@ c #DAD8DF", +"~@ c #F5F4F6", +"{@ c #615B76", +"]@ c #524D6A", +"^@ c #E4E3E8", +"/@ c #D5D5D5", +"(@ c #1B1B1B", +"_@ c #303030", +":@ c #AAABAB", +"<@ c #585464", +"[@ c #B0AEBB", +"}@ c #A29FAF", +"|@ c #E9E8E9", +"1@ c #787779", +"2@ c #0F0E15", +"3@ c #2D2D2E", +"4@ c #595959", +"5@ c #FAFAFB", +"6@ c #807B92", +"7@ c #B0ADBB", +"8@ c #E8E7EB", +"9@ c #3A3258", +"0@ c #E6E5EA", +"a@ c #DFDEE3", +"b@ c #443E5E", +"c@ c #BAB8C4", +"d@ c #C1BFCA", +"e@ c #E0E0E5", +"f@ c #D0CED6", +"g@ c #362F52", +"h@ c #CECCD5", +"i@ c #413A5B", +"j@ c #6A657F", +"k@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.{.].].^./.(._.E :.<.; ; [. ", +" }.; ; |.R h 1.2.3.6 4.5.6.].].].].].].7.8.E 9.0.4 a. ", +" b.c.; d.e.6 6 6 6 6 6 f.g.].].].].].].].].h.i.6 j.k. ", +" V @ l.m.n.6 6 6 6 6 6 o.].].].p.q.r.g.].].].s.6 ", +" t.u.v.6 w.6 6 6 6 6 x.].].y.z.6 A.z.B.].].C.6 D. ", +" E.; ; F.G.G.H.I.G.6 6 B.].].J.6 6 6 6 K.].].L.6 M. ", +" N.; ; O.P.; ; ; Q.6 6 R.].].S.6 6 6 z.T.].].U.6 V. ", +" W.; ; ; ; X.; ; Y.6 6 Z.].].`. +6 .+++].].].q.6 6 @+, ", +" #+; ; X.; : $+%+&+6 *+=+].].].].].].].].].-+;+6 >+X.,+'+ ", +" )+; ; ; !+~+{+6 6 6 6 ]+T.].].].].].].].^+~.6 6 /+; ; (+_+ ", +" :+J ; : <+6 6 6 6 [+6 4.}+|+^.^.].].].1+q.6 6 6 2+3+; ; 4+5+ ", +" 6+; ; 7+6 E 6 8+9+0+a+6 6 6 6 6 6 6 6 b+6 6 6 6 c+d+; ; > 5+ ", +" e+; f+g+h+6 6 0+X.; i+j+6 6 6 6 6 6 6 6 k+l+6 6 6 m+n+; ; o+p+ ", +" 5+q+! r+s+t+x ; ; u+v+w+x+l y+6 6 6 z+A+B+C+6 6 6 D+E+F+; ; G+@ ", +" H+I+J+K+L+M+; N+O+P+; 3+y+6 6 E Q+; ; R+6 6 E 6 o S+; ; = T+ ", +" U+> ; ; ; ; ; ; V+W+; ; X+H.6 6 Y+D ; ; Z+`+6 6 6 @.@; ; +@ ", +" > ; ; ; ; @@#@$@; ; %@&@6 6 *@=@; ; -@;@6 6 >@,@; '@3 ", +" )@!@= ; ~@{@]@^@; ; /@(@6 6 Y+_@; ; ; :@Q+<@ ", +" [@4 }@ X ; ; ; |@1@_@2@3@4@; ; ; X.5@6@ ", +" 7@; ; ; ; ; 8@9@0@; ; ; ; = a@b@ ", +" c@d@e@4 ; ; f@g@h@; ; ; s $@T ", +" i@ j@k@$@ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.C b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.C new file mode 100644 index 0000000..ebc6b0c --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.C @@ -0,0 +1,167 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "SpiralLoopPlugin.h" +#include "SpiralLoopPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../RiffWav.h" +#include "../../NoteTable.h" + +static const float TRIG_THRESH = 0.1; +static const int NOTETRIG = NUM_SAMPLES*2+1; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new SpiralLoopPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x001a; +} +} + +/////////////////////////////////////////////////////// + +SpiralLoopPlugin::SpiralLoopPlugin() +{ + m_PluginInfo.Name="SpiralLoop"; + m_PluginInfo.Width=300; + m_PluginInfo.Height=320; + m_PluginInfo.NumInputs=2; + m_PluginInfo.NumOutputs=9; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Play Trigger"); + m_PluginInfo.PortTips.push_back("Output"); + m_PluginInfo.PortTips.push_back("LoopTrigger 0"); + m_PluginInfo.PortTips.push_back("LoopTrigger 1"); + m_PluginInfo.PortTips.push_back("LoopTrigger 2"); + m_PluginInfo.PortTips.push_back("LoopTrigger 3"); + m_PluginInfo.PortTips.push_back("LoopTrigger 4"); + m_PluginInfo.PortTips.push_back("LoopTrigger 5"); + m_PluginInfo.PortTips.push_back("LoopTrigger 6"); + m_PluginInfo.PortTips.push_back("LoopTrigger 7"); + m_Loop = new Loop; + + m_Version=2; +} + +SpiralLoopPlugin::~SpiralLoopPlugin() +{ +} + +PluginInfo &SpiralLoopPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *SpiralLoopPlugin::CreateGUI() +{ + m_GUI = new SpiralLoopPluginGUI(m_Loop, m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void SpiralLoopPlugin::Execute() +{ + if (InputExists(0)) m_Loop->SetRecordingSource(GetInput(0)->GetBuffer()); + else m_Loop->SetRecordingSource(NULL); + + for (int n=0; n<8; n++) GetOutputBuf(n+1)->Zero(); + + + // get the triggers active this frame + vector TriggerVec; + ((SpiralLoopPluginGUI*)m_GUI)->GetGUI()-> + CheckTriggers(m_Loop->GetCurrentAngle(),TriggerVec); + + for (vector::iterator i=TriggerVec.begin(); + i!=TriggerVec.end(); i++) + { + GetOutputBuf(*i+1)->Set(1); + } + + m_Loop->GetOutput(*GetOutputBuf(0)); + + static bool Triggered=false; + if (GetInput(1,0)>TRIG_THRESH) + { + if (!Triggered) + { + m_Loop->Trigger(); + Triggered=true; + } + } + else Triggered=false; +} + +void SpiralLoopPlugin::StreamOut(ostream &s) +{ + s<GetGUI()<<" "; + } + else + { + m_Loop->StreamOut(s); + s<<*((SpiralLoopPluginGUI*)m_GUI)->GetGUI()<<" "; + } +} + +void SpiralLoopPlugin::StreamIn(istream &s) +{ + int version; + s>>version; + + if (version==1) + { + s>>*m_Loop; + s>>*((SpiralLoopPluginGUI*)m_GUI)->GetGUI(); + } + else + { + m_Loop->StreamIn(s); + s>>*((SpiralLoopPluginGUI*)m_GUI)->GetGUI(); + } +} + +bool SpiralLoopPlugin::SaveExternalFiles(const string &Dir) +{ + char temp[256]; + sprintf(temp,"%sSpiralLoopSample%d.wav",Dir.c_str(),GetID()); + m_Loop->SaveWav(temp); + return true; +} + +void SpiralLoopPlugin::LoadExternalFiles(const string &Dir) +{ + char temp[256]; + sprintf(temp,"%sSpiralLoopSample%d.wav",Dir.c_str(),GetID()); + m_Loop->LoadWav(temp); +} diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.h b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.h new file mode 100644 index 0000000..76d6bd9 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.h @@ -0,0 +1,66 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#include "Loop.h" +#include "GUI/LoopGUI.h" + +#ifndef SpiralLoopPLUGIN +#define SpiralLoopPLUGIN + +static const int NUM_SAMPLES = 8; + +struct SampleDesc +{ + string Pathname; + float Volume; + float Pitch; + float PitchMod; + bool Loop; + int Note; + bool TriggerUp; + float SamplePos; + int SampleRate; + bool Stereo; +}; + +class SpiralLoopPlugin : public SpiralPlugin +{ +public: + SpiralLoopPlugin(); + virtual ~SpiralLoopPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + virtual bool SaveExternalFiles(const string &Dir); + virtual void LoadExternalFiles(const string &Dir); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + +private: + + Loop *m_Loop; +}; + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.pro b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.pro new file mode 100644 index 0000000..473994e --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPlugin.pro @@ -0,0 +1,45 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + ../../RiffWav.h \ + SpiralSound/Delay.h \ + SpiralSound/Filter.h \ + SpiralSound/Reverb.h \ + SpiralSound/iir_filter.h \ + GUI/DelayGUI.h \ + GUI/FilterGUI.h \ + GUI/GUIBase.h \ + GUI/LoopGUI.h \ + GUI/ReverbGUI.h \ + GUI/Widgets/Fl_LED_Button.H \ + GUI/Widgets/Fl_Loop.h \ + GUI/Widgets/Fl_Trigger.h \ + Loop.h \ + SpiralLoopPlugin.h \ + SpiralLoopPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + SpiralSound/Delay.C \ + SpiralSound/Filter.C \ + SpiralSound/Reverb.C \ + SpiralSound/iir_filter.C \ + GUI/DelayGUI.C \ + GUI/FilterGUI.C \ + GUI/GUIBase.C \ + GUI/LoopGUI.C \ + GUI/ReverbGUI.C \ + GUI/Widgets/Fl_LED_Button.cxx \ + GUI/Widgets/Fl_Loop.C \ + GUI/Widgets/Fl_Trigger.C \ + Loop.C \ + SpiralLoopPlugin.C \ + SpiralLoopPluginGUI.C + +TARGET = SpiralLoopPlugin.so diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPluginGUI.C b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPluginGUI.C new file mode 100644 index 0000000..a7164ed --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPluginGUI.C @@ -0,0 +1,48 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "SpiralLoopPluginGUI.h" +#include +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +SpiralLoopPluginGUI::SpiralLoopPluginGUI(Loop *pLoop, int w, int h,SpiralLoopPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + int Width=20; + int Height=100; + + m_LoopGUI = new LoopGUI(pLoop); + pLoop->SetGUI(m_LoopGUI); + m_LoopGUI->CreateGUI(""); + add(m_LoopGUI->GetGUI()); + + end(); +} + +void SpiralLoopPluginGUI::UpdateValues() +{ +} diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPluginGUI.h b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPluginGUI.h new file mode 100644 index 0000000..851e342 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralLoopPluginGUI.h @@ -0,0 +1,48 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include + +#include "SpiralLoopPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" +#include "GUI/LoopGUI.h" + +#ifndef MixerGUI +#define MixerGUI + + +class SpiralLoopPluginGUI : public SpiralPluginGUI +{ +public: + SpiralLoopPluginGUI(Loop *pLoop, int w, int h, SpiralLoopPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + LoopGUI* GetGUI() { return m_LoopGUI; } + + SpiralLoopPlugin *m_Plugin; +private: + + LoopGUI* m_LoopGUI; +}; + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Delay.C b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Delay.C new file mode 100644 index 0000000..3ac9908 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Delay.C @@ -0,0 +1,93 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * 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. +*/ + +// Stereo module + +#include "Delay.h" +#include "../../../Sample.h" + +static const int DELAYBUFFERSIZE=44100; + +Delay::Delay() : +m_LeftBuffer(DELAYBUFFERSIZE), +m_RightBuffer(DELAYBUFFERSIZE), +m_LeftWrite(0), +m_RightWrite(0), +m_LeftDelay(0.5), +m_RightDelay(0.5), +m_Feedback(0.5), +m_Channels(1), +m_Bypass(true) +{ +} + +Delay::~Delay() +{ +} + +void Delay::GetOutput(Sample &data) +{ + if (m_Bypass) return; + + int n=0; + long RLength=static_cast(m_RightDelay*(DELAYBUFFERSIZE-1)); + long LLength=static_cast(m_LeftDelay*(DELAYBUFFERSIZE-1)); + long temp=0; + + while (nLLength) m_LeftWrite=0; + m_RightWrite++; + if (m_RightWrite>RLength) m_RightWrite=0; + } +} + +void Delay::Randomise() +{ + //m_RightDelay=RandFloat(); + //m_LeftDelay=m_RightDelay; + //m_Feedback=RandFloat(); +} + + +istream &operator>>(istream &s, Delay &o) +{ + s>>o.m_LeftDelay>>o.m_Feedback>>o.m_Bypass; + return s; +} + +ostream &operator<<(ostream &s, Delay &o) +{ + s< + * + * 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. +*/ + +// Stereo module, different delay times for left and right, due to reverb +// functionality. + +#include +#include "../../../SpiralInfo.h" + +#ifndef DELAY +#define DELAY + +class Delay +{ +public: + Delay(); + ~Delay(); + + void SetDelay(float s) {m_LeftDelay=s; m_RightDelay=s;} + void SetRightDelay(float s) {m_RightDelay=s;} + void SetLeftDelay(float s) {m_LeftDelay=s;} + void SetNumChannels(int s) {m_Channels=s;} + void SetFeedback(float s) {m_Feedback=s;} + void SetBypass(bool s) {m_Bypass=s;} + float GetDelay() {return GetLeftDelay();} + float GetLeftDelay() {return m_LeftDelay;} + float GetRightDelay() {return m_RightDelay;} + float GetFeedback() {return m_Feedback;} + float GetBypass() {return m_Bypass;} + void GetOutput(Sample &data); + void Randomise(); + +private: + + Sample m_LeftBuffer; + Sample m_RightBuffer; + long m_LeftWrite; + long m_RightWrite; + float m_LeftDelay; + float m_RightDelay; + float m_Feedback; + int m_Channels; + bool m_Bypass; + + friend istream &operator>>(istream &s, Delay &o); + friend ostream &operator<<(ostream &s, Delay &o); +}; + +istream &operator>>(istream &s, Delay &o); +ostream &operator<<(ostream &s, Delay &o); + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Filter.C b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Filter.C new file mode 100644 index 0000000..98ab76f --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Filter.C @@ -0,0 +1,174 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Filter.h" +#include "../../../Sample.h" + +static const float MAX_RES = 10; +static const float MIN_RES = 1; +static const float MAX_CUTOFF = 3000; +static const float MIN_CUTOFF = 500; + +Filter::Filter() : +fs(44100), // Sampling frequency +fc(-1), // Filter cutoff +Q(1), // Resonance +m_LastFC(0), +m_LastQ(1), +k(1.0), // Set overall filter gain +m_RevCutoffMod(false), +m_RevResonanceMod(false), +m_FilterBypass(true), +m_CutoffModBuf(NULL), +m_ResonanceModBuf(NULL) +{ + SetupCoeffs(); + + + iir = new FILTER[1]; + + for (int n=0; n<1; n++) + { + iir[n].length = FILTER_SECTIONS; + iir[n].coef = (float *) calloc(4 * iir[n].length + 1 , sizeof(float)); + + if (!iir[n].coef) + { + printf("Unable to allocate coef array, exiting\n"); + exit(1); + } + } +} + +Filter::~Filter() +{ + delete[] iir; +} + +void Filter::SetupCoeffs() +{ + ProtoCoef[0].a0 = 1.0; + ProtoCoef[0].a1 = 0; + ProtoCoef[0].a2 = 0; + ProtoCoef[0].b0 = 1.0; + ProtoCoef[0].b1 = 0.765367; + ProtoCoef[0].b2 = 1.0; + + ProtoCoef[1].a0 = 1.0; + ProtoCoef[1].a1 = 0; + ProtoCoef[1].a2 = 0; + ProtoCoef[1].b0 = 1.0; + ProtoCoef[1].b1 = 1.847759; + ProtoCoef[1].b2 = 1.0; +} + +void Filter::GetOutput(int V, Sample &data) +{ + float Cutoff; + float Resonance; + + if (m_FilterBypass || fc<0) return; + + for (int n=0; nMAX_RES) Resonance=MAX_RES; + if (Cutoff>MAX_CUTOFF) Cutoff=MAX_CUTOFF; + if (Resonance0.5f); + //m_RevResonanceMod=(RandFloat()>0.5f); +} + +istream &operator>>(istream &s, Filter &o) +{ + s>>o.fc>>o.Q>>o.m_RevCutoffMod>>o.m_RevResonanceMod; + return s; +} + +ostream &operator<<(ostream &s, Filter &o) +{ + s< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "../../../NoteTable.h" +#include "../../../SpiralInfo.h" +#include "iir_filter.h" + +#ifndef _FILTER +#define _FILTER + + +class Filter +{ +public: + Filter(); + ~Filter(); + + void GetOutput(int V, Sample &data); + void Reset(); + void SetupCoeffs(); + + void SetCutoff(double s) {fc=s;} + void SetResonance(double s) {Q=s;} + void SetRevCutoffMod(bool s) {m_RevCutoffMod=s;} + void SetRevResonanceMod(bool s) {m_RevResonanceMod=s;} + void FilterBypass(bool s) {m_FilterBypass=s;} + double GetCutoff() {return fc;} + double GetResonance() {return Q;} + bool GetRevCutoffMod() {return m_RevCutoffMod;} + bool GetRevResonanceMod() {return m_RevResonanceMod;} + + void ModulateCutoff(Sample *data); + void ModulateResonance(Sample *data); + void Randomise(); + +private: + + // Voice specifics + FILTER *iir; + + // Voice independant + float *coef; + double fs, fc; // Sampling frequency, cutoff frequency + double Q; // Resonance > 1.0 < 1000 + double m_LastFC; + double m_LastQ; + unsigned nInd; + double a0, a1, a2, b0, b1, b2; + double k; // overall gain factor + bool m_RevCutoffMod; + bool m_RevResonanceMod; + bool m_FilterBypass; + + Sample *m_CutoffModBuf; + Sample *m_ResonanceModBuf; + + friend istream &operator>>(istream &s, Filter &o); + friend ostream &operator<<(ostream &s, Filter &o); +}; + +istream &operator>>(istream &s, Filter &o); +ostream &operator<<(ostream &s, Filter &o); + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Reverb.C b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Reverb.C new file mode 100644 index 0000000..da267d8 --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/Reverb.C @@ -0,0 +1,115 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * 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. +*/ + +// Stereo module + +#include "Reverb.h" + +static const int NUM_DELAYS = 5; +static const float MAX_DELAYTIME = 0.2; +static const float MIN_DELAYTIME = 0.02; + +float RandFloat(float min, float max) +{ + return min+(rand()%1000/1000.0*(max-min)); +} + +Reverb::Reverb() : +m_Time(0), +m_Feedback(0.2), +m_Randomness(0.01), +m_Bypass(true) +{ + // set up the delay vec + for (int i=0; iSetLeftDelay(RandFloat(MIN_DELAYTIME,MAX_DELAYTIME)); + pDelay->SetRightDelay(RandFloat(MIN_DELAYTIME,MAX_DELAYTIME)); + pDelay->SetBypass(false); + m_DelayVec.push_back(pDelay); + } +} + +Reverb::~Reverb() +{ + for (vector::iterator i=m_DelayVec.begin(); + i!=m_DelayVec.end(); i++) + { + delete *i; + } + + m_DelayVec.clear(); +} + +void Reverb::SetTime(float s) +{ + m_Time=s; + float t=0; + int count=0; + for (vector::iterator i=m_DelayVec.begin(); + i!=m_DelayVec.end(); i++) + { + t=count/(float)NUM_DELAYS; + (*i)->SetLeftDelay(t*m_Time+RandFloat(-m_Randomness,m_Randomness)); + (*i)->SetRightDelay(t*m_Time+RandFloat(-m_Randomness,m_Randomness)); + count++; + } +} + +void Reverb::SetFeedback(float s) +{ + m_Feedback=s; + for (vector::iterator i=m_DelayVec.begin(); + i!=m_DelayVec.end(); i++) + { + (*i)->SetFeedback(s); + } +} + +void Reverb::SetNumChannels(int s) +{ + for (vector::iterator i=m_DelayVec.begin(); + i!=m_DelayVec.end(); i++) + { + (*i)->SetNumChannels(s); + } +} + +void Reverb::GetOutput(Sample &data) +{ + if (m_Time==0 || m_Bypass) return; + + for (vector::iterator i=m_DelayVec.begin(); + i!=m_DelayVec.end(); i++) + { + (*i)->GetOutput(data); + } +} + +istream &operator>>(istream &s, Reverb &o) +{ + s>>o.m_Time>>o.m_Feedback>>o.m_Randomness>>o.m_Bypass; + return s; +} + +ostream &operator<<(ostream &s, Reverb &o) +{ + s< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include +#include "../../../SpiralInfo.h" +#include "Delay.h" +#include + +#ifndef REVERB +#define REVERB + +class Reverb +{ +public: + Reverb(); + ~Reverb(); + + void SetTime(float s); + void SetRandomness(float s) {m_Randomness=s; SetTime(m_Time);} + void SetFeedback(float s); + void SetNumChannels(int s); + void SetBypass(bool s) {m_Bypass=s;} + float GetTime() {return m_Time;} + float GetFeedback() {return m_Feedback;} + float GetRandomness() {return m_Randomness;} + bool IsBypassed() {return m_Bypass;} + void GetOutput(Sample &data); + void Randomise(); + +private: + + float m_Time; + float m_Feedback; + float m_Randomness; + bool m_Bypass; + + vector m_DelayVec; + + friend istream &operator>>(istream &s, Reverb &o); + friend ostream &operator<<(ostream &s, Reverb &o); +}; + +istream &operator>>(istream &s, Reverb &o); +ostream &operator<<(ostream &s, Reverb &o); + +#endif diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.C b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.C new file mode 100644 index 0000000..18a4bcc --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.C @@ -0,0 +1,128 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * 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. +*/ + +/* +Resonant low pass filter source code. +This code was originally written by baltrax@hotmail.com + +See +for the full version with explanatory comments, and the maths! +*/ + +#include "iir_filter.h" + +BIQUAD ProtoCoef[FILTER_SECTIONS]; + +float iir_filter(float input,FILTER *iir) + { + unsigned int i; + float *hist1_ptr,*hist2_ptr,*coef_ptr; + float output,new_hist,history1,history2; + +/* allocate history array if different size than last call */ + + if(!iir->history) { + iir->history = (float *) calloc(2*iir->length,sizeof(float)); + if(!iir->history) { + printf("\nUnable to allocate history array in iir_filter\n"); + exit(1); + } + } + + coef_ptr = iir->coef; /* coefficient pointer */ + + hist1_ptr = iir->history; /* first history */ + hist2_ptr = hist1_ptr + 1; /* next history */ + + /* 1st number of coefficients array is overall input scale factor, + * or filter gain */ + output = input * (*coef_ptr++); + + for (i = 0 ; i < iir->length; i++) + { + history1 = *hist1_ptr; /* history values */ + history2 = *hist2_ptr; + + output = output - history1 * (*coef_ptr++); + new_hist = output - history2 * (*coef_ptr++); /* poles */ + + output = new_hist + history1 * (*coef_ptr++); + output = output + history2 * (*coef_ptr++); /* zeros */ + + *hist2_ptr++ = *hist1_ptr; + *hist1_ptr++ = new_hist; + hist1_ptr++; + hist2_ptr++; + } + + return(output); +} + +void prewarp( + double *a0, double *a1, double *a2, + double fc, double fs) +{ + double wp, pi; + + pi = 4.0 * atan(1.0); + wp = 2.0 * fs * tan(pi * fc / fs); + + *a2 = (*a2) / (wp * wp); + *a1 = (*a1) / wp; +} + +void bilinear( + double a0, double a1, double a2, /* numerator coefficients */ + double b0, double b1, double b2, /* denominator coefficients */ + double *k, /* overall gain factor */ + double fs, /* sampling rate */ + float *coef /* pointer to 4 iir coefficients */ +) +{ + double ad, bd; + + /* alpha (Numerator in s-domain) */ + ad = 4. * a2 * fs * fs + 2. * a1 * fs + a0; + /* beta (Denominator in s-domain) */ + bd = 4. * b2 * fs * fs + 2. * b1* fs + b0; + + /* update gain constant for this section */ + *k *= ad/bd; + + /* Denominator */ + *coef++ = (2. * b0 - 8. * b2 * fs * fs) / bd; /* beta1 */ + *coef++ = (4. * b2 * fs * fs - 2. * b1 * fs + b0) / bd; /* beta2 */ + /* Nominator */ + *coef++ = (2. * a0 - 8. * a2 * fs * fs) / ad; /* alpha1 */ + *coef = (4. * a2 * fs * fs - 2. * a1 * fs + a0) / ad; /* alpha2 */ +} + +void szxform( + double *a0, double *a1, double *a2, /* numerator coefficients */ + double *b0, double *b1, double *b2, /* denominator coefficients */ + double fc, /* Filter cutoff frequency */ + double fs, /* sampling rate */ + double *k, /* overall gain factor */ + float *coef) /* pointer to 4 iir coefficients */ +{ + /* Calculate a1 and a2 and overwrite the original values */ + prewarp(a0, a1, a2, fc, fs); + prewarp(b0, b1, b2, fc, fs); + bilinear(*a0, *a1, *a2, *b0, *b1, *b2, k, fs, coef); +} + diff --git a/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.h b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.h new file mode 100644 index 0000000..c912e5e --- /dev/null +++ b/SpiralSound/Plugins/SpiralLoopPlugin/SpiralSound/iir_filter.h @@ -0,0 +1,75 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * 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. +*/ + +/* +Resonant low pass filter source code. +This code was originally written by baltrax@hotmail.com + +See +for the full version with explanatory comments, and the maths! +*/ + + +#include +#include +#include + + +#ifndef _IIR_FILTER +#define _IIR_FILTER + +/* FILTER INFORMATION STRUCTURE FOR FILTER ROUTINES */ + +class FILTER{ + public: + FILTER() {history=coef=NULL;} + unsigned int length; /* size of filter */ + float *history; /* pointer to history in filter */ + float *coef; /* pointer to coefficients of filter */ +}; + +#define FILTER_SECTIONS 2 /* 2 filter sections for 24 db/oct filter */ + +typedef struct { + double a0, a1, a2; /* numerator coefficients */ + double b0, b1, b2; /* denominator coefficients */ +} BIQUAD; + +extern BIQUAD ProtoCoef[FILTER_SECTIONS]; /* Filter prototype coefficients, + 1 for each filter section */ + +float iir_filter(float input,FILTER *iir); + +void szxform( + double *a0, double *a1, double *a2, /* numerator coefficients */ + double *b0, double *b1, double *b2, /* denominator coefficients */ + double fc, /* Filter cutoff frequency */ + double fs, /* sampling rate */ + double *k, /* overall gain factor */ + float *coef); /* pointer to 4 iir coefficients */ + +void prewarp(double *a0, double *a1, double *a2, double fc, double fs); + +void bilinear( + double a0, double a1, double a2, /* numerator coefficients */ + double b0, double b1, double b2, /* denominator coefficients */ + double *k, /* overall gain factor */ + double fs, /* sampling rate */ + float *coef); + +#endif diff --git a/SpiralSound/Plugins/SpiralPlugin.C b/SpiralSound/Plugins/SpiralPlugin.C new file mode 100644 index 0000000..7150f4c --- /dev/null +++ b/SpiralSound/Plugins/SpiralPlugin.C @@ -0,0 +1,162 @@ +/* SpiralSound + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "SpiralPlugin.h" + +SpiralPlugin::SpiralPlugin(): +m_GUI(NULL) +{ + m_Version=1; + m_ValuesChanged=true; + m_PluginInfo.Name="BasePlugin"; + m_PluginInfo.Width=100; + m_PluginInfo.Height=100; + m_PluginInfo.NumInputs=0; + m_PluginInfo.NumOutputs=0; + UpdateInfo=NULL; + cb_Update=NULL; + m_Parent=NULL; + m_HostID=-1; +} + +SpiralPlugin::~SpiralPlugin() +{ + for (int n=0; nhide(); + // delete m_GUI; + //} +} + +PluginInfo &SpiralPlugin::Initialise(const HostInfo *Host) +{ + m_HostInfo=Host; + + for (int n=0; nBUFSIZE)); + } + + for (int n=0; n=m_Output.size()) return false; + *s = m_Output[n]; + + return true; +} + +bool SpiralPlugin::SetInput(unsigned int n, const Sample *s) +{ + if (n>=m_Input.size()) return false; + m_Input[n]=s; + return true; +} + +bool SpiralPlugin::ValueChanged() +{ + if (m_ValuesChanged) + { + m_ValuesChanged=false; + return true; + } + return false; +} + +void SpiralPlugin::AddOutput() +{ + Sample* NewSample = new Sample(m_HostInfo->BUFSIZE); + m_Output.push_back(NewSample); +} + +void SpiralPlugin::RemoveOutput() +{ + vector::iterator si=m_Output.end(); + si--; + delete *si; + m_Output.erase(si); +} + +void SpiralPlugin::RemoveAllOutputs() +{ + for (vector::iterator i=m_Output.begin(); + i!=m_Output.end(); i++) + { + delete *i; + } + + m_Output.clear(); +} + +void SpiralPlugin::AddInput() +{ + m_Input.push_back(NULL); +} + +void SpiralPlugin::RemoveInput() +{ + vector::iterator si=m_Input.end(); + si--; + m_Input.erase(si); +} + +void SpiralPlugin::RemoveAllInputs() +{ + m_Input.clear(); +} + +void SpiralPlugin::UpdatePluginInfoWithHost() +{ + if (UpdateInfo!=NULL) + { + UpdateInfo(m_HostID,(void*)&m_PluginInfo); + } +} +void SpiralPlugin::SetUpdateInfoCallback(int ID, void(*s)(int, void *)) +{ + m_HostID=ID; + UpdateInfo=s; +} + +void SpiralPlugin::SetInPortType(PluginInfo &pinfo, int port, Sample::SampleType type) +{ + pinfo.PortTypes[port] = type; +} + +void SpiralPlugin::SetOutPortType(PluginInfo &pinfo, int port, Sample::SampleType type) +{ + pinfo.PortTypes[port+m_PluginInfo.NumInputs] = type; + GetOutputBuf(port)->setSampleType(type); +} diff --git a/SpiralSound/Plugins/SpiralPlugin.h b/SpiralSound/Plugins/SpiralPlugin.h new file mode 100644 index 0000000..055a647 --- /dev/null +++ b/SpiralSound/Plugins/SpiralPlugin.h @@ -0,0 +1,145 @@ +/* SpiralSound + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include "../Sample.h" +#include +#include +#include + +#ifndef SPIRALPLUGIN +#define SPIRALPLUGIN + +#define SpiralGUIType Fl_Group + +static const float MAX_FREQ = 13000; + +struct PluginInfo +{ + string Name; + int Width; + int Height; + int NumInputs; + int NumOutputs; + vector PortTips; + vector PortTypes; + char BitMap[40][40][3]; +}; + +struct HostInfo +{ + int BUFSIZE; + int FRAGSIZE; + int FRAGCOUNT; + int SAMPLERATE; + string OUTPUTFILE; + string MIDIFILE; + int POLY; + int GUI_COLOUR; +}; + +class SpiralPlugin +{ +public: + SpiralPlugin(); + virtual ~SpiralPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual void Execute()=0; + virtual SpiralGUIType* CreateGUI()=0; + + // stream the plugins state + virtual void StreamOut(ostream &s)=0; + virtual void StreamIn(istream &s)=0; + + // stuff here gets saved in filename_files directory + // you must return true if this feature is used. + virtual bool SaveExternalFiles(const string &Dir) { return false; } + virtual void LoadExternalFiles(const string &Dir) {} + + const HostInfo* GetHostInfo() { return m_HostInfo; } + bool GetOutput(unsigned int n, Sample **s); + bool SetInput(unsigned int n, const Sample *s); + const Sample* GetInput(unsigned int n) { return m_Input[n]; } + string GetName() { return m_PluginInfo.Name; } + + bool ValueChanged(); + void SetValueChanged(bool s) { m_ValuesChanged=s; } + + void UpdatePluginInfoWithHost(); + void SetUpdateInfoCallback(int ID, void(*s)(int, void *)); + void SetUpdateCallback(void (*s)(void*,bool m)) { cb_Update=s; } + void SetParent(void *s) { m_Parent=s; } + void SetInPortType(PluginInfo &pinfo, int port, Sample::SampleType type); + void SetOutPortType(PluginInfo &pinfo, int port, Sample::SampleType type); + +protected: + + void SetOutput(int n,int p, float s) + { if (m_Output[n]) m_Output[n]->Set(p,s); } + + float GetInput(int n,int p) + { if (m_Input[n]) return (*m_Input[n])[p]; else return 0.0; } + + void SetOutputPitch(int n,int p, float s) + { if (m_Output[n]) m_Output[n]->Set(p,(s/MAX_FREQ*2)-1.0f); } + + float GetInputPitch(int n,int p) + { if (m_Input[n]) return ((*m_Input[n])[p]+1.0f)*MAX_FREQ/2; else return 0.0; } + + void MixOutput(int n,int p, float s) + { if (m_Output[n]) m_Output[n]->Set(p,s+(*m_Output[n])[p]); } + + bool InputExists(int n) { return m_Input[n]!=NULL; } + bool OutputExists(int n) { return m_Output[n]!=NULL; } + + void AddOutput(); + void RemoveOutput(); + void RemoveAllOutputs(); + + void AddInput(); + void RemoveInput(); + void RemoveAllInputs(); + + // the ID number assigned to us by ssm + int GetID() { return m_HostID; } + + Sample* GetOutputBuf(int n) { return m_Output[n]; } + + SpiralGUIType *m_GUI; + const HostInfo *m_HostInfo; + PluginInfo m_PluginInfo; + bool m_ValuesChanged; + int m_Version; + + // needed for jack + void (*cb_Update)(void*o ,bool m); + void *m_Parent; + +private: + + vector m_Input; + vector m_Output; + + void (*UpdateInfo)(int n,void *); + int m_HostID; +}; + +#endif diff --git a/SpiralSound/Plugins/SpiralPluginGUI.C b/SpiralSound/Plugins/SpiralPluginGUI.C new file mode 100644 index 0000000..cc483c1 --- /dev/null +++ b/SpiralSound/Plugins/SpiralPluginGUI.C @@ -0,0 +1,70 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "SpiralPluginGUI.h" +#include "SpiralPlugin.h" +#include +#include + +static const int GUI_COLOUR = 154; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +SpiralPluginGUI::SpiralPluginGUI(int w, int h, SpiralPlugin* o) : +SpiralGUIType(0,0,w,h,"") +{ + Fl::visible_focus(false); + + box(FL_THIN_UP_BOX); + //clear_border(); + m_DragBar = new Fl_DragBar(0,0,w,20,o->GetName().c_str()); + m_DragBar->type(Fl_DragBar::FLDRAG); + add(m_DragBar); + + m_Hide = new Fl_Button(2,2,18,16,"X"); + m_Hide->labeltype(FL_ENGRAVED_LABEL); + m_Hide->box(FL_NO_BOX); + m_Hide->callback((Fl_Callback*)cb_Hide); + add(m_Hide); +} + +SpiralPluginGUI::~SpiralPluginGUI() +{ + // Needed to properly remove the window. + Fl::check(); +} + +// This could be improved. +void SpiralPluginGUI::draw() +{ + if (GetPlugin()->ValueChanged()) + { + UpdateValues(); + } + + SpiralGUIType::draw(); +} + +//// Callbacks //// + +inline void SpiralPluginGUI::cb_Hide_i(Fl_Button* o, void* v) +{ hide(); } +void SpiralPluginGUI::cb_Hide(Fl_Button* o, void* v) +{ ((SpiralPluginGUI*)(o->parent()))->cb_Hide_i(o,v); } + + diff --git a/SpiralSound/Plugins/SpiralPluginGUI.h b/SpiralSound/Plugins/SpiralPluginGUI.h new file mode 100644 index 0000000..cef8c05 --- /dev/null +++ b/SpiralSound/Plugins/SpiralPluginGUI.h @@ -0,0 +1,55 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include + +#include "Widgets/Fl_DragBar.H" + +#ifndef SPIRALPLUGINGUI +#define SPIRALPLUGINGUI + +#define SpiralGUIType Fl_Group + +class SpiralPlugin; + +class SpiralPluginGUI : public SpiralGUIType +{ +public: + SpiralPluginGUI(int w, int h, SpiralPlugin* o); + ~SpiralPluginGUI(); + + // Draw also does the job of reassigning the + // data values to the widgets. This could be better. + virtual void draw(); + virtual void UpdateValues() = 0; + virtual SpiralPlugin* GetPlugin() = 0; + +private: + Fl_DragBar* m_DragBar; + Fl_Button* m_Hide; + + //// Callbacks //// + inline void cb_Hide_i(Fl_Button* o, void* v); + static void cb_Hide(Fl_Button*, void*); +}; + +#endif diff --git a/SpiralSound/Plugins/SplitterPlugin/Makefile.in b/SpiralSound/Plugins/SplitterPlugin/Makefile.in new file mode 100644 index 0000000..6c1f25b --- /dev/null +++ b/SpiralSound/Plugins/SplitterPlugin/Makefile.in @@ -0,0 +1,169 @@ +# Generated automatically from Makefile.in by configure. +############################################################################# +# Makefile for building SplitterPlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: SplitterPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + SplitterPlugin.h \ + SplitterPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + SplitterPlugin.C \ + SplitterPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + SplitterPlugin.o \ + SplitterPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = SplitterPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake SplitterPlugin.pro + +dist: + $(TAR) SplitterPlugin.tar SplitterPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) SplitterPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +SplitterPlugin.o: SplitterPlugin.C \ + SplitterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + SplitterPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +SplitterPluginGUI.o: SplitterPluginGUI.C \ + SplitterPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + SplitterPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/SplitterPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/SplitterPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..1f62f19 --- /dev/null +++ b/SpiralSound/Plugins/SplitterPlugin/SpiralIcon.xpm @@ -0,0 +1,343 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 304 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #252525", +"). c #040400", +"!. c #141500", +"~. c #727175", +"{. c #FEFEFF", +"]. c #9D99AA", +"^. c #DBD9E0", +"/. c #E9E9E9", +"(. c #CBCBCB", +"_. c #E0E0E0", +":. c #6C6C6C", +"<. c #010200", +"[. c #C8D000", +"}. c #F5FE00", +"|. c #F4FD00", +"1. c #F0F900", +"2. c #292B00", +"3. c #515151", +"4. c #A6A6A7", +"5. c #827E93", +"6. c #615C77", +"7. c #EAEAED", +"8. c #DFDFE1", +"9. c #E5EE00", +"0. c #EDF600", +"a. c #8D9200", +"b. c #8C9200", +"c. c #737800", +"d. c #050600", +"e. c #1E1D24", +"f. c #9894A7", +"g. c #B1AEBB", +"h. c #69686F", +"i. c #000001", +"j. c #0A0A00", +"k. c #171800", +"l. c #E0E900", +"m. c #615C76", +"n. c #5F5A75", +"o. c #413E4D", +"p. c #020203", +"q. c #040500", +"r. c #050500", +"s. c #1A1A1C", +"t. c #C3C1CB", +"u. c #9D9D9D", +"v. c #202020", +"w. c #383838", +"x. c #4C4C4C", +"y. c #7B8000", +"z. c #F6FF00", +"A. c #E4ED00", +"B. c #121300", +"C. c #111112", +"D. c #C9C7D0", +"E. c #F1F1F1", +"F. c #F8F8F8", +"G. c #232323", +"H. c #010100", +"I. c #050408", +"J. c #AEACB9", +"K. c #FEFEFE", +"L. c #1D1D1D", +"M. c #020200", +"N. c #101100", +"O. c #B7B5C1", +"P. c #9390A2", +"Q. c #BBBBBB", +"R. c #414141", +"S. c #030303", +"T. c #F2FB00", +"U. c #A3A900", +"V. c #28272A", +"W. c #F4F4F6", +"X. c #605B76", +"Y. c #736E86", +"Z. c #D8D8D8", +"`. c #727272", +" + c #101010", +".+ c #797E00", +"++ c #1E2000", +"@+ c #848486", +"#+ c #CCCBD3", +"$+ c #747087", +"%+ c #6D6881", +"&+ c #1C1C1C", +"*+ c #242424", +"=+ c #656566", +"-+ c #F6F6F6", +";+ c #E8E6EA", +">+ c #706B84", +",+ c #E3E1E6", +"'+ c #474746", +")+ c #151515", +"!+ c #C8C8C8", +"~+ c #AEAEAE", +"{+ c #080808", +"]+ c #373639", +"^+ c #FDFCFE", +"/+ c #ABA8B7", +"(+ c #F1F0F3", +"_+ c #6D6980", +":+ c #0A090E", +"<+ c #95929E", +"[+ c #0A0810", +"}+ c #0D0D0D", +"|+ c #050505", +"1+ c #5B5A5C", +"2+ c #F7F6F7", +"3+ c #F4F3F5", +"4+ c #908C9F", +"5+ c #C8C6D0", +"6+ c #837E96", +"7+ c #86868A", +"8+ c #070608", +"9+ c #ECEBEE", +"0+ c #5B5571", +"a+ c #646078", +"b+ c #AFAFB0", +"c+ c #454545", +"d+ c #363636", +"e+ c #7A7A7A", +"f+ c #C8C8C9", +"g+ c #212025", +"h+ c #060607", +"i+ c #969699", +"j+ c #FAFAFA", +"k+ c #F8F8F9", +"l+ c #A29EAF", +"m+ c #F7F6F8", +"n+ c #F0F0F1", +"o+ c #B8B7B9", +"p+ c #E4E4E4", +"q+ c #FDFDFD", +"r+ c #A5A2B2", +"s+ c #3B3456", +"t+ c #A8A5B4", +"u+ c #525252", +"v+ c #848387", +"w+ c #CDCDCD", +"x+ c #8D899C", +"y+ c #494262", +"z+ c #68627C", +"A+ c #40395A", +"B+ c #ECECEC", +"C+ c #020202", +"D+ c #B4B5B5", +"E+ c #0B0B0B", +"F+ c #313232", +"G+ c #E3E3E3", +"H+ c #B1AEBC", +"I+ c #BDBBC6", +"J+ c #3C3556", +"K+ c #898599", +"L+ c #EDEDED", +"M+ c #39393A", +"N+ c #040404", +"O+ c #333333", +"P+ c #F5F5F5", +"Q+ c #2B2B2B", +"R+ c #2D2A3D", +"S+ c #B6B4C1", +"T+ c #F5F5F6", +"U+ c #605A76", +"V+ c #DAD8DF", +"W+ c #F5F4F6", +"X+ c #615B76", +"Y+ c #524D6A", +"Z+ c #E4E3E8", +"`+ c #D5D5D5", +" @ c #1B1B1B", +".@ c #303030", +"+@ c #AAABAB", +"@@ c #585464", +"#@ c #B0AEBB", +"$@ c #A29FAF", +"%@ c #E9E8E9", +"&@ c #787779", +"*@ c #0F0E15", +"=@ c #2D2D2E", +"-@ c #595959", +";@ c #FAFAFB", +">@ c #807B92", +",@ c #B0ADBB", +"'@ c #E8E7EB", +")@ c #3A3258", +"!@ c #E6E5EA", +"~@ c #DFDEE3", +"{@ c #443E5E", +"]@ c #BAB8C4", +"^@ c #C1BFCA", +"/@ c #E0E0E5", +"(@ c #D0CED6", +"_@ c #362F52", +":@ c #CECCD5", +"<@ c #413A5B", +"[@ c #6A657F", +"}@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.6 6 ).6 6 !.).6 6 6 E ~.{.; ; ]. ", +" ^.; ; /.R h (._.:.6 6 6 <.[.}.|.|.1.2.6 6 E 3.4.4 5. ", +" 6.7.; 8...6 6 6 6 6 6 6 6 <.9.0.a.b.c.d.6 6 6 6 e.f. ", +" V @ g.h.i.6 6 6 6 6 j.k.6 <.l.l.6 6 6 6 6 6 6 6 ", +" m.n.o.6 p.6 6 6 6 6 q.6 <.l.l.6 6 6 6 r.6 6 6 s. ", +" t.; ; u.v.v.w.x.v.6 y.z.z.z.A.l.6 6 6 6 B.6 6 6 C. ", +" D.; ; E.F.; ; ; G.6 H.!.6 6 l.l.6 6 6 6 B.6 6 6 I. ", +" J.; ; ; ; K.; ; L.6 M.N.6 6 l.l.6 6 6 6 B.6 6 6 6 O., ", +" P.; ; K.; : Q.R.S.6 6 6 6 6 l.T.l.l.U.).M.6 6 6 V.K.W.X. ", +" Y.; ; ; Z.`. +6 6 6 6 6 6 6 .+l.l.l.U.++6 6 6 6 @+; ; #+$+ ", +" %+J ; : &+6 6 6 6 *+..6 6 6 6 6 6 j.6 6 H.6 6 6 =+-+; ; ;+>+ ", +" ,+; ; '+6 E 6 )+!+~+{+6 6 6 6 6 6 6 6 H.6 6 6 6 ]+^+; ; > >+ ", +" /+; (+_+:+6 6 ~+K.; <+[+6 6 6 6 6 6 6 6 }+|+6 6 6 1+2+; ; 3+4+ ", +" >+5+! 6+7+8+x ; ; 9+0+a+b+l c+6 6 6 d+e+f+g+6 6 6 h+i+j+; ; k+@ ", +" l+m+n+o+p+q+; r+s+t+; -+c+6 6 E u+; ; v+6 6 E 6 o w+; ; = x+ ", +" y+> ; ; ; ; ; ; z+A+; ; B+w.6 6 C+D ; ; D+E+6 6 6 F+G+; ; H+ ", +" > ; ; ; ; I+J+K+; ; L+M+6 6 N+O+; ; P+Q+6 6 R+S+; T+3 ", +" U+V+= ; W+X+Y+Z+; ; `+ @6 6 C+.@; ; ; +@u+@@ ", +" #@4 $@ X ; ; ; %@&@.@*@=@-@; ; ; K.;@>@ ", +" ,@; ; ; ; ; '@)@!@; ; ; ; = ~@{@ ", +" ]@^@/@4 ; ; (@_@:@; ; ; s K+T ", +" <@ [@}@K+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.C b/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.C new file mode 100644 index 0000000..210cf36 --- /dev/null +++ b/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.C @@ -0,0 +1,87 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "SplitterPlugin.h" +#include "SplitterPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new SplitterPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0006; +} +} + +/////////////////////////////////////////////////////// + +SplitterPlugin::SplitterPlugin() +{ + m_PluginInfo.Name="Splitter"; + m_PluginInfo.Width=220; + m_PluginInfo.Height=125; + m_PluginInfo.NumInputs=1; + m_PluginInfo.NumOutputs=4; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Out one"); + m_PluginInfo.PortTips.push_back("Out two"); + m_PluginInfo.PortTips.push_back("Out three"); + m_PluginInfo.PortTips.push_back("Out four"); +} + +SplitterPlugin::~SplitterPlugin() +{ +} + +PluginInfo &SplitterPlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host); +} + +SpiralGUIType *SplitterPlugin::CreateGUI() +{ + m_GUI=NULL; + return m_GUI; +} + +void SplitterPlugin::Execute() +{ + // Just copy the data through. + GetOutputBuf(0)->Zero(); + GetOutputBuf(3)->Zero(); + GetOutputBuf(2)->Zero(); + GetOutputBuf(1)->Zero(); + + if (InputExists(0)) + { + GetOutputBuf(0)->Mix(*GetInput(0),0); + GetOutputBuf(1)->Mix(*GetInput(0),0); + GetOutputBuf(2)->Mix(*GetInput(0),0); + GetOutputBuf(3)->Mix(*GetInput(0),0); + } +} + diff --git a/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.h b/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.h new file mode 100644 index 0000000..d3a4757 --- /dev/null +++ b/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.h @@ -0,0 +1,43 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef SplitterPLUGIN +#define SplitterPLUGIN + +class SplitterPlugin : public SpiralPlugin +{ +public: + SplitterPlugin(); + virtual ~SplitterPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s) {} + virtual void StreamIn(istream &s) {} + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + +private: +}; + +#endif diff --git a/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.pro b/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.pro new file mode 100644 index 0000000..0c204af --- /dev/null +++ b/SpiralSound/Plugins/SplitterPlugin/SplitterPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + SplitterPlugin.h \ + SplitterPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + SplitterPlugin.C \ + SplitterPluginGUI.C + +TARGET = SplitterPlugin.so diff --git a/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.C b/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.C new file mode 100644 index 0000000..e2850fc --- /dev/null +++ b/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.C @@ -0,0 +1,41 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "SplitterPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +SplitterPluginGUI::SplitterPluginGUI(int w, int h,SplitterPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + end(); +} + + + +void SplitterPluginGUI::UpdateValues() +{ +} + diff --git a/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.h b/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.h new file mode 100644 index 0000000..f8dc168 --- /dev/null +++ b/SpiralSound/Plugins/SplitterPlugin/SplitterPluginGUI.h @@ -0,0 +1,47 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "SplitterPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef SplitterGUI +#define SplitterGUI + + +class SplitterPluginGUI : public SpiralPluginGUI +{ +public: + SplitterPluginGUI(int w, int h, SplitterPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + SplitterPlugin *m_Plugin; +private: + + //// Callbacks //// +}; + +#endif diff --git a/SpiralSound/Plugins/StereoMixerPlugin/Makefile.in b/SpiralSound/Plugins/StereoMixerPlugin/Makefile.in new file mode 100644 index 0000000..806f476 --- /dev/null +++ b/SpiralSound/Plugins/StereoMixerPlugin/Makefile.in @@ -0,0 +1,168 @@ +############################################################################# +# Makefile for building StereoMixerPlugin.so +# Generated by tmake at 22:21, 2001/09/17 +# Project: StereoMixerPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + StereoMixerPlugin.h \ + StereoMixerPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + StereoMixerPlugin.C \ + StereoMixerPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + StereoMixerPlugin.o \ + StereoMixerPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = StereoMixerPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: Makefile + +Makefile: StereoMixerPlugin.pro + tmake StereoMixerPlugin.pro -o Makefile + +dist: + $(TAR) StereoMixerPlugin.tar StereoMixerPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) StereoMixerPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +StereoMixerPlugin.o: StereoMixerPlugin.C \ + StereoMixerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + StereoMixerPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +StereoMixerPluginGUI.o: StereoMixerPluginGUI.C \ + StereoMixerPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + StereoMixerPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/StereoMixerPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/StereoMixerPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..edfe605 --- /dev/null +++ b/SpiralSound/Plugins/StereoMixerPlugin/SpiralIcon.xpm @@ -0,0 +1,342 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 303 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #252525", +"). c #666A00", +"!. c #8B9100", +"~. c #8D9200", +"{. c #929900", +"]. c #7E8200", +"^. c #040400", +"/. c #727175", +"(. c #FEFEFF", +"_. c #9D99AA", +":. c #DBD9E0", +"<. c #E9E9E9", +"[. c #CBCBCB", +"}. c #E0E0E0", +"|. c #6C6C6C", +"1. c #EDF600", +"2. c #F4FD00", +"3. c #F5FE00", +"4. c #515151", +"5. c #A6A6A7", +"6. c #827E93", +"7. c #615C77", +"8. c #EAEAED", +"9. c #DFDFE1", +"0. c #010200", +"a. c #010100", +"b. c #EDFF00", +"c. c #1E1D24", +"d. c #9894A7", +"e. c #B1AEBB", +"f. c #69686F", +"g. c #000001", +"h. c #0F0F00", +"i. c #7F8400", +"j. c #8C9200", +"k. c #C6CE00", +"l. c #615C76", +"m. c #5F5A75", +"n. c #413E4D", +"o. c #020203", +"p. c #292B00", +"q. c #F0F900", +"r. c #1A1A1C", +"s. c #C3C1CB", +"t. c #9D9D9D", +"u. c #202020", +"v. c #383838", +"w. c #4C4C4C", +"x. c #161700", +"y. c #8A9000", +"z. c #111112", +"A. c #C9C7D0", +"B. c #F1F1F1", +"C. c #F8F8F8", +"D. c #232323", +"E. c #141500", +"F. c #050408", +"G. c #AEACB9", +"H. c #FEFEFE", +"I. c #1D1D1D", +"J. c #313300", +"K. c #F6FF00", +"L. c #B7B5C1", +"M. c #9390A2", +"N. c #BBBBBB", +"O. c #414141", +"P. c #030303", +"Q. c #020200", +"R. c #28272A", +"S. c #F4F4F6", +"T. c #605B76", +"U. c #736E86", +"V. c #D8D8D8", +"W. c #727272", +"X. c #101010", +"Y. c #505300", +"Z. c #C8CF00", +"`. c #1E2000", +" + c #848486", +".+ c #CCCBD3", +"++ c #747087", +"@+ c #6D6881", +"#+ c #1C1C1C", +"$+ c #242424", +"%+ c #393B09", +"&+ c #0A0A00", +"*+ c #656566", +"=+ c #F6F6F6", +"-+ c #E8E6EA", +";+ c #706B84", +">+ c #E3E1E6", +",+ c #474746", +"'+ c #151515", +")+ c #C8C8C8", +"!+ c #AEAEAE", +"~+ c #080808", +"{+ c #373639", +"]+ c #FDFCFE", +"^+ c #ABA8B7", +"/+ c #F1F0F3", +"(+ c #6D6980", +"_+ c #0A090E", +":+ c #95929E", +"<+ c #0A0810", +"[+ c #0D0D0D", +"}+ c #050505", +"|+ c #5B5A5C", +"1+ c #F7F6F7", +"2+ c #F4F3F5", +"3+ c #908C9F", +"4+ c #C8C6D0", +"5+ c #837E96", +"6+ c #86868A", +"7+ c #070608", +"8+ c #ECEBEE", +"9+ c #5B5571", +"0+ c #646078", +"a+ c #AFAFB0", +"b+ c #454545", +"c+ c #363636", +"d+ c #7A7A7A", +"e+ c #C8C8C9", +"f+ c #212025", +"g+ c #060607", +"h+ c #969699", +"i+ c #FAFAFA", +"j+ c #F8F8F9", +"k+ c #A29EAF", +"l+ c #F7F6F8", +"m+ c #F0F0F1", +"n+ c #B8B7B9", +"o+ c #E4E4E4", +"p+ c #FDFDFD", +"q+ c #A5A2B2", +"r+ c #3B3456", +"s+ c #A8A5B4", +"t+ c #525252", +"u+ c #848387", +"v+ c #CDCDCD", +"w+ c #8D899C", +"x+ c #494262", +"y+ c #68627C", +"z+ c #40395A", +"A+ c #ECECEC", +"B+ c #020202", +"C+ c #B4B5B5", +"D+ c #0B0B0B", +"E+ c #313232", +"F+ c #E3E3E3", +"G+ c #B1AEBC", +"H+ c #BDBBC6", +"I+ c #3C3556", +"J+ c #898599", +"K+ c #EDEDED", +"L+ c #39393A", +"M+ c #040404", +"N+ c #333333", +"O+ c #F5F5F5", +"P+ c #2B2B2B", +"Q+ c #2D2A3D", +"R+ c #B6B4C1", +"S+ c #F5F5F6", +"T+ c #605A76", +"U+ c #DAD8DF", +"V+ c #F5F4F6", +"W+ c #615B76", +"X+ c #524D6A", +"Y+ c #E4E3E8", +"Z+ c #D5D5D5", +"`+ c #1B1B1B", +" @ c #303030", +".@ c #AAABAB", +"+@ c #585464", +"@@ c #B0AEBB", +"#@ c #A29FAF", +"$@ c #E9E8E9", +"%@ c #787779", +"&@ c #0F0E15", +"*@ c #2D2D2E", +"=@ c #595959", +"-@ c #FAFAFB", +";@ c #807B92", +">@ c #B0ADBB", +",@ c #E8E7EB", +"'@ c #3A3258", +")@ c #E6E5EA", +"!@ c #DFDEE3", +"~@ c #443E5E", +"{@ c #BAB8C4", +"]@ c #C1BFCA", +"^@ c #E0E0E5", +"/@ c #D0CED6", +"(@ c #362F52", +"_@ c #CECCD5", +":@ c #413A5B", +"<@ c #6A657F", +"[@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.!.{.].^.6 6 6 E /.(.; ; _. ", +" :.; ; <.R h [.}.|.6 1.2.2.2.3.2.6 6 6 6 6 E 4.5.4 6. ", +" 7.8.; 9...6 6 6 6 6 6 6 6 0.a.~.2.b.6 6 6 6 6 6 c.d. ", +" V @ e.f.g.6 6 6 6 6 h.i.j.~.j.k.2.b.b.b.b.b.6 6 ", +" l.m.n.6 o.6 6 6 6 p.q.2.2.2.3.3.b.6 6 6 6 6 6 r. ", +" s.; ; t.u.u.v.w.u.6 6 x.6 0.6 y.3.6 6 6 6 6 6 6 z. ", +" A.; ; B.C.; ; ; D.6 a.E.6 6 6 y.3.b.6 6 6 6 6 6 F. ", +" G.; ; ; ; H.; ; I.6 J.K.K.K.K.q.2.b.b.b.b.b.6 6 6 L., ", +" M.; ; H.; : N.O.P.6 6 6 6 6 6 y.2.b.6 ^.Q.6 6 6 R.H.S.T. ", +" U.; ; ; V.W.X.6 6 6 6 6 6 Y.y.Z.2.Q.6 `.6 6 6 6 +; ; .+++ ", +" @+J ; : #+6 6 6 6 $+%+K.K.K.2.2.2.&+6 6 a.6 6 6 *+=+; ; -+;+ ", +" >+; ; ,+6 E 6 '+)+!+~+6 6 6 6 6 6 6 6 a.6 6 6 6 {+]+; ; > ;+ ", +" ^+; /+(+_+6 6 !+H.; :+<+6 6 6 6 6 6 6 6 [+}+6 6 6 |+1+; ; 2+3+ ", +" ;+4+! 5+6+7+x ; ; 8+9+0+a+l b+6 6 6 c+d+e+f+6 6 6 g+h+i+; ; j+@ ", +" k+l+m+n+o+p+; q+r+s+; =+b+6 6 E t+; ; u+6 6 E 6 o v+; ; = w+ ", +" x+> ; ; ; ; ; ; y+z+; ; A+v.6 6 B+D ; ; C+D+6 6 6 E+F+; ; G+ ", +" > ; ; ; ; H+I+J+; ; K+L+6 6 M+N+; ; O+P+6 6 Q+R+; S+3 ", +" T+U+= ; V+W+X+Y+; ; Z+`+6 6 B+ @; ; ; .@t++@ ", +" @@4 #@ X ; ; ; $@%@ @&@*@=@; ; ; H.-@;@ ", +" >@; ; ; ; ; ,@'@)@; ; ; ; = !@~@ ", +" {@]@^@4 ; ; /@(@_@; ; ; s J+T ", +" :@ <@[@J+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.C b/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.C new file mode 100644 index 0000000..0f20407 --- /dev/null +++ b/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.C @@ -0,0 +1,133 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "StereoMixerPlugin.h" +#include "StereoMixerPluginGUI.h" +#include +#include "SpiralIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new StereoMixerPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0008; +} +} + +/////////////////////////////////////////////////////// + +StereoMixerPlugin::StereoMixerPlugin() +{ + m_PluginInfo.Name="Stereo Mixer"; + m_PluginInfo.Width=190; + m_PluginInfo.Height=175; + m_PluginInfo.NumInputs=8; + m_PluginInfo.NumOutputs=2; + m_PluginInfo.PortTips.push_back("Input one"); + m_PluginInfo.PortTips.push_back("Input two"); + m_PluginInfo.PortTips.push_back("Input three"); + m_PluginInfo.PortTips.push_back("Input four"); + m_PluginInfo.PortTips.push_back("Pan CV one"); + m_PluginInfo.PortTips.push_back("Pan CV two"); + m_PluginInfo.PortTips.push_back("Pan CV three"); + m_PluginInfo.PortTips.push_back("Pan CV four"); + m_PluginInfo.PortTips.push_back("Output left"); + m_PluginInfo.PortTips.push_back("Output right"); + + for (int n=0; nhide(); + return m_GUI; +} + +void StereoMixerPlugin::Execute() +{ + float Pan[4]; + + // Mix the inputs + for (int n=0; nBUFSIZE; n++) + { + Pan[0]=m_Pan[0]; + Pan[1]=m_Pan[1]; + Pan[2]=m_Pan[2]; + Pan[3]=m_Pan[3]; + + if (InputExists(0)) Pan[0]+=GetInput(4,n)*0.5; + if (InputExists(1)) Pan[1]+=GetInput(5,n)*0.5; + if (InputExists(2)) Pan[2]+=GetInput(6,n)*0.5; + if (InputExists(3)) Pan[3]+=GetInput(7,n)*0.5; + + SetOutput(0,n,(GetInput(0,n)*m_ChannelVal[0])*Pan[0]+ + (GetInput(1,n)*m_ChannelVal[1])*Pan[1]+ + (GetInput(2,n)*m_ChannelVal[2])*Pan[2]+ + (GetInput(3,n)*m_ChannelVal[3])*Pan[3]); + + SetOutput(1,n,(GetInput(0,n)*m_ChannelVal[0])*(1-Pan[0])+ + (GetInput(1,n)*m_ChannelVal[1])*(1-Pan[1])+ + (GetInput(2,n)*m_ChannelVal[2])*(1-Pan[2])+ + (GetInput(3,n)*m_ChannelVal[3])*(1-Pan[3])); + } +} + +void StereoMixerPlugin::StreamOut(ostream &s) +{ + s<>version; + for (int n=0; n>m_ChannelVal[n]>>m_Pan[n]; + } +} + + diff --git a/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.h b/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.h new file mode 100644 index 0000000..6e7a929 --- /dev/null +++ b/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.h @@ -0,0 +1,52 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef StereoMixerPLUGIN +#define StereoMixerPLUGIN + +static const int NUM_CHANNELS = 4; + +class StereoMixerPlugin : public SpiralPlugin +{ +public: + StereoMixerPlugin(); + virtual ~StereoMixerPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetChannel(int n, float s) { m_ChannelVal[n]=s; } + float GetChannel(int n) { return m_ChannelVal[n]; } + void SetPan(int n, float s) { m_Pan[n]=s; } + float GetPan(int n) { return m_Pan[n]; } + +private: + float m_ChannelVal[NUM_CHANNELS]; + float m_Pan[NUM_CHANNELS]; +}; + +#endif diff --git a/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.pro b/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.pro new file mode 100644 index 0000000..5421239 --- /dev/null +++ b/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + StereoMixerPlugin.h \ + StereoMixerPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + StereoMixerPlugin.C \ + StereoMixerPluginGUI.C + +TARGET = StereoMixerPlugin.so diff --git a/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.C b/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.C new file mode 100644 index 0000000..1d1abf6 --- /dev/null +++ b/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.C @@ -0,0 +1,91 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "StereoMixerPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +StereoMixerPluginGUI::StereoMixerPluginGUI(int w, int h,StereoMixerPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) { + + m_Plugin=o; + int Width=20; + int Height=100; + + for (int n=0; ntype (4); + m_Chan[n]->selection_color (GUI_COLOUR); + m_Chan[n]->labelsize (10); + m_Chan[n]->maximum (2); + m_Chan[n]->step (0.01); + m_Chan[n]->value (1.0); + m_Chan[n]->callback ((Fl_Callback*)cb_Chan, (void*)&Numbers[n]); + add (m_Chan[n]); + + m_Pan[n] = new Fl_Knob (10 + (2 + Width * 2) * n, 122, 40, 40, "Pan"); + m_Pan[n]->type (Fl_Knob::DOTLIN); + m_Pan[n]->color (GUI_COLOUR); + m_Pan[n]->labelsize (10); + m_Pan[n]->maximum (1); + m_Pan[n]->step (0.01); + m_Pan[n]->value (0.5); + m_Pan[n]->callback ((Fl_Callback*)cb_Pan, (void*)&Numbers[n]); + // This line used to be + // add (m_Chan[n]); + // I'm guessing this an error, but I could be wrong there + add (m_Pan[n]); + } + + end(); +} + +void StereoMixerPluginGUI::UpdateValues () { + for (int n=0; nvalue (2.0f - m_Plugin->GetChannel (n)); + // This line used to be + // m_Pan[n]->value (m_Plugin->GetChannel (n)); + // And that definately fixes the problem + m_Pan[n]->value (m_Plugin->GetPan (n)); + } +} + +inline void StereoMixerPluginGUI::cb_Chan_i(Fl_Slider* o, void* v) { + m_Plugin->SetChannel(*(int*)(v),2.0f-o->value()); +} + +void StereoMixerPluginGUI::cb_Chan(Fl_Slider* o, void* v) { + ((StereoMixerPluginGUI*)(o->parent()))->cb_Chan_i(o,v); +} + +inline void StereoMixerPluginGUI::cb_Pan_i(Fl_Knob* o, void* v) { + m_Plugin->SetPan(*(int*)(v),o->value()); +} + +void StereoMixerPluginGUI::cb_Pan(Fl_Knob* o, void* v) { + ((StereoMixerPluginGUI*)(o->parent()))->cb_Pan_i(o,v); +} diff --git a/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.h b/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.h new file mode 100644 index 0000000..5a63ad9 --- /dev/null +++ b/SpiralSound/Plugins/StereoMixerPlugin/StereoMixerPluginGUI.h @@ -0,0 +1,56 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include "../Widgets/Fl_Knob.H" + +#include "StereoMixerPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef MixerGUI +#define MixerGUI + + +class StereoMixerPluginGUI : public SpiralPluginGUI +{ +public: + StereoMixerPluginGUI(int w, int h, StereoMixerPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + StereoMixerPlugin *m_Plugin; +private: + + int Numbers[NUM_CHANNELS]; + + Fl_Slider* m_Chan[NUM_CHANNELS]; + Fl_Knob* m_Pan[NUM_CHANNELS]; + + //// Callbacks //// + inline void cb_Chan_i(Fl_Slider* o, void* v); + static void cb_Chan(Fl_Slider* o, void* v); + + inline void cb_Pan_i(Fl_Knob* o, void* v); + static void cb_Pan(Fl_Knob* o, void* v); +}; + +#endif diff --git a/SpiralSound/Plugins/StreamPlugin/Makefile.in b/SpiralSound/Plugins/StreamPlugin/Makefile.in new file mode 100644 index 0000000..5cc2a52 --- /dev/null +++ b/SpiralSound/Plugins/StreamPlugin/Makefile.in @@ -0,0 +1,184 @@ +############################################################################# +# Makefile for building StreamPlugin.so +# Generated by tmake at 22:23, 2002/02/03 +# Project: StreamPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_SevenSeg.H \ + ../../Sample.h \ + ../../RiffWav.h \ + StreamPlugin.h \ + StreamPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_SevenSeg.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + StreamPlugin.C \ + StreamPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../Widgets/Fl_SevenSeg.o \ + ../../Sample.o \ + ../../RiffWav.o \ + StreamPlugin.o \ + StreamPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = StreamPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake StreamPlugin.pro + +dist: + $(TAR) StreamPlugin.tar StreamPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) StreamPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../Widgets/Fl_SevenSeg.o: ../Widgets/Fl_SevenSeg.cxx \ + ../Widgets/Fl_SevenSeg.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +../../RiffWav.o: ../../RiffWav.C \ + ../../RiffWav.h \ + ../../Sample.h \ + ../../SpiralInfo.h + +StreamPlugin.o: StreamPlugin.C \ + StreamPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../../RiffWav.h \ + StreamPluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_SevenSeg.H \ + SpiralIcon.xpm \ + ../../NoteTable.h + +StreamPluginGUI.o: StreamPluginGUI.C \ + StreamPluginGUI.h \ + StreamPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../../RiffWav.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_SevenSeg.H + diff --git a/SpiralSound/Plugins/StreamPlugin/SpiralIcon.xpm b/SpiralSound/Plugins/StreamPlugin/SpiralIcon.xpm new file mode 100644 index 0000000..64a0ce0 --- /dev/null +++ b/SpiralSound/Plugins/StreamPlugin/SpiralIcon.xpm @@ -0,0 +1,363 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 324 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0A0A0A", +"+. c #151700", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #282900", +"!. c #030300", +"~. c #070700", +"{. c #020200", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #807A00", +"|. c #AAA100", +"1. c #343100", +"2. c #444000", +"3. c #E6DA00", +"4. c #D5CA00", +"5. c #060500", +"6. c #515151", +"7. c #A6A6A7", +"8. c #827E93", +"9. c #615C77", +"0. c #EAEAED", +"a. c #DFDFE1", +"b. c #0C0C0C", +"c. c #191700", +"d. c #D6CB00", +"e. c #FEF100", +"f. c #FDF000", +"g. c #645E00", +"h. c #F8EB00", +"i. c #D1C600", +"j. c #1E1D24", +"k. c #9894A7", +"l. c #B1AEBB", +"m. c #69686F", +"n. c #000001", +"o. c #C2B800", +"p. c #948C00", +"q. c #F6E900", +"r. c #E9DD00", +"s. c #FFF200", +"t. c #615C76", +"u. c #5F5A75", +"v. c #413E4D", +"w. c #020203", +"x. c #EADE00", +"y. c #BCB200", +"z. c #322F00", +"A. c #1A1A1C", +"B. c #C3C1CB", +"C. c #9D9D9D", +"D. c #202020", +"E. c #383838", +"F. c #4C4C4C", +"G. c #111112", +"H. c #C9C7D0", +"I. c #F1F1F1", +"J. c #F8F8F8", +"K. c #232323", +"L. c #050408", +"M. c #AEACB9", +"N. c #FEFEFE", +"O. c #1D1D1D", +"P. c #534E00", +"Q. c #E5D900", +"R. c #E8DC00", +"S. c #8E8700", +"T. c #F3E600", +"U. c #353200", +"V. c #B7B5C1", +"W. c #9390A2", +"X. c #BBBBBB", +"Y. c #414141", +"Z. c #030303", +"`. c #D0C500", +" + c #F1E400", +".+ c #F9EC00", +"++ c #FBEE00", +"@+ c #171600", +"#+ c #363400", +"$+ c #999100", +"%+ c #FCEF00", +"&+ c #E2D600", +"*+ c #28272A", +"=+ c #F4F4F6", +"-+ c #605B76", +";+ c #736E86", +">+ c #D8D8D8", +",+ c #727272", +"'+ c #101010", +")+ c #C7BC00", +"!+ c #8C8400", +"~+ c #302D00", +"{+ c #7E7700", +"]+ c #848486", +"^+ c #CCCBD3", +"/+ c #747087", +"(+ c #6D6881", +"_+ c #1C1C1C", +":+ c #242424", +"<+ c #8E8600", +"[+ c #807900", +"}+ c #1E1C00", +"|+ c #656566", +"1+ c #F6F6F6", +"2+ c #E8E6EA", +"3+ c #706B84", +"4+ c #E3E1E6", +"5+ c #474746", +"6+ c #151515", +"7+ c #C8C8C8", +"8+ c #AEAEAE", +"9+ c #070707", +"0+ c #010100", +"a+ c #373639", +"b+ c #FDFCFE", +"c+ c #ABA8B7", +"d+ c #F1F0F3", +"e+ c #6D6980", +"f+ c #0A090E", +"g+ c #95929E", +"h+ c #0A0810", +"i+ c #0D0D0D", +"j+ c #050505", +"k+ c #5B5A5C", +"l+ c #F7F6F7", +"m+ c #F4F3F5", +"n+ c #908C9F", +"o+ c #C8C6D0", +"p+ c #837E96", +"q+ c #86868A", +"r+ c #070608", +"s+ c #ECEBEE", +"t+ c #5B5571", +"u+ c #646078", +"v+ c #AFAFB0", +"w+ c #454545", +"x+ c #363636", +"y+ c #7A7A7A", +"z+ c #C8C8C9", +"A+ c #212025", +"B+ c #060607", +"C+ c #969699", +"D+ c #FAFAFA", +"E+ c #F8F8F9", +"F+ c #A29EAF", +"G+ c #F7F6F8", +"H+ c #F0F0F1", +"I+ c #B8B7B9", +"J+ c #E4E4E4", +"K+ c #FDFDFD", +"L+ c #A5A2B2", +"M+ c #3B3456", +"N+ c #A8A5B4", +"O+ c #525252", +"P+ c #848387", +"Q+ c #CDCDCD", +"R+ c #8D899C", +"S+ c #494262", +"T+ c #68627C", +"U+ c #40395A", +"V+ c #ECECEC", +"W+ c #020202", +"X+ c #B4B5B5", +"Y+ c #0B0B0B", +"Z+ c #313232", +"`+ c #E3E3E3", +" @ c #B1AEBC", +".@ c #BDBBC6", +"+@ c #3C3556", +"@@ c #898599", +"#@ c #EDEDED", +"$@ c #39393A", +"%@ c #040404", +"&@ c #333333", +"*@ c #F5F5F5", +"=@ c #2B2B2B", +"-@ c #2D2A3D", +";@ c #B6B4C1", +">@ c #F5F5F6", +",@ c #605A76", +"'@ c #DAD8DF", +")@ c #F5F4F6", +"!@ c #615B76", +"~@ c #524D6A", +"{@ c #E4E3E8", +"]@ c #D5D5D5", +"^@ c #1B1B1B", +"/@ c #303030", +"(@ c #AAABAB", +"_@ c #585464", +":@ c #B0AEBB", +"<@ c #A29FAF", +"[@ c #E9E8E9", +"}@ c #787779", +"|@ c #0F0E15", +"1@ c #2D2D2E", +"2@ c #595959", +"3@ c #FAFAFB", +"4@ c #807B92", +"5@ c #B0ADBB", +"6@ c #E8E7EB", +"7@ c #3A3258", +"8@ c #E6E5EA", +"9@ c #DFDEE3", +"0@ c #443E5E", +"a@ c #BAB8C4", +"b@ c #C1BFCA", +"c@ c #E0E0E5", +"d@ c #D0CED6", +"e@ c #362F52", +"f@ c #CECCD5", +"g@ c #413A5B", +"h@ c #6A657F", +"i@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.6 6 6 ~.{.6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 6 }.|.1.6 6 2.3.4.5.6 E 6.7.4 8. ", +" 9.0.; a.b.6 6 6 6 6 c.d.e.f.e.5.g.e.h.e.i.6 c.6 j.k. ", +" V @ l.m.n.6 6 6 6 6 o.e.p.5.e.q.e.r.5.i.s.6 c.6 ", +" t.u.v.6 w.6 6 6 6 6 6 6 6 g.x.y.6 6 6 z.6 6 6 A. ", +" B.; ; C.D.D.E.F.D.6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 G. ", +" H.; ; I.J.; ; ; K.6 6 6 6 6 6 6 6 6 6 6 {.{.6 6 L. ", +" M.; ; ; ; N.; ; O.6 6 P.Q.R.g.6 6 S.T.f.f.U.6 6 6 V., ", +" W.; ; N.; : X.Y.Z.6 `.s. +.+++@+#+e.q.$+%+&+6 6 *+N.=+-+ ", +" ;+; ; ; >+,+'+6 6 6 )+!+6 ~+s.%+f.f.5.6 {+{+6 6 ]+; ; ^+/+ ", +" (+J ; : _+6 6 6 6 :+6 6 6 6 U.<+[+}+6 6 6 6 6 6 |+1+; ; 2+3+ ", +" 4+; ; 5+6 E 6 6+7+8+9+6 6 6 6 6 6 6 6 0+6 6 6 6 a+b+; ; > 3+ ", +" c+; d+e+f+6 6 8+N.; g+h+6 6 6 6 6 6 6 6 i+j+6 6 6 k+l+; ; m+n+ ", +" 3+o+! p+q+r+x ; ; s+t+u+v+l w+6 6 6 x+y+z+A+6 6 6 B+C+D+; ; E+@ ", +" F+G+H+I+J+K+; L+M+N+; 1+w+6 6 E O+; ; P+6 6 E 6 o Q+; ; = R+ ", +" S+> ; ; ; ; ; ; T+U+; ; V+E.6 6 W+D ; ; X+Y+6 6 6 Z+`+; ; @ ", +" > ; ; ; ; .@+@@@; ; #@$@6 6 %@&@; ; *@=@6 6 -@;@; >@3 ", +" ,@'@= ; )@!@~@{@; ; ]@^@6 6 W+/@; ; ; (@O+_@ ", +" :@4 <@ X ; ; ; [@}@/@|@1@2@; ; ; N.3@4@ ", +" 5@; ; ; ; ; 6@7@8@; ; ; ; = 9@0@ ", +" a@b@c@4 ; ; d@e@f@; ; ; s @@T ", +" g@ h@i@@@ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/StreamPlugin/StreamPlugin.C b/SpiralSound/Plugins/StreamPlugin/StreamPlugin.C new file mode 100644 index 0000000..9256a4d --- /dev/null +++ b/SpiralSound/Plugins/StreamPlugin/StreamPlugin.C @@ -0,0 +1,236 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "StreamPlugin.h" +#include "StreamPluginGUI.h" +#include +#include "SpiralIcon.xpm" +#include "../../RiffWav.h" +#include "../../NoteTable.h" + +static const float TRIG_THRESH = 0.1; +static const float BUFSECONDS = 1.0f; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new StreamPlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0119; +} +} + +/////////////////////////////////////////////////////// + +StreamPlugin::StreamPlugin() : +m_SampleSize(256), +m_Pos(0), +m_StreamPos(0), +m_GlobalPos(0), +m_Mode(PLAYM) +{ + m_PluginInfo.Name="Stream"; + m_PluginInfo.Width=245; + m_PluginInfo.Height=165; + m_PluginInfo.NumInputs=1; + m_PluginInfo.NumOutputs=2; + m_PluginInfo.PortTips.push_back("Pitch CV"); + m_PluginInfo.PortTips.push_back("Left Out"); + m_PluginInfo.PortTips.push_back("Right Out"); + + m_StreamDesc.Volume = 1.0f; + m_StreamDesc.Pitch = 1.0f; + m_StreamDesc.PitchMod = 1.0f; + m_StreamDesc.SamplePos = -1; + m_StreamDesc.Loop = false; + m_StreamDesc.Note = 0; + m_StreamDesc.Pathname = "None"; + m_StreamDesc.TriggerUp = true; + m_StreamDesc.SampleRate = 44100; + m_StreamDesc.Stereo = false; +} + +StreamPlugin::~StreamPlugin() +{ +} + +PluginInfo &StreamPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + return Info; +} + +SpiralGUIType *StreamPlugin::CreateGUI() +{ + m_GUI = new StreamPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void StreamPlugin::Execute() +{ + float CVPitch=0; + + if (m_File.IsOpen()) + { + for (int n=0; nBUFSIZE; n++) + { + CVPitch=GetInput(0,n)*10.0f; + + if (m_Pos<0) + { + m_Pos=m_SampleSize-1; + m_StreamPos-=m_SampleSize; + if (m_StreamPos<0) + { + m_StreamPos=m_File.GetSize()/2-m_SampleSize; + m_GlobalPos=m_StreamPos; + } + m_File.SeekToChunk(m_StreamPos); + m_File.LoadChunk(m_SampleSize, m_SampleL, m_SampleR); + } + else + { + if (m_Pos>=m_SampleSize) + { + //m_SampleSize=(int)(BUFSECONDS*m_HostInfo->SAMPLERATE*m_StreamDesc.PitchMod); + m_Pos=0; + m_StreamPos+=m_SampleSize; + if (m_StreamPos>=m_File.GetSize()/2) + { + m_StreamPos=0; + m_GlobalPos=0; + } + m_File.SeekToChunk(m_StreamPos); + m_File.LoadChunk(m_SampleSize, m_SampleL, m_SampleR); + } + } + + SetOutput(0,n,m_SampleL[m_Pos]*m_StreamDesc.Volume); + SetOutput(1,n,m_SampleR[m_Pos]*m_StreamDesc.Volume); + + m_Pos+=m_StreamDesc.PitchMod+CVPitch; + m_GlobalPos+=m_StreamDesc.PitchMod+CVPitch; + } + + if (((StreamPluginGUI*)m_GUI)->visible()) + ((StreamPluginGUI*)m_GUI)->SetTime(GetTime()); + } +} + +void StreamPlugin::StreamOut(ostream &s) +{ + s<>version; + + s>>m_StreamDesc.Volume>> + m_StreamDesc.PitchMod; + char Buf[4096]; + int size; + s>>size; + s.ignore(1); + s.get(Buf,size+1); + m_StreamDesc.Pathname=Buf; + + if (m_StreamDesc.Pathname!="None") + OpenStream(m_StreamDesc.Pathname); + + s>>m_Pos; + s>>m_StreamPos; + s>>m_GlobalPos; + s>>m_Pitch; +} + +void StreamPlugin::OpenStream(const string &Name) +{ + m_StreamPos=0; + m_GlobalPos=0; + if (m_File.IsOpen()) m_File.Close(); + m_File.Open(Name,WavFile::READ); + m_SampleL.Allocate(m_SampleSize); + m_SampleR.Allocate(m_SampleSize); + m_StreamDesc.Pathname=Name; + m_StreamDesc.SampleRate=m_File.GetSamplerate(); + m_StreamDesc.Stereo=m_File.IsStereo(); + m_StreamDesc.Pitch = m_StreamDesc.SampleRate/(float)m_HostInfo->SAMPLERATE; + if (m_StreamDesc.Stereo) + { + m_StreamDesc.Pitch*=2; + ((StreamPluginGUI*)m_GUI)->SetMaxTime(GetLength()); + } + else ((StreamPluginGUI*)m_GUI)->SetMaxTime(GetLength()/2); + +} + +void StreamPlugin::Restart() +{ + m_StreamPos=0; m_GlobalPos=0; +} + +void StreamPlugin::Play() +{ + if (m_Mode==PLAYM) return; + m_StreamDesc.PitchMod=m_Pitch; + m_Mode=PLAYM; +} + +void StreamPlugin::Stop() +{ + if (m_Mode==STOPM) return; + m_Pitch=m_StreamDesc.PitchMod; + m_StreamDesc.PitchMod=0.0f; + m_Mode=STOPM; +} + +float StreamPlugin::GetLength() +{ + if (m_StreamDesc.Stereo) return (m_File.GetSize()/(float)m_StreamDesc.SampleRate)*0.5f; + else return m_File.GetSize()/(float)m_StreamDesc.SampleRate; +} + +void StreamPlugin::SetTime(float t) +{ + m_GlobalPos=m_StreamDesc.SampleRate*t; + m_StreamPos=(int)(m_StreamDesc.SampleRate*t); + m_Pos=m_SampleSize; +} + diff --git a/SpiralSound/Plugins/StreamPlugin/StreamPlugin.h b/SpiralSound/Plugins/StreamPlugin/StreamPlugin.h new file mode 100644 index 0000000..0c1b20f --- /dev/null +++ b/SpiralSound/Plugins/StreamPlugin/StreamPlugin.h @@ -0,0 +1,90 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include "../../RiffWav.h" +#include + +#ifndef StreamPLUGIN +#define StreamPLUGIN + +static const int NUDGESIZE=44100/4; + +struct SampleDesc +{ + string Pathname; + float Volume; + float Pitch; + float PitchMod; + bool Loop; + int Note; + bool TriggerUp; + float SamplePos; + int SampleRate; + bool Stereo; +}; + +class StreamPlugin : public SpiralPlugin +{ +public: + enum Mode{PLAYM,STOPM}; + + StreamPlugin(); + virtual ~StreamPlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void OpenStream(const string &Name); + + void SetVolume(float s) { m_StreamDesc.Volume=s; } + float GetVolume() { return m_StreamDesc.Volume; } + void SetPitch(float s) { m_StreamDesc.PitchMod=s; } + float GetPitch() { return m_StreamDesc.PitchMod; } + void SetLoop(bool s) { m_StreamDesc.Loop=s; } + bool GetLoop() { return m_StreamDesc.Loop; } + float GetLength(); + float GetTime() { return m_GlobalPos/(float)m_StreamDesc.SampleRate; } + void SetTime(float t); + void Nudge() { m_Pos-=NUDGESIZE; } + + void Restart(); + void Play(); + void Stop(); + +private: + + WavFile m_File; + Sample m_SampleL; + Sample m_SampleR; + SampleDesc m_StreamDesc; + int m_SampleSize; + float m_Pos; + int m_StreamPos; + float m_GlobalPos; + float m_Pitch; + Mode m_Mode; +}; + +#endif diff --git a/SpiralSound/Plugins/StreamPlugin/StreamPlugin.pro b/SpiralSound/Plugins/StreamPlugin/StreamPlugin.pro new file mode 100644 index 0000000..2983556 --- /dev/null +++ b/SpiralSound/Plugins/StreamPlugin/StreamPlugin.pro @@ -0,0 +1,21 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../Widgets/Fl_SevenSeg.H \ + ../../Sample.h \ + ../../RiffWav.h \ + StreamPlugin.h \ + StreamPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_SevenSeg.cxx \ + ../../Sample.C \ + ../../RiffWav.C \ + StreamPlugin.C \ + StreamPluginGUI.C + +TARGET = StreamPlugin.so diff --git a/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.C b/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.C new file mode 100644 index 0000000..46c5d67 --- /dev/null +++ b/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.C @@ -0,0 +1,271 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "StreamPluginGUI.h" +#include +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; +char PitchLabel[256]; + +//////////////////////////////////////////// + +StreamPluginGUI::StreamPluginGUI(int w, int h,StreamPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + int Width=20; + int Height=100; + + m_Load = new Fl_Button(2, 130, 30, 30, "Load"); + m_Load->labelsize(9); + m_Load->callback((Fl_Callback*)cb_Load); + add(m_Load); + + int sx=32; + + m_ToStart = new Fl_Button(sx, 130, 30, 30, "@|<"); + m_ToStart->labelsize(10); + m_ToStart->labeltype(FL_SYMBOL_LABEL); + m_ToStart->callback((Fl_Callback*)cb_ToStart); + add(m_ToStart); + + m_Stop = new Fl_Button(sx+30, 130, 30, 30, "@||"); + m_Stop->labelsize(10); + m_Stop->labeltype(FL_SYMBOL_LABEL); + m_Stop->callback((Fl_Callback*)cb_Stop); + add(m_Stop); + + m_Play = new Fl_Button(sx+60, 130, 30, 30, "@>"); + m_Play->labelsize(10); + m_Play->labeltype(FL_SYMBOL_LABEL); + m_Play->callback((Fl_Callback*)cb_Play); + add(m_Play); + + m_Div = new Fl_Button(sx+90, 130, 30, 30, "/2"); + m_Div->labelsize(9); + m_Div->callback((Fl_Callback*)cb_Div); + add(m_Div); + + m_Reset = new Fl_Button(sx+120, 130, 30, 30, "Reset"); + m_Reset->labelsize(9); + m_Reset->callback((Fl_Callback*)cb_Reset); + add(m_Reset); + + m_Loop = new Fl_Button(sx+150, 130, 30, 30, "X2"); + m_Loop->labelsize(9); + m_Loop->callback((Fl_Callback*)cb_Loop); + add(m_Loop); + + m_Nudge = new Fl_Repeat_Button(sx+180, 130, 30, 30, "Nudge"); + m_Nudge->labelsize(9); + m_Nudge->callback((Fl_Callback*)cb_Nudge); + add(m_Nudge); + + // Andy Preston changed + // m_Volume = new Fl_Knob(170, 15, 50, 50, "Volume"); + // to + m_Volume = new Fl_Knob (180, 15, 50, 50, "Volume"); + m_Volume->color(GUI_COLOUR); + m_Volume->type(Fl_Knob::LINELIN); + m_Volume->labelsize(10); + m_Volume->maximum(2); + m_Volume->step(0.001); + m_Volume->value(1); + m_Volume->callback((Fl_Callback*)cb_Volume); + add(m_Volume); + + m_Pitch = new Fl_Slider(5,85,235,20, ""); + m_Pitch->type(FL_HORIZONTAL); + m_Pitch->align(FL_ALIGN_INSIDE | FL_ALIGN_RIGHT); + m_Pitch->labelsize(10); + m_Pitch->labelcolor(GUI_COLOUR); + m_Pitch->maximum(20); + m_Pitch->step(0.001); + sprintf(PitchLabel,"%1.3f ",1.0); + m_Pitch->label(PitchLabel); + m_Pitch->value(11); + m_Pitch->callback((Fl_Callback*)cb_Pitch); + add(m_Pitch); + + // Andy Preston changed + // int k=4; + // m_Display[0] = new Fl_SevenSeg(10, 20, 30, 60); + // m_Display[0]->bar_width(k); + // m_Display[0]->color(FL_WHITE); + // m_Display[0]->color2(GUI_COLOUR); + // add(m_Display[0]); + // m_Display[1] = new Fl_SevenSeg(30, 20, 30, 60); + // m_Display[1]->bar_width(k); + // m_Display[1]->color(FL_WHITE); + // m_Display[1]->color2(GUI_COLOUR); + // add(m_Display[1]); + // m_Display[2] = new Fl_SevenSeg(60, 20, 30, 60); + // m_Display[2]->bar_width(k); + // m_Display[2]->color(FL_WHITE); + // m_Display[2]->color2(GUI_COLOUR); + // add(m_Display[2]); + // m_Display[3] = new Fl_SevenSeg(80, 20, 30, 60); + // m_Display[3]->bar_width(k); + // m_Display[3]->color(FL_WHITE); + // m_Display[3]->color2(GUI_COLOUR); + // add(m_Display[3]); + // m_Display[4] = new Fl_SevenSeg(110, 20, 30, 60); + // m_Display[4]->bar_width(k); + // m_Display[4]->color(FL_WHITE); + // m_Display[4]->color2(GUI_COLOUR); + // add(m_Display[4]); + // m_Display[5] = new Fl_SevenSeg(130, 20, 30, 60); + // m_Display[5]->bar_width(k); + // m_Display[5]->color(FL_WHITE); + // m_Display[5]->color2(GUI_COLOUR); + // add(m_Display[5]); + // to + for (int dis=0; dis<6; dis++) { + m_Display[dis] = new Fl_SevenSeg (5 + 28*dis, 20, 28, 60); + m_Display[dis] -> bar_width (4); + m_Display[dis] -> color (FL_WHITE); + m_Display[dis] -> color2 (GUI_COLOUR); + if (dis > 0 && dis % 2 == 0) m_Display[dis] -> dp (colon); + add (m_Display[dis]); + } + + m_Pos = new Fl_Slider(5,108,235,20,""); + m_Pos->type(FL_HORIZONTAL); + m_Pos->maximum(1); + m_Pos->callback((Fl_Callback*)cb_Pos); + add(m_Pos); + + end(); +} + +void StreamPluginGUI::SetTime(float t) +{ + m_Pos->value(t); + + m_Display[5]->value((int)(t*100)%10); + m_Display[4]->value((int)(t*10)%10); + + m_Display[3]->value((int)t%10); + m_Display[2]->value((int)(t/10)%6); + + m_Display[1]->value((int)(t/60)%10); + m_Display[0]->value((int)(t/600)%10); + redraw(); +} + + +void StreamPluginGUI::UpdateValues() +{ + m_Volume->value(m_Plugin->GetVolume()); + m_Pitch->value(m_Plugin->GetPitch()+10); + m_Loop->value(m_Plugin->GetLoop()); +} + +inline void StreamPluginGUI::cb_Load_i(Fl_Button* o, void* v) +{ + char *fn=fl_file_chooser("Load a sample", "{*.wav,*.WAV}", NULL); + + if (fn && fn!='\0') + { + m_Plugin->OpenStream(fn); + } +} +void StreamPluginGUI::cb_Load(Fl_Button* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_Load_i(o,v);} + +inline void StreamPluginGUI::cb_Volume_i(Fl_Knob* o, void* v) +{ m_Plugin->SetVolume(o->value()); } +void StreamPluginGUI::cb_Volume(Fl_Knob* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_Volume_i(o,v);} + +inline void StreamPluginGUI::cb_Pitch_i(Fl_Slider* o, void* v) +{ + m_Plugin->SetPitch(o->value()-10); + sprintf(PitchLabel,"%1.3f ",o->value()-10); + m_Pitch->label(PitchLabel); +} +void StreamPluginGUI::cb_Pitch(Fl_Slider* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_Pitch_i(o,v);} + +inline void StreamPluginGUI::cb_Loop_i(Fl_Button* o, void* v) +{ + float p=m_Plugin->GetPitch()*2; + m_Plugin->SetPitch(p); + sprintf(PitchLabel,"%1.3f ",p); + m_Pitch->label(PitchLabel); + m_Pitch->value(p+10); + redraw(); +} +void StreamPluginGUI::cb_Loop(Fl_Button* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_Loop_i(o,v);} + +inline void StreamPluginGUI::cb_Div_i(Fl_Button* o, void* v) +{ + float p=m_Plugin->GetPitch()/2.0f; + m_Plugin->SetPitch(p); + sprintf(PitchLabel,"%1.3f ",p); + m_Pitch->label(PitchLabel); + m_Pitch->value(p+10); + redraw(); +} +void StreamPluginGUI::cb_Div(Fl_Button* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_Div_i(o,v);} + +inline void StreamPluginGUI::cb_ToStart_i(Fl_Button* o, void* v) +{ m_Plugin->Restart(); } +void StreamPluginGUI::cb_ToStart(Fl_Button* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_ToStart_i(o,v);} + +inline void StreamPluginGUI::cb_Stop_i(Fl_Button* o, void* v) +{ m_Plugin->Stop(); } +void StreamPluginGUI::cb_Stop(Fl_Button* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_Stop_i(o,v);} + +inline void StreamPluginGUI::cb_Play_i(Fl_Button* o, void* v) +{ m_Plugin->Play(); } +void StreamPluginGUI::cb_Play(Fl_Button* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_Play_i(o,v);} + +inline void StreamPluginGUI::cb_Reset_i(Fl_Button* o, void* v) +{ + m_Plugin->SetPitch(1); + sprintf(PitchLabel,"%1.3f ",1.0); + m_Pitch->label(PitchLabel); + m_Pitch->value(11); + redraw(); +} +void StreamPluginGUI::cb_Reset(Fl_Button* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_Reset_i(o,v);} + +inline void StreamPluginGUI::cb_Nudge_i(Fl_Button* o, void* v) +{ + m_Plugin->Nudge(); +} +void StreamPluginGUI::cb_Nudge(Fl_Button* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_Nudge_i(o,v);} + +inline void StreamPluginGUI::cb_Pos_i(Fl_Slider* o, void* v) +{ m_Plugin->SetTime(o->value()); } +void StreamPluginGUI::cb_Pos(Fl_Slider* o, void* v) +{ ((StreamPluginGUI*)(o->parent()))->cb_Pos_i(o,v);} + diff --git a/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.h b/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.h new file mode 100644 index 0000000..fe6495f --- /dev/null +++ b/SpiralSound/Plugins/StreamPlugin/StreamPluginGUI.h @@ -0,0 +1,94 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include + +#include "StreamPlugin.h" +#include "../SpiralPluginGUI.h" +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_SevenSeg.H" + +#ifndef MixerGUI +#define MixerGUI + + +class StreamPluginGUI : public SpiralPluginGUI +{ +public: + StreamPluginGUI(int w, int h, StreamPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + void SetTime(float t); + void SetMaxTime(float t) { m_Pos->maximum(t); } + + StreamPlugin *m_Plugin; +private: + + Fl_Button* m_Load; + Fl_Knob* m_Volume; + Fl_Slider* m_Pitch; + Fl_Button* m_Loop; + + Fl_Button* m_ToStart; + Fl_Button* m_Stop; + Fl_Button* m_Play; + Fl_Button* m_Reset; + Fl_Button* m_Div; + Fl_Repeat_Button* m_Nudge; + Fl_Output* m_Pout; + + Fl_SevenSeg* m_Display[6]; + + Fl_Slider* m_Pos; + + //// Callbacks //// + inline void cb_Load_i(Fl_Button* o, void* v); + static void cb_Load(Fl_Button* o, void* v); + inline void cb_Volume_i(Fl_Knob* o, void* v); + static void cb_Volume(Fl_Knob* o, void* v); + inline void cb_Pitch_i(Fl_Slider* o, void* v); + static void cb_Pitch(Fl_Slider* o, void* v); + inline void cb_Loop_i(Fl_Button* o, void* v); + static void cb_Loop(Fl_Button* o, void* v); + inline void cb_Div_i(Fl_Button* o, void* v); + static void cb_Div(Fl_Button* o, void* v); + + inline void cb_ToStart_i(Fl_Button* o, void* v); + static void cb_ToStart(Fl_Button* o, void* v); + inline void cb_Stop_i(Fl_Button* o, void* v); + static void cb_Stop(Fl_Button* o, void* v); + inline void cb_Play_i(Fl_Button* o, void* v); + static void cb_Play(Fl_Button* o, void* v); + inline void cb_Reset_i(Fl_Button* o, void* v); + static void cb_Reset(Fl_Button* o, void* v); + inline void cb_Nudge_i(Fl_Button* o, void* v); + static void cb_Nudge(Fl_Button* o, void* v); + + inline void cb_Pos_i(Fl_Slider* o, void* v); + static void cb_Pos(Fl_Slider* o, void* v); + +}; + +#endif diff --git a/SpiralSound/Plugins/WaveShaperPlugin/Makefile.in b/SpiralSound/Plugins/WaveShaperPlugin/Makefile.in new file mode 100644 index 0000000..35f37ea --- /dev/null +++ b/SpiralSound/Plugins/WaveShaperPlugin/Makefile.in @@ -0,0 +1,170 @@ +############################################################################# +# Makefile for building WaveShaperPlugin.so +# Generated by tmake at 08:01, 2001/10/05 +# Project: WaveShaperPlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + WaveShaperPlugin.h \ + WaveShaperPluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + WaveShaperPlugin.C \ + WaveShaperPluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + WaveShaperPlugin.o \ + WaveShaperPluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = WaveShaperPlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: Makefile + +Makefile: WaveShaperPlugin.pro + tmake WaveShaperPlugin.pro -o Makefile + +dist: + $(TAR) WaveShaperPlugin.tar WaveShaperPlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) WaveShaperPlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +WaveShaperPlugin.o: WaveShaperPlugin.C \ + WaveShaperPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + WaveShaperPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + WaveShaperIcon.xpm + +WaveShaperPluginGUI.o: WaveShaperPluginGUI.C \ + WaveShaperPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + WaveShaperPlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperIcon.xpm b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperIcon.xpm new file mode 100644 index 0000000..86fbcbd --- /dev/null +++ b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperIcon.xpm @@ -0,0 +1,289 @@ +/* XPM */ +static char * WaveShaperIcon_xpm[] = { +"36 36 250 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #171800", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #BFBFBF", +"n c #111111", +"o c #000000", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #B8B8B8", +"N c #48445C", +"O c #2B2B2C", +"P c #686417", +"Q c #D3D3D3", +"R c #C1BEC9", +"S c #474060", +"T c #31294D", +"U c #716C85", +"V c #65607A", +"W c #625D78", +"X c #D5D4DB", +"Y c #F7F7F7", +"Z c #8B8B8B", +"` c #393643", +" . c #47415F", +".. c #9692A4", +"+. c #D9D8DE", +"@. c #F7F7F8", +"#. c #918DA0", +"$. c #B8B5C1", +"%. c #D1D1D1", +"&. c #252525", +"*. c #727175", +"=. c #FEFEFF", +"-. c #9D99AA", +";. c #DBD9E0", +">. c #E9E9E9", +",. c #CBCBCB", +"'. c #E0E0E0", +"). c #6C6C6C", +"!. c #515151", +"~. c #A6A6A7", +"{. c #827E93", +"]. c #615C77", +"^. c #EAEAED", +"/. c #DFDFE1", +"(. c #FFFF00", +"_. c #1E1D24", +":. c #9894A7", +"<. c #B1AEBB", +"[. c #69686F", +"}. c #969422", +"|. c #615C76", +"1. c #5F5A75", +"2. c #413E4D", +"3. c #1A1A1C", +"4. c #C3C1CB", +"5. c #9D9D9D", +"6. c #202020", +"7. c #383838", +"8. c #4C4C4C", +"9. c #C9C7D0", +"0. c #F1F1F1", +"a. c #F8F8F8", +"b. c #AEACB9", +"c. c #FEFEFE", +"d. c #1D1D1D", +"e. c #B7B5C1", +"f. c #9390A2", +"g. c #BBBBBB", +"h. c #414141", +"i. c #28272A", +"j. c #F4F4F6", +"k. c #605B76", +"l. c #736E86", +"m. c #D8D8D8", +"n. c #727272", +"o. c #848486", +"p. c #CCCBD3", +"q. c #747087", +"r. c #6D6881", +"s. c #1C1C1C", +"t. c #242424", +"u. c #656566", +"v. c #F6F6F6", +"w. c #E8E6EA", +"x. c #706B84", +"y. c #E3E1E6", +"z. c #474746", +"A. c #C8C8C8", +"B. c #373639", +"C. c #FDFCFE", +"D. c #ABA8B7", +"E. c #F1F0F3", +"F. c #6D6980", +"G. c #AEAEAE", +"H. c #95929E", +"I. c #5B5A5C", +"J. c #F7F6F7", +"K. c #F4F3F5", +"L. c #908C9F", +"M. c #C8C6D0", +"N. c #837E96", +"O. c #86868A", +"P. c #ECEBEE", +"Q. c #5B5571", +"R. c #646078", +"S. c #AFAFB0", +"T. c #454545", +"U. c #363636", +"V. c #7A7A7A", +"W. c #C8C8C9", +"X. c #212025", +"Y. c #969699", +"Z. c #FAFAFA", +"`. c #F8F8F9", +" + c #A29EAF", +".+ c #F7F6F8", +"++ c #F0F0F1", +"@+ c #B8B7B9", +"#+ c #E4E4E4", +"$+ c #FDFDFD", +"%+ c #A5A2B2", +"&+ c #3B3456", +"*+ c #A8A5B4", +"=+ c #525252", +"-+ c #848387", +";+ c #CDCDCD", +">+ c #8D899C", +",+ c #494262", +"'+ c #68627C", +")+ c #40395A", +"!+ c #ECECEC", +"~+ c #B4B5B5", +"{+ c #313232", +"]+ c #E3E3E3", +"^+ c #B1AEBC", +"/+ c #BDBBC6", +"(+ c #3C3556", +"_+ c #898599", +":+ c #EDEDED", +"<+ c #39393A", +"[+ c #333333", +"}+ c #F5F5F5", +"|+ c #2B2B2B", +"1+ c #2D2A3D", +"2+ c #B6B4C1", +"3+ c #F5F5F6", +"4+ c #605A76", +"5+ c #DAD8DF", +"6+ c #F5F4F6", +"7+ c #615B76", +"8+ c #524D6A", +"9+ c #E4E3E8", +"0+ c #D5D5D5", +"a+ c #1B1B1B", +"b+ c #303030", +"c+ c #AAABAB", +"d+ c #585464", +"e+ c #B0AEBB", +"f+ c #A29FAF", +"g+ c #E9E8E9", +"h+ c #787779", +"i+ c #2D2D2E", +"j+ c #595959", +"k+ c #FAFAFB", +"l+ c #807B92", +"m+ c #B0ADBB", +"n+ c #E8E7EB", +"o+ c #3A3258", +"p+ c #E6E5EA", +"q+ c #DFDEE3", +"r+ c #443E5E", +"s+ c #BAB8C4", +"t+ c #C1BFCA", +"u+ c #E0E0E5", +"v+ c #D0CED6", +"w+ c #362F52", +"x+ c #CECCD5", +"y+ c #413A5B", +"z+ c #6A657F", +"A+ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 6 ; m n o p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E o F G ; H ", +" I J ; ; K L 6 6 6 M N O 6 6 P 6 6 6 6 Q R S T U V ", +" W X ; ; ; ; Y Z 6 6 6 6 6 6 6 P 6 6 6 6 ` ...+.@.#. ", +" $.; ; ; ; ; ; = %.&.6 6 6 6 6 P 6 6 6 6 6 *.=.; ; -. ", +" ;.; ; >.Q h ,.'.).6 6 6 6 6 6 P 6 6 6 6 6 6 !.~.4 {. ", +" ].^.; /.6 6 6 6 6 6 6 6 6 6 6 6 (.(.6 6 6 6 6 6 _.:. ", +" U @ <.[.6 6 6 6 6 6 6 6 6 6 }.(.}.6 (.6 6 6 6 6 ", +" |.1.2.6 6 6 6 6 6 6 6 6 6 (.6 P 6 6 (.6 6 6 6 3. ", +" 4.; ; 5.6.6.7.8.6.6 6 6 6 6 (.6 P 6 6 (.6 6 6 6 6 ", +" 9.; ; 0.a.; ; ; P P P P P P (.P P P P (.P P P 6 6 ", +" b.; ; ; ; c.; ; d.6 6 6 6 6 (.6 P 6 6 6 (.6 6 (.6 e., ", +" f.; ; c.; : g.h.6 6 6 6 6 (.6 6 P 6 6 6 (.6 (.6 i.c.j.k. ", +" l.; ; ; m.n.6 6 6 6 6 6 6 (.6 6 P 6 6 6 6 (.}.6 o.; ; p.q. ", +" r.J ; : s.6 6 6 6 t.6 6 (.}.6 6 P 6 6 6 6 6 6 6 u.v.; ; w.x. ", +" y.; ; z.6 6 6 6 A.(.(.6 6 6 6 P 6 6 6 6 6 6 6 6 B.C.; ; > x. ", +" D.; E.F.6 6 6 G.c.; H.6 6 6 6 6 6 6 6 6 6 6 6 6 6 I.J.; ; K.L. ", +" x.M.! N.O.6 x ; ; P.Q.R.S.l T.6 6 6 U.V.W.X.6 6 6 6 Y.Z.; ; `.@ ", +" +.+++@+#+$+; %+&+*+; v.T.6 6 6 =+; ; -+6 6 6 6 6 ;+; ; = >+ ", +" ,+> ; ; ; ; ; ; '+)+; ; !+7.6 6 6 D ; ; ~+6 6 6 6 {+]+; ; ^+ ", +" > ; ; ; ; /+(+_+; ; :+<+6 6 6 [+; ; }+|+6 6 1+2+; 3+3 ", +" 4+5+= ; 6+7+8+9+; ; 0+a+6 6 6 b+; ; ; c+=+d+ ", +" e+4 f+ W ; ; ; g+h+b+6 i+j+; ; ; c.k+l+ ", +" m+; ; ; ; ; n+o+p+; ; ; ; = q+r+ ", +" s+t+u+4 ; ; v+w+x+; ; ; s _+S ", +" y+ z+A+_+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.C b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.C new file mode 100644 index 0000000..2797fc3 --- /dev/null +++ b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.C @@ -0,0 +1,204 @@ +/* WaveShaper Plugin Copyleft (C) 2001 Yves Usson + * for SpiralSynthModular + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "WaveShaperPlugin.h" +#include "WaveShaperPluginGUI.h" +#include +#include "WaveShaperIcon.xpm" + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new WaveShaperPlugin; +} + +char** GetIcon() +{ + return WaveShaperIcon_xpm; +} + +int GetID() +{ + return 0x0032; +} +} + +/////////////////////////////////////////////////////// + +WaveShaperPlugin::WaveShaperPlugin() +{ + m_PluginInfo.Name="WaveShaper"; + m_PluginInfo.Width=278; + m_PluginInfo.Height=260; + m_PluginInfo.NumInputs=1; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Input"); + m_PluginInfo.PortTips.push_back("Out"); + wt = new float[512]; + for (int i=0;i<512;i++) wt[i] = (i / 256.0 - 1.0); + m_Wave = 1; + for (int i=0;i<6;i++) m_Coefs[i] = 0.0; + m_Coefs[0] = 1.0; +} + +WaveShaperPlugin::~WaveShaperPlugin() +{ + delete [] wt; +} + +PluginInfo &WaveShaperPlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info = SpiralPlugin::Initialise(Host); + Calc(); + return Info; +} + +SpiralGUIType *WaveShaperPlugin::CreateGUI() +{ + m_GUI = new WaveShaperPluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void WaveShaperPlugin::Execute() +{ + float k1,k2; + if (!InputExists(0)) return; + for (int i=0;iBUFSIZE;i++) + { + float v = GetInput(0,i); + int index = (short)(256.0*v)+256; + // short rm = v - ((index-256)*(long)SpiralInfo::MAXSAMPLE)/256; + if (index<0) index=0; + if (index>511) index=511; + // k1 = rm / (SpiralInfo::MAXSAMPLE/256.0); + // v = (short)(k1*(wt[index]-wt[index+1])+wt[index+1]); + SetOutput(0,i,wt[index]); + } +} + +void WaveShaperPlugin::Calc(void) + +{ +int i; +float xx,x,y,max; + + if (m_Wave) + { + max = 1.0; + for (i=0;i<512;i++) + { + x = i / 256.0 - 1.0; + y = 0; + xx = x; + for (int j=1; j<7; j++) + { + y += m_Coefs[j-1] * xx; + xx *= x; + } + y = fabs(y); + max = max > y? max:y; + } + for (i=0;i<512;i++) + { + x = i / 256.0 - 1.0; + y = 0; + xx = x; + for (int j=1; j<7; j++) + { + y += m_Coefs[j-1] * xx; + xx *= x; + } + y /= max; + set(i,y); + } + } + else + { + max = 1.0; + for (i=0;i<512;i++) + { + x = (i / 256.0 - 1.0)*M_PI; + y = 0; + for (int j=1; j<7; j++) + y += m_Coefs[j-1] * sin(x*(1+(j-1)*3)); + y = fabs(y); + max = max > y? max:y; + } + for (i=0;i<512;i++) + { + x = (i / 256.0 - 1.0)*M_PI; + y = 0; + for (int j=1; j<7; j++) + y += m_Coefs[j-1] * sin(x*(1+(j-1)*3)); + y /= max; + set(i,y); + } + } +} + +float WaveShaperPlugin::Get(int index) + +{ + if ((index < 0) || (index > 511)) return 0; + return wt[index]; +} + +void WaveShaperPlugin::set(int index,float v) + +{ + if ((index < 0) || (index > 511)) return; + if (v > 1.0f) v = 1.0f; + if (v < -1.0f) v = -1.0f; + wt[index] = v; +} + +void WaveShaperPlugin::SetCoef(int index,float v){ + if ((index < 0) || (index > 5)) return; + m_Coefs[index] = v; +} + +void WaveShaperPlugin::SetWaveType(int t){ + m_Wave = t; +} + +float WaveShaperPlugin::GetCoef(int index){ + if ((index < 0) || (index > 5)) return 0; + return m_Coefs[index]; +} + +int WaveShaperPlugin::GetWaveType(){ + return m_Wave; +} + +void WaveShaperPlugin::StreamOut(ostream &s) +{ + s<>version>>m_Wave; + for (int i=0;i<6;i++) s>>m_Coefs[i]; + Calc(); +} + diff --git a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.h b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.h new file mode 100644 index 0000000..c082d2e --- /dev/null +++ b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.h @@ -0,0 +1,59 @@ +/* WaveShaper Plugin Copyleft (C) 2001 Yves Usson + * for SpiralSynthModular + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef WaveShaperPLUGIN +#define WaveShaperPLUGIN + +class WaveShaperPlugin : public SpiralPlugin +{ +public: + WaveShaperPlugin(); + virtual ~WaveShaperPlugin(); + + virtual PluginInfo& Initialise(const HostInfo *Host); + virtual SpiralGUIType* CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void Calc(void); + float Get(int); + void SetCoef(int,float); + void SetWaveType(int); + float GetCoef(int); + int GetWaveType(void); +private: + float *wt; + float m_Coefs[6]; + int m_Wave; + void set(int,float); + friend istream &operator>>(istream &s, WaveShaperPlugin &o); + friend ostream &operator<<(ostream &s, WaveShaperPlugin &o); +}; + +istream &operator>>(istream &s, WaveShaperPlugin &o); +ostream &operator<<(ostream &s, WaveShaperPlugin &o); + +#endif diff --git a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.pro b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.pro new file mode 100644 index 0000000..e1e7a88 --- /dev/null +++ b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + WaveShaperPlugin.h \ + WaveShaperPluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + WaveShaperPlugin.C \ + WaveShaperPluginGUI.C + +TARGET = WaveShaperPlugin.so diff --git a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPluginGUI.C b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPluginGUI.C new file mode 100644 index 0000000..8e7938b --- /dev/null +++ b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPluginGUI.C @@ -0,0 +1,184 @@ +/* WaveShaper Plugin Copyleft (C) 2001 Yves Usson + * for SpiralSynthModular +/ * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "WaveShaperPluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; +FunctionPlot::FunctionPlot(int ox,int oy,int ww,int hh): Fl_Widget(ox,oy,ww,hh) { + fval = new float[256]; + for (int i=0;i<256;i++) fval[i] = i / 128.0 - 1.0; +} + +FunctionPlot::~FunctionPlot() { + delete [] fval; +} + +void FunctionPlot::draw() { + int ox = x() + 3; +int oy = y() +3; +int ww = w() - 6; +int hh = h() - 6; +float coefx,coefy; + + draw_box(); + fl_clip(ox,oy,ww,hh); + coefx = ww / 256.0; + coefy = hh / 2.0; + for (int i = -5; i < 5; i++) + { + if (i==0) fl_color(FL_BLUE); else fl_color(FL_CYAN); + fl_line(ox,oy+hh/2+i*hh/10,ox+ww,oy+hh/2+i*hh/10); + } + for (int i = -5; i < 5; i++) + { + if (i==0) fl_color(FL_BLUE); else fl_color(FL_CYAN); + fl_line(ox+i*ww/10+ww/2,oy,ox+i*ww/10+ww/2,oy+hh); + } + fl_color(FL_RED); + float y1 = oy+hh/2-coefy*fval[0]; + for (int i = 0; i < 255; i++) + { + float y2 = oy+hh/2-coefy*fval[i+1]; + fl_line((int)(ox+i*coefx),(int)y1,(int)(ox+(i+1)*coefx),(int)y2); + y1 = y2; + } + fl_color(FL_BLACK); + fl_pop_clip(); +} + +int FunctionPlot::handle(int event) { + return 0; +} + +void FunctionPlot::set(const int index,const float v) { + if ((index < 0) || (index > 255)) return; + fval[index] = v; + if (fval[index] > 1.0f) fval[index] = 1.0f; + if (fval[index] < -1.0f) fval[index] = -1.0f; +} + +float FunctionPlot::get(const int index) const { + if ((index < 0) || (index > 255)) return (-10.0f); + return fval[index]; +} + + +//////////////////////////////////////////// + +WaveShaperPluginGUI::WaveShaperPluginGUI(int w, int h,WaveShaperPlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + fplot = new FunctionPlot(3, 20, 268, 195); + fplot->box(FL_ENGRAVED_BOX); + fplot->color(7); + + radio_polynomial = new Fl_Round_Button(3, 218, 30, 20, "S"); + radio_polynomial->down_box(FL_ROUND_DOWN_BOX); + radio_polynomial->value(1); + radio_polynomial->type(102); + radio_polynomial->labelfont(12); + radio_polynomial->labelsize(12); + radio_polynomial->callback((Fl_Callback*)cb_radio); + + radio_sines = new Fl_Round_Button(3, 238, 30, 20, "S"); + radio_sines->down_box(FL_ROUND_DOWN_BOX); + radio_sines->value(0); + radio_sines->type(102); + radio_sines->labelfont(12); + radio_sines->labelsize(12); + radio_sines->callback((Fl_Callback*)cb_radio); + + { Fl_Box* o = new Fl_Box(26, 218, 25, 20, "a .x"); + o->labelfont(2); + o->labelsize(10); + } + { Fl_Box* o = new Fl_Box(33, 227, 10, 15, "i"); + o->labelfont(2); + o->labelsize(10); + } + { Fl_Box* o = new Fl_Box(47, 217, 10, 15, "i"); + o->labelfont(2); + o->labelsize(10); + } + { Fl_Box* o = new Fl_Box(31, 246, 10, 15, "i"); + o->labelfont(2); + o->labelsize(10); + } + { Fl_Box* o = new Fl_Box(36, 237, 25, 20, "a .sin i x"); + o->labelfont(2); + o->labelsize(10); + } + + for (int i=0;i<6;i++) + { + knob[i] = new Fl_Knob(70+i*35, 220, 30, 30); + knob[i]->labelsize(10); + knob[i]->minimum(-1); + knob[i]->step(0.01); + knob[i]->value(0); + knob[i]->color(GUI_COLOUR); + knob[i]->callback((Fl_Callback*)cb_knob); + knob[i]->type(Fl_Knob::DOTLIN); + } + knob[0]->value(1.0); + end(); +} + + + +void WaveShaperPluginGUI::UpdateValues() +{ + int wt = m_Plugin->GetWaveType(); + radio_polynomial->value(wt); + radio_sines->value(!wt); + for (int j=0; j<6; j++) knob[j]->value(m_Plugin->GetCoef(j)); + knobCB(); +} + +inline void WaveShaperPluginGUI::cb_radio_i(Fl_Round_Button*, void*) { + m_Plugin->SetWaveType(radio_polynomial->value()); + knobCB(); +} +void WaveShaperPluginGUI::cb_radio(Fl_Round_Button* o, void* v) { + ((WaveShaperPluginGUI*)(o->parent()))->cb_radio_i(o,v); +} + +inline void WaveShaperPluginGUI::cb_knob_i(Fl_Knob*, void*) { + for (int j=0; j<6; j++) m_Plugin->SetCoef(j,knob[j]->value()); + knobCB(); +} +void WaveShaperPluginGUI::cb_knob(Fl_Knob* o, void* v) { + ((WaveShaperPluginGUI*)(o->parent()))->cb_knob_i(o,v); +} + +void WaveShaperPluginGUI::knobCB() { +int i; + + m_Plugin->Calc(); + for (i=0;i<256;i++) + { + fplot->set(i,m_Plugin->Get(i*2)); + } + fplot->redraw(); +} diff --git a/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPluginGUI.h b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPluginGUI.h new file mode 100644 index 0000000..269cd18 --- /dev/null +++ b/SpiralSound/Plugins/WaveShaperPlugin/WaveShaperPluginGUI.h @@ -0,0 +1,71 @@ +/* WaveShaper Plugin Copyleft (C) 2001 Yves Usson + * for SpiralSynthModular + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../Widgets/Fl_DragBar.H" +#include "WaveShaperPlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef WaveShaperGUI +#define WaveShaperGUI + +class FunctionPlot : public Fl_Widget { +public: + FunctionPlot(int ox,int oy,int ww,int hh); + ~FunctionPlot(); +private: + float *fval; + void draw(); + int handle(int event); +public: + void set(const int index,const float v); + float get(const int index) const; +}; + +class WaveShaperPluginGUI : public SpiralPluginGUI +{ +public: + WaveShaperPluginGUI(int w, int h, WaveShaperPlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + WaveShaperPlugin *m_Plugin; +private: + FunctionPlot *fplot; + Fl_Round_Button *radio_polynomial; + Fl_Round_Button *radio_sines; + Fl_Knob *knob[6]; + + //// Callbacks //// + inline void cb_radio_i(Fl_Round_Button*, void*); + static void cb_radio(Fl_Round_Button* o, void* v); + inline void cb_knob_i(Fl_Knob*, void*); + static void cb_knob(Fl_Knob* o, void* v); + void knobCB(); +}; + +#endif diff --git a/SpiralSound/Plugins/WaveTablePlugin/Makefile.in b/SpiralSound/Plugins/WaveTablePlugin/Makefile.in new file mode 100644 index 0000000..d896548 --- /dev/null +++ b/SpiralSound/Plugins/WaveTablePlugin/Makefile.in @@ -0,0 +1,166 @@ +############################################################################# +# Makefile for building WaveTablePlugin.so +# Generated by tmake at 22:13, 2001/09/17 +# Project: WaveTablePlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + WaveTablePlugin.h \ + WaveTablePluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + WaveTablePlugin.C \ + WaveTablePluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + WaveTablePlugin.o \ + WaveTablePluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = WaveTablePlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake WaveTablePlugin.pro + +dist: + $(TAR) WaveTablePlugin.tar WaveTablePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) WaveTablePlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +WaveTablePlugin.o: WaveTablePlugin.C \ + WaveTablePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + WaveTablePluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +WaveTablePluginGUI.o: WaveTablePluginGUI.C \ + WaveTablePluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + WaveTablePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h + diff --git a/SpiralSound/Plugins/WaveTablePlugin/SpiralIcon.xpm b/SpiralSound/Plugins/WaveTablePlugin/SpiralIcon.xpm new file mode 100644 index 0000000..1dd6f9b --- /dev/null +++ b/SpiralSound/Plugins/WaveTablePlugin/SpiralIcon.xpm @@ -0,0 +1,309 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 270 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #D3D3D3", +"R c #C1BEC9", +"S c #474060", +"T c #31294D", +"U c #716C85", +"V c #65607A", +"W c #625D78", +"X c #D5D4DB", +"Y c #F7F7F7", +"Z c #8B8B8B", +"` c #161616", +" . c #0C0C0C", +".. c #060606", +"+. c #393643", +"@. c #47415F", +"#. c #9692A4", +"$. c #D9D8DE", +"%. c #F7F7F8", +"&. c #918DA0", +"*. c #B8B5C1", +"=. c #D1D1D1", +"-. c #252525", +";. c #727175", +">. c #FEFEFF", +",. c #9D99AA", +"'. c #DBD9E0", +"). c #E9E9E9", +"!. c #CBCBCB", +"~. c #E0E0E0", +"{. c #6C6C6C", +"]. c #515151", +"^. c #A6A6A7", +"/. c #827E93", +"(. c #615C77", +"_. c #EAEAED", +":. c #DFDFE1", +"<. c #F4FD00", +"[. c #1E1D24", +"}. c #9894A7", +"|. c #B1AEBB", +"1. c #69686F", +"2. c #000001", +"3. c #615C76", +"4. c #5F5A75", +"5. c #413E4D", +"6. c #020203", +"7. c #1A1A1C", +"8. c #C3C1CB", +"9. c #9D9D9D", +"0. c #202020", +"a. c #383838", +"b. c #4C4C4C", +"c. c #111112", +"d. c #C9C7D0", +"e. c #F1F1F1", +"f. c #F8F8F8", +"g. c #232323", +"h. c #050408", +"i. c #AEACB9", +"j. c #FEFEFE", +"k. c #1D1D1D", +"l. c #B7B5C1", +"m. c #9390A2", +"n. c #BBBBBB", +"o. c #414141", +"p. c #030303", +"q. c #28272A", +"r. c #F4F4F6", +"s. c #605B76", +"t. c #736E86", +"u. c #D8D8D8", +"v. c #727272", +"w. c #101010", +"x. c #848486", +"y. c #CCCBD3", +"z. c #747087", +"A. c #6D6881", +"B. c #1C1C1C", +"C. c #242424", +"D. c #656566", +"E. c #F6F6F6", +"F. c #E8E6EA", +"G. c #706B84", +"H. c #E3E1E6", +"I. c #474746", +"J. c #151515", +"K. c #C8C8C8", +"L. c #AEAEAE", +"M. c #080808", +"N. c #373639", +"O. c #FDFCFE", +"P. c #ABA8B7", +"Q. c #F1F0F3", +"R. c #6D6980", +"S. c #0A090E", +"T. c #95929E", +"U. c #0A0810", +"V. c #050505", +"W. c #5B5A5C", +"X. c #F7F6F7", +"Y. c #F4F3F5", +"Z. c #908C9F", +"`. c #C8C6D0", +" + c #837E96", +".+ c #86868A", +"++ c #070608", +"@+ c #ECEBEE", +"#+ c #5B5571", +"$+ c #646078", +"%+ c #AFAFB0", +"&+ c #454545", +"*+ c #363636", +"=+ c #7A7A7A", +"-+ c #C8C8C9", +";+ c #212025", +">+ c #060607", +",+ c #969699", +"'+ c #FAFAFA", +")+ c #F8F8F9", +"!+ c #A29EAF", +"~+ c #F7F6F8", +"{+ c #F0F0F1", +"]+ c #B8B7B9", +"^+ c #E4E4E4", +"/+ c #FDFDFD", +"(+ c #A5A2B2", +"_+ c #3B3456", +":+ c #A8A5B4", +"<+ c #525252", +"[+ c #848387", +"}+ c #CDCDCD", +"|+ c #8D899C", +"1+ c #494262", +"2+ c #68627C", +"3+ c #40395A", +"4+ c #ECECEC", +"5+ c #020202", +"6+ c #B4B5B5", +"7+ c #0B0B0B", +"8+ c #313232", +"9+ c #E3E3E3", +"0+ c #B1AEBC", +"a+ c #BDBBC6", +"b+ c #3C3556", +"c+ c #898599", +"d+ c #EDEDED", +"e+ c #39393A", +"f+ c #040404", +"g+ c #333333", +"h+ c #F5F5F5", +"i+ c #2B2B2B", +"j+ c #2D2A3D", +"k+ c #B6B4C1", +"l+ c #F5F5F6", +"m+ c #605A76", +"n+ c #DAD8DF", +"o+ c #F5F4F6", +"p+ c #615B76", +"q+ c #524D6A", +"r+ c #E4E3E8", +"s+ c #D5D5D5", +"t+ c #1B1B1B", +"u+ c #303030", +"v+ c #AAABAB", +"w+ c #585464", +"x+ c #B0AEBB", +"y+ c #A29FAF", +"z+ c #E9E8E9", +"A+ c #787779", +"B+ c #0F0E15", +"C+ c #2D2D2E", +"D+ c #595959", +"E+ c #FAFAFB", +"F+ c #807B92", +"G+ c #B0ADBB", +"H+ c #E8E7EB", +"I+ c #3A3258", +"J+ c #E6E5EA", +"K+ c #DFDEE3", +"L+ c #443E5E", +"M+ c #BAB8C4", +"N+ c #C1BFCA", +"O+ c #E0E0E5", +"P+ c #D0CED6", +"Q+ c #362F52", +"R+ c #CECCD5", +"S+ c #413A5B", +"T+ c #6A657F", +"U+ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 6 6 M Q R S T U V ", +" W X ; ; ; ; Y Z ` 6 .6 6 6 6 6 6 6 6 ..+.@.#.$.%.&. ", +" *.; ; ; ; ; ; = =.-.6 6 6 6 6 6 6 6 6 6 E ;.>.; ; ,. ", +" '.; ; ).Q h !.~.{.6 6 6 6 6 6 6 6 6 6 6 6 E ].^.4 /. ", +" (._.; :. .6 6 6 6 6 6 6 <.<.<.6 <.<.<.6 <.<.6 6 [.}. ", +" U @ |.1.2.6 6 6 6 6 6 6 <.6 <.6 <.6 <.6 <.6 6 6 ", +" 3.4.5.6 6.6 6 6 6 6 <.<.6 <.<.<.6 <.<.<.6 6 6 7. ", +" 8.; ; 9.0.0.a.b.0.6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 c. ", +" d.; ; e.f.; ; ; g.6 6 6 6 <.6 6 6 <.6 6 6 <.6 6 h. ", +" i.; ; ; ; j.; ; k.6 6 6 <.6 <.6 <.6 <.6 <.6 6 6 6 l., ", +" m.; ; j.; : n.o.p.6 6 <.6 6 6 <.6 6 6 <.6 6 6 6 q.j.r.s. ", +" t.; ; ; u.v.w.6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 x.; ; y.z. ", +" A.J ; : B.6 6 6 6 C. .6 6 6 6 6 6 6 6 6 6 6 6 6 D.E.; ; F.G. ", +" H.; ; I.6 E 6 J.K.L.M.6 6 6 6 6 6 6 6 6 6 6 6 6 N.O.; ; > G. ", +" P.; Q.R.S.6 6 L.j.; T.U.6 6 6 6 6 6 6 6 m V.6 6 6 W.X.; ; Y.Z. ", +" G.`.! +.+++x ; ; @+#+$+%+l &+6 6 6 *+=+-+;+6 6 6 >+,+'+; ; )+@ ", +" !+~+{+]+^+/+; (+_+:+; E.&+6 6 E <+; ; [+6 6 E 6 o }+; ; = |+ ", +" 1+> ; ; ; ; ; ; 2+3+; ; 4+a.6 6 5+D ; ; 6+7+6 6 6 8+9+; ; 0+ ", +" > ; ; ; ; a+b+c+; ; d+e+6 6 f+g+; ; h+i+6 6 j+k+; l+3 ", +" m+n+= ; o+p+q+r+; ; s+t+6 6 5+u+; ; ; v+<+w+ ", +" x+4 y+ W ; ; ; z+A+u+B+C+D+; ; ; j.E+F+ ", +" G+; ; ; ; ; H+I+J+; ; ; ; = K+L+ ", +" M+N+O+4 ; ; P+Q+R+; ; ; s c+S ", +" S+ T+U+c+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.C b/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.C new file mode 100644 index 0000000..df66210 --- /dev/null +++ b/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.C @@ -0,0 +1,210 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include "WaveTablePlugin.h" +#include "WaveTablePluginGUI.h" +#include +#include "SpiralIcon.xpm" + +static const int IN_FREQ = 0; +static const int IN_PW = 1; +static const int IN_SHLEN = 2; + +static const int OUT_MAIN = 0; + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new WaveTablePlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x0017; +} +} + +/////////////////////////////////////////////////////// + +WaveTablePlugin::WaveTablePlugin() : +m_Type(SINE), +m_Octave(0), +m_FineFreq(1.0f), +m_ModAmount(1.0f), +m_TableLength(DEFAULT_TABLE_LEN) +{ + + m_CyclePos=0; + m_Note=0; + + m_PluginInfo.Name="WaveTable"; + m_PluginInfo.Width=245; + m_PluginInfo.Height=110; + m_PluginInfo.NumInputs=1; + m_PluginInfo.NumOutputs=1; + m_PluginInfo.PortTips.push_back("Frequency CV"); + m_PluginInfo.PortTips.push_back("Output"); +} + +WaveTablePlugin::~WaveTablePlugin() +{ +} + +PluginInfo &WaveTablePlugin::Initialise(const HostInfo *Host) +{ + PluginInfo& Info= SpiralPlugin::Initialise(Host); + + for (int n=0; nhide(); + return m_GUI; +} + +void WaveTablePlugin::WriteWaves() +{ + float RadCycle = (M_PI/180)*360; + float Pos=0; + + for (int n=0; nBUFSIZE; n++) + { + SetOutput(OUT_MAIN,n,0); + + if (InputExists(0)) + { + Freq=GetInputPitch(0,n); + Freq*=m_ModAmount; + } + else + { + Freq=110; + } + + Freq*=m_FineFreq; + if (m_Octave>0) Freq*=1<<(m_Octave); + if (m_Octave<0) Freq/=1<<(-m_Octave); + + Incr = Freq*(m_TableLength/(float)m_HostInfo->SAMPLERATE); + m_CyclePos+=Incr; + while (m_CyclePos>=m_TableLength) m_CyclePos-=m_TableLength; + + if (m_CyclePos<0 || m_CyclePos>=m_TableLength) m_CyclePos=0; + + SetOutput(OUT_MAIN,n,m_Table[m_Type][m_CyclePos]); + } + +} + +void WaveTablePlugin::StreamOut(ostream &s) +{ + s<>version>>*this; +} + +istream &operator>>(istream &s, WaveTablePlugin &o) +{ + s>>(int&)o.m_Type>>o.m_Octave>>o.m_FineFreq>>o.m_ModAmount; + return s; +} + +ostream &operator<<(ostream &s, WaveTablePlugin &o) +{ + s<<(int)o.m_Type<<" "< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef WaveTablePLUGIN +#define WaveTablePLUGIN + +static const int NUM_TABLES = 8; +static const int DEFAULT_TABLE_LEN = 1024; + +class WaveTablePlugin : public SpiralPlugin +{ +public: + WaveTablePlugin(); + virtual ~WaveTablePlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + enum Type{SINE,SQUARE,SAW,REVSAW,TRIANGLE,PULSE1,PULSE2,INVSINE}; + + void WriteWaves(); + + void NoteTrigger(int V,int s,int v); + void SetOctave(int o) {m_Octave=o;} + void SetFineFreq(float s) {m_FineFreq=s;} + void SetType(Type t) {m_Type=t;} + void SetModAmount(float s) {m_ModAmount=s;} + int GetOctave() {return m_Octave;} + float GetFineFreq() {return m_FineFreq;} + Type GetType() {return m_Type;} + float GetModAmount() {return m_ModAmount;} + +private: + + // Voice specific parameter + int m_Note; + float m_CyclePos; + + // Common voice parameters + Type m_Type; + int m_Octave; + float m_FineFreq; + float m_ModAmount; + + Sample m_Table[NUM_TABLES]; + int m_TableLength; + + friend istream &operator>>(istream &s, WaveTablePlugin &o); + friend ostream &operator<<(ostream &s, WaveTablePlugin &o); +}; + +istream &operator>>(istream &s, WaveTablePlugin &o); +ostream &operator<<(ostream &s, WaveTablePlugin &o); + +#endif diff --git a/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.pro b/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.pro new file mode 100644 index 0000000..257a97c --- /dev/null +++ b/SpiralSound/Plugins/WaveTablePlugin/WaveTablePlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + WaveTablePlugin.h \ + WaveTablePluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + WaveTablePlugin.C \ + WaveTablePluginGUI.C + +TARGET = WaveTablePlugin.so diff --git a/SpiralSound/Plugins/WaveTablePlugin/WaveTablePluginGUI.C b/SpiralSound/Plugins/WaveTablePlugin/WaveTablePluginGUI.C new file mode 100644 index 0000000..818bc9c --- /dev/null +++ b/SpiralSound/Plugins/WaveTablePlugin/WaveTablePluginGUI.C @@ -0,0 +1,499 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "WaveTablePluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +static unsigned char *image_Square[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" ...... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ... . ... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ...... ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_Saw[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" .. ", +(unsigned char*)" .. ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ... . .... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" .. ", +(unsigned char*)" .. ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_RevSaw[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" .. ", +(unsigned char*)" .. ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ... . .... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" .. ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_Tri[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" . ", +(unsigned char*)" . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . ", +(unsigned char*)" . ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_Sine[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" .. ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . . ", +(unsigned char*)" . . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" .. ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_Pulse1[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" .... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ... . ... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ........ ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_Pulse2[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" ........ ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ... . ... ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" .... ", +(unsigned char*)" ", +(unsigned char*)" "}; + +static unsigned char *image_InvSine[] = { +(unsigned char*)"20 20 2 1", +(unsigned char*)" \tc None", +(unsigned char*)".\tc #000000", +(unsigned char*)" ", +(unsigned char*)" ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" .. .. ", +(unsigned char*)" .. .. ", +(unsigned char*)" . . . . ", +(unsigned char*)" . .. . ", +(unsigned char*)" . . ", +(unsigned char*)" . . . ", +(unsigned char*)" . . ", +(unsigned char*)" . .. . ", +(unsigned char*)" . . . . ", +(unsigned char*)" .. .. ", +(unsigned char*)" .. .. ", +(unsigned char*)" . . ", +(unsigned char*)" . . ", +(unsigned char*)" ", +(unsigned char*)" "}; + +WaveTablePluginGUI::WaveTablePluginGUI(int w, int h,WaveTablePlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o), +pixmap_Square(image_Square), +pixmap_Saw(image_Saw), +pixmap_RevSaw(image_RevSaw), +pixmap_Tri(image_Tri), +pixmap_Sine(image_Sine), +pixmap_Pulse1(image_Pulse1), +pixmap_Pulse2(image_Pulse2), +pixmap_InvSine(image_InvSine) +{ + m_Plugin=o; + + ShapeSine = new Fl_Check_Button(5, 15, 55, 30); + ShapeSine->type(102); + ShapeSine->down_box(FL_DIAMOND_DOWN_BOX); + ShapeSine->selection_color(GUI_COLOUR); + pixmap_Sine.label(ShapeSine); + ShapeSine->set(); + ShapeSine->callback((Fl_Callback*)cb_Sine); + + ShapeSquare = new Fl_Check_Button(5, 35, 55, 30); + ShapeSquare->type(102); + ShapeSquare->down_box(FL_DIAMOND_DOWN_BOX); + ShapeSquare->selection_color(GUI_COLOUR); + pixmap_Square.label(ShapeSquare); + ShapeSquare->callback((Fl_Callback*)cb_Square); + + ShapeSaw = new Fl_Check_Button(5, 55, 55, 30); + ShapeSaw->type(102); + ShapeSaw->down_box(FL_DIAMOND_DOWN_BOX); + ShapeSaw->selection_color(GUI_COLOUR); + pixmap_Saw.label(ShapeSaw); + ShapeSaw->callback((Fl_Callback*)cb_Saw); + + ShapeRevSaw = new Fl_Check_Button(5, 75, 55, 30); + ShapeRevSaw->type(102); + ShapeRevSaw->down_box(FL_DIAMOND_DOWN_BOX); + ShapeRevSaw->selection_color(GUI_COLOUR); + pixmap_RevSaw.label(ShapeRevSaw); + ShapeRevSaw->callback((Fl_Callback*)cb_RevSaw); + + ShapeTri = new Fl_Check_Button(55, 15, 55, 30); + ShapeTri->type(102); + ShapeTri->down_box(FL_DIAMOND_DOWN_BOX); + ShapeTri->selection_color(GUI_COLOUR); + pixmap_Tri.label(ShapeTri); + ShapeTri->callback((Fl_Callback*)cb_Tri); + + Pulse1 = new Fl_Check_Button(55, 35, 55, 30); + Pulse1->type(102); + Pulse1->down_box(FL_DIAMOND_DOWN_BOX); + Pulse1->selection_color(GUI_COLOUR); + pixmap_Pulse1.label(Pulse1); + Pulse1->callback((Fl_Callback*)cb_Pulse1); + + Pulse2 = new Fl_Check_Button(55, 55, 55, 30); + Pulse2->type(102); + Pulse2->down_box(FL_DIAMOND_DOWN_BOX); + Pulse2->selection_color(GUI_COLOUR); + pixmap_Pulse2.label(Pulse2); + Pulse2->callback((Fl_Callback*)cb_Pulse2); + + ShapeInvSine = new Fl_Check_Button(55, 75, 55, 30); + ShapeInvSine->type(102); + ShapeInvSine->down_box(FL_DIAMOND_DOWN_BOX); + ShapeInvSine->selection_color(GUI_COLOUR); + pixmap_InvSine.label(ShapeInvSine); + ShapeInvSine->callback((Fl_Callback*)cb_InvSine); + + + + Freq = new Fl_Knob(188, 2, 40, 40, "Octave"); + Freq->color(GUI_COLOUR); + Freq->type(Fl_Knob::LINELIN); + Freq->labelsize(10); + Freq->maximum(6); + Freq->step(1); + Freq->value(3); + Freq->scaleticks(6); + Freq->cursor(50); + Freq->callback((Fl_Callback*)cb_Freq); + + FineTune = new Fl_Knob(112, 22, 65, 65, "Fine Tune"); + FineTune->color(GUI_COLOUR); + FineTune->type(Fl_Knob::LINELIN); + FineTune->labelsize(10); + FineTune->scaleticks(20); + FineTune->maximum(1.414); + FineTune->step(0.000001); + FineTune->value(1); + FineTune->callback((Fl_Callback*)cb_FineTune); + + ModAmount = new Fl_Knob(188, 54, 40, 40, "Mod Depth"); + ModAmount->color(GUI_COLOUR); + ModAmount->type(Fl_Knob::LINELIN); + ModAmount->labelsize(10); + ModAmount->maximum(2.0f); + ModAmount->step(0.001); + ModAmount->value(1.0); + ModAmount->callback((Fl_Callback*)cb_ModAmount); + + m_pop = new Fl_Button(1,h-14, 13, 13, "@>"); + m_pop->type(1); + m_pop->box(FL_FLAT_BOX); + m_pop->down_box(FL_FLAT_BOX); + //m_pop->labeltype(FL_ICON_LABEL); + m_pop->labelsize(10); + m_pop->labelcolor(25); + m_pop->callback((Fl_Callback*)cb_pop); + + m_out_freq = new Fl_Output(65,h+5, 58, 15, "Frequency"); + m_out_freq->box(FL_ENGRAVED_BOX); + m_out_freq->color(16); + m_out_freq->labelsize(10); + m_out_freq->textsize(10); + m_out_freq->hide(); + m_out_freq->set_output(); + + m_out_mod = new Fl_Output(188,h+5, 48, 15, "Modulation"); + m_out_mod->box(FL_ENGRAVED_BOX); + m_out_mod->color(16); + m_out_mod->labelsize(10); + m_out_mod->textsize(10); + m_out_mod->hide(); + m_out_mod->set_output(); + + end(); +} + +extern "C" int sprintf(char *,const char *,...); + +void WaveTablePluginGUI::UpdateValues() +{ + ShapeSquare->value(0); + ShapeRevSaw->value(0); + ShapeSaw->value(0); + ShapeTri->value(0); + ShapeSine->value(0); + Pulse1->value(0); + Pulse2->value(0); + ShapeInvSine->value(0); + + switch (m_Plugin->GetType()) + { + case WaveTablePlugin::SQUARE : ShapeSquare->value(1); break; + case WaveTablePlugin::SINE : ShapeSine->value(1); break; + case WaveTablePlugin::SAW : ShapeSaw->value(1); break; + case WaveTablePlugin::REVSAW : ShapeRevSaw->value(1); break; + case WaveTablePlugin::TRIANGLE : ShapeTri->value(1); break; + case WaveTablePlugin::PULSE1 : Pulse1->value(1); break; + case WaveTablePlugin::PULSE2 : Pulse2->value(1); break; + case WaveTablePlugin::INVSINE : ShapeInvSine->value(1); break; + } + + Freq->value(m_Plugin->GetOctave()+3); + ModAmount->value(m_Plugin->GetModAmount()); + FineTune->value(sqrt(m_Plugin->GetFineFreq())); + + char str[10]; + float fr = 110.0f * m_Plugin->GetFineFreq(); + int oc = m_Plugin->GetOctave(); + if (oc > 0) fr *= 1 << oc; + if (oc < 0) fr /= 1 << (-oc); + sprintf(str,"%4.1f Hz", fr); + m_out_freq->value(str); + sprintf(str,"%4.0f %%", 100*m_Plugin->GetModAmount()); + m_out_mod->value(str); +} + + +//// Callbacks //// + +inline void WaveTablePluginGUI::cb_Freq_i(Fl_Knob* o, void* v) +{ +char str[10]; + m_Plugin->SetOctave((int)o->value()-3); + float fr = 110.0f * m_Plugin->GetFineFreq(); + int oc = m_Plugin->GetOctave(); + if (oc > 0) fr *= 1 << oc; + if (oc < 0) fr /= 1 << (-oc); + sprintf(str,"%4.1f Hz", fr); + m_out_freq->value(str); +} +void WaveTablePluginGUI::cb_Freq(Fl_Knob* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_Freq_i(o,v); } + +inline void WaveTablePluginGUI::cb_FineTune_i(Fl_Knob* o, void* v) +{ char str[10]; + m_Plugin->SetFineFreq(o->value()*o->value()); + float fr = 110.0f * m_Plugin->GetFineFreq(); + int oc = m_Plugin->GetOctave(); + if (oc > 0) fr *= 1 << oc; + if (oc < 0) fr /= 1 << (-oc); + sprintf(str,"%4.1f Hz", fr); + m_out_freq->value(str); +} +void WaveTablePluginGUI::cb_FineTune(Fl_Knob* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_FineTune_i(o,v); } + +inline void WaveTablePluginGUI::cb_Square_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(WaveTablePlugin::SQUARE); } +void WaveTablePluginGUI::cb_Square(Fl_Check_Button* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_Square_i(o,v); } + +inline void WaveTablePluginGUI::cb_Saw_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(WaveTablePlugin::SAW); } +void WaveTablePluginGUI::cb_Saw(Fl_Check_Button* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_Saw_i(o,v); } + +inline void WaveTablePluginGUI::cb_Sine_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(WaveTablePlugin::SINE); } +void WaveTablePluginGUI::cb_Sine(Fl_Check_Button* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_Sine_i(o,v); } + +inline void WaveTablePluginGUI::cb_RevSaw_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(WaveTablePlugin::REVSAW); } +void WaveTablePluginGUI::cb_RevSaw(Fl_Check_Button* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_RevSaw_i(o,v); } + +inline void WaveTablePluginGUI::cb_Tri_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(WaveTablePlugin::TRIANGLE); } +void WaveTablePluginGUI::cb_Tri(Fl_Check_Button* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_Tri_i(o,v); } + +inline void WaveTablePluginGUI::cb_Pulse1_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(WaveTablePlugin::PULSE1); } +void WaveTablePluginGUI::cb_Pulse1(Fl_Check_Button* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_Pulse1_i(o,v); } + +inline void WaveTablePluginGUI::cb_Pulse2_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(WaveTablePlugin::PULSE2); } +void WaveTablePluginGUI::cb_Pulse2(Fl_Check_Button* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_Pulse2_i(o,v); } + +inline void WaveTablePluginGUI::cb_InvSine_i(Fl_Check_Button* o, void* v) +{ m_Plugin->SetType(WaveTablePlugin::INVSINE); } +void WaveTablePluginGUI::cb_InvSine(Fl_Check_Button* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_InvSine_i(o,v); } + +inline void WaveTablePluginGUI::cb_ModAmount_i(Fl_Knob* o, void* v) +{ +char str[10]; + m_Plugin->SetModAmount(o->value()); + sprintf(str,"%4.0f %%", 100*o->value()); + m_out_mod->value(str); +} + +void WaveTablePluginGUI::cb_ModAmount(Fl_Knob* o, void* v) +{ ((WaveTablePluginGUI*)(o->parent()))->cb_ModAmount_i(o,v); } + +inline void WaveTablePluginGUI::cb_pop_i(Fl_Button *o, void*) { + if (o->value()) + { + o->label("@2>"); + m_out_freq->show(); + m_out_mod->show(); + redraw(); + } + else + { + o->label("@>"); + m_out_freq->hide(); + m_out_mod->hide(); + redraw(); + parent()->redraw(); + + } +} +void WaveTablePluginGUI::cb_pop(Fl_Button* o, void* v) { + ((WaveTablePluginGUI*)(o->parent()))->cb_pop_i(o,v); +} + diff --git a/SpiralSound/Plugins/WaveTablePlugin/WaveTablePluginGUI.h b/SpiralSound/Plugins/WaveTablePlugin/WaveTablePluginGUI.h new file mode 100644 index 0000000..e31722a --- /dev/null +++ b/SpiralSound/Plugins/WaveTablePlugin/WaveTablePluginGUI.h @@ -0,0 +1,96 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include + +#include "../Widgets/Fl_Knob.H" +#include "../SpiralPluginGUI.h" +#include "WaveTablePlugin.h" + +#ifndef SCOPEGUI +#define SCOPEGUI + +class WaveTablePluginGUI : public SpiralPluginGUI +{ +public: + WaveTablePluginGUI(int w, int h, WaveTablePlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + WaveTablePlugin *m_Plugin; + +private: + + Fl_Check_Button *ShapeSquare; + Fl_Pixmap pixmap_Square; + Fl_Check_Button *ShapeSaw; + Fl_Pixmap pixmap_Saw; + Fl_Check_Button *ShapeRevSaw; + Fl_Pixmap pixmap_RevSaw; + Fl_Check_Button *ShapeTri; + Fl_Pixmap pixmap_Tri; + Fl_Check_Button *ShapeSine; + Fl_Pixmap pixmap_Sine; + Fl_Check_Button *Pulse1; + Fl_Pixmap pixmap_Pulse1; + Fl_Check_Button *Pulse2; + Fl_Pixmap pixmap_Pulse2; + Fl_Check_Button *ShapeInvSine; + Fl_Pixmap pixmap_InvSine; + + Fl_Knob *Freq; + Fl_Knob *ModAmount; + Fl_Knob *FineTune; + Fl_Button *m_pop; + Fl_Output *m_out_freq; + Fl_Output *m_out_mod; + + //// Callbacks //// + inline void cb_Freq_i(Fl_Knob* o, void* v); + static void cb_Freq(Fl_Knob*, void*); + inline void cb_FineTune_i(Fl_Knob* o, void* v); + static void cb_FineTune(Fl_Knob* o, void* v); + inline void cb_ModAmount_i(Fl_Knob* o, void* v); + static void cb_ModAmount(Fl_Knob* o, void* v); + + inline void cb_Square_i(Fl_Check_Button* o, void* v); + static void cb_Square(Fl_Check_Button*, void*); + inline void cb_Saw_i(Fl_Check_Button* o, void* v); + static void cb_Saw(Fl_Check_Button*, void*); + inline void cb_Sine_i(Fl_Check_Button* o, void* v); + static void cb_Sine(Fl_Check_Button* o, void* v); + inline void cb_RevSaw_i(Fl_Check_Button* o, void* v); + static void cb_RevSaw(Fl_Check_Button* o, void* v); + inline void cb_Tri_i(Fl_Check_Button* o, void* v); + static void cb_Tri(Fl_Check_Button* o, void* v); + inline void cb_Pulse1_i(Fl_Check_Button* o, void* v); + static void cb_Pulse1(Fl_Check_Button* o, void* v); + inline void cb_Pulse2_i(Fl_Check_Button* o, void* v); + static void cb_Pulse2(Fl_Check_Button* o, void* v); + inline void cb_InvSine_i(Fl_Check_Button* o, void* v); + static void cb_InvSine(Fl_Check_Button* o, void* v); + inline void cb_pop_i(Fl_Button* o, void*); + static void cb_pop(Fl_Button* o, void*); +}; + +#endif diff --git a/SpiralSound/Plugins/Widgets/Fl_DragBar.H b/SpiralSound/Plugins/Widgets/Fl_DragBar.H new file mode 100644 index 0000000..792f60b --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_DragBar.H @@ -0,0 +1,24 @@ +// generated by Fast Light User Interface Designer (fluid) version 1.0010 + +#ifndef Fl_DragBar_H +#define Fl_DragBar_H +#include +#include +#include +#include +#include + +class Fl_DragBar : public Fl_Widget { + int old_rx,old_ry; + int _type; +public: + enum DragType {WINDRAG=0,NICEWINDRAG,FLDRAG,NICEFLDRAG}; + Fl_DragBar(int x,int y,int w,int h,const char *l=0); + ~Fl_DragBar(); +private: + void draw(); + int handle(int event); +public: + void type(int t); +}; +#endif diff --git a/SpiralSound/Plugins/Widgets/Fl_DragBar.cxx b/SpiralSound/Plugins/Widgets/Fl_DragBar.cxx new file mode 100644 index 0000000..ac46519 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_DragBar.cxx @@ -0,0 +1,162 @@ +// generated by Fast Light User Interface Designer (fluid) version 1.0010 + +#include "Fl_DragBar.H" + +Fl_DragBar::Fl_DragBar(int x,int y,int w,int h,const char *l): Fl_Widget(x,y,w,h,l) { + _type = Fl_DragBar::NICEFLDRAG; +} + +Fl_DragBar::~Fl_DragBar() { +} + +void Fl_DragBar::draw() { + int ww,hh; + uchar r,g,b; + uchar rb,gb,bb; + uchar rd,gd,bd; + int val; + + draw_box(); + int x1 = x()+5; + int x2 = x()+w()-5; + int y1 = y()+5; + int y2 = y()+h()-5; + Fl::get_color(color(),r,g,b); + val = (int)r + 64; rb = val > 255 ? 255:val; + val = (int)g + 64; gb = val > 255 ? 255:val; + val = (int)b + 64; bb = val > 255 ? 255:val; + val = (int)r - 64; rd = val < 0 ? 0:val; + val = (int)g - 64; gd = val < 0 ? 0:val; + val = (int)b - 64; bd = val < 0 ? 0:val; + if (h()show(); + fl_cursor(FL_CURSOR_MOVE); + if (_type < (int)Fl_DragBar::FLDRAG) + { + old_rx = rx - window()->x(); + old_ry = ry - window()->y(); + } + else + { + old_rx = rx - parent()->x(); + old_ry = ry - parent()->y(); + } + return 1; + } + case FL_RELEASE: + { + fl_cursor(FL_CURSOR_DEFAULT); + do_callback(); + return 1; + } + case FL_DRAG: + { + if ((rx != old_rx) || (ry != old_ry)) + { + xx = rx - old_rx; + yy = ry - old_ry; + if (_type < (int)Fl_DragBar::FLDRAG) + { + window()->position(xx,yy); + } + else + { + parent()->position(xx,yy); + if (parent()->parent()) + parent()->parent()->redraw(); + else + window()->redraw(); + } + } + return 1; + } + case FL_MOVE: + { + return 0; + } + case FL_ENTER : + { + return 0; + } + + case FL_LEAVE : + { + fl_cursor(FL_CURSOR_DEFAULT); + return 1; + } + default : + return 0; + } +} + +void Fl_DragBar::type(int t) { + _type = t; +} diff --git a/SpiralSound/Plugins/Widgets/Fl_DragBar.fld b/SpiralSound/Plugins/Widgets/Fl_DragBar.fld new file mode 100644 index 0000000..c008883 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_DragBar.fld @@ -0,0 +1,180 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0010 +header_name {.H} +code_name {.cxx} +gridx 2 +gridy 2 +snap 1 +decl {\#include } {public +} + +decl {\#include } {public +} + +decl {\#include } {public +} + +class Fl_DragBar {open : {public Fl_Widget} +} { + decl {int old_rx,old_ry;} {} + decl {int _type;} {} + decl {enum DragType {WINDRAG=0,NICEWINDRAG,FLDRAG,NICEFLDRAG};} {public + } + Function {Fl_DragBar(int x,int y,int w,int h,const char *l=0): Fl_Widget(x,y,w,h,l)} {open + } { + code {_type = Fl_DragBar::NICEFLDRAG;} {} + } + Function {~Fl_DragBar()} {} {} + Function {draw()} {private + } { + code {int ww,hh; + uchar r,g,b; + uchar rb,gb,bb; + uchar rd,gd,bd; + int val; + + draw_box(); + int x1 = x()+5; + int x2 = x()+w()-5; + int y1 = y()+5; + int y2 = y()+h()-5; + Fl::get_color(color(),r,g,b); + val = (int)r + 64; rb = val > 255 ? 255:val; + val = (int)g + 64; gb = val > 255 ? 255:val; + val = (int)b + 64; bb = val > 255 ? 255:val; + val = (int)r - 64; rd = val < 0 ? 0:val; + val = (int)g - 64; gd = val < 0 ? 0:val; + val = (int)b - 64; bd = val < 0 ? 0:val; + if (h()show(); + fl_cursor(FL_CURSOR_MOVE); + if (_type < (int)Fl_DragBar::FLDRAG) + { + old_rx = rx - window()->x(); + old_ry = ry - window()->y(); + } + else + { + old_rx = rx - parent()->x(); + old_ry = ry - parent()->y(); + } + return 1; + } + case FL_RELEASE: + { + fl_cursor(FL_CURSOR_DEFAULT); + do_callback(); + return 1; + } + case FL_DRAG: + { + if ((rx != old_rx) || (ry != old_ry)) + { + xx = rx - old_rx; + yy = ry - old_ry; + if (_type < (int)Fl_DragBar::FLDRAG) + { + window()->position(xx,yy); + } + else + { + parent()->position(xx,yy); + if (parent()->parent()) + parent()->parent()->redraw(); + else + window()->redraw(); + } + } + return 1; + } + case FL_MOVE: + { + return 0; + } + case FL_ENTER : + { + return 0; + } + + case FL_LEAVE : + { + fl_cursor(FL_CURSOR_DEFAULT); + return 1; + } + default : + return 0; + }} {} + } + Function {type(int t)} {} { + code {_type = t;} {} + } +} diff --git a/SpiralSound/Plugins/Widgets/Fl_EventMap.C b/SpiralSound/Plugins/Widgets/Fl_EventMap.C new file mode 100644 index 0000000..62861b2 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_EventMap.C @@ -0,0 +1,494 @@ +/* EventMap Widget + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl_EventMap.h" +#include +#include +#include +#include + +static const int AREA_WIDTH = 1000; +static const int AREA_HEIGHT = 1000; +static const int BUTTON_COLOUR = 10; + +static const int EVENT_COLOUR = 0; + +static const int BG_COLOUR = 139; +static const int LINE_COLOUR = 140; + +//////////////////////////////////////////////////////////////////// + +Fl_EventMap::Fl_EventMap(int x, int y, int w, int h, const char* label) : +Fl_Group(x,y,w,h,label), +m_SeqPointer(NULL), +m_Type(ARRANGE_MAP), +m_Update(true), +m_Zoom(1.0f), +m_GridSizeX(0), +m_GridSizeY(10), +m_PixelsPerSec(100), +m_NextID(0), +m_StartLoop(1.0f), +m_EndLoop(2.0f), +m_Pos(0), +m_LastPos(0), +m_DrawBeats(false), +m_BarLength(100), +m_BeatsBar(8), +cb_NewEvent(NULL), +cb_RightMouse(NULL), +cb_CopyEvent(NULL), +m_FirstUpdate(true) +{ + // white/black keys for the melody + m_KeyColMap[0] = FL_YELLOW; + m_KeyColMap[1] = FL_BLUE; + m_KeyColMap[2] = FL_YELLOW; + m_KeyColMap[3] = FL_BLUE; + m_KeyColMap[4] = FL_YELLOW; + m_KeyColMap[5] = FL_BLUE; + m_KeyColMap[6] = FL_YELLOW; + m_KeyColMap[7] = FL_YELLOW; + m_KeyColMap[8] = FL_BLUE; + m_KeyColMap[9] = FL_YELLOW; + m_KeyColMap[10] = FL_BLUE; + m_KeyColMap[11] = FL_YELLOW; +} + + + +void Fl_EventMap::CreateWindow() +{ + int yoff=0; + + //m_StartTri = new Fl_TriEvent(90, 5, 20, 10, ""); + //m_StartTri->LockY(); + //m_StartTri->SetResizeGrab(0); + //m_StartTri->SetPixelsPerSec(m_PixelsPerSec,true); + + m_PosTri = new Fl_TriEvent(90, 5, 30, 20, ""); + m_PosTri->LockY(); + m_PosTri->SetResizeGrab(0); + m_PosTri->SetPixelsPerSec(m_PixelsPerSec,true); + + m_EndTri = new Fl_TriEvent(50, 5, 20, 10, ""); + m_EndTri->LockY(); + m_EndTri->SetResizeGrab(0); + m_EndTri->SetPixelsPerSec(m_PixelsPerSec,true); + + show(); +} + +void Fl_EventMap::draw() +{ + clear_damage(FL_DAMAGE_ALL); + + fl_color(BG_COLOUR); + fl_rectf(x(),y(),w(),h()); + // draw the section markers + fl_color(LINE_COLOUR); + + if (m_GridSizeY) + { + // draw the snap points + for (int n=y(); nGetStartTime(); + //m_EndLoop=m_EndTri->GetStartTime(); + + int StartPixels=(int)(m_StartLoop*(float)m_PixelsPerSec)+x(); + int EndPixels=(int)(m_EndLoop*(float)m_PixelsPerSec)+x(); + + fl_line(StartPixels,y()+15,StartPixels,y()+h()); + fl_line(EndPixels,y()+15,EndPixels,y()+h()); + } + + Fl_Group::draw(); + + SetFirstUpdate(); +} + +int Fl_EventMap::handle(int event) +{ + if (!Fl_Group::handle(event) && event==FL_PUSH) + { + if (m_Type!=ARRANGE_MAP) + { + AddEvent(Fl::event_x(),Fl::event_y(),20, Fl_SEvent::NO_TYPE); + } + } + + for (map::iterator i=m_EventMap.begin(); + i!=m_EventMap.end(); i++) + { + Fl_SEvent *pEvent = i->second; + + if (pEvent->Killed()) + { + RemoveEvent(i->first); + } + } + + return event; +} + +void Fl_EventMap::SetZoomLevel(float s) +{ + m_Zoom=s; + m_PixelsPerSec=int(100/m_Zoom); + + vector EventVec; + for (map::iterator i=m_EventMap.begin(); + i!=m_EventMap.end(); i++) + { + i->second->SetPixelsPerSec(m_PixelsPerSec); + } + + //m_StartTri->SetPixelsPerSec(m_PixelsPerSec); + m_EndTri->SetPixelsPerSec(m_PixelsPerSec); + + redraw(); +} + +void Fl_EventMap::SetSnapGap(float s) +{ + m_GridSizeX=(int)(s*(float)m_PixelsPerSec); + + for (map::iterator i=m_EventMap.begin(); + i!=m_EventMap.end(); i++) + { + i->second->SetSnapGap(s); + } + + redraw(); +} + +vector Fl_EventMap::GetEvents(float Time) +{ + assert(m_PixelsPerSec!=0); + m_Pos = (int)(Time*m_PixelsPerSec); + + // line marker update + // all in all, some orrible code... + if (m_Update && window()->visible() && m_Pos!=m_LastPos) + { + window()->make_current(); + int DrawPos=m_Pos+x(); + + m_PosTri->resize(DrawPos,m_PosTri->y(),m_PosTri->w(),m_PosTri->h()); + redraw(); + +/* if (DrawPos>m_ClipX && DrawPosmake_current(); + } + m_FirstUpdate=false; + + vector EventVec; + for (map::iterator i=m_EventMap.begin(); + i!=m_EventMap.end(); i++) + { + Fl_SEvent *pEvent = i->second; + + bool State=pEvent->UpdateState(Time); + + EventInfo::Type type=EventInfo::ON; + + if (pEvent->AtStart()) type=EventInfo::START; + if (pEvent->AtEnd()) type=EventInfo::END; + + // Collect the events happening now, or just finished + if(State || pEvent->AtEnd()) + { + EventVec.push_back(EventInfo(pEvent->GetID(),pEvent->GetGroup(), + type,pEvent->GetStartTime())); + } + } + return EventVec; +} + +int Fl_EventMap::GetGroupFromY(int y) +{ + return y/m_GridSizeY; +} + +int Fl_EventMap::AddEventTime(float st, int g, float lt, Fl_SEvent::Type EType, bool CallBack) +{ + int ex,ey,ew; + ex=(int)(st*(float)m_PixelsPerSec)+x(); + ew=(int)(lt*(float)m_PixelsPerSec); + ey=g*m_GridSizeY+y(); + + return AddEvent(ex, ey, ew, EType, CallBack); +} + +int Fl_EventMap::AddEvent(int x, int y, int w, Fl_SEvent::Type EType, bool CallBack) +{ + Fl_SEvent *NewEvent; + if (m_Type==PERCUSSION_MAP) + { + NewEvent = new Fl_CircEvent(x,y,w,m_GridSizeY); + } + else + { + NewEvent = new Fl_SEvent(x,y,w,m_GridSizeY); + } + + if (m_Type==MELODY_MAP) NewEvent->LockResize(false); + + NewEvent->SetPixelsPerSec(m_PixelsPerSec, true); + NewEvent->color(EVENT_COLOUR); + NewEvent->labelsize(10); + NewEvent->SetID(m_NextID++); + NewEvent->SetType(EType); + char Name[256]; + if (m_Type==ARRANGE_MAP) + { + if(NewEvent->GetType()==Fl_SEvent::MELODY) + sprintf(Name,"Melody %d",NewEvent->GetID()); + + if(NewEvent->GetType()==Fl_SEvent::PERCUSSION) + sprintf(Name,"Percussion %d",NewEvent->GetID()); + + } + else sprintf(Name,"This shouldnt be read!"); + + NewEvent->SetName(Name); + NewEvent->SetGridX(m_GridSizeX); + NewEvent->SetGridY(m_GridSizeY); + + map::iterator i=m_EventMap.find(NewEvent->GetID()); + if (i!=m_EventMap.end()) + { + cerr<<"Event ID not unique, not added!"<SnapX(); + NewEvent->SnapY(); + + NewEvent->SetPixelsPerSec(m_PixelsPerSec,true); + + m_EventMap[NewEvent->GetID()]=NewEvent; + + int ID = NewEvent->GetID(); + if (cb_NewEvent && CallBack) cb_NewEvent(NewEvent,&ID); + + redraw(); + return NewEvent->GetID(); +} + +void Fl_EventMap::CopyEvent(int x, int y, int w, int ID, float LengthTime) +{ + // make the new widget + int NewID = AddEvent(x,y,w,m_EventMap[ID]->GetType(),false); + + // set the length of time exactly, as rounding + // errors cause a reinit of the sample memory + GetEvent(NewID)->SetLengthTime(LengthTime); + + //string Name="Copy of "+m_EventMap[ID]->GetName(); + //GetEvent(NewID)->SetName(Name); + + GetEvent(NewID)->SetName(m_EventMap[ID]->GetName()); + + if (cb_CopyEvent) cb_CopyEvent(GetEvent(NewID),&ID); +} + +void Fl_EventMap::RemoveAllEvents() +{ + for (map::iterator i=m_EventMap.begin(); + i!=m_EventMap.end(); i++) + { + Fl_SEvent *e=i->second; + remove(e); + m_EventMap.erase(i); + delete(e); + } + m_EventMap.clear(); + m_NextID=0; + + redraw(); +} + +void Fl_EventMap::RemoveEvent(int ID) +{ + map::iterator i=m_EventMap.find(ID); + if (i==m_EventMap.end()) + { + cerr<<"Event ID not found to delete"<second; + remove(e); + m_EventMap.erase(i); + delete(e); +} + +Fl_SEvent *Fl_EventMap::GetEvent(int ID) +{ + map::iterator i=m_EventMap.find(ID); + if (i==m_EventMap.end()) + { + cerr<<"Event ID not found"<SetLengthTime(l); +} + +void Fl_EventMap::CopyFrom(Fl_EventMap *Other) +{ + m_Type = Other->m_Type; + m_Zoom = Other->m_Zoom; + m_GridSizeX = Other->m_GridSizeX; + m_GridSizeY = Other->m_GridSizeY; + m_PixelsPerSec = Other->m_PixelsPerSec; + m_StartLoop = Other->m_StartLoop; + m_EndLoop = Other->m_EndLoop; + m_Pos = Other->m_Pos; + m_LastPos = Other->m_LastPos; + m_BarLength = Other->m_BarLength; + m_BeatsBar = Other->m_BeatsBar; + m_NextID = Other->m_NextID; + + for (map::iterator i=Other->m_EventMap.begin(); + i!=Other->m_EventMap.end(); i++) + { + Fl_SEvent *NewEvent; + + if (m_Type==PERCUSSION_MAP) + { + NewEvent = new Fl_CircEvent(*(Fl_CircEvent*)i->second); + } + else + { + NewEvent = new Fl_SEvent(*i->second); + } + + add(NewEvent); + m_EventMap[NewEvent->GetID()]=NewEvent; + } +} + +///////////////////////////////////////////////////// + +istream &operator>>(istream &s, Fl_EventMap &o) +{ + string dummy; + s>>dummy; + if (dummy!="EventMap") cerr<<"Error in stream before Fl_EventMap"<>(int&)o.m_Type; + s>>o.m_Zoom; + s>>o.m_GridSizeX; + s>>o.m_GridSizeY; + s>>o.m_PixelsPerSec; + s>>o.m_StartLoop; + s>>o.m_EndLoop; + s>>o.m_Pos; + s>>o.m_LastPos; + s>>o.m_BarLength; + s>>o.m_BeatsBar; + + int Num; + + s>>Num; + float st,lt; + int g,t; + + for (int n=0; n>st>>g>>lt>>t; + o.AddEventTime(st,g,lt,(Fl_SEvent::Type)(t), false); + } + + return s; +} + +ostream &operator<<(ostream &s, Fl_EventMap &o) +{ + s<<"EventMap "; + s<<(int)o.m_Type<<" "; + s<::iterator i=o.m_EventMap.begin(); + i!=o.m_EventMap.end(); i++) + { + s<second->GetStartTime()<<" "<second->GetGroup()<<" "<< + i->second->GetLengthTime()<<" "<<(int)(i->second->GetType())<<" "; + } + s< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include "Fl_SEvent.h" + + +#ifndef EVENTMAP +#define EVENTMAP + +using namespace std; + +///////////////////////////////////////////////////////// + +class EventInfo +{ +public: + enum Type{START,ON,END}; + + EventInfo(int ID, int Group, Type t, float s) + {m_ID=ID; m_Group=Group; m_Type=t; m_SectionStart=s;} + int m_ID; + int m_Group; + Type m_Type; + float m_SectionStart; +}; + +///////////////////////////////////////////////////////// + +class Fl_EventMap : public Fl_Group +{ +public: + + enum ModeType {ARRANGE_MAP,MELODY_MAP,PERCUSSION_MAP}; + + Fl_EventMap(int x, int y, int w, int h, const char* label=0); + + virtual void draw(); + virtual int handle(int event); + void CreateWindow(); + + vector GetEvents(float Time); + + void SetUpdate(bool s) {m_Update=s;} + void SetZoomLevel(float s); + void SetGridSizeX(int s) { m_GridSizeX=s; } + void SetGridSizeY(int s) { m_GridSizeY=s; } + + void SetType(ModeType s) { m_Type=s; } + ModeType GetType() { return m_Type; } + + // Sort this hideaous mess out!! + void SetSeq(void* s) { m_SeqPointer=s; } + void *GetSeq() { return m_SeqPointer; } + float GetStartTime() { return m_StartLoop;} + float GetEndTime() { return m_EndLoop;} + void SetEndTime(float s) { m_EndLoop=s;} + void SetBeatsBar(int s) { m_BeatsBar=s; redraw();} + void SetBarLength(float s) { m_BarLength=s; redraw(); } + void SetSnapGap(float s); +// void SetKeyColMap(int *s) { m_KeyColMap=s; } + int *GetKeyColMap() { return m_KeyColMap; } + int GetX() { return x(); } + int GetY() { return y(); } + void SetUpdateLineClip(int X, int Y, int W, int H) + { m_ClipX=X; m_ClipY=Y; m_ClipW=W; m_ClipH=H; } + void DrawBeats(bool s) { m_DrawBeats=s; redraw(); } + int AddEventTime(float st, int g, float lt, Fl_SEvent::Type EType, bool CallBack=true); + void SetEventLength(int ID, float l); + int AddEvent(int x, int y, int w, Fl_SEvent::Type EType, bool CallBack=true); + void CopyEvent(int x, int y, int w, int ID, float LengthTime); + void RemoveAllEvents(); + void RemoveEvent(int ID); + Fl_SEvent *GetEvent(int ID); + void CopyFrom(Fl_EventMap *Other); + + void SetNewEventCallback(Fl_Callback* s) { cb_NewEvent=s; } + void SetCopyEventCallback(Fl_Callback* s) { cb_CopyEvent=s; } + void SetRightMouseCallback(Fl_Callback* s) { cb_RightMouse=s; } + + void TriggerStart(); + void TriggerEnd(); + + void SetFirstUpdate() { m_FirstUpdate=true; } + +protected: + + int GetGroupFromY(int y); + +private: + + void *m_SeqPointer; + + ModeType m_Type; + + bool m_Update; + float m_Zoom; + int m_GridSizeX; + int m_GridSizeY; + int m_PixelsPerSec; + int m_NextID; + float m_StartLoop; + float m_EndLoop; + int m_Pos; + int m_LastPos; + + bool m_DrawBeats; + float m_BarLength; + int m_BeatsBar; + + int m_ClipX,m_ClipY,m_ClipW,m_ClipH; + + Fl_TriEvent *m_StartTri; + Fl_TriEvent *m_PosTri; + Fl_TriEvent *m_EndTri; + + int m_KeyColMap[12]; + + map m_EventMap; + + void (*cb_NewEvent)(Fl_Widget*, void*); +public: + // needed to be called by the event widgets + void (*cb_RightMouse)(Fl_Widget*, void*); + void (*cb_CopyEvent)(Fl_Widget*, void*); +private: + + bool m_FirstUpdate; + + friend istream &operator>>(istream &s, Fl_EventMap &o); + friend ostream &operator<<(ostream &s, Fl_EventMap &o); +}; + +istream &operator>>(istream &s, Fl_EventMap &o); +ostream &operator<<(ostream &s, Fl_EventMap &o); + +#endif diff --git a/SpiralSound/Plugins/Widgets/Fl_Knob.H b/SpiralSound/Plugins/Widgets/Fl_Knob.H new file mode 100644 index 0000000..f2b5f86 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_Knob.H @@ -0,0 +1,33 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#ifndef Fl_Knob_H +#define Fl_Knob_H +#include +#include +#include + +class Fl_Knob : public Fl_Valuator { +public: + enum Fl_Knobtype {DOTLIN=0,DOTLOG_1,DOTLOG_2,DOTLOG_3,LINELIN,LINELOG_1,LINELOG_2,LINELOG_3,NONE}; +private: + int _type; + float _percent; + int _scaleticks; + short a1,a2; +public: + Fl_Knob(int xx,int yy,int ww,int hh,const char *l=0); + ~Fl_Knob(); +private: + void draw(); + int handle(int event); +public: + void type(int ty); +private: + void shadow(const int offs,const uchar r,uchar g,uchar b); + void draw_scale(const int ox,const int oy,const int side); + void draw_cursor(const int ox,const int oy,const int side); +public: + void cursor(const int pc); + void scaleticks(const int tck); +}; +#endif diff --git a/SpiralSound/Plugins/Widgets/Fl_Knob.cxx b/SpiralSound/Plugins/Widgets/Fl_Knob.cxx new file mode 100644 index 0000000..8bd4189 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_Knob.cxx @@ -0,0 +1,268 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#include "Fl_Knob.H" +#include +#include +#include + +Fl_Knob::Fl_Knob(int xx,int yy,int ww,int hh,const char *l): Fl_Valuator(xx,yy,ww,hh,l) { + a1 = 35; + a2 = 325; + _type = DOTLIN; + _percent = 0.3; + _scaleticks = 10; +} + +Fl_Knob::~Fl_Knob() { +} + +void Fl_Knob::draw() { + int ox,oy,ww,hh,side; +float sa,ca,a_r; +unsigned char rr,gg,bb; + + ox = x(); + oy = y(); + ww = w(); + hh = h(); + draw_label(); + fl_clip(ox,oy,ww,hh); + if (ww > hh) + { + side = hh; + ox = ox + (ww - side) / 2; + } + else + { + side = ww; + oy = oy + (hh - side) / 2; + } + side = w() > h () ? hh:ww; + int dam = damage(); + if (dam & FL_DAMAGE_ALL) + { + int col = parent()->color(); + fl_color(col); + fl_rectf(ox,oy,side,side); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(-60,rr,gg,bb); + fl_pie(ox+9,oy+9,side-12,side-12,0,360); + if (_type!=NONE) draw_scale(ox,oy,side); + col = color(); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,40,80); + shadow(30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,80,220); + shadow(-15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,220,260); + shadow(-30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,260,400); + fl_color(FL_BLACK); + fl_arc(ox+6,oy+6,side-11,side-11,0,360); + fl_color(col); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + else + { + fl_color(color()); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + Fl::get_color((Fl_Color)color(),rr,gg,bb); + shadow(10,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,110,150); + fl_pie(ox+10,oy+10,side-20,side-20,290,330); + shadow(17,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,120,140); + fl_pie(ox+10,oy+10,side-20,side-20,300,320); + shadow(25,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,127,133); + fl_pie(ox+10,oy+10,side-20,side-20,307,313); + draw_cursor(ox,oy,side); + fl_pop_clip(); +} + +int Fl_Knob::handle(int event) { + int ox,oy,ww,hh; + + ox = x() + 10; oy = y() + 10; + ww = w() - 20; + hh = h()-20; + switch (event) + { + case FL_PUSH: + handle_push(); + case FL_DRAG: + { + int mx = Fl::event_x()-ox-ww/2; + int my = Fl::event_y()-oy-hh/2; + if (!mx && !my) return 1; + double angle = 270-atan2((float)-my, (float)mx)*180/M_PI; + double oldangle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + while (angle < oldangle-180) angle += 360; + while (angle > oldangle+180) angle -= 360; + double val; + if ((a1= a1)) + { + val = minimum(); + } + else + if ((a1= a2) : (angle <= a2)) + { + val = maximum(); + } + else + { + val = minimum() + (maximum()-minimum())*(angle-a1)/(a2-a1); + } + handle_drag(clamp(round(val))); + } + return 1; + case FL_RELEASE: + handle_release(); + return 1; + default: + return 0; + } + return 0; +} + +void Fl_Knob::type(int ty) { + _type = ty; +} + +void Fl_Knob::shadow(const int offs,const uchar r,uchar g,uchar b) { + int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb); +} + +void Fl_Knob::draw_scale(const int ox,const int oy,const int side) { + float x1,y1,x2,y2,rds,cx,cy,ca,sa; + + rds = side / 2; + cx = ox + side / 2; + cy = oy + side / 2; + if (!(_type & DOTLOG_3)) + { + if (_scaleticks == 0) return; + double a_step = (10.0*3.14159/6.0) / _scaleticks; + double a_orig = -(3.14159/3.0); + for (int a = 0; a <= _scaleticks; a++) + { + double na = a_orig + a * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx + rds * ca; + y1 = cy - rds * sa; + x2 = cx + (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line((int)x1,(int)y1,(int)x2,(int)y2); + fl_color(FL_WHITE); + if (sa*ca >=0) + fl_line((int)x1+1,(int)y1+1,(int)x2+1,(int)y2+1); + else + fl_line((int)x1+1,(int)y1-1,(int)x2+1,(int)y2-1); + } + } + else + { + int nb_dec = (_type & DOTLOG_3); + for (int k = 0; k < nb_dec; k++) + { + double a_step = (10.0*3.14159/6.0) / nb_dec; + double a_orig = -(3.14159/3.0) + k * a_step; + for (int a = (k) ? 2:1; a <= 10; ) + { + double na = a_orig + log10((double)a) * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx - rds * ca; + y1 = cy - rds * sa; + x2 = cx - (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line((int)x1,(int)y1,(int)x2,(int)y2); + fl_color(FL_WHITE); + if (sa*ca <0) + fl_line((int)x1+1,(int)y1+1,(int)x2+1,(int)y2+1); + else + fl_line((int)x1+1,(int)y1-1,(int)x2+1,(int)y2-1); + if ((a == 1) || (nb_dec == 1)) + a += 1; + else + a += 2; + } + } + } +} + +void Fl_Knob::draw_cursor(const int ox,const int oy,const int side) { + float rds,cur,cx,cy; +double angle; + + rds = (side - 20) / 2.0; + cur = _percent * rds / 2; + cx = ox + side / 2; + cy = oy + side / 2; + angle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + fl_push_matrix(); + fl_scale(1,1); + fl_translate(cx,cy); + fl_rotate(-angle); + fl_translate(0,rds-cur-2.0); + if (_type 1.0) _percent = 1.0; + if (visible()) damage(FL_DAMAGE_CHILD); +} + +void Fl_Knob::scaleticks(const int tck) { + _scaleticks = tck; + if (_scaleticks < 0) _scaleticks = 0; + if (_scaleticks > 31) _scaleticks = 31; + if (visible()) damage(FL_DAMAGE_ALL); +} diff --git a/SpiralSound/Plugins/Widgets/Fl_Knob.fld b/SpiralSound/Plugins/Widgets/Fl_Knob.fld new file mode 100644 index 0000000..df3b717 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_Knob.fld @@ -0,0 +1,280 @@ +# data file for the Fltk User Interface Designer (fluid) +version 2.00 +header_name {.H} +code_name {.cxx} +gridx 5 +gridy 5 +snap 3 +decl {\#include } {public +} + +decl {\#include } {} + +decl {\#include } {} + +class Fl_Knob {open : {public Fl_Valuator} +} { + decl {enum Fl_Knobtype {DOTLIN=0,DOTLOG_1,DOTLOG_2,DOTLOG_3,LINELIN,LINELOG_1,LINELOG_2,LINELOG_3};} {public + } + decl {int _type;} {} + decl {float _percent;} {} + decl {int _scaleticks;} {} + decl {short a1,a2;} {} + Function {Fl_Knob(int xx,int yy,int ww,int hh,const char *l=0): Fl_Valuator(xx,yy,ww,hh,l)} {} { + code {a1 = 35; + a2 = 325; + _type = DOTLIN; + _percent = 0.3; + _scaleticks = 10;} {} + } + Function {~Fl_Knob()} {} {} + Function {draw()} {open private + } { + code {int ox,oy,ww,hh,side; +float sa,ca,a_r; +unsigned char rr,gg,bb; + + ox = x(); + oy = y(); + ww = w(); + hh = h(); + draw_label(); + fl_clip(ox,oy,ww,hh); + if (ww > hh) + { + side = hh; + ox = ox + (ww - side) / 2; + } + else + { + side = ww; + oy = oy + (hh - side) / 2; + } + side = w() > h () ? hh:ww; + int dam = damage(); + if (dam & FL_DAMAGE_ALL) + { + int col = parent()->color(); + fl_color(col); + fl_rectf(ox,oy,side,side); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(-60,rr,gg,bb); + fl_pie(ox+9,oy+9,side-12,side-12,0,360); + draw_scale(ox,oy,side); + col = color(); + Fl::get_color((Fl_Color)col,rr,gg,bb); + shadow(15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,40,80); + shadow(30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,80,220); + shadow(-15,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,220,260); + shadow(-30,rr,gg,bb); + fl_pie(ox+6,oy+6,side-12,side-12,260,400); + fl_color(FL_BLACK); + fl_arc(ox+6,oy+6,side-11,side-11,0,360); + fl_color(col); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + else + { + fl_color(color()); + fl_pie(ox+10,oy+10,side-20,side-20,0,360); + } + Fl::get_color((Fl_Color)color(),rr,gg,bb); + shadow(10,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,110,150); + fl_pie(ox+10,oy+10,side-20,side-20,290,330); + shadow(17,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,120,140); + fl_pie(ox+10,oy+10,side-20,side-20,300,320); + shadow(25,rr,gg,bb); + fl_pie(ox+10,oy+10,side-20,side-20,127,133); + fl_pie(ox+10,oy+10,side-20,side-20,307,313); + draw_cursor(ox,oy,side); + fl_pop_clip();} {selected + } + } + Function {handle(int event)} {private return_type int + } { + code {int ox,oy,ww,hh; + + ox = x() + 10; oy = y() + 10; + ww = w() - 20; + hh = h()-20; + switch (event) + { + case FL_PUSH: + handle_push(); + case FL_DRAG: + { + int mx = Fl::event_x()-ox-ww/2; + int my = Fl::event_y()-oy-hh/2; + if (!mx && !my) return 1; + double angle = 270-atan2((float)-my, (float)mx)*180/M_PI; + double oldangle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + while (angle < oldangle-180) angle += 360; + while (angle > oldangle+180) angle -= 360; + double val; + if ((a1= a1)) + { + val = minimum(); + } + else + if ((a1= a2) : (angle <= a2)) + { + val = maximum(); + } + else + { + val = minimum() + (maximum()-minimum())*(angle-a1)/(a2-a1); + } + handle_drag(clamp(round(val))); + } + return 1; + case FL_RELEASE: + handle_release(); + return 1; + default: + return 0; + } + return 0;} {} + } + Function {type(int ty)} {} { + code {_type = ty;} {} + } + Function {shadow(const int offs,const uchar r,uchar g,uchar b)} {private + } { + code {int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb);} {} + } + Function {draw_scale(const int ox,const int oy,const int side)} {private + } { + code {float x1,y1,x2,y2,rds,cx,cy,ca,sa; + + rds = side / 2; + cx = ox + side / 2; + cy = oy + side / 2; + if (!(_type & DOTLOG_3)) + { + if (_scaleticks == 0) return; + double a_step = (10.0*3.14159/6.0) / _scaleticks; + double a_orig = -(3.14159/3.0); + for (int a = 0; a <= _scaleticks; a++) + { + double na = a_orig + a * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx + rds * ca; + y1 = cy - rds * sa; + x2 = cx + (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line(x1,y1,x2,y2); + fl_color(FL_WHITE); + if (sa*ca >=0) + fl_line(x1+1,y1+1,x2+1,y2+1); + else + fl_line(x1+1,y1-1,x2+1,y2-1); + } + } + else + { + int nb_dec = (_type & DOTLOG_3); + for (int k = 0; k < nb_dec; k++) + { + double a_step = (10.0*3.14159/6.0) / nb_dec; + double a_orig = -(3.14159/3.0) + k * a_step; + for (int a = (k) ? 2:1; a <= 10; ) + { + double na = a_orig + log10((double)a) * a_step; + ca = cos(na); + sa = sin(na); + x1 = cx - rds * ca; + y1 = cy - rds * sa; + x2 = cx - (rds-6) * ca; + y2 = cy - (rds-6) * sa; + fl_color(FL_BLACK); + fl_line(x1,y1,x2,y2); + fl_color(FL_WHITE); + if (sa*ca <0) + fl_line(x1+1,y1+1,x2+1,y2+1); + else + fl_line(x1+1,y1-1,x2+1,y2-1); + if ((a == 1) || (nb_dec == 1)) + a += 1; + else + a += 2; + } + } + }} {} + } + Function {draw_cursor(const int ox,const int oy,const int side)} {private + } { + code {float rds,cur,cx,cy; +double angle; + + rds = (side - 20) / 2.0; + cur = _percent * rds / 2; + cx = ox + side / 2; + cy = oy + side / 2; + angle = (a2-a1)*(value()-minimum())/(maximum()-minimum()) + a1; + fl_push_matrix(); + fl_scale(1,1); + fl_translate(cx,cy); + fl_rotate(-angle); + fl_translate(0,rds-cur-2.0); + if (_type 1.0) _percent = 1.0; + if (visible()) damage(FL_DAMAGE_CHILD);} {} + } + Function {scaleticks(const int tck)} {} { + code {_scaleticks = tck; + if (_scaleticks < 0) _scaleticks = 0; + if (_scaleticks > 31) _scaleticks = 31; + if (visible()) damage(FL_DAMAGE_ALL);} {} + } +} diff --git a/SpiralSound/Plugins/Widgets/Fl_LED_Button.H b/SpiralSound/Plugins/Widgets/Fl_LED_Button.H new file mode 100644 index 0000000..850ef61 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_LED_Button.H @@ -0,0 +1,17 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#ifndef Fl_LED_Button_H +#define Fl_LED_Button_H +#include +#include +#include + +class Fl_LED_Button : public Fl_Light_Button { +public: + Fl_LED_Button(int x, int y, int w, int h, const char* l=0); + ~Fl_LED_Button(); +private: + void draw(); + void modulate(const int offs,const uchar r,uchar g,uchar b); +}; +#endif diff --git a/SpiralSound/Plugins/Widgets/Fl_LED_Button.cxx b/SpiralSound/Plugins/Widgets/Fl_LED_Button.cxx new file mode 100644 index 0000000..fae03a8 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_LED_Button.cxx @@ -0,0 +1,63 @@ +// generated by Fast Light User Interface Designer (fluid) version 2.00 + +#include "Fl_LED_Button.H" +#include + +Fl_LED_Button::Fl_LED_Button(int x, int y, int w, int h, const char* l):Fl_Light_Button(x,y,w,h,l) { + box(FL_NO_BOX); + down_box(FL_ROUND_DOWN_BOX); + selection_color(FL_RED); +} + +Fl_LED_Button::~Fl_LED_Button() { +} + +void Fl_LED_Button::draw() { + uchar r,g,b; + + //if (box()) draw_box(this==Fl::pushed() ? down(box()) : box(), color()); + Fl_Color col = value() ? selection_color() : color(); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + int d = h()/6; + int W = w()color(),r,g,b); + modulate(-90,r,g,b); + fl_pie(x1-1,y1-1,ww+2,hh+2,0,360); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + if (value()) modulate(-90,r,g,b); else modulate(-210,r,g,b); + fl_pie(x1,y1,ww,hh,0,360); + if (value()) modulate(-60,r,g,b); else modulate(-190,r,g,b); + fl_pie(x1+1,y1+1,ww-2,hh-2,0,360); + if (value()) modulate(-20,r,g,b); else modulate(-150,r,g,b); + fl_pie(x1+1,y1+1,ww-3,hh-3,0,360); + if (value()) modulate(0,r,g,b); else modulate(-130,r,g,b); + fl_pie(x1+3,y1+3,ww-5,hh-5,0,360); + if (value()) modulate(160,r,g,b); else modulate(-30,r,g,b); + fl_arc(x1+3,y1+3,ww-5,hh-5,250,350); + if (value()) modulate(250,r,g,b); else modulate(100,r,g,b); + fl_pie((int)(x1+ww/2-(0.3*ww)/2),(int)(y1+ww/2-(0.3*ww)/2), + (int)((0.45*ww)/2),(int)((0.45*ww)/2),0,360); + fl_color(FL_BLACK); + fl_arc(x1,y1,ww+1,hh+1,0,360); + draw_label(x()+W-d, y(), w()-W+d, h());//,labelcolor()); +} + +void Fl_LED_Button::modulate(const int offs,const uchar r,uchar g,uchar b) { + int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb); +} diff --git a/SpiralSound/Plugins/Widgets/Fl_LED_Button.fld b/SpiralSound/Plugins/Widgets/Fl_LED_Button.fld new file mode 100644 index 0000000..afa02a0 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_LED_Button.fld @@ -0,0 +1,74 @@ +# data file for the Fltk User Interface Designer (fluid) +version 2.00 +header_name {.H} +code_name {.cxx} +gridx 5 +gridy 5 +snap 3 +decl {\#include } {} + +decl {\#include } {public +} + +class Fl_LED_Button {open : {public Fl_Light_Button} +} { + Function {Fl_LED_Button(int x, int y, int w, int h, const char* l=0):Fl_Light_Button(x,y,w,h,l)} {open + } { + code {box(FL_NO_BOX); + down_box(FL_ROUND_DOWN_BOX); + selection_color(FL_RED);} {} + } + Function {~Fl_LED_Button()} {open + } {} + Function {draw()} {open private + } { + code {uchar r,g,b; + + if (box()) draw_box(this==Fl::pushed() ? down(box()) : box(), color()); + Fl_Color col = value() ? selection_color() : color(); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + int d = h()/6; + int W = w()color(),r,g,b); + modulate(-90,r,g,b); + fl_pie(x1-1,y1-1,ww+2,hh+2,0,360); + Fl::get_color((Fl_Color)selection_color(),r,g,b); + if (value()) modulate(-90,r,g,b); else modulate(-210,r,g,b); + fl_pie(x1,y1,ww,hh,0,360); + if (value()) modulate(-60,r,g,b); else modulate(-190,r,g,b); + fl_pie(x1+1,y1+1,ww-2,hh-2,0,360); + if (value()) modulate(-20,r,g,b); else modulate(-150,r,g,b); + fl_pie(x1+1,y1+1,ww-3,hh-3,0,360); + if (value()) modulate(0,r,g,b); else modulate(-130,r,g,b); + fl_pie(x1+3,y1+3,ww-5,hh-5,0,360); + if (value()) modulate(160,r,g,b); else modulate(-30,r,g,b); + fl_arc(x1+3,y1+3,ww-5,hh-5,250,350); + if (value()) modulate(250,r,g,b); else modulate(100,r,g,b); + fl_pie((int)(x1+ww/2-(0.3*ww)/2),(int)(y1+ww/2-(0.3*ww)/2), + (int)((0.45*ww)/2),(int)((0.45*ww)/2),0,360); + fl_color(FL_BLACK); + fl_arc(x1,y1,ww+1,hh+1,0,360); + draw_label(x()+W-d, y(), w()-W+d, h(),labelcolor());} {selected + } + } + Function {modulate(const int offs,const uchar r,uchar g,uchar b)} {open private + } { + code {int rr,gg,bb; + + rr = r + offs; + rr = rr > 255 ? 255:rr; + rr = rr < 0 ? 0:rr; + gg = g + offs; + gg = gg > 255 ? 255:gg; + gg = gg < 0 ? 0:gg; + bb = b + offs; + bb = bb > 255 ? 255:bb; + bb = bb < 0 ? 0:bb; + fl_color((uchar)rr,(uchar)gg,(uchar)bb);} {} + } +} diff --git a/SpiralSound/Plugins/Widgets/Fl_SEvent.C b/SpiralSound/Plugins/Widgets/Fl_SEvent.C new file mode 100644 index 0000000..664edc3 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_SEvent.C @@ -0,0 +1,332 @@ +/* Event Widget + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "Fl_SEvent.h" +#include "Fl_EventMap.h" +#include +#include +#include +#include + +static const int MELODY_WIDGET_COL = 142; +static const int PERCUSSION_WIDGET_COL = 140; + +Fl_SEvent::Fl_SEvent(int x, int y, int w, int h, const char* label) : +Fl_Button(x,y,w,h,label), +m_Type(NO_TYPE), +m_LastState(false), +m_FirstUpdate(false), +m_LastUpdate(false), +m_Name("No Name"), +m_ID(-1), +m_GridX(0), +m_GridY(0), +m_LockX(false), +m_LockY(false), +m_LockResize(true), +m_ResizeGrab(8), +m_PixelsPerSec(100), +m_StartTime(0.0f), +m_LengthTime(0.0f), +m_SnapGap(0.0f), +m_CurrentDragMode(NONE), +m_DelMe(false) +{ + Fl_Button::label(m_Name.c_str()); +} + +Fl_SEvent::Fl_SEvent(const Fl_SEvent &Other) : +Fl_Button(Other.x(),Other.y(),Other.w(),Other.h(),Other.label()), +m_Type(Other.m_Type), +m_LastState(Other.m_LastState), +m_FirstUpdate(Other.m_FirstUpdate), +m_LastUpdate(Other.m_LastUpdate), +m_Name(Other.m_Name), +m_ID(Other.m_ID), +m_GridX(Other.m_GridX), +m_GridY(Other.m_GridY), +m_LockX(Other.m_LockX), +m_LockY(Other.m_LockY), +m_LockResize(Other.m_LockResize), +m_ResizeGrab(Other.m_ResizeGrab), +m_PixelsPerSec(Other.m_PixelsPerSec), +m_StartTime(Other.m_StartTime), +m_LengthTime(Other.m_LengthTime), +m_SnapGap(Other.m_SnapGap), +m_CurrentDragMode(Other.m_CurrentDragMode), +m_DelMe(false), +LastButtonPushed(0) +{ +} + +Fl_SEvent::~Fl_SEvent() +{ +} + +bool Fl_SEvent::UpdateState(float Time) +{ + m_FirstUpdate=false; + m_LastUpdate=false; + + bool State=(Time>m_StartTime && TimeGetType()==Fl_EventMap::MELODY_MAP) + { + int Col=FL_BLACK; + if (parent()) Col=((Fl_EventMap*)(parent()))->GetKeyColMap()[GetGroup()%12]; + fl_color(Col); + fl_rectf(x()+1,y()+1,w()-1,h()-1); + + // draw shadow + fl_color(FL_BLACK); + fl_line(x()+w(),y()+1,x()+w(),y()+h()); + fl_line(x()+w(),y()+h(),x()+1,y()+h()); + } + else + { + if (m_Type==MELODY) fl_color(MELODY_WIDGET_COL); + else fl_color(PERCUSSION_WIDGET_COL); + + fl_rectf(x()+1,y()+1,w()-1,h()-1); + + // draw shadow + fl_color(FL_BLACK); + fl_line(x()+w(),y()+1,x()+w(),y()+h()); + fl_line(x()+w(),y()+h(),x()+1,y()+h()); + + fl_push_clip(x()+1,y()+1,w()-1,h()-1); + fl_font(fl_font(), 10); + fl_draw(m_Name.c_str(),x()+2,y()+h()-2); + fl_pop_clip(); + } + + + // todo: sample rendering +} + +int Fl_SEvent::handle(int event) +{ + int mx=Fl::event_x(); + int my=Fl::event_y(); + + static int offsx,offsy; + + switch (event) + { + case FL_PUSH: + LastButtonPushed=Fl::event_button(); + + offsx=mx-x(); + offsy=my-y(); + + if (Fl::event_key(FL_BackSpace)) + { + Fl_EventMap *p = (Fl_EventMap*)parent(); + if (p && p->GetType()!=Fl_EventMap::ARRANGE_MAP) + { + m_DelMe=true; + } + } + + if (LastButtonPushed==1) + { + // if the last EVENT_RESIZE_GRAB pixels + // have been grabbed, resize. + /*if(!m_LockResize && mx>x()+w()-m_ResizeGrab && mxCopyEvent(x()+w(),y(),w(),m_ID,m_LengthTime); + } + + if (LastButtonPushed==3) + { + m_CurrentDragMode=RESIZING; + } + + // fall through + case FL_DRAG: + { + if (LastButtonPushed==1 || LastButtonPushed==3) + { + if(m_CurrentDragMode==RESIZING) + { + w(mx-x()+(m_ResizeGrab/2)); + m_LengthTime=w()/(float)m_PixelsPerSec; + } + + if(m_CurrentDragMode==MOVING) + { + x(mx-offsx); + y(my-offsy); + + m_StartTime=(x()-GetParentX())/(float)m_PixelsPerSec; + } + + my=y(); + SnapY(); + + parent()->redraw(); + } + } + break; + + case FL_RELEASE: + { + m_CurrentDragMode=NONE; + } + break; + } + + return event; +} + +void Fl_SEvent::SetPixelsPerSec(int s, bool FirstTime) +{ + m_PixelsPerSec=s; + + if (FirstTime) + { + m_StartTime=(x()-GetParentX())/(float)m_PixelsPerSec; + m_LengthTime=w()/(float)m_PixelsPerSec; + } + else + { + // convert back to new value + + //get relative x + int rel_x=x()-GetParentX(); + + rel_x=(int)(m_StartTime*m_PixelsPerSec); + x(rel_x+GetParentX()); + + w((int)(m_LengthTime*m_PixelsPerSec)); + m_GridX=(int)(m_SnapGap*(float)m_PixelsPerSec); + } +} + +int Fl_SEvent::GetParentX() +{ + Fl_EventMap* P=(Fl_EventMap*)(parent()); + if (P) + { + return P->GetX(); + } + else + { + return 0; + } +} + +int Fl_SEvent::GetParentY() +{ + Fl_EventMap* P=(Fl_EventMap*)(parent()); + if (P) + { + return P->GetY(); + } + else + { + return 0; + } +} + +//////////////////////////////////////////////////////////////////// + +Fl_TriEvent::Fl_TriEvent(int x, int y, int w, int h, const char* label) : +Fl_SEvent(x,y,w,h,label) +{ +} + +Fl_TriEvent::Fl_TriEvent(const Fl_TriEvent &Other) : +Fl_SEvent(Other) +{ +} + +void Fl_TriEvent::draw() +{ + // hackish way to override the zoon scale of the width + w(10); + h(1000); + + fl_color(FL_BLACK); + //fl_line(x(),y(),x()+10,y()); + //fl_line(x()+10,y(),x(),y()+10); + //fl_line(x(),y()+10,x(),y()); + + fl_line(x(),y(),x(),y()+1000); +} + +//////////////////////////////////////////////////////////////////// + +Fl_CircEvent::Fl_CircEvent(int x, int y, int w, int h, const char* label) : +Fl_SEvent(x,y,12,h,label) +{ +} + +Fl_CircEvent::Fl_CircEvent(const Fl_CircEvent &Other) : +Fl_SEvent(Other) +{ +} + +void Fl_CircEvent::draw() +{ + // hackish way to override the zoom scale of the width + w(12); + + int Col=0; + if (parent()) Col=((Fl_EventMap*)(parent()))->GetKeyColMap()[GetGroup()%12]; + fl_color(Col); + + fl_rectf(x(),y()+1,12,12); + + fl_color(FL_BLACK); + fl_line(x()+1,y()+13, x()+13,y()+13); + fl_line(x()+12,y()+13, x()+12,y()+1); + +// fl_pie(x(),y(),12,12,0,360); +} diff --git a/SpiralSound/Plugins/Widgets/Fl_SEvent.h b/SpiralSound/Plugins/Widgets/Fl_SEvent.h new file mode 100644 index 0000000..a8b6e6f --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_SEvent.h @@ -0,0 +1,135 @@ +/* Event Widget + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef SEVENT +#define SEVENT + +using namespace std; + +class Fl_EventMap; + +class Fl_SEvent : public Fl_Button +{ +public: + enum Type{NO_TYPE,MELODY,PERCUSSION}; + enum DragMode{NONE,MOVING,RESIZING}; + + Fl_SEvent(int x, int y, int w, int h, const char* label=0); + Fl_SEvent(const Fl_SEvent &Other); + virtual ~Fl_SEvent(); + + virtual void draw(); + virtual int handle(int event); + + int GetID() { return m_ID; } + void SnapX() { if (m_GridX) x(x()-((x()-GetParentX())%m_GridX)); redraw(); } + void SnapY() { if (m_GridY) y(y()-((y()-GetParentY())%m_GridY)); redraw(); } + void SetName(string s) { m_Name=s; } + string GetName() { return m_Name; } + void SetID(int s) { m_ID=s; } + void SetGridX(int s) { m_GridX=s; } + void SetGridY(int s) { m_GridY=s; } + void LockX() { m_LockX=true; } + void LockY() { m_LockY=true; } + void LockResize(bool s){ m_LockResize=s; } + void SetResizeGrab(int s) { m_ResizeGrab=s; } + void SetSnapGap(float s) + { m_SnapGap=s; if(s) m_GridX=(int)(s*(float)m_PixelsPerSec); } + float GetStartTime() { return m_StartTime; } + float GetLengthTime() { return m_LengthTime; } + void SetLengthTime(float s) { m_LengthTime=s; w((int)(m_LengthTime*m_PixelsPerSec)); redraw(); } + int GetGroup() { return (y()-GetParentY())/m_GridY; } + Type GetType() { return m_Type; } + void SetType(Type s) { m_Type=s; } + void SetPixelsPerSec(int s, bool FirstTime=false); + int GetParentX(); + int GetParentY(); + void Place(int sx, int sy) { x(sx); y(sy); } + + bool UpdateState(float Time); + bool AtStart() { return m_FirstUpdate; } + bool AtEnd() { return m_LastUpdate; } + bool Killed() { return m_DelMe; } + + int GetX() { return x(); } + int GetY() { return y(); } + int GetW() { return w(); } + +private: + + Type m_Type; + // whether we were active or not last tick + bool m_LastState; + + // if this is the first or last update + bool m_FirstUpdate; + bool m_LastUpdate; + + string m_Name; + int m_ID; + int m_GridX; + int m_GridY; + bool m_LockX; + bool m_LockY; + bool m_LockResize; + int m_ResizeGrab; + int m_PixelsPerSec; + + float m_StartTime; + float m_LengthTime; + float m_SnapGap; + + DragMode m_CurrentDragMode; + + bool m_DelMe; + + int LastButtonPushed; +}; + +///////////////////////////////////////////////////////// + +class Fl_TriEvent : public Fl_SEvent +{ +public: + Fl_TriEvent(int x, int y, int w, int h, const char* label=0); + Fl_TriEvent(const Fl_TriEvent &Other); + virtual void draw(); +private: +}; + +///////////////////////////////////////////////////////// + +class Fl_CircEvent : public Fl_SEvent +{ +public: + Fl_CircEvent(int x, int y, int w, int h, const char* label=0); + Fl_CircEvent(const Fl_CircEvent &Other); + virtual void draw(); +private: +}; + +#endif diff --git a/SpiralSound/Plugins/Widgets/Fl_SevenSeg.H b/SpiralSound/Plugins/Widgets/Fl_SevenSeg.H new file mode 100644 index 0000000..e537bea --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_SevenSeg.H @@ -0,0 +1,58 @@ +// generated by Fast Light User Interface Designer (fluid) version 1.0010 + +#ifndef Fl_SevenSeg_H +#define Fl_SevenSeg_H +#include +#include +#include + +// Andy Preston +enum dp_type { off, point, colon }; + + + + +class Fl_SevenSeg : public Fl_Widget { + + // Andy Preston changed + // int digit,decpt,segwidth; + // to + int digit, segwidth; + dp_type decpt; + + +public: + Fl_SevenSeg(int x,int y,int w,int h); + ~Fl_SevenSeg(void); + void value(int v); + void value(char c); + const int value(void); + + // Andy Preston changed + // void dp (int onoff); + // to + void dp (dp_type state); + + // Andy Preston changed + // const int dp(void); + // to + const dp_type dp (void); + + const int bar_width(void); + void bar_width(int w); +private: + void draw(); + void draw_seg_a(int xx,int yy,int ww,int hh); + void draw_seg_b(int xx,int yy,int ww,int hh); + void draw_seg_c(int xx,int yy,int ww,int hh); + void draw_seg_d(int xx,int yy,int ww,int hh); + void draw_seg_e(int xx,int yy,int ww,int hh); + void draw_seg_f(int xx,int yy,int ww,int hh); + void draw_seg_g(int xx,int yy,int ww,int hh); + + // Andy Preston + void draw_seg_dp (int xx, int yy, int ww, int hh); + void draw_seg_col (int xx, int yy, int ww, int hh); + +}; +#endif diff --git a/SpiralSound/Plugins/Widgets/Fl_SevenSeg.cxx b/SpiralSound/Plugins/Widgets/Fl_SevenSeg.cxx new file mode 100644 index 0000000..9cd648b --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_SevenSeg.cxx @@ -0,0 +1,271 @@ +// generated by Fast Light User Interface Designer (fluid) version 1.0010 + +#include "Fl_SevenSeg.H" + +// Andy Preston changed +// Fl_SevenSeg::Fl_SevenSeg(int x,int y,int w,int h):Fl_Widget(x,y,w,h) { +// to +Fl_SevenSeg::Fl_SevenSeg(int x, int y, int w, int h) : +Fl_Widget (x, y, w, h), +decpt (off) { + + color2(FL_BLACK); + color(FL_RED); + digit = 8; + segwidth = (w-8)/13; + segwidth = segwidth<(h-8)/13 ?(h-8)/13: segwidth; + if (segwidth<1) segwidth =1; +} + +Fl_SevenSeg::~Fl_SevenSeg(void) { +} + +// Andy Preston changed +//void Fl_SevenSeg::value(int v) { +// if (v <0) digit = -1; +// else +// if (v>9) digit = 9; +// else +// digit = v; +// if (active()) redraw(); +//} +// to +void Fl_SevenSeg::value (int v) { + if (v>9) digit = 9; + else digit = v; + if (active()) redraw(); +} + +void Fl_SevenSeg::value(char c) { + int v = c - '0'; + value(v); +} + +const int Fl_SevenSeg::value(void) { + return digit; +} + +// Andy Preston changed +// void Fl_SevenSeg::dp(int onoff) { +// decpt =(onoff!=0); +// } +// to +void Fl_SevenSeg::dp (dp_type state) { + decpt = state; +} + +// Andy Preston changed +// const int Fl_SevenSeg::dp(void) { +// to +const dp_type Fl_SevenSeg::dp(void) { + return decpt; +} + +const int Fl_SevenSeg::bar_width(void) { + return segwidth; +} + +void Fl_SevenSeg::bar_width(int w) { + segwidth = w > 2 ? w:2; + if (active()) redraw(); +} +// PRIVATE METHODS + +void Fl_SevenSeg::draw() { + uchar r,g,b; +int val; + + draw_box(); + + // andy preston + fl_color (color2()); + fl_rectf (x(), y(), w(), h()); + + // Andy Preston Changed + // int xx = x()+4; + // int ww = w()-8; + // int yy = y()+4; + // int hh = h()-8; + // to + int xx = x()+2; + int ww = w()-4; + int yy = y()+2; + int hh = h()-4; + + // Andy Preston removed + // fl_clip(xx,yy,ww,hh); + // fl_color(color2()); + // fl_rectf(xx,yy,ww,hh); + + // Andy Preston changed + // if (digit == -1) return; + if (digit < -1) return; + + Fl::get_color(color(),r,g,b); + if (!active()) + { + val = 64+(int)r/4; r = val > 255 ? 255:val; + val = 64+(int)g/4; g = val > 255 ? 255:val; + val = 64+(int)b/4; b = val > 255 ? 255:val; + } + fl_color(r,g,b); + + fl_line_style(FL_SOLID|FL_CAP_ROUND,segwidth); + + switch(digit) + { + // Andy Preston + case -1: + draw_seg_g (xx, yy, ww, hh); + break; + + + case 0: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_e(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + break; + case 1: + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + break; + case 2: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + draw_seg_e(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + break; + case 3: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + break; + case 4: + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + break; + case 5: + draw_seg_a(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + break; + case 6: + draw_seg_a(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_e(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + break; + case 7: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + break; + case 8: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_e(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + break; + case 9: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + break; + } + + // Andy Preston changed (naughty, naughty, who missed out the dp drawing code then?) + // fl_line_style(FL_SOLID,1); + // if (decpt) { } + // to + if (decpt==point) draw_seg_dp (xx, yy, ww, hh); + else if (decpt==colon) draw_seg_col (xx, yy, ww, hh); + fl_line_style(FL_SOLID,1); + + //fl_pop_clip(); +} + + +// Andy Preston +void Fl_SevenSeg::draw_seg_dp (int xx, int yy, int ww, int hh) { + int x1 = xx - segwidth / 2; + int y1 = yy + hh - segwidth; + int x2 = x1 + segwidth / 3; + fl_line (x1, y1, x2, y1); +} + +// Andy Preston +void Fl_SevenSeg::draw_seg_col (int xx, int yy, int ww, int hh) { + int x1 = xx - segwidth/2; + int x2 = x1 + segwidth/3; + int y1 = yy + 1 + hh/4; + int y2 = yy - 1 + (hh/4) * 3; + fl_line (x1, y1, x2, y1); + fl_line (x1, y2, x2, y2); +} + +void Fl_SevenSeg::draw_seg_a(int xx,int yy,int ww,int hh) { + int x1 = xx+2*segwidth+1; + int y1 = yy+segwidth; + int x2 = xx+ww-2*segwidth-1; + fl_line(x1,y1,x2,y1); +} + +void Fl_SevenSeg::draw_seg_b(int xx,int yy,int ww,int hh) { + int x1 = xx+ww-segwidth; + int y1 = yy+(3*segwidth)/2+1; + int y2 = y1+hh/2-2*segwidth-1; + fl_line(x1,y1,x1,y2); +} + +void Fl_SevenSeg::draw_seg_c(int xx,int yy,int ww,int hh) { + int x1 = xx+ww-segwidth; + int y1 = yy+(hh+segwidth)/2+1; + int y2 = y1+hh/2-2*segwidth-1; + fl_line(x1,y1,x1,y2); +} + +void Fl_SevenSeg::draw_seg_d(int xx,int yy,int ww,int hh) { + int x1 = xx+2*segwidth+1; + int y1 = yy+hh-segwidth; + int x2 = xx+ww-2*segwidth-1; + fl_line(x1,y1,x2,y1); +} + +void Fl_SevenSeg::draw_seg_e(int xx,int yy,int ww,int hh) { + int x1 = xx+segwidth; + int y1 = yy+(hh+segwidth)/2+1; + int y2 = y1+hh/2-2*segwidth-1; + fl_line(x1,y1,x1,y2); +} + +void Fl_SevenSeg::draw_seg_f(int xx,int yy,int ww,int hh) { + int x1 = xx+segwidth; + int y1 = yy+(3*segwidth)/2+1; + int y2 = y1+hh/2-2*segwidth-1; + fl_line(x1,y1,x1,y2); +} + +void Fl_SevenSeg::draw_seg_g(int xx,int yy,int ww,int hh) { + int x1 = xx+2*segwidth+1; + int y1 = yy+(hh-segwidth/2)/2; + int x2 = xx+ww-2*segwidth-1; + fl_line(x1,y1,x2,y1); +} diff --git a/SpiralSound/Plugins/Widgets/Fl_SevenSeg.fld b/SpiralSound/Plugins/Widgets/Fl_SevenSeg.fld new file mode 100644 index 0000000..cb2cec1 --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_SevenSeg.fld @@ -0,0 +1,214 @@ +# data file for the Fltk User Interface Designer (fluid) +version 1.0010 +header_name {.H} +code_name {.cxx} +gridx 5 +gridy 5 +snap 3 +decl {\#include } {public +} + +decl {\#include } {public +} + +class Fl_SevenSeg {open : {public Fl_Widget} +} { + decl {int digit,decpt,segwidth;} {} + Function {Fl_SevenSeg(int x,int y,int w,int h):Fl_Widget(x,y,w,h)} {} { + code {color2(FL_BLACK); + color(FL_RED); + digit = 8; + segwidth = (w-8)/13; + segwidth = segwidth<(h-8)/13 ?(h-8)/13: segwidth; + if (segwidth<1) segwidth =1;} {} + } + Function {~Fl_SevenSeg(void)} {} {} + Function {value(int v)} {return_type void + } { + code {if (v <0) digit = -1; + else + if (v>9) digit = 9; + else + digit = v; + if (active()) redraw();} {} + } + Function {value(char c)} {return_type void + } { + code {int v = c - '0'; + value(v);} {} + } + Function {value(void)} {return_type {const int} + } { + code {return digit;} {} + } + Function {dp(int onoff)} {return_type void + } { + code {decpt =(onoff!=0);} {} + } + Function {dp(void)} {return_type {const int} + } { + code {return decpt;} {} + } + Function {bar_width(void)} {return_type {const int} + } { + code {return segwidth;} {} + } + Function {bar_width(int w)} {return_type void + } { + code {segwidth = w > 2 ? w:2; + if (active()) redraw();} {} + } + decl {// PRIVATE METHODS} {} + Function {draw()} {open private + } { + code {uchar r,g,b; +int val; + + draw_box(); + int xx = x()+4; + int ww =w()-8; + int yy = y()+4; + int hh = h()-8; + fl_clip(xx,yy,ww,hh); + fl_color(color2()); + fl_rectf(xx,yy,ww,hh); + if (digit == -1) return; + Fl::get_color(color(),r,g,b); + if (!active()) + { + val = 64+(int)r/4; r = val > 255 ? 255:val; + val = 64+(int)g/4; g = val > 255 ? 255:val; + val = 64+(int)b/4; b = val > 255 ? 255:val; + } + fl_color(r,g,b); + fl_line_style(FL_SOLID|FL_CAP_ROUND,segwidth); + switch(digit) + { + case 0: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_e(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + break; + case 1: + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + break; + case 2: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + draw_seg_e(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + break; + case 3: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + break; + case 4: + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + break; + case 5: + draw_seg_a(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + break; + case 6: + draw_seg_a(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_e(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + break; + case 7: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + break; + case 8: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_e(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + break; + case 9: + draw_seg_a(xx,yy,ww,hh); + draw_seg_b(xx,yy,ww,hh); + draw_seg_c(xx,yy,ww,hh); + draw_seg_d(xx,yy,ww,hh); + draw_seg_g(xx,yy,ww,hh); + draw_seg_f(xx,yy,ww,hh); + break; + } + fl_line_style(FL_SOLID,1); + if (decpt) + { + + } + fl_pop_clip();} {selected + } + } + Function {draw_seg_a(int xx,int yy,int ww,int hh)} {private return_type void + } { + code {int x1 = xx+2*segwidth+1; + int y1 = yy+segwidth; + int x2 = xx+ww-2*segwidth-1; + fl_line(x1,y1,x2,y1);} {} + } + Function {draw_seg_b(int xx,int yy,int ww,int hh)} {private return_type void + } { + code {int x1 = xx+ww-segwidth; + int y1 = yy+(3*segwidth)/2+1; + int y2 = y1+hh/2-2*segwidth-1; + fl_line(x1,y1,x1,y2);} {} + } + Function {draw_seg_c(int xx,int yy,int ww,int hh)} {private return_type void + } { + code {int x1 = xx+ww-segwidth; + int y1 = yy+(hh+segwidth)/2+1; + int y2 = y1+hh/2-2*segwidth-1; + fl_line(x1,y1,x1,y2);} {} + } + Function {draw_seg_d(int xx,int yy,int ww,int hh)} {private return_type void + } { + code {int x1 = xx+2*segwidth+1; + int y1 = yy+hh-segwidth; + int x2 = xx+ww-2*segwidth-1; + fl_line(x1,y1,x2,y1);} {} + } + Function {draw_seg_e(int xx,int yy,int ww,int hh)} {private return_type void + } { + code {int x1 = xx+segwidth; + int y1 = yy+(hh+segwidth)/2+1; + int y2 = y1+hh/2-2*segwidth-1; + fl_line(x1,y1,x1,y2);} {} + } + Function {draw_seg_f(int xx,int yy,int ww,int hh)} {private return_type void + } { + code {int x1 = xx+segwidth; + int y1 = yy+(3*segwidth)/2+1; + int y2 = y1+hh/2-2*segwidth-1; + fl_line(x1,y1,x1,y2);} {} + } + Function {draw_seg_g(int xx,int yy,int ww,int hh)} {private return_type void + } { + code {int x1 = xx+2*segwidth+1; + int y1 = yy+(hh-segwidth/2)/2; + int x2 = xx+ww-2*segwidth-1; + fl_line(x1,y1,x2,y1);} {} + } +} diff --git a/SpiralSound/Plugins/Widgets/Fl_VU_Meter.cxx b/SpiralSound/Plugins/Widgets/Fl_VU_Meter.cxx new file mode 100644 index 0000000..1e8674d --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_VU_Meter.cxx @@ -0,0 +1,41 @@ +#include +#include "Fl_VU_Meter.h" +#include + +Fl_VU_Meter::Fl_VU_Meter (int x, int y, int w, int h, const char *l = 0) : +Fl_Progress (x, y, w, h, l) { +} + +void Fl_VU_Meter::draw() { + int progress, bx, by, bw, bh, tx, tw; + + bx = Fl::box_dx (box()); + by = Fl::box_dy (box()); + bw = Fl::box_dw (box()); + bh = Fl::box_dh (box()); + tx = x() + bx; + tw = w() - bw; + + if (maximum() > minimum()) + progress = (int)(tw * (value() - minimum()) / (maximum() - minimum()) + 0.5f); + else progress = 0; + + draw_box (box(), x(), y(), w(), h(), color()); + + if (progress > 0) { + int block_width = w() / 16; + int block = 0; + for (int block_pos = 0; block_pos < progress; block_pos += block_width) { + Fl_Color colour; + if (++block == 16) colour = FL_RED; + else if (block > 10) colour = FL_YELLOW; + else colour = FL_GREEN; + if (!active_r()) colour = fl_inactive (colour); + fl_push_clip (x() + block_pos, y(), block_width - 2, h()); + draw_box (box(), x(), y(), w(), h(), colour); + fl_pop_clip(); + } + } + // we don't care about the label + // draw_label (tx, y() + by, tw, h() - bh); +} diff --git a/SpiralSound/Plugins/Widgets/Fl_VU_Meter.h b/SpiralSound/Plugins/Widgets/Fl_VU_Meter.h new file mode 100644 index 0000000..20eea7e --- /dev/null +++ b/SpiralSound/Plugins/Widgets/Fl_VU_Meter.h @@ -0,0 +1,13 @@ +#ifndef _Fl_VU_Meter_H_ +#define _Fl_VU_Meter_H_ + +#include + +class Fl_VU_Meter : public Fl_Progress { + public: + FL_EXPORT Fl_VU_Meter (int x, int y, int w, int h, const char *l = 0); + protected: + FL_EXPORT virtual void draw(); +}; + +#endif diff --git a/SpiralSound/Plugins/XFadePlugin/Makefile.in b/SpiralSound/Plugins/XFadePlugin/Makefile.in new file mode 100644 index 0000000..54e3b4c --- /dev/null +++ b/SpiralSound/Plugins/XFadePlugin/Makefile.in @@ -0,0 +1,163 @@ +############################################################################# +# Makefile for building XFadePlugin.so +# Generated by tmake at 22:23, 2002/02/03 +# Project: XFadePlugin +# Template: app +############################################################################# + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +CFLAGS = @CFLAGS@ +CXXFLAGS= @CXXFLAGS@ +INCPATH = -I/usr/X11R6/include +LINK = g++ -shared +LFLAGS = +LIBS = -L/usr/X11R6/lib -lfltk -lGL -lXext -lX11 -lm -ldl +MOC = moc +UIC = + +TAR = tar -cf +GZIP = gzip -9f + +INSTALL = @INSTALL@ + +###### Autoconf variables + +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ + +####### Files + +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + XFadePlugin.h \ + XFadePluginGUI.h +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + XFadePlugin.C \ + XFadePluginGUI.C +OBJECTS = ../SpiralPlugin.o \ + ../SpiralPluginGUI.o \ + ../Widgets/Fl_Knob.o \ + ../Widgets/Fl_DragBar.o \ + ../../Sample.o \ + XFadePlugin.o \ + XFadePluginGUI.o +INTERFACES = +UICDECLS = +UICIMPLS = +SRCMOC = +OBJMOC = +DIST = +TARGET = XFadePlugin.so + +####### Implicit rules + +.SUFFIXES: .cpp .cxx .cc .C .c + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $< + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $< + +####### Build rules + +all: $(TARGET) + +$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS) + +moc: $(SRCMOC) + +tmake: + tmake XFadePlugin.pro + +dist: + $(TAR) XFadePlugin.tar XFadePlugin.pro $(SOURCES) $(HEADERS) $(INTERFACES) $(DIST) + $(GZIP) XFadePlugin.tar + +clean: + -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS) $(TARGET) + -rm -f *~ core + +install: + $(INSTALL) $(TARGET) $(libdir)/SpiralPlugins + +####### Sub-libraries + + +###### Combined headers + + +####### Compile + +../SpiralPlugin.o: ../SpiralPlugin.C \ + ../SpiralPlugin.h \ + ../../Sample.h + +../SpiralPluginGUI.o: ../SpiralPluginGUI.C \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + ../SpiralPlugin.h \ + ../../Sample.h + +../Widgets/Fl_Knob.o: ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_Knob.H + +../Widgets/Fl_DragBar.o: ../Widgets/Fl_DragBar.cxx \ + ../Widgets/Fl_DragBar.H + +../../Sample.o: ../../Sample.C \ + ../../Sample.h \ + ../../SpiralInfo.h + +XFadePlugin.o: XFadePlugin.C \ + XFadePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + XFadePluginGUI.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H \ + SpiralIcon.xpm + +XFadePluginGUI.o: XFadePluginGUI.C \ + XFadePluginGUI.h \ + XFadePlugin.h \ + ../SpiralPlugin.h \ + ../../Sample.h \ + ../../SpiralInfo.h \ + ../../Sample.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_DragBar.H + diff --git a/SpiralSound/Plugins/XFadePlugin/SpiralIcon.xpm b/SpiralSound/Plugins/XFadePlugin/SpiralIcon.xpm new file mode 100644 index 0000000..31a1f4b --- /dev/null +++ b/SpiralSound/Plugins/XFadePlugin/SpiralIcon.xpm @@ -0,0 +1,339 @@ +/* XPM */ +static char * SpiralIcon_xpm[] = { +"36 36 300 2", +" c None", +". c #8B889B", +"+ c #9C99AA", +"@ c #ADAAB9", +"# c #837F94", +"$ c #7D7990", +"% c #9995A7", +"& c #67627C", +"* c #CDCBD4", +"= c #FCFCFC", +"- c #D1D0D8", +"; c #FFFFFF", +"> c #F1F1F3", +", c #848095", +"' c #2A2248", +") c #CFCED6", +"! c #68637D", +"~ c #ABA8B6", +"{ c #D5D3DB", +"] c #9490A2", +"^ c #C4C4C4", +"/ c #1D1C1D", +"( c #313134", +"_ c #EEEFEE", +": c #FBFBFB", +"< c #EFEFEF", +"[ c #7B768D", +"} c #464060", +"| c #DEDEE1", +"1 c #CBCACC", +"2 c #EEEEF1", +"3 c #79758C", +"4 c #FBFBFC", +"5 c #A2A2A2", +"6 c #000000", +"7 c #F5F6F5", +"8 c #747474", +"9 c #2A2A2B", +"0 c #403958", +"a c #7D788F", +"b c #C0BEC8", +"c c #BCBAC6", +"d c #BCBAC5", +"e c #625C79", +"f c #2B2932", +"g c #191919", +"h c #CCCCCC", +"i c #807B91", +"j c #3B3556", +"k c #F2F2F4", +"l c #929292", +"m c #0E0E0E", +"n c #BFBFBF", +"o c #111111", +"p c #100E15", +"q c #868689", +"r c #FEFDFE", +"s c #D9D7DE", +"t c #9C98AA", +"u c #FDFCFD", +"v c #DDDDDD", +"w c #575755", +"x c #5E5E5E", +"y c #C4C2CD", +"z c #423C5C", +"A c #F0F0F2", +"B c #939393", +"C c #555555", +"D c #4A4A4A", +"E c #010101", +"F c #282828", +"G c #C2C2C2", +"H c #DBDAE0", +"I c #615C78", +"J c #F6F6F7", +"K c #DADADA", +"L c #545454", +"M c #0F0F0F", +"N c #B8B8B8", +"O c #48445C", +"P c #2B2B2C", +"Q c #181900", +"R c #D3D3D3", +"S c #C1BEC9", +"T c #474060", +"U c #31294D", +"V c #716C85", +"W c #65607A", +"X c #625D78", +"Y c #D5D4DB", +"Z c #F7F7F7", +"` c #8B8B8B", +" . c #161616", +".. c #0C0C0C", +"+. c #161800", +"@. c #1A1B00", +"#. c #060600", +"$. c #191A00", +"%. c #393643", +"&. c #47415F", +"*. c #9692A4", +"=. c #D9D8DE", +"-. c #F7F7F8", +";. c #918DA0", +">. c #B8B5C1", +",. c #D1D1D1", +"'. c #212121", +"). c #2D2F00", +"!. c #111200", +"~. c #0B0C00", +"{. c #0F0F00", +"]. c #727175", +"^. c #FEFEFF", +"/. c #9D99AA", +"(. c #DBD9E0", +"_. c #E9E9E9", +":. c #CBCBCB", +"<. c #E0E0E0", +"[. c #6C6C6C", +"}. c #645E00", +"|. c #322F00", +"1. c #515151", +"2. c #A6A6A7", +"3. c #827E93", +"4. c #615C77", +"5. c #EAEAED", +"6. c #DFDFE1", +"7. c #C8BD00", +"8. c #FEF100", +"9. c #302D00", +"0. c #1E1D24", +"a. c #9894A7", +"b. c #B1AEBB", +"c. c #69686F", +"d. c #000001", +"e. c #F9EC00", +"f. c #615C76", +"g. c #5F5A75", +"h. c #413E4D", +"i. c #020203", +"j. c #444000", +"k. c #DED200", +"l. c #1A1A1C", +"m. c #C3C1CB", +"n. c #9D9D9D", +"o. c #202020", +"p. c #383838", +"q. c #4C4C4C", +"r. c #8B8300", +"s. c #FFF200", +"t. c #E8DC00", +"u. c #D1C600", +"v. c #191700", +"w. c #111112", +"x. c #C9C7D0", +"y. c #F1F1F1", +"z. c #F8F8F8", +"A. c #232323", +"B. c #7E7700", +"C. c #EFE200", +"D. c #050408", +"E. c #AEACB9", +"F. c #FEFEFE", +"G. c #1D1D1D", +"H. c #B8AE00", +"I. c #F3E600", +"J. c #B7B5C1", +"K. c #9390A2", +"L. c #BBBBBB", +"M. c #414141", +"N. c #030303", +"O. c #C6BB00", +"P. c #CEC300", +"Q. c #060500", +"R. c #28272A", +"S. c #F4F4F6", +"T. c #605B76", +"U. c #736E86", +"V. c #D8D8D8", +"W. c #727272", +"X. c #101010", +"Y. c #999100", +"Z. c #848486", +"`. c #CCCBD3", +" + c #747087", +".+ c #6D6881", +"++ c #1C1C1C", +"@+ c #242424", +"#+ c #656566", +"$+ c #F6F6F6", +"%+ c #E8E6EA", +"&+ c #706B84", +"*+ c #E3E1E6", +"=+ c #474746", +"-+ c #151515", +";+ c #C8C8C8", +">+ c #AEAEAE", +",+ c #080808", +"'+ c #010100", +")+ c #373639", +"!+ c #FDFCFE", +"~+ c #ABA8B7", +"{+ c #F1F0F3", +"]+ c #6D6980", +"^+ c #0A090E", +"/+ c #95929E", +"(+ c #0A0810", +"_+ c #0D0D0D", +":+ c #050505", +"<+ c #5B5A5C", +"[+ c #F7F6F7", +"}+ c #F4F3F5", +"|+ c #908C9F", +"1+ c #C8C6D0", +"2+ c #837E96", +"3+ c #86868A", +"4+ c #070608", +"5+ c #ECEBEE", +"6+ c #5B5571", +"7+ c #646078", +"8+ c #AFAFB0", +"9+ c #454545", +"0+ c #363636", +"a+ c #7A7A7A", +"b+ c #C8C8C9", +"c+ c #212025", +"d+ c #060607", +"e+ c #969699", +"f+ c #FAFAFA", +"g+ c #F8F8F9", +"h+ c #A29EAF", +"i+ c #F7F6F8", +"j+ c #F0F0F1", +"k+ c #B8B7B9", +"l+ c #E4E4E4", +"m+ c #FDFDFD", +"n+ c #A5A2B2", +"o+ c #3B3456", +"p+ c #A8A5B4", +"q+ c #525252", +"r+ c #848387", +"s+ c #CDCDCD", +"t+ c #8D899C", +"u+ c #494262", +"v+ c #68627C", +"w+ c #40395A", +"x+ c #ECECEC", +"y+ c #020202", +"z+ c #B4B5B5", +"A+ c #0B0B0B", +"B+ c #313232", +"C+ c #E3E3E3", +"D+ c #B1AEBC", +"E+ c #BDBBC6", +"F+ c #3C3556", +"G+ c #898599", +"H+ c #EDEDED", +"I+ c #39393A", +"J+ c #040404", +"K+ c #333333", +"L+ c #F5F5F5", +"M+ c #2B2B2B", +"N+ c #2D2A3D", +"O+ c #B6B4C1", +"P+ c #F5F5F6", +"Q+ c #605A76", +"R+ c #DAD8DF", +"S+ c #F5F4F6", +"T+ c #615B76", +"U+ c #524D6A", +"V+ c #E4E3E8", +"W+ c #D5D5D5", +"X+ c #1B1B1B", +"Y+ c #303030", +"Z+ c #AAABAB", +"`+ c #585464", +" @ c #B0AEBB", +".@ c #A29FAF", +"+@ c #E9E8E9", +"@@ c #787779", +"#@ c #0F0E15", +"$@ c #2D2D2E", +"%@ c #595959", +"&@ c #FAFAFB", +"*@ c #807B92", +"=@ c #B0ADBB", +"-@ c #E8E7EB", +";@ c #3A3258", +">@ c #E6E5EA", +",@ c #DFDEE3", +"'@ c #443E5E", +")@ c #BAB8C4", +"!@ c #C1BFCA", +"~@ c #E0E0E5", +"{@ c #D0CED6", +"]@ c #362F52", +"^@ c #CECCD5", +"/@ c #413A5B", +"(@ c #6A657F", +"_@ c #9793A6", +" ", +" ", +" ", +" . + @ # $ % ", +" & * = * - ; > , ' ; ; ; ) ! ", +" ~ ; ; { ] ; ^ / ( _ ; : < [ ", +" } | 1 2 3 4 5 6 6 7 : 8 9 0 a b ", +" c : d e f g h i j k l 6 m ; n o 6 p q r s ", +" t u ; v w 6 6 x y z A B 6 C ; D E 6 F G ; H ", +" I J ; ; K L 6 6 M N O P E 6 6 6 Q Q M R S T U V W ", +" X Y ; ; ; ; Z ` .6 ..6 6 6 6 6 +.@.#.$.%.&.*.=.-.;. ", +" >.; ; ; ; ; ; = ,.'.).!.~.{.6 6 6 6 6 6 E ].^.; ; /. ", +" (.; ; _.R h :.<.[.6 }.}.6 6 6 6 6 6 6 6 |.E 1.2.4 3. ", +" 4.5.; 6...6 6 6 6 6 6 7.8.9.6 6 6 6 6 6 6 6 6 6 0.a. ", +" V @ b.c.d.6 6 6 6 6 6 6 e.e.6 6 6 6 6 6 6 6 6 6 ", +" f.g.h.6 i.6 6 6 6 6 6 j.8.k.6 6 6 6 6 6 6 6 6 l. ", +" m.; ; n.o.o.p.q.o.6 6 6 6 r.s.t.t.t.t.t.u.v.6 6 w. ", +" x.; ; y.z.; ; ; A.6 6 6 6 B.s.C.t.t.t.t.u.v.6 6 D. ", +" E.; ; ; ; F.; ; G.6 6 6 H.8.I.6 6 6 6 6 6 6 6 6 6 J., ", +" K.; ; F.; : L.M.N.6 6 O.s.P.Q.6 6 6 6 6 6 6 6 6 R.F.S.T. ", +" U.; ; ; V.W.X.6 6 6 6 Y.B.6 6 6 6 6 6 6 6 6 6 Q Z.; ; `. + ", +" .+J ; : ++6 6 6 6 @+..6 6 6 6 6 6 6 6 6 6 6 6 6 #+$+; ; %+&+ ", +" *+; ; =+6 E 6 -+;+>+,+6 6 6 6 6 6 6 6 '+6 6 6 6 )+!+; ; > &+ ", +" ~+; {+]+^+6 6 >+F.; /+(+6 6 6 6 6 6 6 6 _+:+6 6 6 <+[+; ; }+|+ ", +" &+1+! 2+3+4+x ; ; 5+6+7+8+l 9+6 6 6 0+a+b+c+6 6 6 d+e+f+; ; g+@ ", +" h+i+j+k+l+m+; n+o+p+; $+9+6 6 E q+; ; r+6 6 E 6 o s+; ; = t+ ", +" u+> ; ; ; ; ; ; v+w+; ; x+p.6 6 y+D ; ; z+A+6 6 6 B+C+; ; D+ ", +" > ; ; ; ; E+F+G+; ; H+I+6 6 J+K+; ; L+M+6 6 N+O+; P+3 ", +" Q+R+= ; S+T+U+V+; ; W+X+6 6 y+Y+; ; ; Z+q+`+ ", +" @4 .@ X ; ; ; +@@@Y+#@$@%@; ; ; F.&@*@ ", +" =@; ; ; ; ; -@;@>@; ; ; ; = ,@'@ ", +" )@!@~@4 ; ; {@]@^@; ; ; s G+T ", +" /@ (@_@G+ ", +" ", +" ", +" "}; diff --git a/SpiralSound/Plugins/XFadePlugin/XFadePlugin.C b/SpiralSound/Plugins/XFadePlugin/XFadePlugin.C new file mode 100644 index 0000000..91f47f4 --- /dev/null +++ b/SpiralSound/Plugins/XFadePlugin/XFadePlugin.C @@ -0,0 +1,108 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ +#include +#include "XFadePlugin.h" +#include "XFadePluginGUI.h" +#include +#include "SpiralIcon.xpm" + +#define PI 3.141592654 + +extern "C" { +SpiralPlugin* CreateInstance() +{ + return new XFadePlugin; +} + +char** GetIcon() +{ + return SpiralIcon_xpm; +} + +int GetID() +{ + return 0x001b; +} +} + +/////////////////////////////////////////////////////// + +XFadePlugin::XFadePlugin() : +m_Mix(0.5f) +{ + m_PluginInfo.Name="XFade"; + m_PluginInfo.Width=210; + m_PluginInfo.Height=45; + m_PluginInfo.NumInputs=5; + m_PluginInfo.NumOutputs=2; + m_PluginInfo.PortTips.push_back("XFade CV"); + m_PluginInfo.PortTips.push_back("A Left"); + m_PluginInfo.PortTips.push_back("A Right"); + m_PluginInfo.PortTips.push_back("B Left"); + m_PluginInfo.PortTips.push_back("B Right"); + m_PluginInfo.PortTips.push_back("Left"); + m_PluginInfo.PortTips.push_back("Right"); +} + +XFadePlugin::~XFadePlugin() +{ +} + +PluginInfo &XFadePlugin::Initialise(const HostInfo *Host) +{ + return SpiralPlugin::Initialise(Host);; +} + +SpiralGUIType *XFadePlugin::CreateGUI() +{ + m_GUI = new XFadePluginGUI(m_PluginInfo.Width, + m_PluginInfo.Height, + this,m_HostInfo); + m_GUI->hide(); + return m_GUI; +} + +void XFadePlugin::Execute() +{ + float x; + + for (int n=0; nBUFSIZE; n++) + { + if (InputExists(0)) x=(1+GetInput(0,n))/2.0f; + else x=m_Mix; + + SetOutput(0,n,GetInput(1,n)*x + GetInput(3,n)*(1-x)); + SetOutput(1,n,GetInput(2,n)*x + GetInput(4,n)*(1-x)); + } +} + +void XFadePlugin::Randomise() +{ +} + +void XFadePlugin::StreamOut(ostream &s) +{ + s<>version; + s>>m_Mix; +} diff --git a/SpiralSound/Plugins/XFadePlugin/XFadePlugin.h b/SpiralSound/Plugins/XFadePlugin/XFadePlugin.h new file mode 100644 index 0000000..91b0a02 --- /dev/null +++ b/SpiralSound/Plugins/XFadePlugin/XFadePlugin.h @@ -0,0 +1,54 @@ +/* SpiralSound + * Copyleft (C) 2001 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "../SpiralPlugin.h" +#include + +#ifndef XFadePLUGIN +#define XFadePLUGIN + +class XFadePlugin : public SpiralPlugin +{ +public: + XFadePlugin(); + virtual ~XFadePlugin(); + + virtual PluginInfo &Initialise(const HostInfo *Host); + virtual SpiralGUIType *CreateGUI(); + virtual void Execute(); + virtual void StreamOut(ostream &s); + virtual void StreamIn(istream &s); + + // has to be defined in the plugin + virtual void UpdateGUI() { Fl::check(); } + + void SetMix(float s) { m_Mix=s; } + float GetMix() { return m_Mix; } + + void Randomise(); + +private: + float m_Mix; + + friend istream &operator>>(istream &s, XFadePlugin &o); + friend ostream &operator<<(ostream &s, XFadePlugin &o); +}; +istream &operator>>(istream &s, XFadePlugin &o); +ostream &operator<<(ostream &s, XFadePlugin &o); + +#endif diff --git a/SpiralSound/Plugins/XFadePlugin/XFadePlugin.pro b/SpiralSound/Plugins/XFadePlugin/XFadePlugin.pro new file mode 100644 index 0000000..b552ea4 --- /dev/null +++ b/SpiralSound/Plugins/XFadePlugin/XFadePlugin.pro @@ -0,0 +1,17 @@ +HEADERS = ../SpiralPlugin.h \ + ../SpiralPluginGUI.h \ + ../Widgets/Fl_Knob.H \ + ../Widgets/Fl_DragBar.H \ + ../../Sample.h \ + XFadePlugin.h \ + XFadePluginGUI.h + +SOURCES = ../SpiralPlugin.C \ + ../SpiralPluginGUI.C \ + ../Widgets/Fl_Knob.cxx \ + ../Widgets/Fl_DragBar.cxx \ + ../../Sample.C \ + XFadePlugin.C \ + XFadePluginGUI.C + +TARGET = XFadePlugin.so diff --git a/SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.C b/SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.C new file mode 100644 index 0000000..19020e0 --- /dev/null +++ b/SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.C @@ -0,0 +1,56 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "XFadePluginGUI.h" +#include +#include + +static const int GUI_COLOUR = 179; +static const int GUIBG_COLOUR = 144; +static const int GUIBG2_COLOUR = 145; + +//////////////////////////////////////////// + +XFadePluginGUI::XFadePluginGUI(int w, int h,XFadePlugin *o,const HostInfo *Info) : +SpiralPluginGUI(w,h,o) +{ + m_Plugin=o; + + m_Mix = new Fl_Slider(5, 20, 200, 20, ""); + m_Mix->type(FL_HORIZONTAL); + m_Mix->selection_color(GUI_COLOUR); + m_Mix->labelsize(10); + m_Mix->maximum(1); + m_Mix->step(0.0001); + m_Mix->value(0.5); + m_Mix->callback((Fl_Callback*)cb_Mix); + + end(); +} + +void XFadePluginGUI::UpdateValues() +{ + m_Mix->value(m_Plugin->GetMix()); +} + +inline void XFadePluginGUI::cb_Mix_i(Fl_Slider* o, void* v) +{ + m_Plugin->SetMix(o->value()); +} +void XFadePluginGUI::cb_Mix(Fl_Slider* o, void* v) +{ ((XFadePluginGUI*)(o->parent()))->cb_Mix_i(o,v); } \ No newline at end of file diff --git a/SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.h b/SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.h new file mode 100644 index 0000000..2ef0873 --- /dev/null +++ b/SpiralSound/Plugins/XFadePlugin/XFadePluginGUI.h @@ -0,0 +1,54 @@ +/* SpiralPlugin + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include + +#include "XFadePlugin.h" +#include "../SpiralPluginGUI.h" + +#ifndef AmpGUI +#define AmpGUI + + +class XFadePluginGUI : public SpiralPluginGUI +{ +public: + XFadePluginGUI(int w, int h, XFadePlugin *o,const HostInfo *Info); + + virtual void UpdateValues(); + virtual SpiralPlugin* GetPlugin() { return m_Plugin; } + + XFadePlugin *m_Plugin; + +private: + + Fl_Group *GUIFilterGroup; + Fl_Slider *m_Mix; + + //// Callbacks //// + + inline void cb_Mix_i(Fl_Slider* o, void* v); + static void cb_Mix(Fl_Slider*, void*); +}; + +#endif diff --git a/SpiralSound/RiffWav.C b/SpiralSound/RiffWav.C new file mode 100644 index 0000000..ae81a5a --- /dev/null +++ b/SpiralSound/RiffWav.C @@ -0,0 +1,407 @@ +/* SpiralSynth + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include "RiffWav.h" +#include "SpiralInfo.h" +#include +#include +#include + +//#define TRACE_OUT + +const int HEADERLEN = (4+24+8); + +#if __BYTE_ORDER == BIG_ENDIAN + +#define SWAPSHORT(a) (a)=(((a)<<8)|((a)>>8)) +#define SWAPINT(a) (a)=(((a)&0x000000ff)<<24)|(((a)&0x0000ff00)<<8)|(((a)&0x00ff0000)>>8)|(((a)&0xff000000)>>24) +#endif + +int WavFile::Open(string FileName, Mode mode, Channels channels) +{ + if (m_Stream!=NULL) + { + cerr<<"WavFile: File already open ["<16) + { + fseek(m_Stream,m_Header.FmtLength-16,SEEK_CUR); + } + + fread(&m_DataHeader,sizeof(DataHeader),1,m_Stream); + + while (m_DataHeader.DataName[0]!='d' || + m_DataHeader.DataName[1]!='a' || + m_DataHeader.DataName[2]!='t' || + m_DataHeader.DataName[3]!='a') + { + // crawl through the rest of the propriatory headers + // if we need to to try and get to the data header + if (feof(m_Stream) || fseek(m_Stream,-(sizeof(DataHeader)-1),SEEK_CUR)==-1) + { + cerr<<"WavFile: File open error, wrong format ["<1) v=1; + temp[n]=(short)(v*SHRT_MAX); + } + + m_DataHeader.DataLengthBytes+=data.GetLength()*2; + fwrite(temp,sizeof(&temp),data.GetLength()/2,m_Stream); + return 1; +} + +int WavFile::Save(short *data, int Bytes) +{ + if (m_Stream==NULL || data==NULL) + { + return 0; + } + + m_DataHeader.DataLengthBytes+=Bytes; + fwrite(data,sizeof(data),Bytes/4,m_Stream); + return 1; +} + +int WavFile::GetSize() +{ + if (m_Header.FmtBitsPerSample!=8 && m_Header.FmtBitsPerSample!=16) + { + cerr<<"WavFile Warning: FmtBitsPerSample="<1) // mix the channels into a mono buffer + { + #ifdef TRACE_OUT + cerr<<"WavFile::Load - Channels = "<1) // mix the channels into a mono buffer + { + #ifdef TRACE_OUT + cerr<<"WavFile::Load - Channels = "<1) // untangle the interleaved data + { + int SizeBytes=NumSamples*4; // stereo,16bit + short *TempBuf = new short[NumSamples*2]; + if (SizeBytes!=(int)fread(TempBuf,1,SizeBytes,m_Stream)) + { + cerr<<"WavFile: Read chunk error"< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include + +#ifndef WAVFILE +#define WAVFILE + +#include +#include "Sample.h" + +struct CanonicalWavHeader +{ + char RiffName[4]; + int RiffFileLength; + char RiffTypeName[4]; + + char FmtName[4]; + int FmtLength; + short FmtTag; + short FmtChannels; + int FmtSamplerate; + int FmtBytesPerSec; + short FmtBlockAlign; + short FmtBitsPerSample; +}; + +struct DataHeader +{ + char DataName[4]; + int DataLengthBytes; +}; + +class WavFile +{ +public: + WavFile() : m_Stream(NULL), m_Samplerate(44100), m_DataStart(0) {} + ~WavFile() {Close();} + + enum Mode{READ,WRITE}; + enum Channels{MONO,STEREO}; + + int Open(string FileName, Mode mode, Channels channels=MONO); + int Close(); + int Save(Sample &data); + int Load(Sample &data); + int Save(short *data, int Bytes); + int Load(short *data); + int SeekToChunk(int Pos); + int LoadChunk(int NumSamples, Sample &ldata, Sample &rdata); + int GetSize(); // in samples + bool Recording() {return (m_Stream!=NULL);} + void SetSamplerate(int s) { m_Samplerate=s; } + int GetSamplerate() { return m_Header.FmtSamplerate; } + bool IsStereo() { return (m_Header.FmtChannels==2); } + bool IsOpen() { return m_Stream!=NULL; } + +private: + + FILE *m_Stream; + int m_Samplerate; + + long m_DataStart; + long m_CurSeekPos; + + CanonicalWavHeader m_Header; + DataHeader m_DataHeader; +}; + +#endif diff --git a/SpiralSound/Sample.C b/SpiralSound/Sample.C new file mode 100644 index 0000000..6d7766d --- /dev/null +++ b/SpiralSound/Sample.C @@ -0,0 +1,316 @@ +/* SpiralLoops + * Copyleft (C) 2000 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include "Sample.h" +#include + +Sample::Sample(int Len) : +m_IsEmpty(true), +m_DataGranularity(1),//512), +m_Data(NULL), +m_Length(0) +{ + if (Len) + { + Allocate(Len); + } +} + + +Sample::Sample(const Sample &rhs): +m_IsEmpty(true), +m_DataGranularity(512), +m_Data(NULL), +m_Length(0) +{ + *this=rhs; +} + + +Sample::Sample(float *S, int Len): +m_IsEmpty(false), +m_DataGranularity(512), +m_Data(NULL), +m_Length(0) +{ + assert(S); + Allocate(Len); + memcpy(m_Data,S,GetLengthInBytes()); +} + + +Sample::~Sample() +{ + Clear(); +} + + + +bool Sample::Allocate(int Size) +{ + Clear(); + m_Data = new float[Size]; + m_Length=Size; + + memset(m_Data,0,GetLengthInBytes()); + + return (m_Data); +} + +void Sample::Clear() +{ + m_IsEmpty=true; + + if (m_Data) + { + delete[] m_Data; + m_Length=0; + m_Data=NULL; + } +} + +void Sample::Zero() +{ + m_IsEmpty=true; + memset(m_Data,0,GetLengthInBytes()); +} + +void Sample::Set(float Val) +{ + m_IsEmpty=false; + + for (int n=0; nGetLength()) ToPos=0; + ToPos++; + } +} + +void Sample::Remove(int Start, int End) +{ + // do some checking + assert(EndGetLength()) End=GetLength(); + if (Start<0) Start=0; + + // calc lengths and allocate memory + int CutLen = End - Start; + // has to be granulated by the buffer size + CutLen-=CutLen % m_DataGranularity; + + int NewLen = GetLength()-CutLen; + float *TempBuf = new float[NewLen]; + + int ToPos=0; + + for (int FromPos=0; FromPosEnd) + { + TempBuf[ToPos]=m_Data[FromPos]; + ToPos++; + // check the position is in range of the calculated length + assert(ToPos<=NewLen); + } + } + + Clear(); + m_Data=TempBuf; + m_Length=NewLen; +} + +void Sample::Reverse(int Start, int End) +{ + // do some checking + assert(EndGetLength()) End=GetLength(); + + int NewLen = End-Start; + float *TempBuf = new float[NewLen]; + int ToPos=0; + int FromPos=0; + + // get the reversed sample + for (FromPos=End; FromPos>Start; FromPos--) + { + TempBuf[ToPos]=m_Data[FromPos]; + ToPos++; + assert(ToPos<=NewLen); + } + + FromPos=0; + + // overwrite back into place + for (ToPos=Start; ToPosLength) FromPos-=Length; + + // get the offset sample + for (ToPos=0; ToPos=Length) FromPos=0; + } + + Clear(); + m_Data=TempBuf; + m_Length=Length; +} + +void Sample::GetRegion(Sample &S, int Start, int End) +{ + // do some checking + assert(End0 && NewLength<=GetLength()); + + float *temp = new float[NewLength]; + + for(int n=0; n + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef SAMPLE +#define SAMPLE + +#include +#include +#include +#include "SpiralInfo.h" + +//#define DEBUG + +inline float Linear(float bot,float top,float pos,float val1,float val2) +{ + float t=(pos-bot)/(top-bot); + return val1*t + val2*(1.0f-t); +} + +inline bool feq(float a, float b, float tol) +{ + return (a>b-tol && a=0 && i=0 && ii=0 && i + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include "FL/fl_draw.h" +#include "FL/fl_message.h" + +#include "SpiralInfo.h" + +float RandFloat(float s, float e) +{ + return s+((rand()%10000/10000.0)*(e-s)); +} + +void SpiralInfo::LoadPrefs() +{ + string rcfn(m_HomeDir+"/"+GetResFileName()); + ifstream i(rcfn.c_str()); + + if (!i) + { + cerr<<"Creating "<>temp>>temp>>temp; + s>>temp>>temp>>m_Version; + s>>temp>>temp>>BUFSIZE; + s>>temp>>temp>>FRAGSIZE; + s>>temp>>temp>>FRAGCOUNT; + s>>temp>>temp>>SAMPLERATE; + s>>temp>>temp>>WANTMIDI; + s>>temp>>temp>>FILTERGRAN; + s>>temp>>temp>>OUTPUTFILE; + s>>temp>>temp>>MIDIFILE; + s>>temp>>temp>>REALTIMEOUT; + s>>temp>>temp>>POLY; + //s>>temp>>temp>>GUI_COLOUR; + //s>>temp>>temp>>GUIBG_COLOUR; + //s>>temp>>temp>>GUIBG2_COLOUR; +} + +void SpiralInfo::StreamOutPrefs(ostream &s) +{ + s<<"SpiralSound resource file"< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "SpiralSynthModular.h" +#include "SpiralSound/PluginManager.h" + +#include "GUI/SSM.xpm" +#include "GUI/load.xpm" +#include "GUI/save.xpm" +#include "GUI/new.xpm" +#include "GUI/options.xpm" +#include "GUI/edit.xpm" +#include "GUI/comment.xpm" + +const static string LABEL = "SpiralSynthModular 0.1.1b1"; +static string TITLEBAR; + +static const int FILE_VERSION = 3; +static int Numbers[512]; + +static const int MAIN_WIDTH = 700; +static const int MAIN_HEIGHT = 300; +static const int SLIDER_WIDTH = 15; +static const int TOOLBOX_HEIGHT = MAIN_HEIGHT-40; +static const int TOOLBOX_WIDTH = 132+SLIDER_WIDTH; +static const int ICON_DEPTH = 3; +static const int COMMENT_ID = -1; + +using namespace std; + +map SynthModular::m_DeviceWinMap; +bool SynthModular::m_CallbackUpdateMode = false; + +////////////////////////////////////////////////////////// + +DeviceWin::~DeviceWin() +{ +} + +////////////////////////////////////////////////////////// + +SynthModular::SynthModular(): +m_NextID(0), +m_NextPluginButton(1), +m_NextPluginButtonXPos(5), +m_NextPluginButtonYPos(20) +{ + m_Info.BUFSIZE = SpiralInfo::BUFSIZE; + m_Info.FRAGSIZE = SpiralInfo::FRAGSIZE; + m_Info.FRAGCOUNT = SpiralInfo::FRAGCOUNT; + m_Info.SAMPLERATE = SpiralInfo::SAMPLERATE; + m_Info.OUTPUTFILE = SpiralInfo::OUTPUTFILE; + m_Info.MIDIFILE = SpiralInfo::MIDIFILE; + m_Info.POLY = SpiralInfo::POLY; + //m_Info.GUI_COLOUR = SpiralInfo::GUI_COLOUR; + + for (int n=0; n<512; n++) Numbers[n]=n; +} + +////////////////////////////////////////////////////////// + +SynthModular::~SynthModular() +{ + ClearUp(); + PluginManager::Get()->PackUpAndGoHome(); +} + +////////////////////////////////////////////////////////// + +void SynthModular::ClearUp() +{ + for(map::iterator i=m_DeviceWinMap.begin(); + i!=m_DeviceWinMap.end(); i++) + { + if (i->second->m_DeviceGUI->GetPluginWindow()) + { + i->second->m_DeviceGUI->GetPluginWindow()->hide(); + m_MainWindow->remove(i->second->m_DeviceGUI->GetPluginWindow()); + } + // deleted by Canvas::Remove()? seems to cause random crashes + //delete i->second->m_DeviceGUI; + delete i->second->m_Device; + } + + m_Canvas->Clear(); + m_DeviceWinMap.clear(); + m_NextID=0; +} + +////////////////////////////////////////////////////////// + +void SynthModular::Update() +{ + // run the plugins + list ExecutionOrder = m_Canvas->GetGraph()->GetSortedList(); + for (list::reverse_iterator i=ExecutionOrder.rbegin(); + i!=ExecutionOrder.rend(); i++) + { + // use the graphsort order to remove internal latency + map::iterator di=m_DeviceWinMap.find(*i); + if (di!=m_DeviceWinMap.end() && di->second->m_Device) + { + di->second->m_Device->Execute(); + } + } +} + +////////////////////////////////////////////////////////// + +void SynthModular::UpdatePluginGUIs() +{ + // see if any need deleting + for (map::iterator i=m_DeviceWinMap.begin(); + i!=m_DeviceWinMap.end(); i++) + { + if (i->second->m_DeviceGUI->Killed()) + { + if (i->second->m_DeviceGUI->GetPluginWindow()) + { + i->second->m_DeviceGUI->GetPluginWindow()->hide(); + m_MainWindow->remove(i->second->m_DeviceGUI->GetPluginWindow()); + } + i->second->m_DeviceGUI->Clear(); + m_Canvas->RemoveDevice(i->second->m_DeviceGUI); + // deleted by Canvas::Remove()? seems to cause random crashes + //delete i->second->m_DeviceGUI; + if (i->second->m_Device) delete i->second->m_Device; + m_DeviceWinMap.erase(i); + break; + } + } +} + +////////////////////////////////////////////////////////// + +SpiralWindowType *SynthModular::CreateWindow() +{ + int xoff=0, yoff=10, but=64, gap=MAIN_HEIGHT/4, n=0; + + m_TopWindow = new SpiralWindowType(MAIN_WIDTH, MAIN_HEIGHT*2, LABEL.c_str()); + m_TopWindow->resizable(m_TopWindow); + + m_TopTile = new Fl_Tile(0,0,MAIN_WIDTH, MAIN_HEIGHT*2, ""); + m_TopWindow->add(m_TopTile); + + m_MainWindow = new Fl_Tile(0,0,MAIN_WIDTH, MAIN_HEIGHT, ""); + m_MainWindow->color(SpiralSynthModularInfo::GUICOL_Canvas); + //m_MainWindow->callback((Fl_Callback*)cb_Close); + m_MainWindow->user_data((void*)(this)); + m_TopTile->add(m_MainWindow); + + m_MainButtons = new Fl_Group(0, 0, but, MAIN_HEIGHT, ""); + m_MainButtons->type(1); + m_MainButtons->color(SpiralSynthModularInfo::GUICOL_Tool); + m_MainButtons->box(FL_FLAT_BOX); + m_MainButtons->user_data((void*)(this)); + m_MainWindow->add(m_MainButtons); + + m_AppScroll = new Fl_Scroll(but, 0, MAIN_WIDTH-but, MAIN_HEIGHT, ""); + m_AppScroll->scrollbar.align(FL_ALIGN_RIGHT); + m_MainWindow->add(m_AppScroll); + //m_MainWindow->resizable(m_AppScroll); + + m_AppGroup = new Fl_Group(-5000, -5000, 10000, 10000, "AppGroup"); + m_AppGroup->type(1); + m_AppGroup->box(FL_FLAT_BOX); + m_AppGroup->labeltype(FL_ENGRAVED_LABEL); + m_AppGroup->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + m_AppGroup->color(SpiralSynthModularInfo::GUICOL_Canvas); + m_AppScroll->add(m_AppGroup); + + m_Load = new Fl_Button(xoff, 5+yoff, but, but, ""); + m_Load->box(FL_NO_BOX); + Fl_Pixmap *tPix = new Fl_Pixmap(load_xpm); + m_Load->image(tPix->copy(tPix->w(),tPix->h())); + m_Load->selection_color(SpiralSynthModularInfo::GUICOL_Tool); + m_Load->tooltip("Load a design file"); + m_Load->callback((Fl_Callback*)cb_Load); + m_MainButtons->add(m_Load); + n++; + + m_Save = new Fl_Button(xoff, n*gap+yoff, but, but, ""); + m_Save->box(FL_NO_BOX); + tPix = new Fl_Pixmap(save_xpm); + m_Save->image(tPix->copy(tPix->w(),tPix->h())); + delete tPix; + m_Save->selection_color(SpiralSynthModularInfo::GUICOL_Tool); + m_Save->tooltip("Save a design file"); + m_Save->callback((Fl_Callback*)cb_Save); + m_MainButtons->add(m_Save); + n++; + + m_New = new Fl_Button(xoff, n*gap+yoff, but, but, ""); + m_New->box(FL_NO_BOX); + tPix = new Fl_Pixmap(new_xpm); + m_New->image(tPix->copy(tPix->w(),tPix->h())); + delete tPix; + m_New->selection_color(SpiralSynthModularInfo::GUICOL_Tool); + m_New->tooltip("New design"); + m_New->callback((Fl_Callback*)cb_New); + m_MainButtons->add(m_New); + n++; + + m_Options = new Fl_Button(xoff, n*gap+yoff, but, but, ""); + m_Options->box(FL_NO_BOX); + tPix = new Fl_Pixmap(options_xpm); + m_Options->image(tPix->copy(tPix->w(),tPix->h())); + delete tPix; + m_Options->selection_color(SpiralSynthModularInfo::GUICOL_Tool); + m_Options->tooltip("Options"); + m_Options->callback((Fl_Callback*)cb_Rload); + m_MainButtons->add(m_Options); + n++; + + /*m_OpenEditor = new Fl_Button(5+xoff, n*gap+yoff, but, but, ""); + m_OpenEditor->box(FL_NO_BOX); + tPix = new Fl_Pixmap(edit_xpm); + m_OpenEditor->image(tPix->copy(tPix->w(),tPix->h())); + delete tPix; + m_OpenEditor->selection_color(SpiralSynthModularInfo::GUICOL_Tool); + m_OpenEditor->tooltip("Open/Close Editor"); + m_OpenEditor->callback((Fl_Callback*)cb_OpenEditor); + m_MainButtons->add(m_OpenEditor); + n++;*/ + + ///////////////// + + m_EditorWindow = new Fl_Tile(0,MAIN_HEIGHT,MAIN_WIDTH, MAIN_HEIGHT, ""); + m_EditorWindow->color(SpiralSynthModularInfo::GUICOL_Tool); + m_TopTile->add(m_EditorWindow); + + int edy = MAIN_HEIGHT; + + m_ToolBox = new Fl_Scroll(0,0+edy,TOOLBOX_WIDTH, MAIN_HEIGHT, ""); + m_ToolBox->type(Fl_Scroll::VERTICAL_ALWAYS); + m_ToolBox->box(FL_FLAT_BOX); + m_ToolBox->labeltype(FL_ENGRAVED_LABEL); + m_ToolBox->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + m_ToolBox->scrollbar.align(FL_ALIGN_LEFT); + m_ToolBox->color(SpiralSynthModularInfo::GUICOL_Tool); + m_ToolBox->user_data((void*)(this)); + m_EditorWindow->add(m_ToolBox); +// m_EditorWindow->resizable(m_ToolBox); + + Fl_Box *Label = new Fl_Box(5,3+edy,100,20,""); + Label->box(FL_FLAT_BOX); + Label->color(SpiralSynthModularInfo::GUICOL_Tool); + Label->labeltype(FL_ENGRAVED_LABEL); + Label->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + m_ToolBox->add(Label); + + m_ToolPack = new Fl_Pack(SLIDER_WIDTH+5,5+edy,TOOLBOX_WIDTH-10, TOOLBOX_HEIGHT-40,""); + m_ToolPack->type(FL_VERTICAL); + m_ToolPack->box(FL_NO_BOX); + m_ToolPack->color(SpiralSynthModularInfo::GUICOL_Tool); + m_ToolPack->user_data((void*)(this)); + m_ToolBox->add(m_ToolPack); + + xoff=0; yoff=TOOLBOX_HEIGHT; + + m_CanvasScroll = new Fl_Scroll(TOOLBOX_WIDTH, 0+edy, MAIN_WIDTH-TOOLBOX_WIDTH, MAIN_HEIGHT, ""); + m_EditorWindow->add(m_CanvasScroll); + + m_Canvas = new Fl_Canvas(-5000, -5000, 10000, 10000, "Canvas"); + m_Canvas->type(1); + m_Canvas->box(FL_FLAT_BOX); + m_Canvas->labeltype(FL_ENGRAVED_LABEL); + m_Canvas->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + m_Canvas->color(SpiralSynthModularInfo::GUICOL_Canvas); + m_Canvas->user_data((void*)(this)); + m_Canvas->SetConnectionCallback((Fl_Callback*)cb_Connection); + m_Canvas->SetUnconnectCallback((Fl_Callback*)cb_Unconnect); + m_Canvas->SetAddDeviceCallback((Fl_Callback*)cb_NewDeviceFromMenu); + m_CanvasScroll->add(m_Canvas); + + /*m_NewComment = new Fl_Button(MAIN_WIDTH-15, MAIN_HEIGHT*2-15, 15, 30, ""); + m_NewComment->box(FL_NO_BOX); + m_Canvas->align(FL_ALIGN_TOP_LEFT|FL_ALIGN_INSIDE); + tPix = new Fl_Pixmap(comment_xpm); + m_NewComment->image(tPix->copy(tPix->w(),tPix->h())); + delete tPix; + m_NewComment->color(SpiralSynthModularInfo::GUICOL_Button); + m_NewComment->selection_color(SpiralSynthModularInfo::GUICOL_Tool); + m_NewComment->type(0); + m_NewComment->shortcut(FL_F + 10); + m_NewComment->tooltip("New comment in editor"); + m_NewComment->user_data((void*)(this)); + m_NewComment->callback((Fl_Callback*)cb_NewComment); + m_EditorWindow->add(m_NewComment);*/ + + m_SettingsWindow = new SettingsWindow; + m_SettingsWindow->RegisterApp(this); + + return m_TopWindow; +} + +////////////////////////////////////////////////////////// + +void SynthModular::LoadPlugins() +{ + + int Width = 40; + int Height = 40; + + int SWidth = 392; + int SHeight = 187; + + Fl_Pixmap pic(SSM_xpm); + + Fl_Double_Window* Splash = new Fl_Double_Window((Fl::w()/2)-(SWidth/2), + (Fl::h()/2)-(SHeight/2), + SWidth,SHeight,"SSM"); + Splash->border(0); + + Fl_Box* pbut = new Fl_Box(0,8,SWidth,SHeight,""); + pbut->box(FL_NO_BOX); + pic.label(pbut); + Fl_Box *splashtext = new Fl_Box(5,SHeight-20,200,20,"Loading..."); + splashtext->labelsize(10); + splashtext->box(FL_NO_BOX); + splashtext->align(FL_ALIGN_INSIDE|FL_ALIGN_LEFT); + Splash->add(pbut); + Splash->add(splashtext); + Splash->show(); + + int ID=-1; + int Icon=0; + Fl_Pack *IconPack; + + IconPack = new Fl_Pack(0,0,TOOLBOX_WIDTH-SLIDER_WIDTH,Height,""); + IconPack->type(FL_HORIZONTAL); + IconPack->color(SpiralSynthModularInfo::GUICOL_Tool); + IconPack->user_data((void*)(this)); + m_ToolPack->add(IconPack); + + for (vector::iterator i=SpiralSynthModularInfo::PLUGINVEC.begin(); + i!=SpiralSynthModularInfo::PLUGINVEC.end(); i++) + { + string Fullpath=SpiralSynthModularInfo::PLUGIN_PATH+*i; + + ID=PluginManager::Get()->LoadPlugin(Fullpath.c_str()); + if (ID!=PluginError) + { + if (Icon>=ICON_DEPTH) + { + Icon=0; + IconPack = new Fl_Pack(0,0,TOOLBOX_WIDTH-SLIDER_WIDTH,Height,""); + IconPack->type(FL_HORIZONTAL); + IconPack->color(SpiralSynthModularInfo::GUICOL_Tool); + IconPack->user_data((void*)(this)); + m_ToolPack->add(IconPack); + } + + Fl_Button *NewButton = new Fl_Button(0,0,Width,Height,""); + NewButton->labelsize(10); + + Fl_Pixmap *tPix = new Fl_Pixmap(PluginManager::Get()->GetPlugin(ID)->GetIcon()); + NewButton->image(tPix->copy(tPix->w(),tPix->h())); + delete tPix; + + IconPack->add(NewButton); + NewButton->type(0); + NewButton->box(FL_PLASTIC_UP_BOX); + NewButton->align(FL_ALIGN_INSIDE|FL_ALIGN_TOP); + NewButton->color(SpiralSynthModularInfo::GUICOL_Button); + NewButton->selection_color(SpiralSynthModularInfo::GUICOL_Tool); + + string tooltip=*i; + // find the first / if there is one, and get rid of everything before and including it + unsigned int p = tooltip.find ('/'); + if (p < tooltip.length()) tooltip.erase (0, p); + // find last . and get rid of everything after and including it + p = tooltip.rfind ('.'); + unsigned int l = tooltip.length (); + if (p < l) tooltip.erase (p, l); + m_Canvas->AddPluginName (tooltip, PluginManager::Get()->GetPlugin(ID)->ID); + splashtext->label (tooltip.c_str()); + Splash->redraw(); + NewButton->tooltip (tooltip.c_str()); + + NewButton->callback((Fl_Callback*)cb_NewDevice,&Numbers[ID]); + NewButton->show(); + m_DeviceVec.push_back(NewButton); + Icon++; + + m_ToolBox->redraw(); + + m_NextPluginButton++; + Fl::check(); + } + } + + Splash->hide(); + delete Splash; +} + +////////////////////////////////////////////////////////// + +DeviceGUIInfo SynthModular::BuildDeviceGUIInfo(PluginInfo &PInfo) +{ + DeviceGUIInfo Info; + int Height=50; + + // tweak the size if we have too many ins/outs + if (PInfo.NumInputs>4 || PInfo.NumOutputs>4) + { + if (PInfo.NumInputsGetPlugin(n); + + if (!Plugin) return NULL; + + nlw->m_Device=Plugin->CreateInstance(); + + if (!nlw->m_Device) + { + return NULL; + } + nlw->m_Device->SetUpdateCallback(cb_Update); + nlw->m_Device->SetParent((void*)this); + + PluginInfo PInfo = nlw->m_Device->Initialise(&m_Info); + SpiralGUIType *temp = nlw->m_Device->CreateGUI(); + Fl_Pixmap *Pix = new Fl_Pixmap(Plugin->GetIcon()); + nlw->m_PluginID = n; + + if (temp) + { + temp->position(200,50); + m_AppGroup->add(temp); + m_MainWindow->redraw(); + } + DeviceGUIInfo Info=BuildDeviceGUIInfo(PInfo); + Info.XPos = x; //TOOLBOX_WIDTH+(rand()%400); + Info.YPos = y; //rand()%400; + + nlw->m_DeviceGUI = new Fl_DeviceGUI(Info, temp, Pix); + m_Canvas->add(nlw->m_DeviceGUI); + m_Canvas->redraw(); + + return nlw; +} + +////////////////////////////////////////////////////////// + +void SynthModular::AddDevice(int n, int x=TOOLBOX_WIDTH+50, int y=400) +{ + //cerr<<"Adding "<m_DeviceGUI->SetID(ID); + temp->m_Device->SetUpdateInfoCallback(ID,cb_UpdatePluginInfo); + m_DeviceWinMap[ID]=temp; + } +} + +////////////////////////////////////////////////////////// + +DeviceWin* SynthModular::NewComment(int n, int x=TOOLBOX_WIDTH+50, int y=400) +{ + DeviceWin *nlw = new DeviceWin; + + nlw->m_Device=NULL; + nlw->m_PluginID = COMMENT_ID; + + DeviceGUIInfo Info; + + Info.XPos = x; + Info.YPos = y; + Info.Width = 50; + Info.Height = 20; + Info.NumInputs = 0; + Info.NumOutputs = 0; + Info.Name = ""; + + nlw->m_DeviceGUI = new Fl_CommentGUI(Info, NULL, NULL); + + m_Canvas->add(nlw->m_DeviceGUI); + m_Canvas->redraw(); + + return nlw; +} + +////////////////////////////////////////////////////////// + +void SynthModular::AddComment(int n) +{ + //cerr<<"Adding "<m_DeviceGUI->SetID(ID); + m_DeviceWinMap[ID]=temp; + } +} + +////////////////////////////////////////////////////////// + +void SynthModular::UpdateHostInfo() +{ + std::stringstream str; + str<<*this; + + ClearUp(); + + // update the settings + m_Info.BUFSIZE = SpiralInfo::BUFSIZE; + m_Info.FRAGSIZE = SpiralInfo::FRAGSIZE; + m_Info.FRAGCOUNT = SpiralInfo::FRAGCOUNT; + m_Info.SAMPLERATE = SpiralInfo::SAMPLERATE; + m_Info.OUTPUTFILE = SpiralInfo::OUTPUTFILE; + m_Info.MIDIFILE = SpiralInfo::MIDIFILE; + m_Info.POLY = SpiralInfo::POLY; + + str>>*this; +} + +////////////////////////////////////////////////////////// + +void SynthModular::cb_Update(void* o, bool mode) +{ + m_CallbackUpdateMode=mode; + ((SynthModular*)o)->Update(); +} + +////////////////////////////////////////////////////////// + +istream &operator>>(istream &s, SynthModular &o) +{ + string dummy; + int ver; + s>>dummy>>dummy>>dummy>>ver; + + if (ver>FILE_VERSION) + { + SpiralInfo::Alert("Bad file, or more recent version."); + return s; + } + + if (ver>2) + { + int MainWinX,MainWinY,MainWinW,MainWinH; + int EditWinX,EditWinY,EditWinW,EditWinH; + + s>>MainWinX>>MainWinY>>MainWinW>>MainWinH; + s>>EditWinX>>EditWinY>>EditWinW>>EditWinH; + + //o.m_MainWindow->resize(MainWinX,MainWinY,MainWinW,MainWinH); + //o.m_EditorWindow->resize(EditWinX,EditWinY,EditWinW,EditWinH); + } + + int Num, ID, PluginID, x,y,ps,px,py; + s>>dummy>>Num; + + for(int n=0; n>dummy; //cerr<>ID; //cerr<>dummy; //cerr<>PluginID; //cerr<>x>>y; + if (ver>1) s>>ps>>px>>py; + + // Check we're not duplicating an ID + if (o.m_DeviceWinMap.find(ID)!=o.m_DeviceWinMap.end()) + { + SpiralInfo::Alert("Duplicate device ID found in file - aborting load"); + return s; + } + + if (PluginID==COMMENT_ID) + { + DeviceWin* temp = o.NewComment(PluginID, x, y); + if (temp) + { + temp->m_DeviceGUI->SetID(ID); + o.m_DeviceWinMap[ID]=temp; + ((Fl_CommentGUI*)(o.m_DeviceWinMap[ID]->m_DeviceGUI))->StreamIn(s); // load the plugin + if (o.m_NextID<=ID) o.m_NextID=ID+1; + } + } + else + { + DeviceWin* temp = o.NewDeviceWin(PluginID, x, y); + if (temp) + { + temp->m_DeviceGUI->SetID(ID); + temp->m_Device->SetUpdateInfoCallback(ID,o.cb_UpdatePluginInfo); + o.m_DeviceWinMap[ID]=temp; + o.m_DeviceWinMap[ID]->m_Device->StreamIn(s); // load the plugin + if (ver>1 && o.m_DeviceWinMap[ID]->m_DeviceGUI->GetPluginWindow()) + { + // position the plugin window in the main window + o.m_DeviceWinMap[ID]->m_DeviceGUI->GetPluginWindow()->position(px,py); + + if (ps) o.m_DeviceWinMap[ID]->m_DeviceGUI->GetPluginWindow()->show(); + else o.m_DeviceWinMap[ID]->m_DeviceGUI->GetPluginWindow()->hide(); + + // load external files + o.m_DeviceWinMap[ID]->m_Device->LoadExternalFiles(o.m_FilePath+"_files/"); + } + + if (o.m_NextID<=ID) o.m_NextID=ID+1; + } + else + { + // can't really recover if the plugin ID doesn't match a plugin, as + // we have no idea how much data in the stream belongs to this plugin + SpiralInfo::Alert("Error in stream, can't really recover data from here on."); + return s; + } + } + } + + s>>*o.m_Canvas; + + return s; +} + +////////////////////////////////////////////////////////// + +ostream &operator<<(ostream &s, SynthModular &o) +{ + s<<"SpiralSynthModular File Ver "<2) + { + s<x()<<" "<y()<<" "; + s<w()<<" "<h()<<" "; + s<x()<<" "<y()<<" "; + s<w()<<" "<h()<::iterator i=o.m_DeviceWinMap.begin(); + i!=o.m_DeviceWinMap.end(); i++) + { + s<first<<" "; // save the id + s<<"Plugin "; + s<second->m_PluginID<second->m_DeviceGUI->x()<<" "; + s<second->m_DeviceGUI->y()<<" "; + + if (i->second->m_DeviceGUI->GetPluginWindow()) + { + s<second->m_DeviceGUI->GetPluginWindow()->visible()<<" "; + s<second->m_DeviceGUI->GetPluginWindow()->x()<<" "; + s<second->m_DeviceGUI->GetPluginWindow()->y()<<" "; + } + else + { + s<<0<<" "<<0<<" "<<0; + } + + s<second->m_PluginID==COMMENT_ID) + { + // save the comment gui + ((Fl_CommentGUI*)(i->second->m_DeviceGUI))->StreamOut(s); + } + else + { + // save the plugin + i->second->m_Device->StreamOut(s); + } + s<second->m_Device && i->second->m_Device->SaveExternalFiles(o.m_FilePath+"_files/")) + { + ExternalDirUsed=true; + } + } + + s<hide(); + delete m_SettingsWindow; + m_EditorWindow->hide(); + delete m_EditorWindow; + o->hide(); +} + +void SynthModular::cb_Close(Fl_Window* o, void* v) +{((SynthModular*)(o->user_data()))->cb_Close_i(o,v);} + +////////////////////////////////////////////////////////// + +inline void SynthModular::cb_Load_i(Fl_Button* o, void* v) +{ + if (m_DeviceWinMap.size()>0 && !fl_ask("Load - Loose changes to current design?")) + { + return; + } + + char *fn=fl_file_chooser("Load a design", "*.ssm", NULL); + + if (fn && fn!='\0') + { + ifstream inf(fn); + + if (inf) + { + m_FilePath=fn; + + ClearUp(); + inf>>*this; + + TITLEBAR=LABEL+" "+fn; + m_TopWindow->label(TITLEBAR.c_str()); + } + } +} + +void SynthModular::cb_Load(Fl_Button* o, void* v) +{((SynthModular*)(o->parent()->user_data()))->cb_Load_i(o,v);} + +////////////////////////////////////////////////////////// + +inline void SynthModular::cb_Save_i(Fl_Button* o, void* v) +{ + char *fn=fl_file_chooser("Save a design", "*.ssm", NULL); + + if (fn && fn!='\0') + { + ifstream ifl(fn); + if (ifl) + { + if (!fl_ask("File [%s] exists, overwrite?",fn)) + { + return; + } + } + + ofstream of(fn); + + if (of) + { + m_FilePath=fn; + + of<<*this; + + TITLEBAR=LABEL+" "+fn; + m_TopWindow->label(TITLEBAR.c_str()); + } + } +} +void SynthModular::cb_Save(Fl_Button* o, void* v) +{((SynthModular*)(o->parent()->user_data()))->cb_Save_i(o,v);} + +////////////////////////////////////////////////////////// + +inline void SynthModular::cb_New_i(Fl_Button* o, void* v) +{ + if (m_DeviceWinMap.size()>0 && !fl_ask("New - Loose changes to current design?")) + { + return; + } + + m_TopWindow->label(TITLEBAR.c_str()); + + ClearUp(); +} +void SynthModular::cb_New(Fl_Button* o, void* v) +{((SynthModular*)(o->parent()->user_data()))->cb_New_i(o,v);} + +////////////////////////////////////////////////////////// + +inline void SynthModular::cb_NewDevice_i(Fl_Button* o, void* v) +{ + AddDevice(*((int*)v)); +} +void SynthModular::cb_NewDevice(Fl_Button* o, void* v) +{((SynthModular*)(o->parent()->user_data()))->cb_NewDevice_i(o,v);} + +////////////////////////////////////////////////////////// + +inline void SynthModular::cb_NewDeviceFromMenu_i(Fl_Canvas* o, void* v) +{ + AddDevice(*((int*)v),*((int*)v+1),*((int*)v+2)); +} +void SynthModular::cb_NewDeviceFromMenu(Fl_Canvas* o, void* v) +{((SynthModular*)(o->user_data()))->cb_NewDeviceFromMenu_i(o,v);} + +////////////////////////////////////////////////////////// + +inline void SynthModular::cb_NewComment_i(Fl_Button* o, void* v) +{ + AddComment(-1); +} +void SynthModular::cb_NewComment(Fl_Button* o, void* v) +{((SynthModular*)(o->user_data()))->cb_NewComment_i(o,v);} + +////////////////////////////////////////////////////////// + +inline void SynthModular::cb_OpenEditor_i(Fl_Button* o, void* v) +{ + //if (m_EditorWindow->shown()) m_EditorWindow->hide(); + //else m_EditorWindow->show(); +} +void SynthModular::cb_OpenEditor(Fl_Button* o, void* v) +{((SynthModular*)(o->parent()->user_data()))->cb_OpenEditor_i(o,v);} + +////////////////////////////////////////////////////////// + +inline void SynthModular::cb_Rload_i(Fl_Button* o, void* v) +{ + m_SettingsWindow->show(); + + /*PluginManager::Get()->UnloadAll(); + + m_ToolBox->remove(m_ToolPack); + delete m_ToolPack; + + m_ToolPack = new Fl_Pack(5,20,TOOLBOX_WIDTH-10, TOOLBOX_HEIGHT-40,""); + m_ToolPack->type(FL_VERTICAL); + m_ToolPack->box(FL_NO_BOX); + m_ToolPack->color(SpiralSynthModularInfo::GUICOL_Tool); + m_ToolPack->user_data((void*)(this)); + m_ToolBox->add(m_ToolPack); + m_ToolBox->redraw(); + + LoadPlugins();*/ +} +void SynthModular::cb_Rload(Fl_Button* o, void* v) +{((SynthModular*)(o->parent()->user_data()))->cb_Rload_i(o,v);} + +////////////////////////////////////////////////////////// + +inline void SynthModular::cb_Connection_i(Fl_Canvas* o, void* v) +{ + CanvasWire *Wire; + Wire=(CanvasWire*)v; + + map::iterator si=m_DeviceWinMap.find(Wire->OutputID); + if (si==m_DeviceWinMap.end()) + { + char num[32]; + sprintf(num,"%d",Wire->OutputID); + SpiralInfo::Alert("Warning: Connection problem - can't find source "+string(num)); + return; + } + + map::iterator di=m_DeviceWinMap.find(Wire->InputID); + if (di==m_DeviceWinMap.end()) + { + char num[32]; + sprintf(num,"%d",Wire->InputID); + SpiralInfo::Alert("Warning: Connection problem - can't find destination "+string(num)); + return; + } + + Sample *sample=NULL; + + if (!si->second->m_Device->GetOutput(Wire->OutputPort,&sample)) + { + char num[32]; + sprintf(num,"%d,%d",Wire->OutputID,Wire->OutputPort); + SpiralInfo::Alert("Warning: Connection problem - can't find source output "+string(num)); + return; + } + + if (!di->second->m_Device->SetInput(Wire->InputPort,(const Sample*)sample)) + { + char num[32]; + sprintf(num,"%d,%d",Wire->InputID,Wire->InputPort); + SpiralInfo::Alert("Warning: Connection problem - can't find source input "+string(num)); + return; + } + +} +void SynthModular::cb_Connection(Fl_Canvas* o, void* v) +{((SynthModular*)(o->user_data()))->cb_Connection_i(o,v);} + +////////////////////////////////////////////////////////// + +inline void SynthModular::cb_Unconnect_i(Fl_Canvas* o, void* v) +{ + CanvasWire *Wire; + Wire=(CanvasWire*)v; + + //cerr<InputID<<" "<InputPort<::iterator di=m_DeviceWinMap.find(Wire->InputID); + if (di==m_DeviceWinMap.end()) + { + //cerr<<"Can't find destination device "<InputID<second->m_Device->SetInput(Wire->InputPort,NULL)) + { cerr<<"Can't find destination device's Input"<user_data()))->cb_Unconnect_i(o,v);} + +////////////////////////////////////////////////////////// + +void SynthModular::cb_UpdatePluginInfo(int ID, void *PInfo) +{ + map::iterator i=m_DeviceWinMap.find(ID); + if (i!=m_DeviceWinMap.end()) + { + DeviceGUIInfo Info=BuildDeviceGUIInfo(*((PluginInfo*)PInfo)); + + (*i).second->m_DeviceGUI->Setup(Info); + (*i).second->m_DeviceGUI->redraw(); + } +} + +////////////////////////////////////////////////////////// + +void SynthModular::LoadPatch(const char *fn) +{ + ifstream inf(fn); + + if (inf) + { + m_FilePath=fn; + + ClearUp(); + inf>>*this; + + TITLEBAR=LABEL+" "+fn; + m_TopWindow->label(TITLEBAR.c_str()); + } +} + +////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////// + +int main(int argc, char **argv) +{ + srand(time(NULL)); + SpiralSynthModularInfo::Get()->LoadPrefs(); + + // get args + string cmd_filename=""; + bool cmd_specd = false; + if (argc>1) + { + cmd_filename = argv[1]; + cmd_specd = true; + } + + Fl::visual(FL_DOUBLE|FL_RGB); + + SynthModular *synth=new SynthModular; + + Fl_Window* win = synth->CreateWindow(); + synth->LoadPlugins(); + win->xclass(""); + win->show(argc, argv); // prevents stuff happening before the plugins have loaded + + Fl_Tooltip::size(10); + Fl::visible_focus(false); + + // do we need to load a patch on startup? + if (cmd_specd) synth->LoadPatch(cmd_filename.c_str()); + + for (;;) + { + if (!Fl::check()) break; + if (!synth->CallbackMode()) synth->Update(); + synth->UpdatePluginGUIs(); // deletes any if necc + //else Fl::wait(); + } + + delete synth; + return 1; +} + diff --git a/SpiralSynthModular.h b/SpiralSynthModular.h new file mode 100644 index 0000000..b57999c --- /dev/null +++ b/SpiralSynthModular.h @@ -0,0 +1,159 @@ +/* SpiralSynthModular + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef SPIRALSYNTHMODULAR +#define SPIRALSYNTHMODULAR + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "SpiralSynthModularInfo.h" +#include "GUI/Widgets/Fl_DeviceGUI.h" +#include "GUI/Widgets/Fl_CommentGUI.h" +#include "GUI/Widgets/Fl_Canvas.h" +#include "SpiralSound/Plugins/SpiralPlugin.h" +#include "SettingsWindow.h" + +typedef Fl_Double_Window SpiralWindowType; +// typedef Fl_Window SpiralWindowType; + +class SettingsWindow; + +class DeviceWin +{ +public: + DeviceWin() : m_DeviceGUI(NULL) {} + ~DeviceWin(); + + int m_PluginID; + SpiralPlugin* m_Device; + Fl_DeviceGUI* m_DeviceGUI; +}; + +class SynthModular +{ +public: + SynthModular(); + ~SynthModular(); + + SpiralWindowType * CreateWindow(); + void LoadPlugins(); + void Update(); + void AddDevice(int n, int x, int y); + void AddComment(int n); + void ClearUp(); + void UpdateHostInfo(); + bool CallbackMode() { return m_CallbackUpdateMode; } + void UpdatePluginGUIs(); + void LoadPatch(const char *fn); + +private: + + DeviceWin* NewDeviceWin(int n, int x, int y); + DeviceWin* NewComment(int n, int x, int y); + + HostInfo m_Info; + + static DeviceGUIInfo BuildDeviceGUIInfo(PluginInfo &PInfo); + + // currently static, to allow the callback + // cb_UpdatePluginInfo to access the map. + static map m_DeviceWinMap; + + int m_NextID; + int m_NextPluginButton; + int m_NextPluginButtonXPos; + int m_NextPluginButtonYPos; + + static bool m_CallbackUpdateMode; + string m_FilePath; + + // Main GUI stuff + void CreateGUI(int xoff=0, int yoff=0, char *name=""); + + Fl_Group *m_MainButtons; + Fl_Button *m_Load; + Fl_Button *m_Save; + Fl_Button *m_New; + Fl_Button *m_OpenEditor; + Fl_Button *m_Options; + Fl_Group *m_AppGroup; + Fl_Scroll *m_AppScroll; + + Fl_Canvas *m_Canvas; + Fl_Scroll *m_CanvasScroll; + Fl_Scroll *m_ToolBox; + Fl_Pack *m_ToolPack; + Fl_Group *m_Buttons; + Fl_Button *m_NewComment; + + SettingsWindow *m_SettingsWindow; + + SpiralWindowType* m_TopWindow; + Fl_Tile* m_TopTile; + + Fl_Group* m_MainWindow; + Fl_Group* m_EditorWindow; + + vector m_DeviceVec; + + inline void cb_NewDevice_i(Fl_Button* o, void* v); + static void cb_NewDevice(Fl_Button* o, void* v); + inline void cb_NewDeviceFromMenu_i(Fl_Canvas* o, void* v); + static void cb_NewDeviceFromMenu(Fl_Canvas* o, void* v); + inline void cb_NewComment_i(Fl_Button* o, void* v); + static void cb_NewComment(Fl_Button* o, void* v); + inline void cb_Load_i(Fl_Button* o, void* v); + static void cb_Load(Fl_Button* o, void* v); + inline void cb_Save_i(Fl_Button* o, void* v); + static void cb_Save(Fl_Button* o, void* v); + inline void cb_New_i(Fl_Button* o, void* v); + static void cb_New(Fl_Button* o, void* v); + inline void cb_Connection_i(Fl_Canvas* o, void* v); + static void cb_Connection(Fl_Canvas* o, void* v); + inline void cb_Unconnect_i(Fl_Canvas* o, void* v); + static void cb_Unconnect(Fl_Canvas* o, void* v); + inline void cb_Close_i(Fl_Window* o, void* v); + static void cb_Close(Fl_Window* o, void* v); + inline void cb_OpenEditor_i(Fl_Button* o, void* v); + static void cb_OpenEditor(Fl_Button* o, void* v); + + + inline void cb_Rload_i(Fl_Button* o, void* v); + static void cb_Rload(Fl_Button* o, void* v); + + static void cb_Update(void* o, bool Mode); + static void cb_UpdatePluginInfo(int ID, void *PluginInfo); + + friend istream &operator>>(istream &s, SynthModular &o); + friend ostream &operator<<(ostream &s, SynthModular &o); +}; + +istream &operator>>(istream &s, SynthModular &o); +ostream &operator<<(ostream &s, SynthModular &o); + +#endif diff --git a/SpiralSynthModular.pro b/SpiralSynthModular.pro new file mode 100644 index 0000000..e3f9099 --- /dev/null +++ b/SpiralSynthModular.pro @@ -0,0 +1,30 @@ +HEADERS = SpiralSynthModular.h \ + SpiralSynthModularInfo.h \ + GraphSort.h \ + GUI/Widgets/Fl_DeviceGUI.h \ + GUI/Widgets/Fl_CommentGUI.h \ + GUI/Widgets/Fl_DragBar.H \ + GUI/Widgets/Fl_Canvas.h \ + SpiralSound/SpiralInfo.h \ + SpiralSound/Sample.h \ + SpiralSound/Plugins/SpiralPlugin.h \ + SpiralSound/Plugins/SpiralPluginGUI.h \ + SpiralSound/PluginManager.h \ + SettingsWindow.h \ + SpiralSynthPluginLocation.h + +SOURCES = SpiralSynthModular.C \ + SpiralSynthModularInfo.C \ + GraphSort.C \ + GUI/Widgets/Fl_DeviceGUI.C \ + GUI/Widgets/Fl_CommentGUI.C \ + GUI/Widgets/Fl_DragBar.cxx \ + GUI/Widgets/Fl_Canvas.C \ + SpiralSound/SpiralInfo.C \ + SpiralSound/Sample.C \ + SpiralSound/Plugins/SpiralPlugin.C \ + SpiralSound/Plugins/SpiralPluginGUI.C \ + SpiralSound/PluginManager.C \ + SettingsWindow.C + +TARGET = SpiralSynthModular diff --git a/SpiralSynthModularInfo.C b/SpiralSynthModularInfo.C new file mode 100644 index 0000000..80bc92c --- /dev/null +++ b/SpiralSynthModularInfo.C @@ -0,0 +1,156 @@ +/* SpiralSynthModular + * Copyleft (C) 2002 David Griffiths + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "SpiralSynthModularInfo.h" +#include "SpiralSynthPluginLocation.h" +#include "FL/fl_draw.h" + +int SpiralInfo::BUFSIZE = 512; +int SpiralInfo::FRAGSIZE = 256; +int SpiralInfo::FRAGCOUNT = -1; +int SpiralInfo::SAMPLERATE = 44100; +long SpiralInfo::MAXSAMPLE = 32767; +float SpiralInfo::VALUECONV = 1.0f/MAXSAMPLE; +bool SpiralInfo::WANTMIDI = false; +int SpiralInfo::FILTERGRAN = 50; +string SpiralInfo::OUTPUTFILE = "/dev/dsp"; +string SpiralInfo::MIDIFILE = "/dev/midi"; +int SpiralInfo::POLY = 1; +bool SpiralInfo::REALTIMEOUT = true; + +//int SpiralInfo::GUI_COLOUR = 139; +//int SpiralInfo::GUIBG_COLOUR = 0; +//int SpiralInfo::GUIBG2_COLOUR = 49;//45; + +int SpiralSynthModularInfo::GUICOL_Tool=179; +int SpiralSynthModularInfo::GUICOL_Button=181; +int SpiralSynthModularInfo::GUICOL_Canvas=181; +int SpiralSynthModularInfo::GUICOL_Device=181; +string SpiralSynthModularInfo::BGIMG; + +vector SpiralSynthModularInfo::PLUGINVEC; +string SpiralSynthModularInfo::PLUGIN_PATH; + +SpiralSynthModularInfo* SpiralSynthModularInfo::m_SpiralSynthModularInfo=NULL; + +SpiralSynthModularInfo* SpiralSynthModularInfo::Get() +{ + if (!m_SpiralSynthModularInfo) + { + m_SpiralSynthModularInfo = new SpiralSynthModularInfo; + } + + return m_SpiralSynthModularInfo; +} + +SpiralSynthModularInfo::SpiralSynthModularInfo() +{ + BGIMG="None"; + + // default plugins + path, check these before dist... + // this is one of the two plugin lists, th other is in + // the SpiralSound/Plugins/PluginList.txt for the + // configure/make/install scripts + + PLUGIN_PATH = PLUGIN_PATH_LOCATION; + + PLUGINVEC.push_back("OutputPlugin.so"); + PLUGINVEC.push_back("ScopePlugin.so"); + PLUGINVEC.push_back("MidiPlugin.so"); + PLUGINVEC.push_back("ControllerPlugin.so"); + PLUGINVEC.push_back("WaveTablePlugin.so"); + PLUGINVEC.push_back("OscillatorPlugin.so"); + PLUGINVEC.push_back("EnvelopePlugin.so"); + PLUGINVEC.push_back("SplitterPlugin.so"); + PLUGINVEC.push_back("SampleHoldPlugin.so"); + PLUGINVEC.push_back("NoteSnapPlugin.so"); + PLUGINVEC.push_back("MixerPlugin.so"); + PLUGINVEC.push_back("StereoMixerPlugin.so"); + PLUGINVEC.push_back("AmpPlugin.so"); + PLUGINVEC.push_back("RingModPlugin.so"); + PLUGINVEC.push_back("FilterPlugin.so"); + PLUGINVEC.push_back("SVFilterPlugin.so"); + PLUGINVEC.push_back("MoogFilterPlugin.so"); + PLUGINVEC.push_back("WaveShaperPlugin.so"); + PLUGINVEC.push_back("EchoPlugin.so"); + PLUGINVEC.push_back("DelayPlugin.so"); + PLUGINVEC.push_back("SamplerPlugin.so"); + PLUGINVEC.push_back("SeqPlugin.so"); + PLUGINVEC.push_back("MatrixPlugin.so"); + PLUGINVEC.push_back("SeqSelectorPlugin.so"); + PLUGINVEC.push_back("EnvFollowerPlugin.so"); + PLUGINVEC.push_back("SmoothPlugin.so"); + PLUGINVEC.push_back("LADSPAPlugin.so"); + PLUGINVEC.push_back("XFadePlugin.so"); + PLUGINVEC.push_back("StreamPlugin.so"); + PLUGINVEC.push_back("SpiralLoopPlugin.so"); + PLUGINVEC.push_back("PoshSamplerPlugin.so"); + PLUGINVEC.push_back("ComplexEnvelopePlugin.so"); + PLUGINVEC.push_back("DistributorPlugin.so"); + PLUGINVEC.push_back("JoystickPlugin.so"); + PLUGINVEC.push_back("LFOPlugin.so"); + PLUGINVEC.push_back("MeterPlugin.so"); +} + +void SpiralSynthModularInfo::StreamInPrefs(istream &s) +{ + // call base class + SpiralInfo::StreamInPrefs(s); + + char temp[256]; + s>>temp>>temp; + s>>temp>>temp>>GUICOL_Tool; + s>>temp>>temp>>GUICOL_Button; + s>>temp>>temp>>GUICOL_Canvas; + s>>temp>>temp>>GUICOL_Device; + s>>temp>>temp>>BGIMG; + s>>temp>>temp>>PLUGIN_PATH; + s>>temp>>temp; + string st; + PLUGINVEC.clear(); + + while(st!="end" && !s.eof()) + { + s>>st; + if (st!="end") PLUGINVEC.push_back(st); + } +} + +void SpiralSynthModularInfo::StreamOutPrefs(ostream &s) +{ + // call base class + SpiralInfo::StreamOutPrefs(s); + + s< + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#ifndef SPIRALSYNTHMODULARINFO +#define SPIRALSYNTHMODULARINFO + +#include "SpiralSound/SpiralInfo.h" +#include + +class SpiralSynthModularInfo : public SpiralInfo +{ +public: + static SpiralSynthModularInfo* Get(); + void SetColours(); + + static string PLUGIN_PATH; + static vector PLUGINVEC; + + static int GUICOL_Tool; + static int GUICOL_Button; + static int GUICOL_Canvas; + static int GUICOL_Device; + static string BGIMG; + +protected: + SpiralSynthModularInfo(); + + virtual string GetResFileName() { return ".SpiralSynthModular"; } + + static SpiralSynthModularInfo *m_SpiralSynthModularInfo; + + virtual void StreamInPrefs(istream &s); + virtual void StreamOutPrefs(ostream &s); +}; + +#endif diff --git a/SpiralSynthPluginLocation.h.in b/SpiralSynthPluginLocation.h.in new file mode 100644 index 0000000..c49a8f2 --- /dev/null +++ b/SpiralSynthPluginLocation.h.in @@ -0,0 +1,20 @@ +/* SpiralSynthModular + * Copyleft (C) 2001 David Griffiths + * Copyleft (C) 2001 Erik de Castro Lopo + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#define PLUGIN_PATH_LOCATION "@PLUGINDIR@/" diff --git a/configure.in b/configure.in new file mode 100644 index 0000000..2bc6725 --- /dev/null +++ b/configure.in @@ -0,0 +1,160 @@ +dnl Process this file with autoconf to produce a configure script. +AC_INIT(SpiralSynthModular.C) + +dnl Checks for programs. +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL + +dnl Checks for header files. +AC_HEADER_STDC + +dnl Checks for typedefs, structures, and compiler characteristics. +AC_C_CONST +AC_C_INLINE + +dnl Check plugin directory +AC_ARG_WITH(plugindir, + [ --with-plugindir=dir give the plugin directory], + plugindir="$withval", + plugindir="/usr/lib/SpiralPlugins") +AC_SUBST(PLUGINDIR, $plugindir) + +dnl Check whether to enable debugging + +AC_ARG_ENABLE(debug, [ --enable-debug enable debugging ], + ac_arg_debug="Y", ac_arg_debug="N") + +if test $ac_arg_debug = "Y" ; then + CFLAGS="-pipe -Wall -O0 -ggdb " + CXXFLAGS="-pipe -Wall -O0 -ggdb " +else + CFLAGS="-pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused " + CXXFLAGS="-pipe -Wall -O3 -ffast-math -DNO_DEBUG -Wno-unused " + fi +echo "$PLUGINLIST" > SpiralSound/PluginList.txt + +AC_ARG_ENABLE(jack, [ --enable-jack build JackPlugin ], + ac_arg_jack="Y", ac_arg_jack="N") + +if test $ac_arg_jack = "Y" ; then + PLUGINLIST="AmpPlugin ControllerPlugin DelayPlugin EchoPlugin EnvFollowerPlugin \ + EnvelopePlugin FilterPlugin MatrixPlugin MidiPlugin MixerPlugin MoogFilterPlugin \ + NoteSnapPlugin OscillatorPlugin OutputPlugin RingModPlugin SVFilterPlugin \ + SampleHoldPlugin SamplerPlugin ScopePlugin SeqPlugin SmoothPlugin SplitterPlugin \ + StereoMixerPlugin WaveTablePlugin SeqSelectorPlugin LADSPAPlugin WaveShaperPlugin \ + StreamPlugin XFadePlugin SpiralLoopPlugin JackPlugin PoshSamplerPlugin \ + ComplexEnvelopePlugin DistributorPlugin JoystickPlugin LFOPlugin MeterPlugin" +else + PLUGINLIST="AmpPlugin ControllerPlugin DelayPlugin EchoPlugin EnvFollowerPlugin \ + EnvelopePlugin FilterPlugin MatrixPlugin MidiPlugin MixerPlugin MoogFilterPlugin \ + NoteSnapPlugin OscillatorPlugin OutputPlugin RingModPlugin SVFilterPlugin \ + SampleHoldPlugin SamplerPlugin ScopePlugin SeqPlugin SmoothPlugin SplitterPlugin \ + StereoMixerPlugin WaveTablePlugin SeqSelectorPlugin LADSPAPlugin WaveShaperPlugin \ + StreamPlugin XFadePlugin SpiralLoopPlugin PoshSamplerPlugin ComplexEnvelopePlugin \ + DistributorPlugin JoystickPlugin LFOPlugin MeterPlugin" + fi +echo "$PLUGINLIST" > SpiralSound/PluginList.txt + + +dnl Checks for library functions. + +AC_CHECK_HEADERS(math.h) +AC_CHECK_LIB(m, sin) + +dnl AC_CHECK_HEADERS(X11/Xlib.h) +dnl AC_CHECK_LIB(X11, XDisplayName) +dnl AC_CHECK_LIB(Xext, main) + +AC_PATH_PROG(FLTK_CONFIG, fltk-config, no) +if test "$FLTK_CONFIG" = "no"; then + AC_PATH_XTRA + LIBGL="" + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + AC_CHECK_HEADERS(GL/gl.h) + if test $ac_cv_header_GL_gl_h = "yes" ; then + AC_CHECK_LIB(GL, glBegin, LIBGL="-lGL") + fi + AC_CHECK_HEADERS(FL/Fl.h) + if test $ac_cv_header_FL_Fl_h = "no" ; then + echo "*** FLTK headers missing." + exit 1 + fi + AC_CHECK_LIB(fltk, main) + FLTK_CXXFLAGS="$X_CFLAGS" + FLTK_CFLAGS="$FLTK_CXXFLAGS" + FLTK_LIBS="$X_LIBS -lfltk $LIBGL" +else + FLTK_CXXFLAGS=`$FLTK_CONFIG $fltk_config_args --cxxflags` + FLTK_CFLAGS=`$FLTK_CONFIG $fltk_config_args --cxxflags` + FLTK_LIBS=`$FLTK_CONFIG $fltk_config_args --ldflags` +fi +AC_SUBST(FLTK_CXXFLAGS) +AC_SUBST(FLTK_CFLAGS) +AC_SUBST(FLTK_LIBS) + +if test $ac_arg_jack = "Y" ; then + AM_PATH_GLIB(1.2.0,,AC_MSG_ERROR([*** GLIB >= 1.2.0 not installed])) +fi + +AC_CHECK_HEADERS(dlfcn.h) +AC_CHECK_LIB(dl, dlopen) + +AC_CHECK_HEADERS(png.h) +AC_CHECK_LIB(png, png_get_copyright) + +dnl This is normally done with libtool but since we aren't using libtool +dnl yet to it here. + +dnl FIXME: forced to add -fPIC here.. +CFLAGS="$CFLAGS -fPIC" +CXXFLAGS="$CFLAGS -fPIC" + +AC_SUBST(CFLAGS) +AC_SUBST(CXXFLAGS) +AC_SUBST(PLUGINLIST) + +dnl Modify the output files. + +AC_OUTPUT( +SpiralSynthPluginLocation.h +SpiralSound/Plugins/AmpPlugin/Makefile +SpiralSound/Plugins/ControllerPlugin/Makefile +SpiralSound/Plugins/DelayPlugin/Makefile +SpiralSound/Plugins/EchoPlugin/Makefile +SpiralSound/Plugins/EnvFollowerPlugin/Makefile +SpiralSound/Plugins/EnvelopePlugin/Makefile +SpiralSound/Plugins/FilterPlugin/Makefile +SpiralSound/Plugins/MatrixPlugin/Makefile +SpiralSound/Plugins/MidiPlugin/Makefile +SpiralSound/Plugins/MixerPlugin/Makefile +SpiralSound/Plugins/MoogFilterPlugin/Makefile +SpiralSound/Plugins/NoteSnapPlugin/Makefile +SpiralSound/Plugins/OscillatorPlugin/Makefile +SpiralSound/Plugins/OutputPlugin/Makefile +SpiralSound/Plugins/RingModPlugin/Makefile +SpiralSound/Plugins/SVFilterPlugin/Makefile +SpiralSound/Plugins/SampleHoldPlugin/Makefile +SpiralSound/Plugins/SamplerPlugin/Makefile +SpiralSound/Plugins/ScopePlugin/Makefile +SpiralSound/Plugins/SeqPlugin/Makefile +SpiralSound/Plugins/SeqSelectorPlugin/Makefile +SpiralSound/Plugins/SmoothPlugin/Makefile +SpiralSound/Plugins/SplitterPlugin/Makefile +SpiralSound/Plugins/StereoMixerPlugin/Makefile +SpiralSound/Plugins/WaveTablePlugin/Makefile +SpiralSound/Plugins/LADSPAPlugin/Makefile +SpiralSound/Plugins/WaveShaperPlugin/Makefile +SpiralSound/Plugins/StreamPlugin/Makefile +SpiralSound/Plugins/XFadePlugin/Makefile +SpiralSound/Plugins/SpiralLoopPlugin/Makefile +SpiralSound/Plugins/JackPlugin/Makefile +SpiralSound/Plugins/ComplexEnvelopePlugin/Makefile +SpiralSound/Plugins/PoshSamplerPlugin/Makefile +SpiralSound/Plugins/DistributorPlugin/Makefile +SpiralSound/Plugins/JoystickPlugin/Makefile +SpiralSound/Plugins/LFOPlugin/Makefile +SpiralSound/Plugins/MeterPlugin/Makefile +Makefile +) + diff --git a/install-sh b/install-sh new file mode 100755 index 0000000..d07c253 --- /dev/null +++ b/install-sh @@ -0,0 +1,119 @@ +#!/bin/sh + +# +# install - install a program, script, or datafile +# This comes from X11R5; it is not part of GNU. +# +# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $ +# +# This script is compatible with the BSD install script, but was written +# from scratch. +# + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" + +instcmd="$mvprog" +chmodcmd="" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +lib="" +dst="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + *) if [ x"$lib" = x ] + then + lib=$1 + else + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$lib" = x ] +then + echo "install: no input file specified" + exit 1 +fi + +if [ x"$dst" = x ] +then + echo "install: no destination specified" + exit 1 +fi + + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + +if [ -d $dst ] +then + dst="$dst"/`basename $lib` +fi + +# Make a temp file name in the proper directory. + +dstdir=`dirname $dst` +dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + +$doit $instcmd $lib $dsttmp + +# and set any options; do chmod last to preserve setuid bits + +if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; fi +if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; fi +if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; fi +if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; fi + +# Now rename the file to the real destination. + +$doit $rmcmd $dst +$doit $mvcmd $dsttmp $dst + + +exit 0