示例#1
0
 public void PlayDuration(string animationName, double durationInSeconds)
 {
     playingMode           = PlayingMode.Duration;
     playDuration          = durationInSeconds;
     lastPlayCallAnimation = animationName;
     timeAnimationStarted  = Screens.ScreenManager.CurrentScreen.PauseAdjustedCurrentTime;
 }
示例#2
0
 private void ButtonPlaylist_Click(object sender, RoutedEventArgs e)
 {
     playingMode          = PlayingMode.PLAYLIST;
     dataGrid.ItemsSource = null;
     dataGrid.Columns.Clear();
     dataGrid.ItemsSource   = playlistsongsMetaData;
     dataGrid.SelectedIndex = currentPlayingSongPlaylistIndex;
 }
示例#3
0
 public void DoForward()
 {
     m_timeAcumAnimation = m_timesSnapShots[0];
     CloneAllGameObjects();
     ColocateAllPiecesAnimation(0, 0);
     HideOriginalGameObjects();
     m_state = PlayingMode.FORWARD;
 }
示例#4
0
 public void DoRewind()
 {
     m_timeAcumAnimation = m_timesSnapShots[m_timesSnapShots.Count - 1];
     CloneAllGameObjects();
     ColocateAllPiecesAnimation(m_timesSnapShots.Count - 2, m_timeAcumAnimation);
     HideOriginalGameObjects();
     m_state = PlayingMode.REWIND;
 }
示例#5
0
        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;
        }
示例#7
0
        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);
        }
示例#8
0
        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;
 }
示例#10
0
 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();
         }
     }
 }
示例#11
0
 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;
 }
示例#12
0
    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();
            }
        }
    }
示例#13
0
 public void StopPlay()
 {
     playingMode           = PlayingMode.NotPlaying;
     lastPlayCallAnimation = null;
 }
示例#14
0
 public void Play(string animationName)
 {
     playingMode           = PlayingMode.Forever;
     lastPlayCallAnimation = animationName;
 }
示例#15
0
 public void  PlayLoop(string animationName, int numberOfLoops)
 {
     playingMode           = PlayingMode.Loop;
     this.loopsLeft        = numberOfLoops;
     lastPlayCallAnimation = animationName;
 }
示例#16
0
 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;
 }
示例#18
0
 public XmlScoreWriter(string pArtist, string pTitle, PlayingMode pPlayingMode, SortedList <ScoreNote, ScoreNote> pScoreNotes)
 {
     Construct(pArtist, pTitle, pPlayingMode, pScoreNotes.Values.ToList());
 }
示例#19
0
 public XmlScoreWriter(Song pSong, PlayingMode pPlayingMode, SortedList <GuitarScoreNote, GuitarScoreNote> pScoreNotes)
 {
     Construct(pSong.Author, pSong.Name, pPlayingMode, pScoreNotes.Values.ToList());
 }