From 57493a2c65a6bbccc01a268dc0760555fd1e0178 Mon Sep 17 00:00:00 2001 From: sr55 Date: Mon, 7 Jun 2010 19:47:40 +0000 Subject: WinGui: - Make public settings in the parsing models. Remove some unneeded methods. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3368 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- .../Parsing/AudioTrack.cs | 63 ++--------- .../Parsing/Chapter.cs | 25 +---- .../Parsing/Subtitle.cs | 39 ++----- .../HandBrake.ApplicationServices/Parsing/Title.cs | 121 +++++---------------- 4 files changed, 48 insertions(+), 200 deletions(-) (limited to 'win/C#') diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs b/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs index 0272a96af..55cf524a5 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/AudioTrack.cs @@ -15,14 +15,14 @@ namespace HandBrake.ApplicationServices.Parsing public class AudioTrack { /// - /// Gets The track number of this Audio Track + /// Gets or sets The track number of this Audio Track /// - public int TrackNumber { get; private set; } + public int TrackNumber { get; set; } /// - /// Gets The language (if detected) of this Audio Track + /// Gets or sets The language (if detected) of this Audio Track /// - public string Language { get; private set; } + public string Language { get; set; } /// /// Gets or sets LanguageCode. @@ -35,62 +35,19 @@ namespace HandBrake.ApplicationServices.Parsing public string Description { get; set; } /// - /// Gets The primary format of this Audio Track + /// Gets or sets The primary format of this Audio Track /// - public string Format { get; private set; } + public string Format { get; set; } /// - /// Gets The frequency (in MHz) of this Audio Track + /// Gets or sets The frequency (in MHz) of this Audio Track /// - public int SampleRate { get; private set; } + public int SampleRate { get; set; } /// - /// Gets The bitrate (in kbps) of this Audio Track + /// Gets or sets The bitrate (in kbps) of this Audio Track /// - public int Bitrate { get; private set; } - - /// - /// Create a new Audio Track object - /// - /// - /// The track. - /// - /// - /// The lang. - /// - /// - /// The lang code. - /// - /// - /// The desc. - /// - /// - /// The format. - /// - /// - /// The samplerate. - /// - /// - /// The bitrate. - /// - /// - /// A new Audio Track - /// - public static AudioTrack CreateAudioTrack(int track, string lang, string langCode, string desc, string format, int samplerate, int bitrate) - { - AudioTrack newTrack = new AudioTrack - { - TrackNumber = track, - Language = lang, - LanguageCode = langCode, - Description = desc, - Format = format, - SampleRate = samplerate, - Bitrate = bitrate - }; - - return newTrack; - } + public int Bitrate { get; set; } /// /// Parse the CLI input to an Audio Track object diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs index b39f2baa4..0545dd1d5 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/Chapter.cs @@ -16,31 +16,14 @@ namespace HandBrake.ApplicationServices.Parsing public class Chapter { /// - /// Gets The number of this Chapter, in regards to it's parent Title + /// Gets or sets The number of this Chapter, in regards to it's parent Title /// - public int ChapterNumber { get; private set; } + public int ChapterNumber { get; set; } /// - /// Gets The length in time this Chapter spans + /// Gets or sets The length in time this Chapter spans /// - public TimeSpan Duration { get; private set; } - - /// - /// Create a chapter Object - /// - /// - /// The number. - /// - /// - /// The duration. - /// - /// - /// A new Chapter Object - /// - public static Chapter CreateChapterOjbect(int number, TimeSpan duration) - { - return new Chapter { ChapterNumber = number, Duration = duration }; - } + public TimeSpan Duration { get; set; } /// /// Parse a CLI string to a Chapter object diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs index 31ec350fa..f4cd65768 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/Subtitle.cs @@ -17,24 +17,24 @@ namespace HandBrake.ApplicationServices.Parsing public class Subtitle { /// - /// Gets the track number of this Subtitle + /// Gets or sets the track number of this Subtitle /// - public int TrackNumber { get; private set; } + public int TrackNumber { get; set; } /// - /// Gets the The language (if detected) of this Subtitle + /// Gets or sets the The language (if detected) of this Subtitle /// - public string Language { get; private set; } + public string Language { get; set; } /// - /// Gets the Langauage Code + /// Gets or sets the Langauage Code /// - public string LanguageCode { get; private set; } + public string LanguageCode { get; set; } /// - /// Gets the Subtitle Type + /// Gets or sets the Subtitle Type /// - public SubtitleType SubtitleType { get; private set; } + public SubtitleType SubtitleType { get; set; } /// /// Gets Subtitle Type @@ -47,29 +47,6 @@ namespace HandBrake.ApplicationServices.Parsing } } - /// - /// Create a new Subtitle Object - /// - /// - /// The track. - /// - /// - /// The lang. - /// - /// - /// The lang code. - /// - /// - /// The type. - /// - /// - /// A Subtitle Object - /// - public static Subtitle CreateSubtitleObject(int track, string lang, string langCode, SubtitleType type) - { - return new Subtitle { TrackNumber = track, Language = lang, LanguageCode = langCode, SubtitleType = type }; - } - /// /// Parse the input strings related to subtitles /// diff --git a/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs b/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs index 0e2d80f66..d402ac909 100644 --- a/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs +++ b/win/C#/HandBrake.ApplicationServices/Parsing/Title.cs @@ -37,146 +37,77 @@ namespace HandBrake.ApplicationServices.Parsing #region Properties /// - /// Gets a Collection of chapters in this Title + /// Gets or sets a Collection of chapters in this Title /// - public List Chapters { get; private set; } + public List Chapters { get; set; } /// - /// Gets a Collection of audio tracks associated with this Title + /// Gets or sets a Collection of audio tracks associated with this Title /// - public List AudioTracks { get; private set; } + public List AudioTracks { get; set; } /// - /// Gets aCollection of subtitles associated with this Title + /// Gets or sets a Collection of subtitles associated with this Title /// - public List Subtitles { get; private set; } + public List Subtitles { get; set; } /// - /// Gets The track number of this Title + /// Gets or sets The track number of this Title /// - public int TitleNumber { get; private set; } + public int TitleNumber { get; set; } /// - /// Gets the length in time of this Title + /// Gets or sets the length in time of this Title /// - public TimeSpan Duration { get; private set; } + public TimeSpan Duration { get; set; } /// - /// Gets the resolution (width/height) of this Title + /// Gets or sets the resolution (width/height) of this Title /// - public Size Resolution { get; private set; } + public Size Resolution { get; set; } /// - /// Gets the aspect ratio of this Title + /// Gets or sets the aspect ratio of this Title /// - public double AspectRatio { get; private set; } + public double AspectRatio { get; set; } /// - /// Gets AngleCount. + /// Gets or sets AngleCount. /// - public int AngleCount { get; private set; } + public int AngleCount { get; set; } /// - /// Gets Par Value + /// Gets or sets Par Value /// - public Size ParVal { get; private set; } + public Size ParVal { get; set; } /// - /// Gets the automatically detected crop region for this Title. + /// Gets or sets the automatically detected crop region for this Title. /// This is an int array with 4 items in it as so: /// 0: T /// 1: B /// 2: L /// 3: R /// - public Cropping AutoCropDimensions { get; private set; } + public Cropping AutoCropDimensions { get; set; } /// - /// Gets the FPS of the source. + /// Gets or sets the FPS of the source. /// - public double Fps { get; private set; } + public double Fps { get; set; } /// - /// Gets a value indicating whether this is a MainTitle. + /// Gets or sets a value indicating whether this is a MainTitle. /// - public bool MainTitle { get; private set; } + public bool MainTitle { get; set; } /// - /// Gets the Source Name + /// Gets or sets the Source Name /// - public string SourceName { get; private set; } + public string SourceName { get; set; } #endregion - /// - /// Creates a Title - /// - /// - /// The angles. - /// - /// - /// The aspect Ratio. - /// - /// - /// The audio Tracks. - /// - /// - /// The crop. - /// - /// - /// The chapters. - /// - /// - /// The duration. - /// - /// - /// The fps. - /// - /// - /// The main Title. - /// - /// - /// The par Val. - /// - /// - /// The resolution. - /// - /// - /// The source Name. - /// - /// - /// The subtitles. - /// - /// - /// The title Number. - /// - /// - /// A Title Object - /// - public static Title CreateTitle(int angles, double aspectRatio, List audioTracks, Cropping crop, List chapters, - TimeSpan duration, float fps, bool mainTitle, Size parVal, Size resolution, string sourceName, List subtitles, - int titleNumber) - { - Title title = new Title - { - AngleCount = angles, - AspectRatio = aspectRatio, - AudioTracks = audioTracks, - AutoCropDimensions = crop, - Chapters = chapters, - Duration = duration, - Fps = fps, - MainTitle = mainTitle, - ParVal = parVal, - Resolution = resolution, - SourceName = sourceName, - Subtitles = subtitles, - TitleNumber = titleNumber - }; - - return title; - } - /// /// Parse the Title Information /// -- cgit v1.2.3