diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/types.cc | 36 | ||||
| -rw-r--r-- | src/lib/types.h | 4 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/lib/types.cc b/src/lib/types.cc index 48363f892..28d58f36b 100644 --- a/src/lib/types.cc +++ b/src/lib/types.cc @@ -75,3 +75,39 @@ CPLSummary::CPLSummary (boost::filesystem::path p) } + +ReelType +string_to_reel_type(string type) +{ + if (type == "single") { + return ReelType::SINGLE; + } else if (type == "by-video-content") { + return ReelType::BY_VIDEO_CONTENT; + } else if (type == "by-length") { + return ReelType::BY_LENGTH; + } else if (type == "custom") { + return ReelType::CUSTOM; + } + + DCPOMATIC_ASSERT(false); + return ReelType::SINGLE; +} + + +string +reel_type_to_string(ReelType type) +{ + switch (type) { + case ReelType::SINGLE: + return "single"; + case ReelType::BY_VIDEO_CONTENT: + return "by-video-content"; + case ReelType::BY_LENGTH: + return "by-length"; + case ReelType::CUSTOM: + return "custom"; + } + + DCPOMATIC_ASSERT(false); + return "single"; +} diff --git a/src/lib/types.h b/src/lib/types.h index b4fcea959..f6b0fb3be 100644 --- a/src/lib/types.h +++ b/src/lib/types.h @@ -113,6 +113,10 @@ enum class ReelType }; +std::string reel_type_to_string(ReelType type); +ReelType string_to_reel_type(std::string type); + + struct CPLSummary { CPLSummary (boost::filesystem::path p); |
