File indexing completed on 2025-01-05 03:53:06

0001 /* ============================================================
0002  *
0003  * This file is a part of digiKam project
0004  * https://www.digikam.org
0005  *
0006  * Date        : 2021-07-24
0007  * Description : MJPEG stream settings container.
0008  *
0009  * SPDX-FileCopyrightText: 2021-2024 by Gilles Caulier <caulier dot gilles at gmail dot com>
0010  * SPDX-FileCopyrightText: 2021      by Quoc Hưng Tran <quochungtran1999 at gmail dot com>
0011  *
0012  * SPDX-License-Identifier: GPL-2.0-or-later
0013  *
0014  * ============================================================ */
0015 
0016 #ifndef DIGIKAM_MJPEG_STREAM_SETTINGS_H
0017 #define DIGIKAM_MJPEG_STREAM_SETTINGS_H
0018 
0019 // Qt includes
0020 
0021 #include <QList>
0022 #include <QString>
0023 #include <QUrl>
0024 #include <QFont>
0025 
0026 // Local includes
0027 
0028 #include "mjpegserver.h"
0029 #include "dinfointerface.h"
0030 #include "effectmngr.h"
0031 #include "transitionmngr.h"
0032 #include "frameosdsettings.h"
0033 
0034 class KConfigGroup;
0035 
0036 using namespace Digikam;
0037 
0038 namespace DigikamGenericMjpegStreamPlugin
0039 {
0040 
0041 class MjpegStreamSettings
0042 {
0043 
0044 public:
0045 
0046     explicit MjpegStreamSettings();
0047     ~MjpegStreamSettings();
0048 
0049     /**
0050      * Helper method to compute urlsList from a set of albms selected by end-users from GUI.
0051      */
0052     void setCollectionMap(const MjpegServerMap& map);
0053 
0054     /**
0055      * Read and write settings in config file between sessions.
0056      */
0057     void  readSettings(KConfigGroup& group);
0058     void  writeSettings(KConfigGroup& group);
0059 
0060 public:
0061 
0062     FrameOsdSettings            osdSettings;
0063 
0064     // ---
0065 
0066     int                         port;                    ///< IP port to use with MJPEG Server.
0067     bool                        loop;                    ///< Image stream as loop.
0068     int                         quality;                 ///< Jpeg compression [1...100].
0069     int                         delay;                   ///< Delay in seconds between inages.
0070     QList<QUrl>                 inputImages;             ///< Ordered list of images to stream.
0071     int                         outSize;                 ///< Output JPEG size ID.
0072     int                         rate;                    ///< Number of frames by seconds.
0073     TransitionMngr::TransType   transition;              ///< Transition type between images.
0074     EffectMngr::EffectType      effect;                  ///< Effect while displaying images.
0075     DInfoInterface*             iface;                   ///< Plugin host interface to handle item properties.
0076 };
0077 
0078 } // namespace DigikamGenericMjpegStreamPlugin
0079 
0080 #endif // DIGIKAM_MJPEG_STREAM_SETTINGS_H