Index: resources/keymap.xml =================================================================== RCS file: /sources/traverso/traverso/resources/keymap.xml,v retrieving revision 1.52 diff -u -r1.52 keymap.xml --- resources/keymap.xml 11 Apr 2007 23:07:32 -0000 1.52 +++ resources/keymap.xml 12 Apr 2007 05:27:49 -0000 @@ -345,7 +345,7 @@ - + Index: src/commands/Gain.cpp =================================================================== RCS file: /sources/traverso/traverso/src/commands/Gain.cpp,v retrieving revision 1.12 diff -u -r1.12 Gain.cpp --- src/commands/Gain.cpp 11 Apr 2007 21:19:17 -0000 1.12 +++ src/commands/Gain.cpp 12 Apr 2007 05:27:49 -0000 @@ -37,16 +37,21 @@ : Command(context, "") { gainObject = context; - + horiz = false; + float gain = -1; QString des = ""; - if (args.size() > 0) { + if (args.size() > 0 && args[0].toString() != "horizontal") { gain = args.at(0).toDouble(); des = QString(context->metaObject()->className()) + ": Reset gain"; } else { des = QString(context->metaObject()->className()) + " Gain"; } + + if (args.size() > 0 && args[0].toString() == "horizontal") { + horiz = true; + } setText(des); @@ -80,7 +85,7 @@ return -1; } newGain = origGain; - origY = cpointer().y(); + origPos = cpointer().pos(); return 1; } @@ -119,7 +124,11 @@ Q_UNUSED(useY); mousePos = QCursor::pos(); - cpointer().get_viewport()->set_holdcursor(":/cursorGain"); + if (horiz) { + cpointer().get_viewport()->set_holdcursor(":/cursorHoldLr"); + } else { + cpointer().get_viewport()->set_holdcursor(":/cursorGain"); + } } @@ -159,18 +168,27 @@ int Gain::jog() { PENTER; - float ofy = 0; + float of = 0; float dbFactor = coefficient_to_dB(newGain); - if (dbFactor > -1) - ofy = (origY - cpointer().y()) * 0.05; + int diff; + + if (horiz) { + diff = cpointer().x() - origPos.x(); + } else { + diff = origPos.y() - cpointer().y(); + } + + if (dbFactor > -1) { + of = diff * 0.05; + } if (dbFactor <= -1) { - ofy = (origY - cpointer().y()) * ((1 - dB_to_scale_factor(dbFactor)) / 3); + of = diff * ((1 - dB_to_scale_factor(dbFactor)) / 3); } - - - newGain = dB_to_scale_factor( dbFactor + ofy ); + + + newGain = dB_to_scale_factor( dbFactor + of ); // Set the gain for gainObject QMetaObject::invokeMethod(gainObject, "set_gain", Q_ARG(float, newGain)); @@ -187,7 +205,7 @@ // This avoids highlighting of other objects !! // Note that due this, we don't have to set the origY variable in this funcion!! QCursor::setPos(mousePos); - + return result; } Index: src/commands/Gain.h =================================================================== RCS file: /sources/traverso/traverso/src/commands/Gain.h,v retrieving revision 1.10 diff -u -r1.10 Gain.h --- src/commands/Gain.h 16 Mar 2007 14:23:39 -0000 1.10 +++ src/commands/Gain.h 12 Apr 2007 05:27:49 -0000 @@ -54,8 +54,9 @@ ContextItem* gainObject; float origGain; float newGain; - int origY; + QPoint origPos; QPoint mousePos; + bool horiz; int get_gain_from_object(float& gain);