Hi, and welcome to the community!
Me too! .
If you check out the rvui module, there is a method called setStereo that takes a string name of the stereo type. While rvui is a runtime module and is not automatically bound to python, you can export symbols or eval.
But taking a look at the setStereo signature in the Mu API Browser, you can see it is not just a plain function it is a function generator. These are used to create callbacks for menus where only the parameter changes (in this case, the stereo mode).
setStereo ((void;Event); string type)
Because the return type is (void; Event)
we know the return type is a callable with a return of void
and a single parameter input Event
.
This means we need to call the result of that function (not just call the function).
In Python, it would look like this (note the extra (nil)
which is us calling the result of the function and giving a nil value for Event).
import rv
rv.runtime.eval(“”“setStereo(“pair”)(nil);”“”, [“rvui”])
You can wrap that up in a function to squirrel away that you had to think about Mu, and just pass in the stereo mode. If you check out the rvui.mu menu definition you can see the stereo mode strings that are called for various menu options:
5706 {"Stereo", Menu {
5707 {"Stereo Viewing Mode", nil, nil, inactiveState},
5708 {" Off", setStereo("off"), nil, isStereo("off")},
5709 {" Anaglyph", setStereo("anaglyph"), nil, isStereo("anaglyph")},
5710 {" Luminance Anaglyph", setStereo("lumanaglyph"), nil, isStereo("lumanaglyph")},
5711 {" Side-by-Side", setStereo("pair"), nil, isStereo("pair")},
5712 {" Mirror Side-by-Side", setStereo("mirror"), nil, isStereo("mirror")},
5713 //{" Horizontal Squeezed", setStereo("hsqueezed"), nil, isStereo("hsqueezed")},
5714 //{" Vertical Squeezed", setStereo("vsqueezed"), nil, isStereo("vsqueezed")},
5715 {" DLP Checker", setStereo("checker"), nil, isStereo("checker")},
5716 {" Scanline", setStereo("scanline"), nil, isStereo("scanline")},
5717 {" Left Eye Only", setStereo("left"), nil, isStereo("left")},
5718 {" Right Eye Only", setStereo("right"), nil, isStereo("right")},
5719 {" Shutter Glasses", setStereo("hardware"), nil, isStereo("hardware")},
Cheers!
-Kessler