summaryrefslogtreecommitdiff
path: root/muse2/muse/liste
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2012-03-15 18:21:23 +0000
committerFlorian Jung <flo@windfisch.org>2012-03-15 18:21:23 +0000
commit27b7bf6815cda7abb67026c37b3e44daee1803cb (patch)
tree0b9d1c0bc84ac7ff8032e707f2b5fb4e0aaabb5c /muse2/muse/liste
parent2d6f113a10eb485694e20a78500f650776d701e3 (diff)
merged with trunk
Diffstat (limited to 'muse2/muse/liste')
-rw-r--r--muse2/muse/liste/editevent.cpp31
-rw-r--r--muse2/muse/liste/editevent.h5
-rw-r--r--muse2/muse/liste/listedit.cpp15
3 files changed, 13 insertions, 38 deletions
diff --git a/muse2/muse/liste/editevent.cpp b/muse2/muse/liste/editevent.cpp
index c31ecb3a..6781c365 100644
--- a/muse2/muse/liste/editevent.cpp
+++ b/muse2/muse/liste/editevent.cpp
@@ -27,7 +27,6 @@
#include <QGridLayout>
#include <QLabel>
#include <QListWidget>
-//#include <QMenu>
#include <QMessageBox>
#include <QPushButton>
#include <QRadioButton>
@@ -45,7 +44,6 @@
#include "pitchedit.h"
#include "intlabel.h"
#include "globals.h"
-///#include "posedit.h"
#include "gconfig.h"
#include "midiport.h"
#include "midiedit/drummap.h"
@@ -445,7 +443,6 @@ EditCAfterDialog::EditCAfterDialog(int tick, const MusECore::Event& event,
setWindowTitle(tr("MusE: Enter Channel Aftertouch"));
QLabel* l1 = new QLabel(tr("Time Position"));
- ///epos = new PosEdit;
epos = new Awl::PosEdit;
QLabel* l2 = new QLabel(tr("Pressure"));
@@ -504,7 +501,6 @@ EditPAfterDialog::EditPAfterDialog(int tick, const MusECore::Event& event,
setWindowTitle(tr("MusE: Enter Poly Aftertouch"));
QLabel* l1 = new QLabel(tr("Time Position"));
- ///epos = new PosEdit;
epos = new Awl::PosEdit;
QLabel* l2 = new QLabel(tr("Pitch"));
@@ -632,8 +628,8 @@ EditCtrlDialog::EditCtrlDialog(int tick, const MusECore::Event& event,
std::list<QString> sList;
typedef std::list<QString>::iterator isList;
- for (MusECore::iMidiCtrlValList i = cll->begin(); i != cll->end(); ++i) {
- MusECore::MidiCtrlValList* cl = i->second;
+ for (MusECore::iMidiCtrlValList it = cll->begin(); it != cll->end(); ++it) {
+ MusECore::MidiCtrlValList* cl = it->second;
int num = cl->num();
// dont show drum specific controller if not a drum track
@@ -697,13 +693,11 @@ EditCtrlDialog::EditCtrlDialog(int tick, const MusECore::Event& event,
void EditCtrlDialog::newController()
{
- //QMenu* pup = new QMenu(this);
MusEGui::PopupMenu* pup = new MusEGui::PopupMenu(this);
- //pup->setCheckable(this);//not necessary in Qt4
- //
+
// populate popup with all controllers available for
// current instrument
- //
+
MusECore::MidiTrack* track = part->track();
int portn = track->outPort();
MusECore::MidiPort* port = &MusEGlobal::midiPorts[portn];
@@ -732,24 +726,16 @@ void EditCtrlDialog::newController()
{
MusECore::MidiCtrlValList* vl = new MusECore::MidiCtrlValList(mc->num());
cll->add(channel, vl);
- //MusEGlobal::song->update(SC_MIDI_CONTROLLER_ADD);
}
- //for (int idx = 0; ;++idx) {
int idx = 0;
for (; idx < ctrlList->count() ;++idx) { // p4.0.25 Fix segfault
- QString str = ctrlList->item(idx)->text();
+ QString str = ctrlList->item(idx)->text();
if (s == str)
{
- ctrlList->item(idx)->setSelected(true);
+ ctrlList->item(idx)->setSelected(true);
ctrlListClicked(ctrlList->item(idx));
break;
}
- //if (str.isNull()) {
- // ctrlList->addItem(s);
- // ctrlList->item(idx)->setSelected(true);
- // ctrlListClicked(ctrlList->item(idx));
- // break;
- // }
}
if (idx >= ctrlList->count()) { // p4.0.25 Fix segfault
ctrlList->addItem(s);
@@ -871,9 +857,7 @@ void EditCtrlDialog::instrPopup()
int port = track->outPort();
MusECore::MidiInstrument* instr = MusEGlobal::midiPorts[port].instrument();
- //QMenu* pup = new QMenu(this);
MusEGui::PopupMenu* pup = new MusEGui::PopupMenu(this);
- //populatePatchPopup(instr, pup, channel, MusEGlobal::song->mtype(), track->isDrumTrack());
instr->populatePatchPopup(pup, channel, MusEGlobal::song->mtype(), track->isDrumTrack());
if(pup->actions().count() == 0)
@@ -897,9 +881,6 @@ void EditCtrlDialog::instrPopup()
void EditCtrlDialog::programChanged()
{
-// MusECore::MidiTrack* track = part->track();
-// int channel = track->outChannel();
-// int port = track->outPort();
int hb = hbank->value();
int lb = lbank->value();
int prog = program->value();
diff --git a/muse2/muse/liste/editevent.h b/muse2/muse/liste/editevent.h
index 51ba80d0..cd02c82e 100644
--- a/muse2/muse/liste/editevent.h
+++ b/muse2/muse/liste/editevent.h
@@ -48,7 +48,6 @@ namespace MusEGui {
class IntLabel;
class PitchEdit;
-///class PosEdit;
//---------------------------------------------------------
@@ -117,7 +116,6 @@ class EditCtrlDialog : public QDialog, public Ui::EditCtrlBase {
int val; // controller value (for prog. changes)
const MusECore::MidiPart* part;
- ///QMenu* pop;
void updatePatch();
@@ -148,7 +146,6 @@ class EditMetaDialog : public EditEventDialog {
unsigned char* meta;
int len;
- ///PosEdit* epos;
Awl::PosEdit* epos;
QTextEdit* edit;
MusEGui::IntLabel* il2;
@@ -179,7 +176,6 @@ class EditMetaDialog : public EditEventDialog {
class EditCAfterDialog : public EditEventDialog {
Q_OBJECT
- ///PosEdit* epos;
Awl::PosEdit* epos;
MusEGui::IntLabel* il2;
@@ -201,7 +197,6 @@ class EditCAfterDialog : public EditEventDialog {
class EditPAfterDialog : public EditEventDialog {
Q_OBJECT
- ///PosEdit* epos;
Awl::PosEdit* epos;
MusEGui::PitchEdit* pl;
MusEGui::IntLabel* il2;
diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp
index 5e72a0c7..a0d82969 100644
--- a/muse2/muse/liste/listedit.cpp
+++ b/muse2/muse/liste/listedit.cpp
@@ -197,13 +197,13 @@ void ListEdit::songChanged(int type)
{
if(_isDeleting) // Ignore while while deleting to prevent crash.
return;
-
+
if (type == 0)
return;
if (type & (SC_PART_REMOVED | SC_PART_MODIFIED
| SC_PART_INSERTED | SC_EVENT_REMOVED | SC_EVENT_MODIFIED
| SC_EVENT_INSERTED | SC_SELECTION)) {
- if (type & (SC_PART_REMOVED | SC_PART_INSERTED))
+ if (type & (SC_PART_REMOVED | SC_PART_INSERTED | SC_PART_MODIFIED))
genPartlist();
// close window if editor has no parts anymore
if (parts()->empty()) {
@@ -213,6 +213,8 @@ void ListEdit::songChanged(int type)
liste->setSortingEnabled(false);
if (type == SC_SELECTION) {
+
+ // DELETETHIS or clean up or whatever?
// BUGFIX: I found the keyboard modifier states affect how QTreeWidget::setCurrentItem() operates.
// So for example (not) holding shift while lassoo-ing notes in piano roll affected
// whether multiple items were selected in this event list editor!
@@ -244,12 +246,10 @@ void ListEdit::songChanged(int type)
// Go backwards to avoid QTreeWidget::setCurrentItem() dependency on KB modifiers!
for (int row = liste->topLevelItemCount() -1; row >= 0 ; --row)
{
- //printf("ListEdit::songChanged row:%d\n", row);
QTreeWidgetItem* i = liste->topLevelItem(row);
bool sel = ((EventListItem*)i)->event.selected();
if (i->isSelected() ^ sel)
{
- //printf("ListEdit::songChanged changing row:%d sel:%d\n", row, sel);
// Do setCurrentItem() before setSelected().
if(sel && !ci_done)
{
@@ -496,7 +496,7 @@ ListEdit::ListEdit(MusECore::PartList* pl)
menuEdit->addActions(MusEGlobal::undoRedo->actions());
menuEdit->addSeparator();
-#if 0
+#if 0 // DELETETHIS or implement?
QAction *cutAction = menuEdit->addAction(QIcon(*editcutIconSet), tr("Cut"));
connect(cutAction, SIGNAL(triggered()), editSignalMapper, SLOT(map()));
editSignalMapper->setMapping(cutAction, EList::CMD_CUT);
@@ -615,7 +615,6 @@ ListEdit::ListEdit(MusECore::PartList* pl)
ListEdit::~ListEdit()
{
- // MusEGlobal::undoRedo->removeFrom(listTools); // p4.0.6 Removed
}
//---------------------------------------------------------
@@ -1003,8 +1002,8 @@ void ListEdit::initShortcuts()
void ListEdit::keyPressEvent(QKeyEvent* event)
{
-int key = event->key();
-if (key == Qt::Key_Escape) {
+ int key = event->key();
+ if (key == Qt::Key_Escape) {
close();
return;
}