[
  {
    "path": ".gitignore",
    "content": "# Xcode\n#\n# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n## User settings\nxcuserdata/\n\n## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)\n*.xcscmblueprint\n*.xccheckout\n\n## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)\nbuild/\nDerivedData/\n*.moved-aside\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\n\n## Obj-C/Swift specific\n*.hmap\n\n## App packaging\n*.ipa\n*.dSYM.zip\n*.dSYM\n\n## Playgrounds\ntimeline.xctimeline\nplayground.xcworkspace\n\n# Swift Package Manager\n#\n# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.\n# Packages/\n# Package.pins\n# Package.resolved\n# *.xcodeproj\n#\n# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata\n# hence it is not needed unless you have added a package configuration file to your project\n# .swiftpm\n\n.build/\n\n# CocoaPods\n#\n# We recommend against adding the Pods directory to your .gitignore. However\n# you should judge for yourself, the pros and cons are mentioned at:\n# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control\n#\n# Pods/\n#\n# Add this line if you want to avoid checking in source code from the Xcode workspace\n# *.xcworkspace\n\n# Carthage\n#\n# Add this line if you want to avoid checking in source code from Carthage dependencies.\n# Carthage/Checkouts\n\nCarthage/Build/\n\n# Accio dependency management\nDependencies/\n.accio/\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo.\n# Instead, use fastlane to re-generate the screenshots whenever they are needed.\n# For more information about the recommended setup visit:\n# https://docs.fastlane.tools/best-practices/source-control/#source-control\n\nfastlane/report.xml\nfastlane/Preview.html\nfastlane/screenshots/**/*.png\nfastlane/test_output\n\n# Code Injection\n#\n# After new code Injection tools there's a generated folder /iOSInjectionProject\n# https://github.com/johnno1962/injectionforxcode\n\niOSInjectionProject/\n.DS_Store"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU AFFERO GENERAL PUBLIC LICENSE\n                       Version 3, 19 November 2007\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU Affero General Public License is a free, copyleft license for\nsoftware and other kinds of works, specifically designed to ensure\ncooperation with the community in the case of network server software.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nour General Public Licenses are intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  Developers that use our General Public Licenses protect your rights\nwith two steps: (1) assert copyright on the software, and (2) offer\nyou this License which gives you legal permission to copy, distribute\nand/or modify the software.\n\n  A secondary benefit of defending all users' freedom is that\nimprovements made in alternate versions of the program, if they\nreceive widespread use, become available for other developers to\nincorporate.  Many developers of free software are heartened and\nencouraged by the resulting cooperation.  However, in the case of\nsoftware used on network servers, this result may fail to come about.\nThe GNU General Public License permits making a modified version and\nletting the public access it on a server without ever releasing its\nsource code to the public.\n\n  The GNU Affero General Public License is designed specifically to\nensure that, in such cases, the modified source code becomes available\nto the community.  It requires the operator of a network server to\nprovide the source code of the modified version running there to the\nusers of that server.  Therefore, public use of a modified version, on\na publicly accessible server, gives the public access to the source\ncode of the modified version.\n\n  An older license, called the Affero General Public License and\npublished by Affero, was designed to accomplish similar goals.  This is\na different license, not a version of the Affero GPL, but Affero has\nreleased a new version of the Affero GPL which permits relicensing under\nthis license.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU Affero General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Remote Network Interaction; Use with the GNU General Public License.\n\n  Notwithstanding any other provision of this License, if you modify the\nProgram, your modified version must prominently offer all users\ninteracting with it remotely through a computer network (if your version\nsupports such interaction) an opportunity to receive the Corresponding\nSource of your version by providing access to the Corresponding Source\nfrom a network server at no charge, through some standard or customary\nmeans of facilitating copying of software.  This Corresponding Source\nshall include the Corresponding Source for any work covered by version 3\nof the GNU General Public License that is incorporated pursuant to the\nfollowing paragraph.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the work with which it is combined will remain governed by version\n3 of the GNU General Public License.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU Affero General Public License from time to time.  Such new versions\nwill be similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU Affero General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU Affero General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU Affero General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    <one line to give the program's name and a brief idea of what it does.>\n    Copyright (C) <year>  <name of author>\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU Affero General Public License as published\n    by the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU Affero General Public License for more details.\n\n    You should have received a copy of the GNU Affero General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If your software can interact with users remotely through a computer\nnetwork, you should also make sure that it provides a way for users to\nget its source.  For example, if your program is a web application, its\ninterface could display a \"Source\" link that leads users to an archive\nof the code.  There are many ways you could offer source, and different\nsolutions will be better for different programs; see section 13 for the\nspecific requirements.\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU AGPL, see\n<https://www.gnu.org/licenses/>.\n"
  },
  {
    "path": "QuickRecorder/AVContext.swift",
    "content": "//\n//  AVContext.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/27.\n//\nimport AppKit\nimport Foundation\nimport AVFoundation\nimport UserNotifications\n\nextension AppDelegate {\n    func recordingCamera(with device: AVCaptureDevice) {\n        SCContext.captureSession = AVCaptureSession()\n        \n        guard let input = try? AVCaptureDeviceInput(device: device),\n              SCContext.captureSession.canAddInput(input) else {\n            print(\"Failed to set up camera\")\n            SCContext.requestCameraPermission()\n            return\n        }\n        SCContext.captureSession.addInput(input)\n        \n        let videoOutput = AVCaptureVideoDataOutput()\n        videoOutput.setSampleBufferDelegate(self, queue: .global())\n        \n        if SCContext.captureSession.canAddOutput(videoOutput) {\n            SCContext.captureSession.addOutput(videoOutput)\n        }\n        \n        SCContext.captureSession.startRunning()\n        DispatchQueue.main.async { self.startCameraOverlayer() }\n    }\n    \n    func closeCamera() {\n        if SCContext.isCameraRunning() {\n            //SCContext.previewType = nil\n            if camWindow.isVisible { camWindow.close() }\n            SCContext.captureSession.stopRunning()\n        }\n    }\n    \n    func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {\n        /* 保留后续以作他用\n        if !SCContext.isPaused && ud.string(forKey: \"recordCam\") != \"\" {\n            if sampleBuffer.isValid { SCContext.isCameraReady = true }\n            if sampleBuffer.imageBuffer != nil { SCContext.frameCache = sampleBuffer }\n        }*/\n    }\n}\n\nclass AVOutputClass: NSObject, AVCaptureFileOutputRecordingDelegate, AVCaptureVideoDataOutputSampleBufferDelegate {\n    static let shared = AVOutputClass()\n    var output: AVCaptureMovieFileOutput!\n    var dataOutput: AVCaptureVideoDataOutput!\n    //var captureSession: AVCaptureSession!\n    \n    func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {\n        //print(sampleBuffer.nsImage?.size)\n    }\n    \n    public func startRecording(with device: AVCaptureDevice, mute: Bool = false, preset: AVCaptureSession.Preset = .high, didOutput: Bool = true) {\n        output = AVCaptureMovieFileOutput()\n        dataOutput = AVCaptureVideoDataOutput()\n        dataOutput.setSampleBufferDelegate(self, queue: .global())\n        SCContext.captureSession = AVCaptureSession()\n        SCContext.previewSession = AVCaptureSession()\n        SCContext.captureSession.sessionPreset = preset\n        SCContext.previewSession.sessionPreset = preset\n        \n        guard let input = try? AVCaptureDeviceInput(device: device),\n              let preview = try? AVCaptureDeviceInput(device: device),\n              SCContext.captureSession.canAddInput(input),\n              SCContext.previewSession.canAddInput(preview),\n              SCContext.captureSession.canAddOutput(output),\n              SCContext.previewSession.canAddOutput(dataOutput) else {\n            print(\"Failed to set up camera or device\")\n            SCContext.requestCameraPermission()\n            return\n        }\n        \n        SCContext.captureSession.addInput(input)\n        SCContext.captureSession.addOutput(output)\n        SCContext.previewSession.addInput(preview)\n        SCContext.previewSession.addOutput(dataOutput)\n        \n        if mute {\n            if let audioConnection = output.connection(with: .audio) {\n                SCContext.captureSession.removeConnection(audioConnection)\n                /*DispatchQueue.main.async {\n                    let alert = createAlert(title: \"No Audio Connection\",\n                                                               message: \"Unable to get audio stream on this device, only screen content will be recorded!\",\n                                                               button1: \"OK\")\n                    alert.runModal()\n                }*/\n            }\n        }\n        \n        if didOutput {\n            let encoderIsH265 = ud.string(forKey: \"encoder\") == Encoder.h265.rawValue\n            let videoSettings: [String: Any] = [ AVVideoCodecKey: encoderIsH265 ? AVVideoCodecType.hevc : AVVideoCodecType.h264 ]\n            guard let connection = output.connection(with: .video) else { return }\n            output.setOutputSettings(videoSettings, for: connection)\n            let fileEnding = ud.string(forKey: \"videoFormat\") ?? \"\"\n            SCContext.filePath = \"\\(SCContext.getFilePath()).\\(fileEnding)\"\n            SCContext.captureSession.startRunning()\n            output.startRecording(to: SCContext.filePath.url, recordingDelegate: self)\n            SCContext.streamType = StreamType.idevice\n            SCContext.startTime = Date.now\n        }\n        \n        SCContext.previewSession.startRunning()\n        DispatchQueue.main.async {\n            closeAllWindow(except: \"Area Overlayer\".local)\n            updateStatusBar()\n            AppDelegate.shared.startDeviceOverlayer(size: NSSize(width: 300, height: 500))\n        }\n    }\n\n    public func stopRecording() {\n        if SCContext.captureSession.isRunning {\n            output.stopRecording()\n            SCContext.captureSession.stopRunning()\n            SCContext.previewSession.stopRunning()\n            SCContext.streamType = nil\n            SCContext.startTime = nil\n            DispatchQueue.main.async {\n                controlPanel.close()\n                deviceWindow.close()\n                updateStatusBar()\n            }\n        }\n    }\n    \n    func closePreview() {\n        if SCContext.isCameraRunning() {\n            //SCContext.previewType = nil\n            if deviceWindow.isVisible { deviceWindow.close() }\n            if let preview = SCContext.previewSession { preview.stopRunning() }\n        }\n    }\n\n    func fileOutput(_ output: AVCaptureFileOutput, didFinishRecordingTo outputFileURL: URL, from connections: [AVCaptureConnection], error: Error?) {\n        let content = UNMutableNotificationContent()\n        content.title = \"Recording Completed\".local\n        content.body = String(format: \"File saved to: %@\".local, outputFileURL.path)\n        content.sound = UNNotificationSound.default\n        let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)\n        let request = UNNotificationRequest(identifier: \"quickrecorder.completed.\\(UUID().uuidString)\", content: content, trigger: trigger)\n        UNUserNotificationCenter.current().add(request) { error in\n            if let error = error { print(\"Notification failed to send：\\(error.localizedDescription)\") }\n        }\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/AccentColor.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"icon_16x16.png\",\n      \"idiom\" : \"mac\",\n      \"scale\" : \"1x\",\n      \"size\" : \"16x16\"\n    },\n    {\n      \"filename\" : \"icon_16x16@2x.png\",\n      \"idiom\" : \"mac\",\n      \"scale\" : \"2x\",\n      \"size\" : \"16x16\"\n    },\n    {\n      \"filename\" : \"icon_32x32.png\",\n      \"idiom\" : \"mac\",\n      \"scale\" : \"1x\",\n      \"size\" : \"32x32\"\n    },\n    {\n      \"filename\" : \"icon_32x32@2x.png\",\n      \"idiom\" : \"mac\",\n      \"scale\" : \"2x\",\n      \"size\" : \"32x32\"\n    },\n    {\n      \"filename\" : \"icon_128x128.png\",\n      \"idiom\" : \"mac\",\n      \"scale\" : \"1x\",\n      \"size\" : \"128x128\"\n    },\n    {\n      \"filename\" : \"icon_128x128@2x.png\",\n      \"idiom\" : \"mac\",\n      \"scale\" : \"2x\",\n      \"size\" : \"128x128\"\n    },\n    {\n      \"filename\" : \"icon_256x256.png\",\n      \"idiom\" : \"mac\",\n      \"scale\" : \"1x\",\n      \"size\" : \"256x256\"\n    },\n    {\n      \"filename\" : \"icon_256x256@2x.png\",\n      \"idiom\" : \"mac\",\n      \"scale\" : \"2x\",\n      \"size\" : \"256x256\"\n    },\n    {\n      \"filename\" : \"icon_512x512.png\",\n      \"idiom\" : \"mac\",\n      \"scale\" : \"1x\",\n      \"size\" : \"512x512\"\n    },\n    {\n      \"filename\" : \"icon_512x512@2x.png\",\n      \"idiom\" : \"mac\",\n      \"scale\" : \"2x\",\n      \"size\" : \"512x512\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Colors/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Colors/black_white.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"color\" : {\n        \"color-space\" : \"display-p3\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0xFF\",\n          \"green\" : \"0xFF\",\n          \"red\" : \"0xFF\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    },\n    {\n      \"appearances\" : [\n        {\n          \"appearance\" : \"luminosity\",\n          \"value\" : \"dark\"\n        }\n      ],\n      \"color\" : {\n        \"color-space\" : \"display-p3\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0x00\",\n          \"green\" : \"0x00\",\n          \"red\" : \"0x00\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Colors/buttonRed.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"color\" : {\n        \"color-space\" : \"display-p3\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0x5E\",\n          \"green\" : \"0x6A\",\n          \"red\" : \"0xEC\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Colors/buttonRedDark.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"color\" : {\n        \"color-space\" : \"display-p3\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0x2B\",\n          \"green\" : \"0x3A\",\n          \"red\" : \"0xCD\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Colors/dark_my_red.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"color\" : {\n        \"color-space\" : \"display-p3\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0x0C\",\n          \"green\" : \"0x1B\",\n          \"red\" : \"0xAA\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    },\n    {\n      \"appearances\" : [\n        {\n          \"appearance\" : \"luminosity\",\n          \"value\" : \"dark\"\n        }\n      ],\n      \"color\" : {\n        \"color-space\" : \"display-p3\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0x5D\",\n          \"green\" : \"0x6A\",\n          \"red\" : \"0xEC\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Colors/myblue.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"color\" : {\n        \"color-space\" : \"srgb\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0xE1\",\n          \"green\" : \"0xA7\",\n          \"red\" : \"0x3D\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    },\n    {\n      \"appearances\" : [\n        {\n          \"appearance\" : \"luminosity\",\n          \"value\" : \"dark\"\n        }\n      ],\n      \"color\" : {\n        \"color-space\" : \"srgb\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0xF6\",\n          \"green\" : \"0xBB\",\n          \"red\" : \"0x51\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Colors/mygreen.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"color\" : {\n        \"color-space\" : \"srgb\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0x37\",\n          \"green\" : \"0xC3\",\n          \"red\" : \"0x21\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    },\n    {\n      \"appearances\" : [\n        {\n          \"appearance\" : \"luminosity\",\n          \"value\" : \"dark\"\n        }\n      ],\n      \"color\" : {\n        \"color-space\" : \"srgb\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0x55\",\n          \"green\" : \"0xE1\",\n          \"red\" : \"0x3D\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Colors/mypurple.colorset/Contents.json",
    "content": "{\n  \"colors\" : [\n    {\n      \"color\" : {\n        \"color-space\" : \"display-p3\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0xCF\",\n          \"green\" : \"0x56\",\n          \"red\" : \"0x57\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    },\n    {\n      \"appearances\" : [\n        {\n          \"appearance\" : \"luminosity\",\n          \"value\" : \"dark\"\n        }\n      ],\n      \"color\" : {\n        \"color-space\" : \"display-p3\",\n        \"components\" : {\n          \"alpha\" : \"1.000\",\n          \"blue\" : \"0xEA\",\n          \"green\" : \"0x61\",\n          \"red\" : \"0x62\"\n        }\n      },\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Others/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Others/audioIcon.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"MissingArtwork_Music_onLight_55A54008AD1BA589AA210D2629C1DF41_0.png\",\n      \"idiom\" : \"universal\"\n    },\n    {\n      \"appearances\" : [\n        {\n          \"appearance\" : \"luminosity\",\n          \"value\" : \"dark\"\n        }\n      ],\n      \"filename\" : \"MissingArtwork_Music_onDark_55A54008AD1BA589AA210D2629C1DF41_0.png\",\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Others/camera.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"menubar@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"menubar@2x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  },\n  \"properties\" : {\n    \"template-rendering-intent\" : \"template\"\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Others/save.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"save.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"save@2x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  },\n  \"properties\" : {\n    \"template-rendering-intent\" : \"template\"\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Others/unknowScreen.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"unknow screen.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"unknow screen@2x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  },\n  \"properties\" : {\n    \"template-rendering-intent\" : \"template\"\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Others/window.select.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"macwindow.and.cursorarrow.svg\",\n      \"idiom\" : \"universal\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  },\n  \"properties\" : {\n    \"preserves-vector-representation\" : true,\n    \"template-rendering-intent\" : \"template\"\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Settings/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Settings/blacklist.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"blacklist@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"blacklist.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Settings/film.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"film@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"film.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Settings/gear.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"gear@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"gear.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Settings/hotkey.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"hotkey@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"hotkey.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Settings/record.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"record@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"record.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/ChineseNewYear/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/ChineseNewYear/fuzi1.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"fuzi@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"fuzi.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/ChineseNewYear/fuzi2.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"fuziBlur@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"fuziBlur.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/ChineseNewYear/fuzi3.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"fuziBlur2@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"fuziBlur2.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/ChineseNewYear/hongbao1.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"hongbao@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"hongbao.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/ChineseNewYear/hongbao2.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"hongbaoBlur@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"hongbaoBlur.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/ChineseNewYear/hongbao3.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"hongbaoBlur2@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"hongbaoBlur2.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/Christmas/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/Christmas/christmasTree1.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"tree@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"tree.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/Christmas/christmasTree2.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"treeBlur@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"treeBlur.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/Christmas/snowflake1.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"snow@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"snow.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/Christmas/snowflake2.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"snowBlur@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"snowBlur.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/Christmas/snowflake3.imageset/Contents.json",
    "content": "{\n  \"images\" : [\n    {\n      \"filename\" : \"snowBlur2@1x.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"1x\"\n    },\n    {\n      \"filename\" : \"snowBlur2.png\",\n      \"idiom\" : \"universal\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\" : \"universal\",\n      \"scale\" : \"3x\"\n    }\n  ],\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Assets.xcassets/Surprise/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/Base.lproj/Credits.rtf",
    "content": "{\\rtf1\\ansi\\ansicpg936\\cocoartf2761\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl\\f0\\fnil\\fcharset134 PingFangSC-Semibold;\\f1\\fnil\\fcharset134 PingFangSC-Regular;}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;}\n\\paperw12240\\paperh15840\\margl1440\\margr1440\\vieww9000\\viewh8400\\viewkind0\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\\partightenfactor0\n\n\\f0\\b\\fs24 \\cf0 Lightweight screen recorder based on ScreenCapture Kit\\\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\\partightenfactor0\n\n\\f1\\b0\\fs10 \\cf0 \\\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\\partightenfactor0\n\n\\fs20 \\cf0 View source code on {\\field{\\*\\fldinst{HYPERLINK \"https://github.com/lihaoyun6/QuickRecorder\"}}{\\fldrslt Github}}}"
  },
  {
    "path": "QuickRecorder/Info.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>CFBundleDocumentTypes</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeExtensions</key>\n\t\t\t<array>\n\t\t\t\t<string>mov</string>\n\t\t\t\t<string>mp4</string>\n\t\t\t</array>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Viewer</string>\n\t\t\t<key>LSHandlerRank</key>\n\t\t\t<string>Alternate</string>\n\t\t\t<key>NSDocumentClass</key>\n\t\t\t<string>NSObject</string>\n\t\t\t<key>NSIsInformational</key>\n\t\t\t<true/>\n\t\t</dict>\n\t\t<dict>\n\t\t\t<key>CFBundleTypeExtensions</key>\n\t\t\t<array>\n\t\t\t\t<string>qma</string>\n\t\t\t</array>\n\t\t\t<key>CFBundleTypeIconFile</key>\n\t\t\t<string>qmaIcon</string>\n\t\t\t<key>CFBundleTypeName</key>\n\t\t\t<string>QuickRecorder Multi-Track Audio</string>\n\t\t\t<key>CFBundleTypeRole</key>\n\t\t\t<string>Viewer</string>\n\t\t\t<key>LSHandlerRank</key>\n\t\t\t<string>Owner</string>\n\t\t\t<key>LSItemContentTypes</key>\n\t\t\t<array>\n\t\t\t\t<string>com.lihaoyun6.QuickRecorder.qma</string>\n\t\t\t</array>\n\t\t\t<key>LSTypeIsPackage</key>\n\t\t\t<true/>\n\t\t</dict>\n\t</array>\n\t<key>NSAppleScriptEnabled</key>\n\t<true/>\n\t<key>OSAScriptingDefinition</key>\n\t<string>Scriptable</string>\n\t<key>SUFeedURL</key>\n\t<string>https://raw.githubusercontent.com/lihaoyun6/QuickRecorder/main/appcast.xml</string>\n\t<key>SUPublicEDKey</key>\n\t<string>dP6zY7RAyK3DtV/dDrQ2V2dB0BY36jADwMKHZIX89u4=</string>\n\t<key>UTExportedTypeDeclarations</key>\n\t<array>\n\t\t<dict>\n\t\t\t<key>UTTypeConformsTo</key>\n\t\t\t<array>\n\t\t\t\t<string>com.apple.package</string>\n\t\t\t</array>\n\t\t\t<key>UTTypeDescription</key>\n\t\t\t<string>QuickRecorder Multi-Track Audio</string>\n\t\t\t<key>UTTypeIcons</key>\n\t\t\t<dict>\n\t\t\t\t<key>UTTypeIconBadgeName</key>\n\t\t\t\t<string>qmaIcon</string>\n\t\t\t</dict>\n\t\t\t<key>UTTypeIdentifier</key>\n\t\t\t<string>com.lihaoyun6.QuickRecorder.qma</string>\n\t\t\t<key>UTTypeTagSpecification</key>\n\t\t\t<dict>\n\t\t\t\t<key>public.filename-extension</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>qma</string>\n\t\t\t\t</array>\n\t\t\t\t<key>public.mime-type</key>\n\t\t\t\t<array>\n\t\t\t\t\t<string>application/x-qma</string>\n\t\t\t\t</array>\n\t\t\t</dict>\n\t\t</dict>\n\t</array>\n</dict>\n</plist>\n"
  },
  {
    "path": "QuickRecorder/Preview Content/Preview Assets.xcassets/Contents.json",
    "content": "{\n  \"info\" : {\n    \"author\" : \"xcode\",\n    \"version\" : 1\n  }\n}\n"
  },
  {
    "path": "QuickRecorder/QuickRecorder.entitlements",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>com.apple.security.device.audio-input</key>\n\t<true/>\n\t<key>com.apple.security.device.camera</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "QuickRecorder/QuickRecorderApp.swift",
    "content": "//\n//  QuickRecorderApp.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/16.\n//\n\nimport AppKit\nimport SwiftUI\nimport AVFAudio\nimport AVFoundation\nimport ScreenCaptureKit\nimport UserNotifications\nimport KeyboardShortcuts\nimport ServiceManagement\nimport CoreMediaIO\nimport Sparkle\n\nlet isMacOS12 = ProcessInfo.processInfo.operatingSystemVersion.majorVersion == 12\nlet isMacOS14 = ProcessInfo.processInfo.operatingSystemVersion.majorVersion == 14\nlet isMacOS15 = ProcessInfo.processInfo.operatingSystemVersion.majorVersion == 15\nvar scPerm = false\nlet fd = FileManager.default\nlet ud = UserDefaults.standard\nvar statusBarItem: NSStatusItem!\nvar mouseMonitor: Any?\nvar keyMonitor: Any?\nvar hideMousePointer = false\nvar hideScreenMagnifier = false\nlet updateTimer = Timer.publish(every: 0.5, on: .main, in: .common).autoconnect()\nlet mousePointer = NSWindow(contentRect: NSRect(x: -70, y: -70, width: 70, height: 70), styleMask: [.borderless], backing: .buffered, defer: false)\nlet screenMagnifier = NSWindow(contentRect: NSRect(x: -402, y: -402, width: 402, height: 348), styleMask: [.borderless], backing: .buffered, defer: false)\nlet camWindow = NSPanel(contentRect: NSRect(x: 200, y: 200, width: 200, height: 200), styleMask: [.fullSizeContentView, .resizable, .nonactivatingPanel], backing: .buffered, defer: false)\nlet deviceWindow = NSWindow(contentRect: NSRect(x: 200, y: 200, width: 200, height: 200), styleMask: [.fullSizeContentView, .resizable], backing: .buffered, defer: false)\nlet controlPanel = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 10, height: 10), styleMask: [.fullSizeContentView], backing: .buffered, defer: false)\nlet countdownPanel = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 120, height: 120), styleMask: [.fullSizeContentView], backing: .buffered, defer: false)\nlet previewWindow = NSWindow(contentRect: NSRect(x: 0, y: 0, width: 266, height: 156), styleMask: [.fullSizeContentView], backing: .buffered, defer: false)\nvar updaterController: SPUStandardUpdaterController!\n\n@main\nstruct QuickRecorderApp: App {\n    @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate\n    //private let updaterController: SPUStandardUpdaterController\n        \n    init() {\n        // If you want to start the updater manually, pass false to startingUpdater and call .startUpdater() later\n        // This is where you can also pass an updater delegate if you need one\n        updaterController = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: nil, userDriverDelegate: nil)\n    }\n    \n    var body: some Scene {\n        DocumentGroup(newDocument: qmaPackageHandle()) { file in\n            //if SCContext.stream == nil {\n                if let fileURL = file.fileURL {\n                    qmaPlayerView(document: file.$document, fileURL: fileURL)\n                        .frame(minWidth: 400, minHeight: 100, maxHeight: 100)\n                        .focusable(false)\n                }\n            //}\n        }\n        .myWindowIsContentResizable()\n        .commands {\n            SidebarCommands()\n            CommandGroup(replacing: .saveItem) {}\n            CommandGroup(replacing: .newItem) {}\n            CommandGroup(replacing: .textEditing) {}\n        }\n        \n        Settings {\n            SettingsView()\n                .background(\n                    WindowAccessor(\n                        onWindowOpen: { w in\n                            if let w = w {\n                                //w.level = .floating\n                                w.titlebarSeparatorStyle = .none\n                                guard let nsSplitView = findNSSplitVIew(view: w.contentView),\n                                      let controller = nsSplitView.delegate as? NSSplitViewController else { return }\n                                controller.splitViewItems.first?.canCollapse = false\n                                controller.splitViewItems.first?.minimumThickness = 140\n                                controller.splitViewItems.first?.maximumThickness = 140\n                                w.orderFront(nil)\n                            }\n                        })\n                )\n        }\n        .handlesExternalEvents(matching: [])\n        .commands {\n            CommandGroup(replacing: .newItem) {}\n            CommandGroup(after: .appInfo) {\n                CheckForUpdatesView(updater: updaterController.updater)\n            }\n        }\n    }\n}\n\nextension Scene {\n    func myWindowIsContentResizable() -> some Scene {\n        if #available(macOS 13.0, *) {\n            return self.windowResizability(.contentSize)\n        }\n        else {\n            return self\n        }\n    }\n}\n\nclass AppDelegate: NSObject, NSApplicationDelegate, SCStreamDelegate, SCStreamOutput, AVCaptureVideoDataOutputSampleBufferDelegate  {\n    static let shared = AppDelegate()\n    var filter: SCContentFilter?\n    var isCameraReady = false\n    var isPresenterON = false\n    var isResizing = false\n    var presenterType = \"OFF\"\n    var frameQueue = FixedLengthArray<CMTime>(maxLength: 20)\n    \n    @AppStorage(\"showOnDock\")       var showOnDock: Bool = true\n    @AppStorage(\"showMenubar\")      var showMenubar: Bool = false\n    @AppStorage(\"enableAEC\")        var enableAEC: Bool = false\n    @AppStorage(\"recordMic\")        var recordMic: Bool = false\n    @AppStorage(\"micDevice\")        var micDevice: String = \"default\"\n    @AppStorage(\"remuxAudio\")       var remuxAudio: Bool = true\n    @AppStorage(\"recordWinSound\")   var recordWinSound: Bool = true\n    @AppStorage(\"recordHDR\")        var recordHDR: Bool = false\n    @AppStorage(\"encoder\")          var encoder: Encoder = .h265\n    @AppStorage(\"highRes\")          var highRes: Int = 2\n    @AppStorage(\"AECLevel\")         var AECLevel: String = \"mid\"\n    @AppStorage(\"withAlpha\")        var withAlpha: Bool = false\n    @AppStorage(\"saveDirectory\")    var saveDirectory: String?\n    @AppStorage(\"countdown\")        var countdown: Int = 0\n    @AppStorage(\"poSafeDelay\")      var poSafeDelay: Int = 1\n    @AppStorage(\"highlightMouse\")   var highlightMouse: Bool = false\n    @AppStorage(\"includeMenuBar\")   var includeMenuBar: Bool = true\n    @AppStorage(\"hideDesktopFiles\") var hideDesktopFiles: Bool = false\n    @AppStorage(\"trimAfterRecord\")  var trimAfterRecord: Bool = false\n    @AppStorage(\"miniStatusBar\")    var miniStatusBar: Bool = false\n    @AppStorage(\"hideSelf\")         var hideSelf: Bool = true\n    @AppStorage(\"preventSleep\")     var preventSleep: Bool = true\n    @AppStorage(\"showPreview\")      var showPreview: Bool = true\n    @AppStorage(\"background\")       var background: BackgroundType = .wallpaper\n    @AppStorage(\"showMouse\")        var showMouse: Bool = true\n    @AppStorage(\"frameRate\")        var frameRate: Int = 60\n    @AppStorage(\"videoQuality\")     var videoQuality: Double = 1.0\n    @AppStorage(\"videoFormat\")      var videoFormat: VideoFormat = .mp4\n    @AppStorage(\"audioFormat\")      var audioFormat: AudioFormat = .aac\n    @AppStorage(\"audioQuality\")     var audioQuality: AudioQuality = .high\n    @AppStorage(\"pixelFormat\")      var pixelFormat: PixFormat = .delault\n    @AppStorage(\"hideCCenter\")      var hideCCenter: Bool = false\n    \n    func mousePointerReLocation(event: NSEvent) {\n        if event.type == .scrollWheel { return }\n        if !highlightMouse || hideMousePointer || SCContext.stream == nil || SCContext.streamType == .window {\n            mousePointer.orderOut(nil)\n            return\n        }\n        let mouseLocation = event.locationInWindow\n        var windowFrame = mousePointer.frame\n        windowFrame.origin = NSPoint(x: mouseLocation.x - windowFrame.width / 2, y: mouseLocation.y - windowFrame.height / 2)\n        mousePointer.contentView = NSHostingView(rootView: MousePointerView(event: event))\n        mousePointer.setFrameOrigin(windowFrame.origin)\n        mousePointer.orderFront(nil)\n    }\n    \n    func screenMagnifierReLocation(event: NSEvent) {\n        if !SCContext.isMagnifierEnabled || hideScreenMagnifier { screenMagnifier.orderOut(nil); return }\n        let mouseLocation = event.locationInWindow\n        var windowFrame = screenMagnifier.frame\n        windowFrame.origin = NSPoint(x: mouseLocation.x - windowFrame.width / 2, y: mouseLocation.y - windowFrame.height / 2)\n        guard let image = NSImage.createScreenShot() else { return }\n        let rect = NSRect(x: mouseLocation.x - 67, y: mouseLocation.y - 58, width: 134, height: 116)\n        let croppedImage = image.trim(rect: rect)\n        screenMagnifier.contentView = NSHostingView(rootView: ScreenMagnifier(screenShot: croppedImage, event: event))\n        screenMagnifier.setFrameOrigin(windowFrame.origin)\n        screenMagnifier.orderFront(nil)\n    }\n    \n    func registerGlobalMouseMonitor() {\n        mouseMonitor = NSEvent.addGlobalMonitorForEvents(matching: [.scrollWheel, .mouseMoved, .rightMouseUp, .rightMouseDown, .rightMouseDragged, .leftMouseUp,  .leftMouseDown, .leftMouseDragged, .otherMouseUp, .otherMouseDown, .otherMouseDragged]) { event in\n            self.mousePointerReLocation(event: event)\n            self.screenMagnifierReLocation(event: event)\n        }\n    }\n        \n    func stopGlobalMouseMonitor() {\n        mousePointer.orderOut(nil)\n        if let monitor = mouseMonitor { NSEvent.removeMonitor(monitor); mouseMonitor = nil }\n    }\n    \n    func applicationWillTerminate(_ aNotification: Notification) {\n        if SCContext.stream != nil { SCContext.stopRecording() }\n    }\n    \n    func application(_ application: NSApplication, open urls: [URL]) {\n        for url in urls {\n            if SCContext.trimingList.contains(url) { continue }\n            createNewWindow(view: VideoTrimmerView(videoURL: url), title: url.lastPathComponent, random: true, only: false)\n            closeMainWindow()\n        }\n    }\n    \n    func applicationWillFinishLaunching(_ notification: Notification) {\n        scPerm = SCContext.updateAvailableContentSync() != nil\n        \n        let process = NSWorkspace.shared.runningApplications.filter({ $0.bundleIdentifier == \"com.lihaoyun6.QuickRecorder\" })\n        if process.count > 1 {\n            DispatchQueue.main.async {\n                let button = createAlert(title: \"QuickRecorder is Running\".local, message: \"Please do not run multiple instances!\".local, button1: \"Quit\".local).runModal()\n                if button == .alertFirstButtonReturn { NSApp.terminate(self) }\n            }\n        }\n        \n        lazy var userDesktop = (NSSearchPathForDirectoriesInDomains(.desktopDirectory, .userDomainMask, true) as [String]).first!\n        \n        ud.register( // default defaults (used if not set)\n            defaults: [\n                \"audioFormat\": AudioFormat.aac.rawValue,\n                \"audioQuality\": AudioQuality.high.rawValue,\n                \"background\": BackgroundType.wallpaper.rawValue,\n                \"frameRate\": 60,\n                \"highRes\": 2,\n                \"hideSelf\": true,\n                \"highlightMouse\" : false,\n                \"hideDesktopFiles\": false,\n                \"includeMenuBar\": true,\n                \"videoQuality\": 1.0,\n                \"countdown\": 0,\n                \"videoFormat\": VideoFormat.mp4.rawValue,\n                \"pixelFormat\": PixFormat.delault.rawValue,\n                \"encoder\": Encoder.h264.rawValue,\n                \"poSafeDelay\": 1,\n                \"saveDirectory\": userDesktop as NSString,\n                \"showMouse\": true,\n                \"recordMic\": false,\n                \"remuxAudio\": isMacOS12 ? false : true,\n                \"recordWinSound\": isMacOS12 ? false : true,\n                \"trimAfterRecord\": false,\n                \"showOnDock\": true,\n                \"showMenubar\": false,\n                \"enableAEC\": false,\n                \"recordHDR\": false,\n                \"preventSleep\": true,\n                \"showPreview\": isMacOS12 ? false : true,\n                \"savedArea\": [String: [String: CGFloat]]()\n            ]\n        )\n        \n        if highRes == 0 { highRes = 2 }\n        if showOnDock { NSApp.setActivationPolicy(.regular) }\n        if isMacOS12 { showPreview = false; remuxAudio = false }\n        \n        UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .sound, .badge]) { granted, error in\n            if let error = error { print(\"Notification authorization denied: \\(error.localizedDescription)\") }\n        }\n        \n        var allow : UInt32 = 1\n        let dataSize : UInt32 = 4\n        let zero : UInt32 = 0\n        var prop = CMIOObjectPropertyAddress(\n            mSelector: CMIOObjectPropertySelector(kCMIOHardwarePropertyAllowScreenCaptureDevices),\n            mScope: CMIOObjectPropertyScope(kCMIOObjectPropertyScopeGlobal),\n            mElement: CMIOObjectPropertyElement(kCMIOObjectPropertyElementMain))\n        CMIOObjectSetPropertyData(CMIOObjectID(kCMIOObjectSystemObject), &prop, zero, nil, dataSize, &allow)\n\n        statusBarItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength)\n        statusBarItem.button?.image = NSImage()\n\n        mousePointer.title = \"Mouse Pointer\".local\n        mousePointer.level = .screenSaver\n        mousePointer.ignoresMouseEvents = true\n        mousePointer.isReleasedWhenClosed = false\n        mousePointer.backgroundColor = NSColor.clear\n        \n        screenMagnifier.title = \"Screen Magnifier\".local\n        screenMagnifier.level = .floating\n        screenMagnifier.ignoresMouseEvents = true\n        screenMagnifier.isReleasedWhenClosed = false\n        screenMagnifier.backgroundColor = NSColor.clear\n        \n        camWindow.title = \"Camera Overlayer\".local\n        camWindow.level = .floating\n        camWindow.isReleasedWhenClosed = false\n        camWindow.isMovableByWindowBackground = true\n        camWindow.backgroundColor = NSColor.clear\n        camWindow.collectionBehavior = [.canJoinAllSpaces]\n        \n        countdownPanel.title = \"Countdown Panel\".local\n        countdownPanel.level = .floating\n        countdownPanel.isReleasedWhenClosed = false\n        countdownPanel.isMovableByWindowBackground = false\n        countdownPanel.backgroundColor = NSColor.clear\n        \n        deviceWindow.title = \"iDevice Overlayer\".local\n        deviceWindow.level = .floating\n        deviceWindow.isReleasedWhenClosed = false\n        deviceWindow.isMovableByWindowBackground = true\n        deviceWindow.backgroundColor = NSColor.clear\n        \n        controlPanel.title = \"Recording Controller\".local\n        controlPanel.level = .floating\n        controlPanel.titleVisibility = .hidden\n        controlPanel.backgroundColor = NSColor.clear\n        controlPanel.isReleasedWhenClosed = false\n        controlPanel.titlebarAppearsTransparent = true\n        controlPanel.isMovableByWindowBackground = true\n        \n        previewWindow.level = .statusBar\n        previewWindow.titlebarAppearsTransparent = true\n        previewWindow.titleVisibility = .hidden\n        previewWindow.isReleasedWhenClosed = false\n        previewWindow.backgroundColor = .clear\n        \n        KeyboardShortcuts.onKeyDown(for: .showPanel) {\n            _ = self.applicationShouldHandleReopen(NSApp, hasVisibleWindows: true)\n            if SCContext.stream == nil { NSApp.activate(ignoringOtherApps: true) }\n        }\n        KeyboardShortcuts.onKeyDown(for: .saveFrame) { if SCContext.stream != nil { SCContext.saveFrame = true }}\n        KeyboardShortcuts.onKeyDown(for: .screenMagnifier) { if SCContext.stream != nil { SCContext.isMagnifierEnabled.toggle() }}\n        KeyboardShortcuts.onKeyDown(for: .stop) { if SCContext.stream != nil { SCContext.stopRecording() }}\n        KeyboardShortcuts.onKeyDown(for: .pauseResume) { if SCContext.stream != nil { SCContext.pauseRecording() }}\n        KeyboardShortcuts.onKeyDown(for: .startWithAudio) {[self] in\n            if SCContext.streamType != nil { return }\n            closeAllWindow()\n            prepRecord(type: \"audio\", screens: SCContext.getSCDisplayWithMouse(), windows: nil, applications: nil, fastStart: true)\n        }\n        KeyboardShortcuts.onKeyDown(for: .startWithScreen) {[self] in\n            if SCContext.stream != nil { return }\n            closeAllWindow()\n            prepRecord(type: \"display\", screens: SCContext.getSCDisplayWithMouse(), windows: nil, applications: nil, fastStart: true)\n        }\n        KeyboardShortcuts.onKeyDown(for: .startWithArea) {[self] in\n            if SCContext.stream != nil { return }\n            closeAllWindow()\n            showAreaSelector(size: NSSize(width: 600, height: 450))\n        }\n        KeyboardShortcuts.onKeyDown(for: .startWithWindow) { [self] in\n            if SCContext.stream != nil { return }\n            closeAllWindow()\n            let frontmostApp = NSWorkspace.shared.frontmostApplication\n            if let pid = frontmostApp?.processIdentifier {\n                guard let scWindow = SCContext.getWindows().first(where: { $0.owningApplication?.processID == pid && $0.title != \"\" && $0.isOnScreen }) else { return }\n                prepRecord(type: \"window\", screens: SCContext.getSCDisplayWithMouse(), windows: [scWindow], applications: nil, fastStart: true)\n                return\n            }\n        }\n        updateStatusBar()\n    }\n    \n    func applicationDidFinishLaunching(_ aNotification: Notification) {\n        closeAllWindow()\n        if showOnDock { _ = applicationShouldHandleReopen(NSApp, hasVisibleWindows: true) }\n        tips(\"Would you like to use H.265 format for better video quality and smaller file size?\",\n             id: \"qr.switch-to-h265.note\", buttonTitle: \"Use H.265\", switchButton: true) {\n            ud.setValue(Encoder.h265.rawValue, forKey: \"encoder\")\n        }\n    }\n    \n    func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {\n        if SCContext.stream == nil {\n            let w1 = NSApp.windows.filter({ !$0.title.contains(\"Item-0\") && !$0.title.isEmpty && $0.isVisible })\n            let w2 = w1.filter({ !$0.title.contains(\".qma\") })\n            if (!w1.isEmpty && w2.isEmpty) || w1.isEmpty {\n                let offset = (!showOnDock && !showMenubar) ? 127 : 0\n                let width = isMacOS12 ? 800 : 928\n                let mainPanel = EscPanel(contentRect: NSRect(x: 0, y: 0, width: width + offset, height: 100), styleMask: [.fullSizeContentView, .nonactivatingPanel], backing: .buffered, defer: false)\n                mainPanel.contentView = NSHostingView(rootView: ContentView())\n                mainPanel.title = \"QuickRecorder\".local\n                mainPanel.isOpaque = false\n                mainPanel.level = .floating\n                mainPanel.isRestorable = false\n                mainPanel.backgroundColor = .clear\n                mainPanel.isReleasedWhenClosed = false\n                mainPanel.isMovableByWindowBackground = true\n                mainPanel.collectionBehavior = [.canJoinAllSpaces]\n                mainPanel.center()\n                if let screen = mainPanel.screen {\n                    let wX = (screen.frame.width - mainPanel.frame.width) / 2 + screen.frame.minX\n                    let wY = (screen.frame.height - mainPanel.frame.height) / 2 + screen.frame.minY\n                    mainPanel.setFrameOrigin(NSPoint(x: wX, y: wY))\n                }\n                mainPanel.makeKeyAndOrderFront(self)\n                if #unavailable(macOS 13) { NSApp.activate(ignoringOtherApps: true) }\n                PopoverState.shared.isShowing = false\n            }\n        }\n        return false\n    }\n    \n    func openSettingPanel() {\n        NSApp.activate(ignoringOtherApps: true)\n        if #available(macOS 14, *) {\n            NSApp.mainMenu?.items.first?.submenu?.item(at: 3)?.performAction()\n        } else if #available(macOS 13, *) {\n            NSApp.sendAction(Selector((\"showSettingsWindow:\")), to: nil, from: nil)\n        } else {\n            NSApp.sendAction(Selector((\"showPreferencesWindow:\")), to: nil, from: nil)\n        }\n    }\n    \n    class EscPanel: NSPanel {\n        override func cancelOperation(_ sender: Any?) {\n            self.close()\n        }\n        override var canBecomeKey: Bool {\n            return true\n        }\n    }\n}\n\nfunc closeMainWindow() {\n    for w in NSApp.windows.filter({ $0.title == \"QuickRecorder\".local }) {\n        w.close()\n    }\n}\n\nfunc closeAllWindow(except: String = \"\") {\n    for w in NSApp.windows.filter({\n        $0.title != \"Item-0\" && $0.title != \"\"\n        && !$0.title.lowercased().contains(\".qma\")\n        && !$0.title.contains(except) }) { w.close() }\n}\n\nfunc findNSSplitVIew(view: NSView?) -> NSSplitView? {\n    var queue = [NSView]()\n    if let root = view { queue.append(root) }\n    \n    while !queue.isEmpty {\n        let current = queue.removeFirst()\n        if current is NSSplitView { return current as? NSSplitView }\n        for subview in current.subviews { queue.append(subview) }\n    }\n    return nil\n}\n\nfunc getStatusBarWidth() -> CGFloat {\n    @AppStorage(\"miniStatusBar\") var miniStatusBar: Bool = false\n    var width = 158.0\n    switch SCContext.streamType {\n    case nil: width = miniStatusBar ? 36.0 : 36.0\n    case .idevice: width = miniStatusBar ? 68.0 : 138.0\n    case .systemaudio: width = miniStatusBar ? 68.0 : 114.0\n    default: width = miniStatusBar ? 78.0 : 158.0\n    }\n    return width\n}\n\nfunc process(path: String, arguments: [String]) -> String? {\n    let task = Process()\n    task.launchPath = path\n    task.arguments = arguments\n    task.standardError = Pipe()\n    \n    let outputPipe = Pipe()\n    defer {\n        outputPipe.fileHandleForReading.closeFile()\n    }\n    task.standardOutput = outputPipe\n    \n    do {\n        try task.run()\n    } catch let error {\n        print(\"\\(error.localizedDescription)\")\n        return nil\n    }\n    \n    let outputData = outputPipe.fileHandleForReading.readDataToEndOfFile()\n    let output = String(decoding: outputData, as: UTF8.self)\n    \n    if output.isEmpty {\n        return nil\n    }\n    \n    return output.trimmingCharacters(in: .newlines)\n}\n\nfunc tips(_ message: String, title: String? = nil, id: String, buttonTitle: String = \"OK\", switchButton: Bool = false, width: Int? = nil, action: (() -> Void)? = nil) {\n    let never = (ud.object(forKey: \"neverRemindMe\") as? [String]) ?? []\n    if !never.contains(id) {\n        if switchButton {\n            let alert = createAlert(title: title ?? Bundle.main.appName + \" Tips\".local, message: message, button1: buttonTitle, button2: \"Don't remind me again\", width: width).runModal()\n            if alert == .alertSecondButtonReturn { ud.setValue(never + [id], forKey: \"neverRemindMe\") }\n            if alert == .alertFirstButtonReturn { action?() }\n        } else {\n            let alert = createAlert(title: title ?? Bundle.main.appName + \" Tips\".local, message: message, button1: \"Don't remind me again\", button2: buttonTitle, width: width).runModal()\n            if alert == .alertFirstButtonReturn { ud.setValue(never + [id], forKey: \"neverRemindMe\") }\n            if alert == .alertSecondButtonReturn { action?() }\n        }\n    }\n}\n\nfunc createAlert(level: NSAlert.Style = .warning, title: String, message: String, button1: String, button2: String = \"\", width: Int? = nil) -> NSAlert {\n    let alert = NSAlert()\n    alert.messageText = title.local\n    alert.informativeText = message.local\n    alert.addButton(withTitle: button1.local)\n    if button2 != \"\" { alert.addButton(withTitle: button2.local) }\n    alert.alertStyle = level\n    if let width = width {\n        alert.accessoryView = NSView(frame: NSMakeRect(0, 0, Double(width), 0))\n    }\n    return alert\n}\n\nfunc showAlertSyncOnMainThread(level: NSAlert.Style = .warning, title: String, message: String, button1: String, button2: String = \"\", width: Int? = nil) -> NSApplication.ModalResponse {\n    var response: NSApplication.ModalResponse = .abort\n    let semaphore = DispatchSemaphore(value: 0)\n    \n    DispatchQueue.main.async {\n        let alert = createAlert(level: level, title: title, message: message, button1: button1, button2: button2, width: width)\n        response = alert.runModal()\n        semaphore.signal()\n    }\n    \n    semaphore.wait()\n    return response\n}\n\nextension Bundle {\n    var appName: String {\n        let appName = self.object(forInfoDictionaryKey: \"CFBundleDisplayName\") as? String\n                     ?? Bundle.main.object(forInfoDictionaryKey: \"CFBundleName\") as? String\n                     ?? \"Unknown App Name\"\n        return appName\n    }\n}\n\nextension String {\n    var local: String { return NSLocalizedString(self, comment: \"\") }\n    var deletingPathExtension: String {\n        return (self as NSString).deletingPathExtension\n    }\n    var pathExtension: String {\n        return (self as NSString).pathExtension\n    }\n    var lastPathComponent: String {\n        return (self as NSString).lastPathComponent\n    }\n    var url: URL { return URL(fileURLWithPath: self) }\n}\n\nextension NSMenuItem {\n    func performAction() {\n        guard let menu else {\n            return\n        }\n        menu.performActionForItem(at: menu.index(of: self))\n    }\n}\n\nextension NSImage {\n    static func createScreenShot() -> NSImage? {\n        let excludedAppBundleIDs = [\"com.lihaoyun6.QuickRecorder\"]\n        var exclusionPIDs = [Int]()\n        for app in NSWorkspace.shared.runningApplications {\n            if excludedAppBundleIDs.contains(app.bundleIdentifier ?? \"\") {\n                exclusionPIDs.append(Int(app.processIdentifier))\n            }\n        }\n        \n        let windowDescriptions = CGWindowListCopyWindowInfo(.optionOnScreenOnly, kCGNullWindowID) as? [[String: Any]] ?? []\n        var windowIDs = [CGWindowID]()\n        for windowDict in windowDescriptions {\n            if let windowProcessID = windowDict[kCGWindowOwnerPID as String] as? Int,\n               !exclusionPIDs.contains(windowProcessID),\n               let windowID = windowDict[kCGWindowNumber as String] as? CGWindowID {\n                windowIDs.append(windowID)\n            }\n        }\n        let pointer = UnsafeMutablePointer<UnsafeRawPointer?>.allocate(capacity: windowIDs.count)\n        for (index, window) in windowIDs.enumerated() { pointer[index] = UnsafeRawPointer(bitPattern: UInt(window)) }\n        let cWindowIDArray: CFArray = CFArrayCreate(kCFAllocatorDefault, pointer, windowIDs.count, nil)\n\n        guard let imageRef = CGImage(windowListFromArrayScreenBounds: CGRect.infinite, windowArray: cWindowIDArray, imageOption: []) else {\n            print(\"No image available\")\n            return nil\n        }\n        let factor = SCContext.getScreenWithMouse()?.backingScaleFactor ?? 1.0\n        return NSImage(cgImage: imageRef, size: NSSize(width: CGFloat(imageRef.width)/factor, height: CGFloat(imageRef.height)/factor))\n    }\n    \n    func saveToFile(_ url: URL, type: NSBitmapImageRep.FileType = .png) {\n        if let tiffData = self.tiffRepresentation,\n           let imageRep = NSBitmapImageRep(data: tiffData) {\n            let pngData = imageRep.representation(using: type, properties: [:])\n            do {\n                try pngData?.write(to: url)\n            } catch {\n                print(\"Error saving image: \\(error.localizedDescription)\")\n            }\n        }\n    }\n    \n    func trim(rect: CGRect) -> NSImage {\n        let result = NSImage(size: rect.size)\n        result.lockFocus()\n\n        let destRect = CGRect(origin: .zero, size: result.size)\n        self.draw(in: destRect, from: rect, operation: .copy, fraction: 1.0)\n\n        result.unlockFocus()\n        return result\n    }\n}\n\nclass NNSWindow: NSWindow {\n    override var canBecomeKey: Bool {\n        return true\n    }\n}\n\nstruct FixedLengthArray<T> {\n    private var array: [T] = []\n    private let maxLength: Int\n\n    init(maxLength: Int) {\n        self.maxLength = maxLength\n    }\n\n    mutating func append(_ element: T) {\n        if array.count >= maxLength {\n            array.removeFirst()\n        }\n        array.append(element)\n    }\n\n    func getArray() -> [T] {\n        return array\n    }\n}\n\nextension utsname {\n    static var sMachine: String {\n        var utsname = utsname()\n        uname(&utsname)\n        return withUnsafePointer(to: &utsname.machine) {\n            $0.withMemoryRebound(to: CChar.self, capacity: Int(_SYS_NAMELEN)) {\n                String(cString: $0)\n            }\n        }\n    }\n    static var isAppleSilicon: Bool {\n        sMachine == \"arm64\"\n    }\n}\n\nenum AudioQuality: Int { case normal = 128, good = 192, high = 256, extreme = 320 }\n\nenum AudioFormat: String { case aac, alac, flac, opus, mp3 }\n\nenum VideoFormat: String { case mov, mp4 }\n\nenum PixFormat: String { case delault, yuv420p8v, yuv420p8f, yuv420p10v, yuv420p10f, bgra32 }\n\nenum ColSpace: String { case delault, srgb, p3, bt709, bt2020 }\n\nenum Encoder: String { case h264, h265 }\n\nenum StreamType: Int { case screen, window, windows, application, screenarea, systemaudio, idevice, camera }\n\nenum BackgroundType: String { case wallpaper, clear, black, white, red, green, yellow, orange, gray, blue, custom }\n"
  },
  {
    "path": "QuickRecorder/RecordEngine.swift",
    "content": "//\n//  RecordEngine.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/17.\n//\n\nimport Foundation\nimport UserNotifications\nimport ScreenCaptureKit\nimport AVFoundation\nimport AVFAudio\nimport VideoToolbox\nimport AECAudioStream\n\nextension AppDelegate {\n    @objc func prepRecord(type: String, screens: SCDisplay?, windows: [SCWindow]?, applications: [SCRunningApplication]?, fastStart: Bool = false) {\n        switch type {\n        case \"window\":  SCContext.streamType = .window\n        case \"windows\":  SCContext.streamType = .windows\n        case \"display\": SCContext.streamType = .screen\n        case \"application\": SCContext.streamType = .application\n        case \"area\": SCContext.streamType = .screenarea\n        case \"audio\":   SCContext.streamType = .systemaudio\n            default: return // if we don't even know what to record I don't think we should even try\n        }\n        var isDirectory: ObjCBool = false\n        let outputPath = saveDirectory!\n        if fd.fileExists(atPath: outputPath, isDirectory: &isDirectory) {\n            if !isDirectory.boolValue {\n                SCContext.streamType = nil\n                _ = createAlert(title: \"Failed to Record\".local, message: \"The output path is a file instead of a folder!\".local, button1: \"OK\").runModal()\n                return\n            }\n        } else {\n            do {\n                try fd.createDirectory(atPath: outputPath, withIntermediateDirectories: true, attributes: nil)\n            } catch {\n                SCContext.streamType = nil\n                _ = createAlert(title: \"Failed to Record\".local, message: \"Unable to create output folder!\".local, button1: \"OK\").runModal()\n                return\n            }\n        }\n        \n        // file preparation\n        if let screens = screens {\n            SCContext.screen = SCContext.availableContent!.displays.first(where: { $0 == screens })\n        } else { SCContext.streamType = nil; return }\n        \n        if let windows = windows {\n            SCContext.window = SCContext.availableContent!.windows.filter({ windows.contains($0) })\n        } else { if SCContext.streamType == .window { SCContext.streamType = nil; return } }\n        \n        if let applications = applications {\n            SCContext.application = SCContext.availableContent!.applications.filter({ applications.contains($0) })\n        } else { if SCContext.streamType == .application { SCContext.streamType = nil; return } }\n        \n        let screen = SCContext.screen ?? SCContext.getSCDisplayWithMouse()!\n        let qrSelf = SCContext.getSelf()\n        let qrWindows = SCContext.getSelfWindows()\n        let dockApp = SCContext.availableContent!.applications.first(where: { $0.bundleIdentifier.description == \"com.apple.dock\" })\n        let wallpaper = SCContext.availableContent!.windows.filter({\n            guard let title = $0.title else { return false }\n            return $0.owningApplication?.bundleIdentifier == \"com.apple.dock\" && title != \"LPSpringboard\" && title != \"Dock\"\n        })\n        let desktop = SCContext.availableContent!.windows.filter({\n            guard let title = $0.title else { return false }\n            return $0.owningApplication?.bundleIdentifier == \"\" && title == \"Desktop\"\n        })\n        let dockWindow = SCContext.availableContent!.windows.filter({\n            guard let title = $0.title else { return true }\n            return $0.owningApplication?.bundleIdentifier == \"com.apple.dock\" && title == \"Dock\"\n        })\n        let desktopFiles = SCContext.availableContent!.windows.filter({\n            $0.owningApplication?.bundleIdentifier == \"com.apple.finder\"\n            && $0.title == \"\" && $0.frame == screen.frame })\n        let controlCenterWindow = SCContext.availableContent!.applications.filter({ $0.bundleIdentifier == \"com.apple.controlcenter\" })\n        let mouseWindow = SCContext.availableContent!.windows.filter({ $0.title == \"Mouse Pointer\".local && $0.owningApplication?.bundleIdentifier == Bundle.main.bundleIdentifier })\n        let camLayer = SCContext.availableContent!.windows.filter({ $0.title == \"Camera Overlayer\".local && $0.owningApplication?.bundleIdentifier == Bundle.main.bundleIdentifier })\n        var appBlackList = [String]()\n        if let savedData = ud.data(forKey: \"hiddenApps\"),\n           let decodedApps = try? JSONDecoder().decode([AppInfo].self, from: savedData) {\n            appBlackList = (decodedApps as [AppInfo]).map({ $0.bundleID })\n        }\n        let excliudedApps = SCContext.availableContent!.applications.filter({ appBlackList.contains($0.bundleIdentifier) })\n        \n        if SCContext.streamType == .window || SCContext.streamType == .windows {\n            if var includ = SCContext.window {\n                if includ.count > 1 {\n                    if highlightMouse { includ += mouseWindow }\n                    if background.rawValue == BackgroundType.wallpaper.rawValue { if dockApp != nil { includ += wallpaper }}\n                    SCContext.filter = SCContentFilter(display: screen, including: includ + camLayer)\n                    if #available(macOS 14.2, *) { SCContext.filter?.includeMenuBar = includeMenuBar }\n                } else {\n                    SCContext.streamType = .window\n                    SCContext.filter = SCContentFilter(desktopIndependentWindow: includ[0])\n                }\n            }\n        } else {\n            if SCContext.streamType == .screen || SCContext.streamType == .screenarea {\n                if SCContext.streamType == .screenarea {\n                    if let area = SCContext.screenArea, let name = screen.nsScreen?.localizedName {\n                        let a = [\"x\": area.origin.x, \"y\": area.origin.y, \"width\": area.width, \"height\": area.height]\n                        ud.set([name: a], forKey: \"savedArea\")\n                    }\n                }\n                var excluded = [SCRunningApplication]()\n                var except = [SCWindow]()\n                excluded += excliudedApps\n                if hideCCenter { excluded += controlCenterWindow }\n                if hideSelf { if let qrWindows = qrWindows { except += qrWindows }}\n                if background.rawValue != BackgroundType.wallpaper.rawValue { if dockApp != nil {\n                    except += wallpaper\n                    except += desktop\n                }}\n                if hideDesktopFiles { except += desktopFiles }\n                SCContext.filter = SCContentFilter(display: screen, excludingApplications: excluded, exceptingWindows: except)\n                if #available(macOS 14.2, *) { SCContext.filter?.includeMenuBar = ((SCContext.streamType == .screen || SCContext.streamType == .screenarea) && includeMenuBar) }\n            }\n            if SCContext.streamType == .application {\n                var includ = SCContext.application!\n                var except = [SCWindow]()\n                if let qrSelf = qrSelf { includ.append(qrSelf) }\n                let withFinder = includ.map{ $0.bundleIdentifier }.contains(\"com.apple.finder\")\n                if withFinder && hideDesktopFiles { except += desktopFiles }\n                if hideSelf { if let qrWindows = qrWindows { except += qrWindows }}\n                //if ud.bool(forKey: \"highlightMouse\") { if let qrSelf = qrSelf { includ.append(qrSelf) }}\n                if background.rawValue == BackgroundType.wallpaper.rawValue { if let dock = dockApp { includ.append(dock); except += dockWindow}}\n                SCContext.filter = SCContentFilter(display: screen, including: includ, exceptingWindows: except)\n                if #available(macOS 14.2, *) { SCContext.filter?.includeMenuBar = includeMenuBar }\n            }\n        }\n        if SCContext.streamType == .systemaudio {\n            SCContext.filter = SCContentFilter(display: screen, excludingApplications: [], exceptingWindows: [])\n            prepareAudioRecording()\n        }\n        Task { await record(filter: SCContext.filter!, fastStart: fastStart) }\n    }\n\n    func record(filter: SCContentFilter, fastStart: Bool = true) async {\n        SCContext.timeOffset = CMTimeMake(value: 0, timescale: 0)\n        SCContext.isPaused = false\n        SCContext.isResume = false\n        \n        let audioOnly = SCContext.streamType == .systemaudio\n        \n        let conf: SCStreamConfiguration\n#if compiler(>=6.0)\n        if recordHDR {\n            if #available(macOS 15, *) {\n                // TODO change here. https://developer.apple.com/videos/play/wwdc2024/10088/?time=191\n                // For canonical display, it means you are capturing HDR content that is optimized for sharing with other HDR devices.\n                // hdrLocalDisplay or hdrCanonicalDisplay\n\n\n                conf = SCStreamConfiguration(preset: .captureHDRStreamLocalDisplay)\n            } else { conf = SCStreamConfiguration() }\n        } else { conf = SCStreamConfiguration() }\n#else\n        conf = SCStreamConfiguration()\n#endif\n        conf.width = 2\n        conf.height = 2\n        \n        if !audioOnly {\n            if #available(macOS 14.0, *) {\n                conf.width = Int(filter.contentRect.width) * (highRes == 2 ? Int(filter.pointPixelScale) : 1)\n                conf.height = Int(filter.contentRect.height) * (highRes == 2 ? Int(filter.pointPixelScale) : 1)\n            } else {\n                guard let pointPixelScaleOld = (SCContext.screen ?? SCContext.getSCDisplayWithMouse()!).nsScreen?.backingScaleFactor else { return }\n                if SCContext.streamType == .application || SCContext.streamType == .windows || SCContext.streamType == .screen {\n                    let frame = (SCContext.screen ?? SCContext.getSCDisplayWithMouse()!).frame\n                    conf.width = Int(frame.width)\n                    conf.height = Int(frame.height)\n                }\n                if SCContext.streamType == .window {\n                    let frame = SCContext.window![0].frame\n                    conf.width = Int(frame.width)\n                    conf.height = Int(frame.height)\n                }\n                if SCContext.streamType == .screenarea {\n                    let frame = SCContext.screenArea!\n                    conf.width = Int(frame.width)\n                    conf.height = Int(frame.height)\n                }\n                conf.width = conf.width * (highRes == 2 ? Int(pointPixelScaleOld) : 1)\n                conf.height = conf.height * (highRes == 2 ? Int(pointPixelScaleOld) : 1)\n            }\n            \n            if fastStart{\n                conf.showsCursor = false\n            } else{\n                conf.showsCursor = showMouse\n            }\n                    \n\n            if background.rawValue != BackgroundType.wallpaper.rawValue { conf.backgroundColor = SCContext.getBackgroundColor() }\n            if !recordHDR {\n                conf.pixelFormat = kCVPixelFormatType_32BGRA\n                conf.colorSpaceName = CGColorSpace.sRGB\n                //if withAlpha { conf.pixelFormat = kCVPixelFormatType_32BGRA }\n            } else {\n                // For recording HDR in a BT2020 PQ container\n                conf.colorSpaceName = CGColorSpace.itur_2100_PQ\n//                https://developer.apple.com/videos/play/wwdc2022/10155/ guide on how to record 4k60\n//                streamConfiguration.pixelFormat = kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange\n    \n// Note: 420 encoding causes color bleed at edges, e.g. youtube settings icon with red logo\n                // conf.pixelFormat = kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange\n//              dont exceed 8 frames  https://developer.apple.com/documentation/screencapturekit/scstreamconfiguration/queuedepth\n//                lower queuedepth has more stutter, dont go below 4 https://github.com/nonstrict-hq/ScreenCaptureKit-Recording-example/blob/main/Sources/sckrecording/main.swift\n                conf.queueDepth = 8\n            }\n        }\n        \n        if #available(macOS 13, *) {\n            conf.capturesAudio = recordWinSound || fastStart || audioOnly\n            conf.sampleRate = 48000\n            conf.channelCount = 2\n        }\n        \n\n        //  conf.minimumFrameInterval = CMTime(value: 1, timescale: audioOnly ? CMTimeScale.max : CMTimeScale(frameRate))\n         conf.minimumFrameInterval = CMTime(value: 1, timescale: audioOnly ? CMTimeScale.max : (frameRate >= 60 ? 0 : CMTimeScale(frameRate)))\n\n//        CMTimeScale is the denominator in the fraction\n//        conf.minimumFrameInterval = CMTime(seconds: audioOnly ? Double(CMTimeScale.max) : Double(1)/Double(frameRate), preferredTimescale: 10000)\n\n        // note: ScreenCaptureKit only delivers frames when something changes\n        // https://www.reddit.com/r/swift/comments/158n4c9/comment/ju847rm/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button\n\n        //blog post from the reddit comment https://nonstrict.eu/blog/2023/recording-to-disk-with-screencapturekit/\n\n        //https://github.com/nonstrict-hq/ScreenCaptureKit-Recording-example\n\n        // https://developer.apple.com/documentation/screencapturekit/scstreamconfiguration/minimumframeinterval\n        //minimumFrameInterval: Use this value to throttle the rate at which you receive updates. The default value is 0, which indicates that the system uses the maximum supported frame rate.\n\n        print(\"Frame interval passed to ScreenCaptureKit. (timescale is FPS. 0 means no throttling): \\(conf.minimumFrameInterval)\")\n        \n\n        if SCContext.streamType == .screenarea {\n            if let nsRect = SCContext.screenArea {\n                let newY = SCContext.screen!.frame.height - nsRect.size.height - nsRect.origin.y\n                conf.sourceRect = CGRect(x: nsRect.origin.x, y: newY, width: nsRect.size.width, height: nsRect.size.height)\n                if #available(macOS 14.0, *) {\n                    conf.width = Int(conf.sourceRect.width) * (highRes == 2 ? Int(filter.pointPixelScale) : 1)\n                    conf.height = Int(conf.sourceRect.height) * (highRes == 2 ? Int(filter.pointPixelScale) : 1)\n                } else {\n                    guard let pointPixelScaleOld = (SCContext.screen ?? SCContext.getSCDisplayWithMouse()!).nsScreen?.backingScaleFactor else { return }\n                    conf.width = Int(conf.sourceRect.width) * (highRes == 2 ? Int(pointPixelScaleOld) : 1)\n                    conf.height = Int(conf.sourceRect.height) * (highRes == 2 ? Int(pointPixelScaleOld) : 1)\n                }\n            }\n        }\n        \n        let encoderIsH265 = (encoder.rawValue == Encoder.h265.rawValue) || recordHDR\n        if !audioOnly && !encoderIsH265 {\n            var session: VTCompressionSession?\n            let status = VTCompressionSessionCreate(\n                allocator: nil,\n                width: Int32(conf.width),\n                height: Int32(conf.height),\n                codecType: kCMVideoCodecType_H264,\n                encoderSpecification: [kVTVideoEncoderSpecification_RequireHardwareAcceleratedVideoEncoder as String: true] as CFDictionary,\n                imageBufferAttributes: nil,\n                compressedDataAllocator: nil,\n                outputCallback: nil,\n                refcon: nil,\n                compressionSessionOut: &session\n            )\n            \n            if status != noErr {\n                let button = showAlertSyncOnMainThread(\n                    level: .critical,\n                    title: \"Encoder Warning\",\n                    message: \"VideoToolbox H.264 hardware encoder doesn't support the current resolution.\\nContinue with a software encoder will significantly increase the CPU usage.\\n\\nWould you like to use H.265 instead?\".local,\n                    button1: \"Use H.265\",\n                    button2: \"Continue with H.264\"\n                )\n                if button == .alertFirstButtonReturn { ud.setValue(Encoder.h265.rawValue, forKey: \"encoder\") }\n            }\n        }\n        \n        SCContext.stream = SCStream(filter: filter, configuration: conf, delegate: self)\n        do {\n            try SCContext.stream.addStreamOutput(self, type: .screen, sampleHandlerQueue: .global())\n            if #available(macOS 13, *) { try SCContext.stream.addStreamOutput(self, type: .audio, sampleHandlerQueue: .global()) }\n            if !audioOnly {\n                initVideo(conf: conf)\n            } else {\n                //SCContext.startTime = Date.now\n                if recordMic { startMicRecording() }\n            }\n            try await SCContext.stream.startCapture()\n        } catch {\n            assertionFailure(\"capture failed\".local)\n            return\n        }\n        if !audioOnly { registerGlobalMouseMonitor() }\n        DispatchQueue.main.async { updateStatusBar() }\n        if preventSleep { SleepPreventer.shared.preventSleep(reason: \"Screen recording in progress\") }\n    }\n\n    func prepareAudioRecording() {\n        var fileEnding = audioFormat.rawValue\n        var fileType = AVFileType.m4a\n        let encorder = fileEnding == AudioFormat.mp3.rawValue ? \"aac\" : fileEnding\n        switch fileEnding { // todo: I'd like to store format info differently\n            case AudioFormat.mp3.rawValue: fallthrough\n            case AudioFormat.aac.rawValue: fallthrough\n            case AudioFormat.alac.rawValue: fileEnding = \"m4a\"\n            case AudioFormat.flac.rawValue: fileEnding = \"flac\"; fileType = .caf\n            case AudioFormat.opus.rawValue: fileEnding = \"ogg\"; fileType = .caf\n            default: assertionFailure(\"loaded unknown audio format: \".local + fileEnding)\n        }\n        let path = SCContext.getFilePath()\n        if recordMic && SCContext.streamType == .systemaudio {\n            SCContext.filePath = \"\\(path).qma\"\n            SCContext.filePath1 = \"\\(path).qma/sys.\\(fileEnding)\"\n            SCContext.filePath2 = \"\\(path).qma/mic.\\(fileEnding)\"\n            let infoJsonURL = \"\\(path).qma/info.json\".url\n            let jsonString = \"{\\\"format\\\": \\\"\\(fileEnding)\\\", \\\"encoder\\\": \\\"\\(encorder)\\\", \\\"exportMP3\\\": \\(audioFormat.rawValue == AudioFormat.mp3.rawValue), \\\"sysVol\\\": 1.0, \\\"micVol\\\": 1.0}\"\n            try? fd.createDirectory(at: SCContext.filePath.url, withIntermediateDirectories: true, attributes: nil)\n            try? jsonString.write(to: infoJsonURL, atomically: true, encoding: .utf8)\n            \n            SCContext.audioFile = try! AVAudioFile(forWriting: SCContext.filePath1.url, settings: SCContext.updateAudioSettings(), commonFormat: .pcmFormatFloat32, interleaved: false)\n\n            let sampleRate = SCContext.getSampleRate() ?? 48000\n            let settings = SCContext.updateAudioSettings(rate: sampleRate)\n            SCContext.vW = try? AVAssetWriter.init(outputURL: SCContext.filePath2.url, fileType: fileType)\n            SCContext.micInput = AVAssetWriterInput(mediaType: AVMediaType.audio, outputSettings: settings)\n            SCContext.micInput.expectsMediaDataInRealTime = true\n            if SCContext.vW.canAdd(SCContext.micInput) { SCContext.vW.add(SCContext.micInput) }\n            SCContext.vW.startWriting()\n            //SCContext.audioFile2 = try! AVAudioFile(forWriting: SCContext.filePath2.url, settings: settings, commonFormat: .pcmFormatFloat32, interleaved: false)\n        } else {\n            SCContext.filePath = \"\\(path).\\(fileEnding)\"\n            SCContext.filePath1 = SCContext.filePath\n            SCContext.audioFile = try! AVAudioFile(forWriting: SCContext.filePath.url, settings: SCContext.updateAudioSettings(), commonFormat: .pcmFormatFloat32, interleaved: false)\n        }\n    }\n}\n\nextension NSScreen {\n    var displayID: CGDirectDisplayID? {\n        return deviceDescription[NSDeviceDescriptionKey(rawValue: \"NSScreenNumber\")] as? CGDirectDisplayID\n    }\n    var isMainScreen: Bool {\n        guard let id = self.displayID else { return false }\n        return (CGDisplayIsMain(id) == 1)\n    }\n}\n\nextension SCDisplay {\n    var nsScreen: NSScreen? {\n        return NSScreen.screens.first(where: { $0.displayID == self.displayID })\n    }\n}\n\nextension AppDelegate {\n    func initVideo(conf: SCStreamConfiguration) {\n        SCContext.startTime = nil\n\n        let fileEnding = videoFormat.rawValue\n        var fileType: AVFileType?\n        switch fileEnding {\n            case VideoFormat.mov.rawValue: fileType = AVFileType.mov\n            case VideoFormat.mp4.rawValue: fileType = AVFileType.mp4\n            default: assertionFailure(\"loaded unknown video format\".local)\n        }\n\n        if remuxAudio && recordMic && recordWinSound {\n            SCContext.filePath = \"\\(SCContext.getFilePath()).\\(fileEnding).\\(fileEnding).\\(fileEnding)\"\n        } else {\n            SCContext.filePath = \"\\(SCContext.getFilePath()).\\(fileEnding)\"\n        }\n        SCContext.vW = try? AVAssetWriter.init(outputURL: SCContext.filePath.url, fileType: fileType!)\n        let encoderIsH265 = (encoder.rawValue == Encoder.h265.rawValue) || recordHDR\n        let fpsMultiplier: Double = Double(frameRate)/8\n        let encoderMultiplier: Double = encoderIsH265 ? 0.5 : 0.9\n        let resolution = Double(max(600, conf.width)) * Double(max(600, conf.height))\n        var qualityMultiplier = 1 - (log10(sqrt(resolution) * fpsMultiplier) / 5)\n        switch videoQuality {\n            case 0.3: qualityMultiplier = max(0.1, qualityMultiplier)\n            case 0.7: qualityMultiplier = max(0.4, min(0.6, qualityMultiplier * 3))\n            default: qualityMultiplier = 1.0\n        }\n        let h264Level = AVVideoProfileLevelH264HighAutoLevel\n        let h265Level = recordHDR ? kVTProfileLevel_HEVC_Main10_AutoLevel : kVTProfileLevel_HEVC_Main_AutoLevel\n\n        let targetBitrate = resolution * fpsMultiplier * encoderMultiplier * qualityMultiplier * (recordHDR ? 2 : 1)\n        print(\"framerate set in app: \\(frameRate)\")\n        print(\"target bitrate: \\(targetBitrate/1000000)\")\n\n        var videoSettings: [String: Any] = [\n            AVVideoCodecKey: encoderIsH265 ? ((withAlpha && !recordHDR) ? AVVideoCodecType.hevcWithAlpha : AVVideoCodecType.hevc) : AVVideoCodecType.h264,\n            // yes, not ideal if we want more than these encoders in the future, but it's ok for now\n            AVVideoWidthKey: conf.width,\n            AVVideoHeightKey: conf.height,\n            AVVideoCompressionPropertiesKey: [\n                AVVideoProfileLevelKey: encoderIsH265 ? h265Level : h264Level,\n                AVVideoAverageBitRateKey: max(200000, Int(targetBitrate)),\n                AVVideoExpectedSourceFrameRateKey: frameRate,\n            ] as [String : Any]\n        ]\n        \n        if !recordHDR {\n            videoSettings[AVVideoColorPropertiesKey] = [\n                AVVideoTransferFunctionKey: AVVideoTransferFunction_ITU_R_709_2,\n                AVVideoColorPrimariesKey: AVVideoColorPrimaries_ITU_R_709_2,\n                AVVideoYCbCrMatrixKey: AVVideoYCbCrMatrix_ITU_R_709_2] as [String : Any]\n        }\n        \n        SCContext.vwInput = AVAssetWriterInput(mediaType: AVMediaType.video, outputSettings: videoSettings)\n        SCContext.vwInput.expectsMediaDataInRealTime = true\n        \n        if SCContext.vW.canAdd(SCContext.vwInput) { SCContext.vW.add(SCContext.vwInput) }\n\n        if #available(macOS 13, *) {\n            SCContext.awInput = AVAssetWriterInput(mediaType: AVMediaType.audio, outputSettings: SCContext.updateAudioSettings())\n            SCContext.awInput.expectsMediaDataInRealTime = true\n            if SCContext.vW.canAdd(SCContext.awInput) { SCContext.vW.add(SCContext.awInput) }\n        }\n\n        if recordMic {\n            let sampleRate = SCContext.getSampleRate() ?? 48000\n            let settings = SCContext.updateAudioSettings(rate: sampleRate)\n            \n            SCContext.micInput = AVAssetWriterInput(mediaType: AVMediaType.audio, outputSettings: settings)\n            SCContext.micInput.expectsMediaDataInRealTime = true\n            if SCContext.vW.canAdd(SCContext.micInput) { SCContext.vW.add(SCContext.micInput) }\n            startMicRecording()\n        }\n        SCContext.vW.startWriting()\n    }\n    \n    func startMicRecording() {\n        if micDevice == \"default\" {\n            if enableAEC {\n                var level = AUVoiceIOOtherAudioDuckingLevel.mid\n                switch AECLevel {\n                    case \"min\": level = .min\n                    case \"max\": level = .max\n                    default: level = .mid\n                }\n                try? SCContext.AECEngine.startAudioStream(enableAEC: enableAEC, duckingLevel: level, audioBufferHandler: { pcmBuffer in\n                    if SCContext.isPaused || SCContext.startTime == nil { return }\n                    if SCContext.micInput.isReadyForMoreMediaData {\n                        SCContext.micInput.append(pcmBuffer.asSampleBuffer!)\n                    }\n                })\n            } else {\n                let input = SCContext.audioEngine.inputNode\n                let inputFormat = input.inputFormat(forBus: 0)\n                input.installTap(onBus: 0, bufferSize: 1024, format: inputFormat) { buffer, time in\n                    if SCContext.isPaused || SCContext.startTime == nil { return }\n                    if SCContext.micInput.isReadyForMoreMediaData {\n                        SCContext.micInput.append(buffer.asSampleBuffer!)\n                    }\n                }\n                try! SCContext.audioEngine.start()\n            }\n        } else {\n            AudioRecorder.shared.setupAudioCapture()\n            AudioRecorder.shared.start()\n        }\n    }\n    \n    func outputVideoEffectDidStart(for stream: SCStream) {\n        DispatchQueue.main.async { camWindow.close() }\n        print(\"[Presenter Overlay ON]\")\n        isPresenterON = true\n        DispatchQueue.main.asyncAfter(deadline: .now() + TimeInterval(poSafeDelay)) {\n            self.isCameraReady = true\n        }\n    }\n    \n    func outputVideoEffectDidStop(for stream: SCStream) {\n        print(\"[Presenter Overlay OFF]\")\n        presenterType = \"OFF\"\n        isPresenterON = false\n        isCameraReady = false\n        DispatchQueue.main.async {\n            if SCContext.stream != nil { camWindow.orderFront(self) }\n        }\n    }\n    \n    func stream(_ stream: SCStream, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, of outputType: SCStreamOutputType) {\n        if SCContext.saveFrame, let imageBuffer = sampleBuffer.imageBuffer {\n            SCContext.saveFrame = false\n            \n            var ciImage = CIImage(cvPixelBuffer: imageBuffer)\n            let url = \"\\(SCContext.getFilePath(capture: true)).png\".url\n            if !recordHDR {\n                sampleBuffer.nsImage?.saveToFile(url)\n            } else {\n                let context = CIContext()\n                \n                // Create the HEIF destination with the correct UTI\n                //            if let destination = url? {\n                // Specify format and color space (assuming default settings here)\n                //                let format = CIFormat.rgb10\n                let colorSpace = CGColorSpace(name: CGColorSpace.itur_2100_PQ) ?? CGColorSpaceCreateDeviceRGB()\n                \n                // let colorSpace = ciImage.colorSpace ?? CGColorSpaceCreateDeviceRGB()\n                \n                // Image exposure needs to be increased by one stop to match the original\n                ciImage = ciImage.applyingFilter(\"CIExposureAdjust\", parameters: [\"inputEV\": 1.0])\n                \n                \n                \n                \n                \n                //                context.writeHEIF10Representation(of: ciImage, to: destination as! URL, colorSpace: colorSpace)\n                do{\n                    // try context.writeHEIF10Representation(of:ciImage,\n                    //                                       to:url,\n                    //                                       colorSpace:colorSpace,\n                    //                                       options: [\n                    //     kCGImageDestinationLossyCompressionQuality as CIImageRepresentationOption: 1.0\n                    if #available(macOS 14.0, *) {\n                        try context.writePNGRepresentation(of:ciImage,\n                                                           to:url,\n                                                           format: .RGB10,\n                                                           colorSpace:colorSpace\n                        )\n                    } else {\n                        // Fallback on earlier versions\n                        print(\"RGB10 PNG not supported on this macOS version\")\n                        try context.writePNGRepresentation(of:ciImage,\n                                                           to:url,\n                                                           format: .RGBA8,\n                                                           colorSpace:colorSpace)\n                    }\n                    //        try context.writePNGRepresentation(of:outImage, to:outURL, format: .RGBA16,colorSpace:colorSpace,options:[:])\n                } catch let error {\n                    // Handle the error case\n                    print(\"Error: \\(error)\")\n                }\n                //                CGImageDestinationFinalize(destination)\n            }\n        }\n        if SCContext.isPaused { return }\n        guard sampleBuffer.isValid else { return }\n        var SampleBuffer = sampleBuffer\n        if SCContext.isResume {\n            SCContext.isResume = false\n            var pts = CMSampleBufferGetPresentationTimeStamp(SampleBuffer)\n            guard let last = SCContext.lastPTS else { return }\n            if last.flags.contains(CMTimeFlags.valid) {\n                if SCContext.timeOffset.flags.contains(CMTimeFlags.valid) { pts = CMTimeSubtract(pts, SCContext.timeOffset) }\n                let off = CMTimeSubtract(pts, last)\n                print(\"adding \\(CMTimeGetSeconds(off)) to \\(CMTimeGetSeconds(SCContext.timeOffset)) (pts \\(CMTimeGetSeconds(SCContext.timeOffset)))\")\n                if SCContext.timeOffset.value == 0 { SCContext.timeOffset = off } else { SCContext.timeOffset = CMTimeAdd(SCContext.timeOffset, off) }\n            }\n            SCContext.lastPTS?.flags = []\n        }\n        switch outputType {\n        case .screen:\n            if (SCContext.screen == nil && SCContext.window == nil && SCContext.application == nil) || SCContext.streamType == .systemaudio { break }\n            guard let attachmentsArray = CMSampleBufferGetSampleAttachmentsArray(SampleBuffer, createIfNecessary: false) as? [[SCStreamFrameInfo: Any]],\n                  let attachments = attachmentsArray.first else { return }\n            guard let statusRawValue = attachments[SCStreamFrameInfo.status] as? Int,\n                  let status = SCFrameStatus(rawValue: statusRawValue),\n                  status == .complete else { return }\n            \n            if SCContext.vW != nil && SCContext.vW?.status == .writing, SCContext.startTime == nil {\n                SCContext.startTime = Date.now\n                SCContext.vW.startSession(atSourceTime: CMSampleBufferGetPresentationTimeStamp(SampleBuffer))\n            }\n            if (SCContext.timeOffset.value > 0) { SampleBuffer = SCContext.adjustTime(sample: SampleBuffer, by: SCContext.timeOffset) ?? sampleBuffer }\n            var pts = CMSampleBufferGetPresentationTimeStamp(SampleBuffer)\n            let dur = CMSampleBufferGetDuration(SampleBuffer)\n            if (dur.value > 0) { pts = CMTimeAdd(pts, dur) }\n            if frameQueue.getArray().contains(where: { $0 >= pts }) { print(\"Skip this frame\"); return } else { frameQueue.append(pts) }\n            SCContext.lastPTS = pts\n            if SCContext.vwInput.isReadyForMoreMediaData {\n                if #available(macOS 14.2, *) {\n                    if let rect = attachments[.presenterOverlayContentRect] as? [String: Any]{\n                        var type = \"np\"\n                        let off = (rect[\"X\"] as! CGFloat == .infinity)\n                        let small = (rect[\"X\"] as! CGFloat == 0.0)\n                        let big = (!off && !small)\n                        if off { type = \"OFF\" } else if small { type = \"Small\" } else if big { type = \"Big\" }\n                        if type != presenterType {\n                            print(\"Presenter Overlay set to \\\"\\(type)\\\"!\")\n                            isCameraReady = false\n                            DispatchQueue.main.asyncAfter(deadline: .now() + TimeInterval(poSafeDelay)) {\n                                self.isCameraReady = true\n                            }\n                            presenterType = type\n                        }\n                    }\n                }\n                if isPresenterON && !isCameraReady { break }\n                if SCContext.firstFrame == nil { SCContext.firstFrame = SampleBuffer }\n                SCContext.vwInput.append(SampleBuffer)\n            }\n            break\n        case .audio:\n            if SCContext.streamType == .systemaudio { // write directly to file if not video recording\n                hideMousePointer = true\n                if SCContext.vW != nil && SCContext.vW?.status == .writing, SCContext.startTime == nil {\n                    SCContext.vW.startSession(atSourceTime: CMSampleBufferGetPresentationTimeStamp(SampleBuffer))\n                }\n                if SCContext.startTime == nil { SCContext.startTime = Date.now }\n                guard let samples = SampleBuffer.asPCMBuffer else { return }\n                do { try SCContext.audioFile?.write(from: samples) }\n                catch { assertionFailure(\"audio file writing issue\".local) }\n            } else {\n                if SCContext.lastPTS == nil { return }\n                if SCContext.awInput.isReadyForMoreMediaData { SCContext.awInput.append(SampleBuffer) }\n            }\n#if compiler(>=6.0)\n        case .microphone:\n            break\n#endif\n        @unknown default:\n            assertionFailure(\"unknown stream type\".local)\n        }\n    }\n\n    func stream(_ stream: SCStream, didStopWithError error: Error) { // stream error\n        print(\"closing stream with error:\\n\".local, error,\n              \"\\nthis might be due to the window closing or the user stopping from the sonoma ui\".local)\n        DispatchQueue.main.async {\n            SCContext.stream = nil\n            SCContext.stopRecording()\n        }\n    }\n}\n\nclass AudioRecorder: NSObject, AVCaptureAudioDataOutputSampleBufferDelegate {\n    static let shared = AudioRecorder()\n    private var captureSession: AVCaptureSession!\n    private var audioInput: AVCaptureDeviceInput!\n    private var audioDataOutput: AVCaptureAudioDataOutput!\n\n    func setupAudioCapture() {\n        captureSession = AVCaptureSession()\n\n        // Get the default audio device (microphone)\n        guard let audioDevice = SCContext.getCurrentMic() else {\n            print(\"Unable to access microphone\")\n            return\n        }\n        \n        // Create audio input\n        do {\n            audioInput = try AVCaptureDeviceInput(device: audioDevice)\n        } catch {\n            print(\"Unable to create audio input: \\(error)\")\n            return\n        }\n        \n        // Add audio input to capture session\n        if captureSession.canAddInput(audioInput) {\n            captureSession.addInput(audioInput)\n        } else {\n            print(\"Unable to add audio input to capture session\")\n            return\n        }\n\n        // Create audio data output\n        audioDataOutput = AVCaptureAudioDataOutput()\n        let audioQueue = DispatchQueue(label: \"audioQueue\")\n        audioDataOutput.setSampleBufferDelegate(self, queue: audioQueue)\n        \n        // Add audio data output to capture session\n        if captureSession.canAddOutput(audioDataOutput) {\n            captureSession.addOutput(audioDataOutput)\n        } else {\n            print(\"Unable to add audio data output to capture session\")\n            return\n        }\n    }\n    \n    func start() {\n        if let session = captureSession {\n            session.startRunning()\n        }\n    }\n    \n    func stop() {\n        if let session = captureSession {\n            if session.isRunning { session.stopRunning() }\n        }\n    }\n\n    func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) {\n        if SCContext.isPaused || SCContext.startTime == nil { return }\n        if SCContext.micInput.isReadyForMoreMediaData {\n            SCContext.micInput.append(sampleBuffer)\n        }\n    }\n}\n\n// https://developer.apple.com/documentation/screencapturekit/capturing_screen_content_in_macos\n// For Sonoma updated to https://developer.apple.com/forums/thread/727709\nextension CMSampleBuffer {\n    var asPCMBuffer: AVAudioPCMBuffer? {\n        try? self.withAudioBufferList { audioBufferList, _ -> AVAudioPCMBuffer? in\n            guard let absd = self.formatDescription?.audioStreamBasicDescription else { return nil }\n            guard let format = AVAudioFormat(standardFormatWithSampleRate: absd.mSampleRate, channels: absd.mChannelsPerFrame) else { return nil }\n            return AVAudioPCMBuffer(pcmFormat: format, bufferListNoCopy: audioBufferList.unsafePointer)\n        }\n    }\n    \n    var nsImage: NSImage? {\n        return autoreleasepool {\n            guard let pixelBuffer = CMSampleBufferGetImageBuffer(self) else { return nil }\n            CVPixelBufferLockBaseAddress(pixelBuffer, .readOnly)\n            defer { CVPixelBufferUnlockBaseAddress(pixelBuffer, .readOnly) }\n            let ciImage = CIImage(cvPixelBuffer: pixelBuffer)\n            let ciContext = CIContext()\n            if let cgImage = ciContext.createCGImage(ciImage, from: ciImage.extent) {\n                return NSImage(cgImage: cgImage, size: .zero)\n            }\n            return nil\n        }\n    }\n}\n\n// Based on https://gist.github.com/aibo-cora/c57d1a4125e145e586ecb61ebecff47c\nextension AVAudioPCMBuffer {\n    var asSampleBuffer: CMSampleBuffer? {\n        let asbd = self.format.streamDescription\n        var sampleBuffer: CMSampleBuffer? = nil\n        var format: CMFormatDescription? = nil\n\n        guard CMAudioFormatDescriptionCreate(\n            allocator: kCFAllocatorDefault,\n            asbd: asbd,\n            layoutSize: 0,\n            layout: nil,\n            magicCookieSize: 0,\n            magicCookie: nil,\n            extensions: nil,\n            formatDescriptionOut: &format\n        ) == noErr else { return nil }\n\n        var timing = CMSampleTimingInfo(\n            duration: CMTime(value: 1, timescale: Int32(asbd.pointee.mSampleRate)),\n            presentationTimeStamp: CMClockGetTime(CMClockGetHostTimeClock()),\n            decodeTimeStamp: .invalid\n        )\n\n        guard CMSampleBufferCreate(\n            allocator: kCFAllocatorDefault,\n            dataBuffer: nil,\n            dataReady: false,\n            makeDataReadyCallback: nil,\n            refcon: nil,\n            formatDescription: format,\n            sampleCount: CMItemCount(self.frameLength),\n            sampleTimingEntryCount: 1,\n            sampleTimingArray: &timing,\n            sampleSizeEntryCount: 0,\n            sampleSizeArray: nil,\n            sampleBufferOut: &sampleBuffer\n        ) == noErr else { return nil }\n\n        guard CMSampleBufferSetDataBufferFromAudioBufferList(\n            sampleBuffer!,\n            blockBufferAllocator: kCFAllocatorDefault,\n            blockBufferMemoryAllocator: kCFAllocatorDefault,\n            flags: 0,\n            bufferList: self.mutableAudioBufferList\n        ) == noErr else { return nil }\n\n        return sampleBuffer\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/SCContext.swift",
    "content": "//\n//  SCContext.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/16.\n//\n\nimport AVFAudio\nimport AVFoundation\nimport Foundation\nimport ScreenCaptureKit\nimport UserNotifications\nimport SwiftLAME\nimport SwiftUI\nimport AECAudioStream\n\nclass SCContext {\n    static var trimingList = [URL]()\n    static var firstFrame: CMSampleBuffer?\n    static var autoStop = 0\n    static var recordCam = \"\"\n    static var recordDevice = \"\"\n    static var captureSession: AVCaptureSession!\n    static var previewSession: AVCaptureSession!\n    static var frameCache: CMSampleBuffer?\n    static var filter: SCContentFilter?\n    static var isMagnifierEnabled = false\n    static var saveFrame = false\n    static var isPaused = false\n    static var isResume = false\n    static var isSkipFrame = false\n    static var lastPTS: CMTime?\n    static var timeOffset = CMTimeMake(value: 0, timescale: 0)\n    static var screenArea: NSRect?\n    static let audioEngine = AVAudioEngine()\n    static let AECEngine = AECAudioStream(sampleRate: 48000)\n    static var backgroundColor: CGColor = CGColor.black\n    static var filePath: String!\n    static var filePath1: String!\n    static var filePath2: String!\n    static var audioFile: AVAudioFile?\n    static var audioFile2: AVAudioFile?\n    static var vW: AVAssetWriter!\n    static var vwInput, awInput, micInput: AVAssetWriterInput!\n    static var startTime: Date?\n    static var timePassed: TimeInterval = 0\n    static var stream: SCStream!\n    static var screen: SCDisplay?\n    static var window: [SCWindow]?\n    static var application: [SCRunningApplication]?\n    static var streamType: StreamType?\n    static var availableContent: SCShareableContent?\n    static let excludedApps = [\"\", \"com.apple.dock\", \"com.apple.screencaptureui\", \"com.apple.controlcenter\", \"com.apple.notificationcenterui\", \"com.apple.systemuiserver\", \"com.apple.WindowManager\", \"dev.mnpn.Azayaka\", \"com.gaosun.eul\", \"com.pointum.hazeover\", \"net.matthewpalmer.Vanilla\", \"com.dwarvesv.minimalbar\", \"com.bjango.istatmenus.status\"]\n    \n    static func updateAvailableContentSync() -> SCShareableContent? {\n        let semaphore = DispatchSemaphore(value: 0)\n        var result: SCShareableContent? = nil\n\n        updateAvailableContent { content in\n            result = content\n            semaphore.signal()\n        }\n\n        semaphore.wait()\n        return result\n    }\n    \n    private static func updateAvailableContent(completion: @escaping (SCShareableContent?) -> Void) {\n        SCShareableContent.getExcludingDesktopWindows(false, onScreenWindowsOnly: true) { [self] content, error in\n            if let error = error {\n                switch error {\n                case SCStreamError.userDeclined:\n                    DispatchQueue.global().asyncAfter(deadline: .now() + 1) {\n                        self.updateAvailableContent() {_ in}\n                    }\n                default:\n                    print(\"Error: failed to fetch available content: \".local, error.localizedDescription)\n                }\n                completion(nil) // 在错误情况下返回 nil\n                return\n            }\n\n            availableContent = content\n            if let displays = content?.displays, !displays.isEmpty {\n                completion(content) // 返回成功获取的 content\n            } else {\n                print(\"There needs to be at least one display connected!\".local)\n                completion(nil) // 如果没有显示器连接，则返回 nil\n            }\n        }\n    }\n    \n    static func updateAvailableContent(completion: @escaping () -> Void) {\n        SCShareableContent.getExcludingDesktopWindows(false, onScreenWindowsOnly: false) { content, error in\n            if let error = error {\n                switch error {\n                case SCStreamError.userDeclined: requestPermissions()\n                default: print(\"Error: failed to fetch available content: \".local, error.localizedDescription)\n                }\n                return\n            }\n            availableContent = content\n            assert(availableContent?.displays.isEmpty != nil, \"There needs to be at least one display connected!\".local)\n            completion()\n        }\n    }\n    \n    static func getSelf() -> SCRunningApplication? {\n        return SCContext.availableContent!.applications.first(where: { Bundle.main.bundleIdentifier == $0.bundleIdentifier })\n    }\n    \n    static func getSelfWindows() -> [SCWindow]? {\n        return SCContext.availableContent!.windows.filter( {\n            guard let title = $0.title else { return false }\n            return $0.owningApplication?.bundleIdentifier == Bundle.main.bundleIdentifier\n            && title != \"Mouse Pointer\".local\n            && title != \"Screen Magnifier\".local\n            && title != \"Camera Overlayer\".local\n            && title != \"iDevice Overlayer\".local\n        })\n    }\n    \n    static func getApps(isOnScreen: Bool = true, hideSelf: Bool = true) -> [SCRunningApplication] {\n        var apps = [SCRunningApplication]()\n        for app in getWindows(isOnScreen: isOnScreen, hideSelf: hideSelf).map({ $0.owningApplication }) {\n            if !apps.contains(app!) { apps.append(app!) }\n        }\n        if hideSelf && ud.bool(forKey: \"hideSelf\") { apps = apps.filter({$0.bundleIdentifier != Bundle.main.bundleIdentifier}) }\n        return apps\n    }\n    \n    static func getWindows(isOnScreen: Bool = true, hideSelf: Bool = true) -> [SCWindow] {\n        var windows = [SCWindow]()\n        windows = availableContent!.windows.filter {\n            guard let app =  $0.owningApplication,\n                  let title = $0.title else {//, !title.isEmpty else {\n                return false\n            }\n            return !excludedApps.contains(app.bundleIdentifier)\n            && !title.contains(\"Item-0\")\n            && title != \"Window\"\n            && $0.frame.width > 40\n            && $0.frame.height > 40\n        }\n        if isOnScreen { windows = windows.filter({$0.isOnScreen == true}) }\n        if hideSelf && ud.bool(forKey: \"hideSelf\") { windows = windows.filter({$0.owningApplication?.bundleIdentifier != Bundle.main.bundleIdentifier}) }\n        return windows\n    }\n    \n    static func getAppIcon(_ app: SCRunningApplication) -> NSImage? {\n        if let appURL = NSWorkspace.shared.urlForApplication(withBundleIdentifier: app.bundleIdentifier) {\n            let icon = NSWorkspace.shared.icon(forFile: appURL.path)\n            icon.size = NSSize(width: 69, height: 69)\n            return icon\n        }\n        let icon = NSImage(systemSymbolName: \"questionmark.app.dashed\", accessibilityDescription: \"blank icon\")\n        icon!.size = NSSize(width: 69, height: 69)\n        return icon\n    }\n    \n    static func getScreenWithMouse() -> NSScreen? {\n        let mouseLocation = NSEvent.mouseLocation\n        let screenWithMouse = NSScreen.screens.first(where: { NSMouseInRect(mouseLocation, $0.frame, false) })\n        return screenWithMouse\n    }\n    \n    static func getSCDisplayWithMouse() -> SCDisplay? {\n        if let displays = availableContent?.displays {\n            for display in displays {\n                if let currentDisplayID = getScreenWithMouse()?.displayID {\n                    if display.displayID == currentDisplayID {\n                        return display\n                    }\n                }\n            }\n        }\n        return nil\n    }\n    \n    static func getFilePath(capture: Bool = false) -> String {\n        let dateFormatter = DateFormatter()\n        dateFormatter.dateFormat = \"y-MM-dd HH.mm.ss\"\n        return ud.string(forKey: \"saveDirectory\")! + (capture ? \"/Capturing at \".local : \"/Recording at \".local) + dateFormatter.string(from: Date())\n    }\n    \n    static func updateAudioSettings(format: String = ud.string(forKey: \"audioFormat\") ?? \"\", rate: Int = 48000) -> [String : Any] {\n        var audioSettings: [String : Any] = [AVSampleRateKey : rate, AVNumberOfChannelsKey : 2] // reset audioSettings\n        var bitRate = ud.integer(forKey: \"audioQuality\") * 1000\n        if rate < 44100 { bitRate = min(64000, bitRate / 2) }\n        switch format {\n        case AudioFormat.mp3.rawValue: fallthrough\n        case AudioFormat.aac.rawValue:\n            audioSettings[AVFormatIDKey] = kAudioFormatMPEG4AAC\n            audioSettings[AVEncoderBitRateKey] = bitRate\n        case AudioFormat.alac.rawValue:\n            audioSettings[AVFormatIDKey] = kAudioFormatAppleLossless\n            audioSettings[AVEncoderBitDepthHintKey] = 16\n        case AudioFormat.flac.rawValue:\n            audioSettings[AVFormatIDKey] = kAudioFormatFLAC\n        case AudioFormat.opus.rawValue:\n            audioSettings[AVFormatIDKey] = ud.string(forKey: \"videoFormat\") != VideoFormat.mp4.rawValue ? kAudioFormatOpus : kAudioFormatMPEG4AAC\n            audioSettings[AVEncoderBitRateKey] =  bitRate\n        default:\n            assertionFailure(\"unknown audio format while setting audio settings: \".local + (ud.string(forKey: \"audioFormat\") ?? \"[no defaults]\".local))\n        }\n        return audioSettings\n    }\n    \n    static func getBackgroundColor() -> CGColor {\n        guard let color = ud.string(forKey: \"background\") else { return CGColor.black  }\n        if color == BackgroundType.wallpaper.rawValue { return CGColor.black }\n        switch color {\n            case \"clear\": backgroundColor = CGColor.clear\n            case \"black\": backgroundColor = CGColor.black\n            case \"white\": backgroundColor = CGColor.white\n            case \"gray\": backgroundColor = NSColor.systemGray.cgColor\n            case \"yellow\": backgroundColor = NSColor.systemYellow.cgColor\n            case \"orange\": backgroundColor = NSColor.systemOrange.cgColor\n            case \"green\": backgroundColor = NSColor.systemGreen.cgColor\n            case \"blue\": backgroundColor = NSColor.systemBlue.cgColor\n            case \"red\": backgroundColor = NSColor.systemRed.cgColor\n            default: backgroundColor = ud.cgColor(forKey: \"userColor\") ?? CGColor.black\n        }\n        return backgroundColor\n    }\n    \n    static func performMicCheck() async {\n        guard ud.bool(forKey: \"recordMic\") == true else { return }\n        if await AVCaptureDevice.requestAccess(for: .audio) { return }\n\n        ud.setValue(false, forKey: \"recordMic\")\n        DispatchQueue.main.async {\n            let alert = createAlert(title: \"Permission Required\",\n                                                       message: \"QuickRecorder needs permission to record your microphone.\",\n                                                       button1: \"Open Settings\",\n                                                       button2: \"Cancel\")\n            if alert.runModal() == .alertFirstButtonReturn {\n                NSWorkspace.shared.open(URL(string: \"x-apple.systempreferences:com.apple.preference.security?Privacy_Microphone\")!)\n            }\n        }\n    }\n    \n    private static func requestPermissions() {\n        DispatchQueue.main.async {\n            let alert = createAlert(title: \"Permission Required\",\n                                                       message: \"QuickRecorder needs screen recording permissions, even if you only intend on recording audio.\",\n                                                       button1: \"Open Settings\",\n                                                       button2: \"Cancel\")\n            if alert.runModal() == .alertFirstButtonReturn {\n                NSWorkspace.shared.open(URL(string: \"x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture\")!)\n            }\n            NSApp.terminate(self)\n        }\n    }\n    \n    static func requestCameraPermission() {\n        let status = AVCaptureDevice.authorizationStatus(for: .video)\n        switch status {\n        case .authorized, .restricted, .notDetermined:\n            break\n        case .denied:\n            DispatchQueue.main.async {\n                let alert = createAlert(title: \"Permission Required\",\n                                                           message: \"QuickRecorder needs this permission to record your camera or mobile device.\",\n                                                           button1: \"Open Settings\",\n                                                           button2: \"Cancel\")\n                if alert.runModal() == .alertFirstButtonReturn {\n                    NSWorkspace.shared.open(URL(string: \"x-apple.systempreferences:com.apple.preference.security?Privacy_Camera\")!)\n                }\n            }\n        @unknown default:\n            break\n        }\n    }\n    \n    static func getWallpaper(_ display: SCDisplay) -> NSImage? {\n        guard let screen = display.nsScreen else { return nil }\n        guard let url = NSWorkspace.shared.desktopImageURL(for: screen) else { return nil }\n        do {\n            var wallpaper: NSImage?\n            try wallpaper = NSImage(data: Data(contentsOf: url))\n            if let w = wallpaper { return w }\n        } catch {\n            print(\"load wallpaper error: \\(error)\")\n        }\n        return nil\n    }\n    \n    static func getRecordingSize() -> String {\n        do {\n            let fileAttr = try fd.attributesOfItem(atPath: filePath)\n            let byteFormat = ByteCountFormatter()\n            byteFormat.allowedUnits = [.useMB]\n            byteFormat.countStyle = .file\n            return byteFormat.string(fromByteCount: fileAttr[FileAttributeKey.size] as! Int64)\n        } catch {\n            print(String(format: \"failed to fetch file for size indicator: %@\".local, error.localizedDescription))\n        }\n        return \"Unknown\".local\n    }\n    \n    static func getRecordingLength() -> String {\n        let formatter = DateComponentsFormatter()\n        formatter.allowedUnits = [.minute, .second]\n        formatter.zeroFormattingBehavior = .pad\n        formatter.unitsStyle = .positional\n        if isPaused { return formatter.string(from: timePassed) ?? \"Unknown\".local }\n        timePassed = Date.now.timeIntervalSince(startTime ?? Date.now)\n        return formatter.string(from: timePassed) ?? \"Unknown\".local\n    }\n    \n    static func isCameraRunning() -> Bool {\n        var preview = false\n        var capture = false\n        if let session = previewSession { preview = session.isRunning }\n        if let session = captureSession { capture = session.isRunning }\n        return (preview || capture)\n    }\n    \n    static func pauseRecording() {\n        isPaused.toggle()\n        PopoverState.shared.isPaused = isPaused\n        if !isPaused {\n            isResume = true\n            startTime = Date.now.addingTimeInterval(-1) - SCContext.timePassed\n        }\n    }\n    \n    static func stopRecording() {\n        if ud.bool(forKey: \"preventSleep\") { SleepPreventer.shared.allowSleep() }\n        autoStop = 0\n        lastPTS = nil\n        recordCam = \"\"\n        recordDevice = \"\"\n        isMagnifierEnabled = false\n        mousePointer.orderOut(nil)\n        screenMagnifier.orderOut(nil)\n        AppDelegate.shared.stopGlobalMouseMonitor()\n\n        if let w = NSApp.windows.first(where:  { $0.title == \"Area Overlayer\".local }) { w.close() }\n        \n        if stream != nil { stream.stopCapture() }\n        stream = nil\n        if ud.bool(forKey: \"recordMic\") {\n            micInput.markAsFinished()\n            AudioRecorder.shared.stop()\n            audioEngine.inputNode.removeTap(onBus: 0)\n            audioEngine.stop()\n            //DispatchQueue.global().async { try? audioEngine.inputNode.setVoiceProcessingEnabled(false) }\n            if ud.bool(forKey: \"enableAEC\") { try? AECEngine.stopAudioUnit() }\n        }\n        if streamType != .systemaudio {\n            let dispatchGroup = DispatchGroup()\n            dispatchGroup.enter()\n            vwInput.markAsFinished()\n            if #available(macOS 13, *) { awInput.markAsFinished() }\n            vW.finishWriting {\n                if vW.status != .completed {\n                    print(\"Video writing failed with status: \\(vW.status), error: \\(String(describing: vW.error))\")\n                    let err = vW.error?.localizedDescription ?? \"Unknow Error\"\n                    showNotification(title: \"Failed to save file\".local, body: \"\\(err)\", id: \"quickrecorder.error.\\(UUID().uuidString)\")\n                } else {\n                    if ud.bool(forKey: \"recordMic\") && ud.bool(forKey: \"recordWinSound\") && ud.bool(forKey: \"remuxAudio\") {\n                        mixAudioTracks(videoURL: filePath.url) { result in\n                            switch result {\n                            case .success(let url):\n                                print(\"Exported video to \\(String(describing: url.path))\")\n                                if !ud.bool(forKey: \"showPreview\") {\n                                    showNotification(title: \"Recording Completed\".local, body: String(format: \"File saved to: %@\".local, url.path), id: \"quickrecorder.completed.\\(UUID().uuidString)\")\n                                }\n                                DispatchQueue.main.async {\n                                    if ud.bool(forKey: \"trimAfterRecord\") {\n                                        AppDelegate.shared.createNewWindow(view: VideoTrimmerView(videoURL: url), title: url.lastPathComponent, only: false)\n                                    } else {\n                                        showPreview(path: url.path)\n                                    }\n                                }\n                            case .failure(let error):\n                                print(\"Failed to export video: \\(error.localizedDescription)\")\n                            }\n                        }\n                    }\n                }\n                dispatchGroup.leave()\n            }\n            dispatchGroup.wait()\n        } else {\n            if ud.bool(forKey: \"recordMic\") { vW.finishWriting {} }\n        }\n        \n        DispatchQueue.main.async {\n            controlPanel.close()\n            if isCameraRunning() {\n                if camWindow.isVisible { camWindow.close() }\n                if deviceWindow.isVisible { deviceWindow.close() }\n                if let preview = previewSession { preview.stopRunning() }\n                if let capture = captureSession { capture.stopRunning() }\n            }\n        }\n        \n        audioFile = nil // close audio file\n        audioFile2 = nil // close audio file2\n        if streamType == .systemaudio {\n            if ud.string(forKey: \"audioFormat\") == AudioFormat.mp3.rawValue && !ud.bool(forKey: \"recordMic\") {\n                Task {\n                    let outPutUrl = (String(filePath.dropLast(4)) + \".mp3\").url\n                    do {\n                        try await m4a2mp3(inputUrl: filePath1.url, outputUrl: outPutUrl)\n                        try? fd.removeItem(atPath: filePath1)\n                        if !ud.bool(forKey: \"showPreview\") {\n                            let title = \"Recording Completed\".local\n                            let body = String(format: \"File saved to: %@\".local, outPutUrl.path.removingPercentEncoding!)\n                            let id = \"quickrecorder.completed.\\(UUID().uuidString)\"\n                            showNotification(title: title, body: body, id: id)\n                        } else {\n                            DispatchQueue.main.async { showPreview(path: outPutUrl.path, image: NSImage(named: \"audioIcon\")) }\n                        }\n                    } catch {\n                        showNotification(title: \"Failed to save file\".local, body: \"\\(error.localizedDescription)\", id: \"quickrecorder.error.\\(UUID().uuidString)\")\n                    }\n                }\n            } else {\n                if ud.bool(forKey: \"remuxAudio\") && ud.bool(forKey: \"recordMic\") {\n                    let fileURL = filePath.url\n                    let document = try? qmaPackageHandle.load(from: fileURL)\n                    if let document = document {\n                        let audioPlayerManager = AudioPlayerManager()\n                        audioPlayerManager.loadAudioFiles(format: document.info.format, package: fileURL, encoder: document.info.encoder, saveMP3: document.info.exportMP3)\n                        audioPlayerManager.sysVol = document.info.sysVol\n                        audioPlayerManager.micVol = document.info.micVol\n                        let exportMP3 = document.info.exportMP3\n                        let format = exportMP3 ? \"mp3\" : document.info.format\n                        let saveURL = fileURL.deletingPathExtension().appendingPathExtension(format)\n                        audioPlayerManager.saveFile(saveURL, saveAsMP3: exportMP3)\n                    }\n                } else {\n                    if !ud.bool(forKey: \"showPreview\") {\n                        let title = \"Recording Completed\".local\n                        let body = String(format: \"File saved to: %@\".local, filePath)\n                        let id = \"quickrecorder.completed.\\(UUID().uuidString)\"\n                        showNotification(title: title, body: body, id: id)\n                    } else {\n                        showPreview(path: filePath, image: NSImage(named: \"qmaIcon\"))\n                    }\n                }\n            }\n        }\n        \n        isPaused = false\n        hideMousePointer = false\n        window = nil\n        screen = nil\n        startTime = nil\n        AppDelegate.shared.presenterType = \"OFF\"\n        updateStatusBar()\n        \n        if !(ud.bool(forKey: \"recordMic\") && ud.bool(forKey: \"recordWinSound\") && ud.bool(forKey: \"remuxAudio\")) && streamType != .systemaudio {\n            if let vW = vW {\n                if vW.status != .completed {\n                    streamType = nil\n                    return\n                }\n            }\n            if !ud.bool(forKey: \"showPreview\") {\n                let title = \"Recording Completed\".local\n                let body = String(format: \"File saved to: %@\".local, filePath)\n                let id = \"quickrecorder.completed.\\(UUID().uuidString)\"\n                showNotification(title: title, body: body, id: id)\n            } else {\n                showPreview(path: filePath)\n            }\n            trimVideo()\n        }\n        \n        streamType = nil\n        firstFrame = nil\n    }\n    \n    static func showPreview(path: String, image: NSImage? = nil) {\n        if !ud.bool(forKey: \"showPreview\") { return }\n        var previewImage: NSImage?\n        let previewURL = fd.temporaryDirectory.appendingPathComponent(\"qr-preview.jpg\")\n        if image == nil { firstFrame?.nsImage?.saveToFile(previewURL, type: .jpeg) }\n        \n        if let i = image { previewImage = i } else { previewImage = NSImage(contentsOf: previewURL) }\n        if let previewImage = previewImage, let screen = getScreenWithMouse() {\n            let contentView = NSHostingView(rootView: PreviewView(frame: previewImage, filePath: path))\n            previewWindow.contentView = contentView\n            previewWindow.setFrameOrigin(NSPoint(x: screen.frame.maxX - 280, y: screen.frame.minY + 20))\n            previewWindow.orderFront(self)\n        }\n    }\n    \n    static func m4a2mp3(inputUrl: URL, outputUrl: URL) async throws {\n        let progress = Progress()\n        let lameEncoder = try SwiftLameEncoder(\n            sourceUrl: inputUrl,\n            configuration: .init(\n                sampleRate: .custom(48000),\n                bitrateMode: .constant(Int32(ud.integer(forKey: \"audioQuality\"))),\n                quality: .nearBest\n            ),\n            destinationUrl: outputUrl,\n            progress: progress // optional\n        )\n        try await lameEncoder.encode(priority: .userInitiated)\n    }\n    \n    static func trimVideo() {\n        if ud.bool(forKey: \"trimAfterRecord\") {\n            let fileURL = filePath.url\n            AppDelegate.shared.createNewWindow(view: VideoTrimmerView(videoURL: fileURL), title: fileURL.lastPathComponent, only: false)\n        }\n    }\n    \n    static func getCameras() -> [AVCaptureDevice] {\n        let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInWideAngleCamera, .externalUnknown], mediaType: .video, position: .unspecified)\n        return discoverySession.devices\n    }\n    \n    static func getMicrophone() -> [AVCaptureDevice] {\n        var discoverySession: AVCaptureDevice.DiscoverySession\n        if #available(macOS 15.0, *) {\n            discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInMicrophone, .microphone], mediaType: .audio, position: .unspecified)\n        } else {\n            discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.builtInMicrophone, .externalUnknown], mediaType: .audio, position: .unspecified)\n        }\n        return discoverySession.devices.filter({ !$0.localizedName.contains(\"CADefaultDeviceAggregate\") })\n    }\n    \n    static func getiDevice() -> [AVCaptureDevice] {\n        let discoverySession = AVCaptureDevice.DiscoverySession(deviceTypes: [.externalUnknown], mediaType: .muxed, position: .unspecified)\n        return discoverySession.devices\n    }\n    \n    static func getCurrentMic() -> AVCaptureDevice? {\n        let deviceName = ud.string(forKey: \"micDevice\")\n        return getMicrophone().first(where: { $0.localizedName == deviceName })\n    }\n    \n    /*static func getChannelCount() -> Int? {\n        if let device = getCurrentMic() {\n            if let channels = device.formats.first?.formatDescription.audioChannelLayout?.numberOfChannels {\n                return channels\n            }\n            \n            let activeFormat = device.activeFormat\n            let description = activeFormat.formatDescription\n            if let audioStreamBasicDescription = CMAudioFormatDescriptionGetStreamBasicDescription(description)?.pointee {\n                let channelCount = audioStreamBasicDescription.mChannelsPerFrame\n                return max(2, Int(channelCount))\n            }\n        }\n        return getDefaultChannelCount()\n    }\n    \n    static func getDefaultChannelCount() -> Int? {\n        var deviceID = AudioObjectID(0)\n        var propertySize = UInt32(MemoryLayout.size(ofValue: deviceID))\n        \n        // 获取默认音频输入设备\n        var address = AudioObjectPropertyAddress(\n            mSelector: kAudioHardwarePropertyDefaultInputDevice,\n            mScope: kAudioObjectPropertyScopeGlobal,\n            mElement: kAudioObjectPropertyElementMain\n        )\n        \n        let status = AudioObjectGetPropertyData(\n            AudioObjectID(kAudioObjectSystemObject),\n            &address,\n            0,\n            nil,\n            &propertySize,\n            &deviceID\n        )\n        \n        guard status == noErr else {\n            print(\"Failed to get default audio input device\")\n            return nil\n        }\n        \n        // 获取通道数\n        address = AudioObjectPropertyAddress(\n            mSelector: kAudioDevicePropertyStreamConfiguration,\n            mScope: kAudioDevicePropertyScopeInput,\n            mElement: kAudioObjectPropertyElementMain\n        )\n        \n        // 查询流配置信息\n        var streamConfig: UnsafeMutableAudioBufferListPointer?\n        propertySize = 0\n        \n        // 先获取属性大小\n        let sizeStatus = AudioObjectGetPropertyDataSize(deviceID, &address, 0, nil, &propertySize)\n        guard sizeStatus == noErr else {\n            print(\"Failed to get size for stream configuration\")\n            return nil\n        }\n        \n        // 分配内存以存储音频流配置\n        let bufferList = UnsafeMutablePointer<AudioBufferList>.allocate(capacity: Int(propertySize))\n        defer { bufferList.deallocate() }\n        \n        let configStatus = AudioObjectGetPropertyData(deviceID, &address, 0, nil, &propertySize, bufferList)\n        guard configStatus == noErr else {\n            print(\"Failed to get stream configuration\")\n            return nil\n        }\n        \n        streamConfig = UnsafeMutableAudioBufferListPointer(bufferList)\n        \n        // 计算通道总数\n        var totalChannels = 0\n        for buffer in streamConfig! {\n            totalChannels += Int(buffer.mNumberChannels)\n        }\n        return max(2, totalChannels)\n    }*/\n    \n    static func getSampleRate() -> Int? {\n        if let device = getCurrentMic() {\n            let activeFormat = device.activeFormat\n            let description = activeFormat.formatDescription\n            \n            if let audioStreamBasicDescription = CMAudioFormatDescriptionGetStreamBasicDescription(description)?.pointee {\n                let sampleRate = audioStreamBasicDescription.mSampleRate\n                return Int(sampleRate)\n            }\n        }\n        return getDefaultSampleRate()\n    }\n    \n    static func getDefaultSampleRate() -> Int? {\n        var deviceID = AudioObjectID(0)\n        var propertySize = UInt32(MemoryLayout.size(ofValue: deviceID))\n        \n        // 获取默认音频输入设备\n        var address = AudioObjectPropertyAddress(\n            mSelector: kAudioHardwarePropertyDefaultInputDevice,\n            mScope: kAudioObjectPropertyScopeGlobal,\n            mElement: kAudioObjectPropertyElementMain\n        )\n        \n        let status = AudioObjectGetPropertyData(\n            AudioObjectID(kAudioObjectSystemObject),\n            &address,\n            0,\n            nil,\n            &propertySize,\n            &deviceID\n        )\n        \n        guard status == noErr else {\n            print(\"Failed to get default audio input device\")\n            return nil\n        }\n        \n        // 获取采样率\n        var sampleRate: Double = 0\n        propertySize = UInt32(MemoryLayout.size(ofValue: sampleRate))\n        \n        address = AudioObjectPropertyAddress(\n            mSelector: kAudioDevicePropertyNominalSampleRate,\n            mScope: kAudioObjectPropertyScopeGlobal,\n            mElement: kAudioObjectPropertyElementMain\n        )\n        \n        let sampleRateStatus = AudioObjectGetPropertyData(\n            deviceID,\n            &address,\n            0,\n            nil,\n            &propertySize,\n            &sampleRate\n        )\n        \n        guard sampleRateStatus == noErr else {\n            print(\"Failed to get sample rate for the default input device\")\n            return nil\n        }\n        \n        return Int(sampleRate)\n    }\n    \n    static func adjustTime(sample: CMSampleBuffer, by offset: CMTime) -> CMSampleBuffer? {\n        guard CMSampleBufferGetFormatDescription(sample) != nil else { return nil }\n        \n        var timingInfo = [CMSampleTimingInfo](repeating: CMSampleTimingInfo(), count: Int(CMSampleBufferGetNumSamples(sample)))\n        CMSampleBufferGetSampleTimingInfoArray(sample, entryCount: timingInfo.count, arrayToFill: &timingInfo, entriesNeededOut: nil)\n        \n        for i in 0..<timingInfo.count {\n            timingInfo[i].decodeTimeStamp = CMTimeSubtract(timingInfo[i].decodeTimeStamp, offset)\n            timingInfo[i].presentationTimeStamp = CMTimeSubtract(timingInfo[i].presentationTimeStamp, offset)\n        }\n        \n        var outSampleBuffer: CMSampleBuffer?\n        CMSampleBufferCreateCopyWithNewTiming(allocator: nil, sampleBuffer: sample, sampleTimingEntryCount: timingInfo.count, sampleTimingArray: &timingInfo, sampleBufferOut: &outSampleBuffer)\n        \n        return outSampleBuffer\n    }\n    \n    static func showNotification(title: String, body: String, id: String) {\n        let content = UNMutableNotificationContent()\n        content.title = title\n        content.body = body\n        content.sound = UNNotificationSound.default\n        let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)\n        let request = UNNotificationRequest(identifier: id, content: content, trigger: trigger)\n        UNUserNotificationCenter.current().add(request) { error in\n            if let error = error { print(\"Notification failed to send：\\(error.localizedDescription)\") }\n        }\n    }\n    \n    static func mixAudioTracks(videoURL: URL, completion: @escaping (Result<URL, Error>) -> Void) {\n        showNotification(title: \"Still Processing\".local, body: \"Mixing audio track...\".local, id: \"quickrecorder.processing.\\(UUID().uuidString)\")\n        \n        let asset = AVAsset(url: videoURL)\n        let audioOutputURL = videoURL.deletingPathExtension()\n        let outputURL = audioOutputURL.deletingPathExtension()\n        let audioOnlyComposition = AVMutableComposition()\n        \n        let fileEnding = ud.string(forKey: \"videoFormat\") ?? \"\"\n        var fileType: AVFileType?\n        switch fileEnding {\n        case VideoFormat.mov.rawValue: fileType = AVFileType.mov\n        case VideoFormat.mp4.rawValue: fileType = AVFileType.mp4\n        default: assertionFailure(\"loaded unknown video format\".local)\n        }\n        \n        let audioTracks = asset.tracks(withMediaType: .audio)\n        guard audioTracks.count > 1 else {\n            completion(.failure(NSError(domain: \"AudioTrackError\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Not enough audio tracks found.\"])))\n            return\n        }\n        \n        for audioTrack in audioTracks {\n            if let compositionAudioTrack = audioOnlyComposition.addMutableTrack(withMediaType: .audio, preferredTrackID: kCMPersistentTrackID_Invalid) {\n                do {\n                    try compositionAudioTrack.insertTimeRange(CMTimeRange(start: .zero, duration: asset.duration), of: audioTrack, at: .zero)\n                } catch {\n                    completion(.failure(NSError(domain: \"AudioTrackInsertionError\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Failed to insert audio track: \\(error.localizedDescription)\"])))\n                    return\n                }\n            }\n        }\n        \n        let audioMix = AVMutableAudioMix()\n        audioMix.inputParameters = audioTracks.map {\n            let parameters = AVMutableAudioMixInputParameters(track: $0)\n            parameters.trackID = $0.trackID\n            return parameters\n        }\n        \n        guard let audioExportSession = AVAssetExportSession(asset: audioOnlyComposition, presetName: AVAssetExportPresetHighestQuality) else {\n            completion(.failure(NSError(domain: \"AudioExportSessionError\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Failed to create audio export session.\"])))\n            return\n        }\n        audioExportSession.outputURL = audioOutputURL\n        audioExportSession.outputFileType = fileType ?? .mp4\n        audioExportSession.audioMix = audioMix\n        \n        audioExportSession.exportAsynchronously {\n            /*var exportStatus: AVAssetExportSession.Status = .unknown\n            \n            // Loop until export session is completed, failed, or cancelled\n            while exportStatus != .completed && exportStatus != .failed && exportStatus != .cancelled {\n                exportStatus = audioExportSession.status\n                Thread.sleep(forTimeInterval: 0.1)\n            }*/\n            \n            switch audioExportSession.status {\n            case .completed:\n                let audioAsset = AVAsset(url: audioOutputURL)\n                let composition = AVMutableComposition()\n                \n                guard let videoTrack = asset.tracks(withMediaType: .video).first,\n                      let compositionVideoTrack = composition.addMutableTrack(withMediaType: .video, preferredTrackID: kCMPersistentTrackID_Invalid) else {\n                    completion(.failure(NSError(domain: \"VideoTrackError\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Failed to get video track.\"])))\n                    return\n                }\n                \n                do {\n                    try compositionVideoTrack.insertTimeRange(CMTimeRange(start: .zero, duration: asset.duration), of: videoTrack, at: .zero)\n                } catch {\n                    completion(.failure(NSError(domain: \"VideoTrackInsertionError\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Failed to insert video track: \\(error.localizedDescription)\"])))\n                    return\n                }\n                \n                let audioTracks = audioAsset.tracks(withMediaType: .audio)\n                guard audioTracks.count >= 1 else {\n                    completion(.failure(NSError(domain: \"AudioTrackError\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Not enough audio tracks found.\"])))\n                    return\n                }\n                \n                for audioTrack in audioTracks {\n                    if let compositionAudioTrack = composition.addMutableTrack(withMediaType: .audio, preferredTrackID: kCMPersistentTrackID_Invalid) {\n                        do {\n                            try compositionAudioTrack.insertTimeRange(CMTimeRange(start: .zero, duration: asset.duration), of: audioTrack, at: .zero)\n                        } catch {\n                            completion(.failure(NSError(domain: \"AudioTrackInsertionError\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Failed to insert audio track: \\(error.localizedDescription)\"])))\n                            return\n                        }\n                    }\n                }\n                \n                guard let exportSession = AVAssetExportSession(asset: composition, presetName: AVAssetExportPresetPassthrough) else {\n                    completion(.failure(NSError(domain: \"ExportSessionError\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Failed to create export session.\"])))\n                    return\n                }\n                \n                exportSession.outputURL = outputURL\n                exportSession.outputFileType = fileType ?? .mp4\n                exportSession.audioMix = audioMix\n                \n                exportSession.exportAsynchronously {\n                    switch exportSession.status {\n                    case .completed:\n                        let  fileManager = fd\n                        try? fileManager.removeItem(atPath: filePath)\n                        try? fileManager.removeItem(atPath: audioOutputURL.path)\n                        completion(.success(outputURL))\n                    case .failed:\n                        completion(.failure(exportSession.error ?? NSError(domain: \"ExportError\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Export failed for an unknown reason.\"])))\n                    case .cancelled:\n                        completion(.failure(NSError(domain: \"ExportCancelled\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Export was cancelled.\"])))\n                    default:\n                        break\n                    }\n                }\n            case .failed:\n                completion(.failure(audioExportSession.error ?? NSError(domain: \"ExportError\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Export failed for an unknown reason.\"])))\n            case .cancelled:\n                completion(.failure(NSError(domain: \"ExportCancelled\", code: -1, userInfo: [NSLocalizedDescriptionKey: \"Export was cancelled.\"])))\n            default:\n                break\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/Supports/AppleScript.swift",
    "content": "//\n//  AppleScript.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/9/23.\n//\n\nimport Foundation\nimport AppKit\nimport ScreenCaptureKit\n\nclass selectScreen: NSScriptCommand {\n    override func performDefaultImplementation() -> Any? {\n        if SCContext.stream != nil {\n            createAlert(title: \"Error\".local, message: \"Already recording!\".local, button1: \"OK\".local).runModal()\n            return nil\n        }\n        SCContext.updateAvailableContent {\n            DispatchQueue.main.async {\n                closeAllWindow()\n                if var index = self.evaluatedArguments![\"index\"] as? Int {\n                    guard let screens = SCContext.availableContent?.displays else { return }\n                    index -= 1\n                    closeAllWindow()\n                    if index >= screens.count || index < 0 {\n                        createAlert(title: \"Error\".local, message: \"Invalid screen number!\".local, button1: \"OK\".local).runModal()\n                        return\n                    } else {\n                        let screen = screens[index]\n                        AppDelegate.shared.createCountdownPanel(screen: screen) {\n                            AppDelegate.shared.prepRecord(type: \"display\", screens: screen, windows: nil, applications: nil)\n                        }\n                    }\n                } else {\n                    closeAllWindow()\n                    AppDelegate.shared.createNewWindow(view: ScreenSelector(), title: \"Screen Selector\".local)\n                }\n            }\n        }\n        return nil\n    }\n}\n\nclass selectArea: NSScriptCommand {\n    override func performDefaultImplementation() -> Any? {\n        if SCContext.stream != nil {\n            createAlert(title: \"Error\".local, message: \"Already recording!\".local, button1: \"OK\".local).runModal()\n            return nil\n        }\n        SCContext.updateAvailableContent {\n            DispatchQueue.main.async {\n                closeAllWindow()\n                DispatchQueue.main.async {\n                    AppDelegate.shared.showAreaSelector(size: NSSize(width: 600, height: 450))\n                    var currentDisplay = SCContext.getSCDisplayWithMouse()\n                    mouseMonitor = NSEvent.addGlobalMonitorForEvents(matching: [.mouseMoved, .rightMouseDown, .leftMouseDown, .otherMouseDown]) { event in\n                        let display = SCContext.getSCDisplayWithMouse()\n                        if display != currentDisplay {\n                            currentDisplay = display\n                            closeAllWindow()\n                            AppDelegate.shared.showAreaSelector(size: NSSize(width: 600, height: 450))\n                        }\n                    }\n                }\n            }\n        }\n        return nil\n    }\n}\n\nclass selectApps: NSScriptCommand {\n    override func performDefaultImplementation() -> Any? {\n        if SCContext.stream != nil {\n            createAlert(title: \"Error\".local, message: \"Already recording!\".local, button1: \"OK\".local).runModal()\n            return nil\n        }\n        SCContext.updateAvailableContent {\n            DispatchQueue.main.async {\n                closeAllWindow()\n                if let name = self.evaluatedArguments![\"name\"] as? String {\n                    guard let app = SCContext.availableContent?.applications.first(where: { $0.applicationName == name }) else {\n                        createAlert(title: \"Error\".local, message: \"No such application!\".local, button1: \"OK\".local).runModal()\n                        return\n                    }\n                    closeAllWindow()\n                    guard let screens = SCContext.availableContent?.displays else { return }\n                    guard let windows = SCContext.availableContent?.windows.filter({\n                        guard let title = $0.title else { return false }\n                        return !title.contains(\"Item-0\")\n                        && title != \"Window\"\n                        && $0.frame.width > 40\n                        && $0.frame.height > 40\n                    }) else { return }\n                    var s = [SCDisplay]()\n                    for screen in screens {\n                        for w in windows {\n                            if NSIntersectsRect(screen.frame, w.frame) { if !s.contains(screen) { s.append(screen) }}\n                        }\n                    }\n                    if s.isEmpty {\n                        createAlert(title: \"Error\".local, message: \"This application has no windows!\".local, button1: \"OK\".local).runModal()\n                        return\n                    }\n                    if s.count != 1 {\n                        AppDelegate.shared.createNewWindow(view: AppSelector(), title: \"App Selector\".local)\n                        createAlert(title: \"Error\".local, message: \"This app exists in multiple screens, please select it manually!\".local, button1: \"OK\".local).runModal()\n                    } else {\n                        AppDelegate.shared.createCountdownPanel(screen: s.first!) {\n                            AppDelegate.shared.prepRecord(type: \"application\", screens: s.first!, windows: nil, applications: [app])\n                        }\n                    }\n                } else {\n                    closeAllWindow()\n                    AppDelegate.shared.createNewWindow(view: AppSelector(), title: \"App Selector\".local)\n                }\n            }\n        }\n        return nil\n    }\n}\n\nclass selectWindows: NSScriptCommand {\n    override func performDefaultImplementation() -> Any? {\n        if SCContext.stream != nil {\n            createAlert(title: \"Error\".local, message: \"Already recording!\".local, button1: \"OK\".local).runModal()\n            return nil\n        }\n        SCContext.updateAvailableContent {\n            DispatchQueue.main.async {\n                closeAllWindow()\n                if let title = self.evaluatedArguments![\"title\"] as? String {\n                    var windows = [SCWindow]()\n                    guard let w = SCContext.availableContent?.windows.filter({ $0.title == title }) else { return }\n                    windows = w\n                    if let app = self.evaluatedArguments![\"app\"] as? String {\n                        guard let w = SCContext.availableContent?.windows.filter({ $0.title == title && $0.owningApplication?.applicationName == app }) else { return }\n                        windows = w\n                    }\n                    closeAllWindow()\n                    if windows.isEmpty {\n                        createAlert(title: \"Error\".local, message: \"No such window!\".local, button1: \"OK\".local).runModal()\n                        return\n                    }\n                    if windows.count > 1 {\n                        AppDelegate.shared.createNewWindow(view: WinSelector(), title: \"Window Selector\".local)\n                        createAlert(title: \"Error\".local, message: \"Duplicate window exists, please select it manually!\".local, button1: \"OK\".local).runModal()\n                        return\n                    }\n                    let window = windows.first!\n                    guard let screens = SCContext.availableContent?.displays else { return }\n                    var s = [SCDisplay]()\n                    for screen in screens {\n                        if NSIntersectsRect(screen.frame, window.frame) { if !s.contains(screen) { s.append(screen) }}\n                    }\n                    if s.isEmpty {\n                        createAlert(title: \"Error\".local, message: \"Unable to find the screen this window belongs to!\".local, button1: \"OK\".local).runModal()\n                        return\n                    }\n                    if let display = SCContext.getSCDisplayWithMouse() {\n                        if s.contains(display) {\n                            AppDelegate.shared.createCountdownPanel(screen: display) {\n                                AppDelegate.shared.prepRecord(type: \"window\" , screens: s.first!, windows: [window], applications: nil)\n                            }\n                        } else {\n                            AppDelegate.shared.createCountdownPanel(screen: s.first!) {\n                                AppDelegate.shared.prepRecord(type: \"window\" , screens: s.first!, windows: [window], applications: nil)\n                            }\n                        }\n                    }\n                } else {\n                    closeAllWindow()\n                    AppDelegate.shared.createNewWindow(view: WinSelector(), title: \"Window Selector\".local)\n                }\n            }\n        }\n        return nil\n    }\n}\n\nclass recordAudio: NSScriptCommand {\n    override func performDefaultImplementation() -> Any? {\n        if SCContext.stream != nil {\n            createAlert(title: \"Error\".local, message: \"Already recording!\".local, button1: \"OK\".local).runModal()\n            return nil\n        }\n        SCContext.updateAvailableContent {\n            DispatchQueue.main.async {\n                let m = UserDefaults.standard.bool(forKey: \"recordMic\")\n                if let mic = self.evaluatedArguments![\"mic\"] as? Bool {\n                    UserDefaults.standard.set(mic, forKey: \"recordMic\")\n                }\n                closeAllWindow()\n                AppDelegate.shared.prepRecord(type: \"audio\", screens: SCContext.getSCDisplayWithMouse(), windows: nil, applications: nil)\n                UserDefaults.standard.set(m, forKey: \"recordMic\")\n            }\n        }\n        return nil\n    }\n}\n\nclass setPreferences: NSScriptCommand {\n    override func performDefaultImplementation() -> Any? {\n        if SCContext.stream != nil {\n            createAlert(title: \"Error\".local, message: \"Already recording!\".local, button1: \"OK\".local).runModal()\n            return nil\n        }\n        if let hires = self.evaluatedArguments![\"hires\"] as? Bool { UserDefaults.standard.set(hires, forKey: \"highRes\") }\n        if let fps = self.evaluatedArguments![\"fps\"] as? Int { UserDefaults.standard.set(fps, forKey: \"frameRate\") }\n        if let cursor = self.evaluatedArguments![\"cursor\"] as? Bool { UserDefaults.standard.set(cursor, forKey: \"showMouse\") }\n        if let sound = self.evaluatedArguments![\"sound\"] as? Bool { UserDefaults.standard.set(sound, forKey: \"recordWinSound\") }\n        if let microphone = self.evaluatedArguments![\"microphone\"] as? Bool { UserDefaults.standard.set(microphone, forKey: \"recordMic\") }\n        if let quality = self.evaluatedArguments![\"quality\"] as? Int {\n            if [1,2,3].contains(quality) {\n                switch quality {\n                    case 1: UserDefaults.standard.set(0.3, forKey: \"videoQuality\")\n                    case 2: UserDefaults.standard.set(0.7, forKey: \"videoQuality\")\n                    default: UserDefaults.standard.set(1.0, forKey: \"videoQuality\")\n                }\n            }\n        }\n        if let micname = self.evaluatedArguments![\"micname\"] as? String {\n            if SCContext.getMicrophone().map({$0.localizedName}).contains(micname) || micname == \"default\" {\n                UserDefaults.standard.set(micname, forKey: \"micDevice\")\n            }\n        }\n        if let hdr = self.evaluatedArguments![\"hdr\"] as? Bool {\n            if #available(macOS 15.0, *) {\n                UserDefaults.standard.set(hdr, forKey: \"recordHDR\")\n            }\n        }\n        return nil\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/Supports/GroupForm.swift",
    "content": "//\n//  GroupForm.swift\n//  AirBattery\n//\n//  Created by apple on 2024/10/28.\n//\n\nimport SwiftUI\n\nstruct HoverButton<Content: View>: View {\n    var color: Color = .primary\n    var secondaryColor: Color = .blue\n    var action: () -> Void\n    @ViewBuilder let label: () -> Content\n    @State private var isHovered: Bool = false\n    \n    var body: some View {\n        Button(action: {\n            action()\n        }, label: {\n            label().foregroundStyle(isHovered ? secondaryColor : color)\n        })\n        .buttonStyle(.plain)\n        .onHover(perform: { isHovered = $0 })\n    }\n}\n\nstruct SForm<Content: View>: View {\n    var spacing: CGFloat = 30\n    var noSpacer: Bool = false\n    @ViewBuilder let content: () -> Content\n    \n    var body: some View {\n        VStack(spacing: spacing) {\n            content()\n            if !noSpacer {\n                Spacer().frame(minHeight: 0)\n            }\n        }\n        .padding(.bottom, noSpacer ? 0 : -spacing)\n        .padding()\n        .frame(maxWidth: .infinity)\n        \n    }\n}\n\nstruct SGroupBox<Content: View>: View {\n    var label: LocalizedStringKey? = nil\n    @ViewBuilder let content: () -> Content\n\n    var body: some View {\n        GroupBox(label: label != nil ? Text(label!).font(.headline) : nil) {\n            VStack(spacing: 10) { content() }.padding(5)\n        }\n    }\n}\n\nstruct SItem<Content: View>: View {\n    var label: LocalizedStringKey? = nil\n    var spacing: CGFloat = 8\n    @ViewBuilder let content: () -> Content\n    \n    var body: some View {\n        HStack(spacing: spacing) {\n            if let label = label { Text(label) }\n            Spacer()\n            content()\n        }.frame(height: 16)\n    }\n}\n\nstruct SDivider: View {\n    var body: some View {\n        Divider().opacity(0.5)\n    }\n}\n\nstruct SSlider: View {\n    var label: LocalizedStringKey? = nil\n    @Binding var value: Int\n    var range: ClosedRange<Double> = 0...100\n    var width: CGFloat = .infinity\n    \n    var body: some View {\n        HStack {\n            if let label = label {\n                Text(label)\n            }\n            Spacer()\n            Slider(value:\n                    Binding(get: { Double(value) },\n                            set: { newValue in\n                let base: Int = Int(newValue.rounded())\n                let modulo: Int = base % 1\n                value = base - modulo\n            }), in: range).frame(maxWidth: width)\n        }.frame(height: 16)\n    }\n}\n\nstruct SInfoButton: View {\n    var tips: LocalizedStringKey\n    @State private var isPresented: Bool = false\n    \n    var body: some View {\n        Button(action: {\n            isPresented = true\n        }, label: {\n            Image(systemName: \"info.circle\")\n                .font(.system(size: 15, weight: .light))\n                .opacity(0.5)\n        })\n        .buttonStyle(.plain)\n        .onChange(of: isPresented) {_ in}\n        .sheet(isPresented: $isPresented) {\n            VStack(alignment: .trailing) {\n                GroupBox { Text(tips).padding() }\n                Button(action: {\n                    isPresented = false\n                }, label: {\n                    Text(\"OK\").frame(width: 30)\n                }).keyboardShortcut(.defaultAction)\n            }.padding()\n        }\n    }\n}\n\nstruct SButton: View {\n    var title: LocalizedStringKey\n    var buttonTitle: LocalizedStringKey\n    var tips: LocalizedStringKey?\n    var action: () -> Void\n    \n    init(_ title: LocalizedStringKey, buttonTitle: LocalizedStringKey, tips: LocalizedStringKey? = nil, action: @escaping () -> Void) {\n        self.title = title\n        self.buttonTitle = buttonTitle\n        self.tips = tips\n        self.action = action\n    }\n    \n    var body: some View {\n        HStack(spacing: 4) {\n            Text(title)\n            Spacer()\n            if let tips = tips { SInfoButton(tips: tips) }\n            Button(buttonTitle,\n                   action: { action() })\n        }.frame(height: 16)\n    }\n}\n\nstruct SField: View {\n    var title: LocalizedStringKey\n    var placeholder: LocalizedStringKey\n    var tips: LocalizedStringKey?\n    @Binding var text: String\n    var width: Double\n    \n    init(_ title: LocalizedStringKey, placeholder:LocalizedStringKey = \"\", tips: LocalizedStringKey? = nil, text: Binding<String>, width: Double = .infinity) {\n        self.title = title\n        self.placeholder = placeholder\n        self.tips = tips\n        self._text = text\n        self.width = width\n    }\n    \n    var body: some View {\n        HStack(spacing: 4) {\n            Text(title)\n            Spacer()\n            if let tips = tips { SInfoButton(tips: tips) }\n            TextField(placeholder, text: $text)\n                .textFieldStyle(.roundedBorder)\n                .multilineTextAlignment(.trailing)\n                .frame(maxWidth: width)\n        }\n    }\n}\n\nstruct SPicker<T: Hashable, Content: View, Style: PickerStyle>: View {\n    var title: LocalizedStringKey\n    @Binding var selection: T\n    var style: Style\n    var tips: LocalizedStringKey?\n    @ViewBuilder let content: () -> Content\n    \n    init(_ title: LocalizedStringKey, selection: Binding<T>, style: Style = .menu, tips: LocalizedStringKey? = nil, @ViewBuilder content: @escaping () -> Content) {\n            self.title = title\n            self._selection = selection\n            self.style = style\n            self.tips = tips\n            self.content = content\n        }\n    \n    var body: some View {\n        HStack {\n            Text(title)\n            Spacer()\n            if let tips = tips { SInfoButton(tips: tips) }\n            Picker(selection: $selection, content: { content() }, label: {})\n                .fixedSize()\n                .pickerStyle(style)\n                .buttonStyle(.borderless)\n        }.frame(height: 16)\n    }\n}\n\nstruct SToggle: View {\n    var title: LocalizedStringKey\n    @Binding var isOn: Bool\n    var tips: LocalizedStringKey?\n    \n    init(_ title: LocalizedStringKey, isOn: Binding<Bool>, tips: LocalizedStringKey? = nil) {\n        self.title = title\n        self._isOn = isOn\n        self.tips = tips\n    }\n    \n    var body: some View {\n        HStack(spacing: 4) {\n            Text(title)\n            Spacer()\n            if let tips = tips { SInfoButton(tips: tips) }\n            Toggle(\"\", isOn: $isOn)\n                .toggleStyle(.switch)\n                .scaleEffect(0.7)\n                .frame(width: 32)\n        }.frame(height: 16)\n    }\n}\n\nstruct SSteper: View {\n    var title: LocalizedStringKey\n    @Binding var value: Int\n    var min: Int\n    var max: Int\n    var width: CGFloat\n    var tips: LocalizedStringKey?\n    \n    init(_ title: LocalizedStringKey, value: Binding<Int>, min: Int = 0, max: Int = 100, width: CGFloat = 45, tips: LocalizedStringKey? = nil) {\n        self.title = title\n        self._value = value\n        self.tips = tips\n        self.width = width\n        self.min = min\n        self.max = max\n    }\n    \n    var body: some View {\n        HStack(spacing: 0) {\n            Text(title)\n            Spacer()\n            if let tips = tips { SInfoButton(tips: tips) }\n            TextField(\"\", value: $value, formatter: NumberFormatter())\n                .textFieldStyle(.roundedBorder)\n                .multilineTextAlignment(.trailing)\n                .frame(width: width)\n                .onChange(of: value) { newValue in\n                    if newValue > max { value = max }\n                    if newValue < min { value = min }\n                }\n            Stepper(\"\", value: $value)\n                .padding(.leading, -6)\n        }.frame(height: 16)\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/Supports/Scriptable.sdef",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE dictionary SYSTEM \"file://localhost/System/Library/DTDs/sdef.dtd\">\n<dictionary title=\"QuickRecorder Scriptable\">\n    <suite name=\"QuickRecorder Scripting\" code=\"QKrd\" description=\"QuickRecorder commands\">\n        <command name=\"record screen\" code=\"QKrdSlsn\" description=\"Select screen to record\">\n            <cocoa class=\"QuickRecorder.selectScreen\"/>\n            <parameter name=\"numbered\" code=\"NUMb\" type=\"integer\" description=\"Screen number\" optional=\"yes\">\n                <cocoa key=\"index\"/>\n            </parameter>\n        </command>\n        \n        <command name=\"record screen area\" code=\"QKrdSlar\" description=\"Select screen area to record\">\n            <cocoa class=\"QuickRecorder.selectArea\"/>\n        </command>\n        \n        <command name=\"record application\" code=\"QKrdSlap\" description=\"Select apps to record\">\n            <cocoa class=\"QuickRecorder.selectApps\"/>\n            <parameter name=\"named\" code=\"NAmd\" type=\"text\" description=\"Application Name\" optional=\"yes\">\n                <cocoa key=\"name\"/>\n            </parameter>\n        </command>\n        \n        <command name=\"record window\" code=\"QKrdSlwd\" description=\"Select windows to record\">\n            <cocoa class=\"QuickRecorder.selectWindows\"/>\n            <parameter name=\"titled\" code=\"TItd\" type=\"text\" description=\"Window Title\" optional=\"yes\">\n                <cocoa key=\"title\"/>\n            </parameter>\n            <parameter name=\"in application\" code=\"APli\" type=\"text\" description=\"Application Name\" optional=\"yes\">\n                <cocoa key=\"app\"/>\n            </parameter>\n        </command>\n        \n        <command name=\"record system audio\" code=\"QKrdREad\" description=\"Record system audio\">\n            <cocoa class=\"QuickRecorder.recordAudio\"/>\n            <parameter name=\"microphone\" code=\"MIcp\" type=\"boolean\" description=\"Whether to record the microphone at the same time\" optional=\"yes\">\n                <cocoa key=\"mic\"/>\n            </parameter>\n        </command>\n        \n        <command name=\"configure\" code=\"QKrdSEtt\" description=\"Modify recording settings\">\n            <cocoa class=\"QuickRecorder.setPreferences\"/>\n            <parameter name=\"hires\" code=\"REsl\" type=\"boolean\" description=\"Recording in Retina resolution\" optional=\"yes\">\n                <cocoa key=\"hires\"/>\n            </parameter>\n            <parameter name=\"fps\" code=\"FPss\" type=\"integer\" description=\"Set the recording frame rate\" optional=\"yes\">\n                <cocoa key=\"fps\"/>\n            </parameter>\n            <parameter name=\"quality\" code=\"QLty\" type=\"integer\" description=\"Video quality (3=high, 2=medium, 1=low)\" optional=\"yes\">\n                <cocoa key=\"quality\"/>\n            </parameter>\n            <parameter name=\"cursor\" code=\"MOus\" type=\"boolean\" description=\"Whether to record the cursor\" optional=\"yes\">\n                <cocoa key=\"cursor\"/>\n            </parameter>\n            <parameter name=\"sound\" code=\"SUnd\" type=\"boolean\" description=\"Whether to record the system sound\" optional=\"yes\">\n                <cocoa key=\"sound\"/>\n            </parameter>\n            <parameter name=\"microphone\" code=\"MIce\" type=\"boolean\" description=\"Whether to record the microphone\" optional=\"yes\">\n                <cocoa key=\"microphone\"/>\n            </parameter>\n            <parameter name=\"mic device\" code=\"MCNa\" type=\"text\" description=\"The name of the audio input device (default is 'default')\" optional=\"yes\">\n                <cocoa key=\"micname\"/>\n            </parameter>\n            <parameter name=\"hdr\" code=\"HDri\" type=\"boolean\" description=\"Whether to record in HDR mode (macOS 15 or later only)\" optional=\"yes\">\n                <cocoa key=\"hdr\"/>\n            </parameter>\n        </command>\n    </suite>\n</dictionary>\n"
  },
  {
    "path": "QuickRecorder/Supports/SleepPreventer.swift",
    "content": "//\n//  SleepPreventer.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/12/9.\n//\n\nimport Foundation\nimport IOKit.pwr_mgt\n\nclass SleepPreventer {\n    static let shared = SleepPreventer()\n    private var assertionID: IOPMAssertionID = 0\n    \n    func preventSleep(reason: String) {\n        let type = \"PreventUserIdleDisplaySleep\" as CFString\n        let reason = reason as CFString\n        let result = IOPMAssertionCreateWithName(type, IOPMAssertionLevel(kIOPMAssertionLevelOn), reason, &assertionID)\n        if result != kIOReturnSuccess { print(\"Failure to prevent sleep, error: \\(result)\") }\n    }\n    \n    func allowSleep() {\n        let result = IOPMAssertionRelease(assertionID)\n        if result != kIOReturnSuccess { print(\"Failed to release assertion, error: \\(result)\") }\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/Supports/Sparkle.swift",
    "content": "//\n//  Sparkle.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/5/2.\n//\n\nimport SwiftUI\nimport Sparkle\n\n// This view model class publishes when new updates can be checked by the user\nfinal class CheckForUpdatesViewModel: ObservableObject {\n    @Published var canCheckForUpdates = false\n\n    init(updater: SPUUpdater) {\n        updater.publisher(for: \\.canCheckForUpdates)\n            .assign(to: &$canCheckForUpdates)\n    }\n}\n\n// This is the view for the Check for Updates menu item\n// Note this intermediate view is necessary for the disabled state on the menu item to work properly before Monterey.\n// See https://stackoverflow.com/questions/68553092/menu-not-updating-swiftui-bug for more info\nstruct CheckForUpdatesView: View {\n    @ObservedObject private var checkForUpdatesViewModel: CheckForUpdatesViewModel\n    private let updater: SPUUpdater\n    \n    init(updater: SPUUpdater) {\n        self.updater = updater\n        \n        // Create our view model for our CheckForUpdatesView\n        self.checkForUpdatesViewModel = CheckForUpdatesViewModel(updater: updater)\n    }\n    \n    var body: some View {\n        Button(\"Check for Updates…\", action: updater.checkForUpdates)\n            .disabled(!checkForUpdatesViewModel.canCheckForUpdates)\n    }\n}\n\nstruct UpdaterSettingsView: View {\n    private let updater: SPUUpdater\n    \n    @State private var automaticallyChecksForUpdates: Bool\n    @State private var automaticallyDownloadsUpdates: Bool\n    \n    init(updater: SPUUpdater) {\n        self.updater = updater\n        self.automaticallyChecksForUpdates = updater.automaticallyChecksForUpdates\n        self.automaticallyDownloadsUpdates = updater.automaticallyDownloadsUpdates\n    }\n    \n    var body: some View {\n        SToggle(\"Automatically check for updates\", isOn: $automaticallyChecksForUpdates)\n            .onChange(of: automaticallyChecksForUpdates) { newValue in\n                updater.automaticallyChecksForUpdates = newValue\n            }\n        Divider().opacity(0.5)\n        SToggle(\"Automatically download updates\", isOn: $automaticallyDownloadsUpdates)\n            .disabled(!automaticallyChecksForUpdates)\n            .onChange(of: automaticallyDownloadsUpdates) { newValue in\n                updater.automaticallyDownloadsUpdates = newValue\n            }\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/Supports/WindowAccessor.swift",
    "content": "//\n//  WindowAccessor.swift\n//  xHistory\n//\n//  Created by apple on 2024/11/7.\n//\n\nimport AppKit\nimport SwiftUI\n\nstruct WindowAccessor: NSViewRepresentable {\n    var onWindowOpen: ((NSWindow?) -> Void)?\n    var onWindowActive: ((NSWindow?) -> Void)?\n    var onWindowDeactivate: ((NSWindow?) -> Void)?\n    var onWindowClose: (() -> Void)?\n\n    func makeNSView(context: Context) -> NSView {\n        let view = NSView()\n        DispatchQueue.main.async {\n            if let window = view.window {\n                window.delegate = context.coordinator\n                context.coordinator.window = window\n                self.onWindowOpen?(window)\n            } else {\n                self.onWindowOpen?(nil)\n            }\n        }\n        return view\n    }\n\n    func updateNSView(_ nsView: NSView, context: Context) {}\n\n    func makeCoordinator() -> Coordinator {\n        Coordinator(\n            onWindowOpen: onWindowOpen,\n            onWindowActive: onWindowActive,\n            onWindowDeactivate: onWindowDeactivate,\n            onWindowClose: onWindowClose\n        )\n    }\n\n    class Coordinator: NSObject, NSWindowDelegate {\n        weak var window: NSWindow? // 使用 weak 避免循环引用\n        var onWindowOpen: ((NSWindow?) -> Void)?\n        var onWindowActive: ((NSWindow?) -> Void)?\n        var onWindowDeactivate: ((NSWindow?) -> Void)?\n        var onWindowClose: (() -> Void)?\n\n        init(onWindowOpen: ((NSWindow?) -> Void)? = nil,\n             onWindowActive: ((NSWindow?) -> Void)? = nil,\n             onWindowDeactivate: ((NSWindow?) -> Void)? = nil,\n             onWindowClose: (() -> Void)? = nil) {\n            self.onWindowOpen = onWindowOpen\n            self.onWindowClose = onWindowClose\n            self.onWindowActive = onWindowActive\n            self.onWindowDeactivate = onWindowDeactivate\n        }\n\n        func windowWillClose(_ notification: Notification) {\n            onWindowClose?()\n        }\n        \n        func windowDidBecomeKey(_ notification: Notification) {\n            onWindowActive?(window)\n        }\n\n        func windowDidResignKey(_ notification: Notification) {\n            onWindowDeactivate?(window)\n        }\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/Supports/WindowHighlighter.swift",
    "content": "//\n//  WindowHighlighter.swift\n//  Topit\n//\n//  Created by apple on 2024/11/26.\n//\n\nimport SwiftUI\nimport ScreenCaptureKit\n\nstruct CoverView: View {\n    var body: some View {\n        Color.clear.overlay { Rectangle().stroke(.blue, lineWidth: 5) }\n    }\n}\n\nstruct HighlightMask: View {\n    let app: String\n    let title: String\n    let windowID: Int\n    var appDelegate = AppDelegate.shared\n    @State var window: SCWindow?\n    @State var display: SCDisplay?\n    @State var color: Color = .blue\n    @State var showSheet: Bool = false\n    @State private var isPopoverShowing = false\n    @State private var disableFilter = false\n    @State private var donotCapture = false\n    @State private var autoStop = 0\n    \n    var body: some View {\n        color\n            .opacity(0.2)\n            .cornerRadius(10)\n            .help(\"\\(app) - \\(title)\")\n            .sheet(isPresented: $showSheet) {\n                HStack(spacing: 4) {\n                    Button(action: {\n                        showSheet = false\n                    }, label: {\n                        VStack{\n                            Image(systemName: \"xmark.circle.fill\")\n                                .font(.system(size: 36))\n                                .foregroundStyle(.gray)\n                            Text(\"Cancel\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                    }).buttonStyle(.plain)\n                    Spacer()\n                    OptionsView()\n                    Spacer()\n                    Button(action: {\n                        isPopoverShowing = true\n                    }, label: {\n                        Image(systemName: \"timer\")\n                            .font(.system(size: 11, weight: .bold))\n                            .foregroundStyle(.blue)\n                    })\n                    .buttonStyle(.plain)\n                    .padding(.top, 42.5)\n                    .popover(isPresented: $isPopoverShowing, arrowEdge: .bottom, content: {\n                        HStack {\n                            Text(\" Stop after\".local)\n                            TextField(\"\", value: $autoStop, formatter: NumberFormatter())\n                                .textFieldStyle(RoundedBorderTextFieldStyle())\n                            Stepper(\"\", value: $autoStop)\n                                .padding(.leading, -10)\n                            Text(\"minutes \".local)\n                        }\n                        .fixedSize()\n                        .padding()\n                    })\n                    Button(action: {\n                        startRecording()\n                    }, label: {\n                        VStack{\n                            Image(systemName: \"record.circle.fill\")\n                                .font(.system(size: 36))\n                                .foregroundStyle(.red)\n                            Text(\"Start\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                    }).buttonStyle(.plain)\n                }\n                .focusable(false)\n                .frame(width: 640, height: 90)\n                .padding(.horizontal, 40)\n                .onDisappear {\n                    if let mask = WindowHighlighter.shared.mask {\n                        mask.close()\n                    }\n                }\n            }\n            .onPressGesture {\n                if let w = WindowHighlighter.shared.getSCWindowWithID(UInt32(windowID)),\n                   let d = SCContext.getSCDisplayWithMouse() {\n                    display = d\n                    window = w\n                    WindowHighlighter.shared.stopMouseMonitor()\n                    showSheet = true\n                    return\n                }\n                color = .red\n                withAnimation(.easeInOut(duration: 0.6)) { color = .blue }\n            }\n    }\n    \n    func startRecording() {\n        closeAllWindow()\n        switch WindowHighlighter.shared.Mode {\n        case 2:\n            var dashWindow = NSWindow()\n            guard let screen = display, let nsScreen = display?.nsScreen, var area = window?.frame else { return }\n            area = CGRectTransform(cgRect: area)\n            SCContext.screenArea = NSRect(x: area.origin.x - nsScreen.frame.minX, y: area.origin.y - nsScreen.frame.minY, width:area.width, height: area.height)\n            let frame = NSRect(x: Int(area.origin.x - 3),\n                               y: Int(area.origin.y - 3),\n                               width: Int(area.width + 6), height: Int(area.height + 6))\n            dashWindow = NSWindow(contentRect: frame, styleMask: [.fullSizeContentView], backing: .buffered, defer: false)\n            dashWindow.hasShadow = false\n            dashWindow.level = .screenSaver\n            dashWindow.ignoresMouseEvents = true\n            dashWindow.isReleasedWhenClosed = false\n            dashWindow.title = \"Area Overlayer\".local\n            dashWindow.backgroundColor = NSColor.clear\n            dashWindow.contentView = NSHostingView(rootView: DashWindow())\n            dashWindow.orderFront(self)\n            appDelegate.createCountdownPanel(screen: screen) {\n                SCContext.autoStop = autoStop\n                appDelegate.prepRecord(type: \"area\", screens: display, windows: nil, applications: nil)\n            }\n        default:\n            if let d = display, let w = window {\n                appDelegate.createCountdownPanel(screen: d) {\n                    SCContext.autoStop = autoStop\n                    appDelegate.prepRecord(type: \"window\" , screens: d, windows: [w], applications: nil)\n                }\n            }\n        }\n    }\n}\n\nclass WindowHighlighter {\n    static let shared = WindowHighlighter()\n    var mouseMonitor: Any?\n    var mouseMonitorL: Any?\n    var targetWindowID: Int?\n    var mask: EscPanel?\n    var Mode: Int = 1\n    \n    func registerMouseMonitor(mode: Int = 1) {\n        closeAllWindow()\n        Mode = mode\n        DispatchQueue.main.async {\n            var message = \"\"\n            var id = \"\"\n            switch mode {\n            case 2:\n                id = \"qr.how-to-select.note2\"\n                message = \"Click on a window to select its area\\nor press Esc to cancel.\".local\n            default:\n                message = \"Click the window you want to record\\nor press Esc to cancel.\".local\n                id = \"qr.how-to-select.note\"\n            }\n            tips(message, id: id)\n        }\n        \n        for screen in NSScreen.screens {\n            let cover = EscPanel(contentRect: screen.frame, styleMask: [.nonactivatingPanel, .fullSizeContentView], backing: .buffered, defer: false)\n            cover.contentView = NSHostingView(rootView: CoverView())\n            cover.level = .statusBar\n            cover.sharingType = .none\n            cover.backgroundColor = .clear\n            cover.ignoresMouseEvents = true\n            cover.isReleasedWhenClosed = false\n            cover.collectionBehavior = [.canJoinAllSpaces, .stationary]\n            cover.title = \"Screen Cover\"\n            cover.orderFront(self)\n        }\n        \n        if mouseMonitor == nil {\n            mouseMonitor = NSEvent.addGlobalMonitorForEvents(matching: [.mouseMoved]) { _ in self.updateMask() }\n        }\n        if mouseMonitorL == nil {\n            mouseMonitorL = NSEvent.addLocalMonitorForEvents(matching: [.mouseMoved]) { event in\n                self.updateMask()\n                return event\n            }\n        }\n    }\n        \n    func stopMouseMonitor() {\n        DispatchQueue.main.async {\n            for w in NSApp.windows.filter({ $0.title == \"Screen Cover\" }) { w.close() }\n        }\n        if let monitor = mouseMonitor {\n            NSEvent.removeMonitor(monitor)\n            mouseMonitor = nil\n        }\n        if let monitor = mouseMonitorL {\n            NSEvent.removeMonitor(monitor)\n            mouseMonitorL = nil\n        }\n    }\n    \n    func updateMask() {\n        guard let targetWindow = getWindowUnderMouse() else {\n            mask?.close()\n            targetWindowID = nil\n            return\n        }\n        \n        if let app = targetWindow[\"kCGWindowOwnerName\"] as? String, app != Bundle.main.appName,\n           let windowID = targetWindow[\"kCGWindowNumber\"] as? Int, targetWindowID != windowID {\n            mask?.close()\n            targetWindowID = windowID\n            createMaskWindow(window: targetWindow)\n        }\n    }\n    \n    func createMaskWindow(window: [String: Any]) {\n        guard let windowID = targetWindowID, let frame = getCGWindowFrame(window: window) else { return }\n        let app = window[\"kCGWindowOwnerName\"] as? String ?? \"\"\n        let title = window[\"kCGWindowName\"] as? String ?? \"\"\n        \n        mask = EscPanel(contentRect: CGRectTransform(cgRect: frame),\n                        styleMask: [.nonactivatingPanel, .fullSizeContentView], backing: .buffered, defer: false)\n        let contentView = NSHostingView(rootView: HighlightMask(app: app, title: title, windowID: windowID))\n        mask?.contentView = contentView\n        mask?.title = \"Mask Window\"\n        mask?.hasShadow = false\n        mask?.sharingType = .none\n        mask?.backgroundColor = .clear\n        mask?.titleVisibility = .hidden\n        mask?.isMovableByWindowBackground = false\n        mask?.isReleasedWhenClosed = false\n        mask?.collectionBehavior = [.canJoinAllSpaces, .transient]\n        mask?.setFrame(CGRectTransform(cgRect: frame), display: true)\n        mask?.order(.above, relativeTo: windowID)\n        mask?.makeKey()\n    }\n    \n    func getWindowUnderMouse() -> [String: Any]? {\n        let mousePosition = NSEvent.mouseLocation\n        guard let windowList = getAllCGWindows() else { return nil }\n\n        for window in windowList {\n            guard let bounds = getCGWindowFrame(window: window) else { continue }\n            if CGRectTransform(cgRect: bounds).contains(mousePosition) {\n                return window\n            }\n        }\n        return nil\n    }\n    \n    func getAllCGWindows() -> [[String: Any]]? {\n        guard var windowList = CGWindowListCopyWindowInfo([.excludeDesktopElements,.optionOnScreenOnly], kCGNullWindowID) as? [[String: Any]] else {\n            return nil\n        }\n        \n        windowList = windowList.filter({\n            ![\"SystemUIServer\", \"Window Server\"].contains($0[\"kCGWindowOwnerName\"] as? String)\n            && $0[\"kCGWindowAlpha\"] as? NSNumber != 0\n            && $0[\"kCGWindowLayer\"] as? NSNumber == 0\n        })\n        \n        return windowList\n    }\n    \n    func getSCWindowWithID(_ windowID: UInt32?) -> SCWindow? {\n        guard let windowID else { return nil }\n        _ = SCContext.updateAvailableContentSync()\n        let windows = SCContext.getWindows()\n        return windows.first(where: { $0.windowID == windowID })\n    }\n    \n    func getCGWindowFrame(window: [String: Any]) -> CGRect? {\n        guard let boundsDict = window[\"kCGWindowBounds\"] as? [String: CGFloat] else { return nil }\n        let bounds = CGRect(\n            x: boundsDict[\"X\"] ?? 0,\n            y: boundsDict[\"Y\"] ?? 0,\n            width: boundsDict[\"Width\"] ?? 0,\n            height: boundsDict[\"Height\"] ?? 0\n        )\n        return bounds\n    }\n    \n    func CGRectTransform(cgRect: CGRect) -> NSRect {\n        let x = cgRect.origin.x\n        let y = cgRect.origin.y\n        let w = cgRect.width\n        let h = cgRect.height\n        if let main = NSScreen.screens.first(where: { $0.isMainScreen }) {\n            return NSRect(x: x, y: main.frame.height - y - h, width: w, height: h)\n        }\n        return cgRect\n    }\n}\n\nclass EscPanel: NSPanel {\n    override func cancelOperation(_ sender: Any?) {\n        self.close()\n        WindowHighlighter.shared.stopMouseMonitor()\n    }\n    override var canBecomeKey: Bool {\n        return true\n    }\n}\n\nfunc CGRectTransform(cgRect: CGRect) -> NSRect {\n    let x = cgRect.origin.x\n    let y = cgRect.origin.y\n    let w = cgRect.width\n    let h = cgRect.height\n    if let main = NSScreen.screens.first(where: { $0.isMainScreen }) {\n        return NSRect(x: x, y: main.frame.height - y - h, width: w, height: h)\n    }\n    return cgRect\n}\n\nextension View {\n    func onPressGesture(perform: @escaping () -> Void) -> some View {\n        self.gesture(\n            DragGesture(minimumDistance: 0)\n                .onChanged { _ in perform() }\n        )\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/AppBlockSelector.swift",
    "content": "//\n//  BundleSelector.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/28.\n//\n\nimport SwiftUI\nimport Foundation\n\nstruct BundleSelector: View {\n    @State private var Bundles = [AppInfo]()\n    @State private var isShowingFilePicker = false\n    \n    var body: some View {\n        ZStack(alignment: Alignment(horizontal: .trailing, vertical: .bottom)) {\n            List(Bundles, id: \\.self) { item in\n                HStack{\n                    Image(systemName: \"minus.circle.fill\")\n                        .font(.system(size: 12))\n                        .foregroundStyle(.red)\n                        .onTapGesture {\n                            if let index = Bundles.firstIndex(of: item) {\n                                _ = withAnimation { Bundles.remove(at: index) }\n                            }\n                        }\n                    Text(item.displayName).font(.system(size: 12))\n                }\n            }\n            Button(action: {\n                self.isShowingFilePicker = true\n            }) {\n                Image(systemName: \"plus.square.fill\")\n                    .font(.system(size: 20))\n                    .foregroundStyle(.secondary)\n            }.buttonStyle(.plain).offset(y: -1)\n        }\n        .onAppear {\n            if let savedData = ud.data(forKey: \"hiddenApps\"),\n               let decodedApps = try? JSONDecoder().decode([AppInfo].self, from: savedData) {\n                Bundles = decodedApps\n            }\n        }\n        .onChange(of: Bundles) { bundles in\n            if let encodedData = try? JSONEncoder().encode(bundles) {\n                ud.set(encodedData, forKey: \"hiddenApps\")\n            }\n        }\n        .fileImporter(isPresented: $isShowingFilePicker, allowedContentTypes: [.application]) { result in\n            do {\n                guard let appID = try Bundle(url: result.get())?.bundleIdentifier else { return }\n                guard let displayName = try Bundle(url: result.get())?.fileName else { return }\n                let app = AppInfo(bundleID: appID, displayName: displayName)\n                if !self.Bundles.contains(app) {\n                    withAnimation { Bundles.append(app) }\n                }\n            } catch {\n                print(\"File selection failed: \\(error.localizedDescription)\")\n            }\n        }\n    }\n}\n\nstruct AppInfo: Hashable, Codable {\n    let bundleID: String\n    let displayName: String\n\n}\n\nextension Bundle {\n    var bundleName: String? { return object(forInfoDictionaryKey: \"CFBundleName\") as? String }\n    var fileName: String { return self.bundleURL.lastPathComponent }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/AppSelector.swift",
    "content": "//\n//  AppSelector.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/16.\n//\n\nimport SwiftUI\nimport Combine\nimport ScreenCaptureKit\n\nstruct AppSelector: View {\n    @StateObject var viewModel = AppSelectorViewModel()\n    @State private var selected = [SCRunningApplication]()\n    @State private var display: SCDisplay!\n    @State private var selectedTab = 0\n    @State private var isPopoverShowing = false\n    @State private var autoStop = 0\n    var appDelegate = AppDelegate.shared\n    \n    var body: some View {\n        ZStack {\n            VStack(spacing: 15) {\n                if #available(macOS 15, *) {\n                    Text(\"Please select the App(s) to record\").offset(y: 12)\n                } else {\n                    Text(\"Please select the App(s) to record\")\n                }\n                TabView(selection: $selectedTab) {\n                    let allApps = viewModel.allApps.sorted(by: { $0.key.displayID < $1.key.displayID })\n                    ForEach(allApps, id: \\.key) { element in\n                        let (screen, apps) = element\n                        let index = allApps.firstIndex(where: { $0.key == screen }) ?? 0\n                        ScrollView(.vertical) {\n                            VStack(spacing: 8) {\n                                ForEach(0..<apps.count/5 + 1, id: \\.self) { rowIndex in\n                                    HStack(spacing: 20) {\n                                        ForEach(0..<5, id: \\.self) { columnIndex in\n                                            let index = 5 * rowIndex + columnIndex\n                                            if index <= apps.count - 1 {\n                                                let item = apps[index]\n                                                Button(action: {\n                                                    if !selected.contains(item) {\n                                                        selected.append(item)\n                                                    } else {\n                                                        selected.removeAll{ $0 == item }\n                                                    }\n                                                }, label: {\n                                                    ZStack {\n                                                        VStack {\n                                                            Image(nsImage: SCContext.getAppIcon(item)!)\n                                                            let appName = item.applicationName\n                                                            let appID = item.bundleIdentifier\n                                                            Text(appName != \"\" ? appName : appID)\n                                                                .foregroundStyle(.secondary)\n                                                                .lineLimit(1)\n                                                                .truncationMode(.tail)\n                                                        }\n                                                        .frame(width: 110, height: 94)\n                                                        .padding(10)\n                                                        .background(\n                                                            Rectangle()\n                                                                .foregroundStyle(.blue)\n                                                                .cornerRadius(5)\n                                                                .opacity(selected.contains(item) ? 0.2 : 0.0)\n                                                        )\n                                                        Image(systemName: \"circle.fill\")\n                                                            .font(.system(size: 31))\n                                                            .foregroundStyle(.white)\n                                                            .opacity(selected.contains(item) ? 1.0 : 0.0)\n                                                            .offset(x: 20, y: 10)\n                                                        Image(systemName: \"checkmark.circle.fill\")\n                                                            .font(.system(size: 27))\n                                                            .foregroundStyle(.green)\n                                                            .opacity(selected.contains(item) ? 1.0 : 0.0)\n                                                            .offset(x: 20, y: 10)\n                                                    }\n                                                }).buttonStyle(.plain)\n                                            }\n                                        }\n                                    }\n                                    .frame(maxWidth: .infinity, alignment: .leading)\n                                    .padding(.leading, 12).padding(.top, 4)\n                                }\n                            }\n                        }\n                        .tag(index)\n                        .tabItem { Text(screen.nsScreen?.localizedName ?? (\"Display \".local + \"\\(index)\")) }\n                        .onAppear{ display = screen }\n                    }\n                }\n                .frame(height: 445)\n                .padding(.horizontal, 10)\n                .onChange(of: selectedTab) { _ in selected.removeAll() }\n                .onReceive(viewModel.$isReady) { isReady in\n                    if isReady {\n                        let allApps = viewModel.allApps.sorted(by: { $0.key.displayID < $1.key.displayID })\n                        if let s = NSApp.windows.first(where: { $0.title == \"App Selector\".local })?.screen,\n                           let index = allApps.firstIndex(where: { $0.key.displayID == s.displayID }) {\n                            selectedTab = index\n                        }\n                    }\n                }\n                HStack(spacing: 4) {\n                    Button(action: {\n                        viewModel.updateAppList()\n                    }, label: {\n                        VStack{\n                            Image(systemName: \"arrow.clockwise.circle.fill\")\n                                .font(.system(size: 36))\n                                .foregroundStyle(.blue)\n                            Text(\"Refresh\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                        \n                    }).buttonStyle(.plain)\n                    Spacer()\n                    OptionsView().padding(.leading, 18)\n                    Spacer()\n                    Button(action: {\n                        isPopoverShowing = true\n                    }, label: {\n                        Image(systemName: \"timer\")\n                            .font(.system(size: 11, weight: .bold))\n                            .foregroundStyle(.blue)\n                    })\n                    .buttonStyle(.plain)\n                    .padding(.top, 42.5)\n                    .popover(isPresented: $isPopoverShowing, arrowEdge: .bottom, content: {\n                        HStack {\n                            Text(\" Stop after\".local)\n                            TextField(\"\", value: $autoStop, formatter: NumberFormatter())\n                                .textFieldStyle(RoundedBorderTextFieldStyle())\n                                //.onChange(of: autoStop) { newValue in SCContext.autoStop = newValue }\n                            Stepper(\"\", value: $autoStop)\n                                .padding(.leading, -10)\n                            Text(\"minutes \".local)\n                        }\n                        .fixedSize()\n                        .padding()\n                    })\n                    Button(action: {\n                        startRecording()\n                    }, label: {\n                        VStack{\n                            Image(systemName: \"record.circle.fill\")\n                                .font(.system(size: 36))\n                                .foregroundStyle(.red)\n                            Text(\"Start\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                    })\n                    .buttonStyle(.plain)\n                    .disabled(selected.count < 1)\n                }.padding(.horizontal, 40)\n                Spacer()\n            }.padding(.top, -5)\n        }.frame(width: 780, height:555)\n    }\n    \n    func startRecording() {\n        closeAllWindow()\n        appDelegate.createCountdownPanel(screen: display) {\n            SCContext.autoStop = autoStop\n            appDelegate.prepRecord(type: \"application\", screens: display, windows: nil, applications: selected)\n        }\n    }\n}\n\nclass AppSelectorViewModel: ObservableObject {\n    @Published var allApps = [SCDisplay: [SCRunningApplication]]()\n    @Published var isReady = false\n    \n    init() {\n        updateAppList()\n    }\n    \n    func updateAppList() {\n        SCContext.updateAvailableContent {\n            guard let screens = SCContext.availableContent?.displays else { return }\n            for screen in screens {\n                var apps = [SCRunningApplication]()\n                let windows = SCContext.getWindows().filter({ NSIntersectsRect(screen.frame, $0.frame) })\n                for app in windows.map({ $0.owningApplication }) { if !apps.contains(app!) { apps.append(app!) }}\n                if ud.bool(forKey: \"hideSelf\") { apps = apps.filter({$0.bundleIdentifier != Bundle.main.bundleIdentifier}) }\n                DispatchQueue.main.async { self.allApps[screen] = apps }\n            }\n            DispatchQueue.main.async { self.isReady = true }\n        }\n    }\n    \n    /*func updateAppList() {\n        SCContext.updateAvailableContent{\n            DispatchQueue.main.async {\n                self.allApps = SCContext.getApps().filter({ $0.bundleIdentifier != Bundle.main.bundleIdentifier })\n            }\n        }\n    }*/\n}\n\nstruct OptionsView: View {\n    @State private var micList = SCContext.getMicrophone()\n    \n    @AppStorage(\"frameRate\")      private var frameRate: Int = 60\n    @AppStorage(\"videoQuality\")   private var videoQuality: Double = 1.0\n    @AppStorage(\"saveDirectory\")  private var saveDirectory: String?\n    @AppStorage(\"hideSelf\")       private var hideSelf: Bool = false\n    @AppStorage(\"showMouse\")      private var showMouse: Bool = true\n    @AppStorage(\"recordMic\")      private var recordMic: Bool = false\n    @AppStorage(\"recordWinSound\") private var recordWinSound: Bool = true\n    @AppStorage(\"background\")     private var background: BackgroundType = .wallpaper\n    @AppStorage(\"highRes\")        private var highRes: Int = 2\n    @AppStorage(\"recordHDR\")      private var recordHDR: Bool = false\n    @AppStorage(\"micDevice\")      private var micDevice: String = \"default\"\n    @AppStorage(\"enableAEC\")      private var enableAEC: Bool = false\n    \n    var body: some View {\n        VStack(spacing: 6) {\n            HStack {\n                VStack(alignment: .leading, spacing: 10) {\n                    Text(\"Resolution\")\n                    Text(\"Frame Rate\")\n                }\n                VStack(alignment: .leading, spacing: 10) {\n                    Picker(\"\", selection: $highRes) {\n                        Text(\"High (auto)\").tag(2)\n                        Text(\"Normal (1x)\").tag(1)\n                        //Text(\"Low (0.5x)\").tag(0)\n                    }\n                    .buttonStyle(.borderless)\n                    .frame(minWidth: isMacOS12 ? 100 : 10)\n                    Picker(\"\", selection: $frameRate) {\n                        if ![240, 144, 120, 90, 60, 30, 24, 15 ,10].contains(frameRate) {\n                            Text(\"\\(frameRate) FPS\").tag(frameRate)\n                        }\n                        Text(\"240 FPS\").tag(240)\n                        Text(\"144 FPS\").tag(144)\n                        Text(\"120 FPS\").tag(120)\n                        Text(\"90 FPS\").tag(90)\n                        Text(\"60 FPS\").tag(60)\n                        Text(\"30 FPS\").tag(30)\n                        Text(\"24 FPS\").tag(24)\n                        Text(\"15 FPS\").tag(15)\n                        Text(\"10 FPS\").tag(10)\n                    }\n                    .buttonStyle(.borderless)\n                    .frame(minWidth: isMacOS12 ? 100 : 10)\n                }.scaledToFit()\n                Divider().frame(height: 50)\n                VStack(alignment: .leading, spacing: 10) {\n                    Text(\"Quality\")\n                    Text(\"Background\")\n                }.padding(.leading, isMacOS12 ? 0 : 8)\n                VStack(alignment: .leading, spacing: 10) {\n                    Picker(\"\", selection: $videoQuality) {\n                        Text(\"High\").tag(1.0)\n                        Text(\"Medium\").tag(0.7)\n                        Text(\"Low\").tag(0.3)\n                    }\n                    .buttonStyle(.borderless)\n                    .frame(minWidth: isMacOS12 ? 100 : 10)\n                    Picker(\"\", selection: $background) {\n                        Text(\"Wallpaper\").tag(BackgroundType.wallpaper)\n                        if ud.bool(forKey: \"withAlpha\") { Text(\"Transparent\").tag(BackgroundType.clear) }\n                        Text(\"Black\").tag(BackgroundType.black)\n                        Text(\"White\").tag(BackgroundType.white)\n                        Text(\"Gray\").tag(BackgroundType.gray)\n                        Text(\"Yellow\").tag(BackgroundType.yellow)\n                        Text(\"Orange\").tag(BackgroundType.orange)\n                        Text(\"Green\").tag(BackgroundType.green)\n                        Text(\"Blue\").tag(BackgroundType.blue)\n                        Text(\"Red\").tag(BackgroundType.red)\n                        Text(\"Custom\").tag(BackgroundType.custom)\n                    }\n                    .buttonStyle(.borderless)\n                    .frame(minWidth: isMacOS12 ? 100 : 10)\n                }.scaledToFit()\n                Divider().frame(height: 50)\n                VStack(alignment: .leading, spacing: isMacOS12 ? 10 : 2) {\n                    if #available(macOS 15, *) {\n                        Toggle(isOn: $recordHDR) {\n                            HStack(spacing:0){\n                                Image(systemName: \"sparkles.square.filled.on.square\")\n                                    .font(.subheadline)\n                                    .frame(width: isMacOS12 ? 20 : 16)\n                                Text(\"Record HDR\")\n                                    .font(.subheadline)\n                            }\n                        }\n                        .fixedSize()\n                        .toggleStyle(.checkbox)\n                    }\n                    Toggle(isOn: $showMouse) {\n                        HStack(spacing: 0){\n                            Image(systemName: \"cursorarrow\")\n                                .font(isMacOS12 ? .body : .subheadline)\n                                .frame(width: isMacOS12 ? 20 : 16)\n                            Text(\"Record Cursor\")\n                                .font(isMacOS12 ? .body : .subheadline)\n                        }\n                    }\n                    .fixedSize()\n                    .toggleStyle(.checkbox)\n                    if #available(macOS 13, *) {\n                        Toggle(isOn: $recordWinSound) {\n                            HStack(spacing: 0){\n                                Image(systemName: \"speaker.wave.1.fill\")\n                                    .font(isMacOS12 ? .body : .subheadline)\n                                    .frame(width: isMacOS12 ? 20 : 16)\n                                Text(\"App's Audio\")\n                                    .font(.subheadline)\n                            }\n                        }\n                        .fixedSize()\n                        .toggleStyle(.checkbox)\n                    }\n                    HStack(spacing: 0) {\n                        Toggle(isOn: $recordMic) {\n                            Image(systemName: \"mic.fill\")\n                                .font(isMacOS12 ? .body : .subheadline)\n                                .frame(width: isMacOS12 ? 20 : 16)\n                        }\n                        .fixedSize()\n                        .toggleStyle(.checkbox)\n                        .onChange(of: recordMic) { _ in\n                            Task { await SCContext.performMicCheck() }\n                        }\n                        .onAppear{ if micList.isEmpty { recordMic = false } }\n                        .disabled(micList.isEmpty)\n                        Picker(\"\", selection: $micDevice) {\n                            Text(\"Default\".local).tag(\"default\")\n                            ForEach(micList, id: \\.self) { device in\n                                Text(device.localizedName).tag(device.localizedName)\n                            }\n                        }\n                        .disabled(!recordMic)\n                        .scaleEffect(isMacOS12 ? 1 : 0.8)\n                        .padding(.leading, isMacOS12 ? -7 : -16)\n                        .frame(width: 90, height: isMacOS12 ? 20 :12)\n                        .onAppear{\n                            let list = micList.map({ $0.localizedName })\n                            if !list.contains(micDevice) { micDevice = \"default\" }\n                        }\n                        Spacer().frame(width: 5)\n                        if micDevice != \"default\" && enableAEC{\n                            Button(\"⚠️\", action: {\n                                let alert = createAlert(\n                                    title: \"Compatibility Warning\".local,\n                                    message: \"The \\\"Acoustic Echo Cancellation\\\" is enabled, but it won't work on now.\\n\\nIf you need to use a specific input with AEC, set it to \\\"Default\\\" and select the device you want in System Preferences.\\n\\nOr you can start recording without AEC.\".local,\n                                    button1: \"OK\".local, button2: \"System Preferences\".local)\n                                if alert.runModal() == .alertSecondButtonReturn {\n                                    NSWorkspace.shared.open(URL(string: \"x-apple.systempreferences:com.apple.preference.sound?input\")!)\n                                }\n                            }).buttonStyle(.plain).fixedSize()\n                        }\n                    }\n                }.padding(.trailing, isMacOS12 ? 0 : -17)\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/AreaSelector.swift",
    "content": "//\n//  AreaSelector.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/20.\n//\n\nimport SwiftUI\nimport ScreenCaptureKit\nimport Quartz\n\nstruct DashWindow: View {\n    var body: some View {\n        ZStack {\n            Rectangle()\n                .fill(Color.clear)\n                .overlay(\n                    RoundedRectangle(cornerRadius: 4)\n                        .stroke(style: StrokeStyle(lineWidth: 2, dash: [5]))\n                        .padding(2)\n                        .foregroundColor(.blue.opacity(0.5))\n                )\n        }\n    }\n}\n\nstruct resizeView: View {\n    private enum Field: Int, Hashable { case width, height }\n    @FocusState private var focusedField: Field?\n    \n    @AppStorage(\"areaWidth\")  private var areaWidth: Int = 600\n    @AppStorage(\"areaHeight\") private var areaHeight: Int = 450\n    @AppStorage(\"highRes\")    private var highRes: Int = 2\n    \n    var appDelegate = AppDelegate.shared\n    var screen: SCDisplay!\n    \n    var body: some View {\n        VStack(alignment: .leading, spacing: 10) {\n            HStack(spacing: 4) {\n                Text(\"Area Size:\")\n                TextField(\"\", value: $areaWidth, formatter: NumberFormatter())\n                    .frame(width: 60)\n                    .textFieldStyle(.roundedBorder)\n                    .focused($focusedField, equals: .width)\n                    .onChange(of: areaWidth) { newValue in\n                        if !appDelegate.isResizing {\n                            areaWidth = min(max(newValue, 1), screen.width)\n                            resize()\n                        }\n                    }\n                Image(systemName: \"xmark\").font(.system(size: 10, weight: .medium))\n                TextField(\"\", value: $areaHeight, formatter: NumberFormatter())\n                    .frame(width: 60)\n                    .textFieldStyle(.roundedBorder)\n                    .focused($focusedField, equals: .height)\n                    .onChange(of: areaHeight) { newValue in\n                        if !appDelegate.isResizing {\n                            areaHeight = min(max(newValue, 1), screen.height)\n                            resize()\n                        }\n                    }\n            }\n            HStack(spacing: 4) {\n                Text(\"Output Size:\")\n                let scale = Int(screen.nsScreen!.backingScaleFactor)\n                Text(\" \\(highRes == 2 ? areaWidth * scale : areaWidth) x \\(highRes == 2 ? areaHeight * scale : areaHeight)\")\n            }\n        }.onAppear{ focusedField = .width }\n    }\n    \n    func resize() {\n        closeAllWindow(except: \"Start Recording\".local)\n        AppDelegate.shared.showAreaSelector(size: NSSize(width: areaWidth, height: areaHeight), noPanel: true)\n    }\n}\n\nstruct AreaSelector: View {\n    @State private var isPopoverShowing = false\n    @State private var resizePopoverShowing = false\n    @State private var autoStop = 0\n    @State private var nsWindow: NSWindow?\n    \n    var screen: SCDisplay!\n    var appDelegate = AppDelegate.shared\n    \n    var body: some View {\n        ZStack {\n            Color(nsColor: NSColor.windowBackgroundColor)\n                .cornerRadius(10)\n            VStack {\n                HStack(spacing: 6) {\n                    Spacer()\n                    Button(action: {\n                        nsWindow?.close()\n                        for w in NSApp.windows.filter({$0.title == \"Area Selector\".local }) { w.close() }\n                        appDelegate.stopGlobalMouseMonitor()\n                        WindowHighlighter.shared.registerMouseMonitor(mode: 2)\n                    }, label: {\n                        VStack(spacing:0){\n                            ZStack {\n                                Image(systemName: \"circle.fill\")\n                                    .font(.system(size: 36))\n                                    .foregroundStyle(.green)\n                                Image(\"window.select\")\n                                    .resizable().scaledToFit()\n                                    .foregroundStyle(.black)\n                                    .frame(width: 27)\n                                    .offset(y: 0.5)\n                                    .blendMode(.destinationOut)\n                            }\n                            .compositingGroup()\n                            .frame(width: 42, height: 41)\n                            Text(\"Window Area\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                    }).buttonStyle(.plain)\n                    Button(action: {\n                        resizePopoverShowing = true\n                    }, label: {\n                        VStack{\n                            Image(systemName: \"viewfinder.circle.fill\")\n                                .font(.system(size: 36))\n                                .foregroundStyle(.blue)\n                            Text(\"Resize\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                    })\n                    .buttonStyle(.plain)\n                    .sheet(isPresented: $resizePopoverShowing, content: {\n                        HStack(spacing: 10) {\n                            Button(action: {\n                                resizePopoverShowing = false\n                            }, label: {\n                                VStack{\n                                    Image(systemName: \"arrow.uturn.backward.circle.fill\")\n                                        .font(.system(size: 30))\n                                        .foregroundStyle(.secondary)\n                                    Text(\"Back\")\n                                        .foregroundStyle(.secondary)\n                                        .font(.system(size: 12))\n                                }\n                                \n                            }).buttonStyle(.plain)\n                            resizeView(screen: screen)\n                        }.padding()\n                    })\n                    Spacer()\n                    OptionsView().padding(.horizontal, 10)\n                    Spacer()\n                    Button(action: {\n                        isPopoverShowing = true\n                    }, label: {\n                        Image(systemName: \"timer\")\n                            .font(.system(size: 11, weight: .bold))\n                            .foregroundStyle(.blue)\n                    })\n                    .buttonStyle(.plain)\n                    .padding(.top, 42.5)\n                    .popover(isPresented: $isPopoverShowing, arrowEdge: .bottom, content: {\n                        HStack {\n                            Text(\" Stop after\".local)\n                            TextField(\"\", value: $autoStop, formatter: NumberFormatter())\n                                .textFieldStyle(RoundedBorderTextFieldStyle())\n                            Stepper(\"\", value: $autoStop)\n                                .padding(.leading, -10)\n                            Text(\"minutes \".local)\n                        }\n                        .fixedSize()\n                        .padding()\n                    })\n                    Button(action: {\n                        startRecording()\n                    }, label: {\n                        VStack{\n                            Image(systemName: \"record.circle.fill\")\n                                .font(.system(size: 36))\n                                .foregroundStyle(.red)\n                            Text(\"Start\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                    }).buttonStyle(.plain)\n                    Spacer()\n                }\n            }.padding(.horizontal, 10)\n            Button(action: {\n                /*for w in NSApp.windows.filter({ $0.title == \"Area Selector\".local || $0.title == \"Start Recording\".local}) { w.close() }\n                if let monitor = keyMonitor {\n                    NSEvent.removeMonitor(monitor)\n                    keyMonitor = nil\n                }\n                appDelegate.stopGlobalMouseMonitor()*/\n                nsWindow?.close()\n            }, label: {\n                Image(systemName: \"x.circle\")\n                    .font(.system(size: 12, weight: .bold))\n                    .foregroundStyle(.secondary)\n            })\n            .buttonStyle(.plain)\n            .padding(.top, -39)\n            .padding(.leading, -389)\n            .keyboardShortcut(.cancelAction)\n        }\n        .focusable(false)\n        .frame(width: 790, height: 90)\n        .background(WindowAccessor(onWindowOpen: { w in nsWindow = w }, onWindowClose: {\n            DispatchQueue.main.async {\n                for w in NSApp.windows.filter({ $0.title == \"Area Selector\".local }) { w.close() }\n                if let monitor = keyMonitor {\n                    NSEvent.removeMonitor(monitor)\n                    keyMonitor = nil\n                }\n                appDelegate.stopGlobalMouseMonitor()\n            }\n        }))\n    }\n    \n    func startRecording() {\n        closeAllWindow()\n        appDelegate.stopGlobalMouseMonitor()\n        var window = NSWindow()\n        let area = SCContext.screenArea!\n        guard let nsScreen = screen.nsScreen else { return }\n        let frame = NSRect(x: Int(area.origin.x + nsScreen.frame.minX - 4),\n                           y: Int(area.origin.y + nsScreen.frame.minY - 4),\n                           width: Int(area.width + 8), height: Int(area.height + 8))\n        window = NSWindow(contentRect: frame, styleMask: [.fullSizeContentView], backing: .buffered, defer: false)\n        window.hasShadow = false\n        window.level = .screenSaver\n        window.ignoresMouseEvents = true\n        window.isReleasedWhenClosed = false\n        window.title = \"Area Overlayer\".local\n        window.backgroundColor = NSColor.clear\n        window.contentView = NSHostingView(rootView: DashWindow())\n        window.orderFront(self)\n        appDelegate.createCountdownPanel(screen: screen) {\n            SCContext.autoStop = autoStop\n            appDelegate.prepRecord(type: \"area\", screens: screen, windows: nil, applications: nil)\n        }\n    }\n}\n\nclass ScreenshotOverlayView: NSView {\n    @AppStorage(\"areaWidth\") private var areaWidth: Int = 600\n    @AppStorage(\"areaHeight\") private var areaHeight: Int = 450\n    \n    var selectionRect: NSRect? {\n        didSet {\n            updateMaskLayer()\n            updateSelectionLayer()\n        }\n    }\n    var initialLocation: NSPoint?\n    var dragIng: Bool = false\n    var activeHandle: ResizeHandle = .none\n    var lastMouseLocation: NSPoint?\n    var maxFrame: NSRect?\n    var size: NSSize\n    var force: Bool\n\n    let controlPointSize: CGFloat = 10.0\n    let controlPointColor: NSColor = NSColor.systemYellow\n\n    private var maskLayer: CAShapeLayer?\n    private var selectionLayer: CAShapeLayer?\n    private var controlPointLayers: [CAShapeLayer] = []\n\n    init(frame: CGRect, size: NSSize, force: Bool) {\n        self.size = size\n        self.force = force\n        super.init(frame: frame)\n        wantsLayer = true\n    }\n\n    required init?(coder: NSCoder) {\n        fatalError(\"init(coder:) has not been implemented\")\n    }\n\n    override func viewDidMoveToWindow() {\n        super.viewDidMoveToWindow()\n        selectionRect = NSRect(x: (self.frame.width - size.width) / 2, y: (self.frame.height - size.height) / 2, width: size.width, height: size.height)\n        if !force {\n            let savedArea = ud.object(forKey: \"savedArea\") as! [String: [String: CGFloat]]\n            if let name = self.window?.screen?.localizedName {\n                if let area = savedArea[name] {\n                    selectionRect = NSRect(x: area[\"x\"]!, y: area[\"y\"]!, width: area[\"width\"]!, height: area[\"height\"]!)\n                }\n            }\n        }\n        if self.window != nil {\n            areaWidth = Int(selectionRect!.width)\n            areaHeight = Int(selectionRect!.height)\n            SCContext.screenArea = selectionRect\n        }\n        updateMaskLayer()\n        updateSelectionLayer()\n        setupControlPoints()\n    }\n\n    override func draw(_ dirtyRect: NSRect) {\n        super.draw(dirtyRect)\n        maxFrame = dirtyRect\n    }\n\n     private func updateMaskLayer() {\n        maskLayer?.removeFromSuperlayer()\n\n        guard let rect = selectionRect else { return }\n         \n         let path = CGMutablePath()\n         path.addRect(bounds)\n         path.addRect(rect)\n\n         let mask = CAShapeLayer()\n         mask.path = path\n         mask.fillRule = .evenOdd\n         mask.fillColor = NSColor.black.withAlphaComponent(0.5).cgColor\n         self.layer?.addSublayer(mask)\n         maskLayer = mask\n     }\n\n\n    private func updateSelectionLayer() {\n        selectionLayer?.removeFromSuperlayer()\n        controlPointLayers.forEach{\n           $0.removeFromSuperlayer()\n        }\n        controlPointLayers.removeAll()\n        \n        guard let rect = selectionRect else { return }\n    \n        let path = CGPath(rect: rect, transform: nil)\n    \n        let shapeLayer = CAShapeLayer()\n        shapeLayer.path = path\n        shapeLayer.fillColor = NSColor.init(white: 1, alpha: 0.01).cgColor\n        shapeLayer.strokeColor = NSColor.white.cgColor\n        shapeLayer.lineWidth = 4.0\n        shapeLayer.lineDashPattern = [4,4]\n    \n        self.layer?.addSublayer(shapeLayer)\n        self.selectionLayer = shapeLayer\n    \n        setupControlPoints()\n    }\n    \n    private func setupControlPoints() {\n      guard let rect = selectionRect else { return }\n        \n      for handle in ResizeHandle.allCases {\n        if let point = controlPointForHandle(handle, inRect: rect) {\n             let controlPointRect = NSRect(origin: point, size: CGSize(width: controlPointSize, height: controlPointSize))\n              let controlPointPath = CGPath(ellipseIn: controlPointRect, transform: nil)\n              \n              let controlLayer = CAShapeLayer()\n              controlLayer.path = controlPointPath\n              controlLayer.fillColor = controlPointColor.cgColor\n            \n             layer?.addSublayer(controlLayer)\n             controlPointLayers.append(controlLayer)\n        }\n      }\n    }\n\n    func handleForPoint(_ point: NSPoint) -> ResizeHandle {\n        guard let rect = selectionRect else { return .none }\n\n        for handle in ResizeHandle.allCases {\n            if let controlPoint = controlPointForHandle(handle, inRect: rect), NSRect(origin: controlPoint, size: CGSize(width: controlPointSize, height: controlPointSize)).contains(point) {\n                return handle\n            }\n        }\n        return .none\n    }\n\n    func controlPointForHandle(_ handle: ResizeHandle, inRect rect: NSRect) -> NSPoint? {\n        switch handle {\n        case .topLeft:\n            return NSPoint(x: rect.minX - controlPointSize / 2 - 1, y: rect.maxY - controlPointSize / 2 + 1)\n        case .top:\n            return NSPoint(x: rect.midX - controlPointSize / 2, y: rect.maxY - controlPointSize / 2 + 1)\n        case .topRight:\n            return NSPoint(x: rect.maxX - controlPointSize / 2 + 1, y: rect.maxY - controlPointSize / 2 + 1)\n        case .right:\n            return NSPoint(x: rect.maxX - controlPointSize / 2 + 1, y: rect.midY - controlPointSize / 2)\n        case .bottomRight:\n            return NSPoint(x: rect.maxX - controlPointSize / 2 + 1, y: rect.minY - controlPointSize / 2 - 1)\n        case .bottom:\n            return NSPoint(x: rect.midX - controlPointSize / 2, y: rect.minY - controlPointSize / 2 - 1)\n        case .bottomLeft:\n            return NSPoint(x: rect.minX - controlPointSize / 2 - 1, y: rect.minY - controlPointSize / 2 - 1)\n        case .left:\n            return NSPoint(x: rect.minX - controlPointSize / 2 - 1, y: rect.midY - controlPointSize / 2)\n        case .none:\n            return nil\n        }\n    }\n\n    override func mouseDown(with event: NSEvent) {\n        let location = convert(event.locationInWindow, from: nil)\n        initialLocation = location\n        lastMouseLocation = location\n        activeHandle = handleForPoint(location)\n        if let rect = selectionRect, NSPointInRect(location, rect) { dragIng = true }\n        AppDelegate.shared.isResizing = true\n    }\n\n    override func mouseDragged(with event: NSEvent) {\n        guard var initialLocation = initialLocation else { return }\n        let currentLocation = convert(event.locationInWindow, from: nil)\n        if activeHandle != .none {\n\n            // Calculate new rectangle size and position\n            var newRect = selectionRect ?? CGRect.zero\n\n            // Get last mouse location\n            let lastLocation = lastMouseLocation ?? currentLocation\n\n            let deltaX = currentLocation.x - lastLocation.x\n            let deltaY = currentLocation.y - lastLocation.y\n\n            switch activeHandle {\n            case .topLeft:\n                newRect.origin.x = min(newRect.origin.x + newRect.size.width - 20, newRect.origin.x + deltaX)\n                newRect.size.width = max(20, newRect.size.width - deltaX)\n                newRect.size.height = max(20, newRect.size.height + deltaY)\n            case .top:\n                newRect.size.height = max(20, newRect.size.height + deltaY)\n            case .topRight:\n                newRect.size.width = max(20, newRect.size.width + deltaX)\n                newRect.size.height = max(20, newRect.size.height + deltaY)\n            case .right:\n                newRect.size.width = max(20, newRect.size.width + deltaX)\n            case .bottomRight:\n                newRect.origin.y = min(newRect.origin.y + newRect.size.height - 20, newRect.origin.y + deltaY)\n                newRect.size.width = max(20, newRect.size.width + deltaX)\n                newRect.size.height = max(20, newRect.size.height - deltaY)\n            case .bottom:\n                newRect.origin.y = min(newRect.origin.y + newRect.size.height - 20, newRect.origin.y + deltaY)\n                newRect.size.height = max(20, newRect.size.height - deltaY)\n            case .bottomLeft:\n                newRect.origin.y = min(newRect.origin.y + newRect.size.height - 20, newRect.origin.y + deltaY)\n                newRect.origin.x = min(newRect.origin.x + newRect.size.width - 20, newRect.origin.x + deltaX)\n                newRect.size.width = max(20, newRect.size.width - deltaX)\n                newRect.size.height = max(20, newRect.size.height - deltaY)\n            case .left:\n                newRect.origin.x = min(newRect.origin.x + newRect.size.width - 20, newRect.origin.x + deltaX)\n                newRect.size.width = max(20, newRect.size.width - deltaX)\n            default:\n                break\n            }\n            self.selectionRect = newRect\n            initialLocation = currentLocation // Update initial location for continuous dragging\n            lastMouseLocation = currentLocation // Update last mouse location\n            areaWidth = Int(selectionRect!.width)\n            areaHeight = Int(selectionRect!.height)\n        } else {\n            if dragIng {\n                dragIng = true\n                // 计算移动偏移量\n                let deltaX = currentLocation.x - initialLocation.x\n                let deltaY = currentLocation.y - initialLocation.y\n\n                // 更新矩形位置\n                let x = self.selectionRect?.origin.x\n                let y = self.selectionRect?.origin.y\n                let w = self.selectionRect?.size.width\n                let h = self.selectionRect?.size.height\n                self.selectionRect?.origin.x = min(max(0.0, x! + deltaX), self.frame.width - w!)\n                self.selectionRect?.origin.y = min(max(0.0, y! + deltaY), self.frame.height - h!)\n                initialLocation = currentLocation\n            } else {\n                //dragIng = false\n                // 创建新矩形\n                guard let maxFrame = maxFrame else { return }\n                let origin = NSPoint(x: max(maxFrame.origin.x, min(initialLocation.x, currentLocation.x)), y: max(maxFrame.origin.y, min(initialLocation.y, currentLocation.y)))\n                var maxH = abs(currentLocation.y - initialLocation.y)\n                var maxW = abs(currentLocation.x - initialLocation.x)\n                if currentLocation.y < maxFrame.origin.y { maxH = initialLocation.y }\n                if currentLocation.x < maxFrame.origin.x { maxW = initialLocation.x }\n                let size = NSSize(width: maxW, height: maxH)\n                self.selectionRect = NSIntersectionRect(maxFrame, NSRect(origin: origin, size: size))\n                areaWidth = Int(selectionRect!.width)\n                areaHeight = Int(selectionRect!.height)\n                //initialLocation = currentLocation\n            }\n            self.initialLocation = initialLocation\n        }\n        lastMouseLocation = currentLocation\n    }\n\n    override func mouseUp(with event: NSEvent) {\n        initialLocation = nil\n        activeHandle = .none\n        dragIng = false\n        AppDelegate.shared.isResizing = false\n        if let rect = selectionRect {\n            SCContext.screenArea = rect\n        }\n    }\n}\n\nclass ScreenshotWindow: NSPanel {\n    \n    init(contentRect: NSRect, backing bufferingType: NSWindow.BackingStoreType, defer flag: Bool, size: NSSize, force: Bool = false) {\n        let overlayView = ScreenshotOverlayView(frame: contentRect, size:size, force: force)\n        super.init(contentRect: contentRect, styleMask: [.borderless, .nonactivatingPanel], backing: bufferingType, defer: flag)\n        self.isOpaque = false\n        self.hasShadow = false\n        self.level = .statusBar\n        self.backgroundColor = NSColor.clear\n        self.collectionBehavior = [.canJoinAllSpaces, .fullScreenAuxiliary]\n        self.isReleasedWhenClosed = false\n        self.contentView = overlayView\n        \n        if keyMonitor != nil { return }\n        keyMonitor = NSEvent.addLocalMonitorForEvents(matching: NSEvent.EventTypeMask.keyDown, handler: myKeyDownEvent)\n    }\n    \n    required init?(coder: NSCoder) {\n        fatalError(\"init(coder:) has not been implemented\")\n    }\n\n    func myKeyDownEvent(event: NSEvent) -> NSEvent? {\n        if event.keyCode == 53 && !event.isARepeat {\n            self.close()\n            for w in NSApp.windows.filter({ $0.title == \"Start Recording\".local }) { w.close() }\n            AppDelegate.shared.stopGlobalMouseMonitor()\n            if let monitor = keyMonitor {\n                NSEvent.removeMonitor(monitor)\n                keyMonitor = nil\n            }\n            return nil\n        }\n        return event\n    }\n}\n\nenum ResizeHandle: CaseIterable {\n    case none\n    case topLeft, top, topRight, right, bottomRight, bottom, bottomLeft, left\n    \n    static var allCases: [ResizeHandle] {\n        return [.none, .topLeft, .top, .topRight, .right, .bottomRight, .bottom, .bottomLeft, .left]\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/CameraOverlayer.swift",
    "content": "//\n//  CameraOverlayer.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/29.\n//\n\nimport SwiftUI\nimport AppKit\nimport Foundation\nimport AVFoundation\n\nextension AppDelegate {\n    func startCameraOverlayer(size: NSSize = NSSize(width: 200, height: 200)){\n        guard let screen = SCContext.getScreenWithMouse() else { return }\n        camWindow.contentView = NSHostingView(rootView: SwiftCameraView(type: .camera))\n        let frame = NSRect(x: (screen.visibleFrame.width-size.width)/2+screen.frame.minX, y: (screen.visibleFrame.height-size.height)/2+screen.frame.minY, width: size.width, height: size.height)\n        camWindow.setFrame(frame, display: true)\n        //camWindow.setFrameOrigin(NSPoint(x: screen.visibleFrame.width/2-100, y: screen.visibleFrame.height/2-100))\n        camWindow.contentView?.wantsLayer = true\n        camWindow.contentView?.layer?.cornerRadius = 5\n        camWindow.contentView?.layer?.masksToBounds = true\n        camWindow.orderFront(self)\n    }\n}\n\nstruct CameraView: NSViewRepresentable {\n    var type: StreamType!\n    func makeNSView(context: Context) -> CameraNSView {\n        let cameraView = CameraNSView(frame: .zero, type: type)\n        return cameraView\n    }\n\n    func updateNSView(_ nsView: CameraNSView, context: Context) {\n        // Update the view\n    }\n}\n\nclass CameraNSView: NSView {\n    let type: StreamType\n    var session = SCContext.captureSession\n    var previewLayer: AVCaptureVideoPreviewLayer? = nil\n    \n    init(frame frameRect: NSRect, type: StreamType) {\n        self.type = type\n        super.init(frame: frameRect)\n        wantsLayer = true\n        setupCaptureSession()\n    }\n        \n    required init?(coder decoder: NSCoder) {\n        // 如果您的类型不是一个可选类型，您可以将其设置为一个默认值\n        self.type = .camera\n        super.init(coder: decoder)\n        wantsLayer = true\n        setupCaptureSession()\n    }\n    \n    private func setupCaptureSession() {\n        if type == .idevice { session = SCContext.previewSession }\n        guard let session = session else { return }\n        previewLayer = AVCaptureVideoPreviewLayer(session: session)\n        previewLayer!.frame = bounds\n        if type == .idevice {\n            previewLayer!.videoGravity = AVLayerVideoGravity.resizeAspect\n        }\n        if type == .camera {\n            previewLayer!.videoGravity = AVLayerVideoGravity.resizeAspectFill\n            previewLayer!.setAffineTransform(CGAffineTransform(scaleX: -1, y: 1))\n        }\n        layer?.addSublayer(previewLayer!)\n    }\n    \n    override func layout() {\n        super.layout()\n        previewLayer?.frame = bounds\n    }\n}\n\nstruct SwiftCameraView: View {\n    var type: StreamType!\n    @State private var hover = false\n    @State private var isFlipped = false\n    \n    var body: some View {\n        GeometryReader { geometry in\n            ZStack {\n                if type == .idevice {\n                    Color.black\n                    Text(\"Please unlock!\")\n                        .foregroundStyle(.white)\n                }\n                ZStack(alignment: Alignment(horizontal: .trailing, vertical: .bottom)) {\n                    CameraView(type: type)\n                        .rotation3DEffect(.degrees(isFlipped ? 180 : 0), axis: (x: 0, y: 1, z: 0))\n                    Button(action: {\n                        if type == .idevice {\n                            for w in NSApp.windows.filter({ $0.title == \"iDevice Overlayer\".local }) { w.close() }\n                        } else {\n                            isFlipped.toggle()\n                        }\n                    }, label: {\n                        ZStack {\n                            Circle().frame(width: 30)\n                                .foregroundStyle(hover ? .blue : .gray)\n                            if type == .idevice {\n                                Image(systemName: \"xmark\")\n                                    .foregroundStyle(.white)\n                            } else {\n                                Image(systemName: \"arrow.left.and.right.righttriangle.left.righttriangle.right.fill\")\n                                    .foregroundStyle(.white)\n                                    .offset(y: -1)\n                            }\n                        }\n                        .opacity(hover ? 0.8 : 0.2)\n                        .onHover{ hovering in hover = hovering }\n                    }).buttonStyle(.plain).padding(10)\n                }.frame(width: geometry.size.width, height: geometry.size.height)\n                if SCContext.streamType == .window {\n                    Text(\"Unable to use camera overlayer when recording a single window!\".local\n                         + (isMacOS14 ? \" Please use \\\"Presenter Overlay\\\"\".local : \"\")\n                    )\n                    .padding()\n                    .colorInvert()\n                    .background(.secondary)\n                }\n            }\n        }\n        .frame(minWidth: 100, minHeight: 100)\n        .onHover { hovering in\n            hideMousePointer = hovering\n            hideScreenMagnifier = hovering\n        }\n    }\n}\n\n\nstruct CameraPopoverView: View {\n    var closePopover: () -> Void\n    @State private var cameras = SCContext.getCameras()\n    @State private var devices = SCContext.getiDevice()\n    @State private var hoverIndex = -1\n    @State private var hoverIndex2 = -1\n    @State private var disabled = false\n    //@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate\n    var appDelegate = AppDelegate.shared\n    \n    var body: some View {\n        VStack( alignment: .leading, spacing: 0) {\n            if cameras.count < 1 {\n                HStack {\n                    ZStack {\n                        Circle().frame(width: 26)\n                            .foregroundStyle(.primary)\n                            .opacity(0.2)\n                        Image(systemName:\"video.slash.fill\")\n                            .foregroundStyle(.primary)\n                            .font(.system(size: 12))\n                    }.padding(.leading, 9)\n                    Text(\"No Cameras Found!\".local)\n                        .padding(.vertical, 8).padding(.trailing, 10)\n                }.frame(maxWidth: .infinity)\n            }\n            ForEach(cameras.indices, id: \\.self) { index in\n                Button(action: {\n                    closePopover()\n                    if SCContext.recordCam == cameras[index].localizedName {\n                        SCContext.recordCam = \"\"\n                        appDelegate.closeCamera()\n                        return\n                    }\n                    SCContext.recordCam = cameras[index].localizedName\n                    appDelegate.closeCamera()\n                    appDelegate.recordingCamera(with: cameras[index])\n                }, label: {\n                    HStack {\n                        ZStack {\n                            Circle().frame(width: 26)\n                                .foregroundStyle(SCContext.recordCam == cameras[index].localizedName ? .blue : .primary)\n                                .opacity(SCContext.recordCam == cameras[index].localizedName ? 1.0 : 0.2)\n                            Image(systemName: \"video.fill\")\n                                .foregroundStyle(SCContext.recordCam == cameras[index].localizedName ? .white : .primary)\n                                .font(.system(size: 12))\n                        }.padding(.leading, 9)\n                        Text(cameras[index].localizedName)\n                            .padding(.vertical, 8).padding(.trailing, 10)\n                        Spacer()\n                    }\n                    .frame(maxWidth: .infinity)\n                    .background(\n                        RoundedRectangle(cornerRadius: 5)\n                            .foregroundStyle(.primary)\n                            .opacity(hoverIndex == index ? 0.2 : 0.0)\n                    )\n                    .onHover{ hovering in\n                        if hoverIndex != index { hoverIndex = index }\n                        if !hovering { hoverIndex = -1 }\n                    }\n                }).buttonStyle(.plain)\n            }\n            if SCContext.streamType != .window {\n                if !devices.isEmpty { Divider().padding(.vertical, 4) }\n                ForEach(devices.indices, id: \\.self) { index in\n                    Button(action: {\n                        closePopover()\n                        if SCContext.recordDevice == devices[index].localizedName {\n                            SCContext.recordDevice = \"\"\n                            AVOutputClass.shared.closePreview()\n                            return\n                        }\n                        SCContext.recordDevice = devices[index].localizedName\n                        AVOutputClass.shared.closePreview()\n                        DispatchQueue.global().async {\n                            AVOutputClass.shared.startRecording(with: devices[index], mute: true, didOutput: false)\n                        }\n                    }, label: {\n                        HStack {\n                            ZStack {\n                                Circle().frame(width: 26)\n                                    .foregroundStyle(SCContext.recordDevice == devices[index].localizedName ? .blue : .primary)\n                                    .opacity(SCContext.recordDevice == devices[index].localizedName ? 1.0 : 0.2)\n                                Image(systemName:\"apple.logo\")\n                                    .foregroundStyle(SCContext.recordDevice == devices[index].localizedName ? .white : .primary)\n                                    .font(.system(size: 12))\n                            }.padding(.leading, 9)\n                            Text(devices[index].localizedName)\n                                .padding(.vertical, 8).padding(.trailing, 10)\n                            Spacer()\n                        }\n                        .frame(maxWidth: .infinity)\n                        .background(\n                            RoundedRectangle(cornerRadius: 5)\n                                .foregroundStyle(.primary)\n                                .opacity(hoverIndex2 == index ? 0.2 : 0.0)\n                        )\n                        .onHover{ hovering in\n                            if hoverIndex2 != index { hoverIndex2 = index }\n                            if !hovering { hoverIndex2 = -1 }\n                        }\n                    }).buttonStyle(.plain)\n                }\n            }\n        }.padding(5)\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/ContentView.swift",
    "content": "//\n//  ContentView.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/16.\n//\n\nimport SwiftUI\nimport AVFoundation\nimport ScreenCaptureKit\n\nstruct ContentView: View {\n    var fromStatusBar = false\n    @State private var window: NSWindow?\n    @State private var xmarkGlowing = false\n    @State private var infoGlowing = false\n    @State private var micGlowing = false\n    @State private var isPopoverShowing = false\n    @State private var isPopoverShowing2 = false\n    @State private var micList = SCContext.getMicrophone()\n    @AppStorage(\"enableAEC\") private var enableAEC: Bool = false\n    @AppStorage(\"recordMic\") private var recordMic: Bool = false\n    @AppStorage(\"micDevice\") private var micDevice: String = \"default\"\n    @AppStorage(\"showOnDock\") private var showOnDock: Bool = true\n    @AppStorage(\"showMenubar\") private var showMenubar: Bool = false\n\n    var appDelegate = AppDelegate.shared\n    \n    var body: some View {\n        ZStack(alignment: Alignment(horizontal: .leading, vertical: .top)) {\n            ZStack {\n                ZStack {\n                    if !fromStatusBar {\n                        Color.clear\n                            .background(.ultraThinMaterial)\n                            .environment(\\.controlActiveState, .active)\n                    }\n                    ZStack {\n                        if isTodayChristmas() && isAllowChristmas() {\n                            let images = [\"snowflake1\", \"snowflake2\", \"snowflake3\", \"christmasTree1\", \"christmasTree2\"]\n                            SurpriseView(snowflakes: images, width: (!showOnDock && !showMenubar) ? 1055 : 930, height: 100)\n                        } else if isChineseNewYear() && isAllowChineseNewYear() {\n                            let images = [\"fuzi1\", \"fuzi2\", \"fuzi3\", \"hongbao1\", \"hongbao3\"]\n                            SurpriseView(snowflakes: images, width: (!showOnDock && !showMenubar) ? 1055 : 930, height: 100)\n                        }\n                    }.opacity(0.5)\n                }.cornerRadius(14)\n                HStack {\n                    if !fromStatusBar { Spacer() }\n                    if #available(macOS 13, *) {\n                        ZStack(alignment: Alignment(horizontal: .center, vertical: .bottom)) {\n                            Button(action: {\n                                if let display = SCContext.getSCDisplayWithMouse() {\n                                    closeMainWindow()\n                                    appDelegate.createCountdownPanel(screen: display) {\n                                        AppDelegate.shared.prepRecord(type: \"audio\", screens: SCContext.getSCDisplayWithMouse(), windows: nil, applications: nil)\n                                    }\n                                }\n                            }, label: {\n                                SelectorView(title: \"System Audio\".local, symbol: \"waveform\").cornerRadius(8)\n                            }).buttonStyle(.plain)\n                            Button {} label: {\n                                HStack(spacing: -2) {\n                                    Button {\n                                        recordMic.toggle()\n                                    } label: {\n                                        ZStack {\n                                            Image(systemName: \"square.fill\")\n                                                .font(.system(size: 15, weight: .medium))\n                                                .foregroundColor(.primary)\n                                                .colorInvert()\n                                                .opacity(0.2)\n                                            Image(systemName: recordMic ? \"checkmark.square\" : \"square\")\n                                                .font(.system(size: 16, weight: .medium))\n                                        }\n                                    }\n                                    .buttonStyle(.plain)\n                                    .onChange(of: recordMic) { _ in  Task { await SCContext.performMicCheck() }}\n                                    .onAppear{ if micList.isEmpty { recordMic = false } }\n                                    .disabled(micList.isEmpty)\n                                    if micDevice != \"default\" && enableAEC && recordMic{\n                                        Button {\n                                            let alert = createAlert(\n                                                title: \"Compatibility Warning\".local,\n                                                message: \"The \\\"Acoustic Echo Cancellation\\\" is enabled, but it won't work on now.\\n\\nIf you need to use a specific input with AEC, set it to \\\"Default\\\" and select the device you want in System Preferences.\\n\\nOr you can start recording without AEC.\".local,\n                                                button1: \"OK\".local, button2: \"System Preferences\".local)\n                                            if alert.runModal() == .alertSecondButtonReturn {\n                                                NSWorkspace.shared.open(URL(string: \"x-apple.systempreferences:com.apple.preference.sound?input\")!)\n                                            }\n                                        } label: {\n                                            ZStack {\n                                                Image(systemName: \"circle.fill\").font(.system(size: 15))\n                                                Image(systemName: \"exclamationmark\")\n                                                    .font(.system(size: 11.5, weight: .black))\n                                                    .foregroundColor(.black)\n                                                    .blendMode(.destinationOut)\n                                            }.compositingGroup()\n                                        }\n                                        .buttonStyle(.plain)\n                                        .frame(width: 24).fixedSize()\n                                        .padding(.leading, 1)\n                                    } else {\n                                        Image(systemName: \"mic.fill\")\n                                            .font(.system(size: 13, weight: .bold))\n                                            .foregroundColor(recordMic ? .primary : .secondary)\n                                            .frame(width: 24)\n                                            .padding(.leading, 1)\n                                    }\n                                    if #available(macOS 14, *) {\n                                        Picker(\"\", selection: $micDevice) {\n                                            Text(\"Default\".local).tag(\"default\")\n                                            ForEach(micList, id: \\.self) { device in\n                                                Text(device.localizedName).tag(device.localizedName)\n                                            }\n                                        }.frame(width: 90)\n                                            .background(\n                                                ZStack {\n                                                    Color.primary\n                                                        .opacity(0.1)\n                                                        .cornerRadius(4)\n                                                        .padding(.vertical, -1)\n                                                        .padding(.horizontal, 3)\n                                                        .padding(.trailing, -16)\n                                                    Image(systemName: \"chevron.up.chevron.down\")\n                                                        .offset(x: 50)\n                                                }\n                                            )\n                                            .disabled(!recordMic)\n                                            .padding(.leading, -10)\n                                            .frame(width: 99)\n                                            .onAppear{\n                                                let list = micList.map({ $0.localizedName })\n                                                if !list.contains(micDevice) { micDevice = \"default\" }\n                                            }\n                                    } else {\n                                        Spacer().frame(width: 6)\n                                        Picker(\"\", selection: $micDevice) {\n                                            Text(\"Default\".local).tag(\"default\")\n                                            ForEach(micList, id: \\.self) { device in\n                                                Text(device.localizedName).tag(device.localizedName)\n                                            }\n                                        }\n                                        .disabled(!recordMic)\n                                        .padding(.leading, -7.5)\n                                        .frame(width: 100)\n                                        .onAppear{\n                                            let list = micList.map({ $0.localizedName })\n                                            if !list.contains(micDevice) { micDevice = \"default\" }\n                                        }\n                                    }\n                                }.padding(.leading, -5)\n                            }.buttonStyle(.plain)\n                            .scaleEffect(0.69)\n                            .padding(.bottom, 4)\n                            .frame(width: 110)\n                            .background(.primary.opacity(0.00001))\n                        }\n                        Divider().frame(height: 70)\n                    }\n                    Button(action: {\n                        closeMainWindow()\n                        appDelegate.createNewWindow(view: ScreenSelector(), title: \"Screen Selector\".local)\n                    }, label: {\n                        SelectorView(title: \"Screen\".local, symbol: \"tv.inset.filled\").cornerRadius(8)\n                    }).buttonStyle(.plain)\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        closeMainWindow()\n                        SCContext.updateAvailableContent {\n                            DispatchQueue.main.async {\n                                appDelegate.showAreaSelector(size: NSSize(width: 600, height: 450))\n                                var currentDisplay = SCContext.getSCDisplayWithMouse()\n                                mouseMonitor = NSEvent.addGlobalMonitorForEvents(matching: [.mouseMoved, .rightMouseDown, .leftMouseDown, .otherMouseDown]) { event in\n                                    let display = SCContext.getSCDisplayWithMouse()\n                                    if display != currentDisplay {\n                                        currentDisplay = display\n                                        closeAllWindow()\n                                        appDelegate.showAreaSelector(size: NSSize(width: 600, height: 450))\n                                    }\n                                }\n                            }\n                        }\n                    }, label: {\n                        SelectorView(title: \"Screen Area\".local, symbol: \"viewfinder\").cornerRadius(8)\n                    }).buttonStyle(.plain)\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        closeMainWindow()\n                        appDelegate.createNewWindow(view: AppSelector(), title: \"App Selector\".local)\n                    }, label: {\n                        SelectorView(title: \"Application\".local, symbol: \"app\", symbolSize: 38, overlayer: \"App\")\n                            .cornerRadius(8)\n                    }).buttonStyle(.plain)\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        closeMainWindow()\n                        appDelegate.createNewWindow(view: WinSelector(), title: \"Window Selector\".local)\n                    }, label: {\n                        SelectorView(title: \"Window\".local, symbol: \"macwindow\").cornerRadius(8)\n                    }).buttonStyle(.plain)\n                    /*Divider().frame(height: 70)\n                    Button(action: {\n                        isPopoverShowing2 = true\n                    }, label: {\n                        SelectorView(title: \"Camera\".local, symbol: \"camera\").cornerRadius(8)\n                    })\n                    .buttonStyle(.plain)\n                    .popover(isPresented: $isPopoverShowing2, arrowEdge: .bottom) {\n                        CameraPopoverView(closePopover: { isPopoverShowing2 = false })\n                    }*/\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        isPopoverShowing = true\n                    }, label: {\n                        SelectorView(title: \"Mobile Device\".local, symbol: \"apps.ipad\").cornerRadius(8)\n                    })\n                    .buttonStyle(.plain)\n                    .popover(isPresented: $isPopoverShowing, arrowEdge: .bottom) {\n                        iDevicePopoverView(closePopover: { isPopoverShowing = false })\n                    }\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        closeMainWindow()\n                        appDelegate.openSettingPanel()\n                    }, label: {\n                        SelectorView(title: \"Preferences\".local, symbol: \"gearshape\").cornerRadius(8)\n                    }).buttonStyle(.plain)\n                    if fromStatusBar || (!showOnDock && !showMenubar) {\n                        Divider().frame(height: 70)\n                        Button(action: {\n                            NSApp.terminate(self)\n                        }, label: {\n                            SelectorView(title: \"Quit\".local, symbol: \"xmark.circle\")\n                                .cornerRadius(8)\n                                .foregroundStyle(.darkMyRed)\n                        }).buttonStyle(.plain)\n                    }\n                    if !fromStatusBar { Spacer() }\n                }.padding(.vertical, 10).padding(.horizontal, fromStatusBar ? 10 : 20)\n            }\n            if !fromStatusBar {\n                Button(action: {\n                    closeMainWindow()\n                }, label: {\n                    Image(systemName: \"x.circle\")\n                        .font(.system(size: 13, weight: .bold))\n                        .opacity(xmarkGlowing ? 1.0 : 0.4)\n                        .foregroundStyle(.secondary)\n                        .onHover{ hovering in xmarkGlowing = hovering }\n                })\n                .buttonStyle(.plain)\n                .padding([.horizontal, .top], 7)\n            }\n        }.focusable(false)\n    }\n}\n\nstruct SelectorView: View {\n    var title = \"No Title\".local\n    var symbol = \"app\"\n    var symbolSize: CGFloat = 36\n    var overlayer = \"\"\n    @State private var backgroundOpacity = 0.0001\n    \n    var body: some View {\n        VStack(spacing: 6) {\n            Text(title)\n                .opacity(0.95)\n                .font(.system(size: 12))\n                .offset(y: title == \"System Audio\".local ? -3.5 : 0)\n            ZStack {\n                if title == \"System Audio\".local {\n                    Image(systemName: symbol)\n                        .opacity(0.95)\n                        .offset(y: -9.5)\n                        .font(.system(size: 26, weight: .bold))\n                } else {\n                    Image(systemName: symbol)\n                        .opacity(0.95)\n                        .font(.system(size: symbolSize))\n                        .frame(height: 40)\n                }\n                Text(overlayer)\n                    .fontWeight(.bold)\n                    .opacity(0.95)\n                    .font(.system(size: 11))\n            }\n        }\n        .frame(width: 110, height: 80)\n        .onHover{ hovering in\n            backgroundOpacity = hovering ? 0.2 : 0.0001\n        }\n        .background( .primary.opacity(backgroundOpacity) )\n    }\n}\n\nstruct CountdownView: View {\n    @State var countdownValue: Int = 00\n    @State private var timer: Timer?\n    var atEnd: () -> Void\n\n    var body: some View {\n        ZStack {\n            Color.mypurple.environment(\\.colorScheme, .dark)\n            Text(\"\\(countdownValue)\")\n                .font(.system(size: 72))\n                .foregroundColor(.white)\n                .offset(y: -10)\n            Button(action: {\n                timer?.invalidate()\n                for w in NSApp.windows.filter({\n                    $0.title == \"Countdown Panel\".local ||\n                    $0.title == \"Area Overlayer\".local\n                }) { w.close() }\n            }, label: {\n                ZStack {\n                    Color.white.opacity(0.2)\n                    Text(\"Cancel\").foregroundColor(.white)\n                }.frame(width: 120, height: 24)\n            })\n            .buttonStyle(.plain)\n            .padding(.top, 96)\n        }\n        .frame(width: 120, height: 120)\n        .cornerRadius(10)\n        .onAppear{\n            timer?.invalidate()\n            timer = Timer.scheduledTimer(withTimeInterval: 1.0, repeats: true) { timer in\n                if countdownValue > 1 {\n                    countdownValue -= 1\n                } else {\n                    timer.invalidate()\n                    if let w = NSApp.windows.first(where: { $0.title == \"Countdown Panel\".local }) { w.close() }\n                    atEnd()\n                }\n            }\n        }\n    }\n}\n\n\nextension AppDelegate {\n    func showAreaSelector(size: NSSize, noPanel: Bool = false) {\n        guard let scDisplay = SCContext.getSCDisplayWithMouse() else { return }\n        guard let screen = scDisplay.nsScreen else { return }\n        let screenshotWindow = ScreenshotWindow(contentRect: screen.frame, backing: .buffered, defer: false, size: size, force: noPanel)\n        screenshotWindow.title = \"Area Selector\".local\n        //screenshotWindow.orderFront(self)\n        screenshotWindow.orderFrontRegardless()\n        if !noPanel {\n            let wX = (screen.frame.width - 790) / 2 + screen.frame.minX\n            let wY = screen.visibleFrame.minY + 80\n            let contentView = NSHostingView(rootView: AreaSelector(screen: scDisplay))\n            contentView.frame = NSRect(x: wX, y: wY, width: 790, height: 90)\n            contentView.focusRingType = .none\n            let areaPanel = NSPanel(contentRect: contentView.frame, styleMask: [.fullSizeContentView, .nonactivatingPanel], backing: .buffered, defer: false)\n            areaPanel.collectionBehavior = [.canJoinAllSpaces]\n            areaPanel.setFrame(contentView.frame, display: true)\n            areaPanel.level = .screenSaver\n            areaPanel.title = \"Start Recording\".local\n            areaPanel.contentView = contentView\n            areaPanel.backgroundColor = .clear\n            areaPanel.titleVisibility = .hidden\n            areaPanel.isReleasedWhenClosed = false\n            areaPanel.titlebarAppearsTransparent = true\n            areaPanel.isMovableByWindowBackground = true\n            //areaPanel.setFrameOrigin(NSPoint(x: wX, y: wY))\n            areaPanel.orderFront(self)\n        }\n    }\n    \n    func createCountdownPanel(screen: SCDisplay, action: @escaping () -> Void) {\n        guard let screen = screen.nsScreen else { return }\n        let countdown = ud.integer(forKey: \"countdown\")\n        if countdown == 0 {\n            action()\n        } else {\n            let wX = (screen.frame.width - 120) / 2 + screen.frame.minX\n            let wY = (screen.frame.height - 120) / 2 + screen.frame.minY\n            let frame =  NSRect(x: wX, y: wY, width: 120, height: 120)\n            let contentView = NSHostingView(rootView: CountdownView(countdownValue: countdown, atEnd: action))\n            contentView.frame = frame\n            countdownPanel.contentView = contentView\n            countdownPanel.setFrame(frame, display: true)\n            countdownPanel.makeKeyAndOrderFront(self)\n        }\n    }\n    \n    func createNewWindow(view: some View, title: String, random: Bool = false, only: Bool = true) {\n        guard let screen = SCContext.getScreenWithMouse() else { return }\n        if only { closeAllWindow() }\n        var seed = 0.0\n        if random { seed = CGFloat(Int(arc4random_uniform(401)) - 200) }\n        let wX = (screen.frame.width - 780) / 2 + seed + screen.frame.minX\n        let wY = (screen.frame.height - 555) / 2 + 100 + seed + screen.frame.minY\n        let contentView = NSHostingView(rootView: view)\n        contentView.frame = NSRect(x: wX, y: wY, width: 780, height: 555)\n        let window = NSWindow(contentRect: contentView.frame, styleMask: [.titled, .closable, .miniaturizable], backing: .buffered, defer: false)\n        window.title = title\n        window.contentView = contentView\n        window.titleVisibility = .hidden\n        window.titlebarAppearsTransparent = true\n        window.isMovableByWindowBackground = true\n        window.isReleasedWhenClosed = false\n        window.makeKeyAndOrderFront(self)\n        window.orderFrontRegardless()\n    }\n}\n\nextension View {\n    func needScale() -> some View {\n        if #available(macOS 14, *) {\n            return self.scaleEffect(0.8).padding(.leading, -4)\n        } else {\n            return self\n        }\n    }\n}\n\n\n/*#Preview {\n    ContentView()\n}\n*/\n"
  },
  {
    "path": "QuickRecorder/ViewModel/ContentViewNew.swift",
    "content": "//\n//  ContentView.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/16.\n//\n\nimport SwiftUI\nimport AVFoundation\nimport ScreenCaptureKit\n\nstruct ContentViewNew: View {\n    @State private var window: NSWindow?\n    @State private var xmarkGlowing = false\n    @State private var infoGlowing = false\n    @State private var micGlowing = false\n    @State private var isPopoverShowing = false\n    @State private var micList = SCContext.getMicrophone()\n    @AppStorage(\"enableAEC\") private var enableAEC: Bool = false\n    @AppStorage(\"recordMic\") private var recordMic: Bool = false\n    @AppStorage(\"micDevice\") private var micDevice: String = \"default\"\n    @AppStorage(\"showOnDock\") private var showOnDock: Bool = true\n    @AppStorage(\"showMenubar\") private var showMenubar: Bool = false\n\n    var appDelegate = AppDelegate.shared\n    \n    var body: some View {\n        ZStack {\n            ZStack {\n                if isTodayChristmas() && isAllowChristmas() {\n                    let images = [\"snowflake1\", \"snowflake2\", \"snowflake3\", \"christmasTree1\", \"christmasTree2\"]\n                    SurpriseView(snowflakes: images, width: 520, height: 200, velocity: 16, lifetime: 30, alphaSpeed: -0.05)\n                } else if isChineseNewYear() && isAllowChineseNewYear() {\n                    let images = [\"fuzi1\", \"fuzi2\", \"fuzi3\", \"hongbao1\", \"hongbao2\", \"hongbao3\", \"bianpao1\", \"bianpao2\", \"bianpao3\"]\n                    SurpriseView(snowflakes: images, width: 520, height: 200, velocity: 16, lifetime: 30, alphaSpeed: -0.05)\n                }\n            }.opacity(0.5)\n            VStack {\n                HStack {\n                    Button(action: {\n                        closeMainWindow()\n                        appDelegate.createNewWindow(view: ScreenSelector(), title: \"Screen Selector\".local)\n                    }, label: {\n                        SelectorView(title: \"Screen\".local, symbol: \"tv.inset.filled\").cornerRadius(8)\n                    }).buttonStyle(.plain)\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        closeMainWindow()\n                        SCContext.updateAvailableContent {\n                            DispatchQueue.main.async {\n                                appDelegate.showAreaSelector(size: NSSize(width: 600, height: 450))\n                                var currentDisplay = SCContext.getSCDisplayWithMouse()\n                                mouseMonitor = NSEvent.addGlobalMonitorForEvents(matching: [.mouseMoved, .rightMouseDown, .leftMouseDown, .otherMouseDown]) { event in\n                                    let display = SCContext.getSCDisplayWithMouse()\n                                    if display != currentDisplay {\n                                        currentDisplay = display\n                                        closeAllWindow()\n                                        appDelegate.showAreaSelector(size: NSSize(width: 600, height: 450))\n                                    }\n                                }\n                            }\n                        }\n                    }, label: {\n                        SelectorView(title: \"Screen Area\".local, symbol: \"viewfinder\").cornerRadius(8)\n                    }).buttonStyle(.plain)\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        closeMainWindow()\n                        appDelegate.createNewWindow(view: AppSelector(), title: \"App Selector\".local)\n                    }, label: {\n                        SelectorView(title: \"Application\".local, symbol: \"app\", overlayer: \"App\")\n                            .cornerRadius(8)\n                    }).buttonStyle(.plain)\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        closeMainWindow()\n                        appDelegate.createNewWindow(view: WinSelector(), title: \"Window Selector\".local)\n                    }, label: {\n                        SelectorView(title: \"Window\".local, symbol: \"macwindow\").cornerRadius(8)\n                    }).buttonStyle(.plain)\n                }\n                HStack(spacing: 27) {\n                    VStack { Divider().frame(width: 100) }\n                    VStack { Divider().frame(width: 100) }\n                    VStack { Divider().frame(width: 100) }\n                    VStack { Divider().frame(width: 100) }\n                }\n                HStack {\n                    ZStack(alignment: Alignment(horizontal: .center, vertical: .bottom)) {\n                        Button(action: {\n                            if let display = SCContext.getSCDisplayWithMouse() {\n                                closeMainWindow()\n                                appDelegate.createCountdownPanel(screen: display) {\n                                    AppDelegate.shared.prepRecord(type: \"audio\", screens: SCContext.getSCDisplayWithMouse(), windows: nil, applications: nil)\n                                }\n                            }\n                        }, label: {\n                            SelectorView(title: \"System Audio\".local, symbol: \"waveform\").cornerRadius(8)\n                        }).buttonStyle(.plain)\n                        Button {} label: {\n                            HStack(spacing: -2) {\n                                Button {\n                                    recordMic.toggle()\n                                } label: {\n                                    ZStack {\n                                        Image(systemName: \"square.fill\")\n                                            .font(.system(size: 15, weight: .medium))\n                                            .foregroundColor(.primary)\n                                            .colorInvert()\n                                            .opacity(0.2)\n                                        Image(systemName: recordMic ? \"checkmark.square\" : \"square\")\n                                            .font(.system(size: 16, weight: .medium))\n                                    }\n                                }\n                                .buttonStyle(.plain)\n                                .onChange(of: recordMic) { _ in  Task { await SCContext.performMicCheck() }}\n                                if micDevice != \"default\" && enableAEC && recordMic{\n                                    Button {\n                                        let alert = createAlert(\n                                            title: \"Compatibility Warning\".local,\n                                            message: \"The \\\"Acoustic Echo Cancellation\\\" is enabled, but it won't work on now.\\n\\nIf you need to use a specific input with AEC, set it to \\\"Default\\\" and select the device you want in System Preferences.\\n\\nOr you can start recording without AEC.\".local,\n                                            button1: \"OK\".local, button2: \"System Preferences\".local)\n                                        if alert.runModal() == .alertSecondButtonReturn {\n                                            NSWorkspace.shared.open(URL(string: \"x-apple.systempreferences:com.apple.preference.sound?input\")!)\n                                        }\n                                    } label: {\n                                        ZStack {\n                                            Image(systemName: \"circle.fill\").font(.system(size: 15))\n                                            Image(systemName: \"exclamationmark\")\n                                                .font(.system(size: 11.5, weight: .black))\n                                                .foregroundColor(.black)\n                                                .blendMode(.destinationOut)\n                                        }.compositingGroup()\n                                    }\n                                    .buttonStyle(.plain)\n                                    .frame(width: 24).fixedSize()\n                                    .padding(.leading, 1)\n                                } else {\n                                    Image(systemName: \"mic.fill\")\n                                        .font(.system(size: 13, weight: .bold))\n                                        .foregroundColor(recordMic ? .primary : .secondary)\n                                        .frame(width: 24)\n                                        .padding(.leading, 1)\n                                }\n                                if #available(macOS 14, *) {\n                                    Picker(\"\", selection: $micDevice) {\n                                        Text(\"Default\".local).tag(\"default\")\n                                        ForEach(micList, id: \\.self) { device in\n                                            Text(device.localizedName).tag(device.localizedName)\n                                        }\n                                    }.frame(width: 90)\n                                        .background(\n                                            ZStack {\n                                                Color.primary\n                                                    .opacity(0.1)\n                                                    .cornerRadius(4)\n                                                    .padding(.vertical, -1)\n                                                    .padding(.horizontal, 3)\n                                                    .padding(.trailing, -16)\n                                                Image(systemName: \"chevron.up.chevron.down\")\n                                                    .offset(x: 50)\n                                            }\n                                        )\n                                        .disabled(!recordMic)\n                                        .padding(.leading, -10)\n                                        .frame(width: 99)\n                                        .onAppear{\n                                            let list = micList.map({ $0.localizedName })\n                                            if !list.contains(micDevice) { micDevice = \"default\" }\n                                        }\n                                } else {\n                                    Spacer().frame(width: 6)\n                                    Picker(\"\", selection: $micDevice) {\n                                        Text(\"Default\".local).tag(\"default\")\n                                        ForEach(micList, id: \\.self) { device in\n                                            Text(device.localizedName).tag(device.localizedName)\n                                        }\n                                    }\n                                    .disabled(!recordMic)\n                                    .padding(.leading, -7.5)\n                                    .frame(width: 100)\n                                    .onAppear{\n                                        let list = micList.map({ $0.localizedName })\n                                        if !list.contains(micDevice) { micDevice = \"default\" }\n                                    }\n                                }\n                            }.padding(.leading, -5)\n                        }\n                        .buttonStyle(.plain)\n                        .scaleEffect(0.69)\n                        .padding(.bottom, 4)\n                        .frame(width: 110)\n                        .background(.primary.opacity(0.00001))\n                    }.frame(height: 80)\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        isPopoverShowing = true\n                    }, label: {\n                        SelectorView(title: \"Mobile Device\".local, symbol: \"apps.ipad\").cornerRadius(8)\n                    }).buttonStyle(.plain)\n                        .popover(isPresented: $isPopoverShowing, arrowEdge: .bottom) {\n                            iDevicePopoverView(closePopover: { isPopoverShowing = false })\n                        }\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        closeMainWindow()\n                        appDelegate.openSettingPanel()\n                    }, label: {\n                        SelectorView(title: \"Preferences\".local, symbol: \"gearshape\").cornerRadius(8)\n                    }).buttonStyle(.plain)\n                    Divider().frame(height: 70)\n                    Button(action: {\n                        NSApp.terminate(self)\n                    }, label: {\n                        SelectorView(title: \"Quit\".local, symbol: \"xmark.circle\")\n                            .cornerRadius(8)\n                            .foregroundStyle(.darkMyRed)\n                    }).buttonStyle(.plain)\n                }\n            }.padding(10)\n        }\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/MousePointer.swift",
    "content": "//\n//  MousePointer.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/21.\n//\nimport SwiftUI\nimport Foundation\nimport Cocoa\n\nstruct MousePointerView: View {\n    @AppStorage(\"showMouse\") private var showMouse: Bool = true\n    var event: NSEvent!\n    \n    var body: some View {\n        ZStack {\n            Circle()\n                .fill(.clear)\n                .overlay(\n                    ZStack {\n                        Circle()\n                            .stroke(style: StrokeStyle(lineWidth: 4))\n                            .foregroundColor(getStrokeColor(event).opacity(0.3))\n                            .padding(4)\n                        Circle()\n                            .stroke(style: StrokeStyle(lineWidth: 4))\n                            .foregroundColor(getColor(event).opacity(getOpacity(event)))\n                            .padding(8)\n                        Circle()\n                            .stroke(style: StrokeStyle(lineWidth: 1))\n                            .foregroundColor(.gray)\n                            .opacity([.rightMouseDown, .rightMouseDragged, .leftMouseDown, .leftMouseDragged, .otherMouseDown, .otherMouseDragged].contains(event.type) ? 0.3 : 0.0)\n                            .padding(10)\n                    }\n                )\n            if !showMouse {\n                Circle()\n                    .fill(getColor(event).opacity(getOpacity(event)))\n                    .frame(width: 8, height: 8)\n            }\n        }\n    }\n    \n    func getOpacity(_ event: NSEvent) -> Double {\n        switch event.type {\n        case .rightMouseDown, .rightMouseDragged, .leftMouseDown, .leftMouseDragged, .otherMouseDown, .otherMouseDragged:\n            return 0.8\n        default:\n            return 0.3\n        }\n    }\n    \n    func getColor(_ event: NSEvent) -> Color {\n        switch event.type {\n        case .rightMouseDown, .rightMouseDragged:\n            return .purple\n        case .leftMouseDown, .leftMouseDragged:\n            return .blue\n        case .otherMouseDown, .otherMouseDragged:\n            return .orange\n        default:\n            return .gray\n        }\n    }\n    \n    func getStrokeColor(_ event: NSEvent) -> Color {\n        switch event.type {\n        case .leftMouseUp, .rightMouseUp, .otherMouseUp, .mouseMoved:\n            return .black\n        default:\n            return .clear\n        }\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/PreviewView.swift",
    "content": "//\n//  PreviewView.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/12/10.\n//\n\nimport SwiftUI\nimport Combine\n\nstruct PreviewView: View {\n    let frame: NSImage\n    let filePath: String\n    private let sharingDelegate = SharingServicePickerDelegate()\n    @State private var isHovered: Bool = false\n    @State private var isHovered2: Bool = false\n    @State private var isSharing: Bool = false\n    @State private var nsWindow: NSWindow?\n    @State private var opacity: Double = 0.0\n    @AppStorage(\"trimAfterRecord\")  private var trimAfterRecord: Bool = false\n    \n    var body: some View {\n        ZStack(alignment: Alignment(horizontal: .leading, vertical: .top)) {\n            ZStack {\n                Color.clear\n                    .background(.ultraThickMaterial)\n                    .environment(\\.controlActiveState, .active)\n                    .cornerRadius(6)\n                ZStack {\n                    Image(nsImage: frame)\n                        .resizable().scaledToFit()\n                        .shadow(color: .black.opacity(0.2), radius: 3, y: 1.5)\n                    if isHovered2 {\n                        Button(action: {\n                            if fd.fileExists(atPath: filePath) {\n                                NSWorkspace.shared.open(filePath.url)\n                                closeWindow()\n                            }\n                        }, label: {\n                            ZStack {\n                                Image(systemName: \"circle.fill\")\n                                    .font(.system(size: 49))\n                                    .foregroundStyle(.black)\n                                    .opacity(0.5)\n                                Image(systemName: \"play.circle\")\n                                    .font(.system(size: 50))\n                                    .foregroundStyle(.white)\n                                    .shadow(radius: 4)\n                            }\n                        }).buttonStyle(.plain)\n                    }\n                }\n                .onHover(perform: { isHovered2 = $0 })\n                .padding(8)\n            }\n            if isHovered {\n                HoverButton(color: .buttonRed, secondaryColor: .buttonRedDark,\n                            action: { closeWindow() }, label: {\n                    ZStack {\n                        Image(systemName: \"circle.fill\")\n                            .font(.title)\n                            .foregroundStyle(.white)\n                        Image(systemName: \"circle.fill\")\n                            .font(.title2)\n                        Image(systemName: \"xmark\")\n                            .font(.system(size: 10, weight: .black))\n                            .foregroundStyle(.white)\n                    }\n                }).padding(4)\n            }\n        }\n        .opacity(opacity)\n        .onHover(perform: { isHovered = $0 })\n        .background(WindowAccessor(onWindowOpen: { w in nsWindow = w }))\n        .onAppear {\n            withAnimation(.easeIn(duration: 0.3)) { opacity = 1.0 }\n            DispatchQueue.main.asyncAfter(deadline: .now() + 6) {\n                if !isHovered && !isSharing { closeWindow() }\n            }\n        }\n        .onChange(of: isHovered) { newValue in\n            if !newValue {\n                DispatchQueue.main.asyncAfter(deadline: .now() + 6) {\n                    if !isHovered && !isSharing { closeWindow() }\n                }\n            }\n        }\n        .contextMenu {\n            Button(\"Show in Finder\") {\n                if fd.fileExists(atPath: filePath) {\n                    NSWorkspace.shared.activateFileViewerSelecting([filePath.url])\n                }\n                closeWindow()\n            }\n            Button(\"Delete\") {\n                do {\n                    try fd.removeItem(atPath: filePath)\n                } catch {\n                    print(\"Failed to delete file: \\(error.localizedDescription)\")\n                }\n                closeWindow()\n            }\n            Divider()\n            Button(\"Copy\") {\n                if fd.fileExists(atPath: filePath) {\n                    let pasteboard = NSPasteboard.general\n                    pasteboard.clearContents()\n                    pasteboard.writeObjects([filePath.url as NSURL])\n                }\n                closeWindow()\n            }\n            Button(\"共享...\") { showSharingServicePicker(for: filePath.url) }\n            Divider()\n            if !trimAfterRecord {\n                Button(\"Trim\") {\n                    if fd.fileExists(atPath: filePath) {\n                        AppDelegate.shared.createNewWindow(view: VideoTrimmerView(videoURL: filePath.url), title: filePath.lastPathComponent, only: false)\n                    }\n                    closeWindow()\n                }\n            }\n            if #available(macOS 13, *) {\n                if [\"mp4\", \"mov\"].contains(filePath.pathExtension) {\n                    Button(\"Make GIF\") {\n                        if isAppInstalled(id: \"com.sindresorhus.Gifski\") {\n                            makeGif()\n                            closeWindow()\n                        } else {\n                            let alert = createAlert(title: \"Gifski not found\",\n                                                    message: \"Please install \\\"Gifski\\\" first to make GIF!\",\n                                                    button1: \"Open App Store\", button2: \"Cancel\").runModal()\n                            if alert == .alertFirstButtonReturn { openURL(\"https://apps.apple.com/app/id1351639930\") }\n                        }\n                    }\n                    Divider()\n                }\n            }\n            Button(\"Close\") { closeWindow() }\n        }\n    }\n    \n    func openURL(_ urlString: String) {\n        if let url = URL(string: urlString) {\n            NSWorkspace.shared.open(url)\n        }\n    }\n    \n    private func closeWindow() {\n        withAnimation(.easeIn(duration: 0.2)) { opacity = 0.0 }\n        DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {\n            nsWindow?.close()\n        }\n    }\n    \n    private func isAppInstalled(id: String) -> Bool {\n        return NSWorkspace.shared.urlForApplication(withBundleIdentifier: id) != nil\n    }\n    \n    private func makeGif() {\n        let task = Process()\n        task.arguments = [\"-b\", \"com.sindresorhus.Gifski\", filePath]\n        task.launchPath = \"/usr/bin/open\"\n        task.launch()\n    }\n    \n    private func showSharingServicePicker(for url: URL) {\n        if let window = nsWindow {\n            isSharing = true\n            sharingDelegate.onDidChooseService = { service in\n                isSharing = false\n                if service != nil {\n                    DispatchQueue.main.async { closeWindow() }\n                } else {\n                    DispatchQueue.main.asyncAfter(deadline: .now() + 6) {\n                        if !isHovered && !isSharing { closeWindow() }\n                    }\n                }\n            }\n            let sharingPicker = NSSharingServicePicker(items: [url])\n            sharingPicker.delegate = sharingDelegate\n            sharingPicker.show(relativeTo: .zero, of: window.contentView!, preferredEdge: .minY)\n        }\n    }\n}\n\n// 自定义 NSSharingServicePickerDelegate\nclass SharingServicePickerDelegate: NSObject, NSSharingServicePickerDelegate {\n    var onDidChooseService: ((NSSharingService?) -> Void)?\n    \n    func sharingServicePicker(_ sharingServicePicker: NSSharingServicePicker, didChoose service: NSSharingService?) {\n        onDidChooseService?(service)\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/QmaPlayer.swift",
    "content": "//\n//  qmaPlayer.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/6/28.\n//\n\nimport Foundation\nimport AVFoundation\nimport SwiftUI\n\nstruct qmaPlayerView: View {\n    @Binding var document: qmaPackageHandle\n    @State var fileURL: URL\n    @State private var overPlay: Bool = false\n    @State private var overStop: Bool = false\n    @State private var overSave: Bool = false\n    @State private var overExport: Bool = false\n    @StateObject private var audioPlayerManager = AudioPlayerManager()\n    \n    var body: some View {\n        ZStack(alignment: .top) {\n            VisualEffectView().ignoresSafeArea()\n            VStack(spacing: 3) {\n                Button {} label: {\n                    PlayerSlider(percentage: $audioPlayerManager.progress, audioLength: $audioPlayerManager.audioLength){ editing in\n                        if !editing {\n                            let newTime = audioPlayerManager.progress * audioPlayerManager.getPlayerDuration()\n                            audioPlayerManager.seek(to: newTime)\n                            audioPlayerManager.shouldPlay = false\n                        } else {\n                            if audioPlayerManager.isPlaying {\n                                audioPlayerManager.pause()\n                                audioPlayerManager.shouldPlay = true\n                            }\n                        }\n                    }.frame(height: 30)\n                }\n                .buttonStyle(.plain)\n                .disabled(audioPlayerManager.exporting)\n                \n                HStack(spacing: 4) {\n                    Rectangle().opacity(0.00001).frame(width: 30)\n                    Spacer()\n                    Button {\n                        audioPlayerManager.stop()\n                    } label: {\n                        ZStack {\n                            Rectangle()\n                                .cornerRadius(6)\n                                .foregroundColor(.secondary.opacity(overStop ? 0.1 : 0.00001))\n                            Image(systemName: \"stop.fill\")\n                                .font(.system(size: 20))\n                        }\n                    }\n                    .buttonStyle(.plain)\n                    .help(\"Stop Play\")\n                    .frame(width: 30, height: 30)\n                    .disabled(audioPlayerManager.exporting)\n                    .onHover { hovering in overStop = hovering }\n                    \n                    Button {\n                        if audioPlayerManager.isPlaying {\n                            audioPlayerManager.pause()\n                        } else {\n                            audioPlayerManager.play()\n                        }\n                    } label: {\n                        ZStack {\n                            Rectangle()\n                                .cornerRadius(6)\n                                .foregroundColor(.secondary.opacity(overPlay ? 0.1 : 0.00001))\n                            Image(systemName: audioPlayerManager.isPlaying ? \"pause.fill\" : \"play.fill\")\n                                .font(.system(size: 30))\n                        }\n                    }\n                    .buttonStyle(.plain)\n                    .help(\"Play / Pause\")\n                    .frame(width: 35, height: 35)\n                    .padding(.leading, 2)\n                    .disabled(audioPlayerManager.exporting)\n                    .onHover { hovering in overPlay = hovering }\n                    \n                    Button {\n                        saveQMA()\n                    } label: {\n                        ZStack {\n                            Rectangle()\n                                .cornerRadius(6)\n                                .foregroundColor(.secondary.opacity(overSave ? 0.1 : 0.00001))\n                            Image(\"save\")\n                                .resizable()\n                                .scaledToFit()\n                                .frame(width: 16.5)\n                                .foregroundColor(.primary)\n                        }\n                    }\n                    .buttonStyle(.plain)\n                    .help(\"Save Changes\")\n                    .frame(width: 30, height: 30)\n                    .disabled(audioPlayerManager.exporting)\n                    .onHover { hovering in overSave = hovering }\n                    \n                    Spacer()\n                    \n                    Button {\n                        saveQMA()\n                        audioPlayerManager.export()\n                    } label: {\n                        ZStack {\n                            Rectangle()\n                                .cornerRadius(6)\n                                .foregroundColor(.secondary.opacity(overExport ? 0.1 : 0.00001))\n                            if audioPlayerManager.exporting {\n                                ActivityIndicator()\n                            } else {\n                                Image(systemName: \"square.and.arrow.up\")\n                                    .font(.system(size: 18))\n                                    .foregroundColor(.secondary)\n                                    .offset(y: -2)\n                            }\n                        }\n                    }\n                    .buttonStyle(.plain)\n                    .help(\"Export\")\n                    .frame(width: 30, height: 30)\n                    .disabled(audioPlayerManager.exporting)\n                    .onHover { hovering in overExport = hovering }\n                }\n                \n                Button {} label: {\n                    HStack(spacing: 14) {\n                        HStack(spacing: 2) {\n                            Image(systemName: \"speaker.wave.2.fill\")\n                            Text(\"\\(Int(audioPlayerManager.sysVol * 100))%\").foregroundColor(.secondary).frame(width: 40)\n                            VolumeSlider(percentage: $audioPlayerManager.sysVol, maxValue: 4){ editing in }\n                                .frame(height: 16)\n                                .disabled(audioPlayerManager.exporting)\n                        }\n                        HStack(spacing: 2) {\n                            Image(systemName: \"mic.fill\")\n                            Text(\"\\(Int(audioPlayerManager.micVol * 100))%\").foregroundColor(.secondary).frame(width: 40)\n                            VolumeSlider(percentage: $audioPlayerManager.micVol, maxValue: 4){ editing in }\n                                .frame(height: 16)\n                                .disabled(audioPlayerManager.exporting)\n                        }\n                    }\n                }.buttonStyle(.plain)\n            }.padding().padding(.top, -14)\n        }\n        .onAppear {\n            audioPlayerManager.loadAudioFiles(format: document.info.format, package: fileURL, encoder: document.info.encoder, saveMP3: document.info.exportMP3)\n                audioPlayerManager.sysVol = document.info.sysVol\n                audioPlayerManager.micVol = document.info.micVol\n        }\n        .background(WindowAccessor(onWindowOpen: { w in\n            guard let w = w else { return }\n            w.setContentSize(CGSize(width: 400, height: 100))\n            w.isMovableByWindowBackground = true\n            w.titlebarAppearsTransparent = true\n        }, onWindowActive: { w in\n            DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { w?.titlebarAppearsTransparent = true }\n        }, onWindowDeactivate: { w in\n            DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { w?.titlebarAppearsTransparent = true }\n        }, onWindowClose: { audioPlayerManager.reset() }))\n    }\n    \n    func saveQMA() {\n        var save = 0\n        if document.info.sysVol != audioPlayerManager.sysVol {\n            document.info.sysVol = audioPlayerManager.sysVol\n            save += 1\n        }\n        if document.info.micVol != audioPlayerManager.micVol {\n            document.info.micVol = audioPlayerManager.micVol\n            save += 1\n        }\n        if save != 0 {\n            NSApp.sendAction(#selector(NSDocument.save(_:)), to: nil, from: nil)\n        }\n    }\n}\n\nstruct VisualEffectView: NSViewRepresentable {\n    func makeNSView(context: Context) -> NSVisualEffectView {\n        let effectView = NSVisualEffectView()\n        effectView.state = .active\n        return effectView\n    }\n\n    func updateNSView(_ nsView: NSVisualEffectView, context: Context) {\n    }\n}\n\nstruct VolumeSlider: View {\n    @Binding var percentage: Float\n    @State var maxValue: Float = 1.0\n    @State private var isDragging = false\n    @State private var isHover = false\n\n    var onEditingChanged: (Bool) -> Void // Callback for editing changes\n\n    var body: some View {\n        GeometryReader { geometry in\n            ZStack(alignment: .leading) {\n                Group {\n                    Rectangle()\n                        .foregroundColor(.secondary.opacity(0.2))\n                    Rectangle()\n                        .foregroundColor(.accentColor)\n                        .frame(width: geometry.size.width * CGFloat(min(1.0, self.percentage / maxValue)))\n                }.frame(height: 5).cornerRadius(12)\n                Circle()\n                    .shadow(radius: 1)\n                    .foregroundColor(.white)\n                    .opacity(isHover || isDragging ? 1.0 : 0.00001)\n                    .frame(width: 16, height: 16)\n                    .offset(x: geometry.size.width * CGFloat(min(1.0, self.percentage / maxValue)) - 8)\n            }.onHover { hovering in isHover = hovering }\n                .compositingGroup()\n                .gesture(DragGesture(minimumDistance: 0)\n                    .onChanged { value in\n                        self.percentage = min(max(0, Float(value.location.x / geometry.size.width) * maxValue), maxValue)\n                        self.isDragging = true // Indicate dragging\n                        self.onEditingChanged(true) // Notify that editing started\n                    }\n                    .onEnded { value in\n                        // Update the bound percentage value when dragging ends\n                        self.percentage = min(max(0, Float(value.location.x / geometry.size.width) * maxValue), maxValue)\n                        self.isDragging = false // Indicate dragging ended\n                        self.onEditingChanged(false) // Notify that editing ended\n                    }\n                )\n        }\n    }\n}\n\nstruct PlayerSlider: View {\n    @Binding var percentage: Double\n    @Binding var audioLength: TimeInterval\n    @State private var isDragging = false\n    @State private var isHover = false\n    @State private var temporaryPercentage: Double = 0.0 // Temporary value during dragging\n\n    var onEditingChanged: (Bool) -> Void // Callback for editing changes\n\n    var body: some View {\n        GeometryReader { geometry in\n            VStack(spacing: 2) {\n                HStack {\n                    Text(\"\\(String(format: \"%.2d:%.2d:%.2d\", isDragging ? Int(temporaryPercentage * audioLength) / 3600 : Int(percentage * audioLength) / 3600, isDragging ? Int(temporaryPercentage * audioLength) / 60 : Int(percentage * audioLength) / 60, isDragging ? Int(temporaryPercentage * audioLength) % 60 : Int(percentage * audioLength) % 60))\"\n                    ).foregroundColor(.secondary)\n                    Spacer()\n                    Text(\"\\(String(format: \"%.2d:%.2d:%.2d\", Int(audioLength) / 3600, Int(audioLength) / 60, Int(audioLength) % 60))\")\n                        .foregroundColor(.secondary)\n                }\n                ZStack(alignment: .leading) {\n                    Group {\n                        Rectangle()\n                            .foregroundColor(.secondary.opacity(0.5))\n                        Rectangle()\n                            .foregroundColor(.secondary)\n                            .frame(width: geometry.size.width * CGFloat(min(1.0, self.isDragging ? self.temporaryPercentage : self.percentage)))\n                    }.frame(height: 4).cornerRadius(12)\n                    if isHover || isDragging {\n                        Rectangle()\n                            .foregroundColor(.black)\n                            .blendMode(.destinationOut)\n                            .frame(width: 6, height: 10)\n                            .offset(x: geometry.size.width * CGFloat(min(1.0, self.isDragging ? self.temporaryPercentage : self.percentage)) - 3)\n                    }\n                    Rectangle()\n                        .cornerRadius(12)\n                        .foregroundColor(.primary)\n                        .opacity(isHover || isDragging ? 1.0 : 0.00001)\n                        .frame(width: 4, height: 12)\n                        .offset(x: geometry.size.width * CGFloat(min(1.0, self.isDragging ? self.temporaryPercentage : self.percentage)) - 2)\n                }.onHover { hovering in isHover = hovering }\n                    .compositingGroup()\n                    .gesture(DragGesture(minimumDistance: 0)\n                        .onChanged { value in\n                            // Update temporary percentage during dragging\n                            self.temporaryPercentage = min(max(0, Double(value.location.x / geometry.size.width)), 1)\n                            self.isDragging = true // Indicate dragging\n                            self.onEditingChanged(true) // Notify that editing started\n                        }\n                        .onEnded { value in\n                            // Update the bound percentage value when dragging ends\n                            self.percentage = self.temporaryPercentage\n                            self.isDragging = false // Indicate dragging ended\n                            self.onEditingChanged(false) // Notify that editing ended\n                        }\n                    )\n            }\n        }\n    }\n}\n\nstruct qmaPackageHandle: FileDocument {\n    static var readableContentTypes: [UTType] { [UTType.qma] }\n    \n    var info: Info\n    var sysAudio: Data\n    var micAudio: Data\n    \n    struct Info: Codable {\n        var format: String\n        var encoder: String\n        var exportMP3: Bool\n        var sysVol: Float\n        var micVol: Float\n    }\n    \n    init(info: Info = Info(format: \"m4a\", encoder: \"aac\", exportMP3: false, sysVol: 1.0, micVol: 1.0), sysAudio: Data = Data(), micAudio: Data = Data()) {\n        self.info = info\n        self.sysAudio = sysAudio\n        self.micAudio = micAudio\n    }\n\n    init(configuration: ReadConfiguration) throws {\n        guard let fileWrappers = configuration.file.fileWrappers else {\n            throw CocoaError(.fileReadCorruptFile)\n        }\n        \n        guard let infoFileWrapper = fileWrappers[\"info.json\"],\n              let infoData = infoFileWrapper.regularFileContents,\n              let info = try? JSONDecoder().decode(Info.self, from: infoData) else {\n            throw CocoaError(.fileReadCorruptFile)\n        }\n        \n        self.info = info\n        \n        guard let sysAudioFileWrapper = fileWrappers[\"sys.\\(info.format)\"],\n              let sysAudio = sysAudioFileWrapper.regularFileContents else {\n            throw CocoaError(.fileReadCorruptFile)\n        }\n        \n        self.sysAudio = sysAudio\n        \n        guard let micAudioFileWrapper = fileWrappers[\"mic.\\(info.format)\"],\n              let micAudio = micAudioFileWrapper.regularFileContents else {\n            throw CocoaError(.fileReadCorruptFile)\n        }\n        \n        self.micAudio = micAudio\n    }\n\n    func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper {\n        let infoData = try JSONEncoder().encode(info)\n        let infoFileWrapper = FileWrapper(regularFileWithContents: infoData)\n        infoFileWrapper.preferredFilename = \"info.json\"\n        \n        let sysAudioFileWrapper = FileWrapper(regularFileWithContents: sysAudio)\n        sysAudioFileWrapper.preferredFilename = \"sys.\\(info.format)\"\n        \n        let micAudioFileWrapper = FileWrapper(regularFileWithContents: micAudio)\n        micAudioFileWrapper.preferredFilename = \"mic.\\(info.format)\"\n        \n        let fileWrapper = FileWrapper(directoryWithFileWrappers: [\n            \"info.json\": infoFileWrapper,\n            \"sys.\\(info.format)\": sysAudioFileWrapper,\n            \"mic.\\(info.format)\": micAudioFileWrapper\n        ])\n        \n        return fileWrapper\n    }\n}\n\nextension qmaPackageHandle {\n    static func load(from url: URL) throws -> qmaPackageHandle {\n        let fileWrapper = try FileWrapper(url: url, options: .immediate)\n        guard let infoFileWrapper = fileWrapper.fileWrappers?[\"info.json\"],\n              let infoData = infoFileWrapper.regularFileContents else {\n            throw CocoaError(.fileReadCorruptFile)\n        }\n        let info = try JSONDecoder().decode(Info.self, from: infoData)\n\n        guard let sysAudioFileWrapper = fileWrapper.fileWrappers?[\"sys.\\(info.format)\"],\n              let sysAudio = sysAudioFileWrapper.regularFileContents else {\n            throw CocoaError(.fileReadCorruptFile)\n        }\n\n        guard let micAudioFileWrapper = fileWrapper.fileWrappers?[\"mic.\\(info.format)\"],\n              let micAudio = micAudioFileWrapper.regularFileContents else {\n            throw CocoaError(.fileReadCorruptFile)\n        }\n\n        return qmaPackageHandle(info: info, sysAudio: sysAudio, micAudio: micAudio)\n    }\n}\n\nclass AudioPlayerManager: ObservableObject {\n    @Published var progress: Double = 0.0\n    @Published var isPlaying: Bool = false\n    @Published var shouldPlay: Bool = false\n    @Published var exporting: Bool = false\n    @Published var audioLength: TimeInterval = 0\n    @Published var sysVol: Float = 1.0 {\n        didSet {\n            updateSysVol()\n        }\n    }\n    @Published var micVol: Float = 1.0 {\n        didSet {\n            updateMicVol()\n        }\n    }\n    \n    private var engine = AVAudioEngine()\n    private var playerNode1 = AVAudioPlayerNode()\n    private var playerNode2 = AVAudioPlayerNode()\n    private var mixerNode = AVAudioMixerNode()\n    private var timer: Timer?\n    private var lastStartFramePosition = AVAudioFramePosition(0.0)\n    private var audioFile1: AVAudioFile?\n    private var audioFile2: AVAudioFile?\n    private var isSeeking = false\n    private var exportMP3 = false\n    private var fileFormat = \"m4a\"\n    private var fileEncoder = \"aac\"\n    private var packageURL: URL?\n    private var seekTime: Double = 0\n    private var panel = NSSavePanel()\n    \n    init() {\n        setupAudioEngine()\n    }\n    \n    private func setupAudioEngine() {\n        engine.attach(playerNode1)\n        engine.attach(playerNode2)\n        engine.attach(mixerNode)\n        \n        let outputFormat = AVAudioFormat(commonFormat: .pcmFormatFloat32, sampleRate: 48000, channels: 2, interleaved: false)!\n        engine.connect(playerNode1, to: mixerNode, format: outputFormat)\n        engine.connect(playerNode2, to: mixerNode, format: outputFormat)\n        engine.connect(mixerNode, to: engine.mainMixerNode, format: outputFormat)\n        \n        do {\n            try engine.start()\n        } catch {\n            print(\"Audio engine start error: \\(error)\")\n        }\n    }\n    \n    func loadAudioFiles(format: String, package: URL, encoder: String, saveMP3: Bool) {\n        do {\n            fileFormat = format\n            fileEncoder = encoder\n            exportMP3 = saveMP3\n            packageURL = package\n            audioFile1 = try AVAudioFile(forReading: package.appendingPathComponent(\"sys.\\(format)\"))\n            audioFile2 = try AVAudioFile(forReading: package.appendingPathComponent(\"mic.\\(format)\"))\n            \n            audioLength = Double(audioFile1?.length ?? 0) / (audioFile1?.processingFormat.sampleRate ?? 48000.0)\n            \n            updateSysVol()\n            updateMicVol()\n        } catch {\n            print(\"Error loading audio data: \\(error)\")\n        }\n    }\n    \n    func play() {\n        guard let audioFile1 = audioFile1, let audioFile2 = audioFile2 else { return }\n        playerNode1.scheduleFile(audioFile1, at: nil, completionHandler: nil)\n        playerNode2.scheduleFile(audioFile2, at: nil, completionHandler: nil)\n        playerNode1.play()\n        playerNode2.play()\n        stopProgressTimer()\n        startProgressTimer()\n        isPlaying = true\n    }\n    \n    func pause() {\n        playerNode1.pause()\n        playerNode2.pause()\n        stopProgressTimer()\n        isPlaying = false\n    }\n    \n    func stop() {\n        playerNode1.stop()\n        playerNode2.stop()\n        stopProgressTimer()\n        lastStartFramePosition = AVAudioFramePosition(0.0)\n        progress = 0.0\n        isPlaying = false\n    }\n    \n    func seek(to time: Double) {\n        guard let audioFile1 = audioFile1, let audioFile2 = audioFile2 else { return }\n        playerNode1.stop()\n        playerNode2.stop()\n        stopProgressTimer()\n        \n        seekTime = time\n        isSeeking = true\n        \n        let startFrame = AVAudioFramePosition(seekTime * audioFile1.processingFormat.sampleRate)\n        let frameCount = AVAudioFrameCount(audioFile1.length - startFrame)\n        \n        if frameCount > 0 {\n            lastStartFramePosition = startFrame\n            playerNode1.scheduleSegment(audioFile1, startingFrame: startFrame, frameCount: frameCount, at: nil, completionHandler: nil)\n            playerNode2.scheduleSegment(audioFile2, startingFrame: startFrame, frameCount: frameCount, at: nil, completionHandler: nil)\n            progress = time / audioLength\n            if isPlaying || shouldPlay {\n                playerNode1.play()\n                playerNode2.play()\n                startProgressTimer()\n                isPlaying = true\n            }\n        } else {\n            stop()\n        }\n        \n        \n    }\n    \n    private func startProgressTimer() {\n        timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { _ in\n            if let lastRenderTime = self.playerNode1.lastRenderTime, let playerTime = self.playerNode1.playerTime(forNodeTime: lastRenderTime) {\n                let currentTime = Double(self.lastStartFramePosition + playerTime.sampleTime) / playerTime.sampleRate\n                self.progress = currentTime / self.audioLength\n                if currentTime > self.audioLength {\n                    DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {\n                        self.stop()\n                    }\n                }\n            }\n        }\n    }\n    \n    private func stopProgressTimer() {\n        timer?.invalidate()\n        timer = nil\n    }\n    \n    func getPlayerDuration() -> TimeInterval {\n        return audioLength\n    }\n    \n    func reset() {\n        stop()\n        playerNode1.reset()\n        playerNode2.reset()\n        audioFile1 = nil\n        audioFile2 = nil\n    }\n    \n    func export() {\n        guard let packageURL = packageURL else { return }\n        stop()\n        let format = exportMP3 ? \"mp3\" : self.fileFormat\n        showSavePanel(defaultFileName: \"\\(packageURL.deletingPathExtension().appendingPathExtension(format).lastPathComponent)\", exportMP3: exportMP3) { url, saveAsMP3 in\n            if let url = url { self.saveFile(url, saveAsMP3: saveAsMP3) }\n        }\n    }\n    \n    func saveFile(_ url: URL, saveAsMP3: Bool = false) {\n        var url = url\n        if url.pathExtension == \"mp3\" { url = url.deletingPathExtension() }\n        if url.pathExtension != self.fileFormat { url = url.appendingPathExtension(self.fileFormat) }\n        let lastComp = url.lastPathComponent\n        if self.exportMP3 { url = url.deletingLastPathComponent().appendingPathComponent(\".\" + url.lastPathComponent) }\n        \n        Thread.detachNewThread {\n            DispatchQueue.main.async { self.exporting = true }\n            do {\n                guard let audioFile1 = self.audioFile1, let audioFile2 = self.audioFile2 else { return }\n                self.playerNode1.scheduleFile(audioFile1, at: nil, completionHandler: nil)\n                self.playerNode2.scheduleFile(audioFile2, at: nil, completionHandler: nil)\n                \n                let audioSettings = SCContext.updateAudioSettings(format: self.fileEncoder)\n                let outputFormat = self.playerNode1.outputFormat(forBus: 0)\n                let outputFile = try AVAudioFile(forWriting: url, settings: audioSettings, commonFormat: .pcmFormatFloat32, interleaved: false)\n                self.engine.stop()\n                try self.engine.enableManualRenderingMode(.offline, format: outputFormat, maximumFrameCount: 4096)\n                try self.engine.start()\n                \n                self.playerNode1.play()\n                self.playerNode2.play()\n                \n                let duration = audioFile1.length\n                let buffer = AVAudioPCMBuffer(pcmFormat: self.engine.manualRenderingFormat, frameCapacity: self.engine.manualRenderingMaximumFrameCount)!\n                \n                while self.engine.manualRenderingSampleTime < duration {\n                    let framesToRender = min(UInt32(buffer.frameCapacity), UInt32(duration - self.engine.manualRenderingSampleTime))\n                    let status = try self.engine.renderOffline(framesToRender, to: buffer)\n                    switch status {\n                    case .success:\n                        try outputFile.write(from: buffer)\n                    case .insufficientDataFromInputNode, .cannotDoInCurrentContext:\n                        // Handle the cases where rendering cannot proceed\n                        break\n                    default:\n                        // Handle other cases if needed\n                        break\n                    }\n                }\n                \n                self.engine.disableManualRenderingMode()\n                self.engine.stop()\n                self.setupAudioEngine()\n                \n                let title = \"Recording Completed\".local\n                var body = String(format: \"File saved to: %@\".local, url.path.removingPercentEncoding!)\n                let id = \"quickrecorder.completed.\\(UUID().uuidString)\"\n                \n                if saveAsMP3 {\n                    let oldURL = url\n                    let newURl = url.deletingLastPathComponent().appendingPathComponent(lastComp).deletingPathExtension().appendingPathExtension(\"mp3\")\n                    body = String(format: \"File saved to: %@\".local, newURl.path.removingPercentEncoding!)\n                    DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {\n                        Task {\n                            do {\n                                try await SCContext.m4a2mp3(inputUrl: oldURL, outputUrl: newURl)\n                                try? fd.removeItem(at: oldURL)\n                            } catch {\n                                SCContext.showNotification(title: \"Failed to save file\".local, body: \"\\(error.localizedDescription)\", id: \"quickrecorder.error.\\(UUID().uuidString)\")\n                                return\n                            }\n                        }\n                    }\n                }\n                \n                SCContext.showNotification(title: title, body: body, id: id)\n            } catch {\n                SCContext.showNotification(title: \"Failed to save file\".local, body: \"\\(error.localizedDescription)\", id: \"quickrecorder.error.\\(UUID().uuidString)\")\n            }\n            DispatchQueue.main.async { self.exporting = false }\n        }\n    }\n    \n    private func updateSysVol() {\n        playerNode1.volume = sysVol\n    }\n    \n    private func updateMicVol() {\n        playerNode2.volume = micVol\n    }\n    \n    private func showSavePanel(defaultFileName: String, exportMP3: Bool, completion: @escaping (URL?, Bool) -> Void) {\n        panel.isReleasedWhenClosed = true\n        panel.nameFieldStringValue = defaultFileName\n        panel.canCreateDirectories = true\n        panel.title = \"Export Recording\".local\n        \n        let checkBox = NSButton(checkboxWithTitle: \"Export as MP3\".local, target: self, action: #selector(checkBoxToggled(_:)))\n        checkBox.state = exportMP3 ? .on : .off\n        \n        let accessoryView = NSView(frame: NSRect(x: 0, y: 0, width: checkBox.frame.width, height: checkBox.frame.height))\n        accessoryView.addSubview(checkBox)\n        \n        panel.accessoryView = accessoryView\n        \n        panel.begin { response in\n            if response == .OK {\n                let exportAsMP3 = (checkBox.state == .on)\n                completion(self.panel.url, exportAsMP3)\n            } else {\n                completion(nil, false)\n            }\n        }\n    }\n    \n    @objc private func checkBoxToggled(_ sender: NSButton) {\n        panel.close()\n        panel = NSSavePanel()\n        exportMP3.toggle()\n        export()\n    }\n}\n\nextension UTType {\n    static let qma = UTType(exportedAs: \"com.lihaoyun6.QuickRecorder.qma\")\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/ScreenMagnifier.swift",
    "content": "//\n//  ScreenMagnifier.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/25.\n//\nimport SwiftUI\n\nstruct ScreenMagnifier: View {\n    @State var screenShot: NSImage!\n    @State var scaleFactor = SCContext.getScreenWithMouse()?.backingScaleFactor ?? 1.0\n    var event: NSEvent!\n    \n    var body: some View {\n        ZStack {\n            Rectangle()\n                .fill(Color.clear)\n                .overlay(\n                    Rectangle()\n                        .stroke(style: StrokeStyle(lineWidth: 2))\n                        .padding(1)\n                        .foregroundColor(.blue.opacity(0.5))\n                )\n                .background(\n                    Image(nsImage: screenShot!)\n                        .interpolation(.none)\n                        .resizable()\n                        .scaledToFit()\n                        .frame(width: (screenShot?.size.width)!*3, height: (screenShot?.size.height)!*3)\n                )\n        }\n    }\n    \n    func getOpacity(_ event: NSEvent) -> Double {\n        switch event.type {\n        case .rightMouseDown, .rightMouseDragged, .leftMouseDown, .leftMouseDragged, .otherMouseDown, .otherMouseDragged:\n            return 0.8\n        default:\n            return 0.3\n        }\n    }\n    \n    func getColor(_ event: NSEvent) -> Color {\n        switch event.type {\n        case .rightMouseDown, .rightMouseDragged:\n            return .purple\n        case .leftMouseDown, .leftMouseDragged:\n            return .blue\n        case .otherMouseDown, .otherMouseDragged:\n            return .orange\n        default:\n            return .gray\n        }\n    }\n    \n    func getStrokeColor(_ event: NSEvent) -> Color {\n        switch event.type {\n        case .leftMouseUp, .rightMouseUp, .otherMouseUp, .mouseMoved:\n            return .black\n        default:\n            return .clear\n        }\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/ScreenSelector.swift",
    "content": "//\n//  ScreenSelector.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/18.\n//\n\nimport SwiftUI\nimport ScreenCaptureKit\n\nstruct ScreenSelector: View {\n    @Environment(\\.colorScheme) var colorScheme\n    @StateObject var viewModel = ScreenSelectorViewModel()\n    \n    @State private var selected: SCDisplay?\n    @State private var isPopoverShowing = false\n    @State private var autoStop = 0\n    var appDelegate = AppDelegate.shared\n    \n    var body: some View {\n        ZStack {\n            VStack(spacing: 15) {\n                Text(\"Please select the screen to record\")\n                let count = viewModel.screenThumbnails.count\n                ScrollView(.vertical) {\n                    VStack(spacing: 14){\n                        ForEach(0..<viewModel.screenThumbnails.count/2 + 1, id: \\.self) { rowIndex in\n                            HStack(spacing: 30) {\n                                ForEach(0..<2, id: \\.self) { columnIndex in\n                                    let index = 2 * rowIndex + columnIndex\n                                    if index <= viewModel.screenThumbnails.count - 1 {\n                                        Button(action: {\n                                            selected = viewModel.screenThumbnails[index].screen\n                                        }, label: {\n                                            ZStack {\n                                                VStack(spacing: 4) {\n                                                    ZStack{\n                                                        if colorScheme == .light {\n                                                            Image(nsImage: viewModel.screenThumbnails[index].image)\n                                                                .resizable()\n                                                                .aspectRatio(contentMode: .fit)\n                                                                .colorMultiply(.black)\n                                                                .blur(radius: 0.5)\n                                                                .opacity(1)\n                                                        } else {\n                                                            Image(nsImage: viewModel.screenThumbnails[index].image)\n                                                                .resizable()\n                                                                .aspectRatio(contentMode: .fit)\n                                                                .colorMultiply(.black)\n                                                                .colorInvert()\n                                                                .blur(radius: 0.5)\n                                                                .opacity(1)\n                                                        }\n                                                        Image(nsImage: viewModel.screenThumbnails[index].image)\n                                                            .resizable()\n                                                            .aspectRatio(contentMode: .fit)\n                                                    }.frame(width: count == 1 ? 672 : 320, height: count == 1 ? 378 : 180, alignment: .center)\n                                                    let screenName = NSScreen.screens.first(where: { $0.displayID == viewModel.screenThumbnails[index].screen.displayID })?.localizedName ?? \"Display \".local + \"\\(viewModel.screenThumbnails[index].screen.displayID)\"\n                                                    Text(screenName)\n                                                        .foregroundStyle(.secondary)\n                                                        .lineLimit(1)\n                                                        .truncationMode(.tail)\n                                                        .offset(y:count == 1 ? 5 : 2)\n                                                }\n                                                .padding(count == 1 ? 19 : 10)\n                                                .background(\n                                                    Rectangle()\n                                                        .foregroundStyle(.blue)\n                                                        .cornerRadius(5)\n                                                        .opacity((selected == viewModel.screenThumbnails[index].screen) ? 0.2 : 0.0)\n                                                )\n                                                Group {\n                                                    Image(systemName: \"circle.fill\")\n                                                        .font(.system(size: count == 1 ? 62 : 31))\n                                                        .foregroundStyle(.white)\n                                                        .opacity((selected == viewModel.screenThumbnails[index].screen) ? 1.0 : 0.0)\n                                                    Image(systemName: \"checkmark.circle.fill\")\n                                                        .font(.system(size: count == 1 ? 54 : 27))\n                                                        .foregroundStyle(.green)\n                                                        .opacity((selected == viewModel.screenThumbnails[index].screen) ? 1.0 : 0.0)\n                                                }.offset(x: count == 1 ? 270 : 120, y: count == 1 ? 130 : 50)\n                                            }\n                                        }).buttonStyle(.plain)\n                                    }\n                                }\n                            }\n                            .frame(maxWidth: .infinity, alignment: .leading)\n                            .padding(.leading, 35)\n                        }\n                    }\n                }\n                .frame(height: 445)\n                \n                HStack(spacing: 4) {\n                    Button(action: {\n                        viewModel.setupStreams()\n                    }, label: {\n                        VStack{\n                            Image(systemName: \"arrow.clockwise.circle.fill\")\n                                .font(.system(size: 36))\n                                .foregroundStyle(.blue)\n                            Text(\"Refresh\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                        \n                    }).buttonStyle(.plain)\n                    Spacer()\n                    OptionsView().padding(.leading, 18)\n                    Spacer()\n                    Button(action: {\n                        isPopoverShowing = true\n                    }, label: {\n                        Image(systemName: \"timer\")\n                            .font(.system(size: 11, weight: .bold))\n                            .foregroundStyle(.blue)\n                    })\n                    .buttonStyle(.plain)\n                    .padding(.top, 42.5)\n                    .popover(isPresented: $isPopoverShowing, arrowEdge: .bottom, content: {\n                        HStack {\n                            Text(\" Stop after\".local)\n                            TextField(\"\", value: $autoStop, formatter: NumberFormatter())\n                                .textFieldStyle(RoundedBorderTextFieldStyle())\n                            Stepper(\"\", value: $autoStop)\n                                .padding(.leading, -10)\n                            Text(\"minutes \".local)\n                        }\n                        .fixedSize()\n                        .padding()\n                    })\n                    Button(action: {\n                        startRecording()\n                    }, label: {\n                        VStack{\n                            Image(systemName: \"record.circle.fill\")\n                                .font(.system(size: 36))\n                                .foregroundStyle(.red)\n                            Text(\"Start\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                    })\n                    .buttonStyle(.plain)\n                    .disabled(selected == nil)\n                }.padding(.horizontal, 40)\n                Spacer()\n            }\n            .padding(.top, -5)\n        }.frame(width: 780, height:555)\n    }\n    \n    func startRecording() {\n        closeAllWindow()\n        if let screen = selected {\n            appDelegate.createCountdownPanel(screen: screen) {\n                SCContext.autoStop = autoStop\n                appDelegate.prepRecord(type: \"display\", screens: screen, windows: nil, applications: nil)\n            }\n        }\n    }\n}\n\nclass ScreenSelectorViewModel: NSObject, ObservableObject, SCStreamDelegate, SCStreamOutput {\n    @Published var screenThumbnails = [ScreenThumbnail]()\n    private var allScreens = [SCDisplay]()\n    private var streams = [SCStream]()\n    \n    override init() {\n        super.init()\n        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {\n            self.setupStreams()\n        }\n    }\n    \n    func stream(_ stream: SCStream, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, of type: SCStreamOutputType) {\n        if CMSampleBufferGetImageBuffer(sampleBuffer) == nil { return }\n        var nsImage = sampleBuffer.nsImage\n        if let index = self.streams.firstIndex(of: stream), index + 1 <= self.allScreens.count {\n            if nsImage == nil { nsImage = SCContext.getWallpaper(self.allScreens[index]) ?? NSImage.unknowScreen }\n            let currentScreen = self.allScreens[index]\n            let thumbnail = ScreenThumbnail(image: nsImage!, screen: currentScreen)\n            DispatchQueue.main.async {\n                if !self.screenThumbnails.contains(where: { $0.screen == currentScreen }) { self.screenThumbnails.append(thumbnail) }\n            }\n            self.streams[index].stopCapture()\n        }\n    }\n\n    func setupStreams() {\n        SCContext.updateAvailableContent {\n            Task {\n                do {\n                    self.streams.removeAll()\n                    DispatchQueue.main.async { self.screenThumbnails.removeAll() }\n                    guard let screens = SCContext.availableContent?.displays else { return }\n                    self.allScreens = screens\n                    let qrSelf = SCContext.getSelf()\n                    let contentFilters = self.allScreens.map { SCContentFilter(display: $0, excludingApplications: qrSelf != nil ? [qrSelf!] : [], exceptingWindows: []) }\n                    for (index, contentFilter) in contentFilters.enumerated() {\n                        let streamConfiguration = SCStreamConfiguration()\n                        streamConfiguration.width = Int(self.allScreens[index].frame.width)\n                        streamConfiguration.height = Int(self.allScreens[index].frame.height)\n                        streamConfiguration.minimumFrameInterval = CMTime(value: 1, timescale: CMTimeScale(1))\n                        streamConfiguration.pixelFormat = kCVPixelFormatType_32BGRA\n                        if #available(macOS 13, *) { streamConfiguration.capturesAudio = false }\n                        streamConfiguration.showsCursor = false\n                        streamConfiguration.queueDepth = 3\n                        let stream = SCStream(filter: contentFilter, configuration: streamConfiguration, delegate: self)\n                        try stream.addStreamOutput(self, type: .screen, sampleHandlerQueue: .main)\n                        try await stream.startCapture()\n                        self.streams.append(stream)\n                    }\n                } catch {\n                    print(\"Get screenshot error：\\(error)\")\n                }\n            }\n        }\n    }\n}\n\nclass ScreenThumbnail {\n    let image: NSImage\n    let screen: SCDisplay\n\n    init(image: NSImage, screen: SCDisplay) {\n        self.image = image\n        self.screen = screen\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/SettingsView.swift",
    "content": "//\n//  SettingsView.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/19.\n//\n\nimport SwiftUI\nimport Sparkle\nimport ServiceManagement\nimport KeyboardShortcuts\nimport MatrixColorSelector\n\nstruct SettingsView: View {\n    @State private var selectedItem: String? = \"General\"\n    \n    var body: some View {\n        NavigationView {\n            List(selection: $selectedItem) {\n                NavigationLink(destination: GeneralView(), tag: \"General\", selection: $selectedItem) {\n                    Label(\"General\", image: \"gear\")\n                }\n                NavigationLink(destination: RecorderView(), tag: \"Recorder\", selection: $selectedItem) {\n                    Label(\"Recorder\", image: \"record\")\n                }\n                NavigationLink(destination: OutputView(), tag: \"Output\", selection: $selectedItem) {\n                    Label(\"Output\", image: \"film\")\n                }\n                NavigationLink(destination: HotkeyView(), tag: \"Hotkey\", selection: $selectedItem) {\n                    Label(\"Hotkey\", image: \"hotkey\")\n                }\n                NavigationLink(destination: BlocklistView(), tag: \"Blaoklist\", selection: $selectedItem) {\n                    Label(\"Blocklist\", image: \"blacklist\")\n                }\n            }\n            .listStyle(.sidebar)\n            .padding(.top, 9)\n        }.frame(width: 600, height: 512)\n    }\n}\n\nstruct GeneralView: View {\n    @AppStorage(\"countdown\") private var countdown: Int = 0\n    @AppStorage(\"poSafeDelay\") private var poSafeDelay: Int = 1\n    @AppStorage(\"showOnDock\") private var showOnDock: Bool = true\n    @AppStorage(\"showMenubar\") private var showMenubar: Bool = false\n    \n    @State private var launchAtLogin = false\n\n    var body: some View {\n        SForm {\n            SGroupBox(label: \"Startup\") {\n                if #available(macOS 13, *) {\n                    SToggle(\"Launch at Login\", isOn: $launchAtLogin)\n                        .onChange(of: launchAtLogin) { newValue in\n                            do {\n                                if newValue {\n                                    try SMAppService.mainApp.register()\n                                } else {\n                                    try SMAppService.mainApp.unregister()\n                                }\n                            }catch{\n                                print(\"Failed to \\(newValue ? \"enable\" : \"disable\") launch at login: \\(error.localizedDescription)\")\n                            }\n                        }\n                    SDivider()\n                }\n                SToggle(\"Show QuickRecorder on Dock\", isOn: $showOnDock)\n                    //.disabled(!showMenubar)\n                SDivider()\n                SToggle(\"Show QuickRecorder on Menu Bar\", isOn: $showMenubar)\n                    //.disabled(!showOnDock)\n            }\n            SGroupBox(label: \"Update\") { UpdaterSettingsView(updater: updaterController.updater) }\n            VStack(spacing: 8) {\n                CheckForUpdatesView(updater: updaterController.updater)\n                if let appVersion = Bundle.main.infoDictionary?[\"CFBundleShortVersionString\"] as? String {\n                    Text(\"QuickRecorder v\\(appVersion)\")\n                        .font(.subheadline)\n                        .foregroundColor(.secondary)\n                }\n            }\n        }\n        .onAppear{ if #available(macOS 13, *) { launchAtLogin = (SMAppService.mainApp.status == .enabled) }}\n        .onChange(of: showMenubar) { _ in updateStatusBar() }\n        .onChange(of: showOnDock) { newValue in\n            if !newValue {\n                NSApp.setActivationPolicy(.accessory)\n                NSApp.activate(ignoringOtherApps: true)\n            } else {\n                NSApp.setActivationPolicy(.regular)\n            }\n        }\n    }\n}\n\nstruct RecorderView: View {\n    @AppStorage(\"countdown\")        private var countdown: Int = 0\n    @AppStorage(\"poSafeDelay\")      private var poSafeDelay: Int = 1\n    @AppStorage(\"highlightMouse\")   private var highlightMouse: Bool = false\n    @AppStorage(\"includeMenuBar\")   private var includeMenuBar: Bool = true\n    @AppStorage(\"hideDesktopFiles\") private var hideDesktopFiles: Bool = false\n    @AppStorage(\"trimAfterRecord\")  private var trimAfterRecord: Bool = false\n    @AppStorage(\"miniStatusBar\")    private var miniStatusBar: Bool = false\n    @AppStorage(\"hideSelf\")         private var hideSelf: Bool = true\n    @AppStorage(\"preventSleep\")     private var preventSleep: Bool = true\n    @AppStorage(\"showPreview\")      private var showPreview: Bool = true\n    @AppStorage(\"hideCCenter\")      private var hideCCenter: Bool = false\n    \n    @State private var userColor: Color = Color.black\n\n    var body: some View {\n        SForm(spacing: 10) {\n            SGroupBox(label: \"Recorder\") {\n                SSteper(\"Delay Before Recording\", value: $countdown, min: 0, max: 99)\n                SDivider()\n                if #available(macOS 14, *) {\n                    SSteper(\"Presenter Overlay Delay\", value: $poSafeDelay, min: 0, max: 99, tips: \"If enabling Presenter Overlay causes recording failure, please increase this value.\")\n                    SDivider()\n                }\n                SItem(label: \"Custom Background Color\") {\n                    if #unavailable(macOS 13) {\n                        ColorPicker(\"\", selection: $userColor)\n                    } else {\n                        MatrixColorSelector(\"\", selection: $userColor)\n                            .onChange(of: userColor) { userColor in ud.setColor(userColor, forKey: \"userColor\") }\n                    }\n                }\n            }\n            SGroupBox {\n                SToggle(\"Mini size Menu Bar controller\", isOn: $miniStatusBar)\n                SDivider()\n                SToggle(\"Prevent Mac from sleeping while recording\", isOn: $preventSleep)\n                SDivider()\n                if #available(macOS 13, *) {\n                    SToggle(\"Show floating preview after recording\", isOn: $showPreview)\n                    SDivider()\n                }\n                SToggle(\"Open video trimmer after recording\", isOn: $trimAfterRecord)\n            }\n            SGroupBox {\n                SToggle(\"Exclude QuickRecorder itself\", isOn: $hideSelf)\n                SDivider()\n                if #available (macOS 13, *) {\n                    SToggle(\"Include Menu Bar in Recording\", isOn: $includeMenuBar)\n                    SDivider()\n                }\n                SToggle(\"Hide Control Center Icons\", isOn: $hideCCenter, tips: \"Hide the clock, Wi-Fi, bluetooth, volume and other system icons in the menu bar.\")\n                SDivider()\n                SToggle(\"Highlight the Mouse Cursor\", isOn: $highlightMouse, tips: \"Not available for \\\"Single Window Capture\\\"\")\n                SDivider()\n                SToggle(\"Exclude Files on Desktop\", isOn: $hideDesktopFiles, tips: \"If enabled, all files on the Desktop will be hidden from the video when recording.\")\n            }\n        }.onAppear{ userColor = ud.color(forKey: \"userColor\") ?? Color.black }\n    }\n}\n\nstruct OutputView: View {\n    @AppStorage(\"encoder\")          private var encoder: Encoder = .h265\n    @AppStorage(\"videoFormat\")      private var videoFormat: VideoFormat = .mp4\n    @AppStorage(\"audioFormat\")      private var audioFormat: AudioFormat = .aac\n    @AppStorage(\"audioQuality\")     private var audioQuality: AudioQuality = .high\n    @AppStorage(\"pixelFormat\")      private var pixelFormat: PixFormat = .delault\n    @AppStorage(\"background\")       private var background: BackgroundType = .wallpaper\n    @AppStorage(\"remuxAudio\")       private var remuxAudio: Bool = true\n    @AppStorage(\"enableAEC\")        private var enableAEC: Bool = false\n    @AppStorage(\"AECLevel\")         private var AECLevel: String = \"mid\"\n    @AppStorage(\"withAlpha\")        private var withAlpha: Bool = false\n    @AppStorage(\"saveDirectory\")    private var saveDirectory: String?\n\n    var body: some View {\n        SForm(spacing: 30) {\n            SGroupBox(label: \"Audio\") {\n                SPicker(\"Quality\", selection: $audioQuality) {\n                    if audioFormat == .alac || audioFormat == .flac {\n                        Text(\"Lossless\").tag(audioQuality)\n                    }\n                    Text(\"Normal - 128Kbps\").tag(AudioQuality.normal)\n                    Text(\"Good - 192Kbps\").tag(AudioQuality.good)\n                    Text(\"High - 256Kbps\").tag(AudioQuality.high)\n                    Text(\"Extreme - 320Kbps\").tag(AudioQuality.extreme)\n                }.disabled(audioFormat == .alac || audioFormat == .flac)\n                SDivider()\n                SPicker(\"Format\", selection: $audioFormat) {\n                    Text(\"MP3\").tag(AudioFormat.mp3)\n                    Text(\"AAC\").tag(AudioFormat.aac)\n                    Text(\"ALAC (Lossless)\").tag(AudioFormat.alac)\n                    Text(\"FLAC (Lossless)\").tag(AudioFormat.flac)\n                    Text(\"Opus\").tag(AudioFormat.opus)\n                }\n                SDivider()\n                if #available(macOS 13, *) {\n                    SToggle(\"Record Microphone to Main Track\", isOn: $remuxAudio)\n                    SDivider()\n                }\n                SToggle(\"Enable Acoustic Echo Cancellation\", isOn: $enableAEC)\n                if #available(macOS 14, *) {\n                    SDivider()\n                    SPicker(\"Audio Ducking Level\", selection: $AECLevel) {\n                        Text(\"Min\").tag(\"min\")\n                        Text(\"Mid\").tag(\"mid\")\n                        Text(\"Max\").tag(\"max\")\n                    }.disabled(!enableAEC)\n                }\n            }\n            SGroupBox(label: \"Video\") {\n                SPicker(\"Format\", selection: $videoFormat) {\n                    Text(\"MOV\").tag(VideoFormat.mov)\n                    Text(\"MP4\").tag(VideoFormat.mp4)\n                }.disabled(withAlpha)\n                SDivider()\n                SPicker(\"Encoder\", selection: $encoder) {\n                    Text(\"H.264\").tag(Encoder.h264)\n                    Text(\"H.265\").tag(Encoder.h265)\n                }.disabled(withAlpha)\n                SDivider()\n                SToggle(\"Recording with Alpha Channel\", isOn: $withAlpha)\n            }\n            SGroupBox(label: \"Save\") {\n                SItem(label: \"Output Folder\") {\n                    Text(String(format: \"Currently set to \\\"%@\\\"\".local, saveDirectory!.lastPathComponent))\n                        .font(.footnote)\n                        .foregroundColor(Color.secondary)\n                        .lineLimit(1)\n                        .truncationMode(.tail)\n                    Button(\"Select...\", action: { updateOutputDirectory() })\n                }\n            }\n        }.onChange(of: withAlpha) {alpha in\n            if alpha {\n                encoder = Encoder.h265; videoFormat = VideoFormat.mov\n            } else {\n                if background == .clear { background = .wallpaper }\n            }\n        }\n    }\n    \n    func updateOutputDirectory() { // todo: re-sandbox\n        let openPanel = NSOpenPanel()\n        openPanel.canChooseFiles = false\n        openPanel.canChooseDirectories = true\n        openPanel.allowedContentTypes = []\n        openPanel.allowsOtherFileTypes = false\n        if openPanel.runModal() == NSApplication.ModalResponse.OK {\n            if let path = openPanel.urls.first?.path { saveDirectory = path }\n        }\n    }\n}\n\nstruct HotkeyView: View {\n    var body: some View {\n        SForm(spacing: 10) {\n            SGroupBox(label: \"Hotkey\") {\n                SItem(label: \"Open Main Panel\") { KeyboardShortcuts.Recorder(\"\", name: .showPanel) }\n            }\n            SGroupBox {\n                SItem(label: \"Stop Recording\") { KeyboardShortcuts.Recorder(\"\", name: .stop) }\n                SDivider()\n                SItem(label: \"Pause / Resume\") { KeyboardShortcuts.Recorder(\"\", name: .pauseResume) }\n            }\n            SGroupBox {\n                SItem(label: \"Record System Audio\") { KeyboardShortcuts.Recorder(\"\", name: .startWithAudio) }\n                SDivider()\n                SItem(label: \"Record Current Screen\") { KeyboardShortcuts.Recorder(\"\", name: .startWithScreen) }\n                SDivider()\n                SItem(label: \"Record Topmost Window\") { KeyboardShortcuts.Recorder(\"\", name: .startWithWindow) }\n                SDivider()\n                SItem(label: \"Select Area to Record\") { KeyboardShortcuts.Recorder(\"\", name: .startWithArea) }\n            }\n            SGroupBox {\n                SItem(label: \"Save Current Frame\") { KeyboardShortcuts.Recorder(\"\", name: .saveFrame) }\n                SDivider()\n                SItem(label: \"Toggle Screen Magnifier\") {KeyboardShortcuts.Recorder(\"\", name: .screenMagnifier) }\n            }\n        }\n    }\n}\n\nstruct BlocklistView: View {\n    var body: some View {\n        SForm(spacing: 0, noSpacer: true) {\n            SGroupBox(label: \"Blocklist\") {\n                    BundleSelector()\n                    Text(\"These apps will be excluded when recording \\\"Screen\\\" or \\\"Screen Area\\\"\\nBut if the app is launched after the recording starts, it cannot be excluded.\")\n                        .font(.footnote)\n                        .multilineTextAlignment(.center)\n                        .foregroundColor(Color.secondary)\n            }\n        }\n    }\n}\n\nextension UserDefaults {\n    func setColor(_ color: Color?, forKey key: String) {\n        guard let color = color else {\n            removeObject(forKey: key)\n            return\n        }\n        \n        do {\n            let data = try NSKeyedArchiver.archivedData(withRootObject: NSColor(color), requiringSecureCoding: false)\n            set(data, forKey: key)\n        } catch {\n            print(\"Error archiving color:\", error)\n        }\n    }\n    \n    func color(forKey key: String) -> Color? {\n        guard let data = data(forKey: key),\n              let nsColor = try? NSKeyedUnarchiver.unarchivedObject(ofClass: NSColor.self, from: data) else {\n            return nil\n        }\n        return Color(nsColor)\n    }\n    \n    func cgColor(forKey key: String) -> CGColor? {\n        guard let data = data(forKey: key),\n              let nsColor = try? NSKeyedUnarchiver.unarchivedObject(ofClass: NSColor.self, from: data) else {\n            return nil\n        }\n        return nsColor.cgColor\n    }\n}\n\nextension KeyboardShortcuts.Name {\n    static let startWithAudio = Self(\"startWithAudio\")\n    static let startWithScreen = Self(\"startWithScreen\")\n    static let startWithWindow = Self(\"startWithWindow\")\n    static let startWithArea = Self(\"startWithArea\")\n    static let screenMagnifier = Self(\"screenMagnifier\")\n    static let saveFrame = Self(\"saveFrame\")\n    static let pauseResume = Self(\"pauseResume\")\n    static let stop = Self(\"stop\")\n    static let showPanel = Self(\"showPanel\")\n}\n\nextension AppDelegate {\n    @available(macOS 13.0, *)\n    @objc func setLoginItem(_ sender: NSMenuItem) {\n        sender.state = sender.state == .on ? .off : .on\n        do {\n            if sender.state == .on { try SMAppService.mainApp.register() }\n            if sender.state == .off { try SMAppService.mainApp.unregister() }\n        }catch{\n            print(\"Failed to \\(sender.state == .on ? \"enable\" : \"disable\") launch at login: \\(error.localizedDescription)\")\n        }\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/StatusBar.swift",
    "content": "//\n//  StatusBarItem.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/16.\n//\n\nimport SwiftUI\n\nclass PopoverState: ObservableObject {\n    static let shared = PopoverState()\n    @Published var isShowing: Bool = false\n    @Published var isPaused: Bool = false\n}\n\nstruct StatusBarItem: View {\n    @State private var deviceWindowIsShowing = true\n    @State private var isMainMenuShowing = false\n    @State private var isHovering = false\n    @State private var recordingLength = \"00:00\"\n    //@State private var isPassed = SCContext.isPaused\n    @StateObject private var popoverState = PopoverState.shared\n    //@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate\n    @AppStorage(\"miniStatusBar\") private var miniStatusBar: Bool = false\n    //@AppStorage(\"highlightMouse\") private var highlightMouse: Bool = false\n    private var appDelegate = AppDelegate.shared\n    \n    var body: some View {\n        HStack(spacing: 0) {\n            if SCContext.streamType != nil {\n                ZStack {\n                    Rectangle()\n                        .fill(Color.mypurple)\n                        .shadow(color: .black.opacity(0.3), radius: 4)\n                        .cornerRadius(4)\n                    HStack(spacing: 4) {\n                        if miniStatusBar {\n                            if isHovering {\n                                Button(action: {\n                                    if SCContext.streamType == .idevice {\n                                        AVOutputClass.shared.stopRecording()\n                                    } else {\n                                        SCContext.stopRecording()\n                                    }\n                                }, label: {\n                                    ZStack {\n                                        Image(systemName: \"circle.fill\")\n                                            .font(.system(size: 10))\n                                            .foregroundStyle(.red)\n                                            .frame(width: 10, alignment: .center)\n                                        Image(systemName: \"stop.circle.fill\")\n                                            .font(.system(size: 16))\n                                            .foregroundStyle(.white)\n                                            .frame(width: 16, alignment: .center)\n                                    }\n                                }).buttonStyle(.plain)\n                                if SCContext.streamType != .idevice {\n                                    Button(action: {\n                                        SCContext.pauseRecording()\n                                    }, label: {\n                                        Image(systemName: popoverState.isPaused ? \"play.circle.fill\" : \"pause.circle.fill\")\n                                            .font(.system(size: 16))\n                                            .foregroundStyle(.white)\n                                            .frame(width: 16, alignment: .center)\n                                    }).buttonStyle(.plain)\n                                } else {\n                                    Button(action:{\n                                        DispatchQueue.main.async {\n                                            if deviceWindow.isVisible { deviceWindow.close() } else { deviceWindow.orderFront(nil) }\n                                            deviceWindowIsShowing = deviceWindow.isVisible\n                                        }\n                                    }, label: {\n                                        Image(systemName: \"eye.circle.fill\")\n                                            .font(.system(size: 16))\n                                            .foregroundStyle(.white)\n                                            .frame(width: 16, alignment: .center)\n                                            .opacity(deviceWindowIsShowing ? 1 : 0.7)\n                                    }).buttonStyle(.plain)\n                                }\n                                if SCContext.streamType != .systemaudio && SCContext.streamType != .idevice && SCContext.streamType != .window {\n                                    Button(action:{\n                                        popoverState.isShowing = true\n                                    }, label: {\n                                        Image(systemName: \"camera.circle.fill\")\n                                            .font(.system(size: 16))\n                                            .foregroundStyle(.white)\n                                            .frame(width: 16, alignment: .center)\n                                    }).buttonStyle(.plain)\n                                }\n                            } else {\n                                Text(recordingLength)\n                                    .foregroundStyle(.white)\n                                    .font(.system(size: 15).monospaced())\n                                    .offset(x: 0.5)\n                            }\n                        } else {\n                            Group {\n                                Button(action: {\n                                    if SCContext.streamType == .idevice {\n                                        AVOutputClass.shared.stopRecording()\n                                    } else {\n                                        SCContext.stopRecording()\n                                    }\n                                }, label: {\n                                    ZStack {\n                                        Image(systemName: \"circle.fill\")\n                                            .font(.system(size: 10))\n                                            .foregroundStyle(.red)\n                                            .frame(width: 10, alignment: .center)\n                                        Image(systemName: \"stop.circle.fill\")\n                                            .font(.system(size: 16))\n                                            .foregroundStyle(.white)\n                                            .frame(width: 16, alignment: .center)\n                                    }\n                                }).buttonStyle(.plain)\n                                if SCContext.streamType != .idevice {//&& SCContext.streamType != .systemaudio {\n                                    Button(action: {\n                                        SCContext.pauseRecording()\n                                    }, label: {\n                                        Image(systemName: popoverState.isPaused ? \"play.circle.fill\" : \"pause.circle.fill\")\n                                            .font(.system(size: 16))\n                                            .foregroundStyle(.white)\n                                            .frame(width: 16, alignment: .center)\n                                    }).buttonStyle(.plain)\n                                }\n                                Text(recordingLength)\n                                    .foregroundStyle(.white)\n                                    .font(.system(size: 15).monospaced())\n                                    .offset(x: 0.5)\n                            }\n                        }\n                    }\n                }\n                .padding([.leading,.trailing], 4)\n                .popover(isPresented: $popoverState.isShowing, arrowEdge: .bottom) {\n                    CameraPopoverView(closePopover: { popoverState.isShowing = false })\n                }\n                .onReceive(updateTimer) { t in\n                    recordingLength = SCContext.getRecordingLength()\n                    let timePassed = Date.now.timeIntervalSince(SCContext.startTime ?? t)\n                    if SCContext.autoStop != 0 && timePassed / 60 >= CGFloat(SCContext.autoStop) { SCContext.stopRecording() }\n                    if let visible = statusBarItem.button?.window?.occlusionState.contains(.visible) {\n                        if visible { NSApp.windows.first(where: { $0.title == \"Recording Controller\".local })?.close(); return }\n                        if SCContext.streamType != nil  && !visible && !(NSApp.windows.first(where: { $0.title == \"Recording Controller\".local })?.isVisible ?? false) {\n                            guard let screen = SCContext.getScreenWithMouse() else { return }\n                            let width = getStatusBarWidth()\n                            let wX = (screen.frame.width - width) / 2\n                            let contentView = NSHostingView(rootView: StatusBarItem())\n                            contentView.frame = NSRect(x: wX, y: screen.visibleFrame.maxY, width: width, height: 24)\n                            controlPanel.setFrame(contentView.frame, display: true)\n                            controlPanel.contentView = contentView\n                            controlPanel.makeKeyAndOrderFront(nil)\n                        }\n                    }\n                }\n                if !miniStatusBar {\n                    if SCContext.streamType != .systemaudio {\n                        if SCContext.streamType != .idevice {\n                            Button(action:{\n                                popoverState.isShowing = true\n                            }, label: {\n                                ZStack {\n                                    Rectangle()\n                                        .fill(SCContext.isCameraRunning() ? Color.mygreen : .gray)\n                                        .shadow(color: .black.opacity(0.3), radius: 4)\n                                        .cornerRadius(4)\n                                    Image(\"camera\")\n                                        .foregroundStyle(.white)\n                                }.frame(width: 36).padding([.leading,.trailing], 4)\n                            }).buttonStyle(.plain)\n                        } else {\n                            Button(action:{\n                                DispatchQueue.main.async {\n                                    if deviceWindow.isVisible { deviceWindow.close() } else { deviceWindow.orderFront(nil) }\n                                }\n                            }, label: {\n                                ZStack {\n                                    Rectangle()\n                                        .fill(deviceWindow.isVisible ? Color.myblue : .gray.opacity(0.7))\n                                        .shadow(color: .black.opacity(0.3), radius: 4)\n                                        .cornerRadius(4)\n                                    Image(systemName: \"apps.ipad\")\n                                        .font(.system(size: 16))\n                                        .foregroundStyle(.white)\n                                }.frame(width: 36).padding([.leading,.trailing], 4)\n                            })\n                            .buttonStyle(.plain)\n                        }\n                    }\n                }\n            } else if ud.bool(forKey: \"showMenubar\") {\n                Button(action: {\n                    popoverState.isShowing = true\n                }, label: {\n                    ZStack {\n                        Color.white.opacity(0.0001)\n                        Image(systemName: \"dot.circle.and.hand.point.up.left.fill\")\n                            .font(.system(size: 14, weight: .medium))\n                            .offset(y: 1)\n                    }\n                })\n                .buttonStyle(.plain)\n                .popover(isPresented: $popoverState.isShowing, arrowEdge: .bottom) {\n                    if #available(macOS 13, *) {\n                        ContentViewNew().onAppear{ closeAllWindow() }\n                    } else {\n                        ContentView(fromStatusBar: true)\n                            .onAppear{\n                                closeAllWindow()\n                                if isMacOS12 { NSApp.activate(ignoringOtherApps: true) }\n                            }\n                    }\n                }\n            }\n        }\n        .onTapGesture {}\n        .onHover { hovering in\n            isHovering = hovering\n            hideMousePointer = hovering\n            hideScreenMagnifier = hovering\n        }\n    }\n}\n\nfunc updateStatusBar() {\n    DispatchQueue.main.asyncAfter(deadline: .now() + 0.2) {\n        if SCContext.streamType == nil && !ud.bool(forKey: \"showMenubar\") {\n            statusBarItem.isVisible = false\n            return\n        }\n        guard let button = statusBarItem.button else { return }\n        //let width = SCContext.streamType == nil ? 36 : ((SCContext.streamType == .idevice || SCContext.streamType == .systemaudio) ? 138 : 158)\n        let iconView = NSHostingView(rootView: StatusBarItem().padding(.top, isMacOS14 ? -2 : -1))\n        iconView.frame = NSRect(x: 0, y: 1, width: getStatusBarWidth(), height: isMacOS14 ? 22 : 21)\n        button.subviews = [iconView]\n        button.frame = iconView.frame\n        button.setAccessibilityLabel(\"QuickRecorder\")\n        statusBarItem.isVisible = true\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/SurpriseView.swift",
    "content": "//\n//  SurpriseView.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/12/12.\n//\n\nimport SwiftUI\n\nfunc isChineseNewYear() -> Bool {\n    let currentDate = Date()\n    let chineseCalendar = Calendar(identifier: .chinese)\n    let currentComponents = chineseCalendar.dateComponents([.month, .day], from: currentDate)\n    if currentComponents.month == 12 {\n        guard let nextDate = chineseCalendar.date(byAdding: .day, value: 1, to: currentDate),\n              let nextComponents = chineseCalendar.dateComponents([.month], from: nextDate).month else {\n            return false\n        }\n        if nextComponents == 1 { return true }\n    }\n    if currentComponents.month == 1 && currentComponents.day == 1 { return true }\n    return false\n}\n\nfunc isAllowChineseNewYear() -> Bool {\n    let allwoedRegions: Set<String> = [\"CN\", \"HK\", \"MO\", \"TW\", \"SG\", \"MY\", \"ID\", \"KR\", \"VN\", \"PH\"]\n    let currentRegionCode = Locale.current.regionCode ?? \"\"\n    return allwoedRegions.contains(currentRegionCode)\n}\n\nfunc isTodayChristmas() -> Bool {\n    let calendar = Calendar.current\n    let today = Date()\n    let components = calendar.dateComponents([.month, .day], from: today)\n    return (components.month == 12 && components.day == 24) || (components.month == 12 && components.day == 25)\n}\n\nfunc isAllowChristmas() -> Bool {\n    let disallowedRegions: Set<String> = [\n        \"SA\", \"AE\", \"SY\", \"YE\", \"LY\", \"DZ\", \"OM\", \"BN\", \"KP\",\n        \"SO\", \"MA\", \"TN\", \"QA\", \"DJ\", \"MR\", \"BH\", \"IL\", \"AL\",\n        \"AF\", \"AZ\", \"PK\", \"BF\", \"GM\", \"GN\", \"GW\", \"KM\", \"KW\",\n        \"ML\", \"BD\", \"NE\", \"SL\", \"SN\", \"TR\", \"IR\", \"ID\", \"MV\",\n        \"TD\", \"TM\", \"UZ\", \"SR\", \"GY\", \"TJ\", \"TG\"\n    ]\n    let currentRegionCode = Locale.current.regionCode ?? \"\"\n    return !disallowedRegions.contains(currentRegionCode)\n}\n\nstruct SurpriseView: NSViewRepresentable {\n    var snowflakes: [String]\n    var width: CGFloat\n    var height: CGFloat\n    var velocity: CGFloat = 12\n    var birthRate: Float = 1\n    var lifetime: Float = 24\n    var alphaSpeed: Float = -0.07\n    \n    func makeNSView(context: Context) -> NSView {\n        let view = NSView(frame: CGRect(x: 0, y: 0, width: width, height: height))\n        view.wantsLayer = true\n        view.layer?.masksToBounds = true\n        \n        let emitterLayer = CAEmitterLayer()\n        emitterLayer.frame = CGRect(x: 0, y: 0, width: view.frame.width, height: view.frame.height)\n        emitterLayer.emitterShape = .line\n        emitterLayer.emitterPosition = CGPoint(x: width / 2, y: height + 50)\n        emitterLayer.emitterSize = CGSize(width: width, height: 40) // 横向扩展整个屏幕\n        \n        emitterLayer.emitterMode = .surface\n        emitterLayer.renderMode = .oldestLast\n        \n        //let snowflakes = [\"snowflake1\", \"snowflake2\", \"snowflake3\", \"christmasTree1\", \"christmasTree2\"]\n        let cells = snowflakes.map { imageName -> CAEmitterCell in\n            let cell = CAEmitterCell()\n            cell.birthRate = birthRate\n            cell.lifetime = lifetime\n            cell.velocity = velocity\n            cell.velocityRange = 5\n            cell.scale = 0.4\n            cell.scaleRange = 0.5\n            cell.spin = 0.5\n            cell.spinRange = 0.3\n            cell.alphaRange = 0.6\n            cell.alphaSpeed = alphaSpeed\n            cell.emissionRange = CGFloat.pi / 2.5\n            cell.contents = NSImage(named: imageName)?.cgImage(forProposedRect: nil, context: nil, hints: nil)\n            return cell\n        }\n        \n        emitterLayer.emitterCells = cells\n        view.layer?.addSublayer(emitterLayer)\n        \n        return view\n    }\n    \n    func updateNSView(_ nsView: NSView, context: Context) {\n        // 在需要时更新视图\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/VideoEditor.swift",
    "content": "import UniformTypeIdentifiers\nimport UserNotifications\nimport SwiftUI\nimport AVKit\n\nclass RecorderPlayerModel: NSObject, ObservableObject {\n    @Published var playerView: AVPlayerView\n    var asset: AVAsset?\n    var fileUrl: URL?\n    var playerItem: AVPlayerItem!\n    var nsWindow: NSWindow?\n    \n    override init() {\n        self.playerView = AVPlayerView()\n        super.init()\n        self.playerView.player = AVPlayer()\n    }\n    \n    func loadVideo(fromUrl: URL, completion: @escaping () -> Void) {\n        fileUrl = fromUrl\n        asset = AVAsset(url: fromUrl)\n        guard let asset = asset else { return }\n        playerItem = AVPlayerItem(asset: asset)\n        playerView.player?.replaceCurrentItem(with: playerItem)\n        playerView.controlsStyle = .inline\n        \n        playerItem.addObserver(self, forKeyPath: #keyPath(AVPlayerItem.status), options: [.new], context: nil)\n        \n        let checkCanBeginTrimming: () -> Void = {\n            if self.playerView.canBeginTrimming {\n                completion()\n            }\n        }\n        \n        NotificationCenter.default.addObserver(forName: .AVPlayerItemTimeJumped, object: playerItem, queue: nil) { _ in\n            checkCanBeginTrimming()\n        }\n    }\n    \n    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {\n        guard let playerItem = object as? AVPlayerItem, keyPath == #keyPath(AVPlayerItem.status) else {\n            super.observeValue(forKeyPath: keyPath, of: object, change: change, context: context)\n            return\n        }\n        \n        if playerItem.status == .readyToPlay {\n            let checkCanBeginTrimming: () -> Void = {\n                if self.playerView.canBeginTrimming {\n                    self.playerView.beginTrimming { result in\n                        if result == .okButton {\n                            guard let fileUrl = self.fileUrl else { return }\n                            let startTime = playerItem.reversePlaybackEndTime\n                            let endTime = playerItem.forwardPlaybackEndTime\n                            let timeRange = CMTimeRangeFromTimeToTime(start: startTime, end: endTime)\n                            guard let asset = self.asset else { return }\n                            let exportSession = AVAssetExportSession(asset: asset, presetName: AVAssetExportPresetPassthrough)\n                            let dateFormatter = DateFormatter()\n                            let fileEnding = fileUrl.pathExtension.lowercased()\n                            var fileType: AVFileType?\n                            switch fileEnding {\n                                case VideoFormat.mov.rawValue: fileType = AVFileType.mov\n                                case VideoFormat.mp4.rawValue: fileType = AVFileType.mp4\n                                default: assertionFailure(\"loaded unknown video format\".local)\n                            }\n                            dateFormatter.dateFormat = \"y-MM-dd HH.mm.ss\"\n                            var path: String?\n                            path = fileUrl.deletingPathExtension().path\n                            guard let path = path else { return }\n                            let filePath = path.removingPercentEncoding! + \" (Cropped in \".local + \"\\(dateFormatter.string(from: Date()))).\" + fileEnding\n                            exportSession?.outputURL = filePath.url\n                            exportSession?.outputFileType = fileType\n                            exportSession?.timeRange = timeRange\n                            exportSession?.exportAsynchronously {\n                                if let error = exportSession?.error {\n                                    print(\"Error: \\(error.localizedDescription)\")\n                                } else {\n                                    print(\"Trimmed video exported successfully.\")\n                                    let content = UNMutableNotificationContent()\n                                    content.title = \"Clip Saved\".local\n                                    content.body = String(format: \"File saved to: %@\".local, filePath)\n                                    content.sound = UNNotificationSound.default\n                                    let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 1, repeats: false)\n                                    let request = UNNotificationRequest(identifier: \"quickrecorder.completed.\\(UUID().uuidString)\", content: content, trigger: trigger)\n                                    UNUserNotificationCenter.current().add(request) { error in\n                                        if let error = error { print(\"Notification failed to send：\\(error.localizedDescription)\") }\n                                    }\n                                }\n                            }\n                            self.nsWindow?.close()\n                        } else {\n                            self.nsWindow?.close()\n                        }\n                    }\n                }\n            }\n            \n            checkCanBeginTrimming()\n\n            playerItem.removeObserver(self, forKeyPath: #keyPath(AVPlayerItem.status))\n        }\n    }\n    \n    func cleanup() {\n        // 移除所有观察者\n        playerItem.removeObserver(self, forKeyPath: #keyPath(AVPlayerItem.status))\n        playerView.player?.pause()\n        playerView.player = nil // 移除 player 对象\n    }\n}\n\nstruct RecorderPlayerView: NSViewRepresentable {\n    typealias NSViewType = AVPlayerView\n\n    var playerView: AVPlayerView\n\n    func makeNSView(context: Context) -> AVPlayerView {\n        return playerView\n    }\n\n    func updateNSView(_ nsView: AVPlayerView, context: Context) {}\n\n}\n\nstruct VideoTrimmerView: View {\n    let videoURL: URL\n    @StateObject var playerViewModel: RecorderPlayerModel = .init()\n\n    var body: some View {\n        VStack {\n            HStack {\n                Image(systemName: \"timeline.selection\")\n                    .font(.system(size: 13, weight: .bold))\n                    .offset(y: 0.5)\n                Text(videoURL.lastPathComponent)\n                    .font(.system(size: 13, weight: .bold))\n            }\n            ZStack {\n                RecorderPlayerView(playerView: playerViewModel.playerView)\n                    .onAppear {playerViewModel.loadVideo(fromUrl: videoURL) {}}\n                    .padding(4)\n                    .background(\n                        Rectangle()\n                            .foregroundStyle(.black)\n                            .cornerRadius(5)\n                    )\n            }.padding([.bottom, .leading, .trailing])\n        }\n        .padding(.top, -22)\n        .background(WindowAccessor(onWindowOpen: { window in\n            window?.styleMask.insert(.resizable)\n            playerViewModel.nsWindow = window\n            SCContext.trimingList.append(videoURL)\n        }, onWindowClose: {\n            playerViewModel.playerView.player?.replaceCurrentItem(with: nil)\n            playerViewModel.playerView.player = nil\n            SCContext.trimingList.removeAll(where: { $0 == videoURL })\n        }))\n        //.navigationTitle(videoURL.lastPathComponent)\n        //.preferredColorScheme(.dark)\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/WinSelector.swift",
    "content": "//\n//  WinSelector.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/4/17.\n//\n\nimport SwiftUI\nimport Foundation\nimport AVFoundation\nimport ScreenCaptureKit\n\nstruct WinSelector: View {\n    @Environment(\\.colorScheme) var colorScheme\n    @StateObject var viewModel = WindowSelectorViewModel()\n    @State private var selected = [SCWindow]()\n    @State private var display: SCDisplay!\n    @State private var selectedTab = 0\n    @State private var isPopoverShowing = false\n    @State private var isPopoverShowing2 = false\n    @State private var disableFilter = false\n    @State private var donotCapture = false\n    @State private var autoStop = 0\n    var appDelegate = AppDelegate.shared\n    \n    var body: some View {\n        ZStack {\n            VStack(spacing: 15) {\n                if #available(macOS 15, *) {\n                    Text(\"Please select the window(s) to record\").offset(y: 12)\n                } else {\n                    HStack {\n                        Spacer()\n                        Text(\"Please select the window(s) to record\")\n                        Spacer()\n                        HoverButton(action: {\n                            WindowHighlighter.shared.registerMouseMonitor(mode: 2)\n                        }, label: {\n                            ZStack {\n                                Color.white.opacity(0.0001)\n                                Image(\"window.select\")\n                                    .resizable().scaledToFit()\n                            }.frame(width: 20, height: 20)\n                        })\n                        .help(\"Select Window Directly\")\n                        .padding(.leading, -20)\n                    }.padding(.horizontal, 10)\n                }\n                TabView(selection: $selectedTab) {\n                    let allApps = viewModel.windowThumbnails.sorted(by: { $0.key.displayID < $1.key.displayID })\n                    ForEach(allApps, id: \\.key) { element in\n                        let (screen, thumbnails) = element\n                        let index = allApps.firstIndex(where: { $0.key == screen }) ?? 0\n                        ScrollView(.vertical) {\n                            VStack(spacing: 0) {\n                                ForEach(0..<thumbnails.count/4 + 1, id: \\.self) { rowIndex in\n                                    HStack(spacing: 16.5) {\n                                        ForEach(0..<4, id: \\.self) { columnIndex in\n                                            let index = 4 * rowIndex + columnIndex\n                                            if index <= thumbnails.count - 1 {\n                                                let item = thumbnails[index]\n                                                Button(action: {\n                                                    if !selected.contains(item.window) {\n                                                        selected.append(item.window)\n                                                    } else {\n                                                        selected.removeAll{ $0 == item.window }\n                                                    }\n                                                }, label: {\n                                                    VStack(spacing: 1){\n                                                        ZStack{\n                                                            if colorScheme == .light {\n                                                                Image(nsImage: item.image)\n                                                                    .resizable()\n                                                                    .aspectRatio(contentMode: .fit)\n                                                                    .colorMultiply(.black)\n                                                                    .blur(radius: 0.5)\n                                                                    .opacity(1)\n                                                                    .frame(width: 160, height: 90, alignment: .center)\n                                                            } else {\n                                                                Image(nsImage: item.image)\n                                                                    .resizable()\n                                                                    .aspectRatio(contentMode: .fit)\n                                                                    .colorMultiply(.black)\n                                                                    .colorInvert()\n                                                                    .blur(radius: 0.5)\n                                                                    .opacity(1)\n                                                                    .frame(width: 160, height: 90, alignment: .center)\n                                                            }\n                                                            Image(nsImage: item.image)\n                                                                .resizable()\n                                                                .aspectRatio(contentMode: .fit)\n                                                                .frame(width: 160, height: 90, alignment: .center)\n                                                            Image(systemName: \"circle.fill\")\n                                                                .font(.system(size: 31))\n                                                                .foregroundStyle(.white)\n                                                                .opacity(selected.contains(item.window) ? 1.0 : 0.0)\n                                                                .offset(x: 55, y: 25)\n                                                            Image(systemName: \"checkmark.circle.fill\")\n                                                                .font(.system(size: 27))\n                                                                .foregroundStyle(.green)\n                                                                .opacity(selected.contains(item.window) ? 1.0 : 0.0)\n                                                                .offset(x: 55, y: 25)\n                                                            Image(nsImage: SCContext.getAppIcon(item.window.owningApplication!)!)\n                                                                .resizable()\n                                                                .aspectRatio(contentMode: .fit)\n                                                                .frame(width: 40, height: 40, alignment: .center)\n                                                                .offset(y: 35)\n                                                        }\n                                                        .padding(5)\n                                                        .padding(.vertical, 5)\n                                                        .background(\n                                                            Rectangle()\n                                                                .foregroundStyle(.blue)\n                                                                .cornerRadius(5)\n                                                                .opacity(selected.contains(item.window) ? 0.2 : 0.0001)\n                                                        )\n                                                        Text(item.window.title!)\n                                                            .font(.system(size: 12))\n                                                            .foregroundStyle(.secondary)\n                                                            .lineLimit(1)\n                                                            .truncationMode(.tail)\n                                                            .frame(width: 160)\n                                                    }\n                                                }).buttonStyle(.plain)\n                                            }\n                                        }\n                                    }\n                                    .frame(maxWidth: .infinity, alignment: .leading)\n                                    .padding(.leading, 12).padding(.top, 5)\n                                }\n                            }\n                        }\n                        .tag(index)\n                        .tabItem { Text(screen.nsScreen?.localizedName ?? (\"Display \".local + \"\\(index)\")) }\n                        .onAppear{ display = screen }\n                    }\n                }\n                .frame(height: 445)\n                .padding(.horizontal, 10)\n                .onChange(of: selectedTab) { _ in selected.removeAll() }\n                .onReceive(viewModel.$isReady) { isReady in\n                    if isReady {\n                        let allApps = viewModel.windowThumbnails.sorted(by: { $0.key.displayID < $1.key.displayID })\n                        if let s = NSApp.windows.first(where: { $0.title == \"Window Selector\".local })?.screen,\n                           let index = allApps.firstIndex(where: { $0.key.displayID == s.displayID }) {\n                            selectedTab = index\n                        }\n                    }\n                }\n                HStack(spacing: 4) {\n                    Button(action: {\n                        self.viewModel.setupStreams(filter: !disableFilter, capture: !donotCapture)\n                        self.selected.removeAll()\n                    }, label: {\n                        VStack{\n                            Image(systemName: \"arrow.clockwise.circle.fill\")\n                                .font(.system(size: 36))\n                                .foregroundStyle(.blue)\n                            Text(\"Refresh\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                        \n                    }).buttonStyle(.plain)\n                    Button(action: {\n                        isPopoverShowing2 = true\n                    }, label: {\n                        Image(systemName: \"chevron.down\")\n                            .font(.system(size: 11, weight: .bold))\n                            .foregroundStyle(.blue)\n                    })\n                    .buttonStyle(.plain)\n                    .padding(.top, 42.5)\n                    .popover(isPresented: $isPopoverShowing2, arrowEdge: .bottom, content: {\n                        VStack(alignment: .leading) {\n                            Toggle(isOn: $disableFilter) { Text(\"Show Windows with No Title\") }\n                                .toggleStyle(.checkbox)\n                                .onChange(of: disableFilter) { _ in\n                                    self.viewModel.setupStreams(filter: !disableFilter, capture: !donotCapture)\n                                    self.selected.removeAll()\n                                }\n                            Toggle(isOn: $donotCapture) { Text(\"Don't Create Thumbnails\") }\n                                .toggleStyle(.checkbox)\n                                .onChange(of: donotCapture) { _ in\n                                    self.viewModel.setupStreams(filter: !disableFilter, capture: !donotCapture)\n                                    self.selected.removeAll()\n                                }\n                        }\n                        .fixedSize()\n                        .padding()\n                    })\n                    Spacer()\n                    OptionsView()\n                    Spacer()\n                    Button(action: {\n                        isPopoverShowing = true\n                    }, label: {\n                        Image(systemName: \"timer\")\n                            .font(.system(size: 11, weight: .bold))\n                            .foregroundStyle(.blue)\n                    })\n                    .buttonStyle(.plain)\n                    .padding(.top, 42.5)\n                    .popover(isPresented: $isPopoverShowing, arrowEdge: .bottom, content: {\n                        HStack {\n                            Text(\" Stop after\".local)\n                            TextField(\"\", value: $autoStop, formatter: NumberFormatter())\n                                .textFieldStyle(RoundedBorderTextFieldStyle())\n                            Stepper(\"\", value: $autoStop)\n                                .padding(.leading, -10)\n                            Text(\"minutes \".local)\n                        }\n                        .fixedSize()\n                        .padding()\n                    })\n                    Button(action: {\n                        startRecording()\n                    }, label: {\n                        VStack{\n                            Image(systemName: \"record.circle.fill\")\n                                .font(.system(size: 36))\n                                .foregroundStyle(.red)\n                            Text(\"Start\")\n                                .foregroundStyle(.secondary)\n                                .font(.system(size: 12))\n                        }\n                    })\n                    .buttonStyle(.plain)\n                    .disabled(selected.count < 1)\n                }.padding(.horizontal, 40)\n                Spacer()\n            }.padding(.top, -5)\n        }\n        .frame(width: 780, height:555)\n        .toolbar {\n            ToolbarItem(placement: .automatic) {\n                HoverButton(action: {\n                    WindowHighlighter.shared.registerMouseMonitor()\n                }, label: {\n                    Image(\"window.select\")\n                        .resizable().scaledToFit()\n                        .frame(width: 20)\n                }).help(\"Select Window Directly\")\n            }\n        }\n    }\n    \n    func startRecording() {\n        closeAllWindow()\n        appDelegate.createCountdownPanel(screen: display) {\n            SCContext.autoStop = autoStop\n            appDelegate.prepRecord(type: (selected.count<2 ? \"window\" : \"windows\") , screens: display, windows: selected, applications: nil)\n        }\n    }\n}\n\nclass WindowSelectorViewModel: NSObject, ObservableObject, SCStreamDelegate, SCStreamOutput {\n    @Published var windowThumbnails = [SCDisplay:[WindowThumbnail]]()\n    @Published var isReady = false\n    private var allWindows = [SCWindow]()\n    private var streams = [SCStream]()\n    \n    override init() {\n        super.init()\n        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {\n            self.setupStreams()\n        }\n    }\n    \n    func stream(_ stream: SCStream, didOutputSampleBuffer sampleBuffer: CMSampleBuffer, of type: SCStreamOutputType) {\n        if CMSampleBufferGetImageBuffer(sampleBuffer) == nil { return }\n        let nsImage = sampleBuffer.nsImage ?? NSImage.unknowScreen\n        if let index = self.streams.firstIndex(of: stream), index + 1 <= self.allWindows.count {\n            let currentWindow = self.allWindows[index]\n            let thumbnail = WindowThumbnail(image: nsImage, window: currentWindow)\n            guard let displays = SCContext.availableContent?.displays.filter({ NSIntersectsRect(currentWindow.frame, $0.frame) }) else {\n                self.streams[index].stopCapture()\n                return\n            }\n            for d in displays {\n                DispatchQueue.main.async {\n                    if self.windowThumbnails[d] != nil {\n                        if !self.windowThumbnails[d]!.contains(where: { $0.window == currentWindow }) { self.windowThumbnails[d]!.append(thumbnail) }\n                    } else {\n                        self.windowThumbnails[d] = [thumbnail]\n                    }\n                }\n            }\n            DispatchQueue.global().asyncAfter(deadline: .now() + 0.1) { self.streams[index].stopCapture() }\n            if index + 1 == self.streams.count { DispatchQueue.main.async { self.isReady = true }}\n        }\n    }\n\n    func setupStreams(filter: Bool = true, capture: Bool = true) {\n        SCContext.updateAvailableContent {\n            Task {\n                do {\n                    self.streams.removeAll()\n                    DispatchQueue.main.async { self.windowThumbnails.removeAll() }\n                    self.allWindows = SCContext.getWindows().filter({\n                        !($0.title == \"\" && $0.owningApplication?.bundleIdentifier == \"com.apple.finder\")\n                        && $0.owningApplication?.bundleIdentifier != Bundle.main.bundleIdentifier\n                        && $0.owningApplication?.applicationName != \"\"\n                    })\n                    if filter { self.allWindows = self.allWindows.filter({ $0.title != \"\" }) }\n                    if capture {\n                        let contentFilters = self.allWindows.map { SCContentFilter(desktopIndependentWindow: $0) }\n                        for (index, contentFilter) in contentFilters.enumerated() {\n                            let streamConfiguration = SCStreamConfiguration()\n                            let width = self.allWindows[index].frame.width\n                            let height = self.allWindows[index].frame.height\n                            var factor = 0.5\n                            if width < 200 && height < 200 { factor = 1.0 }\n                            streamConfiguration.width = Int(width * factor)\n                            streamConfiguration.height = Int(height * factor)\n                            streamConfiguration.minimumFrameInterval = CMTime(value: 1, timescale: CMTimeScale(1))\n                            streamConfiguration.pixelFormat = kCVPixelFormatType_32BGRA\n                            if #available(macOS 13, *) { streamConfiguration.capturesAudio = false }\n                            streamConfiguration.showsCursor = false\n                            streamConfiguration.scalesToFit = true\n                            streamConfiguration.queueDepth = 3\n                            let stream = SCStream(filter: contentFilter, configuration: streamConfiguration, delegate: self)\n                            try stream.addStreamOutput(self, type: .screen, sampleHandlerQueue: .main)\n                            try await stream.startCapture()\n                            self.streams.append(stream)\n                        }\n                    } else {\n                        for w in self.allWindows {\n                            let thumbnail = WindowThumbnail(image: NSImage.unknowScreen, window: w)\n                            guard let displays = SCContext.availableContent?.displays.filter({ NSIntersectsRect(w.frame, $0.frame) }) else { break }\n                            for d in displays {\n                                DispatchQueue.main.async {\n                                    if self.windowThumbnails[d] != nil {\n                                        if !self.windowThumbnails[d]!.contains(where: { $0.window == w }) {\n                                            self.windowThumbnails[d]!.append(thumbnail)\n                                        }\n                                    } else {\n                                        self.windowThumbnails[d] = [thumbnail]\n                                    }\n                                }\n                            }\n                        }\n                        DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) { self.isReady = true }\n                    }\n                } catch {\n                    print(\"Get windowshot error：\\(error)\")\n                }\n            }\n        }\n    }\n}\n\nclass WindowThumbnail {\n    let image: NSImage\n    let window: SCWindow\n\n    init(image: NSImage, window: SCWindow) {\n        self.image = image\n        self.window = window\n    }\n}\n"
  },
  {
    "path": "QuickRecorder/ViewModel/iDeviceSelector.swift",
    "content": "//\n//  iDeviceSelector.swift\n//  QuickRecorder\n//\n//  Created by apple on 2024/5/1.\n//\n\nimport SwiftUI\nimport AVFoundation\n\nextension AppDelegate {\n    func startDeviceOverlayer(size: NSSize = NSSize(width: 200, height: 200)){\n        guard let screen = SCContext.getScreenWithMouse() else { return }\n        let frame = NSRect(x: (screen.visibleFrame.width-size.width)/2+screen.frame.minX, y: (screen.visibleFrame.height-size.height)/2+screen.frame.minY, width: size.width, height: size.height)\n        deviceWindow.contentView = NSHostingView(rootView: SwiftCameraView(type: .idevice))\n        deviceWindow.setFrame(frame, display: true)\n        deviceWindow.contentView?.wantsLayer = true\n        deviceWindow.contentView?.layer?.cornerRadius = 5\n        deviceWindow.contentView?.layer?.masksToBounds = true\n        deviceWindow.orderFront(self)\n    }\n}\n\nstruct iDevicePopoverView: View {\n    var closePopover: () -> Void\n    @State private var devices = SCContext.getiDevice()\n    @State private var hoverIndex = -1\n    @State private var mute = false\n    @State private var preset = AVCaptureSession.Preset.high\n    //@NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate\n    var appDelegate = AppDelegate.shared\n    \n    var body: some View {\n        VStack( alignment: .center, spacing: 0) {\n            if devices.count < 1 {\n                HStack {\n                    ZStack {\n                        Circle().frame(width: 26)\n                            .foregroundStyle(.primary)\n                            .opacity(0.2)\n                        Image(systemName:\"iphone.slash\")\n                            .foregroundStyle(.primary)\n                            .font(.system(size: 12))\n                    }.padding(.leading, 9)\n                    Text(\"No Devices Found!\")\n                        .padding(.vertical, 8).padding(.trailing, 10)\n                }\n                .frame(maxWidth: .infinity)\n                Divider().padding(.vertical, 5)\n                Text(\"Connect your device via USB\")\n                    .font(.system(size: 10))\n                    .foregroundStyle(.secondary)\n                    .padding(.bottom, 1)\n            } else {\n                ForEach(devices.indices, id: \\.self) { index in\n                    Button(action: {\n                        closePopover()\n                        closeAllWindow()\n                        DispatchQueue.global().async {\n                            AVOutputClass.shared.startRecording(with: devices[index], mute: mute, preset: preset)\n                        }\n                    }, label: {\n                        HStack {\n                            ZStack {\n                                Circle().frame(width: 26)\n                                    .foregroundStyle(.primary)\n                                    .opacity(0.2)\n                                Image(systemName:\"apple.logo\")\n                                    .foregroundStyle(.primary)\n                                    .font(.system(size: 12))\n                                    .offset(x: -0.5, y:  -0.5)\n                            }.padding(.leading, 9)\n                            Text(devices[index].localizedName)\n                                .padding(.vertical, 8).padding(.trailing, 10)\n                            Spacer()\n                        }\n                        .frame(maxWidth: .infinity)\n                        .background(\n                            RoundedRectangle(cornerRadius: 5)\n                                .foregroundStyle(.primary)\n                                .opacity(hoverIndex == index ? 0.2 : 0.0)\n                        )\n                        .onHover{ hovering in\n                            if hoverIndex != index { hoverIndex = index }\n                            if !hovering { hoverIndex = -1 }\n                        }\n                    }).buttonStyle(.plain)\n                }\n                Divider().padding(.top, 5)\n                HStack(spacing: 0) {\n                    Text(\"Mute\").font(.system(size: 10)).foregroundStyle(.secondary).padding(.trailing, 6)\n                    Toggle(isOn: $mute) {}\n                        .toggleStyle(.checkbox)\n                        .scaleEffect(0.83)\n                    Spacer()\n                    Text(\"Preset\").font(.system(size: 10)).foregroundStyle(.secondary).padding(.trailing, -10)\n                    Picker(\"\", selection: $preset) {\n                        Text(\"Low\".local).tag(AVCaptureSession.Preset.low)\n                        Text(\"Medium\".local).tag(AVCaptureSession.Preset.medium)\n                        Text(\"High\".local).tag(AVCaptureSession.Preset.high)\n                    }\n                    .buttonStyle(.borderless)\n                    .scaleEffect(0.7)\n                    .offset(y: -0.5)\n                }.padding(.vertical, 4).padding(.leading, 10)\n                Text(\"If you are on a call, enable \\\"Mute\\\"\")\n                    .font(.system(size: 10))\n                    .foregroundStyle(.secondary)\n                    .padding(.bottom, 1)\n            }\n        }.padding(5)\n    }\n}\n\nstruct ActivityIndicator: View {\n    \n    @State var currentDegrees = 0.0\n    \n    let colorGradient = LinearGradient(gradient: Gradient(colors: [\n        .secondary, .secondary.opacity(0.75), .secondary.opacity(0.5), .secondary.opacity(0.2), .clear\n    ]), startPoint: .leading, endPoint: .trailing)\n    \n    var body: some View {\n        Circle()\n            .trim(from: 0.0, to: 0.85)\n            .stroke(colorGradient, style: StrokeStyle(lineWidth: 3))\n            .frame(width: 18, height: 18)\n            .rotationEffect(Angle(degrees: currentDegrees))\n            .onAppear {\n                Timer.scheduledTimer(withTimeInterval: 0.05, repeats: true) { _ in\n                    withAnimation {\n                        self.currentDegrees += 10\n                    }\n                }\n            }\n    }\n}\n\n\n"
  },
  {
    "path": "QuickRecorder/it.lproj/Credits.rtf",
    "content": "{\\rtf1\\ansi\\ansicpg1252\\cocoartf2761\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl\\f0\\fnil\\fcharset134 PingFangSC-Semibold;\\f1\\fnil\\fcharset134 PingFangSC-Regular;}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;}\n\\paperw12240\\paperh15840\\margl1440\\margr1440\\vieww9000\\viewh8400\\viewkind0\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\\partightenfactor0\n\n\\f0\\b\\fs24 \\cf0 Un leggero registratore per lo schermo basato su ScreenCapture Kit\\\n\n\\f1\\b0\\fs10 \\\n\n\\fs20 Vedi il codice sorgente su {\\field{\\*\\fldinst{HYPERLINK \"https://github.com/lihaoyun6/QuickRecorder\"}}{\\fldrslt Github}}}"
  },
  {
    "path": "QuickRecorder/zh-Hans.lproj/Credits.rtf",
    "content": "{\\rtf1\\ansi\\ansicpg936\\cocoartf2761\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl\\f0\\fnil\\fcharset134 PingFangSC-Semibold;\\f1\\fnil\\fcharset134 PingFangSC-Regular;}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;}\n\\paperw12240\\paperh15840\\margl1440\\margr1440\\vieww9000\\viewh8400\\viewkind0\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\\partightenfactor0\n\n\\f0\\b\\fs24 \\cf0 \\'bb\\'f9\\'d3\\'da ScreenCapture Kit \\'b5\\'c4\\'b6\\'e0\\'b9\\'a6\\'c4\\'dc\\'c2\\'bc\\'c6\\'c1\\'b9\\'a4\\'be\\'df\\\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\\partightenfactor0\n\n\\f1\\b0\\fs10 \\cf0 \\\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\\partightenfactor0\n\n\\fs20 \\cf0 \\'d4\\'b4\\'b4\\'fa\\'c2\\'eb\\'cd\\'d0\\'b9\\'dc\\'d3\\'da {\\field{\\*\\fldinst{HYPERLINK \"https://github.com/lihaoyun6/QuickRecorder\"}}{\\fldrslt Github}}}"
  },
  {
    "path": "QuickRecorder/zh-Hans.lproj/InfoPlist.strings",
    "content": "/* \n  InfoPlist.strings\n  QuickRecorder\n\n  Created by apple on 2024/4/28.\n  \n*/\n\"NSMicrophoneUsageDescription\" = \"QuickRecorder 需要使用此权限以录制来自麦克风的声音.\";\n\"NSCameraUsageDescription\" = \"QuickRecorder 需要使用此权限以录制来自摄像头或移动设备的画面.\";\n\"NSHumanReadableCopyright\" = \"版权所有 © 2024 lihaoyun6. 保留所有权利.\";\n"
  },
  {
    "path": "QuickRecorder/zh-Hans.lproj/Localizable.strings",
    "content": "/* \n  Localizable.strings\n  QuickRecorder\n\n  Created by lihaoyun6 on 2024/4/16.\n*/\n\n\"System Audio\" = \"录制系统声音\";\n\"System Audio \" = \"系统声音\";\n\"Screen Area\" = \"录制屏幕区域\";\n\"Screen\" = \"录制全屏画面\";\n\"Application\" = \"录制应用程序\";\n\"Window\" = \"录制窗口内容\";\n//\"Camera\" = \"录制摄像头\";\n\"Mobile Device\" = \"录制移动设备\";\n\"Preferences\" = \"偏好设置\";\n\"No Title\" = \"无标题\";\n\"Display \" = \"显示器\";\n\"Select Applications\" = \"选择应用程序\";\n\"Permission Required\" = \"需要授权\";\n\"Compatibility Warning\" = \"兼容性警告\";\n\"You are using macOS 12.7.4\\nOutput files will be randomly corrupted on this version of macOS!\\n\\nPlease upgrade to 12.7.5 to solve it.\" = \"检测到当前系统版本为 macOS 12.7.4\\nQuickRecorder 在当前系统版本中会\\n随机出现录像文件保存失败的情况!\\n\\n请升级至 macOS 12.7.5 以解决此问题.\";\n\"QuickRecorder needs screen recording permissions, even if you only intend on recording audio.\" = \"QuickRecorder 需要获取录屏权限\\n(即使只是用来录制音频)\";\n\"QuickRecorder needs permission to record your microphone.\" = \"QuickRecorder 需要获取麦克风权限来录制所需的声音\";\n\"Please select a folder to save output files\" = \"请选择录音/录屏文件的保存位置\";\n\"Open Settings\" = \"打开系统设置\";\n\"Quit\" = \"退出程序\";\n\"Cancel\" = \"取消\";\n\"Please select the App(s) to record\" = \"请选择需要录制的应用程序, 支持多选\";\n\"Please select the window(s) to record\" = \"请选择需要录制的窗口, 支持多选\";\n\"Please select the screen to record\" = \"请选择需要录制的屏幕, 仅支持单选\";\n\"Refresh\" = \"刷新列表\";\n\"Start\" = \"开始录制\";\n\"Resolution\" = \"清晰度\";\n\"Frame Rate\" = \"帧速率\";\n\"Auto\" = \"自动\";\n\"High (auto)\" = \"高 (自动)\";\n\"Normal (1x)\" = \"普通 (1x)\";\n//\"Low (0.5x)\" = \"低 (0.5x)\";\n\"Quality\" = \"输出质量\";\n\"Format\" = \"输出格式\";\n\"Encoder\" = \"编码方式\";\n\"Low\" = \"低画质\";\n\"Medium\" = \"中画质\";\n\"High\" = \"高画质\";\n\"Save Current Frame\" = \"保存当前帧截图\";\n\"Record Cursor\" = \"录制鼠标光标\";\n\"System Audio\" = \"录制系统声音\";\n\"App's Audio\" = \"录制App声音\";\n\"Microphone\" = \"录制麦克风\";\n\"Background\" = \"画面背景\";\n\"Wallpaper\" = \"桌面壁纸\";\n\"Transparent\" = \"透明\";\n\"Yellow\" = \"系统黄色\";\n\"Green\" = \"系统绿色\";\n\"Blue\" = \"系统蓝色\";\n\"Red\" = \"系统红色\";\n\"Gray\" = \"中灰色\";\n\"Black\" = \"纯黑色\";\n\"White\" = \"纯白色\";\n\"Orange\" = \"系统橙色\";\n\"Custom\" = \"用户预设\";\n\"Area Size:\" = \"选区尺寸:\";\n\"Output Size:\" = \"输出尺寸:\";\n\"Audio\" = \"音频设置\";\n\"Video\" = \"视频设置\";\n\"Save\" = \"保存位置\";\n\"Exclude QuickRecorder itself\" = \"排除QuickRecorder窗口\";\n\"Highlight the Mouse Cursor\" = \"高亮显示鼠标指针\";\n\"Not available for \\\"Single Window Capture\\\"\" = \"此功能在录制单个窗口时不可用\";\n\"Normal - 128Kbps\" = \"标准 - 128Kbps\";\n\"Good - 192Kbps\" = \"优质 - 192Kbps\";\n\"High - 256Kbps\" = \"高清 - 256Kbps\";\n\"Extreme - 320Kbps\" = \"极致 - 320Kbps\";\n\"Other Settings\" = \"其他设置\";\n\"Opus doesn't support MP4, it will fall back to AAC\" = \"同时使用Opus和MP4格式时, 音频编码将回落至AAC\";\n\"Record Microphone to Main Track\" = \"将麦克风录制到主音轨\";\n\"If enabled, all files on the Desktop will be hidden from the video when recording.\" = \"启用此选项后, 当录制\\\"屏幕画面\\\"或\\\"访达\\\"程序时, 桌面上的所有文件将会从录制画面中被隐藏.\";\n\"These apps will be excluded when recording \\\"Screen\\\" or \\\"Screen Area\\\"\\nBut if the app is launched after the recording starts, it cannot be excluded.\" = \"在录制 \\\"全屏画面\\\" 或 \\\"屏幕区域\\\" 的时候将不会录制这些 App 的画面\\n但如果列表中的 App 在录屏开始后才被启动, 则无法被排除在录制画面之外.\";\n\"Exclude Files on Desktop\" = \"隐藏桌面文件图标\";\n\"Recording with Alpha Channel\" = \"在输出中包含 Alpha 通道\";\n\"Delay Before Recording\" = \"开始录制前倒数 (秒)\";\n\"s\" = \"秒\";\n\"Close\" = \"关闭\";\n\"Custom Background Color\" = \"用户预设颜色 (自定义背景)\";\n\"File size: %@\" = \"文件大小: %@\";\n\"Recording: \" = \"正在录制: \";\n\"Preferences…\" = \"设置…\";\n\"Quit QuickRecorder\" = \"退出QuickRecorder\";\n\"Multiple Windows\" = \"多个窗口\";\n\"Multiple Apps\" = \"多个应用\";\n\"Unknown App\" = \"未知应用\";\n\"A Window\" = \"单个窗口\";\n\"Output Folder\" = \"文件保存位置\";\n\"Currently set to \\\"%@\\\"\" = \"当前保存在 \\\"%@\\\"\";\n\"/Recording at \" = \"/录制于 \";\n\"/Capturing at \" = \"/捕获于 \";\n\" (Cropped in \" = \" (修剪于 \";\n\"Recording Completed\" = \"录制结束\";\n\"Clip Saved\" = \"剪辑已保存\";\n\"File saved to: %@\" = \"文件已保存至: %@\";\n\"File saved to folder: %@\" = \"文件已保存到: %@ 目录中\";\n\"Startup\" = \"启动设置\";\n\"Update\" = \"更新设置\";\n\"Launch at Login\" = \"登录时启动\";\n\"Shortcuts Settings\" = \"快捷键设置\";\n\"Pause / Resume\" = \"暂停/继续录制\";\n\"Stop Recording\" = \"结束屏幕录制\";\n\"Record System Audio\" = \"立即录制系统声音\";\n\"Record Current Screen\" = \"立即录制当前屏幕\";\n\"Record Topmost Window\" = \"立即录制当前窗口\";\n\"Select Area to Record\" = \"选择屏幕区域以录制\";\n\"Toggle Screen Magnifier\" = \"显示/隐藏屏幕放大器\";\n\"Waiting on update…\" = \"正在更新, 请稍等…\";\n\"Include Menu Bar in Recording\" = \"录制菜单栏画面\";\n\"Excluded Apps\" = \"App 排除列表\";\n\"Record with Camera:\" = \"录制摄像头:\";\n\"Presenter Overlay Camera:\" = \"\\\"演讲者前置\\\"摄像头:\";\n//\"Can only be turned off on macOS 14.2 or later!\" = \"此选项仅 macOS 14.2 或更高版本系统可中可被关闭!\";\n\"Presenter Overlay Delay\" = \"演讲者前置延迟 (秒)\";\n\"Open video trimmer after recording\" = \"录制结束后自动打开修剪器\";\n\"Unable to use camera overlayer when recording a single window!\" = \"录制单个窗口时无法使用摄像头浮窗!\";\n\" Please use \\\"Presenter Overlay\\\"\" = \" 请使用\\\"演讲者前置\\\"功能\";\n\"No Devices Found!\" = \"未找到任何设备\";\n\"No Cameras Found!\" = \"未找到任何摄像头\";\n\"Please unlock!\" = \"请解锁屏幕!\";\n\"If you are on a call, enable \\\"Mute\\\"\" = \"如需通话时录屏请启用\\\"静音\\\"\";\n\"Preset\" = \"预设\";\n\"Mute\" = \"静音\";\n\"Default\" = \"系统默认\";\n\"Pixel Format\" = \"像素格式\";\n\"Color Space\" = \"色彩空间\";\n\"Check for Updates…\" = \"检查程序更新…\";\n\"Update Settings\" = \"更新设置\";\n\"Automatically check for updates\" = \"自动检查程序更新\";\n\"Automatically download updates\" = \"自动下载程序更新\";\n\"Connect your device via USB\" = \"请通过 USB 连接您的设备\";\n\"Show QuickRecorder on Dock\" = \"在程序坞中显示 QuickRecorder\";\n\"Show QuickRecorder on Menu Bar\" = \"在菜单栏中显示 QuickRecorder\";\n\"Icon Settings\" = \"图标设置\";\n\"Still Processing\" = \"仍在处理\";\n\"Mixing audio track...\" = \"正在混缩音轨...\";\n\"minutes \" = \"分钟后自动停止录制\";\n\" Stop after\" = \"在\";\n\"Don't remind me again\" = \"不再提醒\";\n\"OK\" = \"好\";\n\"Failed to save file\" = \"保存文件时出错\";\n\"Enable Acoustic Echo Cancellation\" = \"消除麦克风回声\";\n\"QuickRecorder is Running\" = \"QuickRecorder 已在运行\";\n\"Please do not run multiple instances!\" = \"请勿重复运行多个 QuickRecorder 实例!\";\n\"Show Windows with No Title\" = \"显示无标题窗口\";\n\"Don't Create Thumbnails\" = \"不生成缩略图\";\n\"Record HDR\" = \"录制HDR格式\";\n\"Resize\" = \"编辑选区\";\n\"Back\" = \"返回\";\n\"Unknow Error\" = \"未知错误\";\n\"The \\\"Acoustic Echo Cancellation\\\" is enabled, but it won't work on now.\\n\\nIf you need to use a specific input with AEC, set it to \\\"Default\\\" and select the device you want in System Preferences.\\n\\nOr you can start recording without AEC.\" = \"您已启用\\\"消除麦克风回声\\\", 但很可惜程序内自定义麦克风不支持此功能!\\n\\n如需在特定的麦克风上使用回音消除功能, 请将麦克风选项设为\\\"系统默认\\\", 并在系统偏好设置中选择您需要使用的输入设备.\\n\\n或者直接开始录制 (不使用回声消除功能)\";\n\"System Preferences\" = \"系统偏好设置\";\n\"Export Recording\" = \"导出录音\";\n\"Play / Pause\" = \"播放 / 暂停\";\n\"Save Changes\" = \"保存修改\";\n\"Stop Play\" = \"停止播放\";\n\"Export\" = \"导出\";\n\"Export as MP3\" = \"导出为 MP3\";\n\"Show Colors...\" = \"显示颜色…\";\n\"Failed to Record\" = \"录制失败\";\n\"Unable to create output folder!\" = \"无法创建输出文件夹!\";\n\"The output path is a file instead of a folder!\"= \"所选的保存位置是一个文件, 应该是文件夹!\";\n\"Mini size Menu Bar controller\" = \"使用迷你菜单栏控制器\";\n\"Check for Updates\" = \"立即检测程序更新\";\n\"Error\" = \"错误\";\n\"Already recording!\" = \"正在录制中!\";\n\"Invalid screen number!\" = \"无效的屏幕编号!\";\n\"No such application!\" = \"未找到此应用程序!\";\n\"This application has no windows!\" = \"此应用程序没有可录制的窗口!\";\n\"This app exists in multiple screens, please select it manually!\" = \"此应用程序同时存在于多个屏幕中, 请手动选择!\";\n\"No such window!\" = \"未找到此窗口!\";\n\"Duplicate window exists, please select it manually!\" = \"存在多个同名窗口, 请手动选择!\";\n\"Unable to find the screen this window belongs to!\" = \"无法确认此窗口所属的屏幕!\";\n\"General\" = \"一般设置\";\n\"Recorder\" = \"录制设置\";\n\"Output\" = \"输出设置\";\n\"Hotkey\" = \"快捷键\";\n\"Blocklist\" = \"屏蔽列表\";\n\"Select...\" = \"选择...\";\n\"Go Back\" = \"返回\";\n\"If enabling Presenter Overlay causes recording failure, please increase this value.\" = \"如果启用演讲者前置功能后无法保存录像, 请尝试增大此值\";\n\"Open Main Panel\" = \"打开主面板\";\n\"Prevent Mac from sleeping while recording\" = \"录制时防止 Mac 进入睡眠\";\n\"Click the window you want to record\\nor press Esc to cancel.\" = \"请直接点击要录制的窗口\\n或者按 Esc 键退出选择\";\n\"Show floating preview after recording\" = \"录制结束后显示预览悬浮窗\";\n\"Show in Finder\" = \"在访达中显示\";\n\"Copy\" = \"拷贝\";\n\"Delete\" = \"删除\";\n\" Tips\" = \" 小贴士\";\n\"Audio Ducking Level\" = \"音频闪避级别\";\n\"Min\" = \"较小\";\n\"Mid\" = \"中等\";\n\"Max\" = \"最大\";\n\"Window Area\" = \"窗口范围\";\n\"Click on a window to select its area\\nor press Esc to cancel.\" = \"点击任意窗口来获取其范围并进行录制\\n或者按 Esc 键退出选择\";\n\"Trim\" = \"修剪视频\";\n\"Make GIF\" = \"创建 GIF\";\n\"Gifski not found\" = \"未安装 Gifski\";\n\"Please install \\\"Gifski\\\" first to make GIF!\" = \"需要先安装 Gifski 才能创建 GIF!\";\n\"Open App Store\" = \"从 App Store 安装\";\n\"Hide Control Center Icons\" = \"隐藏控制中心图标\";\n\"Hide the clock, Wi-Fi, bluetooth, volume and other system icons in the menu bar.\" = \"隐藏菜单栏上的时钟、Wi-Fi、蓝牙和音量等系统图标.\";\n\"Encoder Warning\" = \"编码器警告\";\n\"VideoToolbox H.264 hardware encoder doesn't support the current resolution.\\nContinue with a software encoder will significantly increase the CPU usage.\\n\\nWould you like to use H.265 instead?\" = \"系统 H.264 硬件编码器不支持当前分辨率\\n继续使用 H.264 编码录制将大量占用CPU\\n\\n是否改为使用 H.265 编码进行录制?\";\n\"Use H.265\" = \"使用 H.265\";\n\"Continue with H.264\" = \"继续使用 H.264\";\n\"Would you like to use H.265 format for better video quality and smaller file size?\" = \"是否使用 H.265 编码格式以获得\\n更好的录像画质和更小的文件体积?\";\n\"QuickRecorder needs this permission to record your camera or mobile device.\" = \"QuickRecorder 需要使用此权限以录制来自摄像头或移动设备的画面.\";\n\"Select Window Directly\" = \"直接点选窗口\";\n\n// Please don't translate the following warning strings, it will make it difficult for me to read the logs\n\"failed to fetch file for size indicator: %@\" = \"获取文件大小失败: \";\n\"[err] failed to fetch available content:\" = \"[错误] 无法获取可用的上下文:\";\n\"There needs to be at least one display connected\" = \"至少需要连接一台显示器\";\n\"capture failed\" = \"捕获失败\";\n\"unknown audio format while setting audio settings: \" = \"更改音频设置时设置了未知的音频格式\";\n\"[no defaults]\" = \"[无默认设置]\";\n\"loaded unknown audio format: \" = \"加载了未知的音频格式: \";\n\"loaded unknown video format\" = \"加载了未知的视频格式\";\n\"unknown stream type\" = \"未知的流类型\";\n\"audio file writing issue\" = \"音频文件写入出错\";\n\"closing stream with error:\\n\" = \"关闭流时发生错误:\\n\";\n\"\\nthis might be due to the window closing or the user stopping from the sonoma ui\" = \"\\n这可能是有由于用户关闭了正在录制中的窗口, 或使用窗口上的附加按钮停止了录制.\";\n"
  },
  {
    "path": "QuickRecorder/zh-Hant.lproj/Credits.rtf",
    "content": "{\\rtf1\\ansi\\ansicpg936\\cocoartf2820\n\\cocoatextscaling0\\cocoaplatform0{\\fonttbl\\f0\\fnil\\fcharset134 PingFangSC-Semibold;\\f1\\fnil\\fcharset134 PingFangSC-Regular;}\n{\\colortbl;\\red255\\green255\\blue255;}\n{\\*\\expandedcolortbl;;}\n\\paperw12240\\paperh15840\\margl1440\\margr1440\\vieww9000\\viewh8400\\viewkind0\n\\pard\\tx560\\tx1120\\tx1680\\tx2240\\tx2800\\tx3360\\tx3920\\tx4480\\tx5040\\tx5600\\tx6160\\tx6720\\qc\\partightenfactor0\n\n\\f0\\b\\fs24 \\cf0 \\'bb\\'f9\\'ec\\'b6 ScreenCapture Kit \\'b5\\'c4\\'b6\\'e0\\'b9\\'a6\\'c4\\'dc\\'ce\\'9e\\'c4\\'bb\\'e4\\'9b\\'d3\\'b0\\'b9\\'a4\\'be\\'df\\\n\n\\f1\\b0\\fs10 \\\n\n\\fs20 \\'d4\\'ad\\'ca\\'bc\\'b4\\'61\\'d3\\'9a\\'b9\\'dc\\'ec\\'b6 {\\field{\\*\\fldinst{HYPERLINK \"https://github.com/lihaoyun6/QuickRecorder\"}}{\\fldrslt Github}}}"
  },
  {
    "path": "QuickRecorder/zh-Hant.lproj/InfoPlist.strings",
    "content": "/* \n  InfoPlist.strings\n  QuickRecorder\n\n  Created by apple on 2024/4/28.\n  \n*/\n\"NSMicrophoneUsageDescription\" = \"QuickRecorder 需要此權限以錄製來自麥克風的聲音.\";\n\"NSCameraUsageDescription\" = \"QuickRecorder 需要此權限以錄製來自攝像頭或行動裝置的畫面.\";\n\"NSHumanReadableCopyright\" = \"版權所有 © 2024 lihaoyun6. 保留所有權利.\";\n"
  },
  {
    "path": "QuickRecorder/zh-Hant.lproj/Localizable.strings",
    "content": "/* \n  Localizable.strings\n  QuickRecorder\n\n  Created by lihaoyun6 on 2024/4/16.\n*/\n\n\"System Audio\" = \"錄製系統聲音\";\n\"System Audio \" = \"系統聲音\";\n\"Screen Area\" = \"錄製螢幕區域\";\n\"Screen\" = \"錄製整個螢幕\";\n\"Application\" = \"錄製應用程式\";\n\"Window\" = \"錄製視窗內容\";\n//\"Camera\" = \"網路攝影機\";\n\"Mobile Device\" = \"錄製行動裝置\";\n\"Preferences\" = \"偏好設定\";\n\"No Title\" = \"無標題\";\n\"Display \" = \"顯示器\";\n\"Select Applications\" = \"選擇應用程式\";\n\"Permission Required\" = \"需要授權\";\n\"Compatibility Warning\" = \"相容性警告\";\n\"You are using macOS 12.7.4\\nOutput files will be randomly corrupted on this version of macOS!\\n\\nPlease upgrade to 12.7.5 to solve it.\" = \"檢測到當前系統版本為 macOS 12.7.4\\nQuickRecorder 在當前系統版本中會\\n隨機出現錄影檔案儲存失敗的情況!\\n\\n請升級至 macOS 12.7.5 以解決此問題.\";\n\"QuickRecorder needs screen recording permissions, even if you only intend on recording audio.\" = \"QuickRecorder 需要獲取錄影許可權\\n(即使只是用來錄製音訊)\";\n\"QuickRecorder needs permission to record your microphone.\" = \"QuickRecorder 需要獲取麥克風許可權來錄製所需的聲音\";\n\"Please select a folder to save output files\" = \"請選擇錄音/錄屏檔案的儲存位置\";\n\"Open Settings\" = \"開啟系統設定\";\n\"Quit\" = \"退出程式\";\n\"Cancel\" = \"取消\";\n\"Please select the App(s) to record\" = \"請選擇需要錄製的應用程式, 支援多選\";\n\"Please select the window(s) to record\" = \"請選擇需要錄製的視窗, 支援多選\";\n\"Please select the screen to record\" = \"請選擇需要錄製的螢幕, 僅支援單選\";\n\"Refresh\" = \"重新整理列表\";\n\"Start\" = \"開始錄製\";\n\"Resolution\" = \"解析度\";\n\"Frame Rate\" = \"幀速率\";\n\"Auto\" = \"自動\";\n\"High (auto)\" = \"高 (自動)\";\n\"Normal (1x)\" = \"普通 (1x)\";\n//\"Low (0.5x)\" = \"低 (0.5x)\";\n\"Quality\" = \"輸出質量\";\n\"Format\" = \"輸出格式\";\n\"Encoder\" = \"編碼方式\";\n\"Low\" = \"低畫質\";\n\"Medium\" = \"中畫質\";\n\"High\" = \"高畫質\";\n\"Save Current Frame\" = \"儲存當前幀快照\";\n\"Record Cursor\" = \"錄製滑鼠游標\";\n\"System Audio\" = \"錄製系統聲音\";\n\"App's Audio\" = \"錄製App聲音\";\n\"Microphone\" = \"錄製麥克風\";\n\"Background\" = \"畫面背景\";\n\"Wallpaper\" = \"桌面背景\";\n\"Transparent\" = \"透明\";\n\"Yellow\" = \"系統黃色\";\n\"Green\" = \"系統綠色\";\n\"Blue\" = \"系統藍色\";\n\"Red\" = \"系統紅色\";\n\"Gray\" = \"中灰色\";\n\"Black\" = \"純黑色\";\n\"White\" = \"純白色\";\n\"Orange\" = \"系統橙色\";\n\"Custom\" = \"使用者預設\";\n\"Area Size:\" = \"選區尺寸:\";\n\"Output Size:\" = \"輸出尺寸:\";\n\"Audio\" = \"音訊設定\";\n\"Video\" = \"影片設定\";\n\"Save\" = \"儲存位置\";\n\"Exclude QuickRecorder itself\" = \"排除QuickRecorder視窗\";\n\"Highlight the Mouse Cursor\" = \"高亮顯示滑鼠游標\";\n\"Not available for \\\"Single Window Capture\\\"\" = \"此功能在錄製單個視窗時不可用\";\n\"Normal - 128Kbps\" = \"標準 - 128Kbps\";\n\"Good - 192Kbps\" = \"優質 - 192Kbps\";\n\"High - 256Kbps\" = \"高品質 - 256Kbps\";\n\"Extreme - 320Kbps\" = \"極致 - 320Kbps\";\n\"Other Settings\" = \"其他設定\";\n\"Opus doesn't support MP4, it will fall back to AAC\" = \"同時使用Opus和MP4格式時, 音訊編碼將回落至AAC\";\n\"Record Microphone to Main Track\" = \"將麥克風錄製到主音軌\";\n\"If enabled, all files on the Desktop will be hidden from the video when recording.\" = \"啟用此選項後, 桌面上的所有檔案將會從錄製畫面中被隱藏.\";\n\"These apps will be excluded when recording \\\"Screen\\\" or \\\"Screen Area\\\"\\nBut if the app is launched after the recording starts, it cannot be excluded.\" = \"在錄製 \\\"整個螢幕\\\" 或 \\\"螢幕區域\\\" 的時候將不會錄製這些 App 的畫面\\n但如果列表中的 App 在錄影開始後才被啟動, 則無法被排除在錄製畫面之外.\";\n\"Exclude Files on Desktop\" = \"隱藏所有桌面圖示\";\n\"Recording with Alpha Channel\" = \"在輸出中包含 Alpha 通道\";\n\"Delay Before Recording\" = \"開始錄製前倒數 (秒)\";\n\"s\" = \"秒\";\n\"Close\" = \"關閉\";\n\"Custom Background Color\" = \"使用者預設顏色 (錄製背景)\";\n\"File size: %@\" = \"檔案大小: %@\";\n\"Recording: \" = \"正在錄製: \";\n\"Preferences…\" = \"設定…\";\n\"Quit QuickRecorder\" = \"退出QuickRecorder\";\n\"Multiple Windows\" = \"多個視窗\";\n\"Multiple Apps\" = \"多個應用\";\n\"Unknown App\" = \"未知應用\";\n\"A Window\" = \"單個視窗\";\n\"Output Folder\" = \"檔案儲存位置\";\n\"Currently set to \\\"%@\\\"\" = \"當前儲存在 \\\"%@\\\"\";\n\"/Recording at \" = \"/錄製於 \";\n\"/Capturing at \" = \"/捕獲於 \";\n\" (Cropped in \" = \" (修剪於 \";\n\"Recording Completed\" = \"錄製結束\";\n\"Clip Saved\" = \"剪輯已儲存\";\n\"File saved to: %@\" = \"檔案已儲存至: %@\";\n\"File saved to folder: %@\" = \"檔案已儲存到: %@ 目錄中\";\n\"Startup\" = \"啟動設定\";\n\"Update\" = \"更新設定\";\n\"Launch at Login\" = \"登入時啟動\";\n\"Shortcuts Settings\" = \"快速鍵設定\";\n\"Pause / Resume\" = \"暫停/繼續錄製\";\n\"Stop Recording\" = \"結束螢幕錄製\";\n\"Record System Audio\" = \"立即錄製系統聲音\";\n\"Record Current Screen\" = \"立即錄製當前螢幕\";\n\"Record Topmost Window\" = \"立即錄製當前視窗\";\n\"Select Area to Record\" = \"選擇螢幕區域以錄製\";\n\"Toggle Screen Magnifier\" = \"顯示/隱藏螢幕放大鏡\";\n\"Waiting on update…\" = \"正在更新, 請稍等…\";\n\"Include Menu Bar in Recording\" = \"錄製選單列畫面\";\n\"Excluded Apps\" = \"App 排除列表\";\n\"Record with Camera:\" = \"錄製攝像頭:\";\n\"Presenter Overlay Camera:\" = \"\\\"發表人置前\\\"攝像頭:\";\n//\"Can only be turned off on macOS 14.2 or later!\" = \"此選項僅 macOS 14.2 或更高版本系統可中可被關閉!\";\n\"Presenter Overlay Delay\" = \"發表人置前延遲 (秒)\";\n\"Open video trimmer after recording\" = \"錄製結束後自動開啟修剪器\";\n\"Unable to use camera overlayer when recording a single window!\" = \"錄製單個視窗時無法使用攝像頭浮窗!\";\n\" Please use \\\"Presenter Overlay\\\"\" = \" 請使用\\\"發表人置前\\\"功能\";\n\"No Devices Found!\" = \"未發現行動裝置\";\n\"No Cameras Found!\" = \"未發現攝像頭\";\n\"Please unlock!\" = \"請解鎖螢幕!\";\n\"If you are on a call, enable \\\"Mute\\\"\" = \"如需通話時錄影請啟用\\\"靜音\\\"\";\n\"Preset\" = \"預設\";\n\"Mute\" = \"靜音\";\n\"Default\" = \"系統預設\";\n\"Pixel Format\" = \"像素格式\";\n\"Color Space\" = \"色彩空間\";\n\"Check for Updates…\" = \"檢查程式更新…\";\n\"Update Settings\" = \"更新設定\";\n\"Automatically check for updates\" = \"自動檢查程式更新\";\n\"Automatically download updates\" = \"自動下載程式更新\";\n\"Connect your device via USB\" = \"請用 USB 傳輸線連接裝置\";\n\"Show QuickRecorder on Dock\" = \"在 Dock 中顯示 QuickRecorder\";\n\"Show QuickRecorder on Menu Bar\" = \"在選單列中顯示 QuickRecorder\";\n\"Icon Settings\" = \"圖示設定\";\n\"Still Processing\" = \"仍在處理\";\n\"Mixing audio track...\" = \"正在混合音軌...\";\n\"minutes \" = \"分鐘後自動停止錄製\";\n\" Stop after\" = \"在\";\n\"Don't remind me again\" = \"不再提醒\";\n\"OK\" = \"好\";\n\"Failed to save file\" = \"儲存檔案時出錯\";\n\"Enable Acoustic Echo Cancellation\" = \"消除麥克風回聲\";\n\"QuickRecorder is Running\" = \"QuickRecorder 已在執行\";\n\"Please do not run multiple instances!\" = \"請勿開啟多個 QuickRecorder!\";\n\"Show Windows with No Title\" = \"顯示無標題視窗\";\n\"Don't Create Thumbnails\" = \"不生成縮圖\";\n\"Record HDR\" = \"錄製HDR影片\";\n\"Resize\" = \"編輯選區\";\n\"Back\" = \"返回\";\n\"Unknow Error\" = \"未知錯誤\";\n\"The \\\"Acoustic Echo Cancellation\\\" is enabled, but it won't work on now.\\n\\nIf you need to use a specific input with AEC, set it to \\\"Default\\\" and select the device you want in System Preferences.\\n\\nOr you can start recording without AEC.\" = \"您已啟用\\\"消除麥克風回聲\\\", 但很可惜程式內自定義麥克風不支援此功能!\\n\\n如需在特定的麥克風上使用迴音消除功能, 請將麥克風選項設為\\\"系統預設\\\", 並在系統偏好設定中選擇您需要使用的輸入裝置.\\n\\n或者直接開始錄製 (不使用回聲消除功能)\";\n\"System Preferences\" = \"系統偏好設定\";\n\"Export Recording\" = \"匯出錄音\";\n\"Play / Pause\" = \"播放 / 暫停\";\n\"Save Changes\" = \"儲存修改\";\n\"Stop Play\" = \"停止播放\";\n\"Export\" = \"匯出\";\n\"Export as MP3\" = \"匯出為 MP3\";\n\"Show Colors...\" = \"顯示顏色…\";\n\"Failed to Record\" = \"錄製失敗\";\n\"Unable to create output folder!\" = \"無法建立輸出資料夾!\";\n\"The output path is a file instead of a folder!\"= \"所選的儲存位置是一個檔案, 應該是資料夾!\";\n\"Mini size Menu Bar controller\" = \"使用迷你選單列控制器\";\n\"Check for Updates\" = \"立即檢測程式更新\";\n\"Error\" = \"錯誤\";\n\"Already recording!\" = \"正在錄製中!\";\n\"Invalid screen number!\" = \"無效的螢幕編號!\";\n\"No such application!\" = \"找不到此應用程式!\";\n\"This application has no windows!\" = \"此應用程式沒有可錄製的視窗!\";\n\"This app exists in multiple screens, please select it manually!\" = \"此應用程式同時存在於多個螢幕中, 請手動選擇!\";\n\"No such window!\" = \"找不到此視窗!\";\n\"Duplicate window exists, please select it manually!\" = \"存在多個同名視窗, 請手動選擇!\";\n\"Unable to find the screen this window belongs to!\" = \"無法確認此視窗所屬的螢幕!\";\n\"General\" = \"一般設定\";\n\"Recorder\" = \"錄製設定\";\n\"Output\" = \"輸出設定\";\n\"Hotkey\" = \"快速鍵\";\n\"Blocklist\" = \"遮蔽列表\";\n\"Select...\" = \"選擇...\";\n\"Go Back\" = \"返回\";\n\"If enabling Presenter Overlay causes recording failure, please increase this value.\" = \"如果啟用發表人置前功能後無法保存錄像, 請嘗試增大此值\";\n\"Open Main Panel\" = \"開啟主面板\";\n\"Prevent Mac from sleeping while recording\" = \"錄製時防止 Mac 進入睡眠\";\n\"Click the window you want to record\\nor press Esc to cancel.\" = \"請直接點選要錄製的視窗\\n或者按 Esc 鍵退出選擇\";\n\"Show floating preview after recording\" = \"錄製結束後顯示預覽懸浮窗\";\n\"Show in Finder\" = \"在 Finder 中顯示\";\n\"Copy\" = \"複製\";\n\"Delete\" = \"刪除\";\n\"Audio Ducking Level\" = \"音訊閃避級別\";\n\"Min\" = \"較小\";\n\"Mid\" = \"中等\";\n\"Max\" = \"最大\";\n\"Window Area\" = \"錄製視窗範圍\";\n\"Click on a window to select its area\\nor press Esc to cancel.\" = \"點選任意視窗來獲取其範圍並進行錄製\\n或者按 Esc 鍵退出選擇\";\n\"Trim\" = \"修剪影片\";\n\"Make GIF\" = \"製作 GIF\";\n\"Gifski not found\" = \"未安裝 Gifski\";\n\"Please install \\\"Gifski\\\" first to make GIF!\" = \"需要先安裝 Gifski 才能製作 GIF!\";\n\"Open App Store\" = \"從 App Store 下載\";\n\"Hide Control Center Icons\" = \"隱藏控制中心圖示\";\n\"Hide the clock, Wi-Fi, bluetooth, volume and other system icons in the menu bar.\" = \"隱藏選單列中的時鐘、Wi-Fi、藍芽和音量等系統圖示.\";\n\"VideoToolbox H.264 hardware encoder doesn't support the current resolution.\\nContinue with a software encoder will significantly increase the CPU usage.\\n\\nWould you like to use H.265 instead?\" = \"內建 H.264 硬體編碼器不支援當前解析度\\n繼續使用 H.264 編碼錄製將大量佔用CPU\\n\\n是否改為使用 H.265 編碼進行錄製?\";\n\"Use H.265\" = \"使用 H.265\";\n\"Continue with H.264\" = \"繼續使用 H.264\";\n\"Would you like to use H.265 format for better video quality and smaller file size?\" = \"是否使用 H.265 編碼以獲得更好的錄影畫質和更小的檔案體積?\";\n\"QuickRecorder needs this permission to record your camera or mobile device.\" = \"QuickRecorder 需要此權限以錄製來自攝像頭或行動裝置的畫面.\";\n\"Select Window Directly\" = \"直接點選視窗\";\n\n// Please don't translate the following warning strings, it will make it difficult for me to read the logs\n\"failed to fetch file for size indicator: %@\" = \"获取文件大小失败: \";\n\"[err] failed to fetch available content:\" = \"[错误] 无法获取可用的上下文:\";\n\"There needs to be at least one display connected\" = \"至少需要连接一台显示器\";\n\"capture failed\" = \"捕获失败\";\n\"unknown audio format while setting audio settings: \" = \"更改音频设置时设置了未知的音频格式\";\n\"[no defaults]\" = \"[无默认设置]\";\n\"loaded unknown audio format: \" = \"加载了未知的音频格式: \";\n\"loaded unknown video format\" = \"加载了未知的视频格式\";\n\"unknown stream type\" = \"未知的流类型\";\n\"audio file writing issue\" = \"音频文件写入出错\";\n\"closing stream with error:\\n\" = \"关闭流时发生错误:\\n\";\n\"\\nthis might be due to the window closing or the user stopping from the sonoma ui\" = \"\\n这可能是有由于用户关闭了正在录制中的窗口, 或使用窗口上的附加按钮停止了录制.\";\n"
  },
  {
    "path": "QuickRecorder.xcodeproj/project.pbxproj",
    "content": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 56;\n\tobjects = {\n\n/* Begin PBXBuildFile section */\n\t\t181724052BE3BEA600F5F539 /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 181724042BE3BEA600F5F539 /* Sparkle */; };\n\t\t1821F2E82CF4B226004A2EC0 /* ContentViewNew.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1821F2E72CF4B226004A2EC0 /* ContentViewNew.swift */; };\n\t\t184506CE2C69213400AFDA45 /* MatrixColorSelector in Frameworks */ = {isa = PBXBuildFile; productRef = 184506CD2C69213400AFDA45 /* MatrixColorSelector */; };\n\t\t184CAEC72BDCCC2300D61D57 /* AVContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 184CAEC62BDCCC2300D61D57 /* AVContext.swift */; };\n\t\t184CAEC92BDDEC6800D61D57 /* AppBlockSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 184CAEC82BDDEC6800D61D57 /* AppBlockSelector.swift */; };\n\t\t185582A62D1D1CC100F0CF47 /* AECAudioStream in Frameworks */ = {isa = PBXBuildFile; productRef = 185582A52D1D1CC100F0CF47 /* AECAudioStream */; };\n\t\t1862BF8D2BD5494E003ED522 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 1862BF8F2BD5494E003ED522 /* Credits.rtf */; };\n\t\t18775C202BE21F38008333EF /* iDeviceSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18775C1F2BE21F38008333EF /* iDeviceSelector.swift */; };\n\t\t187966FA2BD5639D003DB1B2 /* MousePointer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 187966F92BD5639D003DB1B2 /* MousePointer.swift */; };\n\t\t18944C642D0AD36C00B6C811 /* SurpriseView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18944C632D0AD36C00B6C811 /* SurpriseView.swift */; };\n\t\t189BD5E62BDE34B80056D06C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 189BD5E82BDE34B80056D06C /* InfoPlist.strings */; };\n\t\t189BD5ED2BDE971B0056D06C /* VideoEditor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 189BD5EC2BDE971B0056D06C /* VideoEditor.swift */; };\n\t\t189BD5F52BDF8A800056D06C /* CameraOverlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 189BD5F42BDF8A800056D06C /* CameraOverlayer.swift */; };\n\t\t18A551F62D0749C3008FC5F6 /* AppleScript.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A551EE2D0749C3008FC5F6 /* AppleScript.swift */; };\n\t\t18A551F72D0749C3008FC5F6 /* GroupForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A551EF2D0749C3008FC5F6 /* GroupForm.swift */; };\n\t\t18A551F82D0749C3008FC5F6 /* SleepPreventer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A551F12D0749C3008FC5F6 /* SleepPreventer.swift */; };\n\t\t18A551F92D0749C3008FC5F6 /* Sparkle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A551F22D0749C3008FC5F6 /* Sparkle.swift */; };\n\t\t18A551FA2D0749C3008FC5F6 /* WindowAccessor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A551F32D0749C3008FC5F6 /* WindowAccessor.swift */; };\n\t\t18A551FB2D0749C3008FC5F6 /* WindowHighlighter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18A551F42D0749C3008FC5F6 /* WindowHighlighter.swift */; };\n\t\t18A551FC2D0749C3008FC5F6 /* Scriptable.sdef in Resources */ = {isa = PBXBuildFile; fileRef = 18A551F02D0749C3008FC5F6 /* Scriptable.sdef */; };\n\t\t18AFF77B2D5F91F800C795A1 /* KeyboardShortcuts in Frameworks */ = {isa = PBXBuildFile; productRef = 18AFF77A2D5F91F800C795A1 /* KeyboardShortcuts */; };\n\t\t18CEED922D08312C00FBC4BF /* PreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18CEED912D08312C00FBC4BF /* PreviewView.swift */; };\n\t\t18D3BDEB2BCE5DC1006CFFC0 /* QuickRecorderApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18D3BDEA2BCE5DC1006CFFC0 /* QuickRecorderApp.swift */; };\n\t\t18D3BDED2BCE5DC1006CFFC0 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18D3BDEC2BCE5DC1006CFFC0 /* ContentView.swift */; };\n\t\t18D3BDEF2BCE5DC2006CFFC0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18D3BDEE2BCE5DC2006CFFC0 /* Assets.xcassets */; };\n\t\t18D3BDF22BCE5DC2006CFFC0 /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 18D3BDF12BCE5DC2006CFFC0 /* Preview Assets.xcassets */; };\n\t\t18D3BDFB2BCE5DF5006CFFC0 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 18D3BDFD2BCE5DF5006CFFC0 /* Localizable.strings */; };\n\t\t18D3BDFF2BCE5E4B006CFFC0 /* StatusBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18D3BDFE2BCE5E4B006CFFC0 /* StatusBar.swift */; };\n\t\t18D3BE012BCEB1BF006CFFC0 /* AppSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18D3BE002BCEB1BF006CFFC0 /* AppSelector.swift */; };\n\t\t18D3BE042BCEC847006CFFC0 /* SCContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18D3BE032BCEC847006CFFC0 /* SCContext.swift */; };\n\t\t18E6F11A2C2E74DF00249DB1 /* QmaPlayer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18E6F1192C2E74DF00249DB1 /* QmaPlayer.swift */; };\n\t\t18F1A0E22BD3E4C000DB102C /* AreaSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18F1A0E12BD3E4C000DB102C /* AreaSelector.swift */; };\n\t\t18F40B492BFB988A00F0AC70 /* SwiftLAME in Frameworks */ = {isa = PBXBuildFile; productRef = 18F40B482BFB988A00F0AC70 /* SwiftLAME */; };\n\t\t18FDFC8E2BDA435F0020E685 /* ScreenMagnifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18FDFC8D2BDA435F0020E685 /* ScreenMagnifier.swift */; };\n\t\t18FEBDAA2BCF8200003F09BC /* RecordEngine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18FEBDA92BCF8200003F09BC /* RecordEngine.swift */; };\n\t\t18FEBDAC2BD01E82003F09BC /* WinSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18FEBDAB2BD01E82003F09BC /* WinSelector.swift */; };\n\t\t18FEBDAE2BD10ED1003F09BC /* ScreenSelector.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18FEBDAD2BD10ED1003F09BC /* ScreenSelector.swift */; };\n\t\t18FEBDB02BD2C0D1003F09BC /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 18FEBDAF2BD2C0D1003F09BC /* SettingsView.swift */; };\n/* End PBXBuildFile section */\n\n/* Begin PBXFileReference section */\n\t\t1821F2E72CF4B226004A2EC0 /* ContentViewNew.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentViewNew.swift; sourceTree = \"<group>\"; };\n\t\t184CAEC62BDCCC2300D61D57 /* AVContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AVContext.swift; sourceTree = \"<group>\"; };\n\t\t184CAEC82BDDEC6800D61D57 /* AppBlockSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppBlockSelector.swift; sourceTree = \"<group>\"; };\n\t\t1862BF902BD5494F003ED522 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = \"zh-Hans\"; path = \"zh-Hans.lproj/Credits.rtf\"; sourceTree = \"<group>\"; };\n\t\t1862BF912BD5495D003ED522 /* Base */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = Base; path = Base.lproj/Credits.rtf; sourceTree = \"<group>\"; };\n\t\t18775C1F2BE21F38008333EF /* iDeviceSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iDeviceSelector.swift; sourceTree = \"<group>\"; };\n\t\t187966F92BD5639D003DB1B2 /* MousePointer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MousePointer.swift; sourceTree = \"<group>\"; };\n\t\t18944C632D0AD36C00B6C811 /* SurpriseView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SurpriseView.swift; sourceTree = \"<group>\"; };\n\t\t189BD5E72BDE34B80056D06C /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = \"zh-Hans\"; path = \"zh-Hans.lproj/InfoPlist.strings\"; sourceTree = \"<group>\"; };\n\t\t189BD5EC2BDE971B0056D06C /* VideoEditor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoEditor.swift; sourceTree = \"<group>\"; };\n\t\t189BD5F42BDF8A800056D06C /* CameraOverlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CameraOverlayer.swift; sourceTree = \"<group>\"; };\n\t\t189BD5F62BDFDF200056D06C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = \"<group>\"; };\n\t\t18A551EE2D0749C3008FC5F6 /* AppleScript.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppleScript.swift; sourceTree = \"<group>\"; };\n\t\t18A551EF2D0749C3008FC5F6 /* GroupForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GroupForm.swift; sourceTree = \"<group>\"; };\n\t\t18A551F02D0749C3008FC5F6 /* Scriptable.sdef */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = Scriptable.sdef; sourceTree = \"<group>\"; };\n\t\t18A551F12D0749C3008FC5F6 /* SleepPreventer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SleepPreventer.swift; sourceTree = \"<group>\"; };\n\t\t18A551F22D0749C3008FC5F6 /* Sparkle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Sparkle.swift; sourceTree = \"<group>\"; };\n\t\t18A551F32D0749C3008FC5F6 /* WindowAccessor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowAccessor.swift; sourceTree = \"<group>\"; };\n\t\t18A551F42D0749C3008FC5F6 /* WindowHighlighter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowHighlighter.swift; sourceTree = \"<group>\"; };\n\t\t18A735972BFBA12F002314AF /* it */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = it; path = it.lproj/Credits.rtf; sourceTree = \"<group>\"; };\n\t\t18A735982BFBA132002314AF /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/Localizable.strings; sourceTree = \"<group>\"; };\n\t\t18A735992BFBA138002314AF /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = it.lproj/InfoPlist.strings; sourceTree = \"<group>\"; };\n\t\t18CEED912D08312C00FBC4BF /* PreviewView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PreviewView.swift; sourceTree = \"<group>\"; };\n\t\t18CEEE182D097CBF00FBC4BF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = \"zh-Hant\"; path = \"zh-Hant.lproj/Credits.rtf\"; sourceTree = \"<group>\"; };\n\t\t18CEEE192D097CC500FBC4BF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = \"zh-Hant\"; path = \"zh-Hant.lproj/Localizable.strings\"; sourceTree = \"<group>\"; };\n\t\t18CEEE1A2D097D6800FBC4BF /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = \"zh-Hant\"; path = \"zh-Hant.lproj/InfoPlist.strings\"; sourceTree = \"<group>\"; };\n\t\t18D3BDE72BCE5DC1006CFFC0 /* QuickRecorder.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = QuickRecorder.app; sourceTree = BUILT_PRODUCTS_DIR; };\n\t\t18D3BDEA2BCE5DC1006CFFC0 /* QuickRecorderApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuickRecorderApp.swift; sourceTree = \"<group>\"; };\n\t\t18D3BDEC2BCE5DC1006CFFC0 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = \"<group>\"; };\n\t\t18D3BDEE2BCE5DC2006CFFC0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = \"<group>\"; };\n\t\t18D3BDF12BCE5DC2006CFFC0 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = \"Preview Assets.xcassets\"; sourceTree = \"<group>\"; };\n\t\t18D3BDF32BCE5DC2006CFFC0 /* QuickRecorder.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = QuickRecorder.entitlements; sourceTree = \"<group>\"; };\n\t\t18D3BDFC2BCE5DF5006CFFC0 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = \"zh-Hans\"; path = \"zh-Hans.lproj/Localizable.strings\"; sourceTree = \"<group>\"; };\n\t\t18D3BDFE2BCE5E4B006CFFC0 /* StatusBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StatusBar.swift; sourceTree = \"<group>\"; };\n\t\t18D3BE002BCEB1BF006CFFC0 /* AppSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSelector.swift; sourceTree = \"<group>\"; };\n\t\t18D3BE032BCEC847006CFFC0 /* SCContext.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SCContext.swift; sourceTree = \"<group>\"; };\n\t\t18E6F1192C2E74DF00249DB1 /* QmaPlayer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QmaPlayer.swift; sourceTree = \"<group>\"; };\n\t\t18F1A0E12BD3E4C000DB102C /* AreaSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AreaSelector.swift; sourceTree = \"<group>\"; };\n\t\t18FDFC8D2BDA435F0020E685 /* ScreenMagnifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenMagnifier.swift; sourceTree = \"<group>\"; };\n\t\t18FEBDA92BCF8200003F09BC /* RecordEngine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecordEngine.swift; sourceTree = \"<group>\"; };\n\t\t18FEBDAB2BD01E82003F09BC /* WinSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WinSelector.swift; sourceTree = \"<group>\"; };\n\t\t18FEBDAD2BD10ED1003F09BC /* ScreenSelector.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenSelector.swift; sourceTree = \"<group>\"; };\n\t\t18FEBDAF2BD2C0D1003F09BC /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = \"<group>\"; };\n/* End PBXFileReference section */\n\n/* Begin PBXFrameworksBuildPhase section */\n\t\t18D3BDE42BCE5DC1006CFFC0 /* Frameworks */ = {\n\t\t\tisa = PBXFrameworksBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t184506CE2C69213400AFDA45 /* MatrixColorSelector in Frameworks */,\n\t\t\t\t181724052BE3BEA600F5F539 /* Sparkle in Frameworks */,\n\t\t\t\t18AFF77B2D5F91F800C795A1 /* KeyboardShortcuts in Frameworks */,\n\t\t\t\t18F40B492BFB988A00F0AC70 /* SwiftLAME in Frameworks */,\n\t\t\t\t185582A62D1D1CC100F0CF47 /* AECAudioStream in Frameworks */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXFrameworksBuildPhase section */\n\n/* Begin PBXGroup section */\n\t\t181724062BE3BF2000F5F539 /* Frameworks */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t);\n\t\t\tname = Frameworks;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18A551F52D0749C3008FC5F6 /* Supports */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t18A551EE2D0749C3008FC5F6 /* AppleScript.swift */,\n\t\t\t\t18A551EF2D0749C3008FC5F6 /* GroupForm.swift */,\n\t\t\t\t18A551F02D0749C3008FC5F6 /* Scriptable.sdef */,\n\t\t\t\t18A551F12D0749C3008FC5F6 /* SleepPreventer.swift */,\n\t\t\t\t18A551F22D0749C3008FC5F6 /* Sparkle.swift */,\n\t\t\t\t18A551F32D0749C3008FC5F6 /* WindowAccessor.swift */,\n\t\t\t\t18A551F42D0749C3008FC5F6 /* WindowHighlighter.swift */,\n\t\t\t);\n\t\t\tpath = Supports;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18D3BDDE2BCE5DC1006CFFC0 = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t18D3BDE92BCE5DC1006CFFC0 /* QuickRecorder */,\n\t\t\t\t18D3BDE82BCE5DC1006CFFC0 /* Products */,\n\t\t\t\t181724062BE3BF2000F5F539 /* Frameworks */,\n\t\t\t);\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18D3BDE82BCE5DC1006CFFC0 /* Products */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t18D3BDE72BCE5DC1006CFFC0 /* QuickRecorder.app */,\n\t\t\t);\n\t\t\tname = Products;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18D3BDE92BCE5DC1006CFFC0 /* QuickRecorder */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t189BD5E82BDE34B80056D06C /* InfoPlist.strings */,\n\t\t\t\t189BD5F62BDFDF200056D06C /* Info.plist */,\n\t\t\t\t18D3BDEA2BCE5DC1006CFFC0 /* QuickRecorderApp.swift */,\n\t\t\t\t18FEBDA92BCF8200003F09BC /* RecordEngine.swift */,\n\t\t\t\t18D3BE032BCEC847006CFFC0 /* SCContext.swift */,\n\t\t\t\t184CAEC62BDCCC2300D61D57 /* AVContext.swift */,\n\t\t\t\t18A551F52D0749C3008FC5F6 /* Supports */,\n\t\t\t\t18D3BE022BCEB1D4006CFFC0 /* ViewModel */,\n\t\t\t\t18D3BDFD2BCE5DF5006CFFC0 /* Localizable.strings */,\n\t\t\t\t1862BF8F2BD5494E003ED522 /* Credits.rtf */,\n\t\t\t\t18D3BDEE2BCE5DC2006CFFC0 /* Assets.xcassets */,\n\t\t\t\t18D3BDF32BCE5DC2006CFFC0 /* QuickRecorder.entitlements */,\n\t\t\t\t18D3BDF02BCE5DC2006CFFC0 /* Preview Content */,\n\t\t\t);\n\t\t\tpath = QuickRecorder;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18D3BDF02BCE5DC2006CFFC0 /* Preview Content */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t18D3BDF12BCE5DC2006CFFC0 /* Preview Assets.xcassets */,\n\t\t\t);\n\t\t\tpath = \"Preview Content\";\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18D3BE022BCEB1D4006CFFC0 /* ViewModel */ = {\n\t\t\tisa = PBXGroup;\n\t\t\tchildren = (\n\t\t\t\t18944C632D0AD36C00B6C811 /* SurpriseView.swift */,\n\t\t\t\t18D3BDFE2BCE5E4B006CFFC0 /* StatusBar.swift */,\n\t\t\t\t18FEBDAF2BD2C0D1003F09BC /* SettingsView.swift */,\n\t\t\t\t18D3BDEC2BCE5DC1006CFFC0 /* ContentView.swift */,\n\t\t\t\t1821F2E72CF4B226004A2EC0 /* ContentViewNew.swift */,\n\t\t\t\t18D3BE002BCEB1BF006CFFC0 /* AppSelector.swift */,\n\t\t\t\t18FEBDAB2BD01E82003F09BC /* WinSelector.swift */,\n\t\t\t\t18F1A0E12BD3E4C000DB102C /* AreaSelector.swift */,\n\t\t\t\t18FEBDAD2BD10ED1003F09BC /* ScreenSelector.swift */,\n\t\t\t\t187966F92BD5639D003DB1B2 /* MousePointer.swift */,\n\t\t\t\t18FDFC8D2BDA435F0020E685 /* ScreenMagnifier.swift */,\n\t\t\t\t18775C1F2BE21F38008333EF /* iDeviceSelector.swift */,\n\t\t\t\t184CAEC82BDDEC6800D61D57 /* AppBlockSelector.swift */,\n\t\t\t\t189BD5F42BDF8A800056D06C /* CameraOverlayer.swift */,\n\t\t\t\t189BD5EC2BDE971B0056D06C /* VideoEditor.swift */,\n\t\t\t\t18E6F1192C2E74DF00249DB1 /* QmaPlayer.swift */,\n\t\t\t\t18CEED912D08312C00FBC4BF /* PreviewView.swift */,\n\t\t\t);\n\t\t\tpath = ViewModel;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXGroup section */\n\n/* Begin PBXNativeTarget section */\n\t\t18D3BDE62BCE5DC1006CFFC0 /* QuickRecorder */ = {\n\t\t\tisa = PBXNativeTarget;\n\t\t\tbuildConfigurationList = 18D3BDF62BCE5DC2006CFFC0 /* Build configuration list for PBXNativeTarget \"QuickRecorder\" */;\n\t\t\tbuildPhases = (\n\t\t\t\t18D3BDE32BCE5DC1006CFFC0 /* Sources */,\n\t\t\t\t18D3BDE42BCE5DC1006CFFC0 /* Frameworks */,\n\t\t\t\t18D3BDE52BCE5DC1006CFFC0 /* Resources */,\n\t\t\t);\n\t\t\tbuildRules = (\n\t\t\t);\n\t\t\tdependencies = (\n\t\t\t);\n\t\t\tname = QuickRecorder;\n\t\t\tpackageProductDependencies = (\n\t\t\t\t181724042BE3BEA600F5F539 /* Sparkle */,\n\t\t\t\t18F40B482BFB988A00F0AC70 /* SwiftLAME */,\n\t\t\t\t184506CD2C69213400AFDA45 /* MatrixColorSelector */,\n\t\t\t\t185582A52D1D1CC100F0CF47 /* AECAudioStream */,\n\t\t\t\t18AFF77A2D5F91F800C795A1 /* KeyboardShortcuts */,\n\t\t\t);\n\t\t\tproductName = QuickRecorder;\n\t\t\tproductReference = 18D3BDE72BCE5DC1006CFFC0 /* QuickRecorder.app */;\n\t\t\tproductType = \"com.apple.product-type.application\";\n\t\t};\n/* End PBXNativeTarget section */\n\n/* Begin PBXProject section */\n\t\t18D3BDDF2BCE5DC1006CFFC0 /* Project object */ = {\n\t\t\tisa = PBXProject;\n\t\t\tattributes = {\n\t\t\t\tBuildIndependentTargetsInParallel = 1;\n\t\t\t\tLastSwiftUpdateCheck = 1510;\n\t\t\t\tLastUpgradeCheck = 1600;\n\t\t\t\tTargetAttributes = {\n\t\t\t\t\t18D3BDE62BCE5DC1006CFFC0 = {\n\t\t\t\t\t\tCreatedOnToolsVersion = 15.1;\n\t\t\t\t\t};\n\t\t\t\t};\n\t\t\t};\n\t\t\tbuildConfigurationList = 18D3BDE22BCE5DC1006CFFC0 /* Build configuration list for PBXProject \"QuickRecorder\" */;\n\t\t\tcompatibilityVersion = \"Xcode 14.0\";\n\t\t\tdevelopmentRegion = en;\n\t\t\thasScannedForEncodings = 0;\n\t\t\tknownRegions = (\n\t\t\t\ten,\n\t\t\t\tBase,\n\t\t\t\t\"zh-Hans\",\n\t\t\t\tit,\n\t\t\t\t\"zh-Hant\",\n\t\t\t);\n\t\t\tmainGroup = 18D3BDDE2BCE5DC1006CFFC0;\n\t\t\tpackageReferences = (\n\t\t\t\t181724032BE3BEA600F5F539 /* XCRemoteSwiftPackageReference \"Sparkle\" */,\n\t\t\t\t18F40B472BFB988A00F0AC70 /* XCRemoteSwiftPackageReference \"SwiftLAME\" */,\n\t\t\t\t184506CC2C69213400AFDA45 /* XCRemoteSwiftPackageReference \"MatrixColorSelector\" */,\n\t\t\t\t185582A42D1D1CC100F0CF47 /* XCRemoteSwiftPackageReference \"AECAudioStream\" */,\n\t\t\t\t18AFF7792D5F91F800C795A1 /* XCRemoteSwiftPackageReference \"KeyboardShortcuts\" */,\n\t\t\t);\n\t\t\tproductRefGroup = 18D3BDE82BCE5DC1006CFFC0 /* Products */;\n\t\t\tprojectDirPath = \"\";\n\t\t\tprojectRoot = \"\";\n\t\t\ttargets = (\n\t\t\t\t18D3BDE62BCE5DC1006CFFC0 /* QuickRecorder */,\n\t\t\t);\n\t\t};\n/* End PBXProject section */\n\n/* Begin PBXResourcesBuildPhase section */\n\t\t18D3BDE52BCE5DC1006CFFC0 /* Resources */ = {\n\t\t\tisa = PBXResourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t18D3BDF22BCE5DC2006CFFC0 /* Preview Assets.xcassets in Resources */,\n\t\t\t\t18D3BDFB2BCE5DF5006CFFC0 /* Localizable.strings in Resources */,\n\t\t\t\t18A551FC2D0749C3008FC5F6 /* Scriptable.sdef in Resources */,\n\t\t\t\t18D3BDEF2BCE5DC2006CFFC0 /* Assets.xcassets in Resources */,\n\t\t\t\t1862BF8D2BD5494E003ED522 /* Credits.rtf in Resources */,\n\t\t\t\t189BD5E62BDE34B80056D06C /* InfoPlist.strings in Resources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXResourcesBuildPhase section */\n\n/* Begin PBXSourcesBuildPhase section */\n\t\t18D3BDE32BCE5DC1006CFFC0 /* Sources */ = {\n\t\t\tisa = PBXSourcesBuildPhase;\n\t\t\tbuildActionMask = 2147483647;\n\t\t\tfiles = (\n\t\t\t\t18FEBDAE2BD10ED1003F09BC /* ScreenSelector.swift in Sources */,\n\t\t\t\t189BD5ED2BDE971B0056D06C /* VideoEditor.swift in Sources */,\n\t\t\t\t189BD5F52BDF8A800056D06C /* CameraOverlayer.swift in Sources */,\n\t\t\t\t18F1A0E22BD3E4C000DB102C /* AreaSelector.swift in Sources */,\n\t\t\t\t18FDFC8E2BDA435F0020E685 /* ScreenMagnifier.swift in Sources */,\n\t\t\t\t187966FA2BD5639D003DB1B2 /* MousePointer.swift in Sources */,\n\t\t\t\t184CAEC92BDDEC6800D61D57 /* AppBlockSelector.swift in Sources */,\n\t\t\t\t184CAEC72BDCCC2300D61D57 /* AVContext.swift in Sources */,\n\t\t\t\t18D3BDFF2BCE5E4B006CFFC0 /* StatusBar.swift in Sources */,\n\t\t\t\t1821F2E82CF4B226004A2EC0 /* ContentViewNew.swift in Sources */,\n\t\t\t\t18A551F62D0749C3008FC5F6 /* AppleScript.swift in Sources */,\n\t\t\t\t18944C642D0AD36C00B6C811 /* SurpriseView.swift in Sources */,\n\t\t\t\t18A551F72D0749C3008FC5F6 /* GroupForm.swift in Sources */,\n\t\t\t\t18A551F82D0749C3008FC5F6 /* SleepPreventer.swift in Sources */,\n\t\t\t\t18CEED922D08312C00FBC4BF /* PreviewView.swift in Sources */,\n\t\t\t\t18A551F92D0749C3008FC5F6 /* Sparkle.swift in Sources */,\n\t\t\t\t18A551FA2D0749C3008FC5F6 /* WindowAccessor.swift in Sources */,\n\t\t\t\t18A551FB2D0749C3008FC5F6 /* WindowHighlighter.swift in Sources */,\n\t\t\t\t18D3BE042BCEC847006CFFC0 /* SCContext.swift in Sources */,\n\t\t\t\t18775C202BE21F38008333EF /* iDeviceSelector.swift in Sources */,\n\t\t\t\t18D3BDED2BCE5DC1006CFFC0 /* ContentView.swift in Sources */,\n\t\t\t\t18D3BE012BCEB1BF006CFFC0 /* AppSelector.swift in Sources */,\n\t\t\t\t18FEBDAA2BCF8200003F09BC /* RecordEngine.swift in Sources */,\n\t\t\t\t18FEBDB02BD2C0D1003F09BC /* SettingsView.swift in Sources */,\n\t\t\t\t18E6F11A2C2E74DF00249DB1 /* QmaPlayer.swift in Sources */,\n\t\t\t\t18D3BDEB2BCE5DC1006CFFC0 /* QuickRecorderApp.swift in Sources */,\n\t\t\t\t18FEBDAC2BD01E82003F09BC /* WinSelector.swift in Sources */,\n\t\t\t);\n\t\t\trunOnlyForDeploymentPostprocessing = 0;\n\t\t};\n/* End PBXSourcesBuildPhase section */\n\n/* Begin PBXVariantGroup section */\n\t\t1862BF8F2BD5494E003ED522 /* Credits.rtf */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t1862BF902BD5494F003ED522 /* zh-Hans */,\n\t\t\t\t1862BF912BD5495D003ED522 /* Base */,\n\t\t\t\t18A735972BFBA12F002314AF /* it */,\n\t\t\t\t18CEEE182D097CBF00FBC4BF /* zh-Hant */,\n\t\t\t);\n\t\t\tname = Credits.rtf;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t189BD5E82BDE34B80056D06C /* InfoPlist.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t189BD5E72BDE34B80056D06C /* zh-Hans */,\n\t\t\t\t18A735992BFBA138002314AF /* it */,\n\t\t\t\t18CEEE1A2D097D6800FBC4BF /* zh-Hant */,\n\t\t\t);\n\t\t\tname = InfoPlist.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n\t\t18D3BDFD2BCE5DF5006CFFC0 /* Localizable.strings */ = {\n\t\t\tisa = PBXVariantGroup;\n\t\t\tchildren = (\n\t\t\t\t18D3BDFC2BCE5DF5006CFFC0 /* zh-Hans */,\n\t\t\t\t18A735982BFBA132002314AF /* it */,\n\t\t\t\t18CEEE192D097CC500FBC4BF /* zh-Hant */,\n\t\t\t);\n\t\t\tname = Localizable.strings;\n\t\t\tsourceTree = \"<group>\";\n\t\t};\n/* End PBXVariantGroup section */\n\n/* Begin XCBuildConfiguration section */\n\t\t18D3BDF42BCE5DC2006CFFC0 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++20\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEAD_CODE_STRIPPING = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = dwarf;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_TESTABILITY = YES;\n\t\t\t\tENABLE_USER_SCRIPT_SANDBOXING = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu17;\n\t\t\t\tGCC_DYNAMIC_NO_PIC = NO;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_OPTIMIZATION_LEVEL = 0;\n\t\t\t\tGCC_PREPROCESSOR_DEFINITIONS = (\n\t\t\t\t\t\"DEBUG=1\",\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t);\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tLOCALIZATION_PREFERS_STRING_CATALOGS = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 14.2;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tONLY_ACTIVE_ARCH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSWIFT_ACTIVE_COMPILATION_CONDITIONS = \"DEBUG $(inherited)\";\n\t\t\t\tSWIFT_OPTIMIZATION_LEVEL = \"-Onone\";\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t18D3BDF52BCE5DC2006CFFC0 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tALWAYS_SEARCH_USER_PATHS = NO;\n\t\t\t\tASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;\n\t\t\t\tCLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;\n\t\t\t\tCLANG_ANALYZER_NONNULL = YES;\n\t\t\t\tCLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;\n\t\t\t\tCLANG_CXX_LANGUAGE_STANDARD = \"gnu++20\";\n\t\t\t\tCLANG_ENABLE_MODULES = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_ARC = YES;\n\t\t\t\tCLANG_ENABLE_OBJC_WEAK = YES;\n\t\t\t\tCLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;\n\t\t\t\tCLANG_WARN_BOOL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_COMMA = YES;\n\t\t\t\tCLANG_WARN_CONSTANT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;\n\t\t\t\tCLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;\n\t\t\t\tCLANG_WARN_DOCUMENTATION_COMMENTS = YES;\n\t\t\t\tCLANG_WARN_EMPTY_BODY = YES;\n\t\t\t\tCLANG_WARN_ENUM_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_INFINITE_RECURSION = YES;\n\t\t\t\tCLANG_WARN_INT_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;\n\t\t\t\tCLANG_WARN_OBJC_LITERAL_CONVERSION = YES;\n\t\t\t\tCLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;\n\t\t\t\tCLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;\n\t\t\t\tCLANG_WARN_RANGE_LOOP_ANALYSIS = YES;\n\t\t\t\tCLANG_WARN_STRICT_PROTOTYPES = YES;\n\t\t\t\tCLANG_WARN_SUSPICIOUS_MOVE = YES;\n\t\t\t\tCLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;\n\t\t\t\tCLANG_WARN_UNREACHABLE_CODE = YES;\n\t\t\t\tCLANG_WARN__DUPLICATE_METHOD_MATCH = YES;\n\t\t\t\tCOPY_PHASE_STRIP = NO;\n\t\t\t\tDEAD_CODE_STRIPPING = YES;\n\t\t\t\tDEBUG_INFORMATION_FORMAT = \"dwarf-with-dsym\";\n\t\t\t\tENABLE_NS_ASSERTIONS = NO;\n\t\t\t\tENABLE_STRICT_OBJC_MSGSEND = YES;\n\t\t\t\tENABLE_USER_SCRIPT_SANDBOXING = YES;\n\t\t\t\tGCC_C_LANGUAGE_STANDARD = gnu17;\n\t\t\t\tGCC_NO_COMMON_BLOCKS = YES;\n\t\t\t\tGCC_WARN_64_TO_32_BIT_CONVERSION = YES;\n\t\t\t\tGCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;\n\t\t\t\tGCC_WARN_UNDECLARED_SELECTOR = YES;\n\t\t\t\tGCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;\n\t\t\t\tGCC_WARN_UNUSED_FUNCTION = YES;\n\t\t\t\tGCC_WARN_UNUSED_VARIABLE = YES;\n\t\t\t\tLOCALIZATION_PREFERS_STRING_CATALOGS = YES;\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 14.2;\n\t\t\t\tMTL_ENABLE_DEBUG_INFO = NO;\n\t\t\t\tMTL_FAST_MATH = YES;\n\t\t\t\tSDKROOT = macosx;\n\t\t\t\tSWIFT_COMPILATION_MODE = wholemodule;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n\t\t18D3BDF72BCE5DC2006CFFC0 /* Debug */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;\n\t\t\t\tCODE_SIGN_ENTITLEMENTS = QuickRecorder/QuickRecorder.entitlements;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=macosx*]\" = \"Apple Development\";\n\t\t\t\tCODE_SIGN_STYLE = Manual;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tCURRENT_PROJECT_VERSION = 169;\n\t\t\t\tDEAD_CODE_STRIPPING = YES;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"QuickRecorder/Preview Content\\\"\";\n\t\t\t\tDEVELOPMENT_TEAM = \"\";\n\t\t\t\t\"DEVELOPMENT_TEAM[sdk=macosx*]\" = L4T783637F;\n\t\t\t\tENABLE_HARDENED_RUNTIME = YES;\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tGENERATE_INFOPLIST_FILE = YES;\n\t\t\t\tINFOPLIST_FILE = QuickRecorder/Info.plist;\n\t\t\t\tINFOPLIST_KEY_LSApplicationCategoryType = \"public.app-category.utilities\";\n\t\t\t\tINFOPLIST_KEY_LSUIElement = YES;\n\t\t\t\tINFOPLIST_KEY_NSCameraUsageDescription = \"QuickRecorder needs this permission to record your camera and mobile device.\";\n\t\t\t\tINFOPLIST_KEY_NSHumanReadableCopyright = \"Copyright © 2024 lihaoyun6. All rights reserved.\";\n\t\t\t\tINFOPLIST_KEY_NSMicrophoneUsageDescription = \"QuickRecorder needs this permission to record your voice.\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 12.3;\n\t\t\t\tMARKETING_VERSION = 1.6.9;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.lihaoyun6.QuickRecorder;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPROVISIONING_PROFILE_SPECIFIER = \"\";\n\t\t\t\tSWIFT_EMIT_LOC_STRINGS = YES;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t};\n\t\t\tname = Debug;\n\t\t};\n\t\t18D3BDF82BCE5DC2006CFFC0 /* Release */ = {\n\t\t\tisa = XCBuildConfiguration;\n\t\t\tbuildSettings = {\n\t\t\t\tASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;\n\t\t\t\tASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;\n\t\t\t\tCODE_SIGN_ENTITLEMENTS = QuickRecorder/QuickRecorder.entitlements;\n\t\t\t\t\"CODE_SIGN_IDENTITY[sdk=macosx*]\" = \"Apple Development\";\n\t\t\t\tCODE_SIGN_STYLE = Manual;\n\t\t\t\tCOMBINE_HIDPI_IMAGES = YES;\n\t\t\t\tCURRENT_PROJECT_VERSION = 169;\n\t\t\t\tDEAD_CODE_STRIPPING = YES;\n\t\t\t\tDEVELOPMENT_ASSET_PATHS = \"\\\"QuickRecorder/Preview Content\\\"\";\n\t\t\t\tDEVELOPMENT_TEAM = \"\";\n\t\t\t\t\"DEVELOPMENT_TEAM[sdk=macosx*]\" = L4T783637F;\n\t\t\t\tENABLE_HARDENED_RUNTIME = YES;\n\t\t\t\tENABLE_PREVIEWS = YES;\n\t\t\t\tGENERATE_INFOPLIST_FILE = YES;\n\t\t\t\tINFOPLIST_FILE = QuickRecorder/Info.plist;\n\t\t\t\tINFOPLIST_KEY_LSApplicationCategoryType = \"public.app-category.utilities\";\n\t\t\t\tINFOPLIST_KEY_LSUIElement = YES;\n\t\t\t\tINFOPLIST_KEY_NSCameraUsageDescription = \"QuickRecorder needs this permission to record your camera and mobile device.\";\n\t\t\t\tINFOPLIST_KEY_NSHumanReadableCopyright = \"Copyright © 2024 lihaoyun6. All rights reserved.\";\n\t\t\t\tINFOPLIST_KEY_NSMicrophoneUsageDescription = \"QuickRecorder needs this permission to record your voice.\";\n\t\t\t\tLD_RUNPATH_SEARCH_PATHS = (\n\t\t\t\t\t\"$(inherited)\",\n\t\t\t\t\t\"@executable_path/../Frameworks\",\n\t\t\t\t);\n\t\t\t\tMACOSX_DEPLOYMENT_TARGET = 12.3;\n\t\t\t\tMARKETING_VERSION = 1.6.9;\n\t\t\t\tPRODUCT_BUNDLE_IDENTIFIER = com.lihaoyun6.QuickRecorder;\n\t\t\t\tPRODUCT_NAME = \"$(TARGET_NAME)\";\n\t\t\t\tPROVISIONING_PROFILE_SPECIFIER = \"\";\n\t\t\t\tSWIFT_EMIT_LOC_STRINGS = YES;\n\t\t\t\tSWIFT_VERSION = 5.0;\n\t\t\t};\n\t\t\tname = Release;\n\t\t};\n/* End XCBuildConfiguration section */\n\n/* Begin XCConfigurationList section */\n\t\t18D3BDE22BCE5DC1006CFFC0 /* Build configuration list for PBXProject \"QuickRecorder\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t18D3BDF42BCE5DC2006CFFC0 /* Debug */,\n\t\t\t\t18D3BDF52BCE5DC2006CFFC0 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n\t\t18D3BDF62BCE5DC2006CFFC0 /* Build configuration list for PBXNativeTarget \"QuickRecorder\" */ = {\n\t\t\tisa = XCConfigurationList;\n\t\t\tbuildConfigurations = (\n\t\t\t\t18D3BDF72BCE5DC2006CFFC0 /* Debug */,\n\t\t\t\t18D3BDF82BCE5DC2006CFFC0 /* Release */,\n\t\t\t);\n\t\t\tdefaultConfigurationIsVisible = 0;\n\t\t\tdefaultConfigurationName = Release;\n\t\t};\n/* End XCConfigurationList section */\n\n/* Begin XCRemoteSwiftPackageReference section */\n\t\t181724032BE3BEA600F5F539 /* XCRemoteSwiftPackageReference \"Sparkle\" */ = {\n\t\t\tisa = XCRemoteSwiftPackageReference;\n\t\t\trepositoryURL = \"https://github.com/sparkle-project/Sparkle\";\n\t\t\trequirement = {\n\t\t\t\tkind = upToNextMajorVersion;\n\t\t\t\tminimumVersion = 2.6.0;\n\t\t\t};\n\t\t};\n\t\t184506CC2C69213400AFDA45 /* XCRemoteSwiftPackageReference \"MatrixColorSelector\" */ = {\n\t\t\tisa = XCRemoteSwiftPackageReference;\n\t\t\trepositoryURL = \"https://github.com/lihaoyun6/MatrixColorSelector.git\";\n\t\t\trequirement = {\n\t\t\t\tbranch = main;\n\t\t\t\tkind = branch;\n\t\t\t};\n\t\t};\n\t\t185582A42D1D1CC100F0CF47 /* XCRemoteSwiftPackageReference \"AECAudioStream\" */ = {\n\t\t\tisa = XCRemoteSwiftPackageReference;\n\t\t\trepositoryURL = \"https://github.com/lihaoyun6/AECAudioStream.git\";\n\t\t\trequirement = {\n\t\t\t\tbranch = main;\n\t\t\t\tkind = branch;\n\t\t\t};\n\t\t};\n\t\t18AFF7792D5F91F800C795A1 /* XCRemoteSwiftPackageReference \"KeyboardShortcuts\" */ = {\n\t\t\tisa = XCRemoteSwiftPackageReference;\n\t\t\trepositoryURL = \"https://github.com/sindresorhus/KeyboardShortcuts.git\";\n\t\t\trequirement = {\n\t\t\t\tkind = upToNextMajorVersion;\n\t\t\t\tminimumVersion = 2.2.4;\n\t\t\t};\n\t\t};\n\t\t18F40B472BFB988A00F0AC70 /* XCRemoteSwiftPackageReference \"SwiftLAME\" */ = {\n\t\t\tisa = XCRemoteSwiftPackageReference;\n\t\t\trepositoryURL = \"https://github.com/hidden-spectrum/SwiftLAME.git\";\n\t\t\trequirement = {\n\t\t\t\tkind = revision;\n\t\t\t\trevision = e8256a8151594f47f103c742f684253c6c44871d;\n\t\t\t};\n\t\t};\n/* End XCRemoteSwiftPackageReference section */\n\n/* Begin XCSwiftPackageProductDependency section */\n\t\t181724042BE3BEA600F5F539 /* Sparkle */ = {\n\t\t\tisa = XCSwiftPackageProductDependency;\n\t\t\tpackage = 181724032BE3BEA600F5F539 /* XCRemoteSwiftPackageReference \"Sparkle\" */;\n\t\t\tproductName = Sparkle;\n\t\t};\n\t\t184506CD2C69213400AFDA45 /* MatrixColorSelector */ = {\n\t\t\tisa = XCSwiftPackageProductDependency;\n\t\t\tpackage = 184506CC2C69213400AFDA45 /* XCRemoteSwiftPackageReference \"MatrixColorSelector\" */;\n\t\t\tproductName = MatrixColorSelector;\n\t\t};\n\t\t185582A52D1D1CC100F0CF47 /* AECAudioStream */ = {\n\t\t\tisa = XCSwiftPackageProductDependency;\n\t\t\tpackage = 185582A42D1D1CC100F0CF47 /* XCRemoteSwiftPackageReference \"AECAudioStream\" */;\n\t\t\tproductName = AECAudioStream;\n\t\t};\n\t\t18AFF77A2D5F91F800C795A1 /* KeyboardShortcuts */ = {\n\t\t\tisa = XCSwiftPackageProductDependency;\n\t\t\tpackage = 18AFF7792D5F91F800C795A1 /* XCRemoteSwiftPackageReference \"KeyboardShortcuts\" */;\n\t\t\tproductName = KeyboardShortcuts;\n\t\t};\n\t\t18F40B482BFB988A00F0AC70 /* SwiftLAME */ = {\n\t\t\tisa = XCSwiftPackageProductDependency;\n\t\t\tpackage = 18F40B472BFB988A00F0AC70 /* XCRemoteSwiftPackageReference \"SwiftLAME\" */;\n\t\t\tproductName = SwiftLAME;\n\t\t};\n/* End XCSwiftPackageProductDependency section */\n\t};\n\trootObject = 18D3BDDF2BCE5DC1006CFFC0 /* Project object */;\n}\n"
  },
  {
    "path": "QuickRecorder.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:\">\n   </FileRef>\n</Workspace>\n"
  },
  {
    "path": "QuickRecorder.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">\n<plist version=\"1.0\">\n<dict>\n\t<key>IDEDidComputeMac32BitWarning</key>\n\t<true/>\n</dict>\n</plist>\n"
  },
  {
    "path": "QuickRecorder.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved",
    "content": "{\n  \"originHash\" : \"a89f15c8917c69baa61d735aebe94d657281ac2cd56f20025c83a6956b56bdb3\",\n  \"pins\" : [\n    {\n      \"identity\" : \"aecaudiostream\",\n      \"kind\" : \"remoteSourceControl\",\n      \"location\" : \"https://github.com/lihaoyun6/AECAudioStream.git\",\n      \"state\" : {\n        \"branch\" : \"main\",\n        \"revision\" : \"0eab971c1dd0420ee84646c71172dd66fa59117c\"\n      }\n    },\n    {\n      \"identity\" : \"keyboardshortcuts\",\n      \"kind\" : \"remoteSourceControl\",\n      \"location\" : \"https://github.com/sindresorhus/KeyboardShortcuts.git\",\n      \"state\" : {\n        \"revision\" : \"7ecc38bb6edf7d087d30e737057b8d8a9b7f51eb\",\n        \"version\" : \"2.2.4\"\n      }\n    },\n    {\n      \"identity\" : \"matrixcolorselector\",\n      \"kind\" : \"remoteSourceControl\",\n      \"location\" : \"https://github.com/lihaoyun6/MatrixColorSelector.git\",\n      \"state\" : {\n        \"branch\" : \"main\",\n        \"revision\" : \"0853e68c0c9b205ffe6a963f2a56b26e6ceca51a\"\n      }\n    },\n    {\n      \"identity\" : \"sparkle\",\n      \"kind\" : \"remoteSourceControl\",\n      \"location\" : \"https://github.com/sparkle-project/Sparkle\",\n      \"state\" : {\n        \"revision\" : \"0a4caaf7a81eea2cece651ef4b17331fa0634dff\",\n        \"version\" : \"2.6.0\"\n      }\n    },\n    {\n      \"identity\" : \"swiftlame\",\n      \"kind\" : \"remoteSourceControl\",\n      \"location\" : \"https://github.com/hidden-spectrum/SwiftLAME.git\",\n      \"state\" : {\n        \"revision\" : \"e8256a8151594f47f103c742f684253c6c44871d\"\n      }\n    }\n  ],\n  \"version\" : 3\n}\n"
  },
  {
    "path": "QuickRecorder.xcodeproj/xcshareddata/xcschemes/QuickRecorder.xcscheme",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Scheme\n   LastUpgradeVersion = \"1600\"\n   version = \"1.7\">\n   <BuildAction\n      parallelizeBuildables = \"YES\"\n      buildImplicitDependencies = \"YES\">\n      <BuildActionEntries>\n         <BuildActionEntry\n            buildForTesting = \"YES\"\n            buildForRunning = \"YES\"\n            buildForProfiling = \"YES\"\n            buildForArchiving = \"YES\"\n            buildForAnalyzing = \"YES\">\n            <BuildableReference\n               BuildableIdentifier = \"primary\"\n               BlueprintIdentifier = \"18D3BDE62BCE5DC1006CFFC0\"\n               BuildableName = \"QuickRecorder.app\"\n               BlueprintName = \"QuickRecorder\"\n               ReferencedContainer = \"container:QuickRecorder.xcodeproj\">\n            </BuildableReference>\n         </BuildActionEntry>\n      </BuildActionEntries>\n   </BuildAction>\n   <TestAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      shouldAutocreateTestPlan = \"YES\">\n   </TestAction>\n   <LaunchAction\n      buildConfiguration = \"Debug\"\n      selectedDebuggerIdentifier = \"Xcode.DebuggerFoundation.Debugger.LLDB\"\n      selectedLauncherIdentifier = \"Xcode.DebuggerFoundation.Launcher.LLDB\"\n      launchStyle = \"0\"\n      useCustomWorkingDirectory = \"NO\"\n      ignoresPersistentStateOnLaunch = \"NO\"\n      debugDocumentVersioning = \"YES\"\n      debugServiceExtension = \"internal\"\n      allowLocationSimulation = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"18D3BDE62BCE5DC1006CFFC0\"\n            BuildableName = \"QuickRecorder.app\"\n            BlueprintName = \"QuickRecorder\"\n            ReferencedContainer = \"container:QuickRecorder.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </LaunchAction>\n   <ProfileAction\n      buildConfiguration = \"Release\"\n      shouldUseLaunchSchemeArgsEnv = \"YES\"\n      savedToolIdentifier = \"\"\n      useCustomWorkingDirectory = \"NO\"\n      debugDocumentVersioning = \"YES\">\n      <BuildableProductRunnable\n         runnableDebuggingMode = \"0\">\n         <BuildableReference\n            BuildableIdentifier = \"primary\"\n            BlueprintIdentifier = \"18D3BDE62BCE5DC1006CFFC0\"\n            BuildableName = \"QuickRecorder.app\"\n            BlueprintName = \"QuickRecorder\"\n            ReferencedContainer = \"container:QuickRecorder.xcodeproj\">\n         </BuildableReference>\n      </BuildableProductRunnable>\n   </ProfileAction>\n   <AnalyzeAction\n      buildConfiguration = \"Debug\">\n   </AnalyzeAction>\n   <ArchiveAction\n      buildConfiguration = \"Release\"\n      revealArchiveInOrganizer = \"YES\">\n   </ArchiveAction>\n</Scheme>\n"
  },
  {
    "path": "README.md",
    "content": "#\n<p align=\"center\">\n<img src=\"./QuickRecorder/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png\" width=\"200\" height=\"200\" />\n<h1 align=\"center\">QuickRecorder</h1>\n<h3 align=\"center\">A lightweight and high-performance screen recorder for macOS<br><a href=\"./README_zh.md\">[中文版本]</a><br><a href=\"https://lihaoyun6.github.io/quickrecorder/\">[Landing Page]</a>\n</p>\n\n## Screenshot\n<p align=\"center\">\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"./img/preview_en_dark.png\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"./img/preview_en.png\">\n  <img alt=\"QuickRecorder Screenshots\" src=\"./img/preview_en.png\" width=\"840\"/>\n</picture>\n</p>\n\n## Installation and Usage\n### System Requirements:\n- macOS 12.3 and Later\n\n### Install:\nDownload the latest installation file [here](../../releases/latest) or install via Homebrew:\n\n```bash\nbrew install lihaoyun6/tap/quickrecorder\n```\n\n### Features/Usage:\n- You can use QuickRecorder to record your screens / windows / applications / mobile devices... etc.\n\n- QuickRecorder supports driver-free audio loopback recording, mouse highlighting, screen magnifier and many more useful features.  \n- The new **\"[Presenter Overlay](https://support.apple.com/guide/facetime/presenter-overlay-video-conferencing-fctm6333f4bd/mac)\"** in macOS 14 was fully supported by QuickRecorder, which can overlay the camera in real time on your recording *(macOS 12/13 can only use camera floating window)*  \n- QuickRecorder is able to record `HEVC with Alpha` video format, that can contain alpha channel in the output file *(currently only iMovie and FCPX support this feature)*  \n\n## Q&A\n**1. Where can I reopen the main panel after closing it?**\n> Click the Dock tile or Menubar icon of QuickRecorder to reopen the main panel at any time.\n\n**2. Why does QuickRecorder not a sandbox app?**\n> QuickRecorder has no plans to be uploaded to the App Store, so it does not need to be designed as a sandbox app.  \n\n**3. How to independently control the volume of system sound and sound from microphone in other video editor?**\n> QuickRecorder will merge the audio input from the microphone to the main audio track after recording by default. If you need to edit the video, you can turn off the `Record Microphone to Main Track` option in the settings panel. After turning off, the system sound and sound from microphone will be recorded into two audio tracks and can be edited independently.  \n\n## Donate\n<img src=\"./img/donate.png\" width=\"350\"/>\n\n## Thanks\n[Azayaka](https://github.com/Mnpn/Azayaka) @Mnpn\n> The source of inspiration and part of the code of the screen recording engine comes from the Azayaka project, and I am also one of the code contributors to this project\n\n[KeyboardShortcuts](https://github.com/sindresorhus/KeyboardShortcuts) @sindresorhus  \n> QuickRecorder uses this swift library to handle shortcut key events  \n\n[SwiftLAME](https://github.com/hidden-spectrum/SwiftLAME) @Hidden Spectrum\n> QuickRecorder uses this swift library to handle MP3 output\n\n[ChatGPT](https://chat.openai.com) @OpenAI\n> Note: Part of the code in this project was generated or refactored using ChatGPT.\n"
  },
  {
    "path": "README_zh.md",
    "content": "# \n<p align=\"center\">\n<img src=\"./QuickRecorder/Assets.xcassets/AppIcon.appiconset/icon_128x128@2x.png\" width=\"200\" height=\"200\" />\n<h1 align=\"center\">QuickRecorder</h1>\n<h3 align=\"center\">多功能、轻量化、高性能的 macOS 屏幕录制工具<br><a href=\"./README.md\">[English Version]</a><br><a href=\"https://lihaoyun6.github.io/quickrecorder/\">[软件主页]</a>\n</p>\n\n## 运行截图\n<p align=\"center\">\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"./img/preview_dark.png\">\n  <source media=\"(prefers-color-scheme: light)\" srcset=\"./img/preview.png\">\n  <img alt=\"QuickRecorder Screenshots\" src=\"./img/preview.png\" width=\"840\"/>\n</picture>\n</p>\n\n## 安装与使用\n### 系统版本要求:\n- macOS 12.3 及更高版本  \n\n### 安装:\n可[点此前往](../../releases/latest)下载最新版安装文件. 或使用homebrew安装:  \n\n```bash\nbrew install lihaoyun6/tap/quickrecorder\n```\n\n### 特色 / 使用:\n- 使用 SwiftUI 编写, 体积小巧轻量化. 软件大小仅有不到 10MB, 无任何累赘功能. \n\n- 支持窗口录制, App 录制, 录制移动设备等; 支持窗口声音内录, 鼠标高亮, 隐藏桌面文件等功能. \n- 完整支持 macOS 14 新增的 **[演讲者前置](https://support.apple.com/zh-cn/guide/facetime/fctm6333f4bd/mac)** 特性, 可在实时叠加摄像头画面 (低版本 macOS 可以使用悬浮窗模式).  \n- 支持 `HEVC with Alpha` 特性, 可在输出文件中包含 Alpha 通道 (目前仅 iMovie 与 FCPX 支持此特性)\n- 更多功能陆续开发中...  \n\n## 常见问题\n**1. 主面板关闭之后在哪里重新打开?**  \n> 单击 QuickRecorder 的 Dock 栏图标即可随时重新呼出主功能面板.  \n\n**2. 为什么 QuickRecorder 不是沙盒 App?**  \n> 苹果沙盒权限管理机制比较复杂, 使用起来麻烦. 加之 QuickRecorder 并没有上架 App Store的打算, 故没有做成沙盒 App.\n\n**3. 如何在后期剪辑中独立控制系统声音和麦克风录音的音量?**\n> QuickRecorder 默认会在录制结束后将麦克风输入的音频合并到主音轨. 如果需要后期编辑的话, 可以在设置面板中关闭 `将麦克风录制到主音轨` 选项. 关闭后系统声音和麦克风将分别录制为两条音轨, 可以独立编辑.  \n\n## 赞助\n<img src=\"./img/donate.png\" width=\"352\"/>\n\n## 致谢\n[Azayaka](https://github.com/Mnpn/Azayaka) @Mnpn  \n> 灵感来源以及屏幕录制引擎的部分代码来自于 Azayaka 项目, 同时我也是此项目的代码贡献者之一   \n\n[KeyboardShortcuts](https://github.com/sindresorhus/KeyboardShortcuts) @sindresorhus  \n> QuickRecorder 使用此swift库来处理快捷键事件  \n\n\n[SwiftLAME](https://github.com/hidden-spectrum/SwiftLAME) @Hidden Spectrum\n> QuickRecorder 使用此swift库来处理 MP3 输出\n\n[ChatGPT](https://chat.openai.com) @OpenAI  \n> 注: 本项目部分代码使用 ChatGPT 生成或重构整理\n"
  },
  {
    "path": "appcast.xml",
    "content": "<?xml version=\"1.0\" standalone=\"yes\"?>\n<rss xmlns:sparkle=\"http://www.andymatuschak.org/xml-namespaces/sparkle\" version=\"2.0\">\n    <channel>\n        <title>QuickRecorder</title>\n        <item>\n            <title>v1.6.9</title>\n            <pubDate>Wed, 11 Jun 2025 15:37:19 +0800</pubDate>\n            <sparkle:version>169</sparkle:version>\n            <sparkle:shortVersionString>1.6.9</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了在 Intel Mac 上的闪退问题.</li>\n                <li><b style=\"color: red\">我的免费开发者证书将在6月14日过期, 请收藏 QuickRecorder 的<a href=\"https://lihaoyun6.github.io/quickrecorder/\">主页</a>以随时下载最新版本!</b></li>\n                </ul><ul>\n                <li>Fixed: Crash on Intel-based Macs.</li>\n                <li><b style=\"color: red\">My certificate will expire on June 14, bookmark this <a href=\"https://lihaoyun6.github.io/quickrecorder/\">page</a> to download QuickRecorder at any time!\n                </b></li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"270\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.9/QuickRecorder_v1.6.9.dmg\" length=\"4651431\" type=\"application/octet-stream\" sparkle:edSignature=\"r6X5kNk1D6X44n6HTovdaZoTca8pbQZgx0csll4foKveBy+p9LvG+JPCS4lMSLcdBxShF+crbHN23vSIjrQ+Cw==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.9/Update169-168.delta\" sparkle:deltaFrom=\"168\" length=\"747570\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"a5BzG8z8TVZY9zfah2rVj1U0qAZKy7kl2DbynYOGhTTII04bwrSJK3jYPCKFFwMpu/DYh60mgZIELxzMEM5XCw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.9/Update169-167.delta\" sparkle:deltaFrom=\"167\" length=\"744678\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"PaVoFlsStxMOWHat3bkIW4EzIyvTl2W+3SUloy5X+K//yaGF1UzEx15lpGlmg3rOFHzvaIX5Xin1K/JsnL//Dw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.9/Update169-166.delta\" sparkle:deltaFrom=\"166\" length=\"876350\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"Rs6kskgckn9kI3st3gOXVs8sxDOLeOO+I2cAiGvuHd4z/pDVHPcEWza6hGrtZNLow2ZkSiNe4V8wQaR2Igs9BQ==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.6.8</title>\n            <pubDate>Tue, 10 Jun 2025 15:34:04 +0800</pubDate>\n            <sparkle:version>168</sparkle:version>\n            <sparkle:shortVersionString>1.6.8</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了部分录制场景下 App 闪退的问题.</li>\n                <li><b style=\"color: red\">我的免费开发者证书将在6月14日过期, 请收藏 QuickRecorder 的<a href=\"https://lihaoyun6.github.io/quickrecorder/\">主页</a>以随时下载最新版本!</b></li>\n                </ul><ul>\n                <li>Fixed: Crash during recording.</li>\n                <li><b style=\"color: red\">My certificate will expire on June 14, bookmark this <a href=\"https://lihaoyun6.github.io/quickrecorder/\">page</a> to download QuickRecorder at any time!\n                </b></li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"270\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.8/QuickRecorder_v1.6.8.dmg\" length=\"4635571\" type=\"application/octet-stream\" sparkle:edSignature=\"hPQB1x9ZJhheSqpD6n5WZ7bzYQ5DCk7v5anJvjhndZdmNflL1llt0RnRQP2lVKv3iGNh7Ksxgy+qdULNUt1mAw==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.8/Update168-167.delta\" sparkle:deltaFrom=\"167\" length=\"629682\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"uqDSKJGq8hntsqagTrqK1IqHGZyo7HaOEzQ3VA/ksFkSeWL18RtktN2O3TT4/hc2H54pxWbhowqOdhMkHH1+Cw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.8/Update168-166.delta\" sparkle:deltaFrom=\"166\" length=\"851854\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"Z17UHGPrmFrmSdpKjoSFdHnwr/RB+AuNw7c2oYyxLCo02Wr2wfZUSsPmf7L43oA5Ci1J8qPRhdcP8krfC0RdCQ==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.8/Update168-165.delta\" sparkle:deltaFrom=\"165\" length=\"1015506\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"poQvVl0sCJykwIk3E0Z8vKWQqUaoP/wpoqWab8/qttJILJf0TVM3znAj6elZS5T9UnfmcdmlCFDH4X6IjtoOCw==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.6.7</title>\n            <pubDate>Wed, 04 Jun 2025 17:39:45 +0800</pubDate>\n            <sparkle:version>167</sparkle:version>\n            <sparkle:shortVersionString>1.6.7</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了使用快捷键暂停时, 菜单栏指示器按钮不变的问题.</li>\n                <li><b style=\"color: orange\">我的免费开发者证书将在6月14日过期, 请收藏此App的<a href=\"https://lihaoyun6.github.io/quickrecorder/\">主页</a>以随时下载更新</b></li>\n                </ul><ul>\n                <li>Fixed: When pausing via hotkey, the indicator button doesn't change.</li>\n                <li><b style=\"color: orange\">My certificate will expire on June 14, please bookmark this <a href=\"https://lihaoyun6.github.io/quickrecorder/\">page</a> to download the latest version at any time.\n                </b></li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.7/QuickRecorder_v1.6.7.dmg\" length=\"4672786\" type=\"application/octet-stream\" sparkle:edSignature=\"VNTubJ1ieurSsywMV2F2dpqqBMCwLc73cmNf/4MZsUizqK0zE4AvliSFX3+CWyrtufyGSC/A1GaH+UzKnXIoAQ==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.7/Update167-166.delta\" sparkle:deltaFrom=\"166\" length=\"426958\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"GNWdeh2Kjsd8fvndviXSggArPRbeYpIqWrpXS9ruvxFvm5mkb9SPj+xdJFG3jGCriQQ1Y9h1cqIAPax9M1f2Bw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.7/Update167-165.delta\" sparkle:deltaFrom=\"165\" length=\"587246\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"CrCLFeHwFMm6enVRntLnidLJ1xv+Lk+KJB6QkUPUU75Gd4aMa4PaofZGCb+UPkW3ajEZFAVjmHJlQPLuMynlAA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.7/Update167-164.delta\" sparkle:deltaFrom=\"164\" length=\"599502\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"h3DQHpW3bYuf5VhzOpu1Lx3jTjoaFekz+vheYEJW1oOzqfl4Z2GrTLz8C5lJxgAHBHpwOwS9ROoeZiYgwGmECQ==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.6.6</title>\n            <pubDate>Tue, 29 Apr 2025 14:52:47 +0800</pubDate>\n            <sparkle:version>166</sparkle:version>\n            <sparkle:shortVersionString>1.6.6</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了录制高分辨率 H.264 视频时的 CPU 占用问题</li>\n                <li>修复了\"录制窗口范围\"功能与多显示器的兼容性</li>\n                <li>修复了无法录制透明桌面背景的问题</li>\n                <li>修复了其他已知的 bug</li>\n                <li><b style=\"color: orange\">感谢大家的爱心❤️骨折手术很成功, 目前正在稳步康复中!</b></li>\n                </ul><ul>\n                <li>\"Recording Window Area\" now works in multi-screen environments.</li>\n                <li>Fixed: High CPU usage when recording high resolution H.264 video.</li>\n                <li>Fixed: Unable to record transparent desktop background.</li>\n                <li>Fixed other known issues.</li>\n                <li><b style=\"color: orange\">Thank you for your donation, my arm is healing and I can touch my nose again😆</b></li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.6/QuickRecorder_v1.6.6.dmg\" length=\"4667894\" type=\"application/octet-stream\" sparkle:edSignature=\"A8Xp5+aeF67obDpK+gmezjiFqqrSZoEhdTyYa3FjNpgWIM3k0gBld+qT4mv3Oemz5uRXnX6DOmVzcjg5WUyyCA==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.6/Update166-165.delta\" sparkle:deltaFrom=\"165\" length=\"550574\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"YwzRNCxUDCPpc2tcBTj7q2E6Ro5G+EdMmtlioKVPxEzyNDFAJSWxelm1T9UFdlm4aRE7P2I0N9z9kHchFqYWCA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.6/Update166-164.delta\" sparkle:deltaFrom=\"164\" length=\"561194\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"aasJViad3v92Mh8oG+gTm4IT7vDChuNjal239JxY3W2aRz9JV7AmfHWX8trNjD6XajSUY48IQjiJlIdTjC0mDw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.6/Update166-163.delta\" sparkle:deltaFrom=\"163\" length=\"619638\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"QImDo4slw1dZSFhQqqeHmjJ8NRTG+3ymRrLF3xRdbWHDaPt2ua38WgoEH9ovIStfNrjUcOtmYUXGZkSw7r1tBA==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.6.5</title>\n            <pubDate>Wed, 05 Feb 2025 00:20:51 +0800</pubDate>\n            <sparkle:version>165</sparkle:version>\n            <sparkle:shortVersionString>1.6.5</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了录屏颜色与 HDR 色彩深度</li>\n                <li>视频修剪器窗口支持缩放大小</li>\n                <li><b style=\"color: orange\">😢近日意外摔伤导致手臂骨折, 治疗花费两万余元. 如有朋友愿意献出点滴爱心, 本人感激不尽!</b></li>\n                </ul><ul>\n                <li>Fixed video color and HDR bit depth.</li>\n                <li>The video trimmer window is now resizable.</li>\n                <li><b style=\"color: orange\">I broke my arm accidentally, so this update is done with one hand only. And the hospital billed me about $3000, is there anyone willing to give me a little help?😢</b></li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.5/QuickRecorder_v1.6.5.dmg\" length=\"4612475\" type=\"application/octet-stream\" sparkle:edSignature=\"yb82dbHbtWyLawI71apsDX9B1LiO0kU4bcNhTl+jsTD6kBRGgd6mdajnSU+MccMX1pwycOAJ5d6Lzh1uqYLYBg==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.5/Update165-164.delta\" sparkle:deltaFrom=\"164\" length=\"235570\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"/X4DPMj1bd0AhxMgRC4oWLcWgUckoo/cBCvX67BRczaE9xZFQfSmQxPZ58UnHKb8+DTLa677CSf+duNtlJm3Dg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.5/Update165-163.delta\" sparkle:deltaFrom=\"163\" length=\"498778\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"OD9n/flpDT3va/cFTsQjy1mJYvjNCRdXwgpcx0yAu9vgdLLEY911VgSwl0wR/H3bd04T044cm/SDDvN8T945Ag==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.5/Update165-162.delta\" sparkle:deltaFrom=\"162\" length=\"553258\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"51hYI6hiso55u36Kr7sUvJ0HBNU8T+oLv+Cuo3QWNWnPCKtTnRhxJSOob58Eja27Eun7X4ymjYgwz/6DlPpUBQ==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.6.4</title>\n            <pubDate>Sat, 25 Jan 2025 01:49:16 +0800</pubDate>\n            <sparkle:version>164</sparkle:version>\n            <sparkle:shortVersionString>1.6.4</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了预览悬浮窗导致的内存泄漏</li>\n                <li>修复了当开启\"隐藏桌面文件\"时无法录制预览窗口的问题</li>\n                <li><b style=\"color: orange\">请注意, v1.6.x 将是最后一个支持 macOS 12 系统的版本!</b></li>\n                </ul><ul>\n                <li>Fixed the memory leak caused by the preview popup.</li>\n                <li>Fixed: Unable to record the \"Preview\" window when \"Hide desktop files\" is enabled.</li>\n                <li><b style=\"color: orange\">v1.6.x will be the final version that supports macOS 12!</b></li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.4/QuickRecorder_v1.6.4.dmg\" length=\"4614284\" type=\"application/octet-stream\" sparkle:edSignature=\"XmWNRCdXXKfiuMVz12jLlbBVpm33Vi4lEXt8txKknrFQCWSzkZyO1CUXI5n+CV2VBgNVPWcA+5b5uSxYqatuAA==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.4/Update164-163.delta\" sparkle:deltaFrom=\"163\" length=\"492198\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"e0AvRgbI+cQuvc0sH8LiRAwRcMsd8mlD4jfxtbsZKVggxEGu6gS61GK8C/TLNY+xAJ/DeMUjNtv1riDCmzePDg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.4/Update164-162.delta\" sparkle:deltaFrom=\"162\" length=\"544098\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"ZbTFsS4jT2aH/mYuZIbUWsSpODwjEy4LnMSCjPl4XEbihjdjkf3vF77T2ZWFBhlUp/cjYijx5r4pRx50fsUOCA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.4/Update164-161.delta\" sparkle:deltaFrom=\"161\" length=\"551978\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"l7eXlYRFxJo96iXMRbrNQ1UhNJNUJk182BK/0HIuQHh2f8wSAuFOc3oK+zhARmU43eDyk7XAJTAVzdepB2YuAg==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.6.3</title>\n            <pubDate>Thu, 16 Jan 2025 16:30:49 +0800</pubDate>\n            <sparkle:version>163</sparkle:version>\n            <sparkle:shortVersionString>1.6.3</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>支持在录制后创建 GIF 动图 (基于 Gifski)</li>\n                <li>支持录制结束后将文件分享到其他 App</li>\n                <li>支持在录制时隐藏菜单栏上的系统图标</li>\n                <li>修复其他已知问题</li>\n                <li><b style=\"color: orange\">请注意, v1.6.x 将是最后一个支持 macOS 12 系统的版本!</b></li>\n                </ul><ul>\n                <li>Support creating GIF after recording (based on Gifski)</li>\n                <li>Support sharing files to other apps after recording</li>\n                <li>Support hiding system icons on the menu bar during recording</li>\n                <li>Fix other known issues</li>\n                <li><b style=\"color: orange\">v1.6.x will be the final version that supports macOS 12!</b></li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.3/QuickRecorder_v1.6.3.dmg\" length=\"4612465\" type=\"application/octet-stream\" sparkle:edSignature=\"NPk/ODX7xF3id4EaAdLzJ92O5SId/uDonbavxT453BEWgEVHnzYz/sv2lt2J1D1Onk0VG+q1L1Aa8letcOAPBg==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.3/Update163-162.delta\" sparkle:deltaFrom=\"162\" length=\"449290\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"e9f6FkxlH5Xtc6wxyT7U6NY1Qucw/VThLbLdYwULQZ90Oo56MXQp80PQvB4Aq2er3JKWkGU5yUpMb98KxP3tBQ==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.3/Update163-161.delta\" sparkle:deltaFrom=\"161\" length=\"454898\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"1GuAmaVQENL0KJ8pXxu19X0bD2J8L4wBafhPF4c4Elmts2B/0GkIr71Tqb1Wp9Hm+x/1DqrvTbbLPLhHx8sDBA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.3/Update163-160.delta\" sparkle:deltaFrom=\"160\" length=\"577102\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"TjoNmqii7VG64br28vgPEyfO4BnQrDoIZ0ZKuhRPiVk1bJuxnWJEqbg9Ee6qS6pZUWVWkAHGKDJfaCX0qg2UDA==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.6.2</title>\n            <pubDate>Fri, 03 Jan 2025 14:56:56 +0800</pubDate>\n            <sparkle:version>162</sparkle:version>\n            <sparkle:shortVersionString>1.6.2</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了录制屏幕区域时虚线边框出现在画面中的问题</li>\n                <li>修复了仅录制系统声音时可能出现崩溃的问题</li>\n                <li><b style=\"color: orange\">请注意, v1.6.x 将是最后一个支持 macOS 12 系统的版本!</b></li>\n                </ul><ul>\n                <li>Fixed: Screen area selector outline appearing in clips.</li>\n                <li>Fixed: App may crash when recording \"System Audio\".</li>\n                <li><b style=\"color: orange\">v1.6.x will be the final version that supports macOS 12!</b></li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.2/QuickRecorder_v1.6.2.dmg\" length=\"4598450\" type=\"application/octet-stream\" sparkle:edSignature=\"s2TdhJCjj91u594/OfGglVtEf7o9PI/sMBRpzOwQ6+Ll/RXcN8PtTaYgu3m/nPxJgyLu1Xhz8074A9Cw7F5QAg==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.2/Update162-161.delta\" sparkle:deltaFrom=\"161\" length=\"235734\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"wtb3hK8V6o2Ct4igl4ocUh/SZddkWPiHlgswUeGLkQ2A4Pil5FqLY2+0QITmeEXPArrSCjlAr+C+oasThu4JDw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.2/Update162-160.delta\" sparkle:deltaFrom=\"160\" length=\"524406\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"08BydKVi59fgPYqQGbkga3e9lCqWpzJHcc6ODV5J0LdUF2s8zg8xzHNOqvpO9e3iruedwj/iQ9uVy41DVb/3Ag==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.2/Update162-159.delta\" sparkle:deltaFrom=\"159\" length=\"678834\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"oh70JLHCSAu9GcRgRX/HbhDyc0ICdTgICXDOowzErhiuOK63XInqvfZYrHEFfStxgsY68d/pDEezEXCcBaRiDw==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.6.1</title>\n            <pubDate>Thu, 26 Dec 2024 00:28:27 +0800</pubDate>\n            <sparkle:version>161</sparkle:version>\n            <sparkle:shortVersionString>1.6.1</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>添加了 \"录制窗口范围\" 功能</li>\n                <li>修复了某些时候无法同时录制系统声音和麦克风的问题</li>\n                <li>修复了 macOS 15 系统中有时会生成错误的文件扩展名</li>\n                <li><b style=\"color: orange\">请注意, v1.6.x 将是最后一个支持 macOS 12 系统的版本!</b></li>\n                </ul><ul>\n                <li>Added \"record window area\" feature</li>\n                <li>Fixed: Cannot record microphone while recording \"System Audio\"</li>\n                <li>Fixed: Wrong file extensions were sometimes generated on macOS 15</li>\n                <li><b style=\"color: orange\">v1.6.x will be the final version that supports macOS 12!</b></li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"280\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.1/QuickRecorder_v1.6.1.dmg\" length=\"4561074\" type=\"application/octet-stream\" sparkle:edSignature=\"SNd/BKENUh6W4RZ/4XHOaZ3x/4WerdVvOaM2fkAlitMkc33YIzyvayHu/9l8sAniynwVCH6r0xIY8z1cKgoFDQ==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.1/Update161-160.delta\" sparkle:deltaFrom=\"160\" length=\"520614\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"7XnkOyypWWMobE4tKIq+qHmS4RrY1Ts6zJs5lX1IzYtc3xrHTtESP/oRO8SfWiNhMQMr8zoAJjXAUQu02WyjDw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.1/Update161-159.delta\" sparkle:deltaFrom=\"159\" length=\"668570\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"WMKcmk6VLZxLDHybuiTN7NfffQWFfoRuzzgImdqAKOtQo4ifJW696xTZVBkaHDhZQhqlhC9pu7FDIOcA77G5Dw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.1/Update161-157.delta\" sparkle:deltaFrom=\"157\" length=\"824042\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"FcOnA4jGRh03CZmbCQ63oclbSY8j/Asssd8TDFjBIQ0ys6vVQVdIV8z9l7bbsKlr99ghrpGIrEzRbG47zkweCQ==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.1/Update161-155.delta\" sparkle:deltaFrom=\"155\" length=\"986766\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"mOM/QCvn1Swa/C41IC2GEP3VsJvoGbEaJgLLttzADscJee/dFAG3c3FkniMfT25JfuDCWVus0qlYPEQhfVxBDw==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.6.0</title>\n            <pubDate>Thu, 19 Dec 2024 15:40:16 +0800</pubDate>\n            <sparkle:version>160</sparkle:version>\n            <sparkle:shortVersionString>1.6.0</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>进一步修复了与 macOS 12 的兼容性.</li>\n                <li><b>这将是最后一个支持 macOS 12 系统的版本!</b></li>\n                </ul><ul>\n                <li>Fixed compatibility with macOS 12.</li>\n                <li><b>This will be the final version that supports macOS 12!</b></li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.0/QuickRecorder_v1.6.0.dmg\" length=\"4514280\" type=\"application/octet-stream\" sparkle:edSignature=\"RtdbX+DscCYtYLjPHGMHzCQS0JVgdx6a7QB7UgnxKWCbRUbyHwm7rm0ldhJ9MfyDSR4oW/rRkqByjdXQrBlaAA==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.0/Update160-159.delta\" sparkle:deltaFrom=\"159\" length=\"539138\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"lw5XX5zP/QZvUYa9+VlWd9OCPOKDOcbL76DNinznVzWXZ0GnYV6RKx9CD/nk30llzN+Zgqm7wScIzQZFxTftBA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.0/Update160-157.delta\" sparkle:deltaFrom=\"157\" length=\"714962\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"b8r+SciCeemDjNkv8swqW1KfCsApQ+KnbmMA2kezbyhNQc2e4TYbaFgxdoNYfQFywE3heAk2NrARqrvghNBmAg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.0/Update160-155.delta\" sparkle:deltaFrom=\"155\" length=\"908082\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"NQZg+/0cEeihZUsJImvRUBvT38Y4EHUSgcIJVzgv3K44Gfl5wpb4bgyPU9ejsWydINPYAzWqMZhp45A6MeVPDg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.6.0/Update160-154.delta\" sparkle:deltaFrom=\"154\" length=\"913774\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"Ba+UiDcLv4wGbkxmFD8c4Q1QWUqyYy5Rrbyg4/2Ff/cpRsfEdAATO/ScSI8nyAdMJsGzmfGdMVZ9Bxvs5eRrCA==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.5.9</title>\n            <pubDate>Sat, 14 Dec 2024 22:58:23 +0800</pubDate>\n            <sparkle:version>159</sparkle:version>\n            <sparkle:shortVersionString>1.5.9</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li><b>修复了某些场景下异常闪退的 Bug</b></li>\n                <li>修复使用 QuickTime 打开 HDR 录像文件时出现兼容性警告的问题</li>\n                </ul><ul>\n                <li><b>Fixed: App crash after recording sometimes.</b></li>\n                <li>Fixed: Compatibility warning when opening HDR recordings with QuickTime.</li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"280\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.9/QuickRecorder_v1.5.9.dmg\" length=\"4494528\" type=\"application/octet-stream\" sparkle:edSignature=\"EfDzDwVjSigIvA8fNC3w5G9aa5XRTzVccwAwJ9Z3dItfFKiluP7NS/Z4Q8t7XnfhQfexYkYx+eP06uLyW+H2Ag==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.9/Update159-157.delta\" sparkle:deltaFrom=\"157\" length=\"561438\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"fmOYO9WpVEQnr8WCRHbklsVZGZi5+vn/edGvL3nPyXp/Pa+2S3RwQpNo0D0F3ZUM9SEKRKgUjDh+ALnE/v10Aw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.9/Update159-155.delta\" sparkle:deltaFrom=\"155\" length=\"820470\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"HrVaWK9jepCKl+7+cOXADS9nOyfAlLfPvegbZ9YDYDjvVqoR8F6/nuXDI77gLWwb6r6+yT+TmJp/05QiubNyBg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.9/Update159-154.delta\" sparkle:deltaFrom=\"154\" length=\"836670\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"sZlsaKJfpmGrJmDUAdufHCtegbEKM3QpgaNcBkzNOzmjFaqEdEtmJtvsryDOr2Hg1wH8vlbBSZRko8a7/xd/Bg==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.5.7</title>\n            <pubDate>Wed, 11 Dec 2024 16:04:18 +0800</pubDate>\n            <sparkle:version>157</sparkle:version>\n            <sparkle:shortVersionString>1.5.7</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li><b>由于 v1.5.6 更新中包含一个错误, 故此更新被撤回重发!</b></li>\n                <li>添加了 <b>zh-Hant</b> 本地化翻译</li>\n                <li>修复了某些时候录像文件大小为 0KB 的问题</li>\n                <li>支持在录制过程中阻止 Mac 进入睡眠 (可在设置中关闭)</li>\n                <li>支持录制结束后在屏幕角落显示预览气泡 (可在设置中关闭)</li>\n                </ul><ul>\n                <li><b>Update v1.5.6 contained a bug so it's being withdrawn!</b></li>\n                <li>Fixed the recording failure issue since v1.5.5 (file size is 0KB)</li>\n                <li>Added: <b>zh-Hant</b> localization</li>\n                <li>Added: Prevent Mac from sleeping during recording (can be disabled)</li>\n                <li>Added: Show preview in corner after recording (can be disabled)</li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.7/QuickRecorder_v1.5.7.dmg\" length=\"4418256\" type=\"application/octet-stream\" sparkle:edSignature=\"xWsrbjmh2n5VswUt7rZP4YtLqb4fsxsJ8bJJydcI7gcJ8IWkyQcyzdcSaqRX0MFGgbkZ2pYX+XW/vwFDkBaACw==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.7/Update157-156.delta\" sparkle:deltaFrom=\"156\" length=\"247042\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"U3/TgBsKKazcGZ/IyC0D9ZOeV2GdiLHrOqGiTr1Mdfic3/H2dq611IkIwkEq0a7pcfGOnsPm6tuxrpBh0LLCBA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.7/Update157-155.delta\" sparkle:deltaFrom=\"155\" length=\"657998\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"s2j++wQ8XsUUDoaRmZYYXor/axWTjw+lnmHCjt5fcyapICxanG3RKrhKBMSic1QulgaW5PsJR7sbZlpnLxESAw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.7/Update157-154.delta\" sparkle:deltaFrom=\"154\" length=\"677446\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"hMEXdnREWuh3B76nUrFrm6xZfPh3vg5YUVNswsInWnrjIttyEOvTgAqOIgTui14E6fLPAWdLvWGJKaZjXEYoCQ==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.7/Update157-153.delta\" sparkle:deltaFrom=\"153\" length=\"827310\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"N4kwk8RvS2yDWHdmEIEKZRBw/nHiTh5Ot2ZbpQ8SHpLQAi/k8jGmrCVhZMcMLKFn8Jra08b9mvsr9wyc/PNOAA==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.5.5</title>\n            <pubDate>Sun, 01 Dec 2024 14:24:36 +0800</pubDate>\n            <sparkle:version>155</sparkle:version>\n            <sparkle:shortVersionString>1.5.5</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了无法从多通道音频输入设备录制声音的问题.</li>\n                <li>修复了录制移动设备画面时迷你控制器显示不正常的问题.</li>\n                </ul><ul>\n                <li>Fixed crash when recording from multi-channel audio input devices.</li>\n                <li>Fixed the appearance of the mini recording controller.</li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"280\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.5/QuickRecorder_v1.5.5.dmg\" length=\"4257710\" type=\"application/octet-stream\" sparkle:edSignature=\"CYAYEhCpy02+yLGrktekCXofCynJyknKsyT/BeLfT/cDzQFTB9LwGIy+3EtjvZGzAtUCDUiOTVZ1/5X8rI/rAA==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.5/Update155-154.delta\" sparkle:deltaFrom=\"154\" length=\"311322\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"5U7ADes6MmP43v+9CS0bNRM/qrU2V47xpjgdlrWj9ukjCrm/RoYt89IcvfrQxlVme+nc8uouLokDa2/UYopbAg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.5/Update155-153.delta\" sparkle:deltaFrom=\"153\" length=\"662954\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"MfC1eHQSSThZFqvV8Vu4iHu6pYsVpxRyalJhwfBze/86Vuq4FjEo0Rmw1qb/7r468FNsmGpNDXc5/71aYFETDg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.5/Update155-152.delta\" sparkle:deltaFrom=\"152\" length=\"673122\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"qEnaLOoVRbo5cXiobPApi7XEF4ekXaeLd7Bm8mKa0nlVOHP9o+3DMDKwPLVSGYYk1wWJVwEG7xdULrxDh64PAg==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.5.4</title>\n            <pubDate>Mon, 25 Nov 2024 16:06:59 +0800</pubDate>\n            <sparkle:version>154</sparkle:version>\n            <sparkle:shortVersionString>1.5.4</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了与 macOS 12 的兼容性以及一些 UI 问题.</li>\n                <li>允许用户从程序坞和菜单栏中同时隐藏 QuickRecorder, 并使用快捷键呼出面板.</li>\n                <li>当将 QuickRecorder 从程序坞隐藏后, App 启动时将不会自动弹出主面板.</li>\n                </ul><ul>\n                <li>Fixed compatibility with macOS 12 and fixed some UI issues.</li>\n                <li>Allows users to hide QuickRecorder from both Dock and Menu Bar.</li>\n                <li>If QuickRecorder isn't on the Dock, the main panel will not open after launching.</li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.4/QuickRecorder_v1.5.4.dmg\" length=\"4256259\" type=\"application/octet-stream\" sparkle:edSignature=\"VPkGyrw60YhQsmeNHXV6aXfGdkM1yZ/xxkgwQHdM+hwtsxH66w6gmrYSXx9lIwneoq4Te2u3ql+YZCezdVBFDQ==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.4/Update154-153.delta\" sparkle:deltaFrom=\"153\" length=\"641902\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"hBcnfVhB8/4sf9OaYxMMjVg+5a4mJEM0/Ki1ufh4QTUYPxeOE7M4DDHz++RDWgPZUTbHa9fPimq+Mb6qDeC8Ag==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.4/Update154-152.delta\" sparkle:deltaFrom=\"152\" length=\"651322\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"QNsJB+mDhpR6ZwJQ1vS8Le/Ut9tvfLaneeZmiOw4KXVx6glHN2D/BDQjSj6s18JX7REMJKD9nESH5L33rKWNDg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.4/Update154-150.delta\" sparkle:deltaFrom=\"150\" length=\"690026\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"fvvnluJBap8l3dgpnFChPWOl3+KQfZNkbTI/hN3mbxkgjve39LkoXIgWGZ/a9R/3fBZ6b3+AmPtzkswEm8hVBA==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.5.3</title>\n            <pubDate>Fri, 01 Nov 2024 14:46:16 +0800</pubDate>\n            <sparkle:version>153</sparkle:version>\n            <sparkle:shortVersionString>1.5.3</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.3/QuickRecorder_v1.5.3.dmg\" length=\"4219222\" type=\"application/octet-stream\" sparkle:edSignature=\"AlQ7+b2iHeMIiLQoo/xGjOCM2JX47RSybLwZnE86vA/fsiQ1gr+OoB92dHJc+iwWoN+7BUGoa+TVs+H167SZBQ==\"/>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了退出视频修剪器后声音仍然在后台继续播放的bug.</li>\n                </ul><ul>\n                <li>Fixed: Sound continued to play in the background after exiting the video trimmer.</li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.3/Update153-152.delta\" sparkle:deltaFrom=\"152\" length=\"310970\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"1u/bG9nxkKdXrO6+bqDc1FMaWiQv5aGeKdGAkh4GKTfUlV6E8+8BdqXHlEAcpz8B+fYXetivknA4Xr580CIoCA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.3/Update153-150.delta\" sparkle:deltaFrom=\"150\" length=\"424802\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"wa6k58E/hHXksS9vfCW3MfJghkt40rMF/WD6iMZqgbc0iIk4a2y39x6ruO3VgbLLJK4xVsfdiTpsJIL/0CIrAA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.3/Update153-149.delta\" sparkle:deltaFrom=\"149\" length=\"613346\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"1Q0fhRggBHC9F5ctNYv01HjqUlkVfYAf5orhG6DPInPtBUpL+qo511gfu1ZG1y6jSGUG5+h5hQoflI0uA5FGDQ==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.5.2</title>\n            <pubDate>Wed, 30 Oct 2024 10:55:03 +0800</pubDate>\n            <sparkle:version>152</sparkle:version>\n            <sparkle:shortVersionString>1.5.2</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.2/QuickRecorder_v1.5.2.dmg\" length=\"4220417\" type=\"application/octet-stream\" sparkle:edSignature=\"49zusdKlI12mXATfFo0JI0pfyPFOlfgYbCGKsL+0iVDwhtuN2O+im3dzkLXkXaX0o3WKP5ZN3nucHGzWN0MjCg==\"/>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>修复了从 AirPods 麦克风录制声音时会被加速的问题.</li>\n                <li>启用\"将麦克风录制到主音轨\"后, 当仅录制音频+麦克风时会自动导出单轨文件.</li>\n                </ul><ul>\n                <li>Fixed: Audio is accelerated when recording from AirPods microphone.</li>\n                <li>By enabling \"Record Microphone to Main Track\", a single track copy of the audio file will be generated when recording \"Audio Only + Mic\".</li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.2/Update152-150.delta\" sparkle:deltaFrom=\"150\" length=\"389878\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"ObgPddqgBx7/CuyZq0XiFWWiuILNGe/Qta+E/uNoLi0ibWdDCdHnAeraS6dW/iZF1SbkA7WLBb9UoVd5LX/ODg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.2/Update152-149.delta\" sparkle:deltaFrom=\"149\" length=\"602658\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"6YCml9F0on60qpDk6N4q9FTpyjMjf0MlbrfTjPf4027RkyeKLETsr2ZtYfQCCwWjFJo+KFUjE+xervJ0TXJJAQ==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.2/Update152-148.delta\" sparkle:deltaFrom=\"148\" length=\"605742\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"U3Q/a7DJFA4T0Hadd1Zfdy6f3K2LaCJFVtYHYEIqZw7OtWhKwgVJkdv3T11oIBBeZVE2aM5HfwsA4jm/evOGDQ==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.5.0</title>\n            <pubDate>Mon, 28 Oct 2024 16:35:53 +0800</pubDate>\n            <sparkle:version>150</sparkle:version>\n            <sparkle:shortVersionString>1.5.0</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.0/QuickRecorder_v1.5.0.dmg\" length=\"4210590\" type=\"application/octet-stream\" sparkle:edSignature=\"JrbeJ4Rqnvhgk1BeP+MLTOeewSj8SiFUcpc6MSl2N37ovgUImeBqLvBEaR6fAVGs6bJ7rGs0rnWz3rrwx5RzBQ==\"/>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 7;padding-left: 18;}</style><ul>\n                <li>重新设计了偏好设置窗口的样式.</li>\n                <li>修复了颜色选择器工作不正常的问题.</li>\n                <li>修复了多屏场景下菜单栏图标在非活动屏幕上异常高亮的问题.</li>\n                </ul><ul>\n                <li>Redesigned the preferences view.</li>\n                <li>Fixed: Color picker not working properly.</li>\n                <li>Fixed: Menu bar icons not auto greyed out on inactive screens.</li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.0/Update150-149.delta\" sparkle:deltaFrom=\"149\" length=\"546370\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"zZJw2JXzvhqXsdP+ibFF2Fk30R7Po8yglJcqzwlcapNlVt5M2sH2cJ7BSSrOLj507gmBc5R2hnEfL9KH6OISCA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.0/Update150-148.delta\" sparkle:deltaFrom=\"148\" length=\"554002\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"BzRarXZJhfnVTrSPdn1W757bMURsOpDKlbjGdYdnAaWFEanPO/91XvGJMUm8bxMQ4LwHdITPfCda16PA+r7BDQ==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.5.0/Update150-147.delta\" sparkle:deltaFrom=\"147\" length=\"687178\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"mdOk65KXhkCYDen0EuyGcH28T6ZgxU07ueFWYscdlwL+nkCgpRRPf8pHVMGj5S+c5rrMywi1ZvbMgnVoVMiiBg==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.4.9</title>\n            <pubDate>Fri, 11 Oct 2024 14:55:13 +0800</pubDate>\n            <sparkle:version>149</sparkle:version>\n            <sparkle:shortVersionString>1.4.9</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了迷你控制器模式下, 相机选择弹窗异常消失的 bug</li>\n                  </ul><ul>\n                  <li>Fixed: Camera menu automatically closes in mini controller mode.</li>\n                  </ul><br><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.9/QuickRecorder_v1.4.9.dmg\" length=\"4186467\" type=\"application/octet-stream\" sparkle:edSignature=\"1HMuJyLhhKjtONUGZHZCJxnQdvlJf0/BVUHJpoPExA5LFxGIc0T9HevZeJxJfmlbaoSqIX8SkHR/cfUNVfTCBg==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.9/Update149-148.delta\" sparkle:deltaFrom=\"148\" length=\"213178\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"Nl9d+4UKpMmGOCAcW26rkPo+7vSbLufO21CU6CSRLpxY0mw2L9a+q9VHHYKU36A9vfLKDc1Lvz40hfmSg22rAg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.9/Update149-147.delta\" sparkle:deltaFrom=\"147\" length=\"500730\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"yDBGMLs+EEHnUjJPPlgPm913Pm11L2nl9KI/GGPb7/KcfREIFZMuLwrEYKTmVuo0wllZztfSSm7ZBYgafdloDA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.9/Update149-146.delta\" sparkle:deltaFrom=\"146\" length=\"544134\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"QwYGQRb+04mlhfJRzH5OpbRR/HY0eDsze4cQ2R7P9AfyRlnjAHQQ7F0tGVZBsOMnhkI5yNsEOP/QAfAvmHJ6AQ==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.4.8</title>\n            <pubDate>Tue, 24 Sep 2024 10:31:06 +0800</pubDate>\n            <sparkle:version>148</sparkle:version>\n            <sparkle:shortVersionString>1.4.8</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>支持通过 AppleScript 调用各种录制功能.</li>\n                  <li>修复了一些已知的问题.</li>\n                  </ul><ul>\n                  <li>Added AppleScript support for QuickRecorder.</li>\n                  <li>Fixed some known issues.</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.8/QuickRecorder_v1.4.8.dmg\" length=\"4186553\" type=\"application/octet-stream\" sparkle:edSignature=\"11USrM7sWFTu/WLCgyPNt/BK2u4WcHEn985upow/XxuMNLU0aLVO7iuIRccucvjfrYmkeSajCHKOSXYtjFY/CA==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.8/Update148-147.delta\" sparkle:deltaFrom=\"147\" length=\"488198\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"sJvWfkSX+omv+oPtNoSC4+NK0dRqOi1gsPrq8//5LRrZfZQDYa+RWPutoyKrFOqPxj/bXtRVzFECnLFp8ux1BA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.8/Update148-146.delta\" sparkle:deltaFrom=\"146\" length=\"540278\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"yosKJfJQ1nt9i7dvS/WDXKL44v2Clj7SqajuOlOEWdXIewF9Ac3UGZFNHwXX/V0DFP9ASlSmLwo1el7CIvXLAQ==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.8/Update148-145.delta\" sparkle:deltaFrom=\"145\" length=\"624082\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"Vh6m5Vj//d3XC+BgUCNcczh5NpRlm6tO7SzElBEPrKmDR6h44/RZpJVTHHq5/xS7BSqnlu1EphkkeDYRON6JDQ==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.4.7</title>\n            <pubDate>Wed, 18 Sep 2024 15:49:13 +0800</pubDate>\n            <sparkle:version>147</sparkle:version>\n            <sparkle:shortVersionString>1.4.7</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>支持在其他 App 处于全屏模式时框选录制区域</li>\n                  <li>添加了新的\"迷你控制器\"模式, 可以减少菜单栏空间占用</li>\n                  </ul><ul>\n                  <li>Support selecting the recording area on the top of full-screen apps.</li>\n                  <li>Added new \"Mini Controller\" mode to save menu bar space.</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.7/QuickRecorder_v1.4.7.dmg\" length=\"4156014\" type=\"application/octet-stream\" sparkle:edSignature=\"bwU6QxRDKZQb1+CRG9LZwNMTAPMsvmmzuCTys3S7iSD/AupfqfU0ZJFUR7AOEFULwXQJtdRVsIQd2VJj3wcaCg==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.7/Update147-146.delta\" sparkle:deltaFrom=\"146\" length=\"386258\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"TIBN9ntQOr0Oi5fu23CeSyFoDnrMcrOpsBV6m2l+LUuEWgGi8tyRJqh5Ivydt+OZyiGb6tCz3p4hnVusMuVtAQ==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.7/Update147-145.delta\" sparkle:deltaFrom=\"145\" length=\"505690\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"5k0c5LFiUJoLT52hJnHhww1NoEV07aBCSCT+u9f2fS2gJJ8GlP1U4FIi5V1uCPIEaxEF25kmcqL8KtATIaq6Bg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.7/Update147-144.delta\" sparkle:deltaFrom=\"144\" length=\"614102\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"D/iaph/g06bX2PUAfyZya7c48oXqCEXcUQmckaAPCfm/qI7Oe1aaI8JdlP9xzLb3l+xNnQ99B0ZCSZXkdrRBBQ==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.4.6</title>\n            <pubDate>Thu, 15 Aug 2024 21:53:56 +0800</pubDate>\n            <sparkle:version>146</sparkle:version>\n            <sparkle:shortVersionString>1.4.6</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>当检测到用户所选的输出目录不存在时, 自动创建指定文件夹</li>\n                  </ul><ul>\n                  <li>Automatically create the output directory if it does not exist.</li>\n                  </ul><br><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.6/QuickRecorder_v1.4.6.dmg\" length=\"4151662\" type=\"application/octet-stream\" sparkle:edSignature=\"W4R/3e06No3xB5PeMUQDi2Jm8aUMC4jsTj5CE9vcTJjY/OtYTc+BazbduOIZiP678emHV+DCmed1utDyjy7WDg==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.6/Update146-145.delta\" sparkle:deltaFrom=\"145\" length=\"409410\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"7QFLEB3epczl1/V/SDUdk8m7FaLyDjm+DHbOYwNZ3ayzN5DkYtU6Qts5+iDXzOaNGFDx3e8THRCFFfarOiaDCw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.6/Update146-144.delta\" sparkle:deltaFrom=\"144\" length=\"544314\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"w9y7T6mrn0rLjOlWxa+BoLYww8/wNBD585H9+YCqH+/qR/NVFAkdXwKw0xLTu32TqkDQj18/lccRmoBI7nlWDw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.6/Update146-143.delta\" sparkle:deltaFrom=\"143\" length=\"544354\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"s6pwx2+Vhqk8Ry95HSnfK6JFIVtoBuVZ7MQzX2k/qO7b5vKd4O55l6HdzpXVhpq0FMcDonbwtmLXSmspMROaCg==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.4.5</title>\n            <pubDate>Fri, 09 Aug 2024 00:26:38 +0800</pubDate>\n            <sparkle:version>145</sparkle:version>\n            <sparkle:shortVersionString>1.4.5</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了仅录制系统音频时, 即使没有启用麦克风也会录制麦克风音频的问题</li>\n                  </ul><ul>\n                  <li>Fixed: When recording system audio, microphone is recorded even if it is not enabled</li>\n                  </ul><br><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.5/QuickRecorder_v1.4.5.dmg\" length=\"4060679\" type=\"application/octet-stream\" sparkle:edSignature=\"J4HOkKzZLiYu+S7sbNG0eMrRcHcR2cMGG13yJFIZTEacQK5h4QKGt+2c8v1V+17od0f9WmmMjzMyqYNoYFLDCg==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.5/Update145-144.delta\" sparkle:deltaFrom=\"144\" length=\"444322\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"HXrHXxfrQ1ZuD47cTHUeZNh5tA5wOBrv3AJnkUkJ9nwt6MdfA3Vj/28A8eNWZPwKFFuLhEQIw5yYGp3n7oUqBA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.5/Update145-143.delta\" sparkle:deltaFrom=\"143\" length=\"444922\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"Ve7tW+tvwN/zse5KovEo4gwoP/sQZM4XDEOqTVzA6nrj0Znp8mddCoomW/nP6f64QiGoNbev2KKsrth1n2JODA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.5/Update145-142.delta\" sparkle:deltaFrom=\"142\" length=\"438694\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"3Vr8fNxWnP79EQ9sW2Vxb4P3RbV8yM/fePv7JciY05DTH4jvqsOlkYx8ZmtMCwY1etTq3q8K/pAVviGG4Z30AA==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.4.4</title>\n            <pubDate>Sun, 14 Jul 2024 11:09:29 +0800</pubDate>\n            <sparkle:version>144</sparkle:version>\n            <sparkle:shortVersionString>1.4.4</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了录制移动设备结束后, 点击 Dock 图标无法唤起主面板的bug</li>\n                  </ul><ul>\n                  <li>Fixed: Dock icon not working after recording a mobile device</li>\n                  </ul><br><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.4/QuickRecorder_v1.4.4.dmg\" length=\"4064716\" type=\"application/octet-stream\" sparkle:edSignature=\"Ynd5633HjFXV0pXrkgM/MMn8nnLldKcXHvOF+jIZh1HRlfx/oz/rSAETPmc1R+INMVQ3JXjdq+srTJL/lh+iCQ==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.4/Update144-143.delta\" sparkle:deltaFrom=\"143\" length=\"63950\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"8782zmos1kGTgaSzG66QsU2VD5tXgVmAg/iviIA/q2Y0dXCMdQMGK+7N/vB4ftfunt/jX4yc66o6XfUzU7htCw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.4/Update144-142.delta\" sparkle:deltaFrom=\"142\" length=\"85850\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"7391OOXiDB0vHkdEDHtG17FGFh049Qp+aRJDj2RfJNDkVsQ0jfCwqACSafnwc6U7dNwry1jeSY+9ordBREDHDg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.4/Update144-141.delta\" sparkle:deltaFrom=\"141\" length=\"161710\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"iDLLYElgnRB1C3cDGWMMZSdPrGJVtighmA9qK4Qxu6m9XMrlFRNsVohckYldR533YitXvTjrYA7hAbQqajj0AQ==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.4.3</title>\n            <pubDate>Wed, 10 Jul 2024 22:24:28 +0800</pubDate>\n            <sparkle:version>143</sparkle:version>\n            <sparkle:shortVersionString>1.4.3</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了部分 UI 控件在非 HiDPi 显示器上抽搐的问题</li>\n                  <li>允许在仅录制音频的情况下暂停录制</li>\n                  </ul><ul>\n                  <li>Fixed: Some UI elements may shake at certain resolutions</li>\n                  <li>Allows pausing recording while recording system audio</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.3/QuickRecorder_v1.4.3.dmg\" length=\"4065188\" type=\"application/octet-stream\" sparkle:edSignature=\"LjjANoeu9h3JzdgXpkMIe3Y8srinr1mYYP3TKG5yeQjC0b4SFDtNDs7ssps/6ZGex8WsXODGK9PV3wZXKQZADw==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.3/Update143-142.delta\" sparkle:deltaFrom=\"142\" length=\"75250\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"8ofys99xfRyRhJUQiI3jbgQmzvusWskxjb28MKtKwofrL+U0VPON1x8PDy9FhVbMCrKizPUobUo8e9NECOgsDw==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.3/Update143-141.delta\" sparkle:deltaFrom=\"141\" length=\"159074\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"hw0cQJ07Nps8tv1OhncoGiODrfFkcubT8Ir16hs0zD5GQxLv+JAc0/1ceghvCz16ETW5vynuYhNrojz/Oj8sDg==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.3/Update143-140.delta\" sparkle:deltaFrom=\"140\" length=\"1289670\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"yIKFu3nzsyGwFV9kRwiL1c0we6G1CR735WlQ0g0uFEvJDNzWdZ4aT4FH0sFL/y6UQx61KKTwPoEy0iwM1f62DA==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.4.2</title>\n            <pubDate>Wed, 03 Jul 2024 15:40:53 +0800</pubDate>\n            <sparkle:version>142</sparkle:version>\n            <sparkle:shortVersionString>1.4.2</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>内置的摄像头悬浮窗现在可以显示在全屏应用上层</li>\n                  </ul><ul>\n                  <li>Camera overlay can displayed on top of full-screen applications.</li>\n                  </ul><br><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.2/QuickRecorder_v1.4.2.dmg\" length=\"4065391\" type=\"application/octet-stream\" sparkle:edSignature=\"SZ20JaPZZcwP+JyzBM97dqwBQWtZGvoN31O/4y9sBQFsU3NR612ayt0Ku9I1BeVo6/Xj2c8ee5T94egbHHjBCg==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.2/Update142-141.delta\" sparkle:deltaFrom=\"141\" length=\"147622\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"HtQ380CRo8GWvMUkvf5aQe56C4fpgrRp0d4chUfXOSkIordiD1B5lvyQcBlmD3hmF9xv67r28q2KtHUnliv5BA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.2/Update142-140.delta\" sparkle:deltaFrom=\"140\" length=\"1291670\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"nD3UeL6D/HiQZGergNzQzROsIk6AQYcEdyb55dDYKcMfMI3z4XOPdq28sNWDwaBeI1dZJhhlPf+DbUNhkZGICQ==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.2/Update142-139.delta\" sparkle:deltaFrom=\"139\" length=\"1291266\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"fTeLLbpuLysJDLihsZzEbtq6VQ3LNPzmaK8iK+rZ2zXJHVMoEY9t87QnW9V9Eunl8YQmYj3+NXX9YBVGlgL1AQ==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.4.1</title>\n            <pubDate>Mon, 01 Jul 2024 23:24:09 +0800</pubDate>\n            <sparkle:version>141</sparkle:version>\n            <sparkle:shortVersionString>1.4.1</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>允许用户在\"仅录音\"的情况下同时录制系统声音和麦克风</li>\n                  <li>添加了新的\".qma\"文件容器格式用于保存多轨录音</li>\n                  <li>添加了麦克风选择功能, 可以从指定麦克风录制声音</li>\n                  </ul><ul>\n                  <li>Allow users to record both system sound and microphone.</li>\n                  <li>Added new \".qma\" file format for saving multi-track recordings.</li>\n                  <li>Added new \"microphone selection\" feature.</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.1/QuickRecorder_v1.4.1.dmg\" length=\"4065092\" type=\"application/octet-stream\" sparkle:edSignature=\"+oDj2eJiZPsk5a97V4EmHK/Uf2TlTIHFdE3poA5aprRBYcYXFHBqvkQwsnxWlbq9D1oZG1FmtPiiIseHm7pLAg==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.1/Update141-140.delta\" sparkle:deltaFrom=\"140\" length=\"1288754\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"f1CODF4n9bYvBN9g0bg0EbRSZCAcB+9FTj4HAI+daoFrhJMHPHRNUwiLRCrR8LC3dqO6tjPNyGa3lXIhknb4AA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.1/Update141-139.delta\" sparkle:deltaFrom=\"139\" length=\"1289602\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"POyiCbiZfFghHhPlhNTMG87Uafmj1wgVi7Yb5L0phLNEuTSl4PZknOP1CdXoEysrwNT9okZ0j8lbgHTXRAVEDA==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.1/Update141-138.delta\" sparkle:deltaFrom=\"138\" length=\"1312790\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"YkQPBup/+TirVVRWRejaiZnScvPFgDxThkv/M5TPAFLUWPs/uh6Xdsg4gdNvb2MXzZrtKUft3fPXaeyeS5dsDA==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.4.0</title>\n            <pubDate>Sat, 22 Jun 2024 00:14:33 +0800</pubDate>\n            <sparkle:version>140</sparkle:version>\n            <sparkle:shortVersionString>1.4.0</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style>\n                  <b>对于近期由于证书过期和适配 macOS 15 过程中产生的 bug 跟大家说声抱歉</b><ul>\n                  <li>修复了暂停录制时麦克风输入没有被暂停的问题</li>\n                  <li>修复了启用\"降低麦克风串扰\"时麦克风变成单声道的问题</li>\n                  </ul>\n                  <b>Sorry about created tons of bugs when adapt my app for macOS 15</b><ul>\n                  <li>Fixed: Microphone input cannot be paused</li>\n                  <li>Fixed: Microphone becomes mono when ANC is enabled</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.0/QuickRecorder_v1.4.0.dmg\" length=\"3183953\" type=\"application/octet-stream\" sparkle:edSignature=\"0S/W/u75Cjfk+kfzxp0TSP2HO/AG2b6PTHgUQM5tyPPdWXlYJWtXA8yVTXItnCO4sqoLIkLyzacIBseaXkesBg==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.0/Update140-139.delta\" sparkle:deltaFrom=\"139\" length=\"106938\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"h08wQrPKuODNRScEjBr7OalQq+ezniMutzcak28C945u7N7GC5KvrqBm71Bqn6LTiWHCWd6E8DlDvt+HN6TQAQ==\"/>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.4.0/Update140-138.delta\" sparkle:deltaFrom=\"138\" length=\"300510\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"BRJHYnOkNBxLiZ0oC+EGDea41GAWkd+U/u+wlbrs5cwrJMYIgoMrN2NzN6APsq7Pr6xZwYOuGIXmSHtcdBslAg==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.3.9</title>\n            <pubDate>Fri, 21 Jun 2024 02:00:38 +0800</pubDate>\n            <sparkle:version>139</sparkle:version>\n            <sparkle:shortVersionString>1.3.9</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style>\n                  <b>对于近期由于证书过期和适配 macOS 15 过程中产生的 bug 跟大家说声抱歉</b><ul>\n                  <li>修复了关闭\"录制应用声音\"后无法单独录制系统音频的问题</li>\n                  <li>更新了不同画质的码率估算方法</li>\n                  </ul>\n                  <b>Sorry about created tons of bugs when adapt my app for macOS 15</b><ul>\n                  <li>Fixed: Cannot record system audio alone after turning off \"App's Audio\"</li>\n                  <li>Updated the bitrate estimation method for different output qualities</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"260\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.3.9/QuickRecorder_v1.3.9.dmg\" length=\"3183886\" type=\"application/octet-stream\" sparkle:edSignature=\"zODm7MYDBP9ed4V9RZof8GHg63veLgS/c7CHFtn6GMhKB01Vr6BV6DDAJa+MTJ6gX2BA+nqCaXVeGbXE9r7SDQ==\"/>\n            <sparkle:deltas>\n                <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.3.9/Update139-138.delta\" sparkle:deltaFrom=\"138\" length=\"297202\" type=\"application/octet-stream\" sparkle:deltaFromSparkleExecutableSize=\"864896\" sparkle:deltaFromSparkleLocales=\"de,he,ar,el,ja,fa,en\" sparkle:edSignature=\"dlbEoEE/Yl01IzJ2/ZBjWdjsj89h++mun4J0zXs9pWARbpTX+3pIUW5hy9QHLac1T0qDaNIRUltVG07bOCZUCw==\"/>\n            </sparkle:deltas>\n        </item>\n        <item>\n            <title>v1.3.8</title>\n            <pubDate>Wed, 19 Jun 2024 15:24:50 +0800</pubDate>\n            <sparkle:version>138</sparkle:version>\n            <sparkle:shortVersionString>1.3.8</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了音频录制异常和视频画面偏色的问题</li>\n                  <li>修复了某些情况下暂停录制可能导致文件保存失败的问题</li>\n                  <li>修复了低分辨率录制的时候码率偏低导致画面模糊的问题</li>\n                  <li><b>对于近期由于证书过期和适配 macOS 15 过程中产生的 bug 跟大家说声抱歉</b></li>\n                  </ul><ul>\n                  <li>Fixed: Distorted audio and color cast of video output</li>\n                  <li>Fixed: Pausing recording sometimes corrupts output file</li>\n                  <li>Fixed: Blurry video when recording at low resolution</li>\n                  <li><b>Sorry about created tons of bugs when adapt my app for macOS 15</b></li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.3.8/QuickRecorder_v1.3.8.dmg\" length=\"3236184\" type=\"application/octet-stream\" sparkle:edSignature=\"hNzs6BsfdGubVVFgEsDEEdRNulqIymSqBbt3rUpC/PGL1doHDfoOJYlaV7Gs9hSoNgyG3bFu9nsKFQj3A2jxBQ==\"/>\n        </item>\n        <item>\n            <title>v1.3.7</title>\n            <pubDate>Mon, 17 Jun 2024 18:22:24 +0800</pubDate>\n            <sparkle:version>137</sparkle:version>\n            <sparkle:shortVersionString>1.3.7</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了 \"屏幕区域录制\" 功能崩溃闪退的问题</li>\n                  <li>添加了录制倒计时指示器, 可以随时中断取消</li>\n                  </ul><ul>\n                  <li>Fixed: Crash when recording screen area</li>\n                  <li>Added countdown dialog, which can be interrupted at any time</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.3.7/QuickRecorder_v1.3.7.dmg\" length=\"3239586\" type=\"application/octet-stream\" sparkle:edSignature=\"WYLOfiYYOlDXt1FzjZe3iwZ0204avEvU3qlX52wV9z39BnBbUyqcGNsAs9V/8gX/UI7hZVT0dZ+QyuFX8WOpCg==\"/>\n        </item>\n        <item>\n            <title>v1.3.5</title>\n            <pubDate>Sun, 16 Jun 2024 09:38:33 +0800</pubDate>\n            <sparkle:version>135</sparkle:version>\n            <sparkle:shortVersionString>1.3.5</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>15.0</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>支持在 macOS 15 中录制 HDR 内容</li>\n                  <li><b>如果系统提示需要重新授予权限, 请在偏好设置中删除并重新添加!</b></li>\n                  </ul><ul>\n                  <li>Now you can record HDR content in macOS 15</li>\n                  <li><b>If macOS asks for permission again, delete it in Preferences and add it again!</b></li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"250\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.3.5/QuickRecorder_v1.3.5.dmg\" length=\"3289813\" type=\"application/octet-stream\" sparkle:edSignature=\"/xBQVAjmGvk4MiS3Zg8j5IW4KJuD4Ad9/px8O39P0ocvBMosdR5TWsk5tiusNbzttUpU1BwxgmAZM7PmffAxCA==\"/>\n        </item>\n        <item>\n            <title>v1.3.4</title>\n            <pubDate>Sat, 15 Jun 2024 01:34:41 +0800</pubDate>\n            <sparkle:version>134</sparkle:version>\n            <sparkle:shortVersionString>1.3.4</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了与 macOS 15 系统的兼容性</li>\n                  <li>更新了开发者签名</li>\n                  <li><b>如果系统提示需要重新授予权限, 请在偏好设置中删除并重新添加!</b></li>\n                  </ul><ul>\n                  <li>Fixed compatibility with macOS 15</li>\n                  <li>Updated developer signature</li>\n                  <li><b>If macOS asks for permission again, delete it in Preferences and add it again!</b></li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"260\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.3.4/QuickRecorder_v1.3.4.dmg\" length=\"3315885\" type=\"application/octet-stream\" sparkle:edSignature=\"+ftKXND7RwbgkiECne11Lv3Q4LYhJZUJU776EKSS1tWNh3ROIrp8meOImXWr1DtSwiDdPI3mKHoFZDWd4Ei6Dw==\"/>\n        </item>\n        <item>\n            <title>v1.3.3</title>\n            <pubDate>Thu, 13 Jun 2024 14:53:10 +0800</pubDate>\n            <sparkle:version>133</sparkle:version>\n            <sparkle:shortVersionString>1.3.3</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了\"App 黑名单\"无法自动保存的问题</li>\n                  <li>修复了\"屏幕放大器\"放大效果模糊的问题</li>\n                  <li>允许用户精确指定录制区域的大小</li>\n                  </ul><ul>\n                  <li>Fixed: \"App Blacklist\" cannot be saved</li>\n                  <li>Fixed: \"Screen Magnifier\" is not sharp</li>\n                  <li>Allow users to specify the size of the recording area</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"270\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.3.3/QuickRecorder_v1.3.3.dmg\" length=\"3336034\" type=\"application/octet-stream\" sparkle:edSignature=\"meU+IQhYRmnKo3loubJH1VaLigvwdWGcP6XBlfJFGsWuoTJ2vjXPw0oeGDLqhLPCXbt7DJg7qOd6QAIct5fXCw==\"/>\n        </item>\n        <item>\n            <title>v1.3.1</title>\n            <pubDate>Mon, 03 Jun 2024 00:22:12 +0800</pubDate>\n            <sparkle:version>131</sparkle:version>\n            <sparkle:shortVersionString>1.3.1</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了 macOS 12/13 系统无法录制桌面壁纸的问题</li>\n                  <li>修复了麦克风降噪功能在 macOS 12/13 导致崩溃的问题</li>\n                  </ul><ul>\n                  <li>Fixed: Unable to record desktop wallpaper in macOS 12/13</li>\n                  <li>Fixed: Enabling AEC causes crashes in macOS 12/13</li>\n                  </ul><br><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.3.1/QuickRecorder_v1.3.1.dmg\" length=\"3276143\" type=\"application/octet-stream\" sparkle:edSignature=\"7lMrAZz1Nl3ddvVoIdo7OTHAPqDoy94FZDU3za4rcyZykJa75mx/DrtWZqLCBTnnXnHErP+NJg0Qrs3cR1y0AQ==\"/>\n        </item>\n        <item>\n            <title>v1.3.0</title>\n            <pubDate>Sun, 02 Jun 2024 00:37:27 +0800</pubDate>\n            <sparkle:version>130</sparkle:version>\n            <sparkle:shortVersionString>1.3.0</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了使用屏幕放大镜后下次还是自动启用的问题</li>\n                  <li>在改变窗口选择器过滤选项的时候自动刷新窗口列表</li>\n                  <li>改变了偏好设置面板的弹出方式</li>\n                  </ul><ul>\n                  <li>Fixed: Screen magnifier pops up even if it is not enabled</li>\n                  <li>Auto refresh the window list when changing the filter options</li>\n                  <li>Show preferences in a separate window</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]></description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.3.0/QuickRecorder_v1.3.0.dmg\" length=\"3274823\" type=\"application/octet-stream\" sparkle:edSignature=\"AUeqQLKJmC4Rb1A2RLUdoRLfQqvqazx5scjZ00dX84Hzzem+VFe/veegi+BAyIigilnskOwkg/1Z5w8fnw0yCw==\"/>\n        </item>\n        <item>\n            <title>v1.2.9</title>\n            <pubDate>Wed, 29 May 2024 10:01:37 +0800</pubDate>\n            <sparkle:version>129</sparkle:version>\n            <sparkle:shortVersionString>1.2.9</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了某些情况下无法正常列出所有窗口缩略图的问题</li>\n                  <li>添加了警告防止用户运行多个 QuickRecorder 实例</li>\n                  </ul><ul>\n                  <li>Fixed: Unable to create window thumbnail list</li>\n                  <li>Prevent users from running multiple instances of QuickRecorder</li>\n                  </ul><br><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.2.9/QuickRecorder_v1.2.9.dmg\" length=\"3274843\" type=\"application/octet-stream\" sparkle:edSignature=\"KoRg9jqsHeMiHtSVdpUXv9D34XrFGmjG3Xpb0Zg+Xpv602HadXrJtR1ns9uWLTeFBpHUhHGU6tx/yXJjTy5NAg==\"/>\n        </item>\n        <item>\n            <title>v1.2.8</title>\n            <pubDate>Mon, 27 May 2024 23:57:45 +0800</pubDate>\n            <sparkle:version>128</sparkle:version>\n            <sparkle:shortVersionString>1.2.8</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>使用\"屏幕区域\"录制功能时会自动恢复上次的选择区域</li>\n                  </ul><ul>\n                  <li>Auto restore the last selected area when use \"Screen Area\" mode</li>\n                  </ul><br><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"350\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.2.8/QuickRecorder_v1.2.8.dmg\" length=\"3244872\" type=\"application/octet-stream\" sparkle:edSignature=\"SUhY8gxYIc/MwGgnZtauClkSoApjNeFPDN7UdvLeVvPjxRW31Ist0teWfv3Jb5zHWqxO5CyQBQ+frxtYPW+1CQ==\"/>\n        </item>\n        <item>\n            <title>v1.2.7</title>\n            <pubDate>Fri, 24 May 2024 14:40:21 +0800</pubDate>\n            <sparkle:version>127</sparkle:version>\n            <sparkle:shortVersionString>1.2.7</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了 QuickRecorder 被设为默认视频播放器的问题</li>\n                  <li>修复了意大利语翻译导致的界面错位</li>\n                  </ul><ul>\n                  <li>Fixed: QuickRecorder is no longer set as default player</li>\n                  <li>Fixed: Italian localization</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.2.7/QuickRecorder_v1.2.7.dmg\" length=\"3242071\" type=\"application/octet-stream\" sparkle:edSignature=\"yjgdJiqtrEyCQan9GYssLr8x1aMW4FQetQZ9J2uGiMRkWwDgF+iCvk01WWKnhGwbTyV3zDcFfTrsPf5pnY9YDw==\"/>\n        </item>\n        <item>\n            <title>v1.2.6</title>\n            <pubDate>Tue, 21 May 2024 16:54:08 +0800</pubDate>\n            <sparkle:version>126</sparkle:version>\n            <sparkle:shortVersionString>1.2.6</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <sparkle:criticalUpdate></sparkle:criticalUpdate>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>添加了\"降低麦克风音频串扰\"的选项, 开启后可以抑制外放回音</li>\n                  <li>修复了视频修剪器导出缓慢和丢失声音的问题</li>\n                  </ul><ul>\n                  <li>Added: New \"Enable Acoustic Echo Cancellation\" option</li>\n                  <li>Fixed: Fixed: Video trimmer export slow and missing audio</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.2.6/QuickRecorder_v1.2.6.dmg\" length=\"3242644\" type=\"application/octet-stream\" sparkle:edSignature=\"SN9BJBEyK+R2D0KFQbRiplE4PgwVh7Kqg4gFL9HMvs4pmhDHoCVJ6cMqCJbRcB767Nj0tOeKvGeAaD1ktNd8Bw==\"/>\n        </item>\n        <item>\n            <title>v1.2.5</title>\n            <pubDate>Mon, 20 May 2024 22:47:06 +0800</pubDate>\n            <sparkle:version>125</sparkle:version>\n            <sparkle:shortVersionString>1.2.5</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <sparkle:criticalUpdate></sparkle:criticalUpdate>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了\"录制系统声音\"功能无法正常工作的bug</li>\n                  <li>添加了将录音输出为 MP3 格式的选项</li>\n                  <li>修复了视频修剪器打开文件错误 (@Pedro-Beirao)</li>\n                  <li>添加了意大利语本地化 (@piersandro)</li>\n                  </ul><ul>\n                  <li>Fixed: Cannot recording system sound</li>\n                  <li>Added: Save recordings in MP3 format</li>\n                  <li>Fixed: Video trimmer opening wrong file (@Pedro-Beirao)</li>\n                  <li>Added: Italian localization (@piersandro)</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"260\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.2.5/QuickRecorder_v1.2.5.dmg\" length=\"3242368\" type=\"application/octet-stream\" sparkle:edSignature=\"jJ0Wg4fyEtTEyJ2Xmlo+6K8McqKcXIJJ9p5q/KIeuNBxr5QeWuXxjYEEH8vZMVLEtWdVZwa4FrR1LQ9XlhOLCw==\"/>\n        </item>\n        <item>\n            <title>v1.2.4</title>\n            <pubDate>Mon, 20 May 2024 04:22:57 +0800</pubDate>\n            <sparkle:version>124</sparkle:version>\n            <sparkle:shortVersionString>1.2.4</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了\"演讲者前置\"功能无法正常工作的问题</li>\n                  <li>修复了摄像头悬浮窗的显示逻辑</li>\n                  </ul><ul>\n                  <li>Fixed: Presenter Overlay not working properly</li>\n                  <li>Fixed: Camera overlay displays incorrectly</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"350\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.2.4/QuickRecorder_v1.2.4.dmg\" length=\"2917816\" type=\"application/octet-stream\" sparkle:edSignature=\"FEtbC0GUA5GTbiCbwT++xBP3Rm9GDd358e+j5zsPYZ2UBR7/PRVw4GSBvRiB+kOYs/eZBAnkwc0D5Z2JDAwECw==\"/>\n        </item>\n        <item>\n            <title>v1.2.3</title>\n            <pubDate>Sat, 18 May 2024 01:26:12 +0800</pubDate>\n            <sparkle:version>123</sparkle:version>\n            <sparkle:shortVersionString>1.2.3</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <sparkle:criticalUpdate></sparkle:criticalUpdate>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li><strong>修复了使用屏幕区域录制功能后 CPU 占用率异常升高的问题</strong></li>\n                  <li>修复了屏幕区域选择器转移到另一个屏幕上后录制错位的问题</li>\n                  <li>修复了某些录制模式下, 菜单栏控制器样式错误的问题</li>\n                  <li>添加了开始录制一段时间后定时停止录制的功能</li>\n                  <li>添加了可以将麦克风声音合并入主音轨的功能</li>\n                  </ul><ul>\n                  <li><strong>Fixed: High CPU usage after using the screen area recording</strong></li>\n                  <li>Fixed: Area selector got wrong position after moving to another screen</li>\n                  <li>Fixed: Incorrect menu bar controller style in some recording modes</li>\n                  <li>Added the ability to stop recording at a scheduled time</li>\n                  <li>Added the ability to merge microphone sounds into the main audio track</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"200\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.2.3/QuickRecorder_v1.2.3.dmg\" length=\"2910865\" type=\"application/octet-stream\" sparkle:edSignature=\"quRl/Ppg75fSnLV/MM1ad99DuhaTuyA5wkdyMeNI7hUiGRmwFuvDByZVI+S+cdNeNtgBhsr8l7dN4/umjytYBw==\"/>\n        </item>\n        <item>\n            <title>v1.2.2</title>\n            <pubDate>Tue, 14 May 2024 22:30:17 +0800</pubDate>\n            <sparkle:version>122</sparkle:version>\n            <sparkle:shortVersionString>1.2.2</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了即使不设置显示菜单栏图标, 菜单栏也会出现空白图标的bug</li>\n                  </ul><ul>\n                  <li>Fixed an issue where a blank icon appears in menubar</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"350\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.2.2/QuickRecorder_v1.2.2.dmg\" length=\"2839534\" type=\"application/octet-stream\" sparkle:edSignature=\"mlhgOSZZ8/PFLxk2y9bZ8zeGje8dIhB4AuuDzPr6XNO9PC4gpDENeZo3r3VuAUZp7LZJPD4kzGR66bkewIR1Dg==\"/>\n        </item>\n        <item>\n            <title>v1.2.1</title>\n            <pubDate>Mon, 13 May 2024 17:06:14 +0800</pubDate>\n            <sparkle:version>121</sparkle:version>\n            <sparkle:shortVersionString>1.2.1</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了使用快捷键开始录制后, 菜单栏指示器不显示的问题</li>\n                  <li>修正部分 UI 文本以及部分控件在英文环境下显示异常的问题</li>\n                  <li>现在可以选择将 QuickRecorder 图标显示在 Dock 或菜单栏</li>\n                  </ul><ul>\n                  <li>Fixed: Indicator does not display when using hotkeys to start recording</li>\n                  <li>Fixed: Some UI string are not displayed properly in English environment</li>\n                  <li>You can now choose to display the App icon in the Dock or menu bar</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.2.1/QuickRecorder_v1.2.1.dmg\" length=\"2839065\" type=\"application/octet-stream\" sparkle:edSignature=\"fMAg82h4jDrOJQ/ie5kHLf8nTXOKDr/ozEW651JwNzpIkPQdOJtfeLqAOK3NURzkeZ1bb2QPn3UiYsUZZInkBQ==\"/>\n        </item>\n        <item>\n            <title>v1.2.0</title>\n            <pubDate>Sat, 11 May 2024 09:08:16 +0800</pubDate>\n            <sparkle:version>120</sparkle:version>\n            <sparkle:shortVersionString>1.2.0</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了\"屏幕区域选择器\"在多屏场景下超出边界的问题</li>\n                  <li>修复了多屏场景下部分窗口出现在错误的屏幕上的问题</li>\n                  <li>现在\"屏幕区域选择器\"可随鼠标自动在多个屏幕间切换</li>\n                  <li>为 \"窗口选择器\" 和 \"应用程序选择器\" 添加了多屏支持</li>\n                  </ul><ul>\n                  <li>Fixed: Area Selector could go out of bounds when using multiple monitors</li>\n                  <li>Fixed: Some window positions shifted when using multiple monitors</li>\n                  <li>The \"Area Selector\" can auto-switch between screens following the mouse</li>\n                  <li>Added multi-screen support for \"Window Selector\" and \"App Selector\"</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"260\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.2.0/QuickRecorder_v1.2.0.dmg\" length=\"2797825\" type=\"application/octet-stream\" sparkle:edSignature=\"EheU97WCWo6cFkmdSfdTndsPYGabB2oMsYq6tvWZPPZnu4n0PyX+s4nwc6TyjzD6DZf4cMpok1MDrDt0eZgWDg==\"/>\n        </item>\n        <item>\n            <title>v1.1.8</title>\n            <pubDate>Thu, 09 May 2024 01:29:16 +0800</pubDate>\n            <sparkle:version>118</sparkle:version>\n            <sparkle:shortVersionString>1.1.8</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description>\n              <![CDATA[\n                  <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                  <li>修复了\"应用程序\"录制模式下, 录不到摄像头画面的问题</li>\n                  <li>修复某些情况下\"区域录制\"录制的不是所选显示器的问题</li>\n                  <li>修复\"视频修剪器\"在 macOS 12 系统中工作不正常的问题</li>\n                  <li>允许用户在录屏的同时以画中画形式展示 iPhone/iPad 画面</li>\n                  </ul><ul>\n                  <li>Fixed: camera overlayer could not be recorded when recording applications</li>\n                  <li>Fixed: when recording screen area, the wrong monitor may be recorded</li>\n                  <li>Fixed: the \"Video Trimmer\" not working properly in macOS 12 Monterey</li>\n                  <li>Now you can show iPhone/iPad in picture-in-picture while recording a Mac</li>\n                  </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"260\"/>\n              ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.1.8/QuickRecorder_v1.1.8.dmg\" length=\"2716609\" type=\"application/octet-stream\" sparkle:edSignature=\"HSpruBCslp/Mnu+/Jb6pGhGBEwI64+co+XTLtri6OPYvpeYU6PUcf5MYtuEI8RUgogsk2KKlsk/P+Lh3ZKgPCg==\"/>\n        </item>\n        <item>\n            <title>v1.1.7</title>\n            <pubDate>Tue, 07 May 2024 01:37:01 +0800</pubDate>\n            <sparkle:version>117</sparkle:version>\n            <sparkle:shortVersionString>1.1.7</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                <li>当菜单栏中的录制指示器因空间不足被隐藏时, 会自动转变为浮动窗口</li>\n                <li>修复了在非 Retina 显示器上 UI 抖动和 macOS 12 上显示错位的问题</li>\n                <li>修复了 \"屏幕区域录制\" 模式下, 无法隐藏自身窗口的问题</li>\n                <li>修复了一些界面文本中的错字漏字</li>\n                </ul><ul>\n                <li>If the menubar item cannot be displayed, it will become a floating window</li>\n                <li>Fixed UI jitter on non-Retina displays and UI misalignment on macOS 12</li>\n                <li>Fixed \"Exclude QuickRecorder itself\" not working in \"Screen Area\" mode</li>\n                <li>Fixed some typos and omissions in some UI string</li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.1.7/QuickRecorder_v1.1.7.dmg\" length=\"2694167\" type=\"application/octet-stream\" sparkle:edSignature=\"5fhoWd9twf/mN/DHNdZoedLXviHFU9Tl+d6CyJSj1bzmFi/w0ax9Jt0C4GLO8782YlDT49sBsxd5osacS/xPBQ==\"/>\n        </item>\n        <item>\n            <title>v1.1.6</title>\n            <pubDate>Sat, 04 May 2024 22:39:15 +0800</pubDate>\n            <sparkle:version>116</sparkle:version>\n            <sparkle:shortVersionString>1.1.6</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                <li>移除了不适合普通用户使用的 \"像素格式\" 选项</li>\n                <li>新增了透明度捕捉, 可在输出中包含 Alpha 通道</li>\n                <li>为 \"屏幕区域录制\" 添加了快捷键选项</li>\n                </ul><ul>\n                <li>Removed \"Pixel Format\" option not suitable for general users</li>\n                <li>Added Alpha support to include Alpha channel in output video</li>\n                <li>Added hotkey option for \"Record Screen Area\"</li>\n                </ul><img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]>\n            </description>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.1.6/QuickRecorder_v1.1.6.dmg\" length=\"2683926\" type=\"application/octet-stream\" sparkle:edSignature=\"c2869HlLfk7gm05sEMQ9weNRDwla2EfGKit5zTxUxXJQ/Xzm4WWPO97Crz+Qbv3jO2hp0u+PsLAGAl67uHieAg==\"/>\n        </item>\n        <item>\n            <title>v1.1.5</title>\n            <pubDate>Fri, 03 May 2024 00:01:46 +0800</pubDate>\n            <sparkle:version>115</sparkle:version>\n            <description><![CDATA[\n                <style>ul{margin-top: 0;margin-bottom: 5;padding-left: 18;}</style><ul>\n                <li>修复了停止录制后摄像头叠层不自动关闭的问题</li>\n                <li>修复了摄像头叠层最小尺寸没有限制的问题</li></ul><ul>\n                <li>Fixed camera overlay not closing after stopping recording</li>\n                <li>Fixed the camera overlay minimum size limit not working</li></ul>\n                <img src=\"https://github.com/lihaoyun6/QuickRecorder/raw/main/img/donate.png\" width=\"300\"/>\n            ]]>\n            </description>\n            <sparkle:shortVersionString>1.1.5</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.1.5/QuickRecorder_v1.1.5.dmg\" length=\"2683044\" type=\"application/octet-stream\" sparkle:edSignature=\"oXkTn0XAEPqLWRZQ6q5Yl5S0EG1O4WbPgwILBasohBkFsn1n3FP9IPaGvv8PtYtK9i9HRn9kMmhoIaA/OmrQBg==\"/>\n        </item>\n        \n        <item>\n            <title>1.1.4</title>\n            <pubDate>Thu, 02 May 2024 21:50:45 +0800</pubDate>\n            <sparkle:version>114</sparkle:version>\n            <sparkle:shortVersionString>1.1.4</sparkle:shortVersionString>\n            <sparkle:minimumSystemVersion>12.3</sparkle:minimumSystemVersion>\n            <enclosure url=\"https://github.com/lihaoyun6/QuickRecorder/releases/download/1.1.4/QuickRecorder_v1.1.4.dmg\" length=\"2677250\" type=\"application/octet-stream\" sparkle:edSignature=\"KaxmuyIPCnYK8kmw3r95yoQ675+L6QULQadKXJRYsP+2OZglY9n3bcNjCV5Ip4Y3YDO4+Zr5kE1J9fZALkAFAg==\"/>\n        </item>\n    </channel>\n</rss>\n"
  }
]