> This is relatively simple to implement. Create a XML file which defines
> the
> chords (like a major chord consists of a root, major 3rd and a 5th) so
> they
> are no longer hard coded).
> Then the file defines several notation sections which define the names for
> every
> note ("Standard" defines a C, C#, Db, ..., "German" defines the notes as
> C, Cis,
> Des and "French" uses Do, Do# or whatever they use :-)).
> Besides the note names the notation section also define how chords are
> written
> using a template. The template of a standard dominant chord could be {0}7.
> The
> string {x} will be replaced by the x-th note of the chord (starting at
> zero).
> So C-E-G-Bb will results C7.

You'd be doing it the hard way, re-inventing all that and debugging it.

QString already provides some template functionality, and that already
supporting translation.  You can pass a QString an arg which is then
incorporated into the string.  Your example would be something like:

  QString("%017").arg(QObject::tr(getNoteName(note[3])));

This example comes out a bit strange, because "017" is partly an arg
number (01) and partly text ("7").  In almost all cases you can just use
one digit after the percent sign.
http://stackoverflow.com/questions/16737161/solving-qts-qstring-arg-ambiguity
clears this up.

Some other examples of use: MidiDevice::renameInstruments(),
AudioDevice::renameInstruments, Instrument::getLocalizedPresentationName.

        Tom Breton (Tehom)



------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. Consolidate legacy IT systems to a single system of record for IT
2. Standardize and globalize service processes across IT
3. Implement zero-touch automation to replace manual, redundant tasks
http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
_______________________________________________
Rosegarden-devel mailing list
[email protected] - use the link below to unsubscribe
https://lists.sourceforge.net/lists/listinfo/rosegarden-devel

Reply via email to