예제 #1
0
NxGroup::NxGroup(ApplicationCurrent *parent, QTreeWidgetItem *ccParentItem) :
    QObject(parent), QTreeWidgetItem(ccParentItem) {
    setText(0, tr("GROUP"));
    setSolo(0);
    setMute(0);
    scale = scaleDest = 1;
}
void SuperColliderLoopElement::guiEvent(ofxUIEventArgs &e) {
    if (e.getName() == "Play") {
        setPlaying(isPlay);
    }
    else if (e.getName() == "Rec") {
        setToRecord(toRecord);
    }
    else if (e.getName() == "Solo") {
        setSolo(solo);
        SuperColliderLoopElement *ref = this;
        ofNotifyEvent(soloEvent, ref);
    }
    else if (e.getName() == "Del") {
        SuperColliderLoopElement *ref = this;
        ofNotifyEvent(deleteEvent, ref);
    }
    else if (e.getName() == "Skip") {
        skip = pow((float) 2, (float) ((ofxUIRadio *) gui->getWidget("Skip"))->getValue());
        count = beat % (numBeats * getSkip());
    }
    else if (e.getName() == "BusIn") {
        int channel = ((ofxUIRadio *) gui->getWidget("BusIn"))->getValue();
        bufWriter->set("channel", channel);
    }
    else if (e.getName() == "Volume") {
        cout << "write vol " << volume << endl;
        bufReader->set("volume", volume);
    }
}