aboutsummaryrefslogtreecommitdiffstats
path: root/macros/garret.timings_copier.lua
diff options
context:
space:
mode:
authorgarret <garret@airmail.cc>2024-02-25 23:01:13 +0000
committergarret <garret@airmail.cc>2024-02-25 23:08:47 +0000
commit67d261ab378fa9166ee6e0c31b7cb4e32a019925 (patch)
tree1fbd2153481e675f283f731c1da59d584513f2c9 /macros/garret.timings_copier.lua
parent5edf42a777b02ab939ab751a7d3e7eb0a7efde70 (diff)
downloadaegisub-scripts-67d261ab378fa9166ee6e0c31b7cb4e32a019925.tar.gz
aegisub-scripts-67d261ab378fa9166ee6e0c31b7cb4e32a019925.tar.bz2
aegisub-scripts-67d261ab378fa9166ee6e0c31b7cb4e32a019925.zip
get rid of dependencycontrol bullshit
there is no sense in me keeping it around when all it does is add faff to writing the script add useless noise to the filenames/paths and enforces its opinions upon me which i dont agree with and all for absolutely ZERO reason since i don't even have a feed in the first place if you want to take my scripts and package them into a dependencycontrol feed, you are more than welcome to do so, provided you comply with the terms of the licence. but your life is going to be a little bit harder i'm afraid, sorry about that. i will keep all the script_namespace, depctrl registration and such around for the time being (removing it is >effort)
Diffstat (limited to 'macros/garret.timings_copier.lua')
-rw-r--r--macros/garret.timings_copier.lua54
1 files changed, 0 insertions, 54 deletions
diff --git a/macros/garret.timings_copier.lua b/macros/garret.timings_copier.lua
deleted file mode 100644
index 8b79cc0..0000000
--- a/macros/garret.timings_copier.lua
+++ /dev/null
@@ -1,54 +0,0 @@
-script_name = "Timings copier"
-script_description = "for copying song timings"
-script_version = "1.0.0"
-script_author = "garret"
-script_namespace = "garret.timings_copier"
-
-local haveDepCtrl, DependencyControl, depctrl = pcall(require, "l0.DependencyControl")
-if haveDepCtrl then
- depctrl = DependencyControl {}
-end
-
-local function get_blocks(sub, sel)
- local src_style = sub[sel[1]].style
- local src_len = 1
- for i = 2, #sel do
- if sub[sel[i]].style == src_style then
- src_len = src_len + 1
- else
- break
- end
- end
- local blocks = #sel / src_len
- if blocks % 1 ~= 0 then
- aegisub.log(0, "FATAL: Block lengths are not equal!\n")
- aegisub.log(3, "HINT: Each \"block\" of lines must be the same length, e.g. you can't have less romaji than english, or vice versa. a block is a group of consecutive lines with the same style.")
- aegisub.cancel()
- else
- return src_len, blocks
- end
-end
-
-local function copy(sub, sel, offset, blocks)
- for index = 1, offset do
- line = sub[sel[index]]
- for mul = 1, blocks - 1 do
- block_line = sub[sel[offset * mul + index]]
- block_line.start_time = line.start_time
- block_line.end_time = line.end_time
- sub[sel[offset * mul + index]] = block_line
- end
- end
-end
-
-local function main(sub, sel)
- offset, blocks = get_blocks(sub, sel)
- copy(sub, sel, offset, blocks)
- aegisub.set_undo_point(script_name)
-end
-
-if haveDepCtrl then
- depctrl:registerMacro(main)
-else
- aegisub.register_macro(script_name, script_description, main)
-end