-
Notifications
You must be signed in to change notification settings - Fork 13
Implemented eventcmd #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…nd run in debug in VS2022
|
Addresses #40. |
| # subscribed_events = songstart,songfinish | ||
| subscribed_events = songstart,songfinish | ||
|
|
||
| # you can pass variable substitution to event_command to get the current songs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This deviates significantly from the upstream implementation which sends (significantly more) metadata to the eventcmd via stdin. As written I think a handler would have to implement support for both styles.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review.
3 thoughts come to mind:
-
Without the availability of
fork()on Windows, is there a better alternative than CreateProcess? Should we be trying to reproduce sending the data via stdin using CreateProcess? Does Windows applications/scripts that would be launched from event_command have as part of their regular design patterns to be reading from stdin or is that more of a *nix design pattern? -
Stepping away from the implementation details, I would be interested in understanding the metadata requirements. Would there be limitations in passing these to the event_command as arguments such as argument length limits? Is it just the issue that all the metadata fields has not been implemented in the variable substitution parser or is there a fundamental issue with implementing it this way that necessitates for this to be implemented via stdin?
-
How much do we care to maintain compliance with the upstream project? As I worked on this feature, I noted that the codebases have significantly diverged with parts of code and library being different such as the removal of libcurl for WinHTTP library and DirectShow player instead of original player. Is there interest to maintain config file parity between this port and the original?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PowerShell/PowerShell#9497
https://stackoverflow.com/questions/6979747/read-stdin-stream-in-a-batch-file
I didn't dive into it too deeply, but powershell and batch files seem to have limitations with reading from stdin. It would be necessary to utilize python or other non-native scripting language to process from stdin.
Implemented eventcmd functionality. Please note new configuration options:
Please also note, I am NOT a regular C/C++ developer. I haven't touched C since I was in school over 10 years ago. The code in here is very hacky and may need a rewrite. This should be at least a good starting point to implement this. I did test this and it works with making a popup notification toaster like I wanted with the
wsl-notify-sendapplication.