Changing channel

Module API help / support section for programmers.

Moderators: Dreamer, FredB, X05

sgs
Just can't stay away
Posts: 27
Joined: Wed May 14, 2014 4:59 am

Changing channel

Postby sgs » Wed Jun 04, 2014 1:39 am

I was trying (and failing) to change the channel by using the following command:

SendMessage(hwndDD, WM_MODULE_MSG, DDMODAPI_SET_CHANNEL_BY_CHID, chid);

So I was going to ask if this was the correct command although I just looked through the DDDisecq sample and saw this:

SendMessage(hwndDD, WM_MODULE_MSG, DDMODAPI_GET_CHANNEL_ID, (LPARAM)&chid);
SendMessage(hwndDD, WM_MODULE_MSG, DDMODAPI_SET_CHANNEL_BY_CHNO, chid);

What is the difference between DDMODAPI_SET_CHANNEL_BY_CHNO and DDMODAPI_SET_CHANNEL_BY_CHID?

I don't have time to test this until I get home but hopefully DDMODAPI_SET_CHANNEL_BY_CHNO works.

User avatar
rel
relocation
Posts: 2051
Joined: Fri Jun 16, 2006 9:50 am

Re: Changing channel

Postby rel » Wed Jun 04, 2014 12:03 pm

CHID is the index in CHL's Channels array.
CHNO is the channel number assigned by user (for remote controls, user can re-arrange channels etc in remote tab of DVB Dream)

your usage looks alright. Please check if DD main window handle (hwndDD) is correct, if other API functions work fine.
SendMessage(hwndDD, WM_MODULE_MSG, DDMODAPI_SET_CHANNEL_BY_CHID, ChID);

You can search in Channels array by name inside a for-loop, then return the index of for loop. That would be ChID.
DVB Dream - because I have to dream about having time to code it
sgs
Just can't stay away
Posts: 27
Joined: Wed May 14, 2014 4:59 am

Re: Changing channel

Postby sgs » Wed Jun 04, 2014 11:54 pm

Sorry, when I got home I noticed that I was passing the address of chid, not the value.

Return to “Module / Plugin Programming”

Who is online

Users browsing this forum: No registered users and 1 guest