summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-06-06 12:45:57 +0000
committerFlorian Jung <flo@windfisch.org>2011-06-06 12:45:57 +0000
commitd9380293e430d47e03ef94a9914e200c297bc376 (patch)
treeb603a9b028cb1419d634c75b8fce09583b58fa58
parent5e9533d5620f312b3727122c1680d97cf6ca2ff1 (diff)
parente33204ce476daafda6dbfda8c9db2d8dce898ef3 (diff)
merged with current trunk and removed (unused) support for disabling the keymap
-rw-r--r--muse2/ChangeLog4
-rw-r--r--muse2/muse/app.cpp2
-rw-r--r--muse2/muse/keyevent.cpp54
-rw-r--r--muse2/muse/keyevent.h5
-rw-r--r--muse2/muse/midiedit/scoreedit.cpp1
-rw-r--r--muse2/muse/widgets/canvas.cpp31
6 files changed, 25 insertions, 72 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index 3092040e..79452eb9 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,4 +1,8 @@
+06.06.2011:
+ - removed (unused) support for disabling the keymap (flo93)
04.06.2011:
+ - fixed regression with switching ctrl/shift when manipulating
+ items in canvas. drag+shift limits movement, drag+ctrl copies (rj)
- changed behaviour of middle click in all canvases to "delete" (flo93)
02.06.2011:
- the score editor now allows batch-movements, that is,
diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp
index 04c55b01..9e2f6c9a 100644
--- a/muse2/muse/app.cpp
+++ b/muse2/muse/app.cpp
@@ -3742,7 +3742,7 @@ void MusE::updateConfiguration()
trackAInputAction->setShortcut(shortcuts[SHRT_ADD_AUDIO_INPUT].key);
trackAAuxAction->setShortcut(shortcuts[SHRT_ADD_AUDIO_AUX].key);
- editSelectAllAction->setShortcut(shortcuts[SHRT_SELECT_NONE].key);
+ editSelectAllAction->setShortcut(shortcuts[SHRT_SELECT_ALL].key);
editDeselectAllAction->setShortcut(shortcuts[SHRT_SELECT_NONE].key);
editInvertSelectionAction->setShortcut(shortcuts[SHRT_SELECT_INVERT].key);
editInsideLoopAction->setShortcut(shortcuts[SHRT_SELECT_OLOOP].key);
diff --git a/muse2/muse/keyevent.cpp b/muse2/muse/keyevent.cpp
index 865aef01..5d55fef6 100644
--- a/muse2/muse/keyevent.cpp
+++ b/muse2/muse/keyevent.cpp
@@ -18,15 +18,15 @@
KeyList keymap;
+#define DEFAULT_KEY KEY_C
+
//---------------------------------------------------------
// KeyList
//---------------------------------------------------------
KeyList::KeyList()
{
- _key = KEY_C;
- insert(std::pair<const unsigned, KeyEvent> (MAX_TICK+1, KeyEvent(_key, 0)));
- useList = true;
+ insert(std::pair<const unsigned, KeyEvent> (MAX_TICK+1, KeyEvent(DEFAULT_KEY, 0)));
}
//---------------------------------------------------------
@@ -71,7 +71,7 @@ void KeyList::dump() const
void KeyList::clear()
{
KEYLIST::clear();
- insert(std::pair<const unsigned, KeyEvent> (MAX_TICK+1, KeyEvent(_key, 0)));
+ insert(std::pair<const unsigned, KeyEvent> (MAX_TICK+1, KeyEvent(DEFAULT_KEY, 0)));
}
//---------------------------------------------------------
@@ -80,16 +80,12 @@ void KeyList::clear()
key_enum KeyList::keyAtTick(unsigned tick) const
{
- if (useList) {
ciKeyEvent i = upper_bound(tick);
if (i == end()) {
printf("no key at tick %d,0x%x\n", tick, tick);
- return _key;
+ return DEFAULT_KEY;
}
return i->second.key;
- }
- else
- return _key;
}
//---------------------------------------------------------
@@ -129,20 +125,6 @@ void KeyList::change(unsigned tick, key_enum newkey)
e->second.key = newkey;
}
-//---------------------------------------------------------
-// setKey
-// called from transport window
-// & slave mode key changes
-//---------------------------------------------------------
-
-//void KeyList::setKey(unsigned tick, int newkey)
-// {
-// if (useList)
-// add(tick, newkey);
-// else
-// _key = newkey;
-// ++_keySN;
-// }
//---------------------------------------------------------
// addKey
@@ -162,29 +144,6 @@ void KeyList::delKey(unsigned tick)
del(tick);
}
-//---------------------------------------------------------
-// changeKey
-//---------------------------------------------------------
-
-//void KeyList::changeKey(unsigned tick, int newkey)
-// {
-// change(tick, newkey);
-// ++_keySN;
-// }
-
-//---------------------------------------------------------
-// setMasterFlag
-//---------------------------------------------------------
-
-bool KeyList::setMasterFlag(unsigned /*tick*/, bool val)
- {
- if (useList != val) {
- useList = val;
- return true;
- }
- return false;
- }
-
//---------------------------------------------------------
@@ -193,7 +152,6 @@ bool KeyList::setMasterFlag(unsigned /*tick*/, bool val)
void KeyList::write(int level, Xml& xml) const
{
- xml.put(level++, "<keylist fix=\"%d\">", _key);
for (ciKeyEvent i = begin(); i != end(); ++i)
i->second.write(level, xml, i->first);
xml.tag(level, "/keylist");
@@ -225,8 +183,6 @@ void KeyList::read(Xml& xml)
xml.unknown("keyList");
break;
case Xml::Attribut:
- if (tag == "fix")
- _key = key_enum(xml.s2().toInt());
break;
case Xml::TagEnd:
if (tag == "keylist") {
diff --git a/muse2/muse/keyevent.h b/muse2/muse/keyevent.h
index 4a7fc8f9..2d127a67 100644
--- a/muse2/muse/keyevent.h
+++ b/muse2/muse/keyevent.h
@@ -78,9 +78,6 @@ typedef KEYLIST::const_reverse_iterator criKeyEvent;
class KeyList : public KEYLIST {
- bool useList;
- key_enum _key; // key if not using key list
-
void add(unsigned tick, key_enum tempo);
void change(unsigned tick, key_enum newKey);
void del(iKeyEvent);
@@ -99,8 +96,6 @@ class KeyList : public KEYLIST {
void addKey(unsigned t, key_enum newKey);
void delKey(unsigned tick);
-// void changeKey(unsigned tick, key_enum newKey);
- bool setMasterFlag(unsigned tick, bool val);
};
extern KeyList keymap;
diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp
index 309342ae..9bfbaa45 100644
--- a/muse2/muse/midiedit/scoreedit.cpp
+++ b/muse2/muse/midiedit/scoreedit.cpp
@@ -4456,7 +4456,6 @@ void staff_t::update_part_indices()
* between, for example, when a cis is tied to a des
*
* CURRENT TODO
- * o remove functions for disabling key/sigmap
* o either remove these "hidden notes", or deal with them in the score editor
* o insert empty measure should also work inside parts, that is,
* move notes _within_ parts
diff --git a/muse2/muse/widgets/canvas.cpp b/muse2/muse/widgets/canvas.cpp
index 3e9cb46e..650b10b7 100644
--- a/muse2/muse/widgets/canvas.cpp
+++ b/muse2/muse/widgets/canvas.cpp
@@ -504,19 +504,19 @@ void Canvas::viewMousePressEvent(QMouseEvent* event)
// like moving or drawing lasso is performed.
///if (event->stateAfter() & Qt::RightButton) {
if (event->buttons() & Qt::RightButton & ~(event->button())) {
- //printf("viewMousePressEvent special buttons:%x mods:%x button:%x\n", (int)event->buttons(), (int)keyState, event->button());
- switch (drag) {
- case DRAG_LASSO:
- drag = DRAG_OFF;
- redraw();
- return;
- case DRAG_MOVE:
- drag = DRAG_OFF;
- endMoveItems (start, MOVE_MOVE, 0);
- return;
- default:
- break;
- }
+ //printf("viewMousePressEvent special buttons:%x mods:%x button:%x\n", (int)event->buttons(), (int)keyState, event->button());
+ switch (drag) {
+ case DRAG_LASSO:
+ drag = DRAG_OFF;
+ redraw();
+ return;
+ case DRAG_MOVE:
+ drag = DRAG_OFF;
+ endMoveItems (start, MOVE_MOVE, 0);
+ return;
+ default:
+ break;
+ }
}
// ignore event if (another) button is already active:
@@ -619,13 +619,12 @@ void Canvas::viewMousePressEvent(QMouseEvent* event)
// Changed by T356. Alt is default reserved for moving the whole window in KDE. Changed to Shift-Alt.
// Hmm, nope, shift-alt is also reserved sometimes. Must find a way to bypass,
// why make user turn off setting? Left alone for now...
- if (ctrl && !shift)
+ if (ctrl)
drag = DRAG_COPY_START;
else if (alt) {
drag = DRAG_CLONE_START;
}
else if (shift) { //Select all on the same pitch (e.g. same y-value)
- if (!ctrl)
deselectAll();
for (iCItem i = items.begin(); i != items.end(); ++i) {
if (i->second->y() == curItem->y() )
@@ -984,7 +983,7 @@ void Canvas::viewMouseMoveEvent(QMouseEvent* event)
case DRAG_CLONE_START:
if (!moving)
break;
- if (keyState & Qt::ControlModifier) {
+ if (keyState & Qt::ShiftModifier) {
if (ax > ay) {
if (drag == DRAG_MOVE_START)
drag = DRAGX_MOVE;