Struct gabc_parser::GabcFile[][src]

pub struct GabcFile<'a> {
    pub attributes: Vec<(&'a str, &'a str)>,
    pub syllables: Vec<Syllable<'a>>,
}

Struct representing an entire gabc file.

Fields

This file's attributes, e.g. "name: Populus Sion", as key/value tuples

This file's Syllables

Methods

impl<'a> GabcFile<'a>
[src]

Create a new GabcFile from well-formed gabc input.

Examples

let s = "name:Test;
%%
(c1) Hel(e.)lo(hi~) (::)";
let f = GabcFile::new(s);
assert_eq!(f.attributes[0], ("name", "Test"));
assert_eq!(f.syllables.len(), 4); //clefs currently produce an empty syllable

Translate this GabcFile into JSON.

Translate this GabcFile into a well-formed Lilypond file, by translating its text and music and inserting them into a template derived from http://lilypond.org/doc/v2.18/Documentation/snippets/templates#templates-ancient-notation-template-_002d-modern-transcription-of-gregorian-music

Extract the notes of this file into well-formed Lilypond music, with a newline between each syllable

Examples

let s = "name:Test;
%%
(c1) Hel(e.)lo(hi~) (::)";
let f = GabcFile::new(s);
assert_eq!(f.ly_notes(), r#"
d'
g'(a')
\finalis
"#);

Extract the text of this file into well-formed Lilypond lyrics, inserting " -- " to join syllables where appropriate.

Examples

let s = "name:Test;
%%
(c1) Hel(e.)lo(hi~) (::)";
let f = GabcFile::new(s);
assert_eq!(f.ly_lyrics(), " Hel -- lo  ");

Trait Implementations

impl<'a> Debug for GabcFile<'a>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a> Send for GabcFile<'a>

impl<'a> Sync for GabcFile<'a>