Skip to content

Commit

Permalink
AppletParam WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
djphazer committed Jan 7, 2024
1 parent c18ce5b commit c9e4bfe
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions software/o_c_REV/HemisphereApplet.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@ typedef struct Applet {
void (*OnDataReceive)(bool, uint64_t); // Send a data int to the applet
} Applet;

// editable by cursor, and CV assignable
typedef struct {
uint8_t &p; int min, max;
uint8_t x, y, w;
} AppletParam;

Applet available_applets[] = HEMISPHERE_APPLETS;
Applet clock_setup_applet = DECLARE_APPLET(9999, 0x01, ClockSetup);

Expand All @@ -131,6 +137,7 @@ using namespace HS;
class HemisphereApplet {
public:
static int cursor_countdown[2];
static int cursor[2];

virtual const char* applet_name(); // Maximum of 9 characters
virtual void Start();
Expand All @@ -141,7 +148,7 @@ class HemisphereApplet {
hemisphere = hemisphere_;

// Initialize some things for startup
help_active = 0;
full_screen = 0;
cursor_countdown[hemisphere] = HEMISPHERE_CURSOR_TICKS;

// Shutdown FTM capture on Digital 4, used by Tuner
Expand Down Expand Up @@ -190,7 +197,7 @@ class HemisphereApplet {

/* Help Screen Toggle */
void HelpScreen() {
help_active = 1 - help_active;
full_screen = 1 - full_screen;
}

/* Check cursor blink cycle. */
Expand All @@ -205,6 +212,7 @@ class HemisphereApplet {
virtual void DrawFullScreen() {
SetHelp();

// TODO: standard CV input assignment stuff, capture the cursor somehow
for (int section = 0; section < 4; section++)
{
int y = section * 12 + 16;
Expand Down Expand Up @@ -494,8 +502,9 @@ class HemisphereApplet {

private:
bool applet_started; // Allow the app to maintain state during switching
bool help_active;
bool full_screen;
};

int HemisphereApplet::cursor_countdown[2];
int HemisphereApplet::cursor[2];

0 comments on commit c9e4bfe

Please sign in to comment.