private void HandleStop() { // session end if (history == null) { return; } if (history.Empty) { log.Info("Nothing got recorded (no headset)? Discarding session."); return; } Session session = new Session(filename, startTime, DateTime.Now, history, lookProvider, serviceResult); int timesUsedBySinks = 0; foreach (var sink in sessionSinks) { if (sink.Enabled) { sink.UseSession(session); timesUsedBySinks++; } } history = null; log.Info($"Ended history session {filename}, sent to {timesUsedBySinks} session sinks."); }
public Session(string filename, DateTime start, DateTime end, LookHistory history, ILookProvider lookProvider, ServiceResult serviceResult) { version = CURRENT_VERSION; guid = Guid.NewGuid(); uri = filename; sample_rate = history.SampleRate; installation_id = Logic.Instance.settings.InstallId; time_start = start; time_end = end; lookprovider = lookProvider?.DescribeType; this.history = history.ToBase64(); this.media_id = serviceResult.mediaId; }
private void HandleNewFileIsPlaying(ServiceResult result, string concreteFile, double duration) { if (result.contentType != ServiceResult.ContentType.video) { log.Info("Only video files are supported in AnalyticsForVR"); return; } history = new LookHistory(10, duration); log.Info("New history session: " + concreteFile); filename = concreteFile; serviceResult = result; startTime = DateTime.Now; }