예제 #1
0
파일: main.c 프로젝트: Someone101/aleph
// main function
int main(void) { //const int argc, const char** argv) {
  u8 run = 1; 
  
  //  net_init(&ctlnet);
  net_init();
  ui_init();
  pages_init();
  preset_init();
  scene_init();

  // TEST:
  // create some dummy parameters
  /* net_add_param(0, "unit", 0.0, 1.0, 0); */
  /* net_add_param(1, "big", 0.0, 10000.0, 0); */
  /* net_add_param(2, "bipolar", -1.0, 1.0, 0); */

  while (run != 0) {
    run = ui_loop();
  }

  scene_deinit();
  preset_deinit();
  pages_deinit();
  ui_deinit();
  net_deinit();

  return 0;
}
예제 #2
0
static void down_click_handler(ClickRecognizerRef recognizer, void *context) {
  if (!is_connected) {
    return;
  }
  if (s_state == BEGINNING_STATE) {
    recent_contact_chooser_init();
    change_state(GETTING_RECENT_CONTACTS_STATE);
    get_recent_contacts();
  } else if (s_state == CREATING_FINAL_MESSAGE_STATE) {
    preset_init();
    change_state(GETTING_PRESETS_STATE);
    get_presets();
  }
}
예제 #3
0
static void preset_read(t_presetobj *x, t_symbol *s, int argc, t_atom *argv)
{
    t_binbuf *d = binbuf_new();
    if(d && argv && argc && atom_gettype(argv) == A_SYMBOL)
    {
        if(binbuf_read(d, atom_getsymbol(argv)->s_name, (char *)"", 0))
        {
            pd_error(x, "preset : %s read failed", atom_getsymbol(argv)->s_name);
        }
        else
        {
            preset_init(x, d);
            ebox_invalidate_layer((t_ebox *)x, cream_sym_background_layer);
            ebox_redraw((t_ebox *)x);
            post("preset : read %s.", atom_getsymbol(argv)->s_name);
        }
    }
    if(d)
    {
        binbuf_free(d);
    }
}
예제 #4
0
static void *preset_new(t_symbol *s, int argc, t_atom *argv)
{
    t_presetobj *x = (t_presetobj *)eobj_new(preset_class);
    t_binbuf* d = binbuf_via_atoms(argc,argv);
    if(x && d)
    {
        x->f_binbuf = (t_binbuf **)malloc(CREAM_MAXITEMS * sizeof(t_binbuf *));
        for(int i = 0; i < CREAM_MAXITEMS; i++)
        {
            x->f_binbuf[i]  = binbuf_new();
        }
        ebox_new((t_ebox *)x, 0 | EBOX_GROWINDI);

        x->f_binbuf_selected = 0;
        x->f_binbuf_hover    = 0;

        preset_init(x, d);
        ebox_attrprocess_viabinbuf(x, d);
        ebox_ready((t_ebox *)x);
    }

    return (x);
}