Update prototype API (3f739738
) for windows/dll compat
memory allocated by a .dll must be free()d by the given dll.
This commit is contained in:
parent
9773cfa926
commit
db2d238cec
@ -194,16 +194,26 @@ typedef struct {
|
|||||||
} LV2_Midnam;
|
} LV2_Midnam;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** query midnam document. The plugin
|
/** Query midnam document. The plugin
|
||||||
* is expected to return an allocated
|
* is expected to return a null-terminated XML
|
||||||
* null-terminated XML text, which is
|
* text which is a valid midnam desciption
|
||||||
* safe for the host to pass to free().
|
* (or NULL in case of error).
|
||||||
*
|
*
|
||||||
* The midnam <Model> must be unique and
|
* The midnam <Model> must be unique and
|
||||||
* specific for the given plugin-instance.
|
* specific for the given plugin-instance.
|
||||||
*/
|
*/
|
||||||
char* (*midnam)(LV2_Handle instance);
|
char* (*midnam)(LV2_Handle instance);
|
||||||
|
|
||||||
|
/** The unique model id used ith the midnam,
|
||||||
|
* (or NULL).
|
||||||
|
*/
|
||||||
char* (*model)(LV2_Handle instance);
|
char* (*model)(LV2_Handle instance);
|
||||||
|
|
||||||
|
/** free allocated strings. The host
|
||||||
|
* calls this for every value returned by
|
||||||
|
* \ref midnam and \ref model.
|
||||||
|
*/
|
||||||
|
void (*free)(char*);
|
||||||
} LV2_Midnam_Interface;
|
} LV2_Midnam_Interface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -985,7 +985,7 @@ LV2Plugin::read_midnam () {
|
|||||||
MIDI::Name::MidiPatchManager::instance().remove_custom_midnam (ss.str());
|
MIDI::Name::MidiPatchManager::instance().remove_custom_midnam (ss.str());
|
||||||
rv = MIDI::Name::MidiPatchManager::instance().add_custom_midnam (ss.str(), midnam);
|
rv = MIDI::Name::MidiPatchManager::instance().add_custom_midnam (ss.str(), midnam);
|
||||||
}
|
}
|
||||||
free (midnam);
|
_midname_interface->free (midnam);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -999,7 +999,7 @@ LV2Plugin::midnam_model () {
|
|||||||
if (model) {
|
if (model) {
|
||||||
rv = model;
|
rv = model;
|
||||||
}
|
}
|
||||||
free (model);
|
_midname_interface->free (model);
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user