Seite 1 von 9

TMSCommander

Verfasst: So 21. Mär 2010, 22:29
von deangelj
(please excuse me using English as I cannot write in German)

I have written a replacement for TAPCommander, called TMSCommander. What this TAP does is once a TAP has the appropriate code in its event handler, TMSCommander can call it to tell it to display its menu (or perform other functions). Below is a graphic for its menu - it basically discovers at run time which TAPs it can talk to, then you scroll to that line and press OK to call the menu.

I would like to thank Firebird for his library and help.

Download here: TMSCommander
Last version attached below.

Fixes/changes in 1.6
- Support Favourite TAPs
- Support stopping/starting any TAP
- Added Dutch language thanks to Roger-DTL-Stijfs

Fixes/changes in 1.5
- Remove Network Listener
- Refresh menu buttons when enable/disable-ing

Fixes/changes in 1.4
- Menu option for Network listener timeout seconds

Fixes/changes in 1.3
- When selecting an item by number update the buttons available for that item
- When selecting an item by number allow 0 to select the 10th item

Fixes/changes in 1.2
- Listen on network port for commands.
- On exiting TMSCommander pass Exit key on.
- Check for Info box on screen on processing TMSCommander key
- Allow OK button for UserEvent. If OK and no UserEvent default to Menu
- Allow selection of TAP using the numbers for the item
- uses FireBird’s KeyTranslate to support different remotes/boxes

Fixes/changes in 1.1
- Allow TMSCommander to work without the language file – it will default to English
(this is for those users that find it difficult to get the lng file onto the box)

Fixes/changes in 1.0
- this version allows a TAP writer to support another calling method (UserEvent).
For example say a TAP has a menu but also has another screen - then by supporting the UserEvent,
a user can use TMSCommander and press the yellow key on the TAP list to call the TAP's other screen.

Fixes/changes in 0.9
- fixes the reboot issue with disabled TAPs

Fixes/changes in 0.8
- add general language support (German/English language file included) - thanks to Olaf/Firebird
- Firebird's mods to disable taps
Need to copy the TMSCommander.lng file to the same folder as the .TAP.

Fixes/changes in 0.7
- Allow user to change between OK or Menu to select a TAP's menu
- Info button cycles between different screens: Description, Capabilities, TAPIDs, Authors

Fixes/changes in 0.6
- fix bug where infoscreen clearing leaves hole in menu
- refresh list after stopping tap

menu.jpg

This is the code that you would add to your TAP:

Code: Alles auswählen

if (wEvent == EVT_TMSCommander)
{
       switch (dwParam1)
      {
	   case TMSCMDR_Capabilities:
                                //TMSCommander wants to know what we support
		return (dword)(TMSCMDR_HaveMenu | TMSCMDR_CanBeStopped);
	   case TMSCMDR_Stop:
                                //TMSCommander has told me to stop
		//call your TAP's exit function or
		TAP_Exit();
		return TMSCMDR_OK;
	   case TMSCMDR_Menu:
                                //TMSCommander has told me to show my menu
		//call your TAP's menu
		return TMSCMDR_OK;
	   case TMSCMDR_Exiting:
                               //TMSCommander is exiting - do we want to do anything?
                               break;
	   default:
		//unknown TMSCommander function
		return TMSCMDR_UnknownFunction;
         }
}

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: So 21. Mär 2010, 23:01
von Happy
That's great. I'm really looking forward to this release.

I will certainly support this for my TAPs. It seems even easier than integrating the old TAP Commander into a TAP.

Regards,
Happy

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Mo 22. Mär 2010, 07:15
von Twilight
thank you for your support deangelj :up:

twilight

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Mo 22. Mär 2010, 09:56
von Indy
That is a great solution :hello: I was about to think nobody was interrested in solving this problem.
I have some additional questions:

What state does TAP_GetState return when I get the TMSCMDR_Menu? I have a lot of testing against normal state in my code.

How do we solve the situation when people do not have TMSCommander running? Are we running our own code when we startup and disable that when we receive a TMSCMDR_Capabilities event.

People will not always use TMSCommander to stop TAPS. Will you know that a TAP has been stopped or wouldn't it be better if a TAP has a register and unregister with TMSCommander (method) Event.

I would still like to ask if you could consider a "short cut" implementation like I proposed. Pressing 2 keys shortly after each other is quicker than going via an extra TAP menu.

What I also miss is a way to see what TAP is activ. This is something that is not integrated in TAP_GetState. It would be great if we could register SUBSTATES for our own TAPs. But I don't see it very likely Topfield is going to add that to the API. Or even own Events

Is this something you could add to your TAP?

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Mo 22. Mär 2010, 16:30
von Happy
FireBird hat geschrieben:If I?ve understood John correctly, TMSCommander just shows a list of user defined TAPs and not all running TAPs. If this is the case, we need a mechanism so that a TAP can find out if it is TMSCommander?s target (registering?).

I would have thought that TMSCommander shows a list of all running TAPs.
By sending a "TMSCMDR_Capabilities" request, TMSCommander finds out which TAPs are handling its requests properly. If a target TAP receives this request it automatically sees that TMSCommander is running.

Regards,
Till

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Mo 22. Mär 2010, 18:23
von FireBird
Happy hat geschrieben:I would have thought that TMSCommander shows a list of all running TAPs.

This needs to be answered by John.
By sending a "TMSCMDR_Capabilities" request, TMSCommander finds out which TAPs are handling its requests properly. If a target TAP receives this request it automatically sees that TMSCommander is running.
And if someone stops TMSCommander?

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Mo 22. Mär 2010, 19:12
von Happy
FireBird hat geschrieben:
And if someone stops TMSCommander?

