<Compile Include="Interop\Json\Presets\PresetCategory.cs" />\r
<Compile Include="Interop\Json\Presets\PresetTransportContainer.cs" />\r
<Compile Include="Interop\Json\Queue\Task.cs" />\r
+ <Compile Include="Interop\Json\Scan\AudioAttributes.cs" />\r
+ <Compile Include="Interop\Json\Scan\SubtitleAttributes.cs" />\r
<Compile Include="Interop\Json\Shared\PAR.cs" />\r
<Compile Include="Interop\Json\Encode\Audio.cs" />\r
<Compile Include="Interop\Json\Encode\AudioTrack.cs" />\r
<Compile Include="Interop\Json\Encode\SubtitleTrack.cs" />\r
<Compile Include="Interop\Json\Encode\Video.cs" />\r
<Compile Include="Interop\Factories\AnamorphicFactory.cs" />\r
+ <Compile Include="Interop\Json\State\TaskState.cs" />\r
<Compile Include="Interop\Model\Encoding\CombDetect.cs" />\r
<Compile Include="Interop\Model\Encoding\DeinterlaceFilter.cs" />\r
<Compile Include="Interop\Model\Encoding\HBPresetTune.cs" />\r
state = JsonConvert.DeserializeObject<JsonState>(statusJson);\r
}\r
\r
- if (state != null && (state.State == NativeConstants.HB_STATE_SCANNING || state.State == NativeConstants.HB_STATE_SEARCHING))\r
+ TaskState taskState = state != null ? TaskState.FromRepositoryValue(state.State) : null;\r
+\r
+ if (taskState != null && (taskState == TaskState.Scanning || taskState == TaskState.Searching))\r
{\r
if (this.ScanProgress != null && state.Scanning != null)\r
{\r
this.ScanProgress(this, new ScanProgressEventArgs(state.Scanning.Progress, state.Scanning.Preview, state.Scanning.PreviewCount, state.Scanning.Title, state.Scanning.TitleCount));\r
}\r
}\r
- else if (state != null && state.State == NativeConstants.HB_STATE_SCANDONE)\r
+ else if (taskState != null && taskState == TaskState.ScanDone)\r
{\r
this.scanPollTimer.Stop();\r
\r
\r
JsonState state = JsonConvert.DeserializeObject<JsonState>(statusJson);\r
\r
- if (state != null && (state.State == NativeConstants.HB_STATE_WORKING || state.State == NativeConstants.HB_STATE_MUXING || state.State == NativeConstants.HB_STATE_SEARCHING))\r
+ TaskState taskState = state != null ? TaskState.FromRepositoryValue(state.State) : null;\r
+\r
+ if (taskState != null && (taskState == TaskState.Working || taskState == TaskState.Muxing || taskState == TaskState.Searching))\r
{\r
if (this.EncodeProgress != null)\r
{\r
var progressEventArgs = new EncodeProgressEventArgs(state.Working.Progress, state.Working.Rate, state.Working.RateAvg, new TimeSpan(state.Working.Hours, state.Working.Minutes, state.Working.Seconds),\r
- state.Working.PassID, state.Working.Pass, state.Working.PassCount, state.State == NativeConstants.HB_STATE_MUXING, state.State == NativeConstants.HB_STATE_SEARCHING);\r
+ state.Working.PassID, state.Working.Pass, state.Working.PassCount, taskState == TaskState.Muxing, taskState == TaskState.Searching);\r
\r
this.EncodeProgress(this, progressEventArgs);\r
}\r
}\r
- else if (state != null && state.State == NativeConstants.HB_STATE_WORKDONE)\r
+ else if (taskState != null && taskState == TaskState.WorkDone)\r
{\r
this.encodePollTimer.Stop();\r
\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioAttributes.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The color.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ public class AudioAttributes
+ {
+ public bool AltCommentary { get; set; }
+ public bool Commentary { get; set; }
+ public bool Default { get; set; }
+ public bool Normal { get; set; }
+ public bool Secondary { get; set; }
+ public bool VisuallyImpaired { get; set; }
+ }
+}
/// <summary>\r
/// Gets or sets the channel layout.\r
/// </summary>\r
- public long ChannelLayout { get; set; }\r
+ public int ChannelLayout { get; set; }\r
\r
/// <summary>\r
/// Gets or sets the description.\r
/// Gets or sets the codec.\r
/// </summary>\r
public int Codec { get; set; }\r
+\r
+ public string CodecName { get; set; }\r
+\r
+ public long LFECount { get; set; }\r
+\r
+ public string ChannelLayoutName { get; set; }\r
+\r
+ public int ChannelCount { get; set; }\r
+\r
+ public AudioAttributes Attributes { get; set; }\r
}\r
}
\ No newline at end of file
// <summary>\r
// The a chapter from a video source.\r
// </summary>\r
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrake.ApplicationServices.Interop.Json.Scan
-{
- /// <summary>
- /// The a chapter from a video source.
- /// </summary>
- public class SourceChapter
- {
- /// <summary>
- /// Gets or sets the duration.
- /// </summary>
- public Duration Duration { get; set; }
-
- /// <summary>
- /// Gets or sets the name.
- /// </summary>
- public string Name { get; set; }
- }
+// --------------------------------------------------------------------------------------------------------------------\r
+\r
+namespace HandBrake.ApplicationServices.Interop.Json.Scan\r
+{\r
+ /// <summary>\r
+ /// The a chapter from a video source.\r
+ /// </summary>\r
+ public class SourceChapter\r
+ {\r
+ /// <summary>\r
+ /// Gets or sets the duration.\r
+ /// </summary>\r
+ public Duration Duration { get; set; }\r
+\r
+ /// <summary>\r
+ /// Gets or sets the name.\r
+ /// </summary>\r
+ public string Name { get; set; }\r
+ }\r
}
\ No newline at end of file
/// </summary>
public class SourceMetadata
{
- public string Artist { get; set; }
- public string Description { get; set; }
- public string Genre { get; set; }
- public string LongDescription { get; set; }
- public string Name { get; set; }
- public string ReleaseDate { get; set; }
- public string Composer { get; set; }
- public string AlbumArtist { get; set; }
- public string Comment { get; set; }
}
}
\ No newline at end of file
/// <summary>
/// Gets or sets the format.
/// </summary>
- public int Format { get; set; }
+ public string Format { get; set; }
/// <summary>
/// Gets or sets the language.
/// Gets or sets the source.
/// </summary>
public int Source { get; set; }
+
+ public string SourceName { get; set; }
+
+ /// <summary>
+ /// Gets or sets subtitle attribute information.
+ /// </summary>
+ public SubtitleAttributes Attributes { get; set; }
}
}
\ No newline at end of file
/// </summary>\r
public Color Color { get; set; }\r
\r
+ /// <summary>\r
+ /// Gets or sets the input file container.\r
+ /// </summary>\r
+ public string Container { get; set; }\r
+\r
/// <summary>\r
/// Gets or sets the cropping values\r
/// </summary>\r
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitleAttributes.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The color.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.Scan
+{
+ using Newtonsoft.Json;
+
+ public class SubtitleAttributes
+ {
+ [JsonProperty(PropertyName = "4By3")]
+ public bool FourByThree { get; set; }
+ public bool Children { get; set; }
+ public bool ClosedCaption { get; set; }
+ public bool Commentary { get; set; }
+ public bool Default { get; set; }
+ public bool Forced { get; set; }
+ public bool Large { get; set; }
+ public bool Letterbox { get; set; }
+ public bool Normal { get; set; }
+ public bool PanScan { get; set; }
+ public bool Wide { get; set; }
+ }
+}
/// <summary>\r
/// Gets or sets the state.\r
/// </summary>\r
- public int State { get; set; }\r
+ public string State { get; set; }\r
}\r
}
\ No newline at end of file
--- /dev/null
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="TaskState.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The status of the current task being processed.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrake.ApplicationServices.Interop.Json.State
+{
+ using System.Collections.Generic;
+
+ public class TaskState
+ {
+ public static TaskState Idle = new TaskState("IDLE");
+ public static TaskState Scanning = new TaskState("SCANNING");
+ public static TaskState ScanDone = new TaskState("SCANDONE");
+ public static TaskState Working = new TaskState("WORKING");
+ public static TaskState Paused = new TaskState("PAUSED");
+ public static TaskState Searching = new TaskState("SEARCHING");
+ public static TaskState WorkDone = new TaskState("WORKDONE");
+ public static TaskState Muxing = new TaskState("MUXING");
+ public static TaskState Unknown = new TaskState("UNKNOWN");
+
+ private static readonly Dictionary<string, TaskState> taskStates = new Dictionary<string, TaskState>();
+
+ static TaskState()
+ {
+ taskStates.Add("IDLE", Idle);
+ taskStates.Add("SCANNING", Scanning);
+ taskStates.Add("SCANDONE", ScanDone);
+ taskStates.Add("WORKING", Working);
+ taskStates.Add("PAUSED", Paused);
+ taskStates.Add("SEARCHING", Searching);
+ taskStates.Add("WORKDONE", WorkDone);
+ taskStates.Add("MUXING", Muxing);
+ taskStates.Add("UNKNOWN", Unknown);
+ }
+
+ public TaskState(string code)
+ {
+ this.Code = code;
+ }
+
+ public string Code { get; }
+
+ public static TaskState FromRepositoryValue(string code)
+ {
+ TaskState state = null;
+ if (taskStates.TryGetValue(code, out state))
+ {
+ return state;
+ }
+
+ return null;
+ }
+ }
+}