Chords
enum Chords
Utilities to get ChordDefinition
arrays
-
Get all the guitar chords in a
ChordDefinition
arrayDeclaration
Swift
static let guitar = Chords.importInstrument(.guitar)
-
Get all the guitalele chords in a
ChordDefinition
arrayDeclaration
Swift
static let guitalele = Chords.importInstrument(.guitalele)
-
Get all the ukulele chords in a
ChordDefinition
arrayDeclaration
Swift
static let ukulele = Chords.importInstrument(.ukulele)
-
Get all chord definitions for an instrument
Declaration
Swift
static func getAllChordsForInstrument(instrument: Instrument) -> [ChordDefinition]
Parameters
instrument
The
Instrument
Return Value
An
ChordDefinition
array -
Import a definition database from a JSON database file
Declaration
Swift
private static func importInstrument( _ instrument: Instrument) -> [ChordDefinition]
-
Import a database with chord definitions
Declaration
Swift
static func importDatabase(database: ChordPro.Instrument, instrument: Instrument) -> [ChordDefinition]
Parameters
database
The
Instrument
to importinstrument
The
Instrument
to useReturn Value
An array of
ChordDefinition
-
Export the definitions to a JSON string
Declaration
Swift
static func exportToJSON(definitions: [ChordDefinition], uniqueNames: Bool) throws -> String
Parameters
definitions
The chord definitions
uniqueNames
Bool if the chord name should be unique, so one chord for each name
Return Value
A JSON string with chord definitions in ChordPro format