summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse2/ChangeLog1
-rw-r--r--muse2/muse/master/lmaster.cpp57
-rw-r--r--muse2/muse/master/lmaster.h2
-rw-r--r--muse2/muse/widgets/gensetbase.ui10
4 files changed, 31 insertions, 39 deletions
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index 026e8060..a2248523 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -7,6 +7,7 @@
- Small fix to scoredit in color_image(). Use bytesPerLine() * height() for older Qt. Test OK. (Tim)
- Fix to Robert's DssiSynthIF::paramOut(). Call getParameterOut(). (Tim)
- Changed all plugin and dssi module's 'unsigned' usage to 'unsigned long' for more consistency. (Tim)
+ - fixed multiple connects in master list editor and some cleanups suggested by WillyFooBar (rj)
27.04.2011:
- added first version feedback parameters for plugins (rj)
- merged score edit branch into trunk (flo)
diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp
index 5c767060..21cadfdd 100644
--- a/muse2/muse/master/lmaster.cpp
+++ b/muse2/muse/master/lmaster.cpp
@@ -117,7 +117,7 @@ LMaster::LMaster()
: MidiEditor(0, 0, 0)
{
pos_editor = 0;
- editor = 0;
+ tempo_editor = 0;
sig_editor = 0;
key_editor = 0;
editedItem = 0;
@@ -206,6 +206,16 @@ LMaster::LMaster()
// mainGrid->addWidget(corner, 1, 1, AlignBottom | AlignRight);
updateList();
+ tempo_editor = new QLineEdit(view->viewport());
+ connect(tempo_editor, SIGNAL(returnPressed()), SLOT(returnPressed()));
+ sig_editor = new SigEdit(view->viewport());
+ connect(sig_editor, SIGNAL(returnPressed()), SLOT(returnPressed()));
+ pos_editor = new Awl::PosEdit(view->viewport());
+ connect(pos_editor, SIGNAL(returnPressed()), SLOT(returnPressed()));
+ key_editor = new QComboBox(view->viewport());
+ key_editor->addItems(keyStrs);
+ connect(key_editor, SIGNAL(currentIndexChanged(int)), SLOT(returnPressed()));
+
connect(view, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), SLOT(select(QTreeWidgetItem*, QTreeWidgetItem*)));
connect(view, SIGNAL(itemPressed(QTreeWidgetItem*, int)), SLOT(itemPressed(QTreeWidgetItem*, int)));
connect(view, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)), SLOT(itemDoubleClicked(QTreeWidgetItem*)));
@@ -294,19 +304,19 @@ void LMaster::updateList()
++it;
}
- else if ((ik != k->rend()) && (is == s->rend()) && (ik->second.tick >= it->second->tick)
- || (it == t->rend()) && (ik->second.tick >= is->second->tick )) {// ik biggest
+ else if ( ((ik != k->rend()) && (is == s->rend()) && (ik->second.tick >= it->second->tick))
+ || ((it == t->rend()) && (ik->second.tick >= is->second->tick ) )) {// ik biggest
insertKey(ik->second);
++ik;
}
- else if ((is != s->rend()) && (ik == k->rend()) && (is->second->tick >= it->second->tick)
- || (it == t->rend()) && (is->second->tick >= ik->second.tick )) {// is biggest
+ else if ( ((is != s->rend()) && (ik == k->rend()) && (is->second->tick >= it->second->tick))
+ || ((it == t->rend()) && (is->second->tick >= ik->second.tick ))) {// is biggest
insertSig(is->second);
++is;
}
- else if ((it != t->rend()) && (ik == k->rend()) && (it->second->tick >= is->second->tick)
- || (is == s->rend()) && (it->second->tick >= ik->second.tick )) {// it biggest
+ else if (((it != t->rend()) && (ik == k->rend()) && (it->second->tick >= is->second->tick))
+ || ((is == s->rend()) && (it->second->tick >= ik->second.tick ))) {// it biggest
insertTempo(it->second);
++it;
}
@@ -495,39 +505,24 @@ void LMaster::itemDoubleClicked(QTreeWidgetItem* i)
// Edit tempo value:
if (editedItem->getType() == LMASTER_TEMPO) {
- if (!editor)
- editor = new QLineEdit(view->viewport());
- editor->setText(editedItem->text(LMASTER_VAL_COL));
- editor->setGeometry(itemRect);
- editor->show();
- editor->setFocus();
- editor->selectAll();
- connect(editor, SIGNAL(returnPressed()), SLOT(returnPressed()));
+ tempo_editor->setText(editedItem->text(LMASTER_VAL_COL));
+ tempo_editor->setGeometry(itemRect);
+ tempo_editor->show();
+ tempo_editor->setFocus();
+ tempo_editor->selectAll();
}
else if (editedItem->getType() == LMASTER_SIGEVENT) { // Edit signatur value:
- if (!sig_editor)
- sig_editor = new SigEdit(view->viewport());
sig_editor->setValue(editedItem->text(LMASTER_VAL_COL));
sig_editor->setGeometry(itemRect);
sig_editor->show();
sig_editor->setFocus();
- connect(sig_editor, SIGNAL(returnPressed()), SLOT(returnPressed()));
}
else if (editedItem->getType() == LMASTER_KEYEVENT) {
- if (!key_editor)
- {
- key_editor = new QComboBox(view->viewport());
- key_editor->addItems(keyStrs);
- }
- //key_editor->setText(editedItem->text(LMASTER_VAL_COL));
- //key_editor->setCurrentIndex(keyStrs.indexOf(editedItem->text(LMASTER_VAL_COL)));
//key_editor->setCurrentIndex(-1);
key_editor->setGeometry(itemRect);
key_editor->show();
key_editor->showPopup();
key_editor->setFocus();
- //key_editor->selectAll();
- connect(key_editor, SIGNAL(currentIndexChanged(int)), SLOT(returnPressed()));
}
else {
printf("illegal Master list type\n");
@@ -544,9 +539,6 @@ void LMaster::itemDoubleClicked(QTreeWidgetItem* i)
}
// Everything OK
else {
- if (!pos_editor)
- ///pos_editor = new PosEdit(view->viewport());
- pos_editor = new Awl::PosEdit(view->viewport());
pos_editor->setValue(editedItem->tick());
QRect itemRect = view->visualItemRect(editedItem);
itemRect.setX(0);
@@ -554,7 +546,6 @@ void LMaster::itemDoubleClicked(QTreeWidgetItem* i)
pos_editor->setGeometry(itemRect);
pos_editor->show();
pos_editor->setFocus();
- connect(pos_editor, SIGNAL(returnPressed()), SLOT(returnPressed()));
}
}
}
@@ -572,8 +563,8 @@ void LMaster::returnPressed()
setFocus();
// Tempo event:
if (editedItem->getType() == LMASTER_TEMPO && editorColumn == LMASTER_VAL_COL) {
- QString input = editor->text();
- editor->hide();
+ QString input = tempo_editor->text();
+ tempo_editor->hide();
repaint();
LMasterTempoItem* e = (LMasterTempoItem*) editedItem;
const TEvent* t = e->getEvent();
diff --git a/muse2/muse/master/lmaster.h b/muse2/muse/master/lmaster.h
index 23c86c82..150e8236 100644
--- a/muse2/muse/master/lmaster.h
+++ b/muse2/muse/master/lmaster.h
@@ -128,7 +128,7 @@ class LMaster : public MidiEditor {
void insertKey(const KeyEvent&);
LMasterLViewItem* getItemAtPos(unsigned tick, LMASTER_LVTYPE t);
void initShortcuts();
- QLineEdit* editor;
+ QLineEdit* tempo_editor;
PosEdit* pos_editor;
QComboBox* key_editor;
// State-like members:
diff --git a/muse2/muse/widgets/gensetbase.ui b/muse2/muse/widgets/gensetbase.ui
index e452de8b..a48dd3f0 100644
--- a/muse2/muse/widgets/gensetbase.ui
+++ b/muse2/muse/widgets/gensetbase.ui
@@ -812,9 +812,9 @@
</item>
<item row="1" column="1">
<widget class="QComboBox" name="dummyAudioSize">
- <property name="toolTip">
- <string>Shorter periods give better midi playback resolution.</string>
- </property>
+ <property name="toolTip">
+ <string>Shorter periods give better midi playback resolution.</string>
+ </property>
<item>
<property name="text">
<string>16</string>
@@ -878,7 +878,7 @@
<property name="title">
<string>Ticks</string>
</property>
- <layout class="QGridLayout" name="gridLayout_2">
+ <layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="TextLabel3">
<property name="text">
@@ -1108,7 +1108,7 @@
<property name="title">
<string>Behavior</string>
</property>
- <layout class="QGridLayout" name="gridLayout">
+ <layout class="QGridLayout">
<item row="0" column="0">
<widget class="QLabel" name="TextLabel1">
<property name="text">