Make it possible to get controller name with tdControllerValue

The name can be changed with tdSetControllerValue but unless you listen to the
change event you had to fetch all controllers again to get the new name.
This commit is contained in:
Erik Johansson 2012-03-13 15:24:30 +01:00
parent 4760aa8a32
commit 5e49cfffe4
2 changed files with 3 additions and 1 deletions

View file

@ -727,7 +727,7 @@ int WINAPI tdController(int *controllerId, int *controllerType, char *name, int
/**
* This function gets a parameter on a controller.
* Valid parameters are: \c serial \c and firmware
* Valid parameters are: \c serial, \c name and \c firmware
*
* Added in version 2.1.2.
* @param controllerId The controller to change

View file

@ -277,6 +277,8 @@ std::wstring ControllerManager::getControllerValue(int id, const std::wstring &n
}
if (name == L"serial") {
return it->second.serial;
} else if (name == L"name") {
return it->second.name;
} else if (name == L"firmware") {
if (!it->second.controller) {
return L"-1";