Search in sources :

Example 11 with Instrument

use of blue.orchestra.Instrument in project blue by kunstmusik.

the class UserInstrumentTreePopup method copyNode.

protected void copyNode() {
    if (userObj == instrGUI.iLibrary.getRoot()) {
        return;
    }
    Object bufferedObj;
    if (userObj instanceof Instrument) {
        bufferedObj = ((Instrument) userObj).deepCopy();
    } else {
        bufferedObj = new InstrumentCategory((InstrumentCategory) userObj);
    }
    CopyBuffer.setBufferedObject(CopyBuffer.INSTRUMENT, userObj);
}
Also used : Instrument(blue.orchestra.Instrument) InstrumentCategory(blue.orchestra.InstrumentCategory)

Example 12 with Instrument

use of blue.orchestra.Instrument in project blue by kunstmusik.

the class InstrumentTreeDragSource method dragGestureRecognized.

@Override
public void dragGestureRecognized(DragGestureEvent dge) {
    TreePath path = sourceTree.getSelectionPath();
    if ((path == null) || (path.getPathCount() <= 1)) {
        // We can't really move the root node (or an empty selection).
        return;
    }
    if (path.getLastPathComponent() instanceof Instrument || path.getLastPathComponent() instanceof InstrumentCategory) {
        oldNode = path.getLastPathComponent();
        Object cloneNode = null;
        if (oldNode instanceof Instrument) {
            cloneNode = ((Instrument) oldNode).deepCopy();
        } else if (oldNode instanceof InstrumentCategory) {
            cloneNode = new InstrumentCategory((InstrumentCategory) oldNode);
        }
        transferable = new TransferableInstrument(cloneNode);
        source.startDrag(dge, null, transferable, this);
        DragManager.setDragSource(sourceTree);
    }
}
Also used : TreePath(javax.swing.tree.TreePath) Instrument(blue.orchestra.Instrument) InstrumentCategory(blue.orchestra.InstrumentCategory)

Example 13 with Instrument

use of blue.orchestra.Instrument in project blue by kunstmusik.

the class UserInstrumentTreePopup method addInstrument.

private void addInstrument(Instrument instr) {
    Instrument newInstrument = (Instrument) instr.deepCopy();
    InstrumentCategory currentCategory = (InstrumentCategory) userObj;
    instrGUI.iLibrary.addInstrument(currentCategory, newInstrument);
/*
         * BlueUndoManager.setUndoManager("orchestra"); BlueUndoManager.addEdit(
         * new AddEdit(orchTableModel, clone, new Integer(iNum)));
         */
}
Also used : Instrument(blue.orchestra.Instrument) InstrumentCategory(blue.orchestra.InstrumentCategory)

Example 14 with Instrument

use of blue.orchestra.Instrument in project blue by kunstmusik.

the class UserInstrumentTreePopup method removeInstrument.

private void removeInstrument() {
    Instrument instrument = (Instrument) userObj;
    instrGUI.removeInstrument(instrument);
}
Also used : Instrument(blue.orchestra.Instrument)

Example 15 with Instrument

use of blue.orchestra.Instrument in project blue by kunstmusik.

the class ArrangementEditPanel method pasteInstrument.

public void pasteInstrument() {
    Object obj = CopyBuffer.getBufferedObject(CopyBuffer.INSTRUMENT);
    if (obj == null || !(obj instanceof Instrument)) {
        return;
    }
    Instrument instr = (Instrument) obj;
    Instrument clone = (Instrument) instr.deepCopy();
    if (clone instanceof BlueSynthBuilder) {
        ((BlueSynthBuilder) clone).clearParameters();
    }
    addInstrument(clone);
}
Also used : Instrument(blue.orchestra.Instrument) GenericInstrument(blue.orchestra.GenericInstrument) TransferableInstrument(blue.TransferableInstrument) BlueSynthBuilder(blue.orchestra.BlueSynthBuilder)

Aggregations

Instrument (blue.orchestra.Instrument)32 GenericInstrument (blue.orchestra.GenericInstrument)14 Arrangement (blue.Arrangement)6 BlueSynthBuilder (blue.orchestra.BlueSynthBuilder)5 InstrumentCategory (blue.orchestra.InstrumentCategory)5 StrBuilder (org.apache.commons.lang3.text.StrBuilder)5 TransferableInstrument (blue.TransferableInstrument)4 Automatable (blue.automation.Automatable)4 Channel (blue.mixer.Channel)4 ChannelList (blue.mixer.ChannelList)4 Mixer (blue.mixer.Mixer)4 Point (java.awt.Point)4 IOException (java.io.IOException)4 ArrayList (java.util.ArrayList)4 TreePath (javax.swing.tree.TreePath)4 InstrumentAssignment (blue.InstrumentAssignment)3 Parameter (blue.automation.Parameter)3 LinePoint (blue.components.lines.LinePoint)3 StringChannel (blue.orchestra.blueSynthBuilder.StringChannel)3 BlueData (blue.BlueData)2