Цитата
2/There's no limitation in the number of characters.
So, I've written this script which fills all your empty subs with the maximum number of characters you're allowed to use. It's based on a 18 characters/sec limit with 0,72 sec minimum length and 5 sec as maximum length. 2 lines max with 37 characters each for the longest subs. But of course you can change the values.
// Fill empty subtitles with maximum number of characters. Made by Malmoth 2007.03.22. Debugged by Tengo. program FillEmptyLines; // ----------------------------------------------------------------------------- var n: Integer; i: Integer; j: Integer; t: String; begin n := GetSubtitleCount; for i := 0 to n - 1 do begin j := GetSubtitleFinalTime(i)-GetSubtitleInitialTime(i); if j <= 719 then t:='too short' else if ((j >= 720) and (j <= 749)) then t:='13 characters' else if ((j >= 750) and (j <= 805)) then t:='14 characters' else if ((j >= 806) and (j <= 861)) then t:='15 characters' else if ((j >= 862) and (j <= 916)) then t:='16 characters' else if ((j >= 917) and (j <= 972)) then t:='17 characters' else if ((j >= 973) and (j <= 1027)) then t:='18 characters' else if ((j >= 1028) and (j <= 1083)) then t:='19 characters' else if ((j >= 1084) and (j <= 1138)) then t:='20 characters' else if ((j >= 1139) and (j <= 1194)) then t:='21 characters' else if ((j >= 1195) and (j <= 1249)) then t:='22 characters' else if ((j >= 1250) and (j <= 1305)) then t:='23 characters' else if ((j >= 1306) and (j <= 1361)) then t:='24 characters' else if ((j >= 1362) and (j <= 1416)) then t:='25 characters' else if ((j >= 1417) and (j <= 1472)) then t:='26 characters' else if ((j >= 1473) and (j <= 1527)) then t:='27 characters' else if ((j >= 1528) and (j <= 1583)) then t:='28 characters' else if ((j >= 1584) and (j <= 1638)) then t:='29 characters' else if ((j >= 1639) and (j <= 1694)) then t:='30 characters' else if ((j >= 1695) and (j <= 1749)) then t:='31 characters' else if ((j >= 1750) and (j <= 1805)) then t:='32 characters' else if ((j >= 1806) and (j <= 1861)) then t:='33 characters' else if ((j >= 1862) and (j <= 1916)) then t:='34 characters' else if ((j >= 1917) and (j <= 1972)) then t:='35 characters' else if ((j >= 1973) and (j <= 2027)) then t:='36 characters' else if ((j >= 2028) and (j <= 2083)) then t:='37 characters' else if ((j >= 2084) and (j <= 2138)) then t:='38 characters' else if ((j >= 2139) and (j <= 2194)) then t:='39 characters' else if ((j >= 2195) and (j <= 2249)) then t:='40 characters' else if ((j >= 2250) and (j <= 2305)) then t:='41 characters' else if ((j >= 2306) and (j <= 2361)) then t:='42 characters' else if ((j >= 2362) and (j <= 2416)) then t:='43 characters' else if ((j >= 2417) and (j <= 2472)) then t:='44 characters' else if ((j >= 2473) and (j <= 2527)) then t:='45 characters' else if ((j >= 2528) and (j <= 2583)) then t:='46 characters' else if ((j >= 2584) and (j <= 2638)) then t:='47 characters' else if ((j >= 2639) and (j <= 2694)) then t:='48 characters' else if ((j >= 2695) and (j <= 2749)) then t:='49 characters' else if ((j >= 2750) and (j <= 2805)) then t:='50 characters' else if ((j >= 2806) and (j <= 2861)) then t:='51 characters' else if ((j >= 2862) and (j <= 2916)) then t:='52 characters' else if ((j >= 2917) and (j <= 2972)) then t:='53 characters' else if ((j >= 2973) and (j <= 3027)) then t:='54 characters' else if ((j >= 3028) and (j <= 3083)) then t:='55 characters' else if ((j >= 3084) and (j <= 3138)) then t:='56 characters' else if ((j >= 3139) and (j <= 3194)) then t:='57 characters' else if ((j >= 3195) and (j <= 3249)) then t:='58 characters' else if ((j >= 3250) and (j <= 3305)) then t:='59 characters' else if ((j >= 3306) and (j <= 3361)) then t:='60 characters' else if ((j >= 3362) and (j <= 3416)) then t:='61 characters' else if ((j >= 3417) and (j <= 3472)) then t:='62 characters' else if ((j >= 3473) and (j <= 3527)) then t:='63 characters' else if ((j >= 3528) and (j <= 3583)) then t:='64 characters' else if ((j >= 3584) and (j <= 3638)) then t:='65 characters' else if ((j >= 3639) and (j <= 3694)) then t:='66 characters' else if ((j >= 3695) and (j <= 3749)) then t:='67 characters' else if ((j >= 3750) and (j <= 3805)) then t:='68 characters' else if ((j >= 3806) and (j <= 3861)) then t:='69 characters' else if ((j >= 3862) and (j <= 3916)) then t:='70 characters' else if ((j >= 3917) and (j <= 3972)) then t:='71 characters' else if ((j >= 3973) and (j <= 4027)) then t:='72 characters' else if ((j >= 4028) and (j <= 4083)) then t:='73 characters' else if ((j >= 4084) and (j <= 5000)) then t:='74 characters' else t:='too long'; if Length(GetSubtitleText(i)) < 1 then begin SetSubtitleText(i, t); end; end; end.
Что-то мне подсказывает, что длинную портянку if-ов можно свести к одной-двум несложным формулам.
