simfile.ssc =========== .. py:module:: simfile.ssc .. autoapi-nested-parse:: Simfile & chart classes for SSC files. Classes ------- .. autoapisummary:: simfile.ssc.SSCChart simfile.ssc.AttachedSSCChart simfile.ssc.SSCCharts simfile.ssc.SSCSimfile Module Contents --------------- .. py:class:: SSCChart Bases: :py:obj:`simfile.base.BaseChart` SSC implementation of :class:`~simfile.base.BaseChart`. Unlike :class:`~simfile.sm.SMChart`, SSC chart metadata is stored as key-value pairs, so this class allows full modification of its backing OrderedDict. Adds the following known properties: * Metadata: `chartname`, `chartstyle`, `credit`, `timesignatures` * File paths: `music` * Gameplay events: `tickcounts`, `combos`, `speeds`, `scrolls`, `fakes`, `attacks` * Timing data: `bpms`, `stops`, `delays`, `warps`, `labels`, `offset`, `displaybpm` .. py:attribute:: chartname .. py:attribute:: chartstyle .. py:attribute:: music .. py:attribute:: credit .. py:attribute:: offset .. py:attribute:: bpms .. py:attribute:: stops .. py:attribute:: delays .. py:attribute:: timesignatures .. py:attribute:: tickcounts .. py:attribute:: combos .. py:attribute:: warps .. py:attribute:: speeds .. py:attribute:: scrolls .. py:attribute:: fakes .. py:attribute:: labels .. py:attribute:: attacks .. py:attribute:: displaybpm .. py:attribute:: notes .. py:method:: from_str(string: str, strict: bool = True) -> SSCChart :classmethod: Parse a string containing MSD data into an SSC chart. The first property's key must be `NOTEDATA`. Parsing ends at the `NOTES` (or `NOTES2`) property. By default, the underlying parser will throw an exception if it finds any stray text between parameters. This behavior can be overridden by setting `strict` to False. .. py:method:: blank() -> SSCChart :classmethod: Generate a blank, valid chart populated with standard keys. This should approximately match blank charts produced by the StepMania editor. .. py:method:: serialize(file) Write the object to provided text file object as MSD. .. py:class:: AttachedSSCChart Bases: :py:obj:`SSCChart`, :py:obj:`simfile.base.BaseAttachedChart`\ [\ :py:obj:`SSCChart`\ , :py:obj:`SSCSimfile`\ ] SSC implementation of :class:`~simfile.base.BaseChart`. Unlike :class:`~simfile.sm.SMChart`, SSC chart metadata is stored as key-value pairs, so this class allows full modification of its backing OrderedDict. Adds the following known properties: * Metadata: `chartname`, `chartstyle`, `credit`, `timesignatures` * File paths: `music` * Gameplay events: `tickcounts`, `combos`, `speeds`, `scrolls`, `fakes`, `attacks` * Timing data: `bpms`, `stops`, `delays`, `warps`, `labels`, `offset`, `displaybpm` .. py:method:: detach() -> SSCChart .. py:class:: SSCCharts(simfile: S, charts: Optional[Iterable[C]] = None) Bases: :py:obj:`simfile.base.BaseCharts`\ [\ :py:obj:`AttachedSSCChart`\ , :py:obj:`SSCChart`\ , :py:obj:`SSCSimfile`\ ] SSC implementation of :class:`~simfile.base.BaseCharts`. List elements are :class:`SSCChart` instances. .. py:method:: append(chart: SSCChart) Append object to the end of the list. .. py:method:: extend(iterable: Iterable[SSCChart]) -> None Extend list by appending elements from the iterable. .. py:class:: SSCSimfile(*, file: Optional[TextIO] = None, string: Optional[str] = None, tokens: Optional[Iterable[Tuple[msdparser.lexer.MSDToken, str]]] = None, strict: bool = True) Bases: :py:obj:`simfile.base.BaseSimfile` SSC implementation of :class:`~simfile.base.BaseSimfile`. Adds the following known properties: * SSC version: `version` * Metadata: `origin`, `labels`, `lastsecondhint` * File paths: `previewvid`, `jacket`, `cdimage`, `discimage`, `preview` * Gameplay events: `combos`, `speeds`, `scrolls`, `fakes` * Timing data: `warps` .. py:attribute:: version .. py:attribute:: origin .. py:attribute:: previewvid .. py:attribute:: jacket .. py:attribute:: cdimage .. py:attribute:: discimage .. py:attribute:: preview .. py:attribute:: lastsecondhint .. py:attribute:: warps .. py:attribute:: labels .. py:attribute:: combos .. py:attribute:: speeds .. py:attribute:: scrolls .. py:attribute:: fakes .. py:method:: blank() -> SSCSimfile :classmethod: Generate a blank, valid simfile populated with standard keys. This should approximately match the simfile produced by the StepMania editor in a directory with no .sm or .ssc files. .. py:property:: charts :type: SSCCharts List of charts associated with this simfile.