public void ShowNormalInstrumentState(InstrumentMode eWhichInstrument) { InstrumentDetails instrument = m_aInstrumentDetails[(int)eWhichInstrument]; if (instrument != null) { instrument.renderer.sprite = instrument.normalSprite; instrument.holder.transform.localPosition = instrument.normalPosition; instrument.holder.transform.localRotation = Quaternion.Euler(instrument.normalRotation); instrument.holder.transform.localScale = instrument.normalScale; if (m_agoTambourineCymbals[(int)eWhichInstrument] != null) { m_agoTambourineCymbals[(int)eWhichInstrument].SetActive(true); foreach (Transform cymbal in m_agoTambourineCymbals[(int)eWhichInstrument].transform) { cymbal.GetComponent <Button_TambourineCymbal>().enabled = true; } } if (m_arTambourineTargets[(int)eWhichInstrument] != null && m_arTambourineTargets[(int)eWhichInstrument].Visible) { m_arTambourineTargets[(int)eWhichInstrument].HideShakenTambourineTargets(); } } }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Set Instrument Mode //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ private void SetInstrumentMode(InstrumentMode eMode) { if (m_eCurrentInstrumentMode != eMode) { // Disable Currently Active Instrument DisableInstrument(m_eCurrentInstrumentMode); bool bActivateTargets = m_arTambourineTargets[(int)m_eCurrentInstrumentMode].Visible; // Make the switch, saving to memory so that the app uses this same instrument next time app is loaded m_eCurrentInstrumentMode = eMode; SavedPreferenceTool.SaveInt("InstrumentMode", (int)eMode); // Activate next instrument and put it into the normal display state ActivateInstrument(eMode); ShowNormalInstrumentState(); if (bActivateTargets) { m_arTambourineTargets[(int)eMode].ShowTargets(); } else { m_arTambourineTargets[(int)eMode].HideTargets(); } } }
public async Task UpdateAsync(Instrument instrument, string userId) { Instrument currentInstrument = await GetByAssetPairIdAsync(instrument.AssetPairId); InstrumentMode currentInstrumentMode = currentInstrument.Mode; currentInstrument.Update(instrument); currentInstrument.Approve(); await _instrumentRepository.UpdateAsync(currentInstrument); _cache.Set(currentInstrument); if (instrument.Mode == InstrumentMode.Disabled && currentInstrumentMode != InstrumentMode.Disabled) { try { await _lykkeExchangeService.CancelAsync(instrument.AssetPairId); } catch (Exception exception) { _log.WarningWithDetails("An error occurred while cancelling limit orders", exception, new { currentInstrument, userId }); } await _orderBookService.RemoveAsync(instrument.AssetPairId); } _log.InfoWithDetails("Instrument was updated", new { currentInstrument, userId }); }
/// <summary> /// Given an expect mode, compare it to the updated copy of the instrument mode /// </summary> /// <param name="awg"></param> /// <param name="expectedMode"></param> public void AwgInstrumentModeShouldBe(IAWG awg, InstrumentMode expectedMode) { var expectedValue = (expectedMode == InstrumentMode.Awg) ? SyntaxForInstrumentModeAwg : SyntaxForInstrumentModeFgen; Assert.AreEqual(expectedValue, awg.InstrumentMode); }
/// <summary> /// Set the awg's instrument mode /// </summary> /// <param name="awg"></param> /// <param name="setMode"></param> public void SetInstrumentMode(IAWG awg, InstrumentMode setMode) { var setValue = (setMode == InstrumentMode.Awg) ? SyntaxForInstrumentModeAwg : SyntaxForInstrumentModeFgen; awg.SetInstrumentMode(setValue); }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * New Method: Disable Instrument //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ public void DisableInstrument(InstrumentMode eWhichInstrument) { InstrumentDetails instrument = m_aInstrumentDetails[(int)eWhichInstrument]; if (instrument != null) { instrument.holder.SetActive(false); } }
public override void Handle(GameSession session, PacketReader packet) { InstrumentMode mode = (InstrumentMode)packet.ReadByte(); switch (mode) { case InstrumentMode.StartImprovise: HandleStartImprovise(session, packet); break; case InstrumentMode.PlayNote: HandlePlayNote(session, packet); break; case InstrumentMode.StopImprovise: HandleStopImprovise(session); break; case InstrumentMode.PlayScore: HandlePlayScore(session, packet); break; case InstrumentMode.StopScore: HandleStopScore(session); break; case InstrumentMode.StartEnsemble: HandleStartEnsemble(session, packet); break; case InstrumentMode.LeaveEnsemble: HandleLeaveEnsemble(session); break; case InstrumentMode.Compose: HandleCompose(session, packet); break; case InstrumentMode.Fireworks: HandleFireworks(session); break; case InstrumentMode.AudienceEmote: HandleAudienceEmote(packet); break; default: IPacketHandler <GameSession> .LogUnknownMode(mode); break; } }
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // * Derived Method: Awake //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ void Awake() { // Switch to the appropriate instrument type, saved during the last game. Can only change Instruments permanently in full version of app~ InstrumentMode eSavedInstrumentMode = m_eCurrentInstrumentMode; //if(GameManager.IsFullVersion) eSavedInstrumentMode = (InstrumentMode)SavedPreferenceTool.GetInt("InstrumentMode", (int)InstrumentMode.RIQ_TAMBOURINE); if (eSavedInstrumentMode != m_eCurrentInstrumentMode) { SetInstrumentMode(eSavedInstrumentMode); } }
void enqueueDataPoint(InstrumentMode mode, int trace, int index, float x, float y) { newDataToPlot = true; GraphPoint g = new GraphPoint(); g.index = index; g.x = x; g.y = y; g.trace = trace; g.mode = mode; graphPoints.Enqueue(g); newDataToPlot = true; }
public void ToggleInstrumentState(InstrumentMode eWhichInstrument) { InstrumentDetails instrument = m_aInstrumentDetails[(int)eWhichInstrument]; if (instrument != null) { if (instrument.renderer.sprite == instrument.specialSprite) { ShowNormalInstrumentState(eWhichInstrument); } else { ShowSpecialInstrumentState(eWhichInstrument); } } }
// Display the user's mistake, safely. private void WrongUpdateScore(InstrumentMode mode) { if (InvokeRequired) { Invoke(new InstrumentUiInstrumentModeCallback(WrongUpdateScore), mode); return; } if (mode == InstrumentMode.Send) { lblResult.Text = "Wrong! You belled " + CurrentCode + ", not " + ExpectedCode; } else { lblResult.Text = "Wrong! You heard " + ChosenCode + ", not " + ((HiddenCode)comboCodeList.SelectedItem).Code; } UpdateScore(); lblResult.Visible = true; }
public void ShowSpecialInstrumentState(InstrumentMode eWhichInstrument) { InstrumentDetails instrument = m_aInstrumentDetails[(int)eWhichInstrument]; if (instrument != null) { instrument.renderer.sprite = instrument.specialSprite; instrument.holder.transform.localPosition = instrument.specialPosition; instrument.holder.transform.localRotation = Quaternion.Euler(instrument.specialRotation); instrument.holder.transform.localScale = instrument.specialScale; if (m_agoTambourineCymbals[(int)eWhichInstrument] != null) { m_agoTambourineCymbals[(int)eWhichInstrument].SetActive(false); } if (m_arTambourineTargets[(int)eWhichInstrument] != null && m_arTambourineTargets[(int)eWhichInstrument].Visible) { m_arTambourineTargets[(int)eWhichInstrument].ShowShakenTambourineTargets(); } } }
public InstrumentModeFilter() { Instrument = Lib.Instrument.Any; PointingMode = Lib.PointingMode.Any; InstrumentMode = Lib.InstrumentMode.Any; }
private static MusicPlayer MusicBoxNotationMusicPlayerFactory(RawMusicSheet rawMusicSheet, InstrumentMode mode) { var musicSheet = new MusicSheetParser(new ChordParser(new NoteParser(), rawMusicSheet.Instrument)).Parse( rawMusicSheet.Melody, int.Parse(rawMusicSheet.Tempo), int.Parse(rawMusicSheet.Meter.Split('/')[0]), int.Parse(rawMusicSheet.Meter.Split('/')[1])); var algorithm = rawMusicSheet.Algorithm == "favor notes" ? new FavorNotesAlgorithm() : (IPlayAlgorithm) new FavorChordsAlgorithm(); Instrument instrument = InstrumentRepository[rawMusicSheet.Instrument]; instrument.Mode = mode; MusicianModule.ModuleInstance.Conveyor.Visible = mode == InstrumentMode.Practice; return(new MusicPlayer( musicSheet, instrument, algorithm)); }
internal static MusicPlayer Create(RawMusicSheet rawMusicSheet, InstrumentMode mode) { return(MusicBoxNotationMusicPlayerFactory(rawMusicSheet, mode)); }
private static void ValidateInstrumentMode(IEnumerable <OrderBook> orderBooks, InstrumentMode instrumentMode) { if (instrumentMode != InstrumentMode.Active) { SetError(orderBooks.SelectMany(o => o.LimitOrders), LimitOrderError.Idle); } }
public InstrumentModeValue(InstrumentMode value) { Value = value; }