Skip to content

Commit

Permalink
More align fseq with fpp, change extended block count to a minor vers…
Browse files Browse the repository at this point in the history
…ion bump (although nothing uses it yet)
  • Loading branch information
dkulp committed Nov 19, 2020
1 parent b4d3394 commit e33c065
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
3 changes: 3 additions & 0 deletions xLights/FSEQFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,9 @@ V2FSEQFile::V2FSEQFile(const std::string &fn, FILE *file, const std::vector<uint
m_compressionType(none),
m_handler(nullptr)
{
if (m_seqVersionMajor == 2 && m_seqVersionMinor > 1) {
LogErr(VB_SEQUENCE, "Unknown minor version: %d. FSEQ may not load properly.\n", m_seqVersionMinor);
}
if (header[0] == V1ESEQ_HEADER_IDENTIFIER) {
m_compressionType = CompressionType::none;

Expand Down
14 changes: 12 additions & 2 deletions xLights/FSEQFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class FSEQFile {
virtual FrameData *getFrame(uint32_t frame) = 0;

//For writing to the fseq file
virtual void enableMinorVersionFeatures(uint8_t ver) {}
virtual void initializeFromFSEQ(const FSEQFile& fseq);
virtual void writeHeader() = 0;
virtual void addFrame(uint32_t frame,
Expand Down Expand Up @@ -174,8 +175,17 @@ class V2FSEQFile : public FSEQFile {

virtual uint32_t getMaxChannel() const override;

void allowExtendedBlocks(bool a = true) { m_allowExtendedBlocks = a; }

virtual void enableMinorVersionFeatures(uint8_t ver) override {
if (ver == 0) {
m_allowExtendedBlocks = false;
m_seqVersionMinor = 0;
}
if (ver >= 1) {
m_allowExtendedBlocks = true;
m_seqVersionMinor = 1;
}
}

CompressionType m_compressionType;
int m_compressionLevel;
std::vector<std::pair<uint32_t, uint32_t>> m_sparseRanges;
Expand Down

0 comments on commit e33c065

Please sign in to comment.