Page 1 of 1

Changing channel

Posted: Wed Jun 04, 2014 1:39 am
by sgs
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.

Re: Changing channel

Posted: Wed Jun 04, 2014 12:03 pm
by rel
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.

Re: Changing channel

Posted: Wed Jun 04, 2014 11:54 pm
by sgs
Sorry, when I got home I noticed that I was passing the address of chid, not the value.