diff options
-rw-r--r-- | COPYING | 340 | ||||
-rw-r--r-- | HISTORY | 26 | ||||
-rw-r--r-- | Makefile | 134 | ||||
-rw-r--r-- | README | 75 | ||||
-rw-r--r-- | baserender.c | 1011 | ||||
-rw-r--r-- | baserender.h | 141 | ||||
-rw-r--r-- | config.c | 403 | ||||
-rw-r--r-- | config.h | 153 | ||||
-rw-r--r-- | displaychannel.c | 325 | ||||
-rw-r--r-- | displaychannel.h | 32 | ||||
-rw-r--r-- | displaymenu.c | 423 | ||||
-rw-r--r-- | displaymenu.h | 54 | ||||
-rw-r--r-- | displaymessage.c | 22 | ||||
-rw-r--r-- | displaymessage.h | 12 | ||||
-rw-r--r-- | displayreplay.c | 149 | ||||
-rw-r--r-- | displayreplay.h | 27 | ||||
-rw-r--r-- | displaytracks.c | 70 | ||||
-rw-r--r-- | displaytracks.h | 20 | ||||
-rw-r--r-- | displayvolume.c | 70 | ||||
-rw-r--r-- | displayvolume.h | 19 | ||||
-rw-r--r-- | flat.c | 51 | ||||
-rw-r--r-- | flat.h | 192 | ||||
-rw-r--r-- | icons/COPYRIGHT | 14 | ||||
-rw-r--r-- | icons/def_rectalpha/Chart 8.png | bin | 0 -> 3666 bytes | |||
-rw-r--r-- | icons/def_rectalpha/chart.png | bin | 0 -> 3776 bytes | |||
-rw-r--r-- | icons/def_rectalpha/chart1.png | bin | 0 -> 4124 bytes | |||
-rw-r--r-- | icons/def_rectalpha/chart2.png | bin | 0 -> 4000 bytes | |||
-rw-r--r-- | icons/def_rectalpha/chart3.png | bin | 0 -> 3993 bytes | |||
-rw-r--r-- | icons/def_rectalpha/chart4.png | bin | 0 -> 3842 bytes | |||
-rw-r--r-- | icons/def_rectalpha/chart5.png | bin | 0 -> 3943 bytes | |||
-rw-r--r-- | icons/def_rectalpha/chart6.png | bin | 0 -> 3734 bytes | |||
-rw-r--r-- | icons/def_rectalpha/chart7.png | bin | 0 -> 3753 bytes | |||
-rw-r--r-- | icons/def_rectalpha/crypted.png | bin | 0 -> 3586 bytes | |||
-rw-r--r-- | icons/def_rectalpha/forward.png | bin | 0 -> 3360 bytes | |||
-rw-r--r-- | icons/def_rectalpha/forward_sel.png | bin | 0 -> 2501 bytes | |||
-rw-r--r-- | icons/def_rectalpha/hd.png | bin | 0 -> 3376 bytes | |||
-rw-r--r-- | icons/def_rectalpha/hd2.png | bin | 0 -> 3769 bytes | |||
-rw-r--r-- | icons/def_rectalpha/hd3.png | bin | 0 -> 3495 bytes | |||
-rw-r--r-- | icons/def_rectalpha/mute.png | bin | 0 -> 2572 bytes | |||
-rw-r--r-- | icons/def_rectalpha/pause.png | bin | 0 -> 3391 bytes | |||
-rw-r--r-- | icons/def_rectalpha/pause_sel.png | bin | 0 -> 2023 bytes | |||
-rw-r--r-- | icons/def_rectalpha/play.png | bin | 0 -> 4123 bytes | |||
-rw-r--r-- | icons/def_rectalpha/play_sel.png | bin | 0 -> 2811 bytes | |||
-rw-r--r-- | icons/def_rectalpha/prev.png | bin | 0 -> 5373 bytes | |||
-rw-r--r-- | icons/def_rectalpha/prev_sel.png | bin | 0 -> 3386 bytes | |||
-rw-r--r-- | icons/def_rectalpha/record.png | bin | 0 -> 4087 bytes | |||
-rw-r--r-- | icons/def_rectalpha/rewind.png | bin | 0 -> 3543 bytes | |||
-rw-r--r-- | icons/def_rectalpha/rewind_sel.png | bin | 0 -> 2531 bytes | |||
-rw-r--r-- | icons/def_rectalpha/sd.png | bin | 0 -> 3772 bytes | |||
-rw-r--r-- | icons/def_rectalpha/sd2.png | bin | 0 -> 4123 bytes | |||
-rw-r--r-- | icons/def_rectalpha/sd3.png | bin | 0 -> 3840 bytes | |||
-rw-r--r-- | icons/def_rectalpha/skip.png | bin | 0 -> 5208 bytes | |||
-rw-r--r-- | icons/def_rectalpha/skip_sel.png | bin | 0 -> 3446 bytes | |||
-rw-r--r-- | icons/def_rectalpha/uncrypted.png | bin | 0 -> 3585 bytes | |||
-rw-r--r-- | icons/def_round/Chart 8.png | bin | 0 -> 3666 bytes | |||
-rw-r--r-- | icons/def_round/chart.png | bin | 0 -> 3776 bytes | |||
-rw-r--r-- | icons/def_round/chart1.png | bin | 0 -> 4124 bytes | |||
-rw-r--r-- | icons/def_round/chart2.png | bin | 0 -> 4000 bytes | |||
-rw-r--r-- | icons/def_round/chart3.png | bin | 0 -> 3993 bytes | |||
-rw-r--r-- | icons/def_round/chart4.png | bin | 0 -> 3842 bytes | |||
-rw-r--r-- | icons/def_round/chart5.png | bin | 0 -> 3943 bytes | |||
-rw-r--r-- | icons/def_round/chart6.png | bin | 0 -> 3734 bytes | |||
-rw-r--r-- | icons/def_round/chart7.png | bin | 0 -> 3753 bytes | |||
-rw-r--r-- | icons/def_round/crypted.png | bin | 0 -> 3586 bytes | |||
-rw-r--r-- | icons/def_round/forward.png | bin | 0 -> 3360 bytes | |||
-rw-r--r-- | icons/def_round/forward_sel.png | bin | 0 -> 2501 bytes | |||
-rw-r--r-- | icons/def_round/hd.png | bin | 0 -> 3376 bytes | |||
-rw-r--r-- | icons/def_round/hd2.png | bin | 0 -> 3769 bytes | |||
-rw-r--r-- | icons/def_round/hd3.png | bin | 0 -> 3495 bytes | |||
-rw-r--r-- | icons/def_round/mute.png | bin | 0 -> 2572 bytes | |||
-rw-r--r-- | icons/def_round/pause.png | bin | 0 -> 3391 bytes | |||
-rw-r--r-- | icons/def_round/pause_sel.png | bin | 0 -> 2023 bytes | |||
-rw-r--r-- | icons/def_round/play.png | bin | 0 -> 4123 bytes | |||
-rw-r--r-- | icons/def_round/play_sel.png | bin | 0 -> 2811 bytes | |||
-rw-r--r-- | icons/def_round/prev.png | bin | 0 -> 5373 bytes | |||
-rw-r--r-- | icons/def_round/prev_sel.png | bin | 0 -> 3386 bytes | |||
-rw-r--r-- | icons/def_round/record.png | bin | 0 -> 4087 bytes | |||
-rw-r--r-- | icons/def_round/rewind.png | bin | 0 -> 3543 bytes | |||
-rw-r--r-- | icons/def_round/rewind_sel.png | bin | 0 -> 2531 bytes | |||
-rw-r--r-- | icons/def_round/sd.png | bin | 0 -> 3772 bytes | |||
-rw-r--r-- | icons/def_round/sd2.png | bin | 0 -> 4123 bytes | |||
-rw-r--r-- | icons/def_round/sd3.png | bin | 0 -> 3840 bytes | |||
-rw-r--r-- | icons/def_round/skip.png | bin | 0 -> 5208 bytes | |||
-rw-r--r-- | icons/def_round/skip_sel.png | bin | 0 -> 3446 bytes | |||
-rw-r--r-- | icons/def_round/uncrypted.png | bin | 0 -> 3585 bytes | |||
-rw-r--r-- | icons/def_roundalpha/Chart 8.png | bin | 0 -> 3666 bytes | |||
-rw-r--r-- | icons/def_roundalpha/chart.png | bin | 0 -> 3776 bytes | |||
-rw-r--r-- | icons/def_roundalpha/chart1.png | bin | 0 -> 4124 bytes | |||
-rw-r--r-- | icons/def_roundalpha/chart2.png | bin | 0 -> 4000 bytes | |||
-rw-r--r-- | icons/def_roundalpha/chart3.png | bin | 0 -> 3993 bytes | |||
-rw-r--r-- | icons/def_roundalpha/chart4.png | bin | 0 -> 3842 bytes | |||
-rw-r--r-- | icons/def_roundalpha/chart5.png | bin | 0 -> 3943 bytes | |||
-rw-r--r-- | icons/def_roundalpha/chart6.png | bin | 0 -> 3734 bytes | |||
-rw-r--r-- | icons/def_roundalpha/chart7.png | bin | 0 -> 3753 bytes | |||
-rw-r--r-- | icons/def_roundalpha/crypted.png | bin | 0 -> 3586 bytes | |||
-rw-r--r-- | icons/def_roundalpha/forward.png | bin | 0 -> 3360 bytes | |||
-rw-r--r-- | icons/def_roundalpha/forward_sel.png | bin | 0 -> 2501 bytes | |||
-rw-r--r-- | icons/def_roundalpha/hd.png | bin | 0 -> 3376 bytes | |||
-rw-r--r-- | icons/def_roundalpha/hd2.png | bin | 0 -> 3769 bytes | |||
-rw-r--r-- | icons/def_roundalpha/hd3.png | bin | 0 -> 3495 bytes | |||
-rw-r--r-- | icons/def_roundalpha/mute.png | bin | 0 -> 2572 bytes | |||
-rw-r--r-- | icons/def_roundalpha/pause.png | bin | 0 -> 3391 bytes | |||
-rw-r--r-- | icons/def_roundalpha/pause_sel.png | bin | 0 -> 2023 bytes | |||
-rw-r--r-- | icons/def_roundalpha/play.png | bin | 0 -> 4123 bytes | |||
-rw-r--r-- | icons/def_roundalpha/play_sel.png | bin | 0 -> 2811 bytes | |||
-rw-r--r-- | icons/def_roundalpha/prev.png | bin | 0 -> 5373 bytes | |||
-rw-r--r-- | icons/def_roundalpha/prev_sel.png | bin | 0 -> 3386 bytes | |||
-rw-r--r-- | icons/def_roundalpha/record.png | bin | 0 -> 4087 bytes | |||
-rw-r--r-- | icons/def_roundalpha/rewind.png | bin | 0 -> 3543 bytes | |||
-rw-r--r-- | icons/def_roundalpha/rewind_sel.png | bin | 0 -> 2531 bytes | |||
-rw-r--r-- | icons/def_roundalpha/sd.png | bin | 0 -> 3772 bytes | |||
-rw-r--r-- | icons/def_roundalpha/sd2.png | bin | 0 -> 4123 bytes | |||
-rw-r--r-- | icons/def_roundalpha/sd3.png | bin | 0 -> 3840 bytes | |||
-rw-r--r-- | icons/def_roundalpha/skip.png | bin | 0 -> 5208 bytes | |||
-rw-r--r-- | icons/def_roundalpha/skip_sel.png | bin | 0 -> 3446 bytes | |||
-rw-r--r-- | icons/def_roundalpha/uncrypted.png | bin | 0 -> 3585 bytes | |||
-rw-r--r-- | icons/default/Chart 8.png | bin | 0 -> 3666 bytes | |||
-rw-r--r-- | icons/default/chart.png | bin | 0 -> 3776 bytes | |||
-rw-r--r-- | icons/default/chart1.png | bin | 0 -> 4124 bytes | |||
-rw-r--r-- | icons/default/chart2.png | bin | 0 -> 4000 bytes | |||
-rw-r--r-- | icons/default/chart3.png | bin | 0 -> 3993 bytes | |||
-rw-r--r-- | icons/default/chart4.png | bin | 0 -> 3842 bytes | |||
-rw-r--r-- | icons/default/chart5.png | bin | 0 -> 3943 bytes | |||
-rw-r--r-- | icons/default/chart6.png | bin | 0 -> 3734 bytes | |||
-rw-r--r-- | icons/default/chart7.png | bin | 0 -> 3753 bytes | |||
-rw-r--r-- | icons/default/crypted.png | bin | 0 -> 3586 bytes | |||
-rw-r--r-- | icons/default/forward.png | bin | 0 -> 3360 bytes | |||
-rw-r--r-- | icons/default/forward_sel.png | bin | 0 -> 2501 bytes | |||
-rw-r--r-- | icons/default/hd.png | bin | 0 -> 3376 bytes | |||
-rw-r--r-- | icons/default/hd2.png | bin | 0 -> 3769 bytes | |||
-rw-r--r-- | icons/default/hd3.png | bin | 0 -> 3495 bytes | |||
-rw-r--r-- | icons/default/mute.png | bin | 0 -> 2572 bytes | |||
-rw-r--r-- | icons/default/pause.png | bin | 0 -> 3391 bytes | |||
-rw-r--r-- | icons/default/pause_sel.png | bin | 0 -> 2023 bytes | |||
-rw-r--r-- | icons/default/play.png | bin | 0 -> 4123 bytes | |||
-rw-r--r-- | icons/default/play_sel.png | bin | 0 -> 2811 bytes | |||
-rw-r--r-- | icons/default/prev.png | bin | 0 -> 5373 bytes | |||
-rw-r--r-- | icons/default/prev_sel.png | bin | 0 -> 3386 bytes | |||
-rw-r--r-- | icons/default/record.png | bin | 0 -> 4087 bytes | |||
-rw-r--r-- | icons/default/rewind.png | bin | 0 -> 3543 bytes | |||
-rw-r--r-- | icons/default/rewind_sel.png | bin | 0 -> 2531 bytes | |||
-rw-r--r-- | icons/default/sd.png | bin | 0 -> 3772 bytes | |||
-rw-r--r-- | icons/default/sd2.png | bin | 0 -> 4123 bytes | |||
-rw-r--r-- | icons/default/sd3.png | bin | 0 -> 3840 bytes | |||
-rw-r--r-- | icons/default/skip.png | bin | 0 -> 5208 bytes | |||
-rw-r--r-- | icons/default/skip_sel.png | bin | 0 -> 3446 bytes | |||
-rw-r--r-- | icons/default/uncrypted.png | bin | 0 -> 3585 bytes | |||
-rw-r--r-- | imageloader.c | 127 | ||||
-rw-r--r-- | imageloader.h | 35 | ||||
-rw-r--r-- | po/de_DE.po | 250 | ||||
-rw-r--r-- | setup.c | 554 | ||||
-rw-r--r-- | setup.h | 77 | ||||
-rw-r--r-- | skinflatplus.c | 134 | ||||
-rw-r--r-- | themes/flatPlus-def_rectalpha.theme | 125 | ||||
-rw-r--r-- | themes/flatPlus-def_round.theme | 125 | ||||
-rw-r--r-- | themes/flatPlus-def_roundalpha.theme | 125 |
156 files changed, 5315 insertions, 0 deletions
diff --git a/COPYING b/COPYING new file mode 100644 index 00000000..f90922ee --- /dev/null +++ b/COPYING @@ -0,0 +1,340 @@ + 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. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 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. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/HISTORY b/HISTORY new file mode 100644 index 00000000..74fd3eb3 --- /dev/null +++ b/HISTORY @@ -0,0 +1,26 @@ +VDR Plugin 'skinflatplus' Revision History +--------------------------------------- + +2013-XX-XX: Version 0.0.1 +difference to skinflat +- [add] configurable borders + - any window have its own border with separate size and type + - 6 border types: + rect, round, invert round, + rect + alpha blend, round + alpha blend, invert round + alpha blend + - configurable by theme or user +- [add] configurable progressbar + - any progressbar have its own size and type + - 10 progressbar types: + small line + big line, big line, big line + outline, + small line + big line + dot, big line + dot, big line + outline + dot, + small line + dot, outline + dot, small line + big line + alpha blend, + big line + alpha blend + - configurable by theme or user +- [add] channel icons for resolution, recording, encrypted (configurable) +- [add] show disk usage in topbar @ menu recordings & timer +- [add] show disk usage pie graph +- [add] show signal strength and quality (configurable) +- [add] hide empty color buttons (configurable) +- [add] configure menu item padding +- [add] configure osd margin diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..f1e635fd --- /dev/null +++ b/Makefile @@ -0,0 +1,134 @@ +# +# Makefile for a Video Disk Recorder plugin +# +# $Id$ + +# The official name of this plugin. +# This name will be used in the '-P...' option of VDR to load the plugin. +# By default the main source file also carries this name. +# IMPORTANT: the presence of this macro is important for the Make.config +# file. So it must be defined, even if it is not used here! +# +PLUGIN = skinflatplus + +### The version number of this plugin (taken from the main source file): + +VERSION = $(shell grep 'static const char \*VERSION *=' $(PLUGIN).c | awk '{ print $$6 }' | sed -e 's/[";]//g') + +### The directory environment: + +# Use package data if installed...otherwise assume we're under the VDR source directory: +PKGCFG = $(if $(VDRDIR),$(shell pkg-config --variable=$(1) $(VDRDIR)/vdr.pc),$(shell pkg-config --variable=$(1) vdr || pkg-config --variable=$(1) ../../../vdr.pc)) +LIBDIR = $(call PKGCFG,libdir) +LOCDIR = $(call PKGCFG,locdir) +PLGCFG = $(call PKGCFG,plgcfg) +VDRCONFDIR = $(call PKGCFG,configdir) +PLGRESDIR = $(call PKGCFG,resdir)/plugins/$(PLUGIN) +TMPDIR ?= /tmp + +### The compiler options: +export CFLAGS = $(call PKGCFG,cflags) +export CXXFLAGS = $(call PKGCFG,cxxflags) + +### Allow user defined options to overwrite defaults: + +-include $(PLGCFG) + +### The version number of VDR's plugin API: +APIVERSION = $(call PKGCFG,apiversion) + +### The name of the distribution archive: + +ARCHIVE = $(PLUGIN)-$(VERSION) +PACKAGE = vdr-$(ARCHIVE) + +### The name of the shared object file: + +SOFILE = libvdr-$(PLUGIN).so + +### Includes and Defines and Dependencies (add further entries here): + +INCLUDES += $(shell pkg-config --cflags Magick++) + +DEFINES += -DPLUGIN_NAME_I18N='"$(PLUGIN)"' + +LIBS += $(shell pkg-config --libs Magick++) + +### The object files (add further files here): + +OBJS = config.o setup.o imageloader.o baserender.o displaychannel.o displaymenu.o displaymessage.o \ + displayreplay.o displaytracks.o displayvolume.o flat.o $(PLUGIN).o + +### The main target: + +all: $(SOFILE) i18n + +### Implicit rules: + +%.o: %.c + $(CXX) -Wall $(CXXFLAGS) -c $(DEFINES) $(INCLUDES) -o $@ $< + +### Dependencies: + +MAKEDEP = $(CXX) -MM -MG +DEPFILE = .dependencies +$(DEPFILE): Makefile + @$(MAKEDEP) $(CXXFLAGS) $(DEFINES) $(INCLUDES) $(OBJS:%.o=%.c) > $@ + +-include $(DEPFILE) + +### Internationalization (I18N): + +PODIR = po +I18Npo = $(wildcard $(PODIR)/*.po) +I18Nmo = $(addsuffix .mo, $(foreach file, $(I18Npo), $(basename $(file)))) +I18Nmsgs = $(addprefix $(DESTDIR)$(LOCDIR)/, $(addsuffix /LC_MESSAGES/vdr-$(PLUGIN).mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file)))))) +I18Npot = $(PODIR)/$(PLUGIN).pot + +%.mo: %.po + msgfmt -c -o $@ $< + +$(I18Npot): $(wildcard *.c) + xgettext -C -cTRANSLATORS --no-wrap --no-location -k -ktr -ktrNOOP --package-name=vdr-$(PLUGIN) --package-version=$(VERSION) --msgid-bugs-address='<see README>' -o $@ `ls $^` + +%.po: $(I18Npot) + msgmerge -U --no-wrap --no-location --backup=none -q -N $@ $< + @touch $@ + +$(I18Nmsgs): $(DESTDIR)$(LOCDIR)/%/LC_MESSAGES/vdr-$(PLUGIN).mo: $(PODIR)/%.mo + install -D -m644 $< $@ + +.PHONY: i18n +i18n: $(I18Nmo) $(I18Npot) + +install-i18n: $(I18Nmsgs) + +### Targets: + +$(SOFILE): $(OBJS) + $(CXX) $(CXXFLAGS) $(LDFLAGS) -shared $(OBJS) $(LIBS) -o $@ + +install-lib: $(SOFILE) + install -D $^ $(DESTDIR)$(LIBDIR)/$^.$(APIVERSION) + +install-themes: + mkdir -p $(DESTDIR)$(VDRCONFDIR)/themes + cp themes/* $(DESTDIR)$(VDRCONFDIR)/themes + +install-icons: + mkdir -p $(DESTDIR)$(PLGRESDIR)/icons + cp -r icons/* $(DESTDIR)$(PLGRESDIR)/icons + +install: install-lib install-i18n install-themes install-icons + +dist: $(I18Npo) clean + @-rm -rf $(TMPDIR)/$(ARCHIVE) + @mkdir $(TMPDIR)/$(ARCHIVE) + @cp -a * $(TMPDIR)/$(ARCHIVE) + @tar czf $(PACKAGE).tgz --exclude .git* --exclude *.o --exclude *.rej --exclude *.orig -C $(TMPDIR) $(ARCHIVE) + @-rm -rf $(TMPDIR)/$(ARCHIVE) + @echo Distribution package created as $(PACKAGE).tgz + +clean: + @-rm -f $(PODIR)/*.mo $(PODIR)/*.pot + @-rm -f $(OBJS) $(DEPFILE) *.so *.tgz core* *~ @@ -0,0 +1,75 @@ +This is a "plugin" for the Video Disk Recorder (VDR). + +Written by: Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> + +Project's homepage: http://projects.vdr-developer.org/projects/plg-skinflatplus/ + + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. +See the file COPYING for more information. + +Requirements +------------ + +- VDR version >= 1.7.34 + +- Installed ImageMagick for displaying png/jpg Icons, Channel Logos and EPG Images + +Description +----------- +Skin flatPlus basiert auf dem Skin flat. Im Gegensatz zu diesem ist der Skin flatPlus grafisch aufwendiger +und an die Bedürfnisse Konfigurierbar. Derzeit ist der Hauptunterschied die Decorations mit Border und ProgressBar. + + +Installation +------------ +Installation wie bei allen VDR Plugins. + make + make install + +Für die Kanallogos empfehle ich die Logos von 3PO Repo (https://github.com/3PO/Senderlogos). +Diese können mit folgendem Befehl heruntergeladen werden: + git clone https://github.com/3PO/Senderlogos.git logos +Die Logos müssen im folgenden Ordner zur Verfügung gestellt werden: + <vdrconfigdir>/plugins/skinflat/logos/ + +Der Skin muss im Menü unter Einstellungen -> OSD ausgewählt werden. + + +Themes and theme specific Icons +------------------------------- +Der Skin ist weitestgehend über Themes anpassbar. +Die Decorations (Border, ProgressBar) sind über das Theme einstellbar. Dabei kann jeweils der Typ und +die Größe (in Pixeln) eingestellt werden. Dabei wird von dem ARGB im Theme nur B verwendet. Es muss darauf geachtet werden +das die Werte in Hex angegeben werden. Wenn man also z.B. eine Größe von 20 Pixeln angeben möchte heißt der Wert: 00000014 +Siehe dazu die Beispiele. + +Borders: + 0 = none + 1 = rect + 2 = round + 3 = invert round + 4 = rect + alpha blend + 5 = round + alpha blend + 6 = invert round + alpha blend +Beispiel: + clrChannelBorderType = 00000004 + clrChannelBorderSize = 0000000F + +ProgressBar: + 0 = small line + big line + 1 = big line + 2 = big line + outline + 3 = small line + big line + dot + 4 = big line + dot + 5 = big line + outline + dot + 6 = small line + dot + 7 = outline + dot + 8 = small line + big line + alpha blend + 9 = big line + alpha blend +Beispiel + clrChannelProgressType = 00000008 + clrChannelProgressSize = 0000000F diff --git a/baserender.c b/baserender.c new file mode 100644 index 00000000..aed366b0 --- /dev/null +++ b/baserender.c @@ -0,0 +1,1011 @@ +#include "baserender.h" +#include "flat.h" + +cFlatBaseRender::cFlatBaseRender(void) { + font = cFont::CreateFont(Setup.FontOsd, Setup.FontOsdSize ); + fontSml = cFont::CreateFont(Setup.FontSml, Setup.FontSmlSize); + fontFixed = cFont::CreateFont(Setup.FontFix, Setup.FontFixSize); + + fontHeight = font->Height(); + fontSmlHeight = fontSml->Height(); + + topBarTitle = ""; + tobBarTitleExtra1 = ""; + tobBarTitleExtra2 = ""; + topBarLastDate = ""; + topBarUpdateTitle = false; + topBarHeight = 0; + + marginItem = 5; + + scrollBarWidth = 10; + + buttonsHeight = 0; + + topBarPixmap = NULL; + buttonsPixmap = NULL; + messagePixmap = NULL; + contentPixmap = NULL; + progressBarPixmap = NULL; + progressBarPixmapBg = NULL; + decorPixmap = NULL; + + Config.ThemeCheckAndInit(); +} + +cFlatBaseRender::~cFlatBaseRender(void) { + delete font; + delete fontSml; + delete fontFixed; + + if( osd ) + { + if( topBarPixmap ) + osd->DestroyPixmap(topBarPixmap); + if( buttonsPixmap ) + osd->DestroyPixmap(buttonsPixmap); + if( messagePixmap ) + osd->DestroyPixmap(messagePixmap); + if( contentPixmap ) + osd->DestroyPixmap(contentPixmap); + if( progressBarPixmap ) + osd->DestroyPixmap(progressBarPixmap); + if( progressBarPixmapBg ) + osd->DestroyPixmap(progressBarPixmapBg); + if( decorPixmap ) + osd->DestroyPixmap(decorPixmap); + if( topBarExtraIconPixmap ) + osd->DestroyPixmap(topBarExtraIconPixmap); + + delete osd; + } +} + +void cFlatBaseRender::CreateFullOsd(void) { + CreateOsd(cOsd::OsdLeft() + Config.marginOsdHor, cOsd::OsdTop() + Config.marginOsdVer, cOsd::OsdWidth() - Config.marginOsdHor*2, cOsd::OsdHeight() - Config.marginOsdVer*2); +} + +void cFlatBaseRender::CreateOsd(int left, int top, int width, int height) { + osdWidth = width; + osdHeight = height; + + osd = cOsdProvider::NewOsd(left, top); + if (osd) { + tArea Area = { 0, 0, width, height, 32 }; + if (osd->SetAreas(&Area, 1) == oeOk) { + return; + } + } + return; +} + +void cFlatBaseRender::TopBarCreate(void) { + if( fontHeight > fontSmlHeight*2 ) + topBarHeight = fontHeight; + else + topBarHeight = fontSmlHeight * 2; + + topBarPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight)); + topBarExtraIconPixmap = osd->CreatePixmap(2, cRect(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight)); + topBarPixmap->Fill(clrTransparent); +} + +void cFlatBaseRender::TopBarSetTitle(cString title) { + topBarTitle = title; + tobBarTitleExtra1 = ""; + tobBarTitleExtra2 = ""; + topBarExtraIcon = ""; + topBarUpdateTitle = true; + topBarExtraIconSet = false; +} + +void cFlatBaseRender::TopBarSetTitleExtra(cString extra1, cString extra2) { + tobBarTitleExtra1 = extra1; + tobBarTitleExtra2 = extra2; + topBarUpdateTitle = true; +} + +void cFlatBaseRender::TopBarSetExtraIcon(cString icon) { + topBarExtraIcon = icon; + topBarExtraIconSet = true; + topBarUpdateTitle = true; +} + +// sollte bei jedum "Flush" aufgerufen werden! +void cFlatBaseRender::TopBarUpdate(void) { + cString curDate = DayDateTime(); + int TopBarWidth = osdWidth - Config.decorBorderTopBarSize*2; + + if ( strcmp(curDate, topBarLastDate) || topBarUpdateTitle ) { + topBarUpdateTitle = false; + topBarLastDate = curDate; + + int fontTop = (topBarHeight - fontHeight) / 2; + int fontSmlTop = (topBarHeight - fontSmlHeight*2) / 2; + + topBarPixmap->Fill(Theme.Color(clrTopBarBg)); + topBarPixmap->DrawText(cPoint(marginItem*2, fontTop), topBarTitle, Theme.Color(clrTopBarFont), Theme.Color(clrTopBarBg), font); + + int extra1Width = fontSml->Width(tobBarTitleExtra1); + int extra2Width = fontSml->Width(tobBarTitleExtra2); + int extraMaxWidth = max(extra1Width, extra2Width); + + int extraLeft = TopBarWidth/2 - extraMaxWidth/2; + topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop), tobBarTitleExtra1, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, extraMaxWidth); + topBarPixmap->DrawText(cPoint(extraLeft, fontSmlTop + fontSmlHeight), tobBarTitleExtra2, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, extraMaxWidth); + + topBarExtraIconPixmap->Fill(clrTransparent); + if( topBarExtraIconSet ) { + int extraIconLeft = extraLeft + extraMaxWidth + marginItem; + if (imgLoader.LoadIcon(*topBarExtraIcon)) { + int iconTop = topBarHeight / 2 - imgLoader.Height()/2; + topBarExtraIconPixmap->DrawImage(cPoint(extraIconLeft, iconTop), imgLoader.GetImage()); + } + } + time_t t; + time(&t); + + cString time = TimeString(t); + cString time2 = cString::sprintf("%s %s", *time, tr("clock")); + + int timeWidth = font->Width(*time2) + marginItem*2; + topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth, fontTop), time2, Theme.Color(clrTopBarTimeFont), Theme.Color(clrTopBarBg), font); + + cString weekday = WeekDayNameFull(t); + int weekdayWidth = fontSml->Width(*weekday); + + cString date = ShortDateString(t); + int dateWidth = fontSml->Width(*date); + + int fullWidth = max(weekdayWidth, dateWidth); + + topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop), weekday, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, fullWidth, 0, taCenter); + topBarPixmap->DrawText(cPoint(TopBarWidth - timeWidth - fullWidth - marginItem*2, fontSmlTop + fontSmlHeight), date, Theme.Color(clrTopBarDateFont), Theme.Color(clrTopBarBg), fontSml, fullWidth, 0, taCenter); + + DecorBorderDraw(Config.decorBorderTopBarSize, Config.decorBorderTopBarSize, osdWidth - Config.decorBorderTopBarSize*2, topBarHeight, Config.decorBorderTopBarSize, Config.decorBorderTopBarType, Config.decorBorderTopBarFg, Config.decorBorderTopBarBg); + } +} + +void cFlatBaseRender::ButtonsCreate(void) { + marginButtonColor = 10; + buttonColorHeight = 8; + buttonsHeight = fontHeight + marginButtonColor + buttonColorHeight; + buttonsWidth = osdWidth; + buttonsTop = osdHeight - buttonsHeight - Config.decorBorderButtonSize; + + buttonsPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderButtonSize, + buttonsTop, buttonsWidth - Config.decorBorderButtonSize*2, buttonsHeight)); + buttonsPixmap->Fill(clrTransparent); +} + +void cFlatBaseRender::ButtonsSet(const char *Red, const char *Green, const char *Yellow, const char *Blue) { + int buttonWidth = (buttonsWidth / 4) - marginItem - Config.decorBorderButtonSize*2; + + buttonsPixmap->Fill(clrTransparent); + + int x = 0; + if( !(!Config.ButtonsShowEmpty && !Red) ) { + buttonsPixmap->DrawText(cPoint(x, 0), Red, Theme.Color(clrButtonFont), Theme.Color(clrButtonBg), font, buttonWidth, fontHeight + marginButtonColor, taCenter); + buttonsPixmap->DrawRectangle(cRect(x, fontHeight + marginButtonColor, buttonWidth, buttonColorHeight), Theme.Color(clrButtonRed)); + DecorBorderDraw(x + Config.decorBorderButtonSize, buttonsTop, buttonWidth, buttonsHeight, Config.decorBorderButtonSize, Config.decorBorderButtonType, + Config.decorBorderButtonFg, Config.decorBorderButtonBg); + } + + x += buttonWidth + marginItem + Config.decorBorderButtonSize*2; + if( !(!Config.ButtonsShowEmpty && !Green) ) { + buttonsPixmap->DrawText(cPoint(x, 0), Green, Theme.Color(clrButtonFont), Theme.Color(clrButtonBg), font, buttonWidth, fontHeight + marginButtonColor, taCenter); + buttonsPixmap->DrawRectangle(cRect(x, fontHeight + marginButtonColor, buttonWidth, buttonColorHeight), Theme.Color(clrButtonGreen)); + DecorBorderDraw(x + Config.decorBorderButtonSize, buttonsTop, buttonWidth, buttonsHeight, Config.decorBorderButtonSize, Config.decorBorderButtonType, + Config.decorBorderButtonFg, Config.decorBorderButtonBg); + } + + x += buttonWidth + marginItem + Config.decorBorderButtonSize*2; + if( !(!Config.ButtonsShowEmpty && !Yellow) ) { + buttonsPixmap->DrawText(cPoint(x, 0), Yellow, Theme.Color(clrButtonFont), Theme.Color(clrButtonBg), font, buttonWidth, fontHeight + marginButtonColor, taCenter); + buttonsPixmap->DrawRectangle(cRect(x, fontHeight + marginButtonColor, buttonWidth, buttonColorHeight), Theme.Color(clrButtonYellow)); + DecorBorderDraw(x + Config.decorBorderButtonSize, buttonsTop, buttonWidth, buttonsHeight, Config.decorBorderButtonSize, Config.decorBorderButtonType, + Config.decorBorderButtonFg, Config.decorBorderButtonBg); + } + + x += buttonWidth + marginItem + Config.decorBorderButtonSize*2; + if( !(!Config.ButtonsShowEmpty && !Blue) ) { + buttonsPixmap->DrawText(cPoint(x, 0), Blue, Theme.Color(clrButtonFont), Theme.Color(clrButtonBg), font, buttonWidth, fontHeight + marginButtonColor, taCenter); + buttonsPixmap->DrawRectangle(cRect(x, fontHeight + marginButtonColor, buttonWidth, buttonColorHeight), Theme.Color(clrButtonBlue)); + DecorBorderDraw(x + Config.decorBorderButtonSize, buttonsTop, buttonWidth, buttonsHeight, Config.decorBorderButtonSize, Config.decorBorderButtonType, + Config.decorBorderButtonFg, Config.decorBorderButtonBg); + } +} + +void cFlatBaseRender::MessageCreate(void) { + messageHeight = fontHeight + marginItem*2; + int top = osdHeight - osdHeight/10 - messageHeight; + messagePixmap = osd->CreatePixmap(5, cRect(Config.decorBorderMessageSize, top, osdWidth - Config.decorBorderMessageSize*2, messageHeight)); + messagePixmap->Fill(clrTransparent); +} + +void cFlatBaseRender::MessageSet(eMessageType Type, const char *Text) { + tColor col = Theme.Color(clrMessageStatus); + switch (Type) { + case mtStatus: + col = Theme.Color(clrMessageStatus); + break; + case mtInfo: + col = Theme.Color(clrMessageInfo); + break; + case mtWarning: + col = Theme.Color(clrMessageWarning); + break; + case mtError: + col = Theme.Color(clrMessageError); + break; + } + messagePixmap->Fill(Theme.Color(clrMessageBg)); + + messagePixmap->DrawRectangle(cRect( 0, 0, messageHeight, messageHeight), col); + messagePixmap->DrawRectangle(cRect( osdWidth - messageHeight - Config.decorBorderMessageSize*2, 0, messageHeight, messageHeight), col); + + int textWidth = font->Width(Text); + messagePixmap->DrawText(cPoint((osdWidth - textWidth) / 2, marginItem), Text, Theme.Color(clrMessageFont), Theme.Color(clrMessageBg), font); + + int top = osdHeight - osdHeight/10 - messageHeight; + DecorBorderDraw(Config.decorBorderMessageSize, top, osdWidth - Config.decorBorderMessageSize*2, messageHeight, Config.decorBorderMessageSize, Config.decorBorderMessageType, Config.decorBorderMessageFg, Config.decorBorderMessageBg); +} + +void cFlatBaseRender::MessageClear(void) { + messagePixmap->Fill(clrTransparent); + int top = osdHeight - osdHeight/10 - messageHeight; + DecorBorderClear(Config.decorBorderMessageSize, top, osdWidth - Config.decorBorderMessageSize*2, messageHeight, Config.decorBorderMessageSize); +} + +void cFlatBaseRender::ContentCreate(int Left, int Top, int Width, int Height) { + contentHasScrollbar = false; + contentShown = false; + + contentLeft = Left; + contentTop = Top; + contentWidth = Width; + contentHeight = Height; + int lines = ContentVisibleLines(); + contentHeight = lines * fontHeight; +} + +void cFlatBaseRender::ContentSet(const char *Text, tColor ColorFg, tColor ColorBg) { + contentWrapper.Set(Text, font, contentWidth - marginItem*2); + contentColorFg = ColorFg; + contentColorBg = ColorBg; + + int contentWrapperHeight = (contentWrapper.Lines()+1) * fontHeight; + + if( contentWrapperHeight > contentHeight ) { + contentDrawPortHeight = contentWrapperHeight; + contentHasScrollbar = true; + } else { + contentDrawPortHeight = contentHeight; + contentHasScrollbar = false; + } + + contentPixmap = osd->CreatePixmap(2, cRect(contentLeft, contentTop, contentWidth, contentHeight), + cRect(0, 0, contentWidth, contentDrawPortHeight)); + + contentPixmap->Fill(contentColorBg); + + contentDraw(); + contentShown = true; +} + +bool cFlatBaseRender::ContentScrollable(void) { + return contentHasScrollbar; +} + +double cFlatBaseRender::ScrollbarSize(void) { + return (double)contentHeight / (double)contentDrawPortHeight; +} + +int cFlatBaseRender::ContentScrollTotal(void) { + return contentWrapper.Lines(); +} + +int cFlatBaseRender::ContentGetHeight(void) { + return contentHeight; +} + +int cFlatBaseRender::ContentScrollOffset(void) { + double offset; + if ( ((-1)*contentPixmap->DrawPort().Point().Y() + contentHeight + fontHeight) > contentDrawPortHeight) + offset = (double)1 - ScrollbarSize(); + else + offset = (double)((-1)*contentPixmap->DrawPort().Point().Y())/(double)((-1)*contentPixmap->DrawPort().Point().Y() + contentHeight); + return ContentScrollTotal() * offset; +} + +int cFlatBaseRender::ContentVisibleLines(void) { + return contentHeight / fontHeight; +} + +bool cFlatBaseRender::ContentScroll(bool Up, bool Page) { + int aktHeight = contentPixmap->DrawPort().Point().Y(); + int totalHeight = contentPixmap->DrawPort().Height(); + int screenHeight = contentPixmap->ViewPort().Height(); + int lineHeight = fontHeight; + bool scrolled = false; + if (Up) { + if (Page) { + int newY = aktHeight + screenHeight; + if (newY > 0) + newY = 0; + contentPixmap->SetDrawPortPoint(cPoint(0, newY)); + scrolled = true; + } else { + if (aktHeight < 0) { + contentPixmap->SetDrawPortPoint(cPoint(0, aktHeight + lineHeight)); + scrolled = true; + } + } + } else { + if (Page) { + int newY = aktHeight - screenHeight; + if ((-1)*newY > totalHeight - screenHeight) + newY = (-1)*(totalHeight - screenHeight); + contentPixmap->SetDrawPortPoint(cPoint(0, newY)); + scrolled = true; + } else { + if (totalHeight - ((-1)*aktHeight + lineHeight) > screenHeight) { + contentPixmap->SetDrawPortPoint(cPoint(0, aktHeight - lineHeight)); + scrolled = true; + } + } + } + return scrolled; +} + +bool cFlatBaseRender::ContentIsShown(void) { + return contentShown; +} + +void cFlatBaseRender::ContentClear(void) { + if( contentPixmap ) + contentPixmap->Fill(clrTransparent); + contentShown = false; +} + +void cFlatBaseRender::contentDraw(void) { + int linesText = contentWrapper.Lines(); + int currentHeight = 0; + for (int i=0; i < linesText; i++) { + currentHeight = (i)*fontHeight; + contentPixmap->DrawText(cPoint(marginItem, currentHeight), contentWrapper.GetLine(i), contentColorFg, contentColorBg, font, contentWidth - marginItem*2); + } +} + +void cFlatBaseRender::ProgressBarCreate(int Left, int Top, int Width, int Height, int MarginHor, int MarginVer, tColor ColorFg, tColor ColorBarFg, tColor ColorBg, int Type) { + progressBarTop = Top; + progressBarWidth = Width; + progressBarHeight = Height; + ProgressType = Type; + progressBarMarginHor = MarginHor; + progressBarMarginVer = MarginVer; + + progressBarColorFg = ColorFg; + progressBarColorBarFg = ColorBarFg; + progressBarColorBg = ColorBg; + + progressBarColorBarCurFg = Theme.Color(clrReplayProgressBarCurFg); + + progressBarPixmap = osd->CreatePixmap(3, cRect(Left, Top, Width, progressBarHeight)); + progressBarPixmapBg = osd->CreatePixmap(2, cRect(Left - progressBarMarginVer, Top - progressBarMarginHor, Width + progressBarMarginVer*2, progressBarHeight + progressBarMarginHor*2)); + progressBarPixmap->Fill(clrTransparent); + progressBarPixmapBg->Fill(clrTransparent); +} + +void cFlatBaseRender::ProgressBarDraw(int Current, int Total) { + ProgressBarDrawRaw(progressBarPixmap, progressBarPixmapBg, cRect(0, 0, progressBarWidth, progressBarHeight), + cRect(0, 0, progressBarWidth+progressBarMarginVer*2, progressBarHeight+progressBarMarginHor*2), + Current, Total, progressBarColorFg, progressBarColorBarFg, progressBarColorBg, ProgressType); +} + +void cFlatBaseRender::ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRect rect, cRect rectBg, int Current, int Total, tColor ColorFg, tColor ColorBarFg, tColor ColorBg, int Type) { + int Middle = rect.Height()/2; + + double percentLeft = ((double)Current) / (double)Total; + + if( PixmapBg ) + PixmapBg->DrawRectangle(cRect( rectBg.Left(), rectBg.Top(), rectBg.Width(), rectBg.Height()), ColorBg); + + if( PixmapBg == Pixmap ) + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), rect.Width(), rect.Height()), ColorBg); + else + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), rect.Width(), rect.Height()), clrTransparent); + + switch( Type ) { + case 0: // small line + big line + { + int sml = rect.Height() / 10 * 2; + if( sml <= 1 ) + sml = 2; + int big = rect.Height(); + + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (sml/2), rect.Width(), sml), ColorFg); + + if (Current > 0) + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (big/2), (rect.Width() * percentLeft), big), ColorBarFg); + break; + } + case 1: // big line + { + int big = rect.Height(); + + if (Current > 0) + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (big/2), (rect.Width() * percentLeft), big), ColorBarFg); + break; + } + case 2: // big line + outline + { + int big = rect.Height(); + int out = 1; + if( rect.Height() > 10 ) + out = 2; + // outline + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), rect.Width(), out), ColorFg); + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + rect.Height() - out, rect.Width(), out), ColorFg); + + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), out, rect.Height()), ColorFg); + Pixmap->DrawRectangle(cRect( rect.Left() + rect.Width() - out, rect.Top(), out, rect.Height()), ColorFg); + + if (Current > 0) + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (big/2), (rect.Width() * percentLeft), big), ColorBarFg); + break; + } + case 3: // small line + big line + dot + { + int sml = rect.Height() / 10 * 2; + if( sml <= 1 ) + sml = 2; + int big = rect.Height(); + + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (sml/2), rect.Width(), sml), ColorFg); + + if (Current > 0) { + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (big/2), (rect.Width() * percentLeft), big), ColorBarFg); + // dot + Pixmap->DrawEllipse(cRect( rect.Left() + (rect.Width() * percentLeft) - (big/2), rect.Top() + Middle - (big/2), big, big), ColorBarFg, 0); + } + break; + } + case 4: // big line + dot + { + int big = rect.Height(); + + if (Current > 0) { + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (big/2), (rect.Width() * percentLeft), big), ColorBarFg); + // dot + Pixmap->DrawEllipse(cRect( rect.Left() + (rect.Width() * percentLeft) - (big/2), rect.Top() + Middle - (big/2), big, big), ColorBarFg, 0); + } + break; + } + case 5: // big line + outline + dot + { + int big = rect.Height(); + int out = 1; + if( rect.Height() > 10 ) + out = 2; + // outline + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), rect.Width(), out), ColorFg); + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + rect.Height() - out, rect.Width(), out), ColorFg); + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), out, rect.Height()), ColorFg); + Pixmap->DrawRectangle(cRect( rect.Left() + rect.Width() - out, rect.Top(), out, rect.Height()), ColorFg); + + if (Current > 0) { + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (big/2), (rect.Width() * percentLeft), big), ColorBarFg); + // dot + Pixmap->DrawEllipse(cRect( rect.Left() + (rect.Width() * percentLeft) - (big/2), rect.Top() + Middle - (big/2), big, big), ColorBarFg, 0); + } + break; + } + case 6: // small line + dot + { + int sml = rect.Height() / 10 * 2; + if( sml <= 1 ) + sml = 2; + int big = rect.Height(); + + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (sml/2), rect.Width(), sml), ColorFg); + + if (Current > 0) { + // dot + Pixmap->DrawEllipse(cRect( rect.Left() + (rect.Width() * percentLeft) - (big/2), rect.Top() + Middle - (big/2), big, big), ColorBarFg, 0); + } + break; + } + case 7: // outline + dot + { + int big = rect.Height(); + int out = 1; + if( rect.Height() > 10 ) + out = 2; + // outline + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), rect.Width(), out), ColorFg); + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + rect.Height() - out, rect.Width(), out), ColorFg); + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top(), out, rect.Height()), ColorFg); + Pixmap->DrawRectangle(cRect( rect.Left() + rect.Width() - out, rect.Top(), out, rect.Height()), ColorFg); + + if (Current > 0) { + // dot + Pixmap->DrawEllipse(cRect( rect.Left() + (rect.Width() * percentLeft) - (big/2), rect.Top() + Middle - (big/2), big, big), ColorBarFg, 0); + } + break; + } + case 8: // small line + big line + alpha blend + { + int sml = rect.Height() / 10 * 2; + if( sml <= 1 ) + sml = 2; + int big = rect.Height()/2 - sml/2; + + Pixmap->DrawRectangle(cRect( rect.Left(), rect.Top() + Middle - (sml/2), rect.Width(), sml), ColorFg); + + if (Current > 0) { + DecorDrawGlowRectHor(Pixmap, rect.Left(), rect.Top(), (rect.Width() * percentLeft), big, ColorBarFg); + DecorDrawGlowRectHor(Pixmap, rect.Left(), rect.Top() + Middle + sml/2, (rect.Width() * percentLeft), big*-1, ColorBarFg); + } + break; + } + case 9: // big line + alpha blend + { + int big = rect.Height(); + + if (Current > 0) { + DecorDrawGlowRectHor(Pixmap, rect.Left(), rect.Top() + Middle - big/2, (rect.Width() * percentLeft), big/2, ColorBarFg); + DecorDrawGlowRectHor(Pixmap, rect.Left(), rect.Top() + Middle, (rect.Width() * percentLeft), big/-2, ColorBarFg); + } + break; + } + } +} + +void cFlatBaseRender::ProgressBarDrawMarks(int Current, int Total, const cMarks *Marks, tColor Color, tColor ColorCurrent) { + progressBarColorMark = Color; + progressBarColorMarkCurrent = ColorCurrent; + int posMark = 0, posMarkLast = 0, posCurrent = 0; + + int top = progressBarHeight / 2; + if( progressBarPixmapBg ) + progressBarPixmapBg->DrawRectangle(cRect( 0, progressBarMarginHor + progressBarHeight, progressBarWidth, progressBarMarginHor), progressBarColorBg); + + progressBarPixmap->Fill( progressBarColorBg ); + + int sml = Config.decorProgressReplaySize / 10 * 2; + if( sml <= 4 ) + sml = 4; + int big = Config.decorProgressReplaySize - sml*2 - 2; + + if( !Marks ) { + progressBarColorFg = progressBarColorBarCurFg; + progressBarColorBarFg = progressBarColorBarCurFg; + + ProgressBarDraw(Current, Total); + return; + } + if( !Marks->First() ) { + progressBarColorFg = progressBarColorBarCurFg; + progressBarColorBarFg = progressBarColorBarCurFg; + + ProgressBarDraw(Current, Total); + return; + } + + // the small line + progressBarPixmap->DrawRectangle(cRect( 0, top - sml/2, progressBarWidth, sml), progressBarColorFg); + + bool Start = true; + for( const cMark *m = Marks->First(); m; m = Marks->Next(m) ) { + posMark = ProgressBarMarkPos( m->Position(), Total ); + posCurrent = ProgressBarMarkPos( Current, Total ); + + ProgressBarDrawMark(posMark, posMarkLast, posCurrent, Start, m->Position() == Current); + posMarkLast = posMark; + Start = !Start; + } + if( !Start ) { + progressBarPixmap->DrawRectangle(cRect( posMarkLast, top - big/2, progressBarWidth - posMarkLast, big), progressBarColorBarFg); + if( posCurrent > posMarkLast ) + progressBarPixmap->DrawRectangle(cRect( posMarkLast, top - big/2, posCurrent - posMarkLast, big), progressBarColorBarCurFg); + } else { + // marker + progressBarPixmap->DrawRectangle(cRect( posMarkLast, top - sml/2, posCurrent - posMarkLast, sml), progressBarColorBarCurFg); + progressBarPixmap->DrawRectangle(cRect( posCurrent - big/2, top - big/2, big, big), progressBarColorBarCurFg); + + if( posCurrent > posMarkLast + sml/2 ) + progressBarPixmap->DrawRectangle(cRect( posMarkLast - sml/2, 0, sml, progressBarHeight), progressBarColorMark); + } +} + +int cFlatBaseRender::ProgressBarMarkPos(int P, int Total) { + return P * progressBarWidth / Total; +} + +void cFlatBaseRender::ProgressBarDrawMark(int posMark, int posMarkLast, int posCurrent, bool Start, bool isCurrent) +{ + int top = progressBarHeight / 2; + int sml = Config.decorProgressReplaySize / 10 * 2; + if( sml <= 4 ) + sml = 4; + int big = Config.decorProgressReplaySize - sml*2 - 2; + + int mbig = Config.decorProgressReplaySize*2; + if( Config.decorProgressReplaySize > 15 ) + mbig = Config.decorProgressReplaySize; + + // marker vertical line + if( posCurrent == posMark ) + progressBarPixmap->DrawRectangle(cRect( posMark - sml, 0, sml*2, progressBarHeight), progressBarColorMarkCurrent); + else + progressBarPixmap->DrawRectangle(cRect( posMark - sml/2, 0, sml, progressBarHeight), progressBarColorMark); + + if( Start ) { + if( posCurrent > posMark ) + progressBarPixmap->DrawRectangle(cRect( posMarkLast, top - sml/2, posMark - posMarkLast, sml), progressBarColorBarCurFg); + else { + // marker + progressBarPixmap->DrawRectangle(cRect( posCurrent - big/2, top - big/2, big, big), progressBarColorBarCurFg); + if( posCurrent > posMarkLast ) + progressBarPixmap->DrawRectangle(cRect( posMarkLast, top - sml/2, posCurrent - posMarkLast, sml), progressBarColorBarCurFg); + } + // marker top + if( isCurrent ) + progressBarPixmap->DrawRectangle(cRect( posMark - mbig/2, 0, mbig, sml), progressBarColorMarkCurrent); + else + progressBarPixmap->DrawRectangle(cRect( posMark - mbig/2, 0, mbig, sml), progressBarColorMark); + } else { + // big line + if( posCurrent > posMark ) { + progressBarPixmap->DrawRectangle(cRect( posMarkLast, top - big/2, posMark - posMarkLast, big), progressBarColorBarCurFg); + // draw last marker top + progressBarPixmap->DrawRectangle(cRect( posMarkLast - mbig/2, 0, mbig, marginItem/2), progressBarColorMark); + } else { + progressBarPixmap->DrawRectangle(cRect( posMarkLast, top - big/2, posMark - posMarkLast, big), progressBarColorBarFg); + if( posCurrent > posMarkLast ) { + progressBarPixmap->DrawRectangle(cRect( posMarkLast, top - big/2, posCurrent - posMarkLast, big), progressBarColorBarCurFg); + // draw last marker top + progressBarPixmap->DrawRectangle(cRect( posMarkLast - mbig/2, 0, mbig, marginItem/2), progressBarColorMark); + } + } + // marker bottom + if( isCurrent ) + progressBarPixmap->DrawRectangle(cRect( posMark - mbig/2, progressBarHeight - sml, mbig, sml), progressBarColorMarkCurrent); + else + progressBarPixmap->DrawRectangle(cRect( posMark - mbig/2, progressBarHeight - sml, mbig, sml), progressBarColorMark); + } + + if( posCurrent == posMarkLast ) + progressBarPixmap->DrawRectangle(cRect( posMarkLast - sml, 0, sml*2, progressBarHeight), progressBarColorMarkCurrent); + else + progressBarPixmap->DrawRectangle(cRect( posMarkLast - sml/2, 0, sml, progressBarHeight), progressBarColorMark); + +} + +void cFlatBaseRender::ScrollbarDraw(cPixmap *Pixmap, int Left, int Top, int Height, int Total, int Offset, int Shown, bool CanScrollUp, bool CanScrollDown) { + if (Total > 0 && Total > Shown) { + int scrollHeight = max(int((Height) * double(Shown) / Total + 0.5), 5); + int scrollTop = min(int(Top + (Height) * double(Offset) / Total + 0.5), Top + Height - scrollHeight); + + //Pixmap->Fill(clrTransparent); + Pixmap->DrawRectangle(cRect(Left, Top, scrollBarWidth, Height), Theme.Color(clrScrollbarBg)); + + if( scrollBarWidth <= 10 ) + Pixmap->DrawRectangle(cRect(Left, Top, 2, Height), Theme.Color(clrScrollbarFg)); + else if( scrollBarWidth <= 20 ) + Pixmap->DrawRectangle(cRect(Left, Top, 4, Height), Theme.Color(clrScrollbarFg)); + else + Pixmap->DrawRectangle(cRect(Left, Top, 6, Height), Theme.Color(clrScrollbarFg)); + Pixmap->DrawRectangle(cRect(Left, scrollTop, scrollBarWidth, scrollHeight), Theme.Color(clrScrollbarBarFg)); + } +} + +int cFlatBaseRender::ScrollBarWidth(void) { + return scrollBarWidth; +} + +void cFlatBaseRender::DecorBorderClear(int Left, int Top, int Width, int Height, int Size) { + int LeftDecor = Left - Size; + int TopDecor = Top - Size; + int WidthDecor = Width + Size*2; + int HeightDecor = Height + Size*2; + int BottomDecor = Height + Size; + + if( decorPixmap ) { + // top + decorPixmap->DrawRectangle(cRect( LeftDecor, TopDecor, WidthDecor, Size), clrTransparent); + // right + decorPixmap->DrawRectangle(cRect( LeftDecor + Size + Width, TopDecor, Size, HeightDecor), clrTransparent); + // bottom + decorPixmap->DrawRectangle(cRect( LeftDecor, TopDecor + BottomDecor, WidthDecor, Size), clrTransparent); + // left + decorPixmap->DrawRectangle(cRect( LeftDecor, TopDecor, Size, HeightDecor), clrTransparent); + } +} + +void cFlatBaseRender::DecorBorderClearByFrom(int From) { + std::list<sBorderFrom>::iterator it; + for( it = Borders.begin(); it != Borders.end(); ) { + if( (*it).From == From ) { + DecorBorderClear((*it).Left, (*it).Top, (*it).Width, (*it).Height, (*it).Size); + it = Borders.erase(it); + } else + ++it; + } +} + +void cFlatBaseRender::DecorBorderClearAll(void) { + if( decorPixmap ) + decorPixmap->Fill(clrTransparent); +} + +void cFlatBaseRender::DecorBorderDraw(int Left, int Top, int Width, int Height, int Size, int Type, tColor ColorFg, tColor ColorBg, int From) { + if( Size == 0 || Type <= 0 ) + return; + + sBorderFrom f; + f.Left = Left; + f.Top = Top; + f.Width = Width; + f.Height = Height; + f.Size = Size; + f.From = From; + + Borders.push_back(f); + + int LeftDecor = Left - Size; + int TopDecor = Top - Size; + int WidthDecor = Width + Size*2; + int HeightDecor = Height + Size*2; + int BottomDecor = Height + Size; + + if( !decorPixmap ) { + decorPixmap = osd->CreatePixmap(4, cRect(cOsd::OsdLeft(), cOsd::OsdTop(), cOsd::OsdWidth(), cOsd::OsdHeight())); + decorPixmap->Fill(clrTransparent); + } + + switch( Type ) { + case 1: // rect + // top + decorPixmap->DrawRectangle(cRect( LeftDecor, TopDecor, WidthDecor, Size), ColorBg); + // right + decorPixmap->DrawRectangle(cRect( LeftDecor + Size + Width, TopDecor, Size, HeightDecor), ColorBg); + // bottom + decorPixmap->DrawRectangle(cRect( LeftDecor, TopDecor + BottomDecor, WidthDecor, Size), ColorBg); + // left + decorPixmap->DrawRectangle(cRect( LeftDecor, TopDecor, Size, HeightDecor), ColorBg); + break; + case 2: // round + // top + decorPixmap->DrawRectangle(cRect( LeftDecor + Size, TopDecor, Width, Size), ColorBg); + // right + decorPixmap->DrawRectangle(cRect( LeftDecor + Size + Width, TopDecor + Size, Size, Height), ColorBg); + // bottom + decorPixmap->DrawRectangle(cRect( LeftDecor + Size, TopDecor + BottomDecor, Width, Size), ColorBg); + // left + decorPixmap->DrawRectangle(cRect( LeftDecor, TopDecor + Size, Size, Height), ColorBg); + + // top,left corner + decorPixmap->DrawEllipse(cRect( LeftDecor, TopDecor, Size, Size), ColorBg, 2); + // top,right corner + decorPixmap->DrawEllipse(cRect( LeftDecor + Size + Width, TopDecor, Size, Size), ColorBg, 1); + // bottom,left corner + decorPixmap->DrawEllipse(cRect( LeftDecor, TopDecor + BottomDecor, Size, Size), ColorBg, 3); + // bottom,right corner + decorPixmap->DrawEllipse(cRect( LeftDecor + Size + Width, TopDecor + BottomDecor, Size, Size), ColorBg, 4); + break; + case 3: // invert round + // top + decorPixmap->DrawRectangle(cRect( LeftDecor + Size, TopDecor, Width, Size), ColorBg); + // right + decorPixmap->DrawRectangle(cRect( LeftDecor+ Size + Width, TopDecor + Size, Size, Height), ColorBg); + // bottom + decorPixmap->DrawRectangle(cRect( LeftDecor + Size, TopDecor + BottomDecor, Width, Size), ColorBg); + // left + decorPixmap->DrawRectangle(cRect( LeftDecor, TopDecor + Size, Size, Height), ColorBg); + + // top,left corner + decorPixmap->DrawEllipse(cRect( LeftDecor, TopDecor, Size, Size), ColorBg, -4); + // top,right corner + decorPixmap->DrawEllipse(cRect( LeftDecor + Size + Width, TopDecor, Size, Size), ColorBg, -3); + // bottom,left corner + decorPixmap->DrawEllipse(cRect( LeftDecor, TopDecor + BottomDecor, Size, Size), ColorBg, -1); + // bottom,right corner + decorPixmap->DrawEllipse(cRect( LeftDecor + Size + Width, TopDecor + BottomDecor, Size, Size), ColorBg, -2); + break; + case 4: // rect + alpha blend + // top + DecorDrawGlowRectHor(decorPixmap, LeftDecor + Size, TopDecor, WidthDecor - Size*2, Size, ColorBg); + // bottom + DecorDrawGlowRectHor(decorPixmap, LeftDecor + Size, TopDecor + BottomDecor, WidthDecor - Size*2, -1*Size, ColorBg); + // left + DecorDrawGlowRectVer(decorPixmap, LeftDecor, TopDecor + Size, Size, HeightDecor - Size*2, ColorBg); + // right + DecorDrawGlowRectVer(decorPixmap, LeftDecor + Size + Width, TopDecor + Size, -1*Size, HeightDecor - Size*2, ColorBg); + + DecorDrawGlowRectTL(decorPixmap, LeftDecor, TopDecor, Size, Size, ColorBg); + DecorDrawGlowRectTR(decorPixmap, LeftDecor + Size + Width, TopDecor, Size, Size, ColorBg); + DecorDrawGlowRectBL(decorPixmap, LeftDecor, TopDecor + Size + Height, Size, Size, ColorBg); + DecorDrawGlowRectBR(decorPixmap, LeftDecor + Size + Width, TopDecor + Size + Height, Size, Size, ColorBg); + break; + case 5: // round + alpha blend + // top + DecorDrawGlowRectHor(decorPixmap, LeftDecor + Size, TopDecor, WidthDecor - Size*2, Size, ColorBg); + // bottom + DecorDrawGlowRectHor(decorPixmap, LeftDecor + Size, TopDecor + BottomDecor, WidthDecor - Size*2, -1*Size, ColorBg); + // left + DecorDrawGlowRectVer(decorPixmap, LeftDecor, TopDecor + Size, Size, HeightDecor - Size*2, ColorBg); + // right + DecorDrawGlowRectVer(decorPixmap, LeftDecor + Size + Width, TopDecor + Size, -1*Size, HeightDecor - Size*2, ColorBg); + + DecorDrawGlowEllipseTL(decorPixmap, LeftDecor, TopDecor, Size, Size, ColorBg, 2); + DecorDrawGlowEllipseTR(decorPixmap, LeftDecor + Size + Width, TopDecor, Size, Size, ColorBg, 1); + DecorDrawGlowEllipseBL(decorPixmap, LeftDecor, TopDecor + Size + Height, Size, Size, ColorBg, 3); + DecorDrawGlowEllipseBR(decorPixmap, LeftDecor + Size + Width, TopDecor + Size + Height, Size, Size, ColorBg, 4); + break; + case 6: // invert round + alpha blend + // top + DecorDrawGlowRectHor(decorPixmap, LeftDecor + Size, TopDecor, WidthDecor - Size*2, Size, ColorBg); + // bottom + DecorDrawGlowRectHor(decorPixmap, LeftDecor + Size, TopDecor + BottomDecor, WidthDecor - Size*2, -1*Size, ColorBg); + // left + DecorDrawGlowRectVer(decorPixmap, LeftDecor, TopDecor + Size, Size, HeightDecor - Size*2, ColorBg); + // right + DecorDrawGlowRectVer(decorPixmap, LeftDecor + Size + Width, TopDecor + Size, -1*Size, HeightDecor - Size*2, ColorBg); + + DecorDrawGlowEllipseTL(decorPixmap, LeftDecor, TopDecor, Size, Size, ColorBg, -4); + DecorDrawGlowEllipseTR(decorPixmap, LeftDecor + Size + Width, TopDecor, Size, Size, ColorBg, -3); + DecorDrawGlowEllipseBL(decorPixmap, LeftDecor, TopDecor + Size + Height, Size, Size, ColorBg, -1); + DecorDrawGlowEllipseBR(decorPixmap, LeftDecor + Size + Width, TopDecor + Size + Height, Size, Size, ColorBg, -2); + break; + } +} + +/* +tColor cFlatBaseRender::Multiply(tColor Color, uint8_t Alpha) +{ + tColor RB = (Color & 0x00FF00FF) * Alpha; + RB = ((RB + ((RB >> 8) & 0x00FF00FF) + 0x00800080) >> 8) & 0x00FF00FF; + tColor AG = ((Color >> 8) & 0x00FF00FF) * Alpha; + AG = ((AG + ((AG >> 8) & 0x00FF00FF) + 0x00800080)) & 0xFF00FF00; + return AG | RB; +} +*/ + +tColor cFlatBaseRender::SetAlpha(tColor Color, double am) +{ + uint8_t A = (Color & 0xFF000000) >> 24; + uint8_t R = (Color & 0x00FF0000) >> 16; + uint8_t G = (Color & 0x0000FF00) >> 8; + uint8_t B = (Color & 0x000000FF); + + A = A * am; + return ArgbToColor(A, R, G, B); +} + + +void cFlatBaseRender::DecorDrawGlowRectHor(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg) { + double Alpha; + if( Height < 0 ) { + Height *= -1; + for(int i = Height, j = 0; i >= 0; i--, j++) { + Alpha = 255.0 / Height * j; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawRectangle(cRect( Left, Top + i, Width, 1), col); + } + } else { + for(int i = 0; i < Height; i++) { + Alpha = 255.0 / Height * i; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawRectangle(cRect( Left, Top + i, Width, 1), col); + } + } +} + +void cFlatBaseRender::DecorDrawGlowRectVer(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg) { + double Alpha; + if( Width < 0 ) { + Width *= -1; + for(int i = Width, j = 0; i >= 0; i--, j++) { + Alpha = 255.0 / Width * j; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawRectangle(cRect( Left + i, Top, 1, Height), col); + } + } else { + for(int i = 0; i < Width; i++) { + Alpha = 255.0 / Width * i; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawRectangle(cRect( Left + i, Top, 1, Height), col); + } + } +} + +void cFlatBaseRender::DecorDrawGlowRectTL(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg) { + double Alpha; + + for(int i = 0; i < Width; i++) { + Alpha = 255.0 / Width * i; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawRectangle(cRect( Left + i, Top + i, Width-i, Height-i), col); + } +} + +void cFlatBaseRender::DecorDrawGlowRectTR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg) { + double Alpha; + + for(int i = 0, j = Width; i < Width; i++, j--) { + Alpha = 255.0 / Width * i; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawRectangle(cRect( Left, Top + Height-j, j, j), col); + } +} + +void cFlatBaseRender::DecorDrawGlowRectBL(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg) { + double Alpha; + + for(int i = 0, j = Width; i < Width; i++, j--) { + Alpha = 255.0 / Width * i; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawRectangle(cRect( Left + Width - j, Top, j, j), col); + } +} + +void cFlatBaseRender::DecorDrawGlowRectBR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg) { + double Alpha; + + for(int i = 0, j = Width; i < Width; i++, j--) { + Alpha = 255 / Width * i; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawRectangle(cRect( Left, Top, j, j), col); + } +} + +void cFlatBaseRender::DecorDrawGlowEllipseTL(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type) { + double Alpha; + + for(int i = 0, j = Width; i < Width; i++, j--) { + if( VDRVERSNUM < 20002 && j == 1 ) // in VDR Version < 2.0.2 osd breaks if width & height == 1 + continue; + Alpha = 255 / Width * i; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawEllipse(cRect( Left + i, Top + i, j, j), col, type); + } +} + +void cFlatBaseRender::DecorDrawGlowEllipseTR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type) { + double Alpha; + + for(int i = 0, j = Width; i < Width; i++, j--) { + if( VDRVERSNUM < 20002 && j == 1 ) // in VDR Version < 2.0.2 osd breaks if width & height == 1 + continue; + Alpha = 255 / Width * i; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawEllipse(cRect( Left, Top + Height-j, j, j), col, type); + } +} + +void cFlatBaseRender::DecorDrawGlowEllipseBL(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type) { + double Alpha; + + for(int i = 0, j = Width; i < Width; i++, j--) { + if( VDRVERSNUM < 20002 && j == 1 ) // in VDR Version < 2.0.2 osd breaks if width & height == 1 + continue; + Alpha = 255 / Width * i; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawEllipse(cRect( Left + Width - j, Top, j, j), col, type); + } +} + +void cFlatBaseRender::DecorDrawGlowEllipseBR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type) { + double Alpha; + + for(int i = 0, j = Width; i < Width; i++, j--) { + if( VDRVERSNUM < 20002 && j == 1 ) // in VDR Version < 2.0.2 osd breaks if width & height == 1 + continue; + Alpha = 255 / Width * i; + tColor col = SetAlpha(ColorBg, 100.0/255.0*Alpha/100.0); + pixmap->DrawEllipse(cRect( Left, Top, j, j), col, type); + } +} + diff --git a/baserender.h b/baserender.h new file mode 100644 index 00000000..5a51f8a7 --- /dev/null +++ b/baserender.h @@ -0,0 +1,141 @@ +#pragma once + +#include "flat.h" +#include "imageloader.h" +#include <list> + +enum eBorder { + BorderMenuItem = 1 +}; + +struct sBorderFrom { + int From; + int Left, Top, Width, Height, Size; +}; + +class cFlatBaseRender +{ + protected: + cOsd *osd; + + int osdWidth, osdHeight; + int marginItem; + + // Standard fonts + cFont *font; + cFont *fontSml; + cFont *fontFixed; + int fontHeight; + int fontSmlHeight; + + // TopBar + cPixmap *topBarPixmap; + cPixmap *topBarExtraIconPixmap; + cString topBarTitle; + cString tobBarTitleExtra1, tobBarTitleExtra2; + cString topBarExtraIcon; + bool topBarExtraIconSet; + + bool topBarUpdateTitle; + cString topBarLastDate; + int topBarHeight; + + // Progressbar + cPixmap *progressBarPixmap; + cPixmap *progressBarPixmapBg; + int progressBarHeight, progressBarTop, progressBarWidth, progressBarMarginHor, progressBarMarginVer; + int ProgressType; + tColor progressBarColorFg, progressBarColorBarFg, progressBarColorBarCurFg, progressBarColorBg; + tColor progressBarColorMark, progressBarColorMarkCurrent; + + // Scrollbar + int scrollBarWidth; + + // Buttons rot, grün, gelb, blau + cPixmap *buttonsPixmap; + int buttonsWidth, buttonsHeight, buttonsTop; + int marginButtonColor, buttonColorHeight; + + // Nachricht + cPixmap *messagePixmap; + int messageWidth, messageHeight; + + // Mehrzeiliger Content mit Scrollbalken + cPixmap *contentPixmap; + int contentLeft, contentTop, contentHeight, contentWidth; + int contentDrawPortHeight; // gesamthöhe des Textes + bool contentHasScrollbar; + bool contentShown; + tColor contentColorFg, contentColorBg; + cTextWrapper contentWrapper; + + cPixmap *decorPixmap; + std::list<sBorderFrom> Borders; // for clear specific Borders (clear only MenuItems and not TopBar) + + void contentDraw(void); + double ScrollbarSize(void); + + void ProgressBarDrawMark(int posMark, int posMarkLast, int posCurrent, bool Start, bool isCurrent); + int ProgressBarMarkPos(int P, int Total); + + void DecorDrawGlowRectHor(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg); + void DecorDrawGlowRectVer(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg); + + void DecorDrawGlowRectTL(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg); + void DecorDrawGlowRectTR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg); + void DecorDrawGlowRectBL(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg); + void DecorDrawGlowRectBR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg); + + void DecorDrawGlowEllipseTL(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type); + void DecorDrawGlowEllipseTR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type); + void DecorDrawGlowEllipseBL(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type); + void DecorDrawGlowEllipseBR(cPixmap *pixmap, int Left, int Top, int Width, int Height, tColor ColorBg, int type); + + //tColor Multiply(tColor Color, uint8_t Alpha); + tColor SetAlpha(tColor Color, double am); + public: + cImageLoader imgLoader; + + cFlatBaseRender(void); + ~cFlatBaseRender(void); + + void CreateFullOsd(void); + void CreateOsd(int Left, int Top, int Width, int Height); + + void TopBarCreate(void); + void TopBarSetTitle(cString title); + void TopBarSetTitleExtra(cString extra1, cString extra2); + void TopBarSetExtraIcon(cString icon); + void TopBarUpdate(void); + + void ButtonsCreate(void); + void ButtonsSet(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL); + + void MessageCreate(void); + void MessageSet(eMessageType Type, const char *Text); + void MessageClear(void); + + void ProgressBarDrawRaw(cPixmap *Pixmap, cPixmap *PixmapBg, cRect rec, cRect recBg, int Current, int Total, tColor ColorFg, tColor ColorBarFg, tColor ColorBg, int Type); + void ProgressBarCreate(int Left, int Top, int Width, int Height, int MarginHor, int MarginVer, tColor ColorFg, tColor ColorBarFg, tColor ColorBg, int Type); + void ProgressBarDraw(int Current, int Total); + void ProgressBarDrawMarks(int Current, int Total, const cMarks *Marks, tColor Color, tColor ColorCurrent); + + void ScrollbarDraw(cPixmap *Pixmap, int Left, int Top, int Height, int Total, int Offset, int Shown, bool CanScrollUp, bool CanScrollDown); + int ScrollBarWidth(void); + + void ContentCreate(int Left, int Top, int Width, int Height); + void ContentSet(const char *Text, tColor ColorFg, tColor ColorBg); + bool ContentIsShown(void); + bool ContentScrollable(void); + int ContentScrollTotal(void); + int ContentScrollOffset(void); + int ContentVisibleLines(void); + int ContentGetHeight(void); + bool ContentScroll(bool Up, bool Page); + void ContentClear(void); + + void DecorBorderDraw(int Left, int Top, int Width, int Height, int Size, int Type, tColor ColorFg, tColor ColorBg, int From = 0); + void DecorBorderClear(int Left, int Top, int Width, int Height, int Size); + void DecorBorderClearAll(void); + void DecorBorderClearByFrom(int From); +}; diff --git a/config.c b/config.c new file mode 100644 index 00000000..d4e92dce --- /dev/null +++ b/config.c @@ -0,0 +1,403 @@ +#include "config.h" + +cFlatConfig::cFlatConfig(void) { + logoPath = ""; + iconPath = ""; + + ButtonsShowEmpty = true; + + ChannelIconsShow = true; + SignalQualityShow = true; + + DiskUsageShow = true; + + MenuItemPadding = 5; + marginOsdVer = 5; + marginOsdHor = 5; + + decorBorderChannelByTheme = 1; + decorBorderChannelTypeUser = 0; + decorBorderChannelSizeUser = 0; + + decorBorderTopBarByTheme = 1; + decorBorderTopBarTypeUser = 0; + decorBorderTopBarSizeUser = 0; + + decorBorderMessageByTheme = 1; + decorBorderMessageTypeUser = 0; + decorBorderMessageSizeUser = 0; + + decorBorderVolumeByTheme = 1; + decorBorderVolumeTypeUser = 0; + decorBorderVolumeSizeUser = 0; + + decorBorderTrackByTheme = 1; + decorBorderTrackTypeUser = 0; + decorBorderTrackSizeUser = 0; + + decorBorderReplayByTheme = 1; + decorBorderReplayTypeUser = 0; + decorBorderReplaySizeUser = 0; + + decorBorderMenuItemByTheme = 1; + decorBorderMenuItemTypeUser = 0; + decorBorderMenuItemSizeUser = 0; + + decorBorderMenuContentHeadByTheme = 1; + decorBorderMenuContentHeadTypeUser = 0; + decorBorderMenuContentHeadSizeUser = 0; + + decorBorderMenuContentByTheme = 1; + decorBorderMenuContentTypeUser = 0; + decorBorderMenuContentSizeUser = 0; + + decorBorderButtonByTheme = 1; + decorBorderButtonTypeUser = 0; + decorBorderButtonSizeUser = 0; + + decorProgressChannelByTheme = 1; + decorProgressChannelTypeUser = 0; + decorProgressChannelSizeUser = 20; + + decorProgressVolumeByTheme = 1; + decorProgressVolumeTypeUser = 0; + decorProgressVolumeSizeUser = 20; + + decorProgressMenuItemByTheme = 1; + decorProgressMenuItemTypeUser = 0; + decorProgressMenuItemSizeUser = 20; + + decorProgressReplayByTheme = 1; + decorProgressReplayTypeUser = 0; + decorProgressReplaySizeUser = 40; + + decorProgressSignalByTheme = 1; + decorProgressSignalTypeUser = 0; + decorProgressSignalSizeUser = 20; + + ThemeCurrent = ""; + ThemeInit(); +} + +cFlatConfig::~cFlatConfig(void) { +} + +bool cFlatConfig::SetupParse(const char *Name, const char *Value) { + if (strcmp(Name, "decorBorderChannelByTheme") == 0) decorBorderChannelByTheme = atoi(Value); + else if (strcmp(Name, "decorBorderChannelTypeUser") == 0) decorBorderChannelTypeUser = atoi(Value); + else if (strcmp(Name, "decorBorderChannelSizeUser") == 0) decorBorderChannelSizeUser = atoi(Value); + else if (strcmp(Name, "decorBorderTopBarByTheme") == 0) decorBorderTopBarByTheme = atoi(Value); + else if (strcmp(Name, "decorBorderTopBarTypeUser") == 0) decorBorderTopBarTypeUser = atoi(Value); + else if (strcmp(Name, "decorBorderTopBarSizeUser") == 0) decorBorderTopBarSizeUser = atoi(Value); + else if (strcmp(Name, "decorBorderMessageByTheme") == 0) decorBorderMessageByTheme = atoi(Value); + else if (strcmp(Name, "decorBorderMessageTypeUser") == 0) decorBorderMessageTypeUser = atoi(Value); + else if (strcmp(Name, "decorBorderMessageSizeUser") == 0) decorBorderMessageSizeUser = atoi(Value); + else if (strcmp(Name, "decorBorderVolumeByTheme") == 0) decorBorderVolumeByTheme = atoi(Value); + else if (strcmp(Name, "decorBorderVolumeTypeUser") == 0) decorBorderVolumeTypeUser = atoi(Value); + else if (strcmp(Name, "decorBorderVolumeSizeUser") == 0) decorBorderVolumeSizeUser = atoi(Value); + else if (strcmp(Name, "decorBorderTrackByTheme") == 0) decorBorderTrackByTheme = atoi(Value); + else if (strcmp(Name, "decorBorderTrackTypeUser") == 0) decorBorderTrackTypeUser = atoi(Value); + else if (strcmp(Name, "decorBorderTrackSizeUser") == 0) decorBorderTrackSizeUser = atoi(Value); + else if (strcmp(Name, "decorBorderReplayByTheme") == 0) decorBorderReplayByTheme = atoi(Value); + else if (strcmp(Name, "decorBorderReplayTypeUser") == 0) decorBorderReplayTypeUser = atoi(Value); + else if (strcmp(Name, "decorBorderReplaySizeUser") == 0) decorBorderReplaySizeUser = atoi(Value); + else if (strcmp(Name, "decorBorderMenuItemByTheme") == 0) decorBorderMenuItemByTheme = atoi(Value); + else if (strcmp(Name, "decorBorderMenuItemTypeUser") == 0) decorBorderMenuItemTypeUser = atoi(Value); + else if (strcmp(Name, "decorBorderMenuItemSizeUser") == 0) decorBorderMenuItemSizeUser = atoi(Value); + else if (strcmp(Name, "decorBorderMenuContentHeadByTheme") == 0) decorBorderMenuContentHeadByTheme = atoi(Value); + else if (strcmp(Name, "decorBorderMenuContentHeadTypeUser") == 0) decorBorderMenuContentHeadTypeUser = atoi(Value); + else if (strcmp(Name, "decorBorderMenuContentHeadSizeUser") == 0) decorBorderMenuContentHeadSizeUser = atoi(Value); + else if (strcmp(Name, "decorBorderMenuContentByTheme") == 0) decorBorderMenuContentByTheme = atoi(Value); + else if (strcmp(Name, "decorBorderMenuContentTypeUser") == 0) decorBorderMenuContentTypeUser = atoi(Value); + else if (strcmp(Name, "decorBorderMenuContentSizeUser") == 0) decorBorderMenuContentSizeUser = atoi(Value); + else if (strcmp(Name, "decorBorderButtonByTheme") == 0) decorBorderButtonByTheme = atoi(Value); + else if (strcmp(Name, "decorBorderButtonTypeUser") == 0) decorBorderButtonTypeUser = atoi(Value); + else if (strcmp(Name, "decorBorderButtonSizeUser") == 0) decorBorderButtonSizeUser = atoi(Value); + else if (strcmp(Name, "decorProgressChannelByTheme") == 0) decorProgressChannelByTheme = atoi(Value); + else if (strcmp(Name, "decorProgressChannelTypeUser") == 0) decorProgressChannelTypeUser = atoi(Value); + else if (strcmp(Name, "decorProgressChannelSizeUser") == 0) decorProgressChannelSizeUser = atoi(Value); + else if (strcmp(Name, "decorProgressVolumeByTheme") == 0) decorProgressVolumeByTheme = atoi(Value); + else if (strcmp(Name, "decorProgressVolumeTypeUser") == 0) decorProgressVolumeTypeUser = atoi(Value); + else if (strcmp(Name, "decorProgressVolumeSizeUser") == 0) decorProgressVolumeSizeUser = atoi(Value); + else if (strcmp(Name, "decorProgressMenuItemByTheme") == 0) decorProgressMenuItemByTheme = atoi(Value); + else if (strcmp(Name, "decorProgressMenuItemTypeUser") == 0) decorProgressMenuItemTypeUser = atoi(Value); + else if (strcmp(Name, "decorProgressMenuItemSizeUser") == 0) decorProgressMenuItemSizeUser = atoi(Value); + else if (strcmp(Name, "decorProgressReplayByTheme") == 0) decorProgressReplayByTheme = atoi(Value); + else if (strcmp(Name, "decorProgressReplayTypeUser") == 0) decorProgressReplayTypeUser = atoi(Value); + else if (strcmp(Name, "decorProgressReplaySizeUser") == 0) decorProgressReplaySizeUser = atoi(Value); + else if (strcmp(Name, "decorProgressSignalByTheme") == 0) decorProgressSignalByTheme = atoi(Value); + else if (strcmp(Name, "decorProgressSignalTypeUser") == 0) decorProgressSignalTypeUser = atoi(Value); + else if (strcmp(Name, "decorProgressSignalSizeUser") == 0) decorProgressSignalSizeUser = atoi(Value); + else if (strcmp(Name, "ButtonsShowEmpty") == 0) ButtonsShowEmpty = atoi(Value); + else if (strcmp(Name, "ChannelIconsShow") == 0) ChannelIconsShow = atoi(Value); + else if (strcmp(Name, "SignalQualityShow") == 0) SignalQualityShow = atoi(Value); + else if (strcmp(Name, "DiskUsageShow") == 0) DiskUsageShow = atoi(Value); + else if (strcmp(Name, "MenuItemPadding") == 0) MenuItemPadding = atoi(Value); + else if (strcmp(Name, "marginOsdVer") == 0) marginOsdVer = atoi(Value); + else if (strcmp(Name, "marginOsdHor") == 0) marginOsdHor = atoi(Value); + else return false; + return true; +} + +void cFlatConfig::ThemeCheckAndInit(void) { + if( strcmp(Theme.Name(), *ThemeCurrent) != 0 ) + { + ThemeCurrent = Theme.Name(); + ThemeInit(); + } +} + +void cFlatConfig::ThemeInit(void) { + decorBorderChannelTypeTheme = Theme.Color(clrChannelBorderType) & 0x000000FF; + decorBorderChannelSizeTheme = Theme.Color(clrChannelBorderSize) & 0x000000FF; + decorBorderChannelFg = Theme.Color(clrChannelBorderFg); + decorBorderChannelBg = Theme.Color(clrChannelBorderBg); + + decorBorderTopBarTypeTheme = Theme.Color(clrTopBarBorderType) & 0x000000FF; + decorBorderTopBarSizeTheme = Theme.Color(clrTopBarBorderSize) & 0x000000FF; + decorBorderTopBarFg = Theme.Color(clrTopBarBorderFg); + decorBorderTopBarBg = Theme.Color(clrTopBarBorderBg); + + decorBorderMessageTypeTheme = Theme.Color(clrMessageBorderType) & 0x000000FF; + decorBorderMessageSizeTheme = Theme.Color(clrMessageBorderSize) & 0x000000FF; + decorBorderMessageFg = Theme.Color(clrMessageBorderFg); + decorBorderMessageBg = Theme.Color(clrMessageBorderBg); + + decorBorderVolumeTypeTheme = Theme.Color(clrVolumeBorderType) & 0x000000FF; + decorBorderVolumeSizeTheme = Theme.Color(clrVolumeBorderSize) & 0x000000FF; + decorBorderVolumeFg = Theme.Color(clrVolumeBorderFg); + decorBorderVolumeBg = Theme.Color(clrVolumeBorderBg); + + decorBorderTrackTypeTheme = Theme.Color(clrTrackItemBorderType) & 0x000000FF; + decorBorderTrackSizeTheme = Theme.Color(clrTrackItemBorderSize) & 0x000000FF; + decorBorderTrackFg = Theme.Color(clrTrackItemBorderFg); + decorBorderTrackBg = Theme.Color(clrTrackItemBorderBg); + decorBorderTrackCurFg = Theme.Color(clrTrackItemCurrentBorderFg); + decorBorderTrackCurBg = Theme.Color(clrTrackItemCurrentBorderBg); + + decorBorderReplayTypeTheme = Theme.Color(clrReplayBorderType) & 0x000000FF; + decorBorderReplaySizeTheme = Theme.Color(clrReplayBorderSize) & 0x000000FF; + decorBorderReplayFg = Theme.Color(clrReplayBorderFg); + decorBorderReplayBg = Theme.Color(clrReplayBorderBg); + + decorBorderMenuItemTypeTheme = Theme.Color(clrMenuItemBorderType) & 0x000000FF; + decorBorderMenuItemSizeTheme = Theme.Color(clrMenuItemBorderSize) & 0x000000FF; + decorBorderMenuItemFg = Theme.Color(clrMenuItemBorderFg); + decorBorderMenuItemBg = Theme.Color(clrMenuItemBorderBg); + decorBorderMenuItemSelFg = Theme.Color(clrMenuItemSelableBorderFg); + decorBorderMenuItemSelBg = Theme.Color(clrMenuItemSelableBorderBg); + decorBorderMenuItemCurFg = Theme.Color(clrMenuItemCurrentBorderFg); + decorBorderMenuItemCurBg = Theme.Color(clrMenuItemCurrentBorderBg); + + decorBorderMenuContentHeadTypeTheme = Theme.Color(clrMenuContentHeadBorderType) & 0x000000FF; + decorBorderMenuContentHeadSizeTheme = Theme.Color(clrMenuContentHeadBorderSize) & 0x000000FF; + decorBorderMenuContentHeadFg = Theme.Color(clrMenuContentHeadBorderFg); + decorBorderMenuContentHeadBg = Theme.Color(clrMenuContentHeadBorderBg); + + decorBorderMenuContentTypeTheme = Theme.Color(clrMenuContentBorderType) & 0x000000FF; + decorBorderMenuContentSizeTheme = Theme.Color(clrMenuContentBorderSize) & 0x000000FF; + decorBorderMenuContentFg = Theme.Color(clrMenuContentBorderFg); + decorBorderMenuContentBg = Theme.Color(clrMenuContentBorderBg); + + decorBorderButtonTypeTheme = Theme.Color(clrButtonBorderType) & 0x000000FF; + decorBorderButtonSizeTheme = Theme.Color(clrButtonBorderSize) & 0x000000FF; + decorBorderButtonFg = Theme.Color(clrButtonBorderFg); + decorBorderButtonBg = Theme.Color(clrButtonBorderBg); + + decorProgressChannelTypeTheme = Theme.Color(clrChannelProgressType) & 0x000000FF; + decorProgressChannelSizeTheme = Theme.Color(clrChannelProgressSize) & 0x000000FF; + decorProgressChannelFg = Theme.Color(clrChannelProgressFg); + decorProgressChannelBarFg = Theme.Color(clrChannelProgressBarFg); + decorProgressChannelBg = Theme.Color(clrChannelProgressBg); + + decorProgressVolumeTypeTheme = Theme.Color(clrVolumeProgressType) & 0x000000FF; + decorProgressVolumeSizeTheme = Theme.Color(clrVolumeProgressSize) & 0x000000FF; + decorProgressVolumeFg = Theme.Color(clrVolumeProgressFg); + decorProgressVolumeBarFg = Theme.Color(clrVolumeProgressBarFg); + decorProgressVolumeBg = Theme.Color(clrVolumeProgressBg); + + decorProgressMenuItemTypeTheme = Theme.Color(clrMenuItemProgressType) & 0x000000FF; + decorProgressMenuItemSizeTheme = Theme.Color(clrMenuItemProgressSize) & 0x000000FF; + decorProgressMenuItemFg = Theme.Color(clrMenuItemProgressFg); + decorProgressMenuItemBarFg = Theme.Color(clrMenuItemProgressBarFg); + decorProgressMenuItemBg = Theme.Color(clrMenuItemProgressBg); + decorProgressMenuItemCurFg = Theme.Color(clrMenuItemCurProgressFg); + decorProgressMenuItemCurBarFg = Theme.Color(clrMenuItemCurProgressBarFg); + decorProgressMenuItemCurBg = Theme.Color(clrMenuItemCurProgressBg); + + decorProgressReplayTypeTheme = Theme.Color(clrReplayProgressType) & 0x000000FF; + decorProgressReplaySizeTheme = Theme.Color(clrReplayProgressSize) & 0x000000FF; + decorProgressReplayFg = Theme.Color(clrReplayProgressFg); + decorProgressReplayBarFg = Theme.Color(clrReplayProgressBarFg); + decorProgressReplayBg = Theme.Color(clrReplayProgressBg); + + decorProgressSignalTypeTheme = Theme.Color(clrChannelSignalProgressType) & 0x000000FF; + decorProgressSignalSizeTheme = Theme.Color(clrChannelSignalProgressSize) & 0x000000FF; + decorProgressSignalFg = Theme.Color(clrChannelSignalProgressFg); + decorProgressSignalBarFg = Theme.Color(clrChannelSignalProgressBarFg); + decorProgressSignalBg = Theme.Color(clrChannelSignalProgressBg); + + if( decorBorderChannelByTheme ) { + decorBorderChannelType = decorBorderChannelTypeTheme; + decorBorderChannelSize = decorBorderChannelSizeTheme; + } else { + decorBorderChannelType = decorBorderChannelTypeUser; + decorBorderChannelSize = decorBorderChannelSizeUser; + } + + if( decorBorderTopBarByTheme ) { + decorBorderTopBarType = decorBorderTopBarTypeTheme; + decorBorderTopBarSize = decorBorderTopBarSizeTheme; + } else { + decorBorderTopBarType = decorBorderTopBarTypeUser; + decorBorderTopBarSize = decorBorderTopBarSizeUser; + } + + if( decorBorderMessageByTheme ) { + decorBorderMessageType = decorBorderMessageTypeTheme; + decorBorderMessageSize = decorBorderMessageSizeTheme; + } else { + decorBorderMessageType = decorBorderMessageTypeUser; + decorBorderMessageSize = decorBorderMessageSizeUser; + } + + if( decorBorderVolumeByTheme ) { + decorBorderVolumeType = decorBorderVolumeTypeTheme; + decorBorderVolumeSize = decorBorderVolumeSizeTheme; + } else { + decorBorderVolumeType = decorBorderVolumeTypeUser; + decorBorderVolumeSize = decorBorderVolumeSizeUser; + } + + if( decorBorderTrackByTheme ) { + decorBorderTrackType = decorBorderTrackTypeTheme; + decorBorderTrackSize = decorBorderTrackSizeTheme; + } else { + decorBorderTrackType = decorBorderTrackTypeUser; + decorBorderTrackSize = decorBorderTrackSizeUser; + } + + if( decorBorderReplayByTheme ) { + decorBorderReplayType = decorBorderReplayTypeTheme; + decorBorderReplaySize = decorBorderReplaySizeTheme; + } else { + decorBorderReplayType = decorBorderReplayTypeUser; + decorBorderReplaySize = decorBorderReplaySizeUser; + } + + if( decorBorderMenuItemByTheme ) { + decorBorderMenuItemType = decorBorderMenuItemTypeTheme; + decorBorderMenuItemSize = decorBorderMenuItemSizeTheme; + } else { + decorBorderMenuItemType = decorBorderMenuItemTypeUser; + decorBorderMenuItemSize = decorBorderMenuItemSizeUser; + } + + if( decorBorderMenuContentHeadByTheme ) { + decorBorderMenuContentHeadType = decorBorderMenuContentHeadTypeTheme; + decorBorderMenuContentHeadSize = decorBorderMenuContentHeadSizeTheme; + } else { + decorBorderMenuContentHeadType = decorBorderMenuContentHeadTypeUser; + decorBorderMenuContentHeadSize = decorBorderMenuContentHeadSizeUser; + } + + if( decorBorderMenuContentByTheme ) { + decorBorderMenuContentType = decorBorderMenuContentTypeTheme; + decorBorderMenuContentSize = decorBorderMenuContentSizeTheme; + } else { + decorBorderMenuContentType = decorBorderMenuContentTypeUser; + decorBorderMenuContentSize = decorBorderMenuContentSizeUser; + } + + if( decorBorderButtonByTheme ) { + decorBorderButtonType = decorBorderButtonTypeTheme; + decorBorderButtonSize = decorBorderButtonSizeTheme; + } else { + decorBorderButtonType = decorBorderButtonTypeUser; + decorBorderButtonSize = decorBorderButtonSizeUser; + } + + if( decorProgressChannelByTheme ) { + decorProgressChannelType = decorProgressChannelTypeTheme; + decorProgressChannelSize = decorProgressChannelSizeTheme; + } else { + decorProgressChannelType = decorProgressChannelTypeUser; + decorProgressChannelSize = decorProgressChannelSizeUser; + } + + if( decorProgressVolumeByTheme ) { + decorProgressVolumeType = decorProgressVolumeTypeTheme; + decorProgressVolumeSize = decorProgressVolumeSizeTheme; + } else { + decorProgressVolumeType = decorProgressVolumeTypeUser; + decorProgressVolumeSize = decorProgressVolumeSizeUser; + } + + if( decorProgressMenuItemByTheme ) { + decorProgressMenuItemType = decorProgressMenuItemTypeTheme; + decorProgressMenuItemSize = decorProgressMenuItemSizeTheme; + } else { + decorProgressMenuItemType = decorProgressMenuItemTypeUser; + decorProgressMenuItemSize = decorProgressMenuItemSizeUser; + } + + if( decorProgressReplayByTheme ) { + decorProgressReplayType = decorProgressReplayTypeTheme; + decorProgressReplaySize = decorProgressReplaySizeTheme; + } else { + decorProgressReplayType = decorProgressReplayTypeUser; + decorProgressReplaySize = decorProgressReplaySizeUser; + } + + if( decorProgressSignalByTheme ) { + decorProgressSignalType = decorProgressSignalTypeTheme; + decorProgressSignalSize = decorProgressSignalSizeTheme; + } else { + decorProgressSignalType = decorProgressSignalTypeUser; + decorProgressSignalSize = decorProgressSignalSizeUser; + } + + if( decorBorderChannelType == 0 ) + decorBorderChannelSize = 0; + if( decorBorderTopBarType == 0 ) + decorBorderTopBarSize = 0; + if( decorBorderMessageType == 0 ) + decorBorderMessageSize = 0; + if( decorBorderVolumeType == 0 ) + decorBorderVolumeSize = 0; + if( decorBorderTrackType == 0 ) + decorBorderTrackSize = 0; + if( decorBorderReplayType == 0 ) + decorBorderReplaySize = 0; + if( decorBorderMenuItemType == 0 ) + decorBorderMenuItemSize = 0; + if( decorBorderMenuContentHeadType == 0 ) + decorBorderMenuContentHeadSize = 0; + if( decorBorderMenuContentType == 0 ) + decorBorderMenuContentSize = 0; + if( decorBorderButtonType == 0 ) + decorBorderButtonSize = 0; +} + +void cFlatConfig::Init(void) { + if( !strcmp(logoPath, "") ) + logoPath = cString::sprintf("%s/logos/", PLUGINRESOURCEPATH); + //dsyslog("skinflat: logopath: %s", *logoPath); + if( !strcmp(iconPath, "") ) + iconPath = cString::sprintf("%s/icons/", PLUGINRESOURCEPATH); + //dsyslog("skinflat: iconPath: %s", *iconPath); + + ThemeInit(); +} + +void cFlatConfig::SetLogoPath(cString path) { + logoPath = checkSlashAtEnd(*path); +} + +cString cFlatConfig::checkSlashAtEnd(std::string path) { + try { + if (!(path.at(path.size()-1) == '/')) + return cString::sprintf("%s/", path.c_str()); + } catch (...) {return path.c_str();} + return path.c_str(); +} diff --git a/config.h b/config.h new file mode 100644 index 00000000..763f0ba4 --- /dev/null +++ b/config.h @@ -0,0 +1,153 @@ +#pragma once + +#include <string> +#include <vector> + +#include <vdr/plugin.h> +#include "flat.h" + +#define PLUGINCONFIGPATH (cPlugin::ConfigDirectory(PLUGIN_NAME_I18N)) +#define PLUGINRESOURCEPATH (cPlugin::ResourceDirectory(PLUGIN_NAME_I18N)) + +class cFlatConfig +{ + private: + cString checkSlashAtEnd(std::string path); + public: + cFlatConfig(void); + ~cFlatConfig(void); + + void Init(void); + void SetLogoPath(cString path); + bool SetupParse(const char *Name, const char *Value); + + void ThemeCheckAndInit(void); + void ThemeInit(void); + public: + cString ThemeCurrent; + cString logoPath; + cString iconPath; + + // BORDER TYPES + // 0 = none + // 1 = rect + // 2 = round + // 3 = invert round + // 4 = rect + alpha blend + // 5 = round + alpha blend + // 6 = invert round + alpha blend + + int decorBorderChannelByTheme; + int decorBorderChannelTypeTheme, decorBorderChannelSizeTheme; + int decorBorderChannelTypeUser, decorBorderChannelSizeUser; + int decorBorderChannelType, decorBorderChannelSize; + tColor decorBorderChannelFg, decorBorderChannelBg; + + int decorBorderTopBarByTheme; + int decorBorderTopBarTypeTheme, decorBorderTopBarSizeTheme; + int decorBorderTopBarTypeUser, decorBorderTopBarSizeUser; + int decorBorderTopBarType, decorBorderTopBarSize; + tColor decorBorderTopBarFg, decorBorderTopBarBg; + + int decorBorderMessageByTheme; + int decorBorderMessageTypeTheme, decorBorderMessageSizeTheme; + int decorBorderMessageTypeUser, decorBorderMessageSizeUser; + int decorBorderMessageType, decorBorderMessageSize; + tColor decorBorderMessageFg, decorBorderMessageBg; + + int decorBorderVolumeByTheme; + int decorBorderVolumeTypeTheme, decorBorderVolumeSizeTheme; + int decorBorderVolumeTypeUser, decorBorderVolumeSizeUser; + int decorBorderVolumeType, decorBorderVolumeSize; + tColor decorBorderVolumeFg, decorBorderVolumeBg; + + int decorBorderTrackByTheme; + int decorBorderTrackTypeTheme, decorBorderTrackSizeTheme; + int decorBorderTrackTypeUser, decorBorderTrackSizeUser; + int decorBorderTrackType, decorBorderTrackSize; + tColor decorBorderTrackFg, decorBorderTrackBg; + tColor decorBorderTrackCurFg, decorBorderTrackCurBg; + + int decorBorderReplayByTheme; + int decorBorderReplayTypeTheme, decorBorderReplaySizeTheme; + int decorBorderReplayTypeUser, decorBorderReplaySizeUser; + int decorBorderReplayType, decorBorderReplaySize; + tColor decorBorderReplayFg, decorBorderReplayBg; + + int decorBorderMenuItemByTheme; + int decorBorderMenuItemTypeTheme, decorBorderMenuItemSizeTheme; + int decorBorderMenuItemTypeUser, decorBorderMenuItemSizeUser; + int decorBorderMenuItemType, decorBorderMenuItemSize; + tColor decorBorderMenuItemFg, decorBorderMenuItemBg; + tColor decorBorderMenuItemSelFg, decorBorderMenuItemSelBg; + tColor decorBorderMenuItemCurFg, decorBorderMenuItemCurBg; + + int decorBorderMenuContentHeadByTheme; + int decorBorderMenuContentHeadTypeTheme, decorBorderMenuContentHeadSizeTheme; + int decorBorderMenuContentHeadTypeUser, decorBorderMenuContentHeadSizeUser; + int decorBorderMenuContentHeadType, decorBorderMenuContentHeadSize; + tColor decorBorderMenuContentHeadFg, decorBorderMenuContentHeadBg; + + int decorBorderMenuContentByTheme; + int decorBorderMenuContentTypeTheme, decorBorderMenuContentSizeTheme; + int decorBorderMenuContentTypeUser, decorBorderMenuContentSizeUser; + int decorBorderMenuContentType, decorBorderMenuContentSize; + tColor decorBorderMenuContentFg, decorBorderMenuContentBg; + + int decorBorderButtonByTheme; + int decorBorderButtonTypeTheme, decorBorderButtonSizeTheme; + int decorBorderButtonTypeUser, decorBorderButtonSizeUser; + int decorBorderButtonType, decorBorderButtonSize; + tColor decorBorderButtonFg, decorBorderButtonBg; + + // PROGRESS TYPES + // 0 = small line + big line + // 1 = big line + // 2 = big line + outline + // 3 = small line + big line + dot + // 4 = big line + dot + // 5 = big line + outline + dot + // 6 = small line + dot + // 7 = outline + dot + // 8 = small line + big line + alpha blend + // 9 = big line + alpha blend + int decorProgressChannelByTheme; + int decorProgressChannelTypeTheme, decorProgressChannelSizeTheme; + int decorProgressChannelTypeUser, decorProgressChannelSizeUser; + int decorProgressChannelType, decorProgressChannelSize; + tColor decorProgressChannelFg, decorProgressChannelBarFg, decorProgressChannelBg; + + int decorProgressVolumeByTheme; + int decorProgressVolumeTypeTheme, decorProgressVolumeSizeTheme; + int decorProgressVolumeTypeUser, decorProgressVolumeSizeUser; + int decorProgressVolumeType, decorProgressVolumeSize; + tColor decorProgressVolumeFg, decorProgressVolumeBarFg, decorProgressVolumeBg; + + int decorProgressMenuItemByTheme; + int decorProgressMenuItemTypeTheme, decorProgressMenuItemSizeTheme; + int decorProgressMenuItemTypeUser, decorProgressMenuItemSizeUser; + int decorProgressMenuItemType, decorProgressMenuItemSize; + tColor decorProgressMenuItemFg, decorProgressMenuItemBarFg, decorProgressMenuItemBg; + tColor decorProgressMenuItemCurFg, decorProgressMenuItemCurBarFg, decorProgressMenuItemCurBg; + + int decorProgressReplayByTheme; + int decorProgressReplayTypeTheme, decorProgressReplaySizeTheme; + int decorProgressReplayTypeUser, decorProgressReplaySizeUser; + int decorProgressReplayType, decorProgressReplaySize; + tColor decorProgressReplayFg, decorProgressReplayBarFg, decorProgressReplayBg; + + int decorProgressSignalByTheme; + int decorProgressSignalTypeTheme, decorProgressSignalSizeTheme; + int decorProgressSignalTypeUser, decorProgressSignalSizeUser; + int decorProgressSignalType, decorProgressSignalSize; + tColor decorProgressSignalFg, decorProgressSignalBarFg, decorProgressSignalBg; + + // General Config + int ButtonsShowEmpty; + int ChannelIconsShow; + int SignalQualityShow; + int DiskUsageShow; + + int MenuItemPadding; + int marginOsdVer, marginOsdHor; +}; diff --git a/displaychannel.c b/displaychannel.c new file mode 100644 index 00000000..aac466c9 --- /dev/null +++ b/displaychannel.c @@ -0,0 +1,325 @@ +#include "displaychannel.h" + +cFlatDisplayChannel::cFlatDisplayChannel(bool WithInfo) { + present = NULL; + channelName = ""; + chanInfoTopPixmap = NULL; + chanInfoBottomPixmap = NULL; + chanLogoPixmap = NULL; + chanIconsPixmap = NULL; + + screenWidth = lastScreenWidth = 0; + + CreateFullOsd(); + if ( !osd ) + return; + TopBarCreate(); + MessageCreate(); + + channelWidth = osdWidth - Config.decorBorderChannelSize*2; + channelHeight = osdHeight - Config.decorBorderChannelSize*2; + // von unten noch oben + // 2*EPG + 2*EPGsml + heightBottom = (fontHeight*2) + (fontSmlHeight*2) + marginItem; // Top, Buttom, Between + if( Config.SignalQualityShow ) + heightBottom += max(fontSmlHeight, Config.decorProgressSignalSize) + marginItem; + else if( Config.ChannelIconsShow ) + heightBottom += fontSmlHeight + marginItem; + + int heightTop = fontHeight; + + int height = heightBottom; + chanInfoBottomPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderChannelSize, + Config.decorBorderChannelSize+channelHeight - height, channelWidth, heightBottom)); + + chanIconsPixmap = osd->CreatePixmap(2, cRect(Config.decorBorderChannelSize, + Config.decorBorderChannelSize+channelHeight - height, channelWidth, heightBottom)); + chanLogoPixmap = osd->CreatePixmap(2, cRect(Config.decorBorderChannelSize, + Config.decorBorderChannelSize+channelHeight - height, heightBottom, heightBottom)); + + height += Config.decorProgressChannelSize + marginItem*2; + ProgressBarCreate(Config.decorBorderChannelSize, Config.decorBorderChannelSize+channelHeight - height + marginItem, + channelWidth, Config.decorProgressChannelSize, marginItem, 0, + Config.decorProgressChannelFg, Config.decorProgressChannelBarFg, Config.decorProgressChannelBg, Config.decorProgressChannelType); + + height += heightTop; + chanInfoTopPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderChannelSize, + Config.decorBorderChannelSize+channelHeight - height, channelWidth, heightTop)); + + DecorBorderDraw(Config.decorBorderChannelSize, Config.decorBorderChannelSize+channelHeight - height, + channelWidth, heightTop + heightBottom + Config.decorProgressChannelSize+marginItem*2, + Config.decorBorderChannelSize, Config.decorBorderChannelType, Config.decorBorderChannelFg, Config.decorBorderChannelBg); +} + +cFlatDisplayChannel::~cFlatDisplayChannel() { + if (osd) { + if( chanInfoTopPixmap ) + osd->DestroyPixmap(chanInfoTopPixmap); + if( chanInfoBottomPixmap ) + osd->DestroyPixmap(chanInfoBottomPixmap); + if( chanLogoPixmap ) + osd->DestroyPixmap(chanLogoPixmap); + if( chanIconsPixmap ) + osd->DestroyPixmap(chanIconsPixmap); + } +} + +void cFlatDisplayChannel::SetChannel(const cChannel *Channel, int Number) { + cString channelNumber(""); + isRecording = false; + if (Channel) { + channelName = Channel->Name(); + if (!Channel->GroupSep()) + channelNumber = cString::sprintf("%d%s", Channel->Number(), Number ? "-" : ""); + else if (Number) + channelNumber = cString::sprintf("%d-", Number); + + if( Config.ChannelIconsShow ) + ChannelIconsDraw(Channel, false); + } else + channelName = ChannelString(NULL, 0); + + cString channelString = cString::sprintf("%s %s", *channelNumber, *channelName); + + chanInfoTopPixmap->Fill(Theme.Color(clrChannelBg)); + chanInfoTopPixmap->DrawText(cPoint(50, 0), channelString, Theme.Color(clrChannelFontTitle), Theme.Color(clrChannelBg), font); +} + +void cFlatDisplayChannel::ChannelIconsDraw(const cChannel *Channel, bool Resolution) { + if( !Resolution ) + chanIconsPixmap->Fill(clrTransparent); + + int width = fontSmlHeight; + int top = fontHeight*2 + fontSmlHeight*2 + marginItem; + int height = fontSmlHeight; + + if( Config.SignalQualityShow ) { + top += max(fontSmlHeight, Config.decorProgressSignalSize) / 2 - fontSmlHeight / 2; + height = max(fontSmlHeight, Config.decorProgressSignalSize); + } else + top += fontSmlHeight / 2 - fontSmlHeight / 2; + + int left = channelWidth - width - marginItem; + + // look for timers & records + time_t t = time(NULL); + for(cTimer *ti = Timers.First(); ti; ti = Timers.Next(ti)) { + if(ti->Matches(t) && (ti->Channel() == Channel)) { + if( ti->Recording() ) { + isRecording = true; + if( !Resolution ) { + if (imgLoader.LoadIcon("record", width)) { + int imageTop = top + (height - imgLoader.Height())/2; + chanIconsPixmap->DrawImage(cPoint(left, imageTop), imgLoader.GetImage()); + } + } + } + } + } + if( isRecording ) + left -= marginItem + width; + + if( !Resolution && Channel ) { + if (Channel->Ca()) { + if (imgLoader.LoadIcon("crypted", width)) { + int imageTop = top + (height - imgLoader.Height())/2; + chanIconsPixmap->DrawImage(cPoint(left, imageTop), imgLoader.GetImage()); + } + } else { + if (imgLoader.LoadIcon("uncrypted", width)) { + int imageTop = top + (height - imgLoader.Height())/2; + chanIconsPixmap->DrawImage(cPoint(left, imageTop), imgLoader.GetImage()); + } + } + } + left -= marginItem + width; + + if( Resolution ) { + cString iconName(""); + switch (screenWidth) { + case 1920: + case 1440: + case 1280: + iconName = "hd3"; + break; + case 720: + iconName = "sd3"; + break; + default: + iconName = "sd3"; + break; + } + if (imgLoader.LoadIcon(*iconName, width)) { + int imageTop = top + (height - imgLoader.Height())/2; + //chanIconsPixmap->DrawRectangle(cRect(left, 0, imgLoader.Height(), height), Theme.Color(clrChannelBg)); + chanIconsPixmap->DrawImage(cPoint(left, imageTop), imgLoader.GetImage()); + } + } +} + +void cFlatDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following) { + present = Present; + cString epgShort(""); + cString epg(""); + + chanInfoBottomPixmap->Fill(Theme.Color(clrChannelBg)); + chanLogoPixmap->Fill(clrTransparent); + + int imageHeight = heightBottom - marginItem*2; + if( imgLoader.LoadLogo(*channelName, imageHeight, imageHeight) ) { + int imageLeft = marginItem; + int imageTop = (heightBottom - imgLoader.Height() ) / 2; + + chanLogoPixmap->DrawImage( cPoint(imageLeft, imageTop), imgLoader.GetImage() ); + } + + int left = heightBottom + marginItem; + + if( Present ) { + cString startTime = Present->GetTimeString(); + cString endTime = Present->GetEndTimeString(); + + cString timeString = cString::sprintf("%s - %s", *startTime, *endTime); + int timeStringWidth = fontSml->Width(*timeString); + + int epgWidth = font->Width(Present->Title()); + int epgShortWidth = fontSml->Width(Present->ShortText()); + + int s = (int)(time(NULL) - Present->StartTime()) / 60; + int sleft = (Present->Duration() / 60) - s; + + cString seen = cString::sprintf("%d-/%d+ %d min", s, sleft, Present->Duration() / 60); + int seenWidth = fontSml->Width(*seen); + + if( epgWidth > channelWidth - left - timeStringWidth ) { + int dotsWidth = font->Width("... "); + cTextWrapper epgInfoWrapper(Present->Title(), font, channelWidth - left - timeStringWidth - dotsWidth); + epg = epgInfoWrapper.GetLine(0); + epg = cString::sprintf("%s...", *epg); + } else { + epg = Present->Title(); + } + + if( epgShortWidth > channelWidth - left - timeStringWidth ) { + int dotsWidth = fontSml->Width("... "); + cTextWrapper epgInfoWrapper(Present->ShortText(), fontSml, channelWidth - left - timeStringWidth - dotsWidth); + epgShort = epgInfoWrapper.GetLine(0); + epgShort = cString::sprintf("%s...", *epgShort); + } else { + epgShort = Present->ShortText(); + } + + chanInfoBottomPixmap->DrawText(cPoint(channelWidth - timeStringWidth - marginItem * 2, 0), *timeString, + Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontSml); + chanInfoBottomPixmap->DrawText(cPoint(channelWidth - seenWidth - marginItem * 2, fontSmlHeight), *seen, + Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontSml); + + chanInfoBottomPixmap->DrawText(cPoint(left, 0), *epg, Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), font); + chanInfoBottomPixmap->DrawText(cPoint(left, fontHeight), *epgShort, Theme.Color(clrChannelFontEpg), Theme.Color(clrChannelBg), fontSml); + + } + if( Following ) { + cString startTime = Following->GetTimeString(); + cString endTime = Following->GetEndTimeString(); + + cString timeString = cString::sprintf("%s - %s", *startTime, *endTime); + int timeStringWidth = fontSml->Width(*timeString); + + int epgWidth = fontSml->Width(Following->Title()); + int epgShortWidth = fontSml->Width(Following->ShortText()); + + cString dur = cString::sprintf("%d min", Following->Duration() / 60); + int durWidth = fontSml->Width(*dur); + + if( epgWidth > channelWidth - left - timeStringWidth ) { + int dotsWidth = font->Width("... "); + cTextWrapper epgInfoWrapper(Following->Title(), font, channelWidth - left - timeStringWidth - dotsWidth); + epg = epgInfoWrapper.GetLine(0); + epg = cString::sprintf("%s...", *epg); + } else { + epg = Following->Title(); + } + if (epgShortWidth > channelWidth - left - timeStringWidth ) { + int dotsWidth = fontSml->Width("... "); + cTextWrapper epgInfoWrapper(Following->ShortText(), fontSml, channelWidth - left - timeStringWidth - dotsWidth); + epgShort = epgInfoWrapper.GetLine(0); + epgShort = cString::sprintf("%s...", *epgShort); + } else { + epgShort = Following->ShortText(); + } + + chanInfoBottomPixmap->DrawText(cPoint(channelWidth - timeStringWidth - marginItem * 2, fontHeight + fontSmlHeight), *timeString, + Theme.Color(clrChannelFontEpgFollow), Theme.Color(clrChannelBg), fontSml); + chanInfoBottomPixmap->DrawText(cPoint(channelWidth - durWidth - marginItem * 2, fontHeight + fontSmlHeight*2), *dur, + Theme.Color(clrChannelFontEpgFollow), Theme.Color(clrChannelBg), fontSml); + + chanInfoBottomPixmap->DrawText(cPoint(left, fontHeight + fontSmlHeight), *epg, + Theme.Color(clrChannelFontEpgFollow), Theme.Color(clrChannelBg), font); + chanInfoBottomPixmap->DrawText(cPoint(left, fontHeight*2 + fontSmlHeight), *epgShort, + Theme.Color(clrChannelFontEpgFollow), Theme.Color(clrChannelBg), fontSml); + } +} + +void cFlatDisplayChannel::SetMessage(eMessageType Type, const char *Text) { + // Wenn es einen Text gibt, diesen Anzeigen ansonsten Message ausblenden + if( Text ) + MessageSet(Type, Text); + else + MessageClear(); +} + +void cFlatDisplayChannel::SignalQualityDraw(void) { + int SignalStrength = cDevice::ActualDevice()->SignalStrength(); + int SignalQuality = cDevice::ActualDevice()->SignalQuality(); + int signalWidth = channelWidth / 2; + + int top = fontHeight*2 + fontSmlHeight*2 + marginItem; + top += max(fontSmlHeight, Config.decorProgressSignalSize) / 2 - fontSmlHeight / 2; + int left = marginItem; + int progressTop = fontHeight*2 + fontSmlHeight*2 + marginItem; + progressTop += max(fontSmlHeight, Config.decorProgressSignalSize) / 2 - Config.decorProgressSignalSize / 2; + + chanInfoBottomPixmap->DrawText(cPoint(left, top), "STR", + Theme.Color(clrChannelSignalFont), Theme.Color(clrChannelBg), fontSml); + int progressLeft = left + fontSml->Width("STR") + marginItem; + int progressWidth = signalWidth / 2 - progressLeft - marginItem; + ProgressBarDrawRaw(chanInfoBottomPixmap, chanInfoBottomPixmap, cRect(progressLeft, progressTop, progressWidth, Config.decorProgressSignalSize), + cRect(progressLeft, progressTop, progressWidth, Config.decorProgressSignalSize), SignalStrength, 100, + Config.decorProgressSignalFg, Config.decorProgressSignalBarFg, Config.decorProgressSignalBg, Config.decorProgressSignalType); + + left = signalWidth / 2 + marginItem; + chanInfoBottomPixmap->DrawText(cPoint(left, top), "SNR", + Theme.Color(clrChannelSignalFont), Theme.Color(clrChannelBg), fontSml); + progressLeft = signalWidth / 2 + marginItem + fontSml->Width("STR") + marginItem*2; + progressWidth = signalWidth - progressLeft - marginItem; + + ProgressBarDrawRaw(chanInfoBottomPixmap, chanInfoBottomPixmap, cRect(progressLeft, progressTop, progressWidth, Config.decorProgressSignalSize), + cRect(progressLeft, progressTop, progressWidth, Config.decorProgressSignalSize), SignalQuality, 100, + Config.decorProgressSignalFg, Config.decorProgressSignalBarFg, Config.decorProgressSignalBg, Config.decorProgressSignalType); +} + +void cFlatDisplayChannel::Flush(void) { + int Current = 0; + int Total = 0; + if( present ) { + time_t t = time(NULL); + if (t > present->StartTime()) + Current = t - present->StartTime(); + Total = present->Duration(); + ProgressBarDraw(Current, Total); + } + if( Config.SignalQualityShow ) + SignalQualityDraw(); + + if( Config.ChannelIconsShow ) { + int screenHeight; + double aspect; + cDevice::PrimaryDevice()->GetVideoSize(screenWidth, screenHeight, aspect); + if (screenWidth != lastScreenWidth) { + ChannelIconsDraw(NULL, true); + screenWidth = lastScreenWidth; + } + } + TopBarUpdate(); + osd->Flush(); +} diff --git a/displaychannel.h b/displaychannel.h new file mode 100644 index 00000000..4af53814 --- /dev/null +++ b/displaychannel.h @@ -0,0 +1,32 @@ +#pragma once + +#include "baserender.h" + +class cFlatDisplayChannel : public cFlatBaseRender, public cSkinDisplayChannel { + private: + const cEvent *present; + + int channelWidth, channelHeight; + + cString channelName; + + cPixmap *chanInfoTopPixmap; + cPixmap *chanInfoBottomPixmap; + cPixmap *chanLogoPixmap; + cPixmap *chanIconsPixmap; + + int screenWidth, lastScreenWidth; + int heightBottom; + + bool isRecording; + void SignalQualityDraw(void); + void ChannelIconsDraw(const cChannel *Channel, bool Resolution); + + public: + cFlatDisplayChannel(bool WithInfo); + virtual ~cFlatDisplayChannel(); + virtual void SetChannel(const cChannel *Channel, int Number); + virtual void SetEvents(const cEvent *Present, const cEvent *Following); + virtual void SetMessage(eMessageType Type, const char *Text); + virtual void Flush(void); +}; diff --git a/displaymenu.c b/displaymenu.c new file mode 100644 index 00000000..1cecf368 --- /dev/null +++ b/displaymenu.c @@ -0,0 +1,423 @@ +#include "displaymenu.h" + +cFlatDisplayMenu::cFlatDisplayMenu(void) { + CreateFullOsd(); + TopBarCreate(); + ButtonsCreate(); + MessageCreate(); + + VideoDiskUsageState = -1; + + itemHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; + itemChannelHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderMenuItemSize*2; + + scrollBarWidth = ScrollBarWidth() + Config.MenuItemPadding; + scrollBarHeight = osdHeight - (topBarHeight + Config.decorBorderTopBarSize*2 + + buttonsHeight + Config.decorBorderButtonSize*2 + marginItem*3 ); + scrollBarTop = topBarHeight + marginItem + Config.decorBorderTopBarSize*2; + + menuWidth = osdWidth - scrollBarWidth; + menuTop = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize; + menuPixmap = osd->CreatePixmap(1, cRect(0, menuTop, menuWidth, scrollBarHeight )); + + chLeft = Config.decorBorderMenuContentHeadSize; + chTop = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuContentHeadSize; + chWidth = menuWidth - Config.decorBorderMenuContentHeadSize*2; + chHeight = fontHeight + fontSmlHeight*2 + marginItem*2; + contentHeadPixmap = osd->CreatePixmap(1, cRect(chLeft, chTop, chWidth, chHeight)); + + cLeft = Config.decorBorderMenuContentSize; + cTop = chTop + marginItem*3 + fontHeight + fontSmlHeight*2 + + Config.decorBorderMenuContentSize + Config.decorBorderMenuContentHeadSize; + cWidth = menuWidth - Config.decorBorderMenuContentSize*2; + cHeight = osdHeight - (topBarHeight + Config.decorBorderTopBarSize*2 + + buttonsHeight + Config.decorBorderButtonSize*2 + marginItem*3 + + chHeight + Config.decorBorderMenuContentHeadSize*2 + Config.decorBorderMenuContentSize*2); + ContentCreate(cLeft, cTop, cWidth, cHeight); + + scrollbarPixmap = osd->CreatePixmap(2, cRect(osdWidth - scrollBarWidth, scrollBarTop, scrollBarWidth, scrollBarHeight)); + + menuPixmap->Fill(clrTransparent); + scrollbarPixmap->Fill(clrTransparent); + + menuCategory = mcUndefined; +} + +cFlatDisplayMenu::~cFlatDisplayMenu() { + osd->DestroyPixmap(menuPixmap); + osd->DestroyPixmap(scrollbarPixmap); + osd->DestroyPixmap(contentHeadPixmap); +} + +void cFlatDisplayMenu::SetMenuCategory(eMenuCategory MenuCategory) { + menuCategory = MenuCategory; +} + +void cFlatDisplayMenu::DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown) { + ScrollbarDraw(scrollbarPixmap, Config.MenuItemPadding, Top, Height, Total, Offset, Shown, CanScrollUp, CanScrollDown); +} + +void cFlatDisplayMenu::SetScrollbar(int Total, int Offset) { + DrawScrollbar(Total, Offset, MaxItems(), 0, ItemsHeight(), Offset > 0, Offset + MaxItems() < Total); +} + +void cFlatDisplayMenu::Scroll(bool Up, bool Page) { + // Wird das Menü gescrollt oder Content? + if( ContentIsShown() ) + { + bool scrolled = ContentScroll(Up, Page); + if( scrolled ) + { + DrawScrollbar(ContentScrollTotal(), ContentScrollOffset(), ContentVisibleLines(), contentTop - scrollBarTop, ContentGetHeight(), ContentScrollOffset() > 0, ContentScrollOffset() + ContentVisibleLines() < ContentScrollTotal()); + } + } else { + cSkinDisplayMenu::Scroll(Up, Page); + } +} + +int cFlatDisplayMenu::MaxItems(void) { + if( menuCategory == mcChannel ) + return scrollBarHeight / itemChannelHeight; + + return scrollBarHeight / itemHeight; +} + +int cFlatDisplayMenu::ItemsHeight(void) { + if( menuCategory == mcChannel ) + return MaxItems() * itemChannelHeight - Config.MenuItemPadding; + + return MaxItems() * itemHeight - Config.MenuItemPadding; +} + +void cFlatDisplayMenu::Clear(void) { + textScroller.Reset(); + menuPixmap->Fill(clrTransparent); + scrollbarPixmap->Fill(clrTransparent); + contentHeadPixmap->Fill(clrTransparent); + ContentClear(); + DecorBorderClearAll(); + // DecorBorderClearByFrom( BorderMenuItem ); +} + +void cFlatDisplayMenu::SetTitle(const char *Title) { + if( (menuCategory == mcRecording || menuCategory == mcTimer) && Config.DiskUsageShow ) { + cVideoDiskUsage::HasChanged(VideoDiskUsageState); + int DiskUsage = cVideoDiskUsage::UsedPercent(); + int FreeGB = cVideoDiskUsage::FreeMB() / 1024; + cString extra1 = cString::sprintf("%s: %d%%", tr("disk usage"), DiskUsage); + cString extra2 = cString::sprintf("%s: %d GB", tr("free space"), FreeGB); + + cString iconName("chart1"); + if( DiskUsage > 14 ) + iconName = "chart2"; + if( DiskUsage > 28 ) + iconName = "chart3"; + if( DiskUsage > 42 ) + iconName = "chart4"; + if( DiskUsage > 56 ) + iconName = "chart5"; + if( DiskUsage > 70 ) + iconName = "chart6"; + if( DiskUsage > 84 ) + iconName = "chart7"; + + TopBarSetTitle(Title); + TopBarSetTitleExtra(extra1, extra2); + TopBarSetExtraIcon(iconName); + } else + TopBarSetTitle(Title); +} + +void cFlatDisplayMenu::SetButtons(const char *Red, const char *Green, const char *Yellow, const char *Blue) { + ButtonsSet(Red, Green, Yellow, Blue); +} + +void cFlatDisplayMenu::SetMessage(eMessageType Type, const char *Text) { + if (Text) + MessageSet(Type, Text); + else + MessageClear(); +} + +void cFlatDisplayMenu::SetItem(const char *Text, int Index, bool Current, bool Selectable) { + int y = Index * itemHeight; + tColor ColorFg, ColorBg; + if (Current) { + ColorFg = Theme.Color(clrItemCurrentFont); + ColorBg = Theme.Color(clrItemCurrentBg); + } + else { + if( Selectable ) { + ColorFg = Theme.Color(clrItemSelableFont); + ColorBg = Theme.Color(clrItemSelableBg); + } else { + ColorFg = Theme.Color(clrItemFont); + ColorBg = Theme.Color(clrItemBg); + } + } + + for (int i = 0; i < MaxTabs; i++) + { + const char *s = GetTabbedText(Text, i); + if (s) { + int xt = Tab(i); + if( CheckProgressBar( s ) ) { + int colWidth = Tab(i+1) - Tab(i); + + tColor ColorFg = Config.decorProgressMenuItemFg; + tColor ColorBarFg = Config.decorProgressMenuItemBarFg; + tColor ColorBg = Config.decorProgressMenuItemBg; + if( Current ) { + ColorFg = Config.decorProgressMenuItemCurFg; + ColorBarFg = Config.decorProgressMenuItemCurBarFg; + ColorBg = Config.decorProgressMenuItemCurBg; + } + DrawProgressBarFromText(y + (itemHeight-Config.MenuItemPadding)/2 - Config.decorProgressMenuItemSize/2 - Config.decorBorderMenuItemSize, + xt + Config.decorBorderMenuItemSize, colWidth, s, ColorFg, ColorBarFg, ColorBg); + } else { + menuPixmap->DrawText(cPoint(xt + Config.decorBorderMenuItemSize, y), s, ColorFg, ColorBg, font, + menuWidth - Config.decorBorderMenuItemSize*2 - xt); + } + } + if (!Tab(i + 1)) + break; + } + + int left = Config.decorBorderMenuItemSize; + int top = topBarHeight + marginItem + Config.decorBorderTopBarSize*2 + Config.decorBorderMenuItemSize + y; + + if( Current ) + DecorBorderDraw(left, top, menuWidth - Config.decorBorderMenuItemSize*2, fontHeight, + Config.decorBorderMenuItemSize, Config.decorBorderMenuItemType, Config.decorBorderMenuItemCurFg, + Config.decorBorderMenuItemCurBg, BorderMenuItem); + else { + if( Selectable ) + DecorBorderDraw(left, top, menuWidth - Config.decorBorderMenuItemSize*2, fontHeight, + Config.decorBorderMenuItemSize, Config.decorBorderMenuItemType, Config.decorBorderMenuItemSelFg, + Config.decorBorderMenuItemSelBg, BorderMenuItem); + else + DecorBorderDraw(left, top, menuWidth - Config.decorBorderMenuItemSize*2, fontHeight, + Config.decorBorderMenuItemSize, Config.decorBorderMenuItemType, Config.decorBorderMenuItemFg, + Config.decorBorderMenuItemBg, BorderMenuItem); + } + + SetEditableWidth(menuWidth - Tab(1)); +} + +bool cFlatDisplayMenu::CheckProgressBar(const char *text) { + if (strlen(text) > 5 + && text[0] == '[' + && ((text[1] == '|')||(text[1] == ' ')) + && ((text[2] == '|')||(text[2] == ' ')) + && text[strlen(text) - 1] == ']') + return true; + return false; +} + +void cFlatDisplayMenu::DrawProgressBarFromText(int Top, int Left, int Width, const char *bar, tColor ColorFg, tColor ColorBarFg, tColor ColorBg) { + const char *p = bar + 1; + bool isProgressbar = true; + int total = 0; + int now = 0; + for (; *p != ']'; ++p) { + if (*p == ' ' || *p == '|') { + ++total; + if (*p == '|') + ++now; + } else { + isProgressbar = false; + break; + } + } + if (isProgressbar) { + double progress = (double)now/(double)total; + ProgressBarDrawRaw(menuPixmap, menuPixmap, cRect(Left, Top, Width, Config.decorProgressMenuItemSize), + cRect(Left, Top, Width, Config.decorProgressMenuItemSize), progress*total, total, + ColorFg, ColorBarFg, ColorBg, Config.decorProgressMenuItemType); + } +} + +/* +bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider) { + cSchedulesLock schedulesLock; + const cSchedules *schedules = cSchedules::Schedules(schedulesLock); + + cString buffer; + int y = Index * itemChannelHeight; + + tColor ColorFg, ColorBg; + if (Current) { + ColorFg = Theme.Color(clrItemCurrentFont); + ColorBg = Theme.Color(clrItemCurrentBg); + } + else { + if( Selectable ) { + ColorFg = Theme.Color(clrItemSelableFont); + ColorBg = Theme.Color(clrItemSelableBg); + } else { + ColorFg = Theme.Color(clrItemFont); + ColorBg = Theme.Color(clrItemBg); + } + } + menuPixmap->DrawRectangle(cRect(0, y, menuWidth, itemChannelHeight - paddingMenuItem), ColorBg); + + // event from channel + const cSchedule *Schedule = schedules->GetSchedule( Channel->GetChannelID() ); + if( Schedule ) { + const cEvent *Event = Schedule->GetPresentEvent(); + if( Event ) { + // calculate progress bar + float progress = (int)roundf( (float)(time(NULL) - Event->StartTime()) / (float) (Event->Duration()) * 100.0); + if(progress < 0) + progress = 0.; + else if(progress > 100) + progress = 100; + + if( WithProvider ) + buffer = cString::sprintf("%d\t%s - %s", Channel->Number(), Channel->Provider(), Channel->Name()); + else + buffer = cString::sprintf("%d\t%s", Channel->Number(), Channel->Name()); + + const char *s1 = GetTabbedText(buffer, 0); + if( s1 ) { + int xt = Tab(0); + menuPixmap->DrawText(cPoint(marginItem + xt, y), s1, ColorFg, ColorBg, font); + } + const char *s2 = GetTabbedText(buffer, 1); + if( s2 ) { + int xt = Tab(1); + int w = (menuWidth / 10 * 3) - marginItem; + menuPixmap->DrawText(cPoint(marginItem + xt, y), s2, ColorFg, ColorBg, font, w); + } + + menuPixmap->DrawRectangle(cRect( (menuWidth/10*3) + marginItem, y, marginItem, fontHeight), ColorBg); + + if( Current ) + ProgressBarDrawInline(menuPixmap, (menuWidth/10*3) + marginItem*2, y, menuWidth/10 - marginItem, fontHeight, + progress, 100, Theme.Color(clrMenuItemChanCurProgressFg), Theme.Color(clrMenuItemChanCurProgressBarFg), + Theme.Color(clrMenuItemChanCurProgressBg)); + else + ProgressBarDrawInline(menuPixmap, (menuWidth/10*3) + marginItem*2, y, menuWidth/10 - marginItem, fontHeight, + progress, 100, Theme.Color(clrMenuItemChanProgressFg), Theme.Color(clrMenuItemChanProgressBarFg), + Theme.Color(clrMenuItemChanProgressBg)); + menuPixmap->DrawText(cPoint((menuWidth / 10 * 4) + marginItem*2, y), Event->Title(), ColorFg, ColorBg, font); + + return true; + } + } + + // without schedule, do it like vdr + if (!Channel->GroupSep()) { + if( WithProvider ) + buffer = cString::sprintf("%d\t%s - %s", Channel->Number(), Channel->Provider(), Channel->Name()); + else + buffer = cString::sprintf("%d\t%s", Channel->Number(), Channel->Name()); + + const char *s1 = GetTabbedText(buffer, 0); + if( s1 ) { + int xt = Tab(0); + menuPixmap->DrawText(cPoint(marginItem + xt, y), s1, ColorFg, ColorBg, font); + } + const char *s2 = GetTabbedText(buffer, 1); + if( s2 ) { + int xt = Tab(1); + int w = (menuWidth / 10 * 3) - marginItem; + + menuPixmap->DrawText(cPoint(marginItem + xt, y), s2, ColorFg, ColorBg, font, w); + } + } + else { + buffer = cString::sprintf("---%s ----------------------------------------------------------------", Channel->Name()); + menuPixmap->DrawText(cPoint(marginItem, y), buffer, ColorFg, ColorBg, font); + } + + return true; +} +*/ + +void cFlatDisplayMenu::SetEvent(const cEvent *Event) { + if( !Event ) + return; + + contentHeadPixmap->Fill(clrTransparent); + contentHeadPixmap->DrawRectangle(cRect(0, 0, menuWidth, fontHeight + fontSmlHeight*2 + marginItem*2), Theme.Color(clrScrollbarBg)); + + cString date = Event->GetDateString(); + cString startTime = Event->GetTimeString(); + cString endTime = Event->GetEndTimeString(); + + cString timeString = cString::sprintf("%s %s - %s", *date, *startTime, *endTime); + + cString title = Event->Title(); + cString shortText = Event->ShortText(); + + contentHeadPixmap->DrawText(cPoint(marginItem, marginItem), timeString, Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, menuWidth - marginItem*2); + contentHeadPixmap->DrawText(cPoint(marginItem, marginItem + fontSmlHeight), title, Theme.Color(clrMenuEventFontTitle), Theme.Color(clrMenuEventBg), font, menuWidth - marginItem*2); + contentHeadPixmap->DrawText(cPoint(marginItem, marginItem + fontSmlHeight + fontHeight), shortText, Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, menuWidth - marginItem*2); + + DecorBorderDraw(chLeft, chTop, chWidth, chHeight, Config.decorBorderMenuContentHeadSize, Config.decorBorderMenuContentHeadType, + Config.decorBorderMenuContentHeadFg, Config.decorBorderMenuContentHeadBg); + + ContentSet( Event->Description(), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg) ); + if( ContentScrollable() ) + DrawScrollbar(ContentScrollTotal(), ContentScrollOffset(), ContentVisibleLines(), contentTop - scrollBarTop, ContentGetHeight(), ContentScrollOffset() > 0, ContentScrollOffset() + ContentVisibleLines() < ContentScrollTotal()); + + DecorBorderDraw(cLeft, cTop, cWidth, ContentGetHeight(), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType, + Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg); +} + +void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { + if( !Recording ) + return; + contentHeadPixmap->Fill(clrTransparent); + contentHeadPixmap->DrawRectangle(cRect(0, 0, menuWidth, fontHeight + fontSmlHeight*2 + marginItem*2), Theme.Color(clrScrollbarBg)); + + const cRecordingInfo *recInfo = Recording->Info(); + cString timeString = cString::sprintf("%s %s %s", *DateString(Recording->Start()), *TimeString(Recording->Start()), recInfo->ChannelName() ? recInfo->ChannelName() : ""); + + cString title = recInfo->Title(); + if( isempty(title) ) + title = Recording->Name(); + cString shortText = recInfo->ShortText(); + + contentHeadPixmap->DrawText(cPoint(marginItem, marginItem), timeString, Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg), fontSml, menuWidth - marginItem*2); + contentHeadPixmap->DrawText(cPoint(marginItem, marginItem + fontSmlHeight), title, Theme.Color(clrMenuRecFontTitle), Theme.Color(clrMenuRecBg), font, menuWidth - marginItem*2); + contentHeadPixmap->DrawText(cPoint(marginItem, marginItem + fontSmlHeight + fontHeight), shortText, Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg), fontSml, menuWidth - marginItem*2); + + DecorBorderDraw(chLeft, chTop, chWidth, chHeight, Config.decorBorderMenuContentHeadSize, Config.decorBorderMenuContentHeadType, + Config.decorBorderMenuContentHeadFg, Config.decorBorderMenuContentHeadBg); + + ContentSet( recInfo->Description(), Theme.Color(clrMenuRecFontInfo), Theme.Color(clrMenuRecBg) ); + if( ContentScrollable() ) + DrawScrollbar(ContentScrollTotal(), ContentScrollOffset(), ContentVisibleLines(), contentTop - scrollBarTop, ContentGetHeight(), ContentScrollOffset() > 0, ContentScrollOffset() + ContentVisibleLines() < ContentScrollTotal()); + + DecorBorderDraw(cLeft, cTop, cWidth, ContentGetHeight(), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType, + Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg); +} + +void cFlatDisplayMenu::SetText(const char *Text, bool FixedFont) { + if( !Text ) + return; + contentHeadPixmap->Fill(clrTransparent); + + ContentSet( Text, Theme.Color(clrMenuTextFont), Theme.Color(clrMenuTextBg) ); + if( ContentScrollable() ) + SetScrollbar( ContentScrollTotal(), 0 ); + + DecorBorderDraw(cLeft, cTop, cWidth, ContentGetHeight(), Config.decorBorderMenuContentSize, Config.decorBorderMenuContentType, + Config.decorBorderMenuContentFg, Config.decorBorderMenuContentBg); +} + +int cFlatDisplayMenu::GetTextAreaWidth(void) const { + return menuWidth - (marginItem*2); +} + +const cFont *cFlatDisplayMenu::GetTextAreaFont(bool FixedFont) const { + const cFont *rfont = FixedFont ? fontFixed : font; + return rfont; +} + +void cFlatDisplayMenu::Flush(void) { + TopBarUpdate(); + osd->Flush(); +} diff --git a/displaymenu.h b/displaymenu.h new file mode 100644 index 00000000..c78ce7b9 --- /dev/null +++ b/displaymenu.h @@ -0,0 +1,54 @@ +#pragma once + +#include "baserender.h" + +class cFlatDisplayMenu : public cFlatBaseRender, public cSkinDisplayMenu { + private: + cPixmap *menuPixmap; + int menuTop, menuWidth; + + eMenuCategory menuCategory; + int VideoDiskUsageState; + + int chLeft, chTop, chWidth, chHeight; + cPixmap *contentHeadPixmap; + + int cLeft, cTop, cWidth, cHeight; + + cPixmap *scrollbarPixmap; + int scrollBarTop, scrollBarWidth, scrollBarHeight; + + int itemHeight, itemChannelHeight; + + void DrawScrollbar(int Total, int Offset, int Shown, int Top, int Height, bool CanScrollUp, bool CanScrollDown); + int ItemsHeight(void); + bool CheckProgressBar(const char *text); + void DrawProgressBarFromText(int Top, int Left, int Width, const char *bar, tColor ColorFg, tColor ColorBarFg, tColor ColorBg); + public: + cFlatDisplayMenu(void); + virtual ~cFlatDisplayMenu(); + virtual void Scroll(bool Up, bool Page); + virtual int MaxItems(void); + virtual void Clear(void); + + virtual void SetMenuCategory(eMenuCategory MenuCategory); + //virtual void SetTabs(int Tab1, int Tab2 = 0, int Tab3 = 0, int Tab4 = 0, int Tab5 = 0); + + virtual void SetTitle(const char *Title); + virtual void SetButtons(const char *Red, const char *Green = NULL, const char *Yellow = NULL, const char *Blue = NULL); + virtual void SetMessage(eMessageType Type, const char *Text); + virtual void SetItem(const char *Text, int Index, bool Current, bool Selectable); + + //virtual bool SetItemEvent(const cEvent *Event, int Index, bool Current, bool Selectable, const cChannel *Channel, bool WithDate, eTimerMatch TimerMatch); + //virtual bool SetItemTimer(const cTimer *Timer, int Index, bool Current, bool Selectable); + //virtual bool SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider); + //virtual bool SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, int Level, int Total, int New); + + virtual void SetScrollbar(int Total, int Offset); + virtual void SetEvent(const cEvent *Event); + virtual void SetRecording(const cRecording *Recording); + virtual void SetText(const char *Text, bool FixedFont); + virtual int GetTextAreaWidth(void) const; + virtual const cFont *GetTextAreaFont(bool FixedFont) const; + virtual void Flush(void); +}; diff --git a/displaymessage.c b/displaymessage.c new file mode 100644 index 00000000..ec23f23e --- /dev/null +++ b/displaymessage.c @@ -0,0 +1,22 @@ +#include "displaymessage.h" + +cFlatDisplayMessage::cFlatDisplayMessage(void) { + CreateFullOsd(); + TopBarCreate(); + MessageCreate(); +} + +cFlatDisplayMessage::~cFlatDisplayMessage() { +} + +void cFlatDisplayMessage::SetMessage(eMessageType Type, const char *Text) { + if (Text) + MessageSet(Type, Text); + else + MessageClear(); +} + +void cFlatDisplayMessage::Flush(void) { + TopBarUpdate(); + osd->Flush(); +} diff --git a/displaymessage.h b/displaymessage.h new file mode 100644 index 00000000..2b1145a6 --- /dev/null +++ b/displaymessage.h @@ -0,0 +1,12 @@ +#pragma once + +#include "baserender.h" + +class cFlatDisplayMessage : public cFlatBaseRender, public cSkinDisplayMessage { + private: + public: + cFlatDisplayMessage(void); + virtual ~cFlatDisplayMessage(); + virtual void SetMessage(eMessageType Type, const char *Text); + virtual void Flush(void); +}; diff --git a/displayreplay.c b/displayreplay.c new file mode 100644 index 00000000..3fb15058 --- /dev/null +++ b/displayreplay.c @@ -0,0 +1,149 @@ +#include "displayreplay.h" + +cFlatDisplayReplay::cFlatDisplayReplay(bool ModeOnly) { + labelHeight = fontHeight + fontSmlHeight; + current = ""; + total = ""; + + CreateFullOsd(); + TopBarCreate(); + MessageCreate(); + + labelPixmap = osd->CreatePixmap(1, cRect(Config.decorBorderReplaySize, osdHeight - labelHeight - Config.decorBorderReplaySize, + osdWidth - Config.decorBorderReplaySize*2, labelHeight)); + iconsPixmap = osd->CreatePixmap(2, cRect(Config.decorBorderReplaySize, osdHeight - labelHeight - Config.decorBorderReplaySize, + osdWidth - Config.decorBorderReplaySize*2, labelHeight)); + + ProgressBarCreate(Config.decorBorderReplaySize, osdHeight - labelHeight - Config.decorProgressReplaySize - Config.decorBorderReplaySize - marginItem, + osdWidth - Config.decorBorderReplaySize*2, Config.decorProgressReplaySize, marginItem, 0, + Config.decorProgressReplayFg, Config.decorProgressReplayBarFg, Config.decorProgressReplayBg, Config.decorProgressReplayType); + + labelJump = osd->CreatePixmap(1, cRect(Config.decorBorderReplaySize, osdHeight - labelHeight - Config.decorProgressReplaySize - marginItem - fontHeight - Config.decorBorderReplaySize, + osdWidth - Config.decorBorderReplaySize*2, fontHeight)); + + labelPixmap->Fill(Theme.Color(clrReplayBg)); + labelJump->Fill(clrTransparent); + + DecorBorderDraw(Config.decorBorderReplaySize, osdHeight - labelHeight - Config.decorProgressReplaySize - Config.decorBorderReplaySize - marginItem, + osdWidth - Config.decorBorderReplaySize*2, labelHeight + Config.decorProgressReplaySize + marginItem, + Config.decorBorderReplaySize, Config.decorBorderReplayType, Config.decorBorderReplayFg, Config.decorBorderReplayBg); +} + +cFlatDisplayReplay::~cFlatDisplayReplay() { + osd->DestroyPixmap(labelPixmap); + osd->DestroyPixmap(labelJump); + osd->DestroyPixmap(iconsPixmap); +} + +void cFlatDisplayReplay::SetRecording(const cRecording *Recording) { + const cRecordingInfo *recInfo = Recording->Info(); + SetTitle( recInfo->Title() ); + cString info = ""; + if (recInfo->ShortText()) + info = cString::sprintf("%s - %s %s", recInfo->ShortText(), *ShortDateString(Recording->Start()), *TimeString(Recording->Start())); + else + info = cString::sprintf("%s %s", *ShortDateString(Recording->Start()), *TimeString(Recording->Start())); + + labelPixmap->DrawText(cPoint(marginItem, fontHeight), info, Theme.Color(clrReplayFont), Theme.Color(clrReplayBg), fontSml, osdWidth - Config.decorBorderReplaySize*2); +} + +void cFlatDisplayReplay::SetTitle(const char *Title) { + TopBarSetTitle(Title); +} + +void cFlatDisplayReplay::SetMode(bool Play, bool Forward, int Speed) { + if( Setup.ShowReplayMode ) { + int left = osdWidth - Config.decorBorderReplaySize*2 - (fontHeight * 4 + marginItem * 3); + left /= 2; + + iconsPixmap->Fill(clrTransparent); + + labelPixmap->DrawRectangle(cRect( left - font->Width("33") - marginItem, 0, fontHeight*4 + marginItem*6 + font->Width("33")*2, fontHeight), Theme.Color(clrReplayBg) ); + + cString rewind, pause, play, forward; + cString speed; + + if( Speed == -1 ) { + if( Play ) { + rewind = "rewind"; + pause = "pause"; + play = "play_sel"; + forward = "forward"; + } else { + rewind = "rewind"; + pause = "pause_sel"; + play = "play"; + forward = "forward"; + } + } else { + speed = cString::sprintf("%d", Speed); + if( Forward ) { + rewind = "rewind"; + pause = "pause"; + play = "play"; + forward = "forward_sel"; + labelPixmap->DrawText(cPoint(left + fontHeight*4 + marginItem*4, 0), speed, Theme.Color(clrReplayFontSpeed), Theme.Color(clrReplayBg), font); + } else { + rewind = "rewind_sel"; + pause = "pause"; + play = "play"; + forward = "forward"; + labelPixmap->DrawText(cPoint(left - font->Width(speed) - marginItem, 0), speed, Theme.Color(clrReplayFontSpeed), Theme.Color(clrReplayBg), font); + } + } + + if( imgLoader.LoadIcon(*rewind, fontHeight, fontHeight) ) + iconsPixmap->DrawImage( cPoint(left, 0), imgLoader.GetImage() ); + if( imgLoader.LoadIcon(*pause, fontHeight, fontHeight) ) + iconsPixmap->DrawImage( cPoint(left + fontHeight + marginItem, 0), imgLoader.GetImage() ); + if( imgLoader.LoadIcon(*play, fontHeight, fontHeight) ) + iconsPixmap->DrawImage( cPoint(left + fontHeight*2 + marginItem*2, 0), imgLoader.GetImage() ); + if( imgLoader.LoadIcon(*forward, fontHeight, fontHeight) ) + iconsPixmap->DrawImage( cPoint(left + fontHeight*3 + marginItem*3, 0), imgLoader.GetImage() ); + + } +} + +void cFlatDisplayReplay::SetProgress(int Current, int Total) { + ProgressBarDrawMarks(Current, Total, marks, Theme.Color(clrReplayMarkFg), Theme.Color(clrReplayMarkCurrentFg)); +} + +void cFlatDisplayReplay::SetCurrent(const char *Current) { + current = Current; + UpdateInfo(); +} + +void cFlatDisplayReplay::SetTotal(const char *Total) { + total = Total; + UpdateInfo(); +} + +void cFlatDisplayReplay::UpdateInfo(void) { + int right = osdWidth - Config.decorBorderReplaySize*2 - font->Width(total); + labelPixmap->DrawText(cPoint(marginItem, 0), current, Theme.Color(clrReplayFont), Theme.Color(clrReplayBg), font, font->Width(current), fontHeight); + labelPixmap->DrawText(cPoint(right - marginItem, 0), total, Theme.Color(clrReplayFont), Theme.Color(clrReplayBg), font, font->Width(total), fontHeight); +} + +void cFlatDisplayReplay::SetJump(const char *Jump) { + if( !Jump ) + { + labelJump->Fill(clrTransparent); + return; + } + int left = osdWidth - Config.decorBorderReplaySize*2 - font->Width(Jump); + left /= 2; + + labelJump->DrawText(cPoint(left, 0), Jump, Theme.Color(clrReplayFont), Theme.Color(clrReplayBg), font, font->Width(Jump), fontHeight, taCenter); +} + +void cFlatDisplayReplay::SetMessage(eMessageType Type, const char *Text) { + if (Text) + MessageSet(Type, Text); + else + MessageClear(); +} + +void cFlatDisplayReplay::Flush(void) { + TopBarUpdate(); + osd->Flush(); +} diff --git a/displayreplay.h b/displayreplay.h new file mode 100644 index 00000000..c073f1e1 --- /dev/null +++ b/displayreplay.h @@ -0,0 +1,27 @@ +#pragma once + +#include "baserender.h" + +class cFlatDisplayReplay : public cFlatBaseRender, public cSkinDisplayReplay { + private: + cString current, total; + + int labelHeight; + cPixmap *labelPixmap; + cPixmap *labelJump; + cPixmap *iconsPixmap; + + void UpdateInfo(void); + public: + cFlatDisplayReplay(bool ModeOnly); + virtual ~cFlatDisplayReplay(); + virtual void SetRecording(const cRecording *Recording); + virtual void SetTitle(const char *Title); + virtual void SetMode(bool Play, bool Forward, int Speed); + virtual void SetProgress(int Current, int Total); + virtual void SetCurrent(const char *Current); + virtual void SetTotal(const char *Total); + virtual void SetJump(const char *Jump); + virtual void SetMessage(eMessageType Type, const char *Text); + virtual void Flush(void); +}; diff --git a/displaytracks.c b/displaytracks.c new file mode 100644 index 00000000..2bbcaac1 --- /dev/null +++ b/displaytracks.c @@ -0,0 +1,70 @@ +#include "displaytracks.h" + +cFlatDisplayTracks::cFlatDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks) { + + CreateFullOsd(); + TopBarCreate(); + + itemHeight = fontHeight + Config.MenuItemPadding + Config.decorBorderTrackSize*2; + currentIndex = -1; + maxItemWidth = font->Width(Title) + marginItem*2; + for (int i = 0; i < NumTracks; i++) + maxItemWidth = max(maxItemWidth, font->Width(Tracks[i]) + marginItem*2); + + itemsHeight = NumTracks * itemHeight; + int left = osdWidth - maxItemWidth; + left /= 2; + TopBarSetTitle(Title); + + tracksPixmap = osd->CreatePixmap(1, cRect(left, osdHeight - itemsHeight - marginItem, maxItemWidth, itemsHeight)); + tracksPixmap->Fill(clrTransparent); + + for (int i = 0; i < NumTracks; i++) + SetItem(Tracks[i], i, false); +} + +cFlatDisplayTracks::~cFlatDisplayTracks() { + osd->DestroyPixmap(tracksPixmap); +} + +void cFlatDisplayTracks::SetItem(const char *Text, int Index, bool Current) { + int y = Index * itemHeight; + tColor ColorFg, ColorBg; + if (Current) { + ColorFg = Theme.Color(clrTrackItemCurrentFont); + ColorBg = Theme.Color(clrTrackItemCurrentBg); + currentIndex = Index; + } + else { + ColorFg = Theme.Color(clrTrackItemFont); + ColorBg = Theme.Color(clrTrackItemBg); + } + tracksPixmap->DrawText(cPoint(0, y), Text, ColorFg, ColorBg, font, maxItemWidth, itemHeight - Config.MenuItemPadding - Config.decorBorderTrackSize*2, taCenter); + + int left = osdWidth - maxItemWidth; + left /= 2; + + int top = osdHeight - itemsHeight - marginItem + y; + + if( Current ) + DecorBorderDraw(left, top, maxItemWidth, fontHeight, + Config.decorBorderTrackSize, Config.decorBorderTrackType, Config.decorBorderTrackCurFg, Config.decorBorderTrackCurBg); + else + DecorBorderDraw(left, top, maxItemWidth, fontHeight, + Config.decorBorderTrackSize, Config.decorBorderTrackType, Config.decorBorderTrackFg, Config.decorBorderTrackBg); +} + +void cFlatDisplayTracks::SetTrack(int Index, const char * const *Tracks) { + if (currentIndex >= 0) + SetItem(Tracks[currentIndex], currentIndex, false); + SetItem(Tracks[Index], Index, true); +} + +void cFlatDisplayTracks::SetAudioChannel(int AudioChannel) { + return; +} + +void cFlatDisplayTracks::Flush(void) { + TopBarUpdate(); + osd->Flush(); +} diff --git a/displaytracks.h b/displaytracks.h new file mode 100644 index 00000000..23076a6d --- /dev/null +++ b/displaytracks.h @@ -0,0 +1,20 @@ +#pragma once + +#include "baserender.h" + +class cFlatDisplayTracks : public cFlatBaseRender, public cSkinDisplayTracks { + private: + cPixmap *tracksPixmap; + + int itemHeight, itemsHeight; + int maxItemWidth; + int currentIndex; + + void SetItem(const char *Text, int Index, bool Current); + public: + cFlatDisplayTracks(const char *Title, int NumTracks, const char * const *Tracks); + virtual ~cFlatDisplayTracks(); + virtual void SetTrack(int Index, const char * const *Tracks); + virtual void SetAudioChannel(int AudioChannel); + virtual void Flush(void); +}; diff --git a/displayvolume.c b/displayvolume.c new file mode 100644 index 00000000..1efb66cd --- /dev/null +++ b/displayvolume.c @@ -0,0 +1,70 @@ +#include "displayvolume.h" + +cFlatDisplayVolume::cFlatDisplayVolume(void) { + muted = false; + + labelHeight = fontHeight + marginItem*2; + + CreateFullOsd(); + TopBarCreate(); + int width = osdWidth / 4 * 3; + + int top = osdHeight - 50 - Config.decorProgressVolumeSize - labelHeight - marginItem - Config.decorBorderVolumeSize*2; + int left = osdWidth - width - Config.decorBorderVolumeSize; + left /= 2; + + labelPixmap = osd->CreatePixmap(1, cRect(0, top, osdWidth, labelHeight)); + muteLogoPixmap = osd->CreatePixmap(2, cRect(0, top, osdWidth, labelHeight)); + + ProgressBarCreate(left, osdHeight - 50 - Config.decorProgressVolumeSize, width, Config.decorProgressVolumeSize, marginItem, marginItem, + Config.decorProgressVolumeFg, Config.decorProgressVolumeBarFg, Config.decorProgressVolumeBg, Config.decorProgressVolumeType); +} + +cFlatDisplayVolume::~cFlatDisplayVolume() { + osd->DestroyPixmap(labelPixmap); + osd->DestroyPixmap(muteLogoPixmap); +} + +void cFlatDisplayVolume::SetVolume(int Current, int Total, bool Mute) { + labelPixmap->Fill(clrTransparent); + muteLogoPixmap->Fill(clrTransparent); + + cString label = cString::sprintf("%s: %d", tr("Volume"), Current); + cString maxLabel = cString::sprintf("%s: %d", tr("Volume"), 555); + int maxlabelWidth = font->Width(maxLabel) + marginItem; + int left = osdWidth / 2 - maxlabelWidth / 2; + + int DecorTop = osdHeight - 50 - Config.decorProgressVolumeSize - labelHeight - Config.decorBorderVolumeSize*2; + + labelPixmap->DrawRectangle(cRect(left - marginItem, marginItem, marginItem, fontHeight), Theme.Color(clrVolumeBg)); + + DecorBorderClear(left - marginItem, DecorTop, maxlabelWidth + marginItem*4 + fontHeight, fontHeight, Config.decorBorderVolumeSize); + DecorBorderClear(left - marginItem, DecorTop, maxlabelWidth + marginItem, fontHeight, Config.decorBorderVolumeSize); + + if (Mute) { + labelPixmap->DrawText(cPoint(left, marginItem), *label, Theme.Color(clrVolumeFont), Theme.Color(clrVolumeBg), + font, maxlabelWidth + marginItem + labelHeight, fontHeight, taLeft); + if( imgLoader.LoadIcon("mute", fontHeight, fontHeight) ) { + muteLogoPixmap->DrawImage( cPoint(left + maxlabelWidth + marginItem, marginItem), imgLoader.GetImage() ); + } + DecorBorderDraw(left - marginItem, DecorTop, maxlabelWidth + marginItem*4 + fontHeight, fontHeight, + Config.decorBorderVolumeSize, Config.decorBorderVolumeType, Config.decorBorderVolumeFg, Config.decorBorderVolumeBg); + } else { + labelPixmap->DrawText(cPoint(left, marginItem), *label, Theme.Color(clrVolumeFont), Theme.Color(clrVolumeBg), + font, maxlabelWidth, fontHeight, taLeft); + DecorBorderDraw(left - marginItem, DecorTop, maxlabelWidth + marginItem, fontHeight, + Config.decorBorderVolumeSize, Config.decorBorderVolumeType, Config.decorBorderVolumeFg, Config.decorBorderVolumeBg); + } + + ProgressBarDraw(Current, Total); + + int width = (osdWidth / 4 * 3); + left = osdWidth - width - Config.decorBorderVolumeSize; + left /= 2; + DecorBorderDraw(left - marginItem, osdHeight - 50 - Config.decorProgressVolumeSize - marginItem, width + marginItem*2, Config.decorProgressVolumeSize + marginItem*2, Config.decorBorderVolumeSize, Config.decorBorderVolumeType, Theme.Color(clrTopBarBg), Theme.Color(clrTopBarBg)); +} + +void cFlatDisplayVolume::Flush(void) { + TopBarUpdate(); + osd->Flush(); +} diff --git a/displayvolume.h b/displayvolume.h new file mode 100644 index 00000000..c98b293c --- /dev/null +++ b/displayvolume.h @@ -0,0 +1,19 @@ +#pragma once + +#include "baserender.h" + +class cFlatDisplayVolume : public cFlatBaseRender, public cSkinDisplayVolume { + private: + bool muted; + + cPixmap *labelPixmap; + cPixmap *muteLogoPixmap; + + int labelHeight; + public: + cFlatDisplayVolume(void); + virtual ~cFlatDisplayVolume(); + virtual void SetVolume(int Current, int Total, bool Mute); + //virtual void SetAudioChannel(int AudioChannel); + virtual void Flush(void); +}; @@ -0,0 +1,51 @@ +#include <vdr/osd.h> +#include <vdr/menu.h> + +#include "flat.h" + +#include "displaychannel.h" +#include "displaymenu.h" +#include "displaymessage.h" +#include "displayreplay.h" +#include "displaytracks.h" +#include "displayvolume.h" + +class cFlatConfig Config; + +cTheme Theme; +static bool menuActive = false; + +cFlat::cFlat(void) : cSkin("flatPlus", &::Theme) { + displayMenu = NULL; +} + +const char *cFlat::Description(void) { + return "flatPlus"; +} + +cSkinDisplayChannel *cFlat::DisplayChannel(bool WithInfo) { + return new cFlatDisplayChannel(WithInfo); +} + +cSkinDisplayMenu *cFlat::DisplayMenu(void) { + cFlatDisplayMenu *menu = new cFlatDisplayMenu; + displayMenu = menu; + menuActive = true; + return menu; +} + +cSkinDisplayReplay *cFlat::DisplayReplay(bool ModeOnly) { + return new cFlatDisplayReplay(ModeOnly); +} + +cSkinDisplayVolume *cFlat::DisplayVolume(void) { + return new cFlatDisplayVolume; +} + +cSkinDisplayTracks *cFlat::DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks) { + return new cFlatDisplayTracks(Title, NumTracks, Tracks); +} + +cSkinDisplayMessage *cFlat::DisplayMessage(void) { + return new cFlatDisplayMessage; +} @@ -0,0 +1,192 @@ +#pragma once + +#include <vdr/skins.h> +#include <vdr/videodir.h> + +#include "config.h" +extern class cFlatConfig Config; + +class cFlatDisplayMenu; +extern cTheme Theme; + +// BUTTONS +#define CLR_BUTTONRED 0xFFBB0000 +#define CLR_BUTTONGREEN 0xFF00BB00 +#define CLR_BUTTONYELLOW 0xFFBBBB00 +#define CLR_BUTTONBLUE 0xFF0000BB + +// MESSAGES +#define CLR_MESSAGESTATUS 0xFF0000FF +#define CLR_MESSAGEINFO 0xFF009900 +#define CLR_MESSAGEWARNING 0xFFBBBB00 +#define CLR_MESSAGEERROR 0xFFBB0000 + +// TopBar +THEME_CLR(Theme, clrTopBarBg, 0xC0101010); +THEME_CLR(Theme, clrTopBarFont, 0xFFEEEEEE); +THEME_CLR(Theme, clrTopBarTimeFont, 0xFFEEEEEE); +THEME_CLR(Theme, clrTopBarDateFont, 0xFFA0A0A0); +THEME_CLR(Theme, clrTopBarBorderFg, 0xC0101010); +THEME_CLR(Theme, clrTopBarBorderBg, 0xC0101010); +THEME_CLR(Theme, clrTopBarBorderType, 0x00000000); +THEME_CLR(Theme, clrTopBarBorderSize, 0x00000000); + +// Buttons +THEME_CLR(Theme, clrButtonBg, 0xC0101010); +THEME_CLR(Theme, clrButtonFont, 0xFFEEEEEE); +THEME_CLR(Theme, clrButtonRed, CLR_BUTTONRED); +THEME_CLR(Theme, clrButtonGreen, CLR_BUTTONGREEN); +THEME_CLR(Theme, clrButtonYellow, CLR_BUTTONYELLOW); +THEME_CLR(Theme, clrButtonBlue, CLR_BUTTONBLUE); + +THEME_CLR(Theme, clrButtonBorderFg, 0xC0101010); +THEME_CLR(Theme, clrButtonBorderBg, 0xC0101010); +THEME_CLR(Theme, clrButtonBorderType, 0x00000000); +THEME_CLR(Theme, clrButtonBorderSize, 0x00000000); + +// Messages +THEME_CLR(Theme, clrMessageBg, 0xC0101010); +THEME_CLR(Theme, clrMessageFont, 0xFFEEEEEE); + +THEME_CLR(Theme, clrMessageStatus, CLR_MESSAGESTATUS); +THEME_CLR(Theme, clrMessageInfo, CLR_MESSAGEINFO); +THEME_CLR(Theme, clrMessageWarning, CLR_MESSAGEWARNING); +THEME_CLR(Theme, clrMessageError, CLR_MESSAGEERROR); + +THEME_CLR(Theme, clrMessageBorderFg, 0xC0101010); +THEME_CLR(Theme, clrMessageBorderBg, 0xC0101010); +THEME_CLR(Theme, clrMessageBorderType, 0x00000000); +THEME_CLR(Theme, clrMessageBorderSize, 0x00000000); + +// Channel +THEME_CLR(Theme, clrChannelBg, 0xC0101010); +THEME_CLR(Theme, clrChannelFontTitle, 0xFF3090B0); +THEME_CLR(Theme, clrChannelFontEpg, 0xFFEEEEEE); +THEME_CLR(Theme, clrChannelFontEpgFollow, 0xFFA0A0A0); +THEME_CLR(Theme, clrChannelProgressFg, 0xFF3090B0); +THEME_CLR(Theme, clrChannelProgressBarFg, 0xFF3090B0); +THEME_CLR(Theme, clrChannelProgressBg, 0xC0101010); +THEME_CLR(Theme, clrChannelProgressType, 0x00000000); +THEME_CLR(Theme, clrChannelProgressSize, 0x0000000A); + +THEME_CLR(Theme, clrChannelBorderFg, 0xC03090B0); +THEME_CLR(Theme, clrChannelBorderBg, 0xC03090B0); +THEME_CLR(Theme, clrChannelBorderType, 0x00000000); +THEME_CLR(Theme, clrChannelBorderSize, 0x00000000); + +THEME_CLR(Theme, clrChannelSignalFont, 0xFFA0A0A0); +THEME_CLR(Theme, clrChannelSignalProgressFg, 0xFFA0A0A0); +THEME_CLR(Theme, clrChannelSignalProgressBarFg, 0xFFA0A0A0); +THEME_CLR(Theme, clrChannelSignalProgressBg, 0xC0101010); +THEME_CLR(Theme, clrChannelSignalProgressType, 0x00000002); +THEME_CLR(Theme, clrChannelSignalProgressSize, 0x0000000A); + +// Menu +THEME_CLR(Theme, clrItemBg, 0xC0909090); +THEME_CLR(Theme, clrItemFont, 0xFFEEEEEE); +THEME_CLR(Theme, clrItemCurrentBg, 0xC03090B0); +THEME_CLR(Theme, clrItemCurrentFont, 0xFFEEEEEE); +THEME_CLR(Theme, clrItemSelableBg, 0xC0101010); +THEME_CLR(Theme, clrItemSelableFont, 0xFFEEEEEE); +THEME_CLR(Theme, clrScrollbarFg, 0xFF3090B0); +THEME_CLR(Theme, clrScrollbarBarFg, 0xFF3090B0); +THEME_CLR(Theme, clrScrollbarBg, 0xC0101010); +// Menu Event +THEME_CLR(Theme, clrMenuEventBg, 0xC0101010); +THEME_CLR(Theme, clrMenuEventFontTitle, 0xFF3090B0); +THEME_CLR(Theme, clrMenuEventFontInfo, 0xFFEEEEEE); +// Menu Recording +THEME_CLR(Theme, clrMenuRecBg, 0xC0101010); +THEME_CLR(Theme, clrMenuRecFontTitle, 0xFF3090B0); +THEME_CLR(Theme, clrMenuRecFontInfo, 0xFFEEEEEE); +// Menu Text (Multiline) +THEME_CLR(Theme, clrMenuTextBg, 0xC0101010); +THEME_CLR(Theme, clrMenuTextFont, 0xFFEEEEEE); + +THEME_CLR(Theme, clrMenuContentHeadBorderFg, 0xC03090B0); +THEME_CLR(Theme, clrMenuContentHeadBorderBg, 0xC03090B0); +THEME_CLR(Theme, clrMenuContentHeadBorderType, 0x00000000); +THEME_CLR(Theme, clrMenuContentHeadBorderSize, 0x00000000); + +THEME_CLR(Theme, clrMenuContentBorderFg, 0xC03090B0); +THEME_CLR(Theme, clrMenuContentBorderBg, 0xC03090B0); +THEME_CLR(Theme, clrMenuContentBorderType, 0x00000000); +THEME_CLR(Theme, clrMenuContentBorderSize, 0x00000000); + +// Menu Items +THEME_CLR(Theme, clrMenuItemProgressFg, 0xFFEEEEEE); +THEME_CLR(Theme, clrMenuItemProgressBarFg, 0xFFEEEEEE); +THEME_CLR(Theme, clrMenuItemProgressBg, 0xC0101010); +THEME_CLR(Theme, clrMenuItemCurProgressFg, 0xFFEEEEEE); +THEME_CLR(Theme, clrMenuItemCurProgressBarFg, 0xFFEEEEEE); +THEME_CLR(Theme, clrMenuItemCurProgressBg, 0xC03090B0); +THEME_CLR(Theme, clrMenuItemProgressType, 0x00000002); +THEME_CLR(Theme, clrMenuItemProgressSize, 0x00000014); + +THEME_CLR(Theme, clrMenuItemBorderType, 0x00000000); +THEME_CLR(Theme, clrMenuItemBorderSize, 0x00000000); +THEME_CLR(Theme, clrMenuItemBorderFg, 0xC0909090); +THEME_CLR(Theme, clrMenuItemBorderBg, 0xC0909090); +THEME_CLR(Theme, clrMenuItemSelableBorderFg, 0xC0101010); +THEME_CLR(Theme, clrMenuItemSelableBorderBg, 0xC0101010); +THEME_CLR(Theme, clrMenuItemCurrentBorderFg, 0xC03090B0); +THEME_CLR(Theme, clrMenuItemCurrentBorderBg, 0xC03090B0); + +// Replay +THEME_CLR(Theme, clrReplayBg, 0xC0101010); +THEME_CLR(Theme, clrReplayFont, 0xFFEEEEEE); +THEME_CLR(Theme, clrReplayFontSpeed, 0xFF3090B0); +THEME_CLR(Theme, clrReplayProgressFg, 0xFFEEEEEE); +THEME_CLR(Theme, clrReplayProgressBarFg, 0xFFEEEEEE); +THEME_CLR(Theme, clrReplayProgressBarCurFg, 0xFF3090B0); +THEME_CLR(Theme, clrReplayProgressBg, 0xC0101010); +THEME_CLR(Theme, clrReplayMarkFg, 0xFFEEEEEE); +THEME_CLR(Theme, clrReplayMarkCurrentFg, 0xFF3090B0); +THEME_CLR(Theme, clrReplayProgressType, 0x00000000); +THEME_CLR(Theme, clrReplayProgressSize, 0x00000028); + +THEME_CLR(Theme, clrReplayBorderFg, 0xC0101010); +THEME_CLR(Theme, clrReplayBorderBg, 0xC0101010); +THEME_CLR(Theme, clrReplayBorderType, 0x00000000); +THEME_CLR(Theme, clrReplayBorderSize, 0x00000000); + +// Tracks +THEME_CLR(Theme, clrTrackItemBg, 0xC0101010); +THEME_CLR(Theme, clrTrackItemFont, 0xFFEEEEEE); +THEME_CLR(Theme, clrTrackItemCurrentBg, 0xC03090B0); +THEME_CLR(Theme, clrTrackItemCurrentFont, 0xFFEEEEEE); + +THEME_CLR(Theme, clrTrackItemBorderFg, 0xC0101010); +THEME_CLR(Theme, clrTrackItemBorderBg, 0xC0101010); +THEME_CLR(Theme, clrTrackItemBorderType, 0x00000000); +THEME_CLR(Theme, clrTrackItemBorderSize, 0x00000000); +THEME_CLR(Theme, clrTrackItemCurrentBorderFg, 0xC03090B0); +THEME_CLR(Theme, clrTrackItemCurrentBorderBg, 0xC03090B0); + +// Volume +THEME_CLR(Theme, clrVolumeBg, 0xC0101010); +THEME_CLR(Theme, clrVolumeFont, 0xFFEEEEEE); +THEME_CLR(Theme, clrVolumeProgressFg, 0xFF3090B0); +THEME_CLR(Theme, clrVolumeProgressBarFg, 0xFF3090B0); +THEME_CLR(Theme, clrVolumeProgressBg, 0xC0101010); +THEME_CLR(Theme, clrVolumeProgressType, 0x00000000); +THEME_CLR(Theme, clrVolumeProgressSize, 0x0000000A); + +THEME_CLR(Theme, clrVolumeBorderFg, 0xC0101010); +THEME_CLR(Theme, clrVolumeBorderBg, 0xC0101010); +THEME_CLR(Theme, clrVolumeBorderType, 0x00000000); +THEME_CLR(Theme, clrVolumeBorderSize, 0x00000000); + +class cFlat : public cSkin { + private: + cFlatDisplayMenu *displayMenu; + public: + cFlat(void); + virtual const char *Description(void); + virtual cSkinDisplayChannel *DisplayChannel(bool WithInfo); + virtual cSkinDisplayMenu *DisplayMenu(void); + virtual cSkinDisplayReplay *DisplayReplay(bool ModeOnly); + virtual cSkinDisplayVolume *DisplayVolume(void); + virtual cSkinDisplayTracks *DisplayTracks(const char *Title, int NumTracks, const char * const *Tracks); + virtual cSkinDisplayMessage *DisplayMessage(void); +}; diff --git a/icons/COPYRIGHT b/icons/COPYRIGHT new file mode 100644 index 00000000..68f502d3 --- /dev/null +++ b/icons/COPYRIGHT @@ -0,0 +1,14 @@ +Symbols from +Alexander Moore +paket Snowish +under GNU/GPL +http://findicons.com/pack/2152/snowish + +mute & unmute from +brsev +paket vrsev +Creative Commons Attribution +http://findicons.com/pack/949/token + +iconsweet2 +http://www.iconsweets2.com/
\ No newline at end of file diff --git a/icons/def_rectalpha/Chart 8.png b/icons/def_rectalpha/Chart 8.png Binary files differnew file mode 100644 index 00000000..4874a9a7 --- /dev/null +++ b/icons/def_rectalpha/Chart 8.png diff --git a/icons/def_rectalpha/chart.png b/icons/def_rectalpha/chart.png Binary files differnew file mode 100644 index 00000000..1b51e7eb --- /dev/null +++ b/icons/def_rectalpha/chart.png diff --git a/icons/def_rectalpha/chart1.png b/icons/def_rectalpha/chart1.png Binary files differnew file mode 100644 index 00000000..b8041baa --- /dev/null +++ b/icons/def_rectalpha/chart1.png diff --git a/icons/def_rectalpha/chart2.png b/icons/def_rectalpha/chart2.png Binary files differnew file mode 100644 index 00000000..c5a8c549 --- /dev/null +++ b/icons/def_rectalpha/chart2.png diff --git a/icons/def_rectalpha/chart3.png b/icons/def_rectalpha/chart3.png Binary files differnew file mode 100644 index 00000000..4d3f375b --- /dev/null +++ b/icons/def_rectalpha/chart3.png diff --git a/icons/def_rectalpha/chart4.png b/icons/def_rectalpha/chart4.png Binary files differnew file mode 100644 index 00000000..8e3bb5c6 --- /dev/null +++ b/icons/def_rectalpha/chart4.png diff --git a/icons/def_rectalpha/chart5.png b/icons/def_rectalpha/chart5.png Binary files differnew file mode 100644 index 00000000..abc26ea6 --- /dev/null +++ b/icons/def_rectalpha/chart5.png diff --git a/icons/def_rectalpha/chart6.png b/icons/def_rectalpha/chart6.png Binary files differnew file mode 100644 index 00000000..49699d76 --- /dev/null +++ b/icons/def_rectalpha/chart6.png diff --git a/icons/def_rectalpha/chart7.png b/icons/def_rectalpha/chart7.png Binary files differnew file mode 100644 index 00000000..ed7dc422 --- /dev/null +++ b/icons/def_rectalpha/chart7.png diff --git a/icons/def_rectalpha/crypted.png b/icons/def_rectalpha/crypted.png Binary files differnew file mode 100644 index 00000000..934ca90f --- /dev/null +++ b/icons/def_rectalpha/crypted.png diff --git a/icons/def_rectalpha/forward.png b/icons/def_rectalpha/forward.png Binary files differnew file mode 100644 index 00000000..b7464a8b --- /dev/null +++ b/icons/def_rectalpha/forward.png diff --git a/icons/def_rectalpha/forward_sel.png b/icons/def_rectalpha/forward_sel.png Binary files differnew file mode 100644 index 00000000..a7eb25a9 --- /dev/null +++ b/icons/def_rectalpha/forward_sel.png diff --git a/icons/def_rectalpha/hd.png b/icons/def_rectalpha/hd.png Binary files differnew file mode 100644 index 00000000..7019e113 --- /dev/null +++ b/icons/def_rectalpha/hd.png diff --git a/icons/def_rectalpha/hd2.png b/icons/def_rectalpha/hd2.png Binary files differnew file mode 100644 index 00000000..8ff5015b --- /dev/null +++ b/icons/def_rectalpha/hd2.png diff --git a/icons/def_rectalpha/hd3.png b/icons/def_rectalpha/hd3.png Binary files differnew file mode 100644 index 00000000..49c381d1 --- /dev/null +++ b/icons/def_rectalpha/hd3.png diff --git a/icons/def_rectalpha/mute.png b/icons/def_rectalpha/mute.png Binary files differnew file mode 100644 index 00000000..f4c2bba3 --- /dev/null +++ b/icons/def_rectalpha/mute.png diff --git a/icons/def_rectalpha/pause.png b/icons/def_rectalpha/pause.png Binary files differnew file mode 100644 index 00000000..1755f16b --- /dev/null +++ b/icons/def_rectalpha/pause.png diff --git a/icons/def_rectalpha/pause_sel.png b/icons/def_rectalpha/pause_sel.png Binary files differnew file mode 100644 index 00000000..be8b4b4b --- /dev/null +++ b/icons/def_rectalpha/pause_sel.png diff --git a/icons/def_rectalpha/play.png b/icons/def_rectalpha/play.png Binary files differnew file mode 100644 index 00000000..84e8a6ef --- /dev/null +++ b/icons/def_rectalpha/play.png diff --git a/icons/def_rectalpha/play_sel.png b/icons/def_rectalpha/play_sel.png Binary files differnew file mode 100644 index 00000000..a4769c37 --- /dev/null +++ b/icons/def_rectalpha/play_sel.png diff --git a/icons/def_rectalpha/prev.png b/icons/def_rectalpha/prev.png Binary files differnew file mode 100644 index 00000000..4a7f8134 --- /dev/null +++ b/icons/def_rectalpha/prev.png diff --git a/icons/def_rectalpha/prev_sel.png b/icons/def_rectalpha/prev_sel.png Binary files differnew file mode 100644 index 00000000..fed33f3d --- /dev/null +++ b/icons/def_rectalpha/prev_sel.png diff --git a/icons/def_rectalpha/record.png b/icons/def_rectalpha/record.png Binary files differnew file mode 100644 index 00000000..47b99fbb --- /dev/null +++ b/icons/def_rectalpha/record.png diff --git a/icons/def_rectalpha/rewind.png b/icons/def_rectalpha/rewind.png Binary files differnew file mode 100644 index 00000000..393e1bc7 --- /dev/null +++ b/icons/def_rectalpha/rewind.png diff --git a/icons/def_rectalpha/rewind_sel.png b/icons/def_rectalpha/rewind_sel.png Binary files differnew file mode 100644 index 00000000..64ff951e --- /dev/null +++ b/icons/def_rectalpha/rewind_sel.png diff --git a/icons/def_rectalpha/sd.png b/icons/def_rectalpha/sd.png Binary files differnew file mode 100644 index 00000000..1a5fa996 --- /dev/null +++ b/icons/def_rectalpha/sd.png diff --git a/icons/def_rectalpha/sd2.png b/icons/def_rectalpha/sd2.png Binary files differnew file mode 100644 index 00000000..6b0d0743 --- /dev/null +++ b/icons/def_rectalpha/sd2.png diff --git a/icons/def_rectalpha/sd3.png b/icons/def_rectalpha/sd3.png Binary files differnew file mode 100644 index 00000000..5c6e0f5b --- /dev/null +++ b/icons/def_rectalpha/sd3.png diff --git a/icons/def_rectalpha/skip.png b/icons/def_rectalpha/skip.png Binary files differnew file mode 100644 index 00000000..1ef72bae --- /dev/null +++ b/icons/def_rectalpha/skip.png diff --git a/icons/def_rectalpha/skip_sel.png b/icons/def_rectalpha/skip_sel.png Binary files differnew file mode 100644 index 00000000..6058681c --- /dev/null +++ b/icons/def_rectalpha/skip_sel.png diff --git a/icons/def_rectalpha/uncrypted.png b/icons/def_rectalpha/uncrypted.png Binary files differnew file mode 100644 index 00000000..0c14ebe0 --- /dev/null +++ b/icons/def_rectalpha/uncrypted.png diff --git a/icons/def_round/Chart 8.png b/icons/def_round/Chart 8.png Binary files differnew file mode 100644 index 00000000..4874a9a7 --- /dev/null +++ b/icons/def_round/Chart 8.png diff --git a/icons/def_round/chart.png b/icons/def_round/chart.png Binary files differnew file mode 100644 index 00000000..1b51e7eb --- /dev/null +++ b/icons/def_round/chart.png diff --git a/icons/def_round/chart1.png b/icons/def_round/chart1.png Binary files differnew file mode 100644 index 00000000..b8041baa --- /dev/null +++ b/icons/def_round/chart1.png diff --git a/icons/def_round/chart2.png b/icons/def_round/chart2.png Binary files differnew file mode 100644 index 00000000..c5a8c549 --- /dev/null +++ b/icons/def_round/chart2.png diff --git a/icons/def_round/chart3.png b/icons/def_round/chart3.png Binary files differnew file mode 100644 index 00000000..4d3f375b --- /dev/null +++ b/icons/def_round/chart3.png diff --git a/icons/def_round/chart4.png b/icons/def_round/chart4.png Binary files differnew file mode 100644 index 00000000..8e3bb5c6 --- /dev/null +++ b/icons/def_round/chart4.png diff --git a/icons/def_round/chart5.png b/icons/def_round/chart5.png Binary files differnew file mode 100644 index 00000000..abc26ea6 --- /dev/null +++ b/icons/def_round/chart5.png diff --git a/icons/def_round/chart6.png b/icons/def_round/chart6.png Binary files differnew file mode 100644 index 00000000..49699d76 --- /dev/null +++ b/icons/def_round/chart6.png diff --git a/icons/def_round/chart7.png b/icons/def_round/chart7.png Binary files differnew file mode 100644 index 00000000..ed7dc422 --- /dev/null +++ b/icons/def_round/chart7.png diff --git a/icons/def_round/crypted.png b/icons/def_round/crypted.png Binary files differnew file mode 100644 index 00000000..934ca90f --- /dev/null +++ b/icons/def_round/crypted.png diff --git a/icons/def_round/forward.png b/icons/def_round/forward.png Binary files differnew file mode 100644 index 00000000..b7464a8b --- /dev/null +++ b/icons/def_round/forward.png diff --git a/icons/def_round/forward_sel.png b/icons/def_round/forward_sel.png Binary files differnew file mode 100644 index 00000000..a7eb25a9 --- /dev/null +++ b/icons/def_round/forward_sel.png diff --git a/icons/def_round/hd.png b/icons/def_round/hd.png Binary files differnew file mode 100644 index 00000000..7019e113 --- /dev/null +++ b/icons/def_round/hd.png diff --git a/icons/def_round/hd2.png b/icons/def_round/hd2.png Binary files differnew file mode 100644 index 00000000..8ff5015b --- /dev/null +++ b/icons/def_round/hd2.png diff --git a/icons/def_round/hd3.png b/icons/def_round/hd3.png Binary files differnew file mode 100644 index 00000000..49c381d1 --- /dev/null +++ b/icons/def_round/hd3.png diff --git a/icons/def_round/mute.png b/icons/def_round/mute.png Binary files differnew file mode 100644 index 00000000..f4c2bba3 --- /dev/null +++ b/icons/def_round/mute.png diff --git a/icons/def_round/pause.png b/icons/def_round/pause.png Binary files differnew file mode 100644 index 00000000..1755f16b --- /dev/null +++ b/icons/def_round/pause.png diff --git a/icons/def_round/pause_sel.png b/icons/def_round/pause_sel.png Binary files differnew file mode 100644 index 00000000..be8b4b4b --- /dev/null +++ b/icons/def_round/pause_sel.png diff --git a/icons/def_round/play.png b/icons/def_round/play.png Binary files differnew file mode 100644 index 00000000..84e8a6ef --- /dev/null +++ b/icons/def_round/play.png diff --git a/icons/def_round/play_sel.png b/icons/def_round/play_sel.png Binary files differnew file mode 100644 index 00000000..a4769c37 --- /dev/null +++ b/icons/def_round/play_sel.png diff --git a/icons/def_round/prev.png b/icons/def_round/prev.png Binary files differnew file mode 100644 index 00000000..4a7f8134 --- /dev/null +++ b/icons/def_round/prev.png diff --git a/icons/def_round/prev_sel.png b/icons/def_round/prev_sel.png Binary files differnew file mode 100644 index 00000000..fed33f3d --- /dev/null +++ b/icons/def_round/prev_sel.png diff --git a/icons/def_round/record.png b/icons/def_round/record.png Binary files differnew file mode 100644 index 00000000..47b99fbb --- /dev/null +++ b/icons/def_round/record.png diff --git a/icons/def_round/rewind.png b/icons/def_round/rewind.png Binary files differnew file mode 100644 index 00000000..393e1bc7 --- /dev/null +++ b/icons/def_round/rewind.png diff --git a/icons/def_round/rewind_sel.png b/icons/def_round/rewind_sel.png Binary files differnew file mode 100644 index 00000000..64ff951e --- /dev/null +++ b/icons/def_round/rewind_sel.png diff --git a/icons/def_round/sd.png b/icons/def_round/sd.png Binary files differnew file mode 100644 index 00000000..1a5fa996 --- /dev/null +++ b/icons/def_round/sd.png diff --git a/icons/def_round/sd2.png b/icons/def_round/sd2.png Binary files differnew file mode 100644 index 00000000..6b0d0743 --- /dev/null +++ b/icons/def_round/sd2.png diff --git a/icons/def_round/sd3.png b/icons/def_round/sd3.png Binary files differnew file mode 100644 index 00000000..5c6e0f5b --- /dev/null +++ b/icons/def_round/sd3.png diff --git a/icons/def_round/skip.png b/icons/def_round/skip.png Binary files differnew file mode 100644 index 00000000..1ef72bae --- /dev/null +++ b/icons/def_round/skip.png diff --git a/icons/def_round/skip_sel.png b/icons/def_round/skip_sel.png Binary files differnew file mode 100644 index 00000000..6058681c --- /dev/null +++ b/icons/def_round/skip_sel.png diff --git a/icons/def_round/uncrypted.png b/icons/def_round/uncrypted.png Binary files differnew file mode 100644 index 00000000..0c14ebe0 --- /dev/null +++ b/icons/def_round/uncrypted.png diff --git a/icons/def_roundalpha/Chart 8.png b/icons/def_roundalpha/Chart 8.png Binary files differnew file mode 100644 index 00000000..4874a9a7 --- /dev/null +++ b/icons/def_roundalpha/Chart 8.png diff --git a/icons/def_roundalpha/chart.png b/icons/def_roundalpha/chart.png Binary files differnew file mode 100644 index 00000000..1b51e7eb --- /dev/null +++ b/icons/def_roundalpha/chart.png diff --git a/icons/def_roundalpha/chart1.png b/icons/def_roundalpha/chart1.png Binary files differnew file mode 100644 index 00000000..b8041baa --- /dev/null +++ b/icons/def_roundalpha/chart1.png diff --git a/icons/def_roundalpha/chart2.png b/icons/def_roundalpha/chart2.png Binary files differnew file mode 100644 index 00000000..c5a8c549 --- /dev/null +++ b/icons/def_roundalpha/chart2.png diff --git a/icons/def_roundalpha/chart3.png b/icons/def_roundalpha/chart3.png Binary files differnew file mode 100644 index 00000000..4d3f375b --- /dev/null +++ b/icons/def_roundalpha/chart3.png diff --git a/icons/def_roundalpha/chart4.png b/icons/def_roundalpha/chart4.png Binary files differnew file mode 100644 index 00000000..8e3bb5c6 --- /dev/null +++ b/icons/def_roundalpha/chart4.png diff --git a/icons/def_roundalpha/chart5.png b/icons/def_roundalpha/chart5.png Binary files differnew file mode 100644 index 00000000..abc26ea6 --- /dev/null +++ b/icons/def_roundalpha/chart5.png diff --git a/icons/def_roundalpha/chart6.png b/icons/def_roundalpha/chart6.png Binary files differnew file mode 100644 index 00000000..49699d76 --- /dev/null +++ b/icons/def_roundalpha/chart6.png diff --git a/icons/def_roundalpha/chart7.png b/icons/def_roundalpha/chart7.png Binary files differnew file mode 100644 index 00000000..ed7dc422 --- /dev/null +++ b/icons/def_roundalpha/chart7.png diff --git a/icons/def_roundalpha/crypted.png b/icons/def_roundalpha/crypted.png Binary files differnew file mode 100644 index 00000000..934ca90f --- /dev/null +++ b/icons/def_roundalpha/crypted.png diff --git a/icons/def_roundalpha/forward.png b/icons/def_roundalpha/forward.png Binary files differnew file mode 100644 index 00000000..b7464a8b --- /dev/null +++ b/icons/def_roundalpha/forward.png diff --git a/icons/def_roundalpha/forward_sel.png b/icons/def_roundalpha/forward_sel.png Binary files differnew file mode 100644 index 00000000..a7eb25a9 --- /dev/null +++ b/icons/def_roundalpha/forward_sel.png diff --git a/icons/def_roundalpha/hd.png b/icons/def_roundalpha/hd.png Binary files differnew file mode 100644 index 00000000..7019e113 --- /dev/null +++ b/icons/def_roundalpha/hd.png diff --git a/icons/def_roundalpha/hd2.png b/icons/def_roundalpha/hd2.png Binary files differnew file mode 100644 index 00000000..8ff5015b --- /dev/null +++ b/icons/def_roundalpha/hd2.png diff --git a/icons/def_roundalpha/hd3.png b/icons/def_roundalpha/hd3.png Binary files differnew file mode 100644 index 00000000..49c381d1 --- /dev/null +++ b/icons/def_roundalpha/hd3.png diff --git a/icons/def_roundalpha/mute.png b/icons/def_roundalpha/mute.png Binary files differnew file mode 100644 index 00000000..f4c2bba3 --- /dev/null +++ b/icons/def_roundalpha/mute.png diff --git a/icons/def_roundalpha/pause.png b/icons/def_roundalpha/pause.png Binary files differnew file mode 100644 index 00000000..1755f16b --- /dev/null +++ b/icons/def_roundalpha/pause.png diff --git a/icons/def_roundalpha/pause_sel.png b/icons/def_roundalpha/pause_sel.png Binary files differnew file mode 100644 index 00000000..be8b4b4b --- /dev/null +++ b/icons/def_roundalpha/pause_sel.png diff --git a/icons/def_roundalpha/play.png b/icons/def_roundalpha/play.png Binary files differnew file mode 100644 index 00000000..84e8a6ef --- /dev/null +++ b/icons/def_roundalpha/play.png diff --git a/icons/def_roundalpha/play_sel.png b/icons/def_roundalpha/play_sel.png Binary files differnew file mode 100644 index 00000000..a4769c37 --- /dev/null +++ b/icons/def_roundalpha/play_sel.png diff --git a/icons/def_roundalpha/prev.png b/icons/def_roundalpha/prev.png Binary files differnew file mode 100644 index 00000000..4a7f8134 --- /dev/null +++ b/icons/def_roundalpha/prev.png diff --git a/icons/def_roundalpha/prev_sel.png b/icons/def_roundalpha/prev_sel.png Binary files differnew file mode 100644 index 00000000..fed33f3d --- /dev/null +++ b/icons/def_roundalpha/prev_sel.png diff --git a/icons/def_roundalpha/record.png b/icons/def_roundalpha/record.png Binary files differnew file mode 100644 index 00000000..47b99fbb --- /dev/null +++ b/icons/def_roundalpha/record.png diff --git a/icons/def_roundalpha/rewind.png b/icons/def_roundalpha/rewind.png Binary files differnew file mode 100644 index 00000000..393e1bc7 --- /dev/null +++ b/icons/def_roundalpha/rewind.png diff --git a/icons/def_roundalpha/rewind_sel.png b/icons/def_roundalpha/rewind_sel.png Binary files differnew file mode 100644 index 00000000..64ff951e --- /dev/null +++ b/icons/def_roundalpha/rewind_sel.png diff --git a/icons/def_roundalpha/sd.png b/icons/def_roundalpha/sd.png Binary files differnew file mode 100644 index 00000000..1a5fa996 --- /dev/null +++ b/icons/def_roundalpha/sd.png diff --git a/icons/def_roundalpha/sd2.png b/icons/def_roundalpha/sd2.png Binary files differnew file mode 100644 index 00000000..6b0d0743 --- /dev/null +++ b/icons/def_roundalpha/sd2.png diff --git a/icons/def_roundalpha/sd3.png b/icons/def_roundalpha/sd3.png Binary files differnew file mode 100644 index 00000000..5c6e0f5b --- /dev/null +++ b/icons/def_roundalpha/sd3.png diff --git a/icons/def_roundalpha/skip.png b/icons/def_roundalpha/skip.png Binary files differnew file mode 100644 index 00000000..1ef72bae --- /dev/null +++ b/icons/def_roundalpha/skip.png diff --git a/icons/def_roundalpha/skip_sel.png b/icons/def_roundalpha/skip_sel.png Binary files differnew file mode 100644 index 00000000..6058681c --- /dev/null +++ b/icons/def_roundalpha/skip_sel.png diff --git a/icons/def_roundalpha/uncrypted.png b/icons/def_roundalpha/uncrypted.png Binary files differnew file mode 100644 index 00000000..0c14ebe0 --- /dev/null +++ b/icons/def_roundalpha/uncrypted.png diff --git a/icons/default/Chart 8.png b/icons/default/Chart 8.png Binary files differnew file mode 100644 index 00000000..4874a9a7 --- /dev/null +++ b/icons/default/Chart 8.png diff --git a/icons/default/chart.png b/icons/default/chart.png Binary files differnew file mode 100644 index 00000000..1b51e7eb --- /dev/null +++ b/icons/default/chart.png diff --git a/icons/default/chart1.png b/icons/default/chart1.png Binary files differnew file mode 100644 index 00000000..b8041baa --- /dev/null +++ b/icons/default/chart1.png diff --git a/icons/default/chart2.png b/icons/default/chart2.png Binary files differnew file mode 100644 index 00000000..c5a8c549 --- /dev/null +++ b/icons/default/chart2.png diff --git a/icons/default/chart3.png b/icons/default/chart3.png Binary files differnew file mode 100644 index 00000000..4d3f375b --- /dev/null +++ b/icons/default/chart3.png diff --git a/icons/default/chart4.png b/icons/default/chart4.png Binary files differnew file mode 100644 index 00000000..8e3bb5c6 --- /dev/null +++ b/icons/default/chart4.png diff --git a/icons/default/chart5.png b/icons/default/chart5.png Binary files differnew file mode 100644 index 00000000..abc26ea6 --- /dev/null +++ b/icons/default/chart5.png diff --git a/icons/default/chart6.png b/icons/default/chart6.png Binary files differnew file mode 100644 index 00000000..49699d76 --- /dev/null +++ b/icons/default/chart6.png diff --git a/icons/default/chart7.png b/icons/default/chart7.png Binary files differnew file mode 100644 index 00000000..ed7dc422 --- /dev/null +++ b/icons/default/chart7.png diff --git a/icons/default/crypted.png b/icons/default/crypted.png Binary files differnew file mode 100644 index 00000000..934ca90f --- /dev/null +++ b/icons/default/crypted.png diff --git a/icons/default/forward.png b/icons/default/forward.png Binary files differnew file mode 100644 index 00000000..b7464a8b --- /dev/null +++ b/icons/default/forward.png diff --git a/icons/default/forward_sel.png b/icons/default/forward_sel.png Binary files differnew file mode 100644 index 00000000..a7eb25a9 --- /dev/null +++ b/icons/default/forward_sel.png diff --git a/icons/default/hd.png b/icons/default/hd.png Binary files differnew file mode 100644 index 00000000..7019e113 --- /dev/null +++ b/icons/default/hd.png diff --git a/icons/default/hd2.png b/icons/default/hd2.png Binary files differnew file mode 100644 index 00000000..8ff5015b --- /dev/null +++ b/icons/default/hd2.png diff --git a/icons/default/hd3.png b/icons/default/hd3.png Binary files differnew file mode 100644 index 00000000..49c381d1 --- /dev/null +++ b/icons/default/hd3.png diff --git a/icons/default/mute.png b/icons/default/mute.png Binary files differnew file mode 100644 index 00000000..f4c2bba3 --- /dev/null +++ b/icons/default/mute.png diff --git a/icons/default/pause.png b/icons/default/pause.png Binary files differnew file mode 100644 index 00000000..1755f16b --- /dev/null +++ b/icons/default/pause.png diff --git a/icons/default/pause_sel.png b/icons/default/pause_sel.png Binary files differnew file mode 100644 index 00000000..be8b4b4b --- /dev/null +++ b/icons/default/pause_sel.png diff --git a/icons/default/play.png b/icons/default/play.png Binary files differnew file mode 100644 index 00000000..84e8a6ef --- /dev/null +++ b/icons/default/play.png diff --git a/icons/default/play_sel.png b/icons/default/play_sel.png Binary files differnew file mode 100644 index 00000000..a4769c37 --- /dev/null +++ b/icons/default/play_sel.png diff --git a/icons/default/prev.png b/icons/default/prev.png Binary files differnew file mode 100644 index 00000000..4a7f8134 --- /dev/null +++ b/icons/default/prev.png diff --git a/icons/default/prev_sel.png b/icons/default/prev_sel.png Binary files differnew file mode 100644 index 00000000..fed33f3d --- /dev/null +++ b/icons/default/prev_sel.png diff --git a/icons/default/record.png b/icons/default/record.png Binary files differnew file mode 100644 index 00000000..47b99fbb --- /dev/null +++ b/icons/default/record.png diff --git a/icons/default/rewind.png b/icons/default/rewind.png Binary files differnew file mode 100644 index 00000000..393e1bc7 --- /dev/null +++ b/icons/default/rewind.png diff --git a/icons/default/rewind_sel.png b/icons/default/rewind_sel.png Binary files differnew file mode 100644 index 00000000..64ff951e --- /dev/null +++ b/icons/default/rewind_sel.png diff --git a/icons/default/sd.png b/icons/default/sd.png Binary files differnew file mode 100644 index 00000000..1a5fa996 --- /dev/null +++ b/icons/default/sd.png diff --git a/icons/default/sd2.png b/icons/default/sd2.png Binary files differnew file mode 100644 index 00000000..6b0d0743 --- /dev/null +++ b/icons/default/sd2.png diff --git a/icons/default/sd3.png b/icons/default/sd3.png Binary files differnew file mode 100644 index 00000000..5c6e0f5b --- /dev/null +++ b/icons/default/sd3.png diff --git a/icons/default/skip.png b/icons/default/skip.png Binary files differnew file mode 100644 index 00000000..1ef72bae --- /dev/null +++ b/icons/default/skip.png diff --git a/icons/default/skip_sel.png b/icons/default/skip_sel.png Binary files differnew file mode 100644 index 00000000..6058681c --- /dev/null +++ b/icons/default/skip_sel.png diff --git a/icons/default/uncrypted.png b/icons/default/uncrypted.png Binary files differnew file mode 100644 index 00000000..0c14ebe0 --- /dev/null +++ b/icons/default/uncrypted.png diff --git a/imageloader.c b/imageloader.c new file mode 100644 index 00000000..1c0ec688 --- /dev/null +++ b/imageloader.c @@ -0,0 +1,127 @@ +#include "imageloader.h" +#include <math.h> +#include <string> +#include <dirent.h> +#include <iostream> + +using namespace Magick; + +cImageLoader::cImageLoader() { + InitializeMagick(NULL); + logoExtension = "png"; +} + +cImageLoader::~cImageLoader() { +} + +bool cImageLoader::LoadLogo(const char *logo, int width = -1, int height = -1) { + if( width == -1 ) + width = logoWidth; + if( height == -1 ) + height = logoHeight; + + if( (width == 0) || (height==0) ) + return false; + std::string logoLower = logo; + toLowerCase(logoLower); + bool success = LoadImage(logoLower.c_str(), Config.logoPath, logoExtension); + if( !success ) + return false; + + if( height != 0 || width != 0 ) { + buffer.sample( Geometry(width, height) ); + } + return true; +} + +int cImageLoader::Height(void) { + Geometry geo = buffer.size(); + return geo.height(); +} + +int cImageLoader::Width(void) { + Geometry geo = buffer.size(); + return geo.width(); +} + +bool cImageLoader::LoadIcon(const char *cIcon, int size) { + if (size==0) + return false; + cString iconThemePath = cString::sprintf("%s%s/", *Config.iconPath, Setup.OSDTheme); + bool success = LoadImage(cString(cIcon), iconThemePath, "png"); + if (!success) + return false; + if( size >= 0 ) + buffer.sample(Geometry(size, size)); + return true; +} + +bool cImageLoader::LoadIcon(const char *cIcon, int width, int height, bool preserveAspect) { + try { + if ((width == 0)||(height==0)) + return false; + cString iconThemePath = cString::sprintf("%s%s/", *Config.iconPath, Setup.OSDTheme); + bool success = LoadImage(cString(cIcon), iconThemePath, "png"); + if (!success) + return false; + if (preserveAspect) { + buffer.sample(Geometry(width, height)); + } else { + cString geometry = cString::sprintf("%dx%d!", width, height); + buffer.scale(Geometry(*geometry)); + } + return true; + } + catch (...) { + return false; + } +} + +cImage cImageLoader::GetImage() { + int w, h; + w = buffer.columns(); + h = buffer.rows(); + cImage image (cSize(w, h)); + const PixelPacket *pixels = buffer.getConstPixels(0, 0, w, h); + for (int iy = 0; iy < h; ++iy) { + for (int ix = 0; ix < w; ++ix) { + tColor col = (~int(pixels->opacity * 255 / MaxRGB) << 24) + | (int(pixels->green * 255 / MaxRGB) << 8) + | (int(pixels->red * 255 / MaxRGB) << 16) + | (int(pixels->blue * 255 / MaxRGB) ); + image.SetPixel(cPoint(ix, iy), col); + ++pixels; + } + } + return image; +} + +Color cImageLoader::Argb2Color(tColor col) { + tIndex alpha = (col & 0xFF000000) >> 24; + tIndex red = (col & 0x00FF0000) >> 16; + tIndex green = (col & 0x0000FF00) >> 8; + tIndex blue = (col & 0x000000FF); + Color color(MaxRGB*red/255, MaxRGB*green/255, MaxRGB*blue/255, MaxRGB*(0xFF-alpha)/255); + return color; +} + +void cImageLoader::toLowerCase(std::string &str) { + const int length = str.length(); + for(int i=0; i < length; ++i) { + str[i] = std::tolower(str[i]); + } +} + +bool cImageLoader::LoadImage(cString FileName, cString Path, cString Extension) { + try { + cString File = cString::sprintf("%s%s.%s", *Path, *FileName, *Extension); + dsyslog("imageloader: trying to load: %s", *File); + //printf("imageloader: trying to load: %s\n", *File); + buffer.read(*File); + dsyslog("imageloader: %s sucessfully loaded", *File); + //printf("imageloader: %s sucessfully loaded\n", *File); + } catch (...) { + return false; + } + return true; +} diff --git a/imageloader.h b/imageloader.h new file mode 100644 index 00000000..9b073701 --- /dev/null +++ b/imageloader.h @@ -0,0 +1,35 @@ +#pragma once + +#define X_DISPLAY_MISSING + +#include <vdr/osd.h> +#include <vdr/skins.h> + +#include <Magick++.h> + +#include "flat.h" + +using namespace Magick; + +class cImageLoader { +public: + cImageLoader(); + ~cImageLoader(); + cImage GetImage(); + bool LoadLogo(const char *logo, int width, int height); + bool LoadIcon(const char *cIcon, int size = -1); + bool LoadIcon(const char *cIcon, int width, int height, bool preserveAspect = true); + + int Height(void); + int Width(void); +private: + int epgImageWidthLarge, epgImageHeightLarge; + int epgImageWidth, epgImageHeight; + int logoWidth, logoHeight; + cString logoExtension; + + Image buffer; + Color Argb2Color(tColor col); + void toLowerCase(std::string &str); + bool LoadImage(cString FileName, cString Path, cString Extension); +}; diff --git a/po/de_DE.po b/po/de_DE.po new file mode 100644 index 00000000..49e2bdad --- /dev/null +++ b/po/de_DE.po @@ -0,0 +1,250 @@ +# VDR plugin language source file. +# Copyright (C) 2008 Martin Schirrmacher <vdr.skinflat@schirrmacher.eu> +# This file is distributed under the same license as the skinflat package. +# +msgid "" +msgstr "" +"Project-Id-Version: vdr-skinflat 0.0.1\n" +"Report-Msgid-Bugs-To: <see README>\n" +"POT-Creation-Date: 2013-09-23 10:56+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ISO-8859-15\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "clock" +msgstr "Uhr" + +msgid "disk usage" +msgstr "Plattennutzung" + +msgid "free space" +msgstr "freier Platz" + +msgid "Volume" +msgstr "Lautstärke" + +msgid "none" +msgstr "keine" + +msgid "rect" +msgstr "" + +msgid "round" +msgstr "" + +msgid "invert round" +msgstr "" + +msgid "rect + alpha blend" +msgstr "" + +msgid "round + alpha blend" +msgstr "" + +msgid "invert round + alpha blend" +msgstr "" + +msgid "small line + big line" +msgstr "" + +msgid "big line" +msgstr "" + +msgid "big line + outline" +msgstr "" + +msgid "small line + big line + dot" +msgstr "" + +msgid "big line + dot" +msgstr "" + +msgid "big line + outline + dot" +msgstr "" + +msgid "small line + dot" +msgstr "" + +msgid "outline + dot" +msgstr "" + +msgid "small line + big line + alpha blend" +msgstr "" + +msgid "big line + alpha blend" +msgstr "" + +msgid "General settings" +msgstr "Allgemeine Einstellungen" + +msgid "Channelinfo settings" +msgstr "Kanalinfo Einstellungen" + +msgid "Menu settings" +msgstr "Menü Einstellungen" + +msgid "Replay settings" +msgstr "Replay Einstellungen" + +msgid "Volume settings" +msgstr "Lautstärke Einstellungen" + +msgid "Tracks settings" +msgstr "Audiospur Einstellungen" + +msgid "Show empty color-buttons" +msgstr "Zeige leere Farbtasten" + +msgid "Show Diskusage stats" +msgstr "" + +msgid "OSD vertical margin" +msgstr "OSD vertikaler Rand" + +msgid "OSD horizontal margin" +msgstr "OSD horizontaler Rand" + +msgid "TopBar border by theme?" +msgstr "TopBar Rand vom Theme?" + +msgid "TopBar border type" +msgstr "TopBar Rand Typ" + +msgid "TopBar border size" +msgstr "TopBar Rand Größe" + +msgid "Message border by theme?" +msgstr "Meldung Rand vom Theme?" + +msgid "Message border type" +msgstr "Meldung Rand Typ" + +msgid "Message border size" +msgstr "Meldung Rand Größe" + +msgid "Button border by theme?" +msgstr "Tasten Rand vom Theme?" + +msgid "Button border type" +msgstr "Tasten Rand Typ" + +msgid "Button border size" +msgstr "Tasten Rand Größe" + +msgid "Show Channelinfo icons" +msgstr "Zeige Kanalinfo Icons" + +msgid "Show signal quality" +msgstr "Zeige Signalqualität" + +msgid "Channelinfo border by theme?" +msgstr "Kanalinfo Rand vom Theme?" + +msgid "Channelinfo border type" +msgstr "Kanalinfo Rand Typ" + +msgid "Channelinfo border size" +msgstr "Kanalinfo Rand Größe" + +msgid "Channelinfo progress by theme?" +msgstr "Kanalinfo Progress vom Theme?" + +msgid "Channelinfo progress type" +msgstr "Kanalinfo Progress Typ" + +msgid "Channelinfo progress size" +msgstr "Kanalinfo Progress Größe" + +msgid "Signalquality progress by theme?" +msgstr "Signal Progress vom Theme?" + +msgid "Signalquality progress type" +msgstr "Signal Progress Typ" + +msgid "Signalquality progress size" +msgstr "Signal Progress Größe" + +msgid "Menuitem padding" +msgstr "Menüitem Abstand" + +msgid "Menuitem border by theme?" +msgstr "Menüitem Rand vom Theme?" + +msgid "Menuitem border type" +msgstr "Menüitem Rand Typ" + +msgid "Menuitem border size" +msgstr "Menüitem Rand Größe" + +msgid "Menucont. border by theme?" +msgstr "Menü Rand vom Theme?" + +msgid "Menucont. border type" +msgstr "Menü Rand Typ" + +msgid "Menucont. border size" +msgstr "Menü Rand Größe" + +msgid "Menucont. head border by theme?" +msgstr "Menükopf Rand vom Theme?" + +msgid "Menucont. head border type" +msgstr "Menükopf Rand Typ" + +msgid "Menucont. head border size" +msgstr "Menükopf Rand Größe" + +msgid "Menuitem progress by theme?" +msgstr "Menüitem Progress vom Theme?" + +msgid "Menuitem progress type" +msgstr "Menüitem Progress Typ" + +msgid "Menuitem progress size" +msgstr "Menüitem Progress Größe" + +msgid "Replay border by theme?" +msgstr "Replay Rand vom Theme?" + +msgid "Replay border type" +msgstr "Replay Rand Typ" + +msgid "Replay border size" +msgstr "Replay Rand Größe" + +msgid "Replay progress by theme?" +msgstr "Replay Progress vom Theme?" + +msgid "Replay progress size" +msgstr "Replay Progress Größe" + +msgid "Volume border by theme?" +msgstr "Lautstärke Rand vom Theme?" + +msgid "Volume border type" +msgstr "Lautstärke Rand Typ" + +msgid "Volume border size" +msgstr "Lautstärke Rand Größe" + +msgid "Volume progress by theme?" +msgstr "Lautstärke Progress vom Theme?" + +msgid "Volume progress type" +msgstr "Lautstärke Progress Typ" + +msgid "Volume progress size" +msgstr "Lautstärke Progress Größe" + +msgid "Tracks border by theme?" +msgstr "Audiospur Rand vom Theme?" + +msgid "Tracks border type" +msgstr "Audiospur Rand Typ" + +msgid "Tracks border size" +msgstr "Audiospur Rand Größe" diff --git a/setup.c b/setup.c new file mode 100644 index 00000000..d8fbfc01 --- /dev/null +++ b/setup.c @@ -0,0 +1,554 @@ +#include "setup.h" + +cStringList Bordertypes; +cStringList Progresstypes; + +cFlatSetup::cFlatSetup(void) { + SetupConfig = Config; + ItemLastSel = -1; + Setup(); +} + +cFlatSetup::~cFlatSetup() { + +} + +void cFlatSetup::Setup(void) { + Clear(); + Bordertypes.Clear(); + Progresstypes.Clear(); + + Bordertypes.Append( strdup(tr("none")) ); + Bordertypes.Append( strdup(tr("rect")) ); + Bordertypes.Append( strdup(tr("round")) ); + Bordertypes.Append( strdup(tr("invert round")) ); + Bordertypes.Append( strdup(tr("rect + alpha blend")) ); + Bordertypes.Append( strdup(tr("round + alpha blend")) ); + Bordertypes.Append( strdup(tr("invert round + alpha blend")) ); + + Progresstypes.Append( strdup(tr("small line + big line")) ); + Progresstypes.Append( strdup(tr("big line")) ); + Progresstypes.Append( strdup(tr("big line + outline")) ); + Progresstypes.Append( strdup(tr("small line + big line + dot")) ); + Progresstypes.Append( strdup(tr("big line + dot")) ); + Progresstypes.Append( strdup(tr("big line + outline + dot")) ); + Progresstypes.Append( strdup(tr("small line + dot")) ); + Progresstypes.Append( strdup(tr("outline + dot")) ); + Progresstypes.Append( strdup(tr("small line + big line + alpha blend")) ); + Progresstypes.Append( strdup(tr("big line + alpha blend")) ); + + Add(new cOsdItem(tr("General settings"), osUnknown, true)); + Add(new cOsdItem(tr("Channelinfo settings"), osUnknown, true)); + Add(new cOsdItem(tr("Menu settings"), osUnknown, true)); + Add(new cOsdItem(tr("Replay settings"), osUnknown, true)); + Add(new cOsdItem(tr("Volume settings"), osUnknown, true)); + Add(new cOsdItem(tr("Tracks settings"), osUnknown, true)); + + if( ItemLastSel >= 0 ) { + SetCurrent(Get(ItemLastSel)); + ItemLastSel = -1; + } + + Display(); +} + +eOSState cFlatSetup::ProcessKey(eKeys Key) { + bool hadSubMenu = HasSubMenu(); + eOSState state = cMenuSetupPage::ProcessKey(Key); + if (hadSubMenu && Key == kOk) + Store(); + if (!hadSubMenu && (state == osUnknown || Key == kOk)) { + if ((Key == kOk && !hadSubMenu)) { + const char* ItemText = Get(Current())->Text(); + if (strcmp(ItemText, tr("General settings")) == 0) + state = AddSubMenu(new cFlatSetupGeneral(&SetupConfig)); + if (strcmp(ItemText, tr("Channelinfo settings")) == 0) + state = AddSubMenu(new cFlatSetupChannelInfo(&SetupConfig)); + if (strcmp(ItemText, tr("Menu settings")) == 0) + state = AddSubMenu(new cFlatSetupMenu(&SetupConfig)); + if (strcmp(ItemText, tr("Replay settings")) == 0) + state = AddSubMenu(new cFlatSetupReplay(&SetupConfig)); + if (strcmp(ItemText, tr("Volume settings")) == 0) + state = AddSubMenu(new cFlatSetupVolume(&SetupConfig)); + if (strcmp(ItemText, tr("Tracks settings")) == 0) + state = AddSubMenu(new cFlatSetupTracks(&SetupConfig)); + } + } + return state; +} + +void cFlatSetup::Store(void) { + Config = SetupConfig; + SetupStore("decorBorderChannelByTheme", Config.decorBorderChannelByTheme); + SetupStore("decorBorderChannelTypeUser", Config.decorBorderChannelTypeUser); + SetupStore("decorBorderChannelSizeUser", Config.decorBorderChannelSizeUser); + SetupStore("decorBorderTopBarByTheme", Config.decorBorderTopBarByTheme); + SetupStore("decorBorderTopBarTypeUser", Config.decorBorderTopBarTypeUser); + SetupStore("decorBorderTopBarSizeUser", Config.decorBorderTopBarSizeUser); + SetupStore("decorBorderMessageByTheme", Config.decorBorderMessageByTheme); + SetupStore("decorBorderMessageTypeUser", Config.decorBorderMessageTypeUser); + SetupStore("decorBorderMessageSizeUser", Config.decorBorderMessageSizeUser); + SetupStore("decorBorderVolumeByTheme", Config.decorBorderVolumeByTheme); + SetupStore("decorBorderVolumeTypeUser", Config.decorBorderVolumeTypeUser); + SetupStore("decorBorderVolumeSizeUser", Config.decorBorderVolumeSizeUser); + SetupStore("decorBorderTrackByTheme", Config.decorBorderTrackByTheme); + SetupStore("decorBorderTrackTypeUser", Config.decorBorderTrackTypeUser); + SetupStore("decorBorderTrackSizeUser", Config.decorBorderTrackSizeUser); + SetupStore("decorBorderReplayByTheme", Config.decorBorderReplayByTheme); + SetupStore("decorBorderReplayTypeUser", Config.decorBorderReplayTypeUser); + SetupStore("decorBorderReplaySizeUser", Config.decorBorderReplaySizeUser); + SetupStore("decorBorderMenuItemByTheme", Config.decorBorderMenuItemByTheme); + SetupStore("decorBorderMenuItemTypeUser", Config.decorBorderMenuItemTypeUser); + SetupStore("decorBorderMenuItemSizeUser", Config.decorBorderMenuItemSizeUser); + SetupStore("decorBorderMenuContentHeadByTheme", Config.decorBorderMenuContentHeadByTheme); + SetupStore("decorBorderMenuContentHeadTypeUser", Config.decorBorderMenuContentHeadTypeUser); + SetupStore("decorBorderMenuContentHeadSizeUser", Config.decorBorderMenuContentHeadSizeUser); + SetupStore("decorBorderMenuContentByTheme", Config.decorBorderMenuContentByTheme); + SetupStore("decorBorderMenuContentTypeUser", Config.decorBorderMenuContentTypeUser); + SetupStore("decorBorderMenuContentSizeUser", Config.decorBorderMenuContentSizeUser); + SetupStore("decorBorderButtonByTheme", Config.decorBorderButtonByTheme); + SetupStore("decorBorderButtonTypeUser", Config.decorBorderButtonTypeUser); + SetupStore("decorBorderButtonSizeUser", Config.decorBorderButtonSizeUser); + SetupStore("decorProgressChannelByTheme", Config.decorProgressChannelByTheme); + SetupStore("decorProgressChannelTypeUser", Config.decorProgressChannelTypeUser); + SetupStore("decorProgressChannelSizeUser", Config.decorProgressChannelSizeUser); + SetupStore("decorProgressVolumeByTheme", Config.decorProgressVolumeByTheme); + SetupStore("decorProgressVolumeTypeUser", Config.decorProgressVolumeTypeUser); + SetupStore("decorProgressVolumeSizeUser", Config.decorProgressVolumeSizeUser); + SetupStore("decorProgressMenuItemByTheme", Config.decorProgressMenuItemByTheme); + SetupStore("decorProgressMenuItemTypeUser", Config.decorProgressMenuItemTypeUser); + SetupStore("decorProgressMenuItemSizeUser", Config.decorProgressMenuItemSizeUser); + SetupStore("decorProgressReplayByTheme", Config.decorProgressReplayByTheme); + SetupStore("decorProgressReplayTypeUser", Config.decorProgressReplayTypeUser); + SetupStore("decorProgressReplaySizeUser", Config.decorProgressReplaySizeUser); + SetupStore("decorProgressSignalByTheme", Config.decorProgressSignalByTheme); + SetupStore("decorProgressSignalTypeUser", Config.decorProgressSignalTypeUser); + SetupStore("decorProgressSignalSizeUser", Config.decorProgressSignalSizeUser); + SetupStore("ButtonsShowEmpty", Config.ButtonsShowEmpty); + SetupStore("ChannelIconsShow", Config.ChannelIconsShow); + SetupStore("SignalQualityShow", Config.SignalQualityShow); + SetupStore("DiskUsageShow", Config.DiskUsageShow); + SetupStore("MenuItemPadding", Config.MenuItemPadding); + SetupStore("marginOsdVer", Config.marginOsdVer); + SetupStore("marginOsdHor", Config.marginOsdHor); + + Config.Init(); +} + + +//------------------------------------------------------------------------------------------------------------------ + +cMenuSetupSubMenu::cMenuSetupSubMenu(const char* Title, cFlatConfig* data) : cOsdMenu(Title, 30) { + SetupConfig = data; + ItemLastSel = -1; +} + +cOsdItem *cMenuSetupSubMenu::InfoItem(const char *label, const char *value) { + cOsdItem *item; + item = new cOsdItem(cString::sprintf("%s: %s", label, value)); + item->SetSelectable(false); + return item; +} + +// General Settings +cFlatSetupGeneral::cFlatSetupGeneral(cFlatConfig* data) : cMenuSetupSubMenu(tr("General settings"), data) { + Setup(); +} + +void cFlatSetupGeneral::Setup(void) { + Clear(); + + Add(new cMenuEditBoolItem(tr("Show empty color-buttons"), &SetupConfig->ButtonsShowEmpty)); + Add(new cMenuEditBoolItem(tr("Show Diskusage stats"), &SetupConfig->DiskUsageShow)); + Add(new cMenuEditIntItem(tr("OSD vertical margin"), &SetupConfig->marginOsdVer)); + Add(new cMenuEditIntItem(tr("OSD horizontal margin"), &SetupConfig->marginOsdHor)); + + Add(new cMenuEditBoolItem(tr("TopBar border by theme?"), &SetupConfig->decorBorderTopBarByTheme)); + if( SetupConfig->decorBorderTopBarByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("TopBar border type"), Bordertypes[SetupConfig->decorBorderTopBarTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("TopBar border size"), SetupConfig->decorBorderTopBarSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("TopBar border type"), &SetupConfig->decorBorderTopBarTypeUser, Bordertypes.Size(), &Bordertypes[0])); + Add(new cMenuEditIntItem(tr("TopBar border size"), &SetupConfig->decorBorderTopBarSizeUser)); + } + + Add(new cMenuEditBoolItem(tr("Message border by theme?"), &SetupConfig->decorBorderMessageByTheme)); + if( SetupConfig->decorBorderMessageByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Message border type"), Bordertypes[SetupConfig->decorBorderMessageTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Message border size"), SetupConfig->decorBorderMessageSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Message border type"), &SetupConfig->decorBorderMessageTypeUser, Bordertypes.Size(), &Bordertypes[0])); + Add(new cMenuEditIntItem(tr("Message border size"), &SetupConfig->decorBorderMessageSizeUser)); + } + + Add(new cMenuEditBoolItem(tr("Button border by theme?"), &SetupConfig->decorBorderButtonByTheme)); + if( SetupConfig->decorBorderButtonByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Button border type"), Bordertypes[SetupConfig->decorBorderButtonTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Button border size"), SetupConfig->decorBorderButtonSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Button border type"), &SetupConfig->decorBorderButtonTypeUser, Bordertypes.Size(), &Bordertypes[0])); + Add(new cMenuEditIntItem(tr("Button border size"), &SetupConfig->decorBorderButtonSizeUser)); + } + + if( ItemLastSel >= 0 ) { + SetCurrent(Get(ItemLastSel)); + ItemLastSel = -1; + } + + Display(); +} + +eOSState cFlatSetupGeneral::ProcessKey(eKeys Key) { + eOSState state = cOsdMenu::ProcessKey(Key); + if (state == osUnknown) { + switch (Key) { + case kOk: + return osBack; + default: + break; + } + } + if( Key == kLeft || Key == kRight ) { + const char* ItemText = Get(Current())->Text(); + if( strstr(ItemText, tr("TopBar border by theme?")) != NULL || + strstr(ItemText, tr("Message border by theme?")) != NULL || + strstr(ItemText, tr("Button border by theme?")) != NULL + ) { + ItemLastSel = Current(); + Setup(); + } + } + return state; +} + +// Channel Info Settings +cFlatSetupChannelInfo::cFlatSetupChannelInfo(cFlatConfig* data) : cMenuSetupSubMenu(tr("Channelinfo settings"), data) { + Setup(); +} + +void cFlatSetupChannelInfo::Setup(void) { + Clear(); + + Add(new cMenuEditBoolItem(tr("Show Channelinfo icons"), &SetupConfig->ChannelIconsShow)); + Add(new cMenuEditBoolItem(tr("Show signal quality"), &SetupConfig->SignalQualityShow)); + + Add(new cMenuEditBoolItem(tr("Channelinfo border by theme?"), &SetupConfig->decorBorderChannelByTheme)); + if( SetupConfig->decorBorderChannelByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Channelinfo border type"), Bordertypes[SetupConfig->decorBorderChannelTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Channelinfo border size"), SetupConfig->decorBorderChannelSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Channelinfo border type"), &SetupConfig->decorBorderChannelTypeUser, Bordertypes.Size(), &Bordertypes[0])); + Add(new cMenuEditIntItem(tr("Channelinfo border size"), &SetupConfig->decorBorderChannelSizeUser)); + } + + Add(new cMenuEditBoolItem(tr("Channelinfo progress by theme?"), &SetupConfig->decorProgressChannelByTheme)); + if( SetupConfig->decorProgressChannelByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Channelinfo progress type"), Progresstypes[SetupConfig->decorProgressChannelTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Channelinfo progress size"), SetupConfig->decorProgressChannelSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Channelinfo progress type"), &SetupConfig->decorProgressChannelTypeUser, Progresstypes.Size(), &Progresstypes[0])); + Add(new cMenuEditIntItem(tr("Channelinfo progress size"), &SetupConfig->decorProgressChannelSizeUser)); + } + + Add(new cMenuEditBoolItem(tr("Signalquality progress by theme?"), &SetupConfig->decorProgressSignalByTheme)); + if( SetupConfig->decorProgressSignalByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Signalquality progress type"), Progresstypes[SetupConfig->decorProgressSignalTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Signalquality progress size"), SetupConfig->decorProgressSignalSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Signalquality progress type"), &SetupConfig->decorProgressSignalTypeUser, Progresstypes.Size(), &Progresstypes[0])); + Add(new cMenuEditIntItem(tr("Signalquality progress size"), &SetupConfig->decorProgressSignalSizeUser)); + } + + if( ItemLastSel >= 0 ) { + SetCurrent(Get(ItemLastSel)); + ItemLastSel = -1; + } + + Display(); +} + +eOSState cFlatSetupChannelInfo::ProcessKey(eKeys Key) { + eOSState state = cOsdMenu::ProcessKey(Key); + if (state == osUnknown) { + switch (Key) { + case kOk: + return osBack; + default: + break; + } + } + if( Key == kLeft || Key == kRight ) { + const char* ItemText = Get(Current())->Text(); + if( strstr(ItemText, tr("Channelinfo border by theme?")) != NULL || + strstr(ItemText, tr("Channelinfo progress by theme?")) != NULL || + strstr(ItemText, tr("Signalquality progress by theme?")) != NULL + ) { + ItemLastSel = Current(); + Setup(); + } + } + return state; +} + +// Menu Settings +cFlatSetupMenu::cFlatSetupMenu(cFlatConfig* data) : cMenuSetupSubMenu(tr("Menu settings"), data) { + Setup(); +} + +void cFlatSetupMenu::Setup(void) { + Clear(); + + Add(new cMenuEditIntItem(tr("Menuitem padding"), &SetupConfig->MenuItemPadding)); + + Add(new cMenuEditBoolItem(tr("Menuitem border by theme?"), &SetupConfig->decorBorderMenuItemByTheme)); + if( SetupConfig->decorBorderMenuItemByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Menuitem border type"), Bordertypes[SetupConfig->decorBorderMenuItemTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Menuitem border size"), SetupConfig->decorBorderMenuItemSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Menuitem border type"), &SetupConfig->decorBorderMenuItemTypeUser, Bordertypes.Size(), &Bordertypes[0])); + Add(new cMenuEditIntItem(tr("Menuitem border size"), &SetupConfig->decorBorderMenuItemSizeUser)); + } + + Add(new cMenuEditBoolItem(tr("Menucont. border by theme?"), &SetupConfig->decorBorderMenuContentByTheme)); + if( SetupConfig->decorBorderMenuContentByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Menucont. border type"), Bordertypes[SetupConfig->decorBorderMenuContentTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Menucont. border size"), SetupConfig->decorBorderMenuContentSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Menucont. border type"), &SetupConfig->decorBorderMenuContentTypeUser, Bordertypes.Size(), &Bordertypes[0])); + Add(new cMenuEditIntItem(tr("Menucont. border size"), &SetupConfig->decorBorderMenuContentSizeUser)); + } + + Add(new cMenuEditBoolItem(tr("Menucont. head border by theme?"), &SetupConfig->decorBorderMenuContentHeadByTheme)); + if( SetupConfig->decorBorderMenuContentHeadByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Menucont. head border type"), Bordertypes[SetupConfig->decorBorderMenuContentHeadTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Menucont. head border size"), SetupConfig->decorBorderMenuContentHeadSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Menucont. head border type"), &SetupConfig->decorBorderMenuContentHeadTypeUser, Bordertypes.Size(), &Bordertypes[0])); + Add(new cMenuEditIntItem(tr("Menucont. head border size"), &SetupConfig->decorBorderMenuContentHeadSizeUser)); + } + + Add(new cMenuEditBoolItem(tr("Menuitem progress by theme?"), &SetupConfig->decorProgressMenuItemByTheme)); + if( SetupConfig->decorProgressMenuItemByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Menuitem progress type"), Progresstypes[SetupConfig->decorProgressMenuItemTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Menuitem progress size"), SetupConfig->decorProgressMenuItemSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Menuitem progress type"), &SetupConfig->decorProgressMenuItemTypeUser, Progresstypes.Size(), &Progresstypes[0])); + Add(new cMenuEditIntItem(tr("Menuitem progress size"), &SetupConfig->decorProgressMenuItemSizeUser)); + } + + if( ItemLastSel >= 0 ) { + SetCurrent(Get(ItemLastSel)); + ItemLastSel = -1; + } + + Display(); +} + +eOSState cFlatSetupMenu::ProcessKey(eKeys Key) { + eOSState state = cOsdMenu::ProcessKey(Key); + if (state == osUnknown) { + switch (Key) { + case kOk: + return osBack; + default: + break; + } + } + if( Key == kLeft || Key == kRight ) { + const char* ItemText = Get(Current())->Text(); + if( strstr(ItemText, tr("Menuitem border by theme?")) != NULL || + strstr(ItemText, tr("Menucont. border by theme?")) != NULL || + strstr(ItemText, tr("Menucont. head border by theme?")) != NULL || + strstr(ItemText, tr("Menuitem progress by theme?")) != NULL + ) { + ItemLastSel = Current(); + Setup(); + } + } + return state; +} + +// Replay Settings +cFlatSetupReplay::cFlatSetupReplay(cFlatConfig* data) : cMenuSetupSubMenu(tr("Replay settings"), data) { + Setup(); +} + +void cFlatSetupReplay::Setup(void) { + Clear(); + + Add(new cMenuEditBoolItem(tr("Replay border by theme?"), &SetupConfig->decorBorderReplayByTheme)); + if( SetupConfig->decorBorderReplayByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Replay border type"), Bordertypes[SetupConfig->decorBorderReplayTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Replay border size"), SetupConfig->decorBorderReplaySizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Replay border type"), &SetupConfig->decorBorderReplayTypeUser, Bordertypes.Size(), &Bordertypes[0])); + Add(new cMenuEditIntItem(tr("Replay border size"), &SetupConfig->decorBorderReplaySizeUser)); + } + + Add(new cMenuEditBoolItem(tr("Replay progress by theme?"), &SetupConfig->decorProgressReplayByTheme)); + if( SetupConfig->decorProgressReplayByTheme ) { + cString size = cString::sprintf("%s:\t%d", tr("Replay progress size"), SetupConfig->decorProgressReplaySizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditIntItem(tr("Replay progress size"), &SetupConfig->decorProgressReplaySizeUser)); + } + + if( ItemLastSel >= 0 ) { + SetCurrent(Get(ItemLastSel)); + ItemLastSel = -1; + } + + Display(); +} + +eOSState cFlatSetupReplay::ProcessKey(eKeys Key) { + eOSState state = cOsdMenu::ProcessKey(Key); + if (state == osUnknown) { + switch (Key) { + case kOk: + return osBack; + default: + break; + } + } + if( Key == kLeft || Key == kRight ) { + const char* ItemText = Get(Current())->Text(); + if( strstr(ItemText, tr("Replay border by theme?")) != NULL || + strstr(ItemText, tr("Replay progress by theme?")) != NULL + ) { + ItemLastSel = Current(); + Setup(); + } + } + return state; +} + +// Volume Settings +cFlatSetupVolume::cFlatSetupVolume(cFlatConfig* data) : cMenuSetupSubMenu(tr("Volume settings"), data) { + Setup(); +} + +void cFlatSetupVolume::Setup(void) { + Clear(); + + Add(new cMenuEditBoolItem(tr("Volume border by theme?"), &SetupConfig->decorBorderVolumeByTheme)); + if( SetupConfig->decorBorderVolumeByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Volume border type"), Bordertypes[SetupConfig->decorBorderVolumeTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Volume border size"), SetupConfig->decorBorderVolumeSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Volume border type"), &SetupConfig->decorBorderVolumeTypeUser, Bordertypes.Size(), &Bordertypes[0])); + Add(new cMenuEditIntItem(tr("Volume border size"), &SetupConfig->decorBorderVolumeSizeUser)); + } + + Add(new cMenuEditBoolItem(tr("Volume progress by theme?"), &SetupConfig->decorProgressVolumeByTheme)); + if( SetupConfig->decorProgressVolumeByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Volume progress type"), Progresstypes[SetupConfig->decorProgressVolumeTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Volume progress size"), SetupConfig->decorProgressVolumeSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Volume progress type"), &SetupConfig->decorProgressVolumeTypeUser, Progresstypes.Size(), &Progresstypes[0])); + Add(new cMenuEditIntItem(tr("Volume progress size"), &SetupConfig->decorProgressVolumeSizeUser)); + } + + if( ItemLastSel >= 0 ) { + SetCurrent(Get(ItemLastSel)); + ItemLastSel = -1; + } + + Display(); +} + +eOSState cFlatSetupVolume::ProcessKey(eKeys Key) { + eOSState state = cOsdMenu::ProcessKey(Key); + if (state == osUnknown) { + switch (Key) { + case kOk: + return osBack; + default: + break; + } + } + if( Key == kLeft || Key == kRight ) { + const char* ItemText = Get(Current())->Text(); + if( strstr(ItemText, tr("Volume border by theme?")) != NULL || + strstr(ItemText, tr("Volume progress by theme?")) != NULL + ) { + ItemLastSel = Current(); + Setup(); + } + } + return state; +} + +// Tracks Settings +cFlatSetupTracks::cFlatSetupTracks(cFlatConfig* data) : cMenuSetupSubMenu(tr("Tracks settings"), data) { + Setup(); +} + +void cFlatSetupTracks::Setup(void) { + Clear(); + + Add(new cMenuEditBoolItem(tr("Tracks border by theme?"), &SetupConfig->decorBorderTrackByTheme)); + if( SetupConfig->decorBorderTrackByTheme ) { + cString type = cString::sprintf("%s:\t%s", tr("Tracks border type"), Bordertypes[SetupConfig->decorBorderTrackTypeTheme]); + Add(new cOsdItem(type, osUnknown, false)); + cString size = cString::sprintf("%s:\t%d", tr("Tracks border size"), SetupConfig->decorBorderTrackSizeTheme); + Add(new cOsdItem(size, osUnknown, false)); + } else { + Add(new cMenuEditStraItem(tr("Tracks border type"), &SetupConfig->decorBorderTrackTypeUser, Bordertypes.Size(), &Bordertypes[0])); + Add(new cMenuEditIntItem(tr("Tracks border size"), &SetupConfig->decorBorderTrackSizeUser)); + } + + if( ItemLastSel >= 0 ) { + SetCurrent(Get(ItemLastSel)); + ItemLastSel = -1; + } + + Display(); +} + +eOSState cFlatSetupTracks::ProcessKey(eKeys Key) { + eOSState state = cOsdMenu::ProcessKey(Key); + if (state == osUnknown) { + switch (Key) { + case kOk: + return osBack; + default: + break; + } + } + if( Key == kLeft || Key == kRight ) { + const char* ItemText = Get(Current())->Text(); + if( strstr(ItemText, tr("Tracks border by theme?")) != NULL + ) { + ItemLastSel = Current(); + Setup(); + } + } + return state; +} diff --git a/setup.h b/setup.h new file mode 100644 index 00000000..e433091d --- /dev/null +++ b/setup.h @@ -0,0 +1,77 @@ +#pragma once + +#include <vdr/menu.h> +#include <vdr/tools.h> +#include "config.h" + +class cFlatSetup : public cMenuSetupPage { + public: + cFlatSetup(void); + virtual ~cFlatSetup(); + private: + cFlatConfig SetupConfig; + + int ItemLastSel; + void Setup(void); + protected: + virtual void Store(void); + virtual eOSState ProcessKey(eKeys Key); +}; + +class cMenuSetupSubMenu : public cOsdMenu { + protected: + cFlatConfig *SetupConfig; + virtual void Setup(void) = 0; + cOsdItem *InfoItem(const char *label, const char *value); + int ItemLastSel; + public: + cMenuSetupSubMenu(const char *Title, cFlatConfig *data); +}; + +class cFlatSetupGeneral : public cMenuSetupSubMenu { + protected: + void Setup(void); + public: + cFlatSetupGeneral(cFlatConfig *data); + virtual eOSState ProcessKey(eKeys Key); +}; + +class cFlatSetupChannelInfo : public cMenuSetupSubMenu { + protected: + void Setup(void); + public: + cFlatSetupChannelInfo(cFlatConfig *data); + virtual eOSState ProcessKey(eKeys Key); +}; + +class cFlatSetupMenu : public cMenuSetupSubMenu { + protected: + void Setup(void); + public: + cFlatSetupMenu(cFlatConfig *data); + virtual eOSState ProcessKey(eKeys Key); +}; + +class cFlatSetupReplay : public cMenuSetupSubMenu { + protected: + void Setup(void); + public: + cFlatSetupReplay(cFlatConfig *data); + virtual eOSState ProcessKey(eKeys Key); +}; + +class cFlatSetupVolume : public cMenuSetupSubMenu { + protected: + void Setup(void); + public: + cFlatSetupVolume(cFlatConfig *data); + virtual eOSState ProcessKey(eKeys Key); +}; + +class cFlatSetupTracks : public cMenuSetupSubMenu { + protected: + void Setup(void); + public: + cFlatSetupTracks(cFlatConfig *data); + virtual eOSState ProcessKey(eKeys Key); +};
\ No newline at end of file diff --git a/skinflatplus.c b/skinflatplus.c new file mode 100644 index 00000000..609c8d9e --- /dev/null +++ b/skinflatplus.c @@ -0,0 +1,134 @@ +/* + * skinflat.c: A plugin for the Video Disk Recorder + * + * See the README file for copyright information and how to reach the author. + * + * $Id$ + */ +#include <getopt.h> +#include <vdr/plugin.h> + +#if defined(APIVERSNUM) && APIVERSNUM < 10734 +#error "VDR-1.7.34 API version or greater is required!" +#endif + +#include "flat.h" +#include "setup.h" + +static const char *VERSION = "0.0.1"; +static const char *DESCRIPTION = "skin flatplus"; + +class cPluginFlat : public cPlugin { + private: + cFlat *flat; + public: + cPluginFlat(void); + virtual ~cPluginFlat(); + virtual const char *Version(void) { return VERSION; } + virtual const char *Description(void) { return DESCRIPTION; } + virtual const char *CommandLineHelp(void); + virtual bool ProcessArgs(int argc, char *argv[]); + virtual bool Initialize(void); + virtual bool Start(void); + virtual void Stop(void); + virtual void Housekeeping(void); + virtual void MainThreadHook(void); + virtual cString Active(void); + virtual time_t WakeupTime(void); + virtual const char *MainMenuEntry(void) {return NULL;} + virtual cOsdObject *MainMenuAction(void); + virtual cMenuSetupPage *SetupMenu(void); + virtual bool SetupParse(const char *Name, const char *Value); + virtual bool Service(const char *Id, void *Data = NULL); + virtual const char **SVDRPHelpPages(void); + virtual cString SVDRPCommand(const char *Command, const char *Option, int &ReplyCode); +}; + +cPluginFlat::cPluginFlat(void) { + flat = NULL; +} + +cPluginFlat::~cPluginFlat() { +} + +const char *cPluginFlat::CommandLineHelp(void) { + return " -l <LOGOPATH>, --logopath=<LOGOPATH> Set directory where Channel Logos are stored.\n"; +} + +bool cPluginFlat::ProcessArgs(int argc, char *argv[]) { + // Implement command line argument processing here if applicable. + static const struct option long_options[] = { + { "logopath", required_argument, NULL, 'l' }, + { NULL } + }; + + int c; + while ((c = getopt_long(argc, argv, "l:", long_options, NULL)) != -1) { + switch (c) { + case 'l': + Config.SetLogoPath(cString(optarg)); + break; + default: + return false; + } + } + return true; +} + +bool cPluginFlat::Initialize(void) { + Config.Init(); + return true; +} + +bool cPluginFlat::Start(void) { + if (!cOsdProvider::SupportsTrueColor()) { + esyslog("skinflat: No TrueColor OSD found! Aborting!"); + return false; + } else + dsyslog("skinflat: TrueColor OSD found"); + flat = new cFlat; + return flat; +} + +void cPluginFlat::Stop(void) { +} + +void cPluginFlat::Housekeeping(void) { +} + +void cPluginFlat::MainThreadHook(void) { +} + +cString cPluginFlat::Active(void) { + return NULL; +} + +time_t cPluginFlat::WakeupTime(void) { + return 0; +} + +cOsdObject *cPluginFlat::MainMenuAction(void) { + return NULL; +} + +cMenuSetupPage *cPluginFlat::SetupMenu(void) { + return new cFlatSetup(); +} + +bool cPluginFlat::SetupParse(const char *Name, const char *Value) { + return Config.SetupParse(Name, Value); +} + +bool cPluginFlat::Service(const char *Id, void *Data) { + return false; +} + +const char **cPluginFlat::SVDRPHelpPages(void) { + return NULL; +} + +cString cPluginFlat::SVDRPCommand(const char *Command, const char *Option, int &ReplyCode) { + return NULL; +} + +VDRPLUGINCREATOR(cPluginFlat); // Don't touch this! diff --git a/themes/flatPlus-def_rectalpha.theme b/themes/flatPlus-def_rectalpha.theme new file mode 100644 index 00000000..9a44aaff --- /dev/null +++ b/themes/flatPlus-def_rectalpha.theme @@ -0,0 +1,125 @@ +Description = Default + rect alpha +clrTopBarBg = C0101010 +clrTopBarFont = FFEEEEEE +clrTopBarTimeFont = FFEEEEEE +clrTopBarDateFont = FFA0A0A0 +clrTopBarBorderFg = C0101010 +clrTopBarBorderBg = C0101010 +clrTopBarBorderType = 00000004 +clrTopBarBorderSize = 0000000F +clrButtonBg = C0101010 +clrButtonFont = FFEEEEEE +clrButtonRed = FFBB0000 +clrButtonGreen = FF00BB00 +clrButtonYellow = FFBBBB00 +clrButtonBlue = FF0000BB +clrButtonBorderFg = C0101010 +clrButtonBorderBg = C0101010 +clrButtonBorderType = 00000004 +clrButtonBorderSize = 0000000F +clrMessageBg = C0101010 +clrMessageFont = FFEEEEEE +clrMessageStatus = FF0000FF +clrMessageInfo = FF009900 +clrMessageWarning = FFBBBB00 +clrMessageError = FFBB0000 +clrMessageBorderFg = C0101010 +clrMessageBorderBg = C0101010 +clrMessageBorderType = 00000004 +clrMessageBorderSize = 0000000F +clrChannelBg = C0101010 +clrChannelFontTitle = FF3090B0 +clrChannelFontEpg = FFEEEEEE +clrChannelFontEpgFollow = FFA0A0A0 +clrChannelProgressFg = FF3090B0 +clrChannelProgressBarFg = FF3090B0 +clrChannelProgressBg = C0101010 +clrChannelProgressType = 00000008 +clrChannelProgressSize = 0000000F +clrChannelBorderFg = C03090B0 +clrChannelBorderBg = C03090B0 +clrChannelBorderType = 00000004 +clrChannelBorderSize = 0000000F +clrChannelSignalFont = FFA0A0A0 +clrChannelSignalProgressFg = FFA0A0A0 +clrChannelSignalProgressBarFg = FFA0A0A0 +clrChannelSignalProgressBg = C0101010 +clrChannelSignalProgressType = 00000002 +clrChannelSignalProgressSize = 0000000A +clrItemBg = C0909090 +clrItemFont = FFEEEEEE +clrItemCurrentBg = C03090B0 +clrItemCurrentFont = FFEEEEEE +clrItemSelableBg = C0101010 +clrItemSelableFont = FFEEEEEE +clrScrollbarFg = FF3090B0 +clrScrollbarBarFg = FF3090B0 +clrScrollbarBg = C0101010 +clrMenuEventBg = C0101010 +clrMenuEventFontTitle = FF3090B0 +clrMenuEventFontInfo = FFEEEEEE +clrMenuRecBg = C0101010 +clrMenuRecFontTitle = FF3090B0 +clrMenuRecFontInfo = FFEEEEEE +clrMenuTextBg = C0101010 +clrMenuTextFont = FFEEEEEE +clrMenuContentHeadBorderFg = C0101010 +clrMenuContentHeadBorderBg = C0101010 +clrMenuContentHeadBorderType = 00000004 +clrMenuContentHeadBorderSize = 0000000F +clrMenuContentBorderFg = C03090B0 +clrMenuContentBorderBg = C03090B0 +clrMenuContentBorderType = 00000004 +clrMenuContentBorderSize = 0000000F +clrMenuItemProgressFg = FFEEEEEE +clrMenuItemProgressBarFg = FFEEEEEE +clrMenuItemProgressBg = C0101010 +clrMenuItemCurProgressFg = FFEEEEEE +clrMenuItemCurProgressBarFg = FFEEEEEE +clrMenuItemCurProgressBg = C03090B0 +clrMenuItemProgressType = 00000002 +clrMenuItemProgressSize = 00000014 +clrMenuItemBorderType = 00000004 +clrMenuItemBorderSize = 0000000F +clrMenuItemBorderFg = C0909090 +clrMenuItemBorderBg = C0909090 +clrMenuItemSelableBorderFg = C0101010 +clrMenuItemSelableBorderBg = C0101010 +clrMenuItemCurrentBorderFg = C03090B0 +clrMenuItemCurrentBorderBg = C03090B0 +clrReplayBg = C0101010 +clrReplayFont = FFEEEEEE +clrReplayFontSpeed = FF3090B0 +clrReplayProgressFg = FFEEEEEE +clrReplayProgressBarFg = FFEEEEEE +clrReplayProgressBarCurFg = FF3090B0 +clrReplayProgressBg = C0101010 +clrReplayMarkFg = FFEEEEEE +clrReplayMarkCurrentFg = FF3090B0 +clrReplayProgressType = 00000000 +clrReplayProgressSize = 00000028 +clrReplayBorderFg = C0101010 +clrReplayBorderBg = C0101010 +clrReplayBorderType = 00000004 +clrReplayBorderSize = 0000000F +clrTrackItemBg = C0101010 +clrTrackItemFont = FFEEEEEE +clrTrackItemCurrentBg = C03090B0 +clrTrackItemCurrentFont = FFEEEEEE +clrTrackItemBorderFg = C0101010 +clrTrackItemBorderBg = C0101010 +clrTrackItemBorderType = 00000004 +clrTrackItemBorderSize = 0000000F +clrTrackItemCurrentBorderFg = C03090B0 +clrTrackItemCurrentBorderBg = C03090B0 +clrVolumeBg = C0101010 +clrVolumeFont = FFEEEEEE +clrVolumeProgressFg = FF3090B0 +clrVolumeProgressBarFg = FF3090B0 +clrVolumeProgressBg = C0101010 +clrVolumeProgressType = 00000008 +clrVolumeProgressSize = 0000000F +clrVolumeBorderFg = C0101010 +clrVolumeBorderBg = C0101010 +clrVolumeBorderType = 00000004 +clrVolumeBorderSize = 0000000F diff --git a/themes/flatPlus-def_round.theme b/themes/flatPlus-def_round.theme new file mode 100644 index 00000000..a4ac63a0 --- /dev/null +++ b/themes/flatPlus-def_round.theme @@ -0,0 +1,125 @@ +Description = Default + round +clrTopBarBg = C0101010 +clrTopBarFont = FFEEEEEE +clrTopBarTimeFont = FFEEEEEE +clrTopBarDateFont = FFA0A0A0 +clrTopBarBorderFg = C0101010 +clrTopBarBorderBg = C0101010 +clrTopBarBorderType = 00000002 +clrTopBarBorderSize = 0000000F +clrButtonBg = C0101010 +clrButtonFont = FFEEEEEE +clrButtonRed = FFBB0000 +clrButtonGreen = FF00BB00 +clrButtonYellow = FFBBBB00 +clrButtonBlue = FF0000BB +clrButtonBorderFg = C0101010 +clrButtonBorderBg = C0101010 +clrButtonBorderType = 00000002 +clrButtonBorderSize = 0000000F +clrMessageBg = C0101010 +clrMessageFont = FFEEEEEE +clrMessageStatus = FF0000FF +clrMessageInfo = FF009900 +clrMessageWarning = FFBBBB00 +clrMessageError = FFBB0000 +clrMessageBorderFg = C0101010 +clrMessageBorderBg = C0101010 +clrMessageBorderType = 00000002 +clrMessageBorderSize = 0000000F +clrChannelBg = C0101010 +clrChannelFontTitle = FF3090B0 +clrChannelFontEpg = FFEEEEEE +clrChannelFontEpgFollow = FFA0A0A0 +clrChannelProgressFg = FF3090B0 +clrChannelProgressBarFg = FF3090B0 +clrChannelProgressBg = C0101010 +clrChannelProgressType = 00000003 +clrChannelProgressSize = 0000000A +clrChannelBorderFg = C03090B0 +clrChannelBorderBg = C03090B0 +clrChannelBorderType = 00000002 +clrChannelBorderSize = 0000000F +clrChannelSignalFont = FFA0A0A0 +clrChannelSignalProgressFg = FFA0A0A0 +clrChannelSignalProgressBarFg = FFA0A0A0 +clrChannelSignalProgressBg = C0101010 +clrChannelSignalProgressType = 00000002 +clrChannelSignalProgressSize = 0000000A +clrItemBg = C0909090 +clrItemFont = FFEEEEEE +clrItemCurrentBg = C03090B0 +clrItemCurrentFont = FFEEEEEE +clrItemSelableBg = C0101010 +clrItemSelableFont = FFEEEEEE +clrScrollbarFg = FF3090B0 +clrScrollbarBarFg = FF3090B0 +clrScrollbarBg = C0101010 +clrMenuEventBg = C0101010 +clrMenuEventFontTitle = FF3090B0 +clrMenuEventFontInfo = FFEEEEEE +clrMenuRecBg = C0101010 +clrMenuRecFontTitle = FF3090B0 +clrMenuRecFontInfo = FFEEEEEE +clrMenuTextBg = C0101010 +clrMenuTextFont = FFEEEEEE +clrMenuContentHeadBorderFg = C0101010 +clrMenuContentHeadBorderBg = C0101010 +clrMenuContentHeadBorderType = 00000002 +clrMenuContentHeadBorderSize = 0000000F +clrMenuContentBorderFg = C03090B0 +clrMenuContentBorderBg = C03090B0 +clrMenuContentBorderType = 00000002 +clrMenuContentBorderSize = 0000000F +clrMenuItemProgressFg = FFEEEEEE +clrMenuItemProgressBarFg = FFEEEEEE +clrMenuItemProgressBg = C0101010 +clrMenuItemCurProgressFg = FFEEEEEE +clrMenuItemCurProgressBarFg = FFEEEEEE +clrMenuItemCurProgressBg = C03090B0 +clrMenuItemProgressType = 00000002 +clrMenuItemProgressSize = 00000014 +clrMenuItemBorderType = 00000002 +clrMenuItemBorderSize = 0000000F +clrMenuItemBorderFg = C0909090 +clrMenuItemBorderBg = C0909090 +clrMenuItemSelableBorderFg = C0101010 +clrMenuItemSelableBorderBg = C0101010 +clrMenuItemCurrentBorderFg = C03090B0 +clrMenuItemCurrentBorderBg = C03090B0 +clrReplayBg = C0101010 +clrReplayFont = FFEEEEEE +clrReplayFontSpeed = FF3090B0 +clrReplayProgressFg = FFEEEEEE +clrReplayProgressBarFg = FFEEEEEE +clrReplayProgressBarCurFg = FF3090B0 +clrReplayProgressBg = C0101010 +clrReplayMarkFg = FFEEEEEE +clrReplayMarkCurrentFg = FF3090B0 +clrReplayProgressType = 00000000 +clrReplayProgressSize = 00000028 +clrReplayBorderFg = C0101010 +clrReplayBorderBg = C0101010 +clrReplayBorderType = 00000002 +clrReplayBorderSize = 0000000F +clrTrackItemBg = C0101010 +clrTrackItemFont = FFEEEEEE +clrTrackItemCurrentBg = C03090B0 +clrTrackItemCurrentFont = FFEEEEEE +clrTrackItemBorderFg = C0101010 +clrTrackItemBorderBg = C0101010 +clrTrackItemBorderType = 00000002 +clrTrackItemBorderSize = 0000000F +clrTrackItemCurrentBorderFg = C03090B0 +clrTrackItemCurrentBorderBg = C03090B0 +clrVolumeBg = C0101010 +clrVolumeFont = FFEEEEEE +clrVolumeProgressFg = FF3090B0 +clrVolumeProgressBarFg = FF3090B0 +clrVolumeProgressBg = C0101010 +clrVolumeProgressType = 00000003 +clrVolumeProgressSize = 0000000A +clrVolumeBorderFg = C0101010 +clrVolumeBorderBg = C0101010 +clrVolumeBorderType = 00000002 +clrVolumeBorderSize = 0000000F diff --git a/themes/flatPlus-def_roundalpha.theme b/themes/flatPlus-def_roundalpha.theme new file mode 100644 index 00000000..75470b66 --- /dev/null +++ b/themes/flatPlus-def_roundalpha.theme @@ -0,0 +1,125 @@ +Description = Default + round alpha +clrTopBarBg = C0101010 +clrTopBarFont = FFEEEEEE +clrTopBarTimeFont = FFEEEEEE +clrTopBarDateFont = FFA0A0A0 +clrTopBarBorderFg = C0101010 +clrTopBarBorderBg = C0101010 +clrTopBarBorderType = 00000005 +clrTopBarBorderSize = 0000000F +clrButtonBg = C0101010 +clrButtonFont = FFEEEEEE +clrButtonRed = FFBB0000 +clrButtonGreen = FF00BB00 +clrButtonYellow = FFBBBB00 +clrButtonBlue = FF0000BB +clrButtonBorderFg = C0101010 +clrButtonBorderBg = C0101010 +clrButtonBorderType = 00000005 +clrButtonBorderSize = 0000000F +clrMessageBg = C0101010 +clrMessageFont = FFEEEEEE +clrMessageStatus = FF0000FF +clrMessageInfo = FF009900 +clrMessageWarning = FFBBBB00 +clrMessageError = FFBB0000 +clrMessageBorderFg = C0101010 +clrMessageBorderBg = C0101010 +clrMessageBorderType = 00000005 +clrMessageBorderSize = 0000000F +clrChannelBg = C0101010 +clrChannelFontTitle = FF3090B0 +clrChannelFontEpg = FFEEEEEE +clrChannelFontEpgFollow = FFA0A0A0 +clrChannelProgressFg = FF3090B0 +clrChannelProgressBarFg = FF3090B0 +clrChannelProgressBg = C0101010 +clrChannelProgressType = 00000008 +clrChannelProgressSize = 0000000F +clrChannelBorderFg = C03090B0 +clrChannelBorderBg = C03090B0 +clrChannelBorderType = 00000005 +clrChannelBorderSize = 0000000F +clrChannelSignalFont = FFA0A0A0 +clrChannelSignalProgressFg = FFA0A0A0 +clrChannelSignalProgressBarFg = FFA0A0A0 +clrChannelSignalProgressBg = C0101010 +clrChannelSignalProgressType = 00000002 +clrChannelSignalProgressSize = 0000000A +clrItemBg = C0909090 +clrItemFont = FFEEEEEE +clrItemCurrentBg = C03090B0 +clrItemCurrentFont = FFEEEEEE +clrItemSelableBg = C0101010 +clrItemSelableFont = FFEEEEEE +clrScrollbarFg = FF3090B0 +clrScrollbarBarFg = FF3090B0 +clrScrollbarBg = C0101010 +clrMenuEventBg = C0101010 +clrMenuEventFontTitle = FF3090B0 +clrMenuEventFontInfo = FFEEEEEE +clrMenuRecBg = C0101010 +clrMenuRecFontTitle = FF3090B0 +clrMenuRecFontInfo = FFEEEEEE +clrMenuTextBg = C0101010 +clrMenuTextFont = FFEEEEEE +clrMenuContentHeadBorderFg = C0101010 +clrMenuContentHeadBorderBg = C0101010 +clrMenuContentHeadBorderType = 00000005 +clrMenuContentHeadBorderSize = 0000000F +clrMenuContentBorderFg = C03090B0 +clrMenuContentBorderBg = C03090B0 +clrMenuContentBorderType = 00000005 +clrMenuContentBorderSize = 0000000F +clrMenuItemProgressFg = FFEEEEEE +clrMenuItemProgressBarFg = FFEEEEEE +clrMenuItemProgressBg = C0101010 +clrMenuItemCurProgressFg = FFEEEEEE +clrMenuItemCurProgressBarFg = FFEEEEEE +clrMenuItemCurProgressBg = C03090B0 +clrMenuItemProgressType = 00000002 +clrMenuItemProgressSize = 00000014 +clrMenuItemBorderType = 00000005 +clrMenuItemBorderSize = 0000000F +clrMenuItemBorderFg = C0909090 +clrMenuItemBorderBg = C0909090 +clrMenuItemSelableBorderFg = C0101010 +clrMenuItemSelableBorderBg = C0101010 +clrMenuItemCurrentBorderFg = C03090B0 +clrMenuItemCurrentBorderBg = C03090B0 +clrReplayBg = C0101010 +clrReplayFont = FFEEEEEE +clrReplayFontSpeed = FF3090B0 +clrReplayProgressFg = FFEEEEEE +clrReplayProgressBarFg = FFEEEEEE +clrReplayProgressBarCurFg = FF3090B0 +clrReplayProgressBg = C0101010 +clrReplayMarkFg = FFEEEEEE +clrReplayMarkCurrentFg = FF3090B0 +clrReplayProgressType = 00000000 +clrReplayProgressSize = 00000028 +clrReplayBorderFg = C0101010 +clrReplayBorderBg = C0101010 +clrReplayBorderType = 00000005 +clrReplayBorderSize = 0000000F +clrTrackItemBg = C0101010 +clrTrackItemFont = FFEEEEEE +clrTrackItemCurrentBg = C03090B0 +clrTrackItemCurrentFont = FFEEEEEE +clrTrackItemBorderFg = C0101010 +clrTrackItemBorderBg = C0101010 +clrTrackItemBorderType = 00000005 +clrTrackItemBorderSize = 0000000F +clrTrackItemCurrentBorderFg = C03090B0 +clrTrackItemCurrentBorderBg = C03090B0 +clrVolumeBg = C0101010 +clrVolumeFont = FFEEEEEE +clrVolumeProgressFg = FF3090B0 +clrVolumeProgressBarFg = FF3090B0 +clrVolumeProgressBg = C0101010 +clrVolumeProgressType = 00000008 +clrVolumeProgressSize = 0000000F +clrVolumeBorderFg = C0101010 +clrVolumeBorderBg = C0101010 +clrVolumeBorderType = 00000005 +clrVolumeBorderSize = 0000000F |