2
* This file is part of SubLib.
3
* Copyright (C) 2005-2007 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
26
/// <summary>Represents the properties of subtitles.</summary>
27
/// <remarks>This class acts as a container which allows you to get and set a
28
/// variety of properties. Some of these properties are used in syncronization
29
/// and timing calculations.</remarks>
30
public class SubtitleProperties {
31
private Headers headers = new Headers();
33
private float originalFrameRate = 25;
34
private float currentFrameRate = 25;
37
public SubtitleProperties () {
40
public SubtitleProperties (Headers headers, float originalFrameRate, float currentFrameRate) {
41
this.headers = headers;
42
this.originalFrameRate = originalFrameRate;
43
this.currentFrameRate = currentFrameRate;
46
/// <summary>Initializes a new instance of the <see cref="SubtitleProperties" />
47
/// class, with defaults for all properties.</summary>
48
internal SubtitleProperties (ParsingProperties properties) {
49
headers = properties.Headers;
50
originalFrameRate = properties.OriginalFrameRate;
54
/// <summary>The headers used in some subtitle formats.</summary>
55
public Headers Headers {
56
get { return headers; }
59
/// <summary>The frame rate originally applied to the subtitles.</summary>
60
/// <remarks>When converting between frame rates, this is the frame rate of the subtitles
61
/// when they are opened. This is sometimes refered to as the input frame rate.</remarks>
62
public float OriginalFrameRate {
63
get { return originalFrameRate; }
66
/// <summary>The frame rate currently being used in the subtitles.</summary>
67
/// <remarks>When converting between frame rates, this is the target frame rate of the
68
/// subtitles. This is sometimes refered to as the output frame rate.</remarks>
69
public float CurrentFrameRate {
70
get { return currentFrameRate; }
73
public override string ToString () {
74
return "Original FPS = " + originalFrameRate + ", Current FPS = " + currentFrameRate + "\n" + headers.ToString();
77
/* Internal members */
79
internal void SetCurrentFrameRate (float frameRate) {
80
currentFrameRate = frameRate;
83
internal void SetOriginalFrameRate (float frameRate) {
84
originalFrameRate = frameRate;