cue controls in CueTrackWidget
This commit is contained in:
parent
eed68d1817
commit
8716004c5e
7 changed files with 751 additions and 346 deletions
|
@ -270,6 +270,7 @@ void CueTrackListWidget::redrawCueTrackList()
|
|||
|
||||
void CueTrackListWidget::loadCueTrackList(std::string filename)
|
||||
{
|
||||
qDebug() << "loading cue list from " << filename.data();
|
||||
QFile file(QString::fromStdString(filename));
|
||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
{
|
||||
|
@ -389,6 +390,7 @@ void CueTrackListWidget::loadCueTrackList(std::string filename)
|
|||
|
||||
void CueTrackListWidget::saveCueTrackList(std::string filename)
|
||||
{
|
||||
qDebug() << "saving cue list to " << filename.data();
|
||||
std::ofstream file(filename);
|
||||
if (!file.is_open())
|
||||
{
|
||||
|
|
|
@ -17,9 +17,14 @@ CueTrackWidget::CueTrackWidget(QWidget *parent) :
|
|||
connect(&tlFade, SIGNAL(finished()), this, SLOT(fadeSlot()));
|
||||
connect(&tlWaitIn, SIGNAL(finished()), this, SLOT(waitInSlot()));
|
||||
connect(&tlWaitOut, SIGNAL(finished()), this, SLOT(waitOutSlot()));
|
||||
connect(ui->playButton, SIGNAL(clicked()), this, SLOT(play()));
|
||||
connect(ui->stopButton, SIGNAL(clicked()), this, SLOT(stop()));
|
||||
connect(ui->pauseButton, SIGNAL(clicked()), this, SLOT(pause()));
|
||||
connect(ui->fadeInButton, SIGNAL(clicked()), this, SLOT(fadeIn()));
|
||||
connect(ui->fadeOutButton, SIGNAL(clicked()), this, SLOT(fadeOut()));
|
||||
connect(ui->muteButton, SIGNAL(clicked()), this, SLOT(mute()));
|
||||
}
|
||||
|
||||
|
||||
CueTrackWidget::~CueTrackWidget()
|
||||
{
|
||||
delete ui;
|
||||
|
@ -34,9 +39,9 @@ void CueTrackWidget::loadCueTrack(CueTrack* track)
|
|||
ui->pitch->display(track->pitch);
|
||||
ui->bus1->display(track->bus1);
|
||||
ui->bus2->display(track->bus2);
|
||||
ui->fade->setValue(track->fadeIn);
|
||||
ui->waitIn->setValue(track->waitIn);
|
||||
ui->waitOut->setValue(track->waitOut);
|
||||
ui->fade->display(track->fadeIn);
|
||||
ui->waitIn->display(track->waitIn);
|
||||
ui->waitOut->display(track->waitOut);
|
||||
ui->halt->setChecked(track->stopAtEnd);
|
||||
QFileInfo fileInfo(track->filePath.data());
|
||||
fileInfo.fileName().truncate(64);
|
||||
|
@ -44,6 +49,7 @@ void CueTrackWidget::loadCueTrack(CueTrack* track)
|
|||
ui->status->setText(statusToString(track->status));
|
||||
ui->audioLayer->display(track->audioLayer);
|
||||
ui->multi->setChecked(track->multi);
|
||||
ui->fadeOut->display(track->fadeOut);
|
||||
}
|
||||
|
||||
void CueTrackWidget::go()
|
||||
|
@ -95,4 +101,48 @@ void CueTrackWidget::setNextCue()
|
|||
{
|
||||
ui->cueProgressBar->setDisabled(true);
|
||||
ui->cueProgressBar->hide();
|
||||
ui->audioControlLayout->setEnabled(false);
|
||||
QList<int> list = { 1, 0 };
|
||||
ui->cueValues->setSizes(list);
|
||||
}
|
||||
|
||||
void CueTrackWidget::play()
|
||||
{
|
||||
QString t = ui->status->text();
|
||||
emit changeStatus(ui->audioLayer->intValue(), stringToStatus(&t));
|
||||
}
|
||||
|
||||
void CueTrackWidget::stop()
|
||||
{
|
||||
emit changeStatus(ui->audioLayer->intValue(), Status::Stopped);
|
||||
}
|
||||
|
||||
void CueTrackWidget::pause()
|
||||
{
|
||||
emit changeStatus(ui->audioLayer->intValue(), Status::Paused);
|
||||
}
|
||||
|
||||
void CueTrackWidget::fadeIn()
|
||||
{
|
||||
emit changeVol(ui->audioLayer->intValue(), Slider::Volume, ui->vol->value() * 655.35, ui->fade->value() * 1000, ui->fadeOut->value() * 1000);
|
||||
muted = false;
|
||||
}
|
||||
|
||||
void CueTrackWidget::fadeOut()
|
||||
{
|
||||
emit changeVol(ui->audioLayer->intValue(), Slider::Volume, 0, ui->fade->value() * 1000, ui->fadeOut->value() * 1000);
|
||||
muted = true;
|
||||
}
|
||||
|
||||
void CueTrackWidget::mute()
|
||||
{
|
||||
if (muted)
|
||||
{
|
||||
emit changeVol(ui->audioLayer->intValue(), Slider::Volume, ui->vol->value() * 655.35, 0, 0);
|
||||
muted = false;
|
||||
}
|
||||
else {
|
||||
emit changeVol(ui->audioLayer->intValue(), Slider::Volume, 0, 0, 0);
|
||||
muted = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,26 +19,34 @@ public:
|
|||
explicit CueTrackWidget(QWidget *parent = nullptr);
|
||||
~CueTrackWidget();
|
||||
|
||||
private:
|
||||
Ui::CueTrackWidget *ui;
|
||||
QTimeLine tlFade;
|
||||
QTimeLine tlWaitIn;
|
||||
QTimeLine tlWaitOut;
|
||||
|
||||
public slots:
|
||||
void loadCueTrack(CueTrack* track);
|
||||
void go();
|
||||
void setNextCue();
|
||||
|
||||
private:
|
||||
Ui::CueTrackWidget *ui;
|
||||
QTimeLine tlFade;
|
||||
QTimeLine tlWaitIn;
|
||||
QTimeLine tlWaitOut;
|
||||
bool muted = false;
|
||||
|
||||
private slots:
|
||||
void fadeSlot();
|
||||
void waitInSlot();
|
||||
void waitOutSlot();
|
||||
void play();
|
||||
void stop();
|
||||
void pause();
|
||||
void fadeIn();
|
||||
void fadeOut();
|
||||
void mute();
|
||||
|
||||
signals:
|
||||
void cueFinished(int layer);
|
||||
void goAction(int layer);
|
||||
void NewFunction(CueTrack *track);
|
||||
void changeStatus(int layer, Status status);
|
||||
void changeVol(int layer, Slider s, int value, int fadein, int fadeout);
|
||||
};
|
||||
|
||||
#endif // CUETRACKWIDGET_H
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -52,6 +52,7 @@ Settings::~Settings() {
|
|||
|
||||
void Settings::settingsLoader()
|
||||
{
|
||||
qDebug() << "loading settings from system";
|
||||
beginGroup("lmsAudio");
|
||||
m_ui = value("ui", 0).toBool();
|
||||
m_dmxActive = value("dmxActive", 0).toBool();
|
||||
|
@ -118,6 +119,7 @@ void Settings::settingsSaver()
|
|||
// - Audio device id
|
||||
// - Show Ui, showPlayer
|
||||
void Settings::readFromFile(QString file) {
|
||||
qDebug() << "loading settings from xml file " << file;
|
||||
QFile* xmlFile = new QFile(file);
|
||||
if (!xmlFile->open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QMessageBox::critical(NULL,"Load XML File Problem",
|
||||
|
|
|
@ -83,7 +83,7 @@ void ShowPlayer::fade(Slider s, int start, CueTrack *track) {
|
|||
|
||||
void ShowPlayer::updateTrackStateInEngine(CueTrack *track) {
|
||||
emit uiSliderChangedFaded(track->audioLayer, Slider::Volume, track->volume * 655.35, track->fadeIn * 1000, track->fadeOut * 1000);
|
||||
if (prevCue[track->audioLayer] != nullptr) {
|
||||
if (track->fadeIn != 0 && prevCue[track->audioLayer] != nullptr) {
|
||||
if (prevCue[track->audioLayer]->pan != track->pan)
|
||||
fade(Slider::Pan, prevCue[track->audioLayer]->pan, track);
|
||||
if (prevCue[track->audioLayer]->pitch != track->pitch)
|
||||
|
@ -139,6 +139,8 @@ CueTrackWidget *ShowPlayer::addCueTrackWidget(CueTrack* track) {
|
|||
widget->loadCueTrack(track);
|
||||
connect(widget, SIGNAL(goAction(int)), this, SLOT(goAction(int)));
|
||||
connect(widget, SIGNAL(cueFinished(int)), this, SLOT(cueFinished(int)));
|
||||
connect(widget, SIGNAL(changeStatus(int, Status)), this, SIGNAL(uiPlaybackChanged(int, Status)));
|
||||
connect(widget, SIGNAL(changeVol(int, Slider, int, int, int)), this, SIGNAL(uiSliderChangedFaded(int, Slider, int, int, int)));
|
||||
cueTrackWidgetPlaying[track->audioLayer] = widget;
|
||||
item->setSizeHint(widget->sizeHint());
|
||||
ui->activeCueList->setItemWidget(item, widget);
|
||||
|
|
|
@ -59,8 +59,8 @@ private slots:
|
|||
|
||||
signals:
|
||||
void uiPlaybackChanged(int layer, Status s);
|
||||
void uiSliderChanged(int layer, Slider s, int vol);
|
||||
void uiSliderChangedFaded(int layer, Slider s, int vol, int fadeIn, int fadeOut);
|
||||
void uiSliderChanged(int layer, Slider s, int value);
|
||||
void uiSliderChangedFaded(int layer, Slider s, int value, int fadeIn, int fadeOut);
|
||||
void uiLoadMedia(int layer, QString s);
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue