Logging improvements to allow prettier displays in the server GUI.
[dcpomatic.git] / src / lib / dcp_content_type.h
1 /*
2     Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
3
4     This program is free software; you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation; either version 2 of the License, or
7     (at your option) any later version.
8
9     This program is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
13
14     You should have received a copy of the GNU General Public License
15     along with this program; if not, write to the Free Software
16     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17
18 */
19
20 #ifndef DCPOMATIC_DCP_CONTENT_TYPE_H
21 #define DCPOMATIC_DCP_CONTENT_TYPE_H
22
23 /** @file src/dcp_content_type.h
24  *  @brief DCPContentType class.
25  */
26
27 #include <dcp/dcp.h>
28 #include <string>
29 #include <vector>
30
31 /** @class DCPContentType
32  *  @brief A description of the type of content for a DCP (e.g. feature, trailer etc.)
33  */
34 class DCPContentType : public boost::noncopyable
35 {
36 public:
37         DCPContentType (std::string, dcp::ContentKind, std::string);
38
39         /** @return user-visible `pretty' name */
40         std::string pretty_name () const {
41                 return _pretty_name;
42         }
43
44         dcp::ContentKind libdcp_kind () const {
45                 return _libdcp_kind;
46         }
47
48         std::string isdcf_name () const {
49                 return _isdcf_name;
50         }
51
52         static DCPContentType const * from_pretty_name (std::string);
53         static DCPContentType const * from_isdcf_name (std::string);
54         static DCPContentType const * from_index (int);
55         static int as_index (DCPContentType const *);
56         static std::vector<DCPContentType const *> all ();
57         static void setup_dcp_content_types ();
58
59 private:
60         std::string _pretty_name;
61         dcp::ContentKind _libdcp_kind;
62         std::string _isdcf_name;
63
64         /** All available DCP content types */
65         static std::vector<DCPContentType const *> _dcp_content_types;
66 };
67
68 #endif