/// <summary> /// Erstellt eine neue Instanz von WMPlayer /// </summary> public WMPlayer() { _wmplayer = new WMPLib.WindowsMediaPlayer(); //Für den Media Player _playstatus = PlayStatus.Stop; Volume = 100; //Damit das Volume auf 100 ist Mute = false; //Damit es nicht stummgeschalten ist }
public void Pause() { playStatus = PlayStatus.Status_Pause; OnPause(); if (DelegateOnPauseEvent != null) { DelegateOnPauseEvent(); } if (DelegateOnPauseEventNew != null) { DelegateOnPauseEventNew(this); } }
public void Play() { playStatus = PlayStatus.Status_Play; OnPlay(); if (DelegateOnPlayEvent != null) { DelegateOnPlayEvent(); } if (DelegateOnPlayEventNew != null) { DelegateOnPlayEventNew(this); } }
//関数 //--------------------------------------------------- /** * ログファイルを開く */ public void OpenLogFile(string filePath) { //いったん閉じる CloseLogFile(); //ログファイルを読み込む logFilePath = filePath; nxtTrackLog = new NxtTrackLog(filePath); playPosition = 0; playStatus = PlayStatus.Stop; UpdateView(); NoticeUpdate(); }
public static void SetPlayStatus(ref PlayStatus currentStatus, BunifuImageButton button) { if (currentStatus == PlayStatus.PLAY)//next will be PAUSE { currentStatus = PlayStatus.PAUSE; button.Image = Image.FromFile(_Environment.g_SolutionDir + "/UIDesign/Asset/button_play_background.png"); //need display play icon when paused } else if (currentStatus == PlayStatus.PAUSE) //next will be PLAY { currentStatus = PlayStatus.PLAY; button.Image = Image.FromFile(_Environment.g_SolutionDir + "/UIDesign/Asset/button_pause_background.png");//and pause the other } }
// 玩家從 title 畫面, 觸發遊戲開始 public void TriggerGameEnter() { if (_currentPlayStatus != PlayStatus.GameTitle) { DebugLog("Status error."); return; } _currentPlayStatus = PlayStatus.GameChoosePlaymode; // NGUI show ui UIManager.Instance.Open(EnumType.UIType.Menu); }
private void ListPlayPause() { play_state_ = PlayStatus.Pause; /* 実行中タイマーを停止 */ if (play_timer_.Enabled) { play_timer_.Stop(); } UpdateOperationUI(); UpdateStatusUI(); }
public void Pause() { if (Player.Playing) { Player.Pause(); mStatus = PlayStatus.Paused; } else { Player.Play(); mStatus = PlayStatus.Playback; } }
public void Play(int patternIdx) { this.playState = PlayStatus.Playing; periodCount = 0; effectPosition = int.MinValue; this.CurrentLine = null; this.initializeParams(); this.GoToPattern(patternIdx); for (int i = 0; i < ayEmus.Length; i++) { ayEmus[i].Reset(); } }
void Awake() { _instance = this; move = this.GetComponent <PlayerMove>(); ps = this.GetComponent <PlayStatus>(); normal = body.GetComponent <Renderer>().material.color; hudtextFollow = transform.Find("HUDText").gameObject; foreach (GameObject go in efxArray) { efxDict.Add(go.name, go); } }
// Use this for initialization void Start() { _instance = this; tween = _instance.GetComponent <TweenPosition>(); headgear = transform.Find("Headgear").gameObject; armor = transform.Find("Armor").gameObject; righthand = transform.Find("RightHand").gameObject; lefthand = transform.Find("LeftHand").gameObject; shoe = transform.Find("Shoe").gameObject; accessory = transform.Find("Accessory").gameObject; ps = GameObject.FindGameObjectWithTag(Tags.player).GetComponent <PlayStatus>(); }
private void ListPlayReset() { ListPlayPause(); play_state_ = PlayStatus.Reset; /* 非選択状態 */ play_data_index_busy_ = -1; /* 繰り返し回数を初期化 */ play_repeat_count_ = 0; UpdateOperationUI(); }
// 玩家從 mode 選擇觸發 public void TriggerChoosePlayMode(PlayMode mode) { if (_currentPlayStatus != PlayStatus.GameChoosePlaymode) { DebugLog("Status error."); return; } _currentPlayMode = mode; _currentPlayStatus = PlayStatus.GameChooseChapter; // NGUI show ui UIManager.Instance.Open(EnumType.UIType.Levels); }
public async Task <bool> CommandResultsInDuplicateEntryAsync(PlayStatus playStatus) { var duplicatePlayStatus = await context.PlayStatuses .Where(ps => ps.ID != playStatus.ID && (ps.Name == playStatus.Name || ps.OrdinalNumber == playStatus.OrdinalNumber)) .FirstOrDefaultAsync(); if (duplicatePlayStatus != null) { return(true); } return(false); }
public void Stop() { playStatus = PlayStatus.Status_Stop; playProgress = 0.0f; TransformAnimation(); OnStop(); if (DelegateOnStopEvent != null) { DelegateOnStopEvent(); } if (DelegateOnStopEventNew != null) { DelegateOnStopEventNew(this); } }
// Map 產生完畢後呼叫, PS: 因為 load level 是 async, 所以 is done 由 map generator 判定 public void TriggerMapGenerateDone() { if (_currentPlayStatus != PlayStatus.MapGenerating) { DebugLog("Status error. Should be MapGenerating"); return; } DebugLog("蟲族先攻"); _logic.InitialMap(MapGenerator.GeneratedData, MapGenerator.GeneratedHoleData); _currentPlayStatus = PlayStatus.RoundScarabTurn; //蟲族先攻 DebugLog("PlayStatus: " + _currentPlayStatus.ToString()); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { PlayStatus status = (PlayStatus)value; Visibility visibility = (Visibility)parameter; if (status == PlayStatus.Normal) { return(visibility); } if (visibility == Visibility.Visible) { return(Visibility.Collapsed); } return(Visibility.Visible); }
/// <summary> /// Makes a move on the board, with no error checking, so illegal moves can be made. If an illegal move is made then the output becomes unpredictable /// </summary> /// <param name="column">the column you want to make the move against</param> /// <returns>returns true if the game is over (either a win or a Draw)</returns> public bool MakeMoveNoErrorChecking(int column) { _makeMove(column); if (CheckforWin(playerBoards[(turn - 1) % 2])) { Status = PlayStatus.Win; return(true); } else if (turn == 42) { Status = PlayStatus.Draw; return(true); } return(false); }
public PlayStatusViewModel(PlayStatus domain, bool readyToSetDraftOrder, bool readyToDraft, IEnumerable <string> startDraftErrors, DraftPhase draftPhase) { PlayStatus = domain.Value; ReadyToSetDraftOrder = readyToSetDraftOrder; ReadyToDraft = readyToDraft; PlayStarted = domain.PlayStarted; DraftIsActive = domain.DraftIsActive; DraftIsPaused = domain.DraftIsPaused; DraftFinished = domain.DraftFinished; StartDraftErrors = startDraftErrors.ToList(); if (draftPhase.Equals(DraftPhase.CounterPicks)) { DraftingCounterPicks = true; } }
public bool WinnerFound() { foreach (var token in _playerTokens) { if (token.SquarePosition != 100) { continue; } Status = PlayStatus.Over; Message = $"{token.PlayerName} Wins!!!"; return(true); } return(false); }
// 玩家從 關卡選擇 UI 畫面, 觸發遊戲開始 public void TriggerChooseChapter(ushort chapterID) { if (_currentPlayStatus != PlayStatus.GameChooseChapter) { DebugLog("Status error."); return; } _currentChapterID = chapterID; _currentPlayStatus = PlayStatus.MapGenerating; MapGenerator.Generate(_currentChapterID); // NGUI show ui UIManager.Instance.Open(EnumType.UIType.InGame); }
public void ShouldWonTheGame() { var word = new PlayStatus() { CorrectedLetters = "XXXX", Word = "TEST", ErrorsQuantity = 0 }; foreach (var item in new String("Test").ToCharArray()) { word.Shot = item.ToString(); word = new GameBusiness(Environment.CurrentDirectory).Play(word); } Assert.True(word.ErrorsQuantity == 0 && word.Message == "Congratulations, you won the game."); }
public void Play() { try { InitMediaPlayer(); Player.PrepareToPlay(); mStatus = PlayStatus.Buffering; } catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); mStatus = PlayStatus.Error; DestroyMediaPlayer(); } }
public void ShouldLoseTheGame() { var word = new PlayStatus() { CorrectedLetters = "XXXX", Word = "TEST", ErrorsQuantity = 0 }; foreach (var item in new String("ABCDEFG").ToCharArray()) { word.Shot = item.ToString(); word = new GameBusiness(Environment.CurrentDirectory).Play(word); } Assert.True(word.ErrorsQuantity == 6 && word.Message == "Sorry, you lose!"); }
private void HandleLoadCompleted(object sender, AsyncCompletedEventArgs e) { //Status = PlayStatus.Loaded; Status = PlayStatus.Playing; this.Cursor = Cursors.Arrow; openToolStripMenuItem.Enabled = true; if (e.Error == null) { positionHScrollBar.Value = 0; positionHScrollBar.Maximum = sequence1.GetLength(); } else { MessageBox.Show(e.Error.Message); } }
public LeagueYearEntity(League league, int year, LeagueOptions options, PlayStatus playStatus) { LeagueID = league.LeagueID; Year = year; StandardGames = options.StandardGames; GamesToDraft = options.GamesToDraft; CounterPicks = options.CounterPicks; MaximumEligibilityLevel = options.MaximumEligibilityLevel.Level; AllowYearlyInstallments = options.AllowYearlyInstallments; AllowEarlyAccess = options.AllowEarlyAccess; DraftSystem = options.DraftSystem.Value; PickupSystem = options.PickupSystem.Value; ScoringSystem = options.ScoringSystem.Name; PlayStatus = playStatus.Value; }
void OnStatusChanged(PlayStatus last, PlayStatus current) { switch (current) { case PlayStatus.RoundHumanTurn: case PlayStatus.RoundScarabTurn: case PlayStatus.BattleResult: if (tag == TagConst.Human) { Count = GameControl.Instance.Logic.PeopleCount; } else { Count = GameControl.Instance.Logic.ScarabCount; } break; } }
public void Pause() { switch (this.playState) { case PlayStatus.Playing: this.playState = PlayStatus.Paused; break; case PlayStatus.Paused: this.playState = PlayStatus.Playing; break; case PlayStatus.Stopped: this.initializeParams(); this.playState = PlayStatus.Stopped; break; } }
public void Pause() { if (Player == null) { return; } if (Player.IsPlaying) { Player.Pause(); mStatus = PlayStatus.Paused; } else { Player.Start(); mStatus = PlayStatus.Playback; } }
private void aboutToolStripMenuItem_Click(object sender, EventArgs e) { PlayStatus oldStatus = this.songPlayer.Status; if (oldStatus == PlayStatus.Playing) { this.songPlayer.Pause(); } About about = new About(); about.ShowDialog(); if (oldStatus == PlayStatus.Playing) { this.songPlayer.Pause(); } }
private void InitMediaPlayer() { try { var url = NSUrl.FromString(MP3Value); Player = AVAudioPlayer.FromUrl(url); Player.BeginInterruption += Player_BeginInterruption; Player.FinishedPlaying += Player_FinishedPlaying; } catch (Exception ex) { Debug.WriteLine(ex.Message.ToString()); mStatus = PlayStatus.Error; DestroyMediaPlayer(); } }
// Use this for initialization void Awake() { _instance = this; head = transform.Find("head").GetComponent<UISprite>(); level = transform.Find("level").GetComponent<UILabel>(); nameLevel = transform.Find("name").GetComponent<UILabel>(); conbatValue = transform.Find("conbatValue").GetComponent<UILabel>(); ExpProgressBar = transform.Find("ExpProgressBar").GetComponent<UISlider>(); expLabel = transform.Find("ExpProgressBar/Label").GetComponent<UILabel>(); btnChangeName = transform.Find("btnChangeName").GetComponent<UIButton>(); btnClose = transform.Find("btnClose").GetComponent<UIButton>(); coinLabel = transform.Find("CoinLabel").GetComponent<UILabel>(); powerLabel = transform.Find("powerLabel/NumLabel").GetComponent<UILabel>(); energyLabel = transform.Find("energyLabel/NumLabel").GetComponent<UILabel>(); diamonLabel = transform.Find("DiamonLabel").GetComponent<UILabel>(); tweenPosition = this.GetComponent<TweenPosition>(); PlayInfo._instance.OnPlayInfpChanged += this.PlayInfoChangedChanged; EventDelegate de = new EventDelegate(this, "OnClose"); btnClose.onClick.Add(de); }
public void Stop() { this.Timer.Enabled = false; if( this.CdMediaStatus() ) { this.BasicAction( CDDevice.ActionOption.Stopcd ); this._CDStatus = PlayStatus.Stopped; } this.Timer.Enabled = true; }
public void Play() { this.Timer.Enabled = false; if( this.CdMediaStatus() ) { if( this._CDStatus == PlayStatus.Playing ) { this.BasicAction( CDDevice.ActionOption.Pausecd ); this._CDStatus = PlayStatus.Paused; } else if( this._CDStatus == PlayStatus.Paused ) { int TempPosition = this.TrackPositionSeconds; this.PlayTrack( this.CurrentTrack ); this._CDStatus = PlayStatus.Playing; MovePosition( TempPosition ); } else if( this._CDStatus == PlayStatus.Stopped ) { this.PlayTrack( this.CurrentTrack ); this._CDStatus = PlayStatus.Playing; } } this.Timer.Enabled = true; }
void SetPlayStatus() { if (_play == null || _play.CurrentStatus == MediaStatus.Stopped) PlayStatus = PlayStatus.Stopped; if (_play.CurrentStatus == MediaStatus.Playing) PlayStatus = PlayStatus.Playing; if (_play.CurrentStatus == MediaStatus.Paused) PlayStatus = PlayStatus.Paused; }
public PlayInfo(PlayStatus Status, int length, XYAngle Param) : this() { logLength = length; status = Status; param = Param; }
/// <summary> /// Stoppt den Stream und gibt das Result zurück /// </summary> /// <returns></returns> public bool Stop() { //Aktuellen Status des Streams prüfen if (_playstatus == PlayStatus.Play || _playstatus == PlayStatus.Pause) { _wmplayer.controls.stop(); _playstatus = PlayStatus.Stop; return true; } else { return false; } }
/// <summary> /// Startet den Stream und gibt das Result zurück /// </summary> /// <returns></returns> public bool Play() { //Prüfen, ob vorher eine Stream-URL festgelegt wurde if (_streamurl == "") { return false; } //Jetzt soll der Stream abgespielt werden. Bei Fehler abspielen unterbinden try { _wmplayer.controls.play(); _playstatus = PlayStatus.Play; return true; } catch (Exception ex) { MessageBox.Show(ex.Message); //Es ist ein Fehler aufgetreten return false; } }
/// <summary> /// Pausiert den Stream und gibt das Result zurück /// </summary> /// <returns></returns> public bool Pause() { //Aktuellen Status des Streams prüfen if (_playstatus == PlayStatus.Play) { _wmplayer.controls.pause(); _playstatus = PlayStatus.Pause; return true; } else { return false; } }
/// <summary> /// Stoppt den Stream und gibt das Result zurück /// </summary> /// <returns></returns> public bool Stop() { //Aktuellen Status des Streams prüfen if (_playstatus == PlayStatus.Play || _playstatus == PlayStatus.Pause) { try { p.Close(); //Der Prozess soll heruntergefahren werden. Falls der Prozess bereits aus ist, ist es nicht schlimm } catch { } _playstatus = PlayStatus.Stop; return true; } else { return false; } }
/// <summary> /// Erstellt eine neue Instanz von ExtPlayer /// </summary> public ExtPlayer() { p = new Process(); _playstatus = PlayStatus.Stop; }
/** * ログファイルを閉じる */ public void CloseLogFile() { //ファイルを閉じる nxtTrackLog = null; logFilePath = null; //アップデート playPosition = 0; playStatus = PlayStatus.Close; UpdateView(); NoticeUpdate(); }