// Copyright (C) 2024 Intro-Skipper contributors // SPDX-License-Identifier: GPL-3.0-only. using System; using IntroSkipper.Data; namespace IntroSkipper.Db; /// /// All times are measured in seconds relative to the beginning of the media file. /// /// /// Initializes a new instance of the class. /// public class DbSegment { /// /// Initializes a new instance of the class. /// /// The segment to initialize the instance with. /// The type of analysis that was used to determine this segment. public DbSegment(Segment segment, AnalysisMode type) { ItemId = segment.EpisodeId; Start = segment.Start; End = segment.End; Type = type; } /// /// Initializes a new instance of the class. /// public DbSegment() { } /// /// Gets or sets the episode id. /// public Guid ItemId { get; set; } /// /// Gets or sets the start time. /// public double Start { get; set; } /// /// Gets or sets the end time. /// public double End { get; set; } /// /// Gets the type of analysis that was used to determine this segment. /// public AnalysisMode Type { get; private set; } /// /// Converts the instance to a object. /// /// A object. internal Segment ToSegment() { return new Segment(ItemId, new TimeRange(Start, End)); } }