< prev index next >
src/java.desktop/share/classes/com/sun/media/sound/StandardMidiFileWriter.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 72,82 ****
private DataOutputStream tddos; // data output stream for track writing
/**
* MIDI parser types.
*/
! private static final int types[] = {
MIDI_TYPE_0,
MIDI_TYPE_1
};
@Override
--- 72,82 ----
private DataOutputStream tddos; // data output stream for track writing
/**
* MIDI parser types.
*/
! private static final int[] types = {
MIDI_TYPE_0,
MIDI_TYPE_1
};
@Override
*** 94,105 ****
* @return array of file types. If no file types are supported,
* returns an array of length 0.
*/
@Override
public int[] getMidiFileTypes(Sequence sequence){
! int typesArray[];
! Track tracks[] = sequence.getTracks();
if( tracks.length==1 ) {
typesArray = new int[2];
typesArray[0] = MIDI_TYPE_0;
typesArray[1] = MIDI_TYPE_1;
--- 94,105 ----
* @return array of file types. If no file types are supported,
* returns an array of length 0.
*/
@Override
public int[] getMidiFileTypes(Sequence sequence){
! int[] typesArray;
! Track[] tracks = sequence.getTracks();
if( tracks.length==1 ) {
typesArray = new int[2];
typesArray[0] = MIDI_TYPE_0;
typesArray[1] = MIDI_TYPE_1;
*** 147,168 ****
}
//=================================================================================
private InputStream getFileStream(int type, Sequence sequence) throws IOException {
! Track tracks[] = sequence.getTracks();
int bytesBuilt = 0;
int headerLength = 14;
int length = 0;
int timeFormat;
float divtype;
PipedOutputStream hpos = null;
DataOutputStream hdos = null;
PipedInputStream headerStream = null;
! InputStream trackStreams [] = null;
InputStream trackStream = null;
InputStream fStream = null;
// Determine the filetype to write
if( type==MIDI_TYPE_0 ) {
--- 147,168 ----
}
//=================================================================================
private InputStream getFileStream(int type, Sequence sequence) throws IOException {
! Track[] tracks = sequence.getTracks();
int bytesBuilt = 0;
int headerLength = 14;
int length = 0;
int timeFormat;
float divtype;
PipedOutputStream hpos = null;
DataOutputStream hdos = null;
PipedInputStream headerStream = null;
! InputStream[] trackStreams = null;
InputStream trackStream = null;
InputStream fStream = null;
// Determine the filetype to write
if( type==MIDI_TYPE_0 ) {
*** 342,352 ****
int status;
int eventtype;
int metatype;
int data1, data2;
int length;
! byte data[] = null;
ShortMessage shortMessage = null;
MetaMessage metaMessage = null;
SysexMessage sysexMessage = null;
// get the tick
--- 342,352 ----
int status;
int eventtype;
int metatype;
int data1, data2;
int length;
! byte[] data = null;
ShortMessage shortMessage = null;
MetaMessage metaMessage = null;
SysexMessage sysexMessage = null;
// get the tick
< prev index next >