Permalink
Browse files

Updated media file and job states with those explicitly listed in the…

… API docs. Required a separation of InputMediaFile from OutputMediaFile.
  • Loading branch information...
ChadBurggraf committed Feb 18, 2011
1 parent 719438d commit dfb8ad4f9a4bb89e3c8aa76af8518b3b3612610d
View
@@ -17,5 +17,5 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: CLSCompliant(true)]
-[assembly: AssemblyVersion("1.0.1.0")]
-[assembly: AssemblyFileVersion("1.0.1.0")]
+[assembly: AssemblyVersion("1.0.2.0")]
+[assembly: AssemblyFileVersion("1.0.2.0")]
@@ -0,0 +1,25 @@
+//-----------------------------------------------------------------------
+// <copyright file="InputMediaFile.cs" company="Tasty Codes">
+// Copyright (c) 2010 Chad Burggraf.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace Zencoder
+{
+ using System;
+ using Newtonsoft.Json;
+ using Newtonsoft.Json.Converters;
+
+ /// <summary>
+ /// Represents a single input media file in a <see cref="Job"/>.
+ /// </summary>
+ [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
+ public class InputMediaFile : MediaFile
+ {
+ /// <summary>
+ /// Gets or sets the file's state with respect to its parent job.
+ /// </summary>
+ [JsonProperty("state")]
+ public InputState State { get; set; }
+ }
+}
@@ -0,0 +1,53 @@
+//-----------------------------------------------------------------------
+// <copyright file="InputState.cs" company="Tasty Codes">
+// Copyright (c) 2010 Chad Burggraf.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace Zencoder
+{
+ using System;
+ using Newtonsoft.Json;
+
+ /// <summary>
+ /// Defines the possible <see cref="InputMediaFile"/> states.
+ /// </summary>
+ [JsonConverter(typeof(EnumLowercaseUnderscoreJsonConverter))]
+ public enum InputState
+ {
+ /// <summary>
+ /// Identifies that an unkown input state was received from the service.
+ /// </summary>
+ Unknown = 0,
+
+ /// <summary>
+ /// Identifies that the job the input belongs to has been cancelled.
+ /// </summary>
+ Cancelled,
+
+ /// <summary>
+ /// Identifies that the input failed to complete.
+ /// </summary>
+ Failed,
+
+ /// <summary>
+ /// Identifies that the input is finished.
+ /// </summary>
+ Finished,
+
+ /// <summary>
+ /// Identifies that the input is pending.
+ /// </summary>
+ Pending,
+
+ /// <summary>
+ /// Identifies that the input is processing.
+ /// </summary>
+ Processing,
+
+ /// <summary>
+ /// Identifies that the input is waiting to be queued.
+ /// </summary>
+ Waiting
+ }
+}
View
@@ -16,7 +16,7 @@ namespace Zencoder
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
public class Job
{
- private MediaFile[] outputMediaFiles;
+ private OutputMediaFile[] outputMediaFiles;
/// <summary>
/// Gets or sets the date the job was created.
@@ -42,15 +42,15 @@ public class Job
/// Gets or sets the job's input media file.
/// </summary>
[JsonProperty("input_media_file")]
- public MediaFile InputMediaFile { get; set; }
+ public InputMediaFile InputMediaFile { get; set; }
/// <summary>
/// Gets or sets the job's output media files.
/// </summary>
[JsonProperty("output_media_files")]
- public MediaFile[] OutputMediaFiles
+ public OutputMediaFile[] OutputMediaFiles
{
- get { return this.outputMediaFiles ?? (this.outputMediaFiles = new MediaFile[0]); }
+ get { return this.outputMediaFiles ?? (this.outputMediaFiles = new OutputMediaFile[0]); }
set { this.outputMediaFiles = value; }
}
@@ -20,11 +20,6 @@ public enum JobState
/// </summary>
Unknown = 0,
- /// <summary>
- /// Identifies that the job is being assigned.
- /// </summary>
- Assigning,
-
/// <summary>
/// Identifies that the job has been cancelled.
/// </summary>
@@ -41,14 +36,14 @@ public enum JobState
Finished,
/// <summary>
- /// Identifies that the job is processing.
+ /// Identifies that the job is pending.
/// </summary>
- Processing,
+ Pending,
/// <summary>
- /// Identifies that the job is queued for processing.
+ /// Identifies that the job is processing.
/// </summary>
- Queued,
+ Processing,
/// <summary>
/// Identifies that the job is waiting to be queued.
@@ -14,7 +14,7 @@ namespace Zencoder
/// Represents a single input or output media file in a <see cref="Job"/>.
/// </summary>
[JsonObject(MemberSerialization = MemberSerialization.OptIn)]
- public class MediaFile
+ public abstract class MediaFile
{
/// <summary>
/// Gets or sets the file's audio bitrate (in Kbps).
@@ -96,12 +96,6 @@ public class MediaFile
[JsonProperty("id")]
public int Id { get; set; }
- /// <summary>
- /// Gets or sets the file's state with respect to its parent job.
- /// </summary>
- [JsonProperty("state")]
- public OutputState State { get; set; }
-
/// <summary>
/// Gets or sets a value indicating whether the file is in test mode.
/// </summary>
@@ -0,0 +1,25 @@
+//-----------------------------------------------------------------------
+// <copyright file="OutputMediaFile.cs" company="Tasty Codes">
+// Copyright (c) 2010 Chad Burggraf.
+// </copyright>
+//-----------------------------------------------------------------------
+
+namespace Zencoder
+{
+ using System;
+ using Newtonsoft.Json;
+ using Newtonsoft.Json.Converters;
+
+ /// <summary>
+ /// Represents a single output media file in a <see cref="Job"/>.
+ /// </summary>
+ [JsonObject(MemberSerialization = MemberSerialization.OptIn)]
+ public class OutputMediaFile : MediaFile
+ {
+ /// <summary>
+ /// Gets or sets the file's state with respect to its parent job.
+ /// </summary>
+ [JsonProperty("state")]
+ public OutputState State { get; set; }
+ }
+}
@@ -10,7 +10,7 @@ namespace Zencoder
using Newtonsoft.Json;
/// <summary>
- /// Defines the possible <see cref="Output"/> states.
+ /// Defines the possible <see cref="OutputMediaFile"/> states.
/// </summary>
[JsonConverter(typeof(EnumLowercaseUnderscoreJsonConverter))]
public enum OutputState
@@ -84,6 +84,8 @@
<Compile Include="HttpPostNotificationJob.cs" />
<Compile Include="HttpPostNotificationOutput.cs" />
<Compile Include="INotificationReceiver.cs" />
+ <Compile Include="InputMediaFile.cs" />
+ <Compile Include="InputState.cs" />
<Compile Include="Job.cs" />
<Compile Include="JobDetailsRequest.cs" />
<Compile Include="JobDetailsResponse.cs" />
@@ -97,6 +99,7 @@
<Compile Include="Notification.cs" />
<Compile Include="Output.cs" />
<Compile Include="OutputEvent.cs" />
+ <Compile Include="OutputMediaFile.cs" />
<Compile Include="OutputState.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Request.cs" />

0 comments on commit dfb8ad4

Please sign in to comment.