subkt / myaa.subkt.tasks / Merge
open class Merge :
ASSTask
(source)
Task to merge multiple ASS files into one. A predefined task instance can be accessed through Subs.merge.
merge {
from("dialogue.ass") {
incrementLayer(10)
}
from("OP.ass") {
syncSourceLine("sync", EventLineAccessor.ACTOR)
syncTargetTime("0:10:24.66".assTime)
}
from(glob("typesetting-*.ass"))
onScriptInfoConflict(ErrorMode.FAIL)
namespaceStyles(true)
}
Name | Summary |
---|---|
FileSpecPair | data class FileSpecPair Represents a pair of files and corresponding merge specification. |
LineSpecification | data class LineSpecification |
MergeSpecification | inner class MergeSpecification Defines how the files associated with this specification should be merged. |
OnNegativeTimestamp | enum class OnNegativeTimestamp |
Name | Summary |
---|---|
<init> | Merge() Task to merge multiple ASS files into one. A predefined task instance can be accessed through Subs.merge. |
Name | Summary |
---|---|
conflictingScriptInfo | val conflictingScriptInfo: ListProperty < String !>! Fields for which differing values are considered a conflict. Defaults to PlayResX, PlayResY, YCbCr Matrix, ScaledBorderAndShadow and WrapStyle. |
namespaceStyles | val namespaceStyles: Property < Boolean > If true, prepends every style name with an identifier unique to each file, to make style conflicts impossible. |
onNegativeTimestamp | val onNegativeTimestamp: Property < Merge.OnNegativeTimestamp > What to do when encountering negative timestamps (e.g. after shifting). Defaults to Merge.OnNegativeTimestamp.ERROR. |
onScriptInfoConflict | val onScriptInfoConflict: Property < ErrorMode > What to do when encountering conflicting values for fields specified in conflictingScriptInfo. |
onStyleConflict | val onStyleConflict: Property < ErrorMode > What to do when encountering styles with identical names but conflicting definitions. |
scriptInfo | val scriptInfo: ScriptInfoSection A ScriptInfoSection instance for overriding the script info read from the merged files. A scriptInfo method is available for easier modification. |
sources | val sources: Provider < List < Merge.FileSpecPair >> The files to be merged, added via from or fromMergeTemplate. |
Name | Summary |
---|---|
includeExtraData | val includeExtraData: Property < Boolean !>! Whether to include the Aegisub Extradata section. |
includeProjectGarbage | val includeProjectGarbage: Property < Boolean !>! Whether to include the Aegisub Project Garbage section. |
out | val out: ConfigurableFileCollection The location to save the ASS file. Defaults to an automatically generated file in the build directory. |
removeComments | val removeComments: Property < Boolean !>! Whether to remove comments from the output file. |
Name | Summary |
---|---|
buildAss | open fun buildAss(): ASSFile Constructs the ASS file to save. Must be implemented by subtypes. |
from | fun from(vararg files: Any , action: Merge.MergeSpecification .() -> Unit = {}): Unit Adds files to merge. |
fromIfPresent | fun fromIfPresent(vararg files: Any , ignoreMissingFiles: Boolean = false, action: Merge.MergeSpecification .() -> Unit = {}): Unit Adds files to merge, unless the given provider (property) isn't defined. Will still result in an error if the property is defined but the file it points to is missing on the file system, unless [ignoreMissingFiles](from-if-present.md#myaa.subkt.tasks.Merge$fromIfPresent(kotlin.Array((kotlin.Any)), kotlin.Boolean, kotlin.Function1((myaa.subkt.tasks.Merge.MergeSpecification, kotlin.Unit)))/ignoreMissingFiles) is true . |
fromMergeTemplate | fun fromMergeTemplate(file: Any ): Unit Merges files as defined in a template file following Merge Scripts syntax. |
scriptInfo | fun scriptInfo(action: ScriptInfoSection .() -> Unit ): Unit Allows you to override values in the Script Info section as needed. |
Name | Summary |
---|---|
run | open fun run(): Unit |
Name | Summary |
---|---|
batch | val Task .batch: String The same as entry if this is a batch task; error otherwise. |
currentTask | val Task .currentTask: String The name of this task. |
entry | val Task .entry: String The entry (batch or episode) this task corresponds to. |
episode | val Task .episode: String The same as entry if this is an episode task; error otherwise. |
episodes | val Task .episodes: List < String > The episodes this task corresponds to. A single-item list containing episode if this is an episode task; a list of the episodes for the batch given by batch otherwise. |
isBatch | val Task .isBatch: Boolean True if this task is a batch task. |
release | val Task .release: String The release this task was generated for. |
taskGroup | val <T : Task > T .taskGroup: TaskGroup < T > The TaskGroup instance this task belongs to. |
Name | Summary |
---|---|
defaultProperty | fun <T> Task .defaultProperty(default: T ): Property < T > Returns a Property with a default value set. |
evaluate | fun Task .evaluate(expression: String ): Provider < List < String >!>! Evaluates a string using Velocity, splits it on ` |
evaluateTemplate | fun Task .evaluateTemplate(expression: String ): Provider < String !>! Like evaluate but only processes the template syntax, without globbing. |
get | fun Task .get(propertyName: String ): Provider < String !>! Searches for the given property in the Subs object's SubProperties instance, evaluates its value using evaluate, and returns a single string, assuming that the resulting list contains only one element. |
getAs | fun <T> Task .getAs(propertyName: String ): Provider < T >! Searches for the given property in the Subs object's SubProperties instance, evaluates its value using evaluate, and returns a single string, cast to the given type using String.asType, assuming that the resulting list contains only one element. |
getFile | fun Task .getFile(filename: String ): Provider < String !>! fun Task .getFile(filename: Provider < String >): Provider < String !>! Reads the specified file and processes it using Velocity. |
getList | fun Task .getList(propertyName: String ): Provider < List < String >> Searches for the given property in the Subs object's SubProperties instance, and evaluates its value using evaluate. |
getListAs | fun <T> Task .getListAs(propertyName: String ): Provider < List < T >!>! Searches for the given property in the Subs object's SubProperties instance, evaluates its value using evaluate, and casts the list elements to the given type using String.asType. |
getRaw | fun Task .getRaw(propertyName: String ): String Searches for the given property in the Subs object's SubProperties instance, and returns the raw string. Raises an error if not found. |
getRawMaybe | fun Task .getRawMaybe(propertyName: String ): String ? Searches for the given property in the Subs object's SubProperties instance, and returns the raw string, possibly null. |
outputFile | fun Task .outputFile(extension: String ): ConfigurableFileCollection Returns a ConfigurableFileCollection containing a single file taskName.extension located in the build directory. |
propertyExists | fun Task .propertyExists(propertyName: String ): Boolean Returns true if the given property exists in the Subs object's SubProperties instance for the given context. |