Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 6952215707
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 703 lines (652 sloc) 26.878 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702
//=============================================================================
// MuseScore
// Music Composition & Notation
// $Id:$
//
// Copyright (C) 2002-2011 Werner Schweer
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENCE.GPL
//=============================================================================

#include "libmscore/score.h"
#include "libmscore/element.h"
#include "libmscore/note.h"
#include "libmscore/rest.h"
#include "libmscore/measure.h"
#include "libmscore/system.h"
#include "libmscore/segment.h"
#include "libmscore/page.h"
#include "libmscore/image.h"
#include "libmscore/text.h"
#include "libmscore/spanner.h"
#include "libmscore/chord.h"
#include "libmscore/icon.h"
#include "musescore.h"
#include "scoreview.h"

//---------------------------------------------------------
// moveElement
//---------------------------------------------------------

static void moveElement(void* data, Element* e)
      {
      QPointF* pos = (QPointF*)data;
      e->score()->addRefresh(e->canvasBoundingRect());
      e->setPos(*pos);
      e->score()->addRefresh(e->canvasBoundingRect());
      }

//---------------------------------------------------------
// setViewRect
//---------------------------------------------------------

void ScoreView::setViewRect(const QRectF& r)
      {
      QRectF rr = _matrix.mapRect(r);
      QPoint d = rr.topLeft().toPoint();
      int dx = -d.x();
      int dy = -d.y();
      QApplication::sendPostedEvents(this, 0);
      _matrix.setMatrix(_matrix.m11(), _matrix.m12(), _matrix.m13(), _matrix.m21(),
         _matrix.m22(), _matrix.m23(), _matrix.dx()+dx, _matrix.dy()+dy, _matrix.m33());
      imatrix = _matrix.inverted();
      scroll(dx, dy, QRect(0, 0, width(), height()));
      emit offsetChanged(_matrix.dx(), _matrix.dy());
      }

//---------------------------------------------------------
// dragTimeAnchorElement
// pos is in canvas coordinates
//---------------------------------------------------------

bool ScoreView::dragTimeAnchorElement(const QPointF& pos)
      {
      int staffIdx;
      Segment* seg;
      MeasureBase* mb = _score->pos2measure(pos, &staffIdx, 0, &seg, 0);
      if (mb && mb->type() == Element::MEASURE) {
            Measure* m = static_cast<Measure*>(mb);
            System* s = m->system();
            qreal y = s->staff(staffIdx)->y() + s->pos().y() + s->page()->pos().y();
            QPointF anchor(seg->canvasBoundingRect().x(), y);
            setDropAnchor(QLineF(pos, anchor));
            dragElement->setTrack(staffIdx * VOICES);
            return true;
            }
      setDropTarget(0);
      return false;
      }

//---------------------------------------------------------
// dragMeasureAnchorElement
//---------------------------------------------------------

bool ScoreView::dragMeasureAnchorElement(const QPointF& pos)
      {
      Measure* m = _score->searchMeasure(pos);
      if (m) {
            QRectF b(m->canvasBoundingRect());

            QPointF anchor;
            if (pos.x() < (b.x() + b.width() * .5))
                  anchor = m->canvasBoundingRect().topLeft();
            else
                  anchor = m->canvasBoundingRect().topRight();
            setDropAnchor(QLineF(pos, anchor));
            return true;
            }
      setDropTarget(0);
      return false;
      }

//---------------------------------------------------------
// dragEnterEvent
//---------------------------------------------------------

