Supporters update.
[dcpomatic.git] / src / lib / transcode_job.h
1 /*
2     Copyright (C) 2012-2021 Carl Hetherington <cth@carlh.net>
3
4     This file is part of DCP-o-matic.
5
6     DCP-o-matic is free software; you can redistribute it and/or modify
7     it under the terms of the GNU General Public License as published by
8     the Free Software Foundation; either version 2 of the License, or
9     (at your option) any later version.
10
11     DCP-o-matic is distributed in the hope that it will be useful,
12     but WITHOUT ANY WARRANTY; without even the implied warranty of
13     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14     GNU General Public License for more details.
15
16     You should have received a copy of the GNU General Public License
17     along with DCP-o-matic.  If not, see <http://www.gnu.org/licenses/>.
18
19 */
20
21
22 #ifndef DCPOMATIC_TRANSCODE_JOB_H
23 #define DCPOMATIC_TRANSCODE_JOB_H
24
25
26 /** @file src/transcode_job.h
27  *  @brief A job which transcodes from one format to another.
28  */
29
30
31 #include "job.h"
32
33
34 /* Defined by Windows */
35 #undef IGNORE
36
37
38 class Encoder;
39
40
41 /** @class TranscodeJob
42  *  @brief A job which transcodes a Film to another format.
43  */
44 class TranscodeJob : public Job
45 {
46 public:
47         enum class ChangedBehaviour {
48                 EXAMINE_THEN_STOP,
49                 STOP,
50                 IGNORE
51         };
52
53         explicit TranscodeJob (std::shared_ptr<const Film> film, ChangedBehaviour changed);
54         ~TranscodeJob ();
55
56         std::string name () const override;
57         std::string json_name () const override;
58         void run () override;
59         std::string status () const override;
60         bool enable_notify () const override {
61                 return true;
62         }
63
64         void set_encoder (std::shared_ptr<Encoder> t);
65
66 private:
67         virtual void post_transcode () {}
68
69         int remaining_time () const override;
70
71         std::shared_ptr<Encoder> _encoder;
72         ChangedBehaviour _changed;
73 };
74
75
76 #endif
77