Skip to content
MasterSceneManagerCallbackHandler.h 5.13 KiB
Newer Older
Nicolas Metts's avatar
Nicolas Metts committed
class MasterSceneManagerCallbackHandler : public MasterSceneManagerCallback {
    void GetMasterSceneReplyCB(const LSFResponseCode& responseCode, const LSFString& masterSceneID, const MasterScene& masterScene) {
        printf("\n%s(): responseCode = %s, masterSceneID=%s\n", __func__, LSFResponseCodeText(responseCode), masterSceneID.c_str());
        if (responseCode == LSF_OK) {
            printf("\nmasterScene=%s", masterScene.c_str());
        }
        gotReply = true;
        if (numRepliesToWait) {
            numRepliesToWait--;
        }
    }

    void GetAllMasterSceneIDsReplyCB(const LSFResponseCode& responseCode, const LSFStringList& masterSceneIDs) {
        printf("\n%s(): responseCode = %s", __func__, LSFResponseCodeText(responseCode));
        if (responseCode == LSF_OK) {
            LSFStringList::const_iterator it = masterSceneIDs.begin();
            uint8_t count = 1;
            for (; it != masterSceneIDs.end(); ++it) {
                printf("\n(%d)%s", count, (*it).c_str());
                count++;
            }
            printf("\n");
        }
        gotReply = true;
    }

    void GetMasterSceneNameReplyCB(const LSFResponseCode& responseCode, const LSFString& masterSceneID, const LSFString& language, const LSFString& masterSceneName) {
        LSFString uniqueId = masterSceneID;

        printf("\n%s: responseCode = %s masterSceneID = %s language = %s", __func__, LSFResponseCodeText(responseCode), uniqueId.c_str(), language.c_str());

        if (responseCode == LSF_OK) {
            printf("\nmasterSceneName = %s", masterSceneName.c_str());
        }
        gotReply = true;
        if (numRepliesToWait) {
            numRepliesToWait--;
        }
    }

    void SetMasterSceneNameReplyCB(const LSFResponseCode& responseCode, const LSFString& masterSceneID, const LSFString& language) {
        LSFString uniqueId = masterSceneID;
        printf("\n%s: responseCode = %s masterSceneID = %s language = %s", __func__, LSFResponseCodeText(responseCode), uniqueId.c_str(), language.c_str());
        gotReply = true;
        if (LSF_OK != responseCode) {
            gotSignal = true;
        }
    }

    void MasterScenesNameChangedCB(const LSFStringList& masterSceneIDs) {
        printf("\n%s", __func__);
        LSFStringList::const_iterator it = masterSceneIDs.begin();
        for (; it != masterSceneIDs.end(); ++it) {
            printf("\n%s", (*it).c_str());
        }
        printf("\n");
        gotSignal = true;
    }

    void CreateMasterSceneReplyCB(const LSFResponseCode& responseCode, const LSFString& masterSceneID) {
        printf("\n%s: responseCode=%s\n", __func__, LSFResponseCodeText(responseCode));
        if (LSF_OK == responseCode) {
            printf("masterSceneID=%s\n", masterSceneID.c_str());
        } else {
            gotSignal = true;
        }
        gotReply = true;
    }

    void MasterScenesCreatedCB(const LSFStringList& masterSceneIDs) {
        printf("\n%s", __func__);
        LSFStringList::const_iterator it = masterSceneIDs.begin();
        for (; it != masterSceneIDs.end(); ++it) {
            printf("\n%s", (*it).c_str());
        }
        printf("\n");
        gotSignal = true;
    }

    void UpdateMasterSceneReplyCB(const LSFResponseCode& responseCode, const LSFString& masterSceneID) {
        printf("\n%s(): responseCode = %s, masterSceneID=%s\n", __func__, LSFResponseCodeText(responseCode), masterSceneID.c_str());
        gotReply = true;
        if (LSF_OK != responseCode) {
            gotSignal = true;
        }
    }

    void MasterScenesUpdatedCB(const LSFStringList& masterSceneIDs) {
        printf("\n%s", __func__);
        LSFStringList::const_iterator it = masterSceneIDs.begin();
        for (; it != masterSceneIDs.end(); ++it) {
            printf("\n%s", (*it).c_str());
        }
        printf("\n");
        gotSignal = true;
    }

    void DeleteMasterSceneReplyCB(const LSFResponseCode& responseCode, const LSFString& masterSceneID) {
        printf("\n%s(): responseCode = %s, masterSceneID=%s\n", __func__, LSFResponseCodeText(responseCode), masterSceneID.c_str());
        gotReply = true;
        if (LSF_OK != responseCode) {
            gotSignal = true;
        }
    }

    void MasterScenesDeletedCB(const LSFStringList& masterSceneIDs) {
        printf("\n%s", __func__);
        LSFStringList::const_iterator it = masterSceneIDs.begin();
        for (; it != masterSceneIDs.end(); ++it) {
            printf("\n%s", (*it).c_str());
        }
        printf("\n");
        gotSignal = true;
    }

    void ApplyMasterSceneReplyCB(const LSFResponseCode& responseCode, const LSFString& masterSceneID) {
        printf("\n%s(): responseCode = %s, masterSceneID=%s\n", __func__, LSFResponseCodeText(responseCode), masterSceneID.c_str());
        gotReply = true;
        if (LSF_OK != responseCode) {
            gotSignal = true;
        }
    }

    void MasterScenesAppliedCB(const LSFStringList& masterSceneIDs) {
        printf("\n%s", __func__);
        LSFStringList::const_iterator it = masterSceneIDs.begin();
        for (; it != masterSceneIDs.end(); ++it) {
            printf("\n%s", (*it).c_str());
        }
        printf("\n");
        gotSignal = true;
    }
};