Subversion Repositories tpanel

Rev

Rev 310 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 310 Rev 424
Line 377... Line 377...
377
    DECL_TRACER("TSystemButton::setDistinctFocus(ulong handle)");
377
    DECL_TRACER("TSystemButton::setDistinctFocus(ulong handle)");
378
 
378
 
379
    if (mButtons.empty())
379
    if (mButtons.empty())
380
        return;
380
        return;
381
 
381
 
-
 
382
    std::thread thr = std::thread([=] {
382
    vector<TButton *>::iterator iter;
383
        vector<TButton *>::iterator iter;
383
 
384
 
384
    for (iter = mButtons.begin(); iter != mButtons.end(); ++iter)
385
        for (iter = mButtons.begin(); iter != mButtons.end(); ++iter)
385
    {
-
 
386
        TButton *button = *iter;
-
 
387
 
-
 
388
        if (button->getButtonType() == TEXT_INPUT)
-
 
389
        {
386
        {
-
 
387
            TButton *button = *iter;
-
 
388
 
-
 
389
            if (button->getButtonType() == TEXT_INPUT)
-
 
390
            {
390
            if (button->getHandle() == handle && !button->isFocused())
391
                if (button->getHandle() == handle && !button->isFocused())
391
                button->setTextFocus(true);
392
                    button->setTextFocus(true);
392
            else if (button->isFocused())
393
                else if (button->isFocused())
393
                button->setTextFocus(false);
394
                    button->setTextFocus(false);
-
 
395
            }
394
        }
396
        }
395
    }
397
    });
-
 
398
 
-
 
399
    thr.detach();
396
}
400
}
397
 
401
 
398
void TSystemButton::setCursorPosition(ulong handle, int oldPos, int newPos)
402
void TSystemButton::setCursorPosition(ulong handle, int oldPos, int newPos)
399
{
403
{
400
    DECL_TRACER("TSystemButton::setCursorPosition(ulong handle, int pos)");
404
    DECL_TRACER("TSystemButton::setCursorPosition(ulong handle, int pos)");
Line 802... Line 806...
802
    DECL_TRACER("TSystemButton::setKeysToBank(int bank, int handle)");
806
    DECL_TRACER("TSystemButton::setKeysToBank(int bank, int handle)");
803
 
807
 
804
    if (mButtons.empty() || bank < BANK_1 || bank > BANK_3)
808
    if (mButtons.empty() || bank < BANK_1 || bank > BANK_3)
805
        return;
809
        return;
806
 
810
 
-
 
811
    std::thread thr = std::thread([=] {
807
    vector<TButton *>::iterator iter;
812
        vector<TButton *>::iterator iter;
808
    int inst = (bank - 1) * 2;
813
        int inst = (bank - 1) * 2;
809
 
814
 
810
    for (iter = mButtons.begin(); iter != mButtons.end(); ++iter)
815
        for (iter = mButtons.begin(); iter != mButtons.end(); ++iter)
811
    {
816
        {
812
        TButton *button = *iter;
817
            TButton *button = *iter;
-
 
818
            int channelNumber = button->getChannelNumber();
-
 
819
            uint hdl = button->getHandle();
813
        SYS_BUTTON_TYPE tp = getSystemButtonType(button->getChannelNumber(), 0);
820
            SYS_BUTTON_TYPE tp = getSystemButtonType(channelNumber, 0);
814
 
821
 
815
        if (tp == KEY_KEY)
822
            if (tp == KEY_KEY)
816
        {
823
            {
817
            if (handle == button->getHandle())
824
                if (handle == hdl)
818
                button->setBargraphLevel(inst + 1);
825
                    button->setBargraphLevel(inst + 1);
819
            else
826
                else
820
                button->setBargraphLevel(inst);
827
                    button->setBargraphLevel(inst);
821
        }
828
            }
822
        else if (tp == KEY_BUTTON)
829
            else if (tp == KEY_BUTTON)
823
        {
830
            {
824
            if (handle == button->getHandle() || (button->getChannelNumber() == KB_CAPS_LOCK && mCapsLock))
831
                if (handle == hdl || (channelNumber == KB_CAPS_LOCK && mCapsLock))
825
                button->setActive(STATE_ON);
832
                    button->setActive(STATE_ON);
826
            else
833
                else
827
                button->setActive(STATE_OFF);
834
                    button->setActive(STATE_OFF);
-
 
835
            }
828
        }
836
        }
829
    }
837
    });
-
 
838
 
-
 
839
    thr.detach();
830
}
840
}
831
 
841
 
832
void TSystemButton::handleDedicatedKeys(int channel, bool pressed)
842
void TSystemButton::handleDedicatedKeys(int channel, bool pressed)
833
{
843
{
834
    DECL_TRACER("TSystemButton::handleDedicatedKeys(int channel, bool pressed)");
844
    DECL_TRACER("TSystemButton::handleDedicatedKeys(int channel, bool pressed)");