Page 1 of 1

Need polarization of channel in BeforeChannelChange function

Posted: Thu Jul 16, 2009 8:42 pm
by 3dOptics
I would like to retrieve the polarization of the channel being tuned. I tried doing this but I am getting the polarization of the previous channel instead of the channel being tuned. Any ideas of how I can solve this problem? Thanks.

Code: Select all

int __stdcall BeforeChannelChange (TChannelInfo *pChannelInfo)
{
TTransponderInfo trans_info; // '0' is Horizontal and '1'is Vertical
trans_info.dwSize = sizeof TTransponderInfo;
SendMessage(hwndDD, WM_MODULE_MSG, DDMODAPI_GET_TRANSPONDER_INFO, (LPARAM)&trans_info);

char szBuf[100];
wsprintf(szBuf, "Sat Position: %d\nPolarization: %d\n", pChannelInfo->wSatPos, trans_info.Pol);
MessageBox(hwndDD, szBuf, "Notice", MB_OK);

return FALSE;
}

Posted: Sun Aug 02, 2009 6:34 am
by Goldeneye
Been a while since i last worked with dvbdreams api - but i think DDMODAPI_GET_TRANSPONDER_INFO is supposed to return info for the previous channel in BeforeChannelChange, as Before suggests the channel change did not yet happen. Instead you should look for the info in the supplied pChannelInfo parameter. or retrieve the channel corresponding to pChannelInfo from the channel list if TChannelInfo doesn't include all channel information (can't remember)

Posted: Mon Aug 03, 2009 7:58 pm
by 3dOptics
Been a while since i last worked with dvbdreams api - but i think DDMODAPI_GET_TRANSPONDER_INFO is supposed to return info for the previous channel in BeforeChannelChange, as Before suggests the channel change did not yet happen. Instead you should look for the info in the supplied pChannelInfo parameter. or retrieve the channel corresponding to pChannelInfo from the channel list if TChannelInfo doesn't include all channel information (can't remember)
I thought about getting the Polarization from pChannelInfo but the structure does not include the Polarization for the channel. It includes the Satellite Position, but does not include the Polarization.

// Channel Info
typedef struct
{
DWORD dwSize;
WORD wNID;
WORD wSID;
WORD wSatPos;
DWORD dwChId;
char ChName[64];
char Provider[64];
BYTE ChType;
BYTE Scrambled;
WORD wVideo;
WORD wPMT;
WORD wPCR;
WORD wTTX;
TAudioInfo Audio;
TCAInfo ECM;
TCAInfo EMM;
WORD wChNo;
}TChannelInfo, *PChannelInfo;

Posted: Sun Aug 09, 2009 7:14 am
by Goldeneye
Oh didn't remember the TChannelInfo is not the same as the channel list entry (TChlChannel).
But you can use the dwChId of TChannelInfo to look up the channel list entry.

get pointer to channel list:
PCHL myChlP;
SendMessage(hwndDD, WM_MODULE_MSG, DDMODAPI_CHL_GET_POINTER, (LPARAM)&myChlP);

and read the polarisation
BYTE pol = myChlP->Channels[pChannelInfo->dwChId].Pol;