summaryrefslogtreecommitdiff
path: root/muse2/muse/master
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-11-07 21:43:20 +0000
committerFlorian Jung <flo@windfisch.org>2011-11-07 21:43:20 +0000
commit720a43f55f893c1472be0f859d224401f1ec73be (patch)
treed1876120c5e8892e0c8b2b8d023169f1013d2b11 /muse2/muse/master
parentbce73374a78f5fdcc7cc776395157564b5ef9be5 (diff)
housekeeping: pulled fixes from release into trunk
Diffstat (limited to 'muse2/muse/master')
-rw-r--r--muse2/muse/master/master.cpp20
-rw-r--r--muse2/muse/master/masteredit.cpp2
2 files changed, 16 insertions, 6 deletions
diff --git a/muse2/muse/master/master.cpp b/muse2/muse/master/master.cpp
index 50c3f518..02bef8a1 100644
--- a/muse2/muse/master/master.cpp
+++ b/muse2/muse/master/master.cpp
@@ -27,6 +27,8 @@
#include <QEvent>
#include <QMouseEvent>
#include <QPainter>
+#include <QList>
+#include <QPair>
#include "globals.h"
#include "master.h"
@@ -52,6 +54,8 @@ Master::Master(MidiEditor* e, QWidget* parent, int xmag, int ymag)
pos[0] = 0;
pos[1] = 0;
pos[2] = 0;
+ drag = DRAG_OFF;
+ tool = MusEGui::PointerTool; // should be overridden soon anyway, but to be sure...
setFocusPolicy(Qt::StrongFocus); // Tim.
setMouseTracking(true);
connect(MusEGlobal::song, SIGNAL(posChanged(int, unsigned, bool)), this, SLOT(setPos(int, unsigned, bool)));
@@ -288,8 +292,8 @@ void Master::viewMouseReleaseEvent(QMouseEvent*)
bool Master::deleteVal1(unsigned int x1, unsigned int x2)
{
- bool songChanged = false;
-
+ QList< QPair<int,int> > stuff_to_do;
+
MusECore::TempoList* tl = &MusEGlobal::tempomap;
for (MusECore::iTEvent i = tl->begin(); i != tl->end(); ++i) {
if (i->first < x1)
@@ -300,11 +304,17 @@ bool Master::deleteVal1(unsigned int x1, unsigned int x2)
++ii;
if (ii != tl->end()) {
int tempo = ii->second->tempo;
- MusEGlobal::audio->msgDeleteTempo(i->first, tempo, false);
- songChanged = true;
+ // changed by flo: postpone the actual delete operation
+ // to avoid race conditions and invalidating the iterator
+ //MusEGlobal::audio->msgDeleteTempo(i->first, tempo, false);
+ stuff_to_do.append(QPair<int,int>(i->first, tempo));
}
}
- return songChanged;
+
+ for (QList< QPair<int,int> >::iterator it=stuff_to_do.begin(); it!=stuff_to_do.end(); it++)
+ MusEGlobal::audio->msgDeleteTempo(it->first, it->second, false);
+
+ return !stuff_to_do.empty();
}
void Master::deleteVal(int x1, int x2)
diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp
index c3c66008..191f82ab 100644
--- a/muse2/muse/master/masteredit.cpp
+++ b/muse2/muse/master/masteredit.cpp
@@ -159,7 +159,7 @@ MasterEdit::MasterEdit()
info->addWidget(tempo);
const char* rastval[] = {
- QT_TRANSLATE_NOOP("@default", "Off"), "Bar", "1/2", "1/4", "1/8", "1/16"
+ QT_TRANSLATE_NOOP("MusEGui::MasterEdit", "Off"), QT_TRANSLATE_NOOP("MusEGui::MasterEdit", "Bar"), "1/2", "1/4", "1/8", "1/16"
};
rasterLabel = new MusEGui::LabelCombo(tr("Snap"), 0);
rasterLabel->setFocusPolicy(Qt::NoFocus);