Need polarization of channel in BeforeChannelChange function

Module API help / support section for programmers.

Moderators: Dreamer, FredB, X05

3dOptics
Just can't stay away
Posts: 28
Joined: Sun Jun 28, 2009 11:58 pm

Need polarization of channel in BeforeChannelChange function

Postby 3dOptics » Thu Jul 16, 2009 8:42 pm

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;
}

TBS 6920 PCI-Express DVB-S/DVB-S2, Driver Version: 1.0.5.1
Windows Vista Business SP2 32bit
Gigabyte GA-MA780G-UD3H
ATI HD4550
AMD Athlon 64 X2 6000+ 3.0GHz
4gb of ram
DVBdream 2.2c OEM
Goldeneye
Posts: 2
Joined: Tue Oct 21, 2008 4:45 pm

Postby Goldeneye » Sun Aug 02, 2009 6:34 am

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)
3dOptics
Just can't stay away
Posts: 28
Joined: Sun Jun 28, 2009 11:58 pm

Postby 3dOptics » Mon Aug 03, 2009 7:58 pm

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;
TBS 6920 PCI-Express DVB-S/DVB-S2, Driver Version: 1.0.5.1
Windows Vista Business SP2 32bit
Gigabyte GA-MA780G-UD3H
ATI HD4550
AMD Athlon 64 X2 6000+ 3.0GHz
4gb of ram
DVBdream 2.2c OEM
Goldeneye
Posts: 2
Joined: Tue Oct 21, 2008 4:45 pm

Postby Goldeneye » Sun Aug 09, 2009 7:14 am

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;

Return to “Module / Plugin Programming”

Who is online

Users browsing this forum: No registered users and 1 guest