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 /// Adds an item to the queue.
\r
63 /// <param name="query">
\r
64 /// The query that will be passed to the HandBrake CLI.
\r
66 /// <param name="title">
\r
69 /// <param name="source">
\r
70 /// The location of the source video.
\r
72 /// <param name="destination">
\r
73 /// The location where the encoded video will be.
\r
75 /// <param name="customJob">
\r
78 void Add(string query, int title, string source, string destination, bool customJob);
\r
81 /// Removes an item from the queue.
\r
83 /// <param name="index">The zero-based location of the job in the queue.</param>
\r
84 void Remove(int index);
\r
87 /// Retrieve a job from the queue
\r
89 /// <param name="index">the job id</param>
\r
90 /// <returns>A job for the given index or blank job object</returns>
\r
91 Job GetJob(int index);
\r
94 /// Moves an item up one position in the queue.
\r
96 /// <param name="index">The zero-based location of the job in the queue.</param>
\r
97 void MoveUp(int index);
\r
100 /// Moves an item down one position in the queue.
\r
102 /// <param name="index">The zero-based location of the job in the queue.</param>
\r
103 void MoveDown(int index);
\r
106 /// Writes the current state of the queue to a file.
\r
108 /// <param name="file">The location of the file to write the queue to.</param>
\r
109 void WriteQueueStateToFile(string file);
\r
112 /// Writes the current state of the queue in the form of a batch (.bat) file.
\r
114 /// <param name="file">
\r
115 /// The location of the file to write the batch file to.
\r
118 /// The write batch script to file.
\r
120 bool WriteBatchScriptToFile(string file);
\r
123 /// Reads a serialized XML file that represents a queue of encoding jobs.
\r
125 /// <param name="file">The location of the file to read the queue from.</param>
\r
126 void LoadQueueFromFile(string file);
\r
129 /// Checks the current queue for an existing instance of the specified destination.
\r
131 /// <param name="destination">The destination of the encode.</param>
\r
132 /// <returns>Whether or not the supplied destination is already in the queue.</returns>
\r
133 bool CheckForDestinationDuplicate(string destination);
\r
136 /// Starts encoding the first job in the queue and continues encoding until all jobs
\r
137 /// have been encoded.
\r
142 /// Requests a pause of the encode queue.
\r