OSDN Git Service

WinGui:
[handbrake-jp/handbrake-jp-git.git] / win / C# / HandBrake.ApplicationServices / Services / Interfaces / IQueue.cs
1 /*  IQueue.cs $\r
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
5 \r
6 namespace HandBrake.ApplicationServices.Services.Interfaces\r
7 {\r
8     using System;\r
9     using System.Collections.ObjectModel;\r
10 \r
11     using HandBrake.ApplicationServices.Model;\r
12 \r
13     /// <summary>\r
14     /// The IQueue Interface\r
15     /// </summary>\r
16     public interface IQueue : IEncode\r
17     {\r
18         /// <summary>\r
19         /// Fires when the Queue has started\r
20         /// </summary>\r
21         event EventHandler QueueStarted;\r
22 \r
23         /// <summary>\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
26         /// </summary>\r
27         event EventHandler QueueListChanged;\r
28 \r
29         /// <summary>\r
30         /// Fires when a pause to the encode queue has been requested.\r
31         /// </summary>\r
32         event EventHandler QueuePauseRequested;\r
33 \r
34         /// <summary>\r
35         /// Fires when the entire encode queue has completed.\r
36         /// </summary>\r
37         event EventHandler QueueCompleted;\r
38 \r
39         /// <summary>\r
40         /// Gets or sets the last encode that was processed.\r
41         /// </summary>\r
42         /// <returns></returns> \r
43         Job LastEncode { get; set; }\r
44 \r
45         /// <summary>\r
46         /// Gets a value indicating whether Request Pause\r
47         /// </summary>\r
48         bool Paused { get; }\r
49 \r
50         /// <summary>\r
51         /// Gets the current state of the encode queue.\r
52         /// </summary>\r
53         ReadOnlyCollection<Job> CurrentQueue { get; }\r
54 \r
55         /// <summary>\r
56         /// Gets the number of items in the queue.\r
57         /// </summary>\r
58         int Count { get; }\r
59 \r
60         /// <summary>\r
61         /// Adds an item to the queue.\r
62         /// </summary>\r
63         /// <param name="query">\r
64         /// The query that will be passed to the HandBrake CLI.\r
65         /// </param>\r
66         /// <param name="title">\r
67         /// The title.\r
68         /// </param>\r
69         /// <param name="source">\r
70         /// The location of the source video.\r
71         /// </param>\r
72         /// <param name="destination">\r
73         /// The location where the encoded video will be.\r
74         /// </param>\r
75         /// <param name="customJob">\r
76         /// Custom job\r
77         /// </param>\r
78         void Add(string query, int title, string source, string destination, bool customJob);\r
79 \r
80         /// <summary>\r
81         /// Removes an item from the queue.\r
82         /// </summary>\r
83         /// <param name="index">The zero-based location of the job in the queue.</param>\r
84         void Remove(int index);\r
85 \r
86         /// <summary>\r
87         /// Retrieve a job from the queue\r
88         /// </summary>\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
92 \r
93         /// <summary>\r
94         /// Moves an item up one position in the queue.\r
95         /// </summary>\r
96         /// <param name="index">The zero-based location of the job in the queue.</param>\r
97         void MoveUp(int index);\r
98 \r
99         /// <summary>\r
100         /// Moves an item down one position in the queue.\r
101         /// </summary>\r
102         /// <param name="index">The zero-based location of the job in the queue.</param>\r
103         void MoveDown(int index);\r
104 \r
105         /// <summary>\r
106         /// Writes the current state of the queue to a file.\r
107         /// </summary>\r
108         /// <param name="file">The location of the file to write the queue to.</param>\r
109         void WriteQueueStateToFile(string file);\r
110 \r
111         /// <summary>\r
112         /// Writes the current state of the queue in the form of a batch (.bat) file.\r
113         /// </summary>\r
114         /// <param name="file">\r
115         /// The location of the file to write the batch file to.\r
116         /// </param>\r
117         /// <returns>\r
118         /// The write batch script to file.\r
119         /// </returns>\r
120         bool WriteBatchScriptToFile(string file);\r
121 \r
122         /// <summary>\r
123         /// Reads a serialized XML file that represents a queue of encoding jobs.\r
124         /// </summary>\r
125         /// <param name="file">The location of the file to read the queue from.</param>\r
126         void LoadQueueFromFile(string file);\r
127 \r
128         /// <summary>\r
129         /// Checks the current queue for an existing instance of the specified destination.\r
130         /// </summary>\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
134 \r
135         /// <summary>\r
136         /// Starts encoding the first job in the queue and continues encoding until all jobs\r
137         /// have been encoded.\r
138         /// </summary>\r
139         void Start();\r
140 \r
141         /// <summary>\r
142         /// Requests a pause of the encode queue.\r
143         /// </summary>\r
144         void Pause();\r
145     }\r
146 }