diff --git a/documentation/xlDo Commands.txt b/documentation/xlDo Commands.txt index 7798eb981..05372593a 100644 --- a/documentation/xlDo Commands.txt +++ b/documentation/xlDo Commands.txt @@ -31,11 +31,11 @@ GET /closeSequence - closes the sequence force=true to close even if there are unsaved changes GET /newSequence - Needs two query params: + Needs either duration or media query params: duration= Time in seconds media= Media filename frameMS= frame time in MS (typically 25 or 50 or 0) optional - view= view to use for mast view ("Empty", "All Models" or a valid view name) optional + view= view to use for master view ("Empty", "All Models" or a valid view name) optional GET /saveSequence seq= Sequence name to save as, don't specify to use current name diff --git a/xLights/SeqFileUtilities.cpp b/xLights/SeqFileUtilities.cpp index a487b36c2..c69b3c615 100644 --- a/xLights/SeqFileUtilities.cpp +++ b/xLights/SeqFileUtilities.cpp @@ -110,6 +110,13 @@ void xLightsFrame::NewSequence(const std::string& media, uint32_t durationMS, ui return; } + bool wizardactive; + if (media.empty() && durationMS == 0) { + wizardactive = true; + } else { + wizardactive = false; + } + // assign global xml file object wxFileName xml_file; xml_file.SetPath(CurrentDir); @@ -119,10 +126,13 @@ void xLightsFrame::NewSequence(const std::string& media, uint32_t durationMS, ui CurrentSeqXmlFile->setSupportsModelBlending(false); } - SeqSettingsDialog setting_dlg(this, CurrentSeqXmlFile, mediaDirectories, wxT(""), _defaultSeqView, true, media, durationMS); - setting_dlg.Fit(); - int ret_code = setting_dlg.ShowModal(); - if (ret_code == wxID_CANCEL) { + SeqSettingsDialog setting_dlg(this, CurrentSeqXmlFile, mediaDirectories, wxT(""), _defaultSeqView, wizardactive, media, durationMS); + int ret_code = wxID_ANY; + if(wizardactive) { + setting_dlg.Fit(); + ret_code = setting_dlg.ShowModal(); + } + if (wizardactive && ret_code == wxID_CANCEL) { delete CurrentSeqXmlFile; CurrentSeqXmlFile = nullptr; return; diff --git a/xLights/SeqSettingsDialog.cpp b/xLights/SeqSettingsDialog.cpp index d14c189de..83f89bcb7 100644 --- a/xLights/SeqSettingsDialog.cpp +++ b/xLights/SeqSettingsDialog.cpp @@ -569,13 +569,17 @@ SeqSettingsDialog::SeqSettingsDialog(wxWindow* parent, xLightsXmlFile* file_to_h wxFileName name_and_path(media); MediaLoad(name_and_path); - EndModal(wxID_OK); + if (wizard_active) { + EndModal(wxID_OK); + } } else if (durationMS != 0) { float d = (float)(durationMS) / 1000.0f; TextCtrl_Xml_Seq_Duration->SetValue(wxString::Format("%f", d)); UpdateSequenceTiming(); - EndModal(wxID_OK); + if (wizard_active) { + EndModal(wxID_OK); + } } }