summaryrefslogtreecommitdiff
path: root/muse2/awl
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-04-17 15:46:34 +0000
committerFlorian Jung <flo@windfisch.org>2011-04-17 15:46:34 +0000
commita166bf3113c24a02c154bcd94f5f4291d6e675fe (patch)
tree4d8f5a2d6a6b675e976c764b91aa8b62cbb19f2b /muse2/awl
parent47a10173ea203de2036dd00791fe5c24fb673135 (diff)
parentaab05a914e357938f0ccb3d592186320e0646366 (diff)
a mastertrack keymap editor has been inserted and used
merged with current trunk, removed attic/
Diffstat (limited to 'muse2/awl')
-rw-r--r--muse2/awl/sigedit.cpp13
-rw-r--r--muse2/awl/sigedit.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/muse2/awl/sigedit.cpp b/muse2/awl/sigedit.cpp
index 826182ca..460aafe4 100644
--- a/muse2/awl/sigedit.cpp
+++ b/muse2/awl/sigedit.cpp
@@ -58,6 +58,16 @@ bool SigEdit::event(QEvent* event)
if (event->type() == QEvent::KeyPress) {
QKeyEvent* ke = static_cast<QKeyEvent*>(event);
int segment = curSegment();
+ if (ke->key() == Qt::Key_Return)
+ {
+ int z, n;
+ sscanf(lineEdit()->text().toLatin1().data(), "%d/%d", &z, &n);
+ AL::TimeSignature sig(z, n);
+ _sig = sig;
+
+ emit returnPressed();
+ return true;
+ }
if (ke->key() == Qt::Key_Backtab) {
if (segment == 2) {
lineEdit()->setSelection(5, 2);
@@ -117,6 +127,7 @@ void SigEdit::setValue(const QString& s)
void SigEdit::updateValue()
{
+ //printf("updateValue\n");
char buffer[64];
sprintf(buffer, "%d/%d", _sig.z, _sig.n);
lineEdit()->setText(buffer);
@@ -160,7 +171,7 @@ void SigEdit::fixup(QString& input) const
QValidator::State SigEdit::validate(QString&,int&) const
{
// TODO
- // printf("validate\n");
+ //printf("validate\n");
return QValidator::Acceptable;
}
diff --git a/muse2/awl/sigedit.h b/muse2/awl/sigedit.h
index dd059ea2..d2494798 100644
--- a/muse2/awl/sigedit.h
+++ b/muse2/awl/sigedit.h
@@ -54,6 +54,7 @@ class SigEdit : public QAbstractSpinBox
signals:
void valueChanged(const AL::TimeSignature&);
+ void returnPressed();
public slots:
void setValue(const AL::TimeSignature&);