示例#1
0
        public MainWindow()
        {
            InitializeComponent();

            timer          = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick    += new EventHandler(timer_Tick);
            tick           = new timerTick(changeStatus);

            hotKeyControl1.HotKeyIsSet += (s, e) =>
            {
                if (MyHotKeyManager.HotKeyExists(e.Shortcut, HotKeyManager.CheckKey.LocalHotKey))
                {
                    e.Cancel = true;
                    MessageBox.Show("This HotKey has already been registered");
                }
            };

            hotKeyControl2.HotKeyIsSet += (o, ex) =>
            {
                if (MyHotKeyManager.HotKeyExists(ex.Shortcut, HotKeyManager.CheckKey.LocalHotKey))
                {
                    ex.Cancel = true;
                    MessageBox.Show("This HotKey has already been registered");
                }
            };
        }
        public MainWindow()
        {
            InitializeComponent();

            timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick += new EventHandler(timer_Tick);
            tick = new timerTick(changeStatus);

            hotKeyControl1.HotKeyIsSet += (s, e) =>
            {

                if (MyHotKeyManager.HotKeyExists(e.Shortcut, HotKeyManager.CheckKey.LocalHotKey))
                {

                    e.Cancel = true;
                    MessageBox.Show("This HotKey has already been registered");
                }
            };

            hotKeyControl2.HotKeyIsSet += (o, ex) =>
            {
                if (MyHotKeyManager.HotKeyExists(ex.Shortcut, HotKeyManager.CheckKey.LocalHotKey))
                {
                    ex.Cancel = true;
                    MessageBox.Show("This HotKey has already been registered");
                }
            };
        }
示例#3
0
        private void mainMediaElement_MediaOpened(object sender, RoutedEventArgs e)
        {
            timelineSlider.Minimum = 0;
            timelineSlider.Maximum = mainMediaElement.NaturalDuration.TimeSpan.TotalMilliseconds;

            ticks.Interval = TimeSpan.FromMilliseconds(1);
            ticks.Tick    += ticks_Tick;
            tick           = new timerTick(Tick);
            ticks.Start();
        }
示例#4
0
 private void MediaPlayer_MediaOpened(object sender, RoutedEventArgs e)
 {
     slider.Minimum        = 0;
     slider.Maximum        = mediaElement.NaturalDuration.TimeSpan.TotalSeconds;
     MaxDuration.Content   = Milliseconds_to_Minute((long)mediaElement.NaturalDuration.TimeSpan.TotalMilliseconds);
     mediaElement.Position = new TimeSpan(0, 0, 0, 0, (int)slider.Value);
     ticks.Interval        = TimeSpan.FromMilliseconds(1);
     ticks.Tick           += ticks_Tick;
     tick = new timerTick(changeStatus);
     ticks.Start();
 }
示例#5
0
        public MainWindow()
        {
            InitializeComponent();

            timer          = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick    += new EventHandler(timer_Tick);
            tick           = new timerTick(changeStatus);

            slider_list.Maximum = 0;
        }
