Skip to content

Commit 6b98450

Browse files
committed
Pushed v1.03 code
- Bugfix: The MOD2WAV function would write .wav files with a wrong chunk length. Some .wav loaders didn't like this... - Bugfix: Don't allow toggling scope muting with right mouse button while MOD2WAV is ongoing.
1 parent 6340261 commit 6b98450

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/pt2_audio.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1023,10 +1023,10 @@ static int32_t SDLCALL mod2WavThreadFunc(void *ptr)
10231023
wavHeader.numChannels = 2;
10241024
wavHeader.sampleRate = audio.audioFreq;
10251025
wavHeader.bitsPerSample = 16;
1026-
wavHeader.byteRate = wavHeader.sampleRate * wavHeader.numChannels * wavHeader.bitsPerSample / 8;
1027-
wavHeader.blockAlign = wavHeader.numChannels * wavHeader.bitsPerSample / 8;
1026+
wavHeader.byteRate = wavHeader.sampleRate * wavHeader.numChannels * (wavHeader.bitsPerSample / 8);
1027+
wavHeader.blockAlign = wavHeader.numChannels * (wavHeader.bitsPerSample / 8);
10281028
wavHeader.subchunk2ID = 0x61746164; // "data"
1029-
wavHeader.subchunk2Size = totalSampleCounter * 4; // 16-bit stereo = * 4
1029+
wavHeader.subchunk2Size = totalSampleCounter * (wavHeader.bitsPerSample / 8);
10301030

10311031
fwrite(&wavHeader, sizeof (wavHeader_t), 1, fOut);
10321032
fclose(fOut);

src/pt2_header.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <stdint.h>
1414
#include "pt2_unicode.h"
1515

16-
#define PROG_VER_STR "1.02"
16+
#define PROG_VER_STR "1.03"
1717

1818
#ifdef _WIN32
1919
#define DIR_DELIMITER '\\'

src/pt2_mouse.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2142,7 +2142,8 @@ bool handleRightMouseButton(void)
21422142
if (editor.ui.visualizerMode == VISUAL_QUADRASCOPE && input.mouse.y >= 55 && input.mouse.y <= 87)
21432143
{
21442144
if (!editor.ui.posEdScreenShown && !editor.ui.editOpScreenShown && !editor.ui.diskOpScreenShown &&
2145-
!editor.ui.aboutScreenShown && !editor.ui.samplerVolBoxShown && !editor.ui.samplerFiltersBoxShown)
2145+
!editor.ui.aboutScreenShown && !editor.ui.samplerVolBoxShown &&
2146+
!editor.ui.samplerFiltersBoxShown && !editor.isWAVRendering)
21462147
{
21472148
if (input.mouse.x > 127 && input.mouse.x <= 167) editor.muted[0] ^= 1;
21482149
else if (input.mouse.x > 175 && input.mouse.x <= 215) editor.muted[1] ^= 1;

0 commit comments

Comments
 (0)