jcsteh / osara

OSARA: Open Source Accessibility for the REAPER Application
GNU General Public License v2.0
127 stars 46 forks source link

Make focusable volume/pan fader controls accessible #54

Closed jcsteh closed 8 years ago

jcsteh commented 8 years ago

There are focusable volume and pan faders in some windows; e.g. Track I/O and Item Properties. With NVDA, these don't even get focus properly. Even if we hacked around this, there's still no useful info. It'd be nice to be able to access these, but it's low priority, since there are other reasonable ways to get at the value in each case.

These have a rather useless MSAA implementation which doesn't return the focused state and doesn't return an accValue.

Unfortunately, without hacking the WindowProc, we can't intercept WM_GETOBJECT and provide our own MSAA implementation. One option is to create a fake invisible window and do the accessibility there. I started experimenting with this approach, but it's time consuming and low priority as noted above, so I didn't complete it. For reference, here's the code I added to handleWinEvent to fake focus on this fake window:

    if (event == EVENT_OBJECT_FOCUS) {
        WCHAR className[15] = L"\0";
        GetClassName(hwnd, className, ARRAYSIZE(className));
        if (wcscmp(className, L"REAPERhfader") == 0) {
            HWND fake = CreateWindow(L"Static", NULL, WS_CHILD, 0, 0, 0, 0, hwnd, NULL, NULL, NULL);
            VARIANT state;
            state.vt = VT_I4;
            state.lVal = STATE_SYSTEM_FOCUSED;
            accPropServices->SetHwndProp(fake, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_STATE, state);
            NotifyWinEvent(EVENT_OBJECT_FOCUS, fake, OBJID_CLIENT, CHILDID_SELF);
        }
    }

After this, it'd be a matter of using dynamic annotation on the fake window to expose the right accValue.

The volume controls (REAPERhfader) respond to TBM_GETPOS. They have a range from 0 to 1000. I ahven't worked out the calculation for the value yet. It is affected by the volume fader maximum in Preferences. At the default of +12dB, 0dB seems to have a value of 716.

The situation is similar for pan faders (REAPERhpanfader), except the calculation is much simpler there: 500 is centre.

LeonarddeR commented 8 years ago

I assume this case also applies to the Transient Detection Settings dialog?

jcsteh commented 8 years ago

After some tecnical discussion with Cockos, this has been addressd (in just a few days!) in REAPER 5.20pre12a.

The transient sensitivity slider still isn't reporting a value. I'll report this one.

jcsteh commented 8 years ago

Transient detection sliders fixed in REAPER 5.20pre13.