getmusicbee.com

MusicBee & Add-Ons => Customizations => Plugins => Topic started by: DJ MADEST on May 06, 2019, 12:03:44 PM

Title: [Beta] [1.2.1] LuaBee - Lua scripting engine for MusicBee
Post by: DJ MADEST on May 06, 2019, 12:03:44 PM
Hello! I am developing a plugin that allows you to load Lua scripts, thereby expanding the functionality of the player. The advantages of this approach are obvious - the simplicity and speed of development. Of course, at the current stage of development, scripts cannot replace plugins, but writing simple automation algorithms is much simpler on scripts than on plug-ins.

Warning: This plugin is under development, global API changes and random crashes are inevitable.


Documentation is under construction at: https://lainez.gitbook.io/luabee/ (https://lainez.gitbook.io/luabee/)
Download (v 1.2.1): Download (https://drive.google.com/file/d/1H75pHRKo7ZDR0zZjUhe2i8Y3yOG8tNIC/view?usp=sharing)


------
Simple script example

Code
-- Very simple example: Pauses the track if volume level in player is 0


-- Some variables
-- in Lua it is common to use local variables
local EVENT_VOLUMECHANGE = 6 -- Volume change event ID
local volLoop = false -- prevent looping =)


-- Callbacks
function ReceiveNotification(source, event)
    if event == EVENT_VOLUMECHANGE then
        local volume = GetVolume() -- gets volume level
        if volume == 0 then
            SetPlayState("playpause") -- set playing state
            volLoop = true -- prevent looping
        end
        if volume > 0 and volLoop then
            SetPlayState("playpause") -- set playing state
            volLoop = false
        end
    end
end
Title: Re: [In development] LuaBee - Lua scripting engine for MusicBee
Post by: DJ MADEST on May 10, 2019, 07:37:37 AM
Version 1.1.1

Scripts manager:

+ 2 new buttons - "Lookup new scripts" and "Open scripts folder"

API Changes:

+ SetAutoDJ()
+ MbUI:AllocalateConsole()
+ MbUI:PrintConsole()

Description for new functions you can find on docs (https://lainez.gitbook.io/luabee/)
Title: Re: [Beta] [1.2.1] LuaBee - Lua scripting engine for MusicBee
Post by: DJ MADEST on May 15, 2019, 07:36:13 AM
Version 1.2.1

API Changes:

+ CreatePlaylist
+ PlaylistSetFiles
+ RemoveFileFromPlaylist
+ RemovePlaylist

Fixed bug with ReceiveNotification when the event argument were not valid for Lua datatype

Description for new functions you can find on docs (https://lainez.gitbook.io/luabee/)
Title: Re: [Beta] [1.2.1] LuaBee - Lua scripting engine for MusicBee
Post by: zkhcohen on May 16, 2019, 07:45:06 AM
Hey! This seems like a really cool project.

I'm used to creating add-ins in C# - could you provide some sample projects in lua?
Title: Re: [Beta] [1.2.1] LuaBee - Lua scripting engine for MusicBee
Post by: DJ MADEST on May 16, 2019, 01:19:06 PM
Hey! This seems like a really cool project.

I'm used to creating add-ins in C# - could you provide some sample projects in lua?
Yes, i'm working on it...
Title: Re: [Beta] [1.2.1] LuaBee - Lua scripting engine for MusicBee
Post by: imax on January 28, 2021, 07:54:18 PM
Can you post a link to your github repo, so we can read the source code and maybe send you some pull requests?