void ScoreView::dragEnterEvent(QDragEnterEvent* event)
      {
      if (MScore::debugMode)
            qDebug("dragEnterEvent");
      double _spatium = score()->spatium();
      dragElement = 0;

      const QMimeData* data = event->mimeData();

      if (data->hasFormat(mimeSymbolListFormat)
         || data->hasFormat(mimeStaffListFormat)) {
            event->acceptProposedAction();
            return;
            }

      if (data->hasFormat(mimeSymbolFormat)) {
            event->acceptProposedAction();

            QByteArray a = data->data(mimeSymbolFormat);

            if (MScore::debugMode)
                  qDebug("ScoreView::dragEnterEvent Symbol: <%s>", a.data());

            QDomDocument doc;
            int line, column;
            QString err;
            if (!doc.setContent(a, &err, &line, &column)) {
                  qDebug("error reading drag data at %d/%d: %s\n<%s>",
                     line, column, err.toLatin1().data(), a.data());
                  return;
                  }
            docName = "--";
            QDomElement e = doc.documentElement();

            dragOffset = QPoint();
            Fraction duration; // dummy
            Element::ElementType type = Element::readType(e, &dragOffset, &duration);

            Element* el = 0;
            if (type == Element::IMAGE) {
                  // look ahead for image type
                  QString path;
                  for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
                        QString tag(ee.tagName());
                        if (tag == "path") {
                              path = ee.text();
                              break;
                              }
                        }
                  Image* image = 0;
                  QString lp(path.toLower());

                  if (lp.endsWith(".svg"))
                        image = new SvgImage(score());
                  else
                        if (lp.endsWith(".jpg")
                     || lp.endsWith(".png")
                     || lp.endsWith(".gif")
                     || lp.endsWith(".xpm")
                        )
                        image = new RasterImage(score());
                  else {
                        qDebug("unknown image format <%s>", path.toLatin1().data());
                        }
                  el = image;
                  }
            else {
                  el = Element::create(type, score());
                  if (el) {
                        if (type == Element::BAR_LINE || type == Element::ARPEGGIO || type == Element::BRACKET)
                              el->setHeight(_spatium * 5);
                        else if (el->isText()) {
#if 0
Text* text = static_cast<Text*>(el);
// QString sname = text->styleName();
// if (!text->styled() && !sname.isEmpty()) { // TODO
if (!text->styled()) {
// check if we can transform text into styled text
MStyle* s = score()->style();
TextStyleType st = s->textStyleType(sname);
if (st != TEXT_STYLE_INVALID)
text->setTextStyle(st);
}
#endif
                              }
                        }
                  }
            if (el) {
                  dragElement = el;
                  dragElement->setParent(0);
                  dragElement->read(e);
                  dragElement->layout();
                  }
            return;
            }

      if (data->hasUrls()) {
            QList<QUrl>ul = data->urls();
            foreach(const QUrl& u, ul) {
                  if (MScore::debugMode)
                        qDebug("drag Url: %s", qPrintable(u.toString()));
                  if (u.scheme() == "file") {
                        QFileInfo fi(u.path());
                        QString suffix = fi.suffix().toLower();
                        if (suffix == "svg"
                           || suffix == "jpg"
                           || suffix == "png"
                           || suffix == "gif"
                           || suffix == "xpm"
                           ) {
                              event->acceptProposedAction();
                              break;
                              }
                        }
                  }
            return;
            }
      QStringList formats = data->formats();
      qDebug("unknown drop format: formats:");
      foreach(const QString& s, formats)
            qDebug(" <%s>", qPrintable(s));
      }

//---------------------------------------------------------
// dragSymbol
// drag SYMBOL and IMAGE elements
//---------------------------------------------------------

void ScoreView::dragSymbol(const QPointF& pos)
      {
      const QList<const Element*> el = elementsAt(pos);
      const Element* e = el.isEmpty() ? 0 : el[0];
      if (e && (e->type() == Element::NOTE || e->type() == Element::SYMBOL || e->type() == Element::IMAGE)) {
            if (e->acceptDrop(this, pos, dragElement)) {
                  setDropTarget(e);
                  return;
                  }
            else {
                  setDropTarget(0);
                  return;
                  }
            }
      dragTimeAnchorElement(pos);
      }

//---------------------------------------------------------
// dragMoveEvent
//---------------------------------------------------------

