Subversion Repositories svn.mios32

Rev

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

Rev 1542 Rev 1724
Line 1... Line 1...
1
/* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
1
/* -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*- */
2
// $Id: SysexTool.cpp 1542 2012-11-25 21:27:23Z tk $
2
// $Id: SysexTool.cpp 1724 2013-03-28 20:23:40Z tk $
3
/*
3
/*
4
 * SysEx Tool Window
4
 * SysEx Tool Window
5
 *
5
 *
6
 * ==========================================================================
6
 * ==========================================================================
7
 *
7
 *
Line 62... Line 62...
62
    sendDelaySlider->addListener(this);
62
    sendDelaySlider->addListener(this);
63
63
64
    addAndMakeVisible(progressBar = new ProgressBar(progress));
64
    addAndMakeVisible(progressBar = new ProgressBar(progress));
65
65
66
    // restore settings
66
    // restore settings
67
    PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
67
    PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
68
    if( propertiesFile ) {
68
    if( propertiesFile ) {
69
        sendDelaySlider->setValue(propertiesFile->getIntValue(T("sysexSendDelay"), 750));
69
        sendDelaySlider->setValue(propertiesFile->getIntValue(T("sysexSendDelay"), 750));
70
70
71
        String recentlyUsedSyxFiles = propertiesFile->getValue(T("recentlyUsedSyxSendFiles"), String::empty);
71
        String recentlyUsedSyxFiles = propertiesFile->getValue(T("recentlyUsedSyxSendFiles"), String::empty);
72
        // seems that Juce doesn't provide a split function?
72
        // seems that Juce doesn't provide a split function?
Line 147... Line 147...
147
//==============================================================================
147
//==============================================================================
148
void SysexToolSend::sliderValueChanged(Slider* slider)
148
void SysexToolSend::sliderValueChanged(Slider* slider)
149
{
149
{
150
    if( slider == sendDelaySlider ) {
150
    if( slider == sendDelaySlider ) {
151
        // store settings
151
        // store settings
152
        PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
152
        PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
153
        if( propertiesFile ) {
153
        if( propertiesFile ) {
154
            propertiesFile->setValue(T("sysexSendDelay"), sendDelaySlider->getValue());
154
            propertiesFile->setValue(T("sysexSendDelay"), sendDelaySlider->getValue());
155
        }
155
        }
156
    }
156
    }
157
}
157
}
Line 181... Line 181...
181
            int64 readNumBytes = inFileStream->read(buffer, size);
181
            int64 readNumBytes = inFileStream->read(buffer, size);
182
            sendBox->setBinary(buffer, readNumBytes);
182
            sendBox->setBinary(buffer, readNumBytes);
183
            juce_free(buffer);
183
            juce_free(buffer);
184
184
185
            // store setting
185
            // store setting
186
            PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
186
            PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
187
            if( propertiesFile ) {
187
            if( propertiesFile ) {
188
                String recentlyUsedHexFiles = sendFileChooser->getRecentlyUsedFilenames().joinIntoString(";");
188
                String recentlyUsedHexFiles = sendFileChooser->getRecentlyUsedFilenames().joinIntoString(";");
189
                propertiesFile->setValue(T("recentlyUsedSyxSendFiles"), recentlyUsedHexFiles);
189
                propertiesFile->setValue(T("recentlyUsedSyxSendFiles"), recentlyUsedHexFiles);
190
                propertiesFile->setValue(T("defaultSyxSendFile"), inFile.getFullPathName());
190
                propertiesFile->setValue(T("defaultSyxSendFile"), inFile.getFullPathName());
191
            }
191
            }
Line 268... Line 268...
268
    addAndMakeVisible(receiveClearButton = new TextButton(T("Clear Button")));
268
    addAndMakeVisible(receiveClearButton = new TextButton(T("Clear Button")));
269
    receiveClearButton->setButtonText(T("Clear"));
269
    receiveClearButton->setButtonText(T("Clear"));
270
    receiveClearButton->addListener(this);
270
    receiveClearButton->addListener(this);
271
271
272
    // restore settings
272
    // restore settings
273
    PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
273
    PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
274
    if( propertiesFile ) {
274
    if( propertiesFile ) {
275
        String recentlyUsedSyxFiles = propertiesFile->getValue(T("recentlyUsedSyxReceiveFiles"), String::empty);
275
        String recentlyUsedSyxFiles = propertiesFile->getValue(T("recentlyUsedSyxReceiveFiles"), String::empty);
276
        // seems that Juce doesn't provide a split function?
276
        // seems that Juce doesn't provide a split function?
277
        StringArray recentlyUsedSyxFilesArray;
277
        StringArray recentlyUsedSyxFilesArray;
278
        int index = 0;
278
        int index = 0;
Line 364... Line 364...
364
                statusLabel->setText(String(saveData.size()) + T(" bytes saved"), true);
364
                statusLabel->setText(String(saveData.size()) + T(" bytes saved"), true);
365
            }
365
            }
366
        }
366
        }
367
367
368
        // store setting
368
        // store setting
369
        PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
369
        PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
370
        if( propertiesFile ) {
370
        if( propertiesFile ) {
371
            String recentlyUsedHexFiles = receiveFileChooser->getRecentlyUsedFilenames().joinIntoString(";");
371
            String recentlyUsedHexFiles = receiveFileChooser->getRecentlyUsedFilenames().joinIntoString(";");
372
            propertiesFile->setValue(T("recentlyUsedSyxReceiveFiles"), recentlyUsedHexFiles);
372
            propertiesFile->setValue(T("recentlyUsedSyxReceiveFiles"), recentlyUsedHexFiles);
373
            propertiesFile->setValue(T("defaultSyxReceiveFile"), outFile.getFullPathName());
373
            propertiesFile->setValue(T("defaultSyxReceiveFile"), outFile.getFullPathName());
374
        }
374
        }