CuteLogger
Fast and simple logging solution for Qt based applications
transcribeaudiodialog.h
1/*
2 * Copyright (c) 2024-2025 Meltytech, LLC
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef TRANSCRIBEAUDIODIALOG_H
19#define TRANSCRIBEAUDIODIALOG_H
20
21#include "models/extensionmodel.h"
22
23#include <QDialog>
24
25class QAbstractButton;
26class QCheckBox;
27class QComboBox;
28class QDialogButtonBox;
29class QLineEdit;
30class QListWidget;
31class QSpinBox;
32class QTreeView;
33
34class TranscribeAudioDialog : public QDialog
35{
36 Q_OBJECT
37
38public:
39 explicit TranscribeAudioDialog(const QString &trackName, QWidget *parent);
40 QString name();
41 QString language();
42 QList<int> tracks();
43 bool translate();
44 int maxLineLength();
45 bool includeNonspoken();
46 bool useGpu();
47
48protected:
49 virtual void showEvent(QShowEvent *event) override;
50
51private slots:
52 void onButtonClicked(QAbstractButton *button);
53 void onModelRowClicked(const QModelIndex &index);
54
55private:
56 void refreshModels(bool report = true);
57 void downloadModel(int index);
58 void setCurrentModel(int index);
59 void updateWhisperStatus();
60 void showModelContextMenu(QPoint p);
61 ExtensionModel m_model;
62 QLineEdit *m_name;
63 QComboBox *m_lang;
64 QCheckBox *m_translate;
65 QSpinBox *m_maxLength;
66 QCheckBox *m_nonspoken;
67 QCheckBox *m_useGpu;
68 QListWidget *m_trackList;
69 QWidget *m_configWidget;
70 QLineEdit *m_exeLabel;
71 QLineEdit *m_modelLabel;
72 QDialogButtonBox *m_buttonBox;
73 QTreeView *m_table;
74};
75
76#endif // TRANSCRIBEAUDIODIALOG_H