├── DISCLAIMER ├── LICENSE ├── README.md ├── binaries ├── deb64 │ └── PiVision_Deb64.tar.gz ├── osx │ └── PiVision_osx_intel.zip ├── rpi │ └── PiVision_RPi.tar.gz └── win64 │ └── PiVision_win64.zip ├── screenshots ├── PIVision_screenshots.tar.gz └── PIVision_screenshots.zip └── source ├── INSTALL ├── backup ├── rpiCC.lpi.bak ├── rpiCC.lps.bak ├── rpiccbackendmanager.pas.bak ├── rpiccmainform.lfm.bak └── rpiccmainform.pas.bak ├── gsf ├── img └── PiVision_images.zip ├── lib ├── arm-linux │ ├── rpiCC.compiled │ ├── rpiCC.o │ ├── rpiCC.or │ ├── rpiCC.res │ ├── rpiccbackendmanager.o │ ├── rpiccbackendmanager.ppu │ ├── rpiccmainform.lfm │ ├── rpiccmainform.o │ └── rpiccmainform.ppu ├── x86_64-linux │ ├── rpiCC.compiled │ ├── rpiCC.o │ ├── rpiCC.or │ ├── rpiCC.res │ ├── rpiccbackendmanager.o │ ├── rpiccbackendmanager.ppu │ ├── rpiccmainform.lfm │ ├── rpiccmainform.o │ └── rpiccmainform.ppu └── x86_64-win64 │ ├── rpiCC.compiled │ ├── rpiCC.o │ ├── rpiCC.obj │ ├── rpiCC.res │ ├── rpiccbackendmanager.o │ ├── rpiccbackendmanager.ppu │ ├── rpiccmainform.lfm │ ├── rpiccmainform.o │ └── rpiccmainform.ppu ├── rpiCC ├── rpiCC.ico ├── rpiCC.lpi ├── rpiCC.lpr ├── rpiCC.lps ├── rpiCC.res ├── rpiccbackendmanager.pas ├── rpiccmainform.lfm └── rpiccmainform.pas /DISCLAIMER: -------------------------------------------------------------------------------- 1 | Disclaimer 2 | 3 | Provider=B.J.Rao 4 | 5 | IN NO EVENT SHALL Provider BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 6 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, 7 | ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 8 | REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 9 | 10 | Provider SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED 11 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 12 | PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED 13 | HEREUNDER IS PROVIDED "AS IS". Provider HAS NO OBLIGATION TO PROVIDE 14 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS 15 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | , 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | What is Pi Vision? 2 | 3 | Pi Vision is a Graphical User Interface for the Raspberry Pi Camera. 4 | It allows you to control the camera functions through the camera's 5 | native camera apps. It also displays the terminal commands sent. 6 | 7 | The project was developed using Lazarus FPC and has been released 8 | as open source. It is what you make of it. 9 | 10 | The incentive of Pi Vision is to allow for easy use of the 11 | Raspberry Pi camera while also serving as an instructional tool. 12 | Employed commands are relayed to the user. This assists novice users 13 | in understanding the command structure. 14 | 15 | While Pi Vision is specificaly built for the ARM based Raspberry Pi, 16 | binaries have also been provided for Windows, OSX and 17 | Debian Linux. These are, however, only intended to review the 18 | application. 19 | 20 | Where is the Install document? 21 | 22 | See the directory named "source" for the install. 23 | 24 | Why won't Pi Vision app run on the Raspberry? 25 | 26 | You need to set its Permissions first. 27 | 28 | In order to run your apps independently from the Lazarus IDE you will 29 | first need to set permissions. Right-click on the app and select Properties 30 | from the drop-down. Select the Permissions tab from the Properties menu. 31 | There is a small check-box called "Make this file executable". Check this, 32 | close the window and click on the app to run it. 33 | 34 | Copyright 35 | 36 | Pi Vision Copyright 2013 B.J.Rao 37 | 38 | This program is free software; you can redistribute it and/or 39 | modify it under the terms of the GNU General Public License version 2 40 | as published by the Free Software Foundation. 41 | 42 | This program is distributed in the hope that it will be useful, 43 | but WITHOUT ANY WARRANTY; without even the implied warranty of 44 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 45 | GNU General Public License for more details. 46 | 47 | You should have received a copy of the GNU General Public License 48 | along with this program; if not, write to the: 49 | 50 | Free Software Foundation, Inc., 51 | 51 Franklin Street, Fifth Floor, 52 | Boston, MA 02110-1301, USA. 53 | 54 | Trademarks 55 | 56 | All trademarks are the property of their respective owners 57 | - Raspberry Pi is a trademark owned by the Raspberry Pi Foundation 58 | -------------------------------------------------------------------------------- /binaries/deb64/PiVision_Deb64.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/binaries/deb64/PiVision_Deb64.tar.gz -------------------------------------------------------------------------------- /binaries/osx/PiVision_osx_intel.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/binaries/osx/PiVision_osx_intel.zip -------------------------------------------------------------------------------- /binaries/rpi/PiVision_RPi.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/binaries/rpi/PiVision_RPi.tar.gz -------------------------------------------------------------------------------- /binaries/win64/PiVision_win64.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/binaries/win64/PiVision_win64.zip -------------------------------------------------------------------------------- /screenshots/PIVision_screenshots.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/screenshots/PIVision_screenshots.tar.gz -------------------------------------------------------------------------------- /screenshots/PIVision_screenshots.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/screenshots/PIVision_screenshots.zip -------------------------------------------------------------------------------- /source/INSTALL: -------------------------------------------------------------------------------- 1 | Pi Vision, a Simple Controller for the Raspberry Pi Camera 2 | ========================================================== 3 | 4 | Date : May 29, 2013 5 | 6 | Status : GNU Licensed 7 | 8 | System req. : Raspberry Pi Board B, Raspbian Wheezy, Lazarus + Free Pascal Compiler 9 | 10 | Home page : http://heywhatsthebigidea.net 11 | 12 | Note : All trademarks are the property of their respective owners 13 | - Raspberry Pi is a trademark owned by the Raspberry Pi Foundation 14 | 15 | 16 | DEVELOPMENT 17 | =========== 18 | 19 | Pi Vision was specifically built for controlling the camera of the 20 | ARM based Raspberry Pi. 21 | 22 | However, Pi Vision was developed on Linux Mint 14 using Lazarus Pascal 23 | and FPC and then re-compiled/built and tested on the Raspberry Pi using 24 | Lazarus Pascal and FPC. 25 | 26 | The reasoning for this approach was to facilitate faster development using 27 | a modern desktop machine. Only the testing, troubleshooting and debugging 28 | was performed on the Raspberry Pi. 29 | 30 | As Lazarus runs on a plurality of systems it is also possible to 31 | develop on other systems instead of using Linux Mint. These include: 32 | 33 | - Recent version of windows 32/64 bit 34 | - OSX intel 35 | - Linux RH/Deb 36 | 37 | In most all cases you will be able to use the supplied source directly and 38 | without modification. 39 | 40 | In addition, cross-compilers exist which further facilitate ease of development. 41 | 42 | 43 | INSTALL LAZARUS + FPC ON RASPBIAN 44 | ================================= 45 | 46 | The Internet provides ample information on how to install Lazarus on a 47 | multitude of systems. Officially for Raspbian: 48 | 49 | http://wiki.freepascal.org/Lazarus_on_Raspberry_Pi 50 | 51 | A brief overview is provided here regarding installation on the Raspberry Pi 52 | board B, Raspbian Wheezy. 53 | 54 | Lazarus + FPC (Free Pascal Compiler) is already part of the Raspbian 55 | Repository. 56 | 57 | Open a terminal and enter the following commands: 58 | 59 | sudo apt-get update 60 | sudo apt-get upgrade 61 | 62 | sudo apt-get install fpc 63 | sudo apt-get install lazarus 64 | 65 | This process will take some time to download, unpack and install. After 66 | installation you will find Lazarus from the "Programming" section of 67 | the LXDE start menu. 68 | 69 | NOTE 1: 70 | 71 | This version of Lazarus is not the most recent. More recent version can be 72 | compiled to run on Raspbian Weezy. But that is beyond this install document. 73 | In any case this is not needed to compile and run Pi Vision. 74 | 75 | NOTE 2: 76 | 77 | In order to install Lazarus and its dependencies you will need enough disc 78 | space. Make sure that the entire SD card that contains the Raspbian image is 79 | employed. The start menu in Raspbian will display options for this. To open 80 | this menu open a terminal and type in the command: 81 | 82 | sudo raspi-config 83 | 84 | It is one of the first options called: 85 | 86 | expand_rootfs Expand root partition to fill SD card 87 | 88 | You will need to do this prior to installing Lazarus. 89 | 90 | NOTE 3 91 | 92 | In order to run your apps independently from the Lazarus IDE you will 93 | first need to set permissions. Right-click on the app and select Properties 94 | from the drop-down. Select the Permissions tab from the Properties menu. 95 | There is a small check-box called "Make this file executable". Check this, 96 | close the window and click on the app to run it. 97 | 98 | The official Lazarus FPC website can be found here: 99 | 100 | http://www.lazarus.freepascal.org/ 101 | 102 | 103 | PROJECT SOURCES 104 | =============== 105 | 106 | Start LXDE on the Raspberry. 107 | 108 | startx 109 | 110 | Create a directory in a desired location on your Raspberry. Place all source 111 | files and directories in this directory. Pi Vision's Lazarus project file 112 | is called: 113 | 114 | rpiCC.lpr 115 | 116 | Double click this file. Lazarus is typically already associated with its native 117 | files and will open automatically. It may take a moment or two to start Lazarus. 118 | 119 | If Lazarus does not start automatically after clicking the .lpr file go to the 120 | Programming section, start Lazarus and open the .lpr file from the Lazarus IDE. 121 | 122 | With the project opened go to "Run" in the main menu and select "Build". Then 123 | select Run once this completes or the F9 key. It may take up to two minutes 124 | for Pi Vision to run. 125 | 126 | If you have setup your camera correctly you will be able to directly use 127 | Pi Vision to control it. 128 | -------------------------------------------------------------------------------- /source/backup/rpiCC.lpi.bak: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | <ResourceType Value="res"/> 10 | <UseXPManifest Value="True"/> 11 | <Icon Value="0"/> 12 | </General> 13 | <i18n> 14 | <EnableI18N LFM="False"/> 15 | </i18n> 16 | <VersionInfo> 17 | <UseVersionInfo Value="True"/> 18 | <AutoIncrementBuild Value="True"/> 19 | <BuildNr Value="68"/> 20 | <StringTable Comments="Camera Control for your Raspberry Pi" CompanyName="intricad" ProductName="Pi Vision" ProductVersion="1"/> 21 | </VersionInfo> 22 | <BuildModes Count="2"> 23 | <Item1 Name="Default" Default="True"/> 24 | <Item2 Name="Release"> 25 | <CompilerOptions> 26 | <Version Value="11"/> 27 | <Target> 28 | <Filename Value="rpiCC"/> 29 | </Target> 30 | <SearchPaths> 31 | <IncludeFiles Value="$(ProjOutDir)"/> 32 | <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 33 | </SearchPaths> 34 | <Linking> 35 | <Debugging> 36 | <GenerateDebugInfo Value="False"/> 37 | </Debugging> 38 | <Options> 39 | <Win32> 40 | <GraphicApplication Value="True"/> 41 | </Win32> 42 | </Options> 43 | </Linking> 44 | <Other> 45 | <CompilerMessages> 46 | <MsgFileName Value=""/> 47 | </CompilerMessages> 48 | <CompilerPath Value="$(CompPath)"/> 49 | </Other> 50 | </CompilerOptions> 51 | </Item2> 52 | </BuildModes> 53 | <PublishOptions> 54 | <Version Value="2"/> 55 | <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> 56 | <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/> 57 | </PublishOptions> 58 | <RunParams> 59 | <local> 60 | <FormatVersion Value="1"/> 61 | </local> 62 | </RunParams> 63 | <RequiredPackages Count="1"> 64 | <Item1> 65 | <PackageName Value="LCL"/> 66 | </Item1> 67 | </RequiredPackages> 68 | <Units Count="3"> 69 | <Unit0> 70 | <Filename Value="rpiCC.lpr"/> 71 | <IsPartOfProject Value="True"/> 72 | <UnitName Value="rpiCC"/> 73 | </Unit0> 74 | <Unit1> 75 | <Filename Value="rpiccmainform.pas"/> 76 | <IsPartOfProject Value="True"/> 77 | <ComponentName Value="MainForm"/> 78 | <HasResources Value="True"/> 79 | <ResourceBaseClass Value="Form"/> 80 | <UnitName Value="rpiCCMainForm"/> 81 | </Unit1> 82 | <Unit2> 83 | <Filename Value="rpiccbackendmanager.pas"/> 84 | <IsPartOfProject Value="True"/> 85 | <UnitName Value="rpiccBackEndManager"/> 86 | </Unit2> 87 | </Units> 88 | </ProjectOptions> 89 | <CompilerOptions> 90 | <Version Value="11"/> 91 | <Target> 92 | <Filename Value="rpiCC"/> 93 | </Target> 94 | <SearchPaths> 95 | <IncludeFiles Value="$(ProjOutDir)"/> 96 | <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 97 | </SearchPaths> 98 | <Linking> 99 | <Options> 100 | <Win32> 101 | <GraphicApplication Value="True"/> 102 | </Win32> 103 | </Options> 104 | </Linking> 105 | <Other> 106 | <CompilerMessages> 107 | <MsgFileName Value=""/> 108 | </CompilerMessages> 109 | <CompilerPath Value="$(CompPath)"/> 110 | </Other> 111 | </CompilerOptions> 112 | <Debugging> 113 | <Exceptions Count="3"> 114 | <Item1> 115 | <Name Value="EAbort"/> 116 | </Item1> 117 | <Item2> 118 | <Name Value="ECodetoolError"/> 119 | </Item2> 120 | <Item3> 121 | <Name Value="EFOpenError"/> 122 | </Item3> 123 | </Exceptions> 124 | </Debugging> 125 | </CONFIG> 126 | -------------------------------------------------------------------------------- /source/backup/rpiCC.lps.bak: -------------------------------------------------------------------------------- 1 | <?xml version="1.0"?> 2 | <CONFIG> 3 | <ProjectSession> 4 | <Version Value="9"/> 5 | <BuildModes Active="Release"/> 6 | <Units Count="4"> 7 | <Unit0> 8 | <Filename Value="rpiCC.lpr"/> 9 | <IsPartOfProject Value="True"/> 10 | <UnitName Value="rpiCC"/> 11 | <WindowIndex Value="0"/> 12 | <TopLine Value="45"/> 13 | <CursorPos X="46" Y="60"/> 14 | <UsageCount Value="201"/> 15 | </Unit0> 16 | <Unit1> 17 | <Filename Value="rpiccmainform.pas"/> 18 | <IsPartOfProject Value="True"/> 19 | <ComponentName Value="MainForm"/> 20 | <HasResources Value="True"/> 21 | <ResourceBaseClass Value="Form"/> 22 | <UnitName Value="rpiCCMainForm"/> 23 | <IsVisibleTab Value="True"/> 24 | <WindowIndex Value="0"/> 25 | <TopLine Value="1691"/> 26 | <CursorPos X="3" Y="1697"/> 27 | <UsageCount Value="201"/> 28 | </Unit1> 29 | <Unit2> 30 | <Filename Value="rpiccbackendmanager.pas"/> 31 | <IsPartOfProject Value="True"/> 32 | <UnitName Value="rpiccBackEndManager"/> 33 | <WindowIndex Value="0"/> 34 | <TopLine Value="1550"/> 35 | <CursorPos X="32" Y="1559"/> 36 | <FoldState Value=" TJiO2_.1 pjPjT2~a032p"/> 37 | <UsageCount Value="201"/> 38 | </Unit2> 39 | <Unit3> 40 | <Filename Value="/usr/share/lazarus/1.0.8/lcl/extctrls.pp"/> 41 | <UnitName Value="ExtCtrls"/> 42 | <WindowIndex Value="0"/> 43 | <TopLine Value="680"/> 44 | <CursorPos X="14" Y="542"/> 45 | <UsageCount Value="10"/> 46 | </Unit3> 47 | </Units> 48 | <JumpHistory Count="0" HistoryIndex="-1"/> 49 | </ProjectSession> 50 | </CONFIG> 51 | -------------------------------------------------------------------------------- /source/backup/rpiccbackendmanager.pas.bak: -------------------------------------------------------------------------------- 1 | { 2 | This file (rpiccBackEndManager) is part of Pi Vision. 3 | 4 | What is Pi Vision? 5 | 6 | Pi Vision is a Graphics User Interface for the Raspberry Pi Camera. 7 | It allows you to controll the camera functions throught the camera's 8 | native apps. It also displays the terminal commands sent. 9 | 10 | Copyright 11 | 12 | Pi Vision Copyright 2013 B.J.Rao. All Rights Reserved. 13 | 14 | This program is free software; you can redistribute it and/or 15 | modify it under the terms of the GNU General Public License version 2 16 | as published by the Free Software Foundation. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program; if not, write to the Free Software 25 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | 27 | Attributions 28 | 29 | videopageimage.jpg: 30 | Under the CC BY-NC "Fir0002/Flagstaffotos" http://www.flagstaffotos.com.au/ 31 | 32 | infopageimage.jpg: 33 | Under the CC BY-NC B.J.Rao 34 | 35 | mainpageimage.jpg: 36 | Under the CC BY-NC B.J.Rao 37 | 38 | Trademarks 39 | 40 | All trademarks are the property of their respective owners 41 | - Raspberry Pi is a trademark owned by the Raspberry Pi Foundation 42 | 43 | Disclaimer 44 | 45 | Provider=B.J.Rao 46 | 47 | IN NO EVENT SHALL Provider BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 48 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, 49 | ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 50 | REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51 | 52 | Provider SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED 53 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 54 | PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED 55 | HEREUNDER IS PROVIDED "AS IS". Provider HAS NO OBLIGATION TO PROVIDE 56 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS 57 | 58 | } 59 | 60 | unit rpiccBackEndManager; 61 | 62 | {$mode objfpc}{$H+} 63 | 64 | interface 65 | 66 | uses Classes, SysUtils, Forms, Controls, StdCtrls, Dialogs, Process; 67 | 68 | {$REGION 'Constants'} 69 | 70 | {$REGION 'Application Constants'} 71 | 72 | const 73 | //Defaults 74 | c_Application_Title='Pi Vision'; 75 | c_Aplication_About='A Simple Controller for the Raspberry Pi Camera'; 76 | c_Project_Creator='B.J. Rao'; 77 | //c_Terminal='gnome-terminal'; // mint 78 | c_Terminal='lxterminal'; // rpi 79 | c_Space=' '; 80 | c_Comma=','; 81 | c_DoublePoint=':'; 82 | 83 | //Defaults 84 | c_Default_UserLanguage=0; //English 85 | c_Default_ApplicationTheme=0; //default 86 | 87 | //Default files names 88 | c_UserSettings_FileName='gsf'; 89 | c_DefaultImageName='photopageimage.jpg'; 90 | c_CapturedImageName='image'; 91 | c_CapturedVideoName='video'; 92 | c_TimeLapsCapturedImageName='image%d'; 93 | 94 | //Default Directories 95 | c_PictureDir='';//'pictures/'; 96 | c_VideoDir='';//'video/'; 97 | c_DataDir='';//'data/'; 98 | c_SettingsDir='';//'settings/'; 99 | c_SettingsFile_Path=c_SettingsDir+c_UserSettings_FileName; 100 | 101 | //Preview Window 102 | c_Default_PreviewWindowSize_Index=2; 103 | c_Default_PreviewWindowPosition_Index=0; 104 | 105 | c_Default_ShowPreview=True; 106 | c_Default_PreviewPositionSize='0,0,640,480'; 107 | c_Default_ShowDefaultPreviewSizePosition=False; 108 | c_Default_ShowDemoPreview=False; 109 | c_Default_Preview_Width=640; 110 | c_Default_Preview_Height=480; 111 | c_Default_Preview_Window_Position_X=0; 112 | c_Default_Preview_Window_Position_Y=0; 113 | c_Default_Preview_FullScreen=False; 114 | c_Default_PreviewMode_Index=3; //1=showpreview 2=showdemopreview 3=No preview 115 | c_Default_CaptureMode_Index=4; //1=image; 2=imageYUV; 3=video; 116 | 117 | //Image/Video Ext 118 | c_VideoExt='.h264'; 119 | 120 | prm_ExtMap : array[0..3] of String = 121 | ( 122 | '.jpg', 123 | '.bmp', 124 | '.png', 125 | '.gif' 126 | ); 127 | 128 | //Default Image Settings 129 | c_Default_Image_Ext_Index=0; 130 | c_Default_Image_Quality_index=0; 131 | c_Default_Image_Width=640; 132 | c_Default_Image_Height=480; 133 | c_Default_Image_Size_Index=2; 134 | c_Default_Image_Flip_Horizontal=False; 135 | c_Default_Image_Flip_Vertical=False; 136 | c_Default_Image_Effect_Index=0; 137 | c_Default_Image_Duration=5000; 138 | c_Default_Image_Delay=1000; 139 | c_Default_Image_MakeTimeLapse=False; 140 | c_Default_Image_RAW_Output=False; 141 | c_Default_Image_ISO_Output=False; 142 | 143 | //Default Video Settings 144 | c_Default_Video_Quality_Index=1; 145 | c_Default_Video_Size_Index=2; 146 | c_Default_Video_Duration=5000; 147 | c_Default_Video_FPS_Index=3; 148 | c_Default_VideoStabilation=False; 149 | c_Default_Video_Width=640; 150 | c_Default_Video_Height=480; 151 | 152 | c_Default_Camera_Brightness_Index=3; 153 | c_Default_Camera_Contrast_Index=3; 154 | c_Default_Camera_Sharpness_Index=3; 155 | c_Default_Camera_Saturation_Index=3; 156 | c_Default_Camera_AWB_Index=1; 157 | c_Default_Camera_EV_Index=3; 158 | c_Default_Camera_Exposure_Index=1; 159 | c_Default_Camera_Rotation_Index=0; 160 | c_Default_Camera_Metering_Index=0; 161 | c_Default_Camera_ColorEffect_U_Index=0; 162 | c_Default_Camera_ColorEffect_V_Index=0; 163 | c_Default_Camera_ColorEffect_UV=False; 164 | 165 | //Default Network Settings 166 | c_Default_Network_Port=5001; 167 | c_Default_Network_Duration=5000; 168 | 169 | //generic 170 | prm_7_LevelListMap : array[0..6] of String = 171 | ( 172 | 'Max', 173 | 'Very High', 174 | 'High', 175 | 'Default', 176 | 'Low', 177 | 'Very Low', 178 | 'Min' 179 | ); 180 | 181 | {$ENDREGION 'Application Constants'} 182 | 183 | {$REGION 'RPi Camera Constants'} 184 | 185 | const 186 | //Main camera apps 187 | cmd_rpiPhotoCamera='raspistill'; 188 | cmd_rpiPhotoCameraYUV='raspistillyuv'; // no encoding 189 | cmd_rpiVideoCamera='raspivid'; 190 | 191 | //Common cmd line Option constants 192 | cmd_Preview='-p'; //Preview window settings <'x,y,w,h'> 193 | cmd_Fullscreen='-f'; //Fullscreen preview mode 194 | cmd_NoPreview='-n'; //Do not display a preview window 195 | 196 | //c_Preview_FullScreen=6; 197 | prm_PreviewWindowSizeMap : array[0..5] of String = 198 | ( 199 | '160 x 120', // 200 | '320 x 240', // 201 | '640 x 480', // VGA 202 | '800 x 600', 203 | '1280 x 1024', 204 | '1920 x 1080' // HD 1080 205 | ); 206 | 207 | prm_PreviewWindowPositionMap : array[0..4] of String = 208 | ( 209 | 'Top Left', 210 | 'Top Right', 211 | 'Center', 212 | 'Bottom Left', 213 | 'Bottom Right' 214 | ); 215 | 216 | {$REGION 'Image and Camera Constants'} 217 | 218 | //image control option cmd contants. 219 | cmd_Sharpness='-sh'; //Set image sharpness (-100 to 100) 220 | cmd_Contrast='-co'; //Set image contrast (-100 to 100) 221 | cmd_Brightness='-br'; //Set image brightness (0 to 100) 50 is the default. 0 is black, 100 is white. 222 | cmd_Saturation='-sa'; //Set image saturation (-100 to 100) 0 is the default. 223 | 224 | cmd_ISO='-ISO'; //Set capture ISO. Not yet implemented 225 | cmd_Vstab='-vs'; //Turn on video stabilisation In video mode only, turn on video stabilisation. 226 | cmd_Ev='-ev'; //Set EV compensation Range is -10 to +10, default is 0. 227 | cmd_Exposure='-ex'; //Set exposure mode 228 | 229 | //Possible exposure options are (see variables section): 230 | 231 | prm_ExposureMap : array[0..12] of String = 232 | ( 233 | 'off', 234 | 'auto', //Use automatic exposure mode 235 | 'night', //Select setting for night shooting 236 | 'nightpreview', 237 | 'backlight', //Select setting for back lit subject 238 | 'spotlight', 239 | 'sports', //Select setting for sports (fast shutter etc) 240 | 'snow', //Select setting optimised for snowy scenery 241 | 'beach', //Select setting optimised for beach 242 | 'verylong', //Select setting for long exposures 243 | 'fixedfps', //Constrain fps to a fixed value 244 | 'antishake', //Antishake mode 245 | 'fireworks' //Select settings 246 | ); 247 | 248 | cmd_Awb='-awb'; //Set Automatic White Balance (AWB) mode 249 | 250 | //Possible Automatic White Balance options are: 251 | 252 | prm_AwbMap : array[0..9] of String = 253 | ( 254 | 'off', //Turn off white balance calculation 255 | 'auto', //Automatic mode (default) 256 | 'sun', //Sunny mode 257 | 'cloud', //Cloudy mode 258 | 'shade', //Shaded mode 259 | 'tungstun', //Tungsten lighting mode 260 | 'fluorescent', //Fluorescent lighting mode 261 | 'incandescent', //Incandescent lighting mode 262 | 'flash', //Flash mode 263 | 'horizon' //Horizon mode 264 | ); 265 | 266 | cmd_Imxfx='-ifx'; //Set image effect 267 | 268 | //Possible image effect options are: 269 | 270 | prm_ImxfxMap : array[0..22] of String = 271 | ( 272 | 'none', //NO effect (default) 273 | 'negative', //Negate the image 274 | 'solarise', //Solarise the image 275 | 'polarise', //Posterise the image 276 | 'whiteboard', //Whiteboard effect 277 | 'blackboard', //Blackboard effect 278 | 'sketch', //Sketch style effect 279 | 'denoise', //Denoise the image 280 | 'emboss', //Emboss the image 281 | 'oilpaint', //Apply an oil paint style effect 282 | 'hatch', //Hatch sketch style 283 | 'gpen', 284 | 'pastel', //A pastel style effect 285 | 'watercolour', //A watercolour style effect 286 | 'film', //Film grain style effect 287 | 'blur', //Blur the image 288 | 'saturation', //Colour saturate the image 289 | 'colourswap', //Not fully implemented 290 | 'washedout', //Not fully implemented 291 | 'posterise', //Not fully implemented 292 | 'colourpoint', //Not fully implemented 293 | 'colourbalance', //Not fully implemented 294 | 'cartoon' //Not fully implemented 295 | ); 296 | 297 | cmd_Colfx='-cfx'; //Set colour effect <U:V> (range 0 to 255).colfx 128:128 should result in a monochrome image 298 | cmd_Metering='-mm'; //Set metering mode 299 | 300 | //Possible metering mode options are: 301 | 302 | prm_MeteringMap : array[0..3] of String = 303 | ( 304 | 'average', //Average the whole frame for metering. 305 | 'spot', //Spot metering 306 | 'backlit', //Assume a backlit image 307 | 'matrix' //Matrix metering 308 | ); 309 | 310 | cmd_Rotation='-rot'; //Set image rotation (0-359). Only 0, 90, 180 and 270 degree rotations are supported 311 | 312 | prm_RotationMap : array[0..3] of String = 313 | ( 314 | '0', 315 | '90', 316 | '180', 317 | '270' 318 | ); 319 | 320 | cmd_Hflip='-hf'; //Set horizontal flip 321 | cmd_Vflip='-vf'; //Set vertical flip 322 | 323 | //photo camera application specific setting constants 324 | cmd_Image_Width='-w'; //Set image width <size> 325 | cmd_Image_Height='-h'; //Set image height <size> 326 | 327 | prm_ImageSizeMap : array[0..8] of String = 328 | ( 329 | '160 x 120', // 330 | '320 x 240', // 331 | '640 x 480', // VGA 332 | '800 x 600', 333 | '1280 x 1024', 334 | '1600 x 1200', // 335 | '1920 x 1080', // HD 1080 336 | '2240 x 1680', 337 | '2592 x 1944' // max 338 | ); 339 | 340 | cmd_Image_Quality='-q'; //et jpeg quality <0 to 100> 341 | 342 | prm_JPG_QualityMap : array[0..9] of String = 343 | ( 344 | '100', 345 | '90', 346 | '80', 347 | '70', 348 | '60', 349 | '50', 350 | '40', 351 | '30', 352 | '20', 353 | '10' 354 | ); 355 | 356 | cmd_Image_Raw='-r'; //Add raw bayer data to jpeg metadata 357 | cmd_Image_Output='-o'; //Output filename <filename>. 358 | cmd_Image_Verbose='-v'; //Output verbose information during run 359 | cmd_Image_Timeout='-t'; //Time before takes picture and shuts down. Default 5 sec if this is not specified 360 | cmd_Image_Timelapse='-tl'; //Timelapse mode. List time in millisec. Note: specify %d at the point in the filename where you want a frame count number to appear. e.g.-t 30000 -tl 2000 -o image%d.jpg 361 | cmd_Image_Thumb='-th'; //Set thumbnail parameters (x:y:quality) defaults are a size of 64x48 at quality 35 362 | cmd_Image_Demo='-d'; //Run a demo mode <milliseconds> cycles through range of camera options, no capture is don 363 | cmd_Image_Encoding='-e'; //File output Encoding. Valid options; jpg, bmp, gif and png. Unaccelerated image types (gif, png, bmp) take much longer to save than JPG. Note: filename suffix is ignored when encoding a file. 364 | cmd_Image_Exif='-x'; //EXIF tag to apply to captures (format as 'key=value') 365 | 366 | //Possible EXIF tag options are: 367 | 368 | {Allows the insertion of specific exif tags in to the JPEG image. 369 | You can have up to 32 exif tge entries. This is useful for things like adding GPS metadata. 370 | For example, to set the Longitude 371 | 372 | --exif GPS.GPSLongitude=5/1,10/1,15/100 373 | 374 | would set the Longitude to 5degs, 10 minutes, 15 seconds. 375 | Supported tags are as follows: 376 | 377 | IFD0.< or IFD1.< 378 | ImageWidth, ImageLength, BitsPerSample, Compression, PhotometricInterpretation, 379 | ImageDescription, Make, Model, StripOffsets, Orientation, SamplesPerPixel, RowsPerString, 380 | StripByteCounts, Xresolution, Yresolution, PlanarConfiguration, ResolutionUnit, TransferFunction, 381 | Software, DateTime, Artist, WhitePoint, PrimaryChromaticities, JPEGInterchangeFormat, 382 | JPEGInterchangeFormatLength, YcbCrCoefficients, YcbCrSubSampling, YcbCrPositioning, 383 | ReferenceBlackWhite, Copyright> 384 | 385 | EXIF.< 386 | ExposureTime, FNumber, ExposureProgram, SpectralSensitivity,a 387 | ISOSpeedRatings, OECF, ExifVersion, DateTimeOriginal, DateTimeDigitized, ComponentsConfiguration, 388 | CompressedBitsPerPixel, ShutterSpeedValue, ApertureValue, BrightnessValue, ExposureBiasValue, 389 | MaxApertureValue, SubjectDistance, MeteringMode, LightSource, Flash, FocalLength, SubjectArea, 390 | MakerNote, UserComment, SubSecTime, SubSecTimeOriginal, SubSecTimeDigitized, FlashpixVersion, 391 | ColorSpace, PixelXDimension, PixelYDimension, RelatedSoundFile, FlashEnergy, SpacialFrequencyResponse, 392 | FocalPlaneXResolution, FocalPlaneYResolution, FocalPlaneResolutionUnit, SubjectLocation, ExposureIndex, 393 | SensingMethod, FileSource, SceneType, CFAPattern, CustomRendered, ExposureMode, WhiteBalance, 394 | DigitalZoomRatio, FocalLengthIn35mmFilm, SceneCaptureType, GainControl, Contrast, Saturation, 395 | Sharpness, DeviceSettingDescription, SubjectDistanceRange, ImageUniqueID> 396 | 397 | GPS.< 398 | GPSVersionID, GPSLatitudeRef, GPSLatitude, GPSLongitudeRef, GPSLongitude, GPSAltitudeRef, 399 | GPSAltitude, GPSTimeStamp, GPSSatellites, GPSStatus, GPSMeasureMode, GPSDOP, GPSSpeedRef, 400 | GPSSpeed, GPSTrackRef, GPSTrack, GPSImgDirectionRef, GPSImgDirection, GPSMapDatum, GPSDestLatitudeRef, 401 | GPSDestLatitude, GPSDestLongitudeRef, GPSDestLongitude, GPSDestBearingRef, GPSDestBearing, 402 | GPSDestDistanceRef, GPSDestDistance, GPSProcessingMethod, GPSAreaInformation, GPSDateStamp, 403 | GPSDifferential> 404 | 405 | EINT.< 406 | InteroperabilityIndex, InteroperabilityVersion, RelatedImageFileFormat, RelatedImageWidth, 407 | RelatedImageLength> 408 | 409 | Note that a small subset of these tags will be set automatically by the camera system, 410 | but will be overridden by any exif options on the command line.} 411 | 412 | //video camera application specific setting constants 413 | 414 | {$ENDREGION 'Image and Constants'} 415 | 416 | {$REGION 'Video Constants'} 417 | 418 | cmd_Video_Width='-w'; //Set video width. Range: 64 and 1920. 419 | cmd_Video_Height='-h'; //Set video height. Range: 64 and 1080. 420 | 421 | prm_VideoSizeMap : array[0..5] of String = 422 | ( 423 | '160 x 120', // 424 | '320 x 240', // 425 | '640 x 480', // VGA 426 | '800 x 600', 427 | '1280 x 1024', 428 | '1920 x 1080' // HD 1080 429 | ); 430 | 431 | cmd_Video_Bitrate='-b'; //Set bitrate.Bits per second, 10MBits/s would be -b 10000000. For H264, 1080p; high quality bitrate would be 15Mbits/s or more. 432 | 433 | //Bitrate calculation example: 434 | //1920 x 1080 = 2,073,600 pixel count 435 | //24 frames per second 436 | //4 = High Motion 437 | //(2,073,600 x 24) x 4 x 0.07 = 13,934,592 bps / 1000 = 13,934 kbps bitrate 438 | prm_VideoQualitytMap : array[0..4] of String = 439 | ( 440 | 'Very Low', 441 | 'Low', 442 | 'High', 443 | 'Very High', 444 | 'Maximum' 445 | ); 446 | 447 | cmd_Video_Output='-o'; //Output filename <filename>.Specify the output filename. If not specified, no file is saved. If the filename is '-', then all output is sent to stdout. 448 | cmd_Video_Verbose='-v'; //Output verbose information during runOutputs debugging/information messages during the program run. 449 | cmd_Video_Timeout='-t'; //Time before takes picture and shuts down.The program will run for this length of time, then take the capture (if output is specified). If not specified, this is set to 5seconds 450 | cmd_Video_Demo='-d'; //Run a demo mode <milliseconds>This options cycles through range of camera options, no capture is done, the demo will end at the end of the timeout period, irrespective of whether all the options have been cycled. The time between cycles should be specified as a millisecond value. 451 | cmd_Video_Framerate='-fps'; //Specify the frames per second to recordAt present, the minimum frame rate allowed is 2fps, the maximum is 30fps. This is likely to change in the future. 452 | 453 | prm_VideoFPSMap : array[0..3] of String = 454 | ( 455 | '2', 456 | '5', 457 | '15', 458 | '30' 459 | ); 460 | 461 | cmd_Video_Penc='-e'; //Display preview image *after* encoding Switch on an option to display the preview after compression. This will show any compression artefacts in the preview window. In normal operation, the preview will show the camera output prior to being compressed. This option is not guaranteed to work in future releases. 462 | cmd_NetworkStream='– | nc'; //construct: raspivid -t 999999 -o – | nc [insert the IP address of the client] 5001 463 | 464 | 465 | {$ENDREGION 'Video Constants'} 466 | 467 | //Defaults 468 | cmd_QuickCameraPreviewDemoMode=cmd_rpiPhotoCamera+c_Space+cmd_Image_Demo+c_Space+'5000'+c_Space+cmd_Preview+c_Space+c_Default_PreviewPositionSize+c_Space+cmd_Image_Verbose; 469 | cmd_QuickCameraPreview=cmd_rpiPhotoCamera+c_Space+cmd_Image_Timeout+c_Space+'5000'+c_Space+cmd_Preview+c_Space+c_Default_PreviewPositionSize+c_Space+cmd_Image_Verbose; 470 | 471 | 472 | {$ENDREGION 'RPi Camera Constants'} 473 | 474 | {$ENDREGION 'Constants'} 475 | 476 | {$REGION 'Variables'} 477 | 478 | var AppURL:String; //Location path of application 479 | ScreenWidth:array[0..2] of LongInt; //Monitor 1 = ScreenWidth[0] 480 | ScreenHeight:array[0..2] of LongInt; 481 | v_UserPass:String; //User sudo password 482 | v_UserLanguage:Integer=c_Default_UserLanguage; //English 483 | v_ApplicationTheme:Integer=c_Default_ApplicationTheme; //Default 484 | v_UserSelectedDirectory:String=''; //To store user images/files 485 | v_ApplicationStarted:Boolean=False; 486 | 487 | v_ShowDemoPreview:Boolean=c_Default_ShowDemoPreview; 488 | v_PreviewMode_Index:Integer=c_Default_PreviewMode_Index; //1=showpreview 2=showdemopreview 3=showdefaultpreview 4=No preview 489 | v_Preview_FullScreen:Boolean=c_Default_Preview_FullScreen; 490 | v_CaptureMode_Index:Integer=c_Default_CaptureMode_Index; //1=image; 2=imageYUV; 3=video; 491 | 492 | v_Preview_Position_Index:Integer=c_Default_PreviewWindowPosition_Index; 493 | v_Preview_Size_Index:Integer=c_Default_PreviewWindowSize_Index; 494 | v_Preview_ShowPreview:Boolean=c_Default_ShowPreview; 495 | v_Preview_Width:Integer=c_Default_Preview_Width; 496 | v_Preview_Height:Integer=c_Default_Preview_Height; 497 | v_Preview_Window_Position_X:Integer=c_Default_Preview_Window_Position_X; 498 | v_Preview_Window_Position_Y:Integer=c_Default_Preview_Window_Position_Y; 499 | v_Preview_PreviewTest:Boolean=False; 500 | 501 | v_Image_Ext_Index:Integer=c_Default_Image_Ext_Index; 502 | v_Image_Quality_Index:Integer=c_Default_Image_Quality_Index; 503 | v_Image_Width:Integer=c_Default_Image_Width; 504 | v_Image_Height:Integer=c_Default_Image_Height; 505 | v_Image_Size_Index:Integer=c_Default_Image_Size_Index; 506 | v_Image_Flip_Horizontal:Boolean=c_Default_Image_Flip_Horizontal; 507 | v_Image_Flip_Vertical:Boolean=c_Default_Image_Flip_Vertical; 508 | v_Image_Effect_Index:Integer=c_Default_Image_Effect_Index; 509 | v_Image_Duration:Integer=c_Default_Image_Duration; 510 | v_Image_Delay:Integer=c_Default_Image_Delay; 511 | v_Image_MakeTimeLapse:Boolean=c_Default_Image_MakeTimeLapse; 512 | v_Image_RAW_Output:Boolean=c_Default_Image_RAW_Output; 513 | v_Image_ISO_Output:Boolean=c_Default_Image_ISO_Output; 514 | 515 | v_Video_Quality_Index:Integer=c_Default_Video_Quality_Index; 516 | v_Video_Size_Index:Integer=c_Default_Video_Size_Index; 517 | v_Video_Width:Integer=c_Default_Video_Width; 518 | v_Video_Height:Integer=c_Default_Video_Height; 519 | v_Video_Duration:Integer=c_Default_Video_Duration; 520 | v_Video_FPS_Index:Integer=c_Default_Video_FPS_Index; 521 | v_VideoStabilation:Boolean=c_Default_VideoStabilation; 522 | 523 | v_Camera_Brightness_Index:Integer=c_Default_Camera_Brightness_Index; 524 | v_Camera_Contrast_Index:Integer=c_Default_Camera_Contrast_Index; 525 | v_Camera_Sharpness_Index:Integer=c_Default_Camera_Sharpness_Index; 526 | v_Camera_Saturation_Index:Integer=c_Default_Camera_Saturation_Index; 527 | v_Camera_AWB_Index:Integer=c_Default_Camera_AWB_Index; 528 | v_Camera_EV_Index:Integer=c_Default_Camera_EV_Index; 529 | v_Camera_Exposure_Index:Integer=c_Default_Camera_Exposure_Index; 530 | v_Camera_Rotation_Index:Integer=c_Default_Camera_Rotation_Index; 531 | v_Camera_Metering_Index:Integer=c_Default_Camera_Metering_Index; 532 | v_Camera_ColorEffect_U_Index:Integer=c_Default_Camera_ColorEffect_U_Index; 533 | v_Camera_ColorEffect_V_Index:Integer=c_Default_Camera_ColorEffect_V_Index; 534 | v_Camera_ColorEffect_UV:Boolean=c_Default_Camera_ColorEffect_UV; 535 | 536 | v_Network_Port:Integer=c_Default_Network_Port; 537 | v_Network_Duration:Integer=c_Default_Network_Duration; 538 | v_Network_IPAddress:Integer=0; 539 | 540 | {$ENDREGION 'Variables'} 541 | 542 | {$REGION 'Function Prototypes'} 543 | 544 | function rpiGetStackedCommand:String; 545 | procedure rpiExtractWidthHeightValuesFromString(s:String; var ImageWidth,ImageHeight:Integer); 546 | procedure rpiSetPreviewModeIndex; 547 | procedure rpiDefaultAll; 548 | function rpiSaveUserSettings(const FN:String):Boolean; 549 | function rpiLoadUserSettings(const FN:String):Boolean; 550 | procedure rpiClearPreviousCapturedImage; 551 | function rpiGetCapturedPictureFileName:String; 552 | function rpiGetCapturedVideoFileName:String; 553 | function rpiGetScreenSize:String; 554 | 555 | function rpiExcecuteLocalProcessSudo(const sudoPass,cmdToExcecute:String; const UseSudo:Boolean; StatusMemo,MessagesMemo:TMemo):Boolean; 556 | 557 | {$ENDREGION 'Function Prototypes'} 558 | 559 | implementation 560 | 561 | {$REGION 'Support'} 562 | 563 | function rpiGetScreenSize:String; 564 | begin 565 | ScreenWidth[0]:=Screen.Width; 566 | ScreenHeight[0]:=Screen.Height; 567 | 568 | Result:=IntToStr(ScreenWidth[0])+' x '+IntToStr(ScreenHeight[0]); 569 | end; 570 | 571 | procedure rpiSetPreviewWindowPosition; 572 | begin 573 | case v_Preview_Position_Index of //note: what if no screeen attached/detected? 574 | 0:begin //top left 575 | v_Preview_Window_Position_X:=0; v_Preview_Window_Position_Y:=0; 576 | end; 577 | 1:begin //top right 578 | v_Preview_Window_Position_X:=ScreenWidth[0]-v_Preview_Width; 579 | v_Preview_Window_Position_Y:=0; 580 | end; 581 | 2:begin //center 582 | v_Preview_Window_Position_X:=(ScreenWidth[0] -v_Preview_Width) DIV 2; 583 | v_Preview_Window_Position_Y:=(ScreenHeight[0] -v_Preview_Height) DIV 2; 584 | end; 585 | 3:begin //bottom left 586 | v_Preview_Window_Position_X:=0; 587 | v_Preview_Window_Position_Y:=ScreenHeight[0]-v_Preview_Height; 588 | end; 589 | 4:begin //bottom right 590 | v_Preview_Window_Position_X:=ScreenWidth[0]-v_Preview_Width; 591 | v_Preview_Window_Position_Y:=ScreenHeight[0]-v_Preview_Height; 592 | end; 593 | end; 594 | end; 595 | 596 | procedure rpiExtractWidthHeightValuesFromString(s:String; var ImageWidth,ImageHeight:Integer); 597 | var List:TStrings; 598 | begin 599 | List:=TStringList.Create; 600 | try 601 | ExtractStrings([' '], [], PChar(s), List); 602 | ImageWidth:=StrToInt(List[0]); 603 | ImageHeight:=StrToInt(List[2]); 604 | finally 605 | List.Free; 606 | end; 607 | end; 608 | 609 | procedure rpiSetPreviewModeIndex; 610 | begin 611 | if (v_Preview_ShowPreview) then 612 | begin 613 | if (v_Preview_FullScreen) then 614 | begin 615 | v_PreviewMode_Index:=2; 616 | end else 617 | begin 618 | v_PreviewMode_Index:=1; 619 | end; 620 | end else 621 | begin 622 | v_PreviewMode_Index:=3; 623 | end; 624 | end; 625 | 626 | procedure rpiDefaultAll; 627 | begin 628 | //Photo tab 629 | v_Image_Ext_Index:=c_Default_Image_Ext_Index; 630 | v_Image_Quality_Index:=c_Default_Image_Quality_Index; 631 | v_Image_Size_Index:=c_Default_Image_Size_Index; 632 | v_Image_Effect_Index:=c_Default_Image_Effect_Index; 633 | v_Image_MakeTimeLapse:=c_Default_Image_MakeTimeLapse; 634 | v_Image_Flip_Horizontal:=c_Default_Image_Flip_Horizontal; 635 | v_Image_Flip_Vertical:=c_Default_Image_Flip_Vertical; 636 | v_Image_Duration:=c_Default_Image_Duration; 637 | v_Image_Delay:=c_Default_Image_Delay; 638 | v_Image_RAW_Output:=c_Default_Image_RAW_Output; 639 | v_Image_ISO_Output:=c_Default_Image_ISO_Output; 640 | 641 | //Video tab 642 | v_Video_Quality_Index:=c_Default_Video_Quality_Index; 643 | v_Video_Size_Index:=c_Default_Video_Size_Index; 644 | v_Video_Duration:=c_Default_Video_Duration; 645 | v_Video_FPS_Index:=c_Default_Video_FPS_Index; 646 | 647 | //Settings tab preview 648 | v_Preview_Position_Index:=c_Default_PreviewWindowPosition_Index; 649 | v_Preview_Size_Index:=c_Default_PreviewWindowSize_Index; 650 | v_Preview_ShowPreview:=c_Default_ShowPreview; 651 | v_Preview_FullScreen:=c_Default_Preview_FullScreen; 652 | rpiSetPreviewModeIndex; 653 | 654 | //Settings tab camera 655 | v_Camera_Brightness_Index:=c_Default_Camera_Brightness_Index; 656 | v_Camera_Contrast_Index:=c_Default_Camera_Contrast_Index; 657 | v_Camera_Sharpness_Index:=c_Default_Camera_Sharpness_Index; 658 | v_Camera_Saturation_Index:=c_Default_Camera_Saturation_Index; 659 | v_Camera_AWB_Index:=c_Default_Camera_AWB_Index; 660 | v_Camera_EV_Index:=c_Default_Camera_EV_Index; 661 | v_Camera_Exposure_Index:=c_Default_Camera_Exposure_Index; 662 | v_Camera_Rotation_Index:=c_Default_Camera_Rotation_Index; 663 | 664 | //Settings tab additional 665 | v_Camera_Metering_Index:=c_Default_Camera_Metering_Index; 666 | v_Camera_ColorEffect_U_Index:=c_Default_Camera_ColorEffect_U_Index; 667 | v_Camera_ColorEffect_V_Index:=c_Default_Camera_ColorEffect_V_Index; 668 | v_Camera_ColorEffect_UV:=c_Default_Camera_ColorEffect_UV; 669 | 670 | v_Network_Port:=c_Default_Network_Port; 671 | v_Network_Duration:=c_Default_Network_Duration; 672 | end; 673 | 674 | {$REGION 'File IO'} 675 | 676 | function rpiSaveUserSettings(const FN:String):Boolean; 677 | var localText1:String; 678 | Resio:Integer; 679 | DataOut:TextFile; 680 | begin 681 | localText1:='User Setting File Saving Failed'; 682 | 683 | Result:=True; 684 | AssignFile(DataOut,FN); 685 | {$I-} Rewrite(DataOut); {$I+} 686 | Resio:=IOresult; 687 | if Resio=0 then 688 | begin 689 | try 690 | //application info 691 | 692 | Writeln(DataOut,'Application Title'); 693 | Writeln(DataOut,c_Application_Title); 694 | 695 | Writeln(DataOut,'User Language'); 696 | Writeln(DataOut,v_UserLanguage); 697 | 698 | Writeln(DataOut,'Application Theme'); 699 | Writeln(DataOut,v_ApplicationTheme); 700 | 701 | Writeln(DataOut,'User Selected Directory'); 702 | Writeln(DataOut,v_UserSelectedDirectory); 703 | 704 | //preview settings 705 | 706 | Writeln(DataOut,'Preview Position Index'); 707 | Writeln(DataOut,v_Preview_Position_Index); 708 | 709 | Writeln(DataOut,'Preview Size Index'); 710 | Writeln(DataOut,v_Preview_Size_Index); 711 | 712 | Writeln(DataOut,'Preview Show Preview'); 713 | if v_Preview_ShowPreview then 714 | begin 715 | Writeln(DataOut,1); 716 | end else 717 | begin 718 | Writeln(DataOut,-1); 719 | end; 720 | 721 | Writeln(DataOut,'Preview FullScreen'); 722 | if v_Preview_FullScreen then 723 | begin 724 | Writeln(DataOut,1); 725 | end else 726 | begin 727 | Writeln(DataOut,-1); 728 | end; 729 | 730 | //photo settings 731 | 732 | Writeln(DataOut,'Image Ext Index'); 733 | Writeln(DataOut,v_Image_Ext_Index); 734 | 735 | Writeln(DataOut,'Image Quality Index'); 736 | Writeln(DataOut,v_Image_Quality_Index); 737 | 738 | Writeln(DataOut,'Image Width Index'); 739 | Writeln(DataOut,v_Image_Size_Index); 740 | 741 | Writeln(DataOut,'Image Effect Index'); 742 | Writeln(DataOut,v_Image_Effect_Index); 743 | 744 | Writeln(DataOut,'Image Make Time Lapse'); 745 | if v_Image_MakeTimeLapse then 746 | begin 747 | Writeln(DataOut,1); 748 | end else 749 | begin 750 | Writeln(DataOut,-1); 751 | end; 752 | 753 | Writeln(DataOut,'Image Flip Horizontal'); 754 | if v_Image_Flip_Horizontal then 755 | begin 756 | Writeln(DataOut,1); 757 | end else 758 | begin 759 | Writeln(DataOut,-1); 760 | end; 761 | 762 | Writeln(DataOut,'Image Flip Vertical'); 763 | if v_Image_Flip_Vertical then 764 | begin 765 | Writeln(DataOut,1); 766 | end else 767 | begin 768 | Writeln(DataOut,-1); 769 | end; 770 | 771 | Writeln(DataOut,'Image Duration'); 772 | Writeln(DataOut,v_Image_Duration); 773 | 774 | Writeln(DataOut,'Image Delay'); 775 | Writeln(DataOut,v_Image_Delay); 776 | 777 | Writeln(DataOut,'Image RAW Output'); 778 | if v_Image_RAW_Output then 779 | begin 780 | Writeln(DataOut,1); 781 | end else 782 | begin 783 | Writeln(DataOut,-1); 784 | end; 785 | 786 | Writeln(DataOut,'Image ISO Output'); 787 | if v_Image_ISO_Output then 788 | begin 789 | Writeln(DataOut,1); 790 | end else 791 | begin 792 | Writeln(DataOut,-1); 793 | end; 794 | 795 | //video settings 796 | 797 | Writeln(DataOut,'Video Size Index'); 798 | Writeln(DataOut,v_Video_Size_Index); 799 | 800 | Writeln(DataOut,'Video Quality Index'); 801 | Writeln(DataOut,v_Video_Quality_Index); 802 | 803 | Writeln(DataOut,'Video FPS Index'); 804 | Writeln(DataOut,v_Video_FPS_Index); 805 | 806 | Writeln(DataOut,'Image Flip Vertical'); 807 | if v_VideoStabilation then 808 | begin 809 | Writeln(DataOut,1); 810 | end else 811 | begin 812 | Writeln(DataOut,-1); 813 | end; 814 | 815 | Writeln(DataOut,'Video Duration'); 816 | Writeln(DataOut,v_Video_Duration); 817 | 818 | // camera settings 819 | Writeln(DataOut,'Camera Brightness Index'); 820 | Writeln(DataOut,v_Camera_Brightness_Index); 821 | 822 | Writeln(DataOut,'Camera Contrast Index'); 823 | Writeln(DataOut,v_Camera_Contrast_Index); 824 | 825 | Writeln(DataOut,'Camera Sharpness Index'); 826 | Writeln(DataOut,v_Camera_Sharpness_Index); 827 | 828 | Writeln(DataOut,'Camera Saturation Index'); 829 | Writeln(DataOut,v_Camera_Saturation_Index); 830 | 831 | Writeln(DataOut,'Camera AWB Index'); 832 | Writeln(DataOut,v_Camera_AWB_Index); 833 | 834 | Writeln(DataOut,'Camera EV Index'); 835 | Writeln(DataOut,v_Camera_EV_Index); 836 | 837 | Writeln(DataOut,'Camera Exposure Index'); 838 | Writeln(DataOut,v_Camera_Exposure_Index); 839 | 840 | Writeln(DataOut,'Camera Rotation Index'); 841 | Writeln(DataOut,v_Camera_Rotation_Index); 842 | 843 | Writeln(DataOut,'Camera_Metering_Index'); 844 | Writeln(DataOut,v_Camera_Metering_Index); 845 | 846 | Writeln(DataOut,'Camera ColorEffect U_Index'); 847 | Writeln(DataOut,v_Camera_ColorEffect_U_Index); 848 | 849 | Writeln(DataOut,'Camera ColorEffect V_Index'); 850 | Writeln(DataOut,v_Camera_ColorEffect_V_Index); 851 | 852 | Writeln(DataOut,'Camera ColorEffectUV'); 853 | if v_Camera_ColorEffect_UV then 854 | begin 855 | Writeln(DataOut,1); 856 | end else 857 | begin 858 | Writeln(DataOut,-1); 859 | end; 860 | 861 | Writeln(DataOut,'Network Port'); 862 | Writeln(DataOut,v_Network_Port); 863 | 864 | Writeln(DataOut,'Network Duration'); 865 | Writeln(DataOut,v_Network_Duration); 866 | 867 | Writeln(DataOut,'IP Address'); 868 | Writeln(DataOut,v_Network_IPAddress); 869 | finally 870 | CloseFile(DataOut); 871 | end; 872 | end else 873 | begin 874 | MessageDlg(localText1, mtError,[mbOk], 0); 875 | Result:=False; 876 | end; 877 | end; 878 | 879 | function rpiLoadUserSettings(const FN:String):Boolean; 880 | var localText1:String; 881 | Resio,i:Integer; 882 | DataIn:TextFile; 883 | begin 884 | localText1:='User Setting File Loading Failed'; 885 | 886 | Result:=True; 887 | AssignFile(DataIn,FN); 888 | {$I-} ReSet(DataIn); {$I+} 889 | Resio:=IOresult; 890 | if Resio=0 then 891 | begin 892 | try 893 | Readln(DataIn); 894 | Readln(DataIn); 895 | 896 | Readln(DataIn); 897 | Readln(DataIn,v_UserLanguage); 898 | 899 | Readln(DataIn); 900 | Readln(DataIn,v_ApplicationTheme); 901 | 902 | ReadLn(DataIn); 903 | ReadLn(DataIn,v_UserSelectedDirectory); 904 | 905 | Readln(DataIn); 906 | Readln(DataIn,v_Preview_Position_Index); 907 | 908 | Readln(DataIn); 909 | Readln(DataIn,v_Preview_Size_Index); 910 | 911 | Readln(DataIn); 912 | Readln(DataIn,i); 913 | if i=1 then 914 | begin 915 | v_Preview_ShowPreview:=True; 916 | end else 917 | begin 918 | v_Preview_ShowPreview:=False; 919 | end; 920 | 921 | Readln(DataIn); 922 | Readln(DataIn,i); 923 | if i=1 then 924 | begin 925 | v_Preview_FullScreen:=True; 926 | end else 927 | begin 928 | v_Preview_FullScreen:=False; 929 | end; 930 | 931 | Readln(DataIn); 932 | Readln(DataIn,v_Image_Ext_Index); 933 | 934 | Readln(DataIn); 935 | Readln(DataIn,v_Image_Quality_Index); 936 | 937 | Readln(DataIn); 938 | Readln(DataIn,v_Image_Size_Index); 939 | 940 | Readln(DataIn); 941 | Readln(DataIn,v_Image_Effect_Index); 942 | 943 | Readln(DataIn); 944 | Readln(DataIn,i); 945 | if i=1 then 946 | begin 947 | v_Image_MakeTimeLapse:=True; 948 | end else 949 | begin 950 | v_Image_MakeTimeLapse:=False; 951 | end; 952 | 953 | Readln(DataIn); 954 | Readln(DataIn,i); 955 | if i=1 then 956 | begin 957 | v_Image_Flip_Horizontal:=True; 958 | end else 959 | begin 960 | v_Image_Flip_Horizontal:=False; 961 | end; 962 | 963 | Readln(DataIn); 964 | Readln(DataIn,i); 965 | if i=1 then 966 | begin 967 | v_Image_Flip_Vertical:=True; 968 | end else 969 | begin 970 | v_Image_Flip_Vertical:=False; 971 | end; 972 | 973 | Readln(DataIn); 974 | Readln(DataIn,v_Image_Duration); 975 | 976 | Readln(DataIn); 977 | Readln(DataIn,v_Image_Delay); 978 | 979 | Readln(DataIn); 980 | Readln(DataIn,i); 981 | if i=1 then 982 | begin 983 | v_Image_RAW_Output:=True; 984 | end else 985 | begin 986 | v_Image_RAW_Output:=False; 987 | end; 988 | 989 | Readln(DataIn); 990 | Readln(DataIn,i); 991 | if i=1 then 992 | begin 993 | v_Image_ISO_Output:=True; 994 | end else 995 | begin 996 | v_Image_ISO_Output:=False; 997 | end; 998 | 999 | Readln(DataIn); 1000 | Readln(DataIn,v_Video_Size_Index); 1001 | 1002 | Readln(DataIn); 1003 | Readln(DataIn,v_Video_Quality_Index); 1004 | 1005 | Readln(DataIn); 1006 | Readln(DataIn,v_Video_FPS_Index); 1007 | 1008 | Readln(DataIn); 1009 | Readln(DataIn,i); 1010 | if i=1 then 1011 | begin 1012 | v_VideoStabilation:=True; 1013 | end else 1014 | begin 1015 | v_VideoStabilation:=False; 1016 | end; 1017 | 1018 | Readln(DataIn); 1019 | Readln(DataIn,v_Video_Duration); 1020 | 1021 | Readln(DataIn); 1022 | Readln(DataIn,v_Camera_Brightness_Index); 1023 | 1024 | Readln(DataIn); 1025 | Readln(DataIn,v_Camera_Contrast_Index); 1026 | 1027 | Readln(DataIn); 1028 | Readln(DataIn,v_Camera_Sharpness_Index); 1029 | 1030 | Readln(DataIn); 1031 | Readln(DataIn,v_Camera_Saturation_Index); 1032 | 1033 | Readln(DataIn); 1034 | Readln(DataIn,v_Camera_AWB_Index); 1035 | 1036 | Readln(DataIn); 1037 | Readln(DataIn,v_Camera_EV_Index); 1038 | 1039 | Readln(DataIn); 1040 | Readln(DataIn,v_Camera_Exposure_Index); 1041 | 1042 | Readln(DataIn); 1043 | Readln(DataIn,v_Camera_Rotation_Index); 1044 | 1045 | Readln(DataIn); 1046 | Readln(DataIn,v_Camera_Metering_Index); 1047 | 1048 | Readln(DataIn); 1049 | Readln(DataIn,v_Camera_ColorEffect_U_Index); 1050 | 1051 | Readln(DataIn); 1052 | Readln(DataIn,v_Camera_ColorEffect_V_Index); 1053 | 1054 | Readln(DataIn); 1055 | Readln(DataIn,i); 1056 | if i=1 then 1057 | begin 1058 | v_Camera_ColorEffect_UV:=True; 1059 | end else 1060 | begin 1061 | v_Camera_ColorEffect_UV:=False; 1062 | end; 1063 | 1064 | Readln(DataIn); 1065 | Readln(DataIn,v_Network_Port); 1066 | 1067 | Readln(DataIn); 1068 | Readln(DataIn,v_Network_Duration); 1069 | 1070 | Readln(DataIn); 1071 | Readln(DataIn,v_Network_IPAddress); 1072 | finally 1073 | CloseFile(DataIn); 1074 | end; 1075 | end else 1076 | begin 1077 | MessageDlg(localText1, mtError,[mbOk], 0); 1078 | Result:=False; 1079 | end; 1080 | end; 1081 | 1082 | {$ENDREGION 'File IO'} 1083 | 1084 | procedure rpiClearPreviousCapturedImage; 1085 | var ImageFileName:String; 1086 | localText1:String; 1087 | begin 1088 | localText1:='Error'; 1089 | 1090 | try 1091 | ImageFileName:=AppURL+c_PictureDir+c_CapturedImageName+prm_ExtMap[0]; 1092 | if FileExists(ImageFileName) then 1093 | begin 1094 | DeleteFile(ImageFileName); 1095 | end; 1096 | ImageFileName:=AppURL+c_PictureDir+c_CapturedImageName+prm_ExtMap[1]; 1097 | if FileExists(ImageFileName) then 1098 | begin 1099 | DeleteFile(ImageFileName); 1100 | end; 1101 | ImageFileName:=AppURL+c_PictureDir+c_CapturedImageName+prm_ExtMap[2]; 1102 | if FileExists(ImageFileName) then 1103 | begin 1104 | DeleteFile(ImageFileName); 1105 | end; 1106 | except 1107 | on E: Exception do begin MessageDlg(localText1,localText1+': '+E.Message,mtError,[mbOk],0); end; 1108 | end; 1109 | end; 1110 | 1111 | function rpiGetCapturedPictureFileName:String; 1112 | var ImageFileName,ImageFileFound:String; 1113 | localText1:String; 1114 | begin 1115 | localText1:='Error'; 1116 | 1117 | try 1118 | ImageFileFound:=''; 1119 | 1120 | ImageFileName:=AppURL+c_PictureDir+c_CapturedImageName+prm_ExtMap[0]; 1121 | if FileExists(ImageFileName) then begin ImageFileFound:=ImageFileName; end; 1122 | 1123 | ImageFileName:=AppURL+c_PictureDir+c_CapturedImageName+prm_ExtMap[1]; 1124 | if FileExists(ImageFileName) then begin ImageFileFound:=ImageFileName; end; 1125 | 1126 | ImageFileName:=AppURL+c_PictureDir+c_CapturedImageName+prm_ExtMap[2]; 1127 | if FileExists(ImageFileName) then begin ImageFileFound:=ImageFileName; end; 1128 | 1129 | ImageFileName:=AppURL+c_PictureDir+c_CapturedImageName+prm_ExtMap[3]; 1130 | if FileExists(ImageFileName) then begin ImageFileFound:=ImageFileName; end; 1131 | 1132 | result:=ImageFileFound; 1133 | except 1134 | on E: Exception do begin MessageDlg(localText1,localText1+': '+E.Message,mtError,[mbOk],0); end; 1135 | end; 1136 | end; 1137 | 1138 | function rpiGetCapturedVideoFileName:String; 1139 | var VideoFileName,VideoFileFound:String; 1140 | localText1:String; 1141 | begin 1142 | localText1:='Error'; 1143 | try 1144 | VideoFileFound:=''; 1145 | 1146 | VideoFileName:=AppURL+c_VideoDir+c_CapturedVideoName+c_VideoExt; 1147 | if FileExists(VideoFileName) then begin VideoFileFound:=VideoFileName; end; 1148 | 1149 | result:=VideoFileFound; 1150 | except 1151 | on E: Exception do begin MessageDlg(localText1,localText1+': '+E.Message,mtError,[mbOk],0); end; 1152 | end; 1153 | end; 1154 | 1155 | {$ENDREGION 'Support'} 1156 | 1157 | {$REGION 'Main'} 1158 | 1159 | function rpiSetCaptureModeSC(SC:String):String; 1160 | begin 1161 | //capture app 1162 | case v_CaptureMode_Index of 1163 | 1:begin //=image 1164 | SC:=cmd_rpiPhotoCamera; 1165 | end; 1166 | 2:begin //=imageYUV 1167 | SC:=cmd_rpiPhotoCameraYUV; 1168 | end; 1169 | 3:begin //=Video 1170 | SC:=cmd_rpiVideoCamera; 1171 | end; 1172 | 4:begin //=Video network stream 1173 | SC:=cmd_rpiVideoCamera; 1174 | end; 1175 | end; 1176 | Result:=SC; 1177 | end; 1178 | 1179 | function rpiSetPreviewModeSC(SC:String):String; 1180 | begin 1181 | //preview window size 1182 | rpiExtractWidthHeightValuesFromString(prm_PreviewWindowSizeMap[v_Preview_Size_Index],v_Preview_Width,v_Preview_Height); 1183 | //preview window position 1184 | rpiSetPreviewWindowPosition; 1185 | 1186 | case v_PreviewMode_Index of 1187 | 1:begin //=show 1188 | SC:=SC+c_Space+cmd_Preview; 1189 | SC:=SC+c_Space+IntToStr(v_Preview_Window_Position_X)+c_Comma; 1190 | SC:=SC+IntToStr(v_Preview_Window_Position_Y)+c_Comma; 1191 | SC:=SC+IntToStr(v_Preview_Width)+c_Comma; 1192 | SC:=SC+IntToStr(v_Preview_Height); 1193 | end; 1194 | 2:begin //=full screen 1195 | SC:=SC+c_Space+cmd_Fullscreen; 1196 | end; 1197 | 3:begin //=no preview 1198 | SC:=SC+c_Space+cmd_NoPreview; 1199 | end; 1200 | end; 1201 | Result:=SC; 1202 | end; 1203 | 1204 | {$REGION 'Image'} 1205 | 1206 | function rpiSetImageDurationSC(SC:String):String; 1207 | begin 1208 | Result:=SC+c_Space+cmd_Image_Timeout+c_Space+IntToStr(v_Image_Duration); 1209 | end; 1210 | 1211 | function rpiSetImageOutputSC(SC:String):String; 1212 | begin 1213 | if v_Preview_PreviewTest then // preview only no image save 1214 | begin 1215 | v_Preview_PreviewTest:=False; 1216 | Result:=SC; 1217 | exit; 1218 | end; 1219 | if v_Image_MakeTimeLapse then 1220 | begin 1221 | SC:=SC+c_Space+cmd_Image_Timelapse+c_Space+IntToStr(v_Image_Delay); 1222 | SC:=SC+c_Space+cmd_Image_Output+c_Space+v_UserSelectedDirectory+c_TimeLapsCapturedImageName+prm_ExtMap[v_Image_Ext_Index]; 1223 | end else 1224 | begin 1225 | SC:=SC+c_Space+cmd_Image_Output+c_Space+AppURL+c_PictureDir+c_CapturedImageName+prm_ExtMap[v_Image_Ext_Index]; 1226 | end; 1227 | Result:=SC; 1228 | end; 1229 | 1230 | function rpiSetImageEncodingSC(SC:String):String; 1231 | var s:String; 1232 | begin 1233 | s:=prm_ExtMap[v_Image_Ext_Index]; 1234 | Delete(s,1,1); //remove the dot from the file ext. e.g. '.jpg' becomes 'jpg' 1235 | Result:=SC+c_Space+cmd_Image_Encoding+c_Space+s; 1236 | end; 1237 | 1238 | function rpiSetJPGImageQualityStandardsSC(SC:String):String; 1239 | begin 1240 | if v_Image_Ext_Index=c_Default_Image_Ext_Index then //.jpg 1241 | begin 1242 | SC:=SC+c_Space+cmd_Image_Quality+c_Space+prm_JPG_QualityMap[v_Image_Quality_Index]; 1243 | if v_Image_RAW_Output then // RAW 1244 | begin 1245 | SC:=SC+c_Space+cmd_Image_RAW; 1246 | end; 1247 | if v_Image_ISO_Output then //ISO 1248 | begin 1249 | SC:=SC+c_Space+cmd_ISO; 1250 | end; 1251 | end; 1252 | Result:=SC; 1253 | end; 1254 | 1255 | function rpiSetImageSizeSC(SC:String):String; 1256 | begin 1257 | rpiExtractWidthHeightValuesFromString(prm_ImageSizeMap[v_Image_Size_Index],v_Image_Width,v_Image_Height); 1258 | Result:=SC+c_Space+cmd_Image_Width+c_Space+IntToStr(v_Image_Width)+c_Space+cmd_Image_Height+c_Space+IntToStr(v_Image_Height); 1259 | end; 1260 | 1261 | function rpiSetImageEffectSC(SC:String):String; 1262 | begin 1263 | Result:=SC+c_Space+cmd_Imxfx+c_Space+prm_ImxfxMap[v_Image_Effect_Index]; 1264 | end; 1265 | 1266 | function rpiSetImageFlipSC(SC:String):String; 1267 | begin 1268 | if v_Image_Flip_Horizontal then 1269 | begin 1270 | SC:=SC+c_Space+cmd_Hflip; 1271 | end; 1272 | if v_Image_Flip_Vertical then 1273 | begin 1274 | SC:=SC+c_Space+cmd_Vflip; 1275 | end; 1276 | Result:=SC; 1277 | end; 1278 | 1279 | {$ENDREGION 'Image'} 1280 | 1281 | {$REGION 'Video'} 1282 | 1283 | function rpiSetVideoDurationSC(SC:String):String; 1284 | begin 1285 | if v_CaptureMode_Index=4 then 1286 | begin 1287 | SC:=SC+c_Space+cmd_Video_Timeout+c_Space+IntToStr(v_Network_Duration); 1288 | end else 1289 | begin 1290 | SC:=SC+c_Space+cmd_Video_Timeout+c_Space+IntToStr(v_Video_Duration); 1291 | end; 1292 | Result:=SC 1293 | end; 1294 | 1295 | function rpiSetVideoOutputSC(SC:String):String; 1296 | begin 1297 | if v_CaptureMode_Index=4 then 1298 | begin 1299 | SC:=SC+c_Space+cmd_Video_Output+c_Space+cmd_NetworkStream+c_Space+'['+IntToStr(v_Network_IPAddress)+']'+c_Space+IntToStr(v_Network_Port); 1300 | end else 1301 | begin 1302 | SC:=SC+c_Space+cmd_Video_Output+c_Space+AppURL+c_VideoDir+c_CapturedVideoName+c_VideoExt; 1303 | end; 1304 | Result:=SC; 1305 | end; 1306 | 1307 | function rpiSetVideoSizeSC(SC:String):String; 1308 | begin 1309 | rpiExtractWidthHeightValuesFromString(prm_VideoSizeMap[v_Video_Size_Index],v_Video_Width,v_Video_Height); 1310 | Result:=SC+c_Space+cmd_Video_Width+c_Space+IntToStr(v_Video_Width)+c_Space+cmd_Video_Height+c_Space+IntToStr(v_Video_Height); 1311 | end; 1312 | 1313 | function rpiSetVideoFPSSC(SC:String):String; 1314 | begin 1315 | Result:=SC+c_Space+cmd_Video_FrameRate+c_Space+prm_VideoFPSMap[v_Video_FPS_Index]; 1316 | end; 1317 | 1318 | function rpiSetVideoBitRateSC(SC:String):String; 1319 | const VideoFactor=0.096450617;//at max quality bitrate should be 30Mbs for HD video at 30 fps 1320 | var BitRate:Real; 1321 | VideoQualityLevel:Integer; 1322 | begin 1323 | //Bitrate calculation example: 1324 | //1920 x 1080 = 2,073,600 pixel count 1325 | //30 frames per second 1326 | //5 = High Motion = VideoQualityLevel 1327 | //videofactor = 0.096450617 1328 | //(2,073,600 x 30) x 5 x 0.096450617 = 30,000,000 bps / 1000 = 30,000 kbps bitrate / 1000 = 30 Mbps bitrate 1329 | case v_Video_Quality_Index of 1330 | 0:begin VideoQualityLevel:=1; end; //very low 1331 | 1:begin VideoQualityLevel:=2; end; //low 1332 | 2:begin VideoQualityLevel:=3; end; //high 1333 | 3:begin VideoQualityLevel:=4; end; //very high 1334 | 4:begin VideoQualityLevel:=5; end; //max 1335 | end; 1336 | 1337 | BitRate:=(v_Video_Width*v_Video_Height) * StrToInt(prm_VideoFPSMap[v_Video_FPS_Index]) * VideoQualityLevel * VideoFactor; 1338 | 1339 | Result:=SC+c_Space+cmd_Video_BitRate+c_Space+IntToStr(Round(BitRate)); 1340 | end; 1341 | 1342 | function rpiSetVideoStabilizationSC(SC:String):String; 1343 | begin 1344 | if v_VideoStabilation then 1345 | begin 1346 | SC:=SC+c_Space+cmd_Vstab; 1347 | end; 1348 | Result:=SC; 1349 | end; 1350 | 1351 | {$ENDREGION 'Video'} 1352 | 1353 | {$REGION 'Camera'} 1354 | 1355 | function rpiSetCameraBrightnessSC(SC:String):String; 1356 | var Level:Integer; 1357 | begin 1358 | case v_Camera_Brightness_Index of {0 - 100} 1359 | 0:begin Level:=100; end;//Max 1360 | 1:begin Level:=88; end;//Very High 1361 | 2:begin Level:=64; end;//High 1362 | 3:begin Level:=50; end;//Default 1363 | 4:begin Level:=32; end;//Low 1364 | 5:begin Level:=-18; end;//Very Low 1365 | 6:begin Level:=0; end;//Min 1366 | end; 1367 | Result:=SC+c_Space+cmd_Brightness+c_Space+IntToStr(Level); 1368 | end; 1369 | 1370 | function rpiSetCameraContrastSC(SC:String):String; 1371 | var Level:Integer; 1372 | begin 1373 | case v_Camera_Contrast_Index of {-100 - 100} 1374 | 0:begin Level:=100; end;//Max 1375 | 1:begin Level:=64; end;//Very High 1376 | 2:begin Level:=32; end;//High 1377 | 3:begin Level:=0; end;//Default 1378 | 4:begin Level:=-32; end;//Low 1379 | 5:begin Level:=-64; end;//Very Low 1380 | 6:begin Level:=-100; end;//Min 1381 | end; 1382 | Result:=SC+c_Space+cmd_Contrast+c_Space+IntToStr(Level); 1383 | end; 1384 | 1385 | function rpiSetCameraSharpnessSC(SC:String):String; 1386 | var Level:Integer; 1387 | begin 1388 | case v_Camera_Sharpness_Index of {-100 - 100} 1389 | 0:begin Level:=100; end;//Max 1390 | 1:begin Level:=64; end;//Very High 1391 | 2:begin Level:=32; end;//High 1392 | 3:begin Level:=0; end;//Default 1393 | 4:begin Level:=-32; end;//Low 1394 | 5:begin Level:=-64; end;//Very Low 1395 | 6:begin Level:=-100; end;//Min 1396 | end; 1397 | Result:=SC+c_Space+cmd_Sharpness+c_Space+IntToStr(Level); 1398 | end; 1399 | 1400 | function rpiSetCameraSaturationSC(SC:String):String; 1401 | var Level:Integer; 1402 | begin 1403 | case v_Camera_Saturation_Index of {-100 - 100} 1404 | 0:begin Level:=100; end;//Max 1405 | 1:begin Level:=64; end;//Very High 1406 | 2:begin Level:=32; end;//High 1407 | 3:begin Level:=0; end;//Default 1408 | 4:begin Level:=-32; end;//Low 1409 | 5:begin Level:=-64; end;//Very Low 1410 | 6:begin Level:=-100; end;//Min 1411 | end; 1412 | Result:=SC+c_Space+cmd_Saturation+c_Space+IntToStr(Level); 1413 | end; 1414 | 1415 | function rpiSetCameraAWBSC(SC:String):String; 1416 | begin 1417 | Result:=SC+c_Space+cmd_Awb+c_Space+prm_AwbMap[v_Camera_AWB_Index]; 1418 | end; 1419 | 1420 | function rpiSetCameraEVCompSC(SC:String):String; 1421 | var Level:Integer; 1422 | begin 1423 | case v_Camera_EV_Index of {-10 - 10} 1424 | 0:begin Level:=10; end;//Max 1425 | 1:begin Level:=8; end;//Very High 1426 | 2:begin Level:=6; end;//High 1427 | 3:begin Level:=5; end;//Default 1428 | 4:begin Level:=-6; end;//Low 1429 | 5:begin Level:=-8; end;//Very Low 1430 | 6:begin Level:=-10; end;//Min 1431 | end; 1432 | Result:=SC+c_Space+cmd_EV+c_Space+IntToStr(Level); 1433 | end; 1434 | 1435 | function rpiSetCameraExposureSC(SC:String):String; 1436 | begin 1437 | Result:=SC+c_Space+cmd_Exposure+c_Space+prm_ExposureMap[v_Camera_Exposure_Index]; 1438 | end; 1439 | 1440 | function rpiSetCameraRotationSC(SC:String):String; 1441 | begin 1442 | Result:=SC+c_Space+cmd_Rotation+c_Space+prm_RotationMap[v_Camera_Rotation_Index]; 1443 | end; 1444 | 1445 | function rpiSetCameraMeteringSC(SC:String):String; 1446 | begin 1447 | Result:=SC+c_Space+cmd_Metering+c_Space+prm_MeteringMap[v_Camera_Metering_Index]; 1448 | end; 1449 | 1450 | function rpiSetCameraUVSC(SC:String):String; 1451 | var LevelU,LevelV:Integer; 1452 | begin 1453 | case v_Camera_ColorEffect_U_Index of {255 - 0} 1454 | 0:begin LevelU:=255; end;//Max 1455 | 1:begin LevelU:=196; end;//Very High 1456 | 2:begin LevelU:=168; end;//High 1457 | 3:begin LevelU:=128; end;//Default 1458 | 4:begin LevelU:=64; end;//Low 1459 | 5:begin LevelU:=32; end;//Very Low 1460 | 6:begin LevelU:=0; end;//Min 1461 | end; 1462 | SC:=SC+c_Space+cmd_Colfx+c_Space+IntToStr(LevelU); 1463 | SC:=SC+c_DoublePoint; 1464 | case v_Camera_ColorEffect_V_Index of {255 - 0} 1465 | 0:begin LevelV:=255; end;//Max 1466 | 1:begin LevelV:=196; end;//Very High 1467 | 2:begin LevelV:=168; end;//High 1468 | 3:begin LevelV:=128; end;//Default 1469 | 4:begin LevelV:=64; end;//Low 1470 | 5:begin LevelV:=32; end;//Very Low 1471 | 6:begin LevelV:=0; end;//Min 1472 | end; 1473 | Result:=SC+IntToStr(LevelV); 1474 | end; 1475 | 1476 | {$ENDREGION 'Camera'} 1477 | 1478 | function rpiSetImageORVideoSC(SC:String):String; 1479 | begin 1480 | //image or video 1481 | case v_CaptureMode_Index of 1482 | 1:begin //=image/ 1483 | SC:=rpiSetImageDurationSC(SC); 1484 | SC:=rpiSetImageOutputSC(SC); 1485 | SC:=rpiSetImageEncodingSC(SC); 1486 | SC:=rpiSetJPGImageQualityStandardsSC(SC); 1487 | SC:=rpiSetImageSizeSC(SC); 1488 | SC:=rpiSetImageEffectSC(SC); 1489 | SC:=rpiSetImageFlipSC(SC); 1490 | end; 1491 | 2:begin //=imageYUV 1492 | SC:=rpiSetImageDurationSC(SC); 1493 | SC:=rpiSetImageOutputSC(SC); 1494 | SC:=rpiSetImageSizeSC(SC); 1495 | SC:=rpiSetImageEffectSC(SC); 1496 | SC:=rpiSetImageFlipSC(SC); 1497 | end; 1498 | 3,4:begin //=Video and Video Network stream 1499 | SC:=rpiSetVideoDurationSC(SC); 1500 | SC:=rpiSetVideoOutputSC(SC); 1501 | SC:=rpiSetVideoSizeSC(SC); 1502 | SC:=rpiSetVideoFPSSC(SC); 1503 | SC:=rpiSetVideoBitRateSC(SC); 1504 | SC:=rpiSetVideoStabilizationSC(SC); 1505 | end; 1506 | end; 1507 | SC:=SC+c_Space+cmd_Image_Verbose; //debug output 1508 | 1509 | Result:=SC; 1510 | end; 1511 | 1512 | function rpiSetCameraSettingsSC(SC:String):String; 1513 | begin 1514 | SC:=rpiSetCameraBrightnessSC(SC); 1515 | SC:=rpiSetCameraContrastSC(SC); 1516 | SC:=rpiSetCameraSharpnessSC(SC); 1517 | SC:=rpiSetCameraSaturationSC(SC); 1518 | SC:=rpiSetCameraAWBSC(SC); 1519 | SC:=rpiSetCameraEVCompSC(SC); 1520 | SC:=rpiSetCameraExposureSC(SC); 1521 | SC:=rpiSetCameraRotationSC(SC); 1522 | SC:=rpiSetCameraMeteringSC(SC); 1523 | if v_Camera_ColorEffect_UV then 1524 | begin 1525 | SC:=rpiSetCameraUVSC(SC); 1526 | end; 1527 | Result:=SC; 1528 | end; 1529 | 1530 | function rpiGetStackedCommand:String; 1531 | var StackedCommand:String; 1532 | begin 1533 | StackedCommand:=''; //initialize 1534 | StackedCommand:=rpiSetCaptureModeSC(StackedCommand); 1535 | StackedCommand:=rpiSetPreviewModeSC(StackedCommand); 1536 | StackedCommand:=rpiSetImageORVideoSC(StackedCommand); 1537 | StackedCommand:=rpiSetCameraSettingsSC(StackedCommand); 1538 | 1539 | Result:=StackedCommand; 1540 | //showmessage(Result); 1541 | end; 1542 | 1543 | function rpiExcecuteLocalProcessSudo(const sudoPass,cmdToExcecute:String; const UseSudo:Boolean; StatusMemo,MessagesMemo:TMemo):Boolean; 1544 | var lProcess: TProcess; 1545 | begin 1546 | Result:=False; 1547 | 1548 | {$IFDEF LINUX} 1549 | try 1550 | lProcess := TProcess.Create(nil); 1551 | lProcess.Executable := '/bin/sh'; 1552 | lProcess.Parameters.Add('-c'); 1553 | if UseSudo then 1554 | begin 1555 | lProcess.Parameters.add('echo'+sudoPass+' | sudo -S '+cmdToExcecute); 1556 | end else 1557 | begin 1558 | lProcess.Parameters.add(cmdToExcecute); 1559 | end; 1560 | 1561 | lProcess.Options := lProcess.Options + [poWaitOnExit, poUsePipes]; 1562 | lProcess.Execute; 1563 | while lProcess.Running do begin Sleep(12); end; 1564 | 1565 | StatusMemo.Lines.LoadFromStream(lProcess.Output);// Output 1566 | MessagesMemo.Lines.LoadFromStream(lProcess.Stderr);// Error 1567 | 1568 | if not (lProcess.Active = true) or (lProcess.Running = true) then 1569 | begin 1570 | MessagesMemo.SelStart := Length(StatusMemo.Text); //set Statusmemo 2 text position 1571 | end; 1572 | 1573 | Result:=True; 1574 | finally 1575 | lProcess.Free; 1576 | end; 1577 | {$ENDIF} 1578 | 1579 | StatusMemo.Lines.Add(''); //intentional blank line 1580 | StatusMemo.Lines.Add('Employed Command: $ '+cmdToExcecute); 1581 | StatusMemo.SelStart := Length(StatusMemo.Text); //set Statusmemo 1 text position 1582 | end; 1583 | 1584 | {$ENDREGION 'Main'} 1585 | 1586 | end. 1587 | 1588 | -------------------------------------------------------------------------------- /source/backup/rpiccmainform.pas.bak: -------------------------------------------------------------------------------- 1 | { 2 | This file (rpiCCMainForm) is part of Pi Vision. 3 | 4 | What is Pi Vision? 5 | 6 | Pi Vision is a Graphics User Interface for the Raspberry Pi Camera. 7 | It allows you to controll the camera functions throught the camera's 8 | native apps. It also displays the terminal commands sent. 9 | 10 | Copyright 11 | 12 | Pi Vision Copyright 2013 B.J.Rao. All Rights Reserved. 13 | 14 | This program is free software; you can redistribute it and/or 15 | modify it under the terms of the GNU General Public License version 2 16 | as published by the Free Software Foundation. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program; if not, write to the Free Software 25 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | 27 | Attributions 28 | 29 | videopageimage.jpg: 30 | Under the CC BY-NC "Fir0002/Flagstaffotos" http://www.flagstaffotos.com.au/ 31 | 32 | infopageimage.jpg: 33 | Under the CC BY-NC B.J.Rao 34 | 35 | mainpageimage.jpg: 36 | Under the CC BY-NC B.J.Rao 37 | 38 | Trademarks 39 | 40 | All trademarks are the property of their respective owners 41 | - Raspberry Pi is a trademark owned by the Raspberry Pi Foundation 42 | 43 | Disclaimer 44 | 45 | Provider=B.J.Rao 46 | 47 | IN NO EVENT SHALL Provider BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 48 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, 49 | ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 50 | REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51 | 52 | Provider SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED 53 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 54 | PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED 55 | HEREUNDER IS PROVIDED "AS IS". Provider HAS NO OBLIGATION TO PROVIDE 56 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS 57 | 58 | } 59 | 60 | unit rpiCCMainForm; 61 | 62 | {$mode objfpc}{$H+} 63 | 64 | interface 65 | 66 | uses 67 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 68 | StdCtrls, ExtCtrls, ExtDlgs; 69 | 70 | type 71 | 72 | { TMainForm } 73 | 74 | TMainForm = class(TForm) 75 | Button1: TButton; 76 | Button10: TButton; 77 | Button11: TButton; 78 | Button12: TButton; 79 | Button13: TButton; 80 | Button14: TButton; 81 | Button15: TButton; 82 | Button16: TButton; 83 | Button17: TButton; 84 | Button18: TButton; 85 | Button19: TButton; 86 | Button2: TButton; 87 | Button3: TButton; 88 | Button4: TButton; 89 | Button5: TButton; 90 | Button6: TButton; 91 | Button7: TButton; 92 | Button8: TButton; 93 | Button9: TButton; 94 | CheckBox1: TCheckBox; 95 | CheckBox10: TCheckBox; 96 | CheckBox2: TCheckBox; 97 | CheckBox3: TCheckBox; 98 | CheckBox4: TCheckBox; 99 | CheckBox5: TCheckBox; 100 | CheckBox6: TCheckBox; 101 | CheckBox7: TCheckBox; 102 | CheckBox8: TCheckBox; 103 | CheckBox9: TCheckBox; 104 | ComboBox1: TComboBox; 105 | ComboBox10: TComboBox; 106 | ComboBox11: TComboBox; 107 | ComboBox12: TComboBox; 108 | ComboBox13: TComboBox; 109 | ComboBox14: TComboBox; 110 | ComboBox15: TComboBox; 111 | ComboBox16: TComboBox; 112 | ComboBox17: TComboBox; 113 | ComboBox18: TComboBox; 114 | ComboBox19: TComboBox; 115 | ComboBox2: TComboBox; 116 | ComboBox20: TComboBox; 117 | ComboBox3: TComboBox; 118 | ComboBox4: TComboBox; 119 | ComboBox5: TComboBox; 120 | ComboBox6: TComboBox; 121 | ComboBox7: TComboBox; 122 | ComboBox8: TComboBox; 123 | ComboBox9: TComboBox; 124 | Edit1: TEdit; 125 | Edit2: TEdit; 126 | Edit3: TEdit; 127 | Edit4: TEdit; 128 | Edit5: TEdit; 129 | Edit6: TEdit; 130 | Image1: TImage; 131 | Image2: TImage; 132 | Image3: TImage; 133 | Image4: TImage; 134 | Label1: TLabel; 135 | Label10: TLabel; 136 | Label11: TLabel; 137 | Label12: TLabel; 138 | Label13: TLabel; 139 | Label14: TLabel; 140 | Label15: TLabel; 141 | Label16: TLabel; 142 | Label17: TLabel; 143 | Label18: TLabel; 144 | Label19: TLabel; 145 | Label2: TLabel; 146 | Label20: TLabel; 147 | Label21: TLabel; 148 | Label22: TLabel; 149 | Label23: TLabel; 150 | Label24: TLabel; 151 | Label25: TLabel; 152 | Label26: TLabel; 153 | Label27: TLabel; 154 | Label28: TLabel; 155 | Label29: TLabel; 156 | Label3: TLabel; 157 | Label30: TLabel; 158 | Label31: TLabel; 159 | Label32: TLabel; 160 | Label33: TLabel; 161 | Label34: TLabel; 162 | Label35: TLabel; 163 | Label36: TLabel; 164 | Label4: TLabel; 165 | Label5: TLabel; 166 | Label6: TLabel; 167 | Label7: TLabel; 168 | Label8: TLabel; 169 | Label9: TLabel; 170 | Memo1: TMemo; 171 | Memo2: TMemo; 172 | Memo3: TMemo; 173 | Memo4: TMemo; 174 | PageControl1: TPageControl; 175 | PageControl2: TPageControl; 176 | Panel1: TPanel; 177 | Panel10: TPanel; 178 | Panel2: TPanel; 179 | Panel3: TPanel; 180 | Panel4: TPanel; 181 | Panel5: TPanel; 182 | Panel6: TPanel; 183 | Panel7: TPanel; 184 | Panel8: TPanel; 185 | Panel9: TPanel; 186 | SaveDialog1: TSaveDialog; 187 | SavePictureDialog1: TSavePictureDialog; 188 | SelectDirectoryDialog1: TSelectDirectoryDialog; 189 | TabSheet1: TTabSheet; 190 | TabSheet2: TTabSheet; 191 | TabSheet3: TTabSheet; 192 | TabSheet4: TTabSheet; 193 | TabSheet5: TTabSheet; 194 | TabSheet6: TTabSheet; 195 | TabSheet7: TTabSheet; 196 | TabSheet8: TTabSheet; 197 | TabSheet9: TTabSheet; 198 | procedure Button10Click(Sender: TObject); 199 | procedure Button10MouseEnter(Sender: TObject); 200 | procedure Button11Click(Sender: TObject); 201 | procedure Button11MouseEnter(Sender: TObject); 202 | procedure Button12Click(Sender: TObject); 203 | procedure Button12MouseEnter(Sender: TObject); 204 | procedure Button13Click(Sender: TObject); 205 | procedure Button13MouseEnter(Sender: TObject); 206 | procedure Button14Click(Sender: TObject); 207 | procedure Button14MouseEnter(Sender: TObject); 208 | procedure Button16Click(Sender: TObject); 209 | procedure Button16MouseEnter(Sender: TObject); 210 | procedure Button17Click(Sender: TObject); 211 | procedure Button17MouseEnter(Sender: TObject); 212 | procedure Button18Click(Sender: TObject); 213 | procedure Button18MouseEnter(Sender: TObject); 214 | procedure Button1Click(Sender: TObject); 215 | procedure Button1MouseEnter(Sender: TObject); 216 | procedure Button2Click(Sender: TObject); 217 | procedure Button2MouseEnter(Sender: TObject); 218 | procedure Button2MouseLeave(Sender: TObject); 219 | procedure Button3Click(Sender: TObject); 220 | procedure Button3MouseEnter(Sender: TObject); 221 | procedure Button4Click(Sender: TObject); 222 | procedure Button4MouseEnter(Sender: TObject); 223 | procedure Button5Click(Sender: TObject); 224 | procedure Button5MouseEnter(Sender: TObject); 225 | procedure Button6Click(Sender: TObject); 226 | procedure Button6MouseEnter(Sender: TObject); 227 | procedure Button7Click(Sender: TObject); 228 | procedure Button7MouseEnter(Sender: TObject); 229 | procedure Button8Click(Sender: TObject); 230 | procedure Button8MouseEnter(Sender: TObject); 231 | procedure Button9Click(Sender: TObject); 232 | procedure Button9MouseEnter(Sender: TObject); 233 | procedure CheckBox10Change(Sender: TObject); 234 | procedure CheckBox10MouseEnter(Sender: TObject); 235 | procedure CheckBox1MouseEnter(Sender: TObject); 236 | procedure CheckBox2MouseEnter(Sender: TObject); 237 | procedure CheckBox3MouseEnter(Sender: TObject); 238 | procedure CheckBox4MouseEnter(Sender: TObject); 239 | procedure CheckBox5MouseEnter(Sender: TObject); 240 | procedure CheckBox6MouseEnter(Sender: TObject); 241 | procedure CheckBox7MouseEnter(Sender: TObject); 242 | procedure CheckBox8MouseEnter(Sender: TObject); 243 | procedure CheckBox9Change(Sender: TObject); 244 | procedure CheckBox9MouseEnter(Sender: TObject); 245 | procedure ComboBox10Change(Sender: TObject); 246 | procedure ComboBox10MouseEnter(Sender: TObject); 247 | procedure ComboBox11Change(Sender: TObject); 248 | procedure ComboBox11MouseEnter(Sender: TObject); 249 | procedure ComboBox12Change(Sender: TObject); 250 | procedure ComboBox12MouseEnter(Sender: TObject); 251 | procedure ComboBox13Change(Sender: TObject); 252 | procedure ComboBox13MouseEnter(Sender: TObject); 253 | procedure ComboBox14Change(Sender: TObject); 254 | procedure ComboBox14MouseEnter(Sender: TObject); 255 | procedure ComboBox15Change(Sender: TObject); 256 | procedure ComboBox15MouseEnter(Sender: TObject); 257 | procedure ComboBox16Change(Sender: TObject); 258 | procedure ComboBox16MouseEnter(Sender: TObject); 259 | procedure ComboBox17Change(Sender: TObject); 260 | procedure ComboBox17MouseEnter(Sender: TObject); 261 | procedure ComboBox18Change(Sender: TObject); 262 | procedure ComboBox18MouseEnter(Sender: TObject); 263 | procedure ComboBox19Change(Sender: TObject); 264 | procedure ComboBox19MouseEnter(Sender: TObject); 265 | procedure ComboBox1Change(Sender: TObject); 266 | procedure ComboBox1MouseEnter(Sender: TObject); 267 | procedure ComboBox20Change(Sender: TObject); 268 | procedure ComboBox20MouseEnter(Sender: TObject); 269 | procedure ComboBox2Change(Sender: TObject); 270 | procedure ComboBox2MouseEnter(Sender: TObject); 271 | procedure ComboBox3Change(Sender: TObject); 272 | procedure ComboBox3MouseEnter(Sender: TObject); 273 | procedure ComboBox4Change(Sender: TObject); 274 | procedure ComboBox4MouseEnter(Sender: TObject); 275 | procedure ComboBox5Change(Sender: TObject); 276 | procedure ComboBox5MouseEnter(Sender: TObject); 277 | procedure ComboBox6Change(Sender: TObject); 278 | procedure ComboBox6MouseEnter(Sender: TObject); 279 | procedure ComboBox7Change(Sender: TObject); 280 | procedure ComboBox7MouseEnter(Sender: TObject); 281 | procedure ComboBox8Change(Sender: TObject); 282 | procedure ComboBox8MouseEnter(Sender: TObject); 283 | procedure ComboBox9Change(Sender: TObject); 284 | procedure ComboBox9MouseEnter(Sender: TObject); 285 | procedure Edit1Exit(Sender: TObject); 286 | procedure Edit1KeyPress(Sender: TObject; var Key: char); 287 | procedure Edit1MouseEnter(Sender: TObject); 288 | procedure Edit2Exit(Sender: TObject); 289 | procedure Edit2KeyPress(Sender: TObject; var Key: char); 290 | procedure Edit2MouseEnter(Sender: TObject); 291 | procedure Edit3Exit(Sender: TObject); 292 | procedure Edit3KeyPress(Sender: TObject; var Key: char); 293 | procedure Edit3MouseEnter(Sender: TObject); 294 | procedure Edit4Exit(Sender: TObject); 295 | procedure Edit4KeyPress(Sender: TObject; var Key: char); 296 | procedure Edit4MouseEnter(Sender: TObject); 297 | procedure Edit5Exit(Sender: TObject); 298 | procedure Edit5KeyPress(Sender: TObject; var Key: char); 299 | procedure Edit5MouseEnter(Sender: TObject); 300 | procedure Edit6Exit(Sender: TObject); 301 | procedure Edit6KeyPress(Sender: TObject; var Key: char); 302 | procedure Edit6MouseEnter(Sender: TObject); 303 | procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 304 | procedure FormCreate(Sender: TObject); 305 | procedure FormShow(Sender: TObject); 306 | procedure Image2Click(Sender: TObject); 307 | procedure Image2MouseEnter(Sender: TObject); 308 | procedure Label10Click(Sender: TObject); 309 | procedure Label11Click(Sender: TObject); 310 | procedure Label12Click(Sender: TObject); 311 | procedure Label15Click(Sender: TObject); 312 | procedure Label16Click(Sender: TObject); 313 | procedure Label17Click(Sender: TObject); 314 | procedure Label18Click(Sender: TObject); 315 | procedure Label19Click(Sender: TObject); 316 | procedure Label20Click(Sender: TObject); 317 | procedure Label21Click(Sender: TObject); 318 | procedure Label22Click(Sender: TObject); 319 | procedure Label23Click(Sender: TObject); 320 | procedure Label24Click(Sender: TObject); 321 | procedure Label26Click(Sender: TObject); 322 | procedure Label27Click(Sender: TObject); 323 | procedure Label2Click(Sender: TObject); 324 | procedure Label2MouseEnter(Sender: TObject); 325 | procedure Label30Click(Sender: TObject); 326 | procedure Label31Click(Sender: TObject); 327 | procedure Label3Click(Sender: TObject); 328 | procedure Label4Click(Sender: TObject); 329 | procedure Label5Click(Sender: TObject); 330 | procedure Label6Click(Sender: TObject); 331 | procedure Label7Click(Sender: TObject); 332 | procedure Label8Click(Sender: TObject); 333 | procedure Label9Click(Sender: TObject); 334 | private 335 | procedure LoadComboBoxsItems; 336 | procedure InitializeAllControls; 337 | procedure ReadAllControls; 338 | procedure CleanUpForClosingApplication; 339 | procedure InitializeApplication; 340 | 341 | procedure UpdateStatusMemoText(lMemo:TMemo; const MemoText:String; const ClearMemoText:Boolean; const SetAtEnd:Boolean); 342 | procedure UpdateLabelText(lLabel:TLabel; const HintText:String); 343 | procedure HighLightSelectedButton(lButton:TButton; const PC:Integer); 344 | 345 | function SelectUserDirectory:Boolean; 346 | procedure SaveCapturedPictureAs; 347 | procedure SaveCapturedVideoAs; 348 | function LoadCurrentPictureToImage:Boolean; 349 | function LoadCurrentVideoToImage:Boolean; //non functional 350 | { private declarations } 351 | public 352 | { public declarations } 353 | end; 354 | 355 | var 356 | MainForm: TMainForm; 357 | 358 | implementation 359 | 360 | {$R *.lfm} 361 | 362 | { TMainForm } 363 | 364 | {$IFDEF LINUX} 365 | uses rpiccBackEndManager, lclintf, baseunix; 366 | {$ELSE} 367 | uses rpiccBackEndManager, lclintf; 368 | {$ENDIF} 369 | 370 | {$REGION 'Main Form Events'} 371 | 372 | procedure TMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction); 373 | begin 374 | CleanUpForClosingApplication; 375 | end; 376 | 377 | procedure TMainForm.FormCreate(Sender: TObject); 378 | begin 379 | InitializeApplication; 380 | end; 381 | 382 | procedure TMainForm.FormShow(Sender: TObject); 383 | var localText1,localText2,localText3,localText4:String; 384 | {$IFDEF LINUX} 385 | SystemInformation: UtsName; 386 | s:String; 387 | {$ENDIF} 388 | begin 389 | localText1:='Started'; 390 | localText2:='Client Screen Size'; 391 | localText3:='All Rights Reserved.'; 392 | localText4:='is an open source project created by'; 393 | 394 | UpdateStatusMemoText(Memo1,'',True,True); 395 | UpdateStatusMemoText(Memo1,c_Application_Title+c_Space+localText1,False,True); 396 | 397 | UpdateStatusMemoText(Memo1,localText2+c_DoublePoint+c_Space+rpiGetScreenSize,False,True); 398 | 399 | {$ifdef CPU32} 400 | //UpdateStatusMemoText(Memo1,'32-bit System',False); 401 | {$ENDIF} 402 | 403 | {$ifdef CPU64} 404 | //UpdateStatusMemoText(Memo1,'64-bit System',False); 405 | {$ENDIF} 406 | 407 | {$IFDEF UNIX} 408 | //UpdateStatusMemoText(Memo1,'Unix',False); 409 | {$ENDIF} 410 | 411 | {$IFDEF LINUX} 412 | {try 413 | fpuname(SystemInformation); 414 | 415 | s:='OS:'+SystemInformation.sysname; 416 | UpdateStatusMemoText(Memo1,s,False); 417 | s:='Name '+SystemInformation.nodename; 418 | UpdateStatusMemoText(Memo1,s,False); 419 | s:='Release:'+SystemInformation.release; 420 | UpdateStatusMemoText(Memo1,s,False); 421 | s:='Version:'+SystemInformation.version; 422 | UpdateStatusMemoText(Memo1,s,False); 423 | s:='Machine:'+SystemInformation.machine; 424 | UpdateStatusMemoText(Memo1,s,False); 425 | except 426 | // 427 | end;} 428 | {$ENDIF} 429 | 430 | {$IFDEF DARWIN} 431 | UpdateStatusMemoText(Memo1,'OS: Darwin',False,True); 432 | {$ENDIF} 433 | 434 | {$IFDEF WIN32} 435 | UpdateStatusMemoText(Memo1,'OS: Windows 32 Bit',False,True); 436 | {$ENDIF} 437 | 438 | {$IFDEF WIN64} 439 | UpdateStatusMemoText(Memo1,'OS: Windows 64 Bit',False,True); 440 | {$ENDIF} 441 | 442 | UpdateLabelText(Label32,c_Application_Title); 443 | UpdateLabelText(Label33,c_Aplication_About); 444 | 445 | UpdateLabelText(Label34,c_Application_Title); 446 | UpdateLabelText(Label35,c_Aplication_About); 447 | UpdateLabelText(Label36,localText3+c_Space+c_Application_Title+c_Space+localText4+c_Space+c_Project_Creator); 448 | 449 | v_ApplicationStarted:=True; 450 | end; 451 | 452 | {$ENDREGION 'Main Form Events'} 453 | 454 | {$REGION 'Controls'} 455 | 456 | {$REGION 'LabelTextDefault'} 457 | 458 | procedure TMainForm.Label2Click(Sender: TObject); 459 | begin 460 | ComboBox1.ItemIndex:=c_Default_Image_Ext_Index; 461 | end; 462 | 463 | procedure TMainForm.Label4Click(Sender: TObject); 464 | begin 465 | ComboBox3.ItemIndex:=c_Default_Image_Size_Index; 466 | end; 467 | 468 | procedure TMainForm.Label5Click(Sender: TObject); 469 | begin 470 | ComboBox4.ItemIndex:=c_Default_Image_Effect_Index; 471 | end; 472 | 473 | procedure TMainForm.Label6Click(Sender: TObject); 474 | begin 475 | Edit1.Text:=IntToStr(c_Default_Image_Duration); 476 | end; 477 | 478 | procedure TMainForm.Label7Click(Sender: TObject); 479 | begin 480 | Edit2.Text:=IntToStr(c_Default_Image_Delay); 481 | end; 482 | 483 | procedure TMainForm.Label8Click(Sender: TObject); 484 | begin 485 | CheckBox2.Checked:=c_Default_Image_Flip_Horizontal; 486 | CheckBox3.Checked:=c_Default_Image_Flip_Vertical; 487 | end; 488 | 489 | procedure TMainForm.Label9Click(Sender: TObject); 490 | begin 491 | ComboBox5.ItemIndex:=c_Default_Video_Size_Index; 492 | end; 493 | 494 | procedure TMainForm.Label3Click(Sender: TObject); 495 | begin 496 | ComboBox2.ItemIndex:=c_Default_Image_Quality_Index; 497 | end; 498 | 499 | procedure TMainForm.Label2MouseEnter(Sender: TObject); 500 | var localText1:String; 501 | begin 502 | localText1:='Click to Set Default Value'; 503 | 504 | UpdateLabelText(Label1,localText1); 505 | end; 506 | 507 | procedure TMainForm.Label30Click(Sender: TObject); 508 | begin 509 | Edit5.Text:=IntToStr(c_Default_Network_Port); 510 | end; 511 | 512 | procedure TMainForm.Label31Click(Sender: TObject); 513 | begin 514 | Edit6.Text:=IntToStr(c_Default_Network_Duration); 515 | end; 516 | 517 | procedure TMainForm.Label12Click(Sender: TObject); 518 | begin 519 | ComboBox7.ItemIndex:=c_Default_Video_FPS_Index; 520 | end; 521 | 522 | procedure TMainForm.Label10Click(Sender: TObject); 523 | begin 524 | ComboBox6.ItemIndex:=c_Default_Video_Quality_Index; 525 | end; 526 | 527 | procedure TMainForm.Label11Click(Sender: TObject); 528 | begin 529 | Edit3.Text:=IntToStr(c_Default_Video_Duration); 530 | end; 531 | 532 | procedure TMainForm.Label15Click(Sender: TObject); 533 | begin 534 | ComboBox8.ItemIndex:=c_Default_PreviewWindowPosition_Index; 535 | end; 536 | 537 | procedure TMainForm.Label16Click(Sender: TObject); 538 | begin 539 | ComboBox9.ItemIndex:=c_Default_PreviewWindowSize_Index; 540 | end; 541 | 542 | procedure TMainForm.Label17Click(Sender: TObject); 543 | begin 544 | ComboBox10.ItemIndex:=c_Default_Camera_Brightness_Index; 545 | end; 546 | 547 | procedure TMainForm.Label18Click(Sender: TObject); 548 | begin 549 | ComboBox11.ItemIndex:=c_Default_Camera_Contrast_Index; 550 | end; 551 | 552 | procedure TMainForm.Label19Click(Sender: TObject); 553 | begin 554 | ComboBox12.ItemIndex:=c_Default_Camera_Sharpness_Index; 555 | end; 556 | 557 | procedure TMainForm.Label20Click(Sender: TObject); 558 | begin 559 | ComboBox13.ItemIndex:=c_Default_Camera_Saturation_Index; 560 | end; 561 | 562 | procedure TMainForm.Label21Click(Sender: TObject); 563 | begin 564 | ComboBox14.ItemIndex:=c_Default_Camera_AWB_Index; 565 | end; 566 | 567 | procedure TMainForm.Label22Click(Sender: TObject); 568 | begin 569 | ComboBox15.ItemIndex:=c_Default_Camera_EV_Index; 570 | end; 571 | 572 | procedure TMainForm.Label23Click(Sender: TObject); 573 | begin 574 | ComboBox16.ItemIndex:=c_Default_Camera_Exposure_Index; 575 | end; 576 | 577 | procedure TMainForm.Label24Click(Sender: TObject); 578 | begin 579 | ComboBox17.ItemIndex:=c_Default_Camera_Rotation_Index; 580 | end; 581 | 582 | procedure TMainForm.Label26Click(Sender: TObject); 583 | begin 584 | ComboBox19.ItemIndex:=c_Default_Camera_ColorEffect_U_Index; 585 | ComboBox20.ItemIndex:=c_Default_Camera_ColorEffect_V_Index; 586 | end; 587 | 588 | procedure TMainForm.Label27Click(Sender: TObject); 589 | begin 590 | ComboBox18.ItemIndex:=c_Default_Camera_Metering_Index; 591 | end; 592 | 593 | {$ENDREGION 'LabelTextDefault'} 594 | 595 | {$REGION 'Main Form Controls'} 596 | 597 | procedure TMainForm.Button1MouseEnter(Sender: TObject); 598 | var localText1:String; 599 | begin 600 | localText1:='Open Terminal and Enter Commands Manually'; 601 | 602 | UpdateLabelText(Label1,localText1); 603 | end; 604 | 605 | {$ENDREGION 'Main Form Controls'} 606 | 607 | {$REGION 'Page Tabs Control 1'} 608 | 609 | procedure TMainForm.Button2Click(Sender: TObject); 610 | begin 611 | PageControl1.PageIndex:=0; 612 | HighLightSelectedButton(Button2,1); 613 | end; 614 | 615 | procedure TMainForm.Button2MouseEnter(Sender: TObject); 616 | begin 617 | UpdateLabelText(Label1,'Main Page Tab'); 618 | end; 619 | 620 | procedure TMainForm.Button2MouseLeave(Sender: TObject); 621 | begin 622 | UpdateLabelText(Label1,''); 623 | end; 624 | 625 | procedure TMainForm.Button3Click(Sender: TObject); 626 | begin 627 | PageControl1.PageIndex:=2; 628 | HighLightSelectedButton(Button3,1); 629 | end; 630 | 631 | procedure TMainForm.Button3MouseEnter(Sender: TObject); 632 | begin 633 | UpdateLabelText(Label1,'Make a Video'); 634 | end; 635 | 636 | procedure TMainForm.Button4Click(Sender: TObject); 637 | begin 638 | PageControl1.PageIndex:=1; 639 | HighLightSelectedButton(Button4,1); 640 | end; 641 | 642 | procedure TMainForm.Button4MouseEnter(Sender: TObject); 643 | begin 644 | UpdateLabelText(Label1,'Take a Photo'); 645 | end; 646 | 647 | procedure TMainForm.Button5Click(Sender: TObject); 648 | begin 649 | PageControl1.PageIndex:=3; 650 | HighLightSelectedButton(Button5,1); 651 | end; 652 | 653 | procedure TMainForm.Button5MouseEnter(Sender: TObject); 654 | begin 655 | UpdateLabelText(Label1,'Configure Camera Settings'); 656 | end; 657 | 658 | procedure TMainForm.Button6Click(Sender: TObject); 659 | begin 660 | PageControl1.PageIndex:=5; 661 | HighLightSelectedButton(Button6,1); 662 | end; 663 | 664 | procedure TMainForm.Button6MouseEnter(Sender: TObject); 665 | begin 666 | UpdateLabelText(Label1,'Info and Documentation'); 667 | end; 668 | 669 | //additional tab for settings 670 | 671 | procedure TMainForm.Button12Click(Sender: TObject); 672 | begin 673 | PageControl1.PageIndex:=4; 674 | end; 675 | 676 | procedure TMainForm.Button12MouseEnter(Sender: TObject); 677 | begin 678 | UpdateLabelText(Label1,'Addition Settings Controls'); 679 | end; 680 | 681 | procedure TMainForm.Button13Click(Sender: TObject); 682 | begin 683 | PageControl1.PageIndex:=3; 684 | end; 685 | 686 | procedure TMainForm.Button13MouseEnter(Sender: TObject); 687 | begin 688 | UpdateLabelText(Label1,'Go Back to Main Settings Page'); 689 | end; 690 | 691 | {$ENDREGION 'Page Control 1'} 692 | 693 | {$REGION 'Page Tabs Control 2'} 694 | 695 | procedure TMainForm.Button16Click(Sender: TObject); 696 | begin 697 | PageControl2.PageIndex:=1; 698 | end; 699 | 700 | procedure TMainForm.Button16MouseEnter(Sender: TObject); 701 | begin 702 | UpdateLabelText(Label1,'View License'); 703 | end; 704 | 705 | procedure TMainForm.Button17Click(Sender: TObject); 706 | begin 707 | PageControl2.PageIndex:=0; 708 | end; 709 | 710 | procedure TMainForm.Button17MouseEnter(Sender: TObject); 711 | begin 712 | UpdateLabelText(Label1,'Go Back to Main Info Page'); 713 | end; 714 | 715 | procedure TMainForm.Button18Click(Sender: TObject); 716 | begin 717 | PageControl2.PageIndex:=2; 718 | end; 719 | 720 | procedure TMainForm.Button18MouseEnter(Sender: TObject); 721 | begin 722 | UpdateLabelText(Label1,'Project Contributors'); 723 | end; 724 | 725 | {$ENDREGION 'Page Control 2'} 726 | 727 | {$REGION 'Main Tab Controls'} 728 | 729 | procedure TMainForm.CheckBox4MouseEnter(Sender: TObject); 730 | begin 731 | UpdateLabelText(Label1,'Test Camera Preview in Demo Mode'); 732 | end; 733 | 734 | procedure TMainForm.Button7MouseEnter(Sender: TObject); 735 | begin 736 | UpdateLabelText(Label1,'Start a 5 sec Camera Preview Window'); 737 | end; 738 | 739 | {$ENDREGION 'Main Tab Controls'} 740 | 741 | {$REGION 'Photo Tab Controls'} 742 | 743 | procedure TMainForm.Image2Click(Sender: TObject); 744 | begin 745 | SaveCapturedPictureAs; 746 | end; 747 | 748 | procedure TMainForm.Image2MouseEnter(Sender: TObject); 749 | begin 750 | UpdateLabelText(Label1,'Click to Save Picture'); 751 | end; 752 | 753 | procedure TMainForm.Button8MouseEnter(Sender: TObject); 754 | begin 755 | UpdateLabelText(Label1,'Capture an Image'); 756 | end; 757 | 758 | procedure TMainForm.Button9MouseEnter(Sender: TObject); 759 | begin 760 | UpdateLabelText(Label1,'Start Preview'); 761 | end; 762 | 763 | procedure TMainForm.CheckBox10Change(Sender: TObject); 764 | begin 765 | if CheckBox10.Checked then 766 | begin 767 | ComboBox19.Enabled:=True; 768 | ComboBox20.Enabled:=True; 769 | end else 770 | begin 771 | ComboBox19.Enabled:=False; 772 | ComboBox20.Enabled:=False; 773 | end; 774 | end; 775 | 776 | procedure TMainForm.CheckBox10MouseEnter(Sender: TObject); 777 | begin 778 | UpdateLabelText(Label1,'Enable UV Color Effect'); 779 | end; 780 | 781 | procedure TMainForm.CheckBox1MouseEnter(Sender: TObject); 782 | begin 783 | UpdateLabelText(Label1,'Apply Time Laps Capture Session'); 784 | end; 785 | 786 | procedure TMainForm.CheckBox2MouseEnter(Sender: TObject); 787 | begin 788 | UpdateLabelText(Label1,'Flip Video Horizontal'); 789 | end; 790 | 791 | procedure TMainForm.CheckBox3MouseEnter(Sender: TObject); 792 | begin 793 | UpdateLabelText(Label1,'Flip Video Vertical'); 794 | end; 795 | 796 | procedure TMainForm.ComboBox1Change(Sender: TObject); 797 | begin 798 | v_Image_Ext_Index:=ComboBox1.ItemIndex; 799 | end; 800 | 801 | procedure TMainForm.ComboBox1MouseEnter(Sender: TObject); 802 | begin 803 | UpdateLabelText(Label1,'Set Image Capture File Type; .jpg, .bmp, or .png | .jpg is Default'); 804 | end; 805 | 806 | procedure TMainForm.ComboBox2Change(Sender: TObject); 807 | begin 808 | v_Image_Quality_Index:=ComboBox2.ItemIndex; 809 | end; 810 | 811 | procedure TMainForm.ComboBox2MouseEnter(Sender: TObject); 812 | begin 813 | UpdateLabelText(Label1,'Set Image Capture Quality. Applies to .jpg Only'); 814 | end; 815 | 816 | procedure TMainForm.ComboBox3Change(Sender: TObject); 817 | begin 818 | v_Image_Size_Index:=ComboBox3.ItemIndex; 819 | end; 820 | 821 | procedure TMainForm.ComboBox3MouseEnter(Sender: TObject); 822 | begin 823 | UpdateLabelText(Label1,'Set Image Capture Size'); 824 | end; 825 | 826 | procedure TMainForm.ComboBox4Change(Sender: TObject); 827 | begin 828 | v_Image_Effect_Index:=ComboBox4.ItemIndex; 829 | end; 830 | 831 | procedure TMainForm.ComboBox4MouseEnter(Sender: TObject); 832 | begin 833 | UpdateLabelText(Label1,'Select a Video Effect'); 834 | end; 835 | 836 | procedure TMainForm.Edit1Exit(Sender: TObject); 837 | begin 838 | if Edit1.Text='' then 839 | begin 840 | Edit1.Text:=IntToStr(c_Default_Image_Duration); 841 | end; 842 | end; 843 | 844 | procedure TMainForm.Edit1KeyPress(Sender: TObject; var Key: char); 845 | begin 846 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 847 | begin 848 | Key := #0; 849 | end; 850 | end; 851 | 852 | procedure TMainForm.Edit1MouseEnter(Sender: TObject); 853 | begin 854 | UpdateLabelText(Label1,'Set Session Duration in Milliseconds, e.g. 5000 = 5 seconds '); 855 | end; 856 | 857 | procedure TMainForm.Edit2Exit(Sender: TObject); 858 | begin 859 | if Edit2.Text='' then 860 | begin 861 | Edit2.Text:=IntToStr(c_Default_Image_Delay); 862 | end; 863 | end; 864 | 865 | procedure TMainForm.Edit2KeyPress(Sender: TObject; var Key: char); 866 | begin 867 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 868 | begin 869 | Key := #0; 870 | end; 871 | end; 872 | 873 | procedure TMainForm.Edit2MouseEnter(Sender: TObject); 874 | begin 875 | UpdateLabelText(Label1,'Set Delay Between Image Captures in Milliseconds. Relates to Time Lapse'); 876 | end; 877 | 878 | {$ENDREGION 'Photo Tab Controls'} 879 | 880 | {$REGION 'Video Tab Controls'} 881 | 882 | procedure TMainForm.ComboBox5Change(Sender: TObject); 883 | begin 884 | v_Video_Size_Index:=ComboBox5.ItemIndex; 885 | end; 886 | 887 | procedure TMainForm.ComboBox5MouseEnter(Sender: TObject); 888 | begin 889 | UpdateLabelText(Label1,'Set Video Size'); 890 | end; 891 | 892 | procedure TMainForm.ComboBox6Change(Sender: TObject); 893 | begin 894 | v_Video_Quality_Index:=ComboBox6.ItemIndex; 895 | end; 896 | 897 | procedure TMainForm.ComboBox6MouseEnter(Sender: TObject); 898 | begin 899 | UpdateLabelText(Label1,'Set Video Quality. Relates to Bitrate'); 900 | end; 901 | 902 | procedure TMainForm.ComboBox7Change(Sender: TObject); 903 | begin 904 | v_Video_FPS_Index:=ComboBox7.ItemIndex; 905 | end; 906 | 907 | procedure TMainForm.ComboBox7MouseEnter(Sender: TObject); 908 | begin 909 | UpdateLabelText(Label1,'Set Video Frame Per Second'); 910 | end; 911 | 912 | procedure TMainForm.Edit3MouseEnter(Sender: TObject); 913 | begin 914 | UpdateLabelText(Label1,'Set Video Recording Duration'); 915 | end; 916 | 917 | procedure TMainForm.Edit4Exit(Sender: TObject); 918 | begin 919 | if Edit4.Text='' then 920 | begin 921 | //Edit4.Text:=IntToStr(c_Default_Video_Duration); 922 | end; 923 | end; 924 | 925 | procedure TMainForm.Edit4KeyPress(Sender: TObject; var Key: char); 926 | begin 927 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 928 | begin 929 | Key := #0; 930 | end; 931 | end; 932 | 933 | procedure TMainForm.Edit4MouseEnter(Sender: TObject); 934 | begin 935 | UpdateLabelText(Label1,'Enter IP Address of Client (Receiving) Machine'); 936 | end; 937 | 938 | procedure TMainForm.Edit5Exit(Sender: TObject); 939 | begin 940 | if Edit5.Text='' then 941 | begin 942 | Edit5.Text:=IntToStr(c_Default_Network_Port); 943 | end; 944 | end; 945 | 946 | procedure TMainForm.Edit5KeyPress(Sender: TObject; var Key: char); 947 | begin 948 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 949 | begin 950 | Key := #0; 951 | end; 952 | end; 953 | 954 | procedure TMainForm.Edit5MouseEnter(Sender: TObject); 955 | begin 956 | UpdateLabelText(Label1,'Enter Port Number'); 957 | end; 958 | 959 | procedure TMainForm.Edit6Exit(Sender: TObject); 960 | begin 961 | if Edit6.Text='' then 962 | begin 963 | Edit6.Text:=IntToStr(c_Default_Network_Duration); 964 | end; 965 | end; 966 | 967 | procedure TMainForm.Edit6KeyPress(Sender: TObject; var Key: char); 968 | begin 969 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 970 | begin 971 | Key := #0; 972 | end; 973 | end; 974 | 975 | procedure TMainForm.Edit6MouseEnter(Sender: TObject); 976 | begin 977 | UpdateLabelText(Label1,'Enter Duration of the Video Stream in Milliseconds'); 978 | end; 979 | 980 | procedure TMainForm.Edit3Exit(Sender: TObject); 981 | begin 982 | if Edit3.Text='' then 983 | begin 984 | Edit3.Text:=IntToStr(c_Default_Video_Duration); 985 | end; 986 | end; 987 | 988 | procedure TMainForm.Edit3KeyPress(Sender: TObject; var Key: char); 989 | begin 990 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 991 | begin 992 | Key := #0; 993 | end; 994 | end; 995 | 996 | procedure TMainForm.CheckBox5MouseEnter(Sender: TObject); 997 | begin 998 | UpdateLabelText(Label1,'Enable Video Stabalization'); 999 | end; 1000 | 1001 | procedure TMainForm.Button10MouseEnter(Sender: TObject); 1002 | begin 1003 | UpdateLabelText(Label1,'Start Video Recoding'); 1004 | end; 1005 | 1006 | {$ENDREGION 'Video Tab Controls'} 1007 | 1008 | {$REGION 'Settings Tab Controls'} 1009 | 1010 | procedure TMainForm.Button11Click(Sender: TObject); 1011 | begin 1012 | rpiDefaultAll; 1013 | InitializeAllControls; 1014 | end; 1015 | 1016 | procedure TMainForm.Button11MouseEnter(Sender: TObject); 1017 | begin 1018 | UpdateLabelText(Label1,'Default All Settings'); 1019 | end; 1020 | 1021 | procedure TMainForm.ComboBox8Change(Sender: TObject); 1022 | begin 1023 | v_Preview_Position_Index:=ComboBox8.ItemIndex; 1024 | end; 1025 | 1026 | procedure TMainForm.ComboBox8MouseEnter(Sender: TObject); 1027 | begin 1028 | UpdateLabelText(Label1,'Set Preview Window Position'); 1029 | end; 1030 | 1031 | procedure TMainForm.ComboBox9Change(Sender: TObject); 1032 | var localText1:String; 1033 | Value,PreviewResolution,ImageWidth,ImageHeight:Integer; 1034 | begin 1035 | localText1:='Warning: Selected Preview Size Setting may Exceed Screen Size'; 1036 | 1037 | Value:=ComboBox9.ItemIndex; 1038 | 1039 | ImageWidth:=c_Default_Image_Width; ImageHeight:=c_Default_Image_Height; 1040 | 1041 | v_Preview_Size_Index:=Value; 1042 | rpiExtractWidthHeightValuesFromString(prm_PreviewWindowSizeMap[v_Preview_Size_Index],ImageWidth,ImageHeight); 1043 | PreviewResolution:=ImageWidth*ImageHeight; 1044 | if (ScreenWidth[0]*ScreenHeight[0])<(PreviewResolution) then 1045 | begin 1046 | UpdateStatusMemoText(Memo2,localText1,True,True); 1047 | end else 1048 | begin 1049 | UpdateStatusMemoText(Memo2,'',True,True); 1050 | end; 1051 | end; 1052 | 1053 | procedure TMainForm.ComboBox9MouseEnter(Sender: TObject); 1054 | begin 1055 | UpdateLabelText(Label1,'Set Preview Window Size'); 1056 | end; 1057 | 1058 | procedure TMainForm.CheckBox6MouseEnter(Sender: TObject); 1059 | begin 1060 | UpdateLabelText(Label1,'Enable Video Preview'); 1061 | end; 1062 | 1063 | procedure TMainForm.CheckBox7MouseEnter(Sender: TObject); 1064 | begin 1065 | UpdateLabelText(Label1,'Apply RAW Output. Relates to .jpg Only'); 1066 | end; 1067 | 1068 | procedure TMainForm.CheckBox8MouseEnter(Sender: TObject); 1069 | begin 1070 | UpdateLabelText(Label1,'Apply ISO Output'); 1071 | end; 1072 | 1073 | procedure TMainForm.CheckBox9Change(Sender: TObject); 1074 | var localText1:String; 1075 | begin 1076 | localText1:='Desktop may Not be Accessible During FullScreen Preview Session. Continue?'; 1077 | 1078 | if (CheckBox9.Checked) and (v_ApplicationStarted) then // full screen can not be escaped. Inform user 1079 | begin 1080 | if MessageDlg(localText1, mtConfirmation,[mbYes,mbNo], 0)=6 then 1081 | begin 1082 | CheckBox9.Checked:=True; 1083 | end else 1084 | begin 1085 | CheckBox9.Checked:=False; 1086 | end; 1087 | end; 1088 | end; 1089 | 1090 | procedure TMainForm.CheckBox9MouseEnter(Sender: TObject); 1091 | begin 1092 | UpdateLabelText(Label1,'Enable Fullscreen Preview'); 1093 | end; 1094 | 1095 | procedure TMainForm.ComboBox10Change(Sender: TObject); 1096 | begin 1097 | v_Camera_Brightness_Index:=ComboBox10.ItemIndex; 1098 | end; 1099 | 1100 | procedure TMainForm.ComboBox10MouseEnter(Sender: TObject); 1101 | begin 1102 | UpdateLabelText(Label1,'Set Image Brightness'); 1103 | end; 1104 | 1105 | procedure TMainForm.ComboBox11Change(Sender: TObject); 1106 | begin 1107 | v_Camera_Contrast_Index:=ComboBox11.ItemIndex; 1108 | end; 1109 | 1110 | procedure TMainForm.ComboBox11MouseEnter(Sender: TObject); 1111 | begin 1112 | UpdateLabelText(Label1,'Set Image Contrast'); 1113 | end; 1114 | 1115 | procedure TMainForm.ComboBox12Change(Sender: TObject); 1116 | begin 1117 | v_Camera_Sharpness_Index:=ComboBox12.ItemIndex; 1118 | end; 1119 | 1120 | procedure TMainForm.ComboBox12MouseEnter(Sender: TObject); 1121 | begin 1122 | UpdateLabelText(Label1,'Set Image Sharpness'); 1123 | end; 1124 | 1125 | procedure TMainForm.ComboBox13Change(Sender: TObject); 1126 | begin 1127 | v_Camera_Saturation_Index:=ComboBox13.ItemIndex; 1128 | end; 1129 | 1130 | procedure TMainForm.ComboBox13MouseEnter(Sender: TObject); 1131 | begin 1132 | UpdateLabelText(Label1,'Set Image Saturation'); 1133 | end; 1134 | 1135 | procedure TMainForm.ComboBox14Change(Sender: TObject); 1136 | begin 1137 | v_Camera_AWB_Index:=ComboBox14.ItemIndex; 1138 | end; 1139 | 1140 | procedure TMainForm.ComboBox14MouseEnter(Sender: TObject); 1141 | begin 1142 | UpdateLabelText(Label1,'Set Image Auto White Balance'); 1143 | end; 1144 | 1145 | procedure TMainForm.ComboBox15Change(Sender: TObject); 1146 | begin 1147 | v_Camera_EV_Index:=ComboBox15.ItemIndex; 1148 | end; 1149 | 1150 | procedure TMainForm.ComboBox15MouseEnter(Sender: TObject); 1151 | begin 1152 | UpdateLabelText(Label1,'Set Image EV Compensation'); 1153 | end; 1154 | 1155 | procedure TMainForm.ComboBox16Change(Sender: TObject); 1156 | begin 1157 | v_Camera_Exposure_Index:=ComboBox16.ItemIndex; 1158 | end; 1159 | 1160 | procedure TMainForm.ComboBox16MouseEnter(Sender: TObject); 1161 | begin 1162 | UpdateLabelText(Label1,'Set Image Exposure'); 1163 | end; 1164 | 1165 | procedure TMainForm.ComboBox17Change(Sender: TObject); 1166 | begin 1167 | v_Camera_Rotation_Index:=ComboBox17.ItemIndex; 1168 | end; 1169 | 1170 | procedure TMainForm.ComboBox17MouseEnter(Sender: TObject); 1171 | begin 1172 | UpdateLabelText(Label1,'Set Image Rotation'); 1173 | end; 1174 | 1175 | procedure TMainForm.ComboBox18Change(Sender: TObject); 1176 | begin 1177 | v_Camera_Metering_Index:=ComboBox18.ItemIndex; 1178 | end; 1179 | 1180 | procedure TMainForm.ComboBox18MouseEnter(Sender: TObject); 1181 | begin 1182 | UpdateLabelText(Label1,'Set Metering'); 1183 | end; 1184 | 1185 | procedure TMainForm.ComboBox19Change(Sender: TObject); 1186 | begin 1187 | v_Camera_ColorEffect_U_Index:=ComboBox19.ItemIndex; 1188 | end; 1189 | 1190 | procedure TMainForm.ComboBox19MouseEnter(Sender: TObject); 1191 | begin 1192 | UpdateLabelText(Label1,'Set Color Effect U Channel'); 1193 | end; 1194 | 1195 | procedure TMainForm.ComboBox20Change(Sender: TObject); 1196 | begin 1197 | v_Camera_ColorEffect_V_Index:=ComboBox20.ItemIndex; 1198 | end; 1199 | 1200 | procedure TMainForm.ComboBox20MouseEnter(Sender: TObject); 1201 | begin 1202 | UpdateLabelText(Label1,'Set Color Effect V Channel'); 1203 | end; 1204 | 1205 | procedure TMainForm.Button14MouseEnter(Sender: TObject); 1206 | begin 1207 | UpdateLabelText(Label1,'Start Network Video Streaming'); 1208 | end; 1209 | 1210 | {$ENDREGION 'Settings Tab Controls'} 1211 | 1212 | {$ENDREGION 'Controls'} 1213 | 1214 | {$REGION 'Support'} 1215 | 1216 | procedure TMainForm.LoadComboBoxsItems; 1217 | var n:Integer; 1218 | begin 1219 | //file type 1220 | for n:=0 to Length(prm_ExtMap)-1 do 1221 | begin 1222 | ComboBox1.AddItem(prm_ExtMap[n],nil); 1223 | end; 1224 | 1225 | //jpg quality 1226 | for n:=0 to Length(prm_JPG_QualityMap)-1 do 1227 | begin 1228 | ComboBox2.AddItem(prm_JPG_QualityMap[n],nil); 1229 | end; 1230 | 1231 | // image size 1232 | for n:=0 to Length(prm_ImageSizeMap)-1 do 1233 | begin 1234 | ComboBox3.AddItem(prm_ImageSizeMap[n],nil); 1235 | end; 1236 | 1237 | //image effect 1238 | for n:=0 to Length(prm_ImxfxMap)-1 do 1239 | begin 1240 | ComboBox4.AddItem(prm_ImxfxMap[n],nil); 1241 | end; 1242 | 1243 | // video size 1244 | for n:=0 to Length(prm_VideoSizeMap)-1 do 1245 | begin 1246 | ComboBox5.AddItem(prm_VideoSizeMap[n],nil); 1247 | end; 1248 | 1249 | //video quality; bitrate calculation 1250 | for n:=0 to Length(prm_VideoQualitytMap)-1 do 1251 | begin 1252 | ComboBox6.AddItem(prm_VideoQualitytMap[n],nil); 1253 | end; 1254 | 1255 | //video FPS 1256 | for n:=0 to Length(prm_VideoFPSMap)-1 do 1257 | begin 1258 | ComboBox7.AddItem(prm_VideoFPSMap[n],nil); 1259 | end; 1260 | 1261 | //Preview Position 1262 | for n:=0 to Length(prm_PreviewWindowPositionMap)-1 do 1263 | begin 1264 | ComboBox8.AddItem(prm_PreviewWindowPositionMap[n],nil); 1265 | end; 1266 | 1267 | //Preview Size 1268 | for n:=0 to Length(prm_PreviewWindowSizeMap)-1 do 1269 | begin 1270 | ComboBox9.AddItem(prm_PreviewWindowSizeMap[n],nil); 1271 | end; 1272 | 1273 | //Camera Brightness 1274 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1275 | begin 1276 | ComboBox10.AddItem(prm_7_LevelListMap[n],nil); 1277 | end; 1278 | 1279 | //Camera Contrast 1280 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1281 | begin 1282 | ComboBox11.AddItem(prm_7_LevelListMap[n],nil); 1283 | end; 1284 | 1285 | //Camera Sharpness 1286 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1287 | begin 1288 | ComboBox12.AddItem(prm_7_LevelListMap[n],nil); 1289 | end; 1290 | 1291 | //Camera Saturation 1292 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1293 | begin 1294 | ComboBox13.AddItem(prm_7_LevelListMap[n],nil); 1295 | end; 1296 | 1297 | //Camera AWB 1298 | for n:=0 to Length(prm_AwbMap)-1 do 1299 | begin 1300 | ComboBox14.AddItem(prm_AwbMap[n],nil); 1301 | end; 1302 | 1303 | //Camera EV 1304 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1305 | begin 1306 | ComboBox15.AddItem(prm_7_LevelListMap[n],nil); 1307 | end; 1308 | 1309 | //Camera Exposure 1310 | for n:=0 to Length(prm_ExposureMap)-1 do 1311 | begin 1312 | ComboBox16.AddItem(prm_ExposureMap[n],nil); 1313 | end; 1314 | 1315 | //Camera Rotation 1316 | for n:=0 to Length(prm_RotationMap)-1 do 1317 | begin 1318 | ComboBox17.AddItem(prm_RotationMap[n],nil); 1319 | end; 1320 | 1321 | //Camera Metering 1322 | for n:=0 to Length(prm_MeteringMap)-1 do 1323 | begin 1324 | ComboBox18.AddItem(prm_MeteringMap[n],nil); 1325 | end; 1326 | 1327 | //Camera Color Effect U 1328 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1329 | begin 1330 | ComboBox19.AddItem(prm_7_LevelListMap[n],nil); 1331 | end; 1332 | 1333 | //Camera Color Effect U 1334 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1335 | begin 1336 | ComboBox20.AddItem(prm_7_LevelListMap[n],nil); 1337 | end; 1338 | end; 1339 | 1340 | procedure TMainForm.InitializeAllControls; 1341 | begin 1342 | {n:=0; 1343 | while n<=ComboBox1.Items.Count-1 do 1344 | begin 1345 | if (v_Image_Ext=ComboBox1.Items.Strings[n]) then 1346 | begin 1347 | ComboBox1.ItemIndex:=n; 1348 | n:=ComboBox1.Items.Count+1; // +1 to stop the loop 1349 | end else 1350 | begin 1351 | n:=n+1; 1352 | end; 1353 | end;} 1354 | 1355 | //Main Tab 1356 | CheckBox4.Checked:=v_ShowDemoPreview; 1357 | 1358 | //Photo tab 1359 | ComboBox1.ItemIndex:=v_Image_Ext_Index; 1360 | ComboBox2.ItemIndex:=v_Image_Quality_Index; 1361 | ComboBox3.ItemIndex:=v_Image_Size_Index; 1362 | ComboBox4.ItemIndex:=v_Image_Effect_Index; 1363 | CheckBox1.Checked:=v_Image_MakeTimeLapse; 1364 | CheckBox2.Checked:=v_Image_Flip_Horizontal; CheckBox3.Checked:=v_Image_Flip_Vertical; 1365 | Edit1.Text:=IntToStr(v_Image_Duration); 1366 | Edit2.Text:=IntToStr(v_Image_Delay); 1367 | CheckBox7.Checked:=v_Image_RAW_Output; 1368 | CheckBox8.Checked:=v_Image_ISO_Output; 1369 | 1370 | //Video tab 1371 | ComboBox5.ItemIndex:=v_Video_Size_Index; 1372 | ComboBox6.ItemIndex:=v_Video_Quality_Index; 1373 | ComboBox7.ItemIndex:=v_Video_FPS_Index; 1374 | CheckBox5.Checked:=v_VideoStabilation; 1375 | Edit3.Text:=IntToStr(v_Video_Duration); 1376 | 1377 | //Settings tab (preview section) 1378 | ComboBox8.ItemIndex:=v_Preview_Position_Index; 1379 | ComboBox9.ItemIndex:=v_Preview_Size_Index; 1380 | CheckBox6.Checked:=v_Preview_ShowPreview; 1381 | CheckBox9.Checked:=v_Preview_FullScreen; 1382 | rpiSetPreviewModeIndex; 1383 | 1384 | //Settings tab (camera section) 1385 | ComboBox10.ItemIndex:=v_Camera_Brightness_Index; 1386 | ComboBox11.ItemIndex:=v_Camera_Contrast_Index; 1387 | ComboBox12.ItemIndex:=v_Camera_Sharpness_Index; 1388 | ComboBox13.ItemIndex:=v_Camera_Saturation_Index; 1389 | ComboBox14.ItemIndex:=v_Camera_AWB_Index; 1390 | ComboBox15.ItemIndex:=v_Camera_EV_Index; 1391 | ComboBox16.ItemIndex:=v_Camera_Exposure_Index; 1392 | ComboBox17.ItemIndex:=v_Camera_Rotation_Index; 1393 | 1394 | //Settings tab (additional section) 1395 | ComboBox18.ItemIndex:=v_Camera_Metering_Index; 1396 | ComboBox19.ItemIndex:=v_Camera_ColorEffect_U_Index; 1397 | ComboBox20.ItemIndex:=v_Camera_ColorEffect_V_Index; 1398 | CheckBox10.Checked:=v_Camera_ColorEffect_UV; 1399 | 1400 | Edit4.Text:=IntToStr(v_Network_IPAddress); 1401 | Edit5.Text:=IntToStr(v_Network_Port); 1402 | Edit6.Text:=IntToStr(v_Network_Duration); 1403 | end; 1404 | 1405 | procedure TMainForm.ReadAllControls; 1406 | begin 1407 | //Main Tab 1408 | v_ShowDemoPreview:=CheckBox4.Checked; 1409 | 1410 | //Photo tab 1411 | v_Image_Ext_Index:=ComboBox1.ItemIndex; 1412 | v_Image_Quality_Index:=ComboBox2.ItemIndex; 1413 | v_Image_Size_Index:=ComboBox3.ItemIndex; 1414 | v_Image_Effect_Index:=ComboBox4.ItemIndex; 1415 | v_Image_MakeTimeLapse:=CheckBox1.Checked; 1416 | v_Image_Flip_Horizontal:=CheckBox2.Checked; v_Image_Flip_Vertical:=CheckBox3.Checked; 1417 | v_Image_Duration:=StrToInt(Edit1.Text); 1418 | v_Image_Delay:=StrToInt(Edit2.Text); 1419 | v_Image_RAW_Output:=CheckBox7.Checked; 1420 | v_Image_ISO_Output:=CheckBox8.Checked; 1421 | 1422 | //Video tab 1423 | v_Video_Size_Index:=ComboBox5.ItemIndex; 1424 | v_Video_Quality_Index:=ComboBox6.ItemIndex; 1425 | v_Video_FPS_Index:=ComboBox7.ItemIndex; 1426 | v_VideoStabilation:=CheckBox5.Checked; 1427 | v_Video_Duration:=StrToInt(Edit3.Text); 1428 | 1429 | //Settings tab (preview section) 1430 | v_Preview_Position_Index:=ComboBox8.ItemIndex; 1431 | v_Preview_Size_Index:=ComboBox9.ItemIndex; 1432 | v_Preview_ShowPreview:=CheckBox6.Checked; 1433 | v_Preview_FullScreen:=CheckBox9.Checked; 1434 | rpiSetPreviewModeIndex; 1435 | 1436 | //Settings tab (camera section) 1437 | v_Camera_Brightness_Index:=ComboBox10.ItemIndex; 1438 | v_Camera_Contrast_Index:=ComboBox11.ItemIndex; 1439 | v_Camera_Sharpness_Index:=ComboBox12.ItemIndex; 1440 | v_Camera_Saturation_Index:=ComboBox13.ItemIndex; 1441 | v_Camera_AWB_Index:=ComboBox14.ItemIndex; 1442 | v_Camera_EV_Index:=ComboBox15.ItemIndex; 1443 | v_Camera_Exposure_Index:=ComboBox16.ItemIndex; 1444 | v_Camera_Rotation_Index:=ComboBox17.ItemIndex; 1445 | 1446 | //Settings tab (adfditional section) 1447 | v_Camera_Metering_Index:=ComboBox18.ItemIndex; 1448 | v_Camera_ColorEffect_U_Index:=ComboBox19.ItemIndex; 1449 | v_Camera_ColorEffect_V_Index:=ComboBox20.ItemIndex; 1450 | v_Camera_ColorEffect_UV:=CheckBox10.Checked; 1451 | 1452 | v_Network_IPAddress:=StrToInt(Edit4.Text); 1453 | v_Network_Port:=StrToInt(Edit5.Text); 1454 | v_Network_Duration:=StrToInt(Edit6.Text); 1455 | end; 1456 | 1457 | procedure TMainForm.CleanUpForClosingApplication; 1458 | begin 1459 | ReadAllControls; 1460 | rpiSaveUserSettings(AppURL+c_SettingsFile_Path); 1461 | end; 1462 | 1463 | procedure TMainForm.InitializeApplication; 1464 | begin 1465 | rpiGetScreenSize; 1466 | LoadComboBoxsItems; 1467 | AppURL:=ExtractFilePath(ParamStr(0));// works. But this is not the correct approach 1468 | Label1.Caption:=''; 1469 | PageControl1.PageIndex:=0; //set main page 1470 | HighLightSelectedButton(Button2,1); // highlight main page button 1471 | PageControl2.PageIndex:=0; //set info page to first page 1472 | 1473 | if FileExists(AppURL+c_SettingsFile_Path) then // if the settings file does not exists it will use default values 1474 | begin 1475 | rpiLoadUserSettings(AppURL+c_SettingsFile_Path); 1476 | end; 1477 | 1478 | InitializeAllControls; 1479 | 1480 | //DetectCameraApp; 1481 | 1482 | MainForm.Caption:=c_Application_Title; 1483 | end; 1484 | 1485 | function TMainForm.SelectUserDirectory:Boolean; 1486 | var localText1,localText2:String; 1487 | begin 1488 | localText1:='Select Directory to Save Time Laps Images'; 1489 | localText2:='Error'; 1490 | 1491 | Result:=False; 1492 | 1493 | try 1494 | SelectDirectoryDialog1.Title:=localText1; 1495 | if not(SelectDirectoryDialog1.Execute) then exit; 1496 | v_UserSelectedDirectory:=SelectDirectoryDialog1.FileName+'/'; 1497 | //showmessage(v_UserSelectedDirectory); 1498 | Result:=False; 1499 | except 1500 | on E: Exception do begin MessageDlg(localText2,localText2+': '+E.Message,mtError,[mbOk],0); end; 1501 | end; 1502 | end; 1503 | 1504 | procedure TMainForm.SaveCapturedPictureAs; 1505 | var ImageFileName:String; 1506 | localText1,localText2:String; 1507 | begin 1508 | localText1:='Error'; 1509 | localText2:='Captured Image File Not Found: '; 1510 | 1511 | ImageFileName:=rpiGetCapturedPictureFileName; 1512 | if FileExists(ImageFileName) then 1513 | begin 1514 | try 1515 | SavePictureDialog1.DefaultExt:=ExtractFileExt(ImageFileName); 1516 | if not(SavePictureDialog1.Execute) then exit; 1517 | CopyFile(ImageFileName,SavePictureDialog1.FileName,True); 1518 | except 1519 | on E: Exception do begin MessageDlg(localText1,localText1+': '+E.Message,mtError,[mbOk],0); end; 1520 | end; 1521 | end else 1522 | begin 1523 | UpdateStatusMemoText(Memo2,localText2+ImageFileName,True,True); 1524 | end; 1525 | end; 1526 | 1527 | procedure TMainForm.SaveCapturedVideoAs; 1528 | var VideoFileName:String; 1529 | localText1,localText2:String; 1530 | begin 1531 | localText1:='Error'; 1532 | localText2:='Captured Video File Not Found: '; 1533 | 1534 | VideoFileName:=rpiGetCapturedVideoFileName; 1535 | if FileExists(VideoFileName) then 1536 | begin 1537 | try 1538 | SaveDialog1.DefaultExt:=ExtractFileExt(VideoFileName); 1539 | if not(SaveDialog1.Execute) then exit; 1540 | CopyFile(VideoFileName,SaveDialog1.FileName,True); 1541 | except 1542 | on E: Exception do begin MessageDlg(localText1,localText1+': '+E.Message,mtError,[mbOk],0); end; 1543 | end; 1544 | end else 1545 | begin 1546 | UpdateStatusMemoText(Memo2,localText2+VideoFileName,False,True); 1547 | end; 1548 | end; 1549 | 1550 | function TMainForm.LoadCurrentPictureToImage:Boolean; 1551 | var ImageFileName:String; 1552 | localText1,localText2,localText3:String; 1553 | begin 1554 | localText1:='Captured Image File Not Found: '; 1555 | localText2:='Attempting to Load Default Image'; 1556 | localText3:='Error'; 1557 | 1558 | Result:=False; 1559 | ImageFileName:=rpiGetCapturedPictureFileName; 1560 | if FileExists(ImageFileName) then 1561 | begin 1562 | try 1563 | Image2.Picture.LoadFromFile(ImageFileName); 1564 | Image2.Refresh; 1565 | Result:=True; 1566 | except 1567 | on E: Exception do begin MessageDlg(localText3,localText3+': '+E.Message,mtError,[mbOk],0); end; 1568 | end; 1569 | end else 1570 | begin 1571 | UpdateStatusMemoText(Memo2,localText1+ImageFileName,False,True); 1572 | UpdateStatusMemoText(Memo2,localText2,False,True); 1573 | ImageFileName:=AppURL+c_DataDir+c_DefaultImageName; 1574 | if FileExists(ImageFileName) then 1575 | begin 1576 | try 1577 | Image2.Picture.LoadFromFile(ImageFileName); 1578 | Image2.Refresh; 1579 | except 1580 | on E: Exception do begin MessageDlg(localText3,localText3+': '+E.Message,mtError,[mbOk],0); end; 1581 | end; 1582 | end; 1583 | end; 1584 | end; 1585 | 1586 | function TMainForm.LoadCurrentVideoToImage:Boolean; 1587 | //var VideoFileName:String; 1588 | begin 1589 | Result:=True; 1590 | {Result:=False; 1591 | VideoFileName:=rpiGetCapturedVideoFileName; 1592 | if FileExists(VideoFileName) then 1593 | begin 1594 | try 1595 | Image2.Picture.LoadFromFile(VideoFileName); 1596 | Image2.Refresh; 1597 | Result:=True; 1598 | except 1599 | on E: Exception do begin MessageDlg('Error','Error: '+E.Message,mtError,[mbOk],0); end; 1600 | end; 1601 | end else 1602 | begin 1603 | UpdateStatusMemoText(Memo2,'Captured Image File Not Found: '+VideoFileName,False); 1604 | UpdateStatusMemoText(Memo2,'Attempting to Load Default Image',False); 1605 | VideoFileName:=AppURL+c_DataDir+c_DefaultImageName; 1606 | if FileExists(VideoFileName) then 1607 | begin 1608 | try 1609 | Image2.Picture.LoadFromFile(VideoFileName); 1610 | Image2.Refresh; 1611 | except 1612 | on E: Exception do begin MessageDlg('Error','Error: '+E.Message,mtError,[mbOk],0); end; 1613 | end; 1614 | end; 1615 | end;} 1616 | end; 1617 | 1618 | procedure TMainForm.UpdateStatusMemoText(lMemo:TMemo; const MemoText:String; const ClearMemoText:Boolean; const SetAtEnd:Boolean); 1619 | begin 1620 | if (ClearMemoText) and not(MemoText='') then // clear the lmemo first and then write the text 1621 | begin 1622 | lMemo.Lines.Clear; 1623 | lMemo.Lines.Add(MemoText); 1624 | end else 1625 | begin 1626 | if (ClearMemoText) then 1627 | begin 1628 | lMemo.Lines.Clear; // clear the lmemo only 1629 | end else 1630 | begin 1631 | lMemo.Lines.Add(MemoText); // add text 1632 | end; 1633 | end; 1634 | 1635 | if SetAtEnd then 1636 | begin 1637 | lMemo.SelStart := Length(lMemo.Text); //set lmemo text position at end 1638 | end; 1639 | end; 1640 | 1641 | procedure TMainForm.UpdateLabelText(lLabel:TLabel; const HintText:String); 1642 | begin 1643 | lLabel.Caption:=HintText; 1644 | lLabel.Update; 1645 | end; 1646 | 1647 | procedure TMainForm.HighLightSelectedButton(lButton:TButton; const PC:Integer); 1648 | begin 1649 | case PC of 1650 | 1: begin 1651 | Button1.Font.Style:=[]; 1652 | Button2.Font.Style:=[]; 1653 | Button3.Font.Style:=[]; 1654 | Button4.Font.Style:=[]; 1655 | Button5.Font.Style:=[]; 1656 | Button6.Font.Style:=[]; 1657 | end; 1658 | end; 1659 | 1660 | lButton.Font.Style:=[fsBold]; 1661 | end; 1662 | 1663 | {$ENDREGION 'Support} 1664 | 1665 | {$REGION 'Main'} 1666 | 1667 | procedure TMainForm.Button1Click(Sender: TObject);//start terminal 1668 | var localText1:String; 1669 | begin 1670 | localText1:='Error'; 1671 | try 1672 | rpiExcecuteLocalProcessSudo(v_UserPass,c_Terminal,False,Memo1,Memo2); 1673 | except 1674 | on E: Exception do begin MessageDlg(localText1,localText1+c_DoublePoint+E.Message,mtError,[mbOk],0); end; 1675 | end; 1676 | end; 1677 | 1678 | procedure TMainForm.Button10Click(Sender: TObject); //make video 1679 | var localText1:String; 1680 | begin 1681 | localText1:='Error'; 1682 | 1683 | ReadAllControls; 1684 | v_CaptureMode_Index:=3; //video 1685 | 1686 | try 1687 | rpiExcecuteLocalProcessSudo(v_UserPass,rpiGetStackedCommand,False,Memo1,Memo2); 1688 | except 1689 | on E: Exception do begin MessageDlg(localText1,localText1+c_DoublePoint+E.Message,mtError,[mbOk],0); end; 1690 | end; 1691 | if LoadCurrentVideoToImage then begin SaveCapturedVideoAs; end; 1692 | end; 1693 | 1694 | procedure TMainForm.Button9Click(Sender: TObject);//settings preview 1695 | var localText1:String; 1696 | begin 1697 | localText1:='Error'; 1698 | 1699 | ReadAllControls; 1700 | v_CaptureMode_Index:=1; //picture, no save image 1701 | try 1702 | rpiExcecuteLocalProcessSudo(v_UserPass,rpiGetStackedCommand,False,Memo1,Memo2); 1703 | except 1704 | on E: Exception do begin MessageDlg(localText1,localText1+c_DoublePoint+E.Message,mtError,[mbOk],0); end; 1705 | end; 1706 | end; 1707 | 1708 | procedure TMainForm.Button7Click(Sender: TObject); //test preview/demo 1709 | var localText1:String; 1710 | begin 1711 | localText1:='Error'; 1712 | 1713 | ReadAllControls; 1714 | try 1715 | if v_ShowDemoPreview then 1716 | begin 1717 | rpiExcecuteLocalProcessSudo(v_UserPass,cmd_QuickCameraPreviewDemoMode,False,Memo1,Memo2); 1718 | end else 1719 | begin 1720 | rpiExcecuteLocalProcessSudo(v_UserPass,cmd_QuickCameraPreview,False,Memo1,Memo2); 1721 | end; 1722 | except 1723 | on E: Exception do begin MessageDlg(localText1,localText1+c_DoublePoint+E.Message,mtError,[mbOk],0); end; 1724 | end; 1725 | end; 1726 | 1727 | procedure TMainForm.Button8Click(Sender: TObject); //take picture 1728 | var localText1,localText2:String; 1729 | begin 1730 | v_CaptureMode_Index:=1;//picture 1731 | localText1:='Set Duration is Smaller than Delay'; 1732 | localText2:='Error'; 1733 | 1734 | ReadAllControls; 1735 | if not(v_Image_MakeTimeLapse) then 1736 | begin 1737 | rpiClearPreviousCapturedImage; 1738 | try 1739 | rpiExcecuteLocalProcessSudo(v_UserPass,rpiGetStackedCommand,False,Memo1,Memo2) 1740 | except 1741 | on E: Exception do begin MessageDlg(localText2,localText2+c_DoublePoint+E.Message,mtError,[mbOk],0); exit; end; 1742 | end; 1743 | if LoadCurrentPictureToImage then begin SaveCapturedPictureAs; end; 1744 | end else 1745 | begin 1746 | if (v_Image_Duration<v_Image_Delay) then 1747 | begin 1748 | MessageDlg(localText1,mtWarning,[mbOk],0); 1749 | exit; 1750 | end; 1751 | if (v_UserSelectedDirectory='') or not(DirectoryExists(v_UserSelectedDirectory)) then 1752 | begin 1753 | if not(SelectUserDirectory) then 1754 | begin 1755 | if (v_UserSelectedDirectory='') then begin exit; end; 1756 | end; 1757 | end; 1758 | try 1759 | rpiExcecuteLocalProcessSudo(v_UserPass,rpiGetStackedCommand,False,Memo1,Memo2) 1760 | except 1761 | on E: Exception do begin MessageDlg(localText2,localText2+c_DoublePoint+E.Message,mtError,[mbOk],0); exit; end; 1762 | end; 1763 | end; 1764 | end; 1765 | 1766 | procedure TMainForm.Button14Click(Sender: TObject); //network video streaming 1767 | var localText1:String; 1768 | begin 1769 | v_CaptureMode_Index:=4;//video network stream 1770 | localText1:='Error'; 1771 | 1772 | ReadAllControls; 1773 | try 1774 | rpiExcecuteLocalProcessSudo(v_UserPass,rpiGetStackedCommand,False,Memo1,Memo2) 1775 | except 1776 | on E: Exception do begin MessageDlg(localText1,localText1+c_DoublePoint+c_Space+E.Message,mtError,[mbOk],0); exit; end; 1777 | end; 1778 | end; 1779 | 1780 | {$ENDREGION 'Main'} 1781 | 1782 | end. 1783 | 1784 | -------------------------------------------------------------------------------- /source/gsf: -------------------------------------------------------------------------------- 1 | Application Title 2 | Pi Vision 3 | User Language 4 | 0 5 | Application Theme 6 | 0 7 | User Selected Directory 8 | 9 | Preview Position Index 10 | 0 11 | Preview Size Index 12 | 2 13 | Preview Show Preview 14 | 1 15 | Preview FullScreen 16 | -1 17 | Image Ext Index 18 | 0 19 | Image Quality Index 20 | 0 21 | Image Width Index 22 | 2 23 | Image Effect Index 24 | 0 25 | Image Make Time Lapse 26 | -1 27 | Image Flip Horizontal 28 | -1 29 | Image Flip Vertical 30 | -1 31 | Image Duration 32 | 5000 33 | Image Delay 34 | 1000 35 | Image RAW Output 36 | -1 37 | Image ISO Output 38 | -1 39 | Video Size Index 40 | 2 41 | Video Quality Index 42 | 1 43 | Video FPS Index 44 | 3 45 | Image Flip Vertical 46 | -1 47 | Video Duration 48 | 5000 49 | Camera Brightness Index 50 | 3 51 | Camera Contrast Index 52 | 3 53 | Camera Sharpness Index 54 | 3 55 | Camera Saturation Index 56 | 3 57 | Camera AWB Index 58 | 1 59 | Camera EV Index 60 | 3 61 | Camera Exposure Index 62 | 1 63 | Camera Rotation Index 64 | 0 65 | Camera_Metering_Index 66 | 0 67 | Camera ColorEffect U_Index 68 | 0 69 | Camera ColorEffect V_Index 70 | 0 71 | Camera ColorEffectUV 72 | -1 73 | Network Port 74 | 5001 75 | Network Duration 76 | 5000 77 | IP Address 78 | 0 79 | -------------------------------------------------------------------------------- /source/img/PiVision_images.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/img/PiVision_images.zip -------------------------------------------------------------------------------- /source/lib/arm-linux/rpiCC.compiled: -------------------------------------------------------------------------------- 1 | <?xml version="1.0"?> 2 | <CONFIG> 3 | <Compiler Value="/usr/bin/fpc" Date="1358923363"/> 4 | <Params Value=" -MObjFPC -Scghi -O1 -gl -vewnhi -l -Fi/home/pi/Desktop/Lazarus/Projects/Pi-Vision-master/source/lib/arm-linux -Fu/usr/lib/lazarus/0.9.30.4/lcl/units/arm-linux -Fu/usr/lib/lazarus/0.9.30.4/lcl/units/arm-linux/gtk2 -Fu/usr/lib/lazarus/0.9.30.4/packager/units/arm-linux -Fu/home/pi/Desktop/Lazarus/Projects/Pi-Vision-master/source/ -Fu. -FU/home/pi/Desktop/Lazarus/Projects/Pi-Vision-master/source/lib/arm-linux/ -orpiCC -dLCL -dLCLgtk2 rpiCC.lpr"/> 5 | </CONFIG> 6 | -------------------------------------------------------------------------------- /source/lib/arm-linux/rpiCC.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/arm-linux/rpiCC.o -------------------------------------------------------------------------------- /source/lib/arm-linux/rpiCC.or: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/arm-linux/rpiCC.or -------------------------------------------------------------------------------- /source/lib/arm-linux/rpiCC.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/arm-linux/rpiCC.res -------------------------------------------------------------------------------- /source/lib/arm-linux/rpiccbackendmanager.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/arm-linux/rpiccbackendmanager.o -------------------------------------------------------------------------------- /source/lib/arm-linux/rpiccbackendmanager.ppu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/arm-linux/rpiccbackendmanager.ppu -------------------------------------------------------------------------------- /source/lib/arm-linux/rpiccmainform.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/arm-linux/rpiccmainform.o -------------------------------------------------------------------------------- /source/lib/arm-linux/rpiccmainform.ppu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/arm-linux/rpiccmainform.ppu -------------------------------------------------------------------------------- /source/lib/x86_64-linux/rpiCC.compiled: -------------------------------------------------------------------------------- 1 | <?xml version="1.0"?> 2 | <CONFIG> 3 | <Compiler Value="/usr/bin/fpc" Date="1363520124"/> 4 | <Params Value=" -MObjFPC -Scghi -O1 -vewnhi -Fi/home/sane/Pi-Vision/source/lib/x86_64-linux -Fl/opt/gnome/lib -Fu/usr/share/lazarus/1.0.8/lcl/units/x86_64-linux/gtk2 -Fu/usr/share/lazarus/1.0.8/lcl/units/x86_64-linux -Fu/usr/share/lazarus/1.0.8/components/lazutils/lib/x86_64-linux -Fu/usr/share/lazarus/1.0.8/packager/units/x86_64-linux -Fu/home/sane/Pi-Vision/source/ -FU/home/sane/Pi-Vision/source/lib/x86_64-linux/ -l -dLCL -dLCLgtk2 rpiCC.lpr"/> 5 | </CONFIG> 6 | -------------------------------------------------------------------------------- /source/lib/x86_64-linux/rpiCC.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-linux/rpiCC.o -------------------------------------------------------------------------------- /source/lib/x86_64-linux/rpiCC.or: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-linux/rpiCC.or -------------------------------------------------------------------------------- /source/lib/x86_64-linux/rpiCC.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-linux/rpiCC.res -------------------------------------------------------------------------------- /source/lib/x86_64-linux/rpiccbackendmanager.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-linux/rpiccbackendmanager.o -------------------------------------------------------------------------------- /source/lib/x86_64-linux/rpiccbackendmanager.ppu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-linux/rpiccbackendmanager.ppu -------------------------------------------------------------------------------- /source/lib/x86_64-linux/rpiccmainform.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-linux/rpiccmainform.o -------------------------------------------------------------------------------- /source/lib/x86_64-linux/rpiccmainform.ppu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-linux/rpiccmainform.ppu -------------------------------------------------------------------------------- /source/lib/x86_64-win64/rpiCC.compiled: -------------------------------------------------------------------------------- 1 | <?xml version="1.0"?> 2 | <CONFIG> 3 | <Compiler Value="C:\lazarus\fpc\2.6.2\bin\x86_64-win64\fpc.exe" Date="1114731730"/> 4 | <Params Value=" -MObjFPC -Scghi -O1 -WG -vewnhi -FiC:\Users\intricad001\Documents\LazarusProjects\projects\RPiCameraController\lib\x86_64-win64 -FuC:\lazarus\lcl\units\x86_64-win64\win32 -FuC:\lazarus\lcl\units\x86_64-win64 -FuC:\lazarus\components\lazutils\lib\x86_64-win64 -FuC:\lazarus\packager\units\x86_64-win64 -FuC:\Users\intricad001\Documents\LazarusProjects\projects\RPiCameraController\ -FUC:\Users\intricad001\Documents\LazarusProjects\projects\RPiCameraController\lib\x86_64-win64\ -l -dLCL -dLCLwin32 rpiCC.lpr"/> 5 | </CONFIG> 6 | -------------------------------------------------------------------------------- /source/lib/x86_64-win64/rpiCC.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-win64/rpiCC.o -------------------------------------------------------------------------------- /source/lib/x86_64-win64/rpiCC.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-win64/rpiCC.obj -------------------------------------------------------------------------------- /source/lib/x86_64-win64/rpiCC.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-win64/rpiCC.res -------------------------------------------------------------------------------- /source/lib/x86_64-win64/rpiccbackendmanager.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-win64/rpiccbackendmanager.o -------------------------------------------------------------------------------- /source/lib/x86_64-win64/rpiccbackendmanager.ppu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-win64/rpiccbackendmanager.ppu -------------------------------------------------------------------------------- /source/lib/x86_64-win64/rpiccmainform.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-win64/rpiccmainform.o -------------------------------------------------------------------------------- /source/lib/x86_64-win64/rpiccmainform.ppu: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/lib/x86_64-win64/rpiccmainform.ppu -------------------------------------------------------------------------------- /source/rpiCC: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/rpiCC -------------------------------------------------------------------------------- /source/rpiCC.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/rpiCC.ico -------------------------------------------------------------------------------- /source/rpiCC.lpi: -------------------------------------------------------------------------------- 1 | <?xml version="1.0"?> 2 | <CONFIG> 3 | <ProjectOptions> 4 | <Version Value="9"/> 5 | <General> 6 | <SessionStorage Value="InProjectDir"/> 7 | <MainUnit Value="0"/> 8 | <Title Value="Pi Vision"/> 9 | <ResourceType Value="res"/> 10 | <UseXPManifest Value="True"/> 11 | <Icon Value="0"/> 12 | </General> 13 | <i18n> 14 | <EnableI18N LFM="False"/> 15 | </i18n> 16 | <VersionInfo> 17 | <UseVersionInfo Value="True"/> 18 | <AutoIncrementBuild Value="True"/> 19 | <BuildNr Value="68"/> 20 | <StringTable Comments="Camera Control for your Raspberry Pi" CompanyName="intricad" ProductName="Pi Vision" ProductVersion="1"/> 21 | </VersionInfo> 22 | <BuildModes Count="2"> 23 | <Item1 Name="Default" Default="True"/> 24 | <Item2 Name="Release"> 25 | <CompilerOptions> 26 | <Version Value="11"/> 27 | <Target> 28 | <Filename Value="rpiCC"/> 29 | </Target> 30 | <SearchPaths> 31 | <IncludeFiles Value="$(ProjOutDir)"/> 32 | <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 33 | </SearchPaths> 34 | <Linking> 35 | <Debugging> 36 | <GenerateDebugInfo Value="False"/> 37 | </Debugging> 38 | <Options> 39 | <Win32> 40 | <GraphicApplication Value="True"/> 41 | </Win32> 42 | </Options> 43 | </Linking> 44 | <Other> 45 | <CompilerMessages> 46 | <MsgFileName Value=""/> 47 | </CompilerMessages> 48 | <CompilerPath Value="$(CompPath)"/> 49 | </Other> 50 | </CompilerOptions> 51 | </Item2> 52 | </BuildModes> 53 | <PublishOptions> 54 | <Version Value="2"/> 55 | <IncludeFileFilter Value="*.(pas|pp|inc|lfm|lpr|lrs|lpi|lpk|sh|xml)"/> 56 | <ExcludeFileFilter Value="*.(bak|ppu|o|so);*~;backup"/> 57 | </PublishOptions> 58 | <RunParams> 59 | <local> 60 | <FormatVersion Value="1"/> 61 | </local> 62 | </RunParams> 63 | <RequiredPackages Count="1"> 64 | <Item1> 65 | <PackageName Value="LCL"/> 66 | </Item1> 67 | </RequiredPackages> 68 | <Units Count="3"> 69 | <Unit0> 70 | <Filename Value="rpiCC.lpr"/> 71 | <IsPartOfProject Value="True"/> 72 | <UnitName Value="rpiCC"/> 73 | </Unit0> 74 | <Unit1> 75 | <Filename Value="rpiccmainform.pas"/> 76 | <IsPartOfProject Value="True"/> 77 | <ComponentName Value="MainForm"/> 78 | <HasResources Value="True"/> 79 | <ResourceBaseClass Value="Form"/> 80 | <UnitName Value="rpiCCMainForm"/> 81 | </Unit1> 82 | <Unit2> 83 | <Filename Value="rpiccbackendmanager.pas"/> 84 | <IsPartOfProject Value="True"/> 85 | <UnitName Value="rpiccBackEndManager"/> 86 | </Unit2> 87 | </Units> 88 | </ProjectOptions> 89 | <CompilerOptions> 90 | <Version Value="11"/> 91 | <Target> 92 | <Filename Value="rpiCC"/> 93 | </Target> 94 | <SearchPaths> 95 | <IncludeFiles Value="$(ProjOutDir)"/> 96 | <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 97 | </SearchPaths> 98 | <Linking> 99 | <Options> 100 | <Win32> 101 | <GraphicApplication Value="True"/> 102 | </Win32> 103 | </Options> 104 | </Linking> 105 | <Other> 106 | <CompilerMessages> 107 | <MsgFileName Value=""/> 108 | </CompilerMessages> 109 | <CompilerPath Value="$(CompPath)"/> 110 | </Other> 111 | </CompilerOptions> 112 | <Debugging> 113 | <Exceptions Count="3"> 114 | <Item1> 115 | <Name Value="EAbort"/> 116 | </Item1> 117 | <Item2> 118 | <Name Value="ECodetoolError"/> 119 | </Item2> 120 | <Item3> 121 | <Name Value="EFOpenError"/> 122 | </Item3> 123 | </Exceptions> 124 | </Debugging> 125 | </CONFIG> 126 | -------------------------------------------------------------------------------- /source/rpiCC.lpr: -------------------------------------------------------------------------------- 1 | { 2 | This file (rpicc) is part of Pi Vision. 3 | 4 | What is Pi Vision? 5 | 6 | Pi Vision is a Graphics User Interface for the Raspberry Pi Camera. 7 | It allows you to controll the camera functions throught the camera's 8 | native apps. It also displays the terminal commands sent. 9 | 10 | Copyright 11 | 12 | Pi Vision Copyright 2013 B.J.Rao. All Rights Reserved. 13 | 14 | This program is free software; you can redistribute it and/or 15 | modify it under the terms of the GNU General Public License version 2 16 | as published by the Free Software Foundation. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program; if not, write to the Free Software 25 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | 27 | Attributions 28 | 29 | videopageimage.jpg: 30 | Under the CC BY-NC "Fir0002/Flagstaffotos" http://www.flagstaffotos.com.au/ 31 | 32 | infopageimage.jpg: 33 | Under the CC BY-NC B.J.Rao 34 | 35 | mainpageimage.jpg: 36 | Under the CC BY-NC B.J.Rao 37 | 38 | Trademarks 39 | 40 | All trademarks are the property of their respective owners 41 | - Raspberry Pi is a trademark owned by the Raspberry Pi Foundation 42 | 43 | Disclaimer 44 | 45 | Provider=B.J.Rao 46 | 47 | IN NO EVENT SHALL Provider BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 48 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, 49 | ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 50 | REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51 | 52 | Provider SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED 53 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 54 | PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED 55 | HEREUNDER IS PROVIDED "AS IS". Provider HAS NO OBLIGATION TO PROVIDE 56 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS 57 | 58 | } 59 | 60 | program rpiCC; 61 | 62 | {$mode objfpc}{$H+} 63 | 64 | uses 65 | {$IFDEF UNIX}{$IFDEF UseCThreads} 66 | cthreads, 67 | {$ENDIF}{$ENDIF} 68 | Interfaces, // this includes the LCL widgetset 69 | Forms, rpiCCMainForm, rpiccBackEndManager 70 | { you can add units after this }; 71 | 72 | {$R *.res} 73 | 74 | begin 75 | Application.Title:='Pi Vision'; 76 | //RequireDerivedFormResource := True; 77 | Application.Initialize; 78 | Application.CreateForm(TMainForm, MainForm); 79 | Application.Run; 80 | end. 81 | 82 | -------------------------------------------------------------------------------- /source/rpiCC.lps: -------------------------------------------------------------------------------- 1 | <?xml version="1.0"?> 2 | <CONFIG> 3 | <ProjectSession> 4 | <Version Value="9"/> 5 | <BuildModes Active="Release"/> 6 | <Units Count="4"> 7 | <Unit0> 8 | <Filename Value="rpiCC.lpr"/> 9 | <IsPartOfProject Value="True"/> 10 | <UnitName Value="rpiCC"/> 11 | <EditorIndex Value="2"/> 12 | <WindowIndex Value="0"/> 13 | <TopLine Value="45"/> 14 | <CursorPos X="46" Y="60"/> 15 | <UsageCount Value="201"/> 16 | <Loaded Value="True"/> 17 | </Unit0> 18 | <Unit1> 19 | <Filename Value="rpiccmainform.pas"/> 20 | <IsPartOfProject Value="True"/> 21 | <ComponentName Value="MainForm"/> 22 | <HasResources Value="True"/> 23 | <ResourceBaseClass Value="Form"/> 24 | <UnitName Value="rpiCCMainForm"/> 25 | <EditorIndex Value="0"/> 26 | <WindowIndex Value="0"/> 27 | <TopLine Value="1691"/> 28 | <CursorPos X="3" Y="1697"/> 29 | <UsageCount Value="201"/> 30 | <Loaded Value="True"/> 31 | <LoadedDesigner Value="True"/> 32 | </Unit1> 33 | <Unit2> 34 | <Filename Value="rpiccbackendmanager.pas"/> 35 | <IsPartOfProject Value="True"/> 36 | <UnitName Value="rpiccBackEndManager"/> 37 | <IsVisibleTab Value="True"/> 38 | <EditorIndex Value="1"/> 39 | <WindowIndex Value="0"/> 40 | <TopLine Value="1550"/> 41 | <CursorPos X="32" Y="1559"/> 42 | <FoldState Value=" TJiO2_.1 pjPjT2~a032p"/> 43 | <UsageCount Value="201"/> 44 | <Loaded Value="True"/> 45 | </Unit2> 46 | <Unit3> 47 | <Filename Value="/usr/share/lazarus/1.0.8/lcl/extctrls.pp"/> 48 | <UnitName Value="ExtCtrls"/> 49 | <WindowIndex Value="0"/> 50 | <TopLine Value="680"/> 51 | <CursorPos X="14" Y="542"/> 52 | <UsageCount Value="10"/> 53 | </Unit3> 54 | </Units> 55 | <General> 56 | <ActiveWindowIndexAtStart Value="0"/> 57 | </General> 58 | <JumpHistory Count="0" HistoryIndex="-1"/> 59 | </ProjectSession> 60 | </CONFIG> 61 | -------------------------------------------------------------------------------- /source/rpiCC.res: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/local-vision/Pi-Vision/7103318a14afb0400d6b964cc7fb93e949a29ea7/source/rpiCC.res -------------------------------------------------------------------------------- /source/rpiccmainform.pas: -------------------------------------------------------------------------------- 1 | { 2 | This file (rpiCCMainForm) is part of Pi Vision. 3 | 4 | What is Pi Vision? 5 | 6 | Pi Vision is a Graphics User Interface for the Raspberry Pi Camera. 7 | It allows you to controll the camera functions throught the camera's 8 | native apps. It also displays the terminal commands sent. 9 | 10 | Copyright 11 | 12 | Pi Vision Copyright 2013 B.J.Rao. All Rights Reserved. 13 | 14 | This program is free software; you can redistribute it and/or 15 | modify it under the terms of the GNU General Public License version 2 16 | as published by the Free Software Foundation. 17 | 18 | This program is distributed in the hope that it will be useful, 19 | but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | GNU General Public License for more details. 22 | 23 | You should have received a copy of the GNU General Public License 24 | along with this program; if not, write to the Free Software 25 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 26 | 27 | Attributions 28 | 29 | videopageimage.jpg: 30 | Under the CC BY-NC "Fir0002/Flagstaffotos" http://www.flagstaffotos.com.au/ 31 | 32 | infopageimage.jpg: 33 | Under the CC BY-NC B.J.Rao 34 | 35 | mainpageimage.jpg: 36 | Under the CC BY-NC B.J.Rao 37 | 38 | Trademarks 39 | 40 | All trademarks are the property of their respective owners 41 | - Raspberry Pi is a trademark owned by the Raspberry Pi Foundation 42 | 43 | Disclaimer 44 | 45 | Provider=B.J.Rao 46 | 47 | IN NO EVENT SHALL Provider BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 48 | SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, 49 | ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF 50 | REGENTS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 51 | 52 | Provider SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED 53 | TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 54 | PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED 55 | HEREUNDER IS PROVIDED "AS IS". Provider HAS NO OBLIGATION TO PROVIDE 56 | MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS 57 | 58 | } 59 | 60 | unit rpiCCMainForm; 61 | 62 | {$mode objfpc}{$H+} 63 | 64 | interface 65 | 66 | uses 67 | Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, 68 | StdCtrls, ExtCtrls, ExtDlgs; 69 | 70 | type 71 | 72 | { TMainForm } 73 | 74 | TMainForm = class(TForm) 75 | Button1: TButton; 76 | Button10: TButton; 77 | Button11: TButton; 78 | Button12: TButton; 79 | Button13: TButton; 80 | Button14: TButton; 81 | Button15: TButton; 82 | Button16: TButton; 83 | Button17: TButton; 84 | Button18: TButton; 85 | Button19: TButton; 86 | Button2: TButton; 87 | Button3: TButton; 88 | Button4: TButton; 89 | Button5: TButton; 90 | Button6: TButton; 91 | Button7: TButton; 92 | Button8: TButton; 93 | Button9: TButton; 94 | CheckBox1: TCheckBox; 95 | CheckBox10: TCheckBox; 96 | CheckBox2: TCheckBox; 97 | CheckBox3: TCheckBox; 98 | CheckBox4: TCheckBox; 99 | CheckBox5: TCheckBox; 100 | CheckBox6: TCheckBox; 101 | CheckBox7: TCheckBox; 102 | CheckBox8: TCheckBox; 103 | CheckBox9: TCheckBox; 104 | ComboBox1: TComboBox; 105 | ComboBox10: TComboBox; 106 | ComboBox11: TComboBox; 107 | ComboBox12: TComboBox; 108 | ComboBox13: TComboBox; 109 | ComboBox14: TComboBox; 110 | ComboBox15: TComboBox; 111 | ComboBox16: TComboBox; 112 | ComboBox17: TComboBox; 113 | ComboBox18: TComboBox; 114 | ComboBox19: TComboBox; 115 | ComboBox2: TComboBox; 116 | ComboBox20: TComboBox; 117 | ComboBox3: TComboBox; 118 | ComboBox4: TComboBox; 119 | ComboBox5: TComboBox; 120 | ComboBox6: TComboBox; 121 | ComboBox7: TComboBox; 122 | ComboBox8: TComboBox; 123 | ComboBox9: TComboBox; 124 | Edit1: TEdit; 125 | Edit2: TEdit; 126 | Edit3: TEdit; 127 | Edit4: TEdit; 128 | Edit5: TEdit; 129 | Edit6: TEdit; 130 | Image1: TImage; 131 | Image2: TImage; 132 | Image3: TImage; 133 | Image4: TImage; 134 | Label1: TLabel; 135 | Label10: TLabel; 136 | Label11: TLabel; 137 | Label12: TLabel; 138 | Label13: TLabel; 139 | Label14: TLabel; 140 | Label15: TLabel; 141 | Label16: TLabel; 142 | Label17: TLabel; 143 | Label18: TLabel; 144 | Label19: TLabel; 145 | Label2: TLabel; 146 | Label20: TLabel; 147 | Label21: TLabel; 148 | Label22: TLabel; 149 | Label23: TLabel; 150 | Label24: TLabel; 151 | Label25: TLabel; 152 | Label26: TLabel; 153 | Label27: TLabel; 154 | Label28: TLabel; 155 | Label29: TLabel; 156 | Label3: TLabel; 157 | Label30: TLabel; 158 | Label31: TLabel; 159 | Label32: TLabel; 160 | Label33: TLabel; 161 | Label34: TLabel; 162 | Label35: TLabel; 163 | Label36: TLabel; 164 | Label4: TLabel; 165 | Label5: TLabel; 166 | Label6: TLabel; 167 | Label7: TLabel; 168 | Label8: TLabel; 169 | Label9: TLabel; 170 | Memo1: TMemo; 171 | Memo2: TMemo; 172 | Memo3: TMemo; 173 | Memo4: TMemo; 174 | PageControl1: TPageControl; 175 | PageControl2: TPageControl; 176 | Panel1: TPanel; 177 | Panel10: TPanel; 178 | Panel2: TPanel; 179 | Panel3: TPanel; 180 | Panel4: TPanel; 181 | Panel5: TPanel; 182 | Panel6: TPanel; 183 | Panel7: TPanel; 184 | Panel8: TPanel; 185 | Panel9: TPanel; 186 | SaveDialog1: TSaveDialog; 187 | SavePictureDialog1: TSavePictureDialog; 188 | SelectDirectoryDialog1: TSelectDirectoryDialog; 189 | TabSheet1: TTabSheet; 190 | TabSheet2: TTabSheet; 191 | TabSheet3: TTabSheet; 192 | TabSheet4: TTabSheet; 193 | TabSheet5: TTabSheet; 194 | TabSheet6: TTabSheet; 195 | TabSheet7: TTabSheet; 196 | TabSheet8: TTabSheet; 197 | TabSheet9: TTabSheet; 198 | procedure Button10Click(Sender: TObject); 199 | procedure Button10MouseEnter(Sender: TObject); 200 | procedure Button11Click(Sender: TObject); 201 | procedure Button11MouseEnter(Sender: TObject); 202 | procedure Button12Click(Sender: TObject); 203 | procedure Button12MouseEnter(Sender: TObject); 204 | procedure Button13Click(Sender: TObject); 205 | procedure Button13MouseEnter(Sender: TObject); 206 | procedure Button14Click(Sender: TObject); 207 | procedure Button14MouseEnter(Sender: TObject); 208 | procedure Button16Click(Sender: TObject); 209 | procedure Button16MouseEnter(Sender: TObject); 210 | procedure Button17Click(Sender: TObject); 211 | procedure Button17MouseEnter(Sender: TObject); 212 | procedure Button18Click(Sender: TObject); 213 | procedure Button18MouseEnter(Sender: TObject); 214 | procedure Button1Click(Sender: TObject); 215 | procedure Button1MouseEnter(Sender: TObject); 216 | procedure Button2Click(Sender: TObject); 217 | procedure Button2MouseEnter(Sender: TObject); 218 | procedure Button2MouseLeave(Sender: TObject); 219 | procedure Button3Click(Sender: TObject); 220 | procedure Button3MouseEnter(Sender: TObject); 221 | procedure Button4Click(Sender: TObject); 222 | procedure Button4MouseEnter(Sender: TObject); 223 | procedure Button5Click(Sender: TObject); 224 | procedure Button5MouseEnter(Sender: TObject); 225 | procedure Button6Click(Sender: TObject); 226 | procedure Button6MouseEnter(Sender: TObject); 227 | procedure Button7Click(Sender: TObject); 228 | procedure Button7MouseEnter(Sender: TObject); 229 | procedure Button8Click(Sender: TObject); 230 | procedure Button8MouseEnter(Sender: TObject); 231 | procedure Button9Click(Sender: TObject); 232 | procedure Button9MouseEnter(Sender: TObject); 233 | procedure CheckBox10Change(Sender: TObject); 234 | procedure CheckBox10MouseEnter(Sender: TObject); 235 | procedure CheckBox1MouseEnter(Sender: TObject); 236 | procedure CheckBox2MouseEnter(Sender: TObject); 237 | procedure CheckBox3MouseEnter(Sender: TObject); 238 | procedure CheckBox4MouseEnter(Sender: TObject); 239 | procedure CheckBox5MouseEnter(Sender: TObject); 240 | procedure CheckBox6MouseEnter(Sender: TObject); 241 | procedure CheckBox7MouseEnter(Sender: TObject); 242 | procedure CheckBox8MouseEnter(Sender: TObject); 243 | procedure CheckBox9Change(Sender: TObject); 244 | procedure CheckBox9MouseEnter(Sender: TObject); 245 | procedure ComboBox10Change(Sender: TObject); 246 | procedure ComboBox10MouseEnter(Sender: TObject); 247 | procedure ComboBox11Change(Sender: TObject); 248 | procedure ComboBox11MouseEnter(Sender: TObject); 249 | procedure ComboBox12Change(Sender: TObject); 250 | procedure ComboBox12MouseEnter(Sender: TObject); 251 | procedure ComboBox13Change(Sender: TObject); 252 | procedure ComboBox13MouseEnter(Sender: TObject); 253 | procedure ComboBox14Change(Sender: TObject); 254 | procedure ComboBox14MouseEnter(Sender: TObject); 255 | procedure ComboBox15Change(Sender: TObject); 256 | procedure ComboBox15MouseEnter(Sender: TObject); 257 | procedure ComboBox16Change(Sender: TObject); 258 | procedure ComboBox16MouseEnter(Sender: TObject); 259 | procedure ComboBox17Change(Sender: TObject); 260 | procedure ComboBox17MouseEnter(Sender: TObject); 261 | procedure ComboBox18Change(Sender: TObject); 262 | procedure ComboBox18MouseEnter(Sender: TObject); 263 | procedure ComboBox19Change(Sender: TObject); 264 | procedure ComboBox19MouseEnter(Sender: TObject); 265 | procedure ComboBox1Change(Sender: TObject); 266 | procedure ComboBox1MouseEnter(Sender: TObject); 267 | procedure ComboBox20Change(Sender: TObject); 268 | procedure ComboBox20MouseEnter(Sender: TObject); 269 | procedure ComboBox2Change(Sender: TObject); 270 | procedure ComboBox2MouseEnter(Sender: TObject); 271 | procedure ComboBox3Change(Sender: TObject); 272 | procedure ComboBox3MouseEnter(Sender: TObject); 273 | procedure ComboBox4Change(Sender: TObject); 274 | procedure ComboBox4MouseEnter(Sender: TObject); 275 | procedure ComboBox5Change(Sender: TObject); 276 | procedure ComboBox5MouseEnter(Sender: TObject); 277 | procedure ComboBox6Change(Sender: TObject); 278 | procedure ComboBox6MouseEnter(Sender: TObject); 279 | procedure ComboBox7Change(Sender: TObject); 280 | procedure ComboBox7MouseEnter(Sender: TObject); 281 | procedure ComboBox8Change(Sender: TObject); 282 | procedure ComboBox8MouseEnter(Sender: TObject); 283 | procedure ComboBox9Change(Sender: TObject); 284 | procedure ComboBox9MouseEnter(Sender: TObject); 285 | procedure Edit1Exit(Sender: TObject); 286 | procedure Edit1KeyPress(Sender: TObject; var Key: char); 287 | procedure Edit1MouseEnter(Sender: TObject); 288 | procedure Edit2Exit(Sender: TObject); 289 | procedure Edit2KeyPress(Sender: TObject; var Key: char); 290 | procedure Edit2MouseEnter(Sender: TObject); 291 | procedure Edit3Exit(Sender: TObject); 292 | procedure Edit3KeyPress(Sender: TObject; var Key: char); 293 | procedure Edit3MouseEnter(Sender: TObject); 294 | procedure Edit4Exit(Sender: TObject); 295 | procedure Edit4KeyPress(Sender: TObject; var Key: char); 296 | procedure Edit4MouseEnter(Sender: TObject); 297 | procedure Edit5Exit(Sender: TObject); 298 | procedure Edit5KeyPress(Sender: TObject; var Key: char); 299 | procedure Edit5MouseEnter(Sender: TObject); 300 | procedure Edit6Exit(Sender: TObject); 301 | procedure Edit6KeyPress(Sender: TObject; var Key: char); 302 | procedure Edit6MouseEnter(Sender: TObject); 303 | procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 304 | procedure FormCreate(Sender: TObject); 305 | procedure FormShow(Sender: TObject); 306 | procedure Image2Click(Sender: TObject); 307 | procedure Image2MouseEnter(Sender: TObject); 308 | procedure Label10Click(Sender: TObject); 309 | procedure Label11Click(Sender: TObject); 310 | procedure Label12Click(Sender: TObject); 311 | procedure Label15Click(Sender: TObject); 312 | procedure Label16Click(Sender: TObject); 313 | procedure Label17Click(Sender: TObject); 314 | procedure Label18Click(Sender: TObject); 315 | procedure Label19Click(Sender: TObject); 316 | procedure Label20Click(Sender: TObject); 317 | procedure Label21Click(Sender: TObject); 318 | procedure Label22Click(Sender: TObject); 319 | procedure Label23Click(Sender: TObject); 320 | procedure Label24Click(Sender: TObject); 321 | procedure Label26Click(Sender: TObject); 322 | procedure Label27Click(Sender: TObject); 323 | procedure Label2Click(Sender: TObject); 324 | procedure Label2MouseEnter(Sender: TObject); 325 | procedure Label30Click(Sender: TObject); 326 | procedure Label31Click(Sender: TObject); 327 | procedure Label3Click(Sender: TObject); 328 | procedure Label4Click(Sender: TObject); 329 | procedure Label5Click(Sender: TObject); 330 | procedure Label6Click(Sender: TObject); 331 | procedure Label7Click(Sender: TObject); 332 | procedure Label8Click(Sender: TObject); 333 | procedure Label9Click(Sender: TObject); 334 | private 335 | procedure LoadComboBoxsItems; 336 | procedure InitializeAllControls; 337 | procedure ReadAllControls; 338 | procedure CleanUpForClosingApplication; 339 | procedure InitializeApplication; 340 | 341 | procedure UpdateStatusMemoText(lMemo:TMemo; const MemoText:String; const ClearMemoText:Boolean; const SetAtEnd:Boolean); 342 | procedure UpdateLabelText(lLabel:TLabel; const HintText:String); 343 | procedure HighLightSelectedButton(lButton:TButton; const PC:Integer); 344 | 345 | function SelectUserDirectory:Boolean; 346 | procedure SaveCapturedPictureAs; 347 | procedure SaveCapturedVideoAs; 348 | function LoadCurrentPictureToImage:Boolean; 349 | function LoadCurrentVideoToImage:Boolean; //non functional 350 | { private declarations } 351 | public 352 | { public declarations } 353 | end; 354 | 355 | var 356 | MainForm: TMainForm; 357 | 358 | implementation 359 | 360 | {$R *.lfm} 361 | 362 | { TMainForm } 363 | 364 | {$IFDEF LINUX} 365 | uses rpiccBackEndManager, lclintf, baseunix; 366 | {$ELSE} 367 | uses rpiccBackEndManager, lclintf; 368 | {$ENDIF} 369 | 370 | {$REGION 'Main Form Events'} 371 | 372 | procedure TMainForm.FormClose(Sender: TObject; var CloseAction: TCloseAction); 373 | begin 374 | CleanUpForClosingApplication; 375 | end; 376 | 377 | procedure TMainForm.FormCreate(Sender: TObject); 378 | begin 379 | InitializeApplication; 380 | end; 381 | 382 | procedure TMainForm.FormShow(Sender: TObject); 383 | var localText1,localText2,localText3,localText4:String; 384 | {$IFDEF LINUX} 385 | SystemInformation: UtsName; 386 | s:String; 387 | {$ENDIF} 388 | begin 389 | localText1:='Started'; 390 | localText2:='Client Screen Size'; 391 | localText3:='All Rights Reserved.'; 392 | localText4:='is an open source project created by'; 393 | 394 | UpdateStatusMemoText(Memo1,'',True,True); 395 | UpdateStatusMemoText(Memo1,c_Application_Title+c_Space+localText1,False,True); 396 | 397 | UpdateStatusMemoText(Memo1,localText2+c_DoublePoint+c_Space+rpiGetScreenSize,False,True); 398 | 399 | {$ifdef CPU32} 400 | //UpdateStatusMemoText(Memo1,'32-bit System',False); 401 | {$ENDIF} 402 | 403 | {$ifdef CPU64} 404 | //UpdateStatusMemoText(Memo1,'64-bit System',False); 405 | {$ENDIF} 406 | 407 | {$IFDEF UNIX} 408 | //UpdateStatusMemoText(Memo1,'Unix',False); 409 | {$ENDIF} 410 | 411 | {$IFDEF LINUX} 412 | {try 413 | fpuname(SystemInformation); 414 | 415 | s:='OS:'+SystemInformation.sysname; 416 | UpdateStatusMemoText(Memo1,s,False); 417 | s:='Name '+SystemInformation.nodename; 418 | UpdateStatusMemoText(Memo1,s,False); 419 | s:='Release:'+SystemInformation.release; 420 | UpdateStatusMemoText(Memo1,s,False); 421 | s:='Version:'+SystemInformation.version; 422 | UpdateStatusMemoText(Memo1,s,False); 423 | s:='Machine:'+SystemInformation.machine; 424 | UpdateStatusMemoText(Memo1,s,False); 425 | except 426 | // 427 | end;} 428 | {$ENDIF} 429 | 430 | {$IFDEF DARWIN} 431 | UpdateStatusMemoText(Memo1,'OS: Darwin',False,True); 432 | {$ENDIF} 433 | 434 | {$IFDEF WIN32} 435 | UpdateStatusMemoText(Memo1,'OS: Windows 32 Bit',False,True); 436 | {$ENDIF} 437 | 438 | {$IFDEF WIN64} 439 | UpdateStatusMemoText(Memo1,'OS: Windows 64 Bit',False,True); 440 | {$ENDIF} 441 | 442 | UpdateLabelText(Label32,c_Application_Title); 443 | UpdateLabelText(Label33,c_Aplication_About); 444 | 445 | UpdateLabelText(Label34,c_Application_Title); 446 | UpdateLabelText(Label35,c_Aplication_About); 447 | UpdateLabelText(Label36,localText3+c_Space+c_Application_Title+c_Space+localText4+c_Space+c_Project_Creator); 448 | 449 | v_ApplicationStarted:=True; 450 | end; 451 | 452 | {$ENDREGION 'Main Form Events'} 453 | 454 | {$REGION 'Controls'} 455 | 456 | {$REGION 'LabelTextDefault'} 457 | 458 | procedure TMainForm.Label2Click(Sender: TObject); 459 | begin 460 | ComboBox1.ItemIndex:=c_Default_Image_Ext_Index; 461 | end; 462 | 463 | procedure TMainForm.Label4Click(Sender: TObject); 464 | begin 465 | ComboBox3.ItemIndex:=c_Default_Image_Size_Index; 466 | end; 467 | 468 | procedure TMainForm.Label5Click(Sender: TObject); 469 | begin 470 | ComboBox4.ItemIndex:=c_Default_Image_Effect_Index; 471 | end; 472 | 473 | procedure TMainForm.Label6Click(Sender: TObject); 474 | begin 475 | Edit1.Text:=IntToStr(c_Default_Image_Duration); 476 | end; 477 | 478 | procedure TMainForm.Label7Click(Sender: TObject); 479 | begin 480 | Edit2.Text:=IntToStr(c_Default_Image_Delay); 481 | end; 482 | 483 | procedure TMainForm.Label8Click(Sender: TObject); 484 | begin 485 | CheckBox2.Checked:=c_Default_Image_Flip_Horizontal; 486 | CheckBox3.Checked:=c_Default_Image_Flip_Vertical; 487 | end; 488 | 489 | procedure TMainForm.Label9Click(Sender: TObject); 490 | begin 491 | ComboBox5.ItemIndex:=c_Default_Video_Size_Index; 492 | end; 493 | 494 | procedure TMainForm.Label3Click(Sender: TObject); 495 | begin 496 | ComboBox2.ItemIndex:=c_Default_Image_Quality_Index; 497 | end; 498 | 499 | procedure TMainForm.Label2MouseEnter(Sender: TObject); 500 | var localText1:String; 501 | begin 502 | localText1:='Click to Set Default Value'; 503 | 504 | UpdateLabelText(Label1,localText1); 505 | end; 506 | 507 | procedure TMainForm.Label30Click(Sender: TObject); 508 | begin 509 | Edit5.Text:=IntToStr(c_Default_Network_Port); 510 | end; 511 | 512 | procedure TMainForm.Label31Click(Sender: TObject); 513 | begin 514 | Edit6.Text:=IntToStr(c_Default_Network_Duration); 515 | end; 516 | 517 | procedure TMainForm.Label12Click(Sender: TObject); 518 | begin 519 | ComboBox7.ItemIndex:=c_Default_Video_FPS_Index; 520 | end; 521 | 522 | procedure TMainForm.Label10Click(Sender: TObject); 523 | begin 524 | ComboBox6.ItemIndex:=c_Default_Video_Quality_Index; 525 | end; 526 | 527 | procedure TMainForm.Label11Click(Sender: TObject); 528 | begin 529 | Edit3.Text:=IntToStr(c_Default_Video_Duration); 530 | end; 531 | 532 | procedure TMainForm.Label15Click(Sender: TObject); 533 | begin 534 | ComboBox8.ItemIndex:=c_Default_PreviewWindowPosition_Index; 535 | end; 536 | 537 | procedure TMainForm.Label16Click(Sender: TObject); 538 | begin 539 | ComboBox9.ItemIndex:=c_Default_PreviewWindowSize_Index; 540 | end; 541 | 542 | procedure TMainForm.Label17Click(Sender: TObject); 543 | begin 544 | ComboBox10.ItemIndex:=c_Default_Camera_Brightness_Index; 545 | end; 546 | 547 | procedure TMainForm.Label18Click(Sender: TObject); 548 | begin 549 | ComboBox11.ItemIndex:=c_Default_Camera_Contrast_Index; 550 | end; 551 | 552 | procedure TMainForm.Label19Click(Sender: TObject); 553 | begin 554 | ComboBox12.ItemIndex:=c_Default_Camera_Sharpness_Index; 555 | end; 556 | 557 | procedure TMainForm.Label20Click(Sender: TObject); 558 | begin 559 | ComboBox13.ItemIndex:=c_Default_Camera_Saturation_Index; 560 | end; 561 | 562 | procedure TMainForm.Label21Click(Sender: TObject); 563 | begin 564 | ComboBox14.ItemIndex:=c_Default_Camera_AWB_Index; 565 | end; 566 | 567 | procedure TMainForm.Label22Click(Sender: TObject); 568 | begin 569 | ComboBox15.ItemIndex:=c_Default_Camera_EV_Index; 570 | end; 571 | 572 | procedure TMainForm.Label23Click(Sender: TObject); 573 | begin 574 | ComboBox16.ItemIndex:=c_Default_Camera_Exposure_Index; 575 | end; 576 | 577 | procedure TMainForm.Label24Click(Sender: TObject); 578 | begin 579 | ComboBox17.ItemIndex:=c_Default_Camera_Rotation_Index; 580 | end; 581 | 582 | procedure TMainForm.Label26Click(Sender: TObject); 583 | begin 584 | ComboBox19.ItemIndex:=c_Default_Camera_ColorEffect_U_Index; 585 | ComboBox20.ItemIndex:=c_Default_Camera_ColorEffect_V_Index; 586 | end; 587 | 588 | procedure TMainForm.Label27Click(Sender: TObject); 589 | begin 590 | ComboBox18.ItemIndex:=c_Default_Camera_Metering_Index; 591 | end; 592 | 593 | {$ENDREGION 'LabelTextDefault'} 594 | 595 | {$REGION 'Main Form Controls'} 596 | 597 | procedure TMainForm.Button1MouseEnter(Sender: TObject); 598 | var localText1:String; 599 | begin 600 | localText1:='Open Terminal and Enter Commands Manually'; 601 | 602 | UpdateLabelText(Label1,localText1); 603 | end; 604 | 605 | {$ENDREGION 'Main Form Controls'} 606 | 607 | {$REGION 'Page Tabs Control 1'} 608 | 609 | procedure TMainForm.Button2Click(Sender: TObject); 610 | begin 611 | PageControl1.PageIndex:=0; 612 | HighLightSelectedButton(Button2,1); 613 | end; 614 | 615 | procedure TMainForm.Button2MouseEnter(Sender: TObject); 616 | begin 617 | UpdateLabelText(Label1,'Main Page Tab'); 618 | end; 619 | 620 | procedure TMainForm.Button2MouseLeave(Sender: TObject); 621 | begin 622 | UpdateLabelText(Label1,''); 623 | end; 624 | 625 | procedure TMainForm.Button3Click(Sender: TObject); 626 | begin 627 | PageControl1.PageIndex:=2; 628 | HighLightSelectedButton(Button3,1); 629 | end; 630 | 631 | procedure TMainForm.Button3MouseEnter(Sender: TObject); 632 | begin 633 | UpdateLabelText(Label1,'Make a Video'); 634 | end; 635 | 636 | procedure TMainForm.Button4Click(Sender: TObject); 637 | begin 638 | PageControl1.PageIndex:=1; 639 | HighLightSelectedButton(Button4,1); 640 | end; 641 | 642 | procedure TMainForm.Button4MouseEnter(Sender: TObject); 643 | begin 644 | UpdateLabelText(Label1,'Take a Photo'); 645 | end; 646 | 647 | procedure TMainForm.Button5Click(Sender: TObject); 648 | begin 649 | PageControl1.PageIndex:=3; 650 | HighLightSelectedButton(Button5,1); 651 | end; 652 | 653 | procedure TMainForm.Button5MouseEnter(Sender: TObject); 654 | begin 655 | UpdateLabelText(Label1,'Configure Camera Settings'); 656 | end; 657 | 658 | procedure TMainForm.Button6Click(Sender: TObject); 659 | begin 660 | PageControl1.PageIndex:=5; 661 | HighLightSelectedButton(Button6,1); 662 | end; 663 | 664 | procedure TMainForm.Button6MouseEnter(Sender: TObject); 665 | begin 666 | UpdateLabelText(Label1,'Info and Documentation'); 667 | end; 668 | 669 | //additional tab for settings 670 | 671 | procedure TMainForm.Button12Click(Sender: TObject); 672 | begin 673 | PageControl1.PageIndex:=4; 674 | end; 675 | 676 | procedure TMainForm.Button12MouseEnter(Sender: TObject); 677 | begin 678 | UpdateLabelText(Label1,'Addition Settings Controls'); 679 | end; 680 | 681 | procedure TMainForm.Button13Click(Sender: TObject); 682 | begin 683 | PageControl1.PageIndex:=3; 684 | end; 685 | 686 | procedure TMainForm.Button13MouseEnter(Sender: TObject); 687 | begin 688 | UpdateLabelText(Label1,'Go Back to Main Settings Page'); 689 | end; 690 | 691 | {$ENDREGION 'Page Control 1'} 692 | 693 | {$REGION 'Page Tabs Control 2'} 694 | 695 | procedure TMainForm.Button16Click(Sender: TObject); 696 | begin 697 | PageControl2.PageIndex:=1; 698 | end; 699 | 700 | procedure TMainForm.Button16MouseEnter(Sender: TObject); 701 | begin 702 | UpdateLabelText(Label1,'View License'); 703 | end; 704 | 705 | procedure TMainForm.Button17Click(Sender: TObject); 706 | begin 707 | PageControl2.PageIndex:=0; 708 | end; 709 | 710 | procedure TMainForm.Button17MouseEnter(Sender: TObject); 711 | begin 712 | UpdateLabelText(Label1,'Go Back to Main Info Page'); 713 | end; 714 | 715 | procedure TMainForm.Button18Click(Sender: TObject); 716 | begin 717 | PageControl2.PageIndex:=2; 718 | end; 719 | 720 | procedure TMainForm.Button18MouseEnter(Sender: TObject); 721 | begin 722 | UpdateLabelText(Label1,'Project Contributors'); 723 | end; 724 | 725 | {$ENDREGION 'Page Control 2'} 726 | 727 | {$REGION 'Main Tab Controls'} 728 | 729 | procedure TMainForm.CheckBox4MouseEnter(Sender: TObject); 730 | begin 731 | UpdateLabelText(Label1,'Test Camera Preview in Demo Mode'); 732 | end; 733 | 734 | procedure TMainForm.Button7MouseEnter(Sender: TObject); 735 | begin 736 | UpdateLabelText(Label1,'Start a 5 sec Camera Preview Window'); 737 | end; 738 | 739 | {$ENDREGION 'Main Tab Controls'} 740 | 741 | {$REGION 'Photo Tab Controls'} 742 | 743 | procedure TMainForm.Image2Click(Sender: TObject); 744 | begin 745 | SaveCapturedPictureAs; 746 | end; 747 | 748 | procedure TMainForm.Image2MouseEnter(Sender: TObject); 749 | begin 750 | UpdateLabelText(Label1,'Click to Save Picture'); 751 | end; 752 | 753 | procedure TMainForm.Button8MouseEnter(Sender: TObject); 754 | begin 755 | UpdateLabelText(Label1,'Capture an Image'); 756 | end; 757 | 758 | procedure TMainForm.Button9MouseEnter(Sender: TObject); 759 | begin 760 | UpdateLabelText(Label1,'Start Preview'); 761 | end; 762 | 763 | procedure TMainForm.CheckBox10Change(Sender: TObject); 764 | begin 765 | if CheckBox10.Checked then 766 | begin 767 | ComboBox19.Enabled:=True; 768 | ComboBox20.Enabled:=True; 769 | end else 770 | begin 771 | ComboBox19.Enabled:=False; 772 | ComboBox20.Enabled:=False; 773 | end; 774 | end; 775 | 776 | procedure TMainForm.CheckBox10MouseEnter(Sender: TObject); 777 | begin 778 | UpdateLabelText(Label1,'Enable UV Color Effect'); 779 | end; 780 | 781 | procedure TMainForm.CheckBox1MouseEnter(Sender: TObject); 782 | begin 783 | UpdateLabelText(Label1,'Apply Time Laps Capture Session'); 784 | end; 785 | 786 | procedure TMainForm.CheckBox2MouseEnter(Sender: TObject); 787 | begin 788 | UpdateLabelText(Label1,'Flip Video Horizontal'); 789 | end; 790 | 791 | procedure TMainForm.CheckBox3MouseEnter(Sender: TObject); 792 | begin 793 | UpdateLabelText(Label1,'Flip Video Vertical'); 794 | end; 795 | 796 | procedure TMainForm.ComboBox1Change(Sender: TObject); 797 | begin 798 | v_Image_Ext_Index:=ComboBox1.ItemIndex; 799 | end; 800 | 801 | procedure TMainForm.ComboBox1MouseEnter(Sender: TObject); 802 | begin 803 | UpdateLabelText(Label1,'Set Image Capture File Type; .jpg, .bmp, or .png | .jpg is Default'); 804 | end; 805 | 806 | procedure TMainForm.ComboBox2Change(Sender: TObject); 807 | begin 808 | v_Image_Quality_Index:=ComboBox2.ItemIndex; 809 | end; 810 | 811 | procedure TMainForm.ComboBox2MouseEnter(Sender: TObject); 812 | begin 813 | UpdateLabelText(Label1,'Set Image Capture Quality. Applies to .jpg Only'); 814 | end; 815 | 816 | procedure TMainForm.ComboBox3Change(Sender: TObject); 817 | begin 818 | v_Image_Size_Index:=ComboBox3.ItemIndex; 819 | end; 820 | 821 | procedure TMainForm.ComboBox3MouseEnter(Sender: TObject); 822 | begin 823 | UpdateLabelText(Label1,'Set Image Capture Size'); 824 | end; 825 | 826 | procedure TMainForm.ComboBox4Change(Sender: TObject); 827 | begin 828 | v_Image_Effect_Index:=ComboBox4.ItemIndex; 829 | end; 830 | 831 | procedure TMainForm.ComboBox4MouseEnter(Sender: TObject); 832 | begin 833 | UpdateLabelText(Label1,'Select a Video Effect'); 834 | end; 835 | 836 | procedure TMainForm.Edit1Exit(Sender: TObject); 837 | begin 838 | if Edit1.Text='' then 839 | begin 840 | Edit1.Text:=IntToStr(c_Default_Image_Duration); 841 | end; 842 | end; 843 | 844 | procedure TMainForm.Edit1KeyPress(Sender: TObject; var Key: char); 845 | begin 846 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 847 | begin 848 | Key := #0; 849 | end; 850 | end; 851 | 852 | procedure TMainForm.Edit1MouseEnter(Sender: TObject); 853 | begin 854 | UpdateLabelText(Label1,'Set Session Duration in Milliseconds, e.g. 5000 = 5 seconds '); 855 | end; 856 | 857 | procedure TMainForm.Edit2Exit(Sender: TObject); 858 | begin 859 | if Edit2.Text='' then 860 | begin 861 | Edit2.Text:=IntToStr(c_Default_Image_Delay); 862 | end; 863 | end; 864 | 865 | procedure TMainForm.Edit2KeyPress(Sender: TObject; var Key: char); 866 | begin 867 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 868 | begin 869 | Key := #0; 870 | end; 871 | end; 872 | 873 | procedure TMainForm.Edit2MouseEnter(Sender: TObject); 874 | begin 875 | UpdateLabelText(Label1,'Set Delay Between Image Captures in Milliseconds. Relates to Time Lapse'); 876 | end; 877 | 878 | {$ENDREGION 'Photo Tab Controls'} 879 | 880 | {$REGION 'Video Tab Controls'} 881 | 882 | procedure TMainForm.ComboBox5Change(Sender: TObject); 883 | begin 884 | v_Video_Size_Index:=ComboBox5.ItemIndex; 885 | end; 886 | 887 | procedure TMainForm.ComboBox5MouseEnter(Sender: TObject); 888 | begin 889 | UpdateLabelText(Label1,'Set Video Size'); 890 | end; 891 | 892 | procedure TMainForm.ComboBox6Change(Sender: TObject); 893 | begin 894 | v_Video_Quality_Index:=ComboBox6.ItemIndex; 895 | end; 896 | 897 | procedure TMainForm.ComboBox6MouseEnter(Sender: TObject); 898 | begin 899 | UpdateLabelText(Label1,'Set Video Quality. Relates to Bitrate'); 900 | end; 901 | 902 | procedure TMainForm.ComboBox7Change(Sender: TObject); 903 | begin 904 | v_Video_FPS_Index:=ComboBox7.ItemIndex; 905 | end; 906 | 907 | procedure TMainForm.ComboBox7MouseEnter(Sender: TObject); 908 | begin 909 | UpdateLabelText(Label1,'Set Video Frame Per Second'); 910 | end; 911 | 912 | procedure TMainForm.Edit3MouseEnter(Sender: TObject); 913 | begin 914 | UpdateLabelText(Label1,'Set Video Recording Duration'); 915 | end; 916 | 917 | procedure TMainForm.Edit4Exit(Sender: TObject); 918 | begin 919 | if Edit4.Text='' then 920 | begin 921 | //Edit4.Text:=IntToStr(c_Default_Video_Duration); 922 | end; 923 | end; 924 | 925 | procedure TMainForm.Edit4KeyPress(Sender: TObject; var Key: char); 926 | begin 927 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 928 | begin 929 | Key := #0; 930 | end; 931 | end; 932 | 933 | procedure TMainForm.Edit4MouseEnter(Sender: TObject); 934 | begin 935 | UpdateLabelText(Label1,'Enter IP Address of Client (Receiving) Machine'); 936 | end; 937 | 938 | procedure TMainForm.Edit5Exit(Sender: TObject); 939 | begin 940 | if Edit5.Text='' then 941 | begin 942 | Edit5.Text:=IntToStr(c_Default_Network_Port); 943 | end; 944 | end; 945 | 946 | procedure TMainForm.Edit5KeyPress(Sender: TObject; var Key: char); 947 | begin 948 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 949 | begin 950 | Key := #0; 951 | end; 952 | end; 953 | 954 | procedure TMainForm.Edit5MouseEnter(Sender: TObject); 955 | begin 956 | UpdateLabelText(Label1,'Enter Port Number'); 957 | end; 958 | 959 | procedure TMainForm.Edit6Exit(Sender: TObject); 960 | begin 961 | if Edit6.Text='' then 962 | begin 963 | Edit6.Text:=IntToStr(c_Default_Network_Duration); 964 | end; 965 | end; 966 | 967 | procedure TMainForm.Edit6KeyPress(Sender: TObject; var Key: char); 968 | begin 969 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 970 | begin 971 | Key := #0; 972 | end; 973 | end; 974 | 975 | procedure TMainForm.Edit6MouseEnter(Sender: TObject); 976 | begin 977 | UpdateLabelText(Label1,'Enter Duration of the Video Stream in Milliseconds'); 978 | end; 979 | 980 | procedure TMainForm.Edit3Exit(Sender: TObject); 981 | begin 982 | if Edit3.Text='' then 983 | begin 984 | Edit3.Text:=IntToStr(c_Default_Video_Duration); 985 | end; 986 | end; 987 | 988 | procedure TMainForm.Edit3KeyPress(Sender: TObject; var Key: char); 989 | begin 990 | if (not (Key in ['0'..'9', #8])) then //if user types letters very fast this can fail! 991 | begin 992 | Key := #0; 993 | end; 994 | end; 995 | 996 | procedure TMainForm.CheckBox5MouseEnter(Sender: TObject); 997 | begin 998 | UpdateLabelText(Label1,'Enable Video Stabalization'); 999 | end; 1000 | 1001 | procedure TMainForm.Button10MouseEnter(Sender: TObject); 1002 | begin 1003 | UpdateLabelText(Label1,'Start Video Recoding'); 1004 | end; 1005 | 1006 | {$ENDREGION 'Video Tab Controls'} 1007 | 1008 | {$REGION 'Settings Tab Controls'} 1009 | 1010 | procedure TMainForm.Button11Click(Sender: TObject); 1011 | begin 1012 | rpiDefaultAll; 1013 | InitializeAllControls; 1014 | end; 1015 | 1016 | procedure TMainForm.Button11MouseEnter(Sender: TObject); 1017 | begin 1018 | UpdateLabelText(Label1,'Default All Settings'); 1019 | end; 1020 | 1021 | procedure TMainForm.ComboBox8Change(Sender: TObject); 1022 | begin 1023 | v_Preview_Position_Index:=ComboBox8.ItemIndex; 1024 | end; 1025 | 1026 | procedure TMainForm.ComboBox8MouseEnter(Sender: TObject); 1027 | begin 1028 | UpdateLabelText(Label1,'Set Preview Window Position'); 1029 | end; 1030 | 1031 | procedure TMainForm.ComboBox9Change(Sender: TObject); 1032 | var localText1:String; 1033 | Value,PreviewResolution,ImageWidth,ImageHeight:Integer; 1034 | begin 1035 | localText1:='Warning: Selected Preview Size Setting may Exceed Screen Size'; 1036 | 1037 | Value:=ComboBox9.ItemIndex; 1038 | 1039 | ImageWidth:=c_Default_Image_Width; ImageHeight:=c_Default_Image_Height; 1040 | 1041 | v_Preview_Size_Index:=Value; 1042 | rpiExtractWidthHeightValuesFromString(prm_PreviewWindowSizeMap[v_Preview_Size_Index],ImageWidth,ImageHeight); 1043 | PreviewResolution:=ImageWidth*ImageHeight; 1044 | if (ScreenWidth[0]*ScreenHeight[0])<(PreviewResolution) then 1045 | begin 1046 | UpdateStatusMemoText(Memo2,localText1,True,True); 1047 | end else 1048 | begin 1049 | UpdateStatusMemoText(Memo2,'',True,True); 1050 | end; 1051 | end; 1052 | 1053 | procedure TMainForm.ComboBox9MouseEnter(Sender: TObject); 1054 | begin 1055 | UpdateLabelText(Label1,'Set Preview Window Size'); 1056 | end; 1057 | 1058 | procedure TMainForm.CheckBox6MouseEnter(Sender: TObject); 1059 | begin 1060 | UpdateLabelText(Label1,'Enable Video Preview'); 1061 | end; 1062 | 1063 | procedure TMainForm.CheckBox7MouseEnter(Sender: TObject); 1064 | begin 1065 | UpdateLabelText(Label1,'Apply RAW Output. Relates to .jpg Only'); 1066 | end; 1067 | 1068 | procedure TMainForm.CheckBox8MouseEnter(Sender: TObject); 1069 | begin 1070 | UpdateLabelText(Label1,'Apply ISO Output'); 1071 | end; 1072 | 1073 | procedure TMainForm.CheckBox9Change(Sender: TObject); 1074 | var localText1:String; 1075 | begin 1076 | localText1:='Desktop may Not be Accessible During FullScreen Preview Session. Continue?'; 1077 | 1078 | if (CheckBox9.Checked) and (v_ApplicationStarted) then // full screen can not be escaped. Inform user 1079 | begin 1080 | if MessageDlg(localText1, mtConfirmation,[mbYes,mbNo], 0)=6 then 1081 | begin 1082 | CheckBox9.Checked:=True; 1083 | end else 1084 | begin 1085 | CheckBox9.Checked:=False; 1086 | end; 1087 | end; 1088 | end; 1089 | 1090 | procedure TMainForm.CheckBox9MouseEnter(Sender: TObject); 1091 | begin 1092 | UpdateLabelText(Label1,'Enable Fullscreen Preview'); 1093 | end; 1094 | 1095 | procedure TMainForm.ComboBox10Change(Sender: TObject); 1096 | begin 1097 | v_Camera_Brightness_Index:=ComboBox10.ItemIndex; 1098 | end; 1099 | 1100 | procedure TMainForm.ComboBox10MouseEnter(Sender: TObject); 1101 | begin 1102 | UpdateLabelText(Label1,'Set Image Brightness'); 1103 | end; 1104 | 1105 | procedure TMainForm.ComboBox11Change(Sender: TObject); 1106 | begin 1107 | v_Camera_Contrast_Index:=ComboBox11.ItemIndex; 1108 | end; 1109 | 1110 | procedure TMainForm.ComboBox11MouseEnter(Sender: TObject); 1111 | begin 1112 | UpdateLabelText(Label1,'Set Image Contrast'); 1113 | end; 1114 | 1115 | procedure TMainForm.ComboBox12Change(Sender: TObject); 1116 | begin 1117 | v_Camera_Sharpness_Index:=ComboBox12.ItemIndex; 1118 | end; 1119 | 1120 | procedure TMainForm.ComboBox12MouseEnter(Sender: TObject); 1121 | begin 1122 | UpdateLabelText(Label1,'Set Image Sharpness'); 1123 | end; 1124 | 1125 | procedure TMainForm.ComboBox13Change(Sender: TObject); 1126 | begin 1127 | v_Camera_Saturation_Index:=ComboBox13.ItemIndex; 1128 | end; 1129 | 1130 | procedure TMainForm.ComboBox13MouseEnter(Sender: TObject); 1131 | begin 1132 | UpdateLabelText(Label1,'Set Image Saturation'); 1133 | end; 1134 | 1135 | procedure TMainForm.ComboBox14Change(Sender: TObject); 1136 | begin 1137 | v_Camera_AWB_Index:=ComboBox14.ItemIndex; 1138 | end; 1139 | 1140 | procedure TMainForm.ComboBox14MouseEnter(Sender: TObject); 1141 | begin 1142 | UpdateLabelText(Label1,'Set Image Auto White Balance'); 1143 | end; 1144 | 1145 | procedure TMainForm.ComboBox15Change(Sender: TObject); 1146 | begin 1147 | v_Camera_EV_Index:=ComboBox15.ItemIndex; 1148 | end; 1149 | 1150 | procedure TMainForm.ComboBox15MouseEnter(Sender: TObject); 1151 | begin 1152 | UpdateLabelText(Label1,'Set Image EV Compensation'); 1153 | end; 1154 | 1155 | procedure TMainForm.ComboBox16Change(Sender: TObject); 1156 | begin 1157 | v_Camera_Exposure_Index:=ComboBox16.ItemIndex; 1158 | end; 1159 | 1160 | procedure TMainForm.ComboBox16MouseEnter(Sender: TObject); 1161 | begin 1162 | UpdateLabelText(Label1,'Set Image Exposure'); 1163 | end; 1164 | 1165 | procedure TMainForm.ComboBox17Change(Sender: TObject); 1166 | begin 1167 | v_Camera_Rotation_Index:=ComboBox17.ItemIndex; 1168 | end; 1169 | 1170 | procedure TMainForm.ComboBox17MouseEnter(Sender: TObject); 1171 | begin 1172 | UpdateLabelText(Label1,'Set Image Rotation'); 1173 | end; 1174 | 1175 | procedure TMainForm.ComboBox18Change(Sender: TObject); 1176 | begin 1177 | v_Camera_Metering_Index:=ComboBox18.ItemIndex; 1178 | end; 1179 | 1180 | procedure TMainForm.ComboBox18MouseEnter(Sender: TObject); 1181 | begin 1182 | UpdateLabelText(Label1,'Set Metering'); 1183 | end; 1184 | 1185 | procedure TMainForm.ComboBox19Change(Sender: TObject); 1186 | begin 1187 | v_Camera_ColorEffect_U_Index:=ComboBox19.ItemIndex; 1188 | end; 1189 | 1190 | procedure TMainForm.ComboBox19MouseEnter(Sender: TObject); 1191 | begin 1192 | UpdateLabelText(Label1,'Set Color Effect U Channel'); 1193 | end; 1194 | 1195 | procedure TMainForm.ComboBox20Change(Sender: TObject); 1196 | begin 1197 | v_Camera_ColorEffect_V_Index:=ComboBox20.ItemIndex; 1198 | end; 1199 | 1200 | procedure TMainForm.ComboBox20MouseEnter(Sender: TObject); 1201 | begin 1202 | UpdateLabelText(Label1,'Set Color Effect V Channel'); 1203 | end; 1204 | 1205 | procedure TMainForm.Button14MouseEnter(Sender: TObject); 1206 | begin 1207 | UpdateLabelText(Label1,'Start Network Video Streaming'); 1208 | end; 1209 | 1210 | {$ENDREGION 'Settings Tab Controls'} 1211 | 1212 | {$ENDREGION 'Controls'} 1213 | 1214 | {$REGION 'Support'} 1215 | 1216 | procedure TMainForm.LoadComboBoxsItems; 1217 | var n:Integer; 1218 | begin 1219 | //file type 1220 | for n:=0 to Length(prm_ExtMap)-1 do 1221 | begin 1222 | ComboBox1.AddItem(prm_ExtMap[n],nil); 1223 | end; 1224 | 1225 | //jpg quality 1226 | for n:=0 to Length(prm_JPG_QualityMap)-1 do 1227 | begin 1228 | ComboBox2.AddItem(prm_JPG_QualityMap[n],nil); 1229 | end; 1230 | 1231 | // image size 1232 | for n:=0 to Length(prm_ImageSizeMap)-1 do 1233 | begin 1234 | ComboBox3.AddItem(prm_ImageSizeMap[n],nil); 1235 | end; 1236 | 1237 | //image effect 1238 | for n:=0 to Length(prm_ImxfxMap)-1 do 1239 | begin 1240 | ComboBox4.AddItem(prm_ImxfxMap[n],nil); 1241 | end; 1242 | 1243 | // video size 1244 | for n:=0 to Length(prm_VideoSizeMap)-1 do 1245 | begin 1246 | ComboBox5.AddItem(prm_VideoSizeMap[n],nil); 1247 | end; 1248 | 1249 | //video quality; bitrate calculation 1250 | for n:=0 to Length(prm_VideoQualitytMap)-1 do 1251 | begin 1252 | ComboBox6.AddItem(prm_VideoQualitytMap[n],nil); 1253 | end; 1254 | 1255 | //video FPS 1256 | for n:=0 to Length(prm_VideoFPSMap)-1 do 1257 | begin 1258 | ComboBox7.AddItem(prm_VideoFPSMap[n],nil); 1259 | end; 1260 | 1261 | //Preview Position 1262 | for n:=0 to Length(prm_PreviewWindowPositionMap)-1 do 1263 | begin 1264 | ComboBox8.AddItem(prm_PreviewWindowPositionMap[n],nil); 1265 | end; 1266 | 1267 | //Preview Size 1268 | for n:=0 to Length(prm_PreviewWindowSizeMap)-1 do 1269 | begin 1270 | ComboBox9.AddItem(prm_PreviewWindowSizeMap[n],nil); 1271 | end; 1272 | 1273 | //Camera Brightness 1274 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1275 | begin 1276 | ComboBox10.AddItem(prm_7_LevelListMap[n],nil); 1277 | end; 1278 | 1279 | //Camera Contrast 1280 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1281 | begin 1282 | ComboBox11.AddItem(prm_7_LevelListMap[n],nil); 1283 | end; 1284 | 1285 | //Camera Sharpness 1286 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1287 | begin 1288 | ComboBox12.AddItem(prm_7_LevelListMap[n],nil); 1289 | end; 1290 | 1291 | //Camera Saturation 1292 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1293 | begin 1294 | ComboBox13.AddItem(prm_7_LevelListMap[n],nil); 1295 | end; 1296 | 1297 | //Camera AWB 1298 | for n:=0 to Length(prm_AwbMap)-1 do 1299 | begin 1300 | ComboBox14.AddItem(prm_AwbMap[n],nil); 1301 | end; 1302 | 1303 | //Camera EV 1304 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1305 | begin 1306 | ComboBox15.AddItem(prm_7_LevelListMap[n],nil); 1307 | end; 1308 | 1309 | //Camera Exposure 1310 | for n:=0 to Length(prm_ExposureMap)-1 do 1311 | begin 1312 | ComboBox16.AddItem(prm_ExposureMap[n],nil); 1313 | end; 1314 | 1315 | //Camera Rotation 1316 | for n:=0 to Length(prm_RotationMap)-1 do 1317 | begin 1318 | ComboBox17.AddItem(prm_RotationMap[n],nil); 1319 | end; 1320 | 1321 | //Camera Metering 1322 | for n:=0 to Length(prm_MeteringMap)-1 do 1323 | begin 1324 | ComboBox18.AddItem(prm_MeteringMap[n],nil); 1325 | end; 1326 | 1327 | //Camera Color Effect U 1328 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1329 | begin 1330 | ComboBox19.AddItem(prm_7_LevelListMap[n],nil); 1331 | end; 1332 | 1333 | //Camera Color Effect U 1334 | for n:=0 to Length(prm_7_LevelListMap)-1 do 1335 | begin 1336 | ComboBox20.AddItem(prm_7_LevelListMap[n],nil); 1337 | end; 1338 | end; 1339 | 1340 | procedure TMainForm.InitializeAllControls; 1341 | begin 1342 | {n:=0; 1343 | while n<=ComboBox1.Items.Count-1 do 1344 | begin 1345 | if (v_Image_Ext=ComboBox1.Items.Strings[n]) then 1346 | begin 1347 | ComboBox1.ItemIndex:=n; 1348 | n:=ComboBox1.Items.Count+1; // +1 to stop the loop 1349 | end else 1350 | begin 1351 | n:=n+1; 1352 | end; 1353 | end;} 1354 | 1355 | //Main Tab 1356 | CheckBox4.Checked:=v_ShowDemoPreview; 1357 | 1358 | //Photo tab 1359 | ComboBox1.ItemIndex:=v_Image_Ext_Index; 1360 | ComboBox2.ItemIndex:=v_Image_Quality_Index; 1361 | ComboBox3.ItemIndex:=v_Image_Size_Index; 1362 | ComboBox4.ItemIndex:=v_Image_Effect_Index; 1363 | CheckBox1.Checked:=v_Image_MakeTimeLapse; 1364 | CheckBox2.Checked:=v_Image_Flip_Horizontal; CheckBox3.Checked:=v_Image_Flip_Vertical; 1365 | Edit1.Text:=IntToStr(v_Image_Duration); 1366 | Edit2.Text:=IntToStr(v_Image_Delay); 1367 | CheckBox7.Checked:=v_Image_RAW_Output; 1368 | CheckBox8.Checked:=v_Image_ISO_Output; 1369 | 1370 | //Video tab 1371 | ComboBox5.ItemIndex:=v_Video_Size_Index; 1372 | ComboBox6.ItemIndex:=v_Video_Quality_Index; 1373 | ComboBox7.ItemIndex:=v_Video_FPS_Index; 1374 | CheckBox5.Checked:=v_VideoStabilation; 1375 | Edit3.Text:=IntToStr(v_Video_Duration); 1376 | 1377 | //Settings tab (preview section) 1378 | ComboBox8.ItemIndex:=v_Preview_Position_Index; 1379 | ComboBox9.ItemIndex:=v_Preview_Size_Index; 1380 | CheckBox6.Checked:=v_Preview_ShowPreview; 1381 | CheckBox9.Checked:=v_Preview_FullScreen; 1382 | rpiSetPreviewModeIndex; 1383 | 1384 | //Settings tab (camera section) 1385 | ComboBox10.ItemIndex:=v_Camera_Brightness_Index; 1386 | ComboBox11.ItemIndex:=v_Camera_Contrast_Index; 1387 | ComboBox12.ItemIndex:=v_Camera_Sharpness_Index; 1388 | ComboBox13.ItemIndex:=v_Camera_Saturation_Index; 1389 | ComboBox14.ItemIndex:=v_Camera_AWB_Index; 1390 | ComboBox15.ItemIndex:=v_Camera_EV_Index; 1391 | ComboBox16.ItemIndex:=v_Camera_Exposure_Index; 1392 | ComboBox17.ItemIndex:=v_Camera_Rotation_Index; 1393 | 1394 | //Settings tab (additional section) 1395 | ComboBox18.ItemIndex:=v_Camera_Metering_Index; 1396 | ComboBox19.ItemIndex:=v_Camera_ColorEffect_U_Index; 1397 | ComboBox20.ItemIndex:=v_Camera_ColorEffect_V_Index; 1398 | CheckBox10.Checked:=v_Camera_ColorEffect_UV; 1399 | 1400 | Edit4.Text:=IntToStr(v_Network_IPAddress); 1401 | Edit5.Text:=IntToStr(v_Network_Port); 1402 | Edit6.Text:=IntToStr(v_Network_Duration); 1403 | end; 1404 | 1405 | procedure TMainForm.ReadAllControls; 1406 | begin 1407 | //Main Tab 1408 | v_ShowDemoPreview:=CheckBox4.Checked; 1409 | 1410 | //Photo tab 1411 | v_Image_Ext_Index:=ComboBox1.ItemIndex; 1412 | v_Image_Quality_Index:=ComboBox2.ItemIndex; 1413 | v_Image_Size_Index:=ComboBox3.ItemIndex; 1414 | v_Image_Effect_Index:=ComboBox4.ItemIndex; 1415 | v_Image_MakeTimeLapse:=CheckBox1.Checked; 1416 | v_Image_Flip_Horizontal:=CheckBox2.Checked; v_Image_Flip_Vertical:=CheckBox3.Checked; 1417 | v_Image_Duration:=StrToInt(Edit1.Text); 1418 | v_Image_Delay:=StrToInt(Edit2.Text); 1419 | v_Image_RAW_Output:=CheckBox7.Checked; 1420 | v_Image_ISO_Output:=CheckBox8.Checked; 1421 | 1422 | //Video tab 1423 | v_Video_Size_Index:=ComboBox5.ItemIndex; 1424 | v_Video_Quality_Index:=ComboBox6.ItemIndex; 1425 | v_Video_FPS_Index:=ComboBox7.ItemIndex; 1426 | v_VideoStabilation:=CheckBox5.Checked; 1427 | v_Video_Duration:=StrToInt(Edit3.Text); 1428 | 1429 | //Settings tab (preview section) 1430 | v_Preview_Position_Index:=ComboBox8.ItemIndex; 1431 | v_Preview_Size_Index:=ComboBox9.ItemIndex; 1432 | v_Preview_ShowPreview:=CheckBox6.Checked; 1433 | v_Preview_FullScreen:=CheckBox9.Checked; 1434 | rpiSetPreviewModeIndex; 1435 | 1436 | //Settings tab (camera section) 1437 | v_Camera_Brightness_Index:=ComboBox10.ItemIndex; 1438 | v_Camera_Contrast_Index:=ComboBox11.ItemIndex; 1439 | v_Camera_Sharpness_Index:=ComboBox12.ItemIndex; 1440 | v_Camera_Saturation_Index:=ComboBox13.ItemIndex; 1441 | v_Camera_AWB_Index:=ComboBox14.ItemIndex; 1442 | v_Camera_EV_Index:=ComboBox15.ItemIndex; 1443 | v_Camera_Exposure_Index:=ComboBox16.ItemIndex; 1444 | v_Camera_Rotation_Index:=ComboBox17.ItemIndex; 1445 | 1446 | //Settings tab (adfditional section) 1447 | v_Camera_Metering_Index:=ComboBox18.ItemIndex; 1448 | v_Camera_ColorEffect_U_Index:=ComboBox19.ItemIndex; 1449 | v_Camera_ColorEffect_V_Index:=ComboBox20.ItemIndex; 1450 | v_Camera_ColorEffect_UV:=CheckBox10.Checked; 1451 | 1452 | v_Network_IPAddress:=StrToInt(Edit4.Text); 1453 | v_Network_Port:=StrToInt(Edit5.Text); 1454 | v_Network_Duration:=StrToInt(Edit6.Text); 1455 | end; 1456 | 1457 | procedure TMainForm.CleanUpForClosingApplication; 1458 | begin 1459 | ReadAllControls; 1460 | rpiSaveUserSettings(AppURL+c_SettingsFile_Path); 1461 | end; 1462 | 1463 | procedure TMainForm.InitializeApplication; 1464 | begin 1465 | rpiGetScreenSize; 1466 | LoadComboBoxsItems; 1467 | AppURL:=ExtractFilePath(ParamStr(0));// works. But this is not the correct approach 1468 | Label1.Caption:=''; 1469 | PageControl1.PageIndex:=0; //set main page 1470 | HighLightSelectedButton(Button2,1); // highlight main page button 1471 | PageControl2.PageIndex:=0; //set info page to first page 1472 | 1473 | if FileExists(AppURL+c_SettingsFile_Path) then // if the settings file does not exists it will use default values 1474 | begin 1475 | rpiLoadUserSettings(AppURL+c_SettingsFile_Path); 1476 | end; 1477 | 1478 | InitializeAllControls; 1479 | 1480 | //DetectCameraApp; 1481 | 1482 | MainForm.Caption:=c_Application_Title; 1483 | end; 1484 | 1485 | function TMainForm.SelectUserDirectory:Boolean; 1486 | var localText1,localText2:String; 1487 | begin 1488 | localText1:='Select Directory to Save Time Laps Images'; 1489 | localText2:='Error'; 1490 | 1491 | Result:=False; 1492 | 1493 | try 1494 | SelectDirectoryDialog1.Title:=localText1; 1495 | if not(SelectDirectoryDialog1.Execute) then exit; 1496 | v_UserSelectedDirectory:=SelectDirectoryDialog1.FileName+'/'; 1497 | //showmessage(v_UserSelectedDirectory); 1498 | Result:=False; 1499 | except 1500 | on E: Exception do begin MessageDlg(localText2,localText2+': '+E.Message,mtError,[mbOk],0); end; 1501 | end; 1502 | end; 1503 | 1504 | procedure TMainForm.SaveCapturedPictureAs; 1505 | var ImageFileName:String; 1506 | localText1,localText2:String; 1507 | begin 1508 | localText1:='Error'; 1509 | localText2:='Captured Image File Not Found: '; 1510 | 1511 | ImageFileName:=rpiGetCapturedPictureFileName; 1512 | if FileExists(ImageFileName) then 1513 | begin 1514 | try 1515 | SavePictureDialog1.DefaultExt:=ExtractFileExt(ImageFileName); 1516 | if not(SavePictureDialog1.Execute) then exit; 1517 | CopyFile(ImageFileName,SavePictureDialog1.FileName,True); 1518 | except 1519 | on E: Exception do begin MessageDlg(localText1,localText1+': '+E.Message,mtError,[mbOk],0); end; 1520 | end; 1521 | end else 1522 | begin 1523 | UpdateStatusMemoText(Memo2,localText2+ImageFileName,True,True); 1524 | end; 1525 | end; 1526 | 1527 | procedure TMainForm.SaveCapturedVideoAs; 1528 | var VideoFileName:String; 1529 | localText1,localText2:String; 1530 | begin 1531 | localText1:='Error'; 1532 | localText2:='Captured Video File Not Found: '; 1533 | 1534 | VideoFileName:=rpiGetCapturedVideoFileName; 1535 | if FileExists(VideoFileName) then 1536 | begin 1537 | try 1538 | SaveDialog1.DefaultExt:=ExtractFileExt(VideoFileName); 1539 | if not(SaveDialog1.Execute) then exit; 1540 | CopyFile(VideoFileName,SaveDialog1.FileName,True); 1541 | except 1542 | on E: Exception do begin MessageDlg(localText1,localText1+': '+E.Message,mtError,[mbOk],0); end; 1543 | end; 1544 | end else 1545 | begin 1546 | UpdateStatusMemoText(Memo2,localText2+VideoFileName,False,True); 1547 | end; 1548 | end; 1549 | 1550 | function TMainForm.LoadCurrentPictureToImage:Boolean; 1551 | var ImageFileName:String; 1552 | localText1,localText2,localText3:String; 1553 | begin 1554 | localText1:='Captured Image File Not Found: '; 1555 | localText2:='Attempting to Load Default Image'; 1556 | localText3:='Error'; 1557 | 1558 | Result:=False; 1559 | ImageFileName:=rpiGetCapturedPictureFileName; 1560 | if FileExists(ImageFileName) then 1561 | begin 1562 | try 1563 | Image2.Picture.LoadFromFile(ImageFileName); 1564 | Image2.Refresh; 1565 | Result:=True; 1566 | except 1567 | on E: Exception do begin MessageDlg(localText3,localText3+': '+E.Message,mtError,[mbOk],0); end; 1568 | end; 1569 | end else 1570 | begin 1571 | UpdateStatusMemoText(Memo2,localText1+ImageFileName,False,True); 1572 | UpdateStatusMemoText(Memo2,localText2,False,True); 1573 | ImageFileName:=AppURL+c_DataDir+c_DefaultImageName; 1574 | if FileExists(ImageFileName) then 1575 | begin 1576 | try 1577 | Image2.Picture.LoadFromFile(ImageFileName); 1578 | Image2.Refresh; 1579 | except 1580 | on E: Exception do begin MessageDlg(localText3,localText3+': '+E.Message,mtError,[mbOk],0); end; 1581 | end; 1582 | end; 1583 | end; 1584 | end; 1585 | 1586 | function TMainForm.LoadCurrentVideoToImage:Boolean; 1587 | //var VideoFileName:String; 1588 | begin 1589 | Result:=True; 1590 | {Result:=False; 1591 | VideoFileName:=rpiGetCapturedVideoFileName; 1592 | if FileExists(VideoFileName) then 1593 | begin 1594 | try 1595 | Image2.Picture.LoadFromFile(VideoFileName); 1596 | Image2.Refresh; 1597 | Result:=True; 1598 | except 1599 | on E: Exception do begin MessageDlg('Error','Error: '+E.Message,mtError,[mbOk],0); end; 1600 | end; 1601 | end else 1602 | begin 1603 | UpdateStatusMemoText(Memo2,'Captured Image File Not Found: '+VideoFileName,False); 1604 | UpdateStatusMemoText(Memo2,'Attempting to Load Default Image',False); 1605 | VideoFileName:=AppURL+c_DataDir+c_DefaultImageName; 1606 | if FileExists(VideoFileName) then 1607 | begin 1608 | try 1609 | Image2.Picture.LoadFromFile(VideoFileName); 1610 | Image2.Refresh; 1611 | except 1612 | on E: Exception do begin MessageDlg('Error','Error: '+E.Message,mtError,[mbOk],0); end; 1613 | end; 1614 | end; 1615 | end;} 1616 | end; 1617 | 1618 | procedure TMainForm.UpdateStatusMemoText(lMemo:TMemo; const MemoText:String; const ClearMemoText:Boolean; const SetAtEnd:Boolean); 1619 | begin 1620 | if (ClearMemoText) and not(MemoText='') then // clear the lmemo first and then write the text 1621 | begin 1622 | lMemo.Lines.Clear; 1623 | lMemo.Lines.Add(MemoText); 1624 | end else 1625 | begin 1626 | if (ClearMemoText) then 1627 | begin 1628 | lMemo.Lines.Clear; // clear the lmemo only 1629 | end else 1630 | begin 1631 | lMemo.Lines.Add(MemoText); // add text 1632 | end; 1633 | end; 1634 | 1635 | if SetAtEnd then 1636 | begin 1637 | lMemo.SelStart := Length(lMemo.Text); //set lmemo text position at end 1638 | end; 1639 | end; 1640 | 1641 | procedure TMainForm.UpdateLabelText(lLabel:TLabel; const HintText:String); 1642 | begin 1643 | lLabel.Caption:=HintText; 1644 | lLabel.Update; 1645 | end; 1646 | 1647 | procedure TMainForm.HighLightSelectedButton(lButton:TButton; const PC:Integer); 1648 | begin 1649 | case PC of 1650 | 1: begin 1651 | Button1.Font.Style:=[]; 1652 | Button2.Font.Style:=[]; 1653 | Button3.Font.Style:=[]; 1654 | Button4.Font.Style:=[]; 1655 | Button5.Font.Style:=[]; 1656 | Button6.Font.Style:=[]; 1657 | end; 1658 | end; 1659 | 1660 | lButton.Font.Style:=[fsBold]; 1661 | end; 1662 | 1663 | {$ENDREGION 'Support} 1664 | 1665 | {$REGION 'Main'} 1666 | 1667 | procedure TMainForm.Button1Click(Sender: TObject);//start terminal 1668 | var localText1:String; 1669 | begin 1670 | localText1:='Error'; 1671 | try 1672 | rpiExcecuteLocalProcessSudo(v_UserPass,c_Terminal,False,Memo1,Memo2); 1673 | except 1674 | on E: Exception do begin MessageDlg(localText1,localText1+c_DoublePoint+E.Message,mtError,[mbOk],0); end; 1675 | end; 1676 | end; 1677 | 1678 | procedure TMainForm.Button10Click(Sender: TObject); //make video 1679 | var localText1:String; 1680 | begin 1681 | localText1:='Error'; 1682 | 1683 | ReadAllControls; 1684 | v_CaptureMode_Index:=3; //video 1685 | 1686 | try 1687 | rpiExcecuteLocalProcessSudo(v_UserPass,rpiGetStackedCommand,False,Memo1,Memo2); 1688 | except 1689 | on E: Exception do begin MessageDlg(localText1,localText1+c_DoublePoint+E.Message,mtError,[mbOk],0); end; 1690 | end; 1691 | if LoadCurrentVideoToImage then begin SaveCapturedVideoAs; end; 1692 | end; 1693 | 1694 | procedure TMainForm.Button9Click(Sender: TObject);//settings preview 1695 | var localText1:String; 1696 | begin 1697 | localText1:='Error'; 1698 | 1699 | ReadAllControls; 1700 | v_Preview_PreviewTest:=True; //picture, no save image 1701 | v_CaptureMode_Index:=1; 1702 | try 1703 | rpiExcecuteLocalProcessSudo(v_UserPass,rpiGetStackedCommand,False,Memo1,Memo2); 1704 | except 1705 | on E: Exception do begin MessageDlg(localText1,localText1+c_DoublePoint+E.Message,mtError,[mbOk],0); end; 1706 | end; 1707 | end; 1708 | 1709 | procedure TMainForm.Button7Click(Sender: TObject); //test preview/demo 1710 | var localText1:String; 1711 | begin 1712 | localText1:='Error'; 1713 | 1714 | ReadAllControls; 1715 | try 1716 | if v_ShowDemoPreview then 1717 | begin 1718 | rpiExcecuteLocalProcessSudo(v_UserPass,cmd_QuickCameraPreviewDemoMode,False,Memo1,Memo2); 1719 | end else 1720 | begin 1721 | rpiExcecuteLocalProcessSudo(v_UserPass,cmd_QuickCameraPreview,False,Memo1,Memo2); 1722 | end; 1723 | except 1724 | on E: Exception do begin MessageDlg(localText1,localText1+c_DoublePoint+E.Message,mtError,[mbOk],0); end; 1725 | end; 1726 | end; 1727 | 1728 | procedure TMainForm.Button8Click(Sender: TObject); //take picture 1729 | var localText1,localText2:String; 1730 | begin 1731 | v_CaptureMode_Index:=1;//picture 1732 | localText1:='Set Duration is Smaller than Delay'; 1733 | localText2:='Error'; 1734 | 1735 | ReadAllControls; 1736 | if not(v_Image_MakeTimeLapse) then 1737 | begin 1738 | rpiClearPreviousCapturedImage; 1739 | try 1740 | rpiExcecuteLocalProcessSudo(v_UserPass,rpiGetStackedCommand,False,Memo1,Memo2) 1741 | except 1742 | on E: Exception do begin MessageDlg(localText2,localText2+c_DoublePoint+E.Message,mtError,[mbOk],0); exit; end; 1743 | end; 1744 | if LoadCurrentPictureToImage then begin SaveCapturedPictureAs; end; 1745 | end else 1746 | begin 1747 | if (v_Image_Duration<v_Image_Delay) then 1748 | begin 1749 | MessageDlg(localText1,mtWarning,[mbOk],0); 1750 | exit; 1751 | end; 1752 | if (v_UserSelectedDirectory='') or not(DirectoryExists(v_UserSelectedDirectory)) then 1753 | begin 1754 | if not(SelectUserDirectory) then 1755 | begin 1756 | if (v_UserSelectedDirectory='') then begin exit; end; 1757 | end; 1758 | end; 1759 | try 1760 | rpiExcecuteLocalProcessSudo(v_UserPass,rpiGetStackedCommand,False,Memo1,Memo2) 1761 | except 1762 | on E: Exception do begin MessageDlg(localText2,localText2+c_DoublePoint+E.Message,mtError,[mbOk],0); exit; end; 1763 | end; 1764 | end; 1765 | end; 1766 | 1767 | procedure TMainForm.Button14Click(Sender: TObject); //network video streaming 1768 | var localText1:String; 1769 | begin 1770 | v_CaptureMode_Index:=4;//video network stream 1771 | localText1:='Error'; 1772 | 1773 | ReadAllControls; 1774 | try 1775 | rpiExcecuteLocalProcessSudo(v_UserPass,rpiGetStackedCommand,False,Memo1,Memo2) 1776 | except 1777 | on E: Exception do begin MessageDlg(localText1,localText1+c_DoublePoint+c_Space+E.Message,mtError,[mbOk],0); exit; end; 1778 | end; 1779 | end; 1780 | 1781 | {$ENDREGION 'Main'} 1782 | 1783 | end. 1784 | 1785 | --------------------------------------------------------------------------------