Exemplo n.º 1
0
        static void checkMpcViewTime(string media, MediaUnit mu)
        {
            var mpc = getMediaPlayerCalssicPositionInSec(media);

            if (mpc > mu.PositionSec)
            {
                if (mu.PositionSec == 0)
                {
                    ViewTimeLog.Log(TimeSpan.FromSeconds(mpc));
                }
                mu.Position = TimeSpan.FromSeconds(mu.PositionSec = mpc);
            }
        }
Exemplo n.º 2
0
        public static ViewTimeLog GetViewTimeLogSingleton(bool needLatest = false)
        {
            if (_vtl == null)
            {
                var fdel = Path.GetDirectoryName(_file);
                try { if (!Directory.Exists(fdel))
                      {
                          Directory.CreateDirectory(fdel);
                      }
                }
                catch (Exception ex) { System.Diagnostics.Trace.WriteLine(ex.Message, System.Reflection.MethodInfo.GetCurrentMethod().Name); if (System.Diagnostics.Debugger.IsAttached)
                                       {
                                           System.Diagnostics.Debugger.Break();
                                       }
                                       throw; }
                _vtl = Serializer.LoadFromFile <ViewTimeLog>(_file) as ViewTimeLog;
            }

            return(_vtl);
        }