Directive
enum Directive: DirectiveSource, CaseIterable, Identifiable, Codable
The directives Chord Provider supports
-
The ID of the directive
Declaration
Swift
var id: String -
The label of the directive
Declaration
Swift
var label: String -
The directive as string
Declaration
Swift
var directive: String -
The icon of the directive
Declaration
Swift
var icon: String -
Bool if the directive is editable
Declaration
Swift
var editable: Bool -
The help for the directive
Declaration
Swift
var help: String -
The button label of the directive
Declaration
Swift
var button: String -
The environment of the directive
Declaration
Swift
var environment: ChordPro.Environment
-
Meta-data directives
This directive defines the title of the song
Declaration
Swift
case title = "title|t" -
This directive defines a subtitle of the song
Declaration
Swift
case subtitle = "subtitle|st" -
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 -
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 -
This directive specifies the instrument setting for the song
Declaration
Swift
case instrument -
Formatting directives
This directive introduce a comment line
Declaration
Swift
case comment = "comment|c" -
Specifies the name of the file containing the image
Declaration
Swift
case image -
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 the end of the chorus
Declaration
Swift
case endOfChorus = "end_of_chorus|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 the end of the verse
Declaration
Swift
case endOfVerse = "end_of_verse|eov" -
Bridge
Specifies that the following lines form a bridge of the song
Declaration
Swift
case startOfBridge = "start_of_bridge|sob" -
Specifies the end of the bridge
Declaration
Swift
case endOfBridge = "end_of_bridge|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 the end of the tab
Declaration
Swift
case endOfTab = "end_of_tab|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 the end of the grid
Declaration
Swift
case endOfGrid = "end_of_grid|eog" -
Delegated environment directives
ABC
This directive indicates that the lines that follow define a piece of music written in ABC music notation
Declaration
Swift
case startOfABC = "start_of_abc" -
This directive indicates the end of the ABC
Declaration
Swift
case endOfABC = "end_of_abc" -
Textblock
This directive indicates that the lines that follow define a piece of text that is combined into a single object that can be placed as an image
Declaration
Swift
case startOfTextblock = "start_of_textblock" -
This directive indicates the end of the textblock
Declaration
Swift
case endOfTextblock = "end_of_textblock" -
Chord diagrams
This directive defines a chord in terms of fret/string positions and, optionally, finger settings
Declaration
Swift
case define
-
This directive forces a new page to be generated at the place where it occurs in the song
Declaration
Swift
case newPage = "new_page|np" -
When printing songs in multiple columns, this directive forces printing to continue in the next column
Declaration
Swift
case columnBreak = "column_break|colb"
-
This directive defines a tag for the song
Declaration
Swift
case tag -
Strum
This directive indicates that the lines that follow defines a strum pattern
Declaration
Swift
case startOfStrum = "start_of_strum|sos" -
This directive indicates the end of the strum
Declaration
Swift
case endOfStrum = "end_of_strum|eos"
-
Note
These are not real directives A comment in the sourceDeclaration
Swift
case sourceComment = "source_comment" -
A line that is inside an environment
Declaration
Swift
case environmentLine = "environment_line" -
An empty line
Declaration
Swift
case emptyLine = "empty_line" -
An unknown directive
Declaration
Swift
case unknown
-
The start and end of the directive
Declaration
Swift
var format: (start: String, end: String) -
The raw label of the directive
Declaration
Swift
func label(_ directive: ChordPro.Directive) -> StringParameters
directiveThe
ChordPro/DirectiveReturn Value
The raw value as
String -
The kind of directive (block, inline or optional label)
Declaration
Swift
var kind: Kind -
The kind of directive (block or inline)
See moreDeclaration
Swift
enum Kind
-
Array of Metadata
ChordPro/DirectiveDeclaration
Swift
static var metadataDirectives: [ChordPro.Directive] -
Array of environment
ChordPro/DirectiveDeclaration
Swift
static var environmentDirectives: [ChordPro.Directive] -
Array of
ChordPro/Directivethat can be edited by double click on itDeclaration
Swift
static var editableDirectives: [ChordPro.Directive]
View on GitHub