2 #include "ui_musicttkfmradioplaywidget.h"
3 #include "ui_musicttkfmradioinformationwidget.h"
11 #define FMRADIO_PATH RESOURCE_DIR_FULL + "fmlist"
22 m_ui->topTitleCloseButton->setIcon(QIcon(
":/functions/btn_close_hover"));
24 m_ui->topTitleCloseButton->setCursor(QCursor(Qt::PointingHandCursor));
25 m_ui->topTitleCloseButton->setToolTip(tr(
"Close"));
26 connect(
m_ui->topTitleCloseButton, SIGNAL(clicked()), SLOT(close()));
30 m_ui->button->setFocusPolicy(Qt::NoFocus);
32 connect(
m_ui->button, SIGNAL(clicked()), SLOT(accept()));
48 return {
m_ui->nameEdit->text(),
m_ui->pathEdit->text()};
54 m_ui->pathEdit->setReadOnly(mode);
55 m_ui->nameEdit->setReadOnly(mode);
64 m_statusChanged(false),
71 m_ui->topTitleCloseButton->setIcon(QIcon(
":/functions/btn_close_hover"));
73 m_ui->topTitleCloseButton->setCursor(QCursor(Qt::PointingHandCursor));
74 m_ui->topTitleCloseButton->setToolTip(tr(
"Close"));
75 connect(
m_ui->topTitleCloseButton, SIGNAL(clicked()), SLOT(close()));
77 m_ui->playButton->setIcon(QIcon(
":/functions/btn_play_hover"));
78 m_ui->previousButton->setIcon(QIcon(
":/functions/btn_previous_hover"));
79 m_ui->nextButton->setIcon(QIcon(
":/functions/btn_next_hover"));
89 m_ui->playButton->setFocusPolicy(Qt::NoFocus);
90 m_ui->previousButton->setFocusPolicy(Qt::NoFocus);
91 m_ui->nextButton->setFocusPolicy(Qt::NoFocus);
92 m_ui->addButton->setFocusPolicy(Qt::NoFocus);
93 m_ui->deleteButton->setFocusPolicy(Qt::NoFocus);
94 m_ui->infoButton->setFocusPolicy(Qt::NoFocus);
97 m_ui->playButton->setIconSize(QSize(31, 31));
98 m_ui->previousButton->setIconSize(QSize(31, 31));
99 m_ui->nextButton->setIconSize(QSize(31, 31));
101 m_ui->playButton->setCursor(QCursor(Qt::PointingHandCursor));
102 m_ui->previousButton->setCursor(QCursor(Qt::PointingHandCursor));
103 m_ui->nextButton->setCursor(QCursor(Qt::PointingHandCursor));
104 m_ui->addButton->setCursor(QCursor(Qt::PointingHandCursor));
105 m_ui->deleteButton->setCursor(QCursor(Qt::PointingHandCursor));
106 m_ui->infoButton->setCursor(QCursor(Qt::PointingHandCursor));
109 m_ui->volumeSlider->setRange(0, 100);
110 m_ui->volumeSlider->setValue(100);
112 m_ui->itemTree->setHeaderLabels({{}, {}});
113 m_ui->itemTree->setColumnWidth(0, 320);
115 m_ui->itemTree->header()->setVisible(
false);
117 m_ui->itemTree->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
119 m_ui->itemTree->setFocusPolicy(Qt::NoFocus);
123 delegateTitle->
setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
125 m_ui->itemTree->setItemDelegateForColumn(0, delegateTitle);
130 connect(
m_ui->playButton, SIGNAL(clicked()), SLOT(
radioPlay()));
132 connect(
m_ui->nextButton, SIGNAL(clicked()), SLOT(
radioNext()));
136 connect(
m_ui->volumeSlider, SIGNAL(valueChanged(
int)), SLOT(
radioVolume(
int)));
137 connect(
m_ui->itemTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,
int)), SLOT(
radioItemChanged(QTreeWidgetItem*,
int)));
148 if(item && column == 0)
177 m_ui->playButton->setIcon(QIcon(
m_isPlaying ?
":/functions/btn_pause_hover" :
":/functions/btn_play_hover"));
214 MusicFMCategoryList categorys;
220 if(!categorys.isEmpty())
228 QWidget::closeEvent(event);
233 MusicFMCategoryList categorys;
245 QTreeWidgetItem *item =
new QTreeWidgetItem(
m_ui->itemTree);
247 m_ui->itemTree->addTopLevelItem(item);
251 QTreeWidgetItem *it =
new QTreeWidgetItem(item);
258 if(!categorys.isEmpty())
266 const int v =
m_ui->volumeSlider->value();
267 m_ui->volumeSlider->setValue(0);
268 m_ui->volumeSlider->setValue(v);
297 m_ui->gifLabel_1->start();
298 m_ui->gifLabel_2->start();
299 m_ui->gifLabel_3->start();
300 m_ui->gifLabel_4->start();
301 m_ui->gifLabel_5->start();
316 if(!ok || index < 0 || index >=
m_items.count())
341 if(channel.
m_name.isEmpty() || channel.
m_url.isEmpty())
348 QTreeWidgetItem *item =
m_ui->itemTree->topLevelItem(
m_ui->itemTree->topLevelItemCount() - 1);
354 QTreeWidgetItem *it =
new QTreeWidgetItem(item);
366 message.
setText(tr(
"Are you sure to delete?"));
372 QTreeWidgetItem *item =
m_ui->itemTree->currentItem();
386 for(
int i = index - offset + 1; i < item->parent()->childCount(); ++i)
388 item->parent()->child(i)->setData(0,
TTK_DATA_ROLE, offset + i - 1);
391 item->parent()->removeChild(item);
void setMedia(Module type, const QString &url, int winId=-1)
The class of the label item delegate.
void setText(const QString &text) const
static const QString SliderStyle10
bool fromFile(const QString &name)
The class of the fm config manager.
void setStyleSheet(const QString &style) const
The class of the messagebox widget.
void setVolume(int value)
static void popup(const QString &text)
void setAlignment(Qt::Alignment alignment) const
static const QString ScrollBarStyle03
static const QString ColorStyle02
static const QString BackgroundStyle01
Background.
The class of the fm channel item.
virtual bool writeBuffer(const MusicFMCategoryList &items) overridefinal
static const QString PushButtonStyle04
The class of the moving dialog base.
The class of the mplayer core.
static const QString ToolButtonStyle04
The class of the fm category item.
void setModuleMode(TTKUInt8 mode)
virtual bool readBuffer(MusicFMCategoryList &items) overridefinal
static qint64 formatDuration(const QString &time) noexcept