// methods private bool ErrorTrap( ArrayHandleByte messageUtf8, bool resumable) { if (!resumable) { throw new EvalErrorException(EvalErrors.eEvalErrorTrapEncountered); } if (!mainWindow.InvokeRequired) { bool resume = mainWindow.PromptResumableError(messageUtf8.strings); if (!resume) { throw new EvalErrorException(EvalErrors.eEvalErrorTrapEncountered); } } else { // UI interaction must be marshaled to the main UI thread // (see https://msdn.microsoft.com/en-us/library/ms171728%28v=vs.80%29.aspx) interaction = true; MainWindow.PromptResumableErrorDelegate d = new MainWindow.PromptResumableErrorDelegate(mainWindow.PromptResumableError); object o = mainWindow.Invoke(d, new object[] { messageUtf8.strings }); bool resume = (bool)o; if (!resume) { throw new EvalErrorException(EvalErrors.eEvalErrorTrapEncountered); } } return(true); }
private int GetWaveTableFrames( ArrayHandleByte waveTableName) { string name = waveTableName.strings; WaveTableObjectRec waveTable = mainWindow.Document.WaveTableList.Find( delegate(WaveTableObjectRec candidate) { return(String.Equals(name, candidate.Name)); }); if (waveTable == null) { throw new EvalErrorException(EvalErrors.eEvalGetSampleNotDefined); } return(waveTable.NumFrames); }
private ArrayHandleFloat GetSampleMonoArray( ArrayHandleByte sampleName) { string name = sampleName.strings; SampleObjectRec sample = mainWindow.Document.SampleList.Find( delegate(SampleObjectRec candidate) { return(String.Equals(name, candidate.Name)); }); if (sample == null) { throw new EvalErrorException(EvalErrors.eEvalGetSampleNotDefined); } if (sample.NumChannels != NumChannelsType.eSampleMono) { throw new EvalErrorException(EvalErrors.eEvalGetSampleWrongChannelType); } return(new ArrayHandleFloat(sample.SampleData.CopyRawData(ChannelType.eMonoChannel))); }
private ArrayHandleFloat LoadSampleMonoArray( ArrayHandleByte type, ArrayHandleByte name) { return(LoadSampleHelper(ChannelType.eMonoChannel, type.strings, name.strings)); }
private bool PrintString( ArrayHandleByte text) { PrintStringHelper(text.strings); return(true); }
/* the ACTUAL array is added, so you no longer own it after this! */ public void AddArrayToStack(ArrayHandleByte value) { EnsureStackSize1(); ElementArray[NumElements].reference.arrayHandleByte = value; NumElements++; }