コード例 #1
0
ファイル: AddButton.java プロジェクト: DC37/Super-Mario-Paint
  @Override
  protected void reactPressed(MouseEvent event) {
    ProgramState curr = StateMachine.getState();
    if (curr != ProgramState.ARR_PLAYING) {
      if ((Settings.debug & 0b100000) != 0) System.out.println("Add song");

      if (theStaff.getSequenceFile() != null) {
        StateMachine.setArrModified(true);
        theStaff.getArrangementList().getItems().add(theStaff.getSequenceName());
        theStaff.getArrangement().add(theStaff.getSequence(), theStaff.getSequenceFile());
      }
    }
  }
コード例 #2
0
 /**
  * Sets the selected instrument to extend mode.
  *
  * @param i The instrument that we are trying to set to extend.
  */
 private void toggleNoteExtension(InstrumentIndex i) {
   boolean[] ext = StateMachine.getNoteExtensions();
   ext[i.getChannel() - 1] = !ext[i.getChannel() - 1];
   changePortrait(i.getChannel() - 1, ext[i.getChannel() - 1]);
   int ex = theStaff.getSequence().getNoteExtensions();
   ex ^= (1 << (i.getChannel() - 1));
   theStaff.getSequence().setNoteExtensions(ex);
 }
コード例 #3
0
 /** @param i The bitfield that we want to set the note extensions to. */
 public void setNoteExtension(int i) {
   boolean[] ext = StateMachine.getNoteExtensions();
   for (int j = 0; j < Values.NOTES_IN_A_LINE; j++) {
     if (!(ext[j] == ((i & (1 << j)) != 0))) {
       ext[j] = !ext[j];
       changePortrait(j, ext[j]);
     }
   }
 }