Decorum for the Forum:
  • Be nice. If you want to be mean, try Reddit.
  • No Piracy. If you want to be a thief, there are dark places on the internet dedicated to that.
  • No Cracking. Discussions on AnyDVD, DeUHD, DVDFab, UHDKeys and similar tools are not permitted here.
  • No Spamming. If you want to make a buck, work smarter... somewhere else.
  • No Adult Content. Half the internet is dedicated to adult content. This half isn't.

Privacy Policy: Click Here to Review (updated September 30, 2020)

Considering New App - Hotkey Monitor

General support forum for Chameleon MediaCenter (formerly MM Browser)
Teddyboy
Posts: 268
Joined: Wed Apr 25, 2018 10:30 pm
Location: San Diego, Ca

Re: Considering New App - Hotkey Monitor

Post by Teddyboy » Mon Feb 08, 2021 7:39 pm

Disabling HID might in the long run be the way to go. I actually would prefer it for full control of the CMC experience and its supported players. In my use case the pc is being used for a single purpose. It only plays back movies and music. Maybe for others they use CMC part time and the pc performs other duties. For a full 10ft front end experience, you disable HID and take full control of the remote. For those that don’t use it that way and only part time the default would be the old method with basic remote control with none of what your proposing. If it where me, I would only offer the new method once it’s stable, and deprecate then remove the old method to reduce support headaches.

I use my Apple TV 4K for streaming which I like a lot. I’ve never used CMC for that even though you offer that as a option. The button profiles would probably be much simpler for controlling streaming apps then a full on player. Maybe for occasional use if you get this working 100% I would using streaming apps if I was already switched to my htpc if it’s seamless.

I would rather see a global tab like you are proposing with commands that I can set a tick mark to override or not. Easy to see that in one place. Now you could possibly see those same buttons in other profile tabs if they are set to be overridden they would be greyed out. I’m using profiles, but modes(parent), action(child) relationship would work too if it’s well defined. Profiles make more sense to me as I’m controlling a app like jriver or powerdvd.
Mechanical Engineer, Solidworks junkie, Reef aquariums, sci-fi, weight training, orchids, Ferns, Kaiju, model kit building, balboa park, scripps aquarium

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Considering New App - Hotkey Monitor

Post by Pauven » Mon Feb 08, 2021 8:04 pm

Thanks for your input!

Since disabling HID input is just a simple registry tweak, I was thinking of including a button to toggle it on/off, for power users who want to spend a lot more time configuring everything. If you disable the HID, then you have to configure every last button, which includes the numberpad and Enter, Back, etc. That can be a lot.

In my head, Mode is the same as Profile. Just a slight terminology variance. I've already renamed it once, originally I was calling it Categories and didn't like that. Profile is a good word, but I'll have to think if I like Mode or Profile better.

Though your comment did get me thinking that I might need to adjust my design to allow for sharing of profiles for specific apps. Right now I'm semi-hardcoding things just to get it up and running, though it could make a lot more sense to have sharable profiles that can be imported/plugged-in, and are not pre-defined. That way users can add new profiles for new apps without me having to do a code change. While it's a little more work to go this path, it's not so bad now since I'm still early in the coding - not much to rewrite.

This thing is growing in scope by the hour... I need to be careful I don't end up recreating EG / Girder. I also want to make this thing easy to use, a lot easier than EG/Girder type solutions which are way too complex due to their awesome capabilities. Every feature I add risks making this thing too hard for some users. Decisions decisions.

Teddyboy wrote: Mon Feb 08, 2021 7:39 pm The button profiles would probably be much simpler for controlling streaming apps then a full on player.
I'm not sure what I'll be able to do in this regard. Some streaming sites, like Netflix, have a dedicated app. But others only have a website. For a website, I don't think it will be possible to do a site specific key mapping. Though I could be wrong. I know some sites, like YouTube.com, have some well defined hotkeys like "F" for fullscreen.

To be honest, I'm doubtful that I can ever develop a solution that works as well as Apple TV, Roku and other devices of that type, mainly because the streaming service providers have mostly abandoned the humble PC, preferring streaming devices and mobile phones/tablets. Not that I'm giving up - this is something I plan to continue working on in the future. I just like to set expectations realistically low.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

Teddyboy
Posts: 268
Joined: Wed Apr 25, 2018 10:30 pm
Location: San Diego, Ca

Re: Considering New App - Hotkey Monitor

Post by Teddyboy » Mon Feb 08, 2021 8:46 pm

If you want it to be simple to set up, then you should consider providing preconfigured profiles for your supported players along with a CMC MCE remote profile. Maybe pick two or three of them like MPC, jRiver, and or PowerDVD for example to do at first, then the others can follow later. Power DVD would be a biggie and probably the hardest to do for legit 4k UHD playback of rips and you would probably only want to support the most current generation players. The default profiles should always remain static out of the box, and any modifications to those profiles would be saved to another new profile and you’d tell cmc to use that one for that player etc. if something happens to the customized profile you can always load the default. That’s a chunk of work for default profiles, but it would get people up and running quickly and easily without much trouble. Disabling HID would not be a big deal if default profiles are provided.

