abc2svg
Update of "interface-1"
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 809147ff7b9617640180512587902608dddbb921
Page Name:interface-1
Date: 2018-08-08 09:11:49
Original User: moinejf
Mimetype:text/x-markdown
Parent: dbc64cea3cc6379a807adc0c6e9c976dc7b77554 (diff)
Content

abc2svg interface 1

This document describes the interface of the abc2svg core version 1 (abc2svg-1.js).

Changes in the version 1.17.0

Initialization

The abc2svg core may be included in html/xhtml documents by:

<script src="http://moinejf.free.fr/js/abc2svg-1.js" type="text/javascript"></script>

This script defines a global variable, abc2svg, which contains the global variables and functions of the core.

Before any first or new ABC to SVG translation, an instance of the class Abc must be created:

var abc = new abc2svg.Abc(user)

The user argument of this function is a javascript Object which must or may contain:

ABC to SVG translation

ABC to SVG translation is done calling the Abc method tosvg:

        abc.tosvg(file_name, ABC_source, start_offset, end_offset)

abc.tosvg may be called many times in which case the values set by previous calls are kept.

The ABC source must contain full tunes, i.e. a same tune cannot be continued by a second call to tosvg.

Exported attributes and methods of the Abc class

Global variable

The global variable abc2svg contains the global variables and functions of the abc2svg core.

Modules

Some abc2svg specific features are not directly included in the core. They are handled in separate modules.

These modules may be concatenated with the core or may stay on the Web server.

When the modules stay on the server, each ABC source must be scanned to find if it uses some specific features.
This is done calling the function abc2svg.modules.load(). This function expects one or two arguments:

It returns true when all the needed modules are loaded (no new feature). In this case, the function ondone() is not called.
When false is returned, the caller is alerted via the callback function ondone().