Good point :thinker:
:wink:

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Di 23. Mär 2010, 10:44
von deangelj
Indy hat geschrieben:
What state does TAP_GetState return when I get the TMSCMDR_Menu? I have a lot of testing against normal state in my code.

I don't know...

Indy hat geschrieben:
How do we solve the situation when people do not have TMSCommander running? Are we running our own code when we startup and disable that when we receive a TMSCMDR_Capabilities event.

People will not always use TMSCommander to stop TAPS. Will you know that a TAP has been stopped or wouldn't it be better if a TAP has a register and unregister with TMSCommander (method) Event.


That sounds like a good solution!

Indy hat geschrieben:
What I also miss is a way to see what TAP is activ. This is something that is not integrated in TAP_GetState. It would be great if we could register SUBSTATES for our own TAPs. But I don't see it very likely Topfield is going to add that to the API. Or even own Events
Is this something you could add to your TAP?


Yes, this is what my TAP does - shows the running TAPs, and only the ones that can be managed can be selected. I use Firebird's library for pretty much all the "smart stuff" :)

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Di 23. Mär 2010, 11:04
von deangelj
FireBird hat geschrieben:
And if someone stops TMSCommander?


Yes good point! But generally easily fixed - you just restart it - the user will quickly learn :)
The TAP discovers the TAPs it can manage at run time.

Here's the current kit - just copy the TAP to ProgramFiles and run it. Then press Exit to see the table.

TMSCommander v0.4 kit

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Di 23. Mär 2010, 11:15
von deangelj
By the way, I use the same mechanism to manage the TMSCommander menu - you will always see at least one TAP that can be managed in the TAP list: TMSCommander!

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Di 23. Mär 2010, 11:25
von FireBird
Then I missunderstood your intentions. I thought that you just want to display a subset off all running TAPs. Now it is easy: whenever a TAP receives its hotkey, it checks if TMSCommander is running by calling HDD_TAP_isRunning (). If it returns false, the hotkey magic should be done.
Thanks for V0.4

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Di 23. Mär 2010, 13:07
von Happy
deangelj hat geschrieben:Yes good point! But generally easily fixed - you just restart it - the user will quickly learn :)
The TAP discovers the TAPs it can manage at run time.


FireBird hat geschrieben:Now it is easy: whenever a TAP receives its hotkey, it checks if TMSCommander is running by calling HDD_TAP_isRunning ().


Couldn't TMSCommander even send a message when it is stopped and inform the target TAPs ?

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Di 23. Mär 2010, 18:31
von TV-Junkie
So, welches Tap hat denn als erstes den Code für den TMScommander drin :thinker:
Das Tap selber läuft, lässt sich nichts einstellen (logischerweise) :cry:

TMSCommander

Verfasst: Di 23. Mär 2010, 19:25
von FireBird
I've tried to add the TMSCommander events to ScreenCapture OSD. But as soon as I add the TMSCMDR_CanBeStopped capability flag, the list entry is not selectable.

TMSCMDR_Stop is not included in the quickstart doc but I guess this is because that feature is not yet available.

Having TMSCMDRTAPID in TMSCommander.h would be great. :wink:


/Edit: @Ha-Jü: Erster :D

AW: TMSCommander

Verfasst: Di 23. Mär 2010, 21:58
von deangelj
Yes, I'll add the Stop function in the next version. The reason the TAP is no longer selectable is due to my lazy coding in my ReturnCode check (I only check for exactly that flag, not an ORed set). I will fix this as well.

And good suggestion about the TAPID too.

And thanks Firebird for your library and your technical assistance.

cheers,
John

AW: An alle TAP Entwickler: Gemeinsame Benutzung der Fernbedienung

Verfasst: Di 23. Mär 2010, 22:01
von deangelj
[quote="Happy"]Couldn't TMSCommander even send a message when it is stopped and inform the target TAPs ?[/quote]

Yes, it could. It would then need to send a message when starting as well. Let me think about that some more.

AW: TMSCommander

Verfasst: Di 23. Mär 2010, 22:15
von Happy
I was also trying to add TMSCommander to a TAP without menu, just with the ability to stop it. But it didn't work.
Also, when pressing EXIT now while in a TAP's menu, the TMSCommander OSD is covering this TAP's menu. (i.e. iTiNa NiceDisplay or Automove)
In the source I see that the substate is not checked.
Also I don't get the fancy icons, that are visible in John's screenshot.

Regards,
Till

AW: TMSCommander

Verfasst: Mi 24. Mär 2010, 10:54
von deangelj
Hi Till,

The ability to stop is not in 0.4 - hopefully next version. Also I took the icons off because it as only to show which could or could not be managed. I now do this by disabling the line with that TAP on it and you can only select the lines/TAPs that can be managed.

As for covering the TAPs menu, when those TAPs display their menu do they exit normal state? If so then I would imagine that Main State would not be normal? Unless I misunderstand how that works, which is quite likely.

cheers,
John

AW: TMSCommander

Verfasst: Mi 24. Mär 2010, 10:56
von TV-Junkie
FireBird hat geschrieben:
/Edit: @Ha-Jü: Erster :D

Und, kann man es schon herunterladen? :wink:

AW: TMSCommander

Verfasst: Mi 24. Mär 2010, 11:19
von FireBird
TV-Junkie hat geschrieben:Und, kann man es schon herunterladen? :wink:

Schon seit Ewigkeiten. :)