Hard coding is fine for now to test functionality, but you should switch to developing the app to use profiles once you’re satisfied with how it works. Keep the scope to just CMC and CMC supported player control. As far as streaming apps go your right about that. Maybe HDhomerun control at a later date if it’s possible. The core functionality of CMC is library display of media and media playback with its supported players using your new remote control method. That should be your scope. Anything that you learn from this development work that you can apply to streaming apps at a later revision is a bonus.

In my view this is eventghost light. It’s very targeted, and nowhere near the level of user complexity of eventghost. Of course making something simple to use and understand is hard to do programmatically. I think remotes should be a profile as well. It looks like your going for a plugin structure, so why not remotes as well. Start with a MCE remote and get that down solid. Then consider doing one for Logitech remotes. They make a lot of remotes, so you might just pick a couple of most popular ones. You’d install the profile and chose the one you want from a drop down. This is a bit of work because you have to create the underlying structures and GUI for the profiles to function. If you can pull this off which I think you can, you’ll have a solid foundation to build on.

Time to put that fancy upgraded compiler/IDE you recently got to good use now! 😉

I did put in a request to Brian to provide a switch in the API to turn off dune file path validation during export.
Mechanical Engineer, Solidworks junkie, Reef aquariums, sci-fi, weight training, orchids, Ferns, Kaiju, model kit building, balboa park, scripps aquarium

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Considering New App - Hotkey Monitor

Post by Pauven » Tue Feb 09, 2021 10:09 am

Teddyboy wrote: Mon Feb 08, 2021 8:46 pm you should consider providing preconfigured profiles for your supported players along with a CMC MCE remote profile ... The default profiles should always remain static out of the box, and any modifications to those profiles would be saved to another new profile and you’d tell cmc to use that one for that player etc.
That's a really good suggestion. I'm struggling a bit figuring out how to actually implement this. For the default static profiles, I want those to be added to in the future by users, so static in principle, but actually creatable/updatable via manual edits outside the software.

I'm thinking I can come up with the base config for each profile and save it in a file called a "template". You can add a template, or add an end-user configured profile. If you add a template, then any changes get saved as a profile. I've never done anything like this before, which is why I'm having to think a bit harder about how to do this right.

Teddyboy wrote: Mon Feb 08, 2021 8:46 pm Hard coding is fine for now to test functionality, but you should switch to developing the app to use profiles once you’re satisfied with how it works. Keep the scope to just CMC and CMC supported player control.
For the most part, I'm already extremely happy with how it works, proof of concept is 110%. From doing this a few too many times, I know that hard-coding now only to replace it with a proper parameterized solution later is closer to double the work. So I'm spending a few extra hours daydreaming and sketching out the solution now, so that with just a little bit extra effort I come up with a more complete solution from the get-go.

Teddyboy wrote: Mon Feb 08, 2021 8:46 pm In my view this is eventghost light.
True. But for how long? I'm already anticipating the follow-up requests:
  • Can you add the ability to issue WoL Magic Packets on Startup? (already requested and planned)
  • Can you add the ability to launch programs with a button outside CMC (already implemented)
  • Can you add the ability to run routines on startup?
  • Can you add the ability to run a command/macro/script when the mode changes to a new profile?
  • Can you add support for a scripting language?
  • Can you add a way for me to control my home lighting via the remote?
  • Can you add Macro support?
  • Can you add a Function button, where if I press button C, then the following button pressed does a different action than normal
  • Can you add a long button press modifier to perform a different action

Ok, yeah, some of those are my own requests... hehe. And some have come from users over the years. I think all are legitimate ideas, and I'm trying to keep these in mind now as I go through initial design efforts. Even if I don't implement a feature now, it's smart for me to account for them in my design now, so they can be easily implemented in the future.

For example, the long button press is a feature in Event Ghost. This is something I hadn't even thought about, but after seeing that feature in EG I realized it would be rather easy to implement. In my MCEIR Windows Service, I'm currently filtering out the "Button Released" action, as in my original code it was showing as a double button-press. Instead of filtering it out, I probably need to capture both the press and the release. I can send both actions to the SysTray service, instead of just the press. And at some point in the future, I can more easily expand the SysTray service to do different actions for the length of the button press. That also means I need to provide a way to configure the length of time for each button press to switch between short (normal) and long presses.

In fact, it makes sense for me to design all this now, as otherwise all these "profiles" that get created could be made worthless and have to be recreated to support these capabilities in the future.


