Пример #1
0
        public ComposerPage()
        {
            InitializeComponent();

            _logicalComparer = new LogicalComparer();
            _classicalMusicContext = new ClassicalMusicContext(new Uri("http://www.harrenstein.com/ClassicalMusic/ClassicalMusic.svc"));
            _classicalMusicContext.MergeOption = MergeOption.OverwriteChanges;
            _sampleDictionary = new Dictionary<IWaveProvider, Sample>();
            _mp3Player = new Mp3Player();

            _mp3Player.CurrentTimeChanged += Mp3Player_CurrentTimeChanged;
            _mp3Player.TotalTimeChanged += Mp3Player_TotalTimeChanged;
            _mp3Player.TrackChanged += Mp3Player_TrackChanged;
            _mp3Player.PlaybackStateChanged += Mp3Player_PlaybackStateChanged;
            _mp3Player.VolumeChanged += Mp3Player_VolumeChanged;
            _mp3Player.IsMutedChanged += Mp3Player_IsMutedChanged;
            _mp3Player.CanPlayChanged += Mp3Player_CanPlayChanged;
            _mp3Player.CanSkipBackChanged += Mp3Player_CanSkipBackChanged;
            _mp3Player.CanSkipForwardChanged += Mp3Player_CanSkipForwardChanged;

            Loaded += ComposerPage_Loaded;
        }
Пример #2
0
        private async void Influence_Click(object sender, RoutedEventArgs e)
        {
            _sampleDictionary.Clear();

            _mp3Player.Dispose();

            _mp3Player = new Mp3Player();

            _mp3Player.CurrentTimeChanged += Mp3Player_CurrentTimeChanged;
            _mp3Player.TotalTimeChanged += Mp3Player_TotalTimeChanged;
            _mp3Player.TrackChanged += Mp3Player_TrackChanged;
            _mp3Player.PlaybackStateChanged += Mp3Player_PlaybackStateChanged;
            _mp3Player.VolumeChanged += Mp3Player_VolumeChanged;
            _mp3Player.IsMutedChanged += Mp3Player_IsMutedChanged;
            _mp3Player.CanPlayChanged += Mp3Player_CanPlayChanged;
            _mp3Player.CanSkipBackChanged += Mp3Player_CanSkipBackChanged;
            _mp3Player.CanSkipForwardChanged += Mp3Player_CanSkipForwardChanged;

            NowPlayingTitleTextBlock.Text = null;
            NowPlayingArtistTextBlock.Text = null;

            PlayPauseToggleButton.IsEnabled = false;
            SkipBackButton.IsEnabled = false;
            SkipForwardButton.IsEnabled = false;
            ProgressSlider.IsEnabled = false;
            MuteToggleButton.IsEnabled = false;
            VolumeSlider.IsEnabled = false;

            var button = (Button)sender;

            Application.Current.Properties["SelectedComposer"] = ((Composer)button.DataContext).ComposerId;

            await LoadComposerAsync();
        }