From 022036f3a5cbf52ce92a7feb3cd090443389f8b1 Mon Sep 17 00:00:00 2001 From: 9vult Date: Thu, 3 Feb 2022 02:25:10 -0500 Subject: [PATCH] Update readme and add license --- LICENSE | 165 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 117 ++++++++++++++++++++++++++------------ 2 files changed, 245 insertions(+), 37 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0a04128 --- /dev/null +++ b/LICENSE @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff --git a/README.md b/README.md index 29d2d22..b3ef5bc 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,37 @@ + # KFX-GUI + +#### 9volt GUI Karaoke Template Builder -KFX-GUI is a highly extensible graphical karaoke template builder for Advanced Substation Alpha (ASS) subtitles. KFX-GUI does not execute karaoke templates, it only provides a graphical building tool with automation via plugins. +KFX-GUI is a highly extensible graphical karaoke template builder for Advanced Substation Alpha (ASS) subtitles. KFX-GUI does not execute karaoke templates, it only provides a graphical building tool for creating them with automation via plugins. -KFX-GUI is currently in very early development and has limited use. Pull/feature requests, especially for creating the stock plugin suite, are welcome. + +## Contents -## Plugins +- [Plugins](#plugins) + - [Effect Component Plugins](#effect-component-plugins) + - [Creating a Component plugin](#creating-a-component-plugin) + - [Component Plugin Format](#component-plugin-format) + - [Templater Line Definition Plugins](#templater-line-definition-plugins) + - [Creating a Line Definition Plugin](#creating-a-line-definition-plugin) + - [Line Definition Plugin Format](#line-definition-plugin-format) + - [Code line definitions](#code-line-definitions) +- [Dependencies](#dependencies) -KFX-GUI uses plugins to represent each possible action in the template. The most basic plugins represent a single ASS tag, such as `\pos` for setting the position or `\border` to add an outline. However, the major benefit to using a plugin system, rather than hardcoding all the tags and their functions, is extensibility. Plugins can easily be created to automate the creation of repetitive actions and effects. +# Plugins -### Creating a plugin +KFX-GUI uses plugins in a couple different ways. Currently, there are two different plugin types - effect components and templater line definitions. +Plugins are used to provide extensibility and both backward and forward compatibility with existing and future templaters and ASS versions. -KFX-GUI plugins are written in the TOML format, and are automatically loaded from the plugins folder on startup. An example plugin that creates a grow-and-rotate effect during the syl's duration might look like this: +## Effect Component Plugins + +The most basic component plugins represent a single ASS tag, such as `\pos` for setting the position or `\border` to add an outline. However, the beauty of a plugin system is being able to define pretty much whatever you want, so long as it fits within a few constraints. + +Plugins are written in the TOML format, and are automatically loaded from the plugins folder on startup. They should follow a filename convention of `pluginname.toml`. + +### Creating a Component plugin + +The following example defines a plugin that creates a basic grow-and-rotate syl effect: ```toml name = "Grow-And-Rotate" @@ -23,52 +44,74 @@ params = [ format = "?t($start, $mid, ?fscx${Scale}?fscy${Scale}?frz${Rotation})?t($mid, $end, ?fscx100?fscy100?frz0)" ``` -### Explanation of the format +### Component Plugin Format -```toml -name = "Grow-And-Rotate" -author = "9volt" -description = "Expand syl size and rotate it, then return to normal over the syl's duration" -``` +The component plugin format consists of 3 sections. -Pretty self-explanitory. The name of the plugin will be used in the toolbox, and the description will appear as a tooltip when the toolbox entry is hovered over. +1. Plugin identification + - The first 4 lines of the file describe the `name`, `author`, and short `description` of the plugin. The description is used as a tooltip in the toolbox panel. + - The 5th line, `transform`, defines if the plugin may be used within Transform events. For most custom plugins, this is likely to be false, as a transform tag will be provided by the plugin itself. -```toml -transform = false -``` +2. Parameters + - Here we define a list of parameters the user will supply. Each item in the list will be linked to a text field labeled with the parameter name. + - In the example, the user will be asked to supply the `Scale` and `Rotation` values. -This property denotes if this plugin may be used within a transform event. For most plugins, this will be `false`, as the plugin will supply its own transform tags or contain other tags, like `\move`, which cannot be used within a transform event. +3. Format String + - The format string defines the output of the plugin. + - The backslash `\` should be replaced with a question mark `?` in the format string to avoid any potential issues with escape characters. Question marks in the format string will automatically be replaced with backslashes with the finalized ASS code is generated. + - Variables follow a format similar to f-strings in Python, `${VariableName}`, and are case-sensitive. -```toml -params = [ - "Scale", "Rotation" -] + +#### Result + +Assuming a user suppliad values of `120` for Scale and `15` for Rotation, the following ASS code would be generated when this plugin is executed: + +``` +\t($start, $mid, \fscx120\fscy120\frz15)\t($mid, $end, \fscx100\fscy100\frz0) ``` -Here we list all the variables that will be supplied by the user. In this example, the user will supply the scale percentage and angle of rotation. This could easily be expanded to include additional variables, like a variable mid-point to the effect or separate X and Y scale values. +## Templater Line Definition Plugins + +The second type of plugin used by KFX-GUI defines the line types used by a templater. This allows KFX-GUI to support an unlimited number of templaters, both present and future, since one can easily write a plugin to support their favorite templater. + +Line definition plugins must use the `*.linetype.toml` file extension. + +### Creating a Line Definition Plugin + +Below is an excerpt from the stock plugin providing support for The0x539's karaoke templater: ```toml -format = "?t($start, $mid, ?fscx${Scale}?fscy${Scale}?frz${Rotation})?t($mid, $end, ?fscx100?fscy100?frz0)" +target = "The0x539" +components = [ + "code once", + "code line", + "template line", + "template syl", + "mixin word", + "mixin char" +] ``` -The final part to the plugin is the format definition. Here, the format for the ASS tags to be generated by the plugin are laid out, along with any variables needed. +### Line Definition Plugin Format -The backslash `\` should be replaced with a `?` in the format string to avoid issues with escape characters. The question marks will automatically be replaced with backslashes when the final ASS code is generated. +There are two parts to line definition plugins: -Variables are case-sensitive, and follow a format similar to f-strings in Python, which is `${VariableName}`. +1. `target` - The target is the name of the templater this plugin supports. +2. `components` - A list of strings defining the line types used by the templater. -### Plugin Result +#### Code line definitions -If the example plugin were in use, and the user supplied values of `120` for Scale and `15` for Rotation, KFX-GUI would generate the following ASS code, which would be included along with the results from all other actions present on that line: +Code lines are a special part of any karaoke template, and KFX-GUI has some special features for code lines. This section applies to any line with a line type containing the word `code`. + +- A code entry box is displayed on the line settings page +- Components will not be parsed on a code line during ASS generation + - Similarly, code will not be parsed on non-code lines -``` -\t($start, $mid, \fscx120\fscy120\frz15)\t($mid, $end, \fscx100\fscy100\frz0) -``` -## Dependencies +# Dependencies -- JDK 11.0.1 -- JavaFX 11.0.1 -- NightConfig-core 3.6.5 -- NightConfig-toml 3.6.5 -- Gson 2.8.9 +KFX-GUI is a Maven project, and specifics on dependency and plugin usage can be found in the `pom.xml` file in the root directory of this project. TL;DR is that KFX-GUI depends on: +- Java 11 +- JavaFX 11 +- Night-Config Core, TOML +- Gson