From 3ac5d47f0cf394774c42db6a02ea0d9baaf99b54 Mon Sep 17 00:00:00 2001 From: Sandro Kalatozishvili Date: Thu, 28 Sep 2023 03:19:18 +0400 Subject: [PATCH] Initial commit --- LICENSE | 674 ++++++++++++++++++++++++++++++ README.md | 47 +++ application.fam | 17 + assets/Back_icon_10x8.png | Bin 0 -> 3606 bytes assets/Button_18x18.png | Bin 0 -> 3609 bytes assets/IR_Icon_10x10.png | Bin 0 -> 6638 bytes assets/OK_Icon_9x9.png | Bin 0 -> 3605 bytes deploy.sh | 29 ++ icon.png | Bin 0 -> 305 bytes infrared/LICENSE | 674 ++++++++++++++++++++++++++++++ infrared/infrared_remote.c | 217 ++++++++++ infrared/infrared_remote.h | 41 ++ infrared/infrared_remote_button.c | 45 ++ infrared/infrared_remote_button.h | 22 + infrared/infrared_signal.c | 323 ++++++++++++++ infrared/infrared_signal.h | 53 +++ screens/app_menu.png | Bin 0 -> 5940 bytes screens/control.png | Bin 0 -> 8986 bytes screens/control_2.png | Bin 0 -> 4754 bytes screens/playback.png | Bin 0 -> 8896 bytes views/xremote_about_view.c | 40 ++ views/xremote_about_view.h | 13 + views/xremote_common_view.c | 224 ++++++++++ views/xremote_common_view.h | 111 +++++ views/xremote_control_view.c | 95 +++++ views/xremote_control_view.h | 13 + views/xremote_custom_view.c | 24 ++ views/xremote_custom_view.h | 13 + views/xremote_general_view.c | 24 ++ views/xremote_general_view.h | 13 + views/xremote_learn_view.c | 24 ++ views/xremote_learn_view.h | 13 + views/xremote_player_view.c | 95 +++++ views/xremote_player_view.h | 13 + views/xremote_settings_view.c | 24 ++ views/xremote_settings_view.h | 13 + xremote.c | 102 +++++ xremote.h | 15 + xremote_app.c | 192 +++++++++ xremote_app.h | 70 ++++ xremote_control.c | 119 ++++++ xremote_control.h | 13 + xremote_learn.c | 24 ++ xremote_learn.h | 13 + xremote_settings.c | 24 ++ xremote_settings.h | 13 + 46 files changed, 3479 insertions(+) create mode 100644 LICENSE create mode 100644 README.md create mode 100644 application.fam create mode 100644 assets/Back_icon_10x8.png create mode 100644 assets/Button_18x18.png create mode 100644 assets/IR_Icon_10x10.png create mode 100644 assets/OK_Icon_9x9.png create mode 100755 deploy.sh create mode 100644 icon.png create mode 100644 infrared/LICENSE create mode 100644 infrared/infrared_remote.c create mode 100644 infrared/infrared_remote.h create mode 100644 infrared/infrared_remote_button.c create mode 100644 infrared/infrared_remote_button.h create mode 100644 infrared/infrared_signal.c create mode 100644 infrared/infrared_signal.h create mode 100644 screens/app_menu.png create mode 100644 screens/control.png create mode 100644 screens/control_2.png create mode 100644 screens/playback.png create mode 100644 views/xremote_about_view.c create mode 100644 views/xremote_about_view.h create mode 100644 views/xremote_common_view.c create mode 100644 views/xremote_common_view.h create mode 100644 views/xremote_control_view.c create mode 100644 views/xremote_control_view.h create mode 100644 views/xremote_custom_view.c create mode 100644 views/xremote_custom_view.h create mode 100644 views/xremote_general_view.c create mode 100644 views/xremote_general_view.h create mode 100644 views/xremote_learn_view.c create mode 100644 views/xremote_learn_view.h create mode 100644 views/xremote_player_view.c create mode 100644 views/xremote_player_view.h create mode 100644 views/xremote_settings_view.c create mode 100644 views/xremote_settings_view.h create mode 100644 xremote.c create mode 100644 xremote.h create mode 100644 xremote_app.c create mode 100644 xremote_app.h create mode 100644 xremote_control.c create mode 100644 xremote_control.h create mode 100644 xremote_learn.c create mode 100644 xremote_learn.h create mode 100644 xremote_settings.c create mode 100644 xremote_settings.h diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e72bfdd --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. 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 +them 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 prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. 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. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey 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; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If 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 convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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 that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + 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. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +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. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + 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 +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program 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, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU 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. But first, please read +. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..3b18149 --- /dev/null +++ b/README.md @@ -0,0 +1,47 @@ +# flipper-xremote +Advanced IR Remote App for Flipper Device + +### Currently under development, additional details coming soon.. + +## Idea +Currently, to use the buttons in the infrared application, you have to find all the buttons one by one in the menu, scroll to the button you want, and then click it. This makes using the remote a little uncomfortable. The idea behind XRemote is that all physical buttons are pre-mapped to specific category buttons, and pressing a physical button directly sends an infrared signal. This allows the flipper device to be used as a remote rather than as a tool that has a remote. + +The learning approach of XRemote is also different from the current application. Now, in order to clone the remote, you have to write the names of all the buttons one by one with a flipper, which is very inconvenient. The idea of XRemote is that it will tell you in advance which button it is going to record, and you only have to press the remote, so you will no longer have to name all the buttons. + +The application works with standard `.ir` files, but for the buttons to work, the names in the file must match the predefined names of XRemote. Check out [views/remote_common_view.h](https://github.com/kala13x/flipper-xremote/blob/main/views/xremote_common_view.h) file for supported name definitions. + +## Process + +- [ ] Learn new remote +- [x] Use saved remote +- [ ] Saved remote general category +- [x] Saved remote navigation category +- [ ] Saved remote control category +- [x] Saved remote player category +- [ ] Saved remote custom category +- [ ] Delete saved remote file +- [ ] Edit saved remote file +- [ ] Application settings + +## Screens + +

+Main menu +

+

+ XRemote main menu +

+ +

+Saved remote menu and control +

+

+ XRemote main menu +

+ +

+Saved remote menu and playback +

+

+ XRemote main menu +

