diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-01 18:37:05 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-03-01 18:37:05 +0000 |
commit | 145364a8af6a1fec06556221e66d4b724a62fc9a (patch) | |
tree | 53bd71a544008c518034f208d64c932dc2883f50 /src/gui/general/ClefIndex.cpp | |
download | rosegarden-145364a8af6a1fec06556221e66d4b724a62fc9a.tar.gz rosegarden-145364a8af6a1fec06556221e66d4b724a62fc9a.zip |
Added old abandoned KDE3 version of the RoseGarden MIDI tool
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1097595 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/general/ClefIndex.cpp')
-rw-r--r-- | src/gui/general/ClefIndex.cpp | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/src/gui/general/ClefIndex.cpp b/src/gui/general/ClefIndex.cpp new file mode 100644 index 0000000..68ad488 --- /dev/null +++ b/src/gui/general/ClefIndex.cpp @@ -0,0 +1,100 @@ +// -*- c-basic-offset: 4 -*- + +/* + Rosegarden + A sequencer and musical notation editor. + + This program is Copyright 2000-2008 + Guillaume Laurent <[email protected]>, + Chris Cannam <[email protected]>, + Richard Bown <[email protected]> + + The moral right of the authors to claim authorship of this work + has been asserted. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. See the file + COPYING included with this distribution for more information. +*/ + +#include "gui/general/ClefIndex.h" +#include "misc/Debug.h" + +namespace Rosegarden +{ + +const Rosegarden::Clef clefIndexToClef(int index) +{ + Rosegarden::Clef clef; + + // insert an initial clef from track parameters + switch (index) { + case TrebleClef: clef = Clef(Clef::Treble); break; + case BassClef: clef = Clef(Clef::Bass); break; + case CrotalesClef: clef = Clef(Clef::Treble, 2); break; + case XylophoneClef: clef = Clef(Clef::Treble, 1); break; + case GuitarClef: clef = Clef(Clef::Treble, -1); break; + case ContrabassClef: clef = Clef(Clef::Bass, -1); break; + case CelestaClef: clef = Clef(Clef::Bass, 2); break; + case OldCelestaClef: clef = Clef(Clef::Bass, 1); break; + case FrenchClef: clef = Clef(Clef::French); break; + case SopranoClef: clef = Clef(Clef::Soprano); break; + case MezzosopranoClef: clef = Clef(Clef::Mezzosoprano); break; + case AltoClef: clef = Clef(Clef::Alto); break; + case TenorClef: clef = Clef(Clef::Tenor); break; + case BaritoneClef: clef = Clef(Clef::Baritone); break; + case VarbaritoneClef: clef = Clef(Clef::Varbaritone); break; + case SubbassClef: clef = Clef(Clef::Subbass); break; + default: clef = Clef(Clef::Treble); break; + } + return clef; +} + +const int clefNameToClefIndex(QString s) +{ + int m_elClef = 0; + if (s) { + if (s == "treble") + m_elClef = TrebleClef; + else if (s == "bass") + m_elClef = BassClef; + else if (s == "crotales") + m_elClef = CrotalesClef; + else if (s == "xylophone") + m_elClef = XylophoneClef; + else if (s == "guitar") + m_elClef = GuitarClef; + else if (s == "contrabass") + m_elClef = ContrabassClef; + else if (s == "celesta") + m_elClef = CelestaClef; + else if (s == "oldCelesta") + m_elClef = OldCelestaClef; + else if (s == "french") + m_elClef = FrenchClef; + else if (s == "soprano") + m_elClef = SopranoClef; + else if (s == "mezzosoprano") + m_elClef = MezzosopranoClef; + else if (s == "alto") + m_elClef = AltoClef; + else if (s == "tenor") + m_elClef = TenorClef; + else if (s == "baritone") + m_elClef = BaritoneClef; + else if (s == "varbaritone") + m_elClef = VarbaritoneClef; + else if (s == "subbass") + m_elClef = SubbassClef; + else if (s == "two-bar") + m_elClef = TwoBarClef; + else { + RG_DEBUG << "startElement: processed unrecognized clef type: " << s << endl; + } + } + return m_elClef; +} + +}
\ No newline at end of file |