Class: IntermediateSong

@bldr/songbook-intermediate-files~IntermediateSong

Extended version of the Song class to build intermediate files.

new IntermediateSong (songPath, projectorPath, pianoPath, fileMonitor)

Name Type Description
songPath string

The path of the directory containing the song files or a path of a file inside the song folder (not nested in subfolders)

projectorPath string

Directory to store intermediate files for the projector app (*.svg, *.json).

pianoPath string

Directory to store intermediate files for the piano score (*.eps).

fileMonitor module:@bldr/songbook-intermediate-files~FileMonitor

A instance of the FileMonitor() class.

Members

A instance of the FileMonitor class.

Methods

cleanIntermediateFiles ()

Delete all generated files of a song folder.

formatPianoTex ()string

Generate TeX markup for one song.

Returns:
Type Description
string TeX markup for a single song.
\tmpmetadata
{title} % title
{subtitle} % subtitle
{composer} % composer
{lyricist} % lyricist
\tmpimage{s/Swing-low/piano/piano_1.eps}
\tmpimage{s/Swing-low/piano/piano_2.eps}
\tmpimage{s/Swing-low/piano/piano_3.eps}

formatPianoTeXEpsFile_ (index)string private

Format one image file of a piano score in the TeX format.

Name Type Description
index number

The index number of the array position

Returns:
Type Description
string TeX markup for one EPS image file of a piano score.

generateIntermediateFiles (mode, force)

Wrapper method for all process methods of one song folder.

Name Type Default Description
mode string all

Generate all intermediate media files or only slide and piano files. Possible values: “all”, “slides” or “piano”

force boolean false

Force the regeneration of intermediate files.

generatePDF_ (source, destination) private

Generate form a given *.mscx file a PDF file.

Name Type Description
source string

Name of the *.mscx file without the extension.

destination string

Name of the PDF without the extension.

generatePiano_ ()array private

Generate from the MuseScore file “piano/piano.mscx” EPS files.

Returns:
Type Description
array An array of EPS piano score filenames.

generateSlides_ (folder) private

Generate svg files in a 'slides' subfolder.

Name Type Description
folder string

A song folder.