#includePVR_CHANNEL* channel; ADDON_HANDLE handle; bool success = PVR->GetChannel(handle, uniqueID, &channel); if (success) { int id = channel->UniqueID(); // Do something with the ID }
#includeThis example shows how to compare the Unique IDs of two PVR channels using the CPVRChannel Unique ID method. Package library: Kodi PVR API.PVR_CHANNEL* channel1; PVR_CHANNEL* channel2; ADDON_HANDLE handle; bool success1 = PVR->GetChannel(handle, uniqueID1, &channel1); bool success2 = PVR->GetChannel(handle, uniqueID2, &channel2); if (success1 && success2) { int id1 = channel1->UniqueID(); int id2 = channel2->UniqueID(); if (id1 == id2) { // The channels are the same } }