├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── LICENSE ├── README.md ├── VERSION ├── assets ├── setting_cog_20px.png ├── signalbash_logo_100x.png └── signalbash_logo_text_990x624.png ├── build_mac.sh ├── build_win.bat ├── docs ├── .gitkeep └── signalbash_plugin_banner_1500x500.jpg ├── packaging ├── distribution.xml.template ├── installer.iss ├── linux.md └── resources │ └── LICENSE └── source ├── CMakeLists.txt ├── CurrentElapsedTimeProgress.h ├── PluginEditor.cpp ├── PluginEditor.h ├── PluginProcessor.cpp ├── PluginProcessor.h └── RestRequest.h /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | # Installers 35 | *.pkg 36 | 37 | # Build Dirs 38 | build-macos/ 39 | macos_pkgs/ 40 | build-windows/ 41 | 42 | # Build Logs 43 | log.json 44 | 45 | # macos 46 | .DS_Store -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "libs/JUCE"] 2 | path = libs/JUCE 3 | url = https://github.com/juce-framework/JUCE.git 4 | branch = master 5 | [submodule "libs/clap-juce-extensions"] 6 | path = libs/clap-juce-extensions 7 | url = https://github.com/free-audio/clap-juce-extensions.git 8 | branch = main 9 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Example Audio Plugin CMakeLists.txt 2 | 3 | cmake_minimum_required(VERSION 3.22) 4 | 5 | set(CMAKE_CXX_STANDARD 20) 6 | set(CMAKE_OSX_DEPLOYMENT_TARGET "10.11" CACHE STRING "Minimum OS X deployment version" FORCE) 7 | set(CMAKE_OSX_ARCHITECTURES "arm64;x86_64") 8 | 9 | project(Signalbash VERSION 1.1.0) 10 | 11 | # Target JUCE 12 | add_subdirectory(libs/JUCE) 13 | # Target CLAP 14 | add_subdirectory(libs/clap-juce-extensions EXCLUDE_FROM_ALL) 15 | 16 | # If you are building a VST2 or AAX plugin, CMake needs to be told where to find these SDKs on your 17 | # system. This setup should be done before calling `juce_add_plugin`. 18 | 19 | # juce_set_vst2_sdk_path(...) 20 | # juce_set_aax_sdk_path(...) 21 | 22 | # `juce_add_plugin` adds a static library target with the name passed as the first argument 23 | # (AudioPluginExample here). This target is a normal CMake target, but has a lot of extra properties set 24 | # up by default. As well as this shared code static library, this function adds targets for each of 25 | # the formats specified by the FORMATS arguments. This function accepts many optional arguments. 26 | # Check the readme at `docs/CMake API.md` in the JUCE repo for the full list. 27 | 28 | juce_add_plugin(Signalbash 29 | # VERSION ... # Set this if the plugin version is different to the project version 30 | # ICON_BIG ... # ICON_* arguments specify a path to an image file to use as an icon for the Standalone 31 | # ICON_SMALL ... 32 | COMPANY_NAME Signalbash # Specify the name of the plugin's author 33 | COMPANY_WEBSITE https://signalbash.com 34 | IS_SYNTH FALSE 35 | NEEDS_MIDI_INPUT FALSE 36 | NEEDS_MIDI_OUTPUT FALSE 37 | IS_MIDI_EFFECT FALSE 38 | EDITOR_WANTS_KEYBOARD_FOCUS FALSE # Does the editor need keyboard focus? 39 | COPY_PLUGIN_AFTER_BUILD FALSE # Should the plugin be installed to a default location after building? 40 | PLUGIN_MANUFACTURER_CODE SIGB # A four-character manufacturer id with at least one upper-case character 41 | PLUGIN_CODE Sigb # A unique four-character plugin id with exactly one upper-case character 42 | # GarageBand 10.3 requires the first letter to be upper-case, and the remaining letters to be lower-case 43 | FORMATS AAX AU VST3 Standalone # The formats to build. Other valid formats are: AAX Unity VST AU AUv3 44 | PRODUCT_NAME "Signalbash" # The name of the final executable, which can differ from the target name 45 | AAX_CATEGORY AAX_ePlugInCategory_None # AAX Category 46 | VST3_CATEGORIES Fx Tools # VST3 Categories, not all hosts use this, but required to appear in some 47 | VST2_CATEGORY kPlugCategUnknown # Not relevant b/c we don't have access to this sdk, but maybe for others 48 | ) 49 | 50 | clap_juce_extensions_plugin(TARGET Signalbash 51 | CLAP_ID "com.signalbash.Signalbash" 52 | CLAP_FEATURES effect utility 53 | ) 54 | 55 | 56 | # `juce_generate_juce_header` will create a JuceHeader.h for a given target, which will be generated 57 | # into your build tree. This should be included with `#include `. The include path for 58 | # this header will be automatically added to the target. The main function of the JuceHeader is to 59 | # include all your JUCE module headers; if you're happy to include module headers directly, you 60 | # probably don't need to call this. 61 | 62 | juce_generate_juce_header(Signalbash) 63 | 64 | 65 | # `target_sources` adds source files to a target. We pass the target that needs the sources as the 66 | # first argument, then a visibility parameter for the sources which should normally be PRIVATE. 67 | # Finally, we supply a list of source files that will be built into the target. This is a standard 68 | # CMake command. 69 | 70 | add_subdirectory(source) 71 | 72 | #target_sources(Signalbash PRIVATE 73 | # PluginEditor.cpp 74 | # PluginProcessor.cpp) 75 | 76 | # `target_compile_definitions` adds some preprocessor definitions to our target. In a Projucer 77 | # project, these might be passed in the 'Preprocessor Definitions' field. JUCE modules also make use 78 | # of compile definitions to switch certain features on/off, so if there's a particular feature you 79 | # need that's not on by default, check the module header for the correct flag to set here. These 80 | # definitions will be visible both to your code, and also the JUCE module code, so for new 81 | # definitions, pick unique names that are unlikely to collide! This is a standard CMake command. 82 | 83 | target_compile_definitions(Signalbash 84 | PUBLIC 85 | # JUCE_WEB_BROWSER and JUCE_USE_CURL would be on by default, but you might not need them. 86 | JUCE_WEB_BROWSER=0 # If you remove this, add `NEEDS_WEB_BROWSER TRUE` to the `juce_add_plugin` call 87 | JUCE_USE_CURL=0 # If you remove this, add `NEEDS_CURL TRUE` to the `juce_add_plugin` call 88 | JUCE_VST3_CAN_REPLACE_VST2=0) 89 | 90 | # If your target needs extra binary assets, you can add them here. The first argument is the name of 91 | # a new static library target that will include all the binary resources. There is an optional 92 | # `NAMESPACE` argument that can specify the namespace of the generated binary data class. Finally, 93 | # the SOURCES argument should be followed by a list of source files that should be built into the 94 | # static library. These source files can be of any kind (wav data, images, fonts, icons etc.). 95 | # Conversion to binary-data will happen when your target is built. 96 | 97 | juce_add_binary_data(AudioPluginData SOURCES "assets/setting_cog_20px.png" "assets/signalbash_logo_100x.png" "assets/signalbash_logo_text_990x624.png") 98 | 99 | # `target_link_libraries` links libraries and JUCE modules to other libraries or executables. Here, 100 | # we're linking our executable target to the `juce::juce_audio_utils` module. Inter-module 101 | # dependencies are resolved automatically, so `juce_core`, `juce_events` and so on will also be 102 | # linked automatically. If we'd generated a binary data target above, we would need to link to it 103 | # here too. This is a standard CMake command. 104 | 105 | target_link_libraries(Signalbash 106 | PRIVATE 107 | AudioPluginData # If we'd created a binary data target, we'd link to it here 108 | juce::juce_audio_utils 109 | PUBLIC 110 | juce::juce_recommended_config_flags 111 | juce::juce_recommended_lto_flags 112 | juce::juce_recommended_warning_flags) 113 | 114 | 115 | # we need these flags for notarization on MacOS 116 | option(MACOS_RELEASE "Set build flags for MacOS Release" OFF) 117 | if(MACOS_RELEASE) 118 | message(STATUS "Setting MacOS release flags...") 119 | set_target_properties(Signalbash PROPERTIES 120 | XCODE_ATTRIBUTE_ENABLE_HARDENED_RUNTIME YES) 121 | endif() 122 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published by 637 | the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | ![Signalbash Plugin Repository Banner](docs/signalbash_plugin_banner_1500x500.jpg) 4 | 5 | # Signalbash 6 | 7 | Signalbash is a free time-tracking application that allows you to see how long you've 8 | been working in your DAW. 9 | 10 | Signalbash consists of two components: The Signalbash Plugin & The Signalbash Web App. 11 | 12 | This repository hosts the source code for the free and open source Signalbash Plugin. 13 | 14 | ## 🔗 Signalbash Links 15 | 16 | - 🌐 [Website: signalbash.com](https://signalbash.com) 17 | - 🔌 [Signalbash Plugin Home](https://signalbash.com/plugin-download) 18 | - 📜 [Signalbash Documentation](https://info.signalbash.com) 19 | 20 | 21 | ## 💿 Installation 22 | 23 | If you're an artist looking to install the plugin, the recommended & easiest way 24 | is by downloading and running the installer provided on signalbash.com, 25 | available at the following link: 26 | 27 | - [Install Plugin](https://signalbash.com/plugin-download) 28 | 29 | 30 | ## 🖥️ Platform Compatibility 31 | 32 | Signed installers for macOS (Universal) & Windows (x64 only) are currently available 33 | on signalbash.com and on this repo's Releases tab. 34 | 35 | Additionally, plugins compatible with Linux (both x64 & ARM64) can 36 | be downloaded from either of the same locations. 37 | 38 | On macOS, the installer can install the following plugin formats: 39 | 40 | - VST3 41 | - CLAP 42 | - AAX 43 | - AU 44 | 45 | On Windows, the installer can install the following plugin formats: 46 | 47 | - VST3 48 | - CLAP 49 | - AAX 50 | 51 | On Linux, the Plugin can be installed by unzipping the provided zip file, which 52 | includes the following formats: 53 | 54 | - VST3 55 | - CLAP 56 | 57 | 58 | For more info, see the [Signalbash Plugin Page](https://signalbash.com/plugin-download) 59 | 60 | 61 | #### Planned Future Compatibility 62 | 63 | - Windows ARM64 64 | 65 | 66 | ## License 67 | 68 | The Signalbash Plugin is licensed under the GNU Affero General Public License, 69 | Version 3. Individual files may have different but compatible license. 70 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 1.1.0 -------------------------------------------------------------------------------- /assets/setting_cog_20px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/signalbash-audio/signalbash/b345b3f5af1d2473f9d4c1821ab877c05fb1debb/assets/setting_cog_20px.png -------------------------------------------------------------------------------- /assets/signalbash_logo_100x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/signalbash-audio/signalbash/b345b3f5af1d2473f9d4c1821ab877c05fb1debb/assets/signalbash_logo_100x.png -------------------------------------------------------------------------------- /assets/signalbash_logo_text_990x624.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/signalbash-audio/signalbash/b345b3f5af1d2473f9d4c1821ab877c05fb1debb/assets/signalbash_logo_text_990x624.png -------------------------------------------------------------------------------- /build_mac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | cmake -B build-macos \ 5 | -DCMAKE_BUILD_TYPE=Release \ 6 | -DMACOS_RELEASE=ON \ 7 | -D"CMAKE_OSX_ARCHITECTURES=arm64;x86_64" \ 8 | -DCMAKE_OSX_DEPLOYMENT_TARGET=10.11 9 | 10 | cmake --build build-macos --config Release --target Signalbash_VST3 -j8 11 | cmake --build build-macos --config Release --target Signalbash_AU -j8 12 | cmake --build build-macos --config Release --target Signalbash_CLAP -j8 13 | 14 | -------------------------------------------------------------------------------- /build_win.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | setlocal enabledelayedexpansion 3 | 4 | :: Detect logical processors 5 | set "NUM_CORES=%NUMBER_OF_PROCESSORS%" 6 | if not defined NUM_CORES ( 7 | for /f %%i in ('powershell -NoProfile -Command "(Get-CimInstance -ClassName Win32_Processor).NumberOfLogicalProcessors"') do set "NUM_CORES=%%i" 8 | ) 9 | echo Detected !NUM_CORES! logical processors for parallel building 10 | 11 | :: Configure build 12 | cmake -B build-windows ^ 13 | -G "Visual Studio 17 2022" ^ 14 | -A x64 ^ 15 | -DCMAKE_BUILD_TYPE=Release 16 | 17 | :: Build all targets 18 | echo Building VST3 plugin... 19 | cmake --build build-windows --config Release --target Signalbash_VST3 -j!NUM_CORES! 20 | 21 | echo Building CLAP plugin... 22 | cmake --build build-windows --config Release --target Signalbash_CLAP -j!NUM_CORES! 23 | 24 | echo Build complete! 25 | -------------------------------------------------------------------------------- /docs/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/signalbash-audio/signalbash/b345b3f5af1d2473f9d4c1821ab877c05fb1debb/docs/.gitkeep -------------------------------------------------------------------------------- /docs/signalbash_plugin_banner_1500x500.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/signalbash-audio/signalbash/b345b3f5af1d2473f9d4c1821ab877c05fb1debb/docs/signalbash_plugin_banner_1500x500.jpg -------------------------------------------------------------------------------- /packaging/distribution.xml.template: -------------------------------------------------------------------------------- 1 | 2 | 3 | Signalbash 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | signalbash.vst3.pkg 21 | 22 | 23 | 24 | signalbash.au.pkg 25 | 26 | 27 | 28 | signalbash.clap.pkg 29 | 30 | -------------------------------------------------------------------------------- /packaging/installer.iss: -------------------------------------------------------------------------------- 1 | #define Version "1.1.0" 2 | #define ProjectName "Signalbash" 3 | #define ProductName "Signalbash" 4 | #define Publisher "Signalbash" 5 | #define PublisherURL "https://signalbash.com" 6 | #define Year "2025" 7 | 8 | ; 'Types': What get displayed during the setup 9 | [Types] 10 | Name: "full"; Description: "Full installation" 11 | Name: "custom"; Description: "Custom installation"; Flags: iscustom 12 | 13 | ; Components are used inside the script and can be composed of a set of 'Types' 14 | [Components] 15 | Name: "vst3"; Description: "VST3 Plugin"; Types: full custom 16 | Name: "clap"; Description: "CLAP Plugin"; Types: full custom 17 | 18 | [Setup] 19 | ArchitecturesInstallIn64BitMode=x64compatible 20 | ArchitecturesAllowed=x64compatible 21 | AppName={#ProductName} 22 | AppCopyright=Copyright (C) {#Year} {#Publisher} 23 | AppPublisher={#Publisher} 24 | AppPublisherURL={#PublisherURL} 25 | AppVersion={#Version} 26 | DefaultDirName="{commoncf64}\VST3\{#ProductName}.vst3" 27 | DisableDirPage=yes 28 | DisableProgramGroupPage=yes 29 | LicenseFile="resources\LICENSE" 30 | OutputBaseFilename={#ProductName}-{#Version}-Windows-Installer-x64 31 | Uninstallable=no 32 | VersionInfoVersion={#Version} 33 | 34 | ; MSVC adds a .ilk when building the plugin. Let's not include that. 35 | [Files] 36 | Source: "..\build-windows\{#ProjectName}_artefacts\Release\VST3\{#ProductName}.vst3\*"; DestDir: "{commoncf64}\VST3\{#ProductName}.vst3\"; Excludes: *.ilk; Flags: ignoreversion recursesubdirs; Components: vst3 37 | Source: "..\build-windows\{#ProjectName}_artefacts\Release\CLAP\{#ProductName}.clap"; DestDir: "{commoncf64}\CLAP\"; Flags: ignoreversion; Components: clap 38 | -------------------------------------------------------------------------------- /packaging/linux.md: -------------------------------------------------------------------------------- 1 | # Signalbash x Linux 2 | 3 | 4 | ## Installation 5 | 6 | To install the Signalbash plugin, 7 | 8 | - Download the appropriate zip file for your CPU architecture (either x86_64/x64 or ARM64/AARCH64) 9 | - Unzip the zip file 10 | - Copy or move the CLAP/VST3 plugins to their proper directories 11 | 12 | ### CLAP 13 | 14 | For CLAP plugins, this is typically one of the following directories: 15 | 16 | - `~/.clap` 17 | - `/usr/lib/clap` 18 | 19 | 20 | ### VST3 21 | 22 | For VST3 plugins, common locations include: 23 | 24 | - `~/.vst3` 25 | - `/usr/lib/vst3/` 26 | - `/usr/local/lib/vst3/` 27 | 28 | 29 | ## After Installation 30 | 31 | Once you've placed the plugins in their destination directories, they should 32 | automatically be recognized by your DAW. However, if your DAW was open during 33 | installation, you will have to rescan your plugins for Signalbash to appear. 34 | 35 | 36 | ## Uninstalling 37 | 38 | To uninstall, delete the plugin files from the locations where you 39 | installed the plugins. 40 | 41 | 42 | ## Usage & Documentation 43 | 44 | For more information about usage, please visit the official Signalbash documetation, 45 | available at the following link: 46 | 47 | https://info.signalbash.com/ 48 | 49 | 50 | ## License 51 | 52 | The Signalbash Plugin is licensed under the GNU Affero General Public License, Version 3. 53 | A copy of the license should be included with this program. 54 | If not, see: https://www.gnu.org/licenses/ 55 | 56 | To obtain a copy of the source, visit: https://github.com/signalbash-audio/signalbash 57 | 58 | 59 | ## Command Line Installation Example 60 | 61 | ``` 62 | # Assumes you've downloaded the zip file to the current directory 63 | # and `unzip` is installed on your machine 64 | 65 | # CLAP Destination, change if installing for all users 66 | CLAP_DEST=~/.clap # or `/usr/lib/clap` (might require sudo permissions) 67 | 68 | # VST3 Destination, change if installing for all users 69 | VST3_DEST=~/.vst3 # or "/usr/local/lib/vst3/" (might will require sudo permissions) 70 | 71 | # Create directories if they don't exist 72 | mkdir -p "${CLAP_DEST}" "${VST3_DEST}" 73 | 74 | unzip 'Signalbash-*.zip' -d signalbash_plugin 75 | cd signalbash_plugin 76 | 77 | cp Signalbash.clap "${CLAP_DEST}" 78 | echo "Copied Signalbash CLAP plugin to CLAP Plugin Directory" 79 | 80 | cp -r Signalbash.vst3 "${VST3_DEST}" 81 | echo "Copied Signalbash VST3 plugin to VST3 Plugin Directory" 82 | 83 | echo "Installation Complete" 84 | ``` 85 | -------------------------------------------------------------------------------- /packaging/resources/LICENSE: -------------------------------------------------------------------------------- 1 | Signalbash Plugin for Digital Audio Workstations. 2 | Copyright (C) 2025 Signalbash 3 | 4 | This program is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU Affero General Public License as 6 | published by the Free Software Foundation, either version 3 of the 7 | License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU Affero General Public License for more details. 13 | 14 | You should have received a copy of the GNU Affero General Public License 15 | along with this program. If not, see . 16 | 17 | The complete GNU Affero General Public License follows: 18 | 19 | # GNU AFFERO GENERAL PUBLIC LICENSE 20 | 21 | Version 3, 19 November 2007 22 | 23 | Copyright (C) 2007 Free Software Foundation, Inc. 24 | 25 | 26 | Everyone is permitted to copy and distribute verbatim copies of this 27 | license document, but changing it is not allowed. 28 | 29 | ## Preamble 30 | 31 | The GNU Affero General Public License is a free, copyleft license for 32 | software and other kinds of works, specifically designed to ensure 33 | cooperation with the community in the case of network server software. 34 | 35 | The licenses for most software and other practical works are designed 36 | to take away your freedom to share and change the works. By contrast, 37 | our General Public Licenses are intended to guarantee your freedom to 38 | share and change all versions of a program--to make sure it remains 39 | free software for all its users. 40 | 41 | When we speak of free software, we are referring to freedom, not 42 | price. Our General Public Licenses are designed to make sure that you 43 | have the freedom to distribute copies of free software (and charge for 44 | them if you wish), that you receive source code or can get it if you 45 | want it, that you can change the software or use pieces of it in new 46 | free programs, and that you know you can do these things. 47 | 48 | Developers that use our General Public Licenses protect your rights 49 | with two steps: (1) assert copyright on the software, and (2) offer 50 | you this License which gives you legal permission to copy, distribute 51 | and/or modify the software. 52 | 53 | A secondary benefit of defending all users' freedom is that 54 | improvements made in alternate versions of the program, if they 55 | receive widespread use, become available for other developers to 56 | incorporate. Many developers of free software are heartened and 57 | encouraged by the resulting cooperation. However, in the case of 58 | software used on network servers, this result may fail to come about. 59 | The GNU General Public License permits making a modified version and 60 | letting the public access it on a server without ever releasing its 61 | source code to the public. 62 | 63 | The GNU Affero General Public License is designed specifically to 64 | ensure that, in such cases, the modified source code becomes available 65 | to the community. It requires the operator of a network server to 66 | provide the source code of the modified version running there to the 67 | users of that server. Therefore, public use of a modified version, on 68 | a publicly accessible server, gives the public access to the source 69 | code of the modified version. 70 | 71 | An older license, called the Affero General Public License and 72 | published by Affero, was designed to accomplish similar goals. This is 73 | a different license, not a version of the Affero GPL, but Affero has 74 | released a new version of the Affero GPL which permits relicensing 75 | under this license. 76 | 77 | The precise terms and conditions for copying, distribution and 78 | modification follow. 79 | 80 | ## TERMS AND CONDITIONS 81 | 82 | ### 0. Definitions. 83 | 84 | "This License" refers to version 3 of the GNU Affero General Public 85 | License. 86 | 87 | "Copyright" also means copyright-like laws that apply to other kinds 88 | of works, such as semiconductor masks. 89 | 90 | "The Program" refers to any copyrightable work licensed under this 91 | License. Each licensee is addressed as "you". "Licensees" and 92 | "recipients" may be individuals or organizations. 93 | 94 | To "modify" a work means to copy from or adapt all or part of the work 95 | in a fashion requiring copyright permission, other than the making of 96 | an exact copy. The resulting work is called a "modified version" of 97 | the earlier work or a work "based on" the earlier work. 98 | 99 | A "covered work" means either the unmodified Program or a work based 100 | on the Program. 101 | 102 | To "propagate" a work means to do anything with it that, without 103 | permission, would make you directly or secondarily liable for 104 | infringement under applicable copyright law, except executing it on a 105 | computer or modifying a private copy. Propagation includes copying, 106 | distribution (with or without modification), making available to the 107 | public, and in some countries other activities as well. 108 | 109 | To "convey" a work means any kind of propagation that enables other 110 | parties to make or receive copies. Mere interaction with a user 111 | through a computer network, with no transfer of a copy, is not 112 | conveying. 113 | 114 | An interactive user interface displays "Appropriate Legal Notices" to 115 | the extent that it includes a convenient and prominently visible 116 | feature that (1) displays an appropriate copyright notice, and (2) 117 | tells the user that there is no warranty for the work (except to the 118 | extent that warranties are provided), that licensees may convey the 119 | work under this License, and how to view a copy of this License. If 120 | the interface presents a list of user commands or options, such as a 121 | menu, a prominent item in the list meets this criterion. 122 | 123 | ### 1. Source Code. 124 | 125 | The "source code" for a work means the preferred form of the work for 126 | making modifications to it. "Object code" means any non-source form of 127 | a work. 128 | 129 | A "Standard Interface" means an interface that either is an official 130 | standard defined by a recognized standards body, or, in the case of 131 | interfaces specified for a particular programming language, one that 132 | is widely used among developers working in that language. 133 | 134 | The "System Libraries" of an executable work include anything, other 135 | than the work as a whole, that (a) is included in the normal form of 136 | packaging a Major Component, but which is not part of that Major 137 | Component, and (b) serves only to enable use of the work with that 138 | Major Component, or to implement a Standard Interface for which an 139 | implementation is available to the public in source code form. A 140 | "Major Component", in this context, means a major essential component 141 | (kernel, window system, and so on) of the specific operating system 142 | (if any) on which the executable work runs, or a compiler used to 143 | produce the work, or an object code interpreter used to run it. 144 | 145 | The "Corresponding Source" for a work in object code form means all 146 | the source code needed to generate, install, and (for an executable 147 | work) run the object code and to modify the work, including scripts to 148 | control those activities. However, it does not include the work's 149 | System Libraries, or general-purpose tools or generally available free 150 | programs which are used unmodified in performing those activities but 151 | which are not part of the work. For example, Corresponding Source 152 | includes interface definition files associated with source files for 153 | the work, and the source code for shared libraries and dynamically 154 | linked subprograms that the work is specifically designed to require, 155 | such as by intimate data communication or control flow between those 156 | subprograms and other parts of the work. 157 | 158 | The Corresponding Source need not include anything that users can 159 | regenerate automatically from other parts of the Corresponding Source. 160 | 161 | The Corresponding Source for a work in source code form is that same 162 | work. 163 | 164 | ### 2. Basic Permissions. 165 | 166 | All rights granted under this License are granted for the term of 167 | copyright on the Program, and are irrevocable provided the stated 168 | conditions are met. This License explicitly affirms your unlimited 169 | permission to run the unmodified Program. The output from running a 170 | covered work is covered by this License only if the output, given its 171 | content, constitutes a covered work. This License acknowledges your 172 | rights of fair use or other equivalent, as provided by copyright law. 173 | 174 | You may make, run and propagate covered works that you do not convey, 175 | without conditions so long as your license otherwise remains in force. 176 | You may convey covered works to others for the sole purpose of having 177 | them make modifications exclusively for you, or provide you with 178 | facilities for running those works, provided that you comply with the 179 | terms of this License in conveying all material for which you do not 180 | control copyright. Those thus making or running the covered works for 181 | you must do so exclusively on your behalf, under your direction and 182 | control, on terms that prohibit them from making any copies of your 183 | copyrighted material outside their relationship with you. 184 | 185 | Conveying under any other circumstances is permitted solely under the 186 | conditions stated below. Sublicensing is not allowed; section 10 makes 187 | it unnecessary. 188 | 189 | ### 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 190 | 191 | No covered work shall be deemed part of an effective technological 192 | measure under any applicable law fulfilling obligations under article 193 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 194 | similar laws prohibiting or restricting circumvention of such 195 | measures. 196 | 197 | When you convey a covered work, you waive any legal power to forbid 198 | circumvention of technological measures to the extent such 199 | circumvention is effected by exercising rights under this License with 200 | respect to the covered work, and you disclaim any intention to limit 201 | operation or modification of the work as a means of enforcing, against 202 | the work's users, your or third parties' legal rights to forbid 203 | circumvention of technological measures. 204 | 205 | ### 4. Conveying Verbatim Copies. 206 | 207 | You may convey verbatim copies of the Program's source code as you 208 | receive it, in any medium, provided that you conspicuously and 209 | appropriately publish on each copy an appropriate copyright notice; 210 | keep intact all notices stating that this License and any 211 | non-permissive terms added in accord with section 7 apply to the code; 212 | keep intact all notices of the absence of any warranty; and give all 213 | recipients a copy of this License along with the Program. 214 | 215 | You may charge any price or no price for each copy that you convey, 216 | and you may offer support or warranty protection for a fee. 217 | 218 | ### 5. Conveying Modified Source Versions. 219 | 220 | You may convey a work based on the Program, or the modifications to 221 | produce it from the Program, in the form of source code under the 222 | terms of section 4, provided that you also meet all of these 223 | conditions: 224 | 225 | - a) The work must carry prominent notices stating that you modified 226 | it, and giving a relevant date. 227 | - b) The work must carry prominent notices stating that it is 228 | released under this License and any conditions added under 229 | section 7. This requirement modifies the requirement in section 4 230 | to "keep intact all notices". 231 | - c) You must license the entire work, as a whole, under this 232 | License to anyone who comes into possession of a copy. This 233 | License will therefore apply, along with any applicable section 7 234 | additional terms, to the whole of the work, and all its parts, 235 | regardless of how they are packaged. This License gives no 236 | permission to license the work in any other way, but it does not 237 | invalidate such permission if you have separately received it. 238 | - d) If the work has interactive user interfaces, each must display 239 | Appropriate Legal Notices; however, if the Program has interactive 240 | interfaces that do not display Appropriate Legal Notices, your 241 | work need not make them do so. 242 | 243 | A compilation of a covered work with other separate and independent 244 | works, which are not by their nature extensions of the covered work, 245 | and which are not combined with it such as to form a larger program, 246 | in or on a volume of a storage or distribution medium, is called an 247 | "aggregate" if the compilation and its resulting copyright are not 248 | used to limit the access or legal rights of the compilation's users 249 | beyond what the individual works permit. Inclusion of a covered work 250 | in an aggregate does not cause this License to apply to the other 251 | parts of the aggregate. 252 | 253 | ### 6. Conveying Non-Source Forms. 254 | 255 | You may convey a covered work in object code form under the terms of 256 | sections 4 and 5, provided that you also convey the machine-readable 257 | Corresponding Source under the terms of this License, in one of these 258 | ways: 259 | 260 | - a) Convey the object code in, or embodied in, a physical product 261 | (including a physical distribution medium), accompanied by the 262 | Corresponding Source fixed on a durable physical medium 263 | customarily used for software interchange. 264 | - b) Convey the object code in, or embodied in, a physical product 265 | (including a physical distribution medium), accompanied by a 266 | written offer, valid for at least three years and valid for as 267 | long as you offer spare parts or customer support for that product 268 | model, to give anyone who possesses the object code either (1) a 269 | copy of the Corresponding Source for all the software in the 270 | product that is covered by this License, on a durable physical 271 | medium customarily used for software interchange, for a price no 272 | more than your reasonable cost of physically performing this 273 | conveying of source, or (2) access to copy the Corresponding 274 | Source from a network server at no charge. 275 | - c) Convey individual copies of the object code with a copy of the 276 | written offer to provide the Corresponding Source. This 277 | alternative is allowed only occasionally and noncommercially, and 278 | only if you received the object code with such an offer, in accord 279 | with subsection 6b. 280 | - d) Convey the object code by offering access from a designated 281 | place (gratis or for a charge), and offer equivalent access to the 282 | Corresponding Source in the same way through the same place at no 283 | further charge. You need not require recipients to copy the 284 | Corresponding Source along with the object code. If the place to 285 | copy the object code is a network server, the Corresponding Source 286 | may be on a different server (operated by you or a third party) 287 | that supports equivalent copying facilities, provided you maintain 288 | clear directions next to the object code saying where to find the 289 | Corresponding Source. Regardless of what server hosts the 290 | Corresponding Source, you remain obligated to ensure that it is 291 | available for as long as needed to satisfy these requirements. 292 | - e) Convey the object code using peer-to-peer transmission, 293 | provided you inform other peers where the object code and 294 | Corresponding Source of the work are being offered to the general 295 | public at no charge under subsection 6d. 296 | 297 | A separable portion of the object code, whose source code is excluded 298 | from the Corresponding Source as a System Library, need not be 299 | included in conveying the object code work. 300 | 301 | A "User Product" is either (1) a "consumer product", which means any 302 | tangible personal property which is normally used for personal, 303 | family, or household purposes, or (2) anything designed or sold for 304 | incorporation into a dwelling. In determining whether a product is a 305 | consumer product, doubtful cases shall be resolved in favor of 306 | coverage. For a particular product received by a particular user, 307 | "normally used" refers to a typical or common use of that class of 308 | product, regardless of the status of the particular user or of the way 309 | in which the particular user actually uses, or expects or is expected 310 | to use, the product. A product is a consumer product regardless of 311 | whether the product has substantial commercial, industrial or 312 | non-consumer uses, unless such uses represent the only significant 313 | mode of use of the product. 314 | 315 | "Installation Information" for a User Product means any methods, 316 | procedures, authorization keys, or other information required to 317 | install and execute modified versions of a covered work in that User 318 | Product from a modified version of its Corresponding Source. The 319 | information must suffice to ensure that the continued functioning of 320 | the modified object code is in no case prevented or interfered with 321 | solely because modification has been made. 322 | 323 | If you convey an object code work under this section in, or with, or 324 | specifically for use in, a User Product, and the conveying occurs as 325 | part of a transaction in which the right of possession and use of the 326 | User Product is transferred to the recipient in perpetuity or for a 327 | fixed term (regardless of how the transaction is characterized), the 328 | Corresponding Source conveyed under this section must be accompanied 329 | by the Installation Information. But this requirement does not apply 330 | if neither you nor any third party retains the ability to install 331 | modified object code on the User Product (for example, the work has 332 | been installed in ROM). 333 | 334 | The requirement to provide Installation Information does not include a 335 | requirement to continue to provide support service, warranty, or 336 | updates for a work that has been modified or installed by the 337 | recipient, or for the User Product in which it has been modified or 338 | installed. Access to a network may be denied when the modification 339 | itself materially and adversely affects the operation of the network 340 | or violates the rules and protocols for communication across the 341 | network. 342 | 343 | Corresponding Source conveyed, and Installation Information provided, 344 | in accord with this section must be in a format that is publicly 345 | documented (and with an implementation available to the public in 346 | source code form), and must require no special password or key for 347 | unpacking, reading or copying. 348 | 349 | ### 7. Additional Terms. 350 | 351 | "Additional permissions" are terms that supplement the terms of this 352 | License by making exceptions from one or more of its conditions. 353 | Additional permissions that are applicable to the entire Program shall 354 | be treated as though they were included in this License, to the extent 355 | that they are valid under applicable law. If additional permissions 356 | apply only to part of the Program, that part may be used separately 357 | under those permissions, but the entire Program remains governed by 358 | this License without regard to the additional permissions. 359 | 360 | When you convey a copy of a covered work, you may at your option 361 | remove any additional permissions from that copy, or from any part of 362 | it. (Additional permissions may be written to require their own 363 | removal in certain cases when you modify the work.) You may place 364 | additional permissions on material, added by you to a covered work, 365 | for which you have or can give appropriate copyright permission. 366 | 367 | Notwithstanding any other provision of this License, for material you 368 | add to a covered work, you may (if authorized by the copyright holders 369 | of that material) supplement the terms of this License with terms: 370 | 371 | - a) Disclaiming warranty or limiting liability differently from the 372 | terms of sections 15 and 16 of this License; or 373 | - b) Requiring preservation of specified reasonable legal notices or 374 | author attributions in that material or in the Appropriate Legal 375 | Notices displayed by works containing it; or 376 | - c) Prohibiting misrepresentation of the origin of that material, 377 | or requiring that modified versions of such material be marked in 378 | reasonable ways as different from the original version; or 379 | - d) Limiting the use for publicity purposes of names of licensors 380 | or authors of the material; or 381 | - e) Declining to grant rights under trademark law for use of some 382 | trade names, trademarks, or service marks; or 383 | - f) Requiring indemnification of licensors and authors of that 384 | material by anyone who conveys the material (or modified versions 385 | of it) with contractual assumptions of liability to the recipient, 386 | for any liability that these contractual assumptions directly 387 | impose on those licensors and authors. 388 | 389 | All other non-permissive additional terms are considered "further 390 | restrictions" within the meaning of section 10. If the Program as you 391 | received it, or any part of it, contains a notice stating that it is 392 | governed by this License along with a term that is a further 393 | restriction, you may remove that term. If a license document contains 394 | a further restriction but permits relicensing or conveying under this 395 | License, you may add to a covered work material governed by the terms 396 | of that license document, provided that the further restriction does 397 | not survive such relicensing or conveying. 398 | 399 | If you add terms to a covered work in accord with this section, you 400 | must place, in the relevant source files, a statement of the 401 | additional terms that apply to those files, or a notice indicating 402 | where to find the applicable terms. 403 | 404 | Additional terms, permissive or non-permissive, may be stated in the 405 | form of a separately written license, or stated as exceptions; the 406 | above requirements apply either way. 407 | 408 | ### 8. Termination. 409 | 410 | You may not propagate or modify a covered work except as expressly 411 | provided under this License. Any attempt otherwise to propagate or 412 | modify it is void, and will automatically terminate your rights under 413 | this License (including any patent licenses granted under the third 414 | paragraph of section 11). 415 | 416 | However, if you cease all violation of this License, then your license 417 | from a particular copyright holder is reinstated (a) provisionally, 418 | unless and until the copyright holder explicitly and finally 419 | terminates your license, and (b) permanently, if the copyright holder 420 | fails to notify you of the violation by some reasonable means prior to 421 | 60 days after the cessation. 422 | 423 | Moreover, your license from a particular copyright holder is 424 | reinstated permanently if the copyright holder notifies you of the 425 | violation by some reasonable means, this is the first time you have 426 | received notice of violation of this License (for any work) from that 427 | copyright holder, and you cure the violation prior to 30 days after 428 | your receipt of the notice. 429 | 430 | Termination of your rights under this section does not terminate the 431 | licenses of parties who have received copies or rights from you under 432 | this License. If your rights have been terminated and not permanently 433 | reinstated, you do not qualify to receive new licenses for the same 434 | material under section 10. 435 | 436 | ### 9. Acceptance Not Required for Having Copies. 437 | 438 | You are not required to accept this License in order to receive or run 439 | a copy of the Program. Ancillary propagation of a covered work 440 | occurring solely as a consequence of using peer-to-peer transmission 441 | to receive a copy likewise does not require acceptance. However, 442 | nothing other than this License grants you permission to propagate or 443 | modify any covered work. These actions infringe copyright if you do 444 | not accept this License. Therefore, by modifying or propagating a 445 | covered work, you indicate your acceptance of this License to do so. 446 | 447 | ### 10. Automatic Licensing of Downstream Recipients. 448 | 449 | Each time you convey a covered work, the recipient automatically 450 | receives a license from the original licensors, to run, modify and 451 | propagate that work, subject to this License. You are not responsible 452 | for enforcing compliance by third parties with this License. 453 | 454 | An "entity transaction" is a transaction transferring control of an 455 | organization, or substantially all assets of one, or subdividing an 456 | organization, or merging organizations. If propagation of a covered 457 | work results from an entity transaction, each party to that 458 | transaction who receives a copy of the work also receives whatever 459 | licenses to the work the party's predecessor in interest had or could 460 | give under the previous paragraph, plus a right to possession of the 461 | Corresponding Source of the work from the predecessor in interest, if 462 | the predecessor has it or can get it with reasonable efforts. 463 | 464 | You may not impose any further restrictions on the exercise of the 465 | rights granted or affirmed under this License. For example, you may 466 | not impose a license fee, royalty, or other charge for exercise of 467 | rights granted under this License, and you may not initiate litigation 468 | (including a cross-claim or counterclaim in a lawsuit) alleging that 469 | any patent claim is infringed by making, using, selling, offering for 470 | sale, or importing the Program or any portion of it. 471 | 472 | ### 11. Patents. 473 | 474 | A "contributor" is a copyright holder who authorizes use under this 475 | License of the Program or a work on which the Program is based. The 476 | work thus licensed is called the contributor's "contributor version". 477 | 478 | A contributor's "essential patent claims" are all patent claims owned 479 | or controlled by the contributor, whether already acquired or 480 | hereafter acquired, that would be infringed by some manner, permitted 481 | by this License, of making, using, or selling its contributor version, 482 | but do not include claims that would be infringed only as a 483 | consequence of further modification of the contributor version. For 484 | purposes of this definition, "control" includes the right to grant 485 | patent sublicenses in a manner consistent with the requirements of 486 | this License. 487 | 488 | Each contributor grants you a non-exclusive, worldwide, royalty-free 489 | patent license under the contributor's essential patent claims, to 490 | make, use, sell, offer for sale, import and otherwise run, modify and 491 | propagate the contents of its contributor version. 492 | 493 | In the following three paragraphs, a "patent license" is any express 494 | agreement or commitment, however denominated, not to enforce a patent 495 | (such as an express permission to practice a patent or covenant not to 496 | sue for patent infringement). To "grant" such a patent license to a 497 | party means to make such an agreement or commitment not to enforce a 498 | patent against the party. 499 | 500 | If you convey a covered work, knowingly relying on a patent license, 501 | and the Corresponding Source of the work is not available for anyone 502 | to copy, free of charge and under the terms of this License, through a 503 | publicly available network server or other readily accessible means, 504 | then you must either (1) cause the Corresponding Source to be so 505 | available, or (2) arrange to deprive yourself of the benefit of the 506 | patent license for this particular work, or (3) arrange, in a manner 507 | consistent with the requirements of this License, to extend the patent 508 | license to downstream recipients. "Knowingly relying" means you have 509 | actual knowledge that, but for the patent license, your conveying the 510 | covered work in a country, or your recipient's use of the covered work 511 | in a country, would infringe one or more identifiable patents in that 512 | country that you have reason to believe are valid. 513 | 514 | If, pursuant to or in connection with a single transaction or 515 | arrangement, you convey, or propagate by procuring conveyance of, a 516 | covered work, and grant a patent license to some of the parties 517 | receiving the covered work authorizing them to use, propagate, modify 518 | or convey a specific copy of the covered work, then the patent license 519 | you grant is automatically extended to all recipients of the covered 520 | work and works based on it. 521 | 522 | A patent license is "discriminatory" if it does not include within the 523 | scope of its coverage, prohibits the exercise of, or is conditioned on 524 | the non-exercise of one or more of the rights that are specifically 525 | granted under this License. You may not convey a covered work if you 526 | are a party to an arrangement with a third party that is in the 527 | business of distributing software, under which you make payment to the 528 | third party based on the extent of your activity of conveying the 529 | work, and under which the third party grants, to any of the parties 530 | who would receive the covered work from you, a discriminatory patent 531 | license (a) in connection with copies of the covered work conveyed by 532 | you (or copies made from those copies), or (b) primarily for and in 533 | connection with specific products or compilations that contain the 534 | covered work, unless you entered into that arrangement, or that patent 535 | license was granted, prior to 28 March 2007. 536 | 537 | Nothing in this License shall be construed as excluding or limiting 538 | any implied license or other defenses to infringement that may 539 | otherwise be available to you under applicable patent law. 540 | 541 | ### 12. No Surrender of Others' Freedom. 542 | 543 | If conditions are imposed on you (whether by court order, agreement or 544 | otherwise) that contradict the conditions of this License, they do not 545 | excuse you from the conditions of this License. If you cannot convey a 546 | covered work so as to satisfy simultaneously your obligations under 547 | this License and any other pertinent obligations, then as a 548 | consequence you may not convey it at all. For example, if you agree to 549 | terms that obligate you to collect a royalty for further conveying 550 | from those to whom you convey the Program, the only way you could 551 | satisfy both those terms and this License would be to refrain entirely 552 | from conveying the Program. 553 | 554 | ### 13. Remote Network Interaction; Use with the GNU General Public License. 555 | 556 | Notwithstanding any other provision of this License, if you modify the 557 | Program, your modified version must prominently offer all users 558 | interacting with it remotely through a computer network (if your 559 | version supports such interaction) an opportunity to receive the 560 | Corresponding Source of your version by providing access to the 561 | Corresponding Source from a network server at no charge, through some 562 | standard or customary means of facilitating copying of software. This 563 | Corresponding Source shall include the Corresponding Source for any 564 | work covered by version 3 of the GNU General Public License that is 565 | incorporated pursuant to the following paragraph. 566 | 567 | Notwithstanding any other provision of this License, you have 568 | permission to link or combine any covered work with a work licensed 569 | under version 3 of the GNU General Public License into a single 570 | combined work, and to convey the resulting work. The terms of this 571 | License will continue to apply to the part which is the covered work, 572 | but the work with which it is combined will remain governed by version 573 | 3 of the GNU General Public License. 574 | 575 | ### 14. Revised Versions of this License. 576 | 577 | The Free Software Foundation may publish revised and/or new versions 578 | of the GNU Affero General Public License from time to time. Such new 579 | versions will be similar in spirit to the present version, but may 580 | differ in detail to address new problems or concerns. 581 | 582 | Each version is given a distinguishing version number. If the Program 583 | specifies that a certain numbered version of the GNU Affero General 584 | Public License "or any later version" applies to it, you have the 585 | option of following the terms and conditions either of that numbered 586 | version or of any later version published by the Free Software 587 | Foundation. If the Program does not specify a version number of the 588 | GNU Affero General Public License, you may choose any version ever 589 | published by the Free Software Foundation. 590 | 591 | If the Program specifies that a proxy can decide which future versions 592 | of the GNU Affero General Public License can be used, that proxy's 593 | public statement of acceptance of a version permanently authorizes you 594 | to choose that version for the Program. 595 | 596 | Later license versions may give you additional or different 597 | permissions. However, no additional obligations are imposed on any 598 | author or copyright holder as a result of your choosing to follow a 599 | later version. 600 | 601 | ### 15. Disclaimer of Warranty. 602 | 603 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 604 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 605 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT 606 | WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT 607 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 608 | A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND 609 | PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE 610 | DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR 611 | CORRECTION. 612 | 613 | ### 16. Limitation of Liability. 614 | 615 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 616 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR 617 | CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 618 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES 619 | ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT 620 | NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR 621 | LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM 622 | TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER 623 | PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 624 | 625 | ### 17. Interpretation of Sections 15 and 16. 626 | 627 | If the disclaimer of warranty and limitation of liability provided 628 | above cannot be given local legal effect according to their terms, 629 | reviewing courts shall apply local law that most closely approximates 630 | an absolute waiver of all civil liability in connection with the 631 | Program, unless a warranty or assumption of liability accompanies a 632 | copy of the Program in return for a fee. 633 | 634 | END OF TERMS AND CONDITIONS 635 | 636 | ## How to Apply These Terms to Your New Programs 637 | 638 | If you develop a new program, and you want it to be of the greatest 639 | possible use to the public, the best way to achieve this is to make it 640 | free software which everyone can redistribute and change under these 641 | terms. 642 | 643 | To do so, attach the following notices to the program. It is safest to 644 | attach them to the start of each source file to most effectively state 645 | the exclusion of warranty; and each file should have at least the 646 | "copyright" line and a pointer to where the full notice is found. 647 | 648 | 649 | Copyright (C) 650 | 651 | This program is free software: you can redistribute it and/or modify 652 | it under the terms of the GNU Affero General Public License as 653 | published by the Free Software Foundation, either version 3 of the 654 | License, or (at your option) any later version. 655 | 656 | This program is distributed in the hope that it will be useful, 657 | but WITHOUT ANY WARRANTY; without even the implied warranty of 658 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 659 | GNU Affero General Public License for more details. 660 | 661 | You should have received a copy of the GNU Affero General Public License 662 | along with this program. If not, see . 663 | 664 | Also add information on how to contact you by electronic and paper 665 | mail. 666 | 667 | If your software can interact with users remotely through a computer 668 | network, you should also make sure that it provides a way for users to 669 | get its source. For example, if your program is a web application, its 670 | interface could display a "Source" link that leads users to an archive 671 | of the code. There are many ways you could offer source, and different 672 | solutions will be better for different programs; see section 13 for 673 | the specific requirements. 674 | 675 | You should also get your employer (if you work as a programmer) or 676 | school, if any, to sign a "copyright disclaimer" for the program, if 677 | necessary. For more information on this, and how to apply and follow 678 | the GNU AGPL, see . 679 | -------------------------------------------------------------------------------- /source/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | target_sources(Signalbash PRIVATE 2 | CurrentElapsedTimeProgress.h 3 | PluginEditor.cpp 4 | PluginEditor.h 5 | PluginProcessor.cpp 6 | PluginProcessor.h 7 | RestRequest.h 8 | ) 9 | -------------------------------------------------------------------------------- /source/CurrentElapsedTimeProgress.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | class CurrentElapsedTimeProgress 7 | { 8 | public: 9 | CurrentElapsedTimeProgress(int totalDurSeconds) : totalDurationSeconds(totalDurSeconds) 10 | { 11 | _totalDurationSeconds64 = static_cast(totalDurationSeconds); 12 | localTimezoneOffsetSeconds = juce::Time::getCurrentTime().getUTCOffsetSeconds(); 13 | 14 | totalDurationSecondsInvert = 1.0 / static_cast(totalDurationSeconds); 15 | 16 | update(); 17 | } 18 | 19 | void update() { 20 | 21 | nowTimeStamp = juce::Time::currentTimeMillis() * oneThouInvert; 22 | 23 | std::lldiv_t divmod = std::lldiv(nowTimeStamp, _totalDurationSeconds64); 24 | 25 | progress = 100.0 * ( static_cast(divmod.rem) * totalDurationSecondsInvert); 26 | 27 | if (divmod.quot != blockNumber) { 28 | blockNumber = divmod.quot; 29 | blockTimestamp = divmod.quot * totalDurationSeconds; 30 | } 31 | } 32 | 33 | juce::String getCurrentUTCDateAsString () { 34 | auto now = juce::Time::getCurrentTime(); 35 | auto offset = juce::RelativeTime::seconds(localTimezoneOffsetSeconds); 36 | auto currTime = now - offset; 37 | return currTime.formatted("%Y-%m-%d %H:%M:%S"); 38 | } 39 | 40 | juce::String getCurrentLocalDateTimeAsString () { 41 | return juce::Time::getCurrentTime().formatted("%Y-%m-%d %H:%M:%S"); 42 | } 43 | 44 | std::string getTimestamp () { 45 | return std::to_string(juce::Time::currentTimeMillis() / 1000); 46 | } 47 | 48 | void recalcLocalOffset () { 49 | localTimezoneOffsetSeconds = juce::Time::getCurrentTime().getUTCOffsetSeconds(); 50 | } 51 | 52 | double getProgress() const { return progress; } 53 | 54 | int64_t getCurrentBlock () const { return blockNumber; } 55 | int64_t getCurrentBlockTimestamp () const { return blockTimestamp; } 56 | 57 | private: 58 | int totalDurationSeconds; 59 | int64_t _totalDurationSeconds64; 60 | int localTimezoneOffsetSeconds; 61 | double progress = 0.0; 62 | int64_t blockTimestamp = 0; 63 | int64_t blockNumber = 0; 64 | 65 | double oneThouInvert = 0.001; 66 | double totalDurationSecondsInvert; 67 | 68 | int64_t nowTimeStamp = juce::Time::getCurrentTime().toMilliseconds() / 1000; 69 | }; 70 | -------------------------------------------------------------------------------- /source/PluginEditor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "PluginProcessor.h" 4 | #include "PluginEditor.h" 5 | 6 | //============================================================================== 7 | SignalbashAudioProcessorEditor::SignalbashAudioProcessorEditor (SignalbashAudioProcessor& p) 8 | : AudioProcessorEditor (&p), audioProcessor (p) 9 | { 10 | 11 | setSize (400, 300); 12 | startTimerHz(60); 13 | 14 | splashLogoImage = juce::ImageCache::getFromMemory(BinaryData::signalbash_logo_text_990x624_png, BinaryData::signalbash_logo_text_990x624_pngSize); 15 | 16 | settingsCogImage = juce::ImageCache::getFromMemory(BinaryData::setting_cog_20px_png, BinaryData::setting_cog_20px_pngSize); 17 | settingsCogBounds = juce::Rectangle(370, 5, 20, 20); 18 | 19 | rotatingImage = juce::ImageCache::getFromMemory(BinaryData::signalbash_logo_100x_png, BinaryData::signalbash_logo_100x_pngSize); 20 | spinnerBounds = juce::Rectangle( 21 | 30 + (370 - 100) / 2.0f, 22 | (300 - 100) / 2.0f, 23 | 100, 100 24 | ); 25 | 26 | bgColor = juce::Colour(0xFF1D1F21); 27 | buttonFillColor = juce::Colour(0xFF222426); 28 | 29 | addAndMakeVisible(sessionKeyLabel); 30 | sessionKeyLabel.setText("Enter Session Key:", juce::dontSendNotification); 31 | 32 | addAndMakeVisible(sessionKeyEditor); 33 | 34 | sessionKeyEditor.setPasswordCharacter('*'); 35 | sessionKeyEditor.setJustification(juce::Justification::centred); 36 | sessionKeyEditor.setTextToShowWhenEmpty("Session Key", juce::Colours::grey); 37 | sessionKeyEditor.setColour(juce::TextEditor::backgroundColourId, juce::Colour(buttonFillColor)); 38 | 39 | addAndMakeVisible(submitSessionKeyButton); 40 | submitSessionKeyButton.setButtonText("Submit"); 41 | submitSessionKeyButton.addListener(this); 42 | submitSessionKeyButton.setColour(juce::TextButton::buttonColourId, juce::Colour(buttonFillColor)); 43 | 44 | addAndMakeVisible(animationActiveToggle); 45 | animationActiveToggle.setToggleState(audioProcessor.enableAnimation.load(), juce::dontSendNotification); 46 | animationActiveToggle.setButtonText("Enable Animation"); 47 | animationActiveToggle.addListener(this); 48 | 49 | addAndMakeVisible(copySessionKeyButton); 50 | copySessionKeyButton.setButtonText("Copy Session Key"); 51 | copySessionKeyButton.addListener(this); 52 | copySessionKeyButton.setColour(juce::TextButton::buttonColourId, juce::Colour(buttonFillColor)); 53 | 54 | addAndMakeVisible(changeSessionKeyButton); 55 | changeSessionKeyButton.setButtonText("Change Session Key"); 56 | changeSessionKeyButton.addListener(this); 57 | changeSessionKeyButton.setColour(juce::TextButton::buttonColourId, juce::Colour(buttonFillColor)); 58 | 59 | addAndMakeVisible(editSessionKeyCancelButton); 60 | editSessionKeyCancelButton.setButtonText("Cancel"); 61 | editSessionKeyCancelButton.addListener(this); 62 | editSessionKeyCancelButton.setColour(juce::TextButton::buttonColourId, juce::Colour(buttonFillColor)); 63 | 64 | addAndMakeVisible(retrySessionKeyValidateButton); 65 | retrySessionKeyValidateButton.setButtonText("Session Key Not Yet Validated - Retry"); 66 | retrySessionKeyValidateButton.addListener(this); 67 | retrySessionKeyValidateButton.setColour(juce::TextButton::buttonColourId, juce::Colour(buttonFillColor)); 68 | 69 | addAndMakeVisible(flushButton); 70 | flushButton.setButtonText("FLUSH"); 71 | flushButton.addListener(this); 72 | flushButton.setColour(juce::TextButton::buttonColourId, juce::Colour(buttonFillColor)); 73 | 74 | if (!audioProcessor.sessionKey.isEmpty()) { 75 | viewSessionKeyEnter = false; 76 | viewDefault = true; 77 | } 78 | updateUIForCurrentView(); 79 | } 80 | 81 | SignalbashAudioProcessorEditor::~SignalbashAudioProcessorEditor() 82 | { 83 | stopTimer(); 84 | } 85 | 86 | //============================================================================== 87 | void SignalbashAudioProcessorEditor::paint (juce::Graphics& g) 88 | { 89 | 90 | g.fillAll (bgColor); 91 | 92 | g.setColour (juce::Colours::black); 93 | g.fillRect(0, 0, getWidth(), 30); 94 | 95 | juce::String statusBarMessage = "Connection Active"; 96 | if (audioProcessor.sessionKey.isEmpty()) { 97 | g.setColour(juce::Colours::orange); 98 | statusBarMessage = "Session Key Missing"; 99 | } 100 | if (!audioProcessor.sessionKey.isEmpty() && audioProcessor.connectionHealthy.load()) { 101 | g.setColour(juce::Colour(0xFF00E676)); 102 | statusBarMessage = "Connection Healthy"; 103 | } 104 | if (!audioProcessor.sessionKey.isEmpty() && !audioProcessor.connectionHealthy.load()) { 105 | g.setColour(juce::Colours::red); 106 | statusBarMessage = "Offline (No Internet or Server Maintenance In Progress)"; 107 | } 108 | if (!audioProcessor.sessionKey.isEmpty() && audioProcessor.currentSessionKeyInvalid.load()) { 109 | g.setColour(juce::Colours::red); 110 | statusBarMessage = "Invalid Session Key"; 111 | } 112 | g.drawEllipse(12, 7, 16, 16, 1); 113 | g.fillEllipse(15, 10, 10, 10); 114 | 115 | g.setColour (juce::Colours::white); 116 | g.drawFittedText(statusBarMessage, 117 | 40, 5, 118 | 300, 20, 119 | juce::Justification::centredLeft, 1 120 | ); 121 | 122 | if (!viewSessionKeyEnter) { 123 | if (settingsCogHovered) { 124 | g.setColour(juce::Colours::grey); 125 | g.fillEllipse(settingsCogBounds); 126 | } 127 | 128 | juce::AffineTransform settingsCogTranslate; 129 | settingsCogTranslate = juce::AffineTransform::translation(370, 5); 130 | g.drawImageTransformed(settingsCogImage, settingsCogTranslate, false); 131 | } 132 | 133 | if (viewSessionKeyEnter) { 134 | g.setColour (juce::Colours::white); 135 | g.setFont (18.0f); 136 | 137 | juce::String promptMessage; 138 | if (audioProcessor.sessionKey.isEmpty()) { 139 | promptMessage = "Please Enter Your Session Key."; 140 | 141 | g.drawFittedText("Get your session key by logging into your account at signalbash.com", 142 | 100, 150 + 40 + 20, 143 | 200, 40, 144 | juce::Justification::centred, 3 145 | ); 146 | } else { 147 | promptMessage = "Enter New Session Key"; 148 | } 149 | 150 | g.drawImageWithin(splashLogoImage, 112, 40, 175, 90, juce::RectanglePlacement::xMid); 151 | } 152 | 153 | if (viewSettings) { 154 | g.setColour (juce::Colours::white); 155 | 156 | auto bounds = getLocalBounds(); 157 | bounds.removeFromTop(40); bounds.removeFromLeft(40); bounds.removeFromRight(40); 158 | 159 | g.setFont (juce::FontOptions (17.0f)); 160 | 161 | g.drawFittedText(settingsDebugMode ? "Settings (debug mode) - v" + audioProcessor._PLUGIN_VERSION : "Settings", 162 | bounds.removeFromTop(30), 163 | juce::Justification::centredLeft, 1 164 | ); 165 | bounds.removeFromTop(5); 166 | g.setFont (juce::FontOptions (15.0f)); 167 | g.drawFittedText("Host: " + audioProcessor.hostNameDisplay, 168 | bounds.removeFromTop(20), 169 | juce::Justification::centredLeft, 1); 170 | if (settingsDebugMode) { 171 | g.drawFittedText("Current Time (UTC): " + audioProcessor.submissionWindowTimer.getCurrentUTCDateAsString(), 172 | bounds.removeFromTop(20), 173 | juce::Justification::centredLeft, 1); 174 | g.drawFittedText ("Pending Activity: " + juce::String(audioProcessor.activity.load()), 175 | bounds.removeFromTop(20), 176 | juce::Justification::centredLeft, 1); 177 | } 178 | g.drawFittedText ("Session Key: " + getObfuscatedSessionKey().toUpperCase(), 179 | bounds.removeFromTop(20), 180 | juce::Justification::centredLeft, 1); 181 | 182 | g.drawFittedText ("Animation:", 183 | bounds.removeFromTop(90), 184 | juce::Justification::centredLeft, 1); 185 | 186 | g.fillRect(0, 30, 187 | getWidth() * audioProcessor.submissionWindowTimer.getProgress() / 100, 188 | 2); 189 | } 190 | 191 | if (viewDefault) { 192 | float centerX = getWidth() / 2.0f; 193 | float centerY = 30 + (getHeight() - 30) / 2.0f; 194 | 195 | float halfWidth = rotatingImage.getWidth() / 2.0f; 196 | float halfHeight = rotatingImage.getHeight() / 2.0f; 197 | 198 | juce::AffineTransform transform; 199 | 200 | transform = juce::AffineTransform::translation(-halfWidth, -halfHeight); 201 | 202 | if (audioProcessor.enableAnimation.load()) { 203 | transform = transform.rotated(juce::degreesToRadians(rotationAngle)); 204 | } 205 | 206 | transform = transform.translated(centerX, centerY); 207 | 208 | g.drawImageTransformed(rotatingImage, transform, false); 209 | } 210 | } 211 | 212 | void SignalbashAudioProcessorEditor::resized() 213 | { 214 | 215 | updateUIForCurrentView(); 216 | DBG("resized() called"); 217 | } 218 | 219 | void SignalbashAudioProcessorEditor::timerCallback() 220 | { 221 | if (audioProcessor.enableAnimation.load() && audioProcessor.signalHot.load()) { 222 | rotationAngle += 2.0f; 223 | if (rotationAngle >= 360.0f) { 224 | rotationAngle -= 360.0f; 225 | } 226 | } 227 | updateUIForCurrentView(); 228 | repaint(); 229 | } 230 | 231 | void SignalbashAudioProcessorEditor::buttonClicked (juce::Button* button) 232 | { 233 | if (button == &flushButton) 234 | { 235 | audioProcessor.flushAccumulator(); 236 | } 237 | 238 | if (button == &submitSessionKeyButton) 239 | { 240 | juce::String newSessionKey = sessionKeyEditor.getText().trim().removeCharacters("-"); 241 | if (newSessionKey.isEmpty() || newSessionKey.length() < 12) { 242 | DBG("Invalid Session Key"); 243 | return; 244 | } 245 | DBG("Session Key Submitted: " << newSessionKey); 246 | audioProcessor.setSessionKey(newSessionKey); 247 | if (!newSessionKey.isEmpty()) { 248 | viewSessionKeyEnter = false; 249 | viewDefault = true; 250 | viewSettings = false; 251 | updateUIForCurrentView(); 252 | } 253 | else { 254 | juce::AlertWindow::showMessageBoxAsync(juce::AlertWindow::WarningIcon, "Error", "Session Key cannot be empty"); 255 | } 256 | } 257 | 258 | if (button == &animationActiveToggle) { 259 | DBG("animationActiveToggle pressed"); 260 | 261 | if (button->getToggleState()) { 262 | DBG("Toggle Button Now Active"); 263 | audioProcessor.toggleAnimationEnabled(true); 264 | } else { 265 | DBG("Toggle Button Not Active"); 266 | audioProcessor.toggleAnimationEnabled(false); 267 | rotationAngle = 0.0f; 268 | } 269 | } 270 | 271 | if (button == ©SessionKeyButton) { 272 | juce::SystemClipboard::copyTextToClipboard(audioProcessor.sessionKey.toUpperCase()); 273 | DBG("Copied To Clipboard"); 274 | juce::AlertWindow::showMessageBoxAsync(juce::AlertWindow::InfoIcon, "Info", "Copied Session Key"); 275 | } 276 | 277 | if (button == &changeSessionKeyButton) { 278 | 279 | if (audioProcessor.isCurrentSessionKeyValidated()) { 280 | sessionKeyEditor.clear(); 281 | } 282 | viewSessionKeyEnter = true; 283 | viewDefault = false; 284 | viewSettings = false; 285 | updateUIForCurrentView(); 286 | } 287 | 288 | if (button == &editSessionKeyCancelButton) { 289 | viewSessionKeyEnter = false; 290 | viewDefault = false; 291 | viewSettings = true; 292 | updateUIForCurrentView(); 293 | } 294 | 295 | if (button == &retrySessionKeyValidateButton) { 296 | audioProcessor.validateSessionKey(); 297 | } 298 | } 299 | 300 | void SignalbashAudioProcessorEditor::mouseDown (const juce::MouseEvent &event) { 301 | DBG ("Clicked at: " << event.getPosition().toString()); 302 | 303 | if (spinnerBounds.contains(event.position)) { 304 | rotationAngle = 0.0; 305 | } 306 | 307 | if (settingsCogBounds.contains(event.position)) { 308 | if (event.mods.isShiftDown()) { 309 | DBG("SHIFT KEY IS DOWN DURING EVENT"); 310 | } 311 | 312 | if (viewSessionKeyEnter) { 313 | viewSessionKeyEnter = false; 314 | viewDefault = true; 315 | settingsDebugMode = false; 316 | DBG("Switching to viewDefault"); 317 | } else if (viewDefault) { 318 | if (event.mods.isShiftDown()) { 319 | DBG("Shift Key Detected: Activating Debug Mode Settings"); 320 | settingsDebugMode = true; 321 | } 322 | viewDefault = false; 323 | viewSettings = true; 324 | DBG("Switching to viewSettings"); 325 | } else if (viewSettings) { 326 | viewDefault = true; 327 | viewSettings = false; 328 | settingsDebugMode = false; 329 | DBG("Switching to viewDefault"); 330 | } else { 331 | 332 | } 333 | updateUIForCurrentView(); 334 | } 335 | } 336 | 337 | void SignalbashAudioProcessorEditor::mouseMove (const juce::MouseEvent &event) { 338 | if (settingsCogBounds.contains(event.position)) { 339 | settingsCogHovered = true; 340 | } else { 341 | settingsCogHovered = false; 342 | } 343 | } 344 | 345 | void SignalbashAudioProcessorEditor::updateUIForCurrentView() 346 | { 347 | if (viewSessionKeyEnter) 348 | { 349 | sessionKeyLabel.setVisible(true); 350 | sessionKeyEditor.setVisible(true); 351 | submitSessionKeyButton.setVisible(true); 352 | editSessionKeyCancelButton.setVisible(!audioProcessor.sessionKey.isEmpty()); 353 | 354 | auto area = getLocalBounds(); 355 | area.removeFromTop(30 + 110); 356 | area.removeFromLeft(20); 357 | area.removeFromRight(20); 358 | sessionKeyLabel.setBounds(area.removeFromTop(20)); 359 | sessionKeyEditor.setBounds(area.removeFromTop(20)); 360 | area.removeFromTop(5); 361 | submitSessionKeyButton.setBounds(area.removeFromTop(20)); 362 | editSessionKeyCancelButton.setBounds(getLocalBounds().removeFromBottom(40).reduced(10)); 363 | 364 | flushButton.setVisible(false); 365 | copySessionKeyButton.setVisible(false); 366 | changeSessionKeyButton.setVisible(false); 367 | animationActiveToggle.setVisible(false); 368 | retrySessionKeyValidateButton.setVisible(false); 369 | } 370 | else if (viewSettings) 371 | { 372 | flushButton.setVisible(settingsDebugMode); 373 | copySessionKeyButton.setVisible(true); 374 | changeSessionKeyButton.setVisible(true); 375 | animationActiveToggle.setVisible(true); 376 | 377 | auto bounds = getLocalBounds(); 378 | bounds.removeFromTop(40); 379 | bounds.removeFromLeft(40); 380 | bounds.removeFromRight(40); 381 | bounds.removeFromTop(30); 382 | bounds.removeFromTop(5); 383 | bounds.removeFromTop(20); 384 | if (settingsDebugMode) { 385 | bounds.removeFromTop(20); 386 | bounds.removeFromTop(20); 387 | } 388 | bounds.removeFromTop(20); 389 | auto sessKeyBounds = bounds.removeFromTop(20); 390 | copySessionKeyButton.setBounds(sessKeyBounds.removeFromLeft(sessKeyBounds.getWidth() / 2)); 391 | changeSessionKeyButton.setBounds(sessKeyBounds); 392 | bounds.removeFromTop(40); 393 | animationActiveToggle.setBounds(bounds.removeFromTop(20)); 394 | flushButton.setBounds(getLocalBounds().removeFromBottom(40).reduced(10)); 395 | 396 | sessionKeyLabel.setVisible(false); 397 | sessionKeyEditor.setVisible(false); 398 | submitSessionKeyButton.setVisible(false); 399 | editSessionKeyCancelButton.setVisible(false); 400 | retrySessionKeyValidateButton.setVisible(false); 401 | } 402 | else if (viewDefault) 403 | { 404 | bool showRetry = (!audioProcessor.connectionHealthy.load() && !audioProcessor.sessionKeyValidated.load()) || 405 | (!audioProcessor.currentSessionKeyInvalid.load() && !audioProcessor.sessionKeyValidated.load() && audioProcessor.sessionKey.isEmpty()); 406 | retrySessionKeyValidateButton.setVisible(showRetry); 407 | 408 | retrySessionKeyValidateButton.setBounds(getLocalBounds().removeFromBottom(40).reduced(10)); 409 | 410 | flushButton.setVisible(false); 411 | sessionKeyLabel.setVisible(false); 412 | sessionKeyEditor.setVisible(false); 413 | submitSessionKeyButton.setVisible(false); 414 | copySessionKeyButton.setVisible(false); 415 | changeSessionKeyButton.setVisible(false); 416 | editSessionKeyCancelButton.setVisible(false); 417 | animationActiveToggle.setVisible(false); 418 | } 419 | } 420 | 421 | juce::String SignalbashAudioProcessorEditor::getObfuscatedSessionKey () 422 | { 423 | auto sessionKey = audioProcessor.sessionKey; 424 | 425 | if (sessionKey.length() <= 8) 426 | return sessionKey; 427 | 428 | auto firstFour = sessionKey.substring(0, 4); 429 | auto lastFour = sessionKey.substring(sessionKey.length() - 4); 430 | 431 | auto middleLength = sessionKey.length() - 8; 432 | juce::String middleBullets = juce::String::repeatedString("•", middleLength); 433 | 434 | return firstFour + middleBullets + lastFour; 435 | } 436 | -------------------------------------------------------------------------------- /source/PluginEditor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "PluginProcessor.h" 5 | 6 | //============================================================================== 7 | /** 8 | */ 9 | class SignalbashAudioProcessorEditor : public juce::AudioProcessorEditor, 10 | private juce::Timer, 11 | private juce::Button::Listener 12 | { 13 | public: 14 | SignalbashAudioProcessorEditor (SignalbashAudioProcessor&); 15 | ~SignalbashAudioProcessorEditor() override; 16 | 17 | //============================================================================== 18 | void paint (juce::Graphics&) override; 19 | void resized() override; 20 | 21 | private: 22 | 23 | SignalbashAudioProcessor& audioProcessor; 24 | 25 | void timerCallback() override; 26 | void buttonClicked (juce::Button* button) override; 27 | 28 | void mouseDown (const juce::MouseEvent &event) override; 29 | void mouseMove (const juce::MouseEvent &event) override; 30 | 31 | void updateUIForCurrentView(); 32 | 33 | bool viewSessionKeyEnter = true; 34 | bool viewDefault = false; 35 | bool viewSettings = false; 36 | bool settingsDebugMode = false; 37 | 38 | juce::TextButton flushButton; 39 | 40 | juce::TextEditor sessionKeyEditor; 41 | juce::Label sessionKeyLabel; 42 | juce::TextButton submitSessionKeyButton; 43 | juce::TextButton copySessionKeyButton; 44 | juce::TextButton changeSessionKeyButton; 45 | juce::TextButton editSessionKeyCancelButton; 46 | juce::TextButton retrySessionKeyValidateButton; 47 | 48 | juce::ToggleButton animationActiveToggle; 49 | 50 | juce::Image settingsCogImage; 51 | juce::Rectangle settingsCogBounds; 52 | bool settingsCogHovered = false; 53 | 54 | juce::Image splashLogoImage; 55 | 56 | juce::Image rotatingImage; 57 | float rotationAngle = 0.0f; 58 | juce::Rectangle spinnerBounds; 59 | 60 | juce::String getObfuscatedSessionKey (); 61 | 62 | juce::Colour bgColor; 63 | juce::Colour buttonFillColor; 64 | 65 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SignalbashAudioProcessorEditor) 66 | }; 67 | -------------------------------------------------------------------------------- /source/PluginProcessor.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include "PluginProcessor.h" 7 | #include "PluginEditor.h" 8 | #include "RestRequest.h" 9 | 10 | class BackgroundJob : public juce::ThreadPoolJob 11 | { 12 | public: 13 | BackgroundJob(std::function taskToRun) 14 | : ThreadPoolJob("BackgroundJob"), task(std::move(taskToRun)) 15 | { 16 | } 17 | 18 | JobStatus runJob() override 19 | { 20 | task(); 21 | return jobHasFinished; 22 | } 23 | 24 | private: 25 | std::function task; 26 | }; 27 | 28 | //============================================================================== 29 | SignalbashAudioProcessor::SignalbashAudioProcessor() 30 | #ifndef JucePlugin_PreferredChannelConfigurations 31 | : AudioProcessor (BusesProperties() 32 | #if ! JucePlugin_IsMidiEffect 33 | #if ! JucePlugin_IsSynth 34 | .withInput ("Input", juce::AudioChannelSet::stereo(), true) 35 | #endif 36 | .withOutput ("Output", juce::AudioChannelSet::stereo(), true) 37 | #endif 38 | ) 39 | #endif 40 | , activityWindowTimer(10), submissionWindowTimer(120), threadPool(2) 41 | { 42 | 43 | activity = 0; 44 | 45 | currentActivityBlock = activityWindowTimer.getCurrentBlockTimestamp(); 46 | currentSubmissionBlock = submissionWindowTimer.getCurrentBlockTimestamp(); 47 | currentRecordedActivityMilliseconds = 0; 48 | 49 | deduplicationID = generateDedupID(); 50 | 51 | startTimerHz(2); 52 | 53 | bypassParam = new juce::AudioParameterBool({"bypass", 1}, "Bypass", 0); 54 | addParameter(bypassParam); 55 | 56 | juce::PropertiesFile::Options options; 57 | options.applicationName = "signalbash_config"; 58 | options.filenameSuffix = "settings"; 59 | options.folderName = "Signalbash"; 60 | options.osxLibrarySubFolder = "Application Support"; 61 | 62 | auto propertiesFileFile = juce::File::getSpecialLocation(juce::File::userApplicationDataDirectory) 63 | .getChildFile(options.folderName) 64 | .getChildFile(options.applicationName + "." + options.filenameSuffix); 65 | 66 | propertiesFile = std::make_unique(propertiesFileFile, options); 67 | 68 | auto filePath = propertiesFile->getFile().getFullPathName(); 69 | DBG("Properties File Path: " << filePath); 70 | 71 | loadSessionKeyFromFile(); 72 | 73 | parseHost(); 74 | checkConnectionHealth(); 75 | } 76 | 77 | SignalbashAudioProcessor::~SignalbashAudioProcessor() 78 | { 79 | threadPool.removeAllJobs(true, 100); 80 | stopTimer(); 81 | 82 | if (propertiesFile != nullptr) 83 | { 84 | propertiesFile->saveIfNeeded(); 85 | propertiesFile = nullptr; 86 | } 87 | } 88 | 89 | //============================================================================== 90 | const juce::String SignalbashAudioProcessor::getName() const 91 | { 92 | return JucePlugin_Name; 93 | } 94 | 95 | bool SignalbashAudioProcessor::acceptsMidi() const 96 | { 97 | return false; 98 | } 99 | 100 | bool SignalbashAudioProcessor::producesMidi() const 101 | { 102 | return false; 103 | } 104 | 105 | bool SignalbashAudioProcessor::isMidiEffect() const 106 | { 107 | return false; 108 | } 109 | 110 | double SignalbashAudioProcessor::getTailLengthSeconds() const 111 | { 112 | return 0.0; 113 | } 114 | 115 | int SignalbashAudioProcessor::getNumPrograms() 116 | { 117 | return 1; 118 | 119 | } 120 | 121 | int SignalbashAudioProcessor::getCurrentProgram() 122 | { 123 | return 0; 124 | } 125 | 126 | void SignalbashAudioProcessor::setCurrentProgram (int index) 127 | { 128 | } 129 | 130 | const juce::String SignalbashAudioProcessor::getProgramName (int index) 131 | { 132 | return {}; 133 | } 134 | 135 | void SignalbashAudioProcessor::changeProgramName (int index, const juce::String& newName) 136 | { 137 | } 138 | 139 | //============================================================================== 140 | void SignalbashAudioProcessor::prepareToPlay (double sampleRate, int samplesPerBlock) 141 | { 142 | 143 | } 144 | 145 | void SignalbashAudioProcessor::releaseResources() 146 | { 147 | 148 | } 149 | 150 | #ifndef JucePlugin_PreferredChannelConfigurations 151 | bool SignalbashAudioProcessor::isBusesLayoutSupported (const BusesLayout& layouts) const 152 | { 153 | #if JucePlugin_IsMidiEffect 154 | juce::ignoreUnused (layouts); 155 | return true; 156 | #else 157 | 158 | if (layouts.getMainInputChannelSet().isDisabled()) 159 | return false; 160 | 161 | #if ! JucePlugin_IsSynth 162 | if (layouts.getMainOutputChannelSet() != layouts.getMainInputChannelSet()) 163 | return false; 164 | #endif 165 | 166 | return true; 167 | #endif 168 | } 169 | #endif 170 | 171 | void SignalbashAudioProcessor::processBlock (juce::AudioBuffer& buffer, juce::MidiBuffer& midiMessages) 172 | { 173 | juce::ScopedNoDenormals noDenormals; 174 | auto totalNumInputChannels = getTotalNumInputChannels(); 175 | auto totalNumOutputChannels = getTotalNumOutputChannels(); 176 | 177 | for (auto i = totalNumInputChannels; i < totalNumOutputChannels; ++i) 178 | buffer.clear (i, 0, buffer.getNumSamples()); 179 | 180 | { 181 | const juce::ScopedLock lock(mutex); 182 | 183 | if (lastSuccessfullySubmittedBlock != -1) { 184 | 185 | std::vector keysToRemove; 186 | for (const auto& [key, value] : activityBlocks) { 187 | if (key <= lastSuccessfullySubmittedBlock) { 188 | keysToRemove.push_back(key); 189 | } 190 | } 191 | for (auto key : keysToRemove) { 192 | activityBlocks.erase(key); 193 | DBG("Removed Activity Key: " << key); 194 | } 195 | 196 | lastSuccessfullySubmittedBlock = -1; 197 | } 198 | } 199 | 200 | if (currentActivityBlock != activityWindowTimer.getCurrentBlockTimestamp() && currentRecordedActivityMilliseconds > 0) { 201 | 202 | const juce::ScopedLock lock(mutex); 203 | activityBlocks.emplace(currentActivityBlock, currentRecordedActivityMilliseconds); 204 | currentActivityBlock = activityWindowTimer.getCurrentBlockTimestamp(); 205 | currentRecordedActivityMilliseconds = 0; 206 | } 207 | 208 | if (currentSubmissionBlock != submissionWindowTimer.getCurrentBlockTimestamp()) { 209 | 210 | commitActivity(false); 211 | 212 | currentSubmissionBlock = submissionWindowTimer.getCurrentBlockTimestamp(); 213 | } 214 | 215 | if (bypassParam != nullptr && bypassParam->get()) { 216 | signalHot.store(false); 217 | lastProcessBlockCallTimestamp = juce::Time::currentTimeMillis(); 218 | return; 219 | } 220 | 221 | auto numSamples = buffer.getNumSamples(); 222 | bool hasNonZeroData = false; 223 | 224 | for (int channel = 0; channel < totalNumInputChannels; ++channel) { 225 | auto rmsMagnitude = buffer.getRMSLevel(channel, 0, numSamples); 226 | 227 | double db = -196.0; 228 | if (rmsMagnitude > 0.0f) { 229 | db = 20 * std::log10(rmsMagnitude); 230 | } 231 | if (db >= minDbThreshold) { 232 | hasNonZeroData = true; 233 | } 234 | if (hasNonZeroData) { 235 | break; 236 | } 237 | } 238 | 239 | if (hasNonZeroData) { 240 | signalHot.store(true); 241 | ++activity; 242 | auto chunkDurationMilliseconds = numSamples / getSampleRate() * 1000; 243 | currentRecordedActivityMilliseconds += static_cast(chunkDurationMilliseconds); 244 | } else { 245 | signalHot.store(false); 246 | } 247 | lastProcessBlockCallTimestamp = juce::Time::currentTimeMillis(); 248 | } 249 | 250 | void SignalbashAudioProcessor::flushAccumulator () { 251 | 252 | for (const auto& [key, value] : activityBlocks) { 253 | DBG("Key: " << key << ", Value: " << value); 254 | } 255 | 256 | commitActivity(true); 257 | } 258 | 259 | void SignalbashAudioProcessor::parseHost () { 260 | 261 | if (!hostNameInitialized) { 262 | juce::PluginHostType type; 263 | hostName = type.getHostDescription(); 264 | 265 | if (type.isAbletonLive()) { 266 | auto hostPath = type.getHostPath(); 267 | auto hostFilename = juce::File(hostPath).getFileName(); 268 | if (hostPath.containsIgnoreCase("Live 12") || hostFilename.containsIgnoreCase("Live 12")) { 269 | hostName = "Live 12"; 270 | } 271 | if (hostPath.containsIgnoreCase("Live 13") || hostFilename.containsIgnoreCase("Live 13")) { 272 | hostName = "Live 13"; 273 | } 274 | } 275 | 276 | #if JUCE_WINDOWS 277 | 278 | auto hostVersion = juce::File::getSpecialLocation(juce::File::hostApplicationPath).getVersion(); 279 | juce::String arch = isARM ? "arm64" : "x64"; 280 | 281 | uaheader = juce::String(hostName) + "/" + juce::String(hostVersion) + " - " + juce::SystemStats::getOperatingSystemName() + "/" + arch; 282 | #endif 283 | 284 | if (hostName == "ProTools") { 285 | hostNameDisplay = "Pro Tools"; 286 | } else if (hostName == "Live 12") { 287 | hostNameDisplay = "Ableton Live 12"; 288 | } else if (hostName == "Live 13") { 289 | hostNameDisplay = "Ableton Live 13"; 290 | } else if (hostName == "FruityLoops") { 291 | hostNameDisplay = "FL Studio"; 292 | } else if (hostName == "Apple Logic") { 293 | hostNameDisplay = "Logic Pro"; 294 | } else { 295 | hostNameDisplay = hostName; 296 | } 297 | 298 | hostNameInitialized = true; 299 | } 300 | } 301 | 302 | void SignalbashAudioProcessor::timerCallback () { 303 | activityWindowTimer.update(); 304 | submissionWindowTimer.update(); 305 | 306 | if (activity > 0 && submissionWindowTimer.getCurrentBlockTimestamp() - currentSubmissionBlock > 1) { 307 | 308 | DBG("Timer curr block: " << activityWindowTimer.getCurrentBlockTimestamp() << " | Curr registered submission block: " << currentSubmissionBlock); 309 | 310 | if (juce::Time::currentTimeMillis() - lastProcessBlockCallTimestamp > 10000) { 311 | 312 | DBG("Curr ms: " << juce::Time::currentTimeMillis() << " | lastProcessBlockCallTimestamp: " << lastProcessBlockCallTimestamp); 313 | 314 | DBG("Fallback Activity Submission Triggered"); 315 | 316 | commitActivity(false); 317 | 318 | currentSubmissionBlock = submissionWindowTimer.getCurrentBlockTimestamp(); 319 | } else { 320 | DBG("Fallback Activity Submission Not activated"); 321 | } 322 | } 323 | 324 | if (signalHot.load() && activityWindowTimer.getCurrentBlockTimestamp() - currentActivityBlock > 1) { 325 | signalHot.store(false); 326 | } 327 | 328 | } 329 | 330 | //============================================================================== 331 | bool SignalbashAudioProcessor::hasEditor() const 332 | { 333 | return true; 334 | } 335 | 336 | juce::AudioProcessorEditor* SignalbashAudioProcessor::createEditor() 337 | { 338 | return new SignalbashAudioProcessorEditor (*this); 339 | } 340 | 341 | //============================================================================== 342 | void SignalbashAudioProcessor::getStateInformation (juce::MemoryBlock& destData) 343 | { 344 | 345 | } 346 | 347 | void SignalbashAudioProcessor::setStateInformation (const void* data, int sizeInBytes) 348 | { 349 | 350 | } 351 | 352 | //============================================================================== 353 | 354 | juce::AudioProcessor* JUCE_CALLTYPE createPluginFilter() 355 | { 356 | return new SignalbashAudioProcessor(); 357 | } 358 | 359 | void SignalbashAudioProcessor::checkConnectionHealth () 360 | { 361 | auto targetEndpoint = apiBase + "/ping"; 362 | 363 | auto weakThis = juce::WeakReference(this); 364 | std::function requestTask = [weakThis, targetEndpoint]() 365 | { 366 | if (weakThis == nullptr) return; 367 | 368 | int maxAttempts = 5; 369 | int currAttempt = 1; 370 | while (currAttempt <= maxAttempts) { 371 | if (weakThis == nullptr) break; 372 | 373 | RestRequest request; 374 | request.header("Content-Type", "application/json"); 375 | RestRequest::Response response = request.get(targetEndpoint).execute(); 376 | 377 | if (response.status == 200) { 378 | if (auto* proc = weakThis.get()) { 379 | DBG("/ping => Connection Healthy"); 380 | proc->connectionHealthy.store(true); 381 | } 382 | break; 383 | } 384 | else if (response.result.getErrorMessage() == "No internet connection") { 385 | if (auto* proc = weakThis.get()) { 386 | proc->connectionHealthy.store(false); 387 | DBG("No internet detected."); 388 | } 389 | } 390 | else if (response.result.getErrorMessage() == "Server is offline or unreachable") { 391 | if (auto* proc = weakThis.get()) { 392 | proc->connectionHealthy.store(false); 393 | DBG("Server is temporarily offline or unreachable"); 394 | } 395 | } 396 | 397 | if (weakThis == nullptr) break; 398 | juce::Thread::sleep(currAttempt * currAttempt * 1000); 399 | currAttempt += 1; 400 | } 401 | }; 402 | threadPool.addJob(new BackgroundJob(requestTask), true); 403 | } 404 | 405 | void SignalbashAudioProcessor::commitActivity (bool immediateSubmit) 406 | { 407 | if (sessionKey.isEmpty()) { 408 | DBG("Session key is not set, cannot submit activity"); 409 | return; 410 | } 411 | 412 | if (activityBlocks.empty() || activity == 0) { 413 | DBG("No Pending Activity to commit."); 414 | return; 415 | } 416 | 417 | std::unordered_map activityBlocksCopy; 418 | int mostRecentBlock = -1; 419 | { 420 | const juce::ScopedLock lock(mutex); 421 | activityBlocksCopy = activityBlocks; 422 | } 423 | 424 | juce::StringPairArray parameters; 425 | 426 | parameters.set("host", hostName); 427 | parameters.set("session_key", sessionKey); 428 | parameters.set("version", _PLUGIN_VERSION); 429 | parameters.set("deduplication_id", deduplicationID); 430 | parameters.set("ua", uaheader); 431 | 432 | DBG(parameters.getDescription()); 433 | 434 | auto* activityDictObj = new juce::DynamicObject(); 435 | for (const auto& [key, value] : activityBlocksCopy) { 436 | 437 | if (key > mostRecentBlock) { 438 | mostRecentBlock = key; 439 | } 440 | activityDictObj->setProperty(juce::String(key), juce::var(value)); 441 | } 442 | juce::var activityVals = juce::var(activityDictObj); 443 | 444 | auto endpoint = apiBase + "/submit"; 445 | 446 | auto weakThis = juce::WeakReference(this); 447 | 448 | std::function requestTask = [weakThis, parameters, activityVals, mostRecentBlock, endpoint, immediateSubmit]() 449 | { 450 | if (weakThis == nullptr) return; 451 | 452 | if (!immediateSubmit) { 453 | 454 | std::random_device rd; 455 | std::mt19937 gen(rd()); 456 | std::uniform_int_distribution<> distr(0, 10000); 457 | 458 | int randomSleepTime = distr(gen); 459 | juce::Thread::sleep(randomSleepTime); 460 | if (weakThis == nullptr) return; 461 | } 462 | 463 | int maxAttempts = 5; 464 | int currAttempt = 1; 465 | 466 | while (currAttempt <= maxAttempts) { 467 | if (weakThis == nullptr) break; 468 | 469 | if (auto* proc = weakThis.get()) { 470 | if (proc->activity == 0) { 471 | return; 472 | } 473 | } 474 | 475 | RestRequest request; 476 | request.header("Content-Type", "application/json"); 477 | #if JUCE_WINDOWS 478 | request.header("User-Agent", parameters["ua"]); 479 | #endif 480 | RestRequest::Response response = request.post(endpoint) 481 | .field("host", parameters["host"]) 482 | .field("plugin_version", parameters["version"]) 483 | .field("session_key", parameters["session_key"]) 484 | .field("dd_id", parameters["deduplication_id"]) 485 | .field("activity", activityVals) 486 | .execute(); 487 | 488 | if (response.status == 200) { 489 | if (auto* proc = weakThis.get()) { 490 | DBG("Activity Data Submitted! Resetting"); 491 | const juce::ScopedLock lock(proc->mutex); 492 | proc->lastSuccessfullySubmittedBlock = mostRecentBlock; 493 | proc->activity.exchange(0); 494 | proc->connectionHealthy.store(true); 495 | } 496 | return; 497 | } 498 | else if (response.status == 429) { 499 | if (auto* proc = weakThis.get()) { 500 | DBG("429 - Rate Limited. Will retry next pass."); 501 | proc->connectionHealthy.store(true); 502 | } 503 | if (weakThis == nullptr) break; 504 | juce::Thread::sleep(currAttempt * currAttempt * 1000); 505 | currAttempt += 1; 506 | } 507 | else if (response.status == 0) { 508 | if (auto* proc = weakThis.get()) { 509 | DBG("Internet connection down or Server Offline"); 510 | proc->connectionHealthy.store(false); 511 | } 512 | if (weakThis == nullptr) break; 513 | juce::Thread::sleep(currAttempt * currAttempt * 1000); 514 | currAttempt += 1; 515 | } 516 | else { 517 | DBG(response.bodyAsString); 518 | DBG(response.result.getErrorMessage()); 519 | DBG("Status Code: " << response.status); 520 | DBG("Generic Request Error. Sleeping, then retrying"); 521 | if (weakThis == nullptr) break; 522 | juce::Thread::sleep(currAttempt * currAttempt * 1000); 523 | currAttempt += 1; 524 | } 525 | } 526 | 527 | if (auto* proc = weakThis.get()) { 528 | proc->checkConnectionHealth(); 529 | } 530 | DBG("Request Attempt Exhaustion."); 531 | }; 532 | 533 | threadPool.addJob(new BackgroundJob(requestTask), true); 534 | } 535 | 536 | void SignalbashAudioProcessor::validateSessionKey () 537 | { 538 | if (sessionKey.isEmpty()) { 539 | DBG("No Session Key Set. Cannot validate."); 540 | return; 541 | } 542 | 543 | if (sessionKeyValidated.load()) { 544 | DBG("Session Key Validated. Nothing to do."); 545 | return; 546 | } 547 | 548 | juce::StringPairArray parameters; 549 | parameters.set("session_key", sessionKey); 550 | parameters.set("version", _PLUGIN_VERSION); 551 | parameters.set("ua", uaheader); 552 | 553 | auto targetEndpoint = apiBase + "/validate-session-key"; 554 | 555 | auto weakThis = juce::WeakReference(this); 556 | std::function requestTask = [weakThis, parameters, targetEndpoint]() 557 | { 558 | if (weakThis == nullptr) return; 559 | 560 | RestRequest request; 561 | request.header("Content-Type", "application/json"); 562 | #if JUCE_WINDOWS 563 | request.header("User-Agent", parameters["ua"]); 564 | #endif 565 | RestRequest::Response response = request.post(targetEndpoint) 566 | .field("plugin_version", parameters["version"]) 567 | .field("session_key", parameters["session_key"]) 568 | .execute(); 569 | 570 | if (response.status == 200) 571 | { 572 | if (auto* proc = weakThis.get()) { 573 | DBG("Session Key Validated!"); 574 | proc->currentSessionKeyInvalid.store(false); 575 | proc->sessionKeyValidated.store(true); 576 | proc->saveValidSessionKeyState(); 577 | proc->connectionHealthy.store(true); 578 | } 579 | } 580 | else if (response.status == 404) { 581 | if (auto* proc = weakThis.get()) { 582 | DBG("Unknown Session Key"); 583 | proc->currentSessionKeyInvalid.store(true); 584 | proc->sessionKeyValidated.store(false); 585 | proc->connectionHealthy.store(true); 586 | } 587 | } 588 | else if (response.status == 429) 589 | { 590 | if (auto* proc = weakThis.get()) { 591 | DBG("429 - Rate Limited. Will retry next pass."); 592 | proc->connectionHealthy.store(true); 593 | } 594 | } 595 | else if (response.status == 0) { 596 | if (auto* proc = weakThis.get()) { 597 | DBG("No Internet or Server Offline"); 598 | proc->connectionHealthy.store(false); 599 | proc->checkConnectionHealth(); 600 | } 601 | } 602 | }; 603 | threadPool.addJob(new BackgroundJob(requestTask), true); 604 | } 605 | 606 | void SignalbashAudioProcessor::loadSessionKeyFromFile() 607 | { 608 | if (propertiesFile != nullptr) { 609 | sessionKey = propertiesFile->getValue("sessionKey", ""); 610 | DBG("Loaded Session Key From File: " << sessionKey); 611 | 612 | enableAnimation.store(propertiesFile->getBoolValue("animationEnabled", true)); 613 | if (enableAnimation.load()) { 614 | DBG("Loaded Pref => Animation Enabled: ON"); 615 | } else { 616 | DBG("Loaded Pref => Animation Enabled: OFF"); 617 | } 618 | 619 | if (!sessionKey.isEmpty()) { 620 | auto sessionKeyValidatedKey = sessionKey.toUpperCase() + "_validity"; 621 | sessionKeyValidated.store(propertiesFile->getBoolValue(sessionKeyValidatedKey)); 622 | } 623 | } 624 | } 625 | 626 | void SignalbashAudioProcessor::saveSessionKeyToFile() 627 | { 628 | if (propertiesFile != nullptr) { 629 | propertiesFile->setValue("sessionKey", sessionKey); 630 | propertiesFile->saveIfNeeded(); 631 | } 632 | } 633 | 634 | void SignalbashAudioProcessor::saveValidSessionKeyState() 635 | { 636 | if (propertiesFile != nullptr) { 637 | auto sessionKeyValidatedKey = sessionKey.toUpperCase() + "_validity"; 638 | propertiesFile->setValue(sessionKeyValidatedKey, true); 639 | propertiesFile->saveIfNeeded(); 640 | } 641 | } 642 | 643 | void SignalbashAudioProcessor::setSessionKey(const juce::String& newSessionKey) 644 | { 645 | sessionKey = newSessionKey; 646 | saveSessionKeyToFile(); 647 | 648 | auto sessionKeyValidatedKey = sessionKey.toUpperCase() + "_validity"; 649 | if (propertiesFile != nullptr && !propertiesFile->getBoolValue(sessionKeyValidatedKey)) { 650 | sessionKeyValidated.store(false); 651 | validateSessionKey(); 652 | } else { 653 | currentSessionKeyInvalid.store(false); 654 | sessionKeyValidated.store(true); 655 | } 656 | } 657 | 658 | bool SignalbashAudioProcessor::isCurrentSessionKeyValidated () 659 | { 660 | if (sessionKey.isEmpty()) { 661 | return false; 662 | } 663 | 664 | if (currentSessionKeyInvalid.load()) { 665 | return true; 666 | } 667 | 668 | return sessionKeyValidated.load(); 669 | } 670 | 671 | void SignalbashAudioProcessor::toggleAnimationEnabled (bool state) 672 | { 673 | enableAnimation.store(state); 674 | if (propertiesFile != nullptr) { 675 | propertiesFile->setValue("animationEnabled", state); 676 | propertiesFile->saveIfNeeded(); 677 | } 678 | } 679 | 680 | std::string SignalbashAudioProcessor::generateDedupID() 681 | { 682 | static unsigned int seed = static_cast(std::time(nullptr)); 683 | std::string result; 684 | result.reserve(8); 685 | 686 | for (int i = 0; i < 8; ++i) { 687 | seed = (1103515245 * seed + 12345); 688 | char digit = '0' + (seed % 10); 689 | result += digit; 690 | } 691 | return result; 692 | } 693 | -------------------------------------------------------------------------------- /source/PluginProcessor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "CurrentElapsedTimeProgress.h" 9 | 10 | //============================================================================== 11 | /** 12 | */ 13 | class SignalbashAudioProcessor : public juce::AudioProcessor, public juce::Timer 14 | { 15 | public: 16 | //============================================================================== 17 | SignalbashAudioProcessor(); 18 | ~SignalbashAudioProcessor() override; 19 | 20 | //============================================================================== 21 | void prepareToPlay (double sampleRate, int samplesPerBlock) override; 22 | void releaseResources() override; 23 | 24 | #ifndef JucePlugin_PreferredChannelConfigurations 25 | bool isBusesLayoutSupported (const BusesLayout& layouts) const override; 26 | #endif 27 | 28 | void processBlock (juce::AudioBuffer&, juce::MidiBuffer&) override; 29 | 30 | //============================================================================== 31 | juce::AudioProcessorEditor* createEditor() override; 32 | bool hasEditor() const override; 33 | 34 | //============================================================================== 35 | const juce::String getName() const override; 36 | 37 | bool acceptsMidi() const override; 38 | bool producesMidi() const override; 39 | bool isMidiEffect() const override; 40 | double getTailLengthSeconds() const override; 41 | 42 | //============================================================================== 43 | int getNumPrograms() override; 44 | int getCurrentProgram() override; 45 | void setCurrentProgram (int index) override; 46 | const juce::String getProgramName (int index) override; 47 | void changeProgramName (int index, const juce::String& newName) override; 48 | 49 | //============================================================================== 50 | void getStateInformation (juce::MemoryBlock& destData) override; 51 | void setStateInformation (const void* data, int sizeInBytes) override; 52 | 53 | std::atomic activity; 54 | void flushAccumulator (); 55 | 56 | const double minDbThreshold = -60.0; 57 | 58 | const int activityDetectionWindow = 10; 59 | const int submissionAccumulatorWindow = 2 * 60; 60 | 61 | CurrentElapsedTimeProgress activityWindowTimer; 62 | CurrentElapsedTimeProgress submissionWindowTimer; 63 | 64 | int64_t currentActivityBlock; 65 | int64_t currentSubmissionBlock; 66 | 67 | std::atomic signalHot{false}; 68 | 69 | int currentRecordedActivityMilliseconds; 70 | 71 | std::unordered_map activityBlocks; 72 | 73 | void timerCallback() override; 74 | 75 | std::string _PLUGIN_VERSION = "1.1.0"; 76 | 77 | bool hostNameInitialized = false; 78 | std::string hostName = "Unknown"; 79 | std::string hostNameDisplay = "Unknown"; 80 | void parseHost(); 81 | 82 | #if JUCE_DEBUG 83 | std::string apiBase = "http://127.0.0.1:7575"; 84 | #else 85 | std::string apiBase = "https://api.signalbash.com"; 86 | #endif 87 | void commitActivity (bool immediateSubmit); 88 | int lastSuccessfullySubmittedBlock = -1; 89 | int64_t lastProcessBlockCallTimestamp = -1; 90 | 91 | juce::String uaheader = "JUCE_PLUGIN"; 92 | 93 | std::string generateDedupID(); 94 | std::string deduplicationID; 95 | 96 | std::atomic connectionHealthy{true}; 97 | void checkConnectionHealth(); 98 | 99 | juce::CriticalSection mutex; 100 | juce::ThreadPool threadPool; 101 | 102 | juce::String sessionKey; 103 | std::atomic enableAnimation{true}; 104 | std::unique_ptr propertiesFile; 105 | 106 | std::atomic sessionKeyValidated{false}; 107 | std::atomic currentSessionKeyInvalid{false}; 108 | void validateSessionKey(); 109 | void saveValidSessionKeyState(); 110 | bool isCurrentSessionKeyValidated (); 111 | 112 | juce::String getSessionKey() const { return sessionKey; } 113 | void setSessionKey(const juce::String& newSessionKey); 114 | void loadSessionKeyFromFile(); 115 | void saveSessionKeyToFile(); 116 | 117 | void toggleAnimationEnabled (bool state); 118 | 119 | juce::AudioParameterBool *bypassParam = nullptr; 120 | juce::AudioProcessorParameter *getBypassParameter() const override { return bypassParam; } 121 | 122 | private: 123 | //============================================================================== 124 | JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (SignalbashAudioProcessor) 125 | JUCE_DECLARE_WEAK_REFERENCEABLE(SignalbashAudioProcessor) 126 | 127 | #if JUCE_ARM 128 | bool isARM = true; 129 | #else 130 | bool isARM = false; 131 | #endif 132 | 133 | }; 134 | -------------------------------------------------------------------------------- /source/RestRequest.h: -------------------------------------------------------------------------------- 1 | /* 2 | ============================================================================== 3 | 4 | RestRequest.h 5 | Created: 16 Dec 2015 2:29:23pm 6 | OG Author: Adam Wilson (https://github.com/adamski/RestRequest) 7 | 8 | ============================================================================== 9 | */ 10 | 11 | #ifndef RESTREQUEST_H 12 | #define RESTREQUEST_H 13 | 14 | #include 15 | 16 | class RestRequest 17 | { 18 | public: 19 | 20 | RestRequest (juce::String urlString) : url (urlString) {} 21 | RestRequest (juce::URL url) : url (url) {} 22 | RestRequest () {} 23 | 24 | struct Response 25 | { 26 | juce::Result result; 27 | juce::StringPairArray headers; 28 | juce::var body; 29 | juce::String bodyAsString; 30 | int status; 31 | 32 | Response() : result (juce::Result::ok()), status (0) {} 33 | } response; 34 | 35 | RestRequest::Response execute () 36 | { 37 | 38 | auto urlRequest = juce::URL(endpoint); 39 | bool hasFields = (fields.getProperties().size() > 0); 40 | if (hasFields) 41 | { 42 | juce::MemoryOutputStream output; 43 | juce::JSON::FormatOptions jsonConfig; 44 | 45 | fields.writeAsJSON (output, jsonConfig); 46 | urlRequest = urlRequest.withPOSTData (output.toString()); 47 | } 48 | 49 | auto options = juce::URL::InputStreamOptions (hasFields ? juce::URL::ParameterHandling::inPostData : juce::URL::ParameterHandling::inAddress) 50 | .withExtraHeaders (stringPairArrayToHeaderString(headers)) 51 | .withConnectionTimeoutMs (30 * 1000) 52 | .withResponseHeaders (&response.headers) 53 | .withStatusCode (&response.status) 54 | .withNumRedirectsToFollow (5) 55 | .withHttpRequestCmd (verb); 56 | 57 | std::unique_ptr input (urlRequest.createInputStream (options)); 58 | 59 | if (!input) { 60 | if (response.status == 0) 61 | response.result = juce::Result::fail("No internet connection"); 62 | else 63 | response.result = juce::Result::fail("Server is offline or unreachable"); 64 | return response; 65 | } 66 | 67 | response.result = checkInputStream (input); 68 | if (response.result.failed()) return response; 69 | 70 | response.bodyAsString = input->readEntireStreamAsString(); 71 | response.result = juce::JSON::parse(response.bodyAsString, response.body); 72 | 73 | return response; 74 | } 75 | 76 | RestRequest get (const juce::String& endpoint) 77 | { 78 | RestRequest req (*this); 79 | req.verb = "GET"; 80 | req.endpoint = endpoint; 81 | 82 | return req; 83 | } 84 | 85 | RestRequest post (const juce::String& endpoint) 86 | { 87 | RestRequest req (*this); 88 | req.verb = "POST"; 89 | req.endpoint = endpoint; 90 | 91 | return req; 92 | } 93 | 94 | RestRequest put (const juce::String& endpoint) 95 | { 96 | RestRequest req (*this); 97 | req.verb = "PUT"; 98 | req.endpoint = endpoint; 99 | 100 | return req; 101 | } 102 | 103 | RestRequest del (const juce::String& endpoint) 104 | { 105 | RestRequest req (*this); 106 | req.verb = "DELETE"; 107 | req.endpoint = endpoint; 108 | 109 | return req; 110 | } 111 | 112 | RestRequest field (const juce::String& name, const juce::var& value) 113 | { 114 | fields.setProperty(name, value); 115 | return *this; 116 | } 117 | 118 | RestRequest header (const juce::String& name, const juce::String& value) 119 | { 120 | RestRequest req (*this); 121 | headers.set (name, value); 122 | return req; 123 | } 124 | 125 | const juce::URL& getURL() const 126 | { 127 | return url; 128 | } 129 | 130 | const juce::String& getBodyAsString() const 131 | { 132 | return bodyAsString; 133 | } 134 | 135 | private: 136 | juce::URL url; 137 | juce::StringPairArray headers; 138 | juce::String verb; 139 | juce::String endpoint; 140 | juce::DynamicObject fields; 141 | juce::String bodyAsString; 142 | 143 | juce::Result checkInputStream (std::unique_ptr& input) 144 | { 145 | if (! input) return juce::Result::fail ("HTTP request failed, check your internet connection"); 146 | return juce::Result::ok(); 147 | } 148 | 149 | static juce::String stringPairArrayToHeaderString(juce::StringPairArray stringPairArray) 150 | { 151 | juce::String result; 152 | for (auto key : stringPairArray.getAllKeys()) 153 | { 154 | result += key + ": " + stringPairArray.getValue(key, "") + "\n"; 155 | } 156 | return result; 157 | } 158 | }; 159 | 160 | #endif 161 | --------------------------------------------------------------------------------