Merging the SubLib project with Gnome Subtitles
[gn-sub.git] / src / SubLib / IO / SubtitleFormats / SubtitleFormatSubCreator1x.cs
blob33441034aac7abaf3240b26ede1b937c173ff9dd
1 /*
2 * This file is part of SubLib.
3 * Copyright (C) 2007-2008 Pedro Castro
5 * SubLib is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * SubLib is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 using SubLib.Core.Domain;
21 using System;
22 using System.Text.RegularExpressions;
24 namespace SubLib.IO.SubtitleFormats {
26 internal class SubtitleFormatSubCreator1x : SubtitleFormat {
28 internal SubtitleFormatSubCreator1x () {
29 name = "SubCreator 1.x";
30 type = SubtitleType.SubCreator1x;
31 mode = SubtitleMode.Times;
32 extensions = new string[] { "txt" };
33 lineBreak = "|";
35 format = @"\d+:\d+:\d+.\d:\s*.+\s+\d+:\d+:\d+.\d:";
37 subtitleIn = @"(?<StartHours>\d+):(?<StartMinutes>\d+):(?<StartSeconds>\d+).(?<StartDeciseconds>\d+):\s*(?<Text>.+)\s+(?<EndHours>\d+):(?<EndMinutes>\d+):(?<EndSeconds>\d+).(?<EndDeciseconds>\d+)";
39 subtitleOut = "<<StartHours>>:<<StartMinutes>>:<<StartSeconds>>.<<StartDeciseconds>>:" +
40 "<<Text>>\n<<EndHours>>:<<EndMinutes>>:<<EndSeconds>>.<<EndDeciseconds>>:\n";