Ejemplo n.º 1
0
 public MainPage()
 {
     this.InitializeComponent();
     this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Enabled;
     graphGlobal          = new AudioGraphGlobal();
     graphGlobal.Playlist = new ObservableCollection <Song>();
     prev_id = -1;
 }
Ejemplo n.º 2
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     backButton.IsEnabled = this.Frame.CanGoBack;
     if (e.NavigationMode == NavigationMode.New)
     {
         graphGlobal = (AudioGraphGlobal)e.Parameter;
         if (graphGlobal.Playlist.Count > 0)
         {
             if (graphGlobal.id != 0)
             {
                 Initilize_AudioGraph(graphGlobal.Playlist[graphGlobal.id - 1].storageFile);
             }
         }
     }
 }
Ejemplo n.º 3
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            backButton.IsEnabled = this.Frame.CanGoBack;
            switch (e.NavigationMode)
            {
            case NavigationMode.New:
                if (e.Parameter != null && !(e.Parameter is ""))
                {
                    if (lyricList != null)
                    {
                        lyricList.Clear();
                    }

                    graphGlobal = (AudioGraphGlobal)e.Parameter;
                    if (graphGlobal.Playlist.Count > 0)
                    {
                        if (graphGlobal.id != 0)
                        {
                            //await graphGlobal.InitilizeAudioGraph(graphGlobal.Playlist[graphGlobal.id - 1].storageFile);
                            var storageFile = graphGlobal.fileInputNode.SourceFile;
                            Task.Run(() => LoadAndProcessLyricFile(
                                         storageFile.Path.Replace(storageFile.Name, "") + storageFile.DisplayName,
                                         new string[] { ".bcc", ".lrc" }));
                            graphGlobal.ConfigureAudioFrame();
                            //graphGlobal.fileInputNode.Seek(new TimeSpan(0, 0, 0, 0, (int)graphGlobal.position_ms));
                            //graphGlobal.fileInputNode.FileCompleted += FileInputNode_FileCompleted;
                            graphGlobal.audioGraph.QuantumStarted += AudioGraph_QuantumStarted;
                            graphGlobal.audioGraph.Start();
                            if (lyricList.Count == 0)
                            {
                                lyricMessagePanel.Visibility = Visibility.Visible;
                            }
                            else
                            {
                                lyricMessagePanel.Visibility = Visibility.Collapsed;
                            }
                        }
                    }
                }
                break;
            }
        }