Class ChartFile
- Namespace
- ChartTools.IO.Chart
- Assembly
- ChartTools.dll
Provides methods for reading and writing chart files
public static class ChartFile
- Inheritance
-
ChartFile
- Inherited Members
Properties
DefaultReadConfig
Default configuration to use for reading when the provided configuration is default
public static ChartReadingConfiguration DefaultReadConfig { get; set; }
Property Value
DefaultWriteConfig
Default configuration to use for writing when the provided configuration is default
public static ChartWritingConfiguration DefaultWriteConfig { get; set; }
Property Value
Methods
ReadComponents(ReadingDataSource, ComponentList, ChartReadingConfiguration?)
Reads a a set of Song components from a chart target.
public static Song ReadComponents(ReadingDataSource source, ComponentList components, ChartReadingConfiguration? config = null)
Parameters
sourceReadingDataSourceFile path or stream to read from
componentsComponentListSet of components to read
configChartReadingConfigurationOptional read configuration
Returns
ReadComponentsAsync(ReadingDataSource, ComponentList, ChartReadingConfiguration?, CancellationToken)
Reads a a set of Song components from a chart target asynchronously.
public static Task<Song> ReadComponentsAsync(ReadingDataSource source, ComponentList components, ChartReadingConfiguration? config = null, CancellationToken cancellationToken = default)
Parameters
sourceReadingDataSourceFile path or stream to read from
componentsComponentListSet of components to read
configChartReadingConfigurationOptional read configuration
cancellationTokenCancellationTokenToken used for cancellation
Returns
Remarks
Uses multi-threading to parse song components.
ReadGlobalEvents(ReadingDataSource)
Reads the set of GlobalEvent from a chart target.
public static List<GlobalEvent> ReadGlobalEvents(ReadingDataSource source)
Parameters
sourceReadingDataSourceFile path or stream to read from
Returns
ReadGlobalEventsAsync(ReadingDataSource, CancellationToken)
Reads the set of GlobalEvent from a chart target asynchronously.
public static Task<List<GlobalEvent>> ReadGlobalEventsAsync(ReadingDataSource source, CancellationToken cancellationToken = default)
Parameters
sourceReadingDataSourceFile path or stream to read from
cancellationTokenCancellationTokenToken used for cancellation
Returns
ReadInstruments(ReadingDataSource, InstrumentComponentList, ChartReadingConfiguration?)
Reads a set of Instrument from a chart target.
public static InstrumentSet ReadInstruments(ReadingDataSource source, InstrumentComponentList components, ChartReadingConfiguration? config = null)
Parameters
sourceReadingDataSourceFile path or stream to read from
componentsInstrumentComponentListInstruments to read
configChartReadingConfigurationOptional read config
Returns
ReadInstrumentsAsync(ReadingDataSource, InstrumentComponentList, ChartReadingConfiguration?, CancellationToken)
Reads a set of Instrument from a chart target asynchronously.
public static Task<InstrumentSet> ReadInstrumentsAsync(ReadingDataSource source, InstrumentComponentList components, ChartReadingConfiguration? config = null, CancellationToken cancellationToken = default)
Parameters
sourceReadingDataSourceFile path or stream to read from
componentsInstrumentComponentListInstruments to read
configChartReadingConfigurationOptional read config
cancellationTokenCancellationTokenToken used for cancellation
Returns
Remarks
Uses multi-threading to parse tracks.
ReadMetadata(ReadingDataSource, Metadata?)
Reads the Metadata from a chart target.
public static Metadata ReadMetadata(ReadingDataSource source, Metadata? existing = null)
Parameters
sourceReadingDataSourceFile path or stream to read from
existingMetadataMetadata from another target to combine with
Returns
ReadMetadataAsync(ReadingDataSource, Metadata?, CancellationToken)
Reads the Metadata from a chart target asynchronously.
public static Task<Metadata> ReadMetadataAsync(ReadingDataSource source, Metadata? existing = null, CancellationToken cancellationToken = default)
Parameters
sourceReadingDataSourceFile path or stream to read from
existingMetadataMetadata from another target to combine with
cancellationTokenCancellationTokenToken to request cancellation
Returns
- Task<Metadata>
Metadata object provided as the
existingparameter, or a new instance if passed null.
ReadSong(ReadingDataSource, ChartReadingConfiguration?)
Reads a Song from a chart target.
public static Song ReadSong(ReadingDataSource source, ChartReadingConfiguration? config = null)
Parameters
sourceReadingDataSourceFile path or stream to read from
configChartReadingConfigurationOptional read configuration
Returns
ReadSongAsync(ReadingDataSource, ChartReadingConfiguration?, CancellationToken)
Reads a Song from a chart target asynchronously.
public static Task<Song> ReadSongAsync(ReadingDataSource source, ChartReadingConfiguration? config = null, CancellationToken cancellationToken = default)
Parameters
sourceReadingDataSourceFile path or stream to read from
configChartReadingConfigurationOptional read configuration
cancellationTokenCancellationTokenToken used for cancellation
Returns
Remarks
Uses multi-threading to parse song components.
ReadSyncTrack(ReadingDataSource, ChartReadingConfiguration?)
Reads the SyncTrack from a chart target.
public static SyncTrack ReadSyncTrack(ReadingDataSource source, ChartReadingConfiguration? config = null)
Parameters
sourceReadingDataSourceFile path or stream to read from
configChartReadingConfigurationOptional read config
Returns
ReadSyncTrackAsync(ReadingDataSource, ChartReadingConfiguration?, CancellationToken)
Reads the SyncTrack from a chart target asynchronously.
public static Task<SyncTrack> ReadSyncTrackAsync(ReadingDataSource source, ChartReadingConfiguration? config = null, CancellationToken cancellationToken = default)
Parameters
sourceReadingDataSourceFile path or stream to read from
configChartReadingConfigurationOptional read config
cancellationTokenCancellationTokenToken used for cancellation
Returns
ReadVocals(ReadingDataSource)
Reads the StandardVocalsTrack from a chart target.
public static StandardVocalsTrack ReadVocals(ReadingDataSource source)
Parameters
sourceReadingDataSourceFile path or stream to read from
Returns
ReadVocalsAsync(ReadingDataSource, CancellationToken)
Reads the StandardVocalsTrack from a chart target asynchronously.
public static Task<StandardVocalsTrack> ReadVocalsAsync(ReadingDataSource source, CancellationToken cancellationToken = default)
Parameters
sourceReadingDataSourceFile path or stream to read from
cancellationTokenCancellationTokenToken used for cancellation
Returns
ReplaceComponents(WritingDataSource, Song, ComponentList, ChartWritingConfiguration?)
Replaces a set of Song components in a chart target.
public static void ReplaceComponents(WritingDataSource source, Song song, ComponentList components, ChartWritingConfiguration? config = null)
Parameters
sourceWritingDataSourceFile path or stream to write to
songSongSong data to write
componentsComponentListSet of components to replace
configChartWritingConfigurationOptional write config
ReplaceComponentsAsync(WritingDataSource, Song, ComponentList, ChartWritingConfiguration?, CancellationToken)
Replaces a set of Song components in a chart target asynchronously.
public static Task ReplaceComponentsAsync(WritingDataSource source, Song song, ComponentList components, ChartWritingConfiguration? config = null, CancellationToken cancellationToken = default)
Parameters
sourceWritingDataSourceFile path or stream to write to
songSongSong data to write
componentsComponentListSet of components to replace
configChartWritingConfigurationOptional write config
cancellationTokenCancellationTokenToken used for cancellation
Returns
Remarks
Uses multi-threading to serialize song components.
ReplaceGlobalEvents(WritingDataSource, IEnumerable<GlobalEvent>)
Replaces the set of GlobalEvent in a chart target.
public static void ReplaceGlobalEvents(WritingDataSource source, IEnumerable<GlobalEvent> events)
Parameters
sourceWritingDataSourceFile path or stream to write to
eventsIEnumerable<GlobalEvent>Events to use as a replacement
ReplaceGlobalEventsAsync(WritingDataSource, IEnumerable<GlobalEvent>, CancellationToken)
Replaces the set of GlobalEvent in a chart target asynchronously.
public static Task ReplaceGlobalEventsAsync(WritingDataSource source, IEnumerable<GlobalEvent> events, CancellationToken cancellationToken = default)
Parameters
sourceWritingDataSourceFile path or stream to write to
eventsIEnumerable<GlobalEvent>Events to use as a replacement
cancellationTokenCancellationTokenToken used for cancellation
Returns
ReplaceInstruments(WritingDataSource, InstrumentSet, InstrumentComponentList, ChartWritingConfiguration?, FormattingRules?)
Replaces a set of instruments in a chart target.
public static void ReplaceInstruments(WritingDataSource source, InstrumentSet set, InstrumentComponentList components, ChartWritingConfiguration? config = null, FormattingRules? formatting = null)
Parameters
sourceWritingDataSourceFile path or stream to write to
setInstrumentSetInstrument data to write
componentsInstrumentComponentListSet of instruments and tracks to replace
configChartWritingConfigurationOptional write config
formattingFormattingRulesFormatting to apply
ReplaceInstrumentsAsync(WritingDataSource, InstrumentSet, InstrumentComponentList, ChartWritingConfiguration?, FormattingRules?, CancellationToken)
Replaces a set of instruments in a chart target asynchronously.
public static Task ReplaceInstrumentsAsync(WritingDataSource source, InstrumentSet set, InstrumentComponentList components, ChartWritingConfiguration? config = null, FormattingRules? formatting = null, CancellationToken cancellationToken = default)
Parameters
sourceWritingDataSourceFile path or stream to write to
setInstrumentSetInstrument data to write
componentsInstrumentComponentListSet of instruments and tracks to replace
configChartWritingConfigurationOptional write config
formattingFormattingRulesFormatting to apply
cancellationTokenCancellationTokenToken used for cancellation
Returns
ReplaceMetadata(WritingDataSource, Metadata)
Replaces the Metadata in a chart target.
public static void ReplaceMetadata(WritingDataSource source, Metadata metadata)
Parameters
sourceWritingDataSourceFile path or stream to write to
metadataMetadataMetadata to write
ReplaceMetadataAsync(WritingDataSource, Metadata, CancellationToken)
Replaces the Metadata in a chart target asynchronously.
public static Task ReplaceMetadataAsync(WritingDataSource source, Metadata metadata, CancellationToken cancellationToken = default)
Parameters
sourceWritingDataSourceFile path or stream to write to
metadataMetadataMetadata to write
cancellationTokenCancellationTokenToken used for cancellation
Returns
ReplaceSyncTrack(WritingDataSource, SyncTrack, ChartWritingConfiguration?)
Replaces the sync track in a chart target.
public static void ReplaceSyncTrack(WritingDataSource source, SyncTrack syncTrack, ChartWritingConfiguration? config = null)
Parameters
sourceWritingDataSourceFile path or stream to write to
syncTrackSyncTrackSync track to write
configChartWritingConfigurationOptional write configuration
ReplaceSyncTrackAsync(WritingDataSource, SyncTrack, ChartWritingConfiguration?, CancellationToken)
Replaces the sync track in a chart target asynchronously.
public static Task ReplaceSyncTrackAsync(WritingDataSource source, SyncTrack syncTrack, ChartWritingConfiguration? config = null, CancellationToken cancellationToken = default)
Parameters
sourceWritingDataSourceFile path or stream to write to
syncTrackSyncTrackSync track to write
configChartWritingConfigurationOptional write configuration
cancellationTokenCancellationTokenToken used for cancellation
Returns
WriteSong(WritingDataSource, Song, ChartWritingConfiguration?)
Writes a Song to a chart target.
public static void WriteSong(WritingDataSource source, Song song, ChartWritingConfiguration? config = null)
Parameters
sourceWritingDataSourceFile path or stream to write to
songSongSong to write
configChartWritingConfigurationOptional write configuration
WriteSongAsync(WritingDataSource, Song, ChartWritingConfiguration?, CancellationToken)
Writes a Song to a chart target asynchronously.
public static Task WriteSongAsync(WritingDataSource source, Song song, ChartWritingConfiguration? config = null, CancellationToken cancellationToken = default)
Parameters
sourceWritingDataSourceFile path or stream to write to
songSongSong to write
configChartWritingConfigurationOptional write configuration
cancellationTokenCancellationTokenToken to request cancellation
Returns
Remarks
Uses multi-threading to serialize song components.