aboutsummaryrefslogtreecommitdiffstats
path: root/src/sls.cpp
diff options
context:
space:
mode:
authorStefan Pöschel <github@basicmaster.de>2017-02-15 22:53:23 +0100
committerStefan Pöschel <github@basicmaster.de>2017-02-15 22:53:23 +0100
commit204eacfbc596a77b104ab5eeb61f29371f10eda9 (patch)
tree5e820029eb0caa08130e2a929207d135d64531d1 /src/sls.cpp
parenta8bf23a05c12f2c41e8a469feaed3bac2abb01df (diff)
downloadODR-PadEnc-204eacfbc596a77b104ab5eeb61f29371f10eda9.tar.gz
ODR-PadEnc-204eacfbc596a77b104ab5eeb61f29371f10eda9.tar.bz2
ODR-PadEnc-204eacfbc596a77b104ab5eeb61f29371f10eda9.zip
Hide/Move constants
Diffstat (limited to 'src/sls.cpp')
-rw-r--r--src/sls.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sls.cpp b/src/sls.cpp
index cb6e750..5031451 100644
--- a/src/sls.cpp
+++ b/src/sls.cpp
@@ -32,7 +32,7 @@
// --- History -----------------------------------------------------------------
const size_t History::MAXHISTORYLEN = 50; // How many slides to keep in history
-
+const int History::MAXSLIDEID = 9999; // Roll-over value for fidx
int History::find(const fingerprint_t& fp) const
{
@@ -88,7 +88,7 @@ int History::get_fidx(const char* filepath)
idx = m_last_given_fidx++;
fp.fidx = idx;
- if (m_last_given_fidx > SLSManager::MAXSLIDEID) {
+ if (m_last_given_fidx > MAXSLIDEID) {
m_last_given_fidx = 0;
}
@@ -192,7 +192,6 @@ void MOTHeader::AddExtension(int param_id, const uint8_t* data_field, size_t dat
// --- SLSManager -----------------------------------------------------------------
const size_t SLSManager::MAXSEGLEN = 8189; // Bytes (EN 301 234 v2.1.1, ch. 5.1.1)
const size_t SLSManager::MAXSLIDESIZE = 51200; // Bytes (TS 101 499 v3.1.1, ch. 9.1.2)
-const int SLSManager::MAXSLIDEID = 9999; // Roll-over value for fidx
const int SLSManager::MINQUALITY = 40; // Do not allow the image compressor to go below JPEG quality 40
const std::string SLSManager::SLS_PARAMS_SUFFIX = ".sls_params";
@@ -698,3 +697,8 @@ DATA_GROUP* SLSManager::packMscDG(MSCDG* msc)
return dg;
}
+
+bool SLSManager::isSlideParamFileFilename(const std::string& filename) {
+ return filename.length() >= SLS_PARAMS_SUFFIX.length() &&
+ filename.substr(filename.length() - SLS_PARAMS_SUFFIX.length()) == SLS_PARAMS_SUFFIX;
+}