Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix newSequence Lua call #5134 #5135

Merged
merged 1 commit into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions documentation/xlDo Commands.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 14 additions & 4 deletions xLights/SeqFileUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
8 changes: 6 additions & 2 deletions xLights/SeqSettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand Down