int kr_mixer_path_info_fr_ebml(kr_ebml *ebml, void *st) {
  uber_St uber;
  int i;
  int res;
  struct kr_mixer_path_info *actual;

  res = 0;

  if ((ebml == NULL) || (st == NULL)) {
    return -1;
  }

  actual = (struct kr_mixer_path_info *)st;

  res += kr_ebml2_unpack_element_string(ebml, NULL, actual->name , sizeof(actual->name));
  res += kr_ebml2_unpack_element_string(ebml, NULL, actual->bus , sizeof(actual->bus));
  res += kr_ebml2_unpack_element_string(ebml, NULL, actual->crossfade_group , sizeof(actual->crossfade_group));
  uber.actual = &(actual->channels);
  uber.type = DEBML_KR_MIXER_CHANNELS;
  res += info_unpack_fr_ebml(&ebml[res],&uber);
  uber.actual = &(actual->type);
  uber.type = DEBML_KR_MIXER_PATH_TYPE;
  res += info_unpack_fr_ebml(&ebml[res],&uber);
  res += kr_ebml2_unpack_element_float(ebml, NULL, &actual->fade);
  for (i = 0; i < KR_MXR_MAX_CHANNELS; i++) {
    res += kr_ebml2_unpack_element_float(ebml, NULL, &actual->volume[i]);
  }
  for (i = 0; i < KR_MXR_MAX_CHANNELS; i++) {
    res += kr_ebml2_unpack_element_int32(ebml, NULL, &actual->map[i]);
  }
  for (i = 0; i < KR_MXR_MAX_CHANNELS; i++) {
    res += kr_ebml2_unpack_element_int32(ebml, NULL, &actual->mixmap[i]);
  }
  for (i = 0; i < KR_MXR_MAX_CHANNELS; i++) {
    res += kr_ebml2_unpack_element_float(ebml, NULL, &actual->rms[i]);
  }
  for (i = 0; i < KR_MXR_MAX_CHANNELS; i++) {
    res += kr_ebml2_unpack_element_float(ebml, NULL, &actual->peak[i]);
  }
  res += kr_ebml2_unpack_element_int32(ebml, NULL, &actual->delay);
  uber.actual = &(actual->lowpass);
  uber.type = DEBML_KR_LOWPASS_INFO;
  res += info_unpack_fr_ebml(&ebml[res],&uber);
  uber.actual = &(actual->highpass);
  uber.type = DEBML_KR_HIGHPASS_INFO;
  res += info_unpack_fr_ebml(&ebml[res],&uber);
  uber.actual = &(actual->analog);
  uber.type = DEBML_KR_ANALOG_INFO;
  res += info_unpack_fr_ebml(&ebml[res],&uber);
  uber.actual = &(actual->eq);
  uber.type = DEBML_KR_EQ_INFO;
  res += info_unpack_fr_ebml(&ebml[res],&uber);

  return res;
}
示例#2
0
static int kr_ebml_to_mixer_portgroup_rep (kr_ebml2_t *ebml, kr_mixer_portgroup_t *portgroup_rep) {

  int i;
  char string[256];

  kr_ebml2_unpack_element_string (ebml, NULL, portgroup_rep->sysname, sizeof(portgroup_rep->sysname));
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &portgroup_rep->channels);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &portgroup_rep->direction);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &portgroup_rep->output_type);

  kr_ebml2_unpack_element_string (ebml, NULL, string, sizeof(string));

  if (strncmp (string, "Jack", 4) == 0) {
    portgroup_rep->io_type = 0;
  } else {
    portgroup_rep->io_type = 1;    
  }
  
  for (i = 0; i < portgroup_rep->channels; i++) {
    kr_ebml2_unpack_element_float (ebml, NULL, &portgroup_rep->volume[i]);
  }
  
  for (i = 0; i < portgroup_rep->channels; i++) {
    kr_ebml2_unpack_element_float (ebml, NULL, &portgroup_rep->peak[i]);
  }
  
  for (i = 0; i < portgroup_rep->channels; i++) {
    kr_ebml2_unpack_element_float (ebml, NULL, &portgroup_rep->rms[i]);
  }

  kr_ebml2_unpack_element_string (ebml, NULL, portgroup_rep->mixbus, sizeof(portgroup_rep->mixbus));
  kr_ebml2_unpack_element_string (ebml, NULL, portgroup_rep->crossfade_group, sizeof(portgroup_rep->crossfade_group));
  kr_ebml2_unpack_element_float (ebml, NULL, &portgroup_rep->fade);

  kr_ebml2_unpack_element_uint32 (ebml, NULL, &portgroup_rep->has_xmms2);
  
  if (portgroup_rep->has_xmms2 == 1) {
    kr_ebml2_unpack_element_string (ebml, NULL, portgroup_rep->xmms2_ipc_path, sizeof(portgroup_rep->xmms2_ipc_path));
  }
  
  kr_ebml2_unpack_element_data (ebml, NULL, &portgroup_rep->eq, sizeof (portgroup_rep->eq));
  
  kr_ebml2_unpack_element_float (ebml, NULL, &portgroup_rep->lowpass.hz);
  kr_ebml2_unpack_element_float (ebml, NULL, &portgroup_rep->lowpass.bandwidth);
  
  kr_ebml2_unpack_element_float (ebml, NULL, &portgroup_rep->highpass.hz);
  kr_ebml2_unpack_element_float (ebml, NULL, &portgroup_rep->highpass.bandwidth);
  
  kr_ebml2_unpack_element_float (ebml, NULL, &portgroup_rep->analog.drive);
  kr_ebml2_unpack_element_float (ebml, NULL, &portgroup_rep->analog.blend);

  return 1;
}
示例#3
0
static int kr_mixer_response_get_string_from_subunit_control (kr_crate_t *crate, char **string) {

  int len;
  float real;

  len = 0;

  if (crate->addr->path.subunit.mixer_subunit == KR_PORTGROUP) {
    if ((crate->addr->control.portgroup_control == KR_VOLUME) || (crate->addr->control.portgroup_control == KR_CROSSFADE) ||
         (crate->addr->control.portgroup_control == KR_PEAK)) {
      kr_ebml2_unpack_element_float (&crate->payload_ebml, NULL, &real);
      len += sprintf (*string + len, "%5.2f", real);
    }
    if ((crate->addr->control.portgroup_control == KR_CROSSFADE_GROUP) || (crate->addr->control.portgroup_control == KR_XMMS2_IPC_PATH)) {
      kr_ebml2_unpack_element_string (&crate->payload_ebml, NULL, *string + len, 32);
      len += strlen (*string + len);
    }
  } else {
    if (crate->addr->path.subunit.mixer_subunit == KR_EFFECT) {
      kr_ebml2_unpack_element_float (&crate->payload_ebml, NULL, &real);
      len += sprintf (*string + len, "%5.2f", real);
    }
  }
    
  return len; 
}
示例#4
0
static void kr_ebml_to_mixer_rep (kr_ebml2_t *ebml, kr_mixer_t *mixer_rep) {
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &mixer_rep->sample_rate);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &mixer_rep->inputs);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &mixer_rep->outputs);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &mixer_rep->buses);
  kr_ebml2_unpack_element_string (ebml, NULL, mixer_rep->time_source, sizeof(mixer_rep->time_source));
}
int kr_adapter_path_info_fr_ebml(kr_ebml *ebml, void *st) {
  uber_St uber;
  uber_St uber_sub;
  int index;
  int res;
  struct kr_adapter_path_info *actual;

  res = 0;

  if ((ebml == NULL) || (st == NULL)) {
    return -1;
  }

  actual = (struct kr_adapter_path_info *)st;

  res += kr_ebml2_unpack_element_string(ebml, NULL, actual->name , sizeof(actual->name));
  uber.actual = &(actual->dir);
  uber.type = DEBML_KR_ADAPTER_PATH_DIRECTION;
  res += info_unpack_fr_ebml(&ebml[res],&uber);
  uber.actual = &(actual->api);
  uber.type = DEBML_KR_ADAPTER_API;
  res += info_unpack_fr_ebml(&ebml[res],&uber);
  index = kr_adapter_api_to_index(actual->api);
  uber_sub.type = index;
  uber_sub.actual = &(actual->info);
  uber.actual = &(uber_sub);
  uber.type = DEBML_KR_ADAPTER_API_PATH_INFO;
  res += info_unpack_fr_ebml(&ebml[res],&uber);

  return res;
}
static void kr_ebml_to_text_rep (kr_ebml2_t *ebml, kr_text_t *text) {
  
  kr_ebml2_unpack_element_string (ebml, NULL, text->text, sizeof(text->text));
  kr_ebml2_unpack_element_string (ebml, NULL, text->font, sizeof(text->font));

  kr_ebml2_unpack_element_float (ebml, NULL, &text->red);
  kr_ebml2_unpack_element_float (ebml, NULL, &text->green);
  kr_ebml2_unpack_element_float (ebml, NULL, &text->blue);

  kr_ebml2_unpack_element_uint32 (ebml, NULL, &text->controls.x);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &text->controls.y);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &text->controls.z);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &text->controls.width);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &text->controls.height);      

  kr_ebml2_unpack_element_float (ebml, NULL, &text->controls.xscale);
  kr_ebml2_unpack_element_float (ebml, NULL, &text->controls.opacity);
  kr_ebml2_unpack_element_float (ebml, NULL, &text->controls.rotation);
}
static void kr_ebml_to_sprite_rep (kr_ebml2_t *ebml, kr_sprite_t *sprite) {

  kr_ebml2_unpack_element_string (ebml, NULL, sprite->filename, sizeof(sprite->filename));

  kr_ebml2_unpack_element_uint32 (ebml, NULL, &sprite->controls.x);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &sprite->controls.y);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &sprite->controls.z);
  
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &sprite->controls.tickrate);

  kr_ebml2_unpack_element_float (ebml, NULL, &sprite->controls.xscale);
  kr_ebml2_unpack_element_float (ebml, NULL, &sprite->controls.yscale);

  kr_ebml2_unpack_element_float (ebml, NULL, &sprite->controls.opacity);
  kr_ebml2_unpack_element_float (ebml, NULL, &sprite->controls.rotation);
}
static void kr_ebml_to_videoport_rep (kr_ebml2_t *ebml, kr_port_t *port) {
  kr_ebml2_unpack_element_string (ebml, NULL, port->sysname, sizeof(port->sysname));
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->direction );
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->controls.x);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->controls.y);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->controls.z);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->source_width);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->source_height);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->crop_x);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->crop_y);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->crop_width);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->crop_height);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->controls.width);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &port->controls.height);
  kr_ebml2_unpack_element_float (ebml, NULL, &port->controls.opacity);
  kr_ebml2_unpack_element_float (ebml, NULL, &port->controls.rotation);
}
int kr_alsa_info_fr_ebml(kr_ebml *ebml, void *st) {
  int res;
  struct kr_alsa_info *actual;

  res = 0;

  if ((ebml == NULL) || (st == NULL)) {
    return -1;
  }

  actual = (struct kr_alsa_info *)st;

  res += kr_ebml2_unpack_element_int32(ebml, NULL, &actual->card);
  res += kr_ebml2_unpack_element_string(ebml, NULL, actual->name , sizeof(actual->name));

  return res;
}
示例#10
0
static void kr_ebml_to_compositor_rep (kr_ebml2_t *ebml, kr_compositor_t *kr_compositor_rep) {

  kr_ebml2_unpack_element_uint32 (ebml, NULL, &kr_compositor_rep->width);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &kr_compositor_rep->height);

  kr_ebml2_unpack_element_uint32 (ebml, NULL, &kr_compositor_rep->fps_numerator);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &kr_compositor_rep->fps_denominator);

  kr_ebml2_unpack_element_uint32 (ebml, NULL, &kr_compositor_rep->sprites);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &kr_compositor_rep->texts);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &kr_compositor_rep->vectors);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &kr_compositor_rep->inputs);
  kr_ebml2_unpack_element_uint32 (ebml, NULL, &kr_compositor_rep->outputs);
  kr_ebml2_unpack_element_uint64 (ebml, NULL, &kr_compositor_rep->frames);

  kr_ebml2_unpack_element_string (ebml, NULL, kr_compositor_rep->background_filename,
                                  sizeof(kr_compositor_rep->background_filename));
}
示例#11
0
int kr_mixer_info_fr_ebml(kr_ebml *ebml, void *st) {
  int res;
  struct kr_mixer_info *actual;

  res = 0;

  if ((ebml == NULL) || (st == NULL)) {
    return -1;
  }

  actual = (struct kr_mixer_info *)st;

  res += kr_ebml2_unpack_element_uint32(ebml, NULL, &actual->period_size);
  res += kr_ebml2_unpack_element_uint32(ebml, NULL, &actual->sample_rate);
  res += kr_ebml2_unpack_element_uint32(ebml, NULL, &actual->inputs);
  res += kr_ebml2_unpack_element_uint32(ebml, NULL, &actual->buses);
  res += kr_ebml2_unpack_element_uint32(ebml, NULL, &actual->outputs);
  res += kr_ebml2_unpack_element_uint64(ebml, NULL, &actual->frames);
  res += kr_ebml2_unpack_element_uint64(ebml, NULL, &actual->timecode);
  res += kr_ebml2_unpack_element_string(ebml, NULL, actual->clock , sizeof(actual->clock));

  return res;
}
int kr_transponder_path_info_fr_ebml(kr_ebml *ebml, void *st) {
  uber_St uber;
  int res;
  struct kr_transponder_path_info *actual;

  res = 0;

  if ((ebml == NULL) || (st == NULL)) {
    return -1;
  }

  actual = (struct kr_transponder_path_info *)st;

  res += kr_ebml2_unpack_element_string(ebml, NULL, actual->name , sizeof(actual->name));
  uber.actual = &(actual->input);
  uber.type = DEBML_KR_TRANSPONDER_PATH_IO_INFO;
  res += info_unpack_fr_ebml(&ebml[res],&uber);
  uber.actual = &(actual->output);
  uber.type = DEBML_KR_TRANSPONDER_PATH_IO_INFO;
  res += info_unpack_fr_ebml(&ebml[res],&uber);

  return res;
}