Subversion Repositories svn.mios32

Rev

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

Rev 1190 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: MidiKeyboard.cpp 1190 2011-04-24 23:20:11Z tk $
2
// $Id: MidiKeyboard.cpp 1724 2013-03-28 20:23:40Z tk $
3
/*
3
/*
4
 * Midi Keyboard
4
 * Midi Keyboard
5
 *
5
 *
6
 * ==========================================================================
6
 * ==========================================================================
7
 *
7
 *
Line 49... Line 49...
49
    midiChannelSlider->setSliderStyle(Slider::IncDecButtons);
49
    midiChannelSlider->setSliderStyle(Slider::IncDecButtons);
50
    midiChannelSlider->setTextBoxStyle(Slider::TextBoxAbove, false, 80, 20);
50
    midiChannelSlider->setTextBoxStyle(Slider::TextBoxAbove, false, 80, 20);
51
    midiChannelSlider->addListener(this);
51
    midiChannelSlider->addListener(this);
52
52
53
    // restore settings
53
    // restore settings
54
    PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
54
    PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
55
    if( propertiesFile ) {
55
    if( propertiesFile ) {
56
        int chn = propertiesFile->getIntValue("midiKeyboardChannel", 1);
56
        int chn = propertiesFile->getIntValue("midiKeyboardChannel", 1);
57
        midiKeyboardComponent->setMidiChannel(chn);
57
        midiKeyboardComponent->setMidiChannel(chn);
58
        for(int i=0; i<midiSlider.size(); ++i)
58
        for(int i=0; i<midiSlider.size(); ++i)
59
            midiSlider[i]->setMidiChannel(chn);
59
            midiSlider[i]->setMidiChannel(chn);
60
        midiChannelSlider->setValue(chn, false);
60
        midiChannelSlider->setValue(chn, dontSendNotification);
61
    }
61
    }
62
62
63
    setSize(400, 200);
63
    setSize(400, 200);
64
}
64
}
65
65
Line 116... Line 116...
116
116
117
    for(int i=0; i<midiSlider.size(); ++i)
117
    for(int i=0; i<midiSlider.size(); ++i)
118
        midiSlider[i]->setMidiChannel(midiChannel);
118
        midiSlider[i]->setMidiChannel(midiChannel);
119
119
120
    // store setting
120
    // store setting
121
    PropertiesFile *propertiesFile = ApplicationProperties::getInstance()->getCommonSettings(true);
121
    PropertiesFile *propertiesFile = MiosStudioProperties::getInstance()->getCommonSettings(true);
122
    if( propertiesFile )
122
    if( propertiesFile )
123
        propertiesFile->setValue("midiKeyboardChannel", midiChannel);
123
        propertiesFile->setValue("midiKeyboardChannel", midiChannel);
124
}
124
}
125
125
126
126