Represents the frames of a subtitle.
Frames and Times always exist for any Subtitle. This class is automatically constructed when constructing a Subtitle.
示例#1
0
	/// <summary>Initializes a new instance of the <see cref="Subtitle" /> class, given the
	/// global subtitles' properties and the subtitle's text and style.</summary>
	/// <param name="properties">The subtitles' properties.</param>
	/// <param name="text">The subtitle's text.</param>
	/// <param name="style">The subtitle's style.</param>
	public Subtitle (SubtitleProperties properties, SubtitleText text, Style style) {
		this.properties = properties;
		this.text = text;
		this.style = style;

		times = new Times(this);
		frames = new Frames(this);
	}
示例#2
0
        /* Private methods */

        private void SetFieldsForDeepClone(SubtitleProperties properties, Times times, Frames frames, SubtitleText text, SubtitleText translation, Style style)
        {
            this.properties  = properties;
            this.times       = times;
            this.frames      = frames;
            this.text        = text;
            this.translation = translation;
            this.style       = style;
        }
示例#3
0
	/* Private methods */

	private void SetFieldsForDeepClone (SubtitleProperties properties, Times times, Frames frames, SubtitleText text, SubtitleText translation, Style style) {
		this.properties = properties;
		this.times = times;
		this.frames = frames;
		this.text = text;
		this.translation = translation;
		this.style = style;
	}
示例#4
0
	private void ParseFrames (Match match, Frames frames, Frames previousFrames) {
		int result = 0;
		if (ParseGroup(match, "StartFrame", ref result))
			frames.PreciseStart = result;
		else if (ParseGroup(match, "StartElapsedFrames", ref result)) {
			double lastFrames = (previousFrames == null ? 0 : previousFrames.PreciseEnd);
			frames.PreciseStart = lastFrames + result;
		}

		if (ParseGroup(match, "EndFrame", ref result))
			frames.PreciseEnd = result;
		else if (ParseGroup(match, "EndElapsedFrames", ref result)) {
			frames.PreciseDuration = result;
		}
	}