From f2c65be1036bb5d7310c4a8714e14bb4496efebb Mon Sep 17 00:00:00 2001 From: Stefan Pöschel Date: Fri, 16 Feb 2018 13:48:42 +0100 Subject: 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. --- src/sls.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/sls.cpp') 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) { -- cgit v1.2.3