diff --git a/webaccess/src/webaccess.cpp b/webaccess/src/webaccess.cpp index d938bae29d..85efe8768a 100644 --- a/webaccess/src/webaccess.cpp +++ b/webaccess/src/webaccess.cpp @@ -1313,20 +1313,34 @@ QString WebAccess::getCueListHTML(VCCueList *cue) QString topStepBgColor = "inherit"; QString bottomStepBgColor = "inherit"; - if (cue->primaryTop()) { + QString playbackButtonImage = "player_play.png"; + bool playbackButtonPaused = false; + QString stopButtonImage = "player_stop.png"; + bool stopButtonPaused = false; + + Chaser *chaser = cue->chaser(); + Doc *doc = m_vc->getDoc(); + + if (cue->primaryTop()) + { topStepBgColor = cue->topStepValue() != "" ? "#4E8DDE" : "inherit"; bottomStepBgColor = cue->sideFaderMode() == VCCueList::FaderMode::Steps && cue->bottomStepValue() != "" ? "#4E8DDE" : cue->bottomStepValue() != "" ? "orange" : "inherit"; - } else { + } + else + { topStepBgColor = cue->topStepValue() != "" ? "orange" : "inherit"; bottomStepBgColor = cue->sideFaderMode() == VCCueList::FaderMode::Steps || cue->bottomStepValue() != "" ? "#4E8DDE" : "inherit"; } // fader mode - if (cue->sideFaderMode() != VCCueList::FaderMode::None) { + if (cue->sideFaderMode() != VCCueList::FaderMode::None) + { str += "
"; str += "
id())+"\" " - "style=\"display: " + (cue->isSideFaderVisible() ? "block" : "none") + "; width: 45px; height: " + QString::number(cue->height() - 2) + "px;\">"; - if (cue->sideFaderMode() == VCCueList::FaderMode::Crossfade) { + "style=\"display: " + (cue->isSideFaderVisible() ? "block" : "none") + "; width: 45px; height: " + + QString::number(cue->height() - 2) + "px;\">"; + if (cue->sideFaderMode() == VCCueList::FaderMode::Crossfade) + { str += "
"; str += "
id())+"\" class=\"vcslLabel\" style=\"top:0px;\">" + cue->topPercentageValue() + "
\n"; @@ -1336,7 +1350,8 @@ QString WebAccess::getCueListHTML(VCCueList *cue) str += "id())+"\" " "oninput=\"cueCVchange("+QString::number(cue->id())+");\" ontouchmove=\"cueCVchange("+QString::number(cue->id())+");\" " - "style=\"width: " + QString::number(cue->height() - 100) + "px; margin-top: " + QString::number(cue->height() - 100) + "px; margin-left: 22px;\" "; + "style=\"width: " + QString::number(cue->height() - 100) + "px; margin-top: " + + QString::number(cue->height() - 100) + "px; margin-left: 22px;\" "; str += "min=\"0\" max=\"100\" step=\"1\" value=\"" + QString::number(cue->sideFaderValue()) + "\">\n"; str += "
id())+"\" class=\"vcslLabel\" " @@ -1346,14 +1361,16 @@ QString WebAccess::getCueListHTML(VCCueList *cue) cue->bottomPercentageValue() + "
\n"; str += "
"; } - if (cue->sideFaderMode() == VCCueList::FaderMode::Steps) { + if (cue->sideFaderMode() == VCCueList::FaderMode::Steps) + { str += "
"; str += "
id())+"\" class=\"vcslLabel\" style=\"top:0px;\">" + cue->topPercentageValue() + "
\n"; str += "id())+"\" " "oninput=\"cueCVchange("+QString::number(cue->id())+");\" ontouchmove=\"cueCVchange("+QString::number(cue->id())+");\" " - "style=\"width: " + QString::number(cue->height() - 50) + "px; margin-top: " + QString::number(cue->height() - 50) + "px; margin-left: 22px;\" "; + "style=\"width: " + QString::number(cue->height() - 50) + "px; margin-top: " + + QString::number(cue->height() - 50) + "px; margin-left: 22px;\" "; str += "min=\"0\" max=\"255\" step=\"1\" value=\"" + QString::number(cue->sideFaderValue()) + "\">\n"; str += "
id())+"\" class=\"vcslLabel\" style=\"bottom:25px; border: solid 1px #aaa; \">" + @@ -1372,8 +1389,7 @@ QString WebAccess::getCueListHTML(VCCueList *cue) str += "" + tr("Fade Out") + ""; str += "" + tr("Duration") + ""; str += "" + tr("Notes") + "\n"; - Chaser *chaser = cue->chaser(); - Doc *doc = m_vc->getDoc(); + if (chaser != NULL) { for (int i = 0; i < chaser->stepsCount(); i++) @@ -1473,11 +1489,15 @@ QString WebAccess::getCueListHTML(VCCueList *cue) // progress bar str += "
"; - str += "
id())+"\" style=\"width: " +QString::number(cue->progressPercent())+ "%; \">
"; - str += "
id())+"\">" + QString(cue->progressText()) + "
"; + str += "
id())+"\" style=\"width: " + + QString::number(cue->progressPercent())+ "%; \">
"; + str += "
id())+"\">" + + QString(cue->progressText()) + "
"; str += "
"; + // play, stop, next, and preview buttons - if (cue->sideFaderMode() != VCCueList::FaderMode::None) { + if (cue->sideFaderMode() != VCCueList::FaderMode::None) + { str += "
"; str += "id()) + "\" "; str += "href=\"javascript:wsShowCrossfadePanel(" + QString::number(cue->id()) + ");\">\n"; @@ -1485,30 +1505,32 @@ QString WebAccess::getCueListHTML(VCCueList *cue) } str += "
"; - QString playbackButtonImage = "player_play.png"; - bool playbackButtonPaused = false; - QString stopButtonImage = "player_stop.png"; - bool stopButtonPaused = false; - - if (chaser->isRunning()) { - if (cue->playbackLayout() == VCCueList::PlayPauseStop) { - if (chaser->isPaused()) { + if (chaser != NULL && chaser->isRunning()) + { + if (cue->playbackLayout() == VCCueList::PlayPauseStop) + { + if (chaser->isPaused()) + { playbackButtonImage = "player_play.png"; playbackButtonPaused = true; - } else { + } + else + { playbackButtonImage = "player_pause.png"; } - } else if (cue->playbackLayout() == VCCueList::PlayStopPause) { + } + else if (cue->playbackLayout() == VCCueList::PlayStopPause) + { playbackButtonImage = "player_stop.png"; stopButtonImage = "player_pause.png"; - if (chaser->isPaused()) { + if (chaser->isPaused()) stopButtonPaused = true; - } } - } else { - if (cue->playbackLayout() == VCCueList::PlayStopPause) { + } + else + { + if (cue->playbackLayout() == VCCueList::PlayStopPause) stopButtonImage = "player_pause.png"; - } } str += "id()) + "\" ";