MusicXMLSongExporter.java :  » Music » TuxGuitar-1.2 » org » herac » tuxguitar » io » musicxml » Java Open Source

Java Open Source » Music » TuxGuitar 1.2 
TuxGuitar 1.2 » org » herac » tuxguitar » io » musicxml » MusicXMLSongExporter.java
package org.herac.tuxguitar.io.musicxml;

import java.io.OutputStream;

import org.herac.tuxguitar.io.base.TGFileFormat;
import org.herac.tuxguitar.io.base.TGFileFormatException;
import org.herac.tuxguitar.io.base.TGLocalFileExporter;
import org.herac.tuxguitar.song.factory.TGFactory;
import org.herac.tuxguitar.song.models.TGSong;

public class MusicXMLSongExporter implements TGLocalFileExporter{
  
  private OutputStream stream;
  
  public String getExportName() {
    return "MusicXML";
  }
  
  public TGFileFormat getFileFormat() {
    return new TGFileFormat("MusicXML","*.xml");
  }
  
  public boolean configure(boolean setDefaults) {
    return true;
  }
  
  public void init(TGFactory factory,OutputStream stream){
    this.stream = stream;
  }
  
  public void exportSong(TGSong song) throws TGFileFormatException {
    if( this.stream != null ){
      new MusicXMLWriter(this.stream).writeSong(song);
    }
  }
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.