-
Notifications
You must be signed in to change notification settings - Fork 20
/
modelinfodlg.cpp
40 lines (30 loc) · 1.15 KB
/
modelinfodlg.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "modelinfodlg.h"
#include "ui_modelinfodlg.h"
#include <QFile>
ModelInfoDlg::ModelInfoDlg(QWidget *parent) :
QDialog(parent),
ui(new Ui::ModelInfoDlg)
{
ui->setupUi(this);
}
ModelInfoDlg::~ModelInfoDlg()
{
delete ui;
}
void ModelInfoDlg::SetInfo(const QString &ModelName, const QString &Info, int32_t InVersion, const QString &Author, const QString &Repo, const QString &MelGen, const QString &Vocoder, uint32_t SampleRate)
{
ui->lblAuthor->setText("Author: " + Author);
ui->lblVersion->setText("Version: " + QString::number(InVersion) + " ");
ui->redtModelInfo->setText(QString(Info).replace("(/NL)","\n"));
ui->lblModelTitle->setText(ModelName);
QString ArchShow = "Architecture: " + Repo + " " + MelGen;
if (Vocoder.size())
ArchShow += " & " + Vocoder;
ui->lblModelArchitecture->setText(ArchShow);
ui->lblSampleRate->setText("Sampling rate: " + QString::number(SampleRate / 1000) + "KHz");
QString ImgPath = QApplication::applicationDirPath() + "/models/" + ModelName + "/image.png";
if (QFile::exists(ImgPath))
{
ui->lblImg->setPixmap(QPixmap::fromImage(QImage(ImgPath)));
}
}