2. Knobs Data

2.1. DONE Knobs Data Contents

CLOSED: [2019-12-05 Thu 18:25]

2.1.1. Knobs Grid State Data

<<page_knobs_contents>>=
monolith_page_mstate *mstate;
<<knobs_init>>=
monolith_page_mstate_new(pg, &knobs->mstate);
<<knobs_cleanup>>=
monolith_page_mstate_free(&knobs->mstate);

2.1.2. DONE Knobs Arc State Data

CLOSED: [2019-12-05 Thu 18:16]

<<page_knobs_contents>>=
monolith_page_arcstate *astate;
<<knobs_init>>=
monolith_page_arcstate_new(pg, &knobs->astate);
<<knobs_cleanup>>=
monolith_page_arcstate_free(&knobs->astate);

2.1.3. DONE Knobs Values

CLOSED: [2019-12-05 Thu 18:19] 16x8 grids, so 128 total knob values. All contained in a struct.

<<page_knobs_contents>>=
GFFLT vals[128];

zero'd out to begin.

<<knobs_init>>=
for (i = 0; i < 128; i++) {
    knobs->vals[i] = 0;
}

2.1.4. DONE Selected values

CLOSED: [2019-12-05 Thu 18:23] Which knob value is selected (per lane). Should be in range 0-31.

<<page_knobs_contents>>=
int selected[4];

Negative values indicate nothing is selected.

<<knobs_init>>=
for (i = 0; i < 4; i++) {
    knobs->selected[i] = -1;
}

2.1.5. DONE Increment value

CLOSED: [2019-12-05 Thu 18:24] How much to increment by when turned. 0.001 is probably okay?

<<page_knobs_contents>>=
GFFLT inc;

Negative values indicate nothing is selected.

<<knobs_init>>=
knobs->inc = 0.001;

2.1.6. TODO Aux Knob

An integer value set between 0 and 127 (or negative to disable).

Used to assign the griffin to any knob from any lane.

<<page_knobs_contents>>=
int aux_knob;
<<knobs_init>>=
knobs->aux_knob = -1;
<<knobs_function_declarations>>=
static void knobs_aux_knob(page_knobs_d *knobs,
                           int lane,
                           int x, int y);
<<knobs_functions>>=
static void knobs_aux_knob(page_knobs_d *knobs,
                           int lane,
                           int x, int y)
{
    int k;

    k = (lane * 4 + x) + y * 16;

    if (k < 0) return;
    if (k >= 128) return;

    knobs->aux_knob = k;
}

2.2. DONE Knobs Typedef Declaration

CLOSED: [2019-12-05 Thu 18:24] All knobs page data is contained in a struct called page_knobs_d.

<<knobs_typedefs>>=
typedef struct page_knobs_d page_knobs_d;
<<knobs_struct>>=
struct page_knobs_d {
<<page_knobs_contents>>
};

2.3. DONE Knobs Data Allocation/Initialization

CLOSED: [2019-12-05 Thu 18:24] Knobs data is initiatlized with the function page_knobs_init.

<<knobs_function_declarations>>=
static void page_knobs_init(monolith_page *pg, page_knobs_d *knobs);
<<knobs_functions>>=
static void page_knobs_init(monolith_page *pg, page_knobs_d *knobs)
{
    int i;
<<knobs_init>>
}

2.4. DONE Knobs Data Cleanup

CLOSED: [2019-12-05 Thu 18:24] Knobs data is freed with the funciton page_knobs_free.

<<knobs_function_declarations>>=
static void page_knobs_cleanup(page_knobs_d *knobs);
<<knobs_functions>>=
static void page_knobs_cleanup(page_knobs_d *knobs)
{
<<knobs_cleanup>>
}



prev | home | next