Package info.textgrid.lab.noteeditor.mei2013

Examples of info.textgrid.lab.noteeditor.mei2013.MeiHead


      LogService.info(MusicMessages.Mei2FormsConverter_0);
    }
    // handle the mei body
    for (int mdivIter = 0; mdivIter < meiData.getMusic().getBody()
        .getMdivs().size(); mdivIter++) {
      final Mdiv mdiv = meiData.getMusic().getBody().getMdivs()
          .get(mdivIter);
      for (Object scoreDefOrSection : mdiv.getScore()
          .getGapsAndSbsAndCorrs()) {
        if (scoreDefOrSection instanceof Section) {
          rootDiagram.addChild(handleSection(
              (Section) scoreDefOrSection, rootDiagram));
        } else if (scoreDefOrSection instanceof ScoreDef) {
View Full Code Here


    Mdiv mdiv = new Mdiv();
    Score score = new Score();
    ScoreDef scoreDef = createScoreDef(stavesCount);
    score.getGapsAndSbsAndCorrs().add(scoreDef);
    Section section = new Section();
    Measure measureFirst = new Measure();
    Staff staffFirst = new Staff();
    Layer layerFirst = new Layer();
    staffFirst.getSbsAndSymbolsAndOrigs().add(layerFirst);
    measureFirst.getAnnotsAndSlursAndTupletSpen().add(staffFirst);
    for (int stavesIter = 1; stavesIter < stavesCount; stavesIter++) {
      Staff staff = new Staff();
      Layer layer = new Layer();
      staff.getSbsAndSymbolsAndOrigs().add(layer);
      measureFirst.getAnnotsAndSlursAndTupletSpen().add(staff);
    }
    section.getUnclearsAndSbsAndApps().add(measureFirst);

    for (int measureIter = 1; measureIter < measureCount; measureIter++) {
      Measure measure = new Measure();
      for (int stavesIter = 0; stavesIter < stavesCount; stavesIter++) {
        Staff staff = new Staff();
        Layer layer = new Layer();
        staff.getSbsAndSymbolsAndOrigs().add(layer);
        measure.getAnnotsAndSlursAndTupletSpen().add(staff);
      }
      section.getUnclearsAndSbsAndApps().add(measure);
    }
    score.getGapsAndSbsAndCorrs().add(section);
    mdiv.setScore(score);
View Full Code Here

  /**
   * create default measure
   */
  private void createDefaultMeasure() {
    setMeiNode(new Measure());
  }
View Full Code Here

            handleScoreChild(contentChildForm, saveAllVariants));
      }
      return contentNode;
    } else if (childForm instanceof MeasureForm) {
      MeasureForm measureForm = (MeasureForm) childForm;
      Measure measureNode = (Measure) measureForm.getMeiNode();
      measureNode.getAnnotsAndSlursAndTupletSpen().clear();
      for (BasicElement measureChildForm : measureForm.getChildren()) {
        measureNode.getAnnotsAndSlursAndTupletSpen().add(
            handleScoreChild(measureChildForm, saveAllVariants));
      }
      return measureNode;
    } else if (childForm instanceof StaffForm) {
      StaffForm contentForm = (StaffForm) childForm;
View Full Code Here

      public void run() throws Exception {
        saveProperties();
        progressMonitor.beginTask(MusicMessages.MeiseEditor_6, 2);
        final MusicDiagram shutDownDiagram = (MusicDiagram) getMusicDiagram()
            .clone();
        final Mei currentMeiData = MeiFromFormsConverter
            .createMeiFromFormsDiagram(shutDownDiagram, true);
        shutDownDiagram.tearDown();

        if (getEditorInput() instanceof IFileEditorInput) {
          final IFile iFile = ((IFileEditorInput) getEditorInput())
View Full Code Here

              monitor.setCanceled(true);
            }
          }
          monitor.subTask(MusicMessages.MeiseEditor_26);
          monitor.worked(2 + offset);
          Mei meiData = MeiResourceReader.parseMEIInstance(
              currentIFileInputStream, preValidationResult);
          monitor.subTask(MusicMessages.MeiseEditor_27);
          monitor.worked(4 + offset);
          if (!monitor.isCanceled()) {
            setMusicDiagram(Mei2FormsConverter
View Full Code Here

                setInputWithNotify(input);
                // doSave(monitor);
                final MusicDiagram shutDownDiagram = (MusicDiagram) getMusicDiagram()
                    .clone();
                shutDownDiagram.tearDown();
                Mei currentMeiData = MeiFromFormsConverter
                    .createMeiFromFormsDiagram(
                        shutDownDiagram,
                        saveAllVariants);
                if (null != currentMeiData) {
                  monitor.worked(1);
View Full Code Here

      Marshaller marshaller = jc.createMarshaller();
      marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
          Boolean.TRUE);
      ByteArrayOutputStream os = new ByteArrayOutputStream();
      // create the new inputstream
      marshaller.marshal(new Mei(), os);
      ByteArrayInputStream bais = new ByteArrayInputStream(
          os.toByteArray());
      return bais;
    } catch (JAXBException e) {
      LogService.error(MusicMessages.MeiResourceReader_4 + e.toString(),
View Full Code Here

  public static Mei parseMEIInstance(InputStream currentIFileInputStream,
      String preValidationResult) {
    if (preValidationResult.equals(StringConstants.STRING_NEWFILE)) {
      return MusicContainerFactory.createDefaultModel();
    } else {
      Mei root = null;
      Unmarshaller unmarshaller;
      try {
        unmarshaller = getJaxbContextInstance().createUnmarshaller();
        unmarshaller.setSchema(null);
        root = (Mei) unmarshaller.unmarshal(new InputSource(
View Full Code Here

   * creates a default mei tree
   *
   * @return
   */
  public static Mei createDefaultMeiTree(int stavesCount, int measureCount) {
    Mei mei = new Mei();
    MeiHead meiHead = new MeiHead();
    FileDesc fileDesc = new FileDesc();
    TitleStmt titleStmt = new TitleStmt();
    Title title = new Title();
    title.getContent().add("New MEI-2013 document");
    titleStmt.getTitles().add(title);
    fileDesc.setTitleStmt(titleStmt);
    PubStmt pubStmt = new PubStmt();
    fileDesc.setPubStmt(pubStmt);
    SourceDesc sourceDesc = new SourceDesc();
    Source source = new Source();
    sourceDesc.getSources().add(source);
    fileDesc.setSourceDesc(sourceDesc);   
    meiHead.setFileDesc(fileDesc)
    mei.setMeiHead(meiHead);
    Music music = new Music();
    Body body = new Body();
    Mdiv mdiv = new Mdiv();
    Score score = new Score();
    ScoreDef scoreDef = createScoreDef(stavesCount);
    score.getGapsAndSbsAndCorrs().add(scoreDef);
    Section section = new Section();
    Measure measureFirst = new Measure();
    Staff staffFirst = new Staff();
    Layer layerFirst = new Layer();
    staffFirst.getSbsAndSymbolsAndOrigs().add(layerFirst);
    measureFirst.getAnnotsAndSlursAndTupletSpen().add(staffFirst);
    for (int stavesIter = 1; stavesIter < stavesCount; stavesIter++) {
      Staff staff = new Staff();
      Layer layer = new Layer();
      staff.getSbsAndSymbolsAndOrigs().add(layer);
      measureFirst.getAnnotsAndSlursAndTupletSpen().add(staff);
    }
    section.getUnclearsAndSbsAndApps().add(measureFirst);

    for (int measureIter = 1; measureIter < measureCount; measureIter++) {
      Measure measure = new Measure();
      for (int stavesIter = 0; stavesIter < stavesCount; stavesIter++) {
        Staff staff = new Staff();
        Layer layer = new Layer();
        staff.getSbsAndSymbolsAndOrigs().add(layer);
        measure.getAnnotsAndSlursAndTupletSpen().add(staff);
      }
      section.getUnclearsAndSbsAndApps().add(measure);
    }
    score.getGapsAndSbsAndCorrs().add(section);
    mdiv.setScore(score);
    body.getMdivs().add(mdiv);
    music.setBody(body);
    mei.setMusic(music);
    mei.setId(DEFAULT_MEI_TREE);
    return mei;
  }
View Full Code Here

TOP

Related Classes of info.textgrid.lab.noteeditor.mei2013.MeiHead

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.