static void menu_readerview_save_as_cb(GtkWidget *w, gpointer user_data)
{
  char** select_info;
  a_string_t *command;
  char *filename;
  UNUSED(w);
  UNUSED(user_data);

  select_info = ui_select_file("Save recorded data",path_config_get_string(PATH_CONFIG_FOLDER_REPLAY),"card.clf");
  if (select_info[1])
  {  
    filename = luax_escape_string(select_info[1]);
    command=a_strnew(NULL);
    a_sprintf(command,"card.log_save(\"%s\")",filename);
    luax_run_command(a_strval(command));
    a_strfree(command);
    g_free(select_info[0]);
    g_free(select_info[1]);
    g_free(filename);
  }
}
Ejemplo n.º 2
0
static void menu_cardview_save_as_cb(GtkWidget *w, gpointer user_data)
{
    char **select_info;
    a_string_t *command;
    char *filename;
    UNUSED(w);
    UNUSED(user_data);

    select_info = ui_select_file("Save xml card description",path_config_get_string(PATH_CONFIG_FOLDER_WORKING),"card.xml");
    if (select_info[1])
    {
        path_config_set_string(PATH_CONFIG_FOLDER_WORKING,select_info[0]);
        filename = luax_escape_string(select_info[1]);
        command=a_strnew(NULL);
        a_sprintf(command,"ui.save_view(\"%s\")",filename);
        luax_run_command(a_strval(command));
        a_strfree(command);
        g_free(select_info[0]);
        g_free(select_info[1]);
        g_free(filename);
    }
}
Ejemplo n.º 3
0
static void sound_record_start(char *format, uilib_file_filter_enum_t extension)
{
    ui_button_t button;
    char *s;
    char *retval;

    vsync_suspend_speed_eval();

    resources_set_string("SoundRecordDeviceName", "");
    s = ui_select_file(_("Record sound to file"), NULL, 0, soundrecordpath, &extension, 1, &button, 0, NULL, UI_FC_SAVE);
    if (button == UI_BUTTON_OK && s != NULL) {
        lib_free(soundrecordpath);
        util_fname_split(s, &soundrecordpath, NULL);
        util_add_extension(&s, format);
        resources_set_string("SoundRecordDeviceArg", s);
        resources_set_string("SoundRecordDeviceName", format);
        resources_set_int("Sound", 1);
        lib_free(s);
        retval = util_concat(_("Sound Recording started"), "...", NULL);
        ui_display_statustext(retval, 10);
        lib_free(retval);
    }
}