示例#6
0
        private void McMediaElement_MediaOpened(object sender, RoutedEventArgs e)
        {
            ticks.Interval = TimeSpan.FromMilliseconds(1);
            ticks.Tick    += ticks_Tick;
            tick           = new timerTick(changeStatus);
            ticks.Start();
            var converter = new ImageSourceConverter();

            playButton.Source      = (ImageSource)converter.ConvertFromString("pack://application:,,,/Resources/Images/UI_pause_w.png");
            timelineSlider.Maximum = McMediaElement.NaturalDuration.TimeSpan.Seconds;
            McMediaElement.Clock.Controller.Begin();
        }
        public MainWindow()
		{
			this.InitializeComponent();
			// Insert code required on object creation below this point.
            GridPlaylist.ItemsSource = m_playlist.List;
            // For seekSlider
            timer = new DispatcherTimer();
            timer.Interval = TimeSpan.FromMilliseconds(1);
            timer.Tick += new EventHandler(timer_Tick);
            tick = new timerTick(changeStatus);
            // For TaskBar
            TaskbarItemInfo taskbarItemInfo = new TaskbarItemInfo();
            this.TaskbarItemInfo = taskbarItemInfo;
		}
 public Player()
 {
     InitializeComponent();
     this.DataContext      = this;
     timer                 = new DispatcherTimer();
     timer.Interval        = TimeSpan.FromSeconds(1);
     timer.Tick           += new EventHandler(timer_Tick);
     tick                  = new timerTick(changeStatus);
     btnPause.IsEnabled    = false;
     btnPlay.IsEnabled     = false;
     btnRewind.IsEnabled   = false;
     btnForward.IsEnabled  = false;
     AddBookMark.IsEnabled = false;
 }
        public MainWindow()
        {
            InitializeComponent();
            timer          = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick    += new EventHandler(timer_Tick);
            tick           = new timerTick(changeStatus);

            timer1          = new DispatcherTimer();
            timer1.Interval = TimeSpan.FromSeconds(1);
            timer1.Tick    += new EventHandler(timer_Tick1);

            sliderBar1.AddHandler(Slider.PreviewMouseLeftButtonDownEvent, new MouseButtonEventHandler(sliderBar1_MouseLeftButtonDown), true);
        }
        public Media_Player()
        {
            InitializeComponent();

            timer = new DispatcherTimer()
            {
                Interval = TimeSpan.FromSeconds(1)
            };
            timer.Tick += new EventHandler(TimerTick);
            tick        = new timerTick(ChangeStatus);

            GetFileNames();
            Print();
            Select();
        }
示例#11
0
        public AudioPlayer()
        {
            InitializeComponent();
            timer          = new DispatcherTimer();
            timer.Interval = TimeSpan.FromSeconds(1);
            timer.Tick    += new EventHandler(timer_Tick);
            tick           = new timerTick(changeStatus);

            //mediaElement.Source = new Uri(ApplicationState.GetValue<string>("temp_audio_path"));
            mediaElement.Source = new Uri(@"C:\KBlog_media\1\Audio\temp.wav");

            BitmapImage bi4 = new BitmapImage();

            bi4.BeginInit();
            bi4.UriSource = new Uri(@"Images\pause.png", UriKind.Relative);
            bi4.EndInit();

            pauseBtn.Background = new ImageBrush(bi4);
            pauseBtn.Height     = 100;
            pauseBtn.Width      = 100;

            BitmapImage bi5 = new BitmapImage();

            bi5.BeginInit();
            bi5.UriSource = new Uri(@"Images\play.png", UriKind.Relative);
            bi5.EndInit();

            playBtn.Background = new ImageBrush(bi5);
            playBtn.Height     = 100;
            playBtn.Width      = 100;

            BitmapImage bi6 = new BitmapImage();

            bi6.BeginInit();
            bi6.UriSource = new Uri(@"Images\stop.png", UriKind.Relative);
            bi6.EndInit();

            stopBtn.Background = new ImageBrush(bi6);
            stopBtn.Height     = 100;
            stopBtn.Width      = 100;
        }
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            this._Media.Paused = false;
            this._Media.Repeat = false;
            this._ControlsHeight = this._ControlsRow.Height;
            this._current = -1;
            this._Media.MediaFailed += _FailedToLoad;
            this._PlayList = new MyPlaylist();
            this._Media.Volume = (double)_SliderVolume.Value;
            this._timer = new DispatcherTimer();
            this._timer.Interval = TimeSpan.FromMilliseconds(1);
            this._timer.Tick += new EventHandler(_timer_Ticker);
            this._tick = new timerTick(_changeDurationStatus);

            this._SliderVolume.Value = this._Media.Volume;

            this._doubleclicked = false;
            this._doubleclick = new Timer(750);
            this._doubleclick.Elapsed += new ElapsedEventHandler(_Elapsed);

            this._ComboBoxLanguage.ItemsSource = CultureInfo.GetCultures(CultureTypes.NeutralCultures);
            this._ComboBoxLanguage.SelectedIndex = 0;
            this._SwitchCulture();
        }