diff options
Diffstat (limited to 'attic/muse2-oom/muse2/muse/widgets/pitchedit.cpp')
-rw-r--r-- | attic/muse2-oom/muse2/muse/widgets/pitchedit.cpp | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/attic/muse2-oom/muse2/muse/widgets/pitchedit.cpp b/attic/muse2-oom/muse2/muse/widgets/pitchedit.cpp new file mode 100644 index 00000000..563cd6a8 --- /dev/null +++ b/attic/muse2-oom/muse2/muse/widgets/pitchedit.cpp @@ -0,0 +1,64 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: pitchedit.cpp,v 1.2 2004/01/09 17:12:54 wschweer Exp $ +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +//========================================================= + +#include <stdio.h> +#include "pitchedit.h" +#include "helper.h" + +//--------------------------------------------------------- +// PitchEdit +//--------------------------------------------------------- + +PitchEdit::PitchEdit(QWidget* parent) + : QSpinBox(parent) + { + setMinimum(0); + setMaximum(127); + setSingleStep(1); + deltaMode = false; + } + +//--------------------------------------------------------- +// mapValueToText +//--------------------------------------------------------- + +QString PitchEdit::mapValueToText(int v) + { + if (deltaMode) { + QString s; + s.setNum(v); + return s; + } + else + return pitch2string(v); + } + +//--------------------------------------------------------- +// mapTextToValue +//--------------------------------------------------------- + +int PitchEdit::mapTextToValue(bool* ok) + { + printf("PitchEdit: mapTextToValue: not impl.\n"); + if (ok) + *ok = false; + return 0; + } + +//--------------------------------------------------------- +// setDeltaMode +//--------------------------------------------------------- + +void PitchEdit::setDeltaMode(bool val) + { + deltaMode = val; + if (deltaMode) + setRange(-127, 127); + else + setRange(0, 127); + } + |