Writer_t* getWriter(char* encoding) { int i; for (i = 0; AvailableWriter[i] != NULL; i++) { if (strcmp(AvailableWriter[i]->caps->textEncoding, encoding) == 0) { writer_printf(50, "%s: found writer \"%s\" for \"%s\"\n", __func__, AvailableWriter[i]->caps->name, encoding); return AvailableWriter[i]; } } writer_printf(1, "%s: no writer found for \"%s\"\n", __func__, encoding); return NULL; }
Writer_t* getDefaultAudioWriter() { int i; for (i = 0; AvailableWriter[i] != NULL; i++) { if (strcmp(AvailableWriter[i]->caps->textEncoding, "A_MP3") == 0) { writer_printf(50, "%s: found writer \"%s\"\n", __func__, AvailableWriter[i]->caps->name); return AvailableWriter[i]; } } writer_printf(1, "%s: no writer found\n", __func__); return NULL; }
int fb_write(writer_t *w, const disp_t *_d) { const struct disp_fb *d = &_d->disp.fb; writer_printf(w, "%s \"%s\" %d %d", _d->dclass->short_name, CSTR(_d->name), d->n, d->form); writer_printf(w, " %g %g", d->n_inf, d->eg); writer_newline_enter(w); struct fb_osc *fb = d->osc; int i; for (i = 0; i < d->n; i++, fb++) { if (i > 0) { writer_newline(w); } writer_printf(w, "%g %g %g", fb->a, fb->b, fb->c); } writer_newline_exit(w); return 0; }
int disp_sample_table_write(writer_t *w, const disp_t *_d) { const struct disp_sample_table *d = &_d->disp.sample_table; writer_printf(w, "table \"%s\" %d", CSTR(_d->name), d->len); writer_newline_enter(w); rc_matrix_write(w, d->table, RC_MATRIX_TRANSPOSED); writer_newline_exit(w); return 0; }