mirror of
https://github.com/yokemura/Magical8bitPlug2.git
synced 2025-05-24 23:00:21 -04:00
Fixed envelope main section empty error
This commit is contained in:
parent
68253130fa
commit
1d3c91d6e1
@ -328,7 +328,6 @@ public:
|
|||||||
expect(result30.valueAt(1) == 2);
|
expect(result30.valueAt(1) == 2);
|
||||||
expect(result30.loopStartIndex == 0);
|
expect(result30.loopStartIndex == 0);
|
||||||
expect(result30.releaseSequenceStartIndex == 1);
|
expect(result30.releaseSequenceStartIndex == 1);
|
||||||
expect(error = kParseWarningPreRepeatSegmentEmpty);
|
|
||||||
|
|
||||||
beginTest ("Empty segment warning(in-repeat)");
|
beginTest ("Empty segment warning(in-repeat)");
|
||||||
error = kParseErrorNone;
|
error = kParseErrorNone;
|
||||||
|
@ -14,10 +14,6 @@ String getParseErrorString (ParseError err, int minValue, int maxValue)
|
|||||||
{
|
{
|
||||||
switch (err)
|
switch (err)
|
||||||
{
|
{
|
||||||
case kParseWarningPreRepeatSegmentEmpty:
|
|
||||||
return TRANS ("Main body of the sequence is empty");
|
|
||||||
break;
|
|
||||||
|
|
||||||
case kParseWarningRepeatSegmentEmpty:
|
case kParseWarningRepeatSegmentEmpty:
|
||||||
return TRANS ("Repeat section is empty");
|
return TRANS ("Repeat section is empty");
|
||||||
break;
|
break;
|
||||||
@ -26,6 +22,10 @@ String getParseErrorString (ParseError err, int minValue, int maxValue)
|
|||||||
return TRANS ("Release section is empty");
|
return TRANS ("Release section is empty");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case kParseErrorPreReleaseSegmentEmpty:
|
||||||
|
return TRANS ("Main body of the sequence is empty");
|
||||||
|
break;
|
||||||
|
|
||||||
case kParseErrorDuplicatedReleaseDelimiter:
|
case kParseErrorDuplicatedReleaseDelimiter:
|
||||||
return TRANS ("You cannot use \"|\" more than once");
|
return TRANS ("You cannot use \"|\" more than once");
|
||||||
break;
|
break;
|
||||||
|
@ -15,10 +15,10 @@ enum ParseError
|
|||||||
{
|
{
|
||||||
kParseErrorNone = 0,
|
kParseErrorNone = 0,
|
||||||
kParseErrorLevelWarning,
|
kParseErrorLevelWarning,
|
||||||
kParseWarningPreRepeatSegmentEmpty,
|
|
||||||
kParseWarningRepeatSegmentEmpty,
|
kParseWarningRepeatSegmentEmpty,
|
||||||
kParseWarningReleaseSegmentEmpty,
|
kParseWarningReleaseSegmentEmpty,
|
||||||
kParseErrorLevelFatal,
|
kParseErrorLevelFatal,
|
||||||
|
kParseErrorPreReleaseSegmentEmpty,
|
||||||
kParseErrorDuplicatedReleaseDelimiter,
|
kParseErrorDuplicatedReleaseDelimiter,
|
||||||
kParseErrorDuplicatedOpenBracket,
|
kParseErrorDuplicatedOpenBracket,
|
||||||
kParseErrorDuplicatedCloseBracket,
|
kParseErrorDuplicatedCloseBracket,
|
||||||
|
@ -438,9 +438,6 @@ FrameSequence FrameSequenceParser::parse (const String& input,
|
|||||||
{
|
{
|
||||||
return fs;
|
return fs;
|
||||||
}
|
}
|
||||||
if (sequence.size() == 0) {
|
|
||||||
*error = kParseWarningPreRepeatSegmentEmpty;
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.sequence = sequence;
|
fs.sequence = sequence;
|
||||||
fs.sequence.reserve (1000);
|
fs.sequence.reserve (1000);
|
||||||
@ -470,6 +467,10 @@ FrameSequence FrameSequenceParser::parse (const String& input,
|
|||||||
// Set repeatEndIndex according to current working frameSequence length
|
// Set repeatEndIndex according to current working frameSequence length
|
||||||
fs.releaseSequenceStartIndex = (int)fs.sequence.size();
|
fs.releaseSequenceStartIndex = (int)fs.sequence.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fs.sequence.size() == 0) {
|
||||||
|
*error = kParseErrorPreReleaseSegmentEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
if (hasRelease) // If release exists:
|
if (hasRelease) // If release exists:
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user