internal void updateState(VideoEmitterSerializedState videoEmitterstate) { sensorEnabled = videoEmitterstate.isEnabled; playingTrack = videoEmitterstate.videoName; if (videoEmitterstate.state == "Play") { state = SoundAndVideoState.Play; } if (videoEmitterstate.state == "Stop") { state = SoundAndVideoState.Stop; } if (videoEmitterstate.state == "Pause") { state = SoundAndVideoState.Pause; } volume = videoEmitterstate.volume; repeat = videoEmitterstate.repeat; }
/// <summary> /// xecute a commadn on audio player /// </summary> /// <param name="trackname">the name of the track form the sound controller compoentn</param> /// <param name = "volume" > the volume of the player</param> /// <param name="repeat">the vieo shoul e put in repeat mode</param> /// <param name="state">the state of the player</param> public void executeCommandSoundEmitter(string trackname, int volume, bool repeat, SoundAndVideoState state) { if (executecommand == null) { executecommand = new SmartToyExecuteStatus(); } executecommand.soundEmitterCommand = new soundEmitterSet(); executecommand.soundEmitterCommand.repeat = repeat; executecommand.soundEmitterCommand.state = state.ToString().Split('.')[1]; executecommand.soundEmitterCommand.trackname = trackname; }