File indexing completed on 2024-06-16 04:38:18

0001 /*
0002     SPDX-FileCopyrightText: 2023 Mladen Milinkovic <max@smoothware.net>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 #ifndef SUBTITLEVOICEDIALOG_H
0007 #define SUBTITLEVOICEDIALOG_H
0008 
0009 #include <QDialog>
0010 
0011 namespace Ui {
0012 class SubtitleVoiceDialog;
0013 }
0014 
0015 namespace SubtitleComposer {
0016 
0017 class SubtitleVoiceDialog : public QDialog
0018 {
0019     Q_OBJECT
0020 
0021     Q_PROPERTY(QString currentVoice READ currentVoice WRITE setCurrentVoice
0022                NOTIFY currentVoiceChanged)
0023 
0024 public:
0025     SubtitleVoiceDialog(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
0026     SubtitleVoiceDialog(const QString &initial, QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
0027     virtual ~SubtitleVoiceDialog();
0028 
0029     static QString getVoice(const QStringList &voices,
0030                 const QString &initial = QString(),
0031                 QWidget *parent = nullptr,
0032                 const QString &title = QString());
0033 
0034     void setCurrentVoice(const QString &cssVoice);
0035     QString currentVoice() const;
0036 
0037     inline QString selectedVoice() const { return currentVoice(); }
0038 
0039 signals:
0040     void currentVoiceChanged(const QString &cssVoice);
0041     void voiceSelected(const QString &cssVoice);
0042 
0043 private:
0044     Ui::SubtitleVoiceDialog *ui;
0045 };
0046 } // namespace SubtitleComposer
0047 
0048 #endif // SUBTITLEVOICEDIALOG_H