Examples of Mei


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

      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

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

              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

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

                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

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

      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

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

  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

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

   * 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

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

   * @param meiData
   * @return
   */
  public static Mei createMeiFromFormsDiagram(MusicDiagram rootDiagram,
      boolean saveAllVariants) {
    Mei mei = rootDiagram.getMeiTree();
    handleSourceList(rootDiagram, mei);
    Score score = new Score();
    for (BasicElement child : rootDiagram.getChildren()) {
      score.getGapsAndSbsAndCorrs().add(
          handleScoreChild(child, saveAllVariants));
    }
    mei.getMusic().getBody().getMdivs().get(0).setScore(score);
    return mei;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.