Class SampleSet
A thread safe ordered set with notifications
Inheritance
Implements
Inherited Members
Namespace: Phoenix.Input
Assembly: Phoenix.Plugin.Input.dll
Syntax
public class SampleSet : INotifyCollectionChanged
Constructors
View SourceSampleSet()
Initializes a new instance of the SampleSet class
Declaration
public SampleSet()
Properties
View SourceCount
Gets the number of samples
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
First
Gets the oldest sample
Declaration
public Sample First { get; }
Property Value
Type | Description |
---|---|
Sample |
Last
Gets the most recent sample
Declaration
public Sample Last { get; }
Property Value
Type | Description |
---|---|
Sample |
Methods
View SourceAdd(Sample)
Adds an item to the set
Declaration
public void Add(Sample item)
Parameters
Type | Name | Description |
---|---|---|
Sample | item | Item to add |
Clear()
Clears all items from the list
Declaration
public void Clear()
GetAt(Double)
Get sample at specific time
Declaration
public Sample GetAt(double time)
Parameters
Type | Name | Description |
---|---|---|
System.Double | time | Time to get sample at |
Returns
Type | Description |
---|---|
Sample | Sample or null if none |
GetAt(Int32)
Get sample at specific time
Declaration
public Sample GetAt(int tick)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tick | Tick to get sample from |
Returns
Type | Description |
---|---|
Sample | Sample at specified time or null if none |
GetNext(Sample)
Get next sample on the track after specified sample
Declaration
public Sample GetNext(Sample sample)
Parameters
Type | Name | Description |
---|---|---|
Sample | sample | Sample to get next for |
Returns
Type | Description |
---|---|
Sample | Next sample or null if sample is already most recent on the track |
GetNext(Double)
Get next sample from specific time
Declaration
public Sample GetNext(double time)
Parameters
Type | Name | Description |
---|---|---|
System.Double | time | Time offset in seconds from zero |
Returns
Type | Description |
---|---|
Sample | Next sample after the time, if any |
GetNext(Int32)
Get next sample from specific tick
Declaration
public Sample GetNext(int tick)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tick | Tick offset from zero |
Returns
Type | Description |
---|---|
Sample | Next sample after the tick, if any |
GetNextExclude(Sample, Sample[])
Get next sample on the track after specified sample except those in exclude list
Declaration
public static Sample GetNextExclude(Sample sample, Sample[] exclude)
Parameters
Type | Name | Description |
---|---|---|
Sample | sample | Sample to get next for |
Sample[] | exclude | Samples to ignore during search |
Returns
Type | Description |
---|---|
Sample | Next sample or null if none found |
GetPrevious(Sample)
Get previous sample on the track before specified sample
Declaration
public Sample GetPrevious(Sample sample)
Parameters
Type | Name | Description |
---|---|---|
Sample | sample | Sample to get previous for |
Returns
Type | Description |
---|---|
Sample | Previous sample or null if sample is already oldest on the track |
GetPrevious(Double)
Get previous sample on the track before specified time
Declaration
public Sample GetPrevious(double time)
Parameters
Type | Name | Description |
---|---|---|
System.Double | time | Time offset from zero |
Returns
Type | Description |
---|---|
Sample | Sample before the time |
GetPrevious(Int32)
Get previous sample on the track before specified tick
Declaration
public Sample GetPrevious(int tick)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | tick | Tick offset from zero |
Returns
Type | Description |
---|---|
Sample | Sample before the tick |
GetPreviousExclude(Sample, Sample[])
Get previous sample on the track before specified sample except those in exclude list
Declaration
public static Sample GetPreviousExclude(Sample sample, Sample[] exclude)
Parameters
Type | Name | Description |
---|---|---|
Sample | sample | Sample to get previous for |
Sample[] | exclude | Samples to ignore during search |
Returns
Type | Description |
---|---|
Sample | Previous sample or null if none found |
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 in seconds |
System.Double | endTime | End time in seconds |
Returns
Type | Description |
---|---|
Sample[] | An array of samples |
GetRange(Int32, Int32)
Returns an array of samples between specific points in local sequence time
Declaration
public Sample[] GetRange(int startTick, int endTick)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | startTick | Start time in ticks |
System.Int32 | endTick | End time in ticks |
Returns
Type | Description |
---|---|
Sample[] | An array of samples |
Remove(Sample)
Removes an item from the set
Declaration
public void Remove(Sample item)
Parameters
Type | Name | Description |
---|---|---|
Sample | item | Item to remove |
ToArray()
Returns a snapshot of contents
Declaration
public Sample[] ToArray()
Returns
Type | Description |
---|---|
Sample[] | Snapshot of contents |
Events
View SourceCollectionChanged
Event fired when collection changes
Declaration
public event NotifyCollectionChangedEventHandler CollectionChanged
Event Type
Type | Description |
---|---|
System.Collections.Specialized.NotifyCollectionChangedEventHandler |