diff --git a/qml/main.qml b/qml/main.qml index 274ced8..e132f97 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -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); } } } diff --git a/sources/core/waveformparser.cpp b/sources/core/waveformparser.cpp index 3f3a2bc..cd20767 100644 --- a/sources/core/waveformparser.cpp +++ b/sources/core/waveformparser.cpp @@ -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; diff --git a/sources/core/wavreader.cpp b/sources/core/wavreader.cpp index d123ff0..c510fb5 100644 --- a/sources/core/wavreader.cpp +++ b/sources/core/wavreader.cpp @@ -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)))); } {