23 QHBoxLayout *layout =
new QHBoxLayout(
this);
24 layout->setSpacing(0);
25 layout->setContentsMargins(0, 0, 0, 0);
40 QShortcut *cut =
new QShortcut(Qt::SHIFT + Qt::CTRL + Qt::Key_T,
this);
101 m_detectedLabel->setText(tr(
"Intelligent recognition of playing song"));
120 connect(
m_networkRequest, SIGNAL(downLoadDataChanged(QString)), &loop, SLOT(quit()));
180 const QString &lrc = QString(
"<p style='font-weight:600;' align='center'>%1</p>").arg(tr(
"No lrc data file found"));
195 lrc += QString(
"<p style='font-weight:700;' align='center'>");
199 lrc += QString(
"<p align='center'>");
203 lrc += QString(
"</p>");
214 QVBoxLayout *widgetLayout =
new QVBoxLayout(widget);
217 QLabel *iconLabel =
new QLabel(widget);
218 iconLabel->setFixedSize(200, 200);
219 QVBoxLayout *iconLabelLayout =
new QVBoxLayout(iconLabel);
220 iconLabelLayout->setSpacing(0);
221 iconLabelLayout->setContentsMargins(0, 0, 0, 0);
233 iconLabel->setLayout(iconLabelLayout);
237 m_detectedLabel->setText(tr(
"Intelligent recognition of playing song"));
239 QLabel *text =
new QLabel(tr(
"Shortcut:") +
" Shift + Ctrl + T", widget);
242 widgetLayout->addStretch(2);
243 widgetLayout->addWidget(iconLabel, 0, Qt::AlignCenter);
244 widgetLayout->addStretch(1);
246 widgetLayout->addStretch(1);
247 widgetLayout->addWidget(text, 0, Qt::AlignCenter);
248 widget->setLayout(widgetLayout);
272 QVBoxLayout *widgetLayout =
new QVBoxLayout(widget);
274 QWidget *infoWidget =
new QWidget(widget);
275 QHBoxLayout *infoWidgetLayout =
new QHBoxLayout(infoWidget);
276 infoWidgetLayout->setContentsMargins(0, 0, 0, 0);
277 infoWidgetLayout->setSpacing(25);
279 QWidget *infoFuncWidget =
new QWidget(infoWidget);
280 QGridLayout *infoFuncWidgetLayout =
new QGridLayout(infoFuncWidget);
281 infoFuncWidgetLayout->setContentsMargins(0, 0, 0, 0);
283 QLabel *textLabel =
new QLabel(widget);
285 textLabel->setAlignment(Qt::AlignCenter);
289 connect(d, SIGNAL(downLoadDataChanged(QString)), &loop, SLOT(quit()));
297 if(info.m_artistName.trimmed().contains(songIdentify.
m_artistName.trimmed(), Qt::CaseInsensitive) &&
298 info.m_songName.trimmed().contains(songIdentify.
m_songName.trimmed(), Qt::CaseInsensitive))
306 QLabel *iconLabel =
new QLabel(widget);
307 iconLabel->setMinimumSize(280, 280);
311 if(!QFile::exists(name))
314 connect(d, SIGNAL(downLoadDataChanged(QString)), &loop, SLOT(quit()));
318 iconLabel->setPixmap(QPixmap(name).scaled(iconLabel->size()));
322 iconLabel->setPixmap(QPixmap(
":/image/lb_default_art").scaled(iconLabel->size()));
325 QPushButton *playButton =
new QPushButton(infoFuncWidget);
326 QPushButton *loveButton =
new QPushButton(infoFuncWidget);
327 QPushButton *downButton =
new QPushButton(infoFuncWidget);
328 QPushButton *shareButton =
new QPushButton(infoFuncWidget);
331 playButton->setFocusPolicy(Qt::NoFocus);
332 loveButton->setFocusPolicy(Qt::NoFocus);
333 downButton->setFocusPolicy(Qt::NoFocus);
334 shareButton->setFocusPolicy(Qt::NoFocus);
337 playButton->setFixedSize(25, 25);
338 loveButton->setFixedSize(25, 25);
339 downButton->setFixedSize(25, 25);
340 shareButton->setFixedSize(25, 25);
342 playButton->setCursor(QCursor(Qt::PointingHandCursor));
343 loveButton->setCursor(QCursor(Qt::PointingHandCursor));
344 downButton->setCursor(QCursor(Qt::PointingHandCursor));
345 shareButton->setCursor(QCursor(Qt::PointingHandCursor));
356 infoFuncWidgetLayout->addWidget(textLabel, 0, 0, 1, 4);
357 infoFuncWidgetLayout->addWidget(iconLabel, 1, 0, 1, 4);
358 infoFuncWidgetLayout->addWidget(playButton, 2, 0, Qt::AlignCenter);
359 infoFuncWidgetLayout->addWidget(loveButton, 2, 1, Qt::AlignCenter);
360 infoFuncWidgetLayout->addWidget(downButton, 2, 2, Qt::AlignCenter);
361 infoFuncWidgetLayout->addWidget(shareButton, 2, 3, Qt::AlignCenter);
362 infoFuncWidget->setLayout(infoFuncWidgetLayout);
370 if(!QFile::exists(path))
373 connect(d, SIGNAL(downLoadDataChanged(QString)), &loop, SLOT(quit()));
387 infoWidgetLayout->addWidget(infoFuncWidget);
389 infoWidget->setLayout(infoWidgetLayout);
391 QPushButton *reDetect =
new QPushButton(widget);
392 reDetect->setFixedSize(56, 56);
394 reDetect->setCursor(QCursor(Qt::PointingHandCursor));
397 QLabel *text3Label =
new QLabel(tr(
"Redetect"), widget);
400 widgetLayout->addStretch(1);
401 widgetLayout->addWidget(infoWidget, 1, Qt::AlignCenter);
402 widgetLayout->addStretch(1);
403 widgetLayout->addWidget(reDetect, 0, Qt::AlignCenter);
404 widgetLayout->addWidget(text3Label, 0, Qt::AlignCenter);
405 widgetLayout->addStretch(1);
406 widget->setLayout(widgetLayout);
421 QVBoxLayout *widgetLayout =
new QVBoxLayout(widget);
423 QLabel *iconLabel =
new QLabel(widget);
424 iconLabel->setPixmap(QPixmap(
":/toolSets/lb_detect_error"));
425 QLabel *text1Label =
new QLabel(tr(
"There are no recognized songs"), widget);
426 QLabel *text2Label =
new QLabel(tr(
"Only playing songs can be recognized"), widget);
427 QLabel *text3Label =
new QLabel(tr(
"Redetect"), widget);
430 QPushButton *reDetect =
new QPushButton(widget);
431 reDetect->setFixedSize(56, 56);
433 reDetect->setCursor(QCursor(Qt::PointingHandCursor));
436 reDetect->setFocusPolicy(Qt::NoFocus);
439 widgetLayout->addStretch(2);
440 widgetLayout->addWidget(iconLabel, 0, Qt::AlignCenter);
441 widgetLayout->addStretch(1);
442 widgetLayout->addWidget(text1Label, 0, Qt::AlignCenter);
443 widgetLayout->addStretch(1);
444 widgetLayout->addWidget(text2Label, 0, Qt::AlignCenter);
445 widgetLayout->addStretch(2);
446 widgetLayout->addWidget(reDetect, 0, Qt::AlignCenter);
447 widgetLayout->addWidget(text3Label, 0, Qt::AlignCenter);
448 widgetLayout->addStretch(1);
449 widget->setLayout(widgetLayout);
const TTK::MusicSongInformationList & items() const noexcept
int addWavHeader(const char *fileName) const
void setMedia(Module type, const QString &url, int winId=-1)
int lineMax() const noexcept
The class of the abstract download data.
void setLineMax(int max) noexcept
static const QString FontStyle03
virtual void startToRequest(const QString &path) overridefinal
The class of the download the type of data.
static constexpr const char * SongsDetectShareBtn
int exec(ProcessEventsFlags flags=AllEvents)
The class of the audio recorder core.
static constexpr const char * SongsDetectUnloveBtn
bool isEmpty() const noexcept
The class of the ttk event loop.
The class of the song identify data item.
void setCurrentIndex(int index) noexcept
static void popup(const QString &text)
int currentIndex() const noexcept
virtual void startToQueryResult(TTK::MusicSongInformation *info, int bitrate)
The class of the core lrc analysis.
#define TTK_RECORD_DATA_FILE
QString text(int index) const
static constexpr const char * SongsDetectDownloadBtn
TTK_MODULE_EXPORT QString lrcDirPrefix()
static constexpr const char * SongsDetectStopBtn
qint64 findTime(int index) const
int lineMiddle() const noexcept
static constexpr const char * SongsRedetectBtn
static const QString BackgroundStyle10
The class of the mplayer core.
static const QString FontStyle04
const MusicSongIdentifyDataList & items() const noexcept
static const QString ColorStyle03
virtual void startToRequest()=0
State loadFromFile(const QString &path)
#define G_DOWNLOAD_QUERY_PTR
bool isEmpty() const noexcept
The class of the xf song identify query request.
virtual void startToSearch(const QString &value)=0
The class of the abstract query download data from net.
static constexpr const char * SongsDetectPlayBtn
static constexpr const char * SongsDetectStartBtn
virtual void startToRequest() override
TTK_MODULE_EXPORT QString generateSongName(const QString &title, const QString &artist) noexcept
bool error() const noexcept