diff options
author | Florian Jung <flo@windfisch.org> | 2011-12-26 19:35:16 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-12-26 19:35:16 +0000 |
commit | b988a0a27bc175ce10bc8fa53ed131486813f3e7 (patch) | |
tree | 9bd59eda317e9979cffcaa0344f45120e8a6e7d2 /muse2 | |
parent | 0d8e763949e498c1baf3a2fac7b0b3a406eb0068 (diff) |
merged with release_2_0
Diffstat (limited to 'muse2')
-rw-r--r-- | muse2/muse/arranger/tlist.cpp | 4 | ||||
-rw-r--r-- | muse2/muse/ctrl/ctrlcanvas.cpp | 6 | ||||
-rw-r--r-- | muse2/muse/importmidi.cpp | 6 | ||||
-rw-r--r-- | muse2/muse/midiedit/dlist.cpp | 13 | ||||
-rw-r--r-- | muse2/muse/midiedit/drummap.h | 2 | ||||
-rw-r--r-- | muse2/muse/song.cpp | 8 | ||||
-rw-r--r-- | muse2/muse/undo.cpp | 13 | ||||
-rw-r--r-- | muse2/muse/undo.h | 5 |
8 files changed, 39 insertions, 18 deletions
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 4fc39c2c..568bac05 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -1079,7 +1079,9 @@ MusECore::TrackList TList::getRecEnabledTracks() void TList::changeAutomation(QAction* act) { //printf("changeAutomation %d\n", act->data().toInt()); - if (editAutomation->type() == MusECore::Track::MIDI) { + + //if (editAutomation->type() == MusECore::Track::MIDI) { // commented out by flo93 + if ( (editAutomation->type() == MusECore::Track::MIDI) || (editAutomation->type() == MusECore::Track::DRUM) ) { printf("this is wrong, we can't edit automation for midi tracks from arranger yet!\n"); return; } diff --git a/muse2/muse/ctrl/ctrlcanvas.cpp b/muse2/muse/ctrl/ctrlcanvas.cpp index 60e19ba7..96143b10 100644 --- a/muse2/muse/ctrl/ctrlcanvas.cpp +++ b/muse2/muse/ctrl/ctrlcanvas.cpp @@ -1927,8 +1927,8 @@ void CtrlCanvas::drawOverlay(QPainter& p) if (noEvents) { //p.setFont(MusEGlobal::config.fonts[3]); //p.setPen(Qt::black); - //p.drawText(width()/2-100,height()/2-10, "Use shift + pencil or line tool to draw new events"); - p.drawText(2 , y * 2, "Drawing hint: Hold Ctrl to affect only existing events"); + //p.drawText(width()/2-100,height()/2-10, tr("Use shift + pencil or line tool to draw new events")); + p.drawText(2 , y * 2, tr("Drawing hint: Hold Ctrl to affect only existing events")); } } @@ -1948,7 +1948,7 @@ QRect CtrlCanvas::overlayRect() const r.translate(2, y); if (noEvents) { - QRect r2(fm.boundingRect(QString("Use shift + pencil or line tool to draw new events"))); + QRect r2(fm.boundingRect(QString(tr("Use shift + pencil or line tool to draw new events")))); //r2.translate(width()/2-100, height()/2-10); r2.translate(2, y * 2); r |= r2; diff --git a/muse2/muse/importmidi.cpp b/muse2/muse/importmidi.cpp index ccd33b92..0bc477dc 100644 --- a/muse2/muse/importmidi.cpp +++ b/muse2/muse/importmidi.cpp @@ -201,13 +201,13 @@ bool MusE::importMidi(const QString name, bool merge) if (channel == 9 && MusEGlobal::song->mtype() != MT_UNKNOWN) { track->setType(MusECore::Track::DRUM); // - // remap drum pitch with drumInmap + // remap drum pitch with drumOutmap (was: Inmap. flo93 thought this was wrong) // MusECore::EventList* tevents = track->events(); for (MusECore::iEvent i = tevents->begin(); i != tevents->end(); ++i) { MusECore::Event ev = i->second; if (ev.isNote()) { - int pitch = MusEGlobal::drumInmap[ev.pitch()]; + int pitch = MusEGlobal::drumOutmap[ev.pitch()]; // flo93 ev.setPitch(pitch); } else @@ -216,7 +216,7 @@ bool MusE::importMidi(const QString name, bool merge) int ctl = ev.dataA(); MusECore::MidiController *mc = mport->drumController(ctl); if(mc) - ev.setA((ctl & ~0xff) | MusEGlobal::drumInmap[ctl & 0x7f]); + ev.setA((ctl & ~0xff) | MusEGlobal::drumOutmap[ctl & 0x7f]); // flo93 } } } diff --git a/muse2/muse/midiedit/dlist.cpp b/muse2/muse/midiedit/dlist.cpp index 854fe552..80009cc7 100644 --- a/muse2/muse/midiedit/dlist.cpp +++ b/muse2/muse/midiedit/dlist.cpp @@ -291,8 +291,8 @@ void DList::viewMousePressEvent(QMouseEvent* ev) val = dm->vol + incVal; if (val < 0) val = 0; - else if (val > 200) - val = 200; + else if (val > 999) + val = 999; dm->vol = (unsigned char)val; break; case COL_QNT: @@ -607,8 +607,8 @@ void DList::returnPressed() switch (selectedColumn) { case COL_VOL: - if (val > 200) //Check bounds for volume - val = 200; + if (val > 999) //Check bounds for volume + val = 999; if (val < 0) val = 0; break; @@ -826,7 +826,10 @@ void DList::viewMouseReleaseEvent(QMouseEvent* ev) { if (drag == DRAG) { int y = ev->y(); - unsigned dPitch = y / TH; + int dPitch = y / TH; + if (dPitch < 0) dPitch=0; + if (dPitch >= DRUM_MAPSIZE) dPitch=DRUM_MAPSIZE-1; + setCursor(QCursor(Qt::ArrowCursor)); currentlySelected = &MusEGlobal::drumMap[int(dPitch)]; emit curDrumInstrumentChanged(dPitch); diff --git a/muse2/muse/midiedit/drummap.h b/muse2/muse/midiedit/drummap.h index 60a25fad..990f8fe2 100644 --- a/muse2/muse/midiedit/drummap.h +++ b/muse2/muse/midiedit/drummap.h @@ -46,8 +46,8 @@ struct DrumMap { bool mute; // bool selected; - //bool const operator==(const DrumMap& map) const; bool operator==(const DrumMap& map) const; + bool operator!=(const DrumMap& map) const { return !operator==(map); } }; #define DRUM_MAPSIZE 128 diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp index 36be50a0..8b8f6e15 100644 --- a/muse2/muse/song.cpp +++ b/muse2/muse/song.cpp @@ -512,13 +512,15 @@ void Song::remapPortDrumCtrlEvents(int mapidx, int newnote, int newchan, int new { MidiPart* part = (MidiPart*)(ip->second); const EventList* el = part->cevents(); - unsigned len = part->lenTick(); + // unsigned len = part->lenTick(); // unneeded, see below. for(ciEvent ie = el->begin(); ie != el->end(); ++ie) { const Event& ev = ie->second; // Added by T356. Do not handle events which are past the end of the part. - if(ev.tick() >= len) - break; + // Commented out by flo: yes, DO handle them! these are "hidden events" + // which may be revealed later again! + // if(ev.tick() >= len) + // break; if(ev.type() != Controller) continue; diff --git a/muse2/muse/undo.cpp b/muse2/muse/undo.cpp index 8587b108..06c190a2 100644 --- a/muse2/muse/undo.cpp +++ b/muse2/muse/undo.cpp @@ -789,6 +789,7 @@ void Song::doRedo2() UndoOp::UndoOp() { + type=UndoOp::DoNothing; } UndoOp::UndoOp(UndoType type_) @@ -1087,4 +1088,16 @@ void Song::doRedo3() dirty = true; } + +bool Undo::empty() const +{ + if (std::list<UndoOp>::empty()) return true; + + for (const_iterator it=begin(); it!=end(); it++) + if (it->type!=UndoOp::DoNothing) + return false; + + return true; +} + } // namespace MusECore diff --git a/muse2/muse/undo.h b/muse2/muse/undo.h index af55a307..ce73ac9a 100644 --- a/muse2/muse/undo.h +++ b/muse2/muse/undo.h @@ -122,8 +122,9 @@ struct UndoOp { }; class Undo : public std::list<UndoOp> { - void undoOp(UndoOp::UndoType, int data); - }; + public: + bool empty() const; +}; typedef Undo::iterator iUndoOp; typedef Undo::reverse_iterator riUndoOp; |