Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@users.sourceforge.net>2011-07-29 19:53:12 +0400
committerXhmikosR <xhmikosr@users.sourceforge.net>2011-07-29 19:53:12 +0400
commitdbfec44e5aa5c39d0f58096b5e896354952edf38 (patch)
treec314042f48812a78d2c3fbd2d709d8935a624bb5 /src/Subtitles
parent212fa2d73cedcf71fdfe590e5b4b446dfd3ca5ea (diff)
cleanup
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@3503 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/Subtitles')
-rw-r--r--src/Subtitles/libssf/demo/demo.ssa2
-rw-r--r--src/Subtitles/libssf/demo/demo.ssf428
-rw-r--r--src/Subtitles/libssf/docs/ssf-specs.txt816
-rw-r--r--src/Subtitles/libssf/stdafx.h14
4 files changed, 623 insertions, 637 deletions
diff --git a/src/Subtitles/libssf/demo/demo.ssa b/src/Subtitles/libssf/demo/demo.ssa
index f6a05fad7..6466ea5e2 100644
--- a/src/Subtitles/libssf/demo/demo.ssa
+++ b/src/Subtitles/libssf/demo/demo.ssa
@@ -3,7 +3,7 @@
; For Sub Station Alpha info and downloads,
; go to http://www.eswat.demon.co.uk/
; or email kotus@eswat.demon.co.uk
-;
+;
ScriptType: v4.00
Collisions: Normal
PlayResX: 320
diff --git a/src/Subtitles/libssf/demo/demo.ssf b/src/Subtitles/libssf/demo/demo.ssf
index 33258144e..0607a122b 100644
--- a/src/Subtitles/libssf/demo/demo.ssf
+++ b/src/Subtitles/libssf/demo/demo.ssf
@@ -1,11 +1,11 @@
/*
- This file is the direct translation of demo.ssa of the "subtitler" virtualdub plugin
+ This file is the direct translation of demo.ssa of the "subtitler" virtualdub plugin
*/
file#file
{
- format: "ssf";
- version: 1;
+ format: "ssf";
+ version: 1;
};
/*
@@ -15,18 +15,18 @@ PlayResY: 240
subtitle#subtitle
{
- frame
- {
- reference: "video";
- resolution: {cx: 320; cy: 240;};
- };
-
- style
- {
- placement {align: bottomleft; margin {t: 16; r: 16; b: 16; l: 16;};};
- font {size: 14; weight: "normal"; color: yellow;};
- shadow.depth: 4;
- };
+ frame
+ {
+ reference: "video";
+ resolution: {cx: 320; cy: 240;};
+ };
+
+ style
+ {
+ placement {align: bottomleft; margin {t: 16; r: 16; b: 16; l: 16;};};
+ font {size: 14; weight: "normal"; color: yellow;};
+ shadow.depth: 4;
+ };
};
/*
@@ -61,41 +61,41 @@ Dialogue: Marked=0,0:00:10.00,0:00:21.00,MainB,,0000,0000,0000,!Effect,{\q1}Dial
#notes
{
- style: MainB;
+ style: MainB;
};
subtitle : notes
{
- time {start: 00:00:00.000; stop: 00:00:05.000;};
-
- @ {
- Subtitler filter for VirtualDub\n
- Demonstration script\n\n
- Avery Lee <phaeron@virtualdub.org>
- };
+ time {start: 00:00:00.000; stop: 00:00:05.000;};
+
+ @ {
+ Subtitler filter for VirtualDub\n
+ Demonstration script\n\n
+ Avery Lee <phaeron@virtualdub.org>
+ };
};
subtitle : notes
{
- time {start: 00:00:05.000; stop: 00:00:10.000;};
-
- @ {
- Introduction\n\n
- This script will demonstrate some of the simpler features of the subtitler. You will want to
- refer to the [{font {face: "Courier New"; weight: "bold";};}] {readme.txt} file for a more
- complete reference.
- };
+ time {start: 00:00:05.000; stop: 00:00:10.000;};
+
+ @ {
+ Introduction\n\n
+ This script will demonstrate some of the simpler features of the subtitler. You will want to
+ refer to the [{font {face: "Courier New"; weight: "bold";};}] {readme.txt} file for a more
+ complete reference.
+ };
};
subtitle : notes
{
- time {start: 00:00:10.000; stop: 00:00:21.000;};
+ time {start: 00:00:10.000; stop: 00:00:21.000;};
- @ {
- Dialogue lines\n\n
- Scripts are based on dialogue lines. Each dialogue line has a start time, an end time, and text
- to display in between.
- };
+ @ {
+ Dialogue lines\n\n
+ Scripts are based on dialogue lines. Each dialogue line has a start time, an end time, and text
+ to display in between.
+ };
};
/*
@@ -114,8 +114,8 @@ Dialogue: Marked=0,0:00:20.00,0:00:21.00,Timer,,0000,0000,0000,!Effect,0:10
#clocktest
{
- time {start: +0s; stop: +1s;};
- style: Timer;
+ time {start: +0s; stop: +1s;};
+ style: Timer;
};
subtitle : clocktest {@ {0:00}; time.start: 00:00:10.000;};
@@ -143,70 +143,70 @@ Dialogue: Marked=0,0:00:19.00,0:00:21.00,MainT,,0000,0000,0080,!Effect,{\c&H7070
subtitle
{
- time {start: 00:00:12.000; stop: 00:00:15.000;};
- style: MainT {font.color {r: 0x00; g: 0xff; b: 0x80;};};
- @ {Hello.};
+ time {start: 00:00:12.000; stop: 00:00:15.000;};
+ style: MainT {font.color {r: 0x00; g: 0xff; b: 0x80;};};
+ @ {Hello.};
};
subtitle
{
- time {start: 00:00:16.000; stop: 00:00:19.000;};
- style: MainT {font.color {r: 0xe0; g: 0xe0; b: 0xe0;};};
- @ {Oh, hi.};
+ time {start: 00:00:16.000; stop: 00:00:19.000;};
+ style: MainT {font.color {r: 0xe0; g: 0xe0; b: 0xe0;};};
+ @ {Oh, hi.};
};
#dialogtest
{
- style: MainT {placement.margin.t: 80;};
- time.start: +0s;
+ style: MainT {placement.margin.t: 80;};
+ time.start: +0s;
};
#dialogtest1 : dialogtest
{
- @ {\[02:00-05:00\] Hello.};
+ @ {\[02:00-05:00\] Hello.};
};
#dialogtest2 : dialogtest
{
- @ {\[06:00-09:00\] Oh, hi.};
+ @ {\[06:00-09:00\] Oh, hi.};
};
subtitle : dialogtest1
{
- time.start: 00:00:10.000;
- time.stop: +2s;
- style.font.color {r: 0x00; g: 0x7f; b: 0x40;};
+ time.start: 00:00:10.000;
+ time.stop: +2s;
+ style.font.color {r: 0x00; g: 0x7f; b: 0x40;};
};
subtitle : dialogtest1
{
- time.stop: +3s;
- style.font.color {r: 0x00; g: 0xff; b: 0x80;};
+ time.stop: +3s;
+ style.font.color {r: 0x00; g: 0xff; b: 0x80;};
};
subtitle : dialogtest1
{
- time.stop: +6s;
- style.font.color {r: 0x00; g: 0x7f; b: 0x40;};
+ time.stop: +6s;
+ style.font.color {r: 0x00; g: 0x7f; b: 0x40;};
};
subtitle : dialogtest2
{
- time.start: 00:00:10.000;
- time.stop: +6s;
- style.font.color {r: 0x70; g: 0x70; b: 0x70;};
+ time.start: 00:00:10.000;
+ time.stop: +6s;
+ style.font.color {r: 0x70; g: 0x70; b: 0x70;};
};
subtitle : dialogtest2
{
- time.stop: +3s;
- style.font.color {r: 0xe0; g: 0xe0; b: 0xe0;};
+ time.stop: +3s;
+ style.font.color {r: 0xe0; g: 0xe0; b: 0xe0;};
};
subtitle : dialogtest2
{
- time.stop: +2s;
- style.font.color {r: 0x70; g: 0x70; b: 0x70;};
+ time.stop: +2s;
+ style.font.color {r: 0x70; g: 0x70; b: 0x70;};
};
/*
@@ -223,23 +223,23 @@ Dialogue: Marked=0,0:00:23.00,0:00:33.00,MainB,,0008,0008,0008,!Effect,{\a11\c&H
#aligntest : notes
{
- time {start: 00:00:23.000; stop: 00:00:33.000;};
- style {placement.margin {t: 8; r: 8; b: 8; l: 8;};};
+ time {start: 00:00:23.000; stop: 00:00:33.000;};
+ style {placement.margin {t: 8; r: 8; b: 8; l: 8;};};
};
#aligntestside : aligntest
{
- style.font.color {r: 0xe0; g: 0xe0; b: 0xe0;};
+ style.font.color {r: 0xe0; g: 0xe0; b: 0xe0;};
};
subtitle : aligntest
{
- style.placement {align: middlecenter; margin {r: 55; l: 55;};};
-
- @ {
- Alignment\n\n
- Dialogue lines may be placed in any of three horizontal placements and any of three vertical placements.
- };
+ style.placement {align: middlecenter; margin {r: 55; l: 55;};};
+
+ @ {
+ Alignment\n\n
+ Dialogue lines may be placed in any of three horizontal placements and any of three vertical placements.
+ };
};
subtitle : aligntestside {style.placement.align: bottomleft; @ {Bottom\nleft};};
@@ -258,34 +258,34 @@ Dialogue: Marked=0,0:00:35.00,0:00:45.00,MainT,,0000,0000,0000,!Effect,{\q1}You
#fonttest
{
- time {start: 00:00:35.000; stop: 00:00:45.000;};
+ time {start: 00:00:35.000; stop: 00:00:45.000;};
};
subtitle : fonttest notes
{
- @ {
- Text styles\n\n
- Text may be varied in font, size, color, and style.
- };
+ @ {
+ Text styles\n\n
+ Text may be varied in font, size, color, and style.
+ };
};
subtitle : fonttest
{
- style: MainT;
-
- @ {
- You can have your text in
- [{font.color {r: 0xff; g: 0x60; b: 0x40;};}] {red},
- [{font.color {r: 0x40; g: 0xff; b: 0x60;};}] {green}, and
- [{font.color {r: 0x40; g: 0x60; b: 0xff;};}] {blue};
- [{font.face: "Courier New";}] {Courier};
- [{font.size: 16;}] {16 point} or
- [{font.size: 32;}] {32 point};
- [{font.weight: "bold";}] {bold},
- [{font.italic: "true";}] {italic},
- or even
- [{font {weight: "bold"; italic: "true";};}] {bold italic}.
- };
+ style: MainT;
+
+ @ {
+ You can have your text in
+ [{font.color {r: 0xff; g: 0x60; b: 0x40;};}] {red},
+ [{font.color {r: 0x40; g: 0xff; b: 0x60;};}] {green}, and
+ [{font.color {r: 0x40; g: 0x60; b: 0xff;};}] {blue};
+ [{font.face: "Courier New";}] {Courier};
+ [{font.size: 16;}] {16 point} or
+ [{font.size: 32;}] {32 point};
+ [{font.weight: "bold";}] {bold},
+ [{font.italic: "true";}] {italic},
+ or even
+ [{font {weight: "bold"; italic: "true";};}] {bold italic}.
+ };
};
/*
@@ -297,37 +297,37 @@ Dialogue: Marked=0,0:00:47.00,0:00:57.00,MainT,,0000,0000,0090,!Effect,{\q0\a6\c
#wraptest
{
- time {start: 00:00:47.000; stop: 00:00:57.000;};
+ time {start: 00:00:47.000; stop: 00:00:57.000;};
};
subtitle : wraptest notes
{
- @ {
- Wrapping styles\n\n
- Three wrapping modes are supported: manual only, automatic wrapping, and smart wrapping.
- Smart wrapping is automatic wrapping, but with the lines broken as evenly as possible.
- };
+ @ {
+ Wrapping styles\n\n
+ Three wrapping modes are supported: manual only, automatic wrapping, and smart wrapping.
+ Smart wrapping is automatic wrapping, but with the lines broken as evenly as possible.
+ };
};
subtitle : wraptest
{
- style: MainT {font.color {r: 0x80; g: 0xff; b: 0xe0;};};
- wrap: "manual";
- @ {This line uses manual wrapping and won't\nbe wrapped except where explicitly broken.};
+ style: MainT {font.color {r: 0x80; g: 0xff; b: 0xe0;};};
+ wrap: "manual";
+ @ {This line uses manual wrapping and won't\nbe wrapped except where explicitly broken.};
};
subtitle : wraptest
{
- style: MainT {font.color {r: 0xff; g: 0xe0; b: 0x80;}; placement.margin.t: 45;};
- wrap: "normal";
- @ {This line uses automatic wrapping and is broken automatically.};
+ style: MainT {font.color {r: 0xff; g: 0xe0; b: 0x80;}; placement.margin.t: 45;};
+ wrap: "normal";
+ @ {This line uses automatic wrapping and is broken automatically.};
};
subtitle : wraptest
{
- style: MainT {font.color {r: 0x80; g: 0xe0; b: 0xff;}; placement.margin.t: 90; placement.align: topcenter; };
- wrap: "even";
- @ {This line uses smart wrapping and is broken with even lines. It's good for centered text.};
+ style: MainT {font.color {r: 0x80; g: 0xe0; b: 0xff;}; placement.margin.t: 90; placement.align: topcenter; };
+ wrap: "even";
+ @ {This line uses smart wrapping and is broken with even lines. It's good for centered text.};
};
/*
@@ -342,60 +342,60 @@ Dialogue: Marked=0,0:01:21.50,0:01:24.00,MainT,,0000,0000,0000,!Effect,{\q1\c&HE
subtitle : notes
{
- time {start: 00:00:59.000; stop: 00:01:24.000;};
-
- @ {
- Collisions\n\n
- If two dialogue items attempt to display at the same time and place, the second one is
- pushed clear of the first. However, text stays in place after it is resolved, even if
- the collider disappears.
- };
+ time {start: 00:00:59.000; stop: 00:01:24.000;};
+
+ @ {
+ Collisions\n\n
+ If two dialogue items attempt to display at the same time and place, the second one is
+ pushed clear of the first. However, text stays in place after it is resolved, even if
+ the collider disappears.
+ };
};
#actor1
{
- style: MainT {font.color {r: 0xe0; g: 0xe0; b: 0xe0;};};
+ style: MainT {font.color {r: 0xe0; g: 0xe0; b: 0xe0;};};
};
#actor2
{
- style: MainT {font.color {r: 0xff; g: 0xd0; b: 0x50;}; placement.align: topright;};
+ style: MainT {font.color {r: 0xff; g: 0xd0; b: 0x50;}; placement.align: topright;};
};
subtitle : actor1
{
- time {start: 00:01:02.000; stop: 00:01:07.000;};
- @ {Man, I gotta get out of here!};
+ time {start: 00:01:02.000; stop: 00:01:07.000;};
+ @ {Man, I gotta get out of here!};
};
subtitle : actor1
{
- time {start: 00:01:07.000; stop: 00:01:17.000;};
- @ {Which way should I go? I'm not going back to school....};
+ time {start: 00:01:07.000; stop: 00:01:17.000;};
+ @ {Which way should I go? I'm not going back to school....};
};
subtitle : actor2
{
- time {start: 00:01:10.000; stop: 00:01:21.000;};
- @ {Ranma, you're in the way! Move!};
+ time {start: 00:01:10.000; stop: 00:01:21.000;};
+ @ {Ranma, you're in the way! Move!};
};
subtitle : actor1
{
- time {start: 00:01:15.000; stop: 00:01:21.300;};
- @ {Why would I move for an uncute tomboy like you?};
+ time {start: 00:01:15.000; stop: 00:01:21.300;};
+ @ {Why would I move for an uncute tomboy like you?};
};
subtitle : actor2
{
- time {start: 00:01:21.000; stop: 00:01:25.000;};
- @ {Ranma no baka!!!};
+ time {start: 00:01:21.000; stop: 00:01:25.000;};
+ @ {Ranma no baka!!!};
};
subtitle : actor1
{
- time {start: 00:01:21.500; stop: 00:01:24.000;};
- @ {*wham*};
+ time {start: 00:01:21.500; stop: 00:01:24.000;};
+ @ {*wham*};
};
/*
@@ -408,39 +408,39 @@ Dialogue: Marked=0,0:01:26.00,0:01:36.00,B4S4B,,0000,0000,0090,!Effect,Border=4,
#bordershadowtest
{
- time {start: 00:01:26.000; stop: 00:01:36.000;};
+ time {start: 00:01:26.000; stop: 00:01:36.000;};
};
subtitle : bordershadowtest notes
{
- @ {
- Shadows and borders\n\n
- You can vary the depth of the translucent shadow as well as the thickness and color of the border.
- };
+ @ {
+ Shadows and borders\n\n
+ You can vary the depth of the translucent shadow as well as the thickness and color of the border.
+ };
};
subtitle : bordershadowtest
{
- style: B0S0K;
- @ {Border=0, shadow=0};
+ style: B0S0K;
+ @ {Border=0, shadow=0};
};
subtitle : bordershadowtest
{
- style: B2S2R {placement.margin.t: 30;};
- @ {Border=2, shadow=2 (red)};
+ style: B2S2R {placement.margin.t: 30;};
+ @ {Border=2, shadow=2 (red)};
};
subtitle : bordershadowtest
{
- style: B2S6G {placement.margin.t: 60;};
- @ {Border=2, shadow=6 (green)};
+ style: B2S6G {placement.margin.t: 60;};
+ @ {Border=2, shadow=6 (green)};
};
subtitle : bordershadowtest
{
- style: B4S4B {placement.margin.t: 90;};
- @ {Border=4, shadow=4 (blue)};
+ style: B4S4B {placement.margin.t: 90;};
+ @ {Border=4, shadow=4 (blue)};
};
/*
@@ -451,19 +451,19 @@ Dialogue: Marked=0,0:01:40.00,0:01:45.00,Karaoke,,0000,0000,0030,Karaoke,{\fs18\
subtitle : notes
{
- time {start: 00:01:38.000; stop: 00:01:48.000;};
+ time {start: 00:01:38.000; stop: 00:01:48.000;};
- @ {
- Karaoke\n\n
- Letting people sing to music is dangerous. But if they're going to do it anyway,
- they might as well have some help. Both snap and smooth styles are supported.
- };
+ @ {
+ Karaoke\n\n
+ Letting people sing to music is dangerous. But if they're going to do it anyway,
+ they might as well have some help. Both snap and smooth styles are supported.
+ };
};
#karaoketest
{
- time {start: 00:01:40.000; stop: 00:01:45.000;};
- style: Karaoke {font.size: 18;};
+ time {start: 00:01:40.000; stop: 00:01:45.000;};
+ style: Karaoke {font.size: 18;};
};
#hlcolor {r: 0x40; g: 0x40; b: 0xff;};
@@ -472,26 +472,26 @@ subtitle : notes
subtitle : karaoketest
{
- @ {
- [hleffect1 {time.stop: +100;}] {one}
- [hleffect1 {time.stop: +100;}] {two}
- [hleffect1 {time.stop: +50;}] {three-}
- [hleffect1 {time.stop: +50;}] {and}
- [hleffect1 {time.stop: +100;}] {four}
- };
+ @ {
+ [hleffect1 {time.stop: +100;}] {one}
+ [hleffect1 {time.stop: +100;}] {two}
+ [hleffect1 {time.stop: +50;}] {three-}
+ [hleffect1 {time.stop: +50;}] {and}
+ [hleffect1 {time.stop: +100;}] {four}
+ };
};
subtitle : karaoketest
{
- style {placement.margin.t: 30; fill.color: hlcolor;};
+ style {placement.margin.t: 30; fill.color: hlcolor;};
- @ {
- [hleffect2 {time.stop: +100;}] {one}
- [hleffect2 {time.stop: +100;}] {two}
- [hleffect2 {time.stop: +50;}] {three-}
- [hleffect2 {time.stop: +50;}] {and}
- [hleffect2 {time.stop: +100;}] {four}
- };
+ @ {
+ [hleffect2 {time.stop: +100;}] {one}
+ [hleffect2 {time.stop: +100;}] {two}
+ [hleffect2 {time.stop: +50;}] {three-}
+ [hleffect2 {time.stop: +50;}] {and}
+ [hleffect2 {time.stop: +100;}] {four}
+ };
};
/*
@@ -502,28 +502,28 @@ Dialogue: Marked=0,0:01:52.00,0:02:00.00,ShiftJIS,,0000,0000,0000,!Effect,{\a7\q
subtitle : notes
{
- time {start: 00:01:50.000; stop: 00:02:00.000;};
+ time {start: 00:01:50.000; stop: 00:02:00.000;};
- @ {
- DBCS (double-byte character set) support\n\n
- If you have the appropriate language support installed, you can display far-east text
- in your subtitles. (By the way, I don't really know Japanese, so I'm kind of winged it
- above with the JWPce dictionary.)
- };
+ @ {
+ DBCS (double-byte character set) support\n\n
+ If you have the appropriate language support installed, you can display far-east text
+ in your subtitles. (By the way, I don't really know Japanese, so I'm kind of winged it
+ above with the JWPce dictionary.)
+ };
};
subtitle
{
- time {start: 00:01:50.000; stop: 00:02:00.000;};
- style: ShiftJIS;
- @ {\[Keitarou\]だ。。。大丈夫?};
+ time {start: 00:01:50.000; stop: 00:02:00.000;};
+ style: ShiftJIS;
+ @ {\[Keitarou\]だ。。。大丈夫?};
};
subtitle
{
- time {start: 00:01:52.000; stop: 00:02:00.000;};
- style: ShiftJIS {font.color: cyan; placement.align: topright;};
- @ {\[Naru\]何よ!};
+ time {start: 00:01:52.000; stop: 00:02:00.000;};
+ style: ShiftJIS {font.color: cyan; placement.align: topright;};
+ @ {\[Naru\]何よ!};
};
/*
@@ -534,41 +534,41 @@ Dialogue: Marked=0,0:02:02.00,0:02:17.00,MainT,,0000,0000,0000,Scroll Up;40;50;1
#effecttest
{
- time {start: 00:02:02.000; stop: 00:02:17.000;};
- style.placement.clip: "frame";
+ time {start: 00:02:02.000; stop: 00:02:17.000;};
+ style.placement.clip: "frame";
};
subtitle : effecttest notes
{
- @ {
- Motion effects\n\n
- You can scroll text in like a banner, or up the screen.
- };
+ @ {
+ Motion effects\n\n
+ You can scroll text in like a banner, or up the screen.
+ };
};
subtitle : effecttest
{
- wrap: "manual";
- style: MainT {placement {margin {l: "right"; r: "left";}; align.h: "left";};};
- #hscroll {time {start: "start"; stop: "stop";}; placement.align.h: "right";};
+ wrap: "manual";
+ style: MainT {placement {margin {l: "right"; r: "left";}; align.h: "left";};};
+ #hscroll {time {start: "start"; stop: "stop";}; placement.align.h: "right";};
- @ {
- [hscroll]
- Text is fun. We like scrolling text.
- };
+ @ {
+ [hscroll]
+ Text is fun. We like scrolling text.
+ };
};
subtitle : effecttest
{
- style: MainT {placement {margin {t: 120; b: 200;}; clip {t: 40; b: 120;}; align.v: "top";};};
- #vscroll {time {start: "start"; stop: "stop";}; placement.align.v: "bottom";};
+ style: MainT {placement {margin {t: 120; b: 200;}; clip {t: 40; b: 120;}; align.v: "top";};};
+ #vscroll {time {start: "start"; stop: "stop";}; placement.align.v: "bottom";};
- @ {
- [vscroll]
- You can scroll lots of text up this way. Personally, I find it a little annoying
- to have a lot of text coming up very slowly on screen, but it's a useful technique
- to have for credits and other long lists in tabular form.
- };
+ @ {
+ [vscroll]
+ You can scroll lots of text up this way. Personally, I find it a little annoying
+ to have a lot of text coming up very slowly on screen, but it's a useful technique
+ to have for credits and other long lists in tabular form.
+ };
};
/*
@@ -577,19 +577,19 @@ Dialogue: Marked=0,0:02:19.00,0:02:50.00,MainB,,0000,0000,0000,!Effect,{\q1}Conc
subtitle : notes
{
- time {start: 00:02:19.000; stop: 00:02:50.000;};
-
- #monospace {font.face: "Courier New";};
- #monospacebold : monospace {font.weight: "bold";};
-
- @ {
- Conclusion\n\n
- That concludes the demo. I hope you've enjoyed the brief glimpse I've given you here,
- and encourage you to read the [monospacebold] {readme.txt} file for more information
- on the effects you've seen here. Also, if you're bored, try loading this script into
- Kotus' Sub Station Alpha V4 program. Not all effects will render correctly, but most
- of the file will. Have fun, and keep on subtitling!\n\n
- [monospace]{--}Avery Lee <phaeron@virtualdub.org>\n
- [monospace]{\h\h}Author of VirtualDub and the 'subtitler' filter
- };
+ time {start: 00:02:19.000; stop: 00:02:50.000;};
+
+ #monospace {font.face: "Courier New";};
+ #monospacebold : monospace {font.weight: "bold";};
+
+ @ {
+ Conclusion\n\n
+ That concludes the demo. I hope you've enjoyed the brief glimpse I've given you here,
+ and encourage you to read the [monospacebold] {readme.txt} file for more information
+ on the effects you've seen here. Also, if you're bored, try loading this script into
+ Kotus' Sub Station Alpha V4 program. Not all effects will render correctly, but most
+ of the file will. Have fun, and keep on subtitling!\n\n
+ [monospace]{--}Avery Lee <phaeron@virtualdub.org>\n
+ [monospace]{\h\h}Author of VirtualDub and the 'subtitler' filter
+ };
};
diff --git a/src/Subtitles/libssf/docs/ssf-specs.txt b/src/Subtitles/libssf/docs/ssf-specs.txt
index 95d639e19..bc34fed14 100644
--- a/src/Subtitles/libssf/docs/ssf-specs.txt
+++ b/src/Subtitles/libssf/docs/ssf-specs.txt
@@ -1,11 +1,11 @@
Structured Subtitle Format 1.0 (boring name, need a better one)
------------------------------
-The encoding must be utf-8/16le/16be with the BOM at the beginning.
+The encoding must be utf-8/16le/16be with the BOM at the beginning.
-Parsing is prefered to be stream oriented, which means:
+Parsing is prefered to be stream oriented, which means:
- new-line characters in text do not differ from the rest of the white-space characters
-- forward references are not allowed
+- forward references are not allowed
Comments
--------
@@ -16,10 +16,10 @@ Comments
Syntax
------
-Fortunatelly, there is only one general way to define something. The elements are broken
-into lines for better understanding, but they can be compressed into one single line as well,
-whichever suits your preference. The term "type" could be read as "attribute" or "member of
-a structure" too.
+Fortunatelly, there is only one general way to define something. The elements are broken
+into lines for better understanding, but they can be compressed into one single line as well,
+whichever suits your preference. The term "type" could be read as "attribute" or "member of
+a structure" too.
[!]
[type[.type[..]]]
@@ -28,20 +28,20 @@ a structure" too.
[refs | quoted string | num | bool | raw]
;
-As you can see nearly everything is optional, even the terminating semi-colon is not required
+As you can see nearly everything is optional, even the terminating semi-colon is not required
when a closing bracket ends the definition anyway. However, either type or #name must be given,
otherwise there would be no meaning of the expression.
"!":
- gives the definition high priority, normal priority types of the same kind cannot override it:
- #a {!t: 123;};
- #b {t: 234;};
- #c a b; // t of c equals to 123
- - works on references too:
- !#a {t: 123;};
- #b {t: 234;};
- #ab a b;
- #c ab; // t of c still equals to 123
+ #a {!t: 123;};
+ #b {t: 234;};
+ #c a b; // t of c equals to 123
+ - works on references too:
+ !#a {t: 123;};
+ #b {t: 234;};
+ #ab a b;
+ #c ab; // t of c still equals to 123
"type" and "name":
- alphanumeric or underscore characters only, without spaces
@@ -50,58 +50,58 @@ otherwise there would be no meaning of the expression.
"type":
- type is optional but can be inherited through referencing other names which happen to have a type already
- color#c1 {a: 0x80;};
- #c2: c1; // c2 also has the type of color now
- #c3: c2; // c3 too
+ color#c1 {a: 0x80;};
+ #c2: c1; // c2 also has the type of color now
+ #c3: c2; // c3 too
- if there is a type already additional references cannot change it
- when mixing different types (not recommended) the first one decides
- there is one special type which have an important but a limited use: @ (see 'subtitle' for an example usage)
- - it is not parsed for references or nested definitions
- - the content of the following block {...} is saved as-is for the application
- - cannot be global or named and therefore referenced
- - { and } have to be escaped with \ inside the block (other block specific characters may as well)
+ - it is not parsed for references or nested definitions
+ - the content of the following block {...} is saved as-is for the application
+ - cannot be global or named and therefore referenced
+ - { and } have to be escaped with \ inside the block (other block specific characters may as well)
- type.type.type.... is equal to writing: type {type {type {...};};};
"name":
- every name is globally visible
- redefining a name is forbidden, unless it was predefined by the application
- using the type as the name (type#type) can change the type's default values
- - however, the scope is important:
-
- subtitle#subtitle {style.font.size: 20;};
- style#style {font.size: 30;};
- style#s1 {font.face: "Arial";};
- style#s2 : s1 {font.color: red;};
- subtitle#a {style: s2 {font.weight: "normal";};};
-
- Here font.size equals to 20, because it inherits from subtitle#subtitle.style instead of the
- global style#style, additionally it gets the properties of s2-s1 and the inline def. If it also
- inherited properties from style#style through s2-s1 indirectly, there would be two default base
- definitions and the order of overriding eachother would not be clear.
-
- subtitle#a.style
- <- subtitle#subtitle.style
- <- s2 <- s1 <-NOT- style#style
- <- {font.weight: "normal";}
+ - however, the scope is important:
+
+ subtitle#subtitle {style.font.size: 20;};
+ style#style {font.size: 30;};
+ style#s1 {font.face: "Arial";};
+ style#s2 : s1 {font.color: red;};
+ subtitle#a {style: s2 {font.weight: "normal";};};
+
+ Here font.size equals to 20, because it inherits from subtitle#subtitle.style instead of the
+ global style#style, additionally it gets the properties of s2-s1 and the inline def. If it also
+ inherited properties from style#style through s2-s1 indirectly, there would be two default base
+ definitions and the order of overriding eachother would not be clear.
+
+ subtitle#a.style
+ <- subtitle#subtitle.style
+ <- s2 <- s1 <-NOT- style#style
+ <- {font.weight: "normal";}
"refs":
- combination of any names or nested definitions separated by spaces
- forward references are not allowed
- referencing a value type directly is not allowed: (TODO: this may change)
- OK:
- color#c1: {a: 12;};
- color#c2: c1;
- BAD:
- #twelve: 12;
- color#c2: {a: twelve;};
+ OK:
+ color#c1: {a: 12;};
+ color#c2: c1;
+ BAD:
+ #twelve: 12;
+ color#c2: {a: twelve;};
- 'name' must have been defined by a parent node
- OK:
- #c1: {a: 12;};
- style#s1 {color: c1;};
- style#s2 {color: c1;};
- BAD:
- style#s1 {color#c1: {a: 12;};};
- style#s2 {color: c1;}; // c1 cannot be accessed here
+ OK:
+ #c1: {a: 12;};
+ style#s1 {color: c1;};
+ style#s2 {color: c1;};
+ BAD:
+ style#s1 {color#c1: {a: 12;};};
+ style#s2 {color: c1;}; // c1 cannot be accessed here
"quoted string" or 'quoted string':
- \ escapes characters, including " and '
@@ -110,9 +110,9 @@ otherwise there would be no meaning of the expression.
"num":
- decimal, hexadecimal (prefixed with: 0x), float [+ unit (optional, see 'time' below for an example)]
- there are numbers with restricted range or special formatting:
- - degrees: <num> mod 360
- - percent: must be between 0 and 1
- - time: [+] [<num>:[<num>:[<num>.]]]<num> | <num>h | <num>m | <num>s | <num>ms
+ - degrees: <num> mod 360
+ - percent: must be between 0 and 1
+ - time: [+] [<num>:[<num>:[<num>.]]]<num> | <num>h | <num>m | <num>s | <num>ms
"bool":
- "true" | "false" | "on" | "off" | "yes" | "no" | 1 | 0
@@ -123,355 +123,355 @@ Recognized types and attributes
file
{
- format: <string>; // identifies the file format ("ssf")
- version: <num>; // file format version (1)
- language: <string>; // iso6392
- title: <string>;
- year: <num>;
- author: <string>;
+ format: <string>; // identifies the file format ("ssf")
+ version: <num>; // file format version (1)
+ language: <string>; // iso6392
+ title: <string>;
+ year: <num>;
+ author: <string>;
};
color
{
- // a, r, g, b: 0 - 255 or 0x00 - 0xff
+ // a, r, g, b: 0 - 255 or 0x00 - 0xff
- a: <num>;
- r: <num>;
- g: <num>;
- b: <num>;
+ a: <num>;
+ r: <num>;
+ g: <num>;
+ b: <num>;
};
point
{
- x: <num>;
- y: <num>;
+ x: <num>;
+ y: <num>;
};
size
{
- cx: <num>;
- cy: <num>;
+ cx: <num>;
+ cy: <num>;
};
rect
{
- t: <num>;
- r: <num>;
- b: <num>;
- l: <num>;
+ t: <num>;
+ r: <num>;
+ b: <num>;
+ l: <num>;
};
align
{
- // when given in percent, 0 means top/left, 1 bottom/right, 0.5 middle/center
-
- v: ["top" | "middle" | "bottom" | <percent>];
- h: ["left" | "center" | "right" | <percent>];
+ // when given in percent, 0 means top/left, 1 bottom/right, 0.5 middle/center
+
+ v: ["top" | "middle" | "bottom" | <percent>];
+ h: ["left" | "center" | "right" | <percent>];
};
angle
{
- x: <degrees>;
- y: <degrees>;
- z: <degrees>;
+ x: <degrees>;
+ y: <degrees>;
+ z: <degrees>;
};
frame
{
- reference: ["video" | "window"];
- resolution: <size>;
+ reference: ["video" | "window"];
+ resolution: <size>;
};
direction
{
- primary: ["right" | "left" | "down" | "up"];
- secondary: ["right" | "left" | "down" | "up"]; // must be perpendicular to primary
+ primary: ["right" | "left" | "down" | "up"];
+ secondary: ["right" | "left" | "down" | "up"]; // must be perpendicular to primary
};
placement
{
- clip: ["none" | "frame" | <rect>]; // anything drawn outside this rectangle is clipped, negative or larger than 'resolution' values are not allowed for rect
- margin: <rect>; // "top" "right" "bottom" "left" are also valid values for the rect members, they refer to the values of the "frame" rect (0, 0, frame.resolution.cx, frame.resolution.cy)
- align: <align>;
- pos: ["auto" | <point>]; // absolute values, pos.x or pos.y can be animated only when both the source and destination style defined it
- offset: <point>; // relative to pos, unlike pos this can be applied to fragments of the text as an override
- angle: <angle>; // origin of rotation is the alignment point, unless it is overriden
- org: ["auto" | <point>]; // override for the origin
- path: <string>; // a series of x y coord pairs (at least two points)
+ clip: ["none" | "frame" | <rect>]; // anything drawn outside this rectangle is clipped, negative or larger than 'resolution' values are not allowed for rect
+ margin: <rect>; // "top" "right" "bottom" "left" are also valid values for the rect members, they refer to the values of the "frame" rect (0, 0, frame.resolution.cx, frame.resolution.cy)
+ align: <align>;
+ pos: ["auto" | <point>]; // absolute values, pos.x or pos.y can be animated only when both the source and destination style defined it
+ offset: <point>; // relative to pos, unlike pos this can be applied to fragments of the text as an override
+ angle: <angle>; // origin of rotation is the alignment point, unless it is overriden
+ org: ["auto" | <point>]; // override for the origin
+ path: <string>; // a series of x y coord pairs (at least two points)
};
font
{
- face: <string>;
- size: <num>;
- weight: ["normal" | "bold" | "thin" | <num>];
- color: <color>;
- underline: <bool>;
- strikethrough: <bool>;
- italic: <bool>;
- spacing: <num>;
- scale: <size>;
- kerning: <bool>;
+ face: <string>;
+ size: <num>;
+ weight: ["normal" | "bold" | "thin" | <num>];
+ color: <color>;
+ underline: <bool>;
+ strikethrough: <bool>;
+ italic: <bool>;
+ spacing: <num>;
+ scale: <size>;
+ kerning: <bool>;
};
background
{
- color: <color>;
- size: <num>;
- type: ["outline" | "enlarge" | "box"];
- blur: <num>; // number of passes
+ color: <color>;
+ size: <num>;
+ type: ["outline" | "enlarge" | "box"];
+ blur: <num>; // number of passes
- // "enlarge" can be computed faster, but because it follows the path of the original outline it is
- // not rounded and size > 1 can make it look pretty bad if it intersects with itself.
+ // "enlarge" can be computed faster, but because it follows the path of the original outline it is
+ // not rounded and size > 1 can make it look pretty bad if it intersects with itself.
};
shadow
{
- color: <color>;
- depth: <num>;
- angle: <degrees>;
- blur: <num>; // number of passes
+ color: <color>;
+ depth: <num>;
+ angle: <degrees>;
+ blur: <num>; // number of passes
};
fill
{
- color: <color>;
- width: <percent>;
-
- // It cannot be applied to the same text multiple times as an override.
- //
- // #k1 {fill.width:1; time {start: +0; stop: +1s;}};
- // #k2 {fill.width:1; time {start: 0; stop: 2s;}};
- //
- // OK:
- // [k1] {Hello}
- //
- // BAD:
- // [k1] {Wo[k2]{r}ld!}
- //
+ color: <color>;
+ width: <percent>;
+
+ // It cannot be applied to the same text multiple times as an override.
+ //
+ // #k1 {fill.width:1; time {start: +0; stop: +1s;}};
+ // #k2 {fill.width:1; time {start: 0; stop: 2s;}};
+ //
+ // OK:
+ // [k1] {Hello}
+ //
+ // BAD:
+ // [k1] {Wo[k2]{r}ld!}
+ //
};
time
{
- id: [<string> | <num>];
- start: <time>; // inclusive
- stop: <time>; // exclusive
- scale: <num>; // if the time was set WITHOUT a unit, then start and stop are measured in [scale * seconds]
+ id: [<string> | <num>];
+ start: <time>; // inclusive
+ stop: <time>; // exclusive
+ scale: <num>; // if the time was set WITHOUT a unit, then start and stop are measured in [scale * seconds]
};
style
{
- linebreak: ["word" | "char" | "none"]; // ignored if subtitle.wrap: "manual"
- placement: <placement>;
- font: <font>;
- background: <background>;
- shadow: <shadow>;
- fill: <fill>;
+ linebreak: ["word" | "char" | "none"]; // ignored if subtitle.wrap: "manual"
+ placement: <placement>;
+ font: <font>;
+ background: <background>;
+ shadow: <shadow>;
+ fill: <fill>;
};
animation
{
- time: <time>; // before start: previous style, after stop: this style, animation is done between start and stop according to transition
- transition: ["linear" | "start" | "stop" | <num>]; // <num> is the same as the acceleration parameter of advanced ssa (see the "ass-specs"), "start" or "stop" sets num to 0 and inf, "linear" sets it to 1.0
- loop: <num>; // the number of times the effect should repeat, e.g. loop set to 2 makes the style turn from src to dst twice, between start => (start+stop)/2 and (start+stop)/2 => stop
- direction: ["fw" | "bw" | "fwbw" | "bwfw"]; // "bwfw" and "fwbw" makes the value of loop multiplied by two internally
+ time: <time>; // before start: previous style, after stop: this style, animation is done between start and stop according to transition
+ transition: ["linear" | "start" | "stop" | <num>]; // <num> is the same as the acceleration parameter of advanced ssa (see the "ass-specs"), "start" or "stop" sets num to 0 and inf, "linear" sets it to 1.0
+ loop: <num>; // the number of times the effect should repeat, e.g. loop set to 2 makes the style turn from src to dst twice, between start => (start+stop)/2 and (start+stop)/2 => stop
+ direction: ["fw" | "bw" | "fwbw" | "bwfw"]; // "bwfw" and "fwbw" makes the value of loop multiplied by two internally
};
subtitle
{
- frame: <frame>;
- direction: <direction>;
- wrap: ["normal" | "even" | "manual"];
- layer: <num>;
- time: <time>;
- style: <style>;
- @: {... dialog lines ...};
-
- To have a subtitle displayed the minimal set of fields required are:
- - time.start
- - time.stop
- - @
-
- About dialog lines
- ------------------
-
- All white-space will be compressed into one space character.
-
- Special characters can be enforced:
- - new-line: \n
- - non-breaking space: \h
-
- Empty space will be completly removed at these places:
- - before and after outermost text block brackets:
- @ { --> here <-- Hello World! --> here <-- }
- - between the inner closing and opening brackets of overrides:
- [s1] --> here <-- {Hello World!}
- - around forced new-lines:
- Hello --> here <-- \n --> here <-- World!
-
- When neighboring spaces have different styles, the style of the trailing space is used:
- #u {font.underline: "true"};
- #s {font.strikethrough: "true"};
- [u] { Hello }
- [s] { World! }
- =>
- Hello_World!-
- ______-------
-
- These special characters have to be escaped with a backslash:
- { } [ ] \
-
- Style overrides
- ---------------
-
- [refs] {... more dialog text ...}
-
- "name" as in type#name ... is unimportant and ignored.
-
- If there is a text block right after an override, the new style will be used only inside
- that block.
-
- Style and time offsets are restored at the end of text blocks.
-
- Examples:
-
- [s1] {s1 applies only to this block.}
-
- [s2] s2 applies till the end of the container block.
-
- [s1 s2 {color: red;} s3] {Multiple styles are valid just like in a normal ref list}
-
- {
- Nesting text blocks. Some may have overrides, others may not.
-
- [s1]
- {
- Every text block will be trimmed and white-space compressed,
- so we can use the space freely to make it a bit more readable.
-
- {Yet another nested block}
- }
- }
-
- Animation:
-
- The override is style + animation mixed.
-
- [{time.stop: +00:00:01.000; transition: "linear"; font.size: 20;}]
- {
- Here the size of the font gradually becomes 20 after one second.
- }
-
- [{font.color: white;}]
- {
- [{time.stop: +00:00:10.000; font.color: black;}]
- {Text turns from white to black in the first 10 seconds}
-
- [a1]
- {This one does whatever a1 tells to do}
- }
-
- [{time.start: "start"; time.stop: "stop"; font.size: 20}]
- {
- This is a way to refer to the subtitle's own start and stop values.
-
- You can predefine it for easier use:
-
- #a1 {time.start: "start"; time.stop: "stop";};
- [a1 {font.size: 20}] {...}
- }
-
- Karaoke effect using animation:
-
- [{background.size: 0;}]
- {
- [{time.start: 0s; time.stop: +1s; background.size: 10;}]
- {Ka}
- [{time.start: 1s; time.stop: +1s; background.size: 10;}]
- {ra}
- [{time.start: 2s; time.stop: +1s; background.size: 10;}]
- {o}
- [{time.start: 3s; time.stop: +1s; background.size: 10;}]
- {ke!}
- }
-
- To simplify the above, we can predefine the common parameters:
-
- #s1 {background.size: 0;};
- #a1 {time.start: +0s; time.stop: +1s; background.size: 10;};
-
- [s1]
- {
- [a1]{Ka}[a1]{ra}[a1]{o}[a1 {font.color: red;}]{ke!}
-
- // That last piece has even turned into a red in the end :)
-
- // And to make sure s1 has not been red already, we could derive it
- // from "whitefont" (defined somewhere else as: #whitefont {font.color: white;};)
-
- [a1]{Ka}[a1]{ra}[a1]{o}[a1 whitefont {font.color: red;};}]{ke!}
- }
-
- When specifying multiple style references watch out for the start/stop values
- of time. Since they override eachother you should only set them once.
-
- #a2 {font.color.a: 0;};
- #a3 {placement.angle.x: 360;};
-
- [s1] [a1 a2 a3]{Ka}[a1 a2 a3]{ra}[a1 a2 a3]{o}[a1 a2 a3]{ke!}
-
- If you want to be even lazier:
-
- #a4: a1 a2 a3;
-
- [s1] [a4]{Ka}[a4]{ra}[a4]{o}[a4]{ke!}
-
- To avoid the times overriding eachother use either nested text blocks ...
-
- #a2 {time.start: +0.5s; time.stop: +1s; font.color.a: 0;};
- #a3 {time.start: +1s; time.stop: +1s; placement.angle.x: 360;};
-
- [s1] [a1]{[a2]{[a3]Ka}}[a1]{[a2]{[a3]ra}}[a1]{[a2]{[a3]o}}[a1]{[a2]{[a3]ke}}
-
- ... or a list of references were each has a different time.id ...
-
- #a1 {time {id: 1; start: +0s; stop: +1s;}; background.size: 10;};
- #a2 {time {id: 2; start: +0.5s; stop: +1s;}; font.color.a: 0;};
- #a3 {time {id: 3; start: +1s; stop: +1s;}; placement.angle.x: 360;};
-
- [s1] [a1,a2,a3]{Ka}[a1,a2,a3]{ra}[a1,a2,a3]{o}[a1,a2,a3]{ke!}
-
- ... or just let it auto-number the ids, each timer id becomes the actual position
- in the comma separated list (a1 id => 1, a2 id => 2, a3 id => 3).
-
- #a1 {time {start: +0s; stop: +1s;}; background.size: 10;};
- #a2 {time {start: +0.5s; stop: +1s;}; font.color.a: 0;};
- #a3 {time {start: +1s; stop: +1s;}; placement.angle.x: 360;};
-
- [s1] [a1,a2,a3]{Ka}[a1,a2,a3]{ra}[a1,a2,a3]{o}[a1,a2,a3]{ke!}
-
- It is also possible to leave some of the ref list slots empty.
-
- [s1] [a1,a2,a3]{Ka}[,a2,a3]{ra}[a1,,a3]{o}[a1,a2,]{ke!}
-
- Text includes
- -------------
-
- Text blocks can also be defined outside subtitles and included later.
-
- #hw { @ {[{font.italic: "true"}]Hello World!}; };
- subtitle { @ {[hw]}; };
-
- When mixing style overrides and text includes, the new style applies to the text too.
-
- #hw { @ {Hello World!}; };
- subtitle { @ {[hw {font.italic: "true"}]}; };
-
- Multiple levels of recursion:
-
- #dblspace { @ {[{font.scale.cx: 2;}] }; }; // note: there is still only one space character here because of white space compression
- #hw { @ {Hello[dblspace]World!}; };
- subtitle { @ {[hw]}; };
+ frame: <frame>;
+ direction: <direction>;
+ wrap: ["normal" | "even" | "manual"];
+ layer: <num>;
+ time: <time>;
+ style: <style>;
+ @: {... dialog lines ...};
+
+ To have a subtitle displayed the minimal set of fields required are:
+ - time.start
+ - time.stop
+ - @
+
+ About dialog lines
+ ------------------
+
+ All white-space will be compressed into one space character.
+
+ Special characters can be enforced:
+ - new-line: \n
+ - non-breaking space: \h
+
+ Empty space will be completly removed at these places:
+ - before and after outermost text block brackets:
+ @ { --> here <-- Hello World! --> here <-- }
+ - between the inner closing and opening brackets of overrides:
+ [s1] --> here <-- {Hello World!}
+ - around forced new-lines:
+ Hello --> here <-- \n --> here <-- World!
+
+ When neighboring spaces have different styles, the style of the trailing space is used:
+ #u {font.underline: "true"};
+ #s {font.strikethrough: "true"};
+ [u] { Hello }
+ [s] { World! }
+ =>
+ Hello_World!-
+ ______-------
+
+ These special characters have to be escaped with a backslash:
+ { } [ ] \
+
+ Style overrides
+ ---------------
+
+ [refs] {... more dialog text ...}
+
+ "name" as in type#name ... is unimportant and ignored.
+
+ If there is a text block right after an override, the new style will be used only inside
+ that block.
+
+ Style and time offsets are restored at the end of text blocks.
+
+ Examples:
+
+ [s1] {s1 applies only to this block.}
+
+ [s2] s2 applies till the end of the container block.
+
+ [s1 s2 {color: red;} s3] {Multiple styles are valid just like in a normal ref list}
+
+ {
+ Nesting text blocks. Some may have overrides, others may not.
+
+ [s1]
+ {
+ Every text block will be trimmed and white-space compressed,
+ so we can use the space freely to make it a bit more readable.
+
+ {Yet another nested block}
+ }
+ }
+
+ Animation:
+
+ The override is style + animation mixed.
+
+ [{time.stop: +00:00:01.000; transition: "linear"; font.size: 20;}]
+ {
+ Here the size of the font gradually becomes 20 after one second.
+ }
+
+ [{font.color: white;}]
+ {
+ [{time.stop: +00:00:10.000; font.color: black;}]
+ {Text turns from white to black in the first 10 seconds}
+
+ [a1]
+ {This one does whatever a1 tells to do}
+ }
+
+ [{time.start: "start"; time.stop: "stop"; font.size: 20}]
+ {
+ This is a way to refer to the subtitle's own start and stop values.
+
+ You can predefine it for easier use:
+
+ #a1 {time.start: "start"; time.stop: "stop";};
+ [a1 {font.size: 20}] {...}
+ }
+
+ Karaoke effect using animation:
+
+ [{background.size: 0;}]
+ {
+ [{time.start: 0s; time.stop: +1s; background.size: 10;}]
+ {Ka}
+ [{time.start: 1s; time.stop: +1s; background.size: 10;}]
+ {ra}
+ [{time.start: 2s; time.stop: +1s; background.size: 10;}]
+ {o}
+ [{time.start: 3s; time.stop: +1s; background.size: 10;}]
+ {ke!}
+ }
+
+ To simplify the above, we can predefine the common parameters:
+
+ #s1 {background.size: 0;};
+ #a1 {time.start: +0s; time.stop: +1s; background.size: 10;};
+
+ [s1]
+ {
+ [a1]{Ka}[a1]{ra}[a1]{o}[a1 {font.color: red;}]{ke!}
+
+ // That last piece has even turned into a red in the end :)
+
+ // And to make sure s1 has not been red already, we could derive it
+ // from "whitefont" (defined somewhere else as: #whitefont {font.color: white;};)
+
+ [a1]{Ka}[a1]{ra}[a1]{o}[a1 whitefont {font.color: red;};}]{ke!}
+ }
+
+ When specifying multiple style references watch out for the start/stop values
+ of time. Since they override eachother you should only set them once.
+
+ #a2 {font.color.a: 0;};
+ #a3 {placement.angle.x: 360;};
+
+ [s1] [a1 a2 a3]{Ka}[a1 a2 a3]{ra}[a1 a2 a3]{o}[a1 a2 a3]{ke!}
+
+ If you want to be even lazier:
+
+ #a4: a1 a2 a3;
+
+ [s1] [a4]{Ka}[a4]{ra}[a4]{o}[a4]{ke!}
+
+ To avoid the times overriding eachother use either nested text blocks ...
+
+ #a2 {time.start: +0.5s; time.stop: +1s; font.color.a: 0;};
+ #a3 {time.start: +1s; time.stop: +1s; placement.angle.x: 360;};
+
+ [s1] [a1]{[a2]{[a3]Ka}}[a1]{[a2]{[a3]ra}}[a1]{[a2]{[a3]o}}[a1]{[a2]{[a3]ke}}
+
+ ... or a list of references were each has a different time.id ...
+
+ #a1 {time {id: 1; start: +0s; stop: +1s;}; background.size: 10;};
+ #a2 {time {id: 2; start: +0.5s; stop: +1s;}; font.color.a: 0;};
+ #a3 {time {id: 3; start: +1s; stop: +1s;}; placement.angle.x: 360;};
+
+ [s1] [a1,a2,a3]{Ka}[a1,a2,a3]{ra}[a1,a2,a3]{o}[a1,a2,a3]{ke!}
+
+ ... or just let it auto-number the ids, each timer id becomes the actual position
+ in the comma separated list (a1 id => 1, a2 id => 2, a3 id => 3).
+
+ #a1 {time {start: +0s; stop: +1s;}; background.size: 10;};
+ #a2 {time {start: +0.5s; stop: +1s;}; font.color.a: 0;};
+ #a3 {time {start: +1s; stop: +1s;}; placement.angle.x: 360;};
+
+ [s1] [a1,a2,a3]{Ka}[a1,a2,a3]{ra}[a1,a2,a3]{o}[a1,a2,a3]{ke!}
+
+ It is also possible to leave some of the ref list slots empty.
+
+ [s1] [a1,a2,a3]{Ka}[,a2,a3]{ra}[a1,,a3]{o}[a1,a2,]{ke!}
+
+ Text includes
+ -------------
+
+ Text blocks can also be defined outside subtitles and included later.
+
+ #hw { @ {[{font.italic: "true"}]Hello World!}; };
+ subtitle { @ {[hw]}; };
+
+ When mixing style overrides and text includes, the new style applies to the text too.
+
+ #hw { @ {Hello World!}; };
+ subtitle { @ {[hw {font.italic: "true"}]}; };
+
+ Multiple levels of recursion:
+
+ #dblspace { @ {[{font.scale.cx: 2;}] }; }; // note: there is still only one space character here because of white space compression
+ #hw { @ {Hello[dblspace]World!}; };
+ subtitle { @ {[hw]}; };
};
Defaults and predefined names
@@ -481,7 +481,7 @@ These must be predefined by the application and always assumed to be there for s
color#white {a: 255; r: 255; g: 255; b: 255;};
color#black {a: 255; r: 0; g: 0; b: 0;};
-color#gray {a: 255; r: 128; g: 128; b: 128;};
+color#gray {a: 255; r: 128; g: 128; b: 128;};
color#red {a: 255; r: 255; g: 0; b: 0;};
color#green {a: 255; r: 0; g: 255; b: 0;};
color#blue {a: 255; r: 0; g: 0; b: 255;};
@@ -511,86 +511,86 @@ time#startstop {start: "start"; stop: "stop";};
subtitle#subtitle
{
- frame
- {
- reference: "video";
- resolution: {cx: 640; cy: 480;};
- };
-
- direction
- {
- primary: "right";
- secondary: "down";
- };
-
- wrap: "normal";
-
- layer: 0;
-
- style
- {
- linebreak: "word";
-
- placement
- {
- clip: "none";
- margin: {t: 0; r: 0; b: 0; l: 0;};
- align: bottomcenter;
- pos: "auto";
- offset: {x: 0; y: 0;};
- angle: {x: 0; y: 0; z: 0;};
- };
-
- font
- {
- face: "Arial";
- size: 20;
- weight: "bold";
- color: white;
- underline: "false";
- strikethrough: "false";
- italic: "false";
- spacing: 0;
- scale: {cx: 1; cy: 1;};
- kerning: "true";
- };
-
- background
- {
- color: black;
- size: 2;
- type: "outline";
- };
-
- shadow
- {
- color: black {a: 128;};
- depth: 2;
- angle: -45;
- blur: 0;
- };
-
- fill
- {
- color: yellow;
- width: 0;
- };
- };
+ frame
+ {
+ reference: "video";
+ resolution: {cx: 640; cy: 480;};
+ };
+
+ direction
+ {
+ primary: "right";
+ secondary: "down";
+ };
+
+ wrap: "normal";
+
+ layer: 0;
+
+ style
+ {
+ linebreak: "word";
+
+ placement
+ {
+ clip: "none";
+ margin: {t: 0; r: 0; b: 0; l: 0;};
+ align: bottomcenter;
+ pos: "auto";
+ offset: {x: 0; y: 0;};
+ angle: {x: 0; y: 0; z: 0;};
+ };
+
+ font
+ {
+ face: "Arial";
+ size: 20;
+ weight: "bold";
+ color: white;
+ underline: "false";
+ strikethrough: "false";
+ italic: "false";
+ spacing: 0;
+ scale: {cx: 1; cy: 1;};
+ kerning: "true";
+ };
+
+ background
+ {
+ color: black;
+ size: 2;
+ type: "outline";
+ };
+
+ shadow
+ {
+ color: black {a: 128;};
+ depth: 2;
+ angle: -45;
+ blur: 0;
+ };
+
+ fill
+ {
+ color: yellow;
+ width: 0;
+ };
+ };
};
Streaming
---------
-Correct packetization is important when a subtitle file has to be embeded into a media
-file. Putting everything into the header would be trivial, but sending the whole track
-data ahead cannot be called streaming really, and it also makes editing impossible
-unless the application learns how to parse and resave our format.
+Correct packetization is important when a subtitle file has to be embeded into a media
+file. Putting everything into the header would be trivial, but sending the whole track
+data ahead cannot be called streaming really, and it also makes editing impossible
+unless the application learns how to parse and resave our format.
The recommended way of segmenting ssf into media samples:
-- Search top level definitions which do not satisfy the requirements of a displayable
-subtitle (one of start/stop/@ is absent) and save them into the file header of the media
+- Search top level definitions which do not satisfy the requirements of a displayable
+subtitle (one of start/stop/@ is absent) and save them into the file header of the media
file as the initializer data for playback.
-- Multiplex the rest of the top level definitions as media samples, their timestamps
+- Multiplex the rest of the top level definitions as media samples, their timestamps
shall be used for interleaving with other streams.
Example:
diff --git a/src/Subtitles/libssf/stdafx.h b/src/Subtitles/libssf/stdafx.h
index 40d219e40..cac35c39c 100644
--- a/src/Subtitles/libssf/stdafx.h
+++ b/src/Subtitles/libssf/stdafx.h
@@ -23,18 +23,6 @@
#include "../../DSUtil/SharedInclude.h"
-#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP or later.
-#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to target other versions of Windows.
-#endif
-
-#ifndef _WIN32_WINDOWS // Allow use of features specific to Windows 98 or later.
-#define _WIN32_WINDOWS 0x0410 // Change this to the appropriate value to target Windows Me or later.
-#endif
-
-#ifndef _WIN32_IE // Allow use of features specific to IE 6.0 or later.
-#define _WIN32_IE 0x0600 // Change this to the appropriate value to target other versions of IE.
-#endif
-
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
@@ -46,8 +34,6 @@
#include <afxwin.h> // MFC core and standard components
#include <atlcoll.h> // MFC core and standard components
-
-
#include <streams.h>
#include "../../DSUtil/DSUtil.h"
#include "../../DSUtil/vd.h"