Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.6.2 #85

Merged
merged 4 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
VERSION=2.6.1
VERSION=2.6.2

16 changes: 13 additions & 3 deletions data/crt.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ type CRT struct {
}

func ReadCrtFile(filename string) (crt CRT, err error) {
// A CRT file is a long header containing filter info, followed by a list of CCE fragments (each voice missing the filter params since they are concatenated elsewhere in the file).
// A CRT file is a long header containing filter info, followed by a list of VCE fragments (each voice missing the filter params since they are concatenated elsewhere in the file).

var b []byte

Expand All @@ -50,7 +50,7 @@ func ReadCrtFile(filename string) (crt CRT, err error) {
}

func ReadCrt(buf io.ReadSeeker) (crt CRT, err error) {
// A CRT file is a long header containing filter info, followed by a list of CCE fragments (each voice missing the filter params since they are concatenated elsewhere in the file).
// A CRT file is a long header containing filter info, followed by a list of VCE fragments (each voice missing the filter params since they are concatenated elsewhere in the file).

if err = binary.Read(buf, binary.LittleEndian, &crt.Head); err != nil {
logger.Error("binary.Read failed:", err)
Expand Down Expand Up @@ -259,8 +259,18 @@ type crtCursor struct {
VoiceOffset int64
}

func countVoices(vces []*VCE) (result int) {
result = 0
for _, vce := range vces {
if vce != nil {
result += 1
}
}
return result
}

func WriteCrt(buf io.WriteSeeker, vces []*VCE) (err error) {
if len(vces) < 1 || len(vces) > 24 {
if countVoices(vces) < 1 || countVoices(vces) > 24 {
err = errors.Errorf("Must have at least 1 and no more than 24 voices")
return
}
Expand Down
8 changes: 7 additions & 1 deletion message.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ func handleMessages(_ *astilectron.Window, m bootstrap.MessageIn) (payload inter
return
} else {
logger.Infof("Add vce %s to CRT at slot %d\n", args.VcePath, args.Slot)
args.Crt.Voices[args.Slot-1] = &vce
if len(args.Crt.Voices) < args.Slot {
// grow the slice
newVoices := make([]*data.VCE, args.Slot)
copy(newVoices, args.Crt.Voices)
args.Crt.Voices = newVoices
}
args.Crt.Voices[args.Slot-1] = &vce
payload = args.Crt
}

Expand Down
6 changes: 5 additions & 1 deletion resources/app/static/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ let index = {
}
console.log("INFO NOTIFICATION: " + message)
document.getElementById("alertTitle").innerHTML = "Info";
document.getElementById("alertText").innerHTML = message;
document.getElementById("alertText").innerHTML = message;
// Make alert messages hide themselves after 3s - no need to click
setTimeout(function(){
$('#alertModal').modal('hide');
}, 3000);
$('#alertModal').modal();
},

Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package main

const Version = "2.6.1"
const Version = "2.6.2"
Loading