commit a4cb08398b847a365b9d86e0e0cf64d04889eb85 Author: Nikolai Rinas Date: Thu Apr 7 20:14:18 2016 -0700 Init diff --git a/COPYRIGHT b/COPYRIGHT new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/COPYRIGHT @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 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 Lesser General +Public License instead of this License. diff --git a/GuitarTeX2.icns b/GuitarTeX2.icns new file mode 100644 index 0000000..4dec79a Binary files /dev/null and b/GuitarTeX2.icns differ diff --git a/README b/README new file mode 100644 index 0000000..ffc70e3 --- /dev/null +++ b/README @@ -0,0 +1,42 @@ +Release Notes +============= + +Version 3.4.0: +* Code cleanup: Java 1.8 is required +* App for Mac: Embeded Java runtime. Works standalone + +Version 3.3.1 + * Defaultwerte angepasst + +Version 3.3.0: + * std:Ausgaben auf die interne Konsole umleiten + * Harp-Notes hinzugefuegt + * Parser: An die Harp-Notes angepasst + * Shortcuts fuer Noten + * Templates ueber menue zu erreichen + * GuitarTeX2: Option "-f" removed + * GuitarTeX2Converter: UTF8 Support eingebaut + * Direktivloser Text wird nicht geparsed + * Link auf die Webseite mit den Shortcuts + +Version 3.2.5: + * Configuration: Systeme werden mid regex erkannt + * Konsole eingebaut + * Template fuer neue Dokumente + +Version 3.2.4: + * Sprachbutton hinzugefuegt + * FAQ Link im Menue hinzugefuegt + +Version 3.2.3: + * UTF8 Support + +Version 3.2.2: + * Parser: Windows \r wird korrekt geloescht + * Serverseitig: Windows-Dateien werden generell in Unix Format konvertiert + +Version 3.2.1: + * graphicx Packet entfernt + * Schriftarten auf lmodern umgeschaltet + * Neue Direktive {nopagenum} + diff --git a/build.xml b/build.xml new file mode 100644 index 0000000..e3b473c --- /dev/null +++ b/build.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + Builds, tests, and runs the project GuitarTeX2. + + + + + + + + + + + + + + + diff --git a/buildApp.sh b/buildApp.sh new file mode 100755 index 0000000..f3ed5db --- /dev/null +++ b/buildApp.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +ant bundle-GuitarTeX2 diff --git a/examples/griechischer_wein.gtx b/examples/griechischer_wein.gtx new file mode 100644 index 0000000..c3d7368 --- /dev/null +++ b/examples/griechischer_wein.gtx @@ -0,0 +1,39 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} +{language: german} + +{title: Griechischer Wein} + +{a:Vers 1:} +{bridge} + [Am]Es war schon dunkel, als ich durch Vorstadtstrassen [(Am]heimw[F)]"arts gin[C]g. + Da war ein Wirtshaus, aus dem das Licht noch auf den [(C]Gehs[F)]teig sch[G7]ien. + [E7]Ich hatte [Am]Zeit, und mir war [E7]kalt, drum trat ich [Am]ein. + \\ + [Am]Da sassen M"anner mit braunen Augen und mit [(Am]schwarz[F)]em Ha[C]ar. + Und aus der Jukebox erklang Musik, die fremd und [(C]s"ud[F)]lich wa[G7]r. + [E7]Als man mich [Am]sah, stand einer [E7]auf und lud mich [Am]ein. +{/bridge} + +{a:Refrain:} +{chorus} + [F]Griechischer Wein ist wie das Blut der Erde, + k[C]omm, schenk' dir ein, und wenn ich dann traurig werde, + li[G7]egt es daran, dass ich immer tr"aume von da[C]heim, du musst verz[C7]eih'n. + G[F]riechischer Wein und die altvertrauten Lieder, + s[C]chenk nochmal ein, denn ich f"uhl die Sehnsucht wieder, + in[G7] dieser Stadt werd'ich immer nur ein [E7]Fremder [Am]sein [E7]und a[Am]llein. +{/chorus} + +{a:Vers 2:} +{bridge} + Und dann er[Am]z"ahlten sie mir von gr"unen H"ugeln, M[(Am]eer [F)]und Wi[C]nd, + von alten H"ausern und jungen Frauen, die [(C]allei[F)]ne s[G7]ind, + [E7]und von dem K[Am]ind, das seinen V[E7]ater noch nie s[Am]ah. + Si[Am]e sagten sich immer wieder, irgendwann [(Am]geht [F)]es zur[C]"uck, + und das Ersparte gen"ugt zu Hause f"ur ein [(C]klein[F)]es Gl"u[G7]ck. + [E7]Und bald denkt ke[Am]iner mehr dar[E7]an, wie es hier [Am]war. +{/bridge} diff --git a/examples/lazy_blues.gtx b/examples/lazy_blues.gtx new file mode 100644 index 0000000..fd9a7f3 --- /dev/null +++ b/examples/lazy_blues.gtx @@ -0,0 +1,22 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Lazy Blues} + +{define:C7 t x 3 2 3 1 x} +{define:F7 5 x 3 2 3 1 x} +{define:G7 7 x 3 2 3 1 x} + + +{a: [Zahlen = Fingerstellung im Bund x]} + + +{guitartab: [14.5ex;C7]&[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[1;3][1;3][2;1][2;2]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]} +{guitartab: [14.5ex;F7]&[2;8][2;8][3;7]&[4;8]&[5;6][3;7]&[4;8]&[5;6]|[2;8][2;8][3;7]&[4;8]&[5;6][3;7]&[4;8]&[5;6]|[2;8][2;8][3;7]&[4;8]&[5;6][3;7]&[4;8]&[5;6]|[1;8][1;8][2;6][2;7]|[2;8][2;8][3;7]&[4;8]&[5;6][3;7]&[4;8]&[5;6]|[2;8][2;8][3;7]&[4;8]&[5;6][3;7]&[4;8]&[5;6]} +{guitartab: [14.5ex;C7]&[2;3] _ [2;3] _ [3;2]&[4;3]&[5;1] _ [3;2]&[4;3]&[5;1] | [2;3] _ [2;3] _ [3;2]&[4;3]&[5;1] _ [3;2]&[4;3]&[5;1]|} +{guitartab: [14.5ex;G7]&[2;10] _ [2;10] _ [3;9]&[4;10]&[5;8] _ [3;9]&[4;10]&[5;8] | [2;10] _ [2;10] _ [3;9]&[4;10]&[5;8] _ [3;9]&[4;10]&[5;8] |} +{guitartab: [14.5ex;F7]&[2;8] _ [2;8] _ [3;7]&[4;8]&[5;6] _ [3;7]&[4;8]&[5;6] | [2;8] _ [2;8] _ [3;7]&[4;8]&[5;6] _ [3;7]&[4;8]&[5;6] |} +{guitartab: [14.5ex;C7]&[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[1;3][1;3][2;1][2;2]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]} diff --git a/examples/my_first_book.gtb b/examples/my_first_book.gtb new file mode 100644 index 0000000..7085b1f --- /dev/null +++ b/examples/my_first_book.gtb @@ -0,0 +1,10 @@ +{document_class:book} + +{book_author:I am the author} +{book_title:This is my book} +{book_date:02/28/2007} + + +{include:/GuitarTeX2/examples/lazy_blues.gtx} + +{include:/GuitarTeX2/examples/griechischer_wein.gtx} diff --git a/gtx/all_my_loving.gtx b/gtx/all_my_loving.gtx new file mode 100644 index 0000000..ddb3406 --- /dev/null +++ b/gtx/all_my_loving.gtx @@ -0,0 +1,47 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: All My Loving} +{subtitle: The Beatles} + + +{a:Vers 1:} +{bridge} + Close your [F#m]eyes and I'll [H7]kiss you, Tom[E]orrow I'll [C#m]miss you + Rem[A]ember I'll [F#m]always be [D]true + And then [F#m]while I'm [H7]away, I'll write [E]home every[C#m]day + and I'll [A]send all my [H] to you[E] + + I'll pre[F#m]tend that I'm ki[H7]ssing the [E]lips I am [C#m]missing + and [A]hope that my [F#m]dreams will come [D]true + And then [F#m]while I'm [H7]away, I'll write [E]home every[C#m]day + and I'll [A]send all my [H] to you[E] +{/bridge} + + +{a:Refrain:} +{chorus} + All my [C#m]loving, [G#]I will send to [E]you + All my [C#m]loving, [G#]darling I'll be [E]true +{/chorus} + + +{a:Vers 2:} +{bridge} + Close your [F#m]eyes and I'll [H7]kiss you, Tom[E]orrow I'll [C#m]miss you + Rem[A]ember I'll [F#m]always be [D]true + And then [F#m]while I'm [H7]away, I'll write [E]home every[C#m]day + abd I'll [A]send all my [H] to you[E] +{/bridge} + + +{a:Refrain:} +{chorus} + All my [C#m]loving, [G#]I will send to [E]you + All my [C#m]loving, [G#]darling I'll be [E]true + All my [C#m]loving, [G#]All my loving [E] Ooh + All my [C#m]loving, [G#]I will send to [E]you +{/chorus} diff --git a/gtx/always_look_on_the_bright_side_of_life.gtx b/gtx/always_look_on_the_bright_side_of_life.gtx new file mode 100644 index 0000000..0c67f4c --- /dev/null +++ b/gtx/always_look_on_the_bright_side_of_life.gtx @@ -0,0 +1,75 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Always Look On The Bright Side Of Life} +{subtitle: Monti Python} + +{define:Am7 t x n 2 n 1 n} + +{a:Vers 1:} +{bridge} + [Am]Some things in life are [D]bad they can [G]really make you [Em]mad + [Am]Other things just [D]make you swear and [G]curse + When you've [Am]chewing and life's [D]gristle + Don't give [G]grumble, give a [Em]whistle + And [Am7]this'll help things turn out for the [D7]best +{/bridge} + + +{a:Refrain:} +{chorus} + And [G]always [Em]look on the [Am]bright [D7]side of [G]life [Em] [Am] [D7] + [G]Always [Em]look on the [Am]light [D7]side of [G]life [Em] [Am] [D7] +{/chorus} + + +{a:Vers 2:} +{bridge} + If [Am]life seems jolly [D]rotten there's [G]something you've [Em]forgotten + and that's to [Am]laugh and smile and [D]dance and [G]sing. + When you've [Am]feeling in the [D]dumps don't be [G]silly [Em]chumps + Just [Am7]purse your lips and whistle - that's the [D7]thing +{/bridge} + +{a:Refrain:} +{chorus} + And [G]always [Em]look on the [Am]bright [D7]side of [G]life [Em] [Am] [D7] + [G]Always [Em]look on the [Am]light [D7]side of [G]life [Em] [Am] [D7] +{/chorus} + +{a:Vers 3:} +{bridge} + For [Am]life is quite abs[D]urd and [G]death's the final [Em]word + you must [Am]always face the [D]curtain with a [G]bow + [Am]forget about your [D]sin - give the [G]audience a [Em]grin + [Am7]enjoy it - it's your last chance any[D7]how. +{/bridge} + +{np} + +{a:Refrain:} +{chorus} + So [G]always [Em]look on the [Am]bright [D7]side of [G]death [Em] [Am] [D7] + [G]just be[Em]fore you [Am]draw your ter[D7]minal [G]breath [Em] [Am] [D7] +{/chorus} + +{a:Vers 4:} +{bridge} + [Am]Life's a piece of [D]shit [G]when you look at [Em]it + [Am]Life's a laugh and [D]death's a joke it's [G]true + You'll [Am]see it's all a [D]show + keep'em [G]laughing as you [Em]go + [Am7]just remember that the last laugh is on [D7]you. +{/bridge} + +{a:Refrain:} +{chorus} + And [G]always [Em]look on the [Am]bright [D7]side of [G]life [Em] [Am] [D7] + [G]Always [Em]look on the [Am]light [D7]side of [G]life [Em] [Am] [D7] + [A]always [F#m]look on the [Hm]right [E7]side of [A]life [F#m] [Hm] [E7] + [A]Always [F#m]look on the [Hm]light [E7]side of [A]life [F#m] [Hm] [E7] +{/chorus} diff --git a/gtx/bang_bang.gtx b/gtx/bang_bang.gtx new file mode 100644 index 0000000..606af20 --- /dev/null +++ b/gtx/bang_bang.gtx @@ -0,0 +1,41 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Bang Bang} +{subtitle: Nancy Sinatra} + +{a: Intro:} + +{guitartab: [14.5ex;Em]&[1;0]&[5;0][3;2][4;0][5;0][4;3][4;0]|[14.5ex;Am]&[2;0]&[5;1][3;2][4;2][5;1][5;0][4;2]|[14.5ex;H7]&[2;2]&[5;0][3;1][4;2][5;1][5;0][4;2][4;0][3;4]|[14.5ex;Em]&[1;0][2;2][3;2][4;0][5;0][6;0]} + +{a:Vers 1:} +{bridge} + [Em]I was five and [Em/D#]he was six, [Em/D]we rode on horses [E/C#]made of sticks. + [D]He wore black and I wore white. [H7]He would always win the fight, + [H-E]Bang bang. [Em]He shot me [H-E]down, [H-E]bang bang. I [Em]hit the [E-H]ground, + [E-D]bang bang. [D]That awful sound, [D-H7]Bang bang. My baby shot me down. +{/bridge} + +{a:Vers 2:} +{bridge} + Seasons came and changed the time. When I grew up I called him mine. + He would always laugh and say, "Remember when we used to play bang bang?" + I shot you down, bang bang. You hit the ground, bang bang. + That awful sound, bang bang. I used to shoot you down. +{/bridge} + +{a:Refrain:} +{chorus} + [Em]Music played and people sang. [D]Just for me the church bells rang. [C][C9][C][Cmaj7][C][H7] +{/chorus} + +{a:Vers 3:} +{bridge} + Now he's gone, I don't know why, and 'til this day sometimes I cry. + He didn't even say goodbye, he didn't take the time to lie. + Bang bang. He shot me down, bang bang. I hit the ground, bang bang. + That awful sound, bang bang. My baby shot me down. +{/bridge} diff --git a/gtx/behind_blue_eyes.gtx b/gtx/behind_blue_eyes.gtx new file mode 100644 index 0000000..9f39a75 --- /dev/null +++ b/gtx/behind_blue_eyes.gtx @@ -0,0 +1,108 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Behind Blue Eyes} +{subtitle: Limp Bizkit} + +{define:G6 t 3 2 n n 3 n} +{define:Dsus2 t x n n 3 2 n} +{define:Cadd9 t x 3 2 n 3 n} +{define:Asus2 t x n 2 2 n n} +{define:Esus4 t n 2 2 2 n n} + +{a:Vers 1:} +{bridge} + [Em]No one knows what it's [G6]like + To be the [Dsus2]bad man + To be the [Cadd9]sad man + [A]Behind [Asus2]blue [A]eyes + And [Em]no one knows what it's [G6]like + To be [Dsus2]hated + To be [Cadd9]fated + To telling [A]only[Asus2] [A]lies +{/bridge} + +{a:Refrain:} +{chorus} + But my [Cadd9]dreams [D] + They aren't as [G]empty + As my [Cadd9]conscience [D]seems [E]to be [Esus4] [E] + I have [Hm]hours, only [Cadd9]lonely + My love is [D]vengeance + That's never [A]free [Asus2] [A] +{/chorus} + +{a:Vers 2:} +{bridge} + [Em]No one knows what it's [G6]like + To feel these [Dsus2]feelin's + Like I [Cadd9]do + And I blame [A]you [Asus2] [A] + [Em]No one bites back as [G6]hard + On their [Dsus2]anger + None of my [Cadd9]pain an' woe + Can show [A]through [Asus2] [A] +{/bridge} + +{a:Refrain ...} + +{a:Mittelteil:} +{chorus} + [Asus2] Discover [Em]L.[G6]I.M.[Dsus2]P Say it + Discover [Cadd9]L.I.M.[Asus2]P Say it +{/chorus} + + +{a:Vers 3:} +{bridge} + [Em]And no one knows how to [G6]say + That they're [Dsus2]sorry + An' don't [Cadd9]worry + I'm not [A]tell[Asus2]ing[A] lies +{/bridge} + +{a:Refrain ...} + +{a:Vers 4:} +{bridge} + [Em]No one knows what it's [G6]like + To be the [Dsus2]bad man + To be the [Cadd9]sad man + [A]Behind [Asus2]blue [A]eyes +{/bridge} + + +{np} + +{a:INTRO} + +{tab} +e|-----------0--------------------0----------------0-----------------------| +B|-------------0--------------------3---------3-------3---3---------3------| +G|--------0------0-------------0------0-----2---2-------2--------2----2----| +D|------2-------------------0-----------0-0-------------------0------------| +A|----2-------------2-----2------------------------------------------------| +E|--0------------------3---------------------------------------------------| +{/tab} + +{tab} +e|--0-------------------------0---------------------------0----------------| +B|-----3---3-----------3----------3------3---------3---------3-----3-------| +G|-------2-----------------------------------------------------------------| +D|-----------------2------2-----------2---------2-----2---------2----------| +A|--------------3----------------------------3-----------------------------| +E|-------------------------------------------------------------------------| +{/tab} + +{tab} +e|----------------0-----------------------------0---------------------| +B|---------0---------0------0-----------0-----------0-------0---------| +G|--------------------------------------------------------------------| +D|-----2------2----------2----------2------2------------2-------------| +A|--0----------------------------0------------------------------------| +E|--------------------------------------------------------------------| +{/tab} diff --git a/gtx/boat_on_the_river.gtx b/gtx/boat_on_the_river.gtx new file mode 100644 index 0000000..7125d50 --- /dev/null +++ b/gtx/boat_on_the_river.gtx @@ -0,0 +1,43 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Boat On The River} +{subtitle: Styx} + +{a:Vers 1:} +{bridge} + [Dm]Take me down to my boat on the river + I [C]need to go down, I [A7]need to come down + [Dm]Take me back to my boat on the river + And [C]I won't cry [A7]out any[Dm]more +{/bridge} + +{a:Vers 2:} +{bridge} + [Dm]Time stands still as I gaze in her waters + She [C]eases me down, [A7]touching me gently + With the [Dm]waters that flow past my boat on the river + So [C]I won't cry [A7]out any[Dm]more +{/bridge} + +{a:Refrain:} +{chorus} + Oh the [C]river is wide, The [A7]river it touches my [Dm]life + like the waves on the [G]sand. And [Gm]all roads lead to [Dm]tranquility base + Where the [E]frown on my face dis[A]appears[A7] + [Dm]Take me back to my boat on the river. And [C]I won't cry [A7]out any[Dm]more +{/chorus} + +{a:Refrain:} +{chorus} + Oh the [C]river is deep, The [A7]river it touches my [Dm]life + like the waves on the [G]sand. And [Gm]all roads lead to [Dm]tranquility base + Where the [E]frown on my face dis[A]appears[A7] + [Dm]Take me back to my boat on the river + And [C]I won't cry [A7]out [Dm]anymore + And [C]I won't cry [A7]out [Dm]anymore + And [A]I won't cry [A7]out [Dm]anymore +{/chorus} diff --git a/gtx/california_dreamin.gtx b/gtx/california_dreamin.gtx new file mode 100644 index 0000000..ab311b2 --- /dev/null +++ b/gtx/california_dreamin.gtx @@ -0,0 +1,42 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: California Dreamin} +{subtitle: The Mamas and The Papas} + +{a:Refrain:} +{chorus} + [E7]All the leaves are [Am]brown, [G] [F] and the [G]sky is [E7]grey. + [F]I've been for a [C]walk [E7] [Am] on a [F]winter's [E]day. +{/chorus} + +{a:Vers 1:} +{bridge} + [E7]I'd be safe and [Am]warm, [G] [F] if I [G]was in [E7]L.A. + California [Am]dreamin' [G] [F] on [G]such a winters [E7]day. [E] + Stopped into a [Am]church [G] [F] I passed al[G]ong the [E7]way + Oh I [F]got down on my [C]knees, [E7] [Am] and I pre[F]tend to [E]prey. + [E7]You know the preacher likes the [Am]cold, [G] [F] + he knows [G]I'm gonna [E7]stay. + California [Am]dreamin' [G] [F] on [G]such a winters [E7]day. +{/bridge} + +{a:Refrain:} +{chorus} + [E7]All the leaves are [Am]brown, [G] [F] and the [G]sky is [E7]grey. + [F]I've been for a [C]walk [E7] [Am] on a [F]winter's [E]day. +{/chorus} + +{a:Vers 2:} +{bridge} + [E7]If I didn't [Am]tell her, [G] [F] I could [G]leave [E7]today + California [Am]dreamin' [G] [F] on [G]such a winters [E7]day. [E] + Stopped into a [Am]church [G] [F] I passed al[G]ong the [E7]way + Oh I [F]got down on my [C]knees, [E7] [Am] and I pre[F]tend to [E]prey. + [E7]You know the preacher likes the [Am]cold, [G] [F] + he knows [G]I'm gonna [E7]stay. + California [Am]dreamin' [G] [F] on [G]such a winters [E7]day. +{/bridge} diff --git a/gtx/country_roads.gtx b/gtx/country_roads.gtx new file mode 100644 index 0000000..68dbb8b --- /dev/null +++ b/gtx/country_roads.gtx @@ -0,0 +1,46 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Country Roads} +{subtitle: John Denver} + +{a:Vers 1:} +{bridge} +[G]Almost heaven, [Em]west virginia [D]Blue ridge mountains [C]Shenandoah [G]river - +[G]Life is old there [Em]Older than the trees +[D]Younger than the mountains [C]Growin like a [G]breeze +{/bridge} + + +{a:Refrain:} +{chorus} + [G]Country roads, take me [D]home To the [Em]place I [C]belong + West [G]virginia, mountain [D]momma + Take me [C]home, country [G]roads +{/chorus} + +{a:Vers: 2} +{bridge} +[G]All my memories [Em]gathered round her +[D]Miners lady, [C]stranger to blue [G]water +[G]Dark and dusty, [Em]painted on the sky +[D]Misty taste of moonshine +[C]Teardrops in my [G]eye +{/bridge} + +{a:Refrain: ...} + +{a:Vers: 3} + +{bridge} +[Em]I hear her [D]voice +In the [G]mornin hour she calls me +[C]The radio [G]reminds me of [D]my home far away +[Em]And drivin down [F]the road I get a [C]feelin +[G]That I should have been home [D]yesterday, [D7]yesterday +{/bridge} + +{a:Refrain: ...} diff --git a/gtx/creep.gtx b/gtx/creep.gtx new file mode 100644 index 0000000..b833ce4 --- /dev/null +++ b/gtx/creep.gtx @@ -0,0 +1,45 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Creep} +{subtitle: Radiohead} + +{define:Asus4 t x n 2 2 3 n} +{define:Esus t n 2 2 2 n n} +{define:G#sus 4 n n 2 2 n n} + +{a:Capo: 3} + +{a:Intro: E Esus E G# G#sus G# A Asus4 A} + +{a:Vers 1:} +{bridge} + [Am]When you were here b[E]efore [Esus] + [E]Couldn't look you in the e[G#]yes [G#sus] + [G#]Just look like an [A]angel [Asus4] + [A]Your skin makes me [Am]cry [Asus4] + \\ + [Am]You float like a [E]feather [Esus] + [E]In a beautiful [G#]weather [G#sus] + [G#]I wish I was [A]special [Asus4] + [A]You're so very [Am]special [Asus4] +{/bridge} + +{a:Refrain:} +{chorus} + [Am]But I'm a [E]creep [Esus], [E]I'm a wi[G#]erdo [G#sus] + [G#]What the hell am I doin' [A]here [Asus4] , [A]I don't belong [Am]here [Asus4] +{/chorus} + +{a:Vers 2:} +{bridge} + I don't care if it hurts, I wanna have control + I wanna perfect body, I want a perfect soul + I want you to notice, When I'm not around + You're so very special , I wish I was special +{/bridge} + +{a:Refrain ...} diff --git a/gtx/das_liebeslied.gtx b/gtx/das_liebeslied.gtx new file mode 100644 index 0000000..420f829 --- /dev/null +++ b/gtx/das_liebeslied.gtx @@ -0,0 +1,35 @@ +{title: Das Liebeslied} +{subtitle: Annett Louisan} + +{language: german} + +{a: Intro: Am D} + +{a: Vers: 1} +{bridge} +Meine [Am]Zweifel war'n ihr Geld nicht [Dm]wert, sie er[F]gaben sich [E]stumm +Du bist [Am]alles was mein Herz [Dm]begehrt, es schl"agt [F]pausenlos [E]um sich her[Am]um [D] [Am] [D] +H"or f"ur [Am]immer auf in mir zu [Dm]ruhn und [F]fall jeden [E]Schritt +Wie ein [Am]Clown in viel zu gro"sen [Dm]Schuh'n +Ich [F]wei"s nicht mehr [E]wie mir [A]geschieht [A7] +{/bridge} + + +{a: Refrain: } +{chorus} +[F]Alles an [G]mir will zu [A]dir +[A7]Mein k"uhler [Dm]Kopf "offnet T"ur und [G7]Tor, [C]weit "uber beide [F]Ohr'n +Das [Dm]Blut in meinen [E7]Adern [A]gefriert +[A7]Als ob mein [Dm]Bauch sich im Rodeln [G7]"ubt, [C]Schei"se, bin ich [F]verliebt +Hab [Dm]jetzt schon viel zu [E7]viel zu [Am]verliern [D] [Am] [D] +{/chorus} + +{a: Vers: 1} +{bridge} +Bin erbli[Am]ndet auf den ersten [Dm]Blick, bin [F]sprachlos und [E]taub +Meine [Am]Logik bricht sich das [Dm]Genick, ist [F]all ihrer [E]Klarheit [Am]beraubt [D] [Am] [D] +Hab zum [Am]Boden keinerlei [Dm]Kontakt, mein [F]Tag l"asst mich [E]kalt +Meine [Am]Z"uge entgleisen im [Dm]Takt und [F]machen vor [E]keinem mehr halt [A] +{/bridge} + +{a: Refrain: ...} diff --git a/gtx/default.gtx b/gtx/default.gtx new file mode 100644 index 0000000..71e05a6 --- /dev/null +++ b/gtx/default.gtx @@ -0,0 +1,40 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: } +{subtitle: } + +{define:A t x n 2 2 2 n} +{define:A7 t x n 2 n 2 n} +{define:G t f1p3 p5 p5 p4 f1p3 f1p3} + +{a:Vers 1:} +{bridge} +{/bridge} + +{a:Refrain:} +{chorus} +{/chorus} + +{a:Mittelteil:} +{chorus} +{/chorus} + +{np} + +{tab} +E X----------------------------------------------------------------------------- +H |--------1--1--------1--1--------1--1-------------------1--1--------1--1------ +G |--------3--3--------3--3--------3--3-------------------3--3--------3--3------ +D |--------2--2--------2--2--------2--2-------------------2--2--------2--2------ +A |--3--3--------3--3--------3--3-------------1--2--3--3--------3--3------------ +E |-------------------------------------3--3------------------------------------ +{/tab} + +\footnotesize +{guitartab: [14.5ex;D]&[2;3][2;3] | } +\normalsize diff --git a/gtx/der_blender.gtx b/gtx/der_blender.gtx new file mode 100644 index 0000000..3b91e50 --- /dev/null +++ b/gtx/der_blender.gtx @@ -0,0 +1,42 @@ +{title: Der Blender} +{subtitle: Annett Louisan} + +{language: german} + +{a: Vers 1:} +{bridge} +[Am7]Mit jedem Fingerschnipp von ihm, [C]wirst du Berge versetzen und [C7]Schlußstriche [F]zieh'n +Und du wirst über tausend Leichen geh'n [E]nur um ihn einmal noch lächeln zu sehen. +[Am7]Du wirst deine Ziele verraten, deine [C]Eigenarten [C7]bereu'n. +Er wird dich [F]betrügen und [F7]du, [E]du wirst ihm verzeih'n. +[Am7]Und ganz egal welchen Part du in [C]Wirklichkeit dabei [C7]spielst. +Er wird es [F]jedesmal [F7]schaffen, daß [E]du dich schuldig dafür [E7]fühlst. +{/bridge} + +{a: Refrain:} +{chorus} +[C]Er ist ein [D]Blender erster [F]Güte, wie ein [G]Schmetterling leicht. +[C]Er nimmt ein [D]Schluck von jeder [F]Blüte solang der [G]Vorrat [G#]reicht. +[Am]Du bist für [Am/G#]Ihn doch bloß ein [Am/G]Spielplatz. Er [Am/F#]verschaukelt dich täglich [F]mehr. +Dein Name schwimmt in seinem Wortschatz, [E]wie ein Tropfen im Meer. +Er ist ein [Am]Blender [Zwischenspiel] [F] - [Am]ein Blender. [Zwischenspiel] [F] +{/chorus} + +{a: Vers 2:} +{bridge} +[Am7]Du wirst versuchen ihn zu ver[C]steh'n. [C7] +[F]Wirst jeden Irrweg [F7]den er dir weist [E]ganz bis zum Ende geh'n. +[Am7]Auf seine Weise ist er ja [C]ehrlich und es [C7]prickelt so herrlich, +[F]Wenn er dich ausmacht und [F7]anmacht doch das [E]Spiel ist gefährlich. +[Am7]Du hebst ab, du fliegst, und [C]vergehst vor lauter [C7]Begierde +Nach seinen [F]süßen [F7]Seufzern... jetzt [E]komm mal zurück auf die Erde. +[Am7]Glaub mir ich kenn das Gefühl, wie es ist wenn sie [C]unter dir [C7]bebt, +Denn ich [F]hab diese ganze Scheiße schon [E]einmal mit ihm durchlebt. +{/bridge} + +{a: Refrain: ...} + +{bridge} +[E]Ich weiß, er wird dir fehlen, doch er [E]brennt nicht lang in dir. +Er ist so [F]flüchtig, wie der Nebel auf den [E]Straßen früh um vier. +{/bridge} diff --git a/gtx/der_moerder.gtx b/gtx/der_moerder.gtx new file mode 100644 index 0000000..7f079ba --- /dev/null +++ b/gtx/der_moerder.gtx @@ -0,0 +1,82 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{language: german} + +{color_chorus:0,0,0} + +{even} +{title: Der M"order Ist Immer Der G"artner} +{subtitle: Reinhard Mey} + +{a:Vers 1:} +{bridge} + [Am]Die Nacht liegt wie Blei auf [Dm]Schlo"s Darkmoor, + Sir [G7]Henry liest Financial [C]Times.[E] + Zw"olf[Am]mal schl"agt gespenstisch die [Dm]Turmuhr, + der [E7]Buttler hat Ausgang bis [Am]eins. + Da [A7]schleicht sich im flackernden Lampenschein + fast [Dm]lautlos ein Schatten zur T"ure herein + und [H7]st"urzt auf Sir Henry, derselbe lebt ab, + und [E]nimmt das Geheimnis mit in das [E7]Grab. +{/bridge} + +{a:Refrain:} +{chorus} + [A]Der M"order war wieder der [D]G"artner, und der [E7]plant schon den n"achsten [A]Coup. [E] + Der [A]M"order ist immer der [D]G"artner, und [E]der schl"agt erbarmungslos, + [A]der schl"agt [D]erbarmungslos, [A]der schl"agt [E7]erbarmungslos [A]zu. +{/chorus} + +{a:Vers 2:} +{bridge} + Bei Maigret ist schon seit zwei Stunden ein Fahrstuhl andauernd blockiert. + Inspektor Dupont ist verschwunden, der Fahrstuhl wird gerad' repariert. + Da "offnet sich lautlos die T"ure zum Schacht, + es ert"ont eine Stimme, die h"amisch lacht. + Inspektor Dupont traf im Fahrstuhl ein Schu"s, + der Amtsarzt stellt sachlich fest - Exitus. +{/bridge} + +{a:Refrain ...} + +{a:Vers 3:} +{bridge} + Am Hafendamm S"ud wurde neulich ein Hilfsleuchtturmwart umgebracht. + Inspektor van Dyke, stets voreilig, hat drei T"ater schon im Verdacht: + Die Wirtin zu Schleuse, denn die schielt und die hinkt, + der K"apt'n, der schiffsbr"uchig im Rum ertrinkt, + der Lotse, der vorgibt, Napoleon zu sein, + aber da irrt van Dyke, keiner war's von den Drei'n +{/bridge} + +{a:Refrain ...} + +{a:Vers 4:} +{bridge} + Die steinreiche Erbin zu Manster ist wohnhaft im f"unfzehnten Stock. + Dort schl"aft sie bei offenem Fenster, Big-Ben schl"agt gerad' two o'clock. + Ganz leis bl"aht der Wind die Gardinen auf, + auf die Erbin zeigt mattschwarz ein st"ahlerner Lauf, + und ein gellender Schrei zerreißt j"ah die Luft, + auch das war wohl wieder der G"artner der Schuft. +{/bridge} + +{a:Refrain ...} + +{a:Vers 5:} +{bridge} + In seinem Gew"achshaus im Garten, steht in gr"uner Sch"urze ein Mann. + Der G"artner r"uhrt mehrere Arten von Gift gegen Blattl"ause an. + Der G"artner singt pfeift und lacht verschmitzt, + seine Heckenschere die funkelt und blitzt, + Sense, Spaten und Jagdgewehr stehen an der Wand, + da w"urgt ihn von hinten eine meuchelnde Hand. +{/bridge} + +{a:Refrain:} +{chorus} + Der M"order war n"amlich der Buttler, und der schlug erbarmungslos zu. + Der M"order ist immer der Buttler, man lernt eben t"aglich dazu. +{/chorus} diff --git a/gtx/die_katze.gtx b/gtx/die_katze.gtx new file mode 100644 index 0000000..4df639a --- /dev/null +++ b/gtx/die_katze.gtx @@ -0,0 +1,48 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{language: german} + +{color_chorus:0,0,0} + +{title: Die Katze} +{subtitle: Annett Louisan} + +{define:G/Am t 3 n 2 2 1 n} +{define:F#/D t 2 n n 2 3 n} +{define:C 3 x n 2 2 2 n} + +{a:Vers 1:} +{bridge} +[Am]Du hast sie gefunden, [F]jetzt liegt es bei [E]dir +[Am]dich um sie zu kümmern, wer weiß vielleicht [F]schnurrt sie [E]dafür. +[Am]Sie kommt und sie geht, [F]wann immer sie [E]will +[C] Sie räkelt sich in deinen Laken aus [E7]weichem Flanell +{/bridge} + +{a:Refrain:} +{chorus} + [Am]Sie spielt mit der Beute, zieht nie mit der Meute sie [F]kuscht [E]nicht + [Am]Sie zählt deine Mäuse sie mordet sie leise und [F] [E]gründlich + [Dm]Nein, sie wird dir nie [E7]gehörn + [Am]doch du streichelst [G/Am]sie so [F#/D] gern + [F]Das weiß sie ganz [E]genau, [Am]miau +{/chorus} + +{a:Vers 2:} +{bridge} +[Am]Sie krallt sich dein Kissen, [F]und thront [E]arrogant +[Am]Sie frißt dir die Haare vom Kopf, aber [F]nie aus der [E]Hand +[Am]Willst du sie dir greifen faucht sie, [F]rühr mich nicht [E]an +[C] Hast du absolut keine Zeit für sie, [E7]schleicht sie sich an +{/bridge} + +{a:Refrain:} +{chorus} + [Am]Sie fällt auf die Pfoten, sie spielt nicht nach Noten, sie [F]sträubt [E]sich + [Am]Du kannst sie nicht führen und auch nicht dressiern, [F]sie spurt [Am]nicht + [Dm]Nein, sie wird dir nie [E7]gehörn + [Am]doch du streichelst [G/Am]sie so [F#/D]gern + [F]Das weiß sie ganz [E]genau, [Am]miau +{/chorus} diff --git a/gtx/die_loesung.gtx b/gtx/die_loesung.gtx new file mode 100644 index 0000000..a5df61c --- /dev/null +++ b/gtx/die_loesung.gtx @@ -0,0 +1,44 @@ +{title: Die Loesung} +{subtitle: Annett Louisan} + +{define:Am/C t x 3 2 2 1 n} +{define:Dm6 t x 2 n 2 3 1} +{define:E7 t n 2 2 1 3 n} +{define:Em/G t 3 2 2 n n n} +{define:Am/F# t 2 x x 2 1 n} +{define:H7 t x 2 1 2 n 2} + +{language: german} + +{a: Vers: 1} +{bridge} +[Am]Ich hab' da [Am/C]so'n [Dm6]Problem, das kümmert [E7]mich ext[Am]rem +Es ziert mich [Am/C]wie ein [Dm6]Tier, dass ich spa[E7]zieren [Am]führ' +Es macht mich [Am/C]int'ress[Dm6]ant, die Leute [E7]sind ge[Am]spannt +Was ist mit [Am/C]dem Pro[Dm6]blem? Wie wird es [E7]weiterg[Em]eh'n? +Ich brauche [E/G]mein Pro[Am/F#]blem um ander'n [H7]zu ent[Em]geh'n +Ich pack's [Em/G]genüßlich [Am/F#]aus und red' mich [H7]damit [Em]raus +Ich schildere es [E/G]farben[Am/F#]reich und alle [H7]rufen [Em]gleich +"was macht die [Am/F#]Arme bloß [G]durch?!" +{/bridge} + +{a: Refrain: } +{chorus} +Geh' mir weg mit deiner [Dm]Lö[G7]sung,[Dm] sie wär' der [G7]Tod für mein [C]Problem +jetzt laß' mich weiter d'rüber [Dm]re[G7]den,[Dm] is' schließlich [G7]mein Pro[C]blem [F] [E] +und nicht dein Problem [Am] +{/chorus} + +{a: Vers: 2} +{bridge} +Ich spür' da so 'nen Schmerz im Kopf und auch im Herz +Darüber klag' ich leis' wenn ich nicht weiter weiß +Ich hüll' mich in mein Leid wie in ein langes Kleid +und alle schauen her, "oh je, sie leidet sehr" +Ich klage meinen Schmerz ganz traurig himmelwärts +Verweine mein Gesicht bevor man mich erwischt +Wie ich gerade lüg' und jemanden betrüg' +das ist ein guter Trick +{/bridge} + +{a: Refrain: ...} \ No newline at end of file diff --git a/gtx/dust_in_the_wind.gtx b/gtx/dust_in_the_wind.gtx new file mode 100644 index 0000000..48268b7 --- /dev/null +++ b/gtx/dust_in_the_wind.gtx @@ -0,0 +1,56 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Dust In The Wind} +{subtitle: Kerry Livgren} + +{define:C t x 3 2 n 1 n} +{define:CMaj7 t x 3 2 n n n} +{define:C9 t x 3 2 n 3 n} +{define:Am t x n 2 2 1 n} +{define:A9 t x n 2 2 n n} +{define:Asus4 t x n 2 2 3 n} + +{a:Vers 1:} +{bridge} + I [C]close [G/H]my [Am]eyes, [G]only for a [Dm]moment and the [Am]moment's gone. [Am-G] + [C]All [G/H]my [Am]dreams, [G]pass before me [Dm]eyes are curi[Am]osity. +{/bridge} + +{a:Refrain:} +{chorus} + [D/F#]Dust [G] in the [Am]wind, [Am/G] [D/F#]all we are is [G]dust in the [Am]wind. [G] +{/chorus} + +{a:Vers 2:} +{bridge} + [C]Same [G/H]old [Am]song, [G]just a drop of [Dm]water in an [Am]endless sea. [Am-G] + [C]All [G/H]we [Am]do [G]crumbles to the gro[Dm]und, though we re[Am]fuse to see. +{/bridge} + +{a:Refrain ...} + +{a:Vers 3:} +{bridge} + [C]Don't [G/H]hang [Am]on, [G]nothing last [Dm]forever but the [Am]earth and sky. [Am-G] + It [C]slips [G/H]away [Am] [G]all your money won't [Dm]another minute [Am]buy. +{/bridge} + +{a:Refrain:} +{chorus} + [D]Dust [G] in the [Am]wind, [D]all we are is [G]dust in the [Am]wind. [D] + Dust [G] in the [Am]wind, [D]everything is [G]dust in the [Am]wind. +{/chorus} + +{np} + +{a:Intro} + +{guitartab: [14.5ex;C]&[5;1]&[2;3]__[3;2][4;0][2;3][5;1][3;2][4;0]|[14.5ex;CMaj7]&[5;0]&[2;3]__[3;2][4;0][2;3][5;0][3;2][4;0]|[14.5ex;C9]&[5;3]&[2;3]__[3;2][4;0][2;3][5;3][3;2][4;0]|[14.5ex;C]&[5;1]&[2;3]__[3;2][4;0][2;3][5;1][3;2][4;0]} +{guitartab: [14.5ex;A9]&[5;0]&[2;0]__[3;2][4;2][2;0][5;0][3;2][4;2]|[14.5ex;Asus4]&[5;3]&[2;0]__[3;2][4;2][2;0][5;3][3;2][4;2]|[14.5ex;Am]&[5;1]&[2;0]__[3;2][4;2][2;0][5;1][3;2][4;2]|[14.5ex;A9]&[5;0]&[2;0]__[3;2][4;2][2;0][5;0][3;2][4;2]} +{guitartab: [14.5ex;C9]&[5;3]&[2;3]__[3;2][4;0][2;3][5;3][3;2][4;0]|[14.5ex;C]&[5;1]&[2;3]__[3;2][4;0][2;3][5;1][3;2][4;0]|[14.5ex;CMaj7]&[5;0]&[2;3]__[3;2][4;0][2;3][5;0][3;2][4;0]|[14.5ex;C9]&[5;3]&[2;3]__[3;2][4;0][2;3][5;3][3;2][4;0]} +{guitartab: [14.5ex;Am]&[5;1]&[2;0]__[3;2][4;2][2;0][5;1][3;2][4;2]|[14.5ex;A9]&[5;0]&[2;0]__[3;2][4;2][2;0][5;0][3;2][4;2]|[14.5ex;Asus4]&[5;3]&[2;0]__[3;2][4;2][2;0][5;3][3;2][4;2]|[14.5ex;Am]&[5;1]&[2;0]__[3;2][4;2][2;0][2;2][14.5ex;C]&[2;3]&[3;2]&[4;0]&[5;1] } diff --git a/gtx/electrolite.gtx b/gtx/electrolite.gtx new file mode 100644 index 0000000..d2224d7 --- /dev/null +++ b/gtx/electrolite.gtx @@ -0,0 +1,81 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Electrolite} +{subtitle: REM} + +{define:Cadd9 t x 3 2 n 3 3} +{define:G t 3 2 n n 3 3} + +{a:Vers 1:} +{bridge} + [G]Your eyes are [Cadd9]burning holes through [G]me. [Cadd9] + I'm gaso[G]line. [Cadd9] + I'm burnin' [G]clean. [Cadd9] + + [G]Twentieth [Caddd9]Century go to [G]sleep [Cadd9] + You're plasti[G]cine. [Cadd9] + That is obs[G]cene. [Cadd9] + That is obs[D]cene. +{/bridge} + +{a:Refrain:} +{chorus} + You [Am]are the star ton[D]ight. + Your sun [Am]electric, outta [D]sight. + Your light ecli[H]psed the moon [Em]tonight. + [G-Am] Elecro[Em]lite. [G-Am] You're outa [Em]sight. [G-D] +{/chorus} + +{a:Vers 2:} +{bridge} + [G]If I [Cadd9]ever want to [G]fly. [Cadd9] + Mulholland [G]Drive. [Cadd9] + I am [G]alive. [Cadd9] + + [G]Holly[Cadd9]wood is under [G]me. [Cadd9] + I'm Martin [G]Sheen [Cadd9] + I'm Steve [G]McQueen [Cadd9] + I'm Jimmy [D]Dean +{/bridge} + +{a:Refrain ...} + +{a:Mittelteil: H Am H Am H Am C D} + +{np} + +{a:Vers 3:} +{bridge} + [G]If you [Cadd9]want to [G]fly. [Cadd9] + Mulholland [G]Drive. [Cadd9] + Up in the [G]sky. [Cadd9] + + [G]Stand on a [Cadd9]cliff and look down [G]there. [Cadd9] + Don't be [G]scared. [Cadd9] + You are [G]alive. [Cadd9] + You are [D]alive. +{/bridge} + +{a:Refrain ...} + +{a:Vers 4:} +{bridge} + [G]Twentieth [Cadd9]century go and [G]sleep [Cadd9] + Really [G]deep [Cadd9] + We won't [G]blink [Cadd9] + [G]You're eyes are [Cadd9]burnin' holes through [G]me. [Cadd9] + I'm not [G]scared [Cadd9] + I'm outa [G]here. [Cadd9] + I'm not [G]scared. + I'm outa here. +{/bridge} + +\footnotesize +{a:Zwischenspiel:} +{guitartab: [14.5ex;D]&[6;3][6;2][6;3][5;3] } +\normalsize diff --git a/gtx/everybody_hurts.gtx b/gtx/everybody_hurts.gtx new file mode 100644 index 0000000..d28ca0d --- /dev/null +++ b/gtx/everybody_hurts.gtx @@ -0,0 +1,56 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Everybody Hurts} +{subtitle: REM} + +{define:A7 t x n 2 n 2 n} +{define:F# 2 n 2 2 1 n n} +{define:Hm 2 n n 2 2 1 n} + +{a:Intro: D G D G} + +{a:Vers 1:} +{bridge} + [D] When the day is long[G], and the [D]night, the night is yours al[G]one. + [D] And you're sure you've had en[G]ough of this lif[D]e to hang [G]on. + \\ + [Em]Don't let yourself g[A]o, ca[Em]use everybody cr[A]ies[Em], and everybody [A]hurts + s[D]ometimes, [G] sometimes everything is wr[D]ong. + \\ + Now it's time to sing alo[G]ng [D]when your day is night al[G]one + [D] When you feel like let him go[G]. + \\ + [D] You think you've had too m[G]uch of this li[D]fe to hang [G] on[Em]. + cause everybody hu[A]rts. [Em]To comfort in your fr[A]iends [Em]everybody [A] hurts[A7]. +{/bridge} + +{a:Refrain:} +{chorus} + [F#]Don't throw your h[Hm]and, ho-[F#]old [Hm]on. Do[F#]n't throw your [Hm]hand. + [C]If you feel like you're a[G]lone. [C]no, no, no, not al[Am]one. +{/chorus} + +{a:Vers 2:} +{bridge} + If you're on your own. Of this life, the days and nights alone. + When you think you've had too much of this life, to hang on. + For everybody hurts. For sometimes everybody cries. + Everybody hurts. Sometimes everybody hurts. + so, hold on, hold on, hold on, hold on, ... +{/bridge} + +{np} + +{a:Die 4 Bassl"aufe:} +{guitartab: [14.5ex;G]&[1;3][4;0][5;0][6;3][5;0][4;0]|[1;3][4;0][5;0][1;2][4;0][5;0]|[14.5ex;Em]&[1;0][4;0][5;0][6;0][5;0][4;0]|[1;0][4;0][5;0][6;0][5;0][4;0] } + +{guitartab: [14.5ex;A]&[2;0][4;2][5;2][6;0][5;2][4;2]|[2;0][4;2][5;2][2;0][1;3][1;2]|[14.5ex;Em]&[1;0][4;0][5;0][6;0][5;0][4;0]|[1;0][4;0][5;0][6;0][5;0][4;0] } + +{guitartab: [14.5ex;C]&[2;3][4;0][5;1][6;0][5;1][4;0]|[2;3][4;0][5;1][2;2][4;0][5;1]|[14.5ex;Am]&[2;0][4;2][5;1][6;0][5;1][4;2]|[2;0][4;2][5;1][6;0][5;1][4;2] } + +{guitartab: [14.5ex;Hm]&[2;2][4;4][5;3][6;2][5;3][4;4]|[2;2][4;4][5;3][2;2][2;2][2;0]|[14.5ex;F#]&[1;2][4;3][5;2][6;2][5;2][4;3]|[1;2][4;3][5;2][6;2][5;2][4;3] } diff --git a/gtx/father_and_son.gtx b/gtx/father_and_son.gtx new file mode 100644 index 0000000..4f0dc85 --- /dev/null +++ b/gtx/father_and_son.gtx @@ -0,0 +1,43 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Father And Son} +{subtitle: Cat Stevens} + +{a:Vers 1:} +{bridge} + It's not [G]time to make a [D]change, just [C]relax and take it [Am7]easy + You're still [G]young that's your [Em]fault + there's so [Am]much you have to [D]know + Find a [G]girl, settle [D]down, if you [C]want to, you can [Am7]marry + Look at [G]me, I am [Em]old, but I'm [Am]happy [C] + [D]I was [G]once like you are [Hm7]now, and I [C]know that its not [Am7]easy + to be [G]calm, when you've [Em]found something [Am]going on [C] + [D]But take your [G]time, think a [Hm7]lot, why think of [C]everything you've [Am7]got + For you will [G]still be here [Em]tomorrow, but your [D]dreams may [G]not +{/bridge} + +{a:Vers 2:} +{bridge} + How can [G]I try to [Hm]explain? when I [C]do he turns [Am7]away again + it's [G]always been the [Em]same, same old [Am]story [C] + [D]From the [G]moment I could [Em]talk I was [C]ordered to [Am7]listen + now there's a [G]way and I [Em]know I [D]have to [G]go away + I [D]know I [C]have to [G]go +{/bridge} + +{a:Vers 3:} +{bridge} + It's not [G]time to make a [Hm7]change, just sit [C]down and take it [Am7]slowly + You're still [G]young, that's your [Em]fault, there's so [Am]much you have to go [D]through + Find a [G]girl, settle [D]down, if you [C]want to, you can [Am7]marry + Look at [G]me, I am [Em]old, but I'm [Am]happy [C] + [D]All the [G]times that I [Hm7]cried, keeping [C]all the things I [Am7]knew inside + It's [G]hard, but it's [Em]harder to [Am]ignore it [C] + [D]If they were [G]right, I'd [D]agree, but it's [C]them they know, not [Am7]me + Now there's a [G]way, and I [Em]know that I [D]have to [G]go away. + I [D]know I [C]have to [G]go +{/bridge} diff --git a/gtx/girl.gtx b/gtx/girl.gtx new file mode 100644 index 0000000..4834740 --- /dev/null +++ b/gtx/girl.gtx @@ -0,0 +1,71 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Girl} +{subtitle: The Beatles} + +{define:Em7 t n 2 2 n 3 n} +{define:C6 t x 3 2 2 1 n} + +{a:Capo: 8} + +{a:Vers 1:} +{bridge} + Is there [Em]anybody [H7]going to listen [Em]to my [Em7]story [Em] + [Am]All about a [C6]girl who came to [G]stay [H7] + She's the [Em]kind of girl you [H7]want so much it [Em]makes you [Em7]sorry [Em] + [Am]Still you don't [C6]regret a single [Em]day +{/bridge} + +{a:Refrain:} +{chorus} + Ah, [G]girl[Hm] [Am] [D7] [G]girl[Hm] [Am] [D7] +{/chorus} + +{a:Vers 2:} +{bridge} + When I [Em]think of all the [H7]times I've tried so [Em]hard to [Em7]leave her [Em] + [Am]She will turn to [C6]me and start to [G]cry [H7] + And she [Em]promises the [H7]earth to me and [Em]I believe[Em7] her [Em] + [Am]After all this [C6]time I don't know [Em]why +{/bridge} + +{a:Refrain:} +{chorus} + Ah, [G]girl[Hm] [Am] [D7] [G]girl[Hm] [Am] [D7] +{/chorus} + +{a:Mittelteil:} +{chorus} + [Am]She's the kind of girl who puts you [E]down + when friends are there, you feel a [Am]fool [E] + [Am]When you say she's looking good + She [E]acts as if it's understood she's [Am]cool [C] +{/chorus} + +{a:Refrain:} +{chorus} + Ah, [G]girl[Hm] [Am] [D7] [G]girl[Hm] [Am] [D7] +{/chorus} + +{np} + +{a:Vers 3:} +{bridge} + Was she [Em]told when she was [H7]young + That fame would [Em]lead to [Em7]pleasure? [Em] + [Am]Did she under[C6]stand it when they [G]said [H7] + That a [Em]man must break his [H7]back + To earn his [Em]day of [Em7]leisure? [Em] + [Am]Will she still [C6]believe it when [Em]he's dead? +{/bridge} + +{a:Refrain:} +{chorus} + Ah, [G]girl[Hm] [Am] [D7] [G]girl[Hm] [Am] [D7] +{/chorus} + diff --git a/gtx/give_me_love.gtx b/gtx/give_me_love.gtx new file mode 100644 index 0000000..a6d91b6 --- /dev/null +++ b/gtx/give_me_love.gtx @@ -0,0 +1,47 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Give Me Love} +{subtitle: Lambretta} + +{define:Am/G# t x n 2 1 1 n} +{define:Am/G t x n 2 n 1 n} +{define:Am/F# t x n 4 5 5 5} +{define:Dm6 t x n n 2 n 1} +{define:Esus4 t n 2 2 2 n n} +{define:F9 1 n 2 n n n 2} + +{a:Vers 1:} +{bridge} + [Am]Such a long [Am/G#]time ago, [Am/G]I found [Am/F#]you + in the [Dm]street with your [Dm6]friends + your [Esus4] friends were so strung [E7]out. + [Am]And I was [Am/G#]taken in [Am/G]by your false blue [Am/F#]eyes + your [Dm]kiss feels like a [Dm6]drug, + your [Esus4]touch feels like the [E7]sky. + [F]What am I supposed to [G]do with some - [C]one as screwed [Am]up as you + [F9]What am I supposed to do, when my [C]heart is stuck on [G]you +{/bridge} + +{a:Refrain:} +{chorus} + [Dm]Give me [G]love, [C]give me [F]all that you got + [Dm]Take [G]me, forget the [Am]drugs[C] + [Dm]Give me [G]love, [C]give me lo - [F]ve + [Dm]Take [G]me, forget the [C]drugs +{/chorus} + +{a:Vers 2:} +{bridge} + [Am]I wanna come [Am/G#]around today, [Am/G]but something [Am/F#]is in my way + I'm [Dm]scared to be [Dm6]there, I don't [Esus4]know what I might [E7]see + [Am]Daemons make a [Am/G#]fool of you, [Am/G]I know what you're [Am/F#]going through + but the [Dm]night won't be [Dm6]long, [Esus4]tomorow they'll be [E7]gone. + [F]So what am I [G]supposed to do with some - [C]one as lost as [Am]you + [F9]So what am I supposed to do when my [C]heart is stuck on [G]you +{/bridge} + +{a:Refrain ...} diff --git a/gtx/griechischer_wein.gtx b/gtx/griechischer_wein.gtx new file mode 100644 index 0000000..ff34bd1 --- /dev/null +++ b/gtx/griechischer_wein.gtx @@ -0,0 +1,42 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{language: german} + +{color_chorus:0,0,0} + +{title: Griechischer Wein} + +{a:Vers 1:} +{bridge} + [Am]Es war schon dunkel, als ich durch Vorstadtstrassen [(Am]heimw[F)]ärts gin[C]g. + Da war ein Wirtshaus, aus dem das Licht noch auf den [(C]Gehs[F)]teig sch[G7]ien. + [E7]Ich hatte [Am]Zeit, und mir war [E7]kalt, drum trat ich [Am]ein. + \\ + [Am]Da sassen Männer mit braunen Augen und mit [(Am]schwarz[F)]em Ha[C]ar. + Und aus der Jukebox erklang Musik, die fremd und [(C]süd[F)]lich wa[G7]r. + [E7]Als man mich [Am]sah, stand einer [E7]auf und lud mich [Am]ein. +{/bridge} + +{a:Refrain:} +{chorus} + [F]Griechischer Wein ist wie das Blut der Erde, + k[C]omm, schenk' dir ein, und wenn ich dann traurig werde, + li[G7]egt es daran, dass ich immer träume von da[C]heim, du musst verz[C7]eih'n. + G[F]riechischer Wein und die altvertrauten Lieder, + s[C]chenk nochmal ein, denn ich fühl die Sehnsucht wieder, + in[G7] dieser Stadt werd'ich immer nur ein [E7]Fremder [Am]sein [E7]und a[Am]llein. +{/chorus} + +{a:Vers 2:} +{bridge} + Und dann er[Am]z"ahlten sie mir von gr"unen Hügeln, M[(Am]eer [F)]und Wi[C]nd, + von alten Häusern und jungen Frauen, die [(C]allei[F)]ne s[G7]ind, + [E7]und von dem K[Am]ind, das seinen V[E7]ater noch nie s[Am]ah. + Si[Am]e sagten sich immer wieder, irgendwann [(Am]geht [F)]es zur[C]ück, + und das Ersparte genügt zu Hause für ein [(C]klein[F)]es Glü[G7]ck. + [E7]Und bald denkt ke[Am]iner mehr dar[E7]an, wie es hier [Am]war. +{/bridge} + +{a:Refrain ...} diff --git a/gtx/house_of_the_rising_sun.gtx b/gtx/house_of_the_rising_sun.gtx new file mode 100644 index 0000000..a515d65 --- /dev/null +++ b/gtx/house_of_the_rising_sun.gtx @@ -0,0 +1,45 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_bridge:0,0,0} + +{title: House Of The Rising Sun} +{subtitle: The Animals} + +{a:Vorspiel: Am C D F Am C E E} + +{bridge} + [Am]There is a [C]house in [D]New Orl[F]eans, + [Am]They call the [C]Rising [E]Sun [E] + And It's b[Am]een the [C]ruin of [D]many a poor [F]boy + [Am]And God, I [E]know, I'm [Am]one [C] [D] [F] [Am] [E] [Am] [E] +{/bridge} + +{chorus} + My mother was a tailor + She sewed my new blue jeans + My father was a gambling man + Down in New Orleans +{/chorus} + +{bridge} + And the only things a gambler needs + Is a suitcase and a trunk + And the only time he's satisfied + Is when he's all a-drunk +{/bridge} + +{chorus} + I've got one foot on the platform + The other foot on the train + I'm going back to New Orleans + To wear the ball and chain +{/chorus} + +{bridge} + So mothers, tell your children + Not to do what I have done + Spend your life in sin and misery + In the house of the Rising Sun +{/bridge} diff --git a/gtx/i_will_survive.gtx b/gtx/i_will_survive.gtx new file mode 100644 index 0000000..2c6eda3 --- /dev/null +++ b/gtx/i_will_survive.gtx @@ -0,0 +1,71 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: I Will Survive} +{subtitle: Cake} + +{a:Vers 1:} +{bridge} + [Am]At first I was afraid, i was [Dm]petrified. + I kept [G7]thinking I could never live without you [C]by my side. + But then I [F]spent so many nights just thinking [H]how you'd done me wrong. + I grew [E]strong, I learned [E7]how to get along. +{/bridge} + +{a:Vers 2:} +{bridge} + [E7]And so you're [Am]back from outer [Dm]space. + I just walked [G7]in to find you here without that [C]look upon your face. + I should have [F]changed my fucking lock, I would have [H]made you leave your key + If I'd have [E]known for just one second, you'd be [E7]back to bother me. +{/bridge} + +{a:Refrain:} +{chorus} + Oh now [Am]go, walk out the [Dm]door. + Just turn [G7]around now, You're not [C]welcome anymore. + [F]Weren't you the one who tried to [H]break me with desire? + Did you think I'd [E]crumble? + Did you think I'd [E7]lay down and die? + Oh not [Am]I, I will [Dm]survive. + As long as [G7]I know how to love, I know [C]I'll be alive. + I've got [F]all my life to live, I've got [H]all my love to give. + I will [E]survive, I will [E7]survive. +{/chorus} + + +{np} + +{a:Vers 3:} +{bridge} + [E7]It took [Am]all the strength I had just not to [Dm]fall apart. + I'm trying [G7]hard to mend the pieces of my [C]broken heart. + And I spent [F]oh so many nights just feeling [H]sorry for myself. + I used to [E]cry, but now I [E7]hold my head up high. +{/bridge} + +{a:Vers 4:} +{bridge} + [E7]And you'll see [Am]me , with somebody [Dm]new. + I'm not that [G7]stupid little person still in [C]love with you. + And so you [F]thought you'd just drop by, and you [H]expect me to be free. + But now I'm [E]saving all my lovin' for [E7]someone who's lovin' me. +{/bridge} + + +{a:Refrain:} +{chorus} + Oh now [Am]go, walk out the [Dm]door. + Just turn [G7]around now, You're not [C]welcome anymore. + [F]Weren't you the one who tried to [H]break me with desire? + Did you think I'd [E]crumble? + Did you think I'd [E7]lay down and die? + Oh not [Am]I, I will [Dm]survive. + As long as [G7]I know how to love, I know [C]I'll be alive. + I've got [F]all my life to live, I've got [H]all my love to give. + I will [E]survive, I will [E7]survive. +{/chorus} diff --git a/gtx/in_these_arms.gtx b/gtx/in_these_arms.gtx new file mode 100644 index 0000000..fc01fe4 --- /dev/null +++ b/gtx/in_these_arms.gtx @@ -0,0 +1,58 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: In These Arms} +{subtitle: Jon Bon Jovi} + +{a:Intro: E A (4x)} + +{a:Vers 1:} +{bridge} + [A]You want committ[E]ment take a [A]look into these eyes + [A]They burn with f[E]ire, unt[A]il the end of time + I [A]would do any[C#m]thing; I'd beg, I'd steal, I'd [A]die + [A]To have you [H]in these arms ton[E]ight +{/bridge} + +{a:Vers 2:} +{bridge} + [A]Baby I [E]want you like the r[A]oses; want the rain + [A]You know I ne[E]ed you; like a po[A]et needs the pain + [A]I would give a[C#m]nything; my blood my love my li[A]fe. + [A]If you were [H]in these arms ton[E]ight +{/bridge} + +{a:Refrain:} +{chorus} + [E]I'd hold you, I[H]'d need you, I[C#m]'d get down [A]on my knees for y[E]ou + And make eve[C#m]rything al[H]right if you were [A]in these arms + [E]I'd love you, I[H]'d please you, I[C#m]'d tell you that I'd ne[A]ver leave you + [E]And love you t[C#m]ill the end of [H]time if you were [A]in these arms to[E]night +{/chorus} + +{a:Vers 3:} +{bridge} + We stared at the sun and we made a promise + A promise this world would never blind us + These are my words our words were our songs + Our songs are our prayers these prayers keep me strong it's what I believe + If you were in these arms tonight +{/bridge} + +{a:Refrain ...} + +{np} + +{a:Vers 4:} +{bridge} + Your clothes are still scattered all over our room this old place still smells like your cheap perfume + Everything here reminds me of you and there's nothing that I wouldn't do to ... +{/bridge} + +{a:Solo: E H C#m A E H F#m H + +{a:Refrain ...} diff --git a/gtx/knocking_on_heavens_door.gtx b/gtx/knocking_on_heavens_door.gtx new file mode 100644 index 0000000..9e2648c --- /dev/null +++ b/gtx/knocking_on_heavens_door.gtx @@ -0,0 +1,44 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Knocking On Heavens Door} +{subtitle: Bob Dylan} + +{define:Am7 t x n 2 n 1 n} + +{a:Intro: G D Am7 Am7 G D C C} + +{a:Vers 1:} +{bridge} + [G]Mama, [D]take this badge from [Am7]me + [G]I can' [D]use it any[C]more + [G]it's getting [D]dark, too dark to [Am7]see + [G]it feels like I'm [D]knocking on heaven's [C]door +{/bridge} + +{a:Refrain:} +{chorus} + [G]Knock, knock, [D]knocking on heaven's [Am7]door - + [G] knock, knock, [D]knocking on heaven's [C]door + [G]Knock, knock, [D]knocking on heaven's [Am7]door - + [G] knock, knock, [D]knocking on heaven's [C]door +{/chorus} + +{a:Vers 2:} +{bridge} + [G]Mama, [D]put my guns in the [Am7]ground + [G]I can't [D]shoot them any[C]more + [G]That cold, black [D]cloud is comming [Am7]down + [G]it feels like I'm [D]knocking on heaven's [C]door +{/bridge} + +{a:Refrain:} +{chorus} + [G]Knock, knock, [D]knocking on heaven's [Am7]door - + [G] knock, knock, [D]knocking on heaven's [C]door + [G]Knock, knock, [D]knocking on heaven's [Am7]door - + [G] knock, knock, [D]knocking on heaven's [C]door +{/chorus} diff --git a/gtx/lazy_blues.gtx b/gtx/lazy_blues.gtx new file mode 100644 index 0000000..092ce75 --- /dev/null +++ b/gtx/lazy_blues.gtx @@ -0,0 +1,20 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Lazy Blues} + +{define:C7 t x 3 2 3 1 x} +{define:F7 5 x 3 2 3 1 x} +{define:G7 7 x 3 2 3 1 x} + +{a:Zahlen = Fingerstellung im Bund x} + +{guitartab: [14.5ex;C7]&[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[1;3][1;3][2;1][2;2]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]} +{guitartab: [14.5ex;F7]&[2;8][2;8][3;7]&[4;8]&[5;6][3;7]&[4;8]&[5;6]|[2;8][2;8][3;7]&[4;8]&[5;6][3;7]&[4;8]&[5;6]|[2;8][2;8][3;7]&[4;8]&[5;6][3;7]&[4;8]&[5;6]|[1;8][1;8][2;6][2;7]|[2;8][2;8][3;7]&[4;8]&[5;6][3;7]&[4;8]&[5;6]|[2;8][2;8][3;7]&[4;8]&[5;6][3;7]&[4;8]&[5;6]} +{guitartab: [14.5ex;C7]&[2;3] _ [2;3] _ [3;2]&[4;3]&[5;1] _ [3;2]&[4;3]&[5;1] | [2;3] _ [2;3] _ [3;2]&[4;3]&[5;1] _ [3;2]&[4;3]&[5;1]|} +{guitartab: [14.5ex;G7]&[2;10] _ [2;10] _ [3;9]&[4;10]&[5;8] _ [3;9]&[4;10]&[5;8] | [2;10] _ [2;10] _ [3;9]&[4;10]&[5;8] _ [3;9]&[4;10]&[5;8] |} +{guitartab: [14.5ex;F7]&[2;8] _ [2;8] _ [3;7]&[4;8]&[5;6] _ [3;7]&[4;8]&[5;6] | [2;8] _ [2;8] _ [3;7]&[4;8]&[5;6] _ [3;7]&[4;8]&[5;6] |} +{guitartab: [14.5ex;C7]&[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[1;3][1;3][2;1][2;2]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]|[2;3][2;3][3;2]&[4;3]&[5;1][3;2]&[4;3]&[5;1]} diff --git a/gtx/losing_my_religion.gtx b/gtx/losing_my_religion.gtx new file mode 100644 index 0000000..80cf58c --- /dev/null +++ b/gtx/losing_my_religion.gtx @@ -0,0 +1,41 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Losing My Religion} +{subtitle: REM} + + +{a:Intro: F Am F Am-G} + +{a:Vers 1:} +{bridge} + Oh, [Am]life is bigger, [Em]it's bigger than you, and you are [Am]not me, + the lengths that I will [Em]go to, the distance in your [Am]eyes. + [Em] Oh no, I've said too [Dm]much, I've said eno[G]ugh. + That's me in the [Am]corner, that's me in the [Em]spotlight, losing my re[Am]ligion. + Trying to [Em]keep up with you, and I [Am]don't know if i can do it. + [Em] Oh no, I've said too [Dm]much, I've said eno[G]ugh. +{/bridge} + +{a:Refrain:} +{chorus} + I thought that I heard you [F]laughing, + I thought that I [G]heard you [Am]sing, + I [F]think I thought I saw [G]you [Am - G]try +{/chorus} + +{a:Vers 2:} +{bridge} + Every [Am]whisper, every waking [Em]hour I'm chosing my conf[Am]ession. + Trying to [Em]keep an eye you, like a [Am]hurt lost and blinded fool, fool. + [Em] Oh no, I've said too [Dm]much, I've said eno[G]ugh. + Concider [Am]this, consider this, [Em]hint up a century + Concider [Am]this, the slip, that [Em]brought me to my knees pale. + [Am]What if all these fantasies come [Em] flaming around. + Now I've [Dm]said too [G]much +{/bridge} + +{a:Refrain ...} diff --git a/gtx/love_is_all_around.gtx b/gtx/love_is_all_around.gtx new file mode 100644 index 0000000..25f98b3 --- /dev/null +++ b/gtx/love_is_all_around.gtx @@ -0,0 +1,43 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Love Is All Around} +{subtitle: Wet Wet Wet} + +{a:Capo: 4} + +{a:Vers 1:} +{bridge} + I f[D]eel it in my fi[Em]ngers, [G]I feel it [A]in my to[D]es [Em] [G] [A] + Well, lo[D]ve is all ar[Em]ound me, an[G]d so the fee[A]ling gr[D]ows [Em] [G] [A] + It's wr[D]itten on the wi[Em]nd, it[G]'s everywh[A]ere I [D]go [Em] [G] [A] + So [D]if you really l[Em]ove me, co[G]me on and [A]let it sh[D]ow [Em] [G] [A] +{/bridge} + +{a:Refrain:} +{chorus} + You kn[G]ow I love you, I al[Em]ways will + My m[G]ind's made up by the w[D]ay that I feel + There's n[G]o beginning, there'll [Em] be no end + Cos on my love you c[A]an depend +{/chorus} + +{a:Vers 2:} +{bridge} + I s[D]ee your face bef[Em]ore me a[G]s I lay o[A]n my be[D]d [Em] [G] [A] + I ki[D]nda get to th[Em]inking [G]of all the th[A]ings you sa[D]id [Em] [G] [A] + You g[D]ave your promise [Em]to me an[G]d I gave mi[A]ne to y[D]ou [Em] [G] [A] + I [D]need someone bes[Em]ide me i[G]n ever[A]ything I d[D]o [Em] [G] [A] +{/bridge} + +{a:Refrain ...} + +{a:Vers 3:} +{bridge} + It's wr[D]itten on the wi[Em]nd, it[G]'s every[A]where I [D]go [Em] [G] [A] + So [D]if you really l[Em]ove me, co[G]me on and le[A]t it sh[D]ow [Em] + [G]Come on [A]let it sh[D]ow, [Em] co[G]me on le[A]t it sh[D]ow ... +{/bridge} diff --git a/gtx/love_me_tender.gtx b/gtx/love_me_tender.gtx new file mode 100644 index 0000000..968ae05 --- /dev/null +++ b/gtx/love_me_tender.gtx @@ -0,0 +1,52 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Love Me Tender} +{subtitle: Elvis Presley} + +{define:F#7 2 n 2 n 1 n n} +{define:D7 t x n n 2 1 2} +{define:A7 t x n 2 n 2 n} +{define:E7 t n 2 2 1 3 n} +{define:G 3 n 2 2 1 n n} +{define:Gm 3 n 2 2 n n } +{define:H7 t x 2 1 2 n 2} +{define:H7 2 x n 2 n 2 n} +{define:Hm 2 x n 2 2 1 n} + +{a:Vers 1:} +{bridge} + L[D]ove me tender, l[E7]ove me sweet; [A7]never let me [D]go. + Y[D]ou have made my l[E7]ife complete, [A7]and I love you [D]so. +{/bridge} + +{a:Refrain:} +{chorus} + L[D]ove me t[F#7]ender, l[Hm]ove me t[D7]rue; [G]all my dr[Gm]eams ful[D]fill. + F[D]or my da[H7]rlin', I [E7]love you, [A7]and I always [D]will. +{/chorus} + +{a:Vers 2:} +{bridge} + [D]Love me tender, l[E7]ove me long; [A7]take me to your [D]heart. + [D]For it's there that [E7]I belong, [A7]and we'll never [D]part. +{/bridge} + +{a:Refrain ...} + +{a:Vers 3:} +{bridge} + [D]Love me tender, [E7]love me dear; [A7]tell me you are [D]mine. + [D]I'll be yours through [E7]all the years, [A7]till the end of [D]time. +{/bridge} + +{a:Refrain ...} + +{a:Vers 4:} +{bridge} + [D]When at last my [E7]dreams come true, [A7]darling, this I [D]know: + [D]happiness will [E7]follow you, [A7]everywhere you [D]go. +{/bridge} diff --git a/gtx/mrs_robinson.gtx b/gtx/mrs_robinson.gtx new file mode 100644 index 0000000..d1f4f1c --- /dev/null +++ b/gtx/mrs_robinson.gtx @@ -0,0 +1,65 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Mrs. Robinson} +{subtitle: Simon and Garfunkel} + +{bridge} + [E7]De de [A] de[D]de [G]de [C]de [Am]de [E7]de [D]de +{/bridge} + +{a:Refrain:} +{chorus} + [D]And here's to [G]you Mrs.[Em] Robinson + [G]Jesus loves you[Em] more than you will kn[C]ow, [Am]wo, wo [D]wo + [D]God bless you[G] please Mrs.[Em]Robinson + [G]Heaven hold's a [Em]place for those who [C]pray, hey, [Am]hey hey, hey [E] hey hey +{/chorus} + +{a:Vers 1:} +{bridge} + [E7]We'd like to know a little bit about you for our files + [A]We'd like to help you learn to help yourself + [D]Look around you[G] all you see [C]are sympath[Am]etic eyes + [E7]Stroll around the grounds [D]until you feel at home +{/bridge} + +{a:Refrain ...} + +{a:Vers 2:} +{bridge} + [E7]Hide it in a hiding place where no one ever goes + [A]Put it in your pantry with your cupcakes + [D]It's a little [G]secret just the [C]Robinsons' [Am]affair + [E7]Most of all you've got to hide it [D]from the kids +{/bridge} + +{a:Refrain:} +{chorus} + Koo koo ka[G] choo Mrs.[Em]Robinson + [G]Jesus loves you [Em]more than you will [C]know , [Am] wo wo [D] wo + [D]God bless you [G]please Mrs.[Em]Robinson + [G]Heaven hold's [Em]a place for those who [C]pray, hey [Am]hey hey, hey [E]hey hey +{/chorus} + +{np} + +{a:Vers 3:} +{bridge} + [E7]Sitting on a sofa on a Sunday afternoon + [A]Going to the candidates debate + [D]Laugh about it [G]shout about it [C]when you've got to [Am]choose + [E7]Any way you look at it you [D]lose +{/bridge} + +{a:Refrain:} +{chorus} + Where have you [G]gone Joe DiMaggio[Em] + [G]A nation turns its [Em]lonely eyes to [C]you, [Am]woo woo [D]woo + [D]What's that you [G]say Mrs. [Em]Robinson + [G]Joltin' Joe has [Em]left and gone [C]away, [Am]hey hey hey, hey hey [E7]hey +{/chorus} diff --git a/gtx/nichts_mehr_wie_es_war.gtx b/gtx/nichts_mehr_wie_es_war.gtx new file mode 100644 index 0000000..23773eb --- /dev/null +++ b/gtx/nichts_mehr_wie_es_war.gtx @@ -0,0 +1,69 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} +{language: german} +{color_chorus:0,0,0} + +{even} +{title: Nichts Mehr Wie Es War} +{subtitle: Element Of Crime} + +{define:Dm t x n n 2 3 1} +{define:Dm/C t x 3 n 2 3 1} +{define:Dm/H t x 2 n 2 3 1} + +{a:Vers 1:} +{bridge} + Wir [Am]hocken uns traurig in die [E7]Dämmerung + Auf der [Am]Suche nach dem guten [E7]alten Schwung + Wessen [Dm]Schnapsidee [Dm/C]war es denn [Dm/H]hierher zu gehen + Und dem [C]weichgespülten Elend ins [E7]Auge zu sehen +{/bridge} + +{a:Refrain:} +{chorus} + Denn [Dm]eins war doch [G7]vorher völlig [C]klar: [Am] + Hier ist [F]nichts, [E7]nichts mehr wie es [Am]war [E7] [Am] +{/chorus} + +{a:Vers 2:} +{bridge} + Am [Am]Tresen wird betrügerisch [E7]eingeschenkt + Und die [Am]Mehrheit will sowieso ein [E7]Sportgetränk + Und [Dm]genauso wie sie [Dm/C]trinken, so [Dm/H]tanzen sie auch + Laß die [C]Kippen in der Tasche, hier [E7]wird nicht mehr geraucht +{/bridge} + +{a:Refrain:} +{chorus} + Das [Dm]bringt doch die [G7]Gesundheit in [C]Gefahr [Am] + Hier ist [F]nichts, [E7]nichts mehr wie es [Am]war [E7] [Am] +{/chorus} + +{a:Vers 3:} +{bridge} + Die 15 Mann auf des toten Manns Kiste + Die mußten da weg, weil die jetzt fest vermietet ist + Das Gebüsch mit dem stöhnenden Ungetier + Das hatte an Armen und an Beinen vier +{/bridge} + +{a:Refrain:} +{chorus} + Das ist auch schon lange nicht mehr da + Es ist nichts, nichts mehr wie es war +{/chorus} + +{a:Vers 4:} +{bridge} + Ein alter Sack zu sein, ist hier nicht schwer + Und traurig ist das Leben als Reaktionär + Laß uns abgehauen sein, bevor man uns erwischt + Und wo ein Wille ist, mein Herz, da ist auch ein Gebüsch +{/bridge} + +{a:Refrain:} +{chorus} + Schließlich sind wir jetzt die Avantgarde + Denn es ist nichts, nichts mehr wie es war +{/chorus} diff --git a/gtx/nothing_else_matters.gtx b/gtx/nothing_else_matters.gtx new file mode 100644 index 0000000..7bf18e6 --- /dev/null +++ b/gtx/nothing_else_matters.gtx @@ -0,0 +1,67 @@ +{title: Nothing Else Matters} +{subtitle: Mettalica} + +{a:Vers 1:} +{bridge} +[Em]So close, no matter [D]how far [C]. [Em]Couldn't be much more [D]from the [C]heart +[Em]Forever trusting [D]who we [C]are [G]and [H7]nothing else [Em]matters + +[Em]Never opened my[D]self this [C]way. [Em]Life is ours, we live it [D]our [C]way +[Em]All these words I don't [D]just [C]say [G] and [H7]nothing else [Em]matters + +[Em]Trust I seek and I [D]find in [C]you. [Em]Every day for us [D]something [C]new +[Em]Open mind for a [D]different [C]view [G] and [H7]nothing else [Em]matters +{/bridge} + +{a: Refrain:} +{chorus} + [D]never cared for what they [C]do [A] + [D]never cared for what they [C]know [A] + [D]but I [Em]know +{/chorus} + +{a:Vers 2:} +{bridge} +[Em]So close, no matter [D]how far [C]. [Em]Couldn't be much more [D]from the [C]heart +[Em]Forever trusting [D]who we [C]are [G] and [H7]nothing else [Em]matters +{/bridge} + +{a: Refrain: ...} + +{a:Vers 3:} +{bridge} +[Em]Never opened my[D]self this [C]way. [Em]Life is ours, we live it [D]our [C]way +[Em]All these words I don't [D]just [C]say + +[Em]Trust I seek and I [D]find in [C]you. [Em]Every day for us [D]something [C]new +[Em]Open mind for a [D]different [C]view [G] and [H7]nothing else [Em]matters +{/bridge} + +{a: Refrain:} +{chorus} + [D]never cared for what they [C]say [A] + [D]never cared for games they [C]play [A] + [D]never cared for what they [C]do [A] + [D]never cared for what they [C]know [A] + [D]and I [Em]know +{/chorus} + +{a:Vers 4:} +{bridge} +[Em]So close, no matter [D]how far [C]. [Em]Couldn't be much more [D]from the [C]heart +[Em]Forever trusting [D]who we [C]are. [G]No, [H7]nothing else [Em]matters +{/bridge} + +{np} + +{a: Intro:} + +{guitartab: [9;Em]&[1;0][4;0][5;0][6;0][5;0][4;0]|[1;0][4;0][5;0][6;0][5;0][4;0]|[1;0][4;0][5;0][6;0][5;0][4;0]|[1;0][4;0][5;0][6;0][5;0][6;7]|[1;0]&[6;7][5;0][4;0][6;7p]&[5;0][6;0][5;0][4;0]} + +{guitartab: [1;0][4;0][5;0]&[6;7][5;0]&[6;8][6;7][6;5]|[5;0]&[6;7][6;5][6;2][6;0]|[9;Am]&[2;0]&[5;5][4;5][5;5][6;2p][6;0][5;5][4;5]|[2;0][4;5][5;5][6;0][2;0]&[4;5]&[5;5]&[6;0][2;2]&[4;5]&[5;5]&[6;0]|[9;C]&[2;3]&[4;5]&[5;5]&[6;0][4;5][5;5][6;3p][6;0][5;5][4;5][2;3]&[4;5]&[5;5]&[6;0]} + +{guitartab: [9;Dadd2/9]&[2;5]&[4;7]&[5;7]&[6;0][4;7][5;7][6;0h][6;5p][6;0][5;7p][5;0][5;0h][5;5]|[9;Em]&[1;0][4;<12>][5;<12>][6;<12>]___|[1;0][4;0][5;0][6;0][5;0][4;0]|[1;0][4;0][5;0][6;0][5;0][4;0]} + +{guitartab: [1;0][4;0][5;0][6;0][5;0][4;0]|[9;Em]&[1;0][2;7][3;9][4;9][5;8]&[6;7]|[9;D]&[2;5][3;7][4;7]&[5;7][9;C]&[2;3][3;5][4;5]&[5;5]|[9;Em]&[1;0][2;7][3;9][4;9][5;8]&[6;7]|[9;D]&[2;5][3;7][4;7]&[5;7][9;C]&[2;3][3;5][4;5]&[5;5]} + +{guitartab: [9;Em]&[1;0][2;7][3;9][4;9][5;8]&[6;7]|[9;D]&[2;5][6;5][5;7][4;7][9;C]&[2;3][6;3][5;5][4;5]|[9;G]&[1;3][6;3][5;3][4;4][9;H7]&[2;2][6;2][5;4][4;2]|[9;Em]&[1;0][4;0][5;0][6;0][5;0][4;0]} \ No newline at end of file diff --git a/gtx/ofen_aus_glas.gtx b/gtx/ofen_aus_glas.gtx new file mode 100644 index 0000000..f9f33b6 --- /dev/null +++ b/gtx/ofen_aus_glas.gtx @@ -0,0 +1,41 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} +{language: german} +{color_chorus:0,0,0} +{color_bridge:0,0,0} + +{title: Ofen Aus Glas} +{subtitle: Element Of Crime} + +{define: H7 t x 2 1 2 n 2} + +{a:Vers 1:} +{bridge} + [D]Kauf dir ein Sä[D]ckchen voll B[C]lei, [C]bind's an mein B[D]ein + und w[C]irf mich hin[G]ein, in den [H7]See deiner Wü[C]nsche + und sieh zu[D] wie ich ver[G]sink', verbr[H7]ing' dann den Ta[Em]g + mit dem Kä[C]mmen deiner H[D]aare. +{/bridge} + +{a:Vers 2:} +{bridge} + K[D]auf' dir ein H[D]alsband aus S[C]amt ,l[C]eg' es mir [D]um + und fü[C]hr' mich h[G]erum, im Gestr[H7]üpp deines D[C]enkens + und sieh z[D]u, wie ich mich verh[G]ak', verbri[H7]ng' dann den T[Em]ag + mit dem Fe[C]ilen deiner Nä[D]gel. +{/bridge} + +{a:Vers 3:} +{bridge} + K[D]auf' dir einen O[D]fen aus G[C]las, he[C]ize ihn e[D]in + und l[C]eg' mich hi[G]nein, in das F[H7]euer deines Z[C]ornes + und sieh zu[D] wie ich's ert[G]rag', verbr[H7]ing' dann den T[Em]ag + mit dem Re[C]iben deiner A[D]ugen. + \\ + Doch w[G]arte nicht [G], w[C]arte nicht [C] + zu l[G]ang. +{/bridge} + +{a:Zwischenspiel:} +{guitartab: [6;3][6;3][6;3][6;3][6;2] _ [6;0][6;2] } diff --git a/gtx/one_of_us.gtx b/gtx/one_of_us.gtx new file mode 100644 index 0000000..50e9001 --- /dev/null +++ b/gtx/one_of_us.gtx @@ -0,0 +1,58 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: One Of Us} +{subtitle: Joan Osborne} + +{define:Cadd9 t x 3 2 n 3 3} +{define:CMaj7 t x 3 2 n n n} + +{a:Capo: 2} +{a:Intro: Em Cadd9 G D} + +{a:Vers 1:} +{bridge} + If [Em]God had a [Cadd9]name, [G]what would it [D]be? + And would you [Em]call it to his [C]face + [G]If you were [D]faced with him + In [Em]all his [Cadd9]glory - [G]what would you [D]ask? + If you had [Em]just one [Cadd9]question? [G] [D] +{/bridge} + +{a:Refrain:} +{chorus} + [CMaj7]Yeah... yeah... [G]God is [D]great + [CMaj7]Yeah... yeah... [G]God is [D]good + [CMaj7]Yeah... yeah... [D]yeah... yeah... yeah... + What if [Em]God was [Cadd9]one of us? [G] [D] + Just a [Em]slob like [Cadd9]one of us? [G] [D] + Just a [Em]stranger [Cadd9]on the [G]bus trying to [D]make his way home [Em] [Cadd9] [G] [D] +{/chorus} + +{a:Vers 2:} +{bridge} + If [Em]God had a [Cadd9]face, [G]what would it [D]look like + And would you [Em]want to [C]see? + [G]If seeing [D]meant that you would [Em]have to [Cadd9]believe, + [G]In things like [D]heaven and in [Em]Jesus and the [Cadd9]saints [G]and all the [D]prophets +{/bridge} + +{np} + +{a:Refrain:} +{chorus} + [CMaj7]Yeah... yeah... [G]God is [D]great + [CMaj7]Yeah... yeah... [G]God is [D]good + [CMaj7]Yeah... yeah... [D]yeah... yeah... yeah... + What if [Em]God was [Cadd9]one of us? [G] [D] + Just a [Em]slob like [Cadd9]one of us? [G] [D] + Just a [Em]stranger [Cadd9]on the [G]bus trying to [D]make his way home [Em] [Cadd9] [G] + Trying to [D]make his way [Em]home [Cadd9] [G] + Like up to [D]heaven all [Em]alone [Cadd9] [G] + Nobody [D]calling on the [Em]phone [Cadd9] [G] + Except for the [D]Pope, maybe in [Em]Rome. [Cadd9] [G] [D] [G] +{/chorus} diff --git a/gtx/phaenomenal_egal.gtx b/gtx/phaenomenal_egal.gtx new file mode 100644 index 0000000..eb59e5a --- /dev/null +++ b/gtx/phaenomenal_egal.gtx @@ -0,0 +1,76 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} +{language: german} +{color_chorus:0,0,0} + +{even} +{title: Ph"anomenal Egal} +{subtitle: Farin Urlaub} + +{define:Asus2 t x n 2 2 n n} +{define:E5 t n 2 2 1 1 n} +{define:E6 t n 2 2 1 2 n} +{define:E7 t n 2 2 1 3 n} + +{a:Vers 1:} +{bridge} + [E]Zwar lieg ich [F#m]Nachts [A]stundenlang [H]wach und denk an [E]dich, [F#m] + doch in [A]Wirklichkeit [H]lieb ich dich [E]nicht. + Zwar gibt es [F#m]keine sch"onere [A]Frau auf der [H]ganzen Welt f"ur [E]mich, [F#m] + doch in [A]Wirklichkeit [H]lieb ich dich [C#m]nicht. +{/bridge} + +{a:Refrain:} +{chorus} + Eigentlich [H]bist du mir [A]egal, [Asus2] [A] + [C#m]eigentlich [H]bist du nicht mein [A]Typ [Asus2] [A] + und auf [C#m]jeden [H]Fall bin ich [A]gar nicht in [H]dich verlie[E]bt. +{/chorus} + +{a:Vers 2:} +{bridge} + Ich steh zwar [F#m]ab und zu [A]einfach nur [H]so an deiner [E]T"ur, + [F#m]doch im [A]Prinzip will ich [H]gar nichts von [E]dir. + Dein [F#m]Foto h"angt [A]wirklich nur [H]zuf"allig [E]hier, [F#m] + im [A]Prinzip will ich [H]gar nichts von [C#m]dir. +{/bridge} + +{a:Refrain:} +{chorus} + Eigentlich [H]bist du mir [A]egal, [Asus2] [A] + [C#m]eigentlich [H]bist du nicht mein [A]Typ [Asus2] [A] + und auf [C#m]jeden [H]Fall bin ich [A]gar nicht in [H]dich verlie[E]bt. +{/chorus} + +{a:Mittelteil:} +{chorus} + [E]Du bist nur [E5]Luft f"ur mich ganz [E6]unwichtig, [E7]total banal, + [A]ich nehm dich gar nicht [Am]wahr. + Du bist [F#m]mir [G#m]einfach [A]ph"anome[H]nal [E]egal +{/chorus} + +{np} + +{a:Vers 3:} +{bridge} + Ich muss es [F#m]dir gestehen, [A]selbst wenn dein [H]Herz daran [E]zerbricht, [F#m] + in [A]Wirklichkeit [H]lieb ich dich [E]nicht. + Du hast so [F#m]sch"one Augen [A]und ein noch [H]sch"oneres [E]Gesicht, [F#m] + in [A]Wirklichkeit [H]lieb ich dich [C#m]nicht. +{/bridge} + +{a:Refrain:} +{chorus} + Eigentlich [H]bist du mir [A]egal, [Asus2] [A] + [C#m]eigentlich [H]bist du nicht mein [A]Typ [Asus2] [A] + und auf [C#m]jeden [H]Fall bin ich fast [A]gar nicht in [H]dich verlie[C#m]bt. + \\ + [C]Verliebt, [G]verliebt, [A]verliebt, + [C#m]verliebt, [C]verliebt, [G]verliebt, + fast [A]gar nicht in dich ver[E]liebt. +{/chorus} + +{a:Intro: 2x spielen} + +{guitartab: [6;0][4;4][5;4][4;4][6;0][4;4][5;4][4;4][6;0][4;4][5;4][4;4][6;0][4;4][5;4][4;4] | [6;0][4;4][5;2][4;4][6;0][4;4][5;2][4;4][6;0][4;4][5;2][4;4][6;0][4;4][5;2][4;4]} diff --git a/gtx/rein_gar_nichts.gtx b/gtx/rein_gar_nichts.gtx new file mode 100644 index 0000000..ab12be6 --- /dev/null +++ b/gtx/rein_gar_nichts.gtx @@ -0,0 +1,35 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} +{language: german} +{color_chorus:0,0,0} + +{title: Rein Gar Nichts} +{subtitle: Element Of Crime} + +{a:Vers 1:} +{bridge} + [Am]Jetzt sitzen wir schon [Am/G#]wieder hier, drei [Am/G]Schritte [Am/F#]auseinander + [Am]Drei Finger hoch der [Am/G#]Gin, [Am/G] das Glas im [Am/F#]Gesicht + Und ich frag auch [Am]gar nicht, [Am/G#]wie es dir [Am/G]geht [Am/F#] + Was [Dm]soll ich da noch [G7]fragen, [C]ich weiß wie es [E7]steht + Und das ist noch [Am]rein, [Am/G#]rein, [Am/G]rein, rein [Am/F#]gar [Am]nichts [Am/G#] [Am/G] [Am/F#] +{/bridge} + +{a:Vers 2:} +{bridge} + Ich weiß, du hast heut' ferngesehn, das ist weil du so zitterst + Dein Auto hat der Zahnarzt, und du hast Gold im Mund + Und dein Fahrrad fährt immer nur bergauf + Ich weiß, auch du lebst alleine, und auch dich frißt das auf + Und das ist noch rein, rein, rein, rein gar nichts +{/bridge} + +{a:Vers 3:} +{bridge} + Dein Fuß hat grad mein Bein berührt, dein Zeh hat mich gekrault + Drei Finger hoch der Gin, das Glas im Gesicht + Und ich frag auch gar nicht, was du da machst + Komm rüber hier, ich kitzel dich, mal sehn ob du lachst + Und das ist noch rein, rein, rein, rein gar nichts +{/bridge} diff --git a/gtx/show_must_go_on.gtx b/gtx/show_must_go_on.gtx new file mode 100644 index 0000000..0c06cf2 --- /dev/null +++ b/gtx/show_must_go_on.gtx @@ -0,0 +1,89 @@ +{title: Show Must Go On} +{subtitle: Queen} + +{define:Am t x n 2 2 1 n} +{define:Asus2 t x n 2 2 n n} +{define:Asus4 t x n 2 2 3 n} +{define:F t x x 3 2 1 1} +{define:F5 t x x 3 2 n 1} +{define:F6 t x x 3 2 3 1} +{define:Dm t x x n 2 3 1} +{define:Dm5 t x x n 1 3 1} +{define:Dm6 t x x n 2 n 1} +{define:Esus4 t n 2 2 2 n n} +{define:E t n 2 2 1 n n} + + +{a: Vers 1:} +{bridge} + Empty spaces[Am] -[Asus2] what are we [Asus4]living for[Am]? + Abandoned [F]places -[F5] I guess we [F6]know the [F]score.. + [Dm]On and [Dm6]on! + Does [Esus4]anybody [E]know what we are [Dm]looking for[Dm5]? +{/bridge} + + +{a: Vers 2:} +{bridge} + Another hero - another mindless crime. + Behind the curtain, in the pantomime. + Hold the line! + Does anybody want to take it anymore? +{/bridge} + + +{a: Refrain:} +{chorus} + The Show must go on! The Show must go on! + Inside my heart is breaking, + My make-up may be flaking, + But my smile, still, stays on! +{/chorus} + +{a: Vers 3:} +{bridge} + Whatever happens, I'll leave it all to chance. + Another heartache - another failed romance. + On and on! + Does anybody know what we are living for? + I guess i'm learning + I must be warmer now.. + I'll soon be turning round the corner now. + Outside the dawn is breaking, + But inside in the dark I'm aching to be free! +{/bridge} + +{np} + +{a: Refrain: ...} + +{a: Vers 4:} +{bridge} + My soul is painted like the wings of butterflies, + Fairy tales of yesterday, will grow but never die, + I can fly, my friends! +{/bridge} + + +{a: Refrain:} +{chorus} + The Show must go on! Yeah! + The Show must go on! + I'll face it with a grin! + I'm never giving in! + On with the show! +{/chorus} + + +{a: Vers 5:} +{bridge} + I'll top the bill! + I'll overkill! + I have to find the will to carry on! + On with the, + On with the show! +{/bridge} + + +{a: Akkorde:} + diff --git a/gtx/sitting_waiting.gtx b/gtx/sitting_waiting.gtx new file mode 100644 index 0000000..a4344e0 --- /dev/null +++ b/gtx/sitting_waiting.gtx @@ -0,0 +1,88 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Sitting, Waiting, Wishing} +{subtitle: Jack Johnson} + +{define:Am 5 n 2 2 n n n} +{define:Am7 5 n 2 n n n n} +{define:G 3 n 2 2 1 n n} +{define:G7 3 n 2 n 1 n n} +{define:F7 1 n 2 n 1 n n} +{define:C 3 n n 2 2 2 n} +{define:C7 3 n n 2 n 2 n} + +{a:Intro: Am Am7 G G7 F F7 C C7} + +{a:Vers 1:} +{bridge} + Well [Am]I was sitting, [Am7]waiting, wishing + [G]You believed in [G7]superstitions + [F]Then maybe you'd [F7]see the [C]signs [C7] + \\ + The [Am]Lord knows that this [Am7]world is cruel + I [G]ain't the Lord, I'm [G7]just a fool + and in [F]love with somebody [F7]don't make them love [C]you [C7] +{/bridge} + +{a:Refrain:} +{chorus} + Must I [E]always be waiting, waiting on [Am]you [Am7] [Am] [Am7] + Must I [E]always be playing, playing your [Am]fool [Am7] [Am] [Am7] +{/chorus} + +{a:Vers 2:} +{bridge} + I [Am]sang your songs, I [Am7]danced your dance + I [G]gave your friends [G7]all a chance + [F]Putting up with them [F7]wasn't worth ever having [C]you [C7] + \\ + [Am]Maybe you've been through [Am7]this before + But it's [G]my first time so [G7]please ignore + These [F]next few lines because [F7]they're directed at [C]you [C7] +{/bridge} + +{a:Refrain:} +{chorus} + I [E]can't always be waiting, waiting on [Am]you [Am7] [Am] [Am7] [Am] + I [E]can't always be playing, playing your [Am]fool [Am7] [Am] [Am7] [Am] +{/chorus} + +{np} + +{a:Mittelteil:} +{chorus} + [C] I keep playing your [E]part + But it's not my [F]scene + Want this part to [G]twist + I've had enough [C]mystery + Keep building it [E]up + Then shooting me [F]down + But I'm already [G]down, Just wait a [Am]minute [Am7] + [G] [G7]Just sitting, [F]waiting [F7] [C] + [C7]Just wait a [Am]minute [Am7] + [G] [G7]Just sitting, [F]waiting [F7] [C] [C7] +{/chorus} + +{a:Vers 3:} +{bridge} + Well [Am]if I was in [Am7]your position + I'd [G]put down all my [G7]amunition + I'd [F]wonder why it [F7]had taken me so [C]long [C7] + + But [Am]the lord knows that [Am7]I'm not you + and [G]if I was I wouldn't [G7]be so cruel + cause [F]waitin' on love ain't [F7]so easy to [C]do [C7] +{/bridge} + +{a:Refrain:} +{chorus} + Must I always be waiting, waiting on you + Must I always be playing, playing your fool + I can't always be waiting, waiting on you + I can't always be playing, playing your fool +{/chorus} diff --git a/gtx/somewhere.gtx b/gtx/somewhere.gtx new file mode 100644 index 0000000..464845d --- /dev/null +++ b/gtx/somewhere.gtx @@ -0,0 +1,45 @@ +{title: Somewhere over the Rainbow} +{subtitle: Eric Clapton} +{define:C#9 2 x 2 1 2 2 2} +{define:F#m7 2 n 2 n n n n} +{define:B9 t x 2 1 2 2 2} +{define:C#m7 4 x n 2 n 1 n} +{define:G#m7 4 n 2 n n n n} +{define:Ebm7 6 x n 2 n 1 n} +{define:Eaug 5 x 2 1 n n x} +{define:A 5 n 2 2 1 n n} +{define:Eb7 3 x 3 2 3 1 x} +{define:D9 3 x 2 1 2 2 2} +{define:Bbm7 6 n 2 n n n n} +{define:Eb9 4 x 2 1 2 2 2} + +{a: Intro: E C#9 F#m7 B9} + +{a: Vers: 1} +{bridge} +[E]Some[C#m7]where [G#m7]over the [Ebm7]rain [Eaug]bow [A]Way [Eb7]Up [G#m7]High [C#9] +[F#m7]Theres [D9]a [G#m7]land that I've [C#9]heard of [F#m7]once in a [H9]lulla[E]by [A] [H] +[E]Some[C#m7]where [G#m7]over the [Ebm7]rain [Eaug]bow [A]Skies [Eb7]are [G#m7]blue [C#9] +[F#m7]and [D9]the [G#m7]dreams that you [C#9]dare to [F#m7]dream really [H9]do come [E]true +{/bridge} + +{a: Vers: 2} +{chorus} +Some [E]day I'll wish upon a star and +[F#m7]wake up where the [H9]clouds are far be[G#m7]hind [C#9]me [F#m7] [H9] +Where [E]troubles melt like lemon drops +[Bm7]Away above the [Eb9]chimney tops +That's [G#m7]where [C#9]you'll [F#m7]find [H9]me +{/chorus} + +{a: Vers: 3} +{bridge} +[E]Some[C#m7]where [G#m7]over the [Ebm7]rain [Eaug]bow [A]blue [Eb7]birds [G#m7]fly [C#9] +[F#m7]Birds [D7]fly [G#m7]over the [C#9]rainbow +[F#m7]Why then, oh [H9]why can't [G#m7]I [C#9]? +[F#m7]Birds [D7]fly [G#m7]over the [C#9]rainbow +[F#m7]Why then, oh [H9]why can't [E]I? +If [E]happy little bluebirds fly [F#m7]beyond the rainbow +[H9]Why, oh, why can't [E]I? [C#9] [F#m7] [H9] +[E]repeat [C#9] [F#m7] [H9] +{/bridge} \ No newline at end of file diff --git a/gtx/sorry_seems_to_be.gtx b/gtx/sorry_seems_to_be.gtx new file mode 100644 index 0000000..b556d59 --- /dev/null +++ b/gtx/sorry_seems_to_be.gtx @@ -0,0 +1,67 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Sorry Seems To Be The Hardest Word} +{subtitle: Elton John} + +{define:Am7 t x n 2 n 1 n} +{define:D/F# t 2 n n 2 3 2} +{define:C/E t n 3 2 n 1 n} +{define:G/D t x x n n 2 2} +{define:Am7/C t x 3 2 n 1 n} +{define:F#m7 2 n 2 n n 3 n} + +{a:Capo: 3. Bund} +{a:Intro: Em Em6 Em5 Em Am C H7 Em} +{a:Vers 1:} +{bridge} + [Em]What I gotta do to make you [Am7]love me? + [D]What I gotta do to make you [G]care? [Am] [H7] + [Em]What do I do when lightning [Am7]strikes me? + [D]And I wake to find that you're not [G]there [Am] [H7] +{/bridge} + +{a:Vers 2:} +{bridge} + [Em]What do I do to make you [Am7]want me? + [D]What I gotta do to be [G]heard? [Am] [H7] + [Em]What do I say when it's all [Am7]over? + [D]Sorry seems to be the hardest [G]word [D/F#] +{/bridge} + +{a:Refrain:} +{chorus} + [C/E]It's sad, [H7]so sad + [G/D]It's a sad sad [A7]situation + [Am7/C]And it's getting [H7]more and more ab[Em]surd [F#m7] [H7] + [C/E]It's sad, [H7]so sad + [G/D]Why can't we [A7]talk it over + [C]Oh it seems to me, + [Am7]That sorry seems to [H7]be the hardest [Em]word +{/chorus} + +{a:Vers 3:} +{bridge} + [Em]What do I do to make you [Am7]want me? + [D]What I gotta do to be [G]heard? [Am] [H7] + [Em]What do I say when it's all [Am7]over? + [D]Sorry seems to be the hardest [G]word [D/F#] +{/bridge} + +{np} + +{a:Refrain ...} + +{a:Vers4:} +{bridge} + [Em]What do I do to make you [Am7]love me? + [D7]What I gotta do to be [G]heard? [Am] [H7] + [Em]What do I do when lightning [Am7]strikes me? + [C]What have I got to [H7]do? + [Em]What have I got to [Am7]do? + [C]Sorry seems to be the [H7]be the hardest [Em]word [Em6] [Em5] [Em] [Am] [H7] [Em] +{/bridge} diff --git a/gtx/sperr_mich_ein.gtx b/gtx/sperr_mich_ein.gtx new file mode 100644 index 0000000..4b3b77f --- /dev/null +++ b/gtx/sperr_mich_ein.gtx @@ -0,0 +1,46 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} +{language: german} +{color_chorus:0,0,0} + +{title: Sperr Mich Ein} +{subtitle: Element Of Crime} + +{a:Vers 1:} +{bridge} + [D] Lass mich noch eine [Hm]rauchen,[D] dann auf zur [Hm]Tat - + [F#] die H"ande [E]hinter'm Kopf versch[G]r"ankt. + [D] Durchsuchen musst du [Hm]gr"undlich,[D] "uber[Hm]all - + [F#] der Fall ist schw[E]erer als du [G]denkst. +{/bridge} + +{a:Refrain:} +{chorus} + [G] Erkl"ar' mir meine [A]Rechte,[D] sperr mich [Hm]ein, + [G]ich will von [A]dir verhaftet [D]sein. [Hm] [D] [Hm] +{/chorus} + +{a:Vers 2:} +{bridge} + [D] Meine Sitten sind verl[Hm]ottert,[D] mein Weltbild ist verdr[Hm]eht + [F#] und schmutzig [E]meine Phanta[G]sie. + [D] Bin schuldig groben [Hm]Unfugs,[D] der V"oller[Hm]ei, + [F#] und gut zu [E]Tieren war ich [G]nie. +{/bridge} + +{a:Refrain ...} + +{a:Vers 3:} +{bridge} + [D] Gib mir meine St[Hm]rafe,[D] hart hab' ich es [Hm]gern. + [F#] Ich halte st[E]ill, was immer auch pas[G]siert. + [D] In Freiheit bin ich [Hm]garstig,[D] gefangen will ich [Hm]sein, + [F#] kleingem[E]acht und kotverschm[G]iert. +{/bridge} + +{a:Refrain ...} +{a:Intro:} +\footnotesize +{guitartab: [3;4][4;3][5;5][4;3][3;4][4;3][5;5][4;3][3;2][4;1][5;3][4;1][6;0][5;3][4;1][5;3]|[3;4][4;3][5;5][4;3][3;4][4;3][5;5][4;3][3;2][4;1][5;3][4;1][3;2][4;0][5;3][4;0]} +\normalsize diff --git a/gtx/stand_by_me.gtx b/gtx/stand_by_me.gtx new file mode 100644 index 0000000..63dc662 --- /dev/null +++ b/gtx/stand_by_me.gtx @@ -0,0 +1,40 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Stand By Me} +{subtitle: Ben E.King} + +{a:Intro: A F#m D E A} + +{a:Vers 1:} +{bridge} + When the [A]night has come, [F#m]and the land is dark + And the [D]moon is the [E]only light we will [A]see + [A]No, I'won't be afraid, oh, [F#m]I won't be afraid + Just as [D]long as you [E]stand, stand by [A]me +{/bridge} + +{a:Refrain:} +{chorus} + [A]So darlin', darlin' stand by me + Oh [F#m]stand by me + Oh [D]stand, [E]stand by me, stand by [A]me +{/chorus} + +{a:Vers 2:} +{bridge} + If the [A]sky that we look upon [F#m]should tumble and fall + Or the [D]mountains should [E]crumble to the [A]sea + [A]I won't cry, I won't cry, no, [F#m]I won't shed a tear + Just as [D]long as you [E]stand, stand by [A]me. +{/bridge} + +{a:Refrain:} +{chorus} + [A]And dalin', darlin' stand by me + Oh [F#m]stand by me + Oh [D]stand, [E]stand by me, stand by [A]me +{/chorus} diff --git a/gtx/sunny.gtx b/gtx/sunny.gtx new file mode 100644 index 0000000..86eedbc --- /dev/null +++ b/gtx/sunny.gtx @@ -0,0 +1,57 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Sunny} +{subtitle: ABBA} + +{define:C t 3 3 2 n 1 n} +{define:C9 t x 3 2 n 3 n} +{define:Hm7 t x n 2 n 2 n} + +{a:Capo: 3} + +{a:Vers 1:} +{bridge} + [Am]Sunny, [C9] yesterday my [F]life was filled with [Hm7]rain [E7] + [Am]Sunny, [C9] you smiled at me and [F]really eased the [Hm7]pain [E7] + Now the [Am]dark days are done and the [C]bright days are near + My [F]sunny one shines [B]so sincere + [Hm7]Sunny, one so [E7]true + I love [Am]you [C] [F] [E7] +{/bridge} + +{a:Vers 2:} +{bridge} + Sunny, thank you for the sunshine bouquet + Sunny, thank you for the love you brought my way + You gave to me your all and all + And now I feel ten feet tall + Sunny, one so true + I love you +{/bridge} + +{a:Verse 3:} +{bridge} + Sunny, thank you for the truth you let me see + Sunny, thank you for the facts from A to Z + My life was torn like-a windblown sand, then + A rock was formed when we held hands + Sunny, one so true + I love you +{/bridge} + +{np} + +{a:Verse 4:} +{bridge} + Sunny, thank you for that smile upon your face + Sunny, thank you for that gleam that flows from grace + You're my spark of nature's fire + You're my sweet complete desire + Sunny, one so true + I love you +{/bridge} diff --git a/gtx/tears_in_heaven.gtx b/gtx/tears_in_heaven.gtx new file mode 100644 index 0000000..f3a2162 --- /dev/null +++ b/gtx/tears_in_heaven.gtx @@ -0,0 +1,46 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: Tears In Heaven} +{subtitle: Eric Clapton} + + +{a:Vers 1:} +{bridge} + Would you know my name, if I saw you in heaven? + Would you feel the same, if I saw you in heaven? + I must be strong and carry on + 'Cause I know I don't belong here in heaven... +{/bridge} + +{a:Vers 2:} +{bridge} + Would you hold my hand + if I saw you in heaven? + Would you help me stand + if I saw you in heaven? + I'll find my way through night and day + 'Cause I know I just can't stay here in heaven... +{/bridge} + +{a:Refrain:} +{chorus} + Time can bring you down, time can bend your knees + Time can break your heart, have you begging please...begging please + Beyond the door there's peace I'm sure + And I know there'll be no more tears in heaven... +{/chorus} + +{a:Vers 3:} +{bridge} + Would you know my name + if I saw you in heaven? + Would you feel the same + if I saw you in heaven? + I must be strong and carry on + 'Cause I know I don't belong here in heaven... +{/bridge} diff --git a/gtx/the_man_who_sold_the_world.gtx b/gtx/the_man_who_sold_the_world.gtx new file mode 100644 index 0000000..2f0b617 --- /dev/null +++ b/gtx/the_man_who_sold_the_world.gtx @@ -0,0 +1,39 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{title: The Man Who Sold The World} +{subtitle: Chords by Nirvana} + + +{a:Intro: Dm A Dm} + +{a:Vers 1:} +{bridge} + [Dm]We passed upon the [A] stair, we spoke of was and [Dm]when + [Dm]Although I wasn't [A]there, he said I was his [F]friend + [F]which came as some surp[C]rise I spoke into his [A]eyes + [A]I thought you died [Dm]alone, a long long time [C]ago +{/bridge} + +{a:Refrain:} +{chorus} + [C]Oh no, not [F]me + I [B]never lost [F]control + [F]You're [C]face to [F]face + [F]With The [B]Man Who Sold The [A]World +{/chorus} + +{a:Zwischenspiel: A Dm A Dm} + +{a:Vers 2:} +{bridge} + I [Dm]laughed and shook his h[A]and, and made my way back h[Dm]ome + I [Dm]searched for form and l[A]and, for years and years I ro[F]amed + I [F]gazed a gazley st[C]are at all the millions h[A]ere + We [A]must have died along, a l[Dm]ong long time ag[C]o +{/bridge} + +{a:Refrain ...} + +{a:Zwischenspiel: A Dm A Dm F Dm A Dm} diff --git a/gtx/these_boots_are_make.gtx b/gtx/these_boots_are_make.gtx new file mode 100644 index 0000000..3ff5a45 --- /dev/null +++ b/gtx/these_boots_are_make.gtx @@ -0,0 +1,59 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{even} +{title: These Boots Are Made For Walkin} +{subtitle: Nancy Sinatra} + +{a:Intro: 4 x E } + +{a:Vers 1:} +{bridge} + [E]You keep saying, you've got something for me, + Something you call love, but confess. + [A]You've been messing where you shouldnt be messing, + And [E]now someone else is getting all your best. +{/bridge} + +{a:Refrain:} +{chorus} + These [G]Boots are made for [Em]walking + And [G]that's just what they'll [Em]do, + [G]One of these days these [Em]boots [pause]are gonna walk all over you. [Zwischenspiel] +{/chorus} + +{a:Vers 2:} +{bridge} + [E7]You keep lying when you ought to be truthing, + And you keep losing when you ought to not bet, + [A7]You keep sameing when you ought to be a changing, + Now [E7]what's rights right but you aint been right yet. +{/bridge} + +{a:Refrain ...} + +{a:Vers 3:} +{bridge} + [E7]You keep playing where you shouldnt be playing, + And you keep thinking that you'll never get burned , ha! + [A7]I just found me a brand new box of matches yeah + [E7]And what he knows you aint had time to learn. +{/bridge} + +{a:Refrain ...} + +{np} + +{a:Vers 4:} +{bridge} + [E]Are you ready boots, start walking.... +{/bridge} + +{a:Zwischenspiel:} + +\footnotesize +{guitartab: [1;12][1;12]__[1;11][1;11]__[1;10][1;10]__[1;9][1;9] | [1;8][1;8]__[1;7][1;7]__[1;6][1;6]__[1;5][1;5]} +\normalsize diff --git a/gtx/time.gtx b/gtx/time.gtx new file mode 100644 index 0000000..51cbfd9 --- /dev/null +++ b/gtx/time.gtx @@ -0,0 +1,47 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Time} +{subtitle: Pink Floyd} + +{define:Asus4 t x n 2 2 3 n} +{define:Dmaj7 t x n n 2 2 2} +{define:Amaj7 t x n 2 1 2 n} +{define:Hm7 2 x n 2 n 1 n} +{define:C#m7 4 x n 2 n 1 n} + + +{a:Vers 1:} +{bridge} + [F#m]Ticking away, the moments that make up a [A]dull day [Asus4] [A] [A9] [A] + [E]You fritter and waste the hours in an offhand [F#m]way + [F#m]Kicking around on a piece of a ground in your [A]home town + [E]Waiting for someone or something to show you the [F#m]way. +{/bridge} + +{a:Refrain:} +{chorus} + [Dmaj7]Tired of lying in the sunshine, [Amaj7]staying home to watch the rain, + [Dmaj7]You are young and life is long, and [Amaj7]there is time to kill today, + [Dmaj7]And then one day you find, [C#m7]ten years have got behind you + [Hm7]No one told you where to run, [E]you missed the starting gun. +{/chorus} + +{a:Vers 2:} +{bridge} + [E]And you [F#m]run, and you run to catch up to the sun, but it's [A]sinking, + [E]And racing around, to come up behind you [F#m]again + [F#m]The sun is the same in a relativ way, but your [A]older [Asus4] [A] [A9] [A] + [E]Shorter of breath, and one day closer to [F#m]death. +{/bridge} + +{a:Refrain:} +{chorus} + [Dmaj7]Every year is getting shortet, [Amaj7]never seem to find the time, + [Dmaj7]Plans that either come to naught, [Amaj7]or half a page of scribbled lines, + [Dmaj7]Hanging on a quite, despe[C#m]ration is the english way, + [Hm]The time is gone, the [Hm7]song is over[F]thought I'd something more to stay. [E] [D] +{/chorus} diff --git a/gtx/venus.gtx b/gtx/venus.gtx new file mode 100644 index 0000000..827fb8f --- /dev/null +++ b/gtx/venus.gtx @@ -0,0 +1,36 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Venus} +{subtitle: Shocking Blue} + +{define:B7sus4 7 n 2 n 2 n n} + +{a:Vers 1:} +{bridge} + A [Em]goddess on a [A]mountain [Em]top [A] + [Em]burning like a [A]silver [Em]flame, [A] + [Em]Summit of [A]beauty and [Em]love, [A] + and [Em]Venus was her [A]name. [Em] (Zwischenspiel) +{/bridge} + +{a:Refrain:} +{chorus} + She's [Am]got it, [D] [Am] yeah bab[D]y, she's [Em]got it. [A] [Em] [A] + [C7]I'm your Venus, [H7]I'm your fire at [Em] your desire. [A] [Em] [A] +{/chorus} + +{a:Vers 2:} +{bridge} + Her weapons are her crystal eyes + making every man mad. + Black as the dark night she was, + got what no one else had. (Zwischenspiel) +{/bridge} + +{a:Refrain ...} +{a:Zwischenspiel:} +{guitartab: [1;0][1;0][1;3][2;0][2;2][2;2][2;0][1;3] } diff --git a/gtx/we_are_the_champions.gtx b/gtx/we_are_the_champions.gtx new file mode 100644 index 0000000..3af5470 --- /dev/null +++ b/gtx/we_are_the_champions.gtx @@ -0,0 +1,41 @@ +{title: We Are The Champions} +{subtitle: Queen} + + +{define:H7/9 t x 2 1 2 n n} +{define:C9 t x 3 2 n 3 n} +{define:C/B t x 2 n n 3 n} + +{a: Capo 3} + +{a:Vers 1:} +{bridge} +I've paid my [Am]dues [Em] Time after [Am]time [Em] +I've done my [Am]sentence [Em] But committed no [Am]crime [Em] +And bad mi[C]stakes [F] I've made a [C]few [F] +I've had my [C]share of [C/B]sand kicked in my [Am7]face +But [D]I've come [G]through +And I need to go [G]on and on and on and [A7]on +{/bridge} + +{a:Refrain:} +{chorus} + [D]We are the [F#m]champions - my [Hm]friends [G] [A] + And [D]we'll keep on [F#m]fightin' till the [G]end [F#] [F] [H7/9] [H7] + [Em]We are the champions + [Gm]We are the [A7]champions + [D]No time for [C9]losers + 'Cause [F]we are the [G]champions [Am7] of the [Dm]world [Em] +{/chorus} + +{a:Vers 2:} +{bridge} +I've taken my bows and my curtain calls +You've brought me fame and fortune and everything that goes with it +I thank you all. But it's been no bed of roses no pleasure cruise +and I consider it a challenge before human race that I ain't gonna lose +And I need to go on and on and on and on +{/bridge} + + +{a:Refrain: ... 2x} \ No newline at end of file diff --git a/gtx/weil_du_nicht_da_bist.gtx b/gtx/weil_du_nicht_da_bist.gtx new file mode 100644 index 0000000..912d8ee --- /dev/null +++ b/gtx/weil_du_nicht_da_bist.gtx @@ -0,0 +1,43 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} +{language: german} +{color_chorus:0,0,0} + +{even} +{title: Weil Du Nicht Da Bist} +{subtitle: Element Of Crime} + +{a:Intro: H7 Em D7 G H7} + +{bridge} + \textbf{\textit{Vers 1:}} \\ + \\ + Auf dem [H7]Gerüst vor unserem Fenster kommt kein [Em]Maurer mehr vorbei. + Das [D7]Bett wird immer größer und [G]das Bad ist immer frei. + Der blöde [Am]Hund, der mich sonst jeden Tag [G]verbellt + liegt [H7]nur noch stumpf im Gras und glotzt mit leeren [C]Augen in die Welt. + Weil du nicht [G]da bist, weil du nicht [Am]da bist. [H7] +{/bridge} + +{bridge} + \textbf{\textit{Vers 2:}} \\ + \\ + Ein [H7]Vogel, der nur Körner frißt macht [Em]Regenwürmer kalt. + Im [D7]Bus, der nur noch stündlich kommt sind [G]alle angeschnallt. + Die alte [Am]Frau, die mich sonst jeden morgen [G]grüßt + kennt [H7]mich nicht mehr und tut, als ob sie [C]Groschenheft liest. + Weil du nicht [G]da bist, weil du nicht [Am]da bist. [H7] + [Em D7 G Am G H7] +{/bridge} + + +{bridge} + \textbf{\textit{Vers 3:}} \\ + \\ + Vom [H7]Nachbarn kommt musik nach der schon [Em]lang kein Hahn mehr kräht. + Eine [D7]Maus holt sich ihr Nachtmahl und auf [G]meinem Nachttisch steht + ein [Am]Schokoladenhase, traurig und [G]allein. + Ich [H7]weiß ihm nicht zu helfen, und [C]stopf ihn in mich rein. + Weil du nicht [G]da bist, weil du nicht [Am]da bist. [H7] +{/bridge} diff --git a/gtx/what_a_wonderfull_world.gtx b/gtx/what_a_wonderfull_world.gtx new file mode 100644 index 0000000..389023a --- /dev/null +++ b/gtx/what_a_wonderfull_world.gtx @@ -0,0 +1,47 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: What A Wonderful World} +{subtitle: Louis Armstrong} + +{define:C7 3 x n 2 n 2 n} +{define:C# 4 x n 2 2 2 n} +{define:D# 6 x n 2 2 2 n} +{define:Gm7 t f1p3 p5 f1p3 f1p3 f1p3 f1p3} + +{a:Vers 1:} +{bridge} + I see [F]trees of [Am]green, [B]red roses [Am]too, + [Gm7]I see them [F]bloom [A7]for me an [Dm]you, + and I [C#]think to my - self: + [Gm7] What a [C7]wonderful [F]world! [F7] [B] +{/bridge} + +{a:Vers 2:} +{bridge} + [C7] I see [F]skies of [Am]blue, [B]and clouds of [Am]white, + [Gm7]the bright blessed [F]day, [A7]the dark sacred [Dm]night, + and I [C#]think to my - self : + [Gm7] What a [C7]wonderful [F]world [Gm] [F] +{/bridge} + +{a:Vers 3:} +{bridge} + The [Gm7] colours of the [C7]rainbow, so [F]pretty in the sky, + Are [Gm7] also on the [C7]faces of [F]people goin' by. + I see [Dm]friends shakin' [Am]hands, sayin [Dm]"How do you [C]do?" + [Dm] They're really [D7]sayin': "[Gm7]I love [C7]you" +{/bridge} + +{a:Vers 4:} +{bridge} + I here [F]babies [Am]cry, [B]I watch them [Am]grow + [Gm7]they'll learn much [F]more than [A7]I'll ever [Dm]know, + and I [C#]think to my - self: + [Gm7] What a [C7]wonderful [F]world! [D#] [D7] + Yes, I [Gm7]think to myself: + [B] What a [C7]wonderful [F]world! [Gm7] [F] +{/bridge} diff --git a/gtx/where_did_you_sleep.gtx b/gtx/where_did_you_sleep.gtx new file mode 100644 index 0000000..bae75b1 --- /dev/null +++ b/gtx/where_did_you_sleep.gtx @@ -0,0 +1,41 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} +{color_bridge:0,0,0} + +{title: Where Did You Sleep Last Night} +{subtitle: Nirvana} + +{a:Vers 1:} +{bridge} + [Em]My girl, my girl, don't [A]lie to [G]me + Tell me [H]where did you sleep last [Em]night. + \\ + In the pines, in the pines + Where the [A]sun don't ever [G]shine + I would [H]shiver the whole night [Em]through + \\ + My girl, my girl where [A]will you [G]go + I'm [H]going where the cold wind [Em]blows + \\ + In the pines, in the pines + Where the [A]sun don't ever [G]shine + I would [H]shiver the whole night [Em]through +{/bridge} + +{a:Vers 2:} +{bridge} + Her husband, was a hard [A]working [G]man + Just [H]about a mile from [Em]here + His head was found in a [A]driving [G]wheel + But his [H]body never was found + \\ + [Em]My girl, my girl, don't [A]lie to [G]me + Tell me [H]where did you sleep last [Em]night. + \\ + In the pines, in the pines + Where the [A]sun don't ever [G]shine + I would [H]shiver the whole night [Em]through +{/bridge} diff --git a/gtx/while_my_guitar-am.gtx b/gtx/while_my_guitar-am.gtx new file mode 100644 index 0000000..447d764 --- /dev/null +++ b/gtx/while_my_guitar-am.gtx @@ -0,0 +1,56 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: While My Guitar Gently Weeps} +{subtitle: The Beatles} + + +{define: Am/G t 3 0 2 2 1 0} +{define: Am/F# t 2 0 2 2 1 0} +{define: Fmaj7 t x x 3 2 1 0} +{define: C#m 4 x 0 2 2 1 0} + +#{c:Intro } + +#[Am | Am7/G | Am6/F# | Fmaj7 | Am | G | D | E7 ] + +{a:Vers 1:} +{bridge} + I [Am]look at you [Am/G]all see the [Am/F#]love there that's [Fmaj7]sleeping + [Am]While my gui[G]tar gently [D]weeps [E7] + I [Am]look at the [Am/G]floor and I [Am/F#]see it needs [Fmaj7]sweeping + [Am]Still my gui[G]tar gently [C]weeps [E7] +{/bridge} + +{a:Refrain:} +{chorus} + [A]I don't know [C#m]why [F#m] + nobody [C#m]told you [Hm]how to unfold your [E]love [E7] + [A]I don't know [C#m]how [F#m] someone contr[C#m]olled you + [Hm]They bought and sold [E]you [E7] +{/chorus} + +{a:Vers 2:} +{bridge} + I look at the world and I notice it's turning + While my guitar gently weeps + With every mistake we must surely be learning + Still my guitar gently weeps +{/bridge} + +{a:Refrain:} +{chorus} + I don't know how you were diverted, You were perverted too + I don't know how you were inverted, No one alerted you. +{/chorus} + +{a:Vers 3:} +{bridge} + I [Am]look at you [Am/G]all see the [Am/F#]love there that's [Fmaj7]sleeping + [Am]While my gui[G]tar gently [D]weeps [E7] + [Am]..Look at you [Am/G]all [Am/F#] [Fmaj7] + [Am]Still my gui[G]tar gently [D]weeps [E7] +{/bridge} diff --git a/gtx/while_my_guitar-dm.gtx b/gtx/while_my_guitar-dm.gtx new file mode 100644 index 0000000..10fbbf3 --- /dev/null +++ b/gtx/while_my_guitar-dm.gtx @@ -0,0 +1,50 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: While My Guitar Gently Weeps} +{subtitle: The Beatles} + + +{define: Dm/C t n 3 n 2 3 1} +{define: Dm/H t n 2 n 2 3 1} + +{a:Vers 1:} +{bridge} + I [Dm]look at you [Dm/C]all see the [Dm/H]love there that's [H]sleeping + [Dm]While my gui[C]tar gently [G]weeps [A] + I [Dm]look at the [Dm/C]floor and I [Dm/H]see it needs [H]sweeping + [Dm]Still my gui[C]tar gently [F]weeps [A] +{/bridge} + +{a:Refrain:} +{chorus} + [D]I don't know [F#m]why [Hm] + nobody [F#m]told you [Em]how to unfold your [A]love [A7] + [D]I don't know [F#m]how [Hm] someone contr[F#m]olled you + [Em]They bought and sold [A]you [A7] +{/chorus} + +{a:Vers 2:} +{bridge} + I look at the world and I notice it's turning + While my guitar gently weeps + With every mistake we must surely be learning + Still my guitar gently weeps +{/bridge} + +{a:Refrain:} +{chorus} + I don't know how you were diverted, You were perverted too + I don't know how you were inverted, No one alerted you. +{/chorus} + +{a:Vers 3:} +{bridge} + I [Dm]look at you [Dm/C]all see the [Dm/H]love there that's [H]sleeping + [Dm]While my gui[C]tar gently [G]weeps [A] + [Dm]..Look at you [Dm/C]all [Dm/H] [H] + [Dm]Still my gui[C]tar gently [F]weeps [A] +{/bridge} diff --git a/gtx/wish_you_were_here.gtx b/gtx/wish_you_were_here.gtx new file mode 100644 index 0000000..457f696 --- /dev/null +++ b/gtx/wish_you_were_here.gtx @@ -0,0 +1,28 @@ +{title: Wish You Were Here} +{subtitle: Pink Floyd} + +{a: Intro: } +{guitartab: [14.5ex;G]&[1;3][2;0h][2;2][3;0][3;2]_[6;3]&[5;3]&[4;0]&[3;0]&[2;2]&[1;x]_|_[3;2][4;0][3;2][2;0]_[6;3]&[5;3]&[4;0]&[3;0]&[2;2]&[1;3]_|_[14.5ex;G]&[1;3][2;0h][2;2][3;0][3;2]_[6;3]&[5;3]&[4;0]&[3;0]&[2;2]&[1;x]_|_[3;2][4;0][3;2][2;0]_[6;3]&[5;3]&[4;0]&[3;0]&[2;2]&[1;3]} +{guitartab: [14.5ex;G]&[1;3][2;0h][2;2][3;0][3;2]_[6;3]&[5;3]&[4;0]&[3;0]&[2;2]&[1;x]_|_[3;2][3;0][2;2][14.5ex;Dsus4]&[2;0]_[6;3]&[5;3]&[4;2]&[3;2]&[2;0]&[1;0]_|_[14.5ex;G]&[1;3][2;0h][2;2][3;0][3;2]_[6;3]&[5;3]&[4;0]&[3;0]&[2;2]&[1;x]_|_[3;2][3;0][2;2][14.5ex;Dsus4]&[2;0]_[6;3]&[5;3]&[4;2]&[3;2]&[2;0]&[1;0]} + +{a: Vers: 1} +{bridge} +[C]So, so you think you can [D]tell Heaven from [Am]Hell, +Blue skys from [G]pain. Can you tell a green [D]field +From a cold steel [C]rail? A smile from a [Am]veil? +Do you think you can [G]tell? +{/bridge} +{bridge} +Did they get you to [C]trade? Your heros for [D]ghosts? +Hot ashes for [Am]trees? Hot air for a cool [G]breeze? +Cold comfort for [D]change? And did you [C]exchange +A walk on part in the [Am]war For a lead role in a [G]cage? +{/bridge} +{a: Vers: 2} +{bridge} +[C]How I wish, how I wish you were [D]here. +We're just [A]two lost souls Swimming in a fish bowl, +[G]Year after year, [D]Running over the same old ground. +[C]What have we found? The same old [Am]fears. +Wish you were [G]here. +{/bridge} \ No newline at end of file diff --git a/gtx/wonderwal.gtx b/gtx/wonderwal.gtx new file mode 100644 index 0000000..d1e840c --- /dev/null +++ b/gtx/wonderwal.gtx @@ -0,0 +1,55 @@ +{title: Wonderwall} +{subtitle: Oasis} + +{a:Vers 1:} +{bridge} +[Em7] Today is [G]gonna be the day that they're [Dsus4]gonna throw it back to [A7sus4]you +[Em7] By now you [G]should've somehow rea[Dsus4]lized what you gotta [A7sus4]do +[Em7] I don't believe that [G]anybody [Dsus4]feels the way I [A7sus4]do about you [Cadd9]now [G] [A7sus4] +{/bridge} + +{a:Vers 2:} +{bridge} +[Em7] Backbeat the [G]word was on the street that the [Dsus4]fire in your heart is [A7sus4]out. +[Em7] I'm sure you've [G]heard it all before but you [Dsus4]never really had a [A7sus4]doubt. +[Em7] I don't believe that [G]anybody [Dsus4]feels the way I [A7sus4]do about you [Cadd9]now [G] [A7sus4] +{/bridge} + +{a:Refrain:} +{chorus} + And [Cadd9]all the roads we [Dsus4]have to walk along are [Em7]winding + And [Cadd9]all the lights that [Dsus4]lead us there are [Em7]blinding + [Cadd9]There are many [Dsus4]things that I would [G]like to [Dsus4/F#]say to [Em7]you + But I [Dsus4]don't know [A7sus4]how. +{/chorus} + +{chorus} + Because [Cadd9]maybe [Em7] [G] + Yo[Em7]u're gonna be the one who [Cadd9]saves me? [Em7] [G] + And [Em7]after all [Cadd9] [Em7] [G] + You're my[Em7] wonderwall [Cadd9] [Em7] [G] [Em7] +{/chorus} + +{a:Vers 3:} +{bridge} +Today was gonna be the day? But they'll never throw it back to you +By now you should've somehow realized what you're not to do +I don't believe that anybody feels the way I do about you now +{/bridge} + +{a:Refrain: ...} + +{np} + +{a:Refrain:} +{chorus} + I said maybe + You're gonna be the one who saves me ? + And after an + You're my wonderwall + + Said maybe + You're gonna be the one that saves me + You're gonna be the one that saves me + You're gonna be the one that saves me +{/chorus} diff --git a/gtx/yesterday-c.gtx b/gtx/yesterday-c.gtx new file mode 100644 index 0000000..2168e6c --- /dev/null +++ b/gtx/yesterday-c.gtx @@ -0,0 +1,46 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Yesterday (C)} +{subtitle: The Beatles} + +{define: Dm6 t x 2 n 2 3 1} + +{a:Vers 1:} +{bridge} + [C]Yesterday [Dm6] all my [E7]troubles seemed so [Am]far away [/G] + [F]Now it [G7]looks as though they're [C]here to stay [/H]Oh [Am]I be[D]lieve in [F]Yester[C]day + [C]Suddenly [Dm6] I'm not [E7]half the man I [Am]used to be [/G] + [F]there's a [G7]shadow hanging [C]over me [/H]Oh [Am]Yester[D]day came [F]sudden[C]ly +{/bridge} + +{a:Refrain:} +{chorus} + [Dm6]Why [E7]she [Am]had [/G]to [F]go [/E]I don't [Dm]know, she [G7]wouldn't [C]say + [Dm6]I [E7]said [Am]some[/G]thing [F]wrong [/E]now I [Dm]long for [G7]Yester[C]day +{/chorus} + +{a:Vers 2:} +{bridge} + [C]Yesterday [Dm6] love was [E7]such an easy [Am]game to play [/G] + [F]Now I [G7]need a place to [C]hide away [/H]Oh [Am]I be[D]lieve in [F]Yester[C]day +{/bridge} + +{a:Refrain:} +{chorus} + [Dm6]Why [E7]she [Am]had [/G]to [F]go [/E]I don't [Dm]know, she [G7]wouldn't [C]say + [Dm6]I [E7]said [Am]some[/G]thing [F]wrong [/E]now I [Dm]long for [G7]Yester[C]day +{/chorus} + +{a:Vers 3:} +{bridge} + [C]Yesterday [Dm6] love was [E7]such an easy [Am]game to play [/G] + [F]Now I [G7]need a place to [C]hide away [/H]Oh [Am]I be[D]lieve in [F]Yester[C]day +{/bridge} + +{bridge} + [C]Mmm [D]Mmm [F]Mmm [C]Mmm +{/bridge} diff --git a/gtx/yesterday.gtx b/gtx/yesterday.gtx new file mode 100644 index 0000000..61c2994 --- /dev/null +++ b/gtx/yesterday.gtx @@ -0,0 +1,46 @@ +{geometry:a4paper} +{geometry:margin=2.5cm} +{font_size:12} + +{color_chorus:0,0,0} + +{title: Yesterday (F)} +{subtitle: The Beatles} + +{define:Em7 t n 2 2 n 3 3} + +{a:Vers 1:} +{bridge} + [F]Yesterday [Em7] all my [A7]troubles seemed so [Dm]far away [/C] + [B]Now it [C7]looks as though they're [F]here to stay [/E]Oh [Dm]I be[G]lieve in [B]Yester[F]day + [F]Suddenly [Em7] I'm not [A7]half the man I [Dm]used to be [/C] + [B]there's a [C7]shadow hanging [F]over me [/E]Oh [Dm]Yester[G]day came [B]sudden[F]ly +{/bridge} + +{a:Refrain:} +{chorus} + [Em7]Why [A7]she [Dm]had [/C]to [B]go [/A]I don't [Gm]know, she [C]wouldn't [F]say + [Em7]I [A7]said [Dm]some[/C]thing [B]wrong [/A]now I [Gm]long for [C]Yester[F]day +{/chorus} + +{a:Vers 2:} +{bridge} + [F]Yesterday [Em7] love was [A7]such an easy [Dm]game to play [/C] + [B]Now I [C7]need a place to [F]hide away [/E]Oh [Dm]I be[G]lieve in [B]Yester[F]day +{/bridge} + +{a:Refrain:} +{chorus} + [Em7]Why [A7]she [Dm]had [/C]to [B]go [/A]I don't [Gm]know, she [C]wouldn't [F]say + [Em7]I [A7]said [Dm]some[/C]thing [B]wrong [/A]now I [Gm]long for [C]Yester[F]day +{/chorus} + +{a:Vers 3:} +{bridge} + [F]Yesterday [Em7] love was [A7]such an easy [Dm]game to play [/C] + [B]Now I [C7]need a place to [F]hide away [/E]Oh [Dm]I be[G]lieve in [B]Yester[F]day +{/bridge} + +{bridge} + [F]Mmm [G]Mmm [B]Mmm [F]Mmm +{/bridge} diff --git a/lib/appbundler-1.0.jar b/lib/appbundler-1.0.jar new file mode 100644 index 0000000..ef30f1c Binary files /dev/null and b/lib/appbundler-1.0.jar differ diff --git a/manifest.mf b/manifest.mf new file mode 100644 index 0000000..328e8e5 --- /dev/null +++ b/manifest.mf @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +X-COMMENT: Main-Class will be added automatically by build + diff --git a/nbproject/build-impl.xml b/nbproject/build-impl.xml new file mode 100644 index 0000000..668b810 --- /dev/null +++ b/nbproject/build-impl.xml @@ -0,0 +1,1413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set src.dir + Must set test.src.dir + Must set build.dir + Must set dist.dir + Must set build.classes.dir + Must set dist.javadoc.dir + Must set build.test.classes.dir + Must set build.test.results.dir + Must set build.classes.excludes + Must set dist.jar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + No tests executed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must set JVM to use for profiling in profiler.info.jvm + Must set profiler agent JVM arguments in profiler.info.jvmargs.agent + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + To run this application from the command line without Ant, try: + + java -jar "${dist.jar.resolved}" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + Must select one file in the IDE or set run.class + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set debug.class + + + + + Must select one file in the IDE or set debug.class + + + + + Must set fix.includes + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + Must select one file in the IDE or set profile.class + This target only works when run from inside the NetBeans IDE. + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + This target only works when run from inside the NetBeans IDE. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select one file in the IDE or set run.class + + + + + + Must select some files in the IDE or set test.includes + + + + + Must select one file in the IDE or set run.class + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Must select some files in the IDE or set javac.includes + + + + + + + + + + + + + + + + + + + + Some tests failed; see details above. + + + + + + + + + Must select some files in the IDE or set test.includes + + + + Some tests failed; see details above. + + + + Must select some files in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + Some tests failed; see details above. + + + + + Must select one file in the IDE or set test.class + + + + Must select one file in the IDE or set test.class + Must select some method in the IDE or set test.method + + + + + + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + Must select one file in the IDE or set applet.url + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/nbproject/genfiles.properties b/nbproject/genfiles.properties new file mode 100644 index 0000000..9dba6c6 --- /dev/null +++ b/nbproject/genfiles.properties @@ -0,0 +1,8 @@ +build.xml.data.CRC32=f6aed9f0 +build.xml.script.CRC32=7bf792ba +build.xml.stylesheet.CRC32=8064a381@1.75.2.48 +# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml. +# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. +nbproject/build-impl.xml.data.CRC32=f6aed9f0 +nbproject/build-impl.xml.script.CRC32=8b4662fd +nbproject/build-impl.xml.stylesheet.CRC32=876e7a8f@1.75.2.48 diff --git a/nbproject/project.properties b/nbproject/project.properties new file mode 100644 index 0000000..d63922a --- /dev/null +++ b/nbproject/project.properties @@ -0,0 +1,92 @@ +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.processors.list= +annotation.processing.run.all.processors=true +annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output +application.desc=Make your songs nice and simple +application.homepage=guitartex2.sourceforge.com +application.title=GuitarTeX2 +application.vendor=Nikolai Rinas +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +# This directory is removed when the project is cleaned: +build.dir=build +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +# Uncomment to specify the preferred debugger connection transport: +#debug.transport=dt_socket +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +# Files in build.classes.dir which should be excluded from distribution jar +dist.archive.excludes= +# This directory is removed when the project is cleaned: +dist.dir=dist +dist.jar=${dist.dir}/GuitarTeX2.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +includes=** +jar.archive.disabled=${jnlp.enabled} +jar.compress=false +jar.index=${jnlp.enabled} +javac.classpath= +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.8 +javac.target=1.8 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +javac.test.processorpath=\ + ${javac.test.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding=${source.encoding} +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +javadoc.windowtitle= +jnlp.codebase.type=no.codebase +jnlp.descriptor=application +jnlp.enabled=false +jnlp.mixed.code=default +jnlp.offline-allowed=false +jnlp.signed=false +jnlp.signing= +jnlp.signing.alias= +jnlp.signing.keystore= +main.class=guitartex2.GuitarTeX2 +# Optional override of default Codebase manifest attribute, use to prevent RIAs from being repurposed +manifest.custom.codebase= +# Optional override of default Permissions manifest attribute (supported values: sandbox, all-permissions) +manifest.custom.permissions= +manifest.file=manifest.mf +meta.inf.dir=${src.dir}/META-INF +mkdist.disabled=false +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +# Space-separated list of JVM arguments used when running the project. +# You may also define separate properties like run-sys-prop.name=value instead of -Dname=value. +# To set system properties for unit tests define test-sys-prop.name=value: +run.jvmargs= +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +source.encoding=UTF-8 +src.dir=src +test.src.dir=test diff --git a/nbproject/project.xml b/nbproject/project.xml new file mode 100644 index 0000000..8aa7339 --- /dev/null +++ b/nbproject/project.xml @@ -0,0 +1,15 @@ + + + org.netbeans.modules.java.j2seproject + + + GuitarTeX2 + + + + + + + + + diff --git a/pdf-ref/all_my_loving.pdf b/pdf-ref/all_my_loving.pdf new file mode 100644 index 0000000..3a05ac0 Binary files /dev/null and b/pdf-ref/all_my_loving.pdf differ diff --git a/pdf-ref/always_look_on_the_bright_side_of_life.pdf b/pdf-ref/always_look_on_the_bright_side_of_life.pdf new file mode 100644 index 0000000..77cc7e7 Binary files /dev/null and b/pdf-ref/always_look_on_the_bright_side_of_life.pdf differ diff --git a/pdf-ref/bang_bang.pdf b/pdf-ref/bang_bang.pdf new file mode 100644 index 0000000..fc812b0 Binary files /dev/null and b/pdf-ref/bang_bang.pdf differ diff --git a/pdf-ref/behind_blue_eyes.pdf b/pdf-ref/behind_blue_eyes.pdf new file mode 100644 index 0000000..dd1e3b6 Binary files /dev/null and b/pdf-ref/behind_blue_eyes.pdf differ diff --git a/pdf-ref/boat_on_the_river.pdf b/pdf-ref/boat_on_the_river.pdf new file mode 100644 index 0000000..e8329f6 Binary files /dev/null and b/pdf-ref/boat_on_the_river.pdf differ diff --git a/pdf-ref/book_all.pdf b/pdf-ref/book_all.pdf new file mode 100644 index 0000000..4d056fe Binary files /dev/null and b/pdf-ref/book_all.pdf differ diff --git a/pdf-ref/california_dreamin.pdf b/pdf-ref/california_dreamin.pdf new file mode 100644 index 0000000..02dddc7 Binary files /dev/null and b/pdf-ref/california_dreamin.pdf differ diff --git a/pdf-ref/country_roads.pdf b/pdf-ref/country_roads.pdf new file mode 100644 index 0000000..a770b09 Binary files /dev/null and b/pdf-ref/country_roads.pdf differ diff --git a/pdf-ref/creep.pdf b/pdf-ref/creep.pdf new file mode 100644 index 0000000..37f7167 Binary files /dev/null and b/pdf-ref/creep.pdf differ diff --git a/pdf-ref/das_liebeslied.pdf b/pdf-ref/das_liebeslied.pdf new file mode 100644 index 0000000..1e57f12 Binary files /dev/null and b/pdf-ref/das_liebeslied.pdf differ diff --git a/pdf-ref/default.pdf b/pdf-ref/default.pdf new file mode 100644 index 0000000..c18248a Binary files /dev/null and b/pdf-ref/default.pdf differ diff --git a/pdf-ref/der_blender.pdf b/pdf-ref/der_blender.pdf new file mode 100644 index 0000000..404d06c Binary files /dev/null and b/pdf-ref/der_blender.pdf differ diff --git a/pdf-ref/der_moerder.pdf b/pdf-ref/der_moerder.pdf new file mode 100644 index 0000000..11f163e Binary files /dev/null and b/pdf-ref/der_moerder.pdf differ diff --git a/pdf-ref/die_katze.pdf b/pdf-ref/die_katze.pdf new file mode 100644 index 0000000..d373587 Binary files /dev/null and b/pdf-ref/die_katze.pdf differ diff --git a/pdf-ref/die_loesung.pdf b/pdf-ref/die_loesung.pdf new file mode 100644 index 0000000..ab2498a Binary files /dev/null and b/pdf-ref/die_loesung.pdf differ diff --git a/pdf-ref/dust_in_the_wind.pdf b/pdf-ref/dust_in_the_wind.pdf new file mode 100644 index 0000000..de24cb9 Binary files /dev/null and b/pdf-ref/dust_in_the_wind.pdf differ diff --git a/pdf-ref/electrolite.pdf b/pdf-ref/electrolite.pdf new file mode 100644 index 0000000..cd1bc8b Binary files /dev/null and b/pdf-ref/electrolite.pdf differ diff --git a/pdf-ref/everybody_hurts.pdf b/pdf-ref/everybody_hurts.pdf new file mode 100644 index 0000000..1ccfe39 Binary files /dev/null and b/pdf-ref/everybody_hurts.pdf differ diff --git a/pdf-ref/father_and_son.pdf b/pdf-ref/father_and_son.pdf new file mode 100644 index 0000000..7782e3b Binary files /dev/null and b/pdf-ref/father_and_son.pdf differ diff --git a/pdf-ref/girl.pdf b/pdf-ref/girl.pdf new file mode 100644 index 0000000..a2504c3 Binary files /dev/null and b/pdf-ref/girl.pdf differ diff --git a/pdf-ref/give_me_love.pdf b/pdf-ref/give_me_love.pdf new file mode 100644 index 0000000..66dac68 Binary files /dev/null and b/pdf-ref/give_me_love.pdf differ diff --git a/pdf-ref/griechischer_wein.pdf b/pdf-ref/griechischer_wein.pdf new file mode 100644 index 0000000..287ec77 Binary files /dev/null and b/pdf-ref/griechischer_wein.pdf differ diff --git a/pdf-ref/house_of_the_rising_sun.pdf b/pdf-ref/house_of_the_rising_sun.pdf new file mode 100644 index 0000000..4001056 Binary files /dev/null and b/pdf-ref/house_of_the_rising_sun.pdf differ diff --git a/pdf-ref/i_will_survive.pdf b/pdf-ref/i_will_survive.pdf new file mode 100644 index 0000000..390cff7 Binary files /dev/null and b/pdf-ref/i_will_survive.pdf differ diff --git a/pdf-ref/in_these_arms.pdf b/pdf-ref/in_these_arms.pdf new file mode 100644 index 0000000..f3900d6 Binary files /dev/null and b/pdf-ref/in_these_arms.pdf differ diff --git a/pdf-ref/knocking_on_heavens_door.pdf b/pdf-ref/knocking_on_heavens_door.pdf new file mode 100644 index 0000000..0cc8dc9 Binary files /dev/null and b/pdf-ref/knocking_on_heavens_door.pdf differ diff --git a/pdf-ref/lazy_blues.pdf b/pdf-ref/lazy_blues.pdf new file mode 100644 index 0000000..6aa438d Binary files /dev/null and b/pdf-ref/lazy_blues.pdf differ diff --git a/pdf-ref/losing_my_religion.pdf b/pdf-ref/losing_my_religion.pdf new file mode 100644 index 0000000..34a8c84 Binary files /dev/null and b/pdf-ref/losing_my_religion.pdf differ diff --git a/pdf-ref/love_is_all_around.pdf b/pdf-ref/love_is_all_around.pdf new file mode 100644 index 0000000..af36b19 Binary files /dev/null and b/pdf-ref/love_is_all_around.pdf differ diff --git a/pdf-ref/love_me_tender.pdf b/pdf-ref/love_me_tender.pdf new file mode 100644 index 0000000..b9649e2 Binary files /dev/null and b/pdf-ref/love_me_tender.pdf differ diff --git a/pdf-ref/mrs_robinson.pdf b/pdf-ref/mrs_robinson.pdf new file mode 100644 index 0000000..3eef203 Binary files /dev/null and b/pdf-ref/mrs_robinson.pdf differ diff --git a/pdf-ref/nichts_mehr_wie_es_war.pdf b/pdf-ref/nichts_mehr_wie_es_war.pdf new file mode 100644 index 0000000..291a032 Binary files /dev/null and b/pdf-ref/nichts_mehr_wie_es_war.pdf differ diff --git a/pdf-ref/nothing_else_matters.pdf b/pdf-ref/nothing_else_matters.pdf new file mode 100644 index 0000000..44922d2 Binary files /dev/null and b/pdf-ref/nothing_else_matters.pdf differ diff --git a/pdf-ref/ofen_aus_glas.pdf b/pdf-ref/ofen_aus_glas.pdf new file mode 100644 index 0000000..9688253 Binary files /dev/null and b/pdf-ref/ofen_aus_glas.pdf differ diff --git a/pdf-ref/one_of_us.pdf b/pdf-ref/one_of_us.pdf new file mode 100644 index 0000000..5d4c962 Binary files /dev/null and b/pdf-ref/one_of_us.pdf differ diff --git a/pdf-ref/phaenomenal_egal.pdf b/pdf-ref/phaenomenal_egal.pdf new file mode 100644 index 0000000..6bfe83d Binary files /dev/null and b/pdf-ref/phaenomenal_egal.pdf differ diff --git a/pdf-ref/rein_gar_nichts.pdf b/pdf-ref/rein_gar_nichts.pdf new file mode 100644 index 0000000..744e28c Binary files /dev/null and b/pdf-ref/rein_gar_nichts.pdf differ diff --git a/pdf-ref/show_must_go_on.pdf b/pdf-ref/show_must_go_on.pdf new file mode 100644 index 0000000..8db2d04 Binary files /dev/null and b/pdf-ref/show_must_go_on.pdf differ diff --git a/pdf-ref/sitting_waiting.pdf b/pdf-ref/sitting_waiting.pdf new file mode 100644 index 0000000..cf12fb5 Binary files /dev/null and b/pdf-ref/sitting_waiting.pdf differ diff --git a/pdf-ref/somewhere.pdf b/pdf-ref/somewhere.pdf new file mode 100644 index 0000000..0f24fa9 Binary files /dev/null and b/pdf-ref/somewhere.pdf differ diff --git a/pdf-ref/sorry_seems_to_be.pdf b/pdf-ref/sorry_seems_to_be.pdf new file mode 100644 index 0000000..0afae5f Binary files /dev/null and b/pdf-ref/sorry_seems_to_be.pdf differ diff --git a/pdf-ref/sperr_mich_ein.pdf b/pdf-ref/sperr_mich_ein.pdf new file mode 100644 index 0000000..9ad1189 Binary files /dev/null and b/pdf-ref/sperr_mich_ein.pdf differ diff --git a/pdf-ref/stand_by_me.pdf b/pdf-ref/stand_by_me.pdf new file mode 100644 index 0000000..45c5d8e Binary files /dev/null and b/pdf-ref/stand_by_me.pdf differ diff --git a/pdf-ref/sunny.pdf b/pdf-ref/sunny.pdf new file mode 100644 index 0000000..200a40c Binary files /dev/null and b/pdf-ref/sunny.pdf differ diff --git a/pdf-ref/tears_in_heaven.pdf b/pdf-ref/tears_in_heaven.pdf new file mode 100644 index 0000000..f75d166 Binary files /dev/null and b/pdf-ref/tears_in_heaven.pdf differ diff --git a/pdf-ref/the_man_who_sold_the_world.pdf b/pdf-ref/the_man_who_sold_the_world.pdf new file mode 100644 index 0000000..b3efd11 Binary files /dev/null and b/pdf-ref/the_man_who_sold_the_world.pdf differ diff --git a/pdf-ref/these_boots_are_make.pdf b/pdf-ref/these_boots_are_make.pdf new file mode 100644 index 0000000..376669b Binary files /dev/null and b/pdf-ref/these_boots_are_make.pdf differ diff --git a/pdf-ref/time.pdf b/pdf-ref/time.pdf new file mode 100644 index 0000000..176db37 Binary files /dev/null and b/pdf-ref/time.pdf differ diff --git a/pdf-ref/venus.pdf b/pdf-ref/venus.pdf new file mode 100644 index 0000000..b448a64 Binary files /dev/null and b/pdf-ref/venus.pdf differ diff --git a/pdf-ref/we_are_the_champions.pdf b/pdf-ref/we_are_the_champions.pdf new file mode 100644 index 0000000..c8b77d5 Binary files /dev/null and b/pdf-ref/we_are_the_champions.pdf differ diff --git a/pdf-ref/weil_du_nicht_da_bist.pdf b/pdf-ref/weil_du_nicht_da_bist.pdf new file mode 100644 index 0000000..1ac5f8c Binary files /dev/null and b/pdf-ref/weil_du_nicht_da_bist.pdf differ diff --git a/pdf-ref/what_a_wonderfull_world.pdf b/pdf-ref/what_a_wonderfull_world.pdf new file mode 100644 index 0000000..8f33a56 Binary files /dev/null and b/pdf-ref/what_a_wonderfull_world.pdf differ diff --git a/pdf-ref/where_did_you_sleep.pdf b/pdf-ref/where_did_you_sleep.pdf new file mode 100644 index 0000000..88a445f Binary files /dev/null and b/pdf-ref/where_did_you_sleep.pdf differ diff --git a/pdf-ref/while_my_guitar-am.pdf b/pdf-ref/while_my_guitar-am.pdf new file mode 100644 index 0000000..26d22bb Binary files /dev/null and b/pdf-ref/while_my_guitar-am.pdf differ diff --git a/pdf-ref/while_my_guitar-dm.pdf b/pdf-ref/while_my_guitar-dm.pdf new file mode 100644 index 0000000..f17a523 Binary files /dev/null and b/pdf-ref/while_my_guitar-dm.pdf differ diff --git a/pdf-ref/wish_you_were_here.pdf b/pdf-ref/wish_you_were_here.pdf new file mode 100644 index 0000000..58a68cb Binary files /dev/null and b/pdf-ref/wish_you_were_here.pdf differ diff --git a/pdf-ref/wonderwal.pdf b/pdf-ref/wonderwal.pdf new file mode 100644 index 0000000..5bf728e Binary files /dev/null and b/pdf-ref/wonderwal.pdf differ diff --git a/pdf-ref/yesterday-c.pdf b/pdf-ref/yesterday-c.pdf new file mode 100644 index 0000000..67b561e Binary files /dev/null and b/pdf-ref/yesterday-c.pdf differ diff --git a/pdf-ref/yesterday.pdf b/pdf-ref/yesterday.pdf new file mode 100644 index 0000000..cbaa76a Binary files /dev/null and b/pdf-ref/yesterday.pdf differ diff --git a/src/GuitarTeX2strings.properties b/src/GuitarTeX2strings.properties new file mode 100644 index 0000000..6430c27 --- /dev/null +++ b/src/GuitarTeX2strings.properties @@ -0,0 +1,129 @@ +fileMenu=File +newItem=New +openItem=Open... +closeItem=Close +saveItem=Save +saveAsItem=Save As... +templateItem=Templates +simpleSong=Song +simpleBook=Book +exitItem=Quit + +editMenu=Edit +mPrefs=Preferences +undoItem=Undo +cutItem=Cut +copyItem=Copy +pasteItem=Paste +clearItem=Clear +selectAllItem=Select All + +buildMenu=Build +gtx2tex=GTX2TeX +latex=Latex +dvi2ps=Dvi2Ps +dvi2pdf=Dvi2Pdf +tex2pdf=TeX2Pdf + + +helpMenu=Help +aboutItem=About +aboutTitle=About +faqItem=FAQ +faqURL=http://guitartex2.sourceforge.net/page7/page6/page6.html +shortcutItem=Shortcuts +shortcutsURL=http://guitartex2.sourceforge.net/page7/page30/page30.html +consoleItem=Console + +consoleTitle=Console +consoleInitText=Debugging and testing console +consoleSendButton=send + +actionToolBar=Actions +chordsToolBar=Chords +tabsToolBar=Tabs +structToolBar=Structure +melodyToolBar=Melody Creator +mShowTeXArea=TeX-Preview +harpToolBar=Channels + +mHarpTone1=1 +mHarpTone2=2 +mHarpTone3=3 +mHarpTone4=4 +mHarpTone5=5 +mHarpTone6=6 +mHarpTone7=7 +mHarpTone8=8 +mHarpTone9=9 +mHarpTone10=10 + +mToneA=A +mTonea=a +mToneAs=Bb +mToneH=B +mToneC=C +mToneCis=C# +mToneD=D +mToneDis=D# +mToneE=E +mTonee=e +mToneF=F +mToneFis=F# +mToneG=G +mToneGis=G# + +mLanguage=Language +mTitle=Title +mSubtitle=Subtitle +mBridge=Bridge +mChorus=Chorus +mBold=Comment +mGuitarTab=Tabs + +mNewFile=New File + +checkConn=Checking connection to the server ... +createPdf=Creating PDF ... +showPdf=Try to display PDF File ... + +sendTexFile=Sending TeX-File ... +wait4PdfFile=Waiting for results ... +receivePdfFile=Receiving PDF-File ... +receiveLogFile=Receiving Log-File ... +confFailed=Load configuration failed! +texFailed=Failed to create PDF file!\nPlease check your document! + +mSaveQuestionHead=File has been changed! +mSaveQuestion=Would you like to save your file? + +prefTitle=Preferences +mPrefLatex=Latex +mPrefXDvi=XDvi +mPrefPdfLatex=PdfLatex +mPrefPdfViewer=PdfViewer +mPrefTmpPath=TmpDir +mPrefGtxServer=Server +mPrefGtxServerPort=Port + +mBookToolBar=Book Toolbar +mSetBook=Book +mBookAuthor=Author +mBookTitle=Title +mBookDate=Date +mBookInclude=Include + +resetButton=Reset +okButton=OK +cancelButton=Cancel +quitButton=Quit +infoButton=Info + +choose=Choose + +warnTitle=Warning! +statusTitle=Status + +frameConstructor=GuitarTeX2 +appVersion=Version - 3.4.0 +copyright=Nikolai Rinas diff --git a/src/GuitarTeX2strings_de.properties b/src/GuitarTeX2strings_de.properties new file mode 100644 index 0000000..46a2a10 --- /dev/null +++ b/src/GuitarTeX2strings_de.properties @@ -0,0 +1,128 @@ +fileMenu=Datei +newItem=Neu +openItem=\u00d6ffnen... +closeItem=Schlie\u00dfen +saveItem=Speichern +saveAsItem=Speichern unter... +templateItem=Templates +simpleSong=Lied +simpleBook=Liederbuch +exitItem=Beenden + +editMenu=Bearbeiten +mPrefs=Einstellungen +undoItem= +cutItem=Ausschneiden +copyItem=Kopieren +pasteItem=Einf\u00fcgen +clearItem=L\u00f6schen +selectAllItem=Alles ausw\u00e4hlen + +buildMenu=Erstellen +gtx2tex=GTX2TeX +latex=Latex +dvi2ps=Dvi2Ps +dvi2pdf=Dvi2Pdf +tex2pdf=TeX2Pdf + +helpMenu=Hilfe +aboutItem=\u00dcber GuitarTeX2 +aboutTitle=\u00dcber GuitarTeX2 +faqItem=FAQ +faqURL=http://guitartex2.sourceforge.net/page7/page6/page6.html +shortcutItem=Shortcuts +shortcutsURL=http://guitartex2.sourceforge.net/page7/page30/page30.html +consoleItem=Konsole + +consoleTitle=Konsole +consoleInitText=Konsole zum Testen und Debuggen +consoleSendButton=Senden + +actionToolBar=Aktionen +chordsToolBar=Akkorde +tabsToolBar=Tabulatur +structToolBar=Struktur +melodyToolBar=Melodie Creator +mShowTeXArea=TeX-Vorschau +harpToolBar=Kanzellen + +mHarpTone1=1 +mHarpTone2=2 +mHarpTone3=3 +mHarpTone4=4 +mHarpTone5=5 +mHarpTone6=6 +mHarpTone7=7 +mHarpTone8=8 +mHarpTone9=9 +mHarpTone10=10 + +mToneA=A +mTonea=a +mToneAs=B +mToneH=H +mToneC=C +mToneCis=C# +mToneD=D +mToneDis=D# +mToneE=E +mTonee=e +mToneF=F +mToneFis=F# +mToneG=G +mToneGis=G# + +mLanguage=Sprache +mTitle=Titel +mSubtitle=Komponist +mBridge=Vers +mChorus=Refrain +mBold=Kommentar +mGuitarTab=Tabulatur + +mNewFile=Neue Datei + +checkConn=\u00dcberpr\u00fcfe Verbindung zum Server ... +createPdf=Erstelle PDF ... +showPdf=Versuche die PDF Datei darzustellen ... + +sendTexFile=Versende TeX-Datei ... +wait4PdfFile=Warte auf das Ergebnis ... +receivePdfFile=Empfange PDF-Datei ... +receiveLogFile=Empfange Log-Datei ... +confFailed=Laden von Konfigurationsdatei fehlgeschlagen! +texFailed=PDF Datei kann nicht erzeugt werden!\nBitte \u00fcberpr\u00fcfen Sie Ihr Dokument! + +mSaveQuestionHead=Datei wurde ver\u00e4ndert! +mSaveQuestion=Wollen Sie die Datei speichern? + +prefTitle=Einstellungen +mPrefLatex=Latex +mPrefXDvi=XDvi +mPrefPdfLatex=PdfLatex +mPrefPdfViewer=PdfBetrachter +mPrefTmpPath=TmpVerzeichnis +mPrefGtxServer=Server +mPrefGtxServerPort=Port + +mBookToolBar=Buch Toolbar +mSetBook=Buch +mBookAuthor=Autor +mBookTitle=Titel +mBookDate=Datum +mBookInclude=Einf\u00fcgen + +resetButton=Zur\u00fccksetzen +okButton=OK +cancelButton=Abbrechen +quitButton=Beenden +infoButton=Info + +choose=Ausw\u00e4hlen + +warnTitle=Warnung! +statusTitle=Status + +frameConstructor=GuitarTeX2 +appVersion=Version - 3.4.0 +copyright=Nikolai Rinas \ No newline at end of file diff --git a/src/guitartex2/AboutBox.java b/src/guitartex2/AboutBox.java new file mode 100644 index 0000000..a13ac63 --- /dev/null +++ b/src/guitartex2/AboutBox.java @@ -0,0 +1,112 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package guitartex2; + +import java.awt.Dimension; +import java.awt.Font; +import java.awt.BorderLayout; +import java.awt.Panel; +import java.awt.GridLayout; +import java.awt.Toolkit; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +import java.util.Locale; +import java.util.ResourceBundle; + + +import javax.swing.JLabel; +import javax.swing.JFrame; +import javax.swing.ImageIcon; + +public class AboutBox extends JFrame implements ActionListener { + private static final long serialVersionUID = 9143994418412032959L; + + private final JLabel aboutLabel[]; + private static final int labelCount = 6; + private static final int aboutWidth = 280; + private static final int aboutHeight = 230; + private static int aboutTop = 200; + private static int aboutLeft = 350; + private Font titleFont, bodyFont; + private final ResourceBundle resbundle; + + public AboutBox() { + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + aboutTop = new Double((screenSize.getHeight()/2) - (aboutHeight/2)).intValue(); + aboutLeft = new Double((screenSize.getWidth()/2) - (aboutWidth/2)).intValue(); + + this.setResizable(false); + resbundle = ResourceBundle.getBundle ("GuitarTeX2strings", Locale.getDefault()); + SymWindow aSymWindow = new SymWindow(); + this.addWindowListener(aSymWindow); + + // Initialize useful fonts + titleFont = new Font("Lucida Grande", Font.BOLD, 14); + if (titleFont == null) { + titleFont = new Font("SansSerif", Font.BOLD, 14); + } + bodyFont = new Font("Lucida Grande", Font.PLAIN, 10); + if (bodyFont == null) { + bodyFont = new Font("SansSerif", Font.PLAIN, 10); + } + + this.getContentPane().setLayout(new BorderLayout(30, 30)); + java.net.URL imgURL = AboutBox.class.getResource("images/gitarre1.jpg"); + ImageIcon icon = new ImageIcon(imgURL, ""); + + aboutLabel = new JLabel[labelCount]; + aboutLabel[0] = new JLabel(resbundle.getString("frameConstructor")); + aboutLabel[0].setFont(titleFont); + aboutLabel[1] = new JLabel(resbundle.getString("appVersion")); + aboutLabel[1].setFont(bodyFont); + aboutLabel[2] = new JLabel(""); + aboutLabel[3] = new JLabel("JDK " + System.getProperty("java.version")); + aboutLabel[3].setFont(bodyFont); + aboutLabel[4] = new JLabel(resbundle.getString("copyright")); + aboutLabel[4].setFont(bodyFont); + aboutLabel[5] = new JLabel(""); + + Panel imagePanel = new Panel(new GridLayout(0,1)); + imagePanel.add(new JLabel(icon)); + Panel textPanel2 = new Panel(new GridLayout(labelCount, 1)); + for (int i = 0; i fileMgr = Class.forName("com.apple.eio.FileManager"); + Method openURL = fileMgr.getDeclaredMethod("openURL", + new Class[] {String.class}); + openURL.invoke(null, new Object[] {url}); + } + else if (osName.startsWith("Windows")) + Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler " + url); + else { //assume Unix or Linux + boolean found = false; + for (String browser : browsers) + if (!found) { + found = Runtime.getRuntime().exec( + new String[] {"which", browser}).waitFor() == 0; + if (found) + Runtime.getRuntime().exec(new String[] {browser, url}); + } + if (!found) + throw new Exception(Arrays.toString(browsers)); + } + } + catch (Exception e) { + JOptionPane.showMessageDialog(null, + "Error attempting to launch web browser\n" + e.toString()); + } + } + + } \ No newline at end of file diff --git a/src/guitartex2/COPYRIGHT b/src/guitartex2/COPYRIGHT new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/src/guitartex2/COPYRIGHT @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 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 Lesser General +Public License instead of this License. diff --git a/src/guitartex2/CmdExec.java b/src/guitartex2/CmdExec.java new file mode 100644 index 0000000..d45310d --- /dev/null +++ b/src/guitartex2/CmdExec.java @@ -0,0 +1,44 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package guitartex2; + +import java.io.BufferedReader; +import java.io.InputStreamReader; + + +public class CmdExec{ + public CmdExec () { + + } + + public String execute (String cmdline) { + String ausgabe = ""; + try { + String line; + Process p = Runtime.getRuntime().exec(cmdline); + try (BufferedReader input = new BufferedReader + (new InputStreamReader(p.getInputStream()))) { + while ((line = input.readLine()) != null) { + ausgabe = ausgabe + line; + } + } + }catch (Exception err) { + InfoBox infoBox = new InfoBox("ERR: " + err); + } + return ausgabe; + } +} \ No newline at end of file diff --git a/src/guitartex2/Configurations.java b/src/guitartex2/Configurations.java new file mode 100644 index 0000000..7ab6056 --- /dev/null +++ b/src/guitartex2/Configurations.java @@ -0,0 +1,509 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package guitartex2; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.net.URL; +import java.util.Enumeration; +import java.util.Properties; + +final class Configurations { + + private String myName = "GuitarTeX2"; + private String propertiesFileName = myName + ".properties"; + + // get systeminfo + private String osName = System.getProperty( "os.name" ); + private String fileSeparator = System.getProperty("file.separator"); + private String userPath = System.getProperty("user.home"); + private String runPath = System.getProperty("user.dir"); + + private String pdfViewer = ""; + private String tmpDir = ""; + private String tmpDirPrefix = "gtxtmp" + fileSeparator; + private Properties mProperties; + private String propertiesFile; + + private String confProblems = ""; + + private GTXConsole mConsole; + + // Constructor + public Configurations(GTXConsole consoleBox) { + mProperties = new Properties(); + mConsole = consoleBox; + + if ( osName.matches("Windows.*")) { + mConsole.addText(osName); + propertiesFile = windowsConfiguration(); + } + if ( osName.matches("Linux.*")) { + mConsole.addText("osName"); + propertiesFile = linuxConfiguration(); + } + if ( osName.matches("Mac OS.*")) { + mConsole.addText(osName); + propertiesFile = macosConfiguration(); + } + if ( osName.equals("")) { + mConsole.addText("Unknown OS:" + osName); + propertiesFile = defaultConfiguration(); + } + try { + FileInputStream propsFIS; + if ( propertiesFile.equals("")) { + mConsole.addText("taking default config"); + propsFIS = new FileInputStream(propertiesFile); + mConsole.addText("loading..."); + mProperties.load( propsFIS ); + propsFIS.close(); + }else{ + mConsole.addText("taking prefered config: " + propertiesFile); + propsFIS = new FileInputStream(propertiesFile); + mConsole.addText("checking new entries ..."); + // Defaultwerte laden + //File tmpFile = new File(GuitarTeX2.class.getResourceAsStream(propertiesFileName).); + //System.out.println(tmpFile.getAbsoluteFile()); + //FileInputStream defaultPropFIS = new FileInputStream(tmpFile); + + Properties defProps = new Properties(); + //defProps.load(defaultPropFIS); + defProps.load(GuitarTeX2.class.getResourceAsStream(propertiesFileName)); + //defaultPropFIS.close(); + Enumeration defElements = defProps.keys(); + mProperties.load( propsFIS ); + propsFIS.close(); + // Auf neue Eintrage pruefen + boolean mustSafe = false; + while (defElements.hasMoreElements()) { + String key = (String)defElements.nextElement(); + if ( mProperties.getProperty(key) == null ) { + mProperties.setProperty(key, defProps.getProperty(key)); + mustSafe = true; + } + } + if ( mustSafe == true) { + saveSettings(); + } + } + }catch (Exception e) { + mConsole.addText("failed to load config file: " + e); + confProblems = confProblems + "Failed to load config file: " + e; + } + } + + private String windowsConfiguration() { + String userFileFullPath = userPath + fileSeparator + myName + fileSeparator + propertiesFileName; + String userFileDirectory = userPath + fileSeparator + myName; + boolean userConfigFileResult = checkFile(userFileFullPath); + if ( userConfigFileResult == false ) { + boolean systemConfigFileResult = checkFile(runPath + fileSeparator + myName + fileSeparator + propertiesFileName); + if ( systemConfigFileResult == false ) { + mConsole.addText("creating user config file..."); + try { + if ( ! new File(userFileDirectory).exists() ) { + new File(userFileDirectory).mkdir(); + } + copyFile(GuitarTeX2.class.getResource(propertiesFileName), new File(userFileFullPath)); + return userFileFullPath; + }catch (Exception e) { + mConsole.addText("creating user config file failed: " + e); + return ""; + } + }else{ + return runPath + fileSeparator + myName + fileSeparator + propertiesFileName; + } + }else{ + return userFileFullPath; + } + } + + private String linuxConfiguration() { + String userFileFullPath = userPath + fileSeparator + "." + myName + fileSeparator + propertiesFileName; + String userFileDirectory = userPath + fileSeparator + "." + myName; + boolean userConfigFileResult = checkFile(userFileFullPath); + if ( userConfigFileResult == false ) { + boolean systemConfigFileResult = checkFile("/etc/GuitarTeX2" + fileSeparator + propertiesFileName); + if ( systemConfigFileResult == false ) { + mConsole.addText("creating user config file..."); + try { + if ( ! new File(userFileDirectory).exists() ) { + new File(userFileDirectory).mkdir(); + } + copyFile(GuitarTeX2.class.getResource(propertiesFileName), new File(userFileFullPath)); + return userFileFullPath; + }catch (Exception e) { + mConsole.addText("creating user config file failed: " + e); + return ""; + } + }else{ + return runPath + fileSeparator + myName + fileSeparator + propertiesFileName; + } + }else{ + return userFileFullPath; + } + } + + private String macosConfiguration() { + String userFileFullPath = userPath + fileSeparator + "." + myName + fileSeparator + propertiesFileName; + String userFileDirectory = userPath + fileSeparator + "." + myName; + boolean userConfigFileResult = checkFile(userFileFullPath); + if ( userConfigFileResult == false ) { + boolean systemConfigFileResult = checkFile("/etc/GuitarTeX2" + fileSeparator + propertiesFileName); + if ( systemConfigFileResult == false ) { + mConsole.addText("creating user config file..."); + try { + if ( ! new File(userFileDirectory).exists() ) { + new File(userFileDirectory).mkdir(); + } + copyFile(GuitarTeX2.class.getResource(propertiesFileName), new File(userFileFullPath)); + return userFileFullPath; + }catch (Exception e) { + mConsole.addText("creating user config file failed: " + e); + return ""; + } + }else{ + return runPath + fileSeparator + myName + fileSeparator + propertiesFileName; + } + }else{ + return userFileFullPath; + } + } + + private String defaultConfiguration() { + String userFileFullPath = userPath + fileSeparator + myName + fileSeparator + propertiesFileName; + String userFileDirectory = userPath + fileSeparator + myName; + boolean userConfigFileResult = checkFile(userFileFullPath); + if ( userConfigFileResult == false ) { + mConsole.addText("creating user config file..."); + try { + if ( ! new File(userFileDirectory).exists() ) { + new File(userFileDirectory).mkdir(); + } + copyFile(GuitarTeX2.class.getResource(propertiesFileName), new File(userFileFullPath)); + return userFileFullPath; + }catch (Exception e) { + mConsole.addText("creating user config file failed: " + e); + return ""; + } + }else{ + return userFileFullPath; + } + } + + + private void copyFile(URL inURL, File out) throws Exception { + mConsole.addText("CopyFile: " + inURL); + try (InputStream inStream = inURL.openStream(); FileOutputStream fos = new FileOutputStream(out)) { + + byte[] buf = new byte[1024]; + int i; + while((i=inStream.read(buf))!=-1) { + fos.write(buf, 0, i); + } + + } + } + + private boolean checkFile(String fileName) { + try { + File myFileName = new File(fileName); + return myFileName.canRead() == true; + }catch (Exception e) { + return false; + } + } + + private boolean checkDirectory(String directory) { + try { + File dirName = new File(directory); + if ( dirName.isDirectory() ) { + File testFile = new File(directory+"testFileName.tst"); + if ( testFile.createNewFile() ) { + testFile.delete(); + return true; + }else{ + mConsole.addText("tmpDirectory is not writable"); + confProblems = confProblems + "temp directory is not writable!\n"; + return false; + } + }else{ + mConsole.addText("tmpDirectory doesn't exist"); + confProblems = confProblems + "temp directory doesn't exist\n"; + return false; + } + }catch (Exception e) { + return false; + } + } + + private boolean checkWindowsSettings() { + boolean checkResult; + String path = userPath + fileSeparator + myName + fileSeparator + "tmp" + fileSeparator; + String tmpPath = userPath + fileSeparator + myName + fileSeparator + "tmp" + + fileSeparator + tmpDirPrefix + fileSeparator; + if ( mProperties.getProperty("windowsTmpPath").equals("") ) { + // Create default tmp-Dir + File defTmpDir = new File(tmpPath); + if ( defTmpDir.isDirectory() == false ) { + defTmpDir.mkdirs(); + } + mProperties.setProperty("windowsTmpPath", path); + } + checkResult = checkDirectory(mProperties.getProperty("windowsTmpPath")); + checkResult = checkResult & checkFile(mProperties.getProperty("windowsPdfViewer")); + if ( checkResult == false ) { + mConsole.addText("windowsPdfViewer not found"); + confProblems = confProblems + "windowsPdfViewer not found\n"; + } + pdfViewer = mProperties.getProperty("windowsPdfViewer"); + tmpDir = mProperties.getProperty("windowsTmpPath"); + return checkResult; + } + + private boolean checkLinuxSettings() { + boolean checkResult; + String path = userPath + fileSeparator + "." + myName + fileSeparator + "tmp" + fileSeparator; + String tmpPath = userPath + fileSeparator + "." + myName + fileSeparator + "tmp" + + fileSeparator + tmpDirPrefix + fileSeparator; + if ( mProperties.getProperty("tmpPath").equals("") ) { + // Create default tmp-Dir + File defTmpDir = new File(tmpPath); + if ( defTmpDir.isDirectory() == false ) { + defTmpDir.mkdirs(); + } + mProperties.setProperty("tmpPath", path); + } + checkResult = checkDirectory(mProperties.getProperty("tmpPath")); + checkResult = checkResult & checkFile(mProperties.getProperty("linuxPdfViewer")); + if ( checkResult == false ) { + mConsole.addText("linuxPdfViewer not found"); + confProblems = confProblems + "linuxPdfViewer not found!\n"; + } + pdfViewer = mProperties.getProperty("linuxPdfViewer"); + tmpDir = mProperties.getProperty("tmpPath"); + return checkResult; + } + + private boolean checkMacOSSettings() { + boolean checkResult; + String path = userPath + fileSeparator + "." + myName + fileSeparator + "tmp" + fileSeparator; + String tmpPath = userPath + fileSeparator + "." + myName + fileSeparator + "tmp" + fileSeparator + + tmpDirPrefix + fileSeparator; + if ( mProperties.getProperty("tmpPath").equals("") ) { + // Create default tmp-Dir + File defTmpDir = new File(tmpPath); + if ( defTmpDir.isDirectory() == false ) { + defTmpDir.mkdirs(); + } + mProperties.setProperty("tmpPath", path); + } + checkResult = checkDirectory(mProperties.getProperty("tmpPath")); + pdfViewer = "open"; + tmpDir = mProperties.getProperty("tmpPath"); + return checkResult; + } + + private boolean checkOsIndependent() { + boolean checkResult = true; + + return checkResult; + } + + private void setOsUnknown() { + pdfViewer = "open"; + tmpDir = userPath + fileSeparator; + } + + public Properties getProperties () { + return mProperties; + } + + public String getTmpDir() { + return tmpDir; + } + + public void setTmpDir(String mValue) { + if ( osName.equals("Windows XP")) { + mProperties.setProperty("windowsTmpPath", mValue); + } + if ( osName.equals("Linux")) { + mProperties.setProperty("tmpPath", mValue); + } + if ( osName.equals("Mac OS X")) { + mProperties.setProperty("tmpPath", mValue); + } + tmpDir = mValue; + } + + public boolean checkConfig() { + boolean testResult = true; + boolean knownSystem = false; + if ( osName.matches("Windows.*")) { + testResult = checkWindowsSettings(); + knownSystem = true; + } + if ( osName.matches("Linux.*")) { + testResult = checkLinuxSettings(); + knownSystem = true; + } + if ( osName.matches("Mac OS.*")) { + testResult = checkMacOSSettings(); + knownSystem = true; + } + + if ( knownSystem == false ) { + setOsUnknown(); + } + + testResult = testResult & checkOsIndependent(); + + return testResult; + } + + public void saveSettings() { + try { + FileOutputStream propsFOS; + mConsole.addText("taking prefered config: " + propertiesFile); + propsFOS = new FileOutputStream(propertiesFile); + mConsole.addText("saving config file ..."); + mProperties.store( propsFOS, " "); + propsFOS.close(); + }catch (Exception e) { + mConsole.addText("failed to save config file: " + e); + confProblems = confProblems + "failed to save config file: " + e; + } + } + + public String getGtxServer() { + return mProperties.getProperty("gtxServer"); + } + public void setGtxServer(String mValue) { + mProperties.setProperty("gtxServer", mValue); + } + + public int getGtxServerPort() { + return Integer.parseInt(mProperties.getProperty("gtxServerPort")); + } + + public void setGtxServerPort(String mValue) { + mProperties.setProperty("gtxServerPort", mValue); + } + + public String getPdfViewer() { + return pdfViewer; + } + public void setPdfViewer(String mValue) { + if ( osName.matches("Windows.*")) { + mProperties.setProperty("windowsPdfViewer", mValue); + pdfViewer = mValue; + } + if ( osName.matches("Linux.*")) { + mProperties.setProperty("linuxPdfViewer", mValue); + pdfViewer = mValue; + } + } + + public String getConfFile() { + return propertiesFile; + } + + public String getLatex() { + return mProperties.getProperty("latex"); + } + public void setLatex(String mValue) { + mProperties.setProperty("latex", mValue); + } + + public String getXDvi() { + return mProperties.getProperty("xdvi"); + } + public void setXDvi(String mValue) { + mProperties.setProperty("xdvi", mValue); + } + + public String getPdfLatex() { + return mProperties.getProperty("pdflatex"); + } + + public void setPdfLatex(String mValue) { + mProperties.setProperty("pdflatex", mValue); + } + + public String getConfProblems() { + return confProblems; + } + + public String getTmpDirPrefix() { + return tmpDirPrefix; + } + + public void setTmpDirPrefix(String mValue) { + tmpDirPrefix = mValue; + } + + public String quoteString (String input) { + if ( osName.matches("Windows.*")) { + return "\"" + input + "\""; + }else{ + return input; + } + + } + + public String getFileSeparator() { + return fileSeparator; + } + + public String getRunPath() { + return runPath; + } + + public String getSongTemplate() { + return runPath + fileSeparator + "examples" + fileSeparator + mProperties.getProperty("exSongFile"); + } + + public String getBookTemplate() { + return runPath + fileSeparator + "examples" + fileSeparator + mProperties.getProperty("exBookFile"); + } + + public void loadDefaults() { + + try { + Properties defProps; + try (FileInputStream defaultPropFIS = new FileInputStream(propertiesFileName)) { + defProps = new Properties(); + defProps.load(defaultPropFIS); + } + mProperties.setProperty("gtxServer", defProps.getProperty("gtxServer")); + mProperties.setProperty("gtxServerPort", defProps.getProperty("gtxServerPort")); + } catch (Exception e) { + InfoBox infoBox = new InfoBox(e + ""); + } + /* + mPdfViewerField.setText(myConfiguration.getPdfViewer()); + mTmpPathField.setText(myConfiguration.getTmpDir()); + */ + } + + public GTXConsole getConsole() { + return mConsole; + } +} \ No newline at end of file diff --git a/src/guitartex2/FileTransfer.java b/src/guitartex2/FileTransfer.java new file mode 100644 index 0000000..7172325 --- /dev/null +++ b/src/guitartex2/FileTransfer.java @@ -0,0 +1,294 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +package guitartex2; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.zip.GZIPInputStream; +import java.util.zip.GZIPOutputStream; + +class FileTransfer { + + // Debug 0/1 + int debug = 0; + + // Define commands + //private static String quit = "CMD:123_QUIT_123"; + //private static String transfer = "CMD:123_TRANSFER_123"; + private static String ok = "CMD:123_OK_123"; + private static String failed = "CMD:123_FAILED_123"; + + // Father ID + int fId; + + // Streams + DataInputStream inStream; + DataOutputStream outStream; + + // Main - Constructor + public FileTransfer(int id, DataInputStream inputStream, DataOutputStream outputStream) { + fId = id; + inStream = inputStream; + outStream = outputStream; + } + + public FileTransfer(int id, int mDebug, DataInputStream inputStream, DataOutputStream outputStream) { + debug = mDebug; + fId = id; + inStream = inputStream; + outStream = outputStream; + } + + @SuppressWarnings("UnusedAssignment") + public int sendFile(String myFile) { + RandomAccessFile in; + + long length; + String fileLengthResult; + + int zipResult = gzipFile(myFile, false); + if (zipResult == 0) { + myFile = myFile + ".gz"; + } else { + sendMsg("Filetransfer[" + fId + "]: can't gzip file"); + try { + outStream.writeInt(0); + fileLengthResult = inStream.readUTF(); + } catch (Exception e) { + sendMsg("Filetransfer[" + fId + "]: stream error" + e); + cleanTmp(myFile); + return 1; + } + cleanTmp(myFile); + return 1; + } + + try { + in = new RandomAccessFile(myFile, "r"); + length = in.length(); + } catch (Exception g) { + sendMsg("Filetransfer[" + fId + "]: can't read file" + g); + try { + outStream.writeInt(0); + fileLengthResult = inStream.readUTF(); + } catch (Exception h) { + sendMsg("Filetransfer[" + fId + "]: stream error" + h); + cleanTmp(myFile); + return 1; + } + cleanTmp(myFile); + return 1; + } + if (length > Integer.MAX_VALUE) { + // File is too large + sendMsg("Filetransfer[" + fId + "]: File is too large"); + cleanTmp(myFile); + return 1; + } else { + int myFileLength = (int) length; + sendMsg("Filetransfer[" + fId + "]: sending fille length: " + myFileLength); + try { + outStream.writeInt(myFileLength); + fileLengthResult = inStream.readUTF(); + } catch (Exception i) { + sendMsg("Filetransfer[" + fId + "]: stream error" + i); + cleanTmp(myFile); + return 1; + } + if (fileLengthResult.equals(ok)) { + try { + sendMsg("Filetransfer[" + fId + "]: send a file..."); + byte b; + for (int i = 0; i < myFileLength; i++) { + b = in.readByte(); + outStream.writeByte(b); + } + in.close(); + File f = new File(myFile); + f.delete(); + String fileTransferResult = inStream.readUTF(); + if (fileTransferResult.equals(failed)) { + sendMsg("Filetransfer[" + fId + "]: sending file failed: " + fileTransferResult); + cleanTmp(myFile); + return 1; + } + } catch (Exception j) { + sendMsg("Filetransfer[" + fId + "]: stream error" + j); + cleanTmp(myFile); + return 1; + } + } else { + sendMsg("Filetransfer[" + fId + "]: sending file length failed: " + fileLengthResult); + cleanTmp(myFile); + return 1; + } + } + return 0; + } + + public int receiveFile(String myFile) { + int fileLength; + RandomAccessFile out; + + sendMsg("Filetransfer[" + fId + "]: awaiting filelength ..."); + try { + fileLength = inStream.readInt(); + } catch (IOException e) { + sendMsg("Filetransfer[" + fId + "]: stream error " + e); + cleanTmp(myFile); + return 1; + } + sendMsg("Filetransfer[" + fId + "]: file length = " + fileLength); + if (fileLength > 0) { + try { + out = new RandomAccessFile(myFile + ".gz", "rw"); + } catch (IOException g) { + sendMsg("Filetransfer[" + fId + "]: can't write to a file " + g); + try { + outStream.writeUTF(failed); + } catch (Exception h) { + sendMsg("Filetransfer[" + fId + "]: stream error " + h); + } + cleanTmp(myFile); + return 1; + } + try { + outStream.writeUTF(ok); + } catch (Exception i) { + sendMsg("Filetransfer[" + fId + "]: stream error " + i); + cleanTmp(myFile); + return 1; + } + sendMsg("Filetransfer[" + fId + "]: awaiting file..."); + try { + byte b; + for (int i = 0; i < fileLength; i++) { + b = inStream.readByte(); + out.write(b); + } + out.close(); + } catch (Exception j) { + sendMsg("Filetransfer[" + fId + "]: file transfer failed " + j); + try { + outStream.writeUTF(failed); + } catch (Exception k) { + sendMsg("Filetransfer[" + fId + "]: stream error " + k); + } + cleanTmp(myFile); + return 1; + } + try { + outStream.writeUTF(ok); + int gunzipResult = gunzipFile(myFile + ".gz", true); + if (gunzipResult != 0) { + sendMsg("Filetransfer[" + fId + "]: gunzip failed"); + cleanTmp(myFile); + return 1; + } + } catch (Exception l) { + sendMsg("Filetransfer[" + fId + "]: stream error " + l); + cleanTmp(myFile); + return 1; + } + sendMsg("Filetransfer[" + fId + "]: file transfer complete."); + } else { + try { + outStream.writeUTF(failed); + } catch (Exception f) { + sendMsg("Filetransfer[" + fId + "]: file length invalid"); + cleanTmp(myFile); + return 1; + } + } + return 0; + } + + private int gzipFile(String myFile, boolean delSource) { + int read; + byte[] data = new byte[1024]; + sendMsg("Filetransfer[" + fId + "]: gzip file"); + try { + File f = new File(myFile); + GZIPOutputStream out; + try (FileInputStream in = new FileInputStream(f)) { + out = new GZIPOutputStream(new FileOutputStream(myFile + ".gz")); + while ((read = in.read(data, 0, 1024)) != -1) { + out.write(data, 0, read); + } + } + out.close(); + if (delSource == true) { + f.delete(); + } + } catch (Exception e) { + sendMsg("Filetransfer[" + fId + "]: gzipping file failed " + e); + return 1; + } + + sendMsg("Filetransfer[" + fId + "]: gzip file"); + return 0; + } + + private int gunzipFile(String myGZFile, boolean delSource) { + int read; + byte[] data = new byte[1024]; + + sendMsg("Filetransfer[" + fId + "]: gunzip file"); + + try { + File f = new File(myGZFile); + FileOutputStream out; + try (GZIPInputStream in = new GZIPInputStream(new FileInputStream(f))) { + String myFile; + if (myGZFile.endsWith(".gz")) { + myFile = myGZFile.substring(0, myGZFile.length() - 3); + } else { + myFile = myGZFile; + } out = new FileOutputStream(myFile); + while ((read = in.read(data, 0, 1024)) != -1) { + out.write(data, 0, read); + } + } + out.close(); + if (delSource == true) { + f.delete(); + } + } catch (Exception e) { + sendMsg("Filetransfer[" + fId + "]: gunzipping file failed " + e); + return 1; + } + return 0; + } + + private void sendMsg(String msg) { + if (debug == 1) { + System.out.println(msg); + } + } + + private void cleanTmp(String fileName) { + try { + new File(fileName).delete(); + } catch (Exception e) { + sendMsg("can't clean tmp file: " + e); + } + } +} diff --git a/src/guitartex2/GTXClient.java b/src/guitartex2/GTXClient.java new file mode 100644 index 0000000..db86cf2 --- /dev/null +++ b/src/guitartex2/GTXClient.java @@ -0,0 +1,257 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package guitartex2; + +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.net.Socket; +import java.net.UnknownHostException; +import java.util.Locale; +import java.util.ResourceBundle; + + + +public class GTXClient extends Thread{ + + private static String quit = "CMD:123_QUIT_123"; + private static String transfer = "CMD:123_TRANSFER_123"; + //private static String ok = "CMD:123_OK_123"; + private static String failed = "CMD:123_FAILED_123"; + private static String ping = "CMD:123_PING_123"; + private static String pong = "CMD:123_PONG_123"; + + private int id; + private StatusBox myStatusBox; + private String fileName; + private String showPdf; + + private boolean hostExist = false; + + private ResourceBundle resbundle; + protected Socket serverConn; + DataOutputStream dout; + DataInputStream din; + + private GTXConsole myConsole; + private String logCache = ""; + + // Konstruktor + public GTXClient(String host, int port) { + resbundle = ResourceBundle.getBundle ("GuitarTeX2strings", Locale.getDefault()); + try { + logToConsole("Trying to connect to " + host + " " + port); + serverConn = new Socket(host, port); + }catch (UnknownHostException e) { + logToConsole("Bad host name given."); + }catch (IOException e) { + logToConsole("GtxClient: " + e); + } + hostExist = true; + logToConsole("Made server connection"); + } + + public GTXClient(String host, int port, StatusBox sBox, String file, int myId, String sPdf) { + resbundle = ResourceBundle.getBundle ("GuitarTeX2strings", Locale.getDefault()); + try { + logToConsole("Trying to connect to " + host + " " + port); + serverConn = new Socket(host, port); + }catch (UnknownHostException e) { + logToConsole("Bad host name given."); + }catch (IOException e) { + logToConsole("GtxClient: " + e); + } + + hostExist = true; + showPdf = sPdf; + id = myId; + myStatusBox = sBox; + fileName = file; + + logToConsole("Made server connection"); + } + + private void logToConsole(String text) { + if ( myConsole == null ) { + if ( logCache.equals("") ) { + logCache = text; + }else{ + logCache = logCache + "\n" + text; + } + }else{ + if ( ! logCache.equals("") ) { + myConsole.addText(logCache); + logCache = ""; + myConsole.addText(text); + }else{ + myConsole.addText(text); + } + } + } + + void setGTXConsole(GTXConsole mConsole) { + myConsole = mConsole; + if ( ! logCache.equals("") ) { + myConsole.addText(logCache); + logCache = ""; + } + } + + void forceLogCache() { + if ( myConsole != null ) { + myConsole.addText(logCache); + logCache = null; + } + } + + @Override + public void run () { + try { + if ( myStatusBox != null ) { + myStatusBox.setStatus(resbundle.getString("sendTexFile")); + } + dout.writeUTF(transfer); + logToConsole("Client ready for transfer:"); + FileTransfer fileTransfer = new FileTransfer(id,0,din, dout); + int texSendResult = fileTransfer.sendFile(fileName); + if ( texSendResult != 0) { + logToConsole("tex file send failed"); + }else{ + myStatusBox.setStatus(resbundle.getString("wait4PdfFile")); + logToConsole("tex file send."); + } + String texResult = din.readUTF(); + if ( texResult.equals(failed)) { + InfoBox infoBox = new InfoBox(resbundle.getString("texFailed")); + logToConsole("texin unsuccessfull"); + //myStatusBox.setStatus("FEHLER!"); + //myStatusBox.requestFocus(); + }else{ + myStatusBox.setStatus(resbundle.getString("receivePdfFile")); + String rawFileName = fileName.substring(0, fileName.length()-4); + int pdfResult = fileTransfer.receiveFile(rawFileName + ".pdf"); + if ( pdfResult != 0) { + logToConsole("pdf unsuccesfull"); + }else{ + logToConsole("pdf file received."); + } + myStatusBox.setStatus(resbundle.getString("receiveLogFile")); + int logResult = fileTransfer.receiveFile(rawFileName + ".log"); + if ( logResult != 0) { + logToConsole("log unsuccesfull"); + }else{ + logToConsole("log file received."); + } + myStatusBox.setStatus("try to show PDF file ..."); + logToConsole("try to show pdf file"); + try{ + Runtime.getRuntime().exec(showPdf); + }catch (Exception h) { + logToConsole("ERR: " + h); + } + + } + closeConnection(); + + myStatusBox.setVisible(false); + }catch (Exception e) { + logToConsole("failed texin file: " + e); + } + } + + public int openConnection() { + if ( hostExist) { + try { + dout = new DataOutputStream(serverConn.getOutputStream()); + din = new DataInputStream(serverConn.getInputStream()); + logToConsole("connection open"); + return 0; + }catch (Exception e) { + logToConsole("open connection failed: " + e); + return 1; + } + }else{ + logToConsole("Host not exists!"); + return 1; + } + } + + public int closeConnection() { + if ( hostExist ) { + try { + dout.writeUTF(quit); + din.close(); + dout.close(); + logToConsole("connection closed"); + return 0; + }catch (Exception e) { + logToConsole("close connection failed: " + e); + return 1; + } + }else{ + logToConsole("Host not exists!"); + return 1; + } + } + + public int checkServerConnection() { + if ( hostExist ) { + try { + logToConsole("sending ping ..."); + dout.writeUTF(ping); + logToConsole("awaiting pong ..."); + String pingResult = din.readUTF(); + logToConsole(pingResult); + if ( pingResult.equals(pong)) { + logToConsole("pong received."); + return 0; + }else { + logToConsole("server doesn't working."); + return 1; + } + }catch (Exception e) { + logToConsole("ping failed " + e); + return 1; + } + }else{ + logToConsole("Host not exists!"); + return 1; + } + } + + public String sendText(String text) { + String result = "unknown command!"; + if ( text.equals("ping") ){ + try { + dout.writeUTF(ping); + result = din.readUTF(); + if ( result.equals(pong) ) { + result = "pong"; + } + dout.writeUTF(quit); + }catch (Exception e) { + logToConsole("Sending failed!"); + return "Sending failed!"; + } + } + return result; + } +/* public int tex2pdf(String fileName, int id) { + + }*/ + +} \ No newline at end of file diff --git a/src/guitartex2/GTXConsole.java b/src/guitartex2/GTXConsole.java new file mode 100644 index 0000000..5b64ef9 --- /dev/null +++ b/src/guitartex2/GTXConsole.java @@ -0,0 +1,217 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package guitartex2; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.GridBagLayout; +import java.awt.Panel; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Locale; +import java.util.ResourceBundle; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.KeyStroke; + + + +class GTXConsole extends JFrame implements ActionListener{ + private static final long serialVersionUID = -5838495111759011319L; + + private Font titleFont, bodyFont; + + private static final int statusWidth = 640; + private static final int statusHeight = 480; + private static int statusTop; + private static int statusLeft; + + private final ResourceBundle resbundle; + + private final JTextArea mShowArea; + //private JTextArea mInputArea; + private final JTextField mInputTextField; + + private GTXClient gtxClient; + private Configurations myConf; + + private final JButton mInputButton; + private final Action mInputAction; + + //public static final String DATE_FORMAT_NOW = "yyyy-MM-dd HH:mm:ss"; + public static final String DATE_FORMAT_NOW = "HH:mm:ss"; + + + public GTXConsole() { + resbundle = ResourceBundle.getBundle ("GuitarTeX2strings", Locale.getDefault()); + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + statusTop = new Double((screenSize.getHeight()/2) - (statusHeight/2)).intValue(); + statusLeft = new Double((screenSize.getWidth()/2) - (statusWidth/2)).intValue(); + + this.setResizable(false); + + SymWindow aSymWindow = new SymWindow(); + this.addWindowListener(aSymWindow); + +// Initialize useful fonts + titleFont = new Font("Lucida Grande", Font.BOLD, 14); + if (titleFont == null) { + titleFont = new Font("SansSerif", Font.BOLD, 14); + } + bodyFont = new Font("Lucida Grande", Font.PLAIN, 10); + if (bodyFont == null) { + bodyFont = new Font("SansSerif", Font.PLAIN, 10); + } + + Panel inputPanel = new Panel(new FlowLayout()); + Panel buttonPanel = new Panel(new GridBagLayout()); + + mShowArea = new JTextArea(resbundle.getString("consoleInitText")); + mShowArea.setEditable(false); + JScrollPane scrollingShowArea = new JScrollPane(mShowArea); + + // InputPanel + + mInputAction = new buttonActionClass(resbundle.getString("consoleSendButton")); + mInputButton = new JButton(mInputAction); + //mInputButton.setActionCommand("mInputAction"); + + + //mInputArea = new JTextArea(); + mInputTextField = new JTextField(); + mInputTextField.setColumns(40); + mInputTextField.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), mInputAction); + + + inputPanel.add(mInputTextField); + inputPanel.add(mInputButton); + + mInputButton.setEnabled(false); + mInputAction.setEnabled(false); + + // OK - Button + + Action mOkAction = new buttonActionClass(resbundle.getString("okButton")); + JButton mOkButton = new JButton(mOkAction); + //mOkButton.setActionCommand("mOkAction"); + mOkButton.getInputMap().put(KeyStroke.getKeyStroke("ENTER"), mOkAction); + + buttonPanel.add(new JLabel()); + buttonPanel.add(mOkButton); + buttonPanel.add(new JLabel()); + + this.pack(); + this.getContentPane().add (scrollingShowArea, BorderLayout.CENTER); + this.getContentPane().add (inputPanel, BorderLayout.PAGE_START); + this.getContentPane().add (buttonPanel, BorderLayout.PAGE_END); + + this.setLocation(statusLeft, statusTop); + this.setSize(statusWidth, statusHeight); + this.setTitle(resbundle.getString("consoleTitle")); + this.setVisible(false); + + } + + public void setGTXClient(Configurations mConf) { + myConf = mConf; + gtxClient = new GTXClient(myConf.getGtxServer(), myConf.getGtxServerPort()); + int openResult = gtxClient.openConnection(); + if ( openResult == 0 ) { + int connResult = gtxClient.checkServerConnection(); + if ( connResult == 0) { + mInputButton.setEnabled(true); + mInputAction.setEnabled(true); + } + } + gtxClient.closeConnection(); + } + + public class buttonActionClass extends AbstractAction { + private static final long serialVersionUID = 3791659234149686228L; + + private final String mAction; + + public buttonActionClass(String text) { + super(text); + mAction = text; + } + @Override + public void actionPerformed(ActionEvent e) { + if (mAction.equals(resbundle.getString("consoleSendButton"))) { + // Nachricht anzeigen + addText(mInputTextField.getText()); + + // Nachricht senden + gtxClient = new GTXClient(myConf.getGtxServer(), myConf.getGtxServerPort()); + int openResult = gtxClient.openConnection(); + if ( openResult == 0 ) { + String receiveText = gtxClient.sendText(mInputTextField.getText()); + addText("Server: " + receiveText); + } + gtxClient.closeConnection(); + + mInputTextField.setText(""); + mInputTextField.requestFocus(); + } + + // Fenster schliessen + if (mAction.equals(resbundle.getString("okButton"))) { + setVisible(false); + } + } + } + + + class SymWindow extends java.awt.event.WindowAdapter { + @Override + public void windowClosing(java.awt.event.WindowEvent event) { + setVisible(false); + } + } + + @Override + public void actionPerformed(ActionEvent newEvent) { + setVisible(false); + } + + public void addText(String text) { + String prefix = this.now() + " # "; + text = text.replaceAll("\n", "\n" + prefix); + mShowArea.setText(mShowArea.getText() + "\n" + prefix + text); + //System.out.println(text); + } + + private String now() { + Calendar cal = Calendar.getInstance(); + SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT_NOW); + return sdf.format(cal.getTime()); + } + +} \ No newline at end of file diff --git a/src/guitartex2/GTXParser.java b/src/guitartex2/GTXParser.java new file mode 100644 index 0000000..d8a6de0 --- /dev/null +++ b/src/guitartex2/GTXParser.java @@ -0,0 +1,1442 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +package guitartex2; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.nio.charset.Charset; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class GTXParser { + + private final String mEditArea; + private String[] mEditAreaLines; + private String myTeXFile = ""; + + // Debug + private final boolean debugModus = false; + + // geparste Variablen; + private boolean mEven = false; + private final String[] mGeometry = new String[50]; + private int mGeometry_counter = 0; + private String mFontSize = "12"; + private String mLanguage = "english"; + private String mColorChorus = "0,0,0"; + private String mColorBridge = "0,0,1"; + private String mColorInstr = ".3,.3,.3"; + private String mColorTab = ".3,.3,.3"; + private String mColorSecond = "1,1,1"; + private String mColorSecondBack = ".7,.7,.7"; + private boolean bookModus = false; + private final boolean pdfModus = true; + private String mBridgeSection = ""; + private String mChorusSection = ""; + private String mTexSection = ""; + private String mTabSection = ""; + + private String mTitle = ""; + private String mSubtitle = ""; + private int mDefine_counter = 0; + private final int mDefine_size = 9; + private final String[][] mDefine = new String[256][mDefine_size]; + private String mSong = ""; + private String mTab = ""; + private String mBookAuthor = ""; + private String mBookTitle = ""; + private String mBookDate = ""; + private String mMultipleSongs = ""; + private boolean somethingMatched; + private boolean blockBatch; + private boolean noPageNum = false; + + /** + * true when harp tones get used, if true \renewcommand{\baselinestretch}{2} + * is added to tex + */ + private boolean harpUsed = false; + private boolean chordUsed = false; + + /* + * + + Output related directives + + {textfont:fontname} + + Sets the font used to print text to fontname. This must be the name of a known PostScript font. + Chordii: Default font for text is Times-Roman. + + + {chordfont:fontname} + + Sets the font used to print chords to fontname. This must be the name of a known PostScript font. + Chordii: Default font for chords is Helvetica-Oblique. + + {chordsize:fontsize} + + Sets the size of the font used for chords. + Chordii: Default font size for chords is 9. + + {no_grid} + {ng} + + Suppresses printing of the list of chords at the end of the current song. + + {grid} + {g} + + Enables printing of the list of chords at the end of the current song. + Chordii: The -g and -G command line options can be used to control what chords are printed. + + {titles: flush} + + Chordii: If flush is left, song titles are printed to the left of the page. If flush is center, or if this directive is missing, titles are printed centered on top of the page. + + + {columns number} + {col: number} + + Specifies the number of columns to print the current song in. + + {column_break} + {colb} + + Forces a column break. + + // Comments als Box mit einer Hintergrundfarbe hinterlegen + // \fcolorbox{Rahmenfarbe}{white}{Text, der in einer Box steht, die einen Rahmen in einer von dir definierten Farbe hat}. + * + */ + // Direktiven + private final String dGeometry = "\\{geometry:"; + private final String dFontSize = "\\{font_size:"; + private final String dFontSize2 = "\\{textsize:"; + private final String dEven = "\\{even\\}"; + private final String dNoPageNum = "\\{nopagenum\\}"; + private final String dColorChorus = "\\{color_chorus:"; + private final String dColorBridge = "\\{color_bridge:"; + private final String dColorInstr = "\\{color_instr:"; + private final String dColorTab = "\\{color_tab:"; + private final String dColorSecond = "\\{color_second:"; + private final String dColorSecondBack = "\\{color_second_back:"; + private final String dTitle = "\\{title:"; + private final String dTitle2 = "\\{t:"; + private final String dSubtitle = "\\{subtitle:"; + private final String dSubtitle2 = "\\{st:"; + private final String dDefine = "\\{define:"; + private final String dHead = "\\{a:"; + private final String dHead2 = "\\{comment:"; + private final String dHead3 = "\\{c:"; + private final String dHead4 = "\\{comment_italic:"; + private final String dHead5 = "\\{ci:"; + private final String dBridgeStart = "\\{bridge\\}"; + private final String dBridgeStart2 = "\\{start_of_bridge\\}"; + private final String dBridgeStart3 = "\\{sob\\}"; + private final String dBridgeEnd = "\\{/bridge\\}"; + private final String dBridgeEnd2 = "\\{end_of_bridge\\}"; + private final String dBridgeEnd3 = "\\{eob\\}"; + private final String dChorusStart = "\\{chorus\\}"; + private final String dChorusStart2 = "\\{start_of_chorus\\}"; + private final String dChorusStart3 = "\\{soc\\}"; + private final String dChorusEnd = "\\{/chorus\\}"; + private final String dChorusEnd2 = "\\{end_of_chorus\\}"; + private final String dChorusEnd3 = "\\{eoc\\}"; + private final String dTabStart = "\\{tab\\}"; + private final String dTabStart2 = "\\{start_of_tab\\}"; + private final String dTabStart3 = "\\{sot\\}"; + private final String dTabEnd = "\\{/tab\\}"; + private final String dTabEnd2 = "\\{end_of_tab\\}"; + private final String dTabEnd3 = "\\{eot\\}"; + private final String dNewPage = "\\{np\\}"; + private final String dNewPage2 = "\\{new_page\\}"; + private final String dGuitarTab = "\\{guitartab:"; + private final String dTexStart = "\\{tex\\}"; + private final String dTexEnd = "\\{/tex\\}"; + private final String dDocumentClass = "\\{document_class:"; + private final String dBookAuthor = "\\{book_author:"; + private final String dBookTitle = "\\{book_title:"; + private final String dBookDate = "\\{book_date:"; + private final String dInclude = "\\{include:"; + private final String dComment = "^#"; + private final String dLangauge = "\\{language:"; + private final String dHarpUsed = ".*<.*>.*"; + private final String dChordUsed = ".*\\[.*\\].*"; + + private final GTXTextConsole myConsole; + + // --------------------Constructor + public GTXParser(String editArea) { + // http://www.bastie.de/index.html?/java/mjregular/index.html + mEditArea = editArea; + myConsole = new GTXTextConsole(); + }// Constructor + + public int convertToTeX() { + int bridgeStartZeile = 0; + int chorusStartZeile = 0; + int tabStartZeile = 0; + int texStartZeile = 0; + + // All patterns + Pattern geoPattern = Pattern.compile(dGeometry + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern fontSizePattern = Pattern.compile("(" + dFontSize + ".*)|(" + dFontSize2 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern evenPattern = Pattern.compile(dEven + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern cChPattern = Pattern.compile(dColorChorus + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern cBrPattern = Pattern.compile(dColorBridge + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern cInstrPattern = Pattern.compile(dColorInstr + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern cTabPattern = Pattern.compile(dColorTab + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern cSecondPattern = Pattern.compile(dColorSecond + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern cSecondBackPattern = Pattern.compile(dColorSecondBack + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern titlePattern = Pattern.compile("(" + dTitle + ".*)|(" + dTitle2 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern subtitlePattern = Pattern.compile("(" + dSubtitle + ".*)|(" + dSubtitle2 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern definePattern = Pattern.compile(dDefine + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern headPattern = Pattern.compile("(" + dHead + ".*)|(" + dHead2 + ".*)|(" + dHead3 + ".*)|(" + dHead4 + ".*)|(" + dHead5 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern bridgeStartPattern = Pattern.compile("(" + dBridgeStart + ".*)|(" + dBridgeStart2 + ".*)|(" + dBridgeStart3 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern bridgeEndPattern = Pattern.compile("(" + dBridgeEnd + ".*)|(" + dBridgeEnd2 + ".*)|(" + dBridgeEnd3 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern chorusStartPattern = Pattern.compile("(" + dChorusStart + ".*)|(" + dChorusStart2 + ".*)|(" + dChorusStart3 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern chorusEndPattern = Pattern.compile("(" + dChorusEnd + ".*)|(" + dChorusEnd2 + ".*)|(" + dChorusEnd3 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern tabStartPattern = Pattern.compile("(" + dTabStart + ".*)|(" + dTabStart2 + ".*)|(" + dTabStart3 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern tabEndPattern = Pattern.compile("(" + dTabEnd + ".*)|(" + dTabEnd2 + ".*)|(" + dTabEnd3 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern newPagePattern = Pattern.compile("(" + dNewPage + ".*)|(" + dNewPage2 + ".*)", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern guitarTabPattern = Pattern.compile(dGuitarTab + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern texStartPattern = Pattern.compile(dTexStart + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern texEndPattern = Pattern.compile(dTexEnd + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern documentClassPattern = Pattern.compile(dDocumentClass + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern bookAuthorPattern = Pattern.compile(dBookAuthor + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern bookTitlePattern = Pattern.compile(dBookTitle + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern bookDatePattern = Pattern.compile(dBookDate + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern includePattern = Pattern.compile(dInclude + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern commentPattern = Pattern.compile(dComment + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern noPageNumPattern = Pattern.compile(dNoPageNum + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern languagePattern = Pattern.compile(dLangauge + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern harpUsedPattern = Pattern.compile(dHarpUsed + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + Pattern chordUsedPattern = Pattern.compile(dChordUsed + ".*", Pattern.CASE_INSENSITIVE | Pattern.DOTALL); + + mEditAreaLines = mEditArea.split("\n"); + blockBatch = false; + for (int i = 0; i < mEditAreaLines.length; i++) { + try { + if (debugModus == true) { + System.out.println(mEditAreaLines[i]); + printChars(mEditAreaLines[i]); + } + Matcher geoMatch = geoPattern.matcher(mEditAreaLines[i]); + Matcher fontSizeMatch = fontSizePattern.matcher(mEditAreaLines[i]); + Matcher evenMatch = evenPattern.matcher(mEditAreaLines[i]); + Matcher cChMatch = cChPattern.matcher(mEditAreaLines[i]); + Matcher cBrMatch = cBrPattern.matcher(mEditAreaLines[i]); + Matcher cInstrMatch = cInstrPattern.matcher(mEditAreaLines[i]); + Matcher cTabMatch = cTabPattern.matcher(mEditAreaLines[i]); + Matcher cSecondMatch = cSecondPattern.matcher(mEditAreaLines[i]); + Matcher cSecondBackMatch = cSecondBackPattern.matcher(mEditAreaLines[i]); + Matcher titleMatch = titlePattern.matcher(mEditAreaLines[i]); + Matcher subtitleMatch = subtitlePattern.matcher(mEditAreaLines[i]); + Matcher defineMatch = definePattern.matcher(mEditAreaLines[i]); + Matcher headMatch = headPattern.matcher(mEditAreaLines[i]); + Matcher bridgeStartMatch = bridgeStartPattern.matcher(mEditAreaLines[i]); + Matcher bridgeEndMatch = bridgeEndPattern.matcher(mEditAreaLines[i]); + Matcher chorusStartMatch = chorusStartPattern.matcher(mEditAreaLines[i]); + Matcher chorusEndMatch = chorusEndPattern.matcher(mEditAreaLines[i]); + Matcher tabStartMatch = tabStartPattern.matcher(mEditAreaLines[i]); + Matcher tabEndMatch = tabEndPattern.matcher(mEditAreaLines[i]); + Matcher newPageMatch = newPagePattern.matcher(mEditAreaLines[i]); + Matcher guitarTabMatch = guitarTabPattern.matcher(mEditAreaLines[i]); + Matcher texStartMatch = texStartPattern.matcher(mEditAreaLines[i]); + Matcher texEndMatch = texEndPattern.matcher(mEditAreaLines[i]); + Matcher documentClassMatch = documentClassPattern.matcher(mEditAreaLines[i]); + Matcher bookAuthorMatch = bookAuthorPattern.matcher(mEditAreaLines[i]); + Matcher bookTitleMatch = bookTitlePattern.matcher(mEditAreaLines[i]); + Matcher bookDateMatch = bookDatePattern.matcher(mEditAreaLines[i]); + Matcher includeMatch = includePattern.matcher(mEditAreaLines[i]); + Matcher commentMatch = commentPattern.matcher(mEditAreaLines[i]); + Matcher noPageNumMatch = noPageNumPattern.matcher(mEditAreaLines[i]); + Matcher languageMatch = languagePattern.matcher(mEditAreaLines[i]); + Matcher harpUsedMatch = harpUsedPattern.matcher(mEditAreaLines[i]); + Matcher chordUsedMatch = chordUsedPattern.matcher(mEditAreaLines[i]); + + if (!commentMatch.matches()) { + somethingMatched = false; + + if (languageMatch.matches()) { + setLanguage(languageMatch.group()); + somethingMatched = true; + } + + if (harpUsedMatch.matches()) { + setHarpUsed(true); + /** + * an dieser Stelle wird KEIN somethingMatched gesetzt, + * weil wir entsprechende Zeilen ja nicht wegwerfen + * möchten sondern nur wissen wollen ob überhaupt welche + * vorhanden sind. + */ + } + + if (chordUsedMatch.matches()) { + setChordUsed(true); + /** + * an dieser Stelle wird KEIN somethingMatched gesetzt, + * weil wir entsprechende Zeilen ja nicht wegwerfen + * möchten sondern nur wissen wollen ob überhaupt welche + * vorhanden sind. + */ + } + + if (noPageNumMatch.matches()) { + setNoPageNum(noPageNumMatch.group()); + somethingMatched = true; + } + if (geoMatch.matches()) { + setGeometry(geoMatch.group()); + somethingMatched = true; + } + if (fontSizeMatch.matches()) { + setFontSize(fontSizeMatch.group()); + somethingMatched = true; + } + if (cChMatch.matches()) { + setColorChorus(cChMatch.group()); + somethingMatched = true; + } + if (cBrMatch.matches()) { + setColorBridge(cBrMatch.group()); + somethingMatched = true; + } + if (cInstrMatch.matches()) { + setColorInstr(cInstrMatch.group()); + somethingMatched = true; + } + if (cTabMatch.matches()) { + setColorTab(cTabMatch.group()); + somethingMatched = true; + } + if (cSecondMatch.matches()) { + setColorSecond(cSecondMatch.group()); + somethingMatched = true; + } + if (cSecondBackMatch.matches()) { + setColorSecondBack(cSecondBackMatch.group()); + somethingMatched = true; + } + if (evenMatch.matches()) { + setEven(); + somethingMatched = true; + } + if (titleMatch.matches()) { + setTitle(titleMatch.group()); + somethingMatched = true; + } + if (subtitleMatch.matches()) { + setSubtitle(subtitleMatch.group()); + somethingMatched = true; + } + if (defineMatch.matches()) { + setDefine(defineMatch.group()); + somethingMatched = true; + } + + if (headMatch.matches()) { + setHead(headMatch.group()); + somethingMatched = true; + } + + if (bridgeStartMatch.matches()) { + somethingMatched = true; + blockBatch = true; + if (debugModus == true) { + System.out.println("Bridge Start matched"); + } + bridgeStartZeile = i + 1; + } + if (bridgeEndMatch.matches()) { + somethingMatched = true; + blockBatch = false; + if (debugModus == true) { + System.out.println("Bridge End matched"); + } + if (bridgeStartZeile != 0) { + for (int j = bridgeStartZeile; j < i; j++) { + mBridgeSection = mBridgeSection + mEditAreaLines[j] + "\n"; + } + setBridge(mBridgeSection); + bridgeStartZeile = 0; + mBridgeSection = ""; + } else { + myConsole.addText("Ende von Bridge ohne den zugehoerigen Anfang!"); + } + } + + if (chorusStartMatch.matches()) { + somethingMatched = true; + blockBatch = true; + chorusStartZeile = i + 1; + } + if (chorusEndMatch.matches()) { + blockBatch = false; + somethingMatched = true; + if (chorusStartZeile != 0) { + for (int j = chorusStartZeile; j < i; j++) { + mChorusSection = mChorusSection + mEditAreaLines[j] + "\n"; + } + setChorus(mChorusSection); + chorusStartZeile = 0; + mChorusSection = ""; + } else { + myConsole.addText("Ende von Chorus ohne den zugehoerigen Anfang!"); + } + } + + if (newPageMatch.matches()) { + somethingMatched = true; + setNewPage(); + } + + if (tabStartMatch.matches()) { + blockBatch = true; + somethingMatched = true; + tabStartZeile = i + 1; + } + if (tabEndMatch.matches()) { + blockBatch = false; + somethingMatched = true; + if (tabStartZeile != 0) { + for (int j = tabStartZeile; j < i; j++) { + mTabSection = mTabSection + mEditAreaLines[j] + "\n"; + } + setTab(mTabSection); + tabStartZeile = 0; + mTabSection = ""; + } else { + myConsole.addText("Ende vom Tab ohne den zugehoerigen Anfang!"); + } + } + + if (guitarTabMatch.matches()) { + somethingMatched = true; + setGuitarTab(guitarTabMatch.group()); + } + + if (texStartMatch.matches()) { + blockBatch = true; + somethingMatched = true; + texStartZeile = i + 1; + } + if (texEndMatch.matches()) { + blockBatch = false; + somethingMatched = true; + if (texStartZeile != 0) { + for (int j = texStartZeile; j < i; j++) { + mTexSection = mTexSection + mEditAreaLines[j] + "\n"; + } + setTex(mTexSection); + texStartZeile = 0; + mTexSection = ""; + } else { + myConsole.addText("Ende von Tex ohen den zugehoerigen Anfang!"); + } + } + + if (documentClassMatch.matches()) { + somethingMatched = true; + setDocumentClass(documentClassMatch.group()); + } + if (bookAuthorMatch.matches()) { + somethingMatched = true; + setBookAuthor(bookAuthorMatch.group()); + } + if (bookTitleMatch.matches()) { + somethingMatched = true; + setBookTitle(bookTitleMatch.group()); + } + if (bookDateMatch.matches()) { + somethingMatched = true; + setBookDate(bookDateMatch.group()); + } + if (includeMatch.matches()) { + somethingMatched = true; + setInclude(includeMatch.group()); + } + + // Falls keine bekannte Zeile, dann wird sie durch den Parser gejagt und angedruckt + if (somethingMatched == false && blockBatch == false) { + nothingMatched(mEditAreaLines[i]); + } + } + + } catch (Exception e) { + myConsole.addText("Problem beim Konvertieren" + e); + } + } + + //mEditArea.setCursor(0); + /* System.out.println("mGeometry: " + getGeometry()); + System.out.println("mFontSize: " + getFontSize()); + System.out.println("mColorChorus: " + getColorChorus()); + System.out.println("mEven: " + mEven); */ + /* for ( int i = 0; i delete closed Element + // => delete spaces + // => delete carage return (windows) + // 2 => delete closed Element + // => delete TAB + // => replace # Element + // 3 => delete TAB (chord and bdrige blocks) + // => replace # Element + if (type == 1) { + chString = chString.replaceAll("\\}", ""); + chString = chString.replaceAll(" ", ""); + chString = chString.replaceAll("\r", ""); + } + if (type == 2) { + chString = chString.replaceAll("\\}", ""); + chString = chString.replaceAll("#", "\\$\\\\sharp\\$"); + chString = chString.replaceAll("\t", ""); + } + if (type == 3) { + chString = chString.replaceAll(" ", "~"); + chString = chString.replaceAll("#", "\\$\\\\sharp\\$"); + chString = chString.replaceAll("\t", ""); + //chString = chString.replaceAll("\n", "\\\\\\\\"); + //chString = chString.replaceAll("\n", "\\\\ \n"); + //chString = chString.replaceAll("\n", "\n\\\n"); + chString = chString.replaceAll("ö", "\"o"); + chString = chString.replaceAll("Ö", "\"O"); + chString = chString.replaceAll("ä", "\"a"); + chString = chString.replaceAll("Ä", "\"A"); + chString = chString.replaceAll("ü", "\"u"); + chString = chString.replaceAll("Ü", "\"U"); + chString = chString.replaceAll("ß", "\"s"); + } + + return chString; + } + + private int setGeometry(String geoString) { + geoString = geoString.replaceAll(dGeometry, ""); + geoString = toTeXString(geoString, 1); + mGeometry[mGeometry_counter] = geoString; + mGeometry_counter = mGeometry_counter + 1; + return 0; + } + + /* private String[] getGeometry() { + return mGeometry; + } */ + private int setFontSize(String fontSize) { + fontSize = fontSize.replaceAll(dFontSize, ""); + fontSize = fontSize.replaceAll(dFontSize2, ""); + fontSize = toTeXString(fontSize, 1); + mFontSize = fontSize; + + return 0; + } + + /* private String getFontSize() { + return mFontSize; + } */ + private int setColorChorus(String colorChorus) { + colorChorus = colorChorus.replaceAll(dColorChorus, ""); + colorChorus = toTeXString(colorChorus, 1); + mColorChorus = colorChorus; + return 0; + } + + /* private String getColorChorus() { + return mColorChorus; + } */ + private int setColorBridge(String colorBridge) { + colorBridge = colorBridge.replaceAll(dColorBridge, ""); + colorBridge = toTeXString(colorBridge, 1); + mColorBridge = colorBridge; + return 0; + } + + /* private String getColorBridge() { + return mColorBridge; + } */ + private int setColorInstr(String colorInstr) { + colorInstr = colorInstr.replaceAll(dColorInstr, ""); + colorInstr = toTeXString(colorInstr, 1); + mColorInstr = colorInstr; + return 0; + } + + /* private String getColorInstr() { + return mColorInstr; + } */ + private int setColorTab(String colorTab) { + colorTab = colorTab.replaceAll(dColorTab, ""); + colorTab = toTeXString(colorTab, 1); + mColorTab = colorTab; + return 0; + } + + /* private String getColorTab() { + return mColorTab; + } */ + private int setColorSecond(String colorSecond) { + colorSecond = colorSecond.replaceAll(dColorSecond, ""); + colorSecond = toTeXString(colorSecond, 1); + mColorSecond = colorSecond; + return 0; + } + + /* private String getColorSecond() { + return mColorSecond; + } */ + private int setColorSecondBack(String colorSecondBack) { + colorSecondBack = colorSecondBack.replaceAll(dColorSecondBack, ""); + colorSecondBack = toTeXString(colorSecondBack, 1); + mColorSecondBack = colorSecondBack; + return 0; + } + + /* private String getColorSecondBack() { + return mColorSecondBack; + } */ + private int setTitle(String title) { + title = title.replaceAll(dTitle, ""); + title = title.replaceAll(dTitle2, ""); + title = toTeXString(title, 2); + mTitle = title; + + return 0; + } + + /* private String getTitle() { + return mTitle; + } */ + private int setSubtitle(String subTitle) { + subTitle = subTitle.replaceAll(dSubtitle, ""); + subTitle = subTitle.replaceAll(dSubtitle2, ""); + subTitle = toTeXString(subTitle, 2); + mSubtitle = subTitle; + + return 0; + } + + /* private String getSubtitle() { + return mSubtitle; + } */ + private int setDefine(String define) { + define = define.replaceAll(dDefine, " "); + define = toTeXString(define, 2); + //String[] oneDefine = new String[mDefine_size]; + String[] oneDefine = (define.split("[ ]+", mDefine_size)); + + System.arraycopy(oneDefine, 0, mDefine[mDefine_counter], 0, oneDefine.length); + + mDefine_counter = mDefine_counter + 1; + + return 0; + } + + /* private String[][] getDefine () { + return mDefine; + } */ + private void setEven() { + mEven = true; + } + + public boolean getEven() { + return mEven; + } + + /** + * @param harpUsed the harpUsed to set + */ + public void setHarpUsed(boolean harpUsed) { + this.harpUsed = harpUsed; + } + + /** + * @return the harpUsed + */ + public boolean isHarpUsed() { + return harpUsed; + } + + /** + * @param chordUsed the chordUsed to set + */ + public void setChordUsed(boolean chordUsed) { + this.chordUsed = chordUsed; + } + + /** + * @return the chordUsed + */ + public boolean isChordUsed() { + return chordUsed; + } + + private int setHead(String head) { + head = head.replaceAll(dHead, ""); + head = head.replaceAll(dHead2, ""); + head = head.replaceAll(dHead3, ""); + head = head.replaceAll(dHead4, ""); + head = head.replaceAll(dHead5, ""); + head = toTeXString(head, 2); + + mSong = mSong + "\\textbf{\\textit{" + head + "}} \\\\\n\\\\\n"; + //mSong = mSong + "\\textbf{\\textit{" + head + "}}\\\\\n"; + return 0; + } + + /* private String getSong () { + return mSong; + } */ + private String parseChordSection(String chordSection, boolean skipEmptyLines) { + String convertedText = ""; + chordSection = chordSection.replaceAll("\r", ""); + String[] chordSectionLinewise = chordSection.split("\n"); + + // Pro Zeile parseChordSectionSingle aufrufen + for (String chordSectionLinewise1 : chordSectionLinewise) { + String line = parseChordSectionSingle(chordSectionLinewise1, skipEmptyLines); + if ("".equals(line)) { + line = toTeXString(chordSectionLinewise1, 3); + convertedText = convertedText + "\\combichord{}{}{" + line + "}\\\\ \n"; + } else { + //System.out.println("> " + line); + convertedText = convertedText + line + "\\\\ \n"; + } + } + + return convertedText; + } + + private String parseChordSectionSingle(String chordSection, boolean skipEmptyLines) { + String startText = ""; + int startIndex = 0; + String myTextChord = ""; + String myTextSong = ""; + String myTextHarp = ""; + boolean unchanged = true; + + String convertedText = chordSection; + + Pattern parsePattern = Pattern.compile("([\\[<].*?[\\]>])([\\[<].*?[\\]>])?([.[^\\n\\[<\\]>\\\\]]*)"); + + Matcher mat = parsePattern.matcher(convertedText); + + //System.out.print("ChordSection:"+chordSection); + while (mat.find()) { + // Anfang soll auch in ein combichord gepackt werden + if ("".equals(myTextChord) && "".equals(myTextSong) && "".equals(myTextHarp)) { + startIndex = mat.start(); + if (startIndex != 0) { + startText = "\\combichord{}{}{" + chordSection.substring(0, startIndex) + "}"; + } + } + + unchanged = false; + myTextChord = ""; + myTextHarp = ""; + + myTextSong = mat.group(3); + + //System.out.println("(1): " + mat.group(1) + " (2): " + mat.group(2) + " (3): " + mat.group(3) ); + if (mat.group(1) != null && mat.group(1).charAt(0) == '[') { + //its an guitar chord + myTextChord = mat.group(1).substring(1, mat.group(1).length() - 1); + } else if (mat.group(1) != null) { //it must be harp + myTextHarp = mat.group(1).substring(1, mat.group(1).length() - 1); + } + + if (mat.group(2) != null && mat.group(2).charAt(0) == '[') { + //its an guitar chord + myTextChord = mat.group(2).substring(1, mat.group(2).length() - 1); + } else if (mat.group(2) != null) { //it must be harp + myTextHarp = mat.group(2).substring(1, mat.group(2).length() - 1); + } + + myTextHarp = harpToTex(myTextHarp); + + convertedText = mat.replaceFirst("\\\\combichord{" + myTextChord + "}{" + myTextHarp + "}{" + myTextSong + "}"); + mat.reset(convertedText); + + } + if (unchanged) { + return ""; + } else { + //System.out.println(startText + convertedText.substring(startIndex, convertedText.length())); + //return ""; + return toTeXString(startText + convertedText.substring(startIndex, convertedText.length()), 3); + } + } + + private String harpToTex(String myTextHarp) { + if (myTextHarp == null || myTextHarp.length() < 2) { + return ""; + } + String out; + String channel = myTextHarp.substring(1, myTextHarp.length()); + if (myTextHarp.contains("-")) { + if (myTextHarp.contains("\'\'\'")) { + out = channel + "\\\\hdrawhhh"; + } else if (myTextHarp.contains("\'\'")) { + out = channel + "\\\\hdrawhh"; + } else if (myTextHarp.contains("\'")) { + out = channel + "\\\\hdrawh"; + } else { + out = channel + "\\\\hdraw"; + } + } else { + // TODO Specify blow-bends + out = channel + "\\\\hblow"; + } + out = out.replace("\'", ""); + return out; + } + + private int setBridge(String myBridge) { + mSong = mSong + "\\begin{bridge}\n"; + mSong = mSong + parseChordSection(myBridge, false); + mSong = mSong + "\\end{bridge}" + "\n\n"; + return 0; + } + + private int setChorus(String myChorus) { + mSong = mSong + "\\begin{chorus}\n"; + mSong = mSong + parseChordSection(myChorus, false); + mSong = mSong + "\\end{chorus}" + "\n\n"; + return 0; + } + + private int setTab(String myTeXTab) { + String[] myTeXTabLine = myTeXTab.split("\n"); + mTab = "\\begin{gtxtab}" + "\n"; + try { + for (String myTeXTabLine1 : myTeXTabLine) { + mTab = mTab + "\\footnotesize \\verb!" + myTeXTabLine1 + "! \\normalsize \\newline \n"; + } + } catch (Exception e) { + myConsole.addText("ERR: " + e); + } + mTab = mTab + "\\end{gtxtab}" + "\n"; + mSong = mSong + mTab + "\n"; + return 0; + } + + private int setTex(String myTex) { + try { + // zum Song hinzufuegen + mSong = mSong + "\n" + myTex; + } catch (Exception e) { + myConsole.addText("ERR: " + e); + } + + return 0; + } + + private int setNewPage() { + mSong = mSong + "\n" + "\\newpage" + "\n"; + + return 0; + } + + private int setGuitarTab(String guitarTab) { + String texGuitarTab = ""; + + String string1Pos = "2.5ex"; + String string2Pos = "4.5ex"; + String string3Pos = "6.5ex"; + String string4Pos = "8.5ex"; + String string5Pos = "10.5ex"; + String string6Pos = "12.5ex"; + String string9Pos = "14.5ex"; + String tabSpace = "~~~"; + String tabBreak = tabSpace + + "\\gtxtabs{3.7ex}{|}" + + "\\gtxtabs{5.7ex}{|}" + + "\\gtxtabs{7.7ex}{|}" + + "\\gtxtabs{9.7ex}{|}" + + "\\gtxtabs{11.3ex}{|}" + tabSpace; + + guitarTab = guitarTab.replaceAll(dGuitarTab, ""); + guitarTab = toTeXString(guitarTab, 2); + + guitarTab = guitarTab.replaceAll("\\[1;", "\\[" + string1Pos + ";"); + guitarTab = guitarTab.replaceAll("\\[2;", "\\[" + string2Pos + ";"); + guitarTab = guitarTab.replaceAll("\\[3;", "\\[" + string3Pos + ";"); + guitarTab = guitarTab.replaceAll("\\[4;", "\\[" + string4Pos + ";"); + guitarTab = guitarTab.replaceAll("\\[5;", "\\[" + string5Pos + ";"); + guitarTab = guitarTab.replaceAll("\\[6;", "\\[" + string6Pos + ";"); + guitarTab = guitarTab.replaceAll("\\[9;", "\\[" + string9Pos + ";"); + + texGuitarTab = texGuitarTab + "\n" + "\\guitartab" + "\n"; + String gtxTab = ""; + String oneNote; + String onePlace; + boolean noteMode = false; + for (int i = 0; i < guitarTab.length(); i++) { + if (guitarTab.charAt(i) == ']') { + String [] tmp = gtxTab.split(";"); + onePlace = tmp[0]; + oneNote = tmp[1]; + + texGuitarTab = texGuitarTab + "\\gtxtabs{" + onePlace + "}{" + oneNote + "}"; + + if (i + 1 < guitarTab.length()) { + if (guitarTab.charAt(i + 1) == '[') { + texGuitarTab = texGuitarTab + tabSpace; + } + } + + gtxTab = ""; + noteMode = false; + } + if (noteMode == true) { + gtxTab = gtxTab + guitarTab.charAt(i); + } + if (guitarTab.charAt(i) == '[') { + noteMode = true; + } + if (guitarTab.charAt(i) == ' ') { + texGuitarTab = texGuitarTab + "~"; + } + if (guitarTab.charAt(i) == '_') { + texGuitarTab = texGuitarTab + tabSpace; + } + if (guitarTab.charAt(i) == '|') { + texGuitarTab = texGuitarTab + tabBreak; + } + + } + + mSong = mSong + "\\footnotesize"; + mSong = mSong + texGuitarTab + "\n"; + mSong = mSong + "\\normalsize" + "\n\n"; + + return 0; + } + + public String getMyTeXFile() { + if (bookModus == true) { + createTeXBook(); + } else { + createTeXFile(); + } + return myTeXFile; + } + + public String getMyTeXSong() { + createTeX(); + return myTeXFile; + } + + private void setDocumentClass(String documentClass) { + documentClass = documentClass.replaceAll(dDocumentClass, ""); + documentClass = toTeXString(documentClass, 1); + + if (documentClass.equalsIgnoreCase("book")) { + bookModus = true; + } + } + + private void setBookAuthor(String bookAuthor) { + bookAuthor = bookAuthor.replaceAll(dBookAuthor, ""); + bookAuthor = toTeXString(bookAuthor, 2); + + mBookAuthor = bookAuthor; + } + + private void setBookTitle(String bookTitle) { + bookTitle = bookTitle.replaceAll(dBookTitle, ""); + bookTitle = toTeXString(bookTitle, 2); + + mBookTitle = bookTitle; + } + + private void setBookDate(String bookDate) { + bookDate = bookDate.replaceAll(dBookDate, ""); + bookDate = toTeXString(bookDate, 2); + + mBookDate = bookDate; + } + + private void setInclude(String fileName) { + String mTextArea = ""; + fileName = fileName.replaceAll(dInclude, ""); + fileName = fileName.replaceAll("\\}", ""); + fileName = fileName.replaceAll("\n", ""); + fileName = fileName.replaceAll("\r", ""); + + File f = new File(fileName); + try { + try (FileInputStream fis = new FileInputStream(f); BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(f), Charset.forName("UTF-8")))) { + boolean eof = false; + while (eof == false) { + String line = in.readLine(); + if (line == null) { + eof = true; + } else { + mTextArea = mTextArea + line + "\n"; + } + } + } + + GTXParser mGTXParser = new GTXParser(mTextArea); + mGTXParser.convertToTeX(); + if (mGTXParser.getEven() == true) { + mMultipleSongs = mMultipleSongs + "\\ifthenelse{\\isodd{\\thepage}}{}{\\newpage ~}\n"; + } + mMultipleSongs = mMultipleSongs + mGTXParser.getMyTeXSong(); + } catch (Exception e) { + myConsole.addText("File input error:" + e); + } + + } + + public int createTeXFile() { + + myTeXFile = "\\documentclass[" + mLanguage + "," + mFontSize + "pt]{article} \n"; + //myTeXFile = myTeXFile + "\\documentstyle[times]{article}"; + myTeXFile = myTeXFile + "\\usepackage["; + if (mGeometry_counter != 0) { + for (int i = 0; i < mGeometry_counter - 1; i++) { + myTeXFile = myTeXFile + mGeometry[i] + ","; + } + myTeXFile = myTeXFile + mGeometry[mGeometry_counter - 1] + "]{geometry}\n"; + } else { + myTeXFile = myTeXFile + "a4paper,margin=2.5cm" + "]{geometry}\n"; + } + myTeXFile = myTeXFile + + "\\usepackage[T1]{fontenc}\n" + + "\\usepackage{lmodern}\n" + + "\\usepackage[utf8]{inputenc}\n" + + //"\\usepackage[latin1]{inputenc}\n" + + "\\usepackage{babel}\n" + + "\\usepackage{color}\n" + + //"\\usepackage{graphicx}\n" + + "\\usepackage{ifthen}\n" + + "\\usepackage{calc}\n" + + "\\usepackage{gchords}\n" + + "\\usepackage{calligra}\n"; + + if (noPageNum) { + myTeXFile = myTeXFile + "\\pagestyle{empty}\n"; + } + + if (mEven) { + myTeXFile = myTeXFile + "\\pagestyle{empty}\n"; + } + + // Fontfarben definieren + myTeXFile = myTeXFile + "\n" + + "%------definition of font colors-----------\n" + + "\\definecolor{chorus}{rgb}{" + mColorChorus + "}\n" + + "\\definecolor{bridge}{rgb}{" + mColorBridge + "}\n" + + "\\definecolor{instr}{rgb}{" + mColorInstr + "}\n" + + "\\definecolor{tab}{rgb}{" + mColorTab + "}\n" + + "\\definecolor{second_text}{rgb}{" + mColorSecond + "}\n" + + "\\definecolor{second_back}{rgb}{" + mColorSecondBack + "}\n"; + + if (isHarpUsed() && isChordUsed()) { + myTeXFile = myTeXFile + "\\renewcommand{\\baselinestretch}{2}\n"; + } + // Umgebungen definieren + myTeXFile = myTeXFile + "\\newenvironment{chorus}{\\color{chorus}}{\\normalcolor}\n" + + "\\newenvironment{bridge}{\\color{bridge}}{\\normalcolor}\n" + + "\\newenvironment{instr}{\\color{instr}}{\\normalcolor}\n" + + "\\newenvironment{gtxtab}{\\color{tab}}{\\normalcolor}\n"; + + myTeXFile = myTeXFile + + "\\newcommand{\\gtxchordsize}{\\footnotesize}\n" + + "\\setlength{\\parindent}{0pt}\n" + + "\\sloppy\n" + + "\\setlength{\\unitlength}{1mm}\n" + + "\\newcommand{\\gtxchord}[2]{\\sbox{\\gtxchordbox}{#1}\\sbox{\\textbox}{#2}%\n" + + "\\ifthenelse{\\lengthtest{\\wd\\textbox>\\wd\\gtxchordbox}}%\n" + + "{%\n" + + "\\raisebox{2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#1}}#2%\n" + + "}{%\n" + + "\\raisebox{2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#1}}\\makebox[\\wd\\gtxchordbox+0.5em][l]{#2}%\n" + + "}%\n" + + "}%\n" + + "\\newcommand{\\guitartab}{%\n" + + "\\makebox[0cm][l]{\\raisebox{12.5ex}{\\footnotesize{e}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{10.5ex}{\\footnotesize{H}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{8.5ex}{\\footnotesize{G}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{6.5ex}{\\footnotesize{D}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{4.5ex}{\\footnotesize{A}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{2.5ex}{\\footnotesize{E}}}%\n" + + "~~\n" + + "\\makebox[0cm][l]{\\raisebox{13ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{11ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{9ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{7ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{5ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{3ex}{\\line(1,0){130}}}%\n" + + "~}\n\n" + + "\\newcommand{\\basstab}{%\n" + + "\\makebox[0cm][l]{\\raisebox{8.5ex}{\\footnotesize{G}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{6.5ex}{\\footnotesize{D}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{4.5ex}{\\footnotesize{A}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{2.5ex}{\\footnotesize{E}}}%\n" + + "~~\n" + + "\\makebox[0cm][l]{\\raisebox{9ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{7ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{5ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{3ex}{\\line(1,0){130}}}%\n" + + "~}\n\n" + + "\\newcommand{\\gtxtabs}[2]{\\makebox[0cm][l]{\\raisebox{#1}{#2}}}\n" + + // define arrow symbols for harp tunes + "\\newcommand{\\hdraw}{\n" + + " \\begin{picture}(0,0)\n" + + " \\put(0,2.5){\\vector(0,-1){3}}\n" + + " \\end{picture}\n" + + "}\n" + + "\n" + + "\\newcommand{\\hblow}{\n" + + " \\begin{picture}(0,0)\n" + + " \\put(0,-0.5){\\vector(0,1){3}}\n" + + " \\end{picture}\n" + + "}\n" + + "\n" + + "\\newcommand{\\hdrawh}{\n" + + " \\begin{picture}(0,0)\n" + + " \\put(0,2.5){\\line(0,-1){1.5}}\n" + + "% \\put(0,1){\\line(-1,-1){1.5}}\n" + + "% \\put(0,1){\\vector(-1,-1){2}}\n" + + " \\put(0,1){\\vector(-1,-1){1}}\n" + + " \\end{picture}\n" + + "}\n" + + "\n" + + "\\newcommand{\\hdrawhh}{\n" + + " \\begin{picture}(0,0)\n" + + " \\put(0,2.5){\\line(0,-1){1.5}}\n" + + " \\put(0,1){\\vector(-1,0){1.5}}\n" + + " \\end{picture}\n" + + "}\n" + + "\n" + + "\\newcommand{\\hdrawhhh}{\n" + + " \\begin{picture}(0,0)\n" + + " \\put(0,2.5){\\line(0,-1){2}}\n" + + " \\put(0,0.5){\\vector(-1,1){1}}\n" + + " \\end{picture}\n" + + "}\n" + + "\n" + + "\\newcommand{\\combichord}[3]{\\sbox{\\gtxchordbox}{#1}\\sbox{\\textbox}{#3}\\sbox{\\harpbox}{#2}%\n" + + "\\ifthenelse{\\lengthtest{\\wd\\textbox>\\wd\\gtxchordbox}\\and\\lengthtest{\\wd\\textbox>\\wd\\harpbox}}{%\n" + + "\\raisebox{2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#1}}\\raisebox{-2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#2}}#3%\n" + + "}{%\n" + + "\\ifthenelse{\\lengthtest{\\wd\\harpbox>\\wd\\textbox}\\and\\lengthtest{\\wd\\harpbox>\\wd\\gtxchordbox}}{%\n" + + "\\raisebox{2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#1}}\\raisebox{-2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#2}}\\makebox[\\wd\\harpbox]{#3}%\n" + + "}{%\n" + + "\\raisebox{2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#1}}\\raisebox{-2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#2}}\\makebox[\\wd\\gtxchordbox]{#3}%\n" + + "}}}%"; + + // Dokument - Start + myTeXFile = myTeXFile + "\n" + + "\\begin{document}\n" + + "\\newsavebox{\\gtxchordbox}\n" + + "\\newsavebox{\\textbox}\n" + + "\\newsavebox{\\harpbox}\n" + + "\\ifthenelse{\\isodd{\\thepage}}{}{\\newpage ~}%\n"; + + myTeXFile = myTeXFile + "\n%----- New Song -----\n" + + "\\newpage\\addcontentsline{toc}{section}{" + mTitle + "}\n" + + "\\begin{center} \\section*{" + mTitle + "}\\end{center}\n" + + "\\index{" + mTitle + "}\\typeout{" + mTitle + "}\\index{" + mSubtitle + + "!" + mTitle + "}\\begin{center}" + mSubtitle + "\\end{center}\n"; + + // Dokument - Song + myTeXFile = myTeXFile + mSong; + + // Tabs +/* myTeXFile = myTeXFile + "\\footnotesize" + "\n"; + myTeXFile = myTeXFile + mTab + "\n"; + myTeXFile = myTeXFile + mGuitarTab + "\n\n"; + myTeXFile = myTeXFile + "\\normalsize" + "\n"; + */ + // Definiere - Akkorde + String mChord = ""; + for (int i = 0; i < mDefine_counter; i++) { + mChord = mChord + "~\\chord {{" + mDefine[i][2] + "}}{"; + for (int j = 3; j < mDefine_size - 1; j++) { + mChord = mChord + mDefine[i][j] + ","; + } + mChord = mChord + mDefine[i][mDefine_size - 1]; + mChord = mChord + "}{" + mDefine[i][1] + "}\n"; + } + mChord = mChord.replaceAll(" ", ""); + myTeXFile = myTeXFile + mChord; + + // Dokement - Ende + myTeXFile = myTeXFile + "\\end{document}\n"; + + return 0; + } + + public int createTeX() { + // Dokument - Start + + myTeXFile = myTeXFile + "\n" + "%----- New Song -----\n" + + "\\newpage\\addcontentsline{toc}{section}{" + mTitle + "}\n"; + if (pdfModus == true) { + myTeXFile = myTeXFile + "\\pdfdest name {" + + mTitle + "} fith \\pdfoutline goto name {" + + mTitle + "} {" + mTitle + "}"; + } + myTeXFile = myTeXFile + "\\begin{center} \\section*{" + mTitle + "}\\end{center}\n" + + "\\index{" + mTitle + "}\\typeout{" + mTitle + "}\\index{" + mSubtitle + + "!" + mTitle + "}\\begin{center}" + mSubtitle + "\\end{center}\n"; + + // Dokument - Song + myTeXFile = myTeXFile + mSong; + + // Tabs +/* myTeXFile = myTeXFile + "\\footnotesize" + "\n"; + myTeXFile = myTeXFile + mTab + "\n"; + myTeXFile = myTeXFile + mGuitarTab + "\n\n"; + myTeXFile = myTeXFile + "\\normalsize" + "\n"; + */ + // Definiere - Akkorde + String mChord = ""; + for (int i = 0; i < mDefine_counter; i++) { + mChord = mChord + "~\\chord {{" + mDefine[i][2] + "}}{"; + for (int j = 3; j < mDefine_size - 1; j++) { + mChord = mChord + mDefine[i][j] + ","; + } + mChord = mChord + mDefine[i][mDefine_size - 1]; + mChord = mChord + "}{" + mDefine[i][1] + "}\n"; + } + mChord = mChord.replaceAll(" ", ""); + myTeXFile = myTeXFile + mChord; + + return 0; + } + + public int createTeXBook() { + // PDF - Info + myTeXFile = myTeXFile + "\\pdfoutput=1\n" + + "\\pdfcompresslevel=9\n" + + "\\pdfpageheight=29.7cm\n" + + "\\pdfpagewidth=21cm\n" + + "\\pdfcatalog {/PageMode /UseOutlines}\n" + + "\\pdfinfo {\n" + + " /Title (" + mBookTitle + ")\n" + + " /Author (" + mBookAuthor + ")\n" + + " /CreationDate (" + mBookDate + ")\n" + + " /Producer (GuitarTeX2 by Nikolai Rinas)\n" + + "}\n"; + + myTeXFile = myTeXFile + "\\documentclass[" + mLanguage + ",pdftex," + mFontSize + "pt]{book} \n" + + "\\usepackage["; + if (mGeometry_counter != 0) { + for (int i = 0; i < mGeometry_counter - 1; i++) { + myTeXFile = myTeXFile + mGeometry[i] + ","; + } + myTeXFile = myTeXFile + mGeometry[mGeometry_counter - 1] + "]{geometry}\n"; + } else { + myTeXFile = myTeXFile + "a4paper,margin=2.5cm" + "]{geometry}\n"; + } + + myTeXFile = myTeXFile + + "\\usepackage[T1]{fontenc}\n" + + "\\usepackage{lmodern}\n" + + "\\usepackage[utf8]{inputenc}\n" + + //"\\usepackage[latin1]{inputenc}\n" + + "\\usepackage{babel}\n" + + "\\usepackage{color}\n" + + //"\\usepackage{graphicx}\n" + + "\\usepackage{ifthen}\n" + + "\\usepackage{calc}\n" + + "\\usepackage{gchords}\n" + + "\\usepackage{makeidx}\n" + + "\\usepackage{fancyhdr}\n" + + "\\usepackage{calligra}\n" + + "\\usepackage[pdftex]{thumbpdf}\n"; + + myTeXFile = myTeXFile + "\\title{\\calligra{" + mBookTitle + "}}\n" + + "\\author{\\calligra{" + mBookAuthor + "}}\n" + + "\\date{" + mBookDate + "}\n" + + "\\makeindex\n" + + "\\pagestyle{fancy}\n"; + + // Fontfarben definieren + myTeXFile = myTeXFile + "\n" + + "%------definition of font colors-----------\n" + + "\\definecolor{chorus}{rgb}{" + mColorChorus + "}\n" + + "\\definecolor{bridge}{rgb}{" + mColorBridge + "}\n" + + "\\definecolor{instr}{rgb}{" + mColorInstr + "}\n" + + "\\definecolor{tab}{rgb}{" + mColorTab + "}\n" + + "\\definecolor{second_text}{rgb}{" + mColorSecond + "}\n" + + "\\definecolor{second_back}{rgb}{" + mColorSecondBack + "}\n"; + + // Umgebungen definieren + myTeXFile = myTeXFile + "\\newenvironment{chorus}{\\color{chorus}}{\\normalcolor}\n" + + "\\newenvironment{bridge}{\\color{bridge}}{\\normalcolor}\n" + + "\\newenvironment{instr}{\\color{instr}}{\\normalcolor}\n" + + "\\newenvironment{gtxtab}{\\color{tab}}{\\normalcolor}\n"; + + myTeXFile = myTeXFile + "\\newcommand{\\gtxchordsize}{\\footnotesize}\n" + + "\\setlength{\\parindent}{0pt}\n" + + "\\sloppy\n" + + "\\setlength{\\unitlength}{1mm}\n" + + "\\newcommand{\\gtxchord}[2]{\\sbox{\\gtxchordbox}{#1}\\sbox{\\textbox}{#2}%\n" + + "\\ifthenelse{\\lengthtest{\\wd\\textbox>\\wd\\gtxchordbox}}%\n" + + "{%\n" + + "\\raisebox{2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#1}}#2%\n" + + "}{%\n" + + "\\raisebox{2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#1}}\\makebox[\\wd\\gtxchordbox+0.5em][l]{#2}%\n" + + "}%\n" + + "}%\n" + + "\\newcommand{\\guitartab}{%\n" + + "\\makebox[0cm][l]{\\raisebox{12.5ex}{\\footnotesize{e}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{10.5ex}{\\footnotesize{H}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{8.5ex}{\\footnotesize{G}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{6.5ex}{\\footnotesize{D}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{4.5ex}{\\footnotesize{A}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{2.5ex}{\\footnotesize{E}}}%\n" + + "~~\n" + + "\\makebox[0cm][l]{\\raisebox{13ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{11ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{9ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{7ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{5ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{3ex}{\\line(1,0){130}}}%\n" + + "~}\n\n" + + "\\newcommand{\\basstab}{%\n" + + "\\makebox[0cm][l]{\\raisebox{8.5ex}{\\footnotesize{G}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{6.5ex}{\\footnotesize{D}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{4.5ex}{\\footnotesize{A}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{2.5ex}{\\footnotesize{E}}}%\n" + + "~~\n" + + "\\makebox[0cm][l]{\\raisebox{9ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{7ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{5ex}{\\line(1,0){130}}}%\n" + + "\\makebox[0cm][l]{\\raisebox{3ex}{\\line(1,0){130}}}%\n" + + "~}\n\n" + + "\\newcommand{\\gtxtabs}[2]{\\makebox[0cm][l]{\\raisebox{#1}{#2}}}\n" + + // define arrow symbols for harp tunes + "\\newcommand{\\hdraw}{\n" + + " \\begin{picture}(0,0)\n" + + " \\put(0,2.5){\\vector(0,-1){3}}\n" + + " \\end{picture}\n" + + "}\n" + + "\n" + + "\\newcommand{\\hblow}{\n" + + " \\begin{picture}(0,0)\n" + + " \\put(0,-0.5){\\vector(0,1){3}}\n" + + " \\end{picture}\n" + + "}\n" + + "\n" + + "\\newcommand{\\hdrawh}{\n" + + " \\begin{picture}(0,0)\n" + + " \\put(0,2.5){\\line(0,-1){1.5}}\n" + + "% \\put(0,1){\\line(-1,-1){1.5}}\n" + + "% \\put(0,1){\\vector(-1,-1){2}}\n" + + " \\put(0,1){\\vector(-1,-1){1}}\n" + + " \\end{picture}\n" + + "}\n" + + "\n" + + "\\newcommand{\\hdrawhh}{\n" + + " \\begin{picture}(0,0)\n" + + " \\put(0,2.5){\\line(0,-1){1.5}}\n" + + " \\put(0,1){\\vector(-1,0){1.5}}\n" + + " \\end{picture}\n" + + "}\n" + + "\n" + + "\\newcommand{\\hdrawhhh}{\n" + + " \\begin{picture}(0,0)\n" + + " \\put(0,2.5){\\line(0,-1){2}}\n" + + " \\put(0,0.5){\\vector(-1,1){1}}\n" + + " \\end{picture}\n" + + "}\n" + + "\n" + + "\\newcommand{\\combichord}[3]{\\sbox{\\gtxchordbox}{#1}\\sbox{\\textbox}{#3}\\sbox{\\harpbox}{#2}%\n" + + "\\ifthenelse{\\lengthtest{\\wd\\textbox>\\wd\\gtxchordbox}\\and\\lengthtest{\\wd\\textbox>\\wd\\harpbox}}{%\n" + + "\\raisebox{2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#1}}\\raisebox{-2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#2}}#3%\n" + + "}{%\n" + + "\\ifthenelse{\\lengthtest{\\wd\\harpbox>\\wd\\textbox}\\and\\lengthtest{\\wd\\harpbox>\\wd\\gtxchordbox}}{%\n" + + "\\raisebox{2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#1}}\\raisebox{-2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#2}}\\makebox[\\wd\\harpbox]{#3}%\n" + + "}{%\n" + + "\\raisebox{2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#1}}\\raisebox{-2ex}[2ex][2.5ex]{\\makebox[0pt][l]{\\scriptsize\\bf#2}}\\makebox[\\wd\\gtxchordbox]{#3}%\n" + + "}}}%\n"; + + // Dokument - Start + myTeXFile = myTeXFile + "\\begin{document}\n" + + "\\newsavebox{\\gtxchordbox}\n" + + "\\newsavebox{\\textbox}\n" + + "\\newsavebox{\\harpbox}\n" + + "\\fancyhead\n" + + "\\fancyfoot\n" + + "\\maketitle\n" + + "\\tableofcontents\n" + + "\\fancyhead[CE]{\\calligra{" + mBookTitle + "}}\n" + + "\\fancyhead[LE,RO]{\\thepage}"; + + // Dokument - Songs + myTeXFile = myTeXFile + mMultipleSongs; + + // Dokument - End + myTeXFile = myTeXFile + "\\backmatter\n" + + "\\printindex\n" + + "\\end{document}\n"; + + return 0; + } + + private void printChars(String inString) { + int actChar; + for (int i = 0; i < inString.length(); i++) { + actChar = inString.charAt(i); + System.out.print(actChar + " "); + } + System.out.println("\n"); + } +} diff --git a/src/guitartex2/GTXTextConsole.java b/src/guitartex2/GTXTextConsole.java new file mode 100644 index 0000000..de60492 --- /dev/null +++ b/src/guitartex2/GTXTextConsole.java @@ -0,0 +1,12 @@ +package guitartex2; + +class GTXTextConsole { + public GTXTextConsole() { + + }; + + public void addText(String text) { + System.out.println(text); + } + +} \ No newline at end of file diff --git a/src/guitartex2/GuitarTeX2.java b/src/guitartex2/GuitarTeX2.java new file mode 100644 index 0000000..eef95b2 --- /dev/null +++ b/src/guitartex2/GuitarTeX2.java @@ -0,0 +1,1720 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +package guitartex2; + +import java.text.MessageFormat; +import java.util.Date; +import java.util.Locale; +import java.util.Random; +import java.util.ResourceBundle; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Cursor; +import java.awt.Dimension; +import java.awt.Event; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.GridLayout; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.FileWriter; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.net.URL; +import java.nio.charset.Charset; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.ImageIcon; +import javax.swing.InputMap; +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JScrollPane; +import javax.swing.JTabbedPane; +import javax.swing.JTextField; +import javax.swing.JTextPane; +import javax.swing.JToggleButton; +import javax.swing.JToolBar; +import javax.swing.KeyStroke; +import javax.swing.event.DocumentEvent; +import javax.swing.event.DocumentListener; +import javax.swing.text.BadLocationException; +import javax.swing.text.DefaultHighlighter; +import javax.swing.text.Document; +import javax.swing.text.Highlighter; +import javax.swing.text.JTextComponent; +import javax.swing.text.SimpleAttributeSet; + +// Naechster Schritt: +// +// TODO: (1) Direktive (preamble) implementieren +// {preamble:usepackage(fancyheadings)} +// erm�glicht das einbinden von Packeten in den Headerfile +// TODO: (1) Header komplett editierbar machen +// TODO: (2) TeX2PDF Funktion beim Wechseln zur TeX-Vorschau aufrufen +// TODO: (2) Warnmeldung falls der Server nicht erreichbar +// TODO: (3) Formatierung fue Akkorde erlauben +// TODO: (5) Syntax - Highlighting +public class GuitarTeX2 extends JFrame { + + private static final long serialVersionUID = 4527297141114166549L; + + // Highlighter + //private SyntaxHighlighter mSynHighlighter; + //-- Components + private JTabbedPane tabbedPane; + //private JTextArea mEditArea; + private JTextPane mEditArea; + private JTextPane mShowTeXArea; + private JToolBar mActionToolBar; + private JToolBar mChordsToolBar; + private JToolBar mTabsToolBar; + private JToolBar mStructToolBar; + private JToolBar mBookToolBar; + private JToolBar mHarpToolBar; + private JPanel mToolBars; + private JTextField mFretBar; + private AboutBox aboutBox; + private PreferencesBox preferencesBox; + private GTXParser mGTXParser; + + private JButton mNewButton, mOpenButton, mSaveButton, mSaveAsButton; + private JButton mGtx2TeXButton, mTeX2PdfButton; + //private JButton mLatexButton, mDvi2PsButton, mDvi2PdfButton; + private JToggleButton mHarpUp, mHarpDown; + // -- Status + private boolean mFileChanged = false; + private String mActFileName; + + private static JFileChooser mFileChooser = new JFileChooser(System.getProperty("user.home")); + private ResourceBundle resbundle; + + //-- Actions + private Action mNewAction; + private Action mOpenAction; + private Action mSaveAction; + private Action mSaveAsAction; + private Action mPrefAction; + private Action mCopyAction; + private Action mPasteAction; + private Action mGTX2TeXAction; + //private Action mLatexAction; + //private Action mDvi2PsAction; + //private Action mDvi2PdfAction; + private Action mTeX2PdfAction; + private Action mExitAction; + private Action mConsoleAction; + private Action mFAQAction, mShortcutAction; + private Action mAboutAction; + + private Action mOpenTemplateSongAction, mOpenTemplateBookAction; + + private static int gtxWidth; + private static int gtxHeight; + private static int gtxTop; + private static int gtxLeft; + + private String mCopyBuffer; + + private Configurations myConf; + //private GTXClient gtxClient; + private int id; + + private GTXConsole consoleBox; + private StatusBox myStatusBox; + +// int a = Rnd(); + // TODO: .gtx - Datei durch Doppelclick in Windows/Mac OS �ffnen + //===================================================================== main + public static void main(String[] args) { + String help = "Usage: \n" + + " GuitarTeX2 -h help (this screen)\n" + + " GuitarTeX2 -o open a gtx file" + + "\n"; + + if (args.length != 0) { + for (int i = 0; i < args.length; i++) { + if (args[i].equals("--help") || args[i].equals("-help") || args[i].equals("-h") || args[i].equals("--h")) { + System.out.println(help); + System.exit(0); + } + /* + if ( args[i].equals("-f") || args[i].equals("--f") || args[i].equals("-file") || args[i].equals("--file") ) { + if ( i+1 < args.length) { + String fileName = args[i+1]; + if ( !fileName.equals("")) { + File f = new File(fileName); + if ( f.canRead() ) { + new GuitarTeX2(f); + }else{ + System.out.println("error: can't read file\n"); + System.out.println(help); + System.exit(1); + } + }else{ + System.out.println(help); + System.exit(1); + } + }else{ + System.out.println("error: no file found\n"); + System.out.println(help); + System.exit(1); + } + }*/ + if (args[i].equals("-o") || args[i].equals("--o") || args[i].equals("-open") || args[i].equals("--open")) { + if (i + 1 < args.length) { + String fileName = args[i + 1]; + if (!fileName.equals("")) { + File f = new File(fileName); + if (f.canRead()) { + GuitarTeX2 openG = new GuitarTeX2(); + openG.openDirectFile(f); + openG.setVisible(true); + } else { + System.out.println("error: can't read file\n"); + System.out.println(help); + System.exit(1); + } + } else { + System.out.println(help); + System.exit(1); + } + } else { + System.out.println("error: no file found\n"); + System.out.println(help); + System.exit(1); + } + } else { + if (args.length > 0) { + String fileName = args[i]; + if (!fileName.equals("")) { + File f = new File(fileName); + if (f.canRead()) { + GuitarTeX2 openG = new GuitarTeX2(); + openG.openDirectFile(f); + openG.setVisible(true); + } else { + System.out.println("error: can't read file\n"); + System.out.println(help); + System.exit(1); + } + } else { + System.out.println(help); + System.exit(1); + } + } else { + System.out.println("error: no file found\n"); + System.out.println(help); + System.exit(1); + } + } + } + } else { + new GuitarTeX2().setVisible(true); + } + + }//end main + + //============================================================== constructor + public GuitarTeX2() { + SymWindow aSymWindow = new SymWindow(); + this.addWindowListener(aSymWindow); + + mFileChooser.addChoosableFileFilter(new MyFilter()); + + // create Console + consoleBox = new GTXConsole(); + consoleBox.setVisible(false); + + resbundle = ResourceBundle.getBundle("GuitarTeX2strings", Locale.getDefault()); + myConf = new Configurations(consoleBox); + + //myConf.checkConfig(); + if (myConf.checkConfig() == false) { + WarningBox warningBox = new WarningBox(resbundle.getString("confFailed"), myConf.getConfProblems()); + System.err.println("loading configuration failed!"); + } + consoleBox.setGTXClient(myConf); + + createActions(); + this.setContentPane(new contentPanel()); + this.setJMenuBar(createMenuBar()); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + this.setTitle(resbundle.getString("frameConstructor")); + this.pack(); + + //gtxHeight = this.getHeight(); + //gtxWidth = this.getWidth(); + gtxHeight = 650; + gtxWidth = 900; + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + //gtxTop = new Double((screenSize.getHeight()/2) - (gtxHeight/2)).intValue(); + gtxTop = 0; + gtxLeft = new Double((screenSize.getWidth() / 2) - (gtxWidth / 2)).intValue(); + + this.setLocation(gtxLeft, gtxTop); + this.setSize(gtxWidth, gtxHeight); + //this.setSize(850,650); + + GTXClient gtxClient = new GTXClient(myConf.getGtxServer(), myConf.getGtxServerPort()); + gtxClient.setGTXConsole(consoleBox); + int openResult = gtxClient.openConnection(); + if (openResult == 0) { + int connResult = gtxClient.checkServerConnection(); + if (connResult == 0) { + mTeX2PdfButton.setEnabled(true); + mTeX2PdfAction.setEnabled(true); + } + } + gtxClient.closeConnection(); + + // Create StatusBox + myStatusBox = new StatusBox(); + + Random generator = new Random(); + id = generator.nextInt(); + this.mEditArea.requestFocus(); // Set Focus to EditArea + }//end constructor + + public GuitarTeX2(File f) { + /* try { + FileReader reader = new FileReader(f); + // mSynHighlighter = new SyntaxHighlighter(); + // mEditArea = new JTextPane(mSynHighlighter.getDocument()); + //--Scanner scanner = new TextScanner(); + //--mEditArea = new SyntaxHighlighter(24, 80, scanner); + mEditArea = new JTextPane(); + mEditArea.setContentType("text/html"); + mEditArea.read(reader, ""); + + mGTXParser = new GTXParser(mEditArea.getText()); + mGTXParser.convertToTeX(); + System.out.println(mGTXParser.getMyTeXFile()); + } + catch (Exception e) { + System.err.println("File input error:"+e); + } */ + // TODO: Datei oeffnen + } + + public void openDirectFile(File f) { + try { + FileReader reader = new FileReader(f); + mEditArea.read(reader, ""); // Use TextComponent read + mEditArea.getDocument().addDocumentListener(new MyDocumentListener()); + mEditArea.setContentType("text/html"); + mActFileName = f.getName(); + tabbedPane.setTitleAt(0, mActFileName); + //highlight(mEditArea, "a"); + mShowTeXArea.setText(""); + mShowTeXArea.setEnabled(false); + mShowTeXArea.setVisible(false); + mShowTeXArea.setCaretPosition(0); + tabbedPane.setEnabledAt(1, false); + mFileChanged = false; + } catch (IOException ioex) { + System.out.println(ioex); + System.exit(1); + } + } + + class MyFilter extends javax.swing.filechooser.FileFilter { + + @Override + public boolean accept(File file) { + String filename = file.getName(); + return filename.toLowerCase().endsWith(".gtx") || filename.toLowerCase().endsWith(".gtb") || file.isDirectory(); + } + + @Override + public String getDescription() { + return "*.gtx;*.gtb"; + } + } + + ///////////////////////////////////////////////////////// class contentPanel + private class contentPanel extends JPanel { + + private static final long serialVersionUID = -600167277476193108L; + + //========================================================== constructor + contentPanel() { + //-- Create components. + mToolBars = new JPanel(new GridLayout(2, 2)); + JPanel mToolBar1 = new JPanel(new FlowLayout(FlowLayout.LEADING)); + JPanel mToolBar2 = new JPanel(new FlowLayout(FlowLayout.LEADING)); + //mToolBars = new JPanel(new GridBagLayout()); + mActionToolBar = new JToolBar(resbundle.getString("actionToolBar")); + mActionToolBar.setFloatable(false); + // -- // -- New + URL mNewImageURL = GuitarTeX2.class.getResource("images/filenew.png"); + mNewButton = mActionToolBar.add(mNewAction); + mNewButton.setIcon(new ImageIcon(mNewImageURL)); + mNewButton.setText(""); + mNewButton.setToolTipText(resbundle.getString("newItem")); + // -- // -- Open + URL mOpenImageURL = GuitarTeX2.class.getResource("images/fileopen.png"); + mOpenButton = mActionToolBar.add(mOpenAction); + mOpenButton.setIcon(new ImageIcon(mOpenImageURL)); + mOpenButton.setText(""); + mOpenButton.setToolTipText(resbundle.getString("openItem")); + // -- // -- Save + URL mSaveImageURL = GuitarTeX2.class.getResource("images/filesave.png"); + mSaveButton = mActionToolBar.add(mSaveAction); + mSaveButton.setIcon(new ImageIcon(mSaveImageURL)); + mSaveButton.setText(""); + mSaveButton.setToolTipText(resbundle.getString("saveItem")); + // -- // -- SaveAs + URL mSaveAsImageURL = GuitarTeX2.class.getResource("images/filesaveas.png"); + mSaveAsButton = mActionToolBar.add(mSaveAsAction); + mSaveAsButton.setIcon(new ImageIcon(mSaveAsImageURL)); + mSaveAsButton.setText(""); + mSaveAsButton.setToolTipText(resbundle.getString("saveAsItem")); + // -- // -- GTX2TeX + URL mGTX2TeXURL = GuitarTeX2.class.getResource("images/gtx2tex.png"); + mGtx2TeXButton = mActionToolBar.add(mGTX2TeXAction); + mGtx2TeXButton.setIcon(new ImageIcon(mGTX2TeXURL)); + mGtx2TeXButton.setText(""); + mGtx2TeXButton.setToolTipText(resbundle.getString("gtx2tex")); + // -- // -- LaTeX + //URL mLatexURL = GuitarTeX2.class.getResource("images/latex.png"); + //mLatexButton = mActionToolBar.add(mLatexAction); + //mLatexButton.setIcon(new ImageIcon(mLatexURL)); + //mLatexButton.setText(""); + //mLatexButton.setToolTipText(resbundle.getString("latex")); + //mLatexButton.setEnabled(false); + // -- // -- DVI2PS + //URL mDvi2PsURL = GuitarTeX2.class.getResource("images/dvips.png"); + //mDvi2PsButton = mActionToolBar.add(mDvi2PsAction); + //mDvi2PsButton.setIcon(new ImageIcon(mDvi2PsURL)); + //mDvi2PsButton.setText(""); + //mDvi2PsButton.setToolTipText(resbundle.getString("dvi2ps")); + //mDvi2PsButton.setEnabled(false); + // -- // -- DVI2PDF + //URL mDvi2PdfURL = GuitarTeX2.class.getResource("images/dvipdf.png"); + //mDvi2PdfButton = mActionToolBar.add(mDvi2PdfAction); + //mDvi2PdfButton.setIcon(new ImageIcon(mDvi2PdfURL)); + //mDvi2PdfButton.setText(""); + //mDvi2PdfButton.setToolTipText(resbundle.getString("dvi2pdf")); + //mDvi2PdfButton.setEnabled(false); + // -- // -- TEX2PDF + URL mTeX2PdfURL = GuitarTeX2.class.getResource("images/tex2pdf.png"); + mTeX2PdfButton = mActionToolBar.add(mTeX2PdfAction); + mTeX2PdfButton.setIcon(new ImageIcon(mTeX2PdfURL)); + mTeX2PdfButton.setText(""); + mTeX2PdfButton.setToolTipText(resbundle.getString("tex2pdf")); + mTeX2PdfButton.setEnabled(false); + + mEditArea = new JTextPane(); + mEditArea.setContentType("text/plain"); + // Bugfix to change char encoding for JTextArea + mEditArea.setText("Initialize UTF8 Br\u00E2ncu\u015Fi"); + mEditArea.setText(""); + mEditArea.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); + mEditArea.setFont(new Font("monospaced", Font.PLAIN, 14)); + mEditArea.getDocument().addDocumentListener(new MyDocumentListener()); + + mChordsToolBar = new JToolBar(resbundle.getString("chordsToolBar")); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneA")), KeyEvent.VK_A)); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneAs")))); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneH")), KeyEvent.VK_H)); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneC")), KeyEvent.VK_C)); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneCis")))); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneD")), KeyEvent.VK_D)); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneDis")))); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneE")), KeyEvent.VK_E)); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneF")), KeyEvent.VK_F)); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneFis")))); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneG")), KeyEvent.VK_G)); + mChordsToolBar.add(createChordButton(new mChordButtonClass(resbundle.getString("mToneGis")))); + + mTabsToolBar = new JToolBar(resbundle.getString("tabsToolBar")); + mTabsToolBar.add(new mStructButtonClass(resbundle.getString("mGuitarTab"))); + mFretBar = new JTextField(5); + mFretBar.setMaximumSize(new Dimension(27, 27)); + mTabsToolBar.add(mFretBar); + mTabsToolBar.add(new mNoteButtonClass(resbundle.getString("mToneE"))); + mTabsToolBar.add(new mNoteButtonClass(resbundle.getString("mToneA"))); + mTabsToolBar.add(new mNoteButtonClass(resbundle.getString("mToneD"))); + mTabsToolBar.add(new mNoteButtonClass(resbundle.getString("mToneG"))); + mTabsToolBar.add(new mNoteButtonClass(resbundle.getString("mToneH"))); + mTabsToolBar.add(new mNoteButtonClass(resbundle.getString("mTonee"))); + mTabsToolBar.addSeparator(); + mTabsToolBar.add(new mNoteStringButtonClass("&")); + mTabsToolBar.add(new mNoteStringButtonClass("_")); + mTabsToolBar.add(new mNoteStringButtonClass("|")); + + mHarpToolBar = new JToolBar(resbundle.getString("harpToolBar")); + //mHarpToolBar.setLayout(new GridLayout(2,9)); + ImageIcon upButtonIcon = createImageIcon("images/icon-up2.png"); + ImageIcon downButtonIcon = createImageIcon("images/icon-down2.png"); + mHarpUp = new JToggleButton(upButtonIcon); + Action pmUpAction = new mPMHarpActionClass("up"); + mHarpUp.addActionListener(pmUpAction); + mHarpUp.setSelected(true); + InputMap inputMap = mEditArea.getInputMap(); + KeyStroke keyUp = KeyStroke.getKeyStroke(KeyEvent.VK_U, Event.CTRL_MASK); + inputMap.put(keyUp, pmUpAction); + + mHarpDown = new JToggleButton(downButtonIcon); + Action pmDownAction = new mPMHarpActionClass("down"); + mHarpDown.addActionListener(pmDownAction); + KeyStroke keyDown = KeyStroke.getKeyStroke(KeyEvent.VK_J, Event.CTRL_MASK); + inputMap.put(keyDown, pmDownAction); + + JPanel pm = new JPanel(); + pm.setLayout(new GridLayout(2, 1, 0, 0)); + pm.setPreferredSize(new Dimension(18, 6)); + pm.add(mHarpUp); + pm.add(mHarpDown); + mHarpToolBar.add(pm); + mHarpToolBar.add(createHarpButton(new mHarpButtonClass(resbundle.getString("mHarpTone1")), KeyEvent.VK_1)); + mHarpToolBar.add(createHarpButton(new mHarpButtonClass(resbundle.getString("mHarpTone2")), KeyEvent.VK_2)); + mHarpToolBar.add(createHarpButton(new mHarpButtonClass(resbundle.getString("mHarpTone3")), KeyEvent.VK_3)); + mHarpToolBar.add(createHarpButton(new mHarpButtonClass(resbundle.getString("mHarpTone4")), KeyEvent.VK_4)); + mHarpToolBar.add(createHarpButton(new mHarpButtonClass(resbundle.getString("mHarpTone5")), KeyEvent.VK_5)); + mHarpToolBar.add(createHarpButton(new mHarpButtonClass(resbundle.getString("mHarpTone6")), KeyEvent.VK_6)); + mHarpToolBar.add(createHarpButton(new mHarpButtonClass(resbundle.getString("mHarpTone7")), KeyEvent.VK_7)); + mHarpToolBar.add(createHarpButton(new mHarpButtonClass(resbundle.getString("mHarpTone8")), KeyEvent.VK_8)); + mHarpToolBar.add(createHarpButton(new mHarpButtonClass(resbundle.getString("mHarpTone9")), KeyEvent.VK_9)); + mHarpToolBar.add(createHarpButton(new mHarpButtonClass(resbundle.getString("mHarpTone10")), KeyEvent.VK_0)); + + mStructToolBar = new JToolBar(resbundle.getString("structToolBar")); + mStructToolBar.add(new mStructButtonClass(resbundle.getString("mLanguage"))); + mStructToolBar.add(new mStructButtonClass(resbundle.getString("mTitle"))); + mStructToolBar.add(new mStructButtonClass(resbundle.getString("mSubtitle"))); + mStructToolBar.add(new mStructButtonClass(resbundle.getString("mBold"))); + mStructToolBar.add(new mStructButtonClass(resbundle.getString("mBridge"))); + mStructToolBar.add(new mStructButtonClass(resbundle.getString("mChorus"))); + + mBookToolBar = new JToolBar(resbundle.getString("mBookToolBar")); + mBookToolBar.add(new mBookToolBarClass(resbundle.getString("mSetBook"))); + mBookToolBar.add(new mBookToolBarClass(resbundle.getString("mBookAuthor"))); + mBookToolBar.add(new mBookToolBarClass(resbundle.getString("mBookTitle"))); + mBookToolBar.add(new mBookToolBarClass(resbundle.getString("mBookDate"))); + mBookToolBar.add(new mBookToolBarClass(resbundle.getString("mBookInclude"))); + + String[] languageStrings = {"english", "usenglishmax", "dumylang", + "nohyphenation", "arabic", "farsi", "croatian", "ukrainian", + "russian", "bulgarian", "czech", "slovak", "danish", "dutch", + "finnish", "basque", "french", "german", "ngerman", "ibycus", + "greek", "monogreek", "ancientgreek", "hungarian", "italian", + "latin", "mongolian", "norsk", "icelandic", "interlingua", + "turkish", "coptic", "romanian", "welsh", "serbian", "slovenian", + "estonian", "esperanto", "uppersorbian", "indonesian", "polish", + "portuguese", "spanish", "catalan", "galician", "swedish", "ukenglish"}; + java.util.Arrays.sort(languageStrings); + + // TODO: Syntax Highlight + //mSynHighlighter = new SyntaxHighlighter(); + //mEditArea = new JTextPane(mSynHighlighter.getDocument()); + //--Scanner scanner = new TextScanner(); + //--mEditArea = new SyntaxHighlighter(24,80, scanner); + mShowTeXArea = new JTextPane(); + mShowTeXArea.setContentType("text/plain"); + // Bugfix to change char encoding for JTextArea + mShowTeXArea.setText("Initialize UTF8 Br\u00E2ncu\u015Fi"); + mShowTeXArea.setText(""); + mShowTeXArea.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); + mShowTeXArea.setFont(new Font("monospaced", Font.PLAIN, 14)); + mShowTeXArea.setEditable(false); + + //mShowTeXArea.setBorder(BorderFactory.createEmptyBorder(2,2,2,2)); + //mShowTeXArea.setFont(new Font("monospaced", Font.PLAIN, 14)); + //mShowTeXArea.setEditable(false); + //mShowTeXArea.setVisible(false); + JScrollPane scrollingEditArea = new JScrollPane(mEditArea); + JScrollPane scrollingShowTeXArea = new JScrollPane(mShowTeXArea); + + tabbedPane = new JTabbedPane(); + tabbedPane.addTab(resbundle.getString("mNewFile"), scrollingEditArea); + tabbedPane.addTab(resbundle.getString("mShowTeXArea"), scrollingShowTeXArea); + tabbedPane.setEnabledAt(1, false); + + //JScrollPane scrollingText = new JScrollPane(tabbedPane); + mToolBar1.add(mActionToolBar); + mToolBar1.add(mChordsToolBar); + mToolBar1.add(mTabsToolBar); + mToolBar2.add(mStructToolBar); + mToolBar2.add(mBookToolBar); + mToolBar2.add(mHarpToolBar); + mToolBars.add(mToolBar1); + mToolBars.add(mToolBar2); + + /* + mActionToolBar.setFloatable(false); + mTabsToolBar.setFloatable(false); + mChordsToolBar.setFloatable(false); + mStructToolBar.setFloatable(false); + mBookToolBar.setFloatable(false); + mHarpToolBar.setFloatable(false); + mToolBars.add(mActionToolBar, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, + GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0)); + mToolBars.add(mStructToolBar, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, + GridBagConstraints.BOTH, new Insets(0, 0, 0, 5), 0, 0)); + mToolBars.add(mChordsToolBar, new GridBagConstraints(2, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, + GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); + mToolBars.add(mTabsToolBar, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, + GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); + mToolBars.add(mBookToolBar, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, + GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); + mToolBars.add(mHarpToolBar, new GridBagConstraints(3, 0, 1, 2, 0.0, 0.0, GridBagConstraints.WEST, + GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); */ + //-- Do layout + this.setLayout(new BorderLayout()); + this.add(mToolBars, BorderLayout.PAGE_START); + this.add(tabbedPane, BorderLayout.CENTER); + /* + this.setLayout(new GridLayout(2,1)); + this.add(mToolBars); + this.add(tabbedPane); + */ + }//end constructor + }//end class contentPanel + + /** + * Returns an ImageIcon, or null if the path was invalid. + * + * @param path + * @return + */ + public ImageIcon createImageIcon(String path) { + java.net.URL imgURL = GuitarTeX2.class.getResource(path); + if (imgURL != null) { + return new ImageIcon(imgURL); + } else { + consoleBox.addText("Couldn't find file: " + path); + return null; + } + } + + private JButton createChordButton(Action aButton, int keyEvent) { + InputMap inputMap = mEditArea.getInputMap(); + KeyStroke key = KeyStroke.getKeyStroke(keyEvent, Event.CTRL_MASK); + inputMap.put(key, aButton); + + JButton chord = new JButton(aButton); + //chord.setMnemonic(keyEvent); + return chord; + } + + private JButton createChordButton(Action aButton) { + JButton chord = new JButton(aButton); + return chord; + } + + private JButton createHarpButton(Action hButton, int keyEvent) { + InputMap inputMap = mEditArea.getInputMap(); + KeyStroke key = KeyStroke.getKeyStroke(keyEvent, Event.CTRL_MASK); + inputMap.put(key, hButton); + + JButton chord = new JButton(hButton); + //chord.setMnemonic(keyEvent); + return chord; + } + + //============================================================ createMenuBar + /** + * Utility function to create a menubar. + */ + private JMenuBar createMenuBar() { + JMenuBar menuBar = new JMenuBar(); + JMenu fileMenu = menuBar.add(new JMenu(resbundle.getString("fileMenu"))); + fileMenu.add(mNewAction); + fileMenu.add(mOpenAction); + fileMenu.add(mSaveAction); + fileMenu.add(mSaveAsAction); + fileMenu.addSeparator(); + + JMenu templateMenu = new JMenu(resbundle.getString("templateItem")); + templateMenu.add(mOpenTemplateSongAction); + templateMenu.add(mOpenTemplateBookAction); + fileMenu.add(templateMenu); + + fileMenu.addSeparator(); + fileMenu.add(mExitAction); + JMenu editMenu = menuBar.add(new JMenu(resbundle.getString("editMenu"))); + editMenu.add(mCopyAction); + editMenu.add(mPasteAction); + editMenu.addSeparator(); + editMenu.add(mPrefAction); + JMenu buildMenu = menuBar.add(new JMenu(resbundle.getString("buildMenu"))); + buildMenu.add(mGTX2TeXAction); + //buildMenu.add(mLatexAction); + //buildMenu.add(mDvi2PsAction); + //buildMenu.add(mDvi2PdfAction); + buildMenu.add(mTeX2PdfAction); + mTeX2PdfAction.setEnabled(false); + + JMenu helpMenu = menuBar.add(new JMenu(resbundle.getString("helpMenu"))); + helpMenu.add(mConsoleAction); + helpMenu.add(mFAQAction); + helpMenu.add(mShortcutAction); + helpMenu.add(mAboutAction); + return menuBar; + }//end createMenuBar + + //============================================================ createActions + /** + * Utility function to define actions. + */ + private void createActions() { + mActFileName = resbundle.getString("mNewFile"); + int shortcutKeyMask = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask(); + + mNewAction = new newActionClass(resbundle.getString("newItem"), + KeyStroke.getKeyStroke(KeyEvent.VK_N, shortcutKeyMask)); + + mOpenAction = new openActionClass(resbundle.getString("openItem"), + KeyStroke.getKeyStroke(KeyEvent.VK_O, shortcutKeyMask)); + + mOpenTemplateSongAction = new openActionClass(resbundle.getString("simpleSong")); + mOpenTemplateBookAction = new openActionClass(resbundle.getString("simpleBook")); + + mSaveAction = new saveActionClass(resbundle.getString("saveItem"), + KeyStroke.getKeyStroke(KeyEvent.VK_S, shortcutKeyMask)); + + mSaveAsAction = new saveAsActionClass(resbundle.getString("saveAsItem")); + + mCopyAction = new copyActionClass(resbundle.getString("copyItem"), + KeyStroke.getKeyStroke(KeyEvent.VK_C, shortcutKeyMask)); + mPasteAction = new pasteActionClass(resbundle.getString("pasteItem"), + KeyStroke.getKeyStroke(KeyEvent.VK_V, shortcutKeyMask)); + mPrefAction = new prefActionClass(resbundle.getString("mPrefs")); + + mGTX2TeXAction = new gtx2texActionClass(resbundle.getString("gtx2tex")); + //mLatexAction = new latexActionClass ( resbundle.getString("latex")); + //mDvi2PsAction = new dvi2psActionClass ( resbundle.getString("dvi2ps")); + //mDvi2PdfAction = new dvi2pdfActionClass ( resbundle.getString("dvi2pdf")); + mTeX2PdfAction = new tex2pdfActionClass(resbundle.getString("tex2pdf")); + + mConsoleAction = new consoleActionClass(resbundle.getString("consoleItem")); + + mFAQAction = new faqActionClass(resbundle.getString("faqItem")); + + mShortcutAction = new shortcutActionClass(resbundle.getString("shortcutItem")); + + mAboutAction = new aboutActionClass(resbundle.getString("aboutItem")); + + mExitAction = new exitActionClass(resbundle.getString("exitItem"), + KeyStroke.getKeyStroke(KeyEvent.VK_Q, shortcutKeyMask)); + + }//end createActions + + GTXConsole getConsole() { + return consoleBox; + } + + public class copyActionClass extends AbstractAction { + + private static final long serialVersionUID = 6027334751848561316L; + + public copyActionClass(String text, KeyStroke shortcut) { + super(text); + putValue(ACCELERATOR_KEY, shortcut); + } + + @Override + public void actionPerformed(ActionEvent e) { + mCopyBuffer = mEditArea.getSelectedText(); + } + } + + public class pasteActionClass extends AbstractAction { + + private static final long serialVersionUID = 7204847877754106290L; + + public pasteActionClass(String text, KeyStroke shortcut) { + super(text); + putValue(ACCELERATOR_KEY, shortcut); + } + + @Override + public void actionPerformed(ActionEvent e) { + try { + mEditArea.getDocument().insertString(mEditArea.getCaretPosition(), mCopyBuffer, new SimpleAttributeSet()); + } catch (Exception f) { + consoleBox.addText("ERR: Paste failed: " + f); + } + } + } + + // Action-Class + public class newActionClass extends AbstractAction { + + private static final long serialVersionUID = -2269873789000630887L; + + public newActionClass(String text, KeyStroke shortcut) { + super(text); + putValue(ACCELERATOR_KEY, shortcut); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (mFileChanged == true) { + int n = JOptionPane.showConfirmDialog( + GuitarTeX2.this, + resbundle.getString("mSaveQuestion"), + resbundle.getString("mSaveQuestionHead"), + JOptionPane.YES_NO_OPTION); + // n: 0 == yes + // 1 == no + // -1 == window closed + if (n == 0) { + if (mActFileName.equalsIgnoreCase(resbundle.getString("mNewFile"))) { + mSaveAsAction.actionPerformed(e); + adjustAllSettings(); + } else { + mSaveAction.actionPerformed(e); + adjustAllSettings(); + } + } else if (n == 1) { + adjustAllSettings(); + } + } else { + adjustAllSettings(); + } + } + + private void adjustAllSettings() { + String newTemplate = "{language: english }\n\n" + + "{title: Title}\n" + + "{subtitle: Subtitle}\n\n" + + "{a: Bla Fasel Bla}\n" + + "{bridge}\n" + + " [B]Lin[E]e1\n" + + " Line2\n" + + " Line3\n" + + "{/bridge}\n\n" + + "{a: Text2}\n" + + "{chorus}\n" + + " Line1\n" + + " [C]CLin[e]e2\n" + + " CLine3\n" + + "{/chorus}\n"; + mActFileName = resbundle.getString("mNewFile"); + mEditArea.setText(newTemplate); + tabbedPane.setTitleAt(0, resbundle.getString("mNewFile")); + mFileChooser.setSelectedFile(null); + mEditArea.requestFocus(); + mShowTeXArea.setText(""); + mShowTeXArea.setEnabled(false); + mShowTeXArea.setVisible(false); + mShowTeXArea.setCaretPosition(0); + tabbedPane.setEnabledAt(1, false); + mFileChanged = false; + } + } + + public class openActionClass extends AbstractAction { + + private static final long serialVersionUID = -6230238426866087448L; + + public openActionClass(String text, KeyStroke shortcut) { + super(text); + putValue(ACCELERATOR_KEY, shortcut); + } + + public openActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + String fileName = ""; + if (e.getActionCommand().equals(resbundle.getString("simpleSong"))) { + fileName = myConf.getSongTemplate(); + } + if (e.getActionCommand().equals(resbundle.getString("simpleBook"))) { + fileName = myConf.getBookTemplate(); + } + if (mFileChanged == true) { + int n = JOptionPane.showConfirmDialog( + GuitarTeX2.this, + resbundle.getString("mSaveQuestion"), + resbundle.getString("mSaveQuestionHead"), + JOptionPane.YES_NO_OPTION); + // n: 0 == yes + // 1 == no + // -1 == window closed + if (n == 0) { + if (mActFileName.equalsIgnoreCase(resbundle.getString("mNewFile"))) { + mSaveAsAction.actionPerformed(e); + if (fileName.equals("")) { + openFile(); + } else { + openFile(fileName); + } + } else { + mSaveAction.actionPerformed(e); + if (fileName.equals("")) { + openFile(); + } else { + openFile(fileName); + } + } + } else if (n == 1) { + if (fileName.equals("")) { + openFile(); + } else { + openFile(fileName); + } + } + } else { + if (fileName.equals("")) { + openFile(); + } else { + openFile(fileName); + } + } + + } + + private void openFile() { + int retval = mFileChooser.showOpenDialog(GuitarTeX2.this); + if (retval == JFileChooser.APPROVE_OPTION) { + File f = mFileChooser.getSelectedFile(); + try { + FileInputStream fis = new FileInputStream(f); + //InputStreamReader in = + // new InputStreamReader(fis, Charset.forName("UTF-8")); + // char[] buffer = new char[1024]; + // int n = in.read(buffer); + // String text = new String(buffer, 0, n); + //String text = ""; + //String encoding = ; + mEditArea.read(new UnicodeReader(fis, "UTF-8"), ""); + mEditArea.getDocument().addDocumentListener(new MyDocumentListener()); + //mEditArea.setText(text); + //in.close(); + + mActFileName = f.getName(); + tabbedPane.setTitleAt(0, mActFileName); + //highlight(mEditArea, "a"); + mShowTeXArea.setText(""); + mShowTeXArea.setEnabled(false); + mShowTeXArea.setVisible(false); + mShowTeXArea.setCaretPosition(0); + tabbedPane.setEnabledAt(1, false); + mFileChanged = false; + } catch (IOException ioex) { + consoleBox.addText("ERR: " + ioex); + InfoBox infoBox = new InfoBox("Error: " + ioex); + } + } + } + + private void openFile(String fileName) { + File f = new File(fileName); + try { + FileInputStream fis = new FileInputStream(f); + mEditArea.read(new UnicodeReader(fis, "UTF-8"), ""); + mEditArea.getDocument().addDocumentListener(new MyDocumentListener()); + mActFileName = f.getName(); + tabbedPane.setTitleAt(0, mActFileName); + mShowTeXArea.setText(""); + mShowTeXArea.setEnabled(false); + mShowTeXArea.setVisible(false); + mShowTeXArea.setCaretPosition(0); + tabbedPane.setEnabledAt(1, false); + mFileChanged = false; + } catch (IOException ioex) { + consoleBox.addText("ERR: " + ioex); + InfoBox infoBox = new InfoBox("Error: " + ioex); + } + } + } + + public class closeActionClass extends AbstractAction { + + private static final long serialVersionUID = 5462192874364430698L; + + public closeActionClass(String text, KeyStroke shortcut) { + super(text); + putValue(ACCELERATOR_KEY, shortcut); + } + + @Override + public void actionPerformed(ActionEvent e) { + consoleBox.addText("Close..."); + } + } + + public class saveActionClass extends AbstractAction { + + private static final long serialVersionUID = -6554665572883956365L; + + public saveActionClass(String text, KeyStroke shortcut) { + super(text); + putValue(ACCELERATOR_KEY, shortcut); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (mActFileName.equalsIgnoreCase(resbundle.getString("mNewFile"))) { + mSaveAsAction.actionPerformed(e); + } else { + File f = mFileChooser.getSelectedFile(); + try { + FileOutputStream fos + = new FileOutputStream(f); + try (OutputStreamWriter out = new OutputStreamWriter(fos, Charset.forName("UTF-8"))) { + out.write(mEditArea.getText()); + } + mFileChanged = false; + mActFileName = f.getName(); + tabbedPane.setTitleAt(0, mActFileName); + mEditArea.requestFocus(); + } catch (IOException ioex) { + consoleBox.addText("ERR: " + ioex); + } + } + } + } + + public class saveAsActionClass extends AbstractAction { + + private static final long serialVersionUID = 5317474925638206873L; + + public saveAsActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + int retval = mFileChooser.showSaveDialog(GuitarTeX2.this); + if (retval == JFileChooser.APPROVE_OPTION) { + File f = mFileChooser.getSelectedFile(); + try { + FileOutputStream fos + = new FileOutputStream(f); + try (OutputStreamWriter out = new OutputStreamWriter(fos, Charset.forName("UTF-8"))) { + out.write(mEditArea.getText()); + } + mFileChanged = false; + mActFileName = f.getName(); + tabbedPane.setTitleAt(0, mActFileName); + mEditArea.requestFocus(); + } catch (IOException ioex) { + consoleBox.addText("ERR: " + ioex); + } + } + } + } + + public class gtx2texActionClass extends AbstractAction { + + private static final long serialVersionUID = -1997688375883172485L; + + public gtx2texActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + Cursor hourglassCursor = new Cursor(Cursor.WAIT_CURSOR); + setCursor(hourglassCursor); + convertToTeX(); + Cursor normalCursor = new Cursor(Cursor.DEFAULT_CURSOR); + setCursor(normalCursor); + } + + private void convertToTeX() { + mGTXParser = new GTXParser(mEditArea.getText()); + mGTXParser.convertToTeX(); + mShowTeXArea.setText(mGTXParser.getMyTeXFile()); + mShowTeXArea.setEnabled(true); + mShowTeXArea.setVisible(true); + mShowTeXArea.setCaretPosition(0); + tabbedPane.setEnabledAt(1, true); + + // Wird spaeter wieder einkommentiert + //mLatexButton.setEnabled(true); + } + } + + public class latexActionClass extends AbstractAction { + + private static final long serialVersionUID = -1834935499825164201L; + + public latexActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (mShowTeXArea.isEnabled()) { + CmdExec latex = new CmdExec(); + File g = new File("/tmp/gtx2/lied1.tex"); + + try { + try (FileWriter writer = new FileWriter(g)) { + mShowTeXArea.write(writer); + } + } catch (Exception exc) { + System.out.println("ERR: Konnte die Datei nicht schreiben!" + exc); + } + System.out.println("Starte DVI-Anzeigeprogramm"); +// String actDir = System.getProperty("user.dir"); + latex.execute("/usr/bin/latex /tmp/gtx2/lied1.tex"); + latex.execute("/usr/bin/xdvi lied1.dvi"); + + //latex.execute("cd /tmp/guitartex2/"); + //File tmpDir = new File(mPrefResbundle.getString("tmpPath")); + //latex.execute("cd " + mPrefResbundle.getString("tmpPath")); + //latex.execute(mPrefResbundle.getString("latex") + " /tmp/guitartex2/lied1.tex"); + //latex.execute("cd " + actDir); + } + } + } + + /* + public class dvi2psActionClass extends AbstractAction { + private static final long serialVersionUID = -157869873861617802L; + + public dvi2psActionClass (String text) { + super(text); + } + + public void actionPerformed (ActionEvent e) { + System.out.println("dvi2ps"); + } + } + + public class dvi2pdfActionClass extends AbstractAction { + private static final long serialVersionUID = 3203633393288039244L; + + public dvi2pdfActionClass (String text) { + super(text); + } + + public void actionPerformed (ActionEvent e) { + System.out.println("dvi2pdf"); + } + } + */ + public class tex2pdfActionClass extends AbstractAction { + + private static final long serialVersionUID = 1L; + + public tex2pdfActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + String tmpDir = myConf.getTmpDir(); + String tmpDirPrefix = myConf.getTmpDirPrefix(); + String texFileName = "gtx2pdf" + id + ".tex"; + String pdfFileName = "gtx2pdf" + id + ".pdf"; + + File fd = new File(tmpDir + tmpDirPrefix); + if (fd.isDirectory() == false) { + fd.mkdirs(); + } + File f = new File(tmpDir + tmpDirPrefix + texFileName); + + //myStatusBox.setStatus("waiting..."); + try { + mGTX2TeXAction.actionPerformed(e); + FileOutputStream fos + = new FileOutputStream(f); + try (OutputStreamWriter out = new OutputStreamWriter(fos, Charset.forName("UTF-8"))) { + out.write(mShowTeXArea.getText()); + //if ( mShowTeXArea.isEnabled() ) { + String showPdf = myConf.quoteString(myConf.getPdfViewer()) + " " + myConf.quoteString(tmpDir + tmpDirPrefix + pdfFileName); + GTXClient gtxClient = new GTXClient(myConf.getGtxServer(), myConf.getGtxServerPort(), myStatusBox, tmpDir + tmpDirPrefix + texFileName, id, showPdf); + gtxClient.setGTXConsole(consoleBox); + int openResult = gtxClient.openConnection(); + if (openResult == 0) { + gtxClient.start(); + } + //} + } + } catch (Exception g) { + consoleBox.addText("Can't open tmp-tex file: " + g); + } + } + } + + public class prefActionClass extends AbstractAction { + + private static final long serialVersionUID = -8836756782588688400L; + + public prefActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (preferencesBox == null) { + preferencesBox = new PreferencesBox(myConf, mTeX2PdfButton, mTeX2PdfAction); + } else { + preferencesBox.setEnabled(false); + preferencesBox = new PreferencesBox(myConf, mTeX2PdfButton, mTeX2PdfAction); + } + } + } + + public class consoleActionClass extends AbstractAction { + + private static final long serialVersionUID = -416103244597033152L; + + public consoleActionClass(String title) { + super(title); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (consoleBox == null) { + consoleBox = new GTXConsole(); + consoleBox.setGTXClient(myConf); + } else { + if (!consoleBox.isVisible()) { + consoleBox.setVisible(true); + } + } + } + } + + public class aboutActionClass extends AbstractAction { + + private static final long serialVersionUID = -262614383498345150L; + + public aboutActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (aboutBox == null) { + aboutBox = new AboutBox(); + } else { + if (!aboutBox.isVisible()) { + aboutBox.setVisible(true); + } + } + } + } + + public class faqActionClass extends AbstractAction { + + private static final long serialVersionUID = -4076201863269382621L; + + public faqActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + BareBonesBrowserLaunch.openURL(resbundle.getString("faqURL")); + } + } + + public class shortcutActionClass extends AbstractAction { + + private static final long serialVersionUID = 6535888027666006093L; + + public shortcutActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + BareBonesBrowserLaunch.openURL(resbundle.getString("shortcutsURL")); + } + } + + public class exitActionClass extends AbstractAction { + + private static final long serialVersionUID = -895438436156815591L; + + public exitActionClass(String text, KeyStroke shortcut) { + super(text); + putValue(ACCELERATOR_KEY, shortcut); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (mFileChanged == true) { + int n = JOptionPane.showConfirmDialog( + GuitarTeX2.this, + resbundle.getString("mSaveQuestion"), + resbundle.getString("mSaveQuestionHead"), + JOptionPane.YES_NO_OPTION); + // n: 0 == yes + // 1 == no + // -1 == window closed + if (n == 0) { + if (mActFileName.equalsIgnoreCase(resbundle.getString("mNewFile"))) { + mSaveAsAction.actionPerformed(e); + exitApplication(); + } else { + mSaveAction.actionPerformed(e); + exitApplication(); + } + } else if (n == 1) { + exitApplication(); + } + } else { + exitApplication(); + } + } + + private void exitApplication() { + cleanTmpDirectory(); + System.exit(0); + } + + private void cleanTmpDirectory() { + String tmpDir = myConf.getTmpDir(); + String tmpDirPrefix = myConf.getTmpDirPrefix(); + try { + File[] tempFiles = new File(tmpDir + tmpDirPrefix).listFiles(); + for (File tempFile : tempFiles) { + tempFile.deleteOnExit(); + } + } catch (Exception e) { + consoleBox.addText("Clean temp directory failed: " + e); + System.err.println("clean temp directory failed: " + e); + } + } + } + + // Button-Class + public class mStructButtonClass extends AbstractAction { + + private static final long serialVersionUID = -2160838467602037321L; + + private final String mAction; + + public mStructButtonClass(String text) { + super(text); + mAction = text; + } + + @Override + public void actionPerformed(ActionEvent e) { + String mText = ""; + int orderLength = 0; + int placeHolderLength = 4; + + int nextLine = getNextLine(); + + if (resbundle.getString("mTitle").equals(mAction)) { + mText = "{title: text}"; + orderLength = 8; + } + if (resbundle.getString("mSubtitle").equals(mAction)) { + mText = "{subtitle: text}"; + orderLength = 11; + } + if (resbundle.getString("mBridge").equals(mAction)) { + mText = "{bridge}\ntext\n{/bridge}"; + orderLength = 9; + } + if (resbundle.getString("mChorus").equals(mAction)) { + mText = "{chorus}\ntext\n{/chorus}"; + orderLength = 9; + } + if (resbundle.getString("mBold").equals(mAction)) { + mText = "{a: text}"; + orderLength = 4; + } + if (resbundle.getString("mGuitarTab").equals(mAction)) { + mText = "{guitartab: }"; + orderLength = 12; + placeHolderLength = 0; + } + if (resbundle.getString("mLanguage").equals(mAction)) { + mText = "{language: english }"; + orderLength = 11; + placeHolderLength = 7; + } + try { + mEditArea.getDocument().insertString(nextLine, mText, new SimpleAttributeSet()); + } catch (Exception f) { + consoleBox.addText("ERR: Insert " + mText + "failed" + f); + } + mEditArea.setSelectionStart(nextLine + orderLength); + mEditArea.setSelectionEnd(nextLine + orderLength + placeHolderLength); + mEditArea.requestFocus(); + } + } + + public class mChordButtonClass extends AbstractAction { + + private static final long serialVersionUID = 2329576716672960443L; + + private final String mChord; + + public mChordButtonClass(String text) { + super(text); + mChord = "[" + text + "]"; + } + + @Override + public void actionPerformed(ActionEvent e) { + int pos = mEditArea.getCaretPosition(); + try { + mEditArea.getDocument().insertString(pos, mChord, new SimpleAttributeSet()); + int lastPos = mEditArea.getCaretPosition(); + mEditArea.setCaretPosition(lastPos - 1); + } catch (Exception f) { + consoleBox.addText("ERR: Insert " + mChord + " failed:" + f); + } + mEditArea.requestFocus(); + } + } + + public class mPMHarpActionClass extends AbstractAction { + + private static final long serialVersionUID = 6922439217506544126L; + + private final String button; + + public mPMHarpActionClass(String text) { + super(text); + button = text; + } + + @Override + public void actionPerformed(ActionEvent e) { + if (button.equals("up")) { + mHarpUp.setSelected(true); + mHarpDown.setSelected(false); + } + if (button.equals("down")) { + mHarpDown.setSelected(true); + mHarpUp.setSelected(false); + } + } + } + + public class mHarpButtonClass extends AbstractAction { + + private static final long serialVersionUID = -6793976993294567920L; + + private final String mHarp; + + public mHarpButtonClass(String text) { + super(text); + mHarp = text; + } + + @Override + public void actionPerformed(ActionEvent e) { + char add = '+'; + if (mHarpUp.isSelected()) { + add = '+'; + } + if (mHarpDown.isSelected()) { + add = '-'; + } + String fullHarp = "<" + add + mHarp + ">"; + + int pos = mEditArea.getCaretPosition(); + try { + mEditArea.getDocument().insertString(pos, fullHarp, new SimpleAttributeSet()); + int lastPos = mEditArea.getCaretPosition(); + //mEditArea.setCaretPosition(lastPos - 1 ); + mEditArea.setCaretPosition(lastPos); + } catch (Exception f) { + consoleBox.addText("ERR: Insert " + fullHarp + " failed:" + f); + } + mEditArea.requestFocus(); + } + } + + public class mBookToolBarClass extends AbstractAction { + + private static final long serialVersionUID = -2105845246317719134L; + + String mAction; + + public mBookToolBarClass(String text) { + super(text); + mAction = text; + } + + @Override + public void actionPerformed(ActionEvent e) { + String mText = ""; + int orderLength = 0; + int placeHolderLength = 0; + int nextLine = getNextLine(); + + if (resbundle.getString("mSetBook").equals(mAction)) { + mText = "{document_class:book}"; + } + + if (resbundle.getString("mBookTitle").equals(mAction)) { + mText = "{book_title:title}"; + orderLength = 12; + placeHolderLength = 5; + } + + if (resbundle.getString("mBookAuthor").equals(mAction)) { + mText = "{book_author:author}"; + orderLength = 13; + placeHolderLength = 6; + } + + if (resbundle.getString("mBookDate").equals(mAction)) { + MessageFormat timeMf = new MessageFormat("{0,date,medium}"); + Object[] timeObjs = {new Date(System.currentTimeMillis())}; + mText = "{book_date:" + timeMf.format(timeObjs) + "}"; + } + + if (resbundle.getString("mBookInclude").equals(mAction)) { + int retval = mFileChooser.showOpenDialog(GuitarTeX2.this); + if (retval == JFileChooser.APPROVE_OPTION) { + File f = mFileChooser.getSelectedFile(); + mText = "{include:" + f.getAbsolutePath() + "}"; + orderLength = 9; + } + } + try { + if (orderLength != 0 && placeHolderLength != 0) { + mEditArea.getDocument().insertString(nextLine, mText, new SimpleAttributeSet()); + mEditArea.setSelectionStart(nextLine + orderLength); + mEditArea.setSelectionEnd(nextLine + orderLength + placeHolderLength); + } else { + mEditArea.getDocument().insertString(nextLine, mText, new SimpleAttributeSet()); + } + } catch (Exception f) { + consoleBox.addText("ERR: Insert BookToolBar " + mText + " failed: " + f); + } + mEditArea.requestFocus(); + } + } + + public class mNoteButtonClass extends AbstractAction { + + private static final long serialVersionUID = -2909154433868053689L; + + private String mNote; + private String mFret; + + public mNoteButtonClass(String text) { + super(text); + if (resbundle.getString("mToneE").equals(text)) { + mNote = "1"; + } + if (resbundle.getString("mToneA").equals(text)) { + mNote = "2"; + } + if (resbundle.getString("mToneD").equals(text)) { + mNote = "3"; + } + if (resbundle.getString("mToneG").equals(text)) { + mNote = "4"; + } + if (resbundle.getString("mToneH").equals(text)) { + mNote = "5"; + } + if (resbundle.getString("mTonee").equals(text)) { + mNote = "6"; + } + } + + @Override + public void actionPerformed(ActionEvent e) { + // Fret holen + mFret = mFretBar.getText(); + + if (!mFret.equalsIgnoreCase("")) { + if (mNote != null) { + setNote(mNote, mFret); + } + } + mFretBar.requestFocus(); + } + + private void setNote(String note, String fret) { + // An der aktuellen Position einfuegen + int pos = mEditArea.getCaretPosition(); + try { + mEditArea.getDocument().insertString(pos, "[" + note + ";" + fret + "]", new SimpleAttributeSet()); + } catch (Exception f) { + consoleBox.addText("ERR: Insert Note " + note + " failed: " + f); + } + mFretBar.setText(""); + mEditArea.requestFocus(); + } + } + + public class mNoteStringButtonClass extends AbstractAction { + + private static final long serialVersionUID = 3976941938622369381L; + + private final String mNoteString; + + public mNoteStringButtonClass(String text) { + super(text); + mNoteString = text; + } + + @Override + public void actionPerformed(ActionEvent e) { + int pos = mEditArea.getCaretPosition(); + try { + mEditArea.getDocument().insertString(pos, mNoteString, new SimpleAttributeSet()); + } catch (Exception f) { + consoleBox.addText("ERR: Insert mNoteString " + mNoteString + " failed: " + f); + } + mFretBar.requestFocus(); + //mEditArea.requestFocus(); + } + } + + public class mTestButtonClass extends AbstractAction { + + private static final long serialVersionUID = -1928126465736047335L; + + public mTestButtonClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + //highlight(mEditArea, "a"); + } + } + + private int getNextLine() { + int pos; + if (mEditArea.getDocument().getLength() == 0) { + return 0; + } else { + try { + for (pos = mEditArea.getCaretPosition(); pos <= mEditArea.getDocument().getLength(); pos++) { + if (mEditArea.getText(pos, 1).equals("\n")) { + if (pos == 0 || mEditArea.getText(pos - 1, 1).equals("\n")) { + return pos; + } else if (pos == mEditArea.getDocument().getLength()) { + // Eine neue Zeile einf�gen + mEditArea.getDocument().insertString(pos, "\n", new SimpleAttributeSet()); + return pos + 1; + } else { + //Eine neue Zeile einf�gen + mEditArea.getDocument().insertString(pos, "\n", new SimpleAttributeSet()); + return pos + 1; + } + } + } + } catch (Exception f) { + consoleBox.addText("ERR: getNextLine failed: " + f); + } + } + return 0; + } + + // ========================= Highlight - BEGIN ============================== + // Creates highlights around all occurrences of pattern in textComp + public void highlight(JTextComponent textComp, String pattern) { + // First remove all old highlights + removeHighlights(textComp); + + try { + Highlighter hilite = textComp.getHighlighter(); + Document doc = textComp.getDocument(); + String text = doc.getText(0, doc.getLength()); + int pos = 0; + + // Search for pattern + while ((pos = text.indexOf(pattern, pos)) >= 0) { + // Create highlighter using private painter and apply around pattern + hilite.addHighlight(pos, pos + pattern.length(), myHighlightPainter); + pos += pattern.length(); + } + } catch (BadLocationException e) { + } + } + + // Removes only our private highlights + public void removeHighlights(JTextComponent textComp) { + Highlighter hilite = textComp.getHighlighter(); + Highlighter.Highlight[] hilites = hilite.getHighlights(); + + for (Highlighter.Highlight hilite1 : hilites) { + if (hilite1.getPainter() instanceof MyHighlightPainter) { + hilite.removeHighlight(hilite1); + } + } + } + + // An instance of the private subclass of the default highlight painter + Highlighter.HighlightPainter myHighlightPainter = new MyHighlightPainter(Color.yellow); + + // A private subclass of the default highlight painter + class MyHighlightPainter extends DefaultHighlighter.DefaultHighlightPainter { + + public MyHighlightPainter(Color color) { + super(color); + } + } + // ================================ Highlight - END ================================ // + + class MyDocumentListener implements DocumentListener { + + String newline = System.getProperty("line.separator"); + + @Override + public void insertUpdate(DocumentEvent e) { + generalUpdate(e); + } + + @Override + public void removeUpdate(DocumentEvent e) { + generalUpdate(e); + } + + @Override + public void changedUpdate(DocumentEvent e) { + //generalUpdate(e); + //Plain text components don't fire these events + } + + private void generalUpdate(DocumentEvent e) { + //highlight(mEditArea, "{chorus}"); + tabbedPane.setTitleAt(0, mActFileName + " *"); + mFileChanged = true; + } + } + + class SymWindow extends java.awt.event.WindowAdapter { + + @Override + public void windowClosing(java.awt.event.WindowEvent event) { + mExitAction.actionPerformed(null); + } + } +}//end class GuitarTeX2 diff --git a/src/guitartex2/GuitarTeX2.properties b/src/guitartex2/GuitarTeX2.properties new file mode 100644 index 0000000..19f479e --- /dev/null +++ b/src/guitartex2/GuitarTeX2.properties @@ -0,0 +1,11 @@ +latex=/usr/bin/latex +xdvi=/usr/bin/xdvi +pdflatex=/usr/bin/pdflatex +windowsTmpPath= +tmpPath= +windowsPdfViewer=/Programme/Adobe/Reader/AcroRd32.exe +linuxPdfViewer=/usr/bin/acroread +exSongFile=griechischer_wein.gtx +exBookFile=my_first_book.gtb +gtxServer=guitartex2.servebbs.net +gtxServerPort=3121 \ No newline at end of file diff --git a/src/guitartex2/GuitarTeX2Convert.java b/src/guitartex2/GuitarTeX2Convert.java new file mode 100644 index 0000000..356a5d6 --- /dev/null +++ b/src/guitartex2/GuitarTeX2Convert.java @@ -0,0 +1,110 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +package guitartex2; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.nio.charset.Charset; +import java.util.Locale; +import java.util.ResourceBundle; + +public class GuitarTeX2Convert { + + public static void main(String[] args) { + ResourceBundle resbundle = ResourceBundle.getBundle("GuitarTeX2strings", Locale.getDefault()); + String help = "" + + resbundle.getString("appVersion") + "\n" + + "Usage: \n" + + " GuitarTeX2Converter -h help (this screen)\n" + + " GuitarTeX2Converter -f convert gtx file and print to std out\n" + + "\n"; + + if (args.length != 0) { + for (int i = 0; i < args.length; i++) { + if (args[i].equals("--help") || args[i].equals("-help") || args[i].equals("-h") || args[i].equals("--h")) { + System.out.println(help); + System.exit(0); + } + if (args[i].equals("-f") || args[i].equals("--f") || args[i].equals("-file") || args[i].equals("--file")) { + if (i + 1 < args.length) { + String fileName = args[i + 1]; + if (!fileName.equals("")) { + File f = new File(fileName); + if (f.canRead()) { + GuitarTeX2Convert guitarTeX2Convert = new GuitarTeX2Convert(f); + } else { + System.out.println("error: can't read file\n"); + System.out.println(help); + System.exit(1); + } + } else { + System.out.println(help); + System.exit(1); + } + } else { + System.out.println("error: no file found\n"); + System.out.println(help); + System.exit(1); + } + } + } + } else { + System.out.println(help); + System.exit(0); + } + } + + public GuitarTeX2Convert(File f) { + String mTextArea = ""; + try { + /*InputStreamReader in = new InputStreamReader(fis, Charset.forName("UTF-8")); + while ( in.read() != -1) { + char c = (char)in.read(); + mTextArea = mTextArea + c; + }*/ + try (FileInputStream fis = new FileInputStream(f); /*InputStreamReader in = new InputStreamReader(fis, Charset.forName("UTF-8")); + while ( in.read() != -1) { + char c = (char)in.read(); + mTextArea = mTextArea + c; + }*/ BufferedReader in = new BufferedReader( + new InputStreamReader(new FileInputStream(f), Charset.forName("UTF-8")))) { + boolean eof = false; + while (eof == false) { + String line = in.readLine(); + if (line == null) { + eof = true; + } else { + mTextArea = mTextArea + line + "\n"; + } + } + } + + GTXParser mGTXParser = new GTXParser(mTextArea); + mGTXParser.convertToTeX(); + + try (OutputStreamWriter out = new OutputStreamWriter(System.out, Charset.forName("UTF-8"))) { + out.write(mGTXParser.getMyTeXFile()); + } + + } catch (Exception e) { + System.err.println("File input error:" + e); + } + } + +} diff --git a/src/guitartex2/INSTALL b/src/guitartex2/INSTALL new file mode 100644 index 0000000..6dc6b75 --- /dev/null +++ b/src/guitartex2/INSTALL @@ -0,0 +1,28 @@ +INSTALL +======= + +Anmerkungen +----------- + + * Man braucht als Windows/*nix Benutzer einen PDF Betrachter um sich + das Ergebnis anzeigen zu lassen + * Sollte eine Fehlermeldung beim Starten erscheinen, so waehlen Sie + einen installierten PDF Betrachter im Menuepunkt "Preferences". + * Um die Funktion TeX2Pdf nutzen zu koennen braucht man eine Internet- + verbindung. Es muss moeglich sein auf den Port 3121 zugreifen zu koennen. + * Es ist eine beta Version mit einigen bekannten und unbekannten Bugs. + Ich bin fuer jeden Hinweis und Bemerkung dankbar. Bitte nutzen Sie dafuer + die Sourceforge Projektseite http://sourceforge.net/projects/guitartex2 + + +Notes +----- + + * Please make sure you have PDF Reader installed on your system. + * You have to set a Reader in a preferences section + * Remote server port is 3121, make sure your Firewall let it pass through + * It's a beta Version with known and unknown bugs. Please report them + using a project page http://sourceforge.net/projects/guitartex2 + + +Have Fun diff --git a/src/guitartex2/InfoBox.java b/src/guitartex2/InfoBox.java new file mode 100644 index 0000000..a37f9b7 --- /dev/null +++ b/src/guitartex2/InfoBox.java @@ -0,0 +1,121 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package guitartex2; + +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.GridBagLayout; +import java.awt.Panel; +import java.awt.Toolkit; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.Locale; +import java.util.ResourceBundle; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JScrollPane; +import javax.swing.JTextArea; + + + +class InfoBox extends JFrame implements ActionListener{ + private static final long serialVersionUID = 671314678552270671L; + + private Font titleFont, bodyFont; + + private static final int statusWidth = 480; + private static final int statusHeight = 200; + private static int statusTop; + private static int statusLeft; + + private final ResourceBundle resbundle; + + + public InfoBox(String myInfo) { + resbundle = ResourceBundle.getBundle ("GuitarTeX2strings", Locale.getDefault()); + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + statusTop = new Double((screenSize.getHeight()/2) - (statusHeight/2)).intValue(); + statusLeft = new Double((screenSize.getWidth()/2) - (statusWidth/2)).intValue(); + + this.setResizable(false); + + SymWindow aSymWindow = new SymWindow(); + this.addWindowListener(aSymWindow); + +// Initialize useful fonts + titleFont = new Font("Lucida Grande", Font.BOLD, 14); + if (titleFont == null) { + titleFont = new Font("SansSerif", Font.BOLD, 14); + } + bodyFont = new Font("Lucida Grande", Font.PLAIN, 10); + if (bodyFont == null) { + bodyFont = new Font("SansSerif", Font.PLAIN, 10); + } + + Panel buttonPanel = new Panel(new GridBagLayout()); + + JTextArea mShowArea = new JTextArea(myInfo); + mShowArea.setEditable(false); + JScrollPane scrollingShowArea = new JScrollPane(mShowArea); + + Action mOkAction = new buttonActionClass(resbundle.getString("okButton")); + JButton mOkButton = new JButton(mOkAction); + mOkButton.setActionCommand("mOkAction"); + + buttonPanel.add(new JLabel()); + buttonPanel.add(mOkButton); + buttonPanel.add(new JLabel()); + + this.getContentPane().add (scrollingShowArea, BorderLayout.CENTER); + this.getContentPane().add (buttonPanel, BorderLayout.PAGE_END); + + this.pack(); + this.setLocation(statusLeft, statusTop); + this.setSize(statusWidth, statusHeight); + this.setVisible(true); + } + + public class buttonActionClass extends AbstractAction { + private static final long serialVersionUID = 3791659234149686228L; + + public buttonActionClass(String text) { + super(text); + } + @Override + public void actionPerformed(ActionEvent e) { + setVisible(false); + } + } + + class SymWindow extends java.awt.event.WindowAdapter { + @Override + public void windowClosing(java.awt.event.WindowEvent event) { + setVisible(false); + } + } + + @Override + public void actionPerformed(ActionEvent newEvent) { + setVisible(false); + } +} \ No newline at end of file diff --git a/src/guitartex2/PreferencesBox.java b/src/guitartex2/PreferencesBox.java new file mode 100644 index 0000000..a6b4bd5 --- /dev/null +++ b/src/guitartex2/PreferencesBox.java @@ -0,0 +1,330 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +package guitartex2; + +import java.awt.Toolkit; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Font; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +import java.util.Locale; +import java.util.ResourceBundle; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.BoxLayout; +import javax.swing.JButton; +import javax.swing.JFileChooser; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextField; +import javax.swing.SpringLayout; + +public class PreferencesBox extends JFrame implements ActionListener { + + private static final long serialVersionUID = -7086306896538924587L; + + private Font titleFont, bodyFont; + private final ResourceBundle resbundle; + private final Configurations myConfiguration; + + //private Action mLatexAction, mXDviAction, mPdfLatexAction; + private final Action mPdfViewerAction, mTmpPathAction; + private JTextField mLatexField, mXDviField, mPdfLatexField; + private final JTextField mPdfViewerField; + private final JTextField mTmpPathField; + private final JTextField mGtxServerField, mGtxServerPortField; + private final JButton tex2pdfButton; + private final Action tex2pdfAction; + + private final String fileSeparator = System.getProperty("file.separator"); + + PreferencesBox(Configurations myConf, JButton mTeX2PdfButton, Action mTeX2PdfAction) { + myConfiguration = myConf; + tex2pdfButton = mTeX2PdfButton; + tex2pdfAction = mTeX2PdfAction; + + resbundle = ResourceBundle.getBundle("GuitarTeX2strings", Locale.getDefault()); + SymWindow aSymWindow = new SymWindow(); + this.addWindowListener(aSymWindow); + + // Initialize useful fonts + titleFont = new Font("Lucida Grande", Font.BOLD, 14); + if (titleFont == null) { + titleFont = new Font("SansSerif", Font.BOLD, 14); + } + bodyFont = new Font("Lucida Grande", Font.PLAIN, 10); + if (bodyFont == null) { + bodyFont = new Font("SansSerif", Font.PLAIN, 10); + } + + // Show local configuration + //Create and populate the panel. + JPanel mainPanel = new JPanel(); + mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.PAGE_AXIS)); + + //int numPairs = 9; + int numPairs = 6; + int fieldLength = 30; + + JPanel p = new JPanel(new SpringLayout()); + + // External programs + /* + JLabel mLatexLabel = new JLabel(resbundle.getString("mPrefLatex"), JLabel.TRAILING); + p.add(mLatexLabel); + mLatexField = new JTextField(fieldLength); + mLatexField.setText(myConfiguration.getLatex()); + mLatexLabel.setLabelFor(mLatexField); + p.add(mLatexField); + mLatexAction = new chooseFileActionClass(resbundle.getString("choose")); + JButton mLatexButton = new JButton(mLatexAction); + mLatexButton.setActionCommand("mLatexAction"); + p.add(mLatexButton); + + JLabel mXDviLabel = new JLabel(resbundle.getString("mPrefXDvi"), JLabel.TRAILING); + p.add(mXDviLabel); + mXDviField = new JTextField(fieldLength); + mXDviField.setText(myConfiguration.getXDvi()); + mXDviLabel.setLabelFor(mXDviField); + p.add(mXDviField); + mXDviAction = new chooseFileActionClass(resbundle.getString("choose")); + JButton mXDviButton = new JButton(mXDviAction); + mXDviButton.setActionCommand("mXDviAction"); + p.add(mXDviButton); + + JLabel mPdfLatexLabel = new JLabel(resbundle.getString("mPrefPdfLatex"), JLabel.TRAILING); + p.add(mPdfLatexLabel); + mPdfLatexField = new JTextField(fieldLength); + mPdfLatexField.setText(myConfiguration.getPdfLatex()); + mPdfLatexLabel.setLabelFor(mPdfLatexField); + p.add(mPdfLatexField); + mPdfLatexAction = new chooseFileActionClass(resbundle.getString("choose")); + JButton mPdfLatexButton = new JButton(mPdfLatexAction); + mPdfLatexButton.setActionCommand("mPdfLatexAction"); + p.add(mPdfLatexButton); + */ + JLabel mPdfViewerLabel = new JLabel(resbundle.getString("mPrefPdfViewer"), JLabel.TRAILING); + p.add(mPdfViewerLabel); + mPdfViewerField = new JTextField(fieldLength); + mPdfViewerField.setText(myConfiguration.getPdfViewer()); + mPdfViewerLabel.setLabelFor(mPdfViewerField); + p.add(mPdfViewerField); + mPdfViewerAction = new chooseFileActionClass(resbundle.getString("choose")); + JButton mPdfViewerButton = new JButton(mPdfViewerAction); + mPdfViewerButton.setActionCommand("mPdfViewerAction"); + p.add(mPdfViewerButton); + + // Spaces + p.add(new JLabel()); + p.add(new JLabel()); + p.add(new JLabel()); + + // Tmp Path + JLabel mTmpPathLabel = new JLabel(resbundle.getString("mPrefTmpPath"), JLabel.TRAILING); + p.add(mTmpPathLabel); + mTmpPathField = new JTextField(fieldLength); + mTmpPathField.setText(myConfiguration.getTmpDir()); + mTmpPathLabel.setLabelFor(mTmpPathField); + p.add(mTmpPathField); + mTmpPathAction = new chooseDirActionClass(resbundle.getString("choose")); + JButton mTmpPathButton = new JButton(mTmpPathAction); + mTmpPathButton.setActionCommand("mTmpPathAction"); + p.add(mTmpPathButton); + + // Space + p.add(new JLabel()); + p.add(new JLabel()); + p.add(new JLabel()); + + // Remote connection + JLabel mGtxServerLabel = new JLabel(resbundle.getString("mPrefGtxServer"), JLabel.TRAILING); + p.add(mGtxServerLabel); + mGtxServerField = new JTextField(fieldLength); + mGtxServerField.setText(myConfiguration.getGtxServer()); + mGtxServerLabel.setLabelFor(mGtxServerField); + p.add(mGtxServerField); + p.add(new JLabel()); + + JLabel mGtxServerPortLabel = new JLabel(resbundle.getString("mPrefGtxServerPort"), JLabel.TRAILING); + p.add(mGtxServerPortLabel); + mGtxServerPortField = new JTextField(fieldLength); + mGtxServerPortField.setText(Integer.toString(myConfiguration.getGtxServerPort())); + mGtxServerPortLabel.setLabelFor(mGtxServerPortField); + p.add(mGtxServerPortField); + p.add(new JLabel()); + + JPanel buttonsPanel = new JPanel(new FlowLayout(FlowLayout.TRAILING)); + + // Create Buttons + JButton resetButton = new JButton(resbundle.getString("resetButton")); + resetButton.setActionCommand("resetButtonPressed"); + resetButton.addActionListener(this); + JButton okButton = new JButton(resbundle.getString("okButton")); + okButton.setActionCommand("okButtonPressed"); + okButton.addActionListener(this); + JButton cancelButton = new JButton(resbundle.getString("cancelButton")); + cancelButton.setActionCommand("cancelButtonPressed"); + cancelButton.addActionListener(this); + buttonsPanel.add(resetButton); + buttonsPanel.add(cancelButton); + buttonsPanel.add(okButton); + + mainPanel.add(p); + mainPanel.add(buttonsPanel); + + //Lay out the panel. + SpringUtilities.makeCompactGrid(p, + numPairs, 3, //rows, cols + 6, 6, //initX, initY + 6, 6); //xPad, yPad + + //Create and set up the window. + p.setOpaque(true); //content panes must be opaque + buttonsPanel.setOpaque(true); + mainPanel.setOpaque(true); + + this.setResizable(false); + this.getContentPane().add(mainPanel); + this.pack(); + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + + int aboutTop = new Double((screenSize.getHeight() / 2) - (this.getHeight() / 2)).intValue(); + int aboutLeft = new Double((screenSize.getWidth() / 2) - (this.getWidth() / 2)).intValue(); + + this.setTitle(resbundle.getString("prefTitle")); + this.setLocation(aboutLeft, aboutTop); + this.setVisible(true); + } + + public class chooseFileActionClass extends AbstractAction { + + private static final long serialVersionUID = 6483849350866369203L; + + public chooseFileActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + JFileChooser mFileChooser = new JFileChooser(System.getProperty(".")); + int retval = mFileChooser.showOpenDialog(PreferencesBox.this); + if (retval == JFileChooser.APPROVE_OPTION) { + String actionCommand = e.getActionCommand(); + if (actionCommand.equals("mLatexAction")) { + mLatexField.setText(mFileChooser.getSelectedFile().getAbsolutePath()); + } + if (actionCommand.equals("mXDviAction")) { + mXDviField.setText(mFileChooser.getSelectedFile().getAbsolutePath()); + } + if (actionCommand.equals("mPdfLatexAction")) { + mPdfLatexField.setText(mFileChooser.getSelectedFile().getAbsolutePath()); + } + if (actionCommand.equals("mPdfViewerAction")) { + mPdfViewerField.setText(mFileChooser.getSelectedFile().getAbsolutePath()); + } + if (actionCommand.equals("mTmpPathAction")) { + mTmpPathField.setText(mFileChooser.getSelectedFile().getAbsolutePath()); + } + } + } + } + + public class chooseDirActionClass extends AbstractAction { + + private static final long serialVersionUID = 6483849350866369203L; + + public chooseDirActionClass(String text) { + super(text); + } + + @Override + public void actionPerformed(ActionEvent e) { + JFileChooser mFileChooser = new JFileChooser(System.getProperty(".")); + mFileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); + int retval = mFileChooser.showOpenDialog(PreferencesBox.this); + if (retval == JFileChooser.APPROVE_OPTION) { + String actionCommand = e.getActionCommand(); + if (actionCommand.equals("mTmpPathAction")) { + mTmpPathField.setText(mFileChooser.getSelectedFile().getAbsolutePath() + fileSeparator); + } + } + } + } + + private void setFields() { + //myConfiguration.setLatex(mLatexField.getText()); + //myConfiguration.setXDvi(mXDviField.getText()); + //myConfiguration.setPdfLatex(mPdfLatexField.getText()); + myConfiguration.setPdfViewer(mPdfViewerField.getText()); + myConfiguration.setTmpDir(mTmpPathField.getText()); + myConfiguration.setGtxServer(mGtxServerField.getText()); + myConfiguration.setGtxServerPort(mGtxServerPortField.getText()); + } + + private void resetFields() { + mPdfViewerField.setText(myConfiguration.getPdfViewer()); + mTmpPathField.setText(myConfiguration.getTmpDir()); + mGtxServerField.setText(myConfiguration.getGtxServer()); + mGtxServerPortField.setText(myConfiguration.getGtxServerPort() + ""); + } + + class SymWindow extends java.awt.event.WindowAdapter { + + @Override + public void windowClosing(java.awt.event.WindowEvent event) { + setVisible(false); + } + } + + @Override + public void actionPerformed(ActionEvent newEvent) { + if (newEvent.getActionCommand().equals("resetButtonPressed")) { + myConfiguration.loadDefaults(); + resetFields(); + } + + if (newEvent.getActionCommand().equals("okButtonPressed")) { + setFields(); + myConfiguration.saveSettings(); + GTXClient gtxClient = new GTXClient(myConfiguration.getGtxServer(), myConfiguration.getGtxServerPort()); + gtxClient.setGTXConsole(myConfiguration.getConsole()); + int openResult = gtxClient.openConnection(); + if (openResult == 0) { + int connResult = gtxClient.checkServerConnection(); + if (connResult == 0) { + tex2pdfButton.setEnabled(true); + tex2pdfAction.setEnabled(true); + } else { + tex2pdfButton.setEnabled(false); + tex2pdfAction.setEnabled(false); + } + gtxClient.closeConnection(); + } else { + tex2pdfButton.setEnabled(false); + tex2pdfAction.setEnabled(false); + } + setVisible(false); + } + if (newEvent.getActionCommand().equals("cancelButtonPressed")) { + setVisible(false); + } + } +} diff --git a/src/guitartex2/SpringUtilities.java b/src/guitartex2/SpringUtilities.java new file mode 100644 index 0000000..f6bbf38 --- /dev/null +++ b/src/guitartex2/SpringUtilities.java @@ -0,0 +1,210 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package guitartex2; + +import java.awt.Component; +import java.awt.Container; +import javax.swing.Spring; +import javax.swing.SpringLayout; + + + +public class SpringUtilities { + /** + * A debugging utility that prints to stdout the component's + * minimum, preferred, and maximum sizes. + * @param c + */ + public static void printSizes(Component c) { + System.out.println("minimumSize = " + c.getMinimumSize()); + System.out.println("preferredSize = " + c.getPreferredSize()); + System.out.println("maximumSize = " + c.getMaximumSize()); + } + + /** + * Aligns the first rows * cols + * components of parent in + * a grid. Each component is as big as the maximum + * preferred width and height of the components. + * The parent is made just big enough to fit them all. + * + * @param parent + * @param rows number of rows + * @param cols number of columns + * @param initialX x location to start the grid at + * @param initialY y location to start the grid at + * @param xPad x padding between cells + * @param yPad y padding between cells + */ + public static void makeGrid(Container parent, + int rows, int cols, + int initialX, int initialY, + int xPad, int yPad) { + SpringLayout layout; + try { + layout = (SpringLayout)parent.getLayout(); + } catch (ClassCastException exc) { + System.err.println("The first argument to makeGrid must use SpringLayout."); + return; + } + + Spring xPadSpring = Spring.constant(xPad); + Spring yPadSpring = Spring.constant(yPad); + Spring initialXSpring = Spring.constant(initialX); + Spring initialYSpring = Spring.constant(initialY); + int max = rows * cols; + + //Calculate Springs that are the max of the width/height so that all + //cells have the same size. + Spring maxWidthSpring = layout.getConstraints(parent.getComponent(0)). + getWidth(); + Spring maxHeightSpring = layout.getConstraints(parent.getComponent(0)). + getWidth(); + for (int i = 1; i < max; i++) { + SpringLayout.Constraints cons = layout.getConstraints( + parent.getComponent(i)); + + maxWidthSpring = Spring.max(maxWidthSpring, cons.getWidth()); + maxHeightSpring = Spring.max(maxHeightSpring, cons.getHeight()); + } + + //Apply the new width/height Spring. This forces all the + //components to have the same size. + for (int i = 0; i < max; i++) { + SpringLayout.Constraints cons = layout.getConstraints( + parent.getComponent(i)); + + cons.setWidth(maxWidthSpring); + cons.setHeight(maxHeightSpring); + } + + //Then adjust the x/y constraints of all the cells so that they + //are aligned in a grid. + SpringLayout.Constraints lastCons = null; + SpringLayout.Constraints lastRowCons = null; + for (int i = 0; i < max; i++) { + SpringLayout.Constraints cons = layout.getConstraints( + parent.getComponent(i)); + if (i % cols == 0) { //start of new row + lastRowCons = lastCons; + cons.setX(initialXSpring); + } else { //x position depends on previous component + cons.setX(Spring.sum(lastCons.getConstraint(SpringLayout.EAST), + xPadSpring)); + } + + if (i / cols == 0) { //first row + cons.setY(initialYSpring); + } else { //y position depends on previous row + cons.setY(Spring.sum(lastRowCons.getConstraint(SpringLayout.SOUTH), + yPadSpring)); + } + lastCons = cons; + } + + //Set the parent's size. + SpringLayout.Constraints pCons = layout.getConstraints(parent); + pCons.setConstraint(SpringLayout.SOUTH, + Spring.sum( + Spring.constant(yPad), + lastCons.getConstraint(SpringLayout.SOUTH))); + pCons.setConstraint(SpringLayout.EAST, + Spring.sum( + Spring.constant(xPad), + lastCons.getConstraint(SpringLayout.EAST))); + } + + /* Used by makeCompactGrid. */ + private static SpringLayout.Constraints getConstraintsForCell( + int row, int col, + Container parent, + int cols) { + SpringLayout layout = (SpringLayout) parent.getLayout(); + Component c = parent.getComponent(row * cols + col); + return layout.getConstraints(c); + } + + /** + * Aligns the first rows * cols + * components of parent in + * a grid. Each component in a column is as wide as the maximum + * preferred width of the components in that column; + * height is similarly determined for each row. + * The parent is made just big enough to fit them all. + * + * @param parent + * @param rows number of rows + * @param cols number of columns + * @param initialX x location to start the grid at + * @param initialY y location to start the grid at + * @param xPad x padding between cells + * @param yPad y padding between cells + */ + public static void makeCompactGrid(Container parent, + int rows, int cols, + int initialX, int initialY, + int xPad, int yPad) { + SpringLayout layout; + try { + layout = (SpringLayout)parent.getLayout(); + } catch (ClassCastException exc) { + System.err.println("The first argument to makeCompactGrid must use SpringLayout."); + return; + } + + //Align all cells in each column and make them the same width. + Spring x = Spring.constant(initialX); + for (int c = 0; c < cols; c++) { + Spring width = Spring.constant(0); + for (int r = 0; r < rows; r++) { + width = Spring.max(width, + getConstraintsForCell(r, c, parent, cols). + getWidth()); + } + for (int r = 0; r < rows; r++) { + SpringLayout.Constraints constraints = + getConstraintsForCell(r, c, parent, cols); + constraints.setX(x); + constraints.setWidth(width); + } + x = Spring.sum(x, Spring.sum(width, Spring.constant(xPad))); + } + + //Align all cells in each row and make them the same height. + Spring y = Spring.constant(initialY); + for (int r = 0; r < rows; r++) { + Spring height = Spring.constant(0); + for (int c = 0; c < cols; c++) { + height = Spring.max(height, + getConstraintsForCell(r, c, parent, cols). + getHeight()); + } + for (int c = 0; c < cols; c++) { + SpringLayout.Constraints constraints = + getConstraintsForCell(r, c, parent, cols); + constraints.setY(y); + constraints.setHeight(height); + } + y = Spring.sum(y, Spring.sum(height, Spring.constant(yPad))); + } + + //Set the parent's size. + SpringLayout.Constraints pCons = layout.getConstraints(parent); + pCons.setConstraint(SpringLayout.SOUTH, y); + pCons.setConstraint(SpringLayout.EAST, x); + } +} diff --git a/src/guitartex2/StatusBox.java b/src/guitartex2/StatusBox.java new file mode 100644 index 0000000..e5dc820 --- /dev/null +++ b/src/guitartex2/StatusBox.java @@ -0,0 +1,149 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package guitartex2; + +import java.awt.Dimension; +import java.awt.Font; +import java.awt.BorderLayout; +import java.awt.GridBagLayout; +import java.awt.Panel; +import java.awt.Toolkit; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.util.Locale; +import java.util.ResourceBundle; + + +import javax.swing.ImageIcon; +import javax.swing.JLabel; +import javax.swing.JFrame; + + + + +public class StatusBox extends JFrame implements ActionListener { + private static final long serialVersionUID = 8854494445995604753L; + + private Font titleFont, bodyFont; + + private static int statusWidth = 280; + private static int statusHeight = 100; + private static int statusTop; + private static int statusLeft; + + private ResourceBundle resbundle; + private final JLabel myJLStatus; + + public StatusBox() { + resbundle = ResourceBundle.getBundle ("GuitarTeX2strings", Locale.getDefault()); + + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + statusTop = new Double((screenSize.getHeight()/2) - (statusHeight/2)).intValue(); + statusLeft = new Double((screenSize.getWidth()/2) - (statusWidth/2)).intValue(); + + this.setResizable(false); + + SymWindow aSymWindow = new SymWindow(); + this.addWindowListener(aSymWindow); + +// Initialize useful fonts + titleFont = new Font("Lucida Grande", Font.BOLD, 14); + if (titleFont == null) { + titleFont = new Font("SansSerif", Font.BOLD, 14); + } + bodyFont = new Font("Lucida Grande", Font.PLAIN, 10); + if (bodyFont == null) { + bodyFont = new Font("SansSerif", Font.PLAIN, 10); + } + + java.net.URL imgURL = StatusBox.class.getResource("images/info.png"); + ImageIcon icon = new ImageIcon(imgURL, ""); + + Panel textPanel = new Panel(new GridBagLayout()); + Panel imagePanel = new Panel(new GridBagLayout()); + + myJLStatus = new JLabel(); + + imagePanel.add(new JLabel(icon)); + + textPanel.add(new JLabel()); + textPanel.add(myJLStatus); + textPanel.add(new JLabel()); + + this.getContentPane().add (imagePanel, BorderLayout.PAGE_START); + this.getContentPane().add (textPanel, BorderLayout.CENTER); + + this.pack(); + this.setTitle(resbundle.getString("statusTitle")); + this.setLocation(statusLeft, statusTop); + this.setSize(statusWidth, statusHeight); + } + + public StatusBox(String myStatus) { + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + statusTop = new Double((screenSize.getHeight()/2) - (statusHeight/2)).intValue(); + statusLeft = new Double((screenSize.getWidth()/2) - (statusWidth/2)).intValue(); + + this.setResizable(false); + + SymWindow aSymWindow = new SymWindow(); + this.addWindowListener(aSymWindow); + +// Initialize useful fonts + titleFont = new Font("Lucida Grande", Font.BOLD, 14); + if (titleFont == null) { + titleFont = new Font("SansSerif", Font.BOLD, 14); + } + bodyFont = new Font("Lucida Grande", Font.PLAIN, 10); + if (bodyFont == null) { + bodyFont = new Font("SansSerif", Font.PLAIN, 10); + } + + Panel textPanel = new Panel(new GridBagLayout()); + + myJLStatus = new JLabel(myStatus); + + textPanel.add(new JLabel()); + textPanel.add(myJLStatus); + textPanel.add(new JLabel()); + + this.getContentPane().add (textPanel, BorderLayout.CENTER); + + this.pack(); + this.setLocation(statusLeft, statusTop); + this.setSize(statusWidth, statusHeight); + this.setVisible(true); + } + + public void setStatus(String myStatus) { + myJLStatus.setText(myStatus); + setVisible(true); + } + + class SymWindow extends java.awt.event.WindowAdapter { + @Override + public void windowClosing(java.awt.event.WindowEvent event) { + setVisible(false); + } + } + + @Override + public void actionPerformed(ActionEvent newEvent) { + setVisible(false); + } +} \ No newline at end of file diff --git a/src/guitartex2/UnicodeReader.java b/src/guitartex2/UnicodeReader.java new file mode 100644 index 0000000..8137759 --- /dev/null +++ b/src/guitartex2/UnicodeReader.java @@ -0,0 +1,115 @@ +/** + * Original pseudocode : Thomas Weidenfeller Implementation tweaked: Aki + * Nieminen + * + * http://www.unicode.org/unicode/faq/utf_bom.html BOMs: 00 00 FE FF = UTF-32, + * big-endian FF FE 00 00 = UTF-32, little-endian FE FF = UTF-16, big-endian FF + * FE = UTF-16, little-endian EF BB BF = UTF-8 + * + * Win2k Notepad: Unicode format = UTF-16LE + ** + */ +package guitartex2; + +import java.io.*; + +/** + * Generic unicode textreader, which will use BOM mark to identify the encoding + * to be used. If BOM is not found then use a given default encoding. System + * default is used if: BOM mark is not found and defaultEnc is NULL + * + * Usage pattern: String defaultEnc = "ISO-8859-1"; // or NULL to use system + * default FileInputStream fis = new FileInputStream(file); Reader in = new + * UnicodeReader(fis, defaultEnc); + */ +public class UnicodeReader extends Reader { + + PushbackInputStream internalIn; + + InputStreamReader internalIn2 = null; + + String defaultEnc; + + private static final int BOM_SIZE = 4; + + UnicodeReader(InputStream in, String defaultEnc) { + internalIn = new PushbackInputStream(in, BOM_SIZE); + this.defaultEnc = defaultEnc; + } + + public String getDefaultEncoding() { + return defaultEnc; + } + + public String getEncoding() { + if (internalIn2 == null) { + return null; + } + return internalIn2.getEncoding(); + } + + /** + * Read-ahead four bytes and check for BOM marks. Extra bytes are unread + * back to the stream, only BOM bytes are skipped. + * + * @throws java.io.IOException + */ + protected void init() throws IOException { + if (internalIn2 != null) { + return; + } + + String encoding; + byte bom[] = new byte[BOM_SIZE]; + int n, unread; + n = internalIn.read(bom, 0, bom.length); + + if ((bom[0] == (byte) 0xEF) && (bom[1] == (byte) 0xBB) + && (bom[2] == (byte) 0xBF)) { + encoding = "UTF-8"; + unread = n - 3; + } else if ((bom[0] == (byte) 0xFE) && (bom[1] == (byte) 0xFF)) { + encoding = "UTF-16BE"; + unread = n - 2; + } else if ((bom[0] == (byte) 0xFF) && (bom[1] == (byte) 0xFE)) { + encoding = "UTF-16LE"; + unread = n - 2; + } else if ((bom[0] == (byte) 0x00) && (bom[1] == (byte) 0x00) + && (bom[2] == (byte) 0xFE) && (bom[3] == (byte) 0xFF)) { + encoding = "UTF-32BE"; + unread = n - 4; + } else if ((bom[0] == (byte) 0xFF) && (bom[1] == (byte) 0xFE) + && (bom[2] == (byte) 0x00) && (bom[3] == (byte) 0x00)) { + encoding = "UTF-32LE"; + unread = n - 4; + } else { + // Unicode BOM mark not found, unread all bytes + encoding = defaultEnc; + unread = n; + } + // System.out.println("read=" + n + ", unread=" + unread); + + if (unread > 0) { + internalIn.unread(bom, (n - unread), unread); + } + + // Use given encoding + if (encoding == null) { + internalIn2 = new InputStreamReader(internalIn); + } else { + internalIn2 = new InputStreamReader(internalIn, encoding); + } + } + + @Override + public void close() throws IOException { + init(); + internalIn2.close(); + } + + @Override + public int read(char[] cbuf, int off, int len) throws IOException { + init(); + return internalIn2.read(cbuf, off, len); + } +} diff --git a/src/guitartex2/WarningBox.java b/src/guitartex2/WarningBox.java new file mode 100644 index 0000000..be0503f --- /dev/null +++ b/src/guitartex2/WarningBox.java @@ -0,0 +1,164 @@ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package guitartex2; + +//import java.awt.Dimension; +import java.awt.Font; +import java.awt.BorderLayout; +import java.awt.GridBagLayout; +import java.awt.Panel; +//import java.awt.Toolkit; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.util.Locale; +import java.util.ResourceBundle; + + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.swing.JButton; +import javax.swing.JLabel; +import javax.swing.JFrame; + + + +public class WarningBox extends JFrame implements ActionListener { + private static final long serialVersionUID = -6792186354255191963L; + + private Font titleFont, bodyFont; + + private static final int warnWidth = 330; + private static final int warnHeight = 150; + private static int warnTop; + private static int warnLeft; + + private final JLabel myJLStatus; + private final String myInfo; + + private final Action mOkAction, mInfoAction, mQuitAction; + private final ResourceBundle resbundle; + + public WarningBox(String myStatus, String mInfo) { + resbundle = ResourceBundle.getBundle ("GuitarTeX2strings", Locale.getDefault()); + + myInfo = mInfo; + + /* TODO: Bring WarnBox always on top + Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); + /warnTop = new Double((screenSize.getHeight()/2) - (warnHeight/2)).intValue(); + warnLeft = new Double((screenSize.getWidth()/2) - (warnWidth/2)).intValue(); + */ + warnTop = 0; + warnLeft = 0; + + this.setResizable(false); + + SymWindow aSymWindow = new SymWindow(); + this.addWindowListener(aSymWindow); + +// Initialize useful fonts + titleFont = new Font("Lucida Grande", Font.BOLD, 14); + if (titleFont == null) { + titleFont = new Font("SansSerif", Font.BOLD, 14); + } + bodyFont = new Font("Lucida Grande", Font.PLAIN, 10); + if (bodyFont == null) { + bodyFont = new Font("SansSerif", Font.PLAIN, 10); + } + java.net.URL imgURL = WarningBox.class.getResource("images/info.png"); + ImageIcon icon = new ImageIcon(imgURL, ""); + Panel imagePanel = new Panel(new GridBagLayout()); + Panel textPanel = new Panel(new GridBagLayout()); + Panel buttonPanel = new Panel(new GridBagLayout()); + + myJLStatus = new JLabel(myStatus); + + imagePanel.add(new JLabel(icon)); + + JLabel spaceLabel = new JLabel(); + + textPanel.add(spaceLabel); + textPanel.add(myJLStatus); + textPanel.add(spaceLabel); + + mOkAction = new buttonActionClass(resbundle.getString("okButton")); + JButton mOkButton = new JButton(mOkAction); + mOkButton.setActionCommand("mOkAction"); + + mInfoAction = new buttonActionClass(resbundle.getString("infoButton")); + JButton mInfoButton = new JButton(mInfoAction); + mInfoButton.setActionCommand("mInfoAction"); + + mQuitAction = new buttonActionClass(resbundle.getString("quitButton")); + JButton mQuitButton = new JButton(mQuitAction); + mQuitButton.setActionCommand("mQuitAction"); + + buttonPanel.add(mQuitButton); + buttonPanel.add(mInfoButton); + buttonPanel.add(mOkButton); + + this.getContentPane().add (imagePanel, BorderLayout.PAGE_START); + this.getContentPane().add (textPanel, BorderLayout.CENTER); + this.getContentPane().add (buttonPanel, BorderLayout.PAGE_END); + + this.pack(); + this.setLocation(warnLeft, warnTop); + this.setSize(warnWidth, warnHeight); + this.setTitle(resbundle.getString("warnTitle")); + this.setVisible(true); + //this.setResizable(true); + } + + + public class buttonActionClass extends AbstractAction { + private static final long serialVersionUID = 3791659234149686228L; + + public buttonActionClass(String text) { + super(text); + } + @Override + public void actionPerformed(ActionEvent e) { + String mAction = e.getActionCommand(); + if ( mAction.equals("mQuitAction")) { + System.exit(1); + } + if ( mAction.equals("mOkAction")) { + setVisible(false); + setEnabled(false); + } + if ( mAction.equals("mInfoAction")) { + InfoBox infoBox = new InfoBox(myInfo); + } + } + } + + class SymWindow extends java.awt.event.WindowAdapter { + @Override + public void windowClosing(java.awt.event.WindowEvent event) { + setVisible(false); + setEnabled(false); + } + } + + @Override + public void actionPerformed(ActionEvent newEvent) { + setVisible(false); + setEnabled(false); + } +} \ No newline at end of file diff --git a/src/guitartex2/doc/GuitartTeX2-documentation.tex b/src/guitartex2/doc/GuitartTeX2-documentation.tex new file mode 100755 index 0000000..49a2eb1 --- /dev/null +++ b/src/guitartex2/doc/GuitartTeX2-documentation.tex @@ -0,0 +1,461 @@ +\documentclass[12pt]{article} + +\usepackage[latin1]{inputenc} +\usepackage{amsmath} +\usepackage[german]{babel} +\usepackage{listings} +\usepackage{verbatim} +\usepackage{graphicx} + +\newcommand{\ul}{\underline{~}} + +\begin{document} + + \section{Einf"uhrung} + $GuitarTeX_2$ ist ein Werkzeug für Gitarristen, die gut aussehende Ausdrucke ihrer Musikstücke + oder Liederbücher aus ihren Chord- oder Chordpro-Dateien anfertigen wollen. Es benutzt das + weit verbreitete Chord Format mit einigen Erweiterungen.\\ + + Es basiert auf einer Idee von Martin Leclerc und Mario Dorion aus Kanada und ihrem Programm + Chord (Version 3.5 von 1993). Um $GuitarTeX_2$ zu nutzen, benötigen Sie Kenntnisse des Programmes + Chord (wird später erklärt). Obwohl das Satzsystem \LaTeX ~von $GuitarTeX_2$ genutzt wird, müssen + sie wenig (oder nichts) über \LaTeX ~wissen. $GuitarTeX_2$ produziert Postscript- oder PDF-Dateien + automatisch, wenn Sie das möchten. Die von $GuitarTeX_2$ unterstützten Direktiven des Programms + Chord werden erläutert. + + \subsection{Eigenschaften} + \begin{itemize} + \item + Grafische Benutzeroberfläche mit integriertem Editor + \item + Druckt gut aussehende Liedblätter mit Akkorden unter Benutzung von Proportionalschriften + \item + Ausgabeformate \LaTeX, Postscript und PDF + \item + Kompatibel mit ChordPro-Format, Import von ASCII-Dateien + \item + Notensatz mit den \LaTeX-Paketen MusixTeX, MusixLyr und TabDefs + \item + Flexibles Seitenlayout (Größe, Ränder...) + \item + Benutzerdefinierte Farben für Refrain, Bridge ... + \item + Optionale Ausgabe von Akkordsymbolen am Ende eines Stückes + \item + ASCII-Tabulaturen und eingebaute Funktionen für Gitarrten- und Bass-Tabulaturen + \item + \LaTeX-Kommandos können in Chord-Dateien verwendet werden (für Profis) + \end{itemize} + + \subsection{Beispiel} + $GuitarTeX_2$ konvertiert eine Datei mit Text und Akkorden im Chord-Format in + eine \LaTeX-Datei. Ein Beispiel für eine Chord-Datei: \\ + \\ + {\bf\{title:The Manual Song\} \\ + \{st:No-one has yet claimed responsibility\} \\ + ~[D]I print verses [A7]in a [D]row, \\ + The next line gets put [A7]down be[D]low, \\ + Mumble mumble [A7]rhymes with [D]grow [G] [G\#] [A] \\ + Done this verse, now [A7sus4]on we [quietly]go! \\ + \\ + \{soc\} \\ + ~[D]This is the [Bm]manual song \\ + ~[A7]No-one really knows what's [D]goin' on \\ + ~[D]This is the [F\#m]manual song \\ + ~[A7]And now the chorus is already [D]gone \\ + \{eoc\} \\ + \\ + ~[D]The second verse is [A7]like the [D]first, \\ + The music poor, the [A7]verse is [D]worse, \\ + I wrote this since [A7]I'd get [D]sued, \\ + If I used real songs. [A7]This'll [D]do. \\ + \\ + \{c:repeat chorus\} } \\ + \\ + \includegraphics[width=1.1\textwidth]{pics/example1.pdf} + \\ + Wenn Sie sich mit \LaTeX ~auskennen, können Sie die Ausgabedatei auch manuell verändern, + bevor Sie sie in Postscript oder PDF umwandeln. Der Vorteil ist, dass Sie alle Möglichkeiten + von \LaTeX ~einschließlich der vielen Zusatzpackete wie graphics oder MusicTeX einsetzen können. + + \section{Installation} + + \subsection{Woher bekomme ich $GuitarTeX_2$} + Die aktuelle Version bekommen Sie immer auf der Download-Seite des $GuitarTeX_2$-Projektes: + http://sourceforge.net/projects/guitartex2. + + \subsection{Systemanforderungen} + $GuitarTeX_2$ ist ein Java Programm welches Betriessystemunabhägig entwickelt wurde. + Ben"otigt werden: + \begin{itemize} + \item + Java 1.4 oder höher + \item + PDF - Betrachter (z.B. Acrobat Reader, xpdf) + Bei MacOS X braucht man es nicht + \item + Internetverbindung (optinal) + \item + \LaTeX (optional) + \end{itemize} + + \subsection{Installation} + Laden sie sich das binäre Paket (GuitarTeX2.jar) herunter. Je nachdem wie sie Ihr + System konfiguriert haben, reicht es darauf zu Doppelklicken oder mit + ''java -jar GuitarTeX2.jar'' aus der Kommandozeile zu starten. \\ + \\ + Es wird beim ersten Starten eine lokale Konfigurationsdatei + angelegt. Diese ist im Homeverzeichnis des Benutzers zu finden. Sie kann nachträglich + verändert werde und wird immer beim starten zuerst ausgelesen. + + \section{Der Editor $GuitarTeX_2$} + + \section{Unterstützte Chord-Direktiven} + Direktiven sind Befehle zwischen geschweiften Klammern, die das Aussehen der erzeugten + Ausgabe steuern. Einige häufig benötigte Direktiven können durch eine Abkürzung ersetzt + werden (siehe Beispiele). $GuitarTeX_2$ bringt einige neue Direktiven mit, die das original + Chord Programm nicht kennt. + \subsection{Spezielle Zeichen} + Einige Zeichen haben in GuitarTeX eine besondere Bedeutung: + \begin{itemize} + \item + \# am Anfang einer Zeile markiert einen Kommentar. Die Zeile wird von $GuitarTeX_2$ ignoriert + \item + / darf nur in Akkorden mit Bass verwendet werden (z.B. A/E) + \end{itemize} + \subsection{Seitenlayout} + Die Direktive geometry bietet flexible Möglichkeiten, das Layout einer Seite anzupassen. + Sie benutzt das \LaTeX-Paket geometry. Die folgende Beschreibung ist ein (modifizierter) + Teil der Original-Dokumentation. + \\ + Das geometry Paket bietet viele automatische Ausrichtungen, so dass nur wenige manuelle + Angaben zum Seitenlayout erforderlich sind. In diesem Fall reicht ein einfaches \\ + \\ + {\bf\{geometry:a4paper\}} \\ + \\ + Das Setzen von Seitenrändern erfolgt mit \\ + \\ + {\bf\{geometry:margin=2.5cm\}} \\ + \\ + wenn alle Ränder einer Seite 2,5 Zentimeter betragen sollen. + Längenangaben erfolgen in + \begin{itemize} + \item + Zentimeter (cm) + \item + Millimeter (mm) + \item + Inch (in) + \item + Punkt (pt) + \end{itemize} + \subsubsection{Grunds"atzliches} + Das Seitenlayout besteht aus einer einfachen Struktur: Die Seite (paper) enthält einen + Textkörper (total-body, druckbarer Bereich) und Ränder. Der Textkörper besteht aus Kopf- + und Fußzeile, dem eigentlichen Text und (optional) den Randbemerkungen. Die vier Ränder + heißen left-margin, right-margin, top-margin und bottom-margin.\\ + \begin{itemize} + \item + paper: total-body (printable area) and margins + \item + total-body: head, body(text area), foot and marginal notes + \item + margins: left-, right-, top- and bottom-margin + \end{itemize} + Jeder Rand wird von der jeweiligen Kante der Seite aus gemessen, z.B. left-margin meint + den Abstand zwischen linker Seitenkante und dem Textkörper. Die Größen von paper, totalbody + und margins stehen in diesen Ralationen: + \begin{itemize} + \item + paperwidth = left + width + right + \item + paperheight = top + height + bottom + \end{itemize} + \subsubsection{Optionen} + Optionen der Direktive geometry: \\ + \begin{tabular}{|l|l|} + \textbf{Name} & \textbf{Bedeutung} \\ + \hline + landscape & schaltet um auf Querformat \\ + portrait & schaltet um auf Hochformat \\ + twoside & schaltet auf zweiseitige Ausgabe um. Die linken und rechen Ränder werden bei geraden + und ungeraden Seiten symmetrisch angeordnet. \\ + reversemp & Randbemerkungen erscheinen am linken Rand (statt am rechten Rand) \\ + nohead & keine Reservierung von Platz für Kopfzeilen \\ + nofoot & keine Reservierung von Platz für Fußzeilen \\ + noheadfoot & keine Reservierung von Platz für Kopf- und Fußzeilen \\ + a4paper, a5paper & spezifizert die Papiergröße, ohne Wert anzugeben \\ + paperwidth & Breite des Papiers. paperwidth=$<$paperwidth$>$ \\ + paperheight & Höhe des Papiers. paperheight=$<$paperheight$>$ \\ + width & Breite des Textkörpers. width=$<$width$>$or totalwidth=$<$width$>$. Diese Angabe + sollte nicht mit der Textbreite (textwidth) verwechselt werden. width enthält die + Textbreite und die Breite der Randbemerkungen. \\ + height & Höhe des Textkörpers (einschließlich Kopf- und Fußzeile). height=$<$height$>$ \\ + left & linker Rand. left=$<$leftmargin$>$ \\ + right & rechter Rand. right=$<$rightmargin$>$ \\ + top & oberer Rand. top=$<$topmargin$>$ \\ + bottom & unterer Rand. bottom=$<$bottommargin$>$ \\ + margin & alle Ränder. margin=$<$margin$>$ \\ + textwidth & Breite des Textes. textwidth=$<$width$>$ \\ + textheight & Höhe des Textes. textheight=$<$height$>$ \\ + marginpar & Breite der Randbemerkungen. marginpar=$<$length$>$ \\ + marginparsep & Abstand zwischen Text und Randbemerkungen. marginparsep=$<$length$>$ \\ + head & Höhe der Kopfzeile. head=$<$length$>$ \\ + headsep & Abstand zwischen Kopfzeile und Text. headsep=$<$length$>$ \\ + foot & Abstand zwischen Fußzeile und Text. foot=$<$length$>$ \\ + \end{tabular} + \subsubsection{Beispiele} + Setzen Sie die Höhe des Textkörpers auf 10in, den unteren Rand auf 2cm. Der obere + Rand wird automatisch berechnet:\\ + \\ + {\bf\{geometry:height=10in,bottom=2cm\}} \\ + \\ + oder: \\ + \\ + {\bf\{g:height=10in,bottom=2cm\}} \\ + \\ + oder: \\ + \\ + {\bf\{geometry:height=10in\} \\ + \\ + \{g:bottom:=2cm\}} \\ + \\ + Setzen Sie den linken, rechten und oberen Rand auf 3cm, 2cm und 2.5in. + Es wird keine Kopfzeile benötigt. \\ + \\ + {\bf\{geometry:left=3cm,right=2cm, nohead,top=2.5in\}} \\ + \\ + oder: \\ + \\ + {\bf\{geometry:left=3cm\} \\ + \{geometry:right=2cm\} \\ + \{geometry:nohead\} \\ + \{geometry:top=2.5in\}} \\ + \\ + oder : \\ + \\ + {\bf\{g:left=3cm,right=2cm\} \\ + \{g:nohead, top=2.5in\}} \\ + \\ + und so weiter ... \\ + Ändern Sie die Breite der Randbemerkungen auf 3cm \\ + \\ + {\bf\{geometry:marginpar=3cm\} \\ + \{geometry:marginpar=3cm, reversemp\}} \\ + \\ + lässt die Randbemerkungen am linken Rand ausgeben.\\ + Verwenden sie A5-Papier im Querformat: \\ + \\ + {\bf\{geometry:a5paper, landscape\}} \\ + \subsection{Dokumentenstrukur} + \subsubsection{title} + Der Titel eines Stückes wird durch die Direktive title markiert. Der + Titel wird zentriert mit einer vergrößerten Schrift ausgegeben. + In Dokumenten mit mehreren Stücken verursacht title einen Seitenumbruch. \\ + Beispiel:\\ + \\ + {\bf\{title:Go Down Moses\} \\ + \{t:Go Down Moses\}} \\ + \subsubsection{subtitle} + Die Direktive \textbf{subtitle} dient zur Darstellung zusätzlicher + Informationen, wie z.B. Interpret oder Komponist. \\ + Beispiel: \\ + \\ + {\bf\{subtitle:written by John Lennon / Paul McCartney\} \\ + \{st:written by John Lennon / Paul McCartney\}} \\ + \subsubsection{bridge} + Eine Bridge wird mit \{bridge\} oder \{sob\} (start of bridge) am Anfang, + und \{/bridge\} oder \{eob\} (end of bridge) am Ende markiert. Die Bridge + wird auf Farbdruckern in blau ausgegeben. Die Farbe kann mit der Direktive + color\underline{~}bridge angepasst werden (siehe Abschnitt namens color\underline{~}xxx).\\ + Beispiel: \\ + \\ + {\bf \{bridge\} \\ + I want her [Ab]everywhere [Fm] \\ + And if [Bbm]she's beside me [C7]I know I need [Fm]never care \\ + ~[Bb]But to love her [C7]is to meet her \\ + \{/bridge\}} \\ + \subsubsection{chorus} + Ein Refrain wird mit \{chorus\} oder \{soc\} (start of chorus) am Anfang und mit \{/chorus\} + oder \{eoc\} (end of chorus) am Ende markiert. Der Refrain wird auf Farbdruckern in rot + ausgegeben. Die Farbe kann mit der Direktive color\underline{~}chorus angepasst werden + (siehe Abschnitt namens color\underline{~}xxx).\\ + Beispiel: \\ + \\ + {\bf\{chorus\} \\ + Oh, I get [C]by with a little [G]help from my [D]friends \\ + Mm, I get [C]high with a little [G]help from my [D]friends \\ + Oh, I'm gonna [C]try with a little [G]help from my [D]friends \\ + \{/chorus\}} \\ + \subsubsection{instr} + Ein Instrumental-Teil wird mit \{instr\} oder \{soi\} (start of instrumental) am Anfang + und \{/instr\} oder \{eoi\} (end of instrumental) am Ende markiert. Der Instrumental-Teil + wird auf Farbdruckern in grau ausgegeben. Die Farbe kann mit der Direktive + color\underline{~}instr angepasst werden (siehe Abschnitt namens color\underline{~}xxx). + \subsubsection{np} + np steht für eine ''neue Seite'' und erzeugt einen Seitenumbruch.\\ + Beispiel: \\ + {\bf\{np\}} \\ + \subsubsection{tab} + Tabulaturen werden mit \{tab\} oder \{sot\} (start of tablature) am Anfang und \{/tab\} + oder \{eot\} (end of tablature) am Ende markiert. Tabulaturen werden auf Farbdruckern + in grün ausgegeben. Die Farbe kann mit der Direktive color\underline{~}tab directive + angepasst werden (siehe Abschnitt namens color\underline{~}xxx). Tabulaturen werden + in einer nichtproportionalen Schriftart ausgegeben.\\ + Beispiel: \\ + \includegraphics[width=15cm]{pics/tabs1.pdf} + \subsection{Fonts} + Die Direktiven zur Beeinflussung der Schriftart und -farbe können irgendwo in Ihrer Datei + stehen. Trotzdem ist es hilfreich sie am Anfang zu platzieren. Die angegebenen Werte + gelten für das ganze Dokument. + \subsubsection{font\underline{~}size} + \LaTeX ~kennt drei Schriftgrößen 10pt, 11pt and 12pt. GuitarTeX nutzt normalerweise + 11pt (Titel und Untertitel werden automatisch vergrößert). Wenn Sie z.B. 12pt + verwenden wollen, schreiben Sie:\\ + \\ + {\bf\{font\underline{~}size:12\}} \\ + \\ + Achtung: schreiben Sie nicht 12pt statt 12!\\ + \subsubsection{color\underline{~}xxx} + Mit den folgenden Direktiven können Sie die Textfarbe für Refrain, Bridge, + Instrumental-Teil Tabulaturen und zweite Stimme anpassen. Für die zweite Stimme + können Sie auch die Hintergrundfarbe ändern, so dass Sie z.B. weiße Schrift auf einem + farbigen Hintergrund verwenden können. Das erleichtert den Sängern hoffentlich + die Orientierung bei mehreren Textzeilen. \\ + Die Direktiven heißen: \\ + \begin{itemize} + \item + color\underline{~}chorus + \item + color\underline{~}bridge + \item + color\underline{~}instr + \item + color\underline{~}tab + \item + color\underline{~}second + \item + color\underline{~}second\underline{~}back + \end{itemize} + Als Parameter wird eine durch Kommas getrennte Liste von Werten zwischen null und + eins, die die Farben rot, grün und blau repräsentieren.\\ + Beispiel: \\ + \\ + {\bf\{color\underline{~}chorus:.5,.5,1\}} + \subsection{Gitarren- und Bass-Tabulaturen} + $GuitarTeX_2$ kennt zwei neue Direktiven zur Darstellung von Tabulaturen: + \begin{itemize} + \item + \{guitartab: \} für Gitarren-Tabulaturen + \item + \{basstab: \} für Bass-Tabulaturen + \end{itemize} + Jede guitartab oder basstab Direktive stellt eine Zeile mit sechs bzw vier Linien dar. + Sie können mit \{guitartab: \} oder \{basstab: \} auch leere Tabulaturen erzeugen. + Setzen Sie eine Leerzeile vor die Direktive, damit die Tabulatur am linken Rand beginnt.\\ + Die Klammern können enthalten: + \begin{itemize} + \item + normaler Text, der unterhalb der Tabulatur ausgegeben wird + \item + Noten im Format [string;fret], z.B. [2;5] für 5. Bund auf der A-Saite + \item + Taktstriche (durch das Zeichen $|$ dargestellt) + \item + Zusätzlicher Leerraum mit ''\ul{}'' + \end{itemize} + Beispiel: leere Gitarrentabulatur \\ + \\ + {\bf\{guitartab:\}} \\ + \\ + Beispiel: Eine Bass-Tabulatur mit Text \\ + \\ + {\bf\{basstab:some text\}} \\ + \\ + Beispiel: Noten, Taktstriche und Leerraum \\ + \\ + {\bf\{guitartab:[2;3][3;0][3;2][3;3]$|$[4;0]\ul\ul[4;2]\ul\ul[5;0]\ul\ul[5;1]$|$\}} \\ + \\ + Beispiel: Text unter den Noten anordnen \\ + \\ + {\bf\{guitartab:[2;3]do [3;0]re [3;2]mi [3;3]fa $|$[4;0]so [4;2]la [5;0]si [5;1]do$|$\}} \\ + \\ + Beispiel: Eine einfache Bass-Tabulatur \\ + \\ + {\bf\{basstab:[2;5][2;5]$|$[2;5][2;5]$|$[3;5][3;5]$|$[2;5][2;5]$|$[3;7][3;7]$|$[3;5][3;5]$|$[2;5]\}} \\ + \\ + Beispiel: Akkorde \\ + \\ + {\bf\{guitartab:[2;3]\&[3;5]\&[4;5]C (power chord) $|$[2;3]\&[3;2]\&[4;0]\&[5;1]C chord\}} \\ + \subsection{N"utzliches} + \subsubsection{define} + Mit der Direktive define können Sie ein Akkord-Symbol am Ende eines Stückes erstellen. + Die Direktive kann irgendwo im Stück platziert sein.\\ + define verfügt über acht Parameter:\\ + \begin{itemize} + \item + den Akkordnamen + \item + die Nummer des ersten Bundes + \item + sechs Nummern für die sechs Saiten (ein x bedeutet, dass die Saite nicht gespielt wird) + \end{itemize} + Beispiel:\\ + \\ + {\bf\{define:A 1 x n 2 2 2 n\} \\ + \{define:Cm 3 x 1 3 3 2 1\} \\ + \{define:Gm/Bb 4 3 2 2 1 x x\}} \\ + \subsubsection{comment} + Die Direktive comment fügt einen Text ein, der nicht zum eigentlichen Stück gehört. \\ + Beispiel: \\ + \\ + {\bf\{comment: repeat chorus\} \\ + \{c: repeat chorus\}} \\ + \subsubsection{margin} + Die Direktive margin erzeugt eine Randbemerkung. Diese können z.B. dazu genutzt werden, + Hinweise für den Musiker einzufügen.\\ + Beispiel: \\ + \\ + {\bf\{margin:Fade Out\} \\ + \{m:Fade Out\}} \\ + \subsubsection{second} + In einigen Stücken hat die zweite Stimme nicht nur eine andere Melodie, sondern auch + einen anderen oder versetzt gesungenen Text. Bekannte Beispiele sind "California Dreaming" + von The Mamas And The Papas und "Help" von den Beatles. Wenn Sie die zweite Stimme mit + der Direktive second markieren erscheint sie in weißer Schrift auf grauem Hintergrund. + Wegen der proportionalen Schrift müssen Sie ein wenig experimentieren, um die korrekte + Ausrichtung zwischen erster und zweiter Stimme zu erhalten.\\ + Beispiel: \\ + \\ + {\bf[G] When I was younger so much [Hm]younger than today \\ + \{second:When when I was young\} \\ + ~[Em] I never needed anybody's [C]help in [F]any [G]way \\ + \{second:I never need help in any way\} \\ + ~[G]But now these days are gone and I'm [Bm]not so self assured \\ + \{second:Now these days are gone\} \\ + ~[Em] Now I find I've changed my mind, \\ + \{second:And now I find\} \\ + I've [C]opened [F]up the [G]doors \\ + \{second:I've opened up the doors\}} \\ + \section{\LaTeX-Kommandos und Pakete verwenden} + \subsection{\LaTeX-Kommandos} + Wie in der Einführung erwähnt, brauchen Sie nichts über \LaTeX ~zu wissen, um $GuitarTeX_2$ + zu nutzen. Wenn Sie sich mit \LaTeX ~auskennen, können Sie dessen Möglichkeiten nutzen, + um Ihre Ergebnisse weiter zu verbessern. Alle Zeilen, die mit einem Backslash beginnen, + werden in die erzeute \LaTeX-Datei übernommen. Sie können das einfach mit einem Kommando + wie diesem testen: \\ + \\ + {\bf$\backslash$marginpar\{test\}} \\ + \\ + Das Ergebnis ist eine Randbemerkung mit dem Wort ''test''. + Die \LaTeX-Kommandos werden an der Stelle ausgeführt, an der sie in der Datei vorkommen. + Manche Kommandos müssen allerdings in der sog. Präambel der \LaTeX-Datei erscheinen. + Das geschieht mit der Direktive preamble:\\ + \\ + {\bf\{preamble:$\backslash$usepackage(fancyheadings)\}}\\ + \\ + Die Direktive preamble kann irgendwo im Dokument stehen. Die enthaltenen Kommandos + erscheinen in der \LaTeX-Präambel in der Reihenfolge, in der sie in der Chord-Datei stehen. + + +\end{document} diff --git a/src/guitartex2/doc/pics/example1.pdf b/src/guitartex2/doc/pics/example1.pdf new file mode 100644 index 0000000..a57e857 Binary files /dev/null and b/src/guitartex2/doc/pics/example1.pdf differ diff --git a/src/guitartex2/doc/pics/tabs1.pdf b/src/guitartex2/doc/pics/tabs1.pdf new file mode 100644 index 0000000..27aa87c Binary files /dev/null and b/src/guitartex2/doc/pics/tabs1.pdf differ diff --git a/src/guitartex2/images/dvipdf.png b/src/guitartex2/images/dvipdf.png new file mode 100644 index 0000000..a830621 Binary files /dev/null and b/src/guitartex2/images/dvipdf.png differ diff --git a/src/guitartex2/images/dvips.png b/src/guitartex2/images/dvips.png new file mode 100644 index 0000000..fe843c3 Binary files /dev/null and b/src/guitartex2/images/dvips.png differ diff --git a/src/guitartex2/images/filenew.png b/src/guitartex2/images/filenew.png new file mode 100644 index 0000000..7be37e8 Binary files /dev/null and b/src/guitartex2/images/filenew.png differ diff --git a/src/guitartex2/images/fileopen.png b/src/guitartex2/images/fileopen.png new file mode 100644 index 0000000..a79982e Binary files /dev/null and b/src/guitartex2/images/fileopen.png differ diff --git a/src/guitartex2/images/filesave.png b/src/guitartex2/images/filesave.png new file mode 100644 index 0000000..3bc2a37 Binary files /dev/null and b/src/guitartex2/images/filesave.png differ diff --git a/src/guitartex2/images/filesaveas.png b/src/guitartex2/images/filesaveas.png new file mode 100644 index 0000000..c8d4816 Binary files /dev/null and b/src/guitartex2/images/filesaveas.png differ diff --git a/src/guitartex2/images/gitarre1.jpg b/src/guitartex2/images/gitarre1.jpg new file mode 100644 index 0000000..5b701c0 Binary files /dev/null and b/src/guitartex2/images/gitarre1.jpg differ diff --git a/src/guitartex2/images/gtx2tex.png b/src/guitartex2/images/gtx2tex.png new file mode 100644 index 0000000..42fe267 Binary files /dev/null and b/src/guitartex2/images/gtx2tex.png differ diff --git a/src/guitartex2/images/icon-down2.png b/src/guitartex2/images/icon-down2.png new file mode 100644 index 0000000..c278b75 Binary files /dev/null and b/src/guitartex2/images/icon-down2.png differ diff --git a/src/guitartex2/images/icon-up2.png b/src/guitartex2/images/icon-up2.png new file mode 100644 index 0000000..28001b5 Binary files /dev/null and b/src/guitartex2/images/icon-up2.png differ diff --git a/src/guitartex2/images/icon1.jpg b/src/guitartex2/images/icon1.jpg new file mode 100644 index 0000000..4ea7916 Binary files /dev/null and b/src/guitartex2/images/icon1.jpg differ diff --git a/src/guitartex2/images/info.png b/src/guitartex2/images/info.png new file mode 100644 index 0000000..bcd4962 Binary files /dev/null and b/src/guitartex2/images/info.png differ diff --git a/src/guitartex2/images/latex.png b/src/guitartex2/images/latex.png new file mode 100644 index 0000000..918f4a0 Binary files /dev/null and b/src/guitartex2/images/latex.png differ diff --git a/src/guitartex2/images/tex2pdf.png b/src/guitartex2/images/tex2pdf.png new file mode 100644 index 0000000..ed1b1c1 Binary files /dev/null and b/src/guitartex2/images/tex2pdf.png differ