Page 2 of 2

Re: Zoom Player plug-in

Posted: Tue Jul 11, 2017 9:33 pm
by igvk
topix wrote:I'm not the author but i made the changes regarding socket. Please try the attached version.
Sorry, I made a small error. In fact, you should change function to "StreamSelectNav", the opposite of what I wrote.
You have a misspell there in the source ("ionNav").

Re: Zoom Player plug-in

Posted: Tue Jul 11, 2017 9:40 pm
by igvk
topix wrote:can you show me your code changes and how you generate the volume event?

I will include the new version in the next release.
Here's what I changed (a little hacky):

Code: Select all

        self.PlayState = -1
        self.PlayVolume = 0
in class ZoomPlayer.__init__()

Code: Select all

        elif header == "2300":
            state = int(state)
            self.PlayVolume = state
            self.TriggerEvent("Volume", state)
in ValueUpdate()

This way, PlayVolume has the value of the last requested volume.
Probably, it would be better to also update it when it's modified via plugin.

It would actually be much better to define new function AdjustVolume that would take volume delta (positive or negative).

Re: Zoom Player plug-in

Posted: Tue Jul 11, 2017 10:03 pm
by topix
Why store the Volume inside the plugin when it's not used? Any reason for this? I personally wouldn't store the volume because there can be chance that the value will be outdated. Instead always query the actual value.

I would skip this, because as you said the value has also to be changed on setting the volume what makes the changes to the plugin bigger.
If you wanna do it, i'll appreciate it.

Re: Zoom Player plug-in

Posted: Tue Jul 11, 2017 10:16 pm
by igvk
topix wrote:hmm, i'm blind. I can't find "StreamSelectNav" nor "StreamSelectionNav" :shock:
You made a typo, search for "ionNav" in your modified code.
Why store the Volume inside the plugin when it's not used? Any reason for this?
I would skip this, because as you said the value has also to be changed on setting the volume what makes the changes to the plugin bigger.
If you wanna do it, i'll appreciate it.
Volume is stored to use it in EG actions.
Example:

Code: Select all

eg.plugins.ZoomPlayer.plugin.DoCommand("2300"); vol = eg.plugins.ZoomPlayer.plugin.PlayVolume; eg.plugins.ZoomPlayer.exSetVolume(str(vol+int(eg.event.payload)))
Yes, it would be better to implement all this in the plugin itself.
But it's a little less trivial for me, because I don't usually use Python.