Addon that launches script on play and pause

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Onweerwolf
Posts: 705
Joined: Tue Dec 12, 2006 5:32 pm
Location: The Netherlands

Addon that launches script on play and pause

Post by Onweerwolf »

Hiya,

I am sure this is possible. I searched for something usable but could not find it.

I am looking for an addon (or two different ones) that does two things:

1. It checks if MM has stopped playing for x seconds or longer and if so executes an external batch file
2. When MM starts playing it executes an external batch file

Can anyone help me out?
Image
Erwin Hanzl
Posts: 1190
Joined: Tue Jun 13, 2017 8:47 am
Location: Vienna

Re: Addon that launches script on play and pause

Post by Erwin Hanzl »

MMW 4.1.31.1919 Gold-Standardinstallation
Onweerwolf
Posts: 705
Joined: Tue Dec 12, 2006 5:32 pm
Location: The Netherlands

Re: Addon that launches script on play and pause

Post by Onweerwolf »

That doesn't seem to be what I am looking for. Do you mean that there is something in this script that i can use? Might be but I can't use that from only a mmip file.
Image
Eyal
Posts: 3117
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec
Contact:

Re: Addon that launches script on play and pause

Post by Eyal »

Hi Onweerwolf,

It's been a very long time... since I didn't made programmation.

I'm pretty sure it's possible do do it.
If I take snippets of my Silence between Songs script, you need to use something like this:

Code: Select all

' Register Play and Stop event:
Script.RegisterEvent SDB, "OnPlay", "PlayerOnPlay"
Script.RegisterEvent SDB, "OnTrackEnd", "PlayerTrackEnd"
And then make subroutines to call your external batch file:

Code: Select all

' This will be executed when track starts playing:
Sub PlayerOnPlay()
	your code here
End Sub

Code: Select all

' This will be executed when track stops playing:
Sub PlayerTrackEnd()
	your code here
End Sub
To disable everything:

Code: Select all

Script.UnregisterEvents SDB
I hope it helps.
Peace
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Post Reply