OSDN Git Service

981f3c19e3125a161225f1af76e2eb4ad041ae07
[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         /// Gets a value indicating whether IsEncoding.\r
62         /// </summary>\r
63         bool IsEncoding { get; }\r
64 \r
65         /// <summary>\r
66         /// Gets ActivityLog.\r
67         /// </summary>\r
68         string ActivityLog { get; }\r
69 \r
70         /// <summary>\r
71         /// Adds an item to the queue.\r
72         /// </summary>\r
73         /// <param name="query">\r
74         /// The query that will be passed to the HandBrake CLI.\r
75         /// </param>\r
76         /// <param name="title">\r
77         /// The title.\r
78         /// </param>\r
79         /// <param name="source">\r
80         /// The location of the source video.\r
81         /// </param>\r
82         /// <param name="destination">\r
83         /// The location where the encoded video will be.\r
84         /// </param>\r
85         /// <param name="customJob">\r
86         /// Custom job\r
87         /// </param>\r
88         void Add(string query, int title, string source, string destination, bool customJob);\r
89 \r
90         /// <summary>\r
91         /// Removes an item from the queue.\r
92         /// </summary>\r
93         /// <param name="index">The zero-based location of the job in the queue.</param>\r
94         void Remove(int index);\r
95 \r
96         /// <summary>\r
97         /// Retrieve a job from the queue\r
98         /// </summary>\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
102 \r
103         /// <summary>\r
104         /// Moves an item up one position in the queue.\r
105         /// </summary>\r
106         /// <param name="index">The zero-based location of the job in the queue.</param>\r
107         void MoveUp(int index);\r
108 \r
109         /// <summary>\r
110         /// Moves an item down one position in the queue.\r
111         /// </summary>\r
112         /// <param name="index">The zero-based location of the job in the queue.</param>\r
113         void MoveDown(int index);\r
114 \r
115         /// <summary>\r
116         /// Writes the current state of the queue to a file.\r
117         /// </summary>\r
118         /// <param name="file">The location of the file to write the queue to.</param>\r
119         void WriteQueueStateToFile(string file);\r
120 \r
121         /// <summary>\r
122         /// Writes the current state of the queue in the form of a batch (.bat) file.\r
123         /// </summary>\r
124         /// <param name="file">The location of the file to write the batch file to.</param>\r
125         bool WriteBatchScriptToFile(string file);\r
126 \r
127         /// <summary>\r
128         /// Reads a serialized XML file that represents a queue of encoding jobs.\r
129         /// </summary>\r
130         /// <param name="file">The location of the file to read the queue from.</param>\r
131         void LoadQueueFromFile(string file);\r
132 \r
133         /// <summary>\r
134         /// Checks the current queue for an existing instance of the specified destination.\r
135         /// </summary>\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
139 \r
140         /// <summary>\r
141         /// Starts encoding the first job in the queue and continues encoding until all jobs\r
142         /// have been encoded.\r
143         /// </summary>\r
144         void Start();\r
145 \r
146         /// <summary>\r
147         /// Requests a pause of the encode queue.\r
148         /// </summary>\r
149         void Pause();\r
150     }\r
151 }