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
attributes: Vec<(&'a str, &'a str)>
This file's attributes, e.g. "name: Populus Sion", as key/value tuples
syllables: Vec<Syllable<'a>>
This file's Syllables
Methods
impl<'a> GabcFile<'a>
[src]
impl<'a> GabcFile<'a>
pub fn new(gabc_input: &str) -> GabcFile
[src]
pub fn new(gabc_input: &str) -> GabcFile
Create a new GabcFile from well-formed gabc input.
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
pub fn as_json(&self) -> String
[src]
pub fn as_json(&self) -> String
Translate this GabcFile into JSON.
pub fn as_lilypond(&self) -> String
[src]
pub fn as_lilypond(&self) -> String
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
pub fn ly_lyrics(&self) -> String
[src]
pub fn ly_lyrics(&self) -> String
Extract the text of this file into well-formed Lilypond lyrics, inserting " -- " to join syllables where appropriate.