On a separate note, I'm a little concerned that my sole focus on MCE IR is giving me a blind spot with regards to other remotes. I'd hate to do a ton of design work only to find out later that to support Hauppauge remotes requires a major change. My concern is probably overblown since I would probably be creating a separate Windows Service for each remote control type, and in my service I could map those buttons to what I'm considering the "gold standard" MCE buttons. I've also set it up so that my SysTray service knows which service sent the button presses, so if buttons come from HPPGE instead of MCEIR, I can do different remote specific processing there too.

Teddyboy wrote: Mon Feb 08, 2021 8:46 pm Time to put that fancy upgraded compiler/IDE you recently got to good use now!
While I'm very happy with the compiled code being output, the new IDE has been very frustrating. There seems to be a lot of broken functionality, and it is very sluggish and glitchy. At this point, I'm committed to using this version, so I'm just hoping for some relief from some patches.

Teddyboy wrote: Mon Feb 08, 2021 8:46 pm I did put in a request to Brian to provide a switch in the API to turn off dune file path validation during export.
Thank You!!!! I just responded to your post as well. If any other CMC+CCC users read this, I encourage you to chime in too:
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Considering New App - Hotkey Monitor

Post by Pauven » Tue Feb 09, 2021 6:25 pm

So I spent a good portion of the day working on capturing long button presses. This turned out a lot more troublesome than I expected.

The MCE IR driver/dll is sending updates about every 100ms (aka 10 Hz), even when the button is being held. So if I hold a button for about 3 seconds, I get the initial button down signal, then about 30 update signals. I was thinking the updates were that the Button was released, but now I realize they are "button is still pressed" type signals, and I don't get a "button released" signal. Rather, I simply stop receiving the button pressed signal.

Since the updates from MCE IR come about every 100ms, I have to wait about 200 ms after receiving the last "button still pressed" signal to be sure it is no longer pressed.

This means that for every button press, there is now a 300ms delay from initial press, about 1/3rd of a second, and you can feel it. It's much less responsive than my earlier code that was taking the initial button down signal - that felt instantaneous.

Worse, this new button pressed duration logic completely breaks certain buttons that need to repeat, like the arrow keys. Those button should operate on a fast repeat when you hold them, not wait for the button to be released to send a single button press with a 5 second duration.

I think there is a solution for all of this: I can import the button config into the MCE IR windows service, so that it knows which buttons are configured for dual-action short-press / long-press behavior. If a button doesn't have long-press configuring, the service should immediately send the button press on the initial press. Only if a button is configured for long-presses should the service hold the button press message until the button has been released.

Though I'm a little concerned that this is going to end up a bit erratic, so I might revert back to the original short-press only capability that was working pretty well.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

Teddyboy
Posts: 268
Joined: Wed Apr 25, 2018 10:30 pm
Location: San Diego, Ca

Re: Considering New App - Hotkey Monitor

Post by Teddyboy » Wed Feb 10, 2021 3:09 pm

I think importing the mce remote button configuration into the windows service is a reasonable approach. It would allow you have the long button press control your after. Why do you think it would be erratic? One thing is about the remote not responding with almost immediate feedback drives me crazy. I can’t tell you how many times I thought something was wrong when I pushed the green button and CMC took forever to load. I thought my htpc locked or CMC got corrupted only to find its Windows getting in the way.

Remote profiles would be a good thing. Not everyone has or wants a mce remote. I like them for the being a basic standard remote, but I’d definitely get a Logitech remote if it could be easily integrated into your remote control structure as a drop in profile.

Macros, long button presses that would cause a different action would be nice to have. Some of the others I’m not to sure about such as home automation(turning lights on and off), scripting. Not to sure about those. Home automation is interesting, but I don’t think you’d want to make your own customized solution. Maybe that’s something more long term with you partnering with someone on the home automation side.

Side note:
Brian responded to my/our request. Sounds like he wants to implement it, but he just can’t get to it right now because he’s working on something that he needs to complete. He suggested that we create a new topic in the feature request section for all the changes to the API you want to have. He’ll make it a sticky so it will stay on top. It will be easier for him to find and everything thing will be collected in one place when he is ready to begin implementation. Now’s your chance Paul to get your wishlist together, and have it in one place. I’ll let you start that thread since you know what you’d like to have done, and I’ll tag along for the ride giving encouragement and support. 😁
Mechanical Engineer, Solidworks junkie, Reef aquariums, sci-fi, weight training, orchids, Ferns, Kaiju, model kit building, balboa park, scripps aquarium

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Considering New App - Hotkey Monitor

Post by Pauven » Wed Feb 10, 2021 3:11 pm

I believe I have the long-press dual-action behavior working well now.

The SysTray app is responsible for determining what Mode/Profile is currently running, and maintains a list of Buttons that are configured with a Long Press action. Each time the MCE IR Windows Service sends a button press to the SysTray app, it gets a reply back that includes that list of Dual Press configured buttons. You'll also be able to fine-tune the duration threshold for a button press to be a long press.

