6. Seq16 Page Creation

6.1. Seq16 Creation Main

A new seq16 page is created with the function page_seq16.

<<seq16_function_declarations>>=
static void page_seq16(monolith_page *pg);
<<seq16_functions>>=
static void page_seq16(monolith_page *pg)
{
    page_seq16_d *seq16;
    seq16 = calloc(1, sizeof(page_seq16_d));
    if(seq16 == NULL) return;
    page_seq16_init(pg, seq16);
    if(seq16_type == 0) page_seq16_runtime_init(monolith_page_monolith(pg));
<<seq16_assign_callbacks>>
    monolith_page_data_set(pg, seq16);
}

6.2. Seq16 Set Typeflag

<<seq16_assign_callbacks>>=
monolith_page_type_set(pg, seq16_type);

6.3. Seq16 Open

When a seq16 page is opened, the monome state is set.

<<seq16_function_declarations>>=
static void seq16_open(monolith_page *pg);
<<seq16_functions>>=
static void seq16_open(monolith_page *pg)
{
    page_seq16_d *seq16;
    monolith_arc_d *arc;
    monolith_d *m;
    int i;
    seq16 = monolith_page_data_get(pg);
    if(seq16 == NULL) return;
    m = monolith_page_monolith(pg);
    arc = monolith_arc_get(m);
    monolith_page_mstate_recall(seq16->mstate);
    for (i = 0; i < 4; i++) monolith_arc_all(arc, i, 0);
}
<<seq16_assign_callbacks>>=
monolith_page_open_set(pg, seq16_open);

6.4. Seq16 Free

<<seq16_function_declarations>>=
static void seq16_free(monolith_page *pg);
<<seq16_functions>>=
static void seq16_free(monolith_page *pg)
{
    page_seq16_d *seq16;
    seq16 = (page_seq16_d *)monolith_page_data_get(pg);
    if(seq16 == NULL) return;
    page_seq16_cleanup(seq16);
    free(seq16);
}
<<seq16_assign_callbacks>>=
monolith_page_free_set(pg, seq16_free);

6.5. Seq16 Press Callback

<<seq16_function_declarations>>=
static void seq16_press(monolith_page *pg, int x, int y, int s);
<<seq16_functions>>=
static void seq16_press(monolith_page *pg, int x, int y, int s)
{
    if (s) {
        page_seq16_d *seq;
        seq = monolith_page_data_get(pg);
        seq16_pressme(seq, x, y);
        seq16_draw_col(seq, x);
    }
}
<<seq16_assign_callbacks>>=
monolith_page_press_set(pg, seq16_press);



prev | home | next