From be3b3fef8d787f167b57ebfd700717a02c38570d Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Fri, 16 Aug 2013 21:58:04 +0200 Subject: removing commented out code --- muse2/muse/arranger/pcanvas.cpp | 422 ---------------------------------------- muse2/muse/arranger/tlist.cpp | 179 ----------------- muse2/muse/songfile.cpp | 76 -------- 3 files changed, 677 deletions(-) (limited to 'muse2') diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp index 0e1e04a8..5cad107a 100644 --- a/muse2/muse/arranger/pcanvas.cpp +++ b/muse2/muse/arranger/pcanvas.cpp @@ -1484,428 +1484,6 @@ void PartCanvas::keyPress(QKeyEvent* event) // draws a part //--------------------------------------------------------- -#if 0 // DELETETHIS 430 WHOA! -void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) - { - int from = rect.x(); - int to = from + rect.width(); - - //printf("from %d to %d\n", from,to); - MusECore::Part* part = ((NPart*)item)->part(); - int pTick = part->tick(); - from -= pTick; - to -= pTick; - if(from < 0) - from = 0; - if((unsigned int)to > part->lenTick()) - to = part->lenTick(); - - // Item bounding box x is in tick coordinates, same as rectangle. - if(item->bbox().intersect(rect).isNull()) - { - //printf("PartCanvas::drawItem rectangle is null\n"); - return; - } - - QRect r = item->bbox(); - bool clone = part->events()->arefCount() > 1; - QBrush brush; - - //QRect rr = map(r); - //QRect rr = p.transform().mapRect(r); - //printf("PartCanvas::drawItem called map rx:%d rw:%d rrx:%d rrw:%d\n", r.x(), r.width(), rr.x(), rr.width()); - //printf("PartCanvas::drawItem called map rx:%d rw:%d\n", r.x(), r.width()); - //p.save(); - //p.setWorldMatrixEnabled(false); - - // NOTE: Optimization: For each item, hasHiddenEvents() is called once in Canvas::draw(), and we use cachedHasHiddenEvents(). - // Not used for now. - //int het = part->cachedHasHiddenEvents(); - int het = part->hasHiddenEvents(); - - int y_1 = rmapyDev(1); // Hack, try to replace. - double xs_0 = r.x(); - double xe_0 = xs_0 + r.width(); - double xs_m0 = rmapx_f(xs_0); - double xe_m0 = rmapx_f(xe_0); - double xs_1 = rmapxDev_f(xs_m0 + 1.0); - if(xs_1 > xe_0) - xs_1 = xe_0; - double xs_2 = rmapxDev_f(xs_m0 + 2.0); - if(xs_2 > xe_0) - xs_2 = xe_0; - double xs_6 = rmapxDev_f(xs_m0 + 6.0); - if(xs_6 > xe_0) - xs_6 = xe_0; - - double xe_1 = rmapxDev_f(xe_m0 - 1.0); - if(xe_1 < xs_0) - xe_1 = xs_0; - double xe_2 = rmapxDev_f(xe_m0 - 2.0); - if(xe_2 < xs_0) - xe_2 = xs_0; - double xe_6 = rmapxDev_f(xe_m0 - 6.0); - if(xe_6 < xs_0) - xe_6 = xs_0; - - double ys_0 = r.y(); - double ye_0 = ys_0 + r.height(); - double ys_m0 = rmapy_f(ys_0); - double ye_m0 = rmapy_f(ye_0); - double ys_1 = rmapyDev_f(ys_m0 + 1.0); - if(ys_1 > ye_0) - ys_1 = ye_0; - double ys_2 = rmapyDev_f(ys_m0 + 2.0); - if(ys_2 > ye_0) - ys_2 = ye_0; - - double ye_1 = rmapyDev_f(ye_m0 - 1.0); - if(ye_1 < ys_0) - ye_1 = ys_0; - double ye_2 = rmapyDev_f(ye_m0 - 2.0); - if(ye_2 < ys_0) - ye_2 = ys_0; - - int cidx = part->colorIndex(); - if (item->isMoving()) - { - QColor c(Qt::gray); - c.setAlpha(MusEGlobal::config.globalAlphaBlend); - QLinearGradient gradient(r.topLeft(), r.bottomLeft()); - gradient.setColorAt(0, c); - gradient.setColorAt(1, c.darker()); - brush = QBrush(gradient); - } - else - if (part->selected()) - { - QColor c(Qt::black); - c.setAlpha(MusEGlobal::config.globalAlphaBlend); - QLinearGradient gradient(r.topLeft(), r.bottomLeft()); - // Use a colour only about 20% lighter than black, rather than the 50% we use in MusECore::gGradientFromQColor - // and is used in darker()/lighter(), so that it is distinguished a bit better from grey non-part tracks. - //c.setRgba(64, 64, 64, c.alpha()); - gradient.setColorAt(0, QColor(51, 51, 51, MusEGlobal::config.globalAlphaBlend)); - gradient.setColorAt(1, c); - brush = QBrush(gradient); - } - else - if (part->mute()) - { - QColor c(Qt::white); - c.setAlpha(MusEGlobal::config.globalAlphaBlend); - QLinearGradient gradient(r.topLeft(), r.bottomLeft()); - gradient.setColorAt(0, c); - gradient.setColorAt(1, c.darker()); - brush = QBrush(gradient); - - // Not good. Aliasing missing lines happening at different mags. - // And it's too much. If notes + automation is displayed (by removing 'return' below), cross hatch interferes. - // TODO: Maybe try to draw a nice gradient SINGLE cross (or STAR) from corner to corner instead. - // Then remove the 'return' below and let it draw the name and notes. - //brush.setStyle(Qt::DiagCrossPattern); - //p.fillRect(rf, brush); - } - else - { - QColor c(MusEGlobal::config.partColors[cidx]); - c.setAlpha(MusEGlobal::config.globalAlphaBlend); - brush = QBrush(MusECore::gGradientFromQColor(c, r.topLeft(), r.bottomLeft())); - } - - double h = r.height(); - double s = h / 4.0; - double y0 = r.y(); - double y1 = y0 + s; - double y2 = y0 + s * 2.0; - double y3 = y0 + s * 3.0; - double y4 = y0 + h; - - QPointF points[16]; - int pts; - - // - // Fill the part rectangles, accounting for hidden events by using 'jagged' edges... - // - - p.setBrush(brush); - p.setPen(Qt::NoPen); - if(het) - { - pts = 0; - if(het == (MusECore::Part::LeftEventsHidden | MusECore::Part::RightEventsHidden)) - { - points[pts++] = QPointF(xs_0, y0); - points[pts++] = QPointF(xe_0, y0); - points[pts++] = QPointF(xe_6, y1); - points[pts++] = QPointF(xe_0, y2); - points[pts++] = QPointF(xe_6, y3); - points[pts++] = QPointF(xe_0, y4); - points[pts++] = QPointF(xs_0, y4); - points[pts++] = QPointF(xs_6, y3); - points[pts++] = QPointF(xs_0, y2); - points[pts++] = QPointF(xs_6, y1); - p.drawConvexPolygon(points, pts); // Help says may be faster on some platforms (X11). - } - else - if(het == MusECore::Part::LeftEventsHidden) - { - points[pts++] = QPointF(xs_0, y0); - points[pts++] = QPointF(xe_0, y0); - points[pts++] = QPointF(xe_0, y4); - points[pts++] = QPointF(xs_0, y4); - points[pts++] = QPointF(xs_6, y3); - points[pts++] = QPointF(xs_0, y2); - points[pts++] = QPointF(xs_6, y1); - p.drawConvexPolygon(points, pts); - } - else - if(het == MusECore::Part::RightEventsHidden) - { - points[pts++] = QPointF(xs_0, y0); - points[pts++] = QPointF(xe_0, y0); - - points[pts++] = QPointF(xe_6, y1); - points[pts++] = QPointF(xe_0, y2); - points[pts++] = QPointF(xe_6, y3); - points[pts++] = QPointF(xe_0, y4); - points[pts++] = QPointF(xs_0, y4); - p.drawConvexPolygon(points, pts); - } - - // - // Draw remaining 'hidden events' decorations with 'jagged' edges... - // - - int part_r, part_g, part_b, brightness, color_brightness; - MusEGlobal::config.partColors[cidx].getRgb(&part_r, &part_g, &part_b); - brightness = part_r*29 + part_g*59 + part_b*12; - //if ((brightness < 12000 || part->selected()) && !part->mute() && !item->isMoving()) - // color_brightness=223; // too dark: use lighter color - //else - // color_brightness=32; // otherwise use dark color - if ((brightness >= 12000 && !part->selected())) - color_brightness=32; // too light: use dark color - else - color_brightness=223; // too dark: use lighter color - QColor c(color_brightness,color_brightness,color_brightness, MusEGlobal::config.globalAlphaBlend); - p.setBrush(QBrush(MusECore::gGradientFromQColor(c, r.topLeft(), r.bottomLeft()))); - //p.setBrush(QBrush(c)); - if(het & MusECore::Part::RightEventsHidden) - { - pts = 0; - points[pts++] = QPointF(xe_0, y0); - points[pts++] = QPointF(xe_0, y4); - points[pts++] = QPointF(xe_6, y3); - points[pts++] = QPointF(xe_0, y2); - points[pts++] = QPointF(xe_6, y1); - p.drawConvexPolygon(points, pts); - } - if(het & MusECore::Part::LeftEventsHidden) - { - pts = 0; - points[pts++] = QPointF(xs_0, y0); - points[pts++] = QPointF(xs_6, y1); - points[pts++] = QPointF(xs_0, y2); - points[pts++] = QPointF(xs_6, y3); - points[pts++] = QPointF(xs_0, y4); - p.drawConvexPolygon(points, pts); - } - } - else - { - p.fillRect(r, brush); - } - - MusECore::MidiPart* mp = 0; - MusECore::WavePart* wp = 0; - MusECore::Track::TrackType type = part->track()->type(); - if (type == MusECore::Track::WAVE) { - wp =(MusECore::WavePart*)part; - } - else { - mp = (MusECore::MidiPart*)part; - } - - if (wp) - drawWavePart(p, rect, wp, r); - else if (mp) - { - drawMidiPart(p, rect, mp->events(), (MusECore::MidiTrack*)part->track(), mp, r, mp->tick(), from, to); - } - - #if 0 - // - // Now draw the borders... - // Works great but requires clones be drawn with the highest priority on top of all other parts, in Canvas::draw. - // - - QPen pen(part->selected() ? MusEGlobal::config.partColors[i] : Qt::black, 2.0, clone ? Qt::DotLine : Qt::SolidLine); - pen.setCosmetic(true); - p.setPen(pen); - p.setBrush(Qt::NoBrush); - p.drawRect(r); - - #else - // - // Now draw the borders, using custom segments... - // - - // FIXME NOTE: For 1-pixel wide lines, setting pen style to anything other than solid didn't work out well. - // Much too screwy - the single-width lines kept getting shifted one pixel over intermittently. - // I tried EVERYTHING to make sure x is proper but the painter keeps shifting them over. - // Meanwhile the fills are correct. Seems painter doesn't like line patterns, whether stock or custom. - // Therefore I was forced to manually draw the left and right segments. - // It works. Which seems to be more proof that painter is handling line patterns and pen widths badly... - // DO NOT ERASE COMMENTED CODE BELOW for now, in case it can be fixed. Tim. p4.0.29 - - p.setBrush(Qt::NoBrush); - - QColor pc((part->mute() || item->isMoving())? Qt::white : MusEGlobal::config.partColors[cidx]); - QPen penSelect1H(pc); - QPen penSelect2H(pc, 2.0); - QPen penSelect1V(pc); - QPen penSelect2V(pc, 2.0); - penSelect1H.setCosmetic(true); - penSelect2H.setCosmetic(true); - penSelect1V.setCosmetic(true); - penSelect2V.setCosmetic(true); - - pc = Qt::black; - QPen penNormal1H(pc); - QPen penNormal2H(pc, 2.0); - QPen penNormal1V(pc); - QPen penNormal2V(pc, 2.0); - penNormal1H.setCosmetic(true); - penNormal2H.setCosmetic(true); - penNormal1V.setCosmetic(true); - penNormal2V.setCosmetic(true); - - QVector customDashPattern; - if(clone) - { - customDashPattern << 4.0 << 8.0; - penSelect1H.setDashPattern(customDashPattern); - penNormal1H.setDashPattern(customDashPattern); - //penSelect1V.setDashPattern(customDashPattern); - //penNormal1V.setDashPattern(customDashPattern); - customDashPattern.clear(); - customDashPattern << 2.0 << 4.0; - penSelect2H.setDashPattern(customDashPattern); - penNormal2H.setDashPattern(customDashPattern); - //penSelect2V.setDashPattern(customDashPattern); - //penNormal2V.setDashPattern(customDashPattern); - } - - pc = Qt::white; - QPen penHidden1(pc); - QPen penHidden2(pc, 2.0); - penHidden2.setCosmetic(true); - //customDashPattern.clear(); - //customDashPattern << 2.0 << 10.0; - //penHidden1.setDashPattern(customDashPattern); - //customDashPattern.clear(); - //customDashPattern << 1.0 << 5.0; - //penHidden2.setDashPattern(customDashPattern); - - bool lbt = ((NPart*)item)->leftBorderTouches; - bool rbt = ((NPart*)item)->rightBorderTouches; - - QLineF l1( lbt?xs_1:xs_0, ys_0, rbt?xe_1:xe_0, ys_0); // Top - //QLineF l2(rbt?xe_1:xe_0, r.y() + (rbt?y_1:y_2) - 1, rbt?xe_1:xe_0, r.y() + r.height() - 1); // Right - QLineF l3( lbt?xs_1:xs_0, ye_0, rbt?xe_1:xe_0, ye_0); // Bottom - //QLineF l4(r.x(), r.y() + (lbt?y_1:y_2), r.x(), r.y() + r.height() - (lbt?y_1:y_2)); // Left - - if(het & MusECore::Part::RightEventsHidden) - p.setPen(((NPart*)item)->rightBorderTouches ? penHidden1 : penHidden2); - else - { - if(((NPart*)item)->rightBorderTouches) - p.setPen(part->selected() ? penSelect1V : penNormal1V); - else - p.setPen(part->selected() ? penSelect2V : penNormal2V); - } - //p.drawLine(l2); // Right line - - double xx = rbt?xe_1:xe_0; - if(clone) - { - double yinc = 7.0 * y_1; - for(double yy = (rbt?ys_1:ys_2); yy < ye_2; yy += yinc) - { - double yi = (rbt?3.0:2.0) * y_1; - if(yy + yi > ye_2) - yi = ye_2 - yy; - p.drawLine(QPointF(xx, yy), QPointF(xx, yy + yi)); // Right dashed line - } - } - else - p.drawLine(QPointF(xx, rbt?ys_1:ys_2), QPointF(xx, rbt?ye_1:ye_2)); // Right line - - if(het & MusECore::Part::LeftEventsHidden) - p.setPen(((NPart*)item)->leftBorderTouches ? penHidden1 : penHidden2); - else - { - if(((NPart*)item)->leftBorderTouches) - p.setPen(part->selected() ? penSelect1V : penNormal1V); - else - p.setPen(part->selected() ? penSelect2V : penNormal2V); - } - //p.drawLine(l4); // Left line - - xx = xs_0; - if(clone) - { - double yinc = 7.0 * y_1; - for(double yy = (lbt?ys_1:ys_2); yy < ye_2; yy += yinc) - { - double yi = (lbt?3.0:2.0) * y_1; - if(yy + yi > ye_2) - yi = ye_2 - yy; - p.drawLine(QPointF(xx, yy), QPointF(xx, yy + yi)); // Left dashed line - } - } - else - p.drawLine(QPointF(xx, lbt?ys_1:ys_2), QPointF(xx, lbt?ye_1:ye_2)); // Left line - - p.setPen(part->selected() ? penSelect2H : penNormal2H); - p.drawLine(l1); // Top line - p.drawLine(l3); // Bottom line - - #endif - - //p.restore(); - - if (MusEGlobal::config.canvasShowPartType & 1) { // show names - // draw name - // FN: Set text color depending on part color (black / white) - int part_r, part_g, part_b, brightness; - // Since we'll draw the text on the bottom (to accommodate drum 'slivers'), - // get the lowest colour in the gradient used to draw the part. - QRect rr = map(r); - rr.setX(rr.x() + 3); - MusECore::gGradientFromQColor(MusEGlobal::config.partColors[cidx], rr.topLeft(), rr.bottomLeft()).stops().last().second.getRgb(&part_r, &part_g, &part_b); - brightness = part_r*29 + part_g*59 + part_b*12; - //bool rev = (brightness < 12000 || part->selected()) && !part->mute() && !item->isMoving(); - bool rev = brightness >= 12000 && !part->selected(); - p.save(); - p.setFont(MusEGlobal::config.fonts[4]); - p.setWorldMatrixEnabled(false); - if (rev) - p.setPen(Qt::white); - else - p.setPen(Qt::black); - p.drawText(rr.translated(1, 1), Qt::AlignBottom|Qt::AlignLeft, part->name()); - if (rev) - p.setPen(Qt::black); - else - p.setPen(Qt::white); - p.drawText(rr, Qt::AlignBottom|Qt::AlignLeft, part->name()); - p.restore(); - } - } -#endif - void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect) { int from = rect.x(); diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp index 5cea444d..8535a9f5 100644 --- a/muse2/muse/arranger/tlist.cpp +++ b/muse2/muse/arranger/tlist.cpp @@ -2510,185 +2510,6 @@ void TList::mouseReleaseEvent(QMouseEvent* ev) void TList::wheelEvent(QWheelEvent* ev) { emit redirectWheelEvent(ev); - -// REMOVE Tim. Hate to just kill all this, so remove later if all tests OK. -// int x = ev->x(); -// int y = ev->y(); -// MusECore::Track* t = y2Track(y + ypos); -// if (t == 0) { -// emit redirectWheelEvent(ev); -// return; -// } -// -// TrackColumn col = TrackColumn(header->logicalIndexAt(x)); -// int delta = ev->delta() / WHEEL_DELTA; -// ev->accept(); -// -// switch (col) { -// case COL_RECORD: -// case COL_NONE: -// case COL_CLASS: -// case COL_NAME: -// case COL_AUTOMATION: -// break; -// case COL_MUTE: -// // p3.3.29 -// if (((QInputEvent*)ev)->modifiers() & Qt::ShiftModifier) -// t->setOff(!t->off()); -// else -// { -// if (t->off()) -// t->setOff(false); -// else -// t->setMute(!t->mute()); -// } -// MusEGlobal::song->update(SC_MUTE); -// break; -// -// case COL_SOLO: -// MusEGlobal::audio->msgSetSolo(t, !t->solo()); -// MusEGlobal::song->update(SC_SOLO); -// break; -// -// case COL_TIMELOCK: -// t->setLocked(!t->locked()); -// break; -// -// case COL_OPORT: -// if (t->isMidiTrack()) { -// MusECore::MidiTrack* mt = (MusECore::MidiTrack*)t; -// int port = mt->outPort() + delta; -// -// if (port >= MIDI_PORTS) -// port = MIDI_PORTS-1; -// else if (port < 0) -// port = 0; -// if (port != ((MusECore::MidiTrack*)t)->outPort()) { -// MusEGlobal::audio->msgIdle(true); -// mt->setOutPortAndUpdate(port); -// MusEGlobal::audio->msgIdle(false); -// -// MusEGlobal::audio->msgUpdateSoloStates(); // p4.0.14 -// MusEGlobal::song->update(SC_MIDI_TRACK_PROP); // p4.0.17 -// } -// } -// break; -// -// case COL_OCHANNEL: -// if (t->isMidiTrack()) { -// MusECore::MidiTrack* mt = (MusECore::MidiTrack*)t; -// if (mt && mt->type() == MusECore::Track::DRUM) -// break; -// -// int channel = mt->outChannel() + delta; -// -// if (channel >= MIDI_CHANNELS) -// channel = MIDI_CHANNELS-1; -// else if (channel < 0) -// channel = 0; -// if (channel != ((MusECore::MidiTrack*)t)->outChannel()) { -// MusEGlobal::audio->msgIdle(true); -// mt->setOutChanAndUpdate(channel); -// MusEGlobal::audio->msgIdle(false); -// -// // may result in adding/removing mixer strip: -// //MusEGlobal::song->update(-1); -// MusEGlobal::audio->msgUpdateSoloStates(); // p4.0.14 -// MusEGlobal::song->update(SC_MIDI_TRACK_PROP); -// } -// } -// else { -// int n = t->channels() + delta; -// if (n > MAX_CHANNELS) -// n = MAX_CHANNELS; -// else if (n < 1) -// n = 1; -// if (n != t->channels()) { -// MusEGlobal::audio->msgSetChannels((MusECore::AudioTrack*)t, n); -// MusEGlobal::song->update(SC_CHANNELS); -// } -// } -// break; -// default: -// if (col>=COL_CUSTOM_MIDICTRL_OFFSET) -// { -// mode = START_DRAG; -// -// if (t->isMidiTrack()) -// { -// MusECore::MidiTrack* mt = dynamic_cast(t); -// if (mt == 0) -// break; -// -// int ctrl_num = Arranger::custom_columns[col-COL_CUSTOM_MIDICTRL_OFFSET].ctrl; -// -// MusECore::MidiPort* mp = &MusEGlobal::midiPorts[mt->outPort()]; -// MusECore::MidiController* mctl = mp->midiController(ctrl_num); -// -// int minval=mctl->minVal()+mctl->bias(); -// int maxval=mctl->maxVal()+mctl->bias(); -// -// int val = mt->getControllerChangeAtTick(0,ctrl_num); -// int oldval=val; -// -// if (ctrl_num!=MusECore::CTRL_PROGRAM) -// { -// val += delta; -// if(val > maxval) -// val = maxval; -// if(val < minval-1) // "-1" because of "off" -// val = minval-1; -// } -// else -// { -// MusECore::MidiInstrument* instr = mp->instrument(); -// if (delta>0) val=instr->getNextPatch(mt->outChannel(), val, false); -// else if (delta<0) val=instr->getPrevPatch(mt->outChannel(), val, false); -// } -// -// if (val != oldval) -// { -// if (val!=minval-1) -// { -// int at_tick; -// if (Arranger::custom_columns[col-COL_CUSTOM_MIDICTRL_OFFSET].affected_pos == -// Arranger::custom_col_t::AFFECT_BEGIN) -// at_tick=0; -// else -// at_tick=MusEGlobal::song->cpos(); -// -// record_controller_change_and_maybe_send(at_tick, ctrl_num, val, mt); -// } -// else -// { -// MusECore::Undo operations; -// for (MusECore::iPart p = mt->parts()->begin(); p!=mt->parts()->end(); p++) -// { -// if (p->second->tick()==0) -// { -// for (MusECore::iEvent ev=p->second->events()->begin(); ev!=p->second->events()->end(); ev++) -// { -// if (ev->second.tick()!=0) break; -// else if (ev->second.type()==MusECore::Controller && ev->second.dataA()==ctrl_num) -// { -// using MusECore::UndoOp; -// operations.push_back(UndoOp(UndoOp::DeleteEvent, ev->second, p->second, false, false)); -// break; -// } -// } -// } -// } -// MusEGlobal::song->applyOperationGroup(operations); -// } -// } -// } -// } -// else -// mode = START_DRAG; -// -// break; -// } - } diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp index 6d0e056f..9a583996 100644 --- a/muse2/muse/songfile.cpp +++ b/muse2/muse/songfile.cpp @@ -340,14 +340,6 @@ Part* readXmlPart(Xml& xml, Track* track, bool doClone, bool toTrack) e.move( -npart->tick() ); int tick = e.tick(); - // DELETETHIS 7 - // Do not discard events belonging to clone parts, - // at least not yet. A later clone might have a longer, - // fully accommodating part length! - //if ((tick < 0) || (tick >= (int) lenTick())) { - //if ((tick < 0) || ( id == -1 && !clone && (tick >= (int)lenTick()) )) - // No way to tell at the moment whether there will be clones referencing this... - // No choice but to accept all events past 0. if(tick < 0) { printf("readClone: warning: event at tick:%d not in part:%s, discarded\n", @@ -373,25 +365,6 @@ Part* readXmlPart(Xml& xml, Track* track, bool doClone, bool toTrack) else if (tag == "cloneId") { id = xml.s2().toInt(); - //if(id != -1) DELETETHIS 19 - //{ - // for(iClone i = MusEGlobal::cloneList.begin(); i != MusEGlobal::cloneList.end(); ++i) - // { - // Is a matching part found in the clone list? - // if(i->id == id) - // { - // If it's a regular paste (not paste clone), and the original part is - // not a clone, defer so that a new copy is created in TagStart above. - //if(!doClone && i->cp->cevents()->arefCount() <= 1) - //if(!doClone && !isclone) - // break; - - // This makes a clone, chains the part, and increases ref counts. - // npart = track->newPart((Part*)i->cp, true); - // break; - // } - // } - //} } else if (tag == "uuid") { @@ -399,55 +372,6 @@ Part* readXmlPart(Xml& xml, Track* track, bool doClone, bool toTrack) if(!uuid_is_null(uuid)) { uuidvalid = true; - /* DELETETHIS 50 - for(iClone i = MusEGlobal::cloneList.begin(); i != MusEGlobal::cloneList.end(); ++i) - { - // Is a matching part found in the clone list? - if(uuid_compare(uuid, i->uuid) == 0) - { - Track* cpt = i->cp->track(); - // If we want to paste to the given track... - if(toTrack) - { - // If the given track type is not the same as the part's - // original track type, we can't continue. Just return. - if(!track || cpt->type() != track->type()) - { - xml.skip("part"); - return 0; - } - } - else - // ...else we want to paste to the part's original track. - { - // Make sure the track exists (has not been deleted). - if((cpt->isMidiTrack() && MusEGlobal::song->midis()->find(cpt) != MusEGlobal::song->midis()->end()) || - (cpt->type() == Track::WAVE && MusEGlobal::song->waves()->find(cpt) != MusEGlobal::song->waves()->end())) - track = cpt; - else - // Track was not found. Try pasting to the given track, as above... - { - if(!track || cpt->type() != track->type()) - { - // No luck. Just return. - xml.skip("part"); - return 0; - } - } - } - - // If it's a regular paste (not paste clone), and the original part is - // not a clone, defer so that a new copy is created in TagStart above. - //if(!doClone && i->cp->cevents()->arefCount() <= 1) - if(!doClone && !isclone) - break; - - // This makes a clone, chains the part, and increases ref counts. - npart = track->newPart((Part*)i->cp, true); - break; - } - } - */ } } else if(tag == "isclone") -- cgit v1.2.3