The cool thing about this is it provides a lot more buttons, since one of the biggest shortcomings of MCE remotes is a lack of buttons.

Buttons that are configured for single, short presses only still work best, with an immediate response. And of course, some buttons aren't eligible for being long-press enabled, like the arrow keys, volume, and other buttons that depend upon a repeating action.

You can also configure a button to only have a long-press action, with no short-press behavior at all.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Considering New App - Hotkey Monitor

Post by Pauven » Wed Feb 10, 2021 3:13 pm

Teddyboy wrote: Wed Feb 10, 2021 3:09 pm Remote profiles would be a good thing. Not everyone has or wants a mce remote. I like them for the being a basic standard remote, but I’d definitely get a Logitech remote if it could be easily integrated into your remote control structure as a drop in profile.
I mostly use Logitech remotes, have been for 15+ years now. I just configure them to emulate a WMC/MCE remote.

Teddyboy wrote: Wed Feb 10, 2021 3:09 pm Not to sure about those. Home automation is interesting, but I don’t think you’d want to make your own customized solution. Maybe that’s something more long term with you partnering with someone on the home automation side.
Since you weren't looking for this functionality, you probably missed that CMC v4.2 already has this. 8-) I'm not developing solutions from scratch, rather I'm re-implementing the Event Handlers that My Movies already had for WMC. So far I've only created an Event Handler for the Mi Casa Verde. The user configures Scenes in Mi Casa Verde (i.e. "All Lights On", "Lights 20%", "Lights Off"), and then links those pre-configured Scenes to events in CMC (i.e. CMC Launch, Playback Started, Playback Stopped, CMC Closed, etc.). Then when an event happens, CMC calls the Scene via a URL.

I did something similar for Wake-on-LAN (WoL), linking Events like CMC Launching and Playback Starting to sending out Magic Packets to wake server(s).

To add this to the new SysTray app, I would just have to link to my already existing code, and define a new Event for Login. Then the SysTray could simply call the Mi Casa Verde Scene or send WoL Magic Packets.

Teddyboy wrote: Wed Feb 10, 2021 3:09 pmSide note:
Brian responded to my/our request. Sounds like he wants to implement it, but he just can’t get to it right now because he’s working on something that he needs to complete. He suggested that we create a new topic in the feature request section for all the changes to the API you want to have. He’ll make it a sticky so it will stay on top. It will be easier for him to find and everything thing will be collected in one place when he is ready to begin implementation. Now’s your chance Paul to get your wishlist together, and have it in one place. I’ll let you start that thread since you know what you’d like to have done, and I’ll tag along for the ride giving encouragement and support.
Thanks for the heads up. I've been meaning to put together a list anyway, but I hadn't these past couple months because Brian seemed incredibly busy and I was worried my requests would just get lost. I'll work on that.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

User avatar
Pauven
Posts: 2777
Joined: Tue Dec 26, 2017 10:28 pm
Location: Atlanta, GA, USA
Contact:

Re: Considering New App - Hotkey Monitor

Post by Pauven » Sat Feb 13, 2021 6:05 pm

I've been working for a few days on designing the new remote control configuration options, and finally have it to a point that it mostly resembles how the final product will work. Before I get much further, I would appreciate feedback on the new configurator.

Here's a screenshot showing the "Global" tab. Across the top you can see there are more tabs for CMC and HDHomeRun - those look exactly the same as Global, except they don't have the "Allow Override" option that you see on the Global tab.

image.png
image.png (245.05 KiB) Viewed 3944 times

Beyond that, I won't tell you anything other than hopefully the picture speaks for itself.

There's obviously more design work to do, like Add/Delete buttons, plus sorting buttons, but otherwise what's inside each green panel is 95%+ complete, so I'm really just looking for commentary on the green panels themselves.

Here's the CMC tab too, which might give you more insight into the GUI, with the main difference being that most CMC actions are pre-defined instead of custom:

image.png
image.png (216.75 KiB) Viewed 3943 times

Feel free to ask questions - that's how I can evaluate what makes sense and what doesn't.
President, Chameleon Consulting LLC
Author, Chameleon MediaCenter

Jamie
Posts: 942
Joined: Wed Dec 27, 2017 11:26 pm

Re: Considering New App - Hotkey Monitor

Post by Jamie » Sat Feb 13, 2021 8:52 pm

Hi Paul,

This looks good to me and I think that I understand how it should work. Can you use a customized link so the remote can control the lights in a room by either turning them off and on or dimming the lights. That would be great! I also read on the Mymovie.dk website that some time in the future you may consider providing Amazon Echo features which would be great. I would really love to see that feature too! I realize that it might be awhile and I will temper my expectations for now.

jamie

Post Reply