0

readSetting and writeSetting with a backslash in the name

I'm trying to check, and possibly set the value of a setting, in particular the SDI video format to match a frame rate known from the environment rv is launched in.  I have a MinorMode which applies rv session modifications to the various "fps" values (for image sequences) via callback from the new-source event.  This works fine for the desktop, but when viewing in presentation via rvsdi it appears the videoFormat setting needs to be tweaked for frame-rate too.

More simply, this python test code works:

            readSetting = \
r'''{
let SettingsValue.Int vf = readSetting("OpenExr", "iosize", SettingsValue.Int(-1));
vf;
}'''
            print("INFO: %s" % rv.runtime.eval(readSetting, ["commands"]))

which outputs INFO: 61440

 

With my RV.conf containing

[NVIDIA-SDI]
0\dataFormat=8
0\videoFormat=34
0\syncMode=1
0\syncSource=0

I would also like to be able to query and set the videoFormat at initialization, but can't figure out how to get something like the following to work:

            readSetting = \
r'''{
let SettingsValue.Int vf = readSetting("NVIDIA-SDI", "0\videoFormat", SettingsValue.Int(-1));
vf;
}'''

            print("INFO: %s" % readSetting)

which incorrectly outputs INFO: -1

and

 

            writeSetting = \
r'''{
writeSetting("NVIDIA-SDI", "0\videoFormat", SettingsValue.Int(%s));
}''' % 32
            rv.runtime.eval(writeSetting, ["commands"])


which modifies with the wrong name in my RV.conf

 

[NVIDIA-SDI]
0\dataFormat=8
0\videoFormat=34
0\syncMode=1
0\syncSource=0
0%5CvideoFormat=32

Several permutations of backslashes tried, to no avail.

Is there a way (simpler even) to achieve my goal?

2 comments

  • 0
    Avatar
    Chris King

    I think we may have this solved.

    Forward-slashes get translated to backslashes when stored in RV.conf, so getting/setting "0/videoFormat" corresponds to RV.conf "0\videoFormat".

  • 0
    Avatar
    Alan Trombla

    Hah, that's pretty funny.  I was trying to figure out why and even how we were adding a backslash like that.

    Glad you figured it out !

    Alan

Please sign in to leave a comment.