When BooScript extension is loaded, the extension will check the scripts. If there are scripts, it will compile them and execute. At this moment, lots of things are not initialized yet, so we have to add code to Application.ClientStarted. And application will execute our code after everything is initialized.
import System
import System.IO
import Banshee.ServiceStack
def OnClientStarted( client as Client ):
Hyena.Log.Information( "engine is playing now..." )
ServiceManager.PlayerEngine.Play()
Hyena.Log.Information( "autoplay script is loaded." )
Banshee.ServiceStack.Application.ClientStarted += OnClientStarted
The script is very simple, I will add the functions to save the current track and to play the saved track automatically.
沒有留言:
張貼留言