Class Sequence
Sequence containing tracks and recorded samples
Inheritance
Implements
Inherited Members
Namespace: Phoenix.Input
Assembly: Phoenix.Plugin.Input.dll
Syntax
public class Sequence : INotifyPropertyChanged, IDisposable
Constructors
View SourceSequence()
Initializes a new instance of the Sequence class
Declaration
public Sequence()
Sequence(String)
Initializes a new instance of the Sequence class
Declaration
public Sequence(string pathToLoadFrom)
Parameters
Type | Name | Description |
---|---|---|
System.String | pathToLoadFrom | Path to load from, otherwise a blank sequence is created |
Fields
View SourceCommaEscape
Character sequence for escaping commas
Declaration
public const string CommaEscape = ","
Field Value
Type | Description |
---|---|
System.String |
TicksPerSecond
Minimum unit of time for storing samples
Declaration
public const double TicksPerSecond = 30
Field Value
Type | Description |
---|---|
System.Double |
Properties
View SourceIsPaused
Gets a value indicating whether the sequence playback is suspended
Declaration
public bool IsPaused { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsPlaying
Gets a value indicating whether the sequence is in the middle of playback
Declaration
public bool IsPlaying { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsRecording
Gets a value indicating whether the sequence is recording
Declaration
public bool IsRecording { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Length
Gets the sequence length in seconds
Declaration
public double Length { get; }
Property Value
Type | Description |
---|---|
System.Double |
LengthTicks
Gets the sequence length in ticks
Declaration
public int LengthTicks { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
LockUpdate
Gets or sets a value indicating whether update notifications should be put on hold
Declaration
public bool LockUpdate { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Loop
Gets or sets a value indicating whether the sequence should loop when last sample is processed
Declaration
public bool Loop { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Path
Gets or sets the path the sequence was last loaded from
Declaration
public string Path { get; set; }
Property Value
Type | Description |
---|---|
System.String |
PlaybackEnd
Gets or sets the end of playback in seconds
Declaration
public double PlaybackEnd { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
PlaybackEndTick
Gets or sets the end of playback in ticks
Declaration
public int PlaybackEndTick { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
PlaybackLength
Gets the length of playback between in/out points in seconds
Declaration
public double PlaybackLength { get; }
Property Value
Type | Description |
---|---|
System.Double |
PlaybackLengthTicks
Gets the length of playback between in/out points in ticks
Declaration
public int PlaybackLengthTicks { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
PlaybackStart
Gets or sets the start of playback in seconds
Declaration
public double PlaybackStart { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
PlaybackStartTick
Gets or sets the start of playback in ticks
Declaration
public int PlaybackStartTick { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Position
Gets or sets the current sequence position
Declaration
public double Position { get; set; }
Property Value
Type | Description |
---|---|
System.Double |
PositionTicks
Gets or sets the current position in ticks
Declaration
public int PositionTicks { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
Tracks
Gets the tracks with information on samples expected
Declaration
public Collection<Track> Tracks { get; }
Property Value
Type | Description |
---|---|
System.Collections.ObjectModel.Collection<Track> |
Methods
View SourceClearSamples()
Clears sequence of all samples
Declaration
public void ClearSamples()
Deserialize(String)
Loads samples from file. Serialization functions are the only ones that assume data contained in Sequence is controller input.
Declaration
public void Deserialize(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | Path to load from |
Deserialize(String[])
Deserialize from an array of text lines
Declaration
public void Deserialize(string[] lines)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | lines | Text to read |
Dispose()
Disposes Sequence to finalize running threads properly
Declaration
public void Dispose()
Dispose(Boolean)
Perform finalization
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Whether to dispose managed resources |
Duplicate()
Duplicates tracks and samples but not the state data (does include view and position)
Declaration
public Sequence Duplicate()
Returns
Type | Description |
---|---|
Sequence | A duplicate of the sequence not including state |
Finalize()
Finalizes an instance of the Sequence class.
Declaration
protected void Finalize()
GetRange(Double, Double)
Returns an array of samples between specific points in local sequence time
Declaration
public Sample[] GetRange(double startTime, double endTime)
Parameters
Type | Name | Description |
---|---|---|
System.Double | startTime | Start time to get samples for |
System.Double | endTime | End time to get samples for |
Returns
Type | Description |
---|---|
Sample[] | Samples in range |
GetRange(Int32, Int32)
Returns an array of samples between two ticks in local sequence time
Declaration
public Sample[] GetRange(int startTick, int endTick)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startTick | Time tick to get samples for |
System.Int32 | endTick | End tick to get samples for |
Returns
Type | Description |
---|---|
Sample[] | A range of samples as an array |
GetSamples()
Returns a copy of all samples in an array sorted by time from start to end of sequence
Declaration
public Sample[] GetSamples()
Returns
Type | Description |
---|---|
Sample[] | All samples |
Pause()
Suspends sequence playback
Declaration
public void Pause()
Play()
Commences or resumes sequence playback
Declaration
public void Play()
Record()
Commences sequence recording
Declaration
public void Record()
SecondsToTicks(Double)
Converts seconds to ticks
Declaration
public static int SecondsToTicks(double seconds)
Parameters
Type | Name | Description |
---|---|---|
System.Double | seconds | Seconds to convert |
Returns
Type | Description |
---|---|
System.Int32 | Time in ticks |
SecondsToTicksCeil(Double)
Converts seconds to ticks using ceiling rounding
Declaration
public static int SecondsToTicksCeil(double seconds)
Parameters
Type | Name | Description |
---|---|---|
System.Double | seconds | Seconds to convert |
Returns
Type | Description |
---|---|
System.Int32 | Time in ticks |
Serialize()
Write samples to a string.
Declaration
public string Serialize()
Returns
Type | Description |
---|---|
System.String | Samples as a string |
Serialize(String)
Writes samples to file. Serialization functions are the only ones that assume data contained in Sequence is controller input.
Declaration
public void Serialize(string filePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | filePath | Path to write to |
Stop()
Stops playback and ends the playing thread, resetting current position to 0
Declaration
public void Stop()
TicksToSeconds(Int32)
Converts ticks to seconds
Declaration
public static double TicksToSeconds(int ticks)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | ticks | Ticks to convert |
Returns
Type | Description |
---|---|
System.Double | Time in seconds |
Events
View SourcePropertyChanged
Property changed event required for INotifyPropertyChanged support
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type | Description |
---|---|
System.ComponentModel.PropertyChangedEventHandler |
SampleAvailable
Sample available event
Declaration
public event EventHandler SampleAvailable
Event Type
Type | Description |
---|---|
System.EventHandler |
StateChanged
State changed event
Declaration
public event EventHandler StateChanged
Event Type
Type | Description |
---|---|
System.EventHandler |