diff --git a/application.fam b/application.fam new file mode 100644 index 0000000..9fc7e68 --- /dev/null +++ b/application.fam @@ -0,0 +1,17 @@ +App( + appid="xremote", + name="XRemote", + apptype=FlipperAppType.EXTERNAL, + entry_point="xremote_main", + requires=["gui", "dialogs", "infrared"], + stack_size=3 * 1024, + order=1, + fap_version="1.0", + fap_icon="icon.png", + fap_category="Infrared", + fap_icon_assets="assets", + fap_icon_assets_symbol="xc", + fap_author="@kala13x", + fap_weburl="https://github.com/kala13x/flipper-xremote", + fap_description="Advanced infrared remote control", +) diff --git a/assets/Back_icon_10x8.png b/assets/Back_icon_10x8.png new file mode 100644 index 0000000000000000000000000000000000000000..3bafabd144864b575144c75b592e5eaf53974566 GIT binary patch literal 3606 zcmaJ@c{r49+rKTOBBhHB}+m>LbCLY=Y4wK?~kwVKJMeb&hxs?-|t+n40QpA+b4G8*k_>A)gsvzul2%)`{+ zGXO-B3u=_{$d$PU5YEZSn%Bo%6nB$X*pi8HtvlN(j>)<>oU^ms-{SJc!?CVM_kGpq zD|mb=fG|Jac@dmEE>EYKyFP!dPw~V2q0~L3V4zJ7VgZs-lDyFoU9CnK9lA z{|)s3FeAcdMKT|ltq9$x0m1;iQ-6nS!_cqj3MXxM0Gt2}LS)A!gg7{$QQxIe9%xhs z9ymYp6$g?4Aeep95(3@bioPky5s{%vM(c>C~+;D?q3rCl<9Vk3~u)C^5I%(w`)RT2PH zm)f7N?K9(ykBtnC`Hctjzt`uk1dC{xK3DmG+T--QM)Dliz9M@cHh&jC)x2t{F@ZnKih0C+}OXW@w z`v&$?T!Pj1rsQGSiPMN#jg(cf#BeEqd)~3u;mM}Qyx`i%uR_AH()f-rz&vtJ?~1BK z0wCjWh+r=QKw`~Oyt$4L(2|<}2>>cTD<8d+q=bD10syO=GrJ#HY?6E~&#jfte6C(u zt0YX=Xk{+Bqt-;ma^pzUR`Hw4DHbX&wa9MK#}7nQbGD=p$&@~a?~@uIls$T8lCHGT zTRHoMa^-n3QHw^99AP{1;ufE{Zb&OgDJ@PELckbai^>O2T$Dcqsc&TD3l~}jCU{~r zzv(gLjjtXx|H*H&$^=ebjw433!=?SMd>|aXa>3gB5?)oiL6JC$H*$+NBC6x}hAF7kW)t|J z9m26ua#NsV=VV?4pXG3D@mM_ij@FcBscZ$vT`c+>{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 diff --git a/assets/Button_18x18.png b/assets/Button_18x18.png new file mode 100644 index 0000000000000000000000000000000000000000..30a5b4fab236d8b57242559ef94fb1c5dbb5d10a GIT binary patch literal 3609 zcmaJ@c{r49`+jVNvSba(81Yt?8Cx+K+gL`~8rw)>jKN@*W(G4tN=nI=Eo(wa4Q%8vkx{u?zYHw>PBq%Eg0DzDc z(hS9!#kL=Q9?lyh8i4}IOAwh8Gn{vj+=2WcHX}wv6 z{-S5$q3oHN^-t@S6WJ3RZH#u2$UR~zN#ptcfIceP0M?_BV27-0s*2>6L=N(TM8}(7 z`|{NTz#I>Q9zlC#w88a|1aJf7E{y|X4MV@8D(qEU08kPz2o{^z#g&Kx8Z{gnC4k1g zz$1sJ-hx0100c6^Ou@i?Az=E4l_4L{Q=Hr{4fN#iE9M8{xPXj4 zwXcCZrZHH9x3-ik()GEPC3j>M9}pamP82cr1R^s`)mi|M9yfs4FW$-nvgXNycGe6Q zdyu19NG_nZIkh$YM5nd{EA_o>$im#H=N(jFoW#zri2 zzHaq}&H-mLjWbGW3!*m9Vu-<|sQ8IyUQrUuD^Y zZ5kLaP)TNrO{v3TljpVO71A~Zl0$?5=4HED+vhu;fXTOrK ztd-`*>@YLleW2Dr)O5#aVKIBW;(Net{L&fmykHDc=SE~9Xfj6PB)GnjQpjCw>YwC} zR9aA{Na)9%HeO5YYXoUs+qhO~shM)&$w{7%+(E`K?kUJ#dz(k?py`OXN2cWmbjX(N zhetloFX}k)Erp$Yef^5L=T)?gtyCsf!S5mvbxHH}AK>JBc4f+;Vyks@FWBQm zv;|XTR&l>#uJV~bgvC9Qkq3mEZj9OrDk>*xS?#h4K=vWk3mpm#J4Nx?)+$qpgr={f z{7)j8p!B5jM3F?h8|zJPM$08&^)bWN0{I6}g(+gkb#X>xymxMCnP%kOKiOKG`;q^C z4D8k^D?(ndJ;dQkvA9l9rgCeR6r#CMy`bxTCf*mn;s=?eRS0~E+HaozKD{&G+s?^} z$*3P8yM-F2nbx$W4+H`tb7MFv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{ajwM@~ literal 0 HcmV?d00001 diff --git a/assets/IR_Icon_10x10.png b/assets/IR_Icon_10x10.png new file mode 100644 index 0000000000000000000000000000000000000000..94823bfbe2bfcffba4d1bf96bb6b24ae6d230413 GIT binary patch literal 6638 zcmeHMdpOiv_aB6)2uY60m{KZpHRguGj9W}@lUvA``3`fKOEV)w1|fvJ>4uU^iY~`d zAt6#iC6|y=x~UV9R8&IserLLzdfv|S{(7F@`(N|S%y;j#*ZS^-yHWu4s| z)!$Sh5Xc+{dx{(Ql(tpn6u|GwX}=HP<8&m=OXNlmhw=qH7CRJxiX!*`6cDpn5QzA; zpNo}R19W!Hfc6$^&0<6Iq+=!J`p@3YnlsX5tf8!z4H+4|Y4tC)O-nYUl!o~c18y8Y z6P%;<`j3m7dnkIwW$P*n3=9@j!O5A9nP$*qHkH#e{4!gFxTpm~F;@E%R=bW?YS5C@ zspQaezYpks@Ov^Qk~r^n>CZf4_$t4eT<ru5f?(U*)E)Ird9 zTWO)$S`#|8)oRdpQ!BgHq+Nh~%-d7t4MRg*veE`#P4xQe>RcgMc;*;ZI$y~;gQd2i z*0#aC<1ik(g|Cb^M7_xd)QMx51asXMVOu}&;&I>dM>~j`b!iy^x;g_hC#o=Y%NX$@ zheXRJ-s4lcQR{FJqg{Q7Cqj2-D4em&2onc?6ajf)e`Vu~PNdhhcC8lm#%H)y0K#gY_MR8P(LD__yG0-pP#id? z&Zs-aZ~DNlx10C*C&WD0rRYyIyzz|Ao&z~q1XT1+CUMx>5WitLmzwuUtpP|#%IUf= zHOZ#M)lvR#m->x^R-NeU^L3QV3t5329G%Qliy?1}YIm!a?$7!)2{x#cbUGcUFxf5D!(l7Qt$mBR8hu<&MxUG;N-Z~b#S7JImU9!f zU7oA$mL!6bFE2d3&1Dqsz67&H?7Rt=d$ zuFQ80)|}LiR9=EoDZ1cuQX^EcEWnvCGd)4)!j%^of<7XyvVJdLA!_dP1m}j#2O3_g zYql0^#Lm?q9ZE%M%)e-BogrSTqG51ir{-aK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n=CplHa=PsvQHglaGb>IpG01*)?$HiBr_e$xf$ PHwFezS3j3^P6 + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. 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 +them 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 prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. 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. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey 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; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If 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 convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU 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 that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + 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. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +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. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + 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 +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program 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, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU 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. But first, please read +. \ No newline at end of file diff --git a/infrared/infrared_remote.c b/infrared/infrared_remote.c new file mode 100644 index 0000000..ff0d19f --- /dev/null +++ b/infrared/infrared_remote.c @@ -0,0 +1,217 @@ +/* + This file was taken from the project: + https://github.com/DarkFlippers/unleashed-firmware + + The original project is licensed under the GNU GPLv3 + + Modifications made: + - Added function infrared_remote_get_button_by_name() +*/ + +#include "infrared_remote.h" + +#include +#include +#include +#include +#include +#include +#include + +#define TAG "InfraredRemote" + +ARRAY_DEF(InfraredButtonArray, InfraredRemoteButton*, M_PTR_OPLIST); + +struct InfraredRemote { + InfraredButtonArray_t buttons; + FuriString* name; + FuriString* path; +}; + +static void infrared_remote_clear_buttons(InfraredRemote* remote) { + InfraredButtonArray_it_t it; + for(InfraredButtonArray_it(it, remote->buttons); !InfraredButtonArray_end_p(it); + InfraredButtonArray_next(it)) { + infrared_remote_button_free(*InfraredButtonArray_cref(it)); + } + InfraredButtonArray_reset(remote->buttons); +} + +InfraredRemote* infrared_remote_alloc() { + InfraredRemote* remote = malloc(sizeof(InfraredRemote)); + InfraredButtonArray_init(remote->buttons); + remote->name = furi_string_alloc(); + remote->path = furi_string_alloc(); + return remote; +} + +void infrared_remote_free(InfraredRemote* remote) { + infrared_remote_clear_buttons(remote); + InfraredButtonArray_clear(remote->buttons); + furi_string_free(remote->path); + furi_string_free(remote->name); + free(remote); +} + +void infrared_remote_reset(InfraredRemote* remote) { + infrared_remote_clear_buttons(remote); + furi_string_reset(remote->name); + furi_string_reset(remote->path); +} + +void infrared_remote_set_name(InfraredRemote* remote, const char* name) { + furi_string_set(remote->name, name); +} + +const char* infrared_remote_get_name(InfraredRemote* remote) { + return furi_string_get_cstr(remote->name); +} + +void infrared_remote_set_path(InfraredRemote* remote, const char* path) { + furi_string_set(remote->path, path); +} + +const char* infrared_remote_get_path(InfraredRemote* remote) { + return furi_string_get_cstr(remote->path); +} + +size_t infrared_remote_get_button_count(InfraredRemote* remote) { + return InfraredButtonArray_size(remote->buttons); +} + +InfraredRemoteButton* infrared_remote_get_button(InfraredRemote* remote, size_t index) { + furi_assert(index < InfraredButtonArray_size(remote->buttons)); + return *InfraredButtonArray_get(remote->buttons, index); +} + +bool infrared_remote_find_button_by_name(InfraredRemote* remote, const char* name, size_t* index) { + for(size_t i = 0; i < InfraredButtonArray_size(remote->buttons); i++) { + InfraredRemoteButton* button = *InfraredButtonArray_get(remote->buttons, i); + if(!strcmp(infrared_remote_button_get_name(button), name)) { + *index = i; + return true; + } + } + return false; +} + +InfraredRemoteButton* infrared_remote_get_button_by_name(InfraredRemote* remote, const char* name) { + for(size_t i = 0; i < InfraredButtonArray_size(remote->buttons); i++) { + InfraredRemoteButton* button = *InfraredButtonArray_get(remote->buttons, i); + if(!strcmp(infrared_remote_button_get_name(button), name)) { + return button; + } + } + return NULL; +} + +bool infrared_remote_add_button(InfraredRemote* remote, const char* name, InfraredSignal* signal) { + InfraredRemoteButton* button = infrared_remote_button_alloc(); + infrared_remote_button_set_name(button, name); + infrared_remote_button_set_signal(button, signal); + InfraredButtonArray_push_back(remote->buttons, button); + return infrared_remote_store(remote); +} + +bool infrared_remote_rename_button(InfraredRemote* remote, const char* new_name, size_t index) { + furi_assert(index < InfraredButtonArray_size(remote->buttons)); + InfraredRemoteButton* button = *InfraredButtonArray_get(remote->buttons, index); + infrared_remote_button_set_name(button, new_name); + return infrared_remote_store(remote); +} + +bool infrared_remote_delete_button(InfraredRemote* remote, size_t index) { + furi_assert(index < InfraredButtonArray_size(remote->buttons)); + InfraredRemoteButton* button; + InfraredButtonArray_pop_at(&button, remote->buttons, index); + infrared_remote_button_free(button); + return infrared_remote_store(remote); +} + +void infrared_remote_move_button(InfraredRemote* remote, size_t index_orig, size_t index_dest) { + furi_assert(index_orig < InfraredButtonArray_size(remote->buttons)); + furi_assert(index_dest < InfraredButtonArray_size(remote->buttons)); + + InfraredRemoteButton* button; + InfraredButtonArray_pop_at(&button, remote->buttons, index_orig); + InfraredButtonArray_push_at(remote->buttons, index_dest, button); +} + +bool infrared_remote_store(InfraredRemote* remote) { + Storage* storage = furi_record_open(RECORD_STORAGE); + FlipperFormat* ff = flipper_format_file_alloc(storage); + const char* path = furi_string_get_cstr(remote->path); + + FURI_LOG_I(TAG, "store file: \'%s\'", path); + + bool success = flipper_format_file_open_always(ff, path) && + flipper_format_write_header_cstr(ff, "IR signals file", 1); + if(success) { + InfraredButtonArray_it_t it; + for(InfraredButtonArray_it(it, remote->buttons); !InfraredButtonArray_end_p(it); + InfraredButtonArray_next(it)) { + InfraredRemoteButton* button = *InfraredButtonArray_cref(it); + success = infrared_signal_save( + infrared_remote_button_get_signal(button), + ff, + infrared_remote_button_get_name(button)); + if(!success) { + break; + } + } + } + + flipper_format_free(ff); + furi_record_close(RECORD_STORAGE); + return success; +} + +bool infrared_remote_load(InfraredRemote* remote, FuriString* path) { + Storage* storage = furi_record_open(RECORD_STORAGE); + FlipperFormat* ff = flipper_format_buffered_file_alloc(storage); + + FuriString* buf; + buf = furi_string_alloc(); + + FURI_LOG_I(TAG, "load file: \'%s\'", furi_string_get_cstr(path)); + bool success = false; + + do { + if(!flipper_format_buffered_file_open_existing(ff, furi_string_get_cstr(path))) break; + uint32_t version; + if(!flipper_format_read_header(ff, buf, &version)) break; + if(!furi_string_equal(buf, "IR signals file") || (version != 1)) break; + + path_extract_filename(path, buf, true); + infrared_remote_clear_buttons(remote); + infrared_remote_set_name(remote, furi_string_get_cstr(buf)); + infrared_remote_set_path(remote, furi_string_get_cstr(path)); + + for(bool can_read = true; can_read;) { + InfraredRemoteButton* button = infrared_remote_button_alloc(); + can_read = infrared_signal_read(infrared_remote_button_get_signal(button), ff, buf); + if(can_read) { + infrared_remote_button_set_name(button, furi_string_get_cstr(buf)); + InfraredButtonArray_push_back(remote->buttons, button); + } else { + infrared_remote_button_free(button); + } + } + success = true; + } while(false); + + furi_string_free(buf); + flipper_format_free(ff); + furi_record_close(RECORD_STORAGE); + return success; +} + +bool infrared_remote_remove(InfraredRemote* remote) { + Storage* storage = furi_record_open(RECORD_STORAGE); + + FS_Error status = storage_common_remove(storage, furi_string_get_cstr(remote->path)); + infrared_remote_reset(remote); + + furi_record_close(RECORD_STORAGE); + return (status == FSE_OK || status == FSE_NOT_EXIST); +} diff --git a/infrared/infrared_remote.h b/infrared/infrared_remote.h new file mode 100644 index 0000000..c6d9df9 --- /dev/null +++ b/infrared/infrared_remote.h @@ -0,0 +1,41 @@ +/* + This file was taken from the project: + https://github.com/DarkFlippers/unleashed-firmware + + The original project is licensed under the GNU GPLv3 + + Modifications made: + - Added function infrared_remote_get_button_by_name() +*/ + +#pragma once + +#include + +#include "infrared_remote_button.h" + +typedef struct InfraredRemote InfraredRemote; + +InfraredRemote* infrared_remote_alloc(); +void infrared_remote_free(InfraredRemote* remote); +void infrared_remote_reset(InfraredRemote* remote); + +void infrared_remote_set_name(InfraredRemote* remote, const char* name); +const char* infrared_remote_get_name(InfraredRemote* remote); + +void infrared_remote_set_path(InfraredRemote* remote, const char* path); +const char* infrared_remote_get_path(InfraredRemote* remote); + +size_t infrared_remote_get_button_count(InfraredRemote* remote); +InfraredRemoteButton* infrared_remote_get_button(InfraredRemote* remote, size_t index); +bool infrared_remote_find_button_by_name(InfraredRemote* remote, const char* name, size_t* index); +InfraredRemoteButton* infrared_remote_get_button_by_name(InfraredRemote* remote, const char* name); + +bool infrared_remote_add_button(InfraredRemote* remote, const char* name, InfraredSignal* signal); +bool infrared_remote_rename_button(InfraredRemote* remote, const char* new_name, size_t index); +bool infrared_remote_delete_button(InfraredRemote* remote, size_t index); +void infrared_remote_move_button(InfraredRemote* remote, size_t index_orig, size_t index_dest); + +bool infrared_remote_store(InfraredRemote* remote); +bool infrared_remote_load(InfraredRemote* remote, FuriString* path); +bool infrared_remote_remove(InfraredRemote* remote); diff --git a/infrared/infrared_remote_button.c b/infrared/infrared_remote_button.c new file mode 100644 index 0000000..613761a --- /dev/null +++ b/infrared/infrared_remote_button.c @@ -0,0 +1,45 @@ +/* + This file was taken from the project: + https://github.com/DarkFlippers/unleashed-firmware + + The original project is licensed under the GNU GPLv3 + No modifications were made to this file. +*/ + +#include "infrared_remote_button.h" + +#include + +struct InfraredRemoteButton { + FuriString* name; + InfraredSignal* signal; +}; + +InfraredRemoteButton* infrared_remote_button_alloc() { + InfraredRemoteButton* button = malloc(sizeof(InfraredRemoteButton)); + button->name = furi_string_alloc(); + button->signal = infrared_signal_alloc(); + return button; +} + +void infrared_remote_button_free(InfraredRemoteButton* button) { + furi_string_free(button->name); + infrared_signal_free(button->signal); + free(button); +} + +void infrared_remote_button_set_name(InfraredRemoteButton* button, const char* name) { + furi_string_set(button->name, name); +} + +const char* infrared_remote_button_get_name(InfraredRemoteButton* button) { + return furi_string_get_cstr(button->name); +} + +void infrared_remote_button_set_signal(InfraredRemoteButton* button, InfraredSignal* signal) { + infrared_signal_set_signal(button->signal, signal); +} + +InfraredSignal* infrared_remote_button_get_signal(InfraredRemoteButton* button) { + return button->signal; +} diff --git a/infrared/infrared_remote_button.h b/infrared/infrared_remote_button.h new file mode 100644 index 0000000..e55d28f --- /dev/null +++ b/infrared/infrared_remote_button.h @@ -0,0 +1,22 @@ +/* + This file was taken from the project: + https://github.com/DarkFlippers/unleashed-firmware + + The original project is licensed under the GNU GPLv3 + No modifications were made to this file. +*/ + +#pragma once + +#include "infrared_signal.h" + +typedef struct InfraredRemoteButton InfraredRemoteButton; + +InfraredRemoteButton* infrared_remote_button_alloc(); +void infrared_remote_button_free(InfraredRemoteButton* button); + +void infrared_remote_button_set_name(InfraredRemoteButton* button, const char* name); +const char* infrared_remote_button_get_name(InfraredRemoteButton* button); + +void infrared_remote_button_set_signal(InfraredRemoteButton* button, InfraredSignal* signal); +InfraredSignal* infrared_remote_button_get_signal(InfraredRemoteButton* button); diff --git a/infrared/infrared_signal.c b/infrared/infrared_signal.c new file mode 100644 index 0000000..1bb97b0 --- /dev/null +++ b/infrared/infrared_signal.c @@ -0,0 +1,323 @@ +/* + This file was taken from the project: + https://github.com/DarkFlippers/unleashed-firmware + + The original project is licensed under the GNU GPLv3 + No modifications were made to this file. +*/ + +#include "infrared_signal.h" + +#include +#include +#include +#include +#include + +#define TAG "InfraredSignal" + +struct InfraredSignal { + bool is_raw; + union { + InfraredMessage message; + InfraredRawSignal raw; + } payload; +}; + +static void infrared_signal_clear_timings(InfraredSignal* signal) { + if(signal->is_raw) { + free(signal->payload.raw.timings); + signal->payload.raw.timings_size = 0; + signal->payload.raw.timings = NULL; + } +} + +static bool infrared_signal_is_message_valid(InfraredMessage* message) { + if(!infrared_is_protocol_valid(message->protocol)) { + FURI_LOG_E(TAG, "Unknown protocol"); + return false; + } + + uint32_t address_length = infrared_get_protocol_address_length(message->protocol); + uint32_t address_mask = (1UL << address_length) - 1; + + if(message->address != (message->address & address_mask)) { + FURI_LOG_E( + TAG, + "Address is out of range (mask 0x%08lX): 0x%lX\r\n", + address_mask, + message->address); + return false; + } + + uint32_t command_length = infrared_get_protocol_command_length(message->protocol); + uint32_t command_mask = (1UL << command_length) - 1; + + if(message->command != (message->command & command_mask)) { + FURI_LOG_E( + TAG, + "Command is out of range (mask 0x%08lX): 0x%lX\r\n", + command_mask, + message->command); + return false; + } + + return true; +} + +static bool infrared_signal_is_raw_valid(InfraredRawSignal* raw) { + if((raw->frequency > INFRARED_MAX_FREQUENCY) || (raw->frequency < INFRARED_MIN_FREQUENCY)) { + FURI_LOG_E( + TAG, + "Frequency is out of range (%X - %X): %lX", + INFRARED_MIN_FREQUENCY, + INFRARED_MAX_FREQUENCY, + raw->frequency); + return false; + + } else if((raw->duty_cycle <= 0) || (raw->duty_cycle > 1)) { + FURI_LOG_E(TAG, "Duty cycle is out of range (0 - 1): %f", (double)raw->duty_cycle); + return false; + + } else if((raw->timings_size <= 0) || (raw->timings_size > MAX_TIMINGS_AMOUNT)) { + FURI_LOG_E( + TAG, + "Timings amount is out of range (0 - %X): %zX", + MAX_TIMINGS_AMOUNT, + raw->timings_size); + return false; + } + + return true; +} + +static inline bool infrared_signal_save_message(InfraredMessage* message, FlipperFormat* ff) { + const char* protocol_name = infrared_get_protocol_name(message->protocol); + return flipper_format_write_string_cstr(ff, "type", "parsed") && + flipper_format_write_string_cstr(ff, "protocol", protocol_name) && + flipper_format_write_hex(ff, "address", (uint8_t*)&message->address, 4) && + flipper_format_write_hex(ff, "command", (uint8_t*)&message->command, 4); +} + +static inline bool infrared_signal_save_raw(InfraredRawSignal* raw, FlipperFormat* ff) { + furi_assert(raw->timings_size <= MAX_TIMINGS_AMOUNT); + return flipper_format_write_string_cstr(ff, "type", "raw") && + flipper_format_write_uint32(ff, "frequency", &raw->frequency, 1) && + flipper_format_write_float(ff, "duty_cycle", &raw->duty_cycle, 1) && + flipper_format_write_uint32(ff, "data", raw->timings, raw->timings_size); +} + +static inline bool infrared_signal_read_message(InfraredSignal* signal, FlipperFormat* ff) { + FuriString* buf; + buf = furi_string_alloc(); + bool success = false; + + do { + if(!flipper_format_read_string(ff, "protocol", buf)) break; + + InfraredMessage message; + message.protocol = infrared_get_protocol_by_name(furi_string_get_cstr(buf)); + + success = flipper_format_read_hex(ff, "address", (uint8_t*)&message.address, 4) && + flipper_format_read_hex(ff, "command", (uint8_t*)&message.command, 4) && + infrared_signal_is_message_valid(&message); + + if(!success) break; + + infrared_signal_set_message(signal, &message); + } while(0); + + furi_string_free(buf); + return success; +} + +static inline bool infrared_signal_read_raw(InfraredSignal* signal, FlipperFormat* ff) { + uint32_t timings_size, frequency; + float duty_cycle; + + bool success = flipper_format_read_uint32(ff, "frequency", &frequency, 1) && + flipper_format_read_float(ff, "duty_cycle", &duty_cycle, 1) && + flipper_format_get_value_count(ff, "data", &timings_size); + + if(!success || timings_size > MAX_TIMINGS_AMOUNT) { + return false; + } + + uint32_t* timings = malloc(sizeof(uint32_t) * timings_size); + success = flipper_format_read_uint32(ff, "data", timings, timings_size); + + if(success) { + infrared_signal_set_raw_signal(signal, timings, timings_size, frequency, duty_cycle); + } + + free(timings); + return success; +} + +static bool infrared_signal_read_body(InfraredSignal* signal, FlipperFormat* ff) { + FuriString* tmp = furi_string_alloc(); + + bool success = false; + + do { + if(!flipper_format_read_string(ff, "type", tmp)) break; + if(furi_string_equal(tmp, "raw")) { + success = infrared_signal_read_raw(signal, ff); + } else if(furi_string_equal(tmp, "parsed")) { + success = infrared_signal_read_message(signal, ff); + } else { + FURI_LOG_E(TAG, "Unknown signal type"); + } + } while(false); + + furi_string_free(tmp); + return success; +} + +InfraredSignal* infrared_signal_alloc() { + InfraredSignal* signal = malloc(sizeof(InfraredSignal)); + + signal->is_raw = false; + signal->payload.message.protocol = InfraredProtocolUnknown; + + return signal; +} + +void infrared_signal_free(InfraredSignal* signal) { + infrared_signal_clear_timings(signal); + free(signal); +} + +bool infrared_signal_is_raw(InfraredSignal* signal) { + return signal->is_raw; +} + +bool infrared_signal_is_valid(InfraredSignal* signal) { + return signal->is_raw ? infrared_signal_is_raw_valid(&signal->payload.raw) : + infrared_signal_is_message_valid(&signal->payload.message); +} + +void infrared_signal_set_signal(InfraredSignal* signal, const InfraredSignal* other) { + if(other->is_raw) { + const InfraredRawSignal* raw = &other->payload.raw; + infrared_signal_set_raw_signal( + signal, raw->timings, raw->timings_size, raw->frequency, raw->duty_cycle); + } else { + const InfraredMessage* message = &other->payload.message; + infrared_signal_set_message(signal, message); + } +} + +void infrared_signal_set_raw_signal( + InfraredSignal* signal, + const uint32_t* timings, + size_t timings_size, + uint32_t frequency, + float duty_cycle) { + infrared_signal_clear_timings(signal); + + // If the frequency is out of bounds, set it to the closest bound same for duty cycle + // TODO: Should we return error instead? Also infrared_signal_is_valid is used only in CLI for some reason?! + if(frequency > INFRARED_MAX_FREQUENCY) { + frequency = INFRARED_MAX_FREQUENCY; + } else if(frequency < INFRARED_MIN_FREQUENCY) { + frequency = INFRARED_MIN_FREQUENCY; + } + if((duty_cycle <= (float)0) || (duty_cycle > (float)1)) { + duty_cycle = (float)0.33; + } + // In case of timings out of bounds we just call return + if((timings_size <= 0) || (timings_size > MAX_TIMINGS_AMOUNT)) { + return; + } + + signal->is_raw = true; + + signal->payload.raw.timings_size = timings_size; + signal->payload.raw.frequency = frequency; + signal->payload.raw.duty_cycle = duty_cycle; + + signal->payload.raw.timings = malloc(timings_size * sizeof(uint32_t)); + memcpy(signal->payload.raw.timings, timings, timings_size * sizeof(uint32_t)); +} + +InfraredRawSignal* infrared_signal_get_raw_signal(InfraredSignal* signal) { + furi_assert(signal->is_raw); + return &signal->payload.raw; +} + +void infrared_signal_set_message(InfraredSignal* signal, const InfraredMessage* message) { + infrared_signal_clear_timings(signal); + + signal->is_raw = false; + signal->payload.message = *message; +} + +InfraredMessage* infrared_signal_get_message(InfraredSignal* signal) { + furi_assert(!signal->is_raw); + return &signal->payload.message; +} + +bool infrared_signal_save(InfraredSignal* signal, FlipperFormat* ff, const char* name) { + if(!flipper_format_write_comment_cstr(ff, "") || + !flipper_format_write_string_cstr(ff, "name", name)) { + return false; + } else if(signal->is_raw) { + return infrared_signal_save_raw(&signal->payload.raw, ff); + } else { + return infrared_signal_save_message(&signal->payload.message, ff); + } +} + +bool infrared_signal_read(InfraredSignal* signal, FlipperFormat* ff, FuriString* name) { + FuriString* tmp = furi_string_alloc(); + + bool success = false; + + do { + if(!flipper_format_read_string(ff, "name", tmp)) break; + furi_string_set(name, tmp); + if(!infrared_signal_read_body(signal, ff)) break; + success = true; + } while(0); + + furi_string_free(tmp); + return success; +} + +bool infrared_signal_search_and_read( + InfraredSignal* signal, + FlipperFormat* ff, + const FuriString* name) { + bool success = false; + FuriString* tmp = furi_string_alloc(); + + do { + bool is_name_found = false; + while(flipper_format_read_string(ff, "name", tmp)) { + is_name_found = furi_string_equal(name, tmp); + if(is_name_found) break; + } + if(!is_name_found) break; //-V547 + if(!infrared_signal_read_body(signal, ff)) break; //-V779 + success = true; + } while(false); + + furi_string_free(tmp); + return success; +} + +void infrared_signal_transmit(InfraredSignal* signal) { + if(signal->is_raw) { + InfraredRawSignal* raw_signal = &signal->payload.raw; + infrared_send_raw_ext( + raw_signal->timings, + raw_signal->timings_size, + true, + raw_signal->frequency, + raw_signal->duty_cycle); + } else { + InfraredMessage* message = &signal->payload.message; + infrared_send(message, 1); + } +} diff --git a/infrared/infrared_signal.h b/infrared/infrared_signal.h new file mode 100644 index 0000000..dd9199d --- /dev/null +++ b/infrared/infrared_signal.h @@ -0,0 +1,53 @@ +/* + This file was taken from the project: + https://github.com/DarkFlippers/unleashed-firmware + + The original project is licensed under the GNU GPLv3 + No modifications were made to this file. +*/ + +#pragma once + +#include +#include +#include + +#include +#include + +typedef struct InfraredSignal InfraredSignal; + +typedef struct { + size_t timings_size; + uint32_t* timings; + uint32_t frequency; + float duty_cycle; +} InfraredRawSignal; + +InfraredSignal* infrared_signal_alloc(); +void infrared_signal_free(InfraredSignal* signal); + +bool infrared_signal_is_raw(InfraredSignal* signal); +bool infrared_signal_is_valid(InfraredSignal* signal); + +void infrared_signal_set_signal(InfraredSignal* signal, const InfraredSignal* other); + +void infrared_signal_set_raw_signal( + InfraredSignal* signal, + const uint32_t* timings, + size_t timings_size, + uint32_t frequency, + float duty_cycle); +InfraredRawSignal* infrared_signal_get_raw_signal(InfraredSignal* signal); + +void infrared_signal_set_message(InfraredSignal* signal, const InfraredMessage* message); +InfraredMessage* infrared_signal_get_message(InfraredSignal* signal); + +bool infrared_signal_save(InfraredSignal* signal, FlipperFormat* ff, const char* name); +bool infrared_signal_read(InfraredSignal* signal, FlipperFormat* ff, FuriString* name); +bool infrared_signal_search_and_read( + InfraredSignal* signal, + FlipperFormat* ff, + const FuriString* name); + +void infrared_signal_transmit(InfraredSignal* signal); diff --git a/screens/app_menu.png b/screens/app_menu.png new file mode 100644 index 0000000000000000000000000000000000000000..5a983710b543508d1b3a5825df81dff72c478f30 GIT binary patch literal 5940 zcmeHLdsGu=7N3BMfCepMs}vn$eX^5G9>63dk*Aoh0R*aGRTwgpFhU+Cfdo*DXzQx2 zLG8MI;Hs^UcD49wyDB13d~~a=R!*^02#B`$sHEi;t%Cc_1QAbrP7mj7_b+l!PG;_R zzu&$0cklgRW<|Nz#8;p82 zl|#bjd;*9q@r56<<2uX#U3@zz z(6L}ka+>$S<+Zl%%X>yEhHsLvyEAL1c)hpXP`u{Rd$q51ju4+pt6S3e=~R&7Ix0Fk zQ4t;eBqNYV>8dTVc{LF)o=s0a>o=Q?aPE}s&O5qkBUU$i-0r9k0~Y6^CpvxK6}>cz zySX^Ky4rsBUu!oVD`S@x!}nP&cUtz`;!Nx1&HChTUCqZQJKJP!4pvmfMbUxa5m_g- z`<`3D-?lWMaM?HO7mS)xyzAm$RPkH4-oj3|UB7X6>06pyxvTYsMALZBm7EoCOxUM9 z6)8PN1(v!tL?4`a;7sco|LIFh?r*uf@w~p&m+LDP68n-n&P>TXa{1iLfydteXl#Q2 z`d5_uS5CQcM|& zKiiKNZCK)S;^mB+sS(2`5?B3ty(-H;ZBO2|ED2_tE3vQ7W0#Nlik5HgSoIV3rhnDr zQA=(ktM{@m7HwUYO3;h4y@O;O1z9VPuTYTNRG$jTQGQdJ6Z|H~F2cH`bgOcH<`KJSzn{ELAyQqS9-* zIHAuZxmK+Kv>pUW=U5H6Dw{OJnWTo&$vDpPN)AjBGR~q9C8{(;lUdZf0wbAR5TBwd z$X1C7&K$Xq)G7f0TGEWeR&9>XB(cgk46X!R(`p_EW=zc4GES;85suayNm#@ca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T->=X+(< zI}0ss_8mUmxo%wp>odpgMGZL0c*saj5AJSEt9(AIE_b zViI&P0)`T~J@V?{ywh9k&Yn^?S%%2k0$V`1>)Y=hhRJVtK{U%Y!N*>yM{0L=c_U5x z_4PO6`#vd{Cdy(`mK*PF8XHb7-Z_siQ?6Yg#dhfWn$Uh%Yn&TM8k zvu*C;MY0oEWBYUOgxndI#QH^?QylVwg2#-6#>pUeLc}+oB`dDnWihirD*VuPd3AZ^ zO!%;D<|}H7Md;Uu>(qAZwMxKTeQ^ zq^_ZRJ>zzpT&vIi?rhV8#UD7%S81Hv3YgY!VEq{QKrTDgk$uJ8z-^GB_6cv_wXiQg ze7AS|)m!#QY2AC7iL|Xg7574aA)DDCY(@t8S|>#OLDvkyg3%cw e;r~Fw54<%Ii067w->u*;AEbzlk131FDE==z2o@Fq literal 0 HcmV?d00001 diff --git a/screens/control.png b/screens/control.png new file mode 100644 index 0000000000000000000000000000000000000000..c3176153241dce260f3491de3b1674b7794753ac GIT binary patch literal 8986 zcmbVSc|4SD)E-OOvb3PG%%plLN|F#`O_tJ-JzJ5Gwd~6nX;GA=M1>h8WSy7E&hS~RbDeWMG`gtE%e|i)0)g=A>z%y> zfv|dm3&Ob_++me7c7Q-w?z(Dg8|iCn!@O^KU3YbNfO8vVmDXFq%YG-y$viJl9XfJ6Cc^EHKVs{0?nL7X_zEIm%PilgzrUH3 zILwee^6mj;xC~01htChPXjM0#%9Y;kQsI%g>!#dOTfq>!uaU+(4n(9i%Q#+q@?=s8 zKR+@$W1HaYr$(FDYvd!u7AkS`(Y{Q>Dos_Kt4Ip%p?02B?#GFbyMMEdTaKTJs`pCa zInJXhe=XC5^znd0;g?SaBDmMtI}y7h%?z_b4~!Nz21Vn{3yQ|!D?DtlmKxjkU+dy$aMV;5FPS{Gy9DF& ztx;;NSNekEIdvn3gq&4+yt{T|ht1S6R0dyj*b_T9*O7x)yhX~&JY5^bz028lsP8K} zQuzdv8Ao6vI+G2pV1YbjY*4iV?dB@vO?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y4Pb3QhO-)trBvL5!W@Sg|c7ya*p<$o+_piKv{zpq4Bf*FRuJD$^jw#gd~fNhUUpQ6{k zu!ki~RH}ecp(c;-pPlwNZKnUoXIbuo!2V}`#|HNN9Q$Q<_jZBS|2Rz0K|Qj&*8Yj; ztpf?LZ!q$kIwGM_pGCl+eF+o3D7#lf>TMM1*%{2g-~M1KDE;}HzJt%^#LFGjp+y6u z&t}An9A=EAi_!MKOceeyRE)%voXDdcGpYO|YU0h#FEK+0*#92Z!~qX#U5Mq^Jfr5b z?%wWBbWHT9qvm~cNRPaU4Yt(!XH4+q=h4WI1Yj9qq2sGouQiD;q^aVcs<6bw9sf+~ z4sCjSa2Peo#oHB{5R6Fq_Yr`B$ZG#*!&0N z6~nzjSNorLhl9x+N$@3d81laSm)XHAY&$j+QnNxO?0G4T1ljXZ;<(|DHl^dWs;Tq4dkJP2>N0?B<%4NN@De*1^%w z1xy~=#uGb8LhlwcL#oCr>t*}YvE4)1b`ahaY2WGrKsKD0hfV)7`=7J%-6oevPhYZ) z04wn@{}v#5t}E+%pu~j;f7L(ZN@;6cIRqydxP_Te%ADwdoR?#rUd=ou5}r=suiq;` zl+dm+hxHq%R|F0wpjpp>*(h^h)o}Q)h8C_(pOd z*DC(jJ`9TQz`xP`WI0)yDnm>*pRKpR)3};wIF}E0&>4#;lGWCs5ksBY-CXZATG#>s OKl(Zs&lYH1iTEGBRem`D literal 0 HcmV?d00001 diff --git a/screens/control_2.png b/screens/control_2.png new file mode 100644 index 0000000000000000000000000000000000000000..2e7194c69022d7584b957650d5245fc451a054e0 GIT binary patch literal 4754 zcmcIoX;f3^7QGlW3>sT)Yc*h~wqgaVRI5ms1S)C;wYCglvQ|MR2?Piv!~}(5TEJ2|+Wcl?x;xVn_msfp@{$cN1K1t@q=tth2JX`R@JBxA#8# zoJ;l=f8QBa^Q-^>n6Y8K&yN5w1rG&aF%7yh#cAsf05Cfc?d`o~gSWRGJ}DtGI&K#L zEIvj#=C=N>r_KF{ZTDv`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m@lHoPcxVC~q^|LC5&XX_ zrjI8M0{)W|k4hDv;@}kWUb<)yZO{f#*>%zM!gQ6QU^xuqcid0YMB=as#n>blkDV_v zO2|gT^Y{zTQMu42qKu!277YsHG1tpLf(Gmp3FQ4FN5om>8ddq&*nkAND8t?az8;6_ zY_~J~mKHfjppWZdMo~1(V6sPo@-6XPYbU*`9mHBrve2$GZf8U;YXXTq&H_0~3O#t0 zYw6?%`;dKw$iws5VB>)P(Xq)dX<@>;x$K1Qe%p&ottD0;TrC8Pi~rnXZgtO VUeTyI(0?m{4d46wRCsOQ_is(UeR==@ literal 0 HcmV?d00001 diff --git a/screens/playback.png b/screens/playback.png new file mode 100644 index 0000000000000000000000000000000000000000..d75b5e4c98370ca3a0ee4d374d6d274ce6bc94bc GIT binary patch literal 8896 zcmcI~c|6qJ+y9^tF{+yu%V-rsk|@T~CP}g->m-TDQph@%N{S>|bJu9GWQk;7W{5&r z#*%#*`^1fLgGy*mC@)XL{zIYlt#@E%#k$9G&mevJ8?eK)EwPdM+6^b*(D z%vjp@U3*zdvPBQ5BV{l$2~Ha3I*x8WoFmWcT;Z0n`KEH5t!SWKdxY`Eop)X~A8on`qeaJWyWl0p6SV8*qwN`nRl1sm*TtXHAD+nFpYsX-Y0Ey_Crhz} z$Oez+f{KEgDpxa17eDR1QqWd^R=n_a)+VDZ5$1-OK|99_zWPTMUd;P21z#5AIf`_A zMmXH?q-Iy5wC=q-a%cC~osPfw;x9qj{utl6n6lu9HUi~mFHc<3S-<0I50u4MU0J+f z8fRxBE$m&b-rAtvRw#JbPlFusmcZilL>npCBdQAFWEixdKVc%9#-I^yEJ&5RV=n9YPb)%)pF3 z9JHeERvq8shAdzf-YW)rCn0Rk&r5V>9C&Ag=NU^c2t@c3XK^LS3yXs{`MmWFPx0Y5 zh>IP9?q5!~fIy@n`X_bG{Q8MQNI$d5a;1?Cue-X3pv5J8MJ`c9^GV8I?a{?=r3G{! zwexRKzI@@ZY_W!9&c60{lAT07Zn2K%a{IV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lh|Pb@O#rsQ?DSuzbZZKO zd;Br1QTj3IV${TDy1pUf?>0)-orV0gB4@C+>m2s)ax&V=sC|nV6{Xz3Z9M*K!~Lg# zdFYfKR{UQ_Z(R0n|4XO*zt!^day7b0i-XOE|9aa~FiyEQ9r*Q4&b$`f!(QB@!d0~g z9?WDi?y!QFgICkC5h620pb(wje&D*7%A7i*?4n3b@orS*{{Se zIJuir%cyiKe(R7)ogSH3vY!M6AiV_?#X1Z?|N!-h)3kmKhCCeWUb#S^yobl z0)Z58{ukg?AD^N}+CX6(5tlSwXy}Eec`view = view_alloc(); + remote_view->notifications = notifications; + + remote_view->context = NULL; + remote_view->on_clear = NULL; + + view_set_orientation(remote_view->view, ViewOrientationVertical); + view_allocate_model(remote_view->view, ViewModelTypeLocking, sizeof(XRemoteViewModel)); + + view_set_input_callback(remote_view->view, input_cb); + view_set_draw_callback(remote_view->view, draw_cb); + view_set_context(remote_view->view, remote_view); + + return remote_view; +} + +void xremote_view_clear_context(XRemoteView* rview) +{ + furi_assert(rview); + + if (rview->context != NULL && + rview->on_clear != NULL) + { + rview->on_clear(rview->context); + rview->context = NULL; + } +} + +void xremote_view_set_context(XRemoteView* rview, void *context, XRemoteViewClearCallback on_clear) +{ + furi_assert(rview); + xremote_view_clear_context(rview); + rview->context = context; + rview->on_clear = on_clear; +} + +void* xremote_view_get_context(XRemoteView* rview) +{ + furi_assert(rview); + return rview->context; +} + +void xremote_view_free(XRemoteView* rview) +{ + furi_assert(rview); + xremote_view_clear_context(rview); + view_free(rview->view); + free(rview); +} + +View* xremote_view_get_view(XRemoteView* rview) +{ + furi_assert(rview); + return rview->view; +} + +static InfraredRemoteButton* xremote_view_get_button_by_name(XRemoteView *rview, const char* name) +{ + xremote_app_assert(rview->context, NULL); + InfraredRemote* remote = (InfraredRemote*)rview->context; + return infrared_remote_get_button_by_name(remote, name); +} + +void xremote_view_send_ir(XRemoteView *rview, const char *name) +{ + InfraredRemoteButton* button = xremote_view_get_button_by_name(rview, name); + xremote_app_assert_void(button); + + InfraredSignal* signal = infrared_remote_button_get_signal(button); + xremote_app_assert_void(signal); + + infrared_signal_transmit(signal); + notification_message(rview->notifications, &g_sequence_blink_purple_50); +} + +void xremote_canvas_draw_icon(Canvas* canvas, uint8_t x, uint8_t y, XRemoteIcon icon) +{ + if (icon == XRemoteIconArrowUp) + { + canvas_draw_triangle(canvas, x - 2, y - 2, 5, 3, CanvasDirectionBottomToTop); + canvas_draw_line(canvas, x - 2, y - 3, x - 2, y + 4); + } + else if (icon == XRemoteIconArrowDown) + { + canvas_draw_triangle(canvas, x - 2, y + 2, 5, 3, CanvasDirectionTopToBottom); + canvas_draw_line(canvas, x - 2, y - 4, x - 2, y + 3); + } + else if (icon == XRemoteIconArrowLeft) + { + canvas_draw_triangle(canvas, x - 4, y, 5, 3, CanvasDirectionRightToLeft); + canvas_draw_line(canvas, x + 2, y, x - 5, y); + } + else if (icon == XRemoteIconArrowRight) + { + canvas_draw_triangle(canvas, x, y, 5, 3, CanvasDirectionLeftToRight); + canvas_draw_line(canvas, x - 6, y, x + 1, y); + } + else if (icon == XRemoteIconJumpForward) + { + canvas_draw_triangle(canvas, x - 2, y, 5, 3, CanvasDirectionLeftToRight); + canvas_draw_triangle(canvas, x - 5, y, 5, 3, CanvasDirectionLeftToRight); + canvas_draw_line(canvas, x + 1, y - 2, x + 1, y + 2); + canvas_draw_line(canvas, x - 4, y, x, y); + } + else if (icon == XRemoteIconJumpBackward) + { + canvas_draw_triangle(canvas, x - 2, y, 5, 3, CanvasDirectionRightToLeft); + canvas_draw_triangle(canvas, x + 1, y, 5, 3, CanvasDirectionRightToLeft); + canvas_draw_line(canvas, x - 5, y - 2, x - 5, y + 2); + canvas_draw_line(canvas, x, y, x - 4, y); + } + else if (icon == XRemoteIconFastForward) + { + canvas_draw_triangle(canvas, x - 1, y, 5, 3, CanvasDirectionLeftToRight); + canvas_draw_triangle(canvas, x - 4, y, 5, 3, CanvasDirectionLeftToRight); + canvas_draw_line(canvas, x - 3, y, x, y); + } + else if (icon == XRemoteIconFastBackward) + { + canvas_draw_triangle(canvas, x - 3, y, 5, 3, CanvasDirectionRightToLeft); + canvas_draw_triangle(canvas, x, y, 5, 3, CanvasDirectionRightToLeft); + canvas_draw_line(canvas, x - 1, y, x - 4, y); + } + else if (icon == XRemoteIconPlayPause) + { + canvas_draw_triangle(canvas, x - 5, y, 5, 3, CanvasDirectionLeftToRight); + canvas_draw_dot(canvas, x - 4, y); + canvas_draw_line(canvas, x - 1, y - 2, x - 1, y + 2); + canvas_draw_line(canvas, x + 1, y - 2, x + 1, y + 2); + } + else if (icon == XRemoteIconPlay) + { + canvas_draw_triangle(canvas, x - 3, y, 5, 3, CanvasDirectionLeftToRight); + canvas_draw_dot(canvas, x - 2, y); + } + else if (icon == XRemoteIconPause) + { + canvas_draw_line(canvas, x - 3, y - 2, x - 3, y + 2); + canvas_draw_line(canvas, x - 1, y - 2, x - 1, y + 2); + } + else if (icon == XRemoteIconStop) + { + canvas_draw_box(canvas, x - 4, y - 2, 5, 5); + } + else if (icon == XRemoteIconOk) + { + canvas_draw_str(canvas, x - 7, y + 4, "OK"); + } +} + +void xremote_canvas_draw_header(Canvas* canvas, const char* section) +{ + canvas_set_font(canvas, FontPrimary); + elements_multiline_text_aligned(canvas, 0, 0, AlignLeft, AlignTop, "XRemote"); + + canvas_set_font(canvas, FontSecondary); + canvas_draw_str(canvas, 0, 20, section); +} + +void xremote_canvas_draw_exit_footer(Canvas* canvas, char *text) +{ + canvas_set_font(canvas, FontSecondary); + canvas_draw_icon(canvas, 0, 120, &I_Back_icon_10x8); + canvas_draw_str(canvas, 12, 128, text); +} + +void xremote_canvas_draw_button(Canvas* canvas, bool pressed, uint8_t x, uint8_t y, XRemoteIcon icon) +{ + canvas_draw_icon(canvas, x, y, &I_Button_18x18); + + if (pressed) + { + elements_slightly_rounded_box(canvas, x + 3, y + 2, 13, 13); + canvas_set_color(canvas, ColorWhite); + } + + xremote_canvas_draw_icon(canvas, x + 11, y + 8, icon); + canvas_set_color(canvas, ColorBlack); +} + +void xremote_canvas_draw_button_wide(Canvas* canvas, bool pressed, uint8_t x, uint8_t y, char* text, const Icon* icon) +{ + elements_slightly_rounded_frame(canvas, x, y, 64, 17); + + if (pressed) + { + elements_slightly_rounded_box(canvas, x + 2, y + 2, 60, 13); + canvas_set_color(canvas, ColorWhite); + } + + canvas_draw_icon(canvas, x + 11, y + 4, icon); + elements_multiline_text_aligned(canvas, x + 28, y + 12, AlignLeft, AlignBottom, text); + canvas_set_color(canvas, ColorBlack); +} diff --git a/views/xremote_common_view.h b/views/xremote_common_view.h new file mode 100644 index 0000000..0439c8e --- /dev/null +++ b/views/xremote_common_view.h @@ -0,0 +1,111 @@ +/*! + * @file flipper-xremote/views/xremote_common_view.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Common view and canvas functionality shared between the pages. + */ + +#pragma once + +#include +#include +#include + +#include +#include + +#include +#include + +#define XREMOTE_COMMAND_POWER "Power" +#define XREMOTE_COMMAND_SETTINGS "Settings" +#define XREMOTE_COMMAND_INPUT "Input" +#define XREMOTE_COMMAND_MENU "Menu" +#define XREMOTE_COMMAND_LIST "List" +#define XREMOTE_COMMAND_INFO "Info" +#define XREMOTE_COMMAND_BACK "Back" +#define XREMOTE_COMMAND_OK "Ok" +#define XREMOTE_COMMAND_UP "Up" +#define XREMOTE_COMMAND_DOWN "Down" +#define XREMOTE_COMMAND_LEFT "Left" +#define XREMOTE_COMMAND_RIGHT "Right" +#define XREMOTE_COMMAND_JUMP_FORWARD "Jump_forward" +#define XREMOTE_COMMAND_JUMP_BACKWARD "Jump_backward" +#define XREMOTE_COMMAND_FAST_FORWARD "Fast_forward" +#define XREMOTE_COMMAND_FAST_BACKWARD "Fast_backward" +#define XREMOTE_COMMAND_PAUSE_PLAY "Pause_play" +#define XREMOTE_COMMAND_PAUSE "Pause" +#define XREMOTE_COMMAND_PLAY "Play" +#define XREMOTE_COMMAND_STOP "Stop" +#define XREMOTE_COMMAND_VOL_UP "Vol_up" +#define XREMOTE_COMMAND_VOL_DOWN "Vol_down" +#define XREMOTE_COMMAND_NEXT_CHAN "Next_chan" +#define XREMOTE_COMMAND_PREV_CHAN "Prev_chan" + +typedef enum { + /* Controller */ + XRemoteIconOk, + XRemoteIconArrowUp, + XRemoteIconArrowDown, + XRemoteIconArrowLeft, + XRemoteIconArrowRight, + + /* Playback */ + XRemoteIconPlay, + XRemoteIconPause, + XRemoteIconStop, + XRemoteIconPlayPause, + XRemoteIconFastForward, + XRemoteIconFastBackward, + XRemoteIconJumpForward, + XRemoteIconJumpBackward +} XRemoteIcon; + +typedef struct { + bool ok_pressed; + bool back_pressed; + bool up_pressed; + bool down_pressed; + bool left_pressed; + bool right_pressed; + uint32_t reserverd; +} XRemoteViewModel; + +typedef enum { + XRemoteViewNone, + + /* Main page */ + XRemoteViewSubmenu, + XRemoteViewLearn, + XRemoteViewSaved, + XRemoteViewSettings, + XRemoteViewAbout, + + /* Remote app */ + XRemoteViewIRSubmenu, + XRemoteViewIRGeneral, + XRemoteViewIRControl, + XRemoteViewIRPlayer, + XRemoteViewIRCustom +} XRemoteViewID; + +typedef struct XRemoteView XRemoteView; +typedef void (*XRemoteViewClearCallback)(void *context); + +void xremote_canvas_draw_header(Canvas* canvas, const char* section); +void xremote_canvas_draw_exit_footer(Canvas* canvas, char *text); + +void xremote_canvas_draw_icon(Canvas* canvas, uint8_t x, uint8_t y, XRemoteIcon icon); +void xremote_canvas_draw_button(Canvas* canvas, bool pressed, uint8_t x, uint8_t y, XRemoteIcon icon); +void xremote_canvas_draw_button_wide(Canvas* canvas, bool pressed, uint8_t x, uint8_t y, char* text, const Icon* icon); + +XRemoteView* xremote_view_alloc(NotificationApp* notifications, ViewInputCallback input_cb, ViewDrawCallback draw_cb); +void xremote_view_free(XRemoteView* rview); + +View* xremote_view_get_view(XRemoteView* rview); +void xremote_view_send_ir(XRemoteView *rview, const char *name); + +void xremote_view_set_context(XRemoteView* rview, void *context, XRemoteViewClearCallback on_clear); +void* xremote_view_get_context(XRemoteView* rview); +void xremote_view_clear_context(XRemoteView* rview); \ No newline at end of file diff --git a/views/xremote_control_view.c b/views/xremote_control_view.c new file mode 100644 index 0000000..96916ac --- /dev/null +++ b/views/xremote_control_view.c @@ -0,0 +1,95 @@ +/*! + * @file flipper-xremote/views/xremote_control_view.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Control page view callbacks and infrared functionality. + */ + +#include "xremote_control_view.h" + +static void xremote_control_view_draw_callback(Canvas* canvas, void* context) +{ + furi_assert(context); + XRemoteViewModel* model = context; + + xremote_canvas_draw_header(canvas, "Controller"); + xremote_canvas_draw_button(canvas, model->up_pressed, 23, 30, XRemoteIconArrowUp); + xremote_canvas_draw_button(canvas, model->down_pressed, 23, 72, XRemoteIconArrowDown); + xremote_canvas_draw_button(canvas, model->left_pressed, 2, 51, XRemoteIconArrowLeft); + xremote_canvas_draw_button(canvas, model->right_pressed, 44, 51, XRemoteIconArrowRight); + xremote_canvas_draw_button(canvas, model->ok_pressed, 23, 51, XRemoteIconOk); + xremote_canvas_draw_button_wide(canvas, model->back_pressed, 0, 95, "BACK", &I_Back_icon_10x8); + xremote_canvas_draw_exit_footer(canvas, "Hold to exit"); +} + +static void xremote_control_view_process(XRemoteView* view, InputEvent* event) +{ + with_view_model( + xremote_view_get_view(view), + XRemoteViewModel* model, + { + if (event->type == InputTypePress) + { + if (event->key == InputKeyUp) + { + model->up_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_UP); + } + else if (event->key == InputKeyDown) + { + model->down_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_DOWN); + } + else if (event->key == InputKeyLeft) + { + model->left_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_LEFT); + } + else if (event->key == InputKeyRight) + { + model->right_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_RIGHT); + } + else if (event->key == InputKeyOk) + { + model->ok_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_OK); + } + else if (event->key == InputKeyBack) + { + model->back_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_BACK); + } + } + else if (event->type == InputTypeRelease) + { + if (event->key == InputKeyUp) model->up_pressed = false; + else if (event->key == InputKeyDown) model->down_pressed = false; + else if (event->key == InputKeyLeft) model->left_pressed = false; + else if (event->key == InputKeyRight) model->right_pressed = false; + else if (event->key == InputKeyOk) model->ok_pressed = false; + else if (event->key == InputKeyBack) model->back_pressed = false; + } + }, + true); +} + +static bool xremote_control_view_input_callback(InputEvent* event, void* context) +{ + furi_assert(context); + XRemoteView* view = (XRemoteView*)context; + + if (event->type == InputTypeLong && + event->key == InputKeyBack) return false; + + xremote_control_view_process(view, event); + return true; +} + +XRemoteView* xremote_control_view_alloc(NotificationApp* notifications) +{ + return xremote_view_alloc(notifications, + xremote_control_view_input_callback, + xremote_control_view_draw_callback); +} \ No newline at end of file diff --git a/views/xremote_control_view.h b/views/xremote_control_view.h new file mode 100644 index 0000000..9bf2819 --- /dev/null +++ b/views/xremote_control_view.h @@ -0,0 +1,13 @@ +/*! + * @file flipper-xremote/views/xremote_control_view.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Control page view callbacks and infrared functionality. + */ + +#pragma once + +#include "xremote_common_view.h" + +XRemoteView* xremote_control_view_alloc(NotificationApp* notifications); diff --git a/views/xremote_custom_view.c b/views/xremote_custom_view.c new file mode 100644 index 0000000..9ec7994 --- /dev/null +++ b/views/xremote_custom_view.c @@ -0,0 +1,24 @@ +/*! + * @file flipper-xremote/views/xremote_custom_view.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Custom layout UI and view functionality for remote buttons. + */ + +#include "xremote_custom_view.h" + +static void xremote_custom_view_draw_callback(Canvas* canvas, void* context) +{ + (void)context; + xremote_canvas_draw_header(canvas, "Custom"); + canvas_set_font(canvas, FontSecondary); + canvas_draw_str(canvas, 0, 70, "Comming Soon"); + xremote_canvas_draw_exit_footer(canvas, "Press to exit"); +} + +XRemoteView* xremote_custom_view_alloc(NotificationApp* notifications) +{ + return xremote_view_alloc(notifications, + NULL, xremote_custom_view_draw_callback); +} \ No newline at end of file diff --git a/views/xremote_custom_view.h b/views/xremote_custom_view.h new file mode 100644 index 0000000..b99939b --- /dev/null +++ b/views/xremote_custom_view.h @@ -0,0 +1,13 @@ +/*! + * @file flipper-xremote/views/xremote_custom_view.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Custom layout UI and view functionality for remote buttons. + */ + +#pragma once + +#include "xremote_common_view.h" + +XRemoteView* xremote_custom_view_alloc(NotificationApp* notifications); diff --git a/views/xremote_general_view.c b/views/xremote_general_view.c new file mode 100644 index 0000000..76e0fb8 --- /dev/null +++ b/views/xremote_general_view.c @@ -0,0 +1,24 @@ +/*! + * @file flipper-xremote/views/xremote_general_view.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief General remote buttons section UI and view functionality. + */ + +#include "xremote_general_view.h" + +static void xremote_general_view_draw_callback(Canvas* canvas, void* context) +{ + (void)context; + xremote_canvas_draw_header(canvas, "General"); + canvas_set_font(canvas, FontSecondary); + canvas_draw_str(canvas, 0, 70, "Comming Soon"); + xremote_canvas_draw_exit_footer(canvas, "Press to exit"); +} + +XRemoteView* xremote_general_view_alloc(NotificationApp* notifications) +{ + return xremote_view_alloc(notifications, + NULL, xremote_general_view_draw_callback); +} \ No newline at end of file diff --git a/views/xremote_general_view.h b/views/xremote_general_view.h new file mode 100644 index 0000000..2faf316 --- /dev/null +++ b/views/xremote_general_view.h @@ -0,0 +1,13 @@ +/*! + * @file flipper-xremote/views/xremote_general_view.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief General remote buttons section UI and view functionality. + */ + +#pragma once + +#include "xremote_common_view.h" + +XRemoteView* xremote_general_view_alloc(NotificationApp* notifications); diff --git a/views/xremote_learn_view.c b/views/xremote_learn_view.c new file mode 100644 index 0000000..780dd96 --- /dev/null +++ b/views/xremote_learn_view.c @@ -0,0 +1,24 @@ +/*! + * @file flipper-xremote/views/xremote_learn_view.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Learn new remote page view components and functionality. + */ + +#include "xremote_learn_view.h" + +static void xremote_learn_view_draw_callback(Canvas* canvas, void* context) +{ + (void)context; + xremote_canvas_draw_header(canvas, "Learn"); + canvas_set_font(canvas, FontSecondary); + canvas_draw_str(canvas, 0, 70, "Comming Soon"); + xremote_canvas_draw_exit_footer(canvas, "Press to exit"); +} + +XRemoteView* xremote_learn_view_alloc(NotificationApp* notifications) +{ + return xremote_view_alloc(notifications, + NULL, xremote_learn_view_draw_callback); +} \ No newline at end of file diff --git a/views/xremote_learn_view.h b/views/xremote_learn_view.h new file mode 100644 index 0000000..ae1b671 --- /dev/null +++ b/views/xremote_learn_view.h @@ -0,0 +1,13 @@ +/*! + * @file flipper-xremote/views/xremote_learn_view.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Learn new remote page view components and functionality. + */ + +#pragma once + +#include "xremote_common_view.h" + +XRemoteView* xremote_learn_view_alloc(NotificationApp* notifications); diff --git a/views/xremote_player_view.c b/views/xremote_player_view.c new file mode 100644 index 0000000..eb1d748 --- /dev/null +++ b/views/xremote_player_view.c @@ -0,0 +1,95 @@ +/*! + * @file flipper-xremote/views/xremote_player_view.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Playback page view callbacks and infrared functionality. + */ + +#include "xremote_player_view.h" + +static void xremote_player_view_draw_callback(Canvas* canvas, void* context) +{ + furi_assert(context); + XRemoteViewModel* model = context; + + xremote_canvas_draw_header(canvas, "Playback"); + xremote_canvas_draw_button(canvas, model->up_pressed, 23, 30, XRemoteIconJumpForward); + xremote_canvas_draw_button(canvas, model->down_pressed, 23, 72, XRemoteIconJumpBackward); + xremote_canvas_draw_button(canvas, model->ok_pressed, 23, 51, XRemoteIconPlayPause); + xremote_canvas_draw_button(canvas, model->left_pressed, 2, 51, XRemoteIconFastBackward); + xremote_canvas_draw_button(canvas, model->right_pressed, 44, 51, XRemoteIconFastForward); + xremote_canvas_draw_button(canvas, model->back_pressed, 2, 95, XRemoteIconStop); + xremote_canvas_draw_exit_footer(canvas, "Hold to exit"); +} + +static void xremote_player_view_process(XRemoteView* view, InputEvent* event) +{ + with_view_model( + xremote_view_get_view(view), + XRemoteViewModel* model, + { + if (event->type == InputTypePress) + { + if (event->key == InputKeyUp) + { + model->up_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_JUMP_FORWARD); + } + else if (event->key == InputKeyDown) + { + model->down_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_JUMP_BACKWARD); + } + else if (event->key == InputKeyLeft) + { + model->left_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_FAST_BACKWARD); + } + else if (event->key == InputKeyRight) + { + model->right_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_FAST_FORWARD); + } + else if (event->key == InputKeyOk) + { + model->ok_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_PAUSE_PLAY); + } + else if (event->key == InputKeyBack) + { + model->back_pressed = true; + xremote_view_send_ir(view, XREMOTE_COMMAND_STOP); + } + } + else if (event->type == InputTypeRelease) + { + if (event->key == InputKeyUp) model->up_pressed = false; + else if (event->key == InputKeyDown) model->down_pressed = false; + else if (event->key == InputKeyLeft) model->left_pressed = false; + else if (event->key == InputKeyRight) model->right_pressed = false; + else if (event->key == InputKeyOk) model->ok_pressed = false; + else if (event->key == InputKeyBack) model->back_pressed = false; + } + }, + true); +} + +static bool xremote_player_view_input_callback(InputEvent* event, void* context) +{ + furi_assert(context); + XRemoteView* view = (XRemoteView*)context; + + if (event->type == InputTypeLong && + event->key == InputKeyBack) return false; + + xremote_player_view_process(view, event); + return true; +} + +XRemoteView* xremote_player_view_alloc(NotificationApp* notifications) +{ + return xremote_view_alloc(notifications, + xremote_player_view_input_callback, + xremote_player_view_draw_callback); +} diff --git a/views/xremote_player_view.h b/views/xremote_player_view.h new file mode 100644 index 0000000..bf6677b --- /dev/null +++ b/views/xremote_player_view.h @@ -0,0 +1,13 @@ +/*! + * @file flipper-xremote/views/xremote_player_view.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Playback page view callbacks and infrared functionality. + */ + +#pragma once + +#include "xremote_common_view.h" + +XRemoteView* xremote_player_view_alloc(NotificationApp* notifications); diff --git a/views/xremote_settings_view.c b/views/xremote_settings_view.c new file mode 100644 index 0000000..7520d98 --- /dev/null +++ b/views/xremote_settings_view.c @@ -0,0 +1,24 @@ +/*! + * @file flipper-xremote/views/xremote_settings_view.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief UI and view functionality for the project settings page. + */ + +#include "xremote_settings_view.h" + +static void xremote_settings_view_draw_callback(Canvas* canvas, void* context) +{ + (void)context; + xremote_canvas_draw_header(canvas, "Settings"); + canvas_set_font(canvas, FontSecondary); + canvas_draw_str(canvas, 0, 70, "Comming Soon"); + xremote_canvas_draw_exit_footer(canvas, "Press to exit"); +} + +XRemoteView* xremote_settings_view_alloc(NotificationApp* notifications) +{ + return xremote_view_alloc(notifications, + NULL, xremote_settings_view_draw_callback); +} \ No newline at end of file diff --git a/views/xremote_settings_view.h b/views/xremote_settings_view.h new file mode 100644 index 0000000..b7b7afb --- /dev/null +++ b/views/xremote_settings_view.h @@ -0,0 +1,13 @@ +/*! + * @file flipper-xremote/views/xremote_settings_view.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief UI and view functionality for the project settings page. + */ + +#pragma once + +#include "xremote_common_view.h" + +XRemoteView* xremote_settings_view_alloc(NotificationApp* notifications); diff --git a/xremote.c b/xremote.c new file mode 100644 index 0000000..b20dc06 --- /dev/null +++ b/xremote.c @@ -0,0 +1,102 @@ +/*! + * @file flipper-xremote/xremote.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Entrypoint and factory of the XRemote main app. + */ + +#include "xremote.h" +#include "xremote_learn.h" +#include "xremote_control.h" +#include "xremote_settings.h" + +#include "views/xremote_about_view.h" +#include "views/xremote_learn_view.h" +#include "views/xremote_settings_view.h" + +#define TAG "XRemote" + +void xremote_get_version(char *version, size_t length) +{ + snprintf(version, length, "%d.%d.%d", + XREMOTE_VERSION_MAJOR, + XREMOTE_VERSION_MINOR, + XREMOTE_BUILD_NUMBER); +} + +static uint32_t xremote_view_exit_callback(void* context) +{ + UNUSED(context); + return XRemoteViewSubmenu; +} + +static uint32_t xremote_exit_callback(void* context) +{ + UNUSED(context); + return VIEW_NONE; +} + +static void xremote_child_clear_callback(void *context) +{ + xremote_app_assert_void(context); + xremote_app_free((XRemoteApp*)context); +} + +static XRemoteApp* xremote_about_alloc(XRemoteAppContext* app_ctx) +{ + XRemoteApp* app = xremote_app_alloc(app_ctx); + xremote_app_view_alloc(app, XRemoteViewAbout, xremote_about_view_alloc); + xremote_app_view_set_previous_callback(app, xremote_view_exit_callback); + return app; +} + +void xremote_submenu_callback(void* context, uint32_t index) +{ + furi_assert(context); + XRemoteApp* app = (XRemoteApp*)context; + + /* Cleanup previous app first */ + xremote_app_user_context_free(app); + XRemoteApp* child = NULL; + + /* Allocate child app and view based on submenu selection */ + if (index == XRemoteViewLearn) + child = xremote_learn_alloc(app->app_ctx); + else if (index == XRemoteViewIRSubmenu) + child = xremote_control_alloc(app->app_ctx); + else if (index == XRemoteViewSettings) + child = xremote_settings_alloc(app->app_ctx); + else if (index == XRemoteViewAbout) + child = xremote_about_alloc(app->app_ctx); + + if (child != NULL) + { + /* Switch to the view of newely allocated app */ + xremote_app_set_user_context(app, child, xremote_child_clear_callback); + xremote_app_switch_to_view(child, index); + } +} + +int32_t xremote_main(void* p) +{ + /* Allocate context and main application */ + XRemoteAppContext* context = xremote_app_context_alloc(p); + XRemoteApp* app = xremote_app_alloc(context); + + /* Allocate and build the menu */ + xremote_app_submenu_alloc(app, XRemoteViewSubmenu, xremote_exit_callback); + xremote_app_submenu_add(app, "Learn", XRemoteViewLearn, xremote_submenu_callback); + xremote_app_submenu_add(app, "Saved", XRemoteViewIRSubmenu, xremote_submenu_callback); + xremote_app_submenu_add(app, "Settings", XRemoteViewSettings, xremote_submenu_callback); + xremote_app_submenu_add(app, "About", XRemoteViewAbout, xremote_submenu_callback); + + /* Switch to main menu by default and run disparcher*/ + xremote_app_switch_to_view(app, XRemoteViewSubmenu); + view_dispatcher_run(app->app_ctx->view_dispatcher); + + /* Cleanup and exit */ + xremote_app_free(app); + xremote_app_context_free(context); + return 0; +} \ No newline at end of file diff --git a/xremote.h b/xremote.h new file mode 100644 index 0000000..c3e08d8 --- /dev/null +++ b/xremote.h @@ -0,0 +1,15 @@ +/*! + * @file flipper-xremote/xremote.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Entrypoint and factory of the XRemote main app. + */ + +#include "xremote_app.h" + +#define XREMOTE_VERSION_MAJOR 0 +#define XREMOTE_VERSION_MINOR 9 +#define XREMOTE_BUILD_NUMBER 13 + +void xremote_get_version(char *version, size_t length); \ No newline at end of file diff --git a/xremote_app.c b/xremote_app.c new file mode 100644 index 0000000..0fde54f --- /dev/null +++ b/xremote_app.c @@ -0,0 +1,192 @@ +/*! + * @file flipper-xremote/xremote_app.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Shared functionality and data types between the apps. + */ + +#include "xremote_app.h" + +XRemoteAppContext* xremote_app_context_alloc(void *arg) +{ + XRemoteAppContext* ctx = malloc(sizeof(XRemoteAppContext)); + ctx->gui = furi_record_open(RECORD_GUI); + ctx->notifications = furi_record_open(RECORD_NOTIFICATION); + ctx->view_dispatcher = view_dispatcher_alloc(); + ctx->arg = arg; + + view_dispatcher_enable_queue(ctx->view_dispatcher); + view_dispatcher_attach_to_gui(ctx->view_dispatcher, ctx->gui, ViewDispatcherTypeFullscreen); + return ctx; +} + +void xremote_app_context_free(XRemoteAppContext* ctx) +{ + xremote_app_assert_void(ctx); + notification_internal_message(ctx->notifications, &sequence_reset_blue); + view_dispatcher_free(ctx->view_dispatcher); + furi_record_close(RECORD_NOTIFICATION); + furi_record_close(RECORD_GUI); + free(ctx); +} + +void xremote_app_view_alloc(XRemoteApp *app, uint32_t view_id, XRemoteViewAllocator allocator) +{ + furi_assert(app); + xremote_app_assert_void(app->app_ctx); + + if (app->view_id == view_id && + app->view_ctx != NULL) return; + + xremote_app_view_free(app); + app->view_id = view_id; + + app->view_ctx = allocator(app->app_ctx->notifications); + View* app_view = xremote_view_get_view(app->view_ctx); + + ViewDispatcher* view_disp = app->app_ctx->view_dispatcher; + view_dispatcher_add_view(view_disp, app->view_id, app_view); +} + +void xremote_app_view_free(XRemoteApp* app) +{ + xremote_app_assert_void(app); + + if (app->app_ctx != NULL && app->view_id != XRemoteViewNone) + { + ViewDispatcher* view_disp = app->app_ctx->view_dispatcher; + view_dispatcher_remove_view(view_disp, app->view_id); + app->view_id = XRemoteViewNone; + } + + if (app->view_ctx != NULL) + { + xremote_view_free(app->view_ctx); + app->view_ctx = NULL; + } +} + + +bool xremote_app_has_view(XRemoteApp *app, uint32_t view_id) +{ + xremote_app_assert(app, false); + return (app->view_id == view_id || + app->submenu_id == view_id); +} + +void xremote_app_switch_to_view(XRemoteApp *app, uint32_t view_id) +{ + furi_assert(app); + xremote_app_assert_void(app->app_ctx); + ViewDispatcher* view_disp = app->app_ctx->view_dispatcher; + view_dispatcher_switch_to_view(view_disp, view_id); +} + +void xremote_app_switch_to_submenu(XRemoteApp *app) +{ + furi_assert(app); + xremote_app_assert_void(app->app_ctx); + ViewDispatcher* view_disp = app->app_ctx->view_dispatcher; + view_dispatcher_switch_to_view(view_disp, app->submenu_id); +} + +void xremote_app_submenu_add(XRemoteApp* app, const char *name, uint32_t index, SubmenuItemCallback callback) +{ + furi_assert(app); + xremote_app_assert_void(app->submenu); + submenu_add_item(app->submenu, name, index, callback, app); +} + +void xremote_app_submenu_alloc(XRemoteApp* app, uint32_t index, ViewNavigationCallback prev_cb) +{ + furi_assert(app); + app->submenu = submenu_alloc(); + app->submenu_id = index; + + View* view = submenu_get_view(app->submenu); + view_set_orientation(view, ViewOrientationVertical); + view_set_previous_callback(view, prev_cb); + + ViewDispatcher* view_disp = app->app_ctx->view_dispatcher; + view_dispatcher_add_view(view_disp, app->submenu_id, view); +} + +void xremote_app_submenu_free(XRemoteApp *app) +{ + xremote_app_assert_void(app); + + /* Remove submenu view from dispatcher */ + if (app->submenu_id != XRemoteViewNone && app->app_ctx != NULL) + { + ViewDispatcher* view_disp = app->app_ctx->view_dispatcher; + view_dispatcher_remove_view(view_disp, app->submenu_id); + app->submenu_id = XRemoteViewNone; + } + + /* Free submenu */ + if (app->submenu != NULL) + { + submenu_free(app->submenu); + app->submenu = NULL; + } +} + +void xremote_app_view_set_previous_callback(XRemoteApp* app, ViewNavigationCallback callback) +{ + furi_assert(app); + xremote_app_assert_void(app->view_ctx); + View* view = xremote_view_get_view(app->view_ctx); + view_set_previous_callback(view, callback); +} + +void xremote_app_set_view_context(XRemoteApp* app, void *context, XRemoteViewClearCallback on_clear) +{ + furi_assert(app); + xremote_app_assert_void(app->view_ctx); + xremote_view_set_context(app->view_ctx, context, on_clear); +} + +void xremote_app_set_user_context(XRemoteApp* app, void *context, XRemoteAppClearCallback on_clear) +{ + furi_assert(app); + app->on_clear = on_clear; + app->context = context; +} + +void xremote_app_user_context_free(XRemoteApp* app) +{ + furi_assert(app); + xremote_app_assert_void(app->context); + xremote_app_assert_void(app->on_clear); + + app->on_clear(app->context); + app->on_clear = NULL; + app->context = NULL; +} + +XRemoteApp* xremote_app_alloc(XRemoteAppContext *ctx) +{ + furi_assert(ctx); + XRemoteApp* app = malloc(sizeof(XRemoteApp)); + app->submenu_id = XRemoteViewNone; + app->view_id = XRemoteViewNone; + app->app_ctx = ctx; + app->submenu = NULL; + app->view_ctx = NULL; + app->on_clear = NULL; + app->context = NULL; + return app; +} + +void xremote_app_free(XRemoteApp* app) +{ + xremote_app_assert_void(app); + xremote_app_submenu_free(app); + xremote_app_view_free(app); + + if (app->on_clear != NULL) + app->on_clear(app->context); + + free(app); +} diff --git a/xremote_app.h b/xremote_app.h new file mode 100644 index 0000000..1cb446e --- /dev/null +++ b/xremote_app.h @@ -0,0 +1,70 @@ +/*! + * @file flipper-xremote/xremote_app.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Shared functionality and data types between the apps. + */ + +#pragma once + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include + +#include "views/xremote_common_view.h" +#include "xc_icons.h" + +#define xremote_app_assert_void(cond) if (!cond) return +#define xremote_app_assert(cond, var) if (!cond) return var + +typedef struct { + NotificationApp* notifications; + ViewDispatcher* view_dispatcher; + Gui* gui; + void* arg; +} XRemoteAppContext; + +XRemoteAppContext* xremote_app_context_alloc(void* arg); +void xremote_app_context_free(XRemoteAppContext* ctx); + +typedef XRemoteView* (*XRemoteViewAllocator)(NotificationApp* notifications); +typedef void (*XRemoteAppClearCallback)(void *context); + +typedef struct { + XRemoteAppClearCallback on_clear; + XRemoteAppContext* app_ctx; + XRemoteViewID submenu_id; + XRemoteViewID view_id; + XRemoteView* view_ctx; + Submenu* submenu; + void *context; +} XRemoteApp; + +void xremote_app_submenu_add(XRemoteApp* app, const char *name, uint32_t index, SubmenuItemCallback callback); +void xremote_app_submenu_alloc(XRemoteApp* app, uint32_t index, ViewNavigationCallback prev_cb); +void xremote_app_submenu_free(XRemoteApp *app); + +void xremote_app_view_alloc(XRemoteApp *app, uint32_t view_id, XRemoteViewAllocator allocator); +void xremote_app_view_free(XRemoteApp* app); + +void xremote_app_view_set_previous_callback(XRemoteApp* app, ViewNavigationCallback callback); +void xremote_app_set_view_context(XRemoteApp* app, void *context, XRemoteViewClearCallback on_clear); +void xremote_app_set_user_context(XRemoteApp* app, void *context, XRemoteAppClearCallback on_clear); +void xremote_app_user_context_free(XRemoteApp* app); + +bool xremote_app_has_view(XRemoteApp *app, uint32_t view_id); +void xremote_app_switch_to_view(XRemoteApp *app, uint32_t view_id); +void xremote_app_switch_to_submenu(XRemoteApp *app); + +XRemoteApp* xremote_app_alloc(XRemoteAppContext *ctx); +void xremote_app_free(XRemoteApp* app); diff --git a/xremote_control.c b/xremote_control.c new file mode 100644 index 0000000..4089836 --- /dev/null +++ b/xremote_control.c @@ -0,0 +1,119 @@ +/*! + * @file flipper-xremote/xremote_control.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Remote controller application menu and view factory. + */ + +#include "xremote_control.h" + +#include "views/xremote_general_view.h" +#include "views/xremote_control_view.h" +#include "views/xremote_player_view.h" +#include "views/xremote_custom_view.h" + +#include "infrared/infrared_remote.h" + +#define XREMOTE_APP_EXTENSION ".ir" +#define XREMOTE_APP_FOLDER ANY_PATH("infrared") + +static uint32_t xremote_control_submenu_exit_callback(void* context) +{ + UNUSED(context); + return XRemoteViewSubmenu; +} + +static uint32_t xremote_control_view_exit_callback(void* context) +{ + UNUSED(context); + return XRemoteViewIRSubmenu; +} + +static void xremote_ir_clear_callback(void *context) +{ + xremote_app_assert_void(context); + infrared_remote_free((InfraredRemote*)context); +} + +static void xremote_control_submenu_callback(void* context, uint32_t index) +{ + furi_assert(context); + XRemoteApp* app = context; + + /* Allocate new view based on selection */ + if (index == XRemoteViewIRGeneral) + xremote_app_view_alloc(app, index, xremote_general_view_alloc); + else if (index == XRemoteViewIRControl) + xremote_app_view_alloc(app, index, xremote_control_view_alloc); + else if (index == XRemoteViewIRPlayer) + xremote_app_view_alloc(app, index, xremote_player_view_alloc); + else if (index == XRemoteViewIRCustom) + xremote_app_view_alloc(app, index, xremote_custom_view_alloc); + + if (app->view_ctx != NULL) + { + xremote_app_view_set_previous_callback(app, xremote_control_view_exit_callback); + xremote_app_set_view_context(app, app->context, NULL); + xremote_app_switch_to_view(app, index); + } +} + +InfraredRemote* xremote_load_ir_buttons() +{ + DialogsApp* dialogs = furi_record_open(RECORD_DIALOGS); + Storage* storage = furi_record_open(RECORD_STORAGE); + + FuriString* file_path = furi_string_alloc(); + furi_string_set(file_path, XREMOTE_APP_FOLDER); + storage_simply_mkdir(storage, XREMOTE_APP_FOLDER); + + /* Open file browser (view and dialogs are managed by the browser itself) */ + DialogsFileBrowserOptions browser; + dialog_file_browser_set_basic_options(&browser, XREMOTE_APP_EXTENSION, &I_IR_Icon_10x10); + browser.base_path = XREMOTE_APP_FOLDER; + + /* Show file selection dialog (returns selected file path with variable file_path) */ + if(!dialog_file_browser_show(dialogs, file_path, file_path, &browser)) + { + furi_record_close(RECORD_STORAGE); + furi_record_close(RECORD_DIALOGS); + furi_string_free(file_path); + return NULL; + } + + /* Load buttons from the selected path */ + InfraredRemote* remote = infrared_remote_alloc(); + bool success = infrared_remote_load(remote, file_path); + + /* Cleanup file loading context */ + furi_record_close(RECORD_STORAGE); + furi_record_close(RECORD_DIALOGS); + furi_string_free(file_path); + + if (!success) + { + infrared_remote_free(remote); + return NULL; + } + + return remote; +} + +XRemoteApp* xremote_control_alloc(XRemoteAppContext* app_ctx) +{ + /* Open file browser and load buttons from selected file */ + InfraredRemote* remote = xremote_load_ir_buttons(); + xremote_app_assert(remote, NULL); + + /* Allocate remote controller app with submenu */ + XRemoteApp* app = xremote_app_alloc(app_ctx); + xremote_app_submenu_alloc(app, XRemoteViewIRSubmenu, xremote_control_submenu_exit_callback); + xremote_app_submenu_add(app, "General", XRemoteViewIRGeneral, xremote_control_submenu_callback); + xremote_app_submenu_add(app, "Control", XRemoteViewIRControl, xremote_control_submenu_callback); + xremote_app_submenu_add(app, "Playback", XRemoteViewIRPlayer, xremote_control_submenu_callback); + xremote_app_submenu_add(app, "Custom", XRemoteViewIRCustom, xremote_control_submenu_callback); + xremote_app_set_user_context(app, remote, xremote_ir_clear_callback); + + return app; +} diff --git a/xremote_control.h b/xremote_control.h new file mode 100644 index 0000000..28dbd59 --- /dev/null +++ b/xremote_control.h @@ -0,0 +1,13 @@ +/*! + * @file flipper-xremote/xremote_control.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Remote controller application menu and view factory. + */ + +#pragma once + +#include "xremote_app.h" + +XRemoteApp* xremote_control_alloc(XRemoteAppContext* app_ctx); diff --git a/xremote_learn.c b/xremote_learn.c new file mode 100644 index 0000000..3366d37 --- /dev/null +++ b/xremote_learn.c @@ -0,0 +1,24 @@ +/*! + * @file flipper-xremote/xremote_learn.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Functionality to read and store input from new remote. + */ + +#include "xremote_learn.h" +#include "views/xremote_learn_view.h" + +uint32_t xremote_learn_view_exit_callback(void* context) +{ + UNUSED(context); + return XRemoteViewSubmenu; +} + +XRemoteApp* xremote_learn_alloc(XRemoteAppContext* app_ctx) +{ + XRemoteApp* app = xremote_app_alloc(app_ctx); + xremote_app_view_alloc(app, XRemoteViewLearn, xremote_learn_view_alloc); + xremote_app_view_set_previous_callback(app, xremote_learn_view_exit_callback); + return app; +} diff --git a/xremote_learn.h b/xremote_learn.h new file mode 100644 index 0000000..9a20409 --- /dev/null +++ b/xremote_learn.h @@ -0,0 +1,13 @@ +/*! + * @file flipper-xremote/xremote_learn.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Functionality to read and store input from new remote. + */ + +#pragma once + +#include "xremote_app.h" + +XRemoteApp* xremote_learn_alloc(XRemoteAppContext* app_ctx); diff --git a/xremote_settings.c b/xremote_settings.c new file mode 100644 index 0000000..0368a3f --- /dev/null +++ b/xremote_settings.c @@ -0,0 +1,24 @@ +/*! + * @file flipper-xremote/xremote_settings.c + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Remote controller application menu and view factory. + */ + +#include "xremote_settings.h" +#include "views/xremote_settings_view.h" + +static uint32_t xremote_settings_view_exit_callback(void* context) +{ + UNUSED(context); + return XRemoteViewSubmenu; +} + +XRemoteApp* xremote_settings_alloc(XRemoteAppContext* app_ctx) +{ + XRemoteApp* app = xremote_app_alloc(app_ctx); + xremote_app_view_alloc(app, XRemoteViewSettings, xremote_settings_view_alloc); + xremote_app_view_set_previous_callback(app, xremote_settings_view_exit_callback); + return app; +} diff --git a/xremote_settings.h b/xremote_settings.h new file mode 100644 index 0000000..c5dfbc0 --- /dev/null +++ b/xremote_settings.h @@ -0,0 +1,13 @@ +/*! + * @file flipper-xremote/xremote_settings.h + @license This project is released under the GNU GPLv3 License + * @copyright (c) 2023 Sandro Kalatozishvili (s.kalatoz@gmail.com) + * + * @brief Settings application menu and view factory. + */ + +#pragma once + +#include "xremote_app.h" + +XRemoteApp* xremote_settings_alloc(XRemoteAppContext* app_ctx);