mirror of
https://github.com/yokemura/Magical8bitPlug2.git
synced 2025-05-24 23:00:21 -04:00
Added new parse warning message
This commit is contained in:
parent
6583979011
commit
411d3b4868
@ -153,6 +153,10 @@ void CustomEnvelopeComponent::textEditorTextChanged (TextEditor& editor)
|
|||||||
|
|
||||||
ParseError err = kParseErrorNone;
|
ParseError err = kParseErrorNone;
|
||||||
processor.settingRefs.setSequenceWithString (paramType, txt, &err);
|
processor.settingRefs.setSequenceWithString (paramType, txt, &err);
|
||||||
|
|
||||||
|
ColorScheme cs = ColorScheme (processor.settingRefs.colorSchemeType());
|
||||||
|
Colour c = (err < kParseErrorLevelFatal) ? cs.main : cs.warning;
|
||||||
|
label->setColour (juce::Label::textColourId, c);
|
||||||
|
|
||||||
if (err == kParseErrorValueOutOfRange)
|
if (err == kParseErrorValueOutOfRange)
|
||||||
{
|
{
|
||||||
|
@ -14,6 +14,18 @@ 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:
|
||||||
|
return TRANS ("Repeat section is empty");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case kParseWarningReleaseSegmentEmpty:
|
||||||
|
return TRANS ("Release section 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,6 +15,9 @@ enum ParseError
|
|||||||
{
|
{
|
||||||
kParseErrorNone = 0,
|
kParseErrorNone = 0,
|
||||||
kParseErrorLevelWarning,
|
kParseErrorLevelWarning,
|
||||||
|
kParseWarningPreRepeatSegmentEmpty,
|
||||||
|
kParseWarningRepeatSegmentEmpty,
|
||||||
|
kParseWarningReleaseSegmentEmpty,
|
||||||
kParseErrorLevelFatal,
|
kParseErrorLevelFatal,
|
||||||
kParseErrorDuplicatedReleaseDelimiter,
|
kParseErrorDuplicatedReleaseDelimiter,
|
||||||
kParseErrorDuplicatedOpenBracket,
|
kParseErrorDuplicatedOpenBracket,
|
||||||
|
@ -438,6 +438,9 @@ 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);
|
||||||
@ -456,6 +459,10 @@ FrameSequence FrameSequenceParser::parse (const String& input,
|
|||||||
{
|
{
|
||||||
return fs;
|
return fs;
|
||||||
}
|
}
|
||||||
|
if (repeatSeq.size() == 0) {
|
||||||
|
// Repeat section is defined but content is empty
|
||||||
|
*error = kParseWarningRepeatSegmentEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
// Add the result to working frameSequence
|
// Add the result to working frameSequence
|
||||||
fs.sequence.insert (fs.sequence.end(), repeatSeq.begin(), repeatSeq.end());
|
fs.sequence.insert (fs.sequence.end(), repeatSeq.begin(), repeatSeq.end());
|
||||||
@ -477,6 +484,10 @@ FrameSequence FrameSequenceParser::parse (const String& input,
|
|||||||
{
|
{
|
||||||
return fs;
|
return fs;
|
||||||
}
|
}
|
||||||
|
if (releaseSeq.size() == 0) {
|
||||||
|
// Release section is defined but content is empty
|
||||||
|
*error = kParseWarningRepeatSegmentEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
// Add the result to working frameSequence
|
// Add the result to working frameSequence
|
||||||
fs.sequence.insert (fs.sequence.end(), releaseSeq.begin(), releaseSeq.end());
|
fs.sequence.insert (fs.sequence.end(), releaseSeq.begin(), releaseSeq.end());
|
||||||
|
Loading…
Reference in New Issue
Block a user