Browse Source

pt6

tags/1.9.4
falkTX 11 years ago
parent
commit
beb9ae6471
1 changed files with 9 additions and 8 deletions
  1. +9
    -8
      source/modules/lilv/lilv-0.16.0/src/state.c

+ 9
- 8
source/modules/lilv/lilv-0.16.0/src/state.c View File

@@ -374,7 +374,7 @@ lilv_state_new_from_instance(const LilvPlugin* plugin,
// Store properties
const LV2_Descriptor* desc = instance->lv2_descriptor;
const LV2_State_Interface* iface = (desc->extension_data)
? (LV2_State_Interface*)desc->extension_data(LV2_STATE__interface)
? (const LV2_State_Interface*)desc->extension_data(LV2_STATE__interface)
: NULL;

if (iface) {
@@ -489,11 +489,12 @@ new_state_from_model(LilvWorld* world,
} else if (value) {
chunk.len = 0;
sratom_read(sratom, &forge, world->world, model, value);
LV2_Atom* atom = (LV2_Atom*)chunk.buf;
const LV2_Atom* atom = (const LV2_Atom*)chunk.buf;

append_port_value(state,
(const char*)sord_node_get_string(symbol),
LV2_ATOM_BODY(atom), atom->size, atom->type);
LV2_ATOM_BODY_CONST(atom),
atom->size, atom->type);

if (label) {
lilv_state_set_label(state,
@@ -520,15 +521,15 @@ new_state_from_model(LilvWorld* world,
&forge, sratom_forge_sink, sratom_forge_deref, &chunk);

sratom_read(sratom, &forge, world->world, model, o);
LV2_Atom* atom = (LV2_Atom*)chunk.buf;
uint32_t flags = LV2_STATE_IS_POD|LV2_STATE_IS_PORTABLE;
Property prop = { NULL, 0, 0, 0, flags };
const LV2_Atom* atom = (const LV2_Atom*)chunk.buf;
uint32_t flags = LV2_STATE_IS_POD|LV2_STATE_IS_PORTABLE;
Property prop = { NULL, 0, 0, 0, flags };

prop.key = map->map(map->handle, (const char*)sord_node_get_string(p));
prop.type = atom->type;
prop.size = atom->size;
prop.value = malloc(atom->size);
memcpy(prop.value, LV2_ATOM_BODY(atom), atom->size);
memcpy(prop.value, LV2_ATOM_BODY_CONST(atom), atom->size);
if (atom->type == forge.Path) {
prop.flags = LV2_STATE_IS_PORTABLE;
}
@@ -701,7 +702,7 @@ add_state_to_manifest(const LilvNode* plugin_uri,
const char* state_uri,
const char* state_path)
{
FILE* fd = fopen((char*)manifest_path, "a");
FILE* fd = fopen(manifest_path, "a");
if (!fd) {
LILV_ERRORF("Failed to open %s (%s)\n",
manifest_path, strerror(errno));


Loading…
Cancel
Save