2009-06-25 07:16:22 -07:00
|
|
|
|
/*
|
|
|
|
|
* VsqCommand.cs
|
|
|
|
|
* Copyright (c) 2008-2009 kbinani
|
|
|
|
|
*
|
|
|
|
|
* This file is part of Boare.Lib.Vsq.
|
|
|
|
|
*
|
|
|
|
|
* Boare.Lib.Vsq is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the BSD License.
|
|
|
|
|
*
|
|
|
|
|
* Boare.VECapture is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
*/
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if JAVA
|
|
|
|
|
package org.kbinani.vsq;
|
|
|
|
|
|
|
|
|
|
import java.io.*;
|
|
|
|
|
import java.util.*;
|
|
|
|
|
import org.kbinani.*;
|
|
|
|
|
#else
|
2009-06-25 07:16:22 -07:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2009-09-07 03:44:18 -07:00
|
|
|
|
using bocoree;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
using bocoree.java.util;
|
2009-09-07 03:44:18 -07:00
|
|
|
|
|
2009-06-25 07:16:22 -07:00
|
|
|
|
namespace Boare.Lib.Vsq {
|
2009-09-07 03:44:18 -07:00
|
|
|
|
using boolean = System.Boolean;
|
|
|
|
|
using Integer = System.Int32;
|
|
|
|
|
using Long = System.Int64;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#endif
|
2009-09-07 03:44:18 -07:00
|
|
|
|
|
2009-06-25 07:16:22 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
/// </summary>
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if JAVA
|
|
|
|
|
public class VsqCommand implements Serializable {
|
|
|
|
|
#else
|
2009-06-25 07:16:22 -07:00
|
|
|
|
[Serializable]
|
|
|
|
|
public class VsqCommand {
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#endif
|
2009-06-25 07:16:22 -07:00
|
|
|
|
public VsqCommandType Type;
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// コマンドの処理内容を保持します。Args具体的な内容は、処理するクラスごとに異なります
|
|
|
|
|
/// </summary>
|
2010-03-16 20:14:08 -07:00
|
|
|
|
public Object[] Args;
|
2009-06-25 07:16:22 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 後続するコマンド
|
|
|
|
|
/// </summary>
|
2009-09-07 03:44:18 -07:00
|
|
|
|
public Vector<VsqCommand> Children = new Vector<VsqCommand>();
|
2009-06-25 07:16:22 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// このコマンドの親
|
|
|
|
|
/// </summary>
|
|
|
|
|
public VsqCommand Parent = null;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// VsqCommandはgenerateCommand*からコンストラクトしなければならない。
|
|
|
|
|
/// </summary>
|
2009-07-29 10:03:20 -07:00
|
|
|
|
public VsqCommand() {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandRoot() {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.ROOT;
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args = null;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandReplace( VsqFile vsq ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[1];
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.REPLACE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args[0] = (VsqFile)vsq.clone();
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandTrackReplace( int track, VsqTrack item ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.TRACK_REPLACE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args[1] = (VsqTrack)item.clone();
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandUpdateTimesig( int bar_count, int new_barcount, int numerator, int denominator ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.UPDATE_TIMESIG;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[4];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = bar_count;
|
|
|
|
|
command.Args[1] = numerator;
|
|
|
|
|
command.Args[2] = denominator;
|
|
|
|
|
command.Args[3] = new_barcount;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandUpdateTimesigRange( int[] bar_counts, int[] new_barcounts, int[] numerators, int[] denominators ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.UPDATE_TIMESIG_RANGE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[4];
|
|
|
|
|
command.Args[0] = copyIntArray( bar_counts );
|
|
|
|
|
command.Args[1] = copyIntArray( numerators );
|
|
|
|
|
command.Args[2] = copyIntArray( denominators );
|
|
|
|
|
command.Args[3] = copyIntArray( new_barcounts );
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandUpdateTempoRange( int[] clocks, int[] new_clocks, int[] tempos ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.UPDATE_TEMPO_RANGE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
|
|
|
|
command.Args[0] = copyIntArray( clocks );
|
|
|
|
|
command.Args[1] = copyIntArray( tempos );
|
|
|
|
|
command.Args[2] = copyIntArray( new_clocks );
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandUpdateTempo( int clock, int new_clock, int tempo ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.UPDATE_TEMPO;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = clock;
|
|
|
|
|
command.Args[1] = tempo;
|
|
|
|
|
command.Args[2] = new_clock;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandChangePreMeasure( int pre_measure ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.CHANGE_PRE_MEASURE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[1];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = pre_measure;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandDeleteTrack( int track ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.TRACK_DELETE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[1];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// トラックを追加するコマンドを発行します.trackはClone()して渡さなくてもよい
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandAddTrack( VsqTrack track, VsqMixerEntry mixer, int position ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.TRACK_ADD;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = mixer;
|
|
|
|
|
command.Args[2] = position;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// トラック名を変更するコマンドを作成します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="new_name"></param>
|
|
|
|
|
/// <returns></returns>
|
2009-09-07 03:44:18 -07:00
|
|
|
|
public static VsqCommand generateCommandTrackChangeName( int track, String new_name ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.TRACK_CHANGE_NAME;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = new_name;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
2009-07-29 10:03:20 -07:00
|
|
|
|
public static VsqCommand generateCommandTrackChangePlayMode( int track, int play_mode ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.TRACK_CHANGE_PLAY_MODE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
2009-07-29 10:03:20 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = play_mode;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-25 07:16:22 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// VsqIDとClockを同時に変更するコマンドを発行します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="internal_ids"></param>
|
|
|
|
|
/// <param name="clocks"></param>
|
|
|
|
|
/// <param name="values"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventChangeClockAndIDContaintsRange( int track, int[] internal_ids, int[] clocks, VsqID[] values ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_CLOCK_AND_ID_CONTAINTS_RANGE;
|
2009-06-25 07:16:22 -07:00
|
|
|
|
int count = internal_ids.Length;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[4];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args[1] = copyIntArray( internal_ids );
|
|
|
|
|
command.Args[2] = copyIntArray( clocks );
|
|
|
|
|
VsqID[] cp_values = new VsqID[values.Length];
|
|
|
|
|
for ( int i = 0; i < values.Length; i++ ) {
|
|
|
|
|
cp_values[i] = (VsqID)values[i].clone();
|
|
|
|
|
}
|
|
|
|
|
command.Args[3] = cp_values;
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// VsqIDとClockを同時に変更するコマンドを発行します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="internal_id"></param>
|
|
|
|
|
/// <param name="clock"></param>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventChangeClockAndIDContaints( int track, int internal_id, int clock, VsqID value ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_CLOCK_AND_ID_CONTAINTS;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[4];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = internal_id;
|
|
|
|
|
command.Args[2] = clock;
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Args[3] = (VsqID)value.clone();
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// VsqIDの内容を変更するコマンドを発行します。
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="internal_ids"></param>
|
|
|
|
|
/// <param name="values"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventChangeIDContaintsRange( int track, int[] internal_ids, VsqID[] values ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_ID_CONTAINTS_RANGE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args[1] = copyIntArray( internal_ids );
|
2009-06-25 07:16:22 -07:00
|
|
|
|
VsqID[] list = new VsqID[values.Length];
|
|
|
|
|
for ( int i = 0; i < values.Length; i++ ) {
|
2009-09-07 03:44:18 -07:00
|
|
|
|
list[i] = (VsqID)values[i].clone();
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
|
|
|
|
command.Args[2] = list;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// VsqIDの内容を変更するコマンドを発行します。
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="internal_id"></param>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventChangeIDContaints( int track, int internal_id, VsqID value ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_ID_CONTAINTS;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = internal_id;
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Args[2] = (VsqID)value.clone();
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ノートの長さを変更するコマンドを発行します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="internal_id"></param>
|
|
|
|
|
/// <param name="new_clock"></param>
|
|
|
|
|
/// <param name="new_length"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventChangeClockAndLength( int track, int internal_id, int new_clock, int new_length ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_CLOCK_AND_LENGTH;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[4];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = internal_id;
|
|
|
|
|
command.Args[2] = new_clock;
|
|
|
|
|
command.Args[3] = new_length;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ノートの長さを変更するコマンドを発行します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="internal_id"></param>
|
|
|
|
|
/// <param name="new_length"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventChangeLength( int track, int internal_id, int new_length ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_LENGTH;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = internal_id;
|
|
|
|
|
command.Args[2] = new_length;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 指定したトラックの,音符のベロシティ(VEL)を変更するコマンドを発行します.
|
|
|
|
|
/// リストvelocityには,音符を指定するInteralIDと,変更したいベロシティの値のペアを登録します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="velocity"></param>
|
|
|
|
|
/// <returns></returns>
|
2010-03-16 20:14:08 -07:00
|
|
|
|
public static VsqCommand generateCommandEventChangeVelocity( int track, Vector<ValuePair<Integer, Integer>> velocity ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_VELOCITY;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
Vector<ValuePair<Integer, Integer>> list = new Vector<ValuePair<Integer, Integer>>();
|
|
|
|
|
for ( Iterator itr = velocity.iterator(); itr.hasNext(); ) {
|
|
|
|
|
ValuePair<Integer, Integer> item = (ValuePair<Integer, Integer>)itr.next();
|
|
|
|
|
list.add( new ValuePair<Integer, Integer>( item.getKey(), item.getValue() ) );
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
|
|
|
|
command.Args[1] = list;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
2009-07-29 10:03:20 -07:00
|
|
|
|
public static VsqCommand generateCommandEventReplace( int track, VsqEvent item ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_REPLACE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
2009-07-29 10:03:20 -07:00
|
|
|
|
command.Args[0] = track;
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Args[1] = item.clone();
|
2009-07-29 10:03:20 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandEventReplaceRange( int track, VsqEvent[] items ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_REPLACE_RANGE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
2009-07-29 10:03:20 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
VsqEvent[] objs = new VsqEvent[items.Length];
|
2010-03-16 20:14:08 -07:00
|
|
|
|
for ( int i = 0; i < items.Length; i++ ) {
|
2009-09-07 03:44:18 -07:00
|
|
|
|
objs[i] = (VsqEvent)items[i].clone();
|
2009-07-29 10:03:20 -07:00
|
|
|
|
}
|
|
|
|
|
command.Args[1] = objs;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
2009-06-25 07:16:22 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// 指定したトラックの、音符のアクセント(Accent)を変更するコマンドを発行します。
|
|
|
|
|
/// リストaccent_listには、音符を指定するInternalIDと、変更したいアクセント値のペアを登録します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="accent_list"></param>
|
|
|
|
|
/// <returns></returns>
|
2010-03-16 20:14:08 -07:00
|
|
|
|
public static VsqCommand generateCommandEventChangeAccent( int track, Vector<ValuePair<Integer, Integer>> accent_list ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_ACCENT;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
Vector<ValuePair<Integer, Integer>> list = new Vector<ValuePair<Integer, Integer>>();
|
|
|
|
|
for ( Iterator itr = accent_list.iterator(); itr.hasNext(); ) {
|
|
|
|
|
ValuePair<Integer, Integer> item = (ValuePair<Integer, Integer>)itr.next();
|
|
|
|
|
list.add( new ValuePair<Integer, Integer>( item.getKey(), item.getValue() ) );
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
|
|
|
|
command.Args[1] = list;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 指定したトラックの、音符のディケイ(Decay)を変更するコマンドを発行します。
|
|
|
|
|
/// リストdecay_listには、音符を指定するInternalIDと、変更したいディケイ値のペアを登録します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="decay_list"></param>
|
|
|
|
|
/// <returns></returns>
|
2010-03-16 20:14:08 -07:00
|
|
|
|
public static VsqCommand generateCommandEventChangeDecay( int track, Vector<ValuePair<Integer, Integer>> decay_list ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_DECAY;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
Vector<ValuePair<Integer, Integer>> list = new Vector<ValuePair<Integer, Integer>>();
|
|
|
|
|
for ( Iterator itr = decay_list.iterator(); itr.hasNext(); ) {
|
|
|
|
|
ValuePair<Integer, Integer> item = (ValuePair<Integer, Integer>)itr.next();
|
|
|
|
|
list.add( new ValuePair<Integer, Integer>( item.getKey(), item.getValue() ) );
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
|
|
|
|
command.Args[1] = list;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
2009-09-07 03:44:18 -07:00
|
|
|
|
public static VsqCommand generateCommandTrackCurveReplaceRange( int track, String[] target_curve, VsqBPList[] bplist ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
|
|
|
|
command.Type = VsqCommandType.TRACK_CURVE_REPLACE_RANGE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
String[] arr = new String[target_curve.Length];
|
|
|
|
|
for ( int i = 0; i < target_curve.Length; i++ ) {
|
|
|
|
|
arr[i] = target_curve[i];
|
|
|
|
|
}
|
|
|
|
|
command.Args[1] = arr;
|
|
|
|
|
VsqBPList[] cp = new VsqBPList[bplist.Length];
|
|
|
|
|
for ( int i = 0; i < bplist.Length; i++ ) {
|
|
|
|
|
cp[i] = (VsqBPList)bplist[i].clone();
|
|
|
|
|
}
|
|
|
|
|
command.Args[2] = cp;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandTrackCurveReplace( int track, String target_curve, VsqBPList bplist ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
|
|
|
|
command.Type = VsqCommandType.TRACK_CURVE_REPLACE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = target_curve;
|
|
|
|
|
command.Args[2] = bplist.clone();
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*public static VsqCommand generateCommandTrackRemovePoints( int track, String target, Vector<Long> ids ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
|
|
|
|
command.Type = VsqCommandType.TRACK_CURVE_REMOVE_POINTS;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = target;
|
|
|
|
|
Vector<Long> cpy = new Vector<Long>();
|
|
|
|
|
if ( ids != null ){
|
|
|
|
|
int count = ids.size();
|
|
|
|
|
for ( int i = 0; i < count; i++ ) {
|
|
|
|
|
cpy.add( ids.get( i ) );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
command.Args[2] = cpy;
|
|
|
|
|
return command;
|
|
|
|
|
}*/
|
|
|
|
|
|
2009-06-25 07:16:22 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// vsqファイルのカーブを編集するコマンドを発行します.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="target"></param>
|
|
|
|
|
/// <param name="edit"></param>
|
|
|
|
|
/// <returns></returns>
|
2009-09-07 03:44:18 -07:00
|
|
|
|
public static VsqCommand generateCommandTrackCurveEdit( int track, String target, Vector<BPPair> edit ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.TRACK_CURVE_EDIT;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = target;
|
2009-09-07 03:44:18 -07:00
|
|
|
|
Vector<BPPair> copied = new Vector<BPPair>();
|
2010-03-16 20:14:08 -07:00
|
|
|
|
for ( Iterator itr = edit.iterator(); itr.hasNext(); ) {
|
2009-09-07 03:44:18 -07:00
|
|
|
|
BPPair item = (BPPair)itr.next();
|
|
|
|
|
copied.add( item );
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
|
|
|
|
command.Args[2] = copied;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// コントロールカーブを編集するコマンドを発行します.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track">編集対象のコントロールカーブが含まれるトラックの番号</param>
|
|
|
|
|
/// <param name="target">編集対象のコントロールカーブ名</param>
|
|
|
|
|
/// <param name="delete">削除を行うデータ点のリスト</param>
|
|
|
|
|
/// <param name="add_or_move">追加または移動を行うデータ点のリスト</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandTrackCurveEdit2( int track, String target, Vector<Long> delete, TreeMap<Integer, VsqBPPair> add ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
|
|
|
|
command.Type = VsqCommandType.TRACK_CURVE_EDIT2;
|
|
|
|
|
command.Args = new Object[4];
|
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = target;
|
|
|
|
|
Vector<Long> cp_delete = new Vector<Long>();
|
|
|
|
|
for ( Iterator itr = delete.iterator(); itr.hasNext(); ) {
|
|
|
|
|
long id = (Long)itr.next();
|
|
|
|
|
cp_delete.add( id );
|
|
|
|
|
}
|
|
|
|
|
command.Args[2] = cp_delete;
|
|
|
|
|
|
|
|
|
|
TreeMap<Integer, VsqBPPair> cp_add = new TreeMap<Integer, VsqBPPair>();
|
|
|
|
|
for ( Iterator itr = add.keySet().iterator(); itr.hasNext(); ) {
|
|
|
|
|
int clock = (Integer)itr.next();
|
|
|
|
|
VsqBPPair item = add.get( clock );
|
|
|
|
|
cp_add.put( clock, item );
|
|
|
|
|
}
|
|
|
|
|
command.Args[3] = cp_add;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandTrackCurveEditRange( int track, Vector<String> targets, Vector<Vector<BPPair>> edits ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.TRACK_CURVE_EDIT_RANGE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
Vector<String> cp_targets = new Vector<String>();
|
|
|
|
|
int count = targets.size();
|
|
|
|
|
for ( int i = 0; i < count; i++ ) {
|
|
|
|
|
cp_targets.add( targets.get( i ) );
|
|
|
|
|
}
|
|
|
|
|
command.Args[1] = cp_targets;
|
|
|
|
|
Vector<Vector<BPPair>> cp_edits = new Vector<Vector<BPPair>>();
|
|
|
|
|
count = edits.size();
|
|
|
|
|
for ( int i = 0; i < count; i++ ) {
|
2009-09-07 03:44:18 -07:00
|
|
|
|
Vector<BPPair> copied = new Vector<BPPair>();
|
2010-03-16 20:14:08 -07:00
|
|
|
|
for ( Iterator itr = edits.get( i ).iterator(); itr.hasNext(); ) {
|
2009-09-07 03:44:18 -07:00
|
|
|
|
BPPair item = (BPPair)itr.next();
|
|
|
|
|
copied.add( new BPPair( item.Clock, item.Value ) );
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
2010-03-16 20:14:08 -07:00
|
|
|
|
cp_edits.add( copied );
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args[2] = cp_edits;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// コントロールカーブを編集するコマンドを発行します.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track">編集対象のコントロールカーブが含まれるトラックの番号</param>
|
|
|
|
|
/// <param name="target">編集対象のコントロールカーブ名</param>
|
|
|
|
|
/// <param name="delete">削除を行うデータ点のリスト</param>
|
|
|
|
|
/// <param name="add_or_move">追加または移動を行うデータ点のリスト</param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandTrackCurveEdit2All( int track, Vector<String> target, Vector<Vector<Long>> delete, Vector<TreeMap<Integer, VsqBPPair>> add ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
|
|
|
|
command.Type = VsqCommandType.TRACK_CURVE_EDIT2_ALL;
|
|
|
|
|
command.Args = new Object[4];
|
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
Vector<String> cp_target = new Vector<String>();
|
|
|
|
|
int c = target.size();
|
|
|
|
|
for ( int i = 0; i < c; i++ ) {
|
|
|
|
|
cp_target.add( target.get( i ) );
|
|
|
|
|
}
|
|
|
|
|
command.Args[1] = cp_target;
|
|
|
|
|
|
|
|
|
|
Vector<Vector<Long>> cp_vec_delete = new Vector<Vector<Long>>();
|
|
|
|
|
c = delete.size();
|
|
|
|
|
for ( int i = 0; i < c; i++ ) {
|
|
|
|
|
Vector<Long> cp_delete = new Vector<Long>();
|
|
|
|
|
for ( Iterator itr = delete.get( i ).iterator(); itr.hasNext(); ) {
|
|
|
|
|
long id = (Long)itr.next();
|
|
|
|
|
cp_delete.add( id );
|
|
|
|
|
}
|
|
|
|
|
cp_vec_delete.add( cp_delete );
|
|
|
|
|
}
|
|
|
|
|
command.Args[2] = cp_vec_delete;
|
|
|
|
|
|
|
|
|
|
Vector<TreeMap<Integer, VsqBPPair>> cp_vec_add = new Vector<TreeMap<Integer, VsqBPPair>>();
|
|
|
|
|
c = add.size();
|
|
|
|
|
for ( int i = 0; i < c; i++ ) {
|
|
|
|
|
TreeMap<Integer, VsqBPPair> cp_add = new TreeMap<Integer, VsqBPPair>();
|
|
|
|
|
TreeMap<Integer, VsqBPPair> tmp = add.get( i );
|
|
|
|
|
for ( Iterator itr = tmp.keySet().iterator(); itr.hasNext(); ) {
|
|
|
|
|
int clock = (Integer)itr.next();
|
|
|
|
|
VsqBPPair item = tmp.get( clock );
|
|
|
|
|
cp_add.put( clock, item );
|
|
|
|
|
}
|
|
|
|
|
cp_vec_add.add( cp_add );
|
|
|
|
|
}
|
|
|
|
|
command.Args[3] = cp_vec_add;
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 特定位置のイベントの歌詞と発音記号を変更するコマンドを発行します。
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="internal_id"></param>
|
|
|
|
|
/// <param name="phrase"></param>
|
|
|
|
|
/// <param name="phonetic_symbol"></param>
|
|
|
|
|
/// <returns></returns>
|
2009-09-07 03:44:18 -07:00
|
|
|
|
public static VsqCommand generateCommandEventChangeLyric( int track, int internal_id, String phrase, String phonetic_symbol, boolean protect_symbol ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_LYRIC;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[5];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = internal_id;
|
|
|
|
|
command.Args[2] = phrase;
|
|
|
|
|
command.Args[3] = phonetic_symbol;
|
|
|
|
|
command.Args[4] = protect_symbol;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ノートのクロック位置を変更するコマンドを発行します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="internal_id"></param>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventChangeClock( int track, int internal_id, int value ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_CLOCK;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = internal_id;
|
|
|
|
|
command.Args[2] = value;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
public static VsqCommand generateCommandEventDeleteRange( int track, Vector<Integer> internal_ids ) {
|
2009-06-25 07:16:22 -07:00
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_DELETE_RANGE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = copyIntVector( internal_ids );
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ノートを削除するコマンドを発行します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="clock"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventDelete( int track, int internal_id ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_DELETE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = internal_id;
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static VsqCommand generateCommandEventAddRange( int track, VsqEvent[] items ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_ADD_RANGE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
VsqEvent[] cp_items = new VsqEvent[items.Length];
|
|
|
|
|
for ( int i = 0; i < items.Length; i++ ) {
|
|
|
|
|
cp_items[i] = (VsqEvent)items[i].clone();
|
|
|
|
|
}
|
|
|
|
|
command.Args[1] = cp_items;
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ノートを追加するコマンドを発行します。
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="item"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventAdd( int track, VsqEvent item ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_ADD;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[2];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Args[1] = (VsqEvent)item.clone();
|
2009-06-25 07:16:22 -07:00
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ノートの音程を変更するコマンドを発行します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="internal_id"></param>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventChangeNote( int track, int internal_id, int note ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_NOTE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[3];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = internal_id;
|
|
|
|
|
command.Args[2] = note;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// ノートの音程とクロックを変更するコマンドを発行します
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="track"></param>
|
|
|
|
|
/// <param name="internal_id"></param>
|
|
|
|
|
/// <param name="value"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public static VsqCommand generateCommandEventChangeClockAndNote( int track, int internal_id, int clock, int note ) {
|
|
|
|
|
VsqCommand command = new VsqCommand();
|
2009-09-07 03:44:18 -07:00
|
|
|
|
command.Type = VsqCommandType.EVENT_CHANGE_CLOCK_AND_NOTE;
|
2010-03-16 20:14:08 -07:00
|
|
|
|
command.Args = new Object[4];
|
2009-06-25 07:16:22 -07:00
|
|
|
|
command.Args[0] = track;
|
|
|
|
|
command.Args[1] = internal_id;
|
|
|
|
|
command.Args[2] = clock;
|
|
|
|
|
command.Args[3] = note;
|
|
|
|
|
return command;
|
|
|
|
|
}
|
2010-03-16 20:14:08 -07:00
|
|
|
|
|
|
|
|
|
private static int[] copyIntArray( int[] value ) {
|
|
|
|
|
int[] ret = new int[value.Length];
|
|
|
|
|
for ( int i = 0; i < value.Length; i++ ) {
|
|
|
|
|
ret[i] = value[i];
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static Vector<Integer> copyIntVector( Vector<Integer> value ) {
|
|
|
|
|
Vector<Integer> ret = new Vector<Integer>();
|
|
|
|
|
int count = value.size();
|
|
|
|
|
for ( int i = 0; i < count; i++ ) {
|
|
|
|
|
ret.add( value.get( i ) );
|
|
|
|
|
}
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
|
|
|
|
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#if !JAVA
|
2009-06-25 07:16:22 -07:00
|
|
|
|
}
|
2010-03-16 20:14:08 -07:00
|
|
|
|
#endif
|