vendredi 20 février 2015

Latest App (Radio Auricle) writing experiences

(Radio Auricle announcement: http://ift.tt/1AXGmdf)

My new Internet radio app powered by UberStations has been a fairly simple thing to write after doing EWz. Some interesting technical / dev stuff from the experience so far:



Backgrounds: I realized instead of custom backgrounds I could take some abstract appropriately-sized public domain images and use them. The trick I used here was cover them up with a 0.25 transparent Red/Blue/Purple/Green colored view to tint the image (when needed) and then I created a "scroll region" rectangle view extended off the right edge of the screen with Black at 0.30 transparency to make it look like a standard TiVo style background. For SD, I just am using the colors without any image behind them.



I'm also supporting SD/HD font sizes by modifying the font size by the ratio of current height to SD height.



Global Responses and Screenblanker: I globally have it supporting both ZOOM and REPLAY(for now) as a "Back" button, CLEAR (when not supported by the page, like artist search) as "Quit", and "D" to activate the screenblanker immediately. I also made sure any key press event (aside from ones I'm using for chaining or "D") immediately unblanks (rather than waiting 5-10 seconds for the "not idle" event to show up). Screenblanker is just a 0.05 transparent Black view covering everything but my "currently playing" view which then takes 5 minutes to slide to a random spot with every subsequent idle event, and unblanking slides it back home.



Animation Chaining and Threads: I'm using two sendEvent animation chains... TIVO and LIVETV keys as key repeat events. One refreshes the "currently playing" view (it only refreshes it just before UberStations says the song's time-to-end, then every 2 seconds until it truly gets an update with a new time-to-end), the other chain refreshes station lists every 5 seconds if any are active (Artist search, or when a Chart Topper song is highlighted)

Some Uberstations actions take a while, so I have a "busy" view that I display when I start an operation (currently just screen dimming+text). The neat trick here is I set it visible with a 350ms animation, so if my operation completes and hides the view before the 350ms is up, you don't see any busy view at all.

I want to make the slow operations run in a separate thread, but 1.4.1e is a thread BRICK, so the best I might do is spin up a query thread, and have the SDK thread poll (sendEvent animation chaining) for that query thread's final values.



Real Time Search: I tried to make the Artist Search screen match how the TiVo search pages work as much as possible. I matched TiVo's behavior of jumping to the list with ADVANCE or going to the right edge of the keyboard. (It should probably jump to the list when there is only one result, too).

I additionally made it support FORWARD/REVERSE/CLEAR/#'s when the list is focused by focusing back to the keyboard and forwarding the event.

I also made it support the v49 keyboard characters and backspace regardless of where focus is.

My own additions are for it to jump back and forth with ENTER, and also jump to the list with PLAY.



Selection-reminder BLists: I'm using a custom BList subclass throughout that adds several features.

The displayed value is the toString of the entry, or if the entry is a Map Entry, the toString of the entry's Key.

The value is specifically placed in a view inset from the row's view sides by 1/2 the row height.

It also accepts an action to post when the user hits SELECT which you'd usually set to the same thing as you'd set for the "right" action of BarAndArrows on the list's highlights.

In addition, the row's background is changed to highlight what was selected when the list loses focus, then restored when it regains focus.

I also stole my own code to make it optionally support list rearranging numbers on the right which I use in the Favorites page.

I plan to expand this class to use a custom interface for object values that will provide an icon for the row and other features to be even more TiVo-like. This app will use that to indicate what you've saved as a favorite and maybe display the station's logo.



I'm very happy with how the three highlighting lists worked out in the Chart Toppers page and some day may generalize this to do a TiVo-alike HD UI Now Playing style generic Screen - complete with top area feature bars and such.



Number widget: The Local AM/FM zip code search is a newly built "widget" view that just allows you to enter numbers and a few related characters and such for numeric entry. I adapted some code from the BButton to make it work (mainly for highlight arrows). This rewrite actually looks and acts pretty good including the same "_" cursor as the Bananas keyboard. (It should also support USB keyboard for a few number-related characters, but doesn't at this moment). Actually the IP address uses the same widget, but changes the background color and makes it non-focusable.

The correct DVR IP address is figured out using the trick from the hmedev.wikidot.com wiki's "tips and tricks" section.



I still need to build the options page for a few things, add a favorites preview at the top alongside the "currently playing," build an info popup with access to additional features (especially recommendations), add some key hints in a few places, decide if I want to add a general string search page, and figure out if it will be practical to do the auto-repeat (artist or song) feature I wanted to add, among other things.




Aucun commentaire:

Enregistrer un commentaire