aboutsummaryrefslogtreecommitdiffstats
path: root/src/sls.cpp
diff options
context:
space:
mode:
authorStefan Pöschel <github@basicmaster.de>2018-02-16 13:48:42 +0100
committerStefan Pöschel <github@basicmaster.de>2018-02-16 13:48:42 +0100
commitf2c65be1036bb5d7310c4a8714e14bb4496efebb (patch)
tree10a2d430ed112edb52419652d5060a24e2ea23ea /src/sls.cpp
parent6d7667155dca929544fbcc362286df2618ed60d0 (diff)
downloadODR-PadEnc-f2c65be1036bb5d7310c4a8714e14bb4496efebb.tar.gz
ODR-PadEnc-f2c65be1036bb5d7310c4a8714e14bb4496efebb.tar.bz2
ODR-PadEnc-f2c65be1036bb5d7310c4a8714e14bb4496efebb.zip
SLS: add support to request slides dir re-read
A re-read of the slides dir can now be requested by storing a file named `REQUEST_SLIDES_DIR_REREAD` into the slides dir. When the next slide is going to be encoded and this file is present, the slides dir is re-read and this file is deleted.
Diffstat (limited to 'src/sls.cpp')
-rw-r--r--src/sls.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sls.cpp b/src/sls.cpp
index 4d24358..8963b65 100644
--- a/src/sls.cpp
+++ b/src/sls.cpp
@@ -3,7 +3,7 @@
Copyright (C) 2014, 2015 Matthias P. Braendli (http://opendigitalradio.org)
- Copyright (C) 2015, 2016, 2017 Stefan Pöschel (http://opendigitalradio.org)
+ Copyright (C) 2015, 2016, 2017, 2018 Stefan Pöschel (http://opendigitalradio.org)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -111,12 +111,16 @@ int SlideStore::FilterSlides(const struct dirent* file) {
if(SLSEncoder::isSlideParamFileFilename(name))
return 0;
+ // skip re-read request file
+ if(name == SLSEncoder::REQUEST_REREAD_FILENAME.c_str())
+ return 0;
+
return 1;
}
bool SlideStore::InitFromDir(const std::string& dir) {
// start with empty list
- slides.clear();
+ Clear();
struct dirent** dir_entries;
int dir_count = scandir(dir.c_str(), &dir_entries, FilterSlides, alphasort);
@@ -257,6 +261,7 @@ const int SLSEncoder::MINQUALITY = 40; // Do not allow the image comp
const std::string SLSEncoder::SLS_PARAMS_SUFFIX = ".sls_params";
const int SLSEncoder::APPTYPE_MOT_START = 12;
const int SLSEncoder::APPTYPE_MOT_CONT = 13;
+const std::string SLSEncoder::REQUEST_REREAD_FILENAME = "REQUEST_SLIDES_DIR_REREAD";
void SLSEncoder::warnOnSmallerImage(size_t height, size_t width, const std::string& fname) {