Directive

enum Directive : String, CaseIterable

The directives Chord Provider supports

  • t

    Meta-data directives

    This directive defines the title of the song

    Declaration

    Swift

    case t
  • Declaration

    Swift

    case title
  • st

    This directive defines a subtitle of the song

    Note

    It will be used as artist

    Declaration

    Swift

    case st
  • Declaration

    Swift

    case subtitle
  • This directive defines an artist

    Declaration

    Swift

    case artist
  • This directive defines an album this song occurs on

    Declaration

    Swift

    case album
  • The year this song was first published, as a four-digit number

    Declaration

    Swift

    case year
  • key

    This directive specifies the key the song is written in

    Declaration

    Swift

    case key
  • This directive specifies a time signature

    Declaration

    Swift

    case time
  • This directive specifies the tempo in number of beats per minute for the song

    Declaration

    Swift

    case tempo
  • This directive specifies the capo setting for the song

    Declaration

    Swift

    case capo
  • c

    Formatting directives

    This directive introduce a comment line

    Declaration

    Swift

    case c
  • Declaration

    Swift

    case comment
  • Environment directives

    Chorus

    This directive indicates that the lines that follow form the song’s chorus

    Declaration

    Swift

    case startOfChorus = "start_of_chorus"
  • soc

    This directive indicates that the lines that follow form the song’s chorus

    Declaration

    Swift

    case soc
  • This directive indicates the end of the chorus

    Declaration

    Swift

    case endOfChorus = "end_of_chorus"
  • eoc

    This directive indicates the end of the chorus

    Declaration

    Swift

    case eoc
  • This directive indicates that the song chorus must be played here

    Declaration

    Swift

    case chorus
  • Verse

    Specifies that the following lines form a verse of the song

    Declaration

    Swift

    case startOfVerse = "start_of_verse"
  • sov

    Specifies that the following lines form a verse of the song

    Declaration

    Swift

    case sov
  • Specifies the end of the verse

    Declaration

    Swift

    case endOfVerse = "end_of_verse"
  • eov

    Specifies the end of the verse

    Declaration

    Swift

    case eov
  • Bridge

    Specifies that the following lines form a bridge of the song

    Declaration

    Swift

    case startOfBridge = "start_of_bridge"
  • sob

    Specifies that the following lines form a bridge of the song

    Declaration

    Swift

    case sob
  • Specifies the end of the bridge

    Declaration

    Swift

    case endOfBridge = "end_of_bridge"
  • eob

    Specifies the end of the bridge

    Declaration

    Swift

    case eob
  • Tab

    This directive indicates that the lines that follow form a section of guitar TAB instructions

    Declaration

    Swift

    case startOfTab = "start_of_tab"
  • sot

    This directive indicates that the lines that follow form a section of guitar TAB instructions

    Declaration

    Swift

    case sot
  • This directive indicates the end of the tab

    Declaration

    Swift

    case endOfTab = "end_of_tab"
  • eot

    This directive indicates the end of the tab

    Declaration

    Swift

    case eot
  • Grid

    This directive indicates that the lines that follow define a chord grid in the style of Jazz Grilles

    Declaration

    Swift

    case startOfGrid = "start_of_grid"
  • sog

    This directive indicates that the lines that follow define a chord grid in the style of Jazz Grilles

    Declaration

    Swift

    case sog
  • This directive indicates the end of the grid

    Declaration

    Swift

    case endOfGrid = "end_of_grid"
  • eog

    This directive indicates the end of the grid

    Declaration

    Swift

    case eog
  • Chord diagrams

    This directive defines a chord in terms of fret/string positions and, optionally, finger settings

    Declaration

    Swift

    case define
  • Custom directives

    This directive has the path to the music file

    Declaration

    Swift

    case musicPath = "musicpath"
  • The start and end of the directive

    Declaration

    Swift

    var format: (start: String, end: String) { get }
  • The raw label of the directive

    Declaration

    Swift

    func label(_ directive: ChordPro.Directive) -> String

    Parameters

    directive

    The ChordPro/Directive

    Return Value

    The raw value as String

  • The kind of directive (block or inline)

    Note

    This is used to move the cursor in the editor when you apply a directive to selected text in the editor

    Declaration

    Swift

    var kind: Kind { get }
  • The kind of directive (block or inline)

    See more

    Declaration

    Swift

    enum Kind
  • The label for the button

    Declaration

    Swift

    var label: (text: String, icon: String) { get }
  • Array of Metadata ChordPro/Directive

    Declaration

    Swift

    static var metaDataDirectives: [ChordPro.Directive] { get }
  • Array of environment ChordPro/Directive

    Declaration

    Swift

    static var environmentDirectives: [ChordPro.Directive] { get }