Skip to content

Commit

Permalink
Merge pull request #25 from lgolouz/lgolouz_zxtr-24
Browse files Browse the repository at this point in the history
Fixed [ZXTR-24] It is unable to read some WAV files
  • Loading branch information
lgolouz authored Oct 20, 2021
2 parents bdd96e5 + 3ecc604 commit 43a5160
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -663,14 +663,14 @@ ApplicationWindow {
Text {
anchors.centerIn: parent
color: parent.parent.blkSelected ? "white" : "black"
text: blkNumber
text: blkNumber + 1
}
}

MouseArea {
anchors.fill: parent
onClicked: {
WaveformParser.toggleBlockSelection(blkNumber - 1);
WaveformParser.toggleBlockSelection(blkNumber);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion sources/core/waveformparser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ QVariantList WaveformParser::getParsedChannelData(uint chNum) const
for (const auto& i: ch) {
QVariantMap m;

m.insert("block", QVariantMap { {"blockSelected", blockNumber < (unsigned) mSelectedBlocks.size() ? mSelectedBlocks[blockNumber] : (mSelectedBlocks.append(true), true)}, {"blockNumber", (++blockNumber, blockNumber)} });
m.insert("block", QVariantMap { {"blockSelected", blockNumber < (unsigned) mSelectedBlocks.size() ? mSelectedBlocks[blockNumber] : (mSelectedBlocks.append(true), true)}, {"blockNumber", blockNumber++} });
if (i.data.size() > 0) {
auto d = i.data.at(0);
int blockType = -1;
Expand Down
3 changes: 3 additions & 0 deletions sources/core/wavreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ WavReader::ErrorCodesEnum WavReader::open()
}

mWavFormatHeader = *fmtHeader;

//File pos aligning according to header data
mWavFile.seek(mWavFile.pos() + (fmtHeader->chunk.chunkDataSize - (sizeof (WavFmt) - sizeof (WavChunk))));
}

{
Expand Down

0 comments on commit 43a5160

Please sign in to comment.