Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: API should let patches fetch screen metrics #114

Open
mcclure opened this issue Jun 12, 2022 · 0 comments
Open

Feature request: API should let patches fetch screen metrics #114

mcclure opened this issue Jun 12, 2022 · 0 comments

Comments

@mcclure
Copy link
Contributor

mcclure commented Jun 12, 2022

So, say I write a patch that displays something complex to the screen. I want it to be forward compatible; that is, I want it to work on future OWL devices that have not been announced. For example this patch is hardcoded to display 7 lines of text and no more than 21 columns. But

You can currently get the height and width of the screen. But this is not enough. More information I want includes:

  • What is the height and width of a text character? Future devices might have a higher DPI and bigger text.
  • What is the height and width of the displayable area? 8 lines of text fit on the screen, but my patch is hardcoded to use 7 lines, because the bottom character's worth of screen is taken up by system UI that cannot be turned off. In a future
  • What is the topmost/leftmost pixel of the displayable area? Currently UI is displayed below the patch area and nothing is displayed above. But maybe a future device will have UI both above and below.
  • Is there a screen at all? (This one is lower priority because as antisvn points out in the thread linked above you can just wait to see if you get processDisplay() called and then set a flag. But it might be better to know at constructor time if a display exists, because maybe you have to do some kind of intensive display init work that you know could cause an audio hiccup.

My recommended API for this would be to add to MonochromeScreenPatch:

void getScreenMetric(ScreenMetricEnum kind, int &x, int &y);
bool getScreenPresent();

(On color devices maybe getScreenPresent() could be replaced with an enum version that could indicate also whether the screen is color or monochrome.)

@mcclure mcclure changed the title API should let patches fetch screen metrics Feature request: API should let patches fetch screen metrics Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant