public void SetState(eGeneratorState stateIN) { switch (stateIN) { case eGeneratorState.initializing: break; case eGeneratorState.ready: break; case eGeneratorState.stopped: { mMeasureEditor.mCurrentMeasure.value = 0; mStaffPlayer.SetBarlineColor(-1, false); break; } case eGeneratorState.playing: break; case eGeneratorState.repeating: break; case eGeneratorState.paused: { if (stateIN == eGeneratorState.editing) { mMeasureEditor.mLoadedClip.mIsPlaying = false; } break; } case eGeneratorState.editing: { mStaffPlayer.ClearNotes(true, mMeasureEditor.mShowEditorHints.isOn == false); break; } case eGeneratorState.editorPaused: break; case eGeneratorState.editorStopped: { mMeasureEditor.mCurrentMeasure.value = 0; mStaffPlayer.SetBarlineColor(-1, false); mMeasureEditor.Stop(); break; } case eGeneratorState.editorPlaying: { break; } default: break; } }
/// Loads a global configuration: instruments, global settings, etc. public void LoadConfig(string argDirectory, eGeneratorState argContinueState) { MusicGenerator.Instance.ClearInstruments(MusicGenerator.Instance.mInstrumentSet); LoadInstrumentSetData(argDirectory); LoadGeneratorData(argDirectory); LoadChordProgressionData(argDirectory); LoadInstrumentsData(argDirectory); SaveConfiguration(argDirectory); MusicGenerator.Instance.SetState(argContinueState); }
public void OnRepeatedMeasureExited(eGeneratorState stateIN) { mStaffPlayer.ClearNotes(); if (stateIN >= eGeneratorState.editing) { if (mMeasureEditor.mCurrentMeasure.value < mMeasureEditor.mNumberOfMeasures.value) { mMeasureEditor.mCurrentMeasure.value += 1; } else { mMeasureEditor.mCurrentMeasure.value = 0; } mMeasureEditor.UIToggleAllInstruments(true); } }
/// <summary> /// Loads a global configuration: instruments, global settings, etc. /// </summary> /// <param name="folderIN"></param> public IEnumerator LoadAndroidConfig(string argDirectory, eGeneratorState argContinueState, bool argAsync = false) { MusicGenerator.Instance.ClearInstruments(MusicGenerator.Instance.mInstrumentSet); MusicGenerator.Instance.SetState(eGeneratorState.initializing); yield return(StartCoroutine(LoadInstrumentSetData(argDirectory))); yield return(StartCoroutine(LoadGeneratorData(argDirectory))); yield return(StartCoroutine(LoadChordProgressionData(argDirectory))); yield return(StartCoroutine(LoadInstrumentsData(argDirectory, argAsync))); SaveConfiguration(argDirectory); MusicGenerator.Instance.SetState(argContinueState); yield return(null); }
/// <summary> /// async Loads a global configuration: instruments, global settings, etc. /// </summary> /// <param name="argDirectory"></param> /// <param name="argContinueState"></param> /// <returns></returns> public IEnumerator AsyncLoadConfig(string argDirectory, eGeneratorState argContinueState) { MusicGenerator.Instance.ClearInstruments(MusicGenerator.Instance.mInstrumentSet); LoadInstrumentSetData(argDirectory); yield return(null); LoadGeneratorData(argDirectory); yield return(null); LoadChordProgressionData(argDirectory); yield return(null); yield return(StartCoroutine(AsyncLoadInstrumentsData(argDirectory))); MusicGenerator.Instance.ResetPlayer(); SaveConfiguration(argDirectory); MusicGenerator.Instance.SetState(argContinueState); yield return(null); }
public void OnStateSet(eGeneratorState stateIN) { SetState(stateIN); }
/// <summary> /// Loads a global configuration: instruments, global settings, etc. /// </summary> /// <param name="folderIN"></param> public IEnumerator LoadConfig(string argDirectory, eGeneratorState argContinueState) { yield return(StartCoroutine(LoadAndroidConfig(argDirectory, argContinueState))); }