Jump to content
majstang

COM Favourites SendCommand issue

Recommended Posts

majstang

Hello,

There seem to be something wrong with the possibility to switch favourite channels via COM using the actions.ini codes.

iDVBViewer.SendCommand(11)  is supposed to switch to favourite 1 but switches to favourite 2. Im therefor forced to use

the more reliable PostMessage channel switching method.

 

Moreover Im wondering how it was intended to switch to channels with channel numbers greater than 9 when there is no option to Send favourite 0? 

For example sending this does switch to channel number 13 when aim was switching to no.12:

iDVBViewer.SendCommand(11)  

iDVBViewer.SendCommand(12)      

 

I would have imagined, if it had been possible/working, sending this would switch to fav channel 10:

iDVBViewer.SendCommand(11)

iDVBViewer.SendCommand(10)  

                      

Edited by majstang

Share this post


Link to post
Griga
23 hours ago, majstang said:

iDVBViewer.SendCommand(11)  is supposed to switch to favourite 1 but switches to favourite 2.

 

 0 or 1 based favourites numbering in DVBViewer?  Can be changed with Tweaker.exe. 0 or 1 based numbering in your post?

 

As far as it concerns channels and favourites, SendCommand works according to the numbering setting in DVBViewer, because it's an UI thing. SendCommand(11) switches over to favourite number 1. This may be the first favourite in the list (one based numbering) or the second (zero based numbering). Please note that you are not sending the index, but the number! It's like the user pressing numbers on the keyboard or the remote control.

 

23 hours ago, majstang said:

Im therefor forced to use the more reliable PostMessage channel switching method.

 

Well... there should be no difference. This is the implementation:

procedure TDVBViewer.SendCommand(CMD: Integer);
begin
  PostMessage(frmMain.Handle, WM_DVBVIEWER, MSG_REMOTE, Cmd + 100);
end;

 

23 hours ago, majstang said:

Moreover Im wondering how it was intended to switch to channels with channel numbers greater than 9 when there is no option to Send favourite 0? 

 

Of course there is. SendCommand(38). A bit out of order, dunno why. On zero based numbering: switches to favourite 0 (the first in the list). On one based numbering: no effect because there is no favourite 0.

 

23 hours ago, majstang said:

I would have imagined, if it had been possible/working, sending this would switch to fav channel 10:

 

This way:

 

iDVBViewer.SendCommand(11)

iDVBViewer.SendCommand(38)  

 

Please note: The "Favourites based OSD navigation" tweak swaps the meaning of the favourite and channel number commands. Otherwise the whole thing would be too easy :)

Share this post


Link to post
majstang
57 minutes ago, Griga said:

 0 or 1 based favourites numbering in DVBViewer?  Can be changed with Tweaker.exe. 0 or 1 based numbering in your post?

 

As far as it concerns channels and favourites, SendCommand works according to the numbering setting in DVBViewer, because it's an UI thing. SendCommand(11) switches over to favourite number 1. This may be the first favourite in the list (one based numbering) or the second (zero based numbering). Please note that you are not sending the index, but the number! It's like the user pressing numbers on the keyboard or the remote control.

Aha, it seems I have missed out on hidden features. Thanks for the, as always, very good explanations:)

 

57 minutes ago, Griga said:

Of course there is. SendCommand(38). A bit out of order, dunno why. On zero based numbering: switches to favourite 0 (the first in the list). On one based numbering: no effect because there is no favourite 0.

 

On 2017-05-01 at 11:40 AM, majstang said:

I would have imagined, if it had been possible/working, sending this would switch to fav channel 10:

 

This way:

 

iDVBViewer.SendCommand(11)

iDVBViewer.SendCommand(38)  

Oh, jeeez...I didnt look that far down in the actions.ini list. It was probably added later on when discovered it was missing +15 years ago:unsure: 

Great now Im abled to switch channels for the DVBViewer thumbnailed app via COM as well..thanks:D

Edited by majstang

Share this post


Link to post
majstang

Yep, it works:) Had to enable:

- Favourite based OSD Navigation

- One based channel and favourites numbering

and

- remove the dummy channel I previously had at channel position 0 (channel editor).

 

Then it works beautifully with exception from if Channel name contains OS reserved characters, which arent escaped, the channel switch OSD confirmation does not show up in upper left corner as it should, but the channel switches alright. That channelname is: Barnkanalen/SVT24

 

Quote

Please note: The "Favourites based OSD navigation" tweak swaps the meaning of the favourite and channel number commands. Otherwise the whole thing would be too easy :)

EDIT: Hmm...quite right, if tweaking "Favourite based OSD Navigation" swaps the meaning of the favourite and channel number commands. Which implies if enabled, Postmessage channelswitching works up to channel number 13...14+ is a no go. If disabled, COM channelswitching works up to channel 13...14+ is a no go.  

 

 

Edited by majstang

Share this post


Link to post
majstang

I may have found a second bug, besides OS reserved chars not being escaped in channel names which results in a no show in upper left OSD area during PostMessage/COM channelswitching. The second one refers to the "One based channel and favourites numbering" tweak and COM GetFavorites.Item/GetFavoritesList. It seems COM GetFavorites.Item/GetFavoritesList always returns a 0 based channel and favourites numbering and doesnt seem to be aware of the index change when a 1 based numbering is tweaked. This results in the initial problem in post 1 above for PostMessage/COM channelswitching. While if doing ordinary channelswitching in the DVBViewer it acknowledges the tweak perfectly fine.

Edited by majstang

Share this post


Link to post
Griga
1 hour ago, majstang said:

It seems COM GetFavorites.Item/GetFavoritesList always returns a 0 based channel and favourites numbering and doesnt seem to be aware of the index change when a 1 based numbering is tweaked.

 

The 0/1 based channel numbering is a UI thing. Everything that is not UI related (or with other words: refers to internal structures) is supposed to use the index, not the number, e.g. command line parameters. The index is always 0 based, the number depends on the tweak.

 

Internally DVBViewer does an index -> number conversion when it comes to displaying numbers and the other way round on user (keyboard) input. This may even be extended in future (if a user defined or logical channel numbering will ever get implemented... o:) ).

Share this post


Link to post
majstang
1 hour ago, Griga said:

The index is always 0 based, the number depends on the tweak.

Oh no, it proved to be impossible to find a failsafe way (handling all user scenarios) to do some programatical channelswitching. I really had high hopes finding a tweak safe solution when managing to get the GetFavoritesList array:( Well, I will have to come up with a workaround. Yes, as I understand it: creating the GetFavoritesList array retrieval will always start from zero, traditionally in languages like C (Delphi does obviously the same). In AHK it always starts from 1. Ok, things are as they are. After all the only complications for me is as long as using the GetFavoritesList array (retrieving channel ID Number (index) based on channelname) for COM channelswitching, 1 based channel numbering is impossible. Using 0 based channel numbering works, but channel 1 is displayed as 0.

 

1 hour ago, Griga said:

The 0/1 based channel numbering is a UI thing. Everything that is not UI related (or with other words: refers to internal structures) is supposed to use the index, not the number, e.g. command line parameters.

So, might there be any way for me to detect/query if tweak "0/1 based channel numbering" is true or false? If so it should be easier to handle things for the app.

 

EDIT: Found it..."FFavOne" in setup.xml:)

Edited by majstang

Share this post


Link to post
This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...