Subversion Repositories svn.mios32

Rev

Rev 1195 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1195 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: MidiSlider.cpp 1195 2011-04-28 17:56:35Z tk $
2
// $Id: MidiSlider.cpp 1724 2013-03-28 20:23:40Z tk $
3
/*
3
/*
4
 * Midi Slider
4
 * Midi Slider
5
 *
5
 *
6
 * ==========================================================================
6
 * ==========================================================================
7
 *
7
 *
Line 196... Line 196...
196
    // only used for horizontal sliders
196
    // only used for horizontal sliders
197
    addAndMakeVisible(sliderFunction = new ComboBox(String::empty));
197
    addAndMakeVisible(sliderFunction = new ComboBox(String::empty));
198
    sliderFunction->addListener(this);
198
    sliderFunction->addListener(this);
199
199
200
    // restore settings
200
    // restore settings
201
    PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
201
    PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
202
    if( propertiesFile ) {
202
    if( propertiesFile ) {
203
        _functionName = propertiesFile->getValue("slider" + String(sliderNum) + "FunctionName", _functionName);
203
        _functionName = propertiesFile->getValue("slider" + String(sliderNum) + "FunctionName", _functionName);
204
        _functionArg = propertiesFile->getIntValue("slider" + String(sliderNum) + "FunctionArg", _functionArg);
204
        _functionArg = propertiesFile->getIntValue("slider" + String(sliderNum) + "FunctionArg", _functionArg);
205
        _midiChannel = propertiesFile->getIntValue("slider" + String(sliderNum) + "MidiChannel", _midiChannel);
205
        _midiChannel = propertiesFile->getIntValue("slider" + String(sliderNum) + "MidiChannel", _midiChannel);
206
        initialValue = propertiesFile->getIntValue("slider" + String(sliderNum) + "InitialValue", initialValue);
206
        initialValue = propertiesFile->getIntValue("slider" + String(sliderNum) + "InitialValue", initialValue);
Line 258... Line 258...
258
        sliderFunction->clear();
258
        sliderFunction->clear();
259
    } else {
259
    } else {
260
        sliderFunction->clear();
260
        sliderFunction->clear();
261
    }
261
    }
262
262
263
    slider->setValue(initialValue, false); // don't send update message
263
    slider->setValue(initialValue, dontSendNotification); // don't send update message
264
264
265
    // store settings
265
    // store settings
266
    PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
266
    PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
267
    if( propertiesFile ) {
267
    if( propertiesFile ) {
268
        propertiesFile->setValue("slider" + String(sliderNum) + "FunctionName",_functionName);
268
        propertiesFile->setValue("slider" + String(sliderNum) + "FunctionName",_functionName);
269
        propertiesFile->setValue("slider" + String(sliderNum) + "FunctionArg", functionArg);
269
        propertiesFile->setValue("slider" + String(sliderNum) + "FunctionArg", functionArg);
270
        propertiesFile->setValue("slider" + String(sliderNum) + "MidiChannel", midiChannel);
270
        propertiesFile->setValue("slider" + String(sliderNum) + "MidiChannel", midiChannel);
271
        propertiesFile->setValue("slider" + String(sliderNum) + "InitialValue", slider->getValue());
271
        propertiesFile->setValue("slider" + String(sliderNum) + "InitialValue", slider->getValue());