2 This file is part of the HandBrake source code.
\r
3 Homepage: <http://handbrake.fr/>.
\r
4 It may be used under the terms of the GNU General Public License. */
\r
6 namespace HandBrake.ApplicationServices.Services.Interfaces
\r
9 using System.Collections.ObjectModel;
\r
11 using HandBrake.ApplicationServices.Model;
\r
14 /// The IQueue Interface
\r
16 public interface IQueue : IEncode
\r
19 /// Fires when the Queue has started
\r
21 event EventHandler QueueStarted;
\r
24 /// Fires when a job is Added, Removed or Re-Ordered.
\r
25 /// Should be used for triggering an update of the Queue Window.
\r
27 event EventHandler QueueListChanged;
\r
30 /// Fires when a pause to the encode queue has been requested.
\r
32 event EventHandler QueuePauseRequested;
\r
35 /// Fires when the entire encode queue has completed.
\r
37 event EventHandler QueueCompleted;
\r
40 /// Gets or sets the last encode that was processed.
\r
42 /// <returns></returns>
\r
43 Job LastEncode { get; set; }
\r
46 /// Gets a value indicating whether Request Pause
\r
48 bool Paused { get; }
\r
51 /// Gets the current state of the encode queue.
\r
53 ReadOnlyCollection<Job> CurrentQueue { get; }
\r
56 /// Gets the number of items in the queue.
\r
61 /// Gets a value indicating whether IsEncoding.
\r
63 bool IsEncoding { get; }
\r
66 /// Gets ActivityLog.
\r
68 string ActivityLog { get; }
\r
71 /// Adds an item to the queue.
\r
73 /// <param name="query">
\r
74 /// The query that will be passed to the HandBrake CLI.
\r
76 /// <param name="title">
\r
79 /// <param name="source">
\r
80 /// The location of the source video.
\r
82 /// <param name="destination">
\r
83 /// The location where the encoded video will be.
\r
85 /// <param name="customJob">
\r
88 void Add(string query, int title, string source, string destination, bool customJob);
\r
91 /// Removes an item from the queue.
\r
93 /// <param name="index">The zero-based location of the job in the queue.</param>
\r
94 void Remove(int index);
\r
97 /// Retrieve a job from the queue
\r
99 /// <param name="index">the job id</param>
\r
100 /// <returns>A job for the given index or blank job object</returns>
\r
101 Job GetJob(int index);
\r
104 /// Moves an item up one position in the queue.
\r
106 /// <param name="index">The zero-based location of the job in the queue.</param>
\r
107 void MoveUp(int index);
\r
110 /// Moves an item down one position in the queue.
\r
112 /// <param name="index">The zero-based location of the job in the queue.</param>
\r
113 void MoveDown(int index);
\r
116 /// Writes the current state of the queue to a file.
\r
118 /// <param name="file">The location of the file to write the queue to.</param>
\r
119 void WriteQueueStateToFile(string file);
\r
122 /// Writes the current state of the queue in the form of a batch (.bat) file.
\r
124 /// <param name="file">The location of the file to write the batch file to.</param>
\r
125 bool WriteBatchScriptToFile(string file);
\r
128 /// Reads a serialized XML file that represents a queue of encoding jobs.
\r
130 /// <param name="file">The location of the file to read the queue from.</param>
\r
131 void LoadQueueFromFile(string file);
\r
134 /// Checks the current queue for an existing instance of the specified destination.
\r
136 /// <param name="destination">The destination of the encode.</param>
\r
137 /// <returns>Whether or not the supplied destination is already in the queue.</returns>
\r
138 bool CheckForDestinationDuplicate(string destination);
\r
141 /// Starts encoding the first job in the queue and continues encoding until all jobs
\r
142 /// have been encoded.
\r
147 /// Requests a pause of the encode queue.
\r