In article <[email protected]>,
Marc Sabatella <[email protected]> wrote:
> On the philosophy that is better to ask forgiveness than permission, I 
> have tentatively gone ahead and done things as I thought best:
> 
> - new class ParsedChord defined in chordlist.h/chordlist.cpp to hold the 
> parsed form of the chord
> - the actual parsing function is a constructor for this class
> - ChordDescription now contains a list of ParsedChord's
> - the ParsedChord list for a ChordList (list of predefined chord id's) 
> is populated when the chord description XML file is read
> - if there are multiple names for a given chord id, there will be 
> multiple ParsedChord's as well, *if* the names actually parse differently
> - Harmony::parseHarmony in harmony.cpp creates a ParsedChord object for 
> the user-input chord, and if the search for a literal match against the 
> names in the ChordList fails, it looks for a match against the 
> ParsedChord's in the ChordList
> 
> In the process, I also removed the toLower() performed before the 
> literal comparison, as that was broken (it made "m" match "M", and thus 
> potentially turned minor chords into major or vice versa) and is 
> rendered unnecessary by the parser.
> 
> All seems stable, and I'm quite happy with how it works.

OK, I've had a proper look through it now, and I think I can see how it's
working. So you are not doing anything with the TPCs, but just with the
chord flavour, which is fine.

And while reading the xml chord file(s), you're storing both the original
name in the names list and a parsed version in the parsedChords list. The
parsed version can be used to match against alternative user inputs that
parse to the same result. Nice!

I have a couple of queries on the code itself, but I'll put them on github
against the appropriate lines.

Cheers
Tony
-- 
Tony Mountifield
Work: [email protected] - http://www.softins.co.uk
Play: [email protected] - http://tony.mountifield.org

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
_______________________________________________
Mscore-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mscore-developer

Reply via email to