Commit 8e0904bd authored by Sylvain Berfini's avatar Sylvain Berfini :cow:
Browse files

Added ms_snd_card_set_name(), only to be used in detect() method

Showing with 19 additions and 0 deletions
......@@ -562,6 +562,15 @@ MS2_PUBLIC const char *ms_snd_card_device_type_to_string(const MSSndCardDeviceTy
*/
MS2_PUBLIC const char *ms_snd_card_get_name(const MSSndCard *obj);
/**
* Sets the sound card's name.
* Warning: only call this method while in the detect() method, not after!
*
* @param obj A sound card object.
* @param new_name The new name for the soundcard
*/
MS2_PUBLIC void ms_snd_card_set_name(MSSndCard *obj, const char *new_name);
/**
* Retreive sound card's name ($driver_type: $name).
*
......
......@@ -427,6 +427,16 @@ const char *ms_snd_card_get_name(const MSSndCard *obj) {
return obj->name;
}
void ms_snd_card_set_name(MSSndCard *obj, const char *new_name) {
if (obj->name) {
ms_free(obj->name);
obj->name = NULL;
}
if (new_name) {
obj->name = ms_strdup(new_name);
}
}
unsigned int ms_snd_card_get_capabilities(const MSSndCard *obj) {
return obj->capabilities;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment