Warning, file /multimedia/kdenlive/src/dialogs/kdenlivesettingsdialog.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2008 Jean-Baptiste Mardelle <jb@kdenlive.org>
0003 
0004 SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include <KConfigDialog>
0010 #include <KProcess>
0011 #include <QMap>
0012 #include <QListWidget>
0013 
0014 #include "ui_configcapture_ui.h"
0015 #include "ui_configenv_ui.h"
0016 #include "ui_configjogshuttle_ui.h"
0017 #include "ui_configmisc_ui.h"
0018 #include "ui_configproject_ui.h"
0019 #include "ui_configproxy_ui.h"
0020 #include "ui_configsdl_ui.h"
0021 #include "ui_configtimeline_ui.h"
0022 #include "ui_configtranscode_ui.h"
0023 #include "ui_configcolors_ui.h"
0024 #include "ui_configspeech_ui.h"
0025 
0026 #include "pythoninterfaces/speechtotext.h"
0027 #include "encodingprofilesdialog.h"
0028 
0029 class ProfileWidget;
0030 class GuideCategories;
0031 class KJob;
0032 
0033 class SpeechList : public QListWidget
0034 {
0035     Q_OBJECT
0036 
0037 public:
0038     SpeechList(QWidget *parent = nullptr);
0039 
0040 protected:
0041     QStringList mimeTypes() const override;
0042     void dropEvent(QDropEvent *event) override;
0043 
0044 signals:
0045     void getDictionary(const QUrl url);
0046 };
0047 
0048 class KdenliveSettingsDialog : public KConfigDialog
0049 {
0050     Q_OBJECT
0051 
0052 public:
0053     KdenliveSettingsDialog(QMap<QString, QString> mappable_actions, bool gpuAllowed, QWidget *parent = nullptr);
0054     ~KdenliveSettingsDialog() override;
0055     void showPage(int page, int option);
0056     void checkProfile();
0057     /** @brief update kdenlive settings for external app path if they were changed outside config dialog */
0058     void updateExternalApps();
0059 
0060 protected slots:
0061     void updateSettings() override;
0062     void updateWidgets() override;
0063     bool hasChanged() override;
0064     void accept() override;
0065 
0066 private slots:
0067     void slotCheckShuttle(int state = 0);
0068     void slotUpdateShuttleDevice(int ix = 0);
0069     void slotEditImageApplication();
0070     void slotEditAudioApplication();
0071     void slotEditGlaxnimateApplication();
0072     void slotReadAudioDevices();
0073     void slotUpdateGrabRegionStatus();
0074     void slotCheckAlsaDriver();
0075     void slotCheckAudioBackend();
0076     void slotAddTranscode();
0077     void slotDeleteTranscode();
0078     /** @brief Update current transcoding profile. */
0079     void slotUpdateTranscodingProfile();
0080     /** @brief Enable / disable the update profile button. */
0081     void slotEnableTranscodeUpdate();
0082     /** @brief Update display of current transcoding profile parameters. */
0083     void slotSetTranscodeProfile();
0084     void slotShuttleModified();
0085     void slotDialogModified();
0086     void slotEnableCaptureFolder(int ix);
0087     void slotEnableLibraryFolder();
0088     void slotEnableVideoFolder(int ix);
0089     void slotUpdatev4lDevice();
0090     void slotUpdatev4lCaptureProfile();
0091     void slotEditVideo4LinuxProfile();
0092     void slotReloadBlackMagic();
0093     void slotReloadShuttleDevices();
0094     void loadExternalProxyProfiles();
0095     void slotParseVoskDictionaries();
0096     void getDictionary(const QUrl &sourceUrl = QUrl());
0097     void removeDictionary();
0098     void downloadModelFinished(KJob* job);
0099     void processArchive(const QString &path);
0100     void doShowSpeechMessage(const QString &message, int messageType);
0101     /** @brief fill list of connected monitors */
0102     void fillMonitorData();
0103     
0104 private:
0105     KPageWidgetItem *m_page1;
0106     KPageWidgetItem *m_page2;
0107     KPageWidgetItem *m_page3;
0108     KPageWidgetItem *m_page4;
0109     KPageWidgetItem *m_page5;
0110     KPageWidgetItem *m_page6;
0111     KPageWidgetItem *m_page7;
0112     KPageWidgetItem *m_page8;
0113     KPageWidgetItem *m_page10;
0114     KPageWidgetItem *m_page11;
0115     Ui::ConfigEnv_UI m_configEnv;
0116     Ui::ConfigMisc_UI m_configMisc;
0117     Ui::ConfigColors_UI m_configColors;
0118     Ui::ConfigTimeline_UI m_configTimeline;
0119     Ui::ConfigCapture_UI m_configCapture;
0120     Ui::ConfigJogShuttle_UI m_configShuttle;
0121     Ui::ConfigSdl_UI m_configSdl;
0122     Ui::ConfigTranscode_UI m_configTranscode;
0123     Ui::ConfigProject_UI m_configProject;
0124     Ui::ConfigProxy_UI m_configProxy;
0125     Ui::ConfigSpeech_UI m_configSpeech;
0126     SpeechList *m_speechListWidget;
0127     GuideCategories *m_guidesCategories;
0128     ProfileWidget *m_pw;
0129     KProcess m_readProcess;
0130     QAction *m_voskAction;
0131     bool m_modified;
0132     bool m_shuttleModified;
0133     bool m_voskUpdated;
0134     SpeechToText *m_stt;
0135     QMap<QString, QString> m_mappable_actions;
0136     QVector<QComboBox *> m_shuttle_buttons;
0137     EncodingTimelinePreviewProfilesChooser *m_tlPreviewProfiles;
0138     EncodingProfilesChooser *m_proxyProfiles;
0139     EncodingProfilesChooser *m_decklinkProfiles;
0140     EncodingProfilesChooser *m_v4lProfiles;
0141     EncodingProfilesChooser *m_grabProfiles;
0142     void initDevices();
0143     void loadTranscodeProfiles();
0144     void saveTranscodeProfiles();
0145     void loadCurrentV4lProfileInfo();
0146     void saveCurrentV4lProfile();
0147     void setupJogshuttleBtns(const QString &device);
0148     /** @brief Fill a combobox with the found blackmagic devices */
0149     static bool getBlackMagicDeviceList(QComboBox *devicelist, bool force = false);
0150     static bool getBlackMagicOutputDeviceList(QComboBox *devicelist, bool force = false);
0151     /** @brief Init QtMultimedia audio record settings */
0152     bool initAudioRecDevice();
0153     void initMiscPage();
0154     void initProjectPage();
0155     void initProxyPage();
0156     void initTimelinePage();
0157     void initEnviromentPage();
0158     void initColorsPage();
0159     /** @brief Init Speech to text settings */
0160     void initSpeechPage();
0161     void initCapturePage();
0162     void initJogShuttlePage();
0163     void initSdlPage(bool gpuAllowed);
0164     void initTranscodePage();
0165 
0166 signals:
0167     void customChanged();
0168     void doResetConsumer(bool fullReset);
0169     void updateCaptureFolder();
0170     void updateLibraryFolder();
0171     /** @brief Screengrab method changed between fullsceen and region, update rec monitor */
0172     void updateFullScreenGrab();
0173     /** @brief A settings changed that requires a Kdenlive restart, trigger it */
0174     void restartKdenlive(bool resetConfig = false);
0175     void checkTabPosition();
0176     /** @brief Switch between merged / separate channels for audio thumbs */
0177     void audioThumbFormatChanged();
0178     /** @brief An important timeline property changed, prepare for a reset */
0179     void resetView();
0180     /** @brief Monitor background color changed, update monitors */
0181     void updateMonitorBg();
0182     /** @brief Trigger parsing of the speech models folder */
0183     void parseDictionaries();
0184     /** @brief audio volume or rec channels changed, update audio monitor view */
0185     void resetAudioMonitoring();
0186 };