void ScoreView::dragMoveEvent(QDragMoveEvent* event)
      {
      // we always accept the drop action
      // to get a "drop" Event:

      event->acceptProposedAction();
      if (mscore->state() == STATE_PLAY) // no editing during play
            return;

      // convert window to canvas position
      QPointF pos(imatrix.map(QPointF(event->pos())));

      if (dragElement) {
            switch(dragElement->type()) {
                  case Element::VOLTA:
                        dragMeasureAnchorElement(pos);
                        break;
                  case Element::PEDAL:
                  case Element::DYNAMIC:
                  case Element::OTTAVA:
                  case Element::TRILL:
                  case Element::HAIRPIN:
                  case Element::TEXTLINE:
                  case Element::FRET_DIAGRAM:
                        dragTimeAnchorElement(pos);
                        break;
                  case Element::IMAGE:
                  case Element::SYMBOL:
                        dragSymbol(pos);
                        break;
                  case Element::KEYSIG:
                  case Element::CLEF:
                  case Element::TIMESIG:
                  case Element::BAR_LINE:
                  case Element::ARPEGGIO:
                  case Element::BREATH:
                  case Element::GLISSANDO:
                  case Element::Element::BRACKET:
                  case Element::ARTICULATION:
                  case Element::CHORDLINE:
                  case Element::BEND:
                  case Element::ACCIDENTAL:
                  case Element::TEXT:
                  case Element::FINGERING:
                  case Element::TEMPO_TEXT:
                  case Element::STAFF_TEXT:
                  case Element::NOTEHEAD:
                  case Element::TREMOLO:
                  case Element::LAYOUT_BREAK:
                  case Element::MARKER:
                  case Element::STAFF_STATE:
                  case Element::INSTRUMENT_CHANGE:
                  case Element::REHEARSAL_MARK:
                  case Element::JUMP:
                  case Element::REPEAT_MEASURE:
                  case Element::ICON:
                  case Element::CHORD:
                  case Element::SPACER:
                  case Element::SLUR:
                  case Element::ACCIDENTAL_BRACKET:
                  case Element::HARMONY:
                        {
                        QList<const Element*> el = elementsAt(pos);
                        bool found = false;
                        foreach(const Element* e, el) {
                              if (e->acceptDrop(this, pos, dragElement)) {
                                    if (e->type() != Element::MEASURE)
                                          setDropTarget(const_cast<Element*>(e));
                                    found = true;
                                    break;
                                    }
                              }
                        if (!found)
                              setDropTarget(0);
                        }
                        break;
                  default:
                        break;
                  }

            dragElement->scanElements(&pos, moveElement, false);
            _score->end();
            return;
            }

      if (event->mimeData()->hasUrls()) {
            QList<QUrl>ul = event->mimeData()->urls();
            QUrl u = ul.front();
            if (u.scheme() == "file") {
                  QFileInfo fi(u.path());
                  QString suffix(fi.suffix().toLower());
                  if (suffix != "svg"
                     && suffix != "jpg"
                     && suffix != "png"
                     && suffix != "gif"
                     && suffix != "xpm"
                     )
                        return;
                  //
                  // special drop target Note
                  //
                  Element* el = elementAt(pos);
                  if (el && (el->type() == Element::NOTE || el->type() == Element::REST))
                        setDropTarget(el);
                  else
                        setDropTarget(0);
                  }
            _score->end();
            return;
            }
      const QMimeData* md = event->mimeData();
      QByteArray data;
      int etype;
      if (md->hasFormat(mimeSymbolListFormat)) {
            etype = Element::ELEMENT_LIST;
            data = md->data(mimeSymbolListFormat);
            }
      else if (md->hasFormat(mimeStaffListFormat)) {
            etype = Element::STAFF_LIST;
            data = md->data(mimeStaffListFormat);
            }
      else {
            _score->end();
            return;
            }
      Element* el = elementAt(pos);
      if (el == 0 || el->type() != Element::MEASURE) {
            _score->end();
            return;
            }
      else if (etype == Element::ELEMENT_LIST) {
            qDebug("accept drop element list");
            }
      else if (etype == Element::STAFF_LIST || etype == Element::MEASURE_LIST) {
//TODO el->acceptDrop(this, pos, etype, e);
            }
      _score->end();
      }

//---------------------------------------------------------
// dropEvent
//---------------------------------------------------------

void ScoreView::dropEvent(QDropEvent* event)
      {
      QPointF pos(imatrix.map(QPointF(event->pos())));

      DropData dropData;
      dropData.view = this;
      dropData.pos = pos;
      dropData.dragOffset = dragOffset;
      dropData.element = dragElement;
      dropData.modifiers = event->keyboardModifiers();

      if (dragElement) {
            _score->startCmd();
            dragElement->setScore(_score); // CHECK: should already be ok
            _score->addRefresh(dragElement->canvasBoundingRect());
            switch(dragElement->type()) {
                  case Element::VOLTA:
                  case Element::OTTAVA:
                  case Element::TRILL:
                  case Element::PEDAL:
                  case Element::HAIRPIN:
                  case Element::TEXTLINE:
                        {
                        dragElement->setScore(score());
                        Spanner* spanner = static_cast<Spanner*>(dragElement);
                        score()->cmdAddSpanner(spanner, pos, dragOffset);
                        event->acceptProposedAction();
                        }
                        break;
                  case Element::SYMBOL:
                  case Element::IMAGE:
                  case Element::DYNAMIC:
                  case Element::FRET_DIAGRAM:
                  case Element::HARMONY:
                        {
                        Element* el = elementAt(pos);
                        if (el == 0) {
                              int staffIdx;
                              Segment* seg;
                              el = _score->pos2measure(pos, &staffIdx, 0, &seg, 0);
                              if (el == 0) {
                                    qDebug("cannot drop here");
                                    delete dragElement;
                                    break;
                                    }
                             }
                        _score->addRefresh(el->canvasBoundingRect());
                        _score->addRefresh(dragElement->canvasBoundingRect());

                        Element* dropElement = el->drop(dropData);
                        _score->addRefresh(el->canvasBoundingRect());
                        if (dropElement) {
                              _score->select(dropElement, SELECT_SINGLE, 0);
                              _score->addRefresh(dropElement->canvasBoundingRect());
                              }
                        }
                        event->acceptProposedAction();
                        break;
                  case Element::KEYSIG:
                  case Element::CLEF:
                  case Element::TIMESIG:
                  case Element::BAR_LINE:
                  case Element::ARPEGGIO:
                  case Element::BREATH:
                  case Element::GLISSANDO:
                  case Element::BRACKET:
                  case Element::ARTICULATION:
                  case Element::CHORDLINE:
                  case Element::BEND:
                  case Element::ACCIDENTAL:
                  case Element::TEXT:
                  case Element::FINGERING:
                  case Element::TEMPO_TEXT:
                  case Element::STAFF_TEXT:
                  case Element::NOTEHEAD:
                  case Element::TREMOLO:
                  case Element::LAYOUT_BREAK:
                  case Element::MARKER:
                  case Element::STAFF_STATE:
                  case Element::INSTRUMENT_CHANGE:
                  case Element::REHEARSAL_MARK:
                  case Element::JUMP:
                  case Element::REPEAT_MEASURE:
                  case Element::ICON:
                  case Element::NOTE:
                  case Element::CHORD:
                  case Element::SPACER:
                  case Element::SLUR:
                  case Element::ACCIDENTAL_BRACKET:
                        {
                        Element* el = 0;
                        foreach(const Element* e, elementsAt(pos)) {
                              if (e->acceptDrop(this, pos, dragElement)) {
                                    el = const_cast<Element*>(e);
                                    break;
                                    }
                              }
                        if (!el) {
                              if (!dropCanvas(dragElement)) {
                                    qDebug("cannot drop element to canvas");
                                    delete dragElement;
                                    dragElement = 0;
                                    }
                              break;
                              }
                        _score->addRefresh(el->canvasBoundingRect());
                        Element* dropElement = el->drop(dropData);
                        _score->addRefresh(el->canvasBoundingRect());
                        if (dropElement) {
                              if (!_score->noteEntryMode())
                                    _score->select(dropElement, SELECT_SINGLE, 0);
                              _score->addRefresh(dropElement->canvasBoundingRect());

#if 0
                              Qt::KeyboardModifiers keyState = event->keyboardModifiers();
                              if (keyState == (Qt::ShiftModifier | Qt::ControlModifier)) {
                                    //
                                    // continue drag with a cloned element
                                    //
//?? CloneEvent* ce = new CloneEvent(dropElement);
// QCoreApplication::postEvent(this, ce);
                                    }
#endif
                              }
                        event->acceptProposedAction();
                        }
                        break;
                  default:
                        delete dragElement;
                        break;
                  }
            dragElement = 0;
            setDropTarget(0); // this also resets dropRectangle and dropAnchor
            score()->endCmd();
            mscore->endCmd();
            return;
            }

      if (event->mimeData()->hasUrls()) {
            QList<QUrl>ul = event->mimeData()->urls();
            QUrl u = ul.front();
            if (u.scheme() == "file") {
                  QFileInfo fi(u.path());
                  Image* s = 0;
                  QString suffix = fi.suffix().toLower();
                  if (suffix == "svg")
                        s = new SvgImage(score());
                  else if (suffix == "jpg"
                     || suffix == "png"
                     || suffix == "gif"
                     || suffix == "xpm"
                     )
                        s = new RasterImage(score());
                  else {
                        if (MScore::debugMode)
                              qDebug("drop: unknown suffix %s\n", qPrintable(suffix));
                        return;
                        }
                  _score->startCmd();
                  QString str(u.toLocalFile());
                  s->load(str);
if (MScore::debugMode)
      qDebug("drop image <%s> <%s>", qPrintable(str), qPrintable(str));

                  Element* el = elementAt(pos);
                  if (el && (el->type() == Element::NOTE || el->type() == Element::REST)) {
                        s->setTrack(el->track());
                        if (el->type() == Element::NOTE) {
                              Note* note = (Note*)el;
                              // s->setTick(note->chord()->tick());
                              s->setParent(note->chord()->segment()->measure());
                              }
                        else {
                              Rest* rest = (Rest*)el;
                              // s->setTick(rest->tick());
                              s->setParent(rest->segment()->measure());
                              }
                        score()->undoAddElement(s);
                        }
                  else
                        score()->cmdAddBSymbol(s, pos, dragOffset);

                  event->acceptProposedAction();
                  score()->endCmd();
                  mscore->endCmd();
                  setDropTarget(0); // this also resets dropRectangle and dropAnchor
                  return;
                  }
            return;
            }

      dragElement = 0;
      const QMimeData* md = event->mimeData();
      QByteArray data;
      int etype;
      if (md->hasFormat(mimeSymbolListFormat)) {
            etype = Element::ELEMENT_LIST;
            data = md->data(mimeSymbolListFormat);
            }
      else if (md->hasFormat(mimeStaffListFormat)) {
            etype = Element::STAFF_LIST;
            data = md->data(mimeStaffListFormat);
            }
      else {
            qDebug("cannot drop this object: unknown mime type");
            QStringList sl = md->formats();
            foreach(QString s, sl)
                  qDebug(" %s", qPrintable(s));
            _score->end();
            return;
            }

// qDebug("drop <%s>", data.data());

      QDomDocument doc;
      int line, column;
      QString err;
      if (!doc.setContent(data, &err, &line, &column)) {
            qWarning("error reading drag data at %d/%d: %s\n %s\n",
               line, column, qPrintable(err), data.data());
            return;
            }
      docName = "--";
      Element* el = elementAt(pos);
      if (el == 0 || el->type() != Element::MEASURE) {
            setDropTarget(0);
            return;
            }
      Measure* measure = (Measure*) el;

      if (etype == Element::ELEMENT_LIST) {
            qDebug("drop element list");
            }
      else if (etype == Element::MEASURE_LIST || etype == Element::STAFF_LIST) {
            _score->startCmd();
            System* s = measure->system();
            int idx = s->y2staff(pos.y());
            if (idx != -1) {
                  Segment* seg = measure->first();
                  // assume there is always a ChordRest segment
                  while (seg->subtype() != Segment::SegChordRest)
                        seg = seg->next();
                  score()->pasteStaff(doc.documentElement(), (ChordRest*)(seg->element(idx * VOICES)));
                  }
            event->acceptProposedAction();
            _score->setLayoutAll(true);
            _score->endCmd();
            mscore->endCmd();
            }
      setDropTarget(0); // this also resets dropRectangle and dropAnchor
      }

//---------------------------------------------------------
// dragLeaveEvent
//---------------------------------------------------------

void ScoreView::dragLeaveEvent(QDragLeaveEvent*)
      {
      if (dragElement) {
            _score->setLayoutAll(false);
// _score->addRefresh(dragElement->canvasBoundingRect());
            _score->setUpdateAll(true);
            delete dragElement;
            dragElement = 0;
            _score->end();
            }
      setDropTarget(0);
      }

//---------------------------------------------------------
// dropCanvas
//---------------------------------------------------------

bool ScoreView::dropCanvas(Element* e)
      {
      if (e->type() == Element::ICON) {
            switch(static_cast<Icon*>(e)->subtype()) {
                  case ICON_VFRAME:
                        score()->insertMeasure(Element::VBOX, 0);
                        break;
                  case ICON_HFRAME:
                        score()->insertMeasure(Element::HBOX, 0);
                        break;
                  case ICON_TFRAME:
                        score()->insertMeasure(Element::TBOX, 0);
                        break;
                  case ICON_FFRAME:
                        score()->insertMeasure(Element::FBOX, 0);
                        break;
                  case ICON_MEASURE:
                        score()->insertMeasure(Element::MEASURE, 0);
                        break;
                  default:
                        return false;
                  }
            delete e;
            return true;
            }
      return false;
      }


Something went wrong with that request. Please try again.