Esempio n. 1
0
void Att::GetMidi( Object *element, ArrayOfStrAttr *attributes ) {
    if (dynamic_cast<AttChannelized*>(element) ) {
        AttChannelized *att = dynamic_cast<AttChannelized*>(element);
        if (att->HasMidiChannel()) {
            attributes->push_back(std::make_pair("midiChannel", att->StrToStr(att->GetMidiChannel())));
        }
        if (att->HasMidiDuty()) {
            attributes->push_back(std::make_pair("midiDuty", att->StrToStr(att->GetMidiDuty())));
        }
        if (att->HasMidiPort()) {
            attributes->push_back(std::make_pair("midiPort", att->StrToStr(att->GetMidiPort())));
        }
        if (att->HasMidiTrack()) {
            attributes->push_back(std::make_pair("midiTrackInt", att->IntToStr(att->GetMidiTrack())));
        }
    }
    if (dynamic_cast<AttMidiinstrument*>(element) ) {
        AttMidiinstrument *att = dynamic_cast<AttMidiinstrument*>(element);
        if (att->HasMidiInstrnum()) {
            attributes->push_back(std::make_pair("midiInstrnum", att->StrToStr(att->GetMidiInstrnum())));
        }
        if (att->HasMidiInstrname()) {
            attributes->push_back(std::make_pair("midiInstrname", att->StrToStr(att->GetMidiInstrname())));
        }
        if (att->HasMidiPan()) {
            attributes->push_back(std::make_pair("midiPan", att->StrToStr(att->GetMidiPan())));
        }
        if (att->HasMidiVolume()) {
            attributes->push_back(std::make_pair("midiVolume", att->StrToStr(att->GetMidiVolume())));
        }
    }
    if (dynamic_cast<AttMidinumber*>(element) ) {
        AttMidinumber *att = dynamic_cast<AttMidinumber*>(element);
        if (att->HasNum()) {
            attributes->push_back(std::make_pair("numInt", att->IntToStr(att->GetNum())));
        }
    }
    if (dynamic_cast<AttMiditempo*>(element) ) {
        AttMiditempo *att = dynamic_cast<AttMiditempo*>(element);
        if (att->HasMidiTempo()) {
            attributes->push_back(std::make_pair("midiTempo", att->StrToStr(att->GetMidiTempo())));
        }
    }
    if (dynamic_cast<AttMidivalue*>(element) ) {
        AttMidivalue *att = dynamic_cast<AttMidivalue*>(element);
        if (att->HasVal()) {
            attributes->push_back(std::make_pair("val", att->StrToStr(att->GetVal())));
        }
    }
    if (dynamic_cast<AttTimebase*>(element) ) {
        AttTimebase *att = dynamic_cast<AttTimebase*>(element);
        if (att->HasPpq()) {
            attributes->push_back(std::make_pair("ppqInt", att->IntToStr(att->GetPpq())));
        }
    }

}
Esempio n. 2
0
void Att::GetMidi( Object *element, ArrayOfStrAttr *attributes ) {
    if (element->HasAttClass( ATT_CHANNELIZED ) ) {
        AttChannelized *att = dynamic_cast<AttChannelized*>(element);
        assert( att );
        if (att->HasMidiChannel()) {
            attributes->push_back(std::make_pair("midiChannel", att->StrToStr(att->GetMidiChannel())));
        }
        if (att->HasMidiDuty()) {
            attributes->push_back(std::make_pair("midiDuty", att->StrToStr(att->GetMidiDuty())));
        }
        if (att->HasMidiPort()) {
            attributes->push_back(std::make_pair("midiPort", att->StrToStr(att->GetMidiPort())));
        }
        if (att->HasMidiTrack()) {
            attributes->push_back(std::make_pair("midiTrackInt", att->IntToStr(att->GetMidiTrack())));
        }
    }
    if (element->HasAttClass( ATT_MIDIINSTRUMENT ) ) {
        AttMidiinstrument *att = dynamic_cast<AttMidiinstrument*>(element);
        assert( att );
        if (att->HasMidiInstrnum()) {
            attributes->push_back(std::make_pair("midiInstrnum", att->StrToStr(att->GetMidiInstrnum())));
        }
        if (att->HasMidiInstrname()) {
            attributes->push_back(std::make_pair("midiInstrname", att->StrToStr(att->GetMidiInstrname())));
        }
        if (att->HasMidiPan()) {
            attributes->push_back(std::make_pair("midiPan", att->StrToStr(att->GetMidiPan())));
        }
        if (att->HasMidiVolume()) {
            attributes->push_back(std::make_pair("midiVolume", att->StrToStr(att->GetMidiVolume())));
        }
    }
    if (element->HasAttClass( ATT_MIDINUMBER ) ) {
        AttMidinumber *att = dynamic_cast<AttMidinumber*>(element);
        assert( att );
        if (att->HasNum()) {
            attributes->push_back(std::make_pair("numInt", att->IntToStr(att->GetNum())));
        }
    }
    if (element->HasAttClass( ATT_MIDITEMPO ) ) {
        AttMiditempo *att = dynamic_cast<AttMiditempo*>(element);
        assert( att );
        if (att->HasMidiTempo()) {
            attributes->push_back(std::make_pair("midiTempo", att->StrToStr(att->GetMidiTempo())));
        }
    }
    if (element->HasAttClass( ATT_MIDIVALUE ) ) {
        AttMidivalue *att = dynamic_cast<AttMidivalue*>(element);
        assert( att );
        if (att->HasVal()) {
            attributes->push_back(std::make_pair("val", att->StrToStr(att->GetVal())));
        }
    }
    if (element->HasAttClass( ATT_TIMEBASE ) ) {
        AttTimebase *att = dynamic_cast<AttTimebase*>(element);
        assert( att );
        if (att->HasPpq()) {
            attributes->push_back(std::make_pair("ppqInt", att->IntToStr(att->GetPpq())));
        }
    }

}
Esempio n. 3
0
bool Att::SetMidi( Object *element, std::string attrType, std::string attrValue ) {
    if (dynamic_cast<AttChannelized*>(element) ) {
        AttChannelized *att = dynamic_cast<AttChannelized*>(element);
        if (attrType == "midiChannel") {
            att->SetMidiChannel(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiDuty") {
            att->SetMidiDuty(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiPort") {
            att->SetMidiPort(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiTrackInt") {
            att->SetMidiTrack(att->StrToInt(attrValue));
            return true;
        }
    }
    if (dynamic_cast<AttMidiinstrument*>(element) ) {
        AttMidiinstrument *att = dynamic_cast<AttMidiinstrument*>(element);
        if (attrType == "midiInstrnum") {
            att->SetMidiInstrnum(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiInstrname") {
            att->SetMidiInstrname(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiPan") {
            att->SetMidiPan(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiVolume") {
            att->SetMidiVolume(att->StrToStr(attrValue));
            return true;
        }
    }
    if (dynamic_cast<AttMidinumber*>(element) ) {
        AttMidinumber *att = dynamic_cast<AttMidinumber*>(element);
        if (attrType == "numInt") {
            att->SetNum(att->StrToInt(attrValue));
            return true;
        }
    }
    if (dynamic_cast<AttMiditempo*>(element) ) {
        AttMiditempo *att = dynamic_cast<AttMiditempo*>(element);
        if (attrType == "midiTempo") {
            att->SetMidiTempo(att->StrToStr(attrValue));
            return true;
        }
    }
    if (dynamic_cast<AttMidivalue*>(element) ) {
        AttMidivalue *att = dynamic_cast<AttMidivalue*>(element);
        if (attrType == "val") {
            att->SetVal(att->StrToStr(attrValue));
            return true;
        }
    }
    if (dynamic_cast<AttTimebase*>(element) ) {
        AttTimebase *att = dynamic_cast<AttTimebase*>(element);
        if (attrType == "ppqInt") {
            att->SetPpq(att->StrToInt(attrValue));
            return true;
        }
    }

    return false;
}
Esempio n. 4
0
bool Att::SetMidi( Object *element, std::string attrType, std::string attrValue ) {
    if (element->HasAttClass( ATT_CHANNELIZED ) ) {
        AttChannelized *att = dynamic_cast<AttChannelized*>(element);
        assert( att );
        if (attrType == "midiChannel") {
            att->SetMidiChannel(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiDuty") {
            att->SetMidiDuty(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiPort") {
            att->SetMidiPort(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiTrackInt") {
            att->SetMidiTrack(att->StrToInt(attrValue));
            return true;
        }
    }
    if (element->HasAttClass( ATT_MIDIINSTRUMENT ) ) {
        AttMidiinstrument *att = dynamic_cast<AttMidiinstrument*>(element);
        assert( att );
        if (attrType == "midiInstrnum") {
            att->SetMidiInstrnum(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiInstrname") {
            att->SetMidiInstrname(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiPan") {
            att->SetMidiPan(att->StrToStr(attrValue));
            return true;
        }
        if (attrType == "midiVolume") {
            att->SetMidiVolume(att->StrToStr(attrValue));
            return true;
        }
    }
    if (element->HasAttClass( ATT_MIDINUMBER ) ) {
        AttMidinumber *att = dynamic_cast<AttMidinumber*>(element);
        assert( att );
        if (attrType == "numInt") {
            att->SetNum(att->StrToInt(attrValue));
            return true;
        }
    }
    if (element->HasAttClass( ATT_MIDITEMPO ) ) {
        AttMiditempo *att = dynamic_cast<AttMiditempo*>(element);
        assert( att );
        if (attrType == "midiTempo") {
            att->SetMidiTempo(att->StrToStr(attrValue));
            return true;
        }
    }
    if (element->HasAttClass( ATT_MIDIVALUE ) ) {
        AttMidivalue *att = dynamic_cast<AttMidivalue*>(element);
        assert( att );
        if (attrType == "val") {
            att->SetVal(att->StrToStr(attrValue));
            return true;
        }
    }
    if (element->HasAttClass( ATT_TIMEBASE ) ) {
        AttTimebase *att = dynamic_cast<AttTimebase*>(element);
        assert( att );
        if (attrType == "ppqInt") {
            att->SetPpq(att->StrToInt(attrValue));
            return true;
        }
    }

    return false;
}