Subversion Repositories svn.mios32

Rev

Rev 1542 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1542 Rev 1724
Line 406... Line 406...
406
406
407
//==============================================================================
407
//==============================================================================
408
void MbhpMfToolCalibrationTable::resized()
408
void MbhpMfToolCalibrationTable::resized()
409
{
409
{
410
    // position our table with a gap around its edge
410
    // position our table with a gap around its edge
411
    table->setBoundsInset(BorderSize(8));
411
    table->setBoundsInset(BorderSize<int>(8));
412
}
412
}
413
413
414
414
415
//==============================================================================
415
//==============================================================================
416
int MbhpMfToolCalibrationTable::getTableValue(const int rowNumber, const int columnId)
416
int MbhpMfToolCalibrationTable::getTableValue(const int rowNumber, const int columnId)
Line 1005... Line 1005...
1005
    sendButton->addListener(this);
1005
    sendButton->addListener(this);
1006
1006
1007
    addAndMakeVisible(progressBar = new ProgressBar(progress));
1007
    addAndMakeVisible(progressBar = new ProgressBar(progress));
1008
1008
1009
    // restore settings
1009
    // restore settings
1010
    PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
1010
    PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
1011
    if( propertiesFile ) {
1011
    if( propertiesFile ) {
1012
        deviceIdSlider->setValue(propertiesFile->getIntValue(T("mbhpMfDeviceId"), 0) & 0x7f);
1012
        deviceIdSlider->setValue(propertiesFile->getIntValue(T("mbhpMfDeviceId"), 0) & 0x7f);
1013
        patchSlider->setValue(propertiesFile->getIntValue(T("mbhpMfPatch"), 0) & 0x7f);
1013
        patchSlider->setValue(propertiesFile->getIntValue(T("mbhpMfPatch"), 0) & 0x7f);
1014
        String syxFileName(propertiesFile->getValue(T("mbhpMfSyxFile"), String::empty));
1014
        String syxFileName(propertiesFile->getValue(T("mbhpMfSyxFile"), String::empty));
1015
        if( syxFileName != String::empty )
1015
        if( syxFileName != String::empty )
Line 1070... Line 1070...
1070
                       T("*.syx"));
1070
                       T("*.syx"));
1071
1071
1072
        if( fc.browseForFileToOpen() ) {
1072
        if( fc.browseForFileToOpen() ) {
1073
            syxFile = fc.getResult();
1073
            syxFile = fc.getResult();
1074
            if( loadSyx(syxFile) ) {
1074
            if( loadSyx(syxFile) ) {
1075
                PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
1075
                PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
1076
                if( propertiesFile )
1076
                if( propertiesFile )
1077
                    propertiesFile->setValue(T("mbhpMfSyxFile"), syxFile.getFullPathName());
1077
                    propertiesFile->setValue(T("mbhpMfSyxFile"), syxFile.getFullPathName());
1078
            }
1078
            }
1079
        }
1079
        }
1080
    } else if( buttonThatWasClicked == saveButton ) {
1080
    } else if( buttonThatWasClicked == saveButton ) {
Line 1082... Line 1082...
1082
                       syxFile,
1082
                       syxFile,
1083
                       T("*.syx"));
1083
                       T("*.syx"));
1084
        if( fc.browseForFileToSave(true) ) {
1084
        if( fc.browseForFileToSave(true) ) {
1085
            syxFile = fc.getResult();
1085
            syxFile = fc.getResult();
1086
            if( saveSyx(syxFile) ) {
1086
            if( saveSyx(syxFile) ) {
1087
                PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
1087
                PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
1088
                if( propertiesFile )
1088
                if( propertiesFile )
1089
                    propertiesFile->setValue(T("mbhpMfSyxFile"), syxFile.getFullPathName());
1089
                    propertiesFile->setValue(T("mbhpMfSyxFile"), syxFile.getFullPathName());
1090
            }
1090
            }
1091
        }
1091
        }
1092
    } else if( buttonThatWasClicked == sendButton || buttonThatWasClicked == receiveButton ) {
1092
    } else if( buttonThatWasClicked == sendButton || buttonThatWasClicked == receiveButton ) {
Line 1115... Line 1115...
1115
//==============================================================================
1115
//==============================================================================
1116
void MbhpMfToolControl::sliderValueChanged(Slider* slider)
1116
void MbhpMfToolControl::sliderValueChanged(Slider* slider)
1117
{
1117
{
1118
    if( slider == deviceIdSlider ) {
1118
    if( slider == deviceIdSlider ) {
1119
        // store setting
1119
        // store setting
1120
        PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
1120
        PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
1121
        if( propertiesFile )
1121
        if( propertiesFile )
1122
            propertiesFile->setValue(T("mbhpMfDeviceId"), (int)slider->getValue());
1122
            propertiesFile->setValue(T("mbhpMfDeviceId"), (int)slider->getValue());
1123
    } else if( slider == patchSlider ) {
1123
    } else if( slider == patchSlider ) {
1124
        // store setting
1124
        // store setting
1125
        PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
1125
        PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
1126
        if( propertiesFile )
1126
        if( propertiesFile )
1127
            propertiesFile->setValue(T("mbhpMfPatch"), (int)slider->getValue());
1127
            propertiesFile->setValue(T("mbhpMfPatch"), (int)slider->getValue());
1128
    }
1128
    }
1129
}
1129
}
1130
1130
Line 1248... Line 1248...
1248
}
1248
}
1249
1249
1250
//==============================================================================
1250
//==============================================================================
1251
void MbhpMfToolControl::handleIncomingMidiMessage(const MidiMessage& message, uint8 runningStatus)
1251
void MbhpMfToolControl::handleIncomingMidiMessage(const MidiMessage& message, uint8 runningStatus)
1252
{
1252
{
1253
    uint8 *data = message.getRawData();
1253
    uint8 *data = (uint8 *)message.getRawData();
1254
    uint32 size = message.getRawDataSize();
1254
    uint32 size = message.getRawDataSize();
1255
1255
1256
    if( SysexHelper::isValidMbhpMfTraceDump(data, size, (int)deviceIdSlider->getValue()) ) {
1256
    if( SysexHelper::isValidMbhpMfTraceDump(data, size, (int)deviceIdSlider->getValue()) ) {
1257
        Array<uint16> newTrace;
1257
        Array<uint16> newTrace;
1258
1258