Class FileSegment
Represents a segment of a target file. It can also store the parent file that a new segment has been derived
from. A segment is just a stored start and end for a target file - it represents a future, or a request.
Other functions can take the segment request, cut out the selected range, and return a new file segment.
New file segments, or segments that represent a whole file, will not have the segment properties set
because they do not represent a request anymore.
Assembly: AnalysisBase.dll
Syntax
public class FileSegment : ICloneable, ISegment<FileInfo>, IEquatable<ISegment<FileInfo>>
Constructors
|
Improve this Doc
View Source
FileSegment(FileInfo, TimeAlignment)
Initializes a new instance of the FileSegment class.
Allow specifying an absolutely aligned (to the nearest minute) file segment.
Implies FileDateBehavior.Required
.
NOTE: Start offset will be set to start of file, and end offset set to the end of the file.
Declaration
public FileSegment(FileInfo source, TimeAlignment alignment)
Parameters
|
Improve this Doc
View Source
Initializes a new instance of the FileSegment class.
Allow specifying an absolutely aligned (to the nearest minute) file segment.
Implies FileDateBehavior.Required
.
NOTE: Start offset will be set to start of file, and end offset set to the end of the file.
Declaration
public FileSegment(FileInfo source, TimeAlignment alignment, IAudioUtility utility = null, FileSegment.FileDateBehavior dateBehavior = FileSegment.FileDateBehavior.Try)
Parameters
|
Improve this Doc
View Source
Declaration
public FileSegment(FileInfo source, DateTimeOffset startDate, IAudioUtility utility = null)
Parameters
|
Improve this Doc
View Source
FileSegment(FileInfo, Int32, TimeSpan, FileSegment.FileDateBehavior)
Initializes a new instance of the FileSegment class.
Use this constructor if you know all the information about a segment beforehand (except for the date it was created).
Declaration
public FileSegment(FileInfo source, int sampleRate, TimeSpan duration, FileSegment.FileDateBehavior dateBehavior)
Parameters
|
Improve this Doc
View Source
FileSegment(FileInfo, Int32, TimeSpan, Nullable<DateTimeOffset>)
Initializes a new instance of the FileSegment class.
Use this constructor if you know all the information about a segment beforehand.
Declaration
public FileSegment(FileInfo source, int sampleRate, TimeSpan duration, DateTimeOffset? suppliedDate = default(DateTimeOffset? ))
Parameters
Properties
|
Improve this Doc
View Source
Alignment
Gets the style of alignment padding to use - indicates that bad start dates should be shifted to the
nearest minute.
Declaration
public TimeAlignment Alignment { get; }
Property Value
|
Improve this Doc
View Source
EndOffsetSeconds
Declaration
public double EndOffsetSeconds { get; }
Property Value
|
Improve this Doc
View Source
IsSegmentSet
Gets a value indicating whether gets ISegmentSet - whether or not either of the segment properties have been set.
Declaration
public bool IsSegmentSet { get; }
Property Value
|
Improve this Doc
View Source
SegmentEndOffset
Gets or sets SegmentEndOffset - the value that represents what ending point of the target file should be used.
Declaration
public TimeSpan? SegmentEndOffset { get; set; }
Property Value
|
Improve this Doc
View Source
SegmentStartOffset
Gets or sets SegmentStartOffset - the value that represents what starting point of the target file should
be used.
Declaration
public TimeSpan? SegmentStartOffset { get; set; }
Property Value
|
Improve this Doc
View Source
Source
Gets the target file for this file segment.
Declaration
public FileInfo Source { get; }
Property Value
|
Improve this Doc
View Source
Declaration
public SourceMetadata SourceMetadata { get; }
Property Value
|
Improve this Doc
View Source
StartOffsetSeconds
Declaration
public double StartOffsetSeconds { get; }
Property Value
|
Improve this Doc
View Source
TargetFileDuration
Gets the entire audio file duration FOR THE TARGET FILE.
Declaration
public TimeSpan? TargetFileDuration { get; }
Property Value
|
Improve this Doc
View Source
TargetFileSampleRate
Gets the TARGET FILE'S audio file Sample rate.
May be required when doing analysis.
Declaration
public int? TargetFileSampleRate { get; }
Property Value
|
Improve this Doc
View Source
TargetFileStartDate
Gets the TargetFileStartDate.
Declaration
public DateTimeOffset? TargetFileStartDate { get; }
Property Value
Methods
|
Improve this Doc
View Source
Clone()
Declaration
Returns
|
Improve this Doc
View Source
Equals(ISegment<FileInfo>)
Declaration
public bool Equals(ISegment<FileInfo> other)
Parameters
Type |
Name |
Description |
ISegment<FileInfo> |
other |
The other file segment to compare with.
|
Returns
Type |
Description |
Boolean |
True if the segments are considered equal.
|
|
Improve this Doc
View Source
SplitSegment(Double, Double)
Declaration
public ISegment<FileInfo> SplitSegment(double newStart, double newEnd)
Parameters
Returns
|
Improve this Doc
View Source
ToString()
Returns a friendly string representation of this object.
Declaration
public override string ToString()
Returns
Overrides
|
Improve this Doc
View Source
Validate()
Declaration
Returns
Type |
Description |
Boolean |
True if properties are valid, otherwise false.
|
Implements
Extension Methods