public void PlayDuration(string animationName, double durationInSeconds) { playingMode = PlayingMode.Duration; playDuration = durationInSeconds; lastPlayCallAnimation = animationName; timeAnimationStarted = Screens.ScreenManager.CurrentScreen.PauseAdjustedCurrentTime; }
private void ButtonPlaylist_Click(object sender, RoutedEventArgs e) { playingMode = PlayingMode.PLAYLIST; dataGrid.ItemsSource = null; dataGrid.Columns.Clear(); dataGrid.ItemsSource = playlistsongsMetaData; dataGrid.SelectedIndex = currentPlayingSongPlaylistIndex; }
public void DoForward() { m_timeAcumAnimation = m_timesSnapShots[0]; CloneAllGameObjects(); ColocateAllPiecesAnimation(0, 0); HideOriginalGameObjects(); m_state = PlayingMode.FORWARD; }
public void DoRewind() { m_timeAcumAnimation = m_timesSnapShots[m_timesSnapShots.Count - 1]; CloneAllGameObjects(); ColocateAllPiecesAnimation(m_timesSnapShots.Count - 2, m_timeAcumAnimation); HideOriginalGameObjects(); m_state = PlayingMode.REWIND; }
internal void Activity() { cachedChainName = null; if (EveryFrameAction != null) { cachedChainName = EveryFrameAction(); } else { switch (playingMode) { case PlayingMode.Duration: cachedChainName = lastPlayCallAnimation; if (Screens.ScreenManager.CurrentScreen.PauseAdjustedSecondsSince(timeAnimationStarted) >= playDuration) { cachedChainName = null; playingMode = PlayingMode.NotPlaying; } break; case PlayingMode.Forever: // never ends until they call stop cachedChainName = lastPlayCallAnimation; break; case PlayingMode.Loop: if (Container.AnimatedObject.JustCycled) { loopsLeft--; cachedChainName = lastPlayCallAnimation; if (loopsLeft <= 0) { cachedChainName = null; playingMode = PlayingMode.NotPlaying; } } break; case PlayingMode.NotPlaying: // do nothing break; case PlayingMode.Once: cachedChainName = lastPlayCallAnimation; if (Container.AnimatedObject.JustCycled) { cachedChainName = null; playingMode = PlayingMode.NotPlaying; } break; } } }
private async void Button_Click_Library(object sender, RoutedEventArgs e) { playingMode = PlayingMode.MUSIC_LIBRARY; await AudioFileRetriever.RetreiveFilesInFolders(musicLibrary, folder); await AudioFileRetriever.RetrieveSongMetadata(musicLibrary, musicLibrarySongsMetaData); SetNewGridItemSource(musicLibrarySongsMetaData); dataGrid.SelectedIndex = currentPlayingSongMusicLibraryIndex; }
private void Construct(string pArtist, string pTitle, PlayingMode pPlayingMode, IList pScoreNotes) { this.fArtist = pArtist; this.fTitle = pTitle; this.fPlayingMode = pPlayingMode; this.fXmlNotesStringBuilder = new StringBuilder(); this.fXmlSyncStringBuilder = new StringBuilder(); this.GenerateXmlNotes(pScoreNotes); }
private async void Button_Click_Library(object sender, RoutedEventArgs e) { playingMode = PlayingMode.MUSIC_LIBRARY; await AudioFileRetriever.RetreiveFilesInFolders(musicLibrary, folder); await AudioFileRetriever.RetrieveSongMetadata(musicLibrary, musicLibrarySongsMetaData); if (musicLibrarySongsMetaData.Count == 0 || dataGrid.ItemsSource == null) { dataGrid.Columns.Clear(); } dataGrid.ItemsSource = musicLibrarySongsMetaData; dataGrid.SelectedIndex = currentPlayingSongMusicLibraryIndex; }
public MainPage() { this.InitializeComponent(); musicLibrary = new List <StorageFile>(); playlistsongsMetaData = new List <Song>(); musicLibrarySongsMetaData = new List <Song>(); playlistTracks = new List <StorageFile>(); player = new MediaPlayer(); player.MediaEnded += PlayNewSong_MediaEnded; volumeSlider.Value = player.Volume * 100; currentPlayingSongMusicLibraryIndex = 0; currentPlayingSongPlaylistIndex = 0; playingMode = PlayingMode.PLAYLIST; }
public void Rewind() { if (m_timeAcumAnimation > m_timesSnapShots[0]) { m_timeAcumAnimation -= Time.deltaTime * FactorRewind; int index = FindCloseIndex(m_timeAcumAnimation); float timeLerp = (m_timeAcumAnimation - m_timesSnapShots[index]) / (m_timesSnapShots[index + 1] - m_timesSnapShots[index]); ColocateAllPiecesAnimation(index, timeLerp); } else { m_state = PlayingMode.NONE; if (RewindEnded != null) { RewindEnded(); } } }
void Awake() { if (m_instance != null && m_instance != this) { Destroy(this.gameObject); return; } m_instance = this; m_allActions = new Dictionary <float, List <Action> >(); m_timesSnapShots = new List <float>(); m_gameobjectsForAnimations = new Dictionary <int, GameObject>(); m_gameobjectsForClone = new Dictionary <int, GameObject>(); m_gameobjectID = 0; m_timeWaitSnapShot = 0; m_mutex = new Mutex(true); m_mutex.ReleaseMutex(); m_state = PlayingMode.RECORDING; }
public void Forward() { if (m_timeAcumAnimation < m_timesSnapShots[m_timesSnapShots.Count - 1]) { m_timeAcumAnimation += Time.deltaTime * FactorForward; int index = FindCloseIndex(m_timeAcumAnimation); if (index >= 0) { float timeLerp = (m_timeAcumAnimation - m_timesSnapShots[index]) / (m_timesSnapShots[index + 1] - m_timesSnapShots[index]); ColocateAllPiecesAnimation(index, timeLerp); } } else { m_state = PlayingMode.NONE; if (ForwardEnded != null) { ForwardEnded(); } } }
public void StopPlay() { playingMode = PlayingMode.NotPlaying; lastPlayCallAnimation = null; }
public void Play(string animationName) { playingMode = PlayingMode.Forever; lastPlayCallAnimation = animationName; }
public void PlayLoop(string animationName, int numberOfLoops) { playingMode = PlayingMode.Loop; this.loopsLeft = numberOfLoops; lastPlayCallAnimation = animationName; }
public void PlayOnce(string animationName) { playingMode = PlayingMode.Once; lastPlayCallAnimation = animationName; }
private void ButtonPlaylist_Click(object sender, RoutedEventArgs e) { playingMode = PlayingMode.PLAYLIST; SetNewGridItemSource(playlistsongsMetaData); dataGrid.SelectedIndex = currentPlayingSongPlaylistIndex; }
public XmlScoreWriter(string pArtist, string pTitle, PlayingMode pPlayingMode, SortedList <ScoreNote, ScoreNote> pScoreNotes) { Construct(pArtist, pTitle, pPlayingMode, pScoreNotes.Values.ToList()); }
public XmlScoreWriter(Song pSong, PlayingMode pPlayingMode, SortedList <GuitarScoreNote, GuitarScoreNote> pScoreNotes) { Construct(pSong.Author, pSong.Name, pPlayingMode, pScoreNotes.Values.ToList()); }