SDK-Request: API-Documentation!

Module API help / support section for programmers.

Moderators: Dreamer, FredB, X05

BhaaL
Just popping in
Posts: 3
Joined: Tue Jul 31, 2007 12:56 pm

SDK-Request: API-Documentation!

Postby BhaaL » Wed Feb 27, 2008 11:45 am

Evenin' Folks!

I'd like to see an API-Documentation for upcoming versions of the SDK.
The header files are basically documented, but they lack details to a certain degree that often makes development a bit hard for module/plugin coders.

The most practical reason for that: SendMessage to DD.
It isnt always exactly clear how to use certain Messages.
My most recent struggle: DDMODAPI_CHL_GET_POINTER.
Rather than reading the file directly, I wanted to use built-in stuff to let DD take care of that. Simply using it with SendMessage, passing a PCHL as lParam didnt work.
The question: Do I have to call DDMODAPI_CHL_LOAD first? Does it return a Handle/Pointer/whatever that has to be passed to CHL_GET_POINTER, which then returns a PCHL address as return value of SendMessage?

Stuff like that should be documented in some way, as it isnt always the most convinient way to "simply" ask some other coder that already found out how to do this and that *blinks over to ScanMan*.

I'd at least like to see some more verbose comments in the header files, like mentioned above telling us to call some other func first, or what types to pass/get back as return.
I do not expect some fully blown CHM Helpfile, but at least something that makes live easier for those who love DD, and want to enhance it :)

Greetings, BhaaL

Hauppauge WinTV Nova-S-Plus PCI on Windoze XP Professional; AMD Athlon X2 4600+, 2 GB RAM, nVidia GeForce 7900 GT
User avatar
ScanMan
love DVB Dream!
Posts: 191
Joined: Fri Sep 08, 2006 4:52 am
Location: 49565 Germany

Postby ScanMan » Tue Mar 04, 2008 2:29 am

Hi Bhaal :D

If you want to have access to all scanned and tuneable channels you should 'order' a pointer to the internal ChannelList like that (in Delphi)

Code: Select all

SendMessage(hwndDD, WM_MODULE_MSG, DDMODAPI_CHL_GET_POINTER, Integer(@chl));
with chl: PCHL;

To be simply up to date of the actual running channel you best should evaluate the DD-Event 'AfterChannelChange' like that:

Code: Select all

// After every successfull tuner-lock
function AfterChannelChange(pChannelInfo: PChannelInfo): BOOL; stdcall; export;
var
ch : array[0..63] of Char;
begin
Move(pChannelInfo.ChName, ch, 64);
CurrentSat := pChannelInfo^.wSatPos;
CurrentNid := pChannelInfo^.wNID;
CurrentSid := pChannelInfo^.wSID;
CurrentChId := pChannelInfo^.dwChId;
........
result := false; // or true ????
end;
If you are looking for a sqecial channel and its Data (see PChannelInfo) do it like that:

Code: Select all

for i := 0 to MAX_FAVORITES - 1 do
begin
if chl^.Favorites[i].FavName[0] <> 0 then // if entry is in use
begin
s := PChar(@chl^.Favorites[i].FavName);
end;
end;
for i:= 0 to MAX_CHANNELS - 1 do
if (chl^.Channels[i].dwFreq <> 0) and // if entry is in use
(chl^.Channels[i].ChType <> 3) then // if EntryType is not DATA
begin
...
s := PChar(chl^.Channels[i].ChName);
...
end;
Set a specific channel from your decision:

Code: Select all

SendMessage(Data.DDhwnd, WM_MODULE_MSG, DDMODAPI_SET_CHANNEL_BY_CHID, SetCHL);
SetChl is a real integer - NOT A POINTER TO !

I hope this could help you out

:D ScanMan
.
Visit the german DD-Forum: www.dvbdream.de
_________________________________________
90cm Dish on Rotor STAB HH 120 / Uni-LNB + 90cm Dish / Dual-Quad-LNB to 9/8 MultiSwitch for 23.5°E/19.2°E --- SkyStar 2, SkyStar USB-Box plus, TwinHan 1041 S2, Technotrend S-3200 S2, DVBWorld S2, Terratec Cinergy T USB XE --- a few PCs with AMD-CPU/ASUS-Boards from Athlon-2400+ to 64 X2 5600+, 1-2GB RAM, totally up to 2 TB HardDisk, nVidia Graphics. All using XP-Professional - everytime up2date
BhaaL
Just popping in
Posts: 3
Joined: Tue Jul 31, 2007 12:56 pm

Postby BhaaL » Wed Mar 05, 2008 10:54 am

Heh, thanks for that :)

Yet I found out already why it didnt work for me:
Out of laziness (I wanted to avoid restarting DD every time I changed something on the code) I simply ran my module as external app, and ofc SendMessage with GET_CHL_POINTER returned an address that was outside my Application bounds :roll:

Still, more Comments for the Coders! 8)

Greetings, BhaaL
Hauppauge WinTV Nova-S-Plus PCI on Windoze XP Professional; AMD Athlon X2 4600+, 2 GB RAM, nVidia GeForce 7900 GT

Return to “Module / Plugin Programming”

Who is online

Users browsing this forum: No registered users and 1 guest