src/FingersDance.Control.SyncSource/UserControlSyncSource.xaml.cs
changeset 75 99d003723474
parent 39 0efa1d506f28
child 119 7a370bfb4d77
equal deleted inserted replaced
74:7ce946833eae 75:99d003723474
    23 
    23 
    24         #region player
    24         #region player
    25         private void UserControlPlayer_PlayerOpened(object sender, EventArgs e)
    25         private void UserControlPlayer_PlayerOpened(object sender, EventArgs e)
    26         {
    26         {
    27             //Initialisation du Timer
    27             //Initialisation du Timer
    28             UserControlTimeLine.initTimer();
    28             UCTimeLine.initTimer();
    29             //Initialisation du slider
    29             //Initialisation du slider
    30             UserControlTimeLine.initslider(UserControlPlayer.TotalMilliseconds);
    30             UCTimeLine.initslider(UserControlPlayer.TotalMilliseconds);
    31             //Demarrage du Timer
    31             //Demarrage du Timer
    32             UserControlTimeLine.timerStart();
    32             UCTimeLine.timerStart();
    33 
    33 
    34         }
    34         }
    35         #endregion
    35         #endregion
    36 
    36 
    37         #region TimeLine
    37         #region TimeLine
    50 
    50 
    51 
    51 
    52         #region SynSource pour chaque X milliseconds
    52         #region SynSource pour chaque X milliseconds
    53         private void UserControlTimeLine_TimerTick(object sender, EventArgs e)
    53         private void UserControlTimeLine_TimerTick(object sender, EventArgs e)
    54         {
    54         {
    55             if (!UserControlTimeLine.IsDragging)
    55             if (!UCTimeLine.IsDragging)
    56             {
    56             {
    57                 UserControlTimeLine.Slider.Value = UserControlPlayer.Player.Position.TotalMilliseconds;
    57                 UCTimeLine.Slider.Value = UserControlPlayer.Player.Position.TotalMilliseconds;
    58             }
    58             }
    59             if (UserControlTimeLine.FinishedDragging)
    59             if (UCTimeLine.FinishedDragging)
    60             {
    60             {
    61                 int SliderValue = (int)UserControlTimeLine.Slider.Value;
    61                 int SliderValue = (int)UCTimeLine.Slider.Value;
    62                 TimeSpan ts = new TimeSpan(0, 0, 0, 0, SliderValue);
    62                 TimeSpan ts = new TimeSpan(0, 0, 0, 0, SliderValue);
    63 
    63 
    64                 UserControlPlayer.Player.Position = ts;
    64                 UserControlPlayer.Player.Position = ts;
    65                 UserControlPlayer.playerPlay();
    65                 UserControlPlayer.playerPlay();
    66 
    66 
    67                 UserControlTimeLine.IsDragging = false;
    67                 UCTimeLine.IsDragging = false;
    68                 UserControlTimeLine.FinishedDragging = false;
    68                 UCTimeLine.FinishedDragging = false;
    69             }
    69             }
    70         }
    70         }
    71         #endregion
    71         #endregion
       
    72 
       
    73         public UserControlTimeLine userControlTimeLine
       
    74         {
       
    75             get { return this.UCTimeLine; }
       
    76         }
    72     }
    77     }
    73 }
    78 }