Exemple #1
0
    protected override void OnBeforeGraphRunning()
    {
      base.OnBeforeGraphRunning();

      // first all automatically rendered pins
      FilterGraphTools.RenderOutputPins(_graphBuilder, _dvdbasefilter);

      // MSDN: "During the connection process, the Filter Graph Manager ignores pins on intermediate filters if the pin name begins with a tilde (~)."
      // then connect the skipped "~" output pins
      FilterGraphTools.RenderAllManualConnectPins(_graphBuilder);
      _currTime = new DvdHMSFTimeCode();
    }
Exemple #2
0
 /// <summary>
 /// Converts a <see cref="DvdHMSFTimeCode"/> to <see cref="double"/> time stamp.
 /// </summary>
 /// <param name="timeCode">DvdHMSFTimeCode</param>
 /// <returns>Double</returns>
 private static double ToDouble(DvdHMSFTimeCode timeCode)
 {
   Double result = timeCode.bHours * 3600d;
   result += (timeCode.bMinutes * 60d);
   result += timeCode.bSeconds;
   return result;
 }
Exemple #3
0
 /// <summary>
 /// Calculates the duration.
 /// </summary>
 private void CalculateDuration()
 {
   DvdHMSFTimeCode totaltime = new DvdHMSFTimeCode();
   DvdTimeCodeFlags ulTimeCodeFlags;
   _dvdInfo.GetTotalTitleTime(totaltime, out ulTimeCodeFlags);
   lock (SyncObj)
     _duration = ToDouble(totaltime);
 }
Exemple #4
0
 /// <summary>
 /// Converts a <see cref="TimeSpan"/> into a <see cref="DvdHMSFTimeCode"/>.
 /// </summary>
 /// <param name="newTime">TimeSpan to convert.</param>
 /// <returns><see cref="DvdHMSFTimeCode"/> instance.</returns>
 private static DvdHMSFTimeCode ToTimeCode(TimeSpan newTime)
 {
   int hours = newTime.Hours;
   int minutes = newTime.Minutes;
   int seconds = newTime.Seconds;
   DvdHMSFTimeCode timeCode = new DvdHMSFTimeCode
   {
     bHours = (byte) (hours & 0xff),
     bMinutes = (byte) (minutes & 0xff),
     bSeconds = (byte) (seconds & 0xff),
     bFrames = 0
   };
   return timeCode;
 }