Pascal script to join duplicated subtitles?

Everything that does not match one of the other categories.
subworkshopfan
Posts: 2
Joined: Wed Jun 29, 2016 3:13 pm

Pascal script to join duplicated subtitles?

Postby subworkshopfan » Wed Jun 29, 2016 3:26 pm

Hi! I'm looking for a Pascal script to joined duplicated subtitles.
I have zero knowledge of programming language, otherwise I would do it myself... :oops:

The idea is to keep the initial time and the text of the first subtitle with the final time of the second subtitle, joining both subtitles into a single one.

Pretty much like this example:
202
00:06:13,031 --> 00:06:14,378
And just because that say
"Property of Men," that doesn't mean


203
00:06:14,378 --> 00:06:14,668
And just because that say
"Property of Men," that doesn't mean


Into this:
202
00:06:13,031 --> 00:06:14,668
And just because that say
"Property of Men," that doesn't mean


Can anyone please help me with my request?
Thanks in advance!

Greetings from Paysandú, Uruguay.

===============================

Hola! Estoy buscando un script Pascal que me permita unir subtítulos duplicados o dobles.
No tengo conocimientos de lenguaje de programación, de otro modo lo haría yo mismo... :oops:

La idea es conservar el texto y el tiempo inicial del primer subtítulo, y el tiempo final del segundo subtítulo, uniéndolos en un único subtítulo.

¿Podría alguien ayudarme con esto, por favor?
Desde ya, ¡muchas gracias!


Saludos desde Paysandú, Uruguay.

User avatar
URUWorks
Site Admin
Posts: 58
Joined: Tue Jun 23, 2015 5:31 pm
Location: Uruguay
Contact:

Re: Pascal script to join duplicated subtitles?

Postby URUWorks » Thu Jun 30, 2016 10:59 am

Claro, el código seria algo así:

Code: Select all

// -------------------------------------------------------------------------- //
//          Subtitle Workshop - join duplicated subtitles extension           //
//                          Copyright © 2016 URUWorks                         //
//                             http://uruworks.net                            //
//                                                                            //
//  The idea is to keep the initial time and the text of the first subtitle   //
//  with the final time of the second subtitle, joining both subtitles into   //
//  a single one.                                                             //
//                                                                            //
// -------------------------------------------------------------------------- //

program JoinDuplicatedSubtitles;

// -----------------------------------------------------------------------------

var
  i, p, c : Integer;
begin
  c := GetSubtitleCount;
  if not c > 1 then Exit;

  i := c-1;
  while i > 0 do
  begin
    p := i-1;
    if GetSubtitleText(i) = GetSubtitleText(p) then
    begin   
      SetSubtitleFinalTime(p, GetSubtitleFinalTime(i));
      DeleteSubtitle(i);
    end;
    i := p;
  end;
end.

// -----------------------------------------------------------------------------

end.
Atentamente,

Aldo M. Lacavalla
Dir. de desarrollo y nuevas tecnologías
URUWorks - 100% Software Uruguayo!

subworkshopfan
Posts: 2
Joined: Wed Jun 29, 2016 3:13 pm

Re: Pascal script to join duplicated subtitles?

Postby subworkshopfan » Thu Jun 30, 2016 11:17 am

¡Fantástico, Aldo!

Muchas gracias. :D

laet74
Posts: 2
Joined: Tue May 09, 2017 8:16 am

Re: Pascal script to join duplicated subtitles?

Postby laet74 » Tue May 09, 2017 8:17 am

Thanks for this reply


Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests