Skip to content

Commit 797476b

Browse files
authored
Merge branch 'release-1.0.1' into DeltaEpsilon7787-patch-1
2 parents bb570c1 + 2c3cbdd commit 797476b

File tree

7 files changed

+76
-31
lines changed

7 files changed

+76
-31
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
# Enable version updates for GitHub Actions
9+
- package-ecosystem: "github-actions"
10+
# Look for GitHub Actions workflows in the `root` directory
11+
directory: "/"
12+
# Check the for updates once a week
13+
schedule:
14+
interval: "weekly"

.github/workflows/windows.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
name: Windows Build
1+
name: Build & Latest Beta
22

33
on:
44
push:
5-
branches: ["main"]
5+
pull_request:
6+
paths-ignore:
7+
- '**.md'
68

79
jobs:
810
windows:
@@ -11,6 +13,8 @@ jobs:
1113
defaults:
1214
run:
1315
working-directory: ${{github.workspace}}/main
16+
permissions:
17+
contents: read
1418
steps:
1519
- name: Get AV
1620
uses: actions/checkout@v3
@@ -24,7 +28,8 @@ jobs:
2428
unzip oggenc.zip -d .
2529
- name: Build AV
2630
run: msbuild build\VisualStudio\ArrowVortex.vcxproj /p:Configuration=Release /p:Platform=x64
27-
- name: Collect into a zip
31+
- name: Collect into a directory
32+
if: github.ref_name == 'beta'
2833
run: |
2934
mkdir AV
3035
cd AV
@@ -35,3 +40,10 @@ jobs:
3540
cp ../oggenc2.exe .
3641
cd ..
3742
7z.exe a -tzip av.zip AV
43+
- name: Upload artifact
44+
if: github.ref_name == 'beta'
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: AV
48+
path: main/AV/
49+
if-no-files-found: error

CREDITS

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,27 @@ status of the original code as provided to them.
2727

2828
Code from the following projects is included in this repository:
2929

30-
1. freetype, using the FreeType License, which is compatible with GPLv3
31-
See lib/freetype/ for more info.
30+
1. freetype , using the FreeType License, which is compatible with GPLv3
31+
See lib/freetype/ or https://freetype.org/license.html for more info.
3232

3333
2. libogg & libvorbis, using its BSD-style license, which is compatible with
34-
GPLv3. See lib/libvorbis/license for more info.
34+
GPLv3. See lib/libvorbis/license or https://gitlab.xiph.org/xiph for more info.
3535

3636
3. libmad, using the GPL license (libmad allows for GPLv2 or any later version)
37-
See lib/freetype/ for more info.
37+
See lib/freetype/ or https://www.underbit.com/products/mad/ for more info.
3838

3939
4. lua, using its GPLv3-compatible permissive license
40-
See lib/lua/ for more info.
40+
See lib/lua/ or https://www.lua.org/license.html for more info.
4141

4242
5. Code from liir.c by Exstrom Labratories, which is GPL, is present in
4343
src/Editor/Butterworth.cpp
44+
https://www.exstrom.com/journal/sigproc/dsigproc.html
4445

4546
6. Code from Takuya OOURA's General Purpose FFT Package, which is released
4647
freely, is present in src/Editor/FFT.cpp
48+
https://www.kurims.kyoto-u.ac.jp/~ooura/fft.html
4749

4850
7. Code from the aubio library, which is also GPLv3, is present in
4951
src/Editor/Aubio.h and src/Editor/FindOnsets.cpp
52+
https://github.com/aubio/aubio
5053

src/Editor/LoadMp3.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <stdio.h>
66
#include <string.h>
7+
#include <memory>
78

89
#include <System/File.h>
910

@@ -431,19 +432,18 @@ int MP3Loader::readFrames(int frames, short* buffer)
431432

432433
SoundSource* LoadMP3(FileReader* file, String& title, String& artist)
433434
{
434-
MP3Loader* loader = new MP3Loader;
435+
std::unique_ptr<MP3Loader> loader = std::make_unique<MP3Loader>();
435436
loader->file = file;
436437

437438
// Decode and synth the first frame to check if the file is valid.
438439
if(!loader->decodeFirstFrame())
439440
{
440441
loader->file = nullptr;
441-
delete loader;
442442
return nullptr;
443443
}
444444

445445
// The file is valid, return the MP3 loader.
446-
return loader;
446+
return loader.release();
447447
}
448448

449449
}; // namespace Vortex

src/Editor/LoadWav.cpp

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@ namespace {
1414
#pragma pack(1)
1515
struct WaveHeader
1616
{
17-
uint8_t chunkId[4];
17+
uint8_t chunkId[4]; // "RIFF"
1818
uint32_t chunkSize;
19-
uint8_t format[4];
20-
uint8_t subChunkId[4];
21-
uint32_t subChunkSize;
19+
uint8_t format[4]; // "WAVE"
20+
uint8_t subchunk1Id[4]; // "fmt "
21+
uint32_t subchunk1Size;
2222
uint16_t audioFormat;
2323
uint16_t numChannels;
2424
uint32_t sampleRate;
2525
uint32_t byteRate;
2626
uint16_t blockAlign;
27-
uint16_t bps;
27+
uint16_t bitsPerSample;
2828
};
2929
struct WaveData
3030
{
@@ -72,32 +72,38 @@ SoundSource* LoadWav(FileReader* file, String& title, String& artist)
7272
if(file->read(&header, sizeof(WaveHeader), 1) == 0
7373
|| memcmp(header.chunkId, "RIFF", 4) != 0
7474
|| memcmp(header.format, "WAVE", 4) != 0
75-
|| memcmp(header.subChunkId, "fmt ", 4) != 0
75+
|| memcmp(header.subchunk1Id, "fmt ", 4) != 0
7676
|| header.audioFormat != 1
7777
|| header.sampleRate == 0
7878
|| header.numChannels == 0
79-
|| (header.bps != 8 && header.bps != 16 && header.bps != 24))
79+
|| (header.bitsPerSample != 8 && header.bitsPerSample != 16 && header.bitsPerSample != 24))
8080
{
8181
return nullptr;
8282
}
8383

8484
// Skip over additional parameters at the end of the format chunk.
85-
file->skip(header.subChunkSize - 16);
85+
if (header.subchunk1Size > 16)
86+
{
87+
size_t extraBytes = static_cast<size_t>(header.subchunk1Size) - 16;
88+
file->skip(extraBytes);
89+
}
8690

8791
// Read the start of the data chunk.
8892
WaveData data;
89-
if(file->read(&data, sizeof(WaveData), 1) == 0
90-
|| memcmp(data.chunkId, "data", 4) != 0)
91-
{
92-
return nullptr;
93+
while (true) {
94+
if (file->read(&data, sizeof(WaveData), 1) == 0)
95+
return nullptr;
96+
if (memcmp(data.chunkId, "data", 4) == 0)
97+
break;
98+
file->skip(data.chunkSize);
9399
}
94100

95101
// Create a wav loader that will read the contents of the data chunk.
96102
WavLoader* loader = new WavLoader;
97103

98104
loader->frequency = header.sampleRate;
99105
loader->numChannels = header.numChannels;
100-
loader->bytesPerSample = header.bps / 8;
106+
loader->bytesPerSample = header.bitsPerSample / 8;
101107
loader->numFrames = data.chunkSize / (loader->bytesPerSample * loader->numChannels);
102108
loader->numFramesLeft = loader->numFrames;
103109
loader->file = file;

src/Editor/View.cpp

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,14 +95,14 @@ void loadSettings(XmrNode& settings)
9595
view->get("useReverseScroll", &myUseReverseScroll);
9696
view->get("useChartPreview" , &myUseChartPreview);
9797
view->get("customSnap", &myCustomSnap);
98+
view->get("zoomLevel", &myZoomLevel);
99+
view->get("scaleLevel", &myScaleLevel);
100+
view->get("receptorX", &myReceptorX);
101+
view->get("receptorY", &myReceptorY);
98102

99103
myCustomSnap = min(max(myCustomSnap, 1), 192);
100-
101-
// if myUseReverseScroll is set, the receptor Y position must be inverted.
102-
if (myUseReverseScroll)
103-
{
104-
myReceptorY = rect_.h - myReceptorY;
105-
}
104+
myZoomLevel = min(max(myZoomLevel, -2.0), 16.0);
105+
myScaleLevel = min(max(myScaleLevel, 1.0), 10.0);
106106
}
107107

108108
updateScrollValues();
@@ -115,9 +115,13 @@ void saveSettings(XmrNode& settings)
115115
if(!view) view = settings.addChild("view");
116116

117117
view->addAttrib("useTimeBasedView", myUseTimeBasedView);
118-
view->addAttrib("customSnap", (long)myCustomSnap);
119118
view->addAttrib("useReverseScroll", myUseReverseScroll);
120119
view->addAttrib("useChartPreview", myUseChartPreview);
120+
view->addAttrib("customSnap", (long)myCustomSnap);
121+
view->addAttrib("zoomLevel", (long)myZoomLevel);
122+
view->addAttrib("scaleLevel", (long)myScaleLevel);
123+
view->addAttrib("receptorX", (long)myReceptorX);
124+
view->addAttrib("receptorY", (long)myReceptorY);
121125
}
122126

123127
// ================================================================================================

src/Editor/Waveform.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,12 @@ void sampleEdges(WaveEdge* edges, int w, int h, int channel, int blockId, bool f
457457
return;
458458
}
459459

460+
// A crash can occur if another thread is loading the audio. Just do nothing if it is.
461+
if (!music.isAllocated())
462+
{
463+
return;
464+
}
465+
460466
double sampleSkip = max(0.001, (samplesPerPixel / 200.0));
461467
int wh = w / 2 - 1;
462468

0 commit comments

Comments
 (0)