diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-06 01:07:49 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-05-08 01:29:35 +0200 |
| commit | 237cac14be009b9b7afb908204f35fa94da65116 (patch) | |
| tree | 16ea23a60df487ce5facb6c82ee8102881daded7 /src/lib/types.cc | |
| parent | 6b9ecf45d64a2d62b217f2984af0ccc805db857a (diff) | |
Add ReelType / string conversions.
Diffstat (limited to 'src/lib/types.cc')
| -rw-r--r-- | src/lib/types.cc | 36 |
1 files changed, 36 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"; +} |
