Beispiel #1
0
        private bool BuildThis(out Synthesizer.EffectSpecListRec effectSpec)
        {
            effectSpec = null;

            if (!Validate()) // ensure all controls commit data to store
            {
                return(false);
            }

            int    ErrorLine;
            string ErrorExtraMessage;

            Synthesizer.BuildInstrErrors Error = Synthesizer.BuildScoreEffectList(
                textBoxEffectBody.Text,
                mainWindow.Document.CodeCenter,
                out ErrorLine,
                out ErrorExtraMessage,
                out effectSpec);
            if (Error != Synthesizer.BuildInstrErrors.eBuildInstrNoError)
            {
                BuildErrorInfo errorInfo = new LiteralBuildErrorInfo(Synthesizer.BuildInstrGetErrorMessageText(Error, ErrorExtraMessage), ErrorLine);
                textBoxEffectBody.Focus();
                textBoxEffectBody.SetSelectionLine(ErrorLine - 1);
                textBoxEffectBody.ScrollToSelection();
                MessageBox.Show(errorInfo.CompositeErrorMessage, "Error", MessageBoxButtons.OK);
                return(false);
            }

            return(true);
        }
Beispiel #2
0
        public override bool EnsureBuilt(
            bool force,
            PcodeSystem.IEvaluationContext pcodeEnvironment,
            BuildFailedCallback failedCallback)
        {
            if (!force && (_scoreEffectSpec != null))
            {
                return(true);
            }
            _scoreEffectSpec = null;

            int    ErrorLine;
            string ErrorExtraMessage;

            Synthesizer.EffectSpecListRec LocalEffectSpec;
            Synthesizer.BuildInstrErrors  Error = Synthesizer.BuildScoreEffectList(
                this.Source,
                ((Document)Parent).CodeCenter,
                out ErrorLine,
                out ErrorExtraMessage,
                out LocalEffectSpec);
            if (Error != Synthesizer.BuildInstrErrors.eBuildInstrNoError)
            {
                failedCallback(this, new LiteralBuildErrorInfo(Synthesizer.BuildInstrGetErrorMessageText(Error, ErrorExtraMessage), ErrorLine));
                return(false);
            }

            _scoreEffectSpec = LocalEffectSpec;
            return(true);
        }
Beispiel #3
0
 public PlayFileWithEffectsGeneratorParams(
     Stream stream,
     AudioFileReader reader,
     Synthesizer.EffectSpecListRec effectSpec,
     IMainWindowServices mainWindow)
 {
     this.stream     = stream;
     this.reader     = reader;
     this.effectSpec = effectSpec;
     this.mainWindow = mainWindow;
 }
Beispiel #4
0
 public override void Unbuild()
 {
     _scoreEffectSpec = null;
 }
Beispiel #5
0
 public override void Unbuild()
 {
     _effectSpec = null;
 }