Skip to content

API Main

LenweSaralonde edited this page Aug 1, 2024 · 9 revisions

Main module

Functions

Musician:OnInitialize

OnInitialize

Musician:OnInitialize()

Musician:OnEnable

OnEnable

Musician:OnEnable()

Musician.AddModule

Add a module

Musician.AddModule(moduleName)

Arguments

  • moduleName (string)

Musician.InitLocale

Initialize a locale and returns the initialized message table

msg = Musician.InitLocale(languageCode, languageName, localeCode, ...)

Arguments

  • languageCode (string) Short language code (ie 'en')
  • languageName (string) Locale name (ie "English")
  • localeCode (string) Long locale code (ie 'enUS')
  • ... (string) Additional locale codes (optional)

Returns

  • msg (table) Initialized message table

Musician.ShowTrackEditor

Show the song editor

Musician.ShowTrackEditor()

Musician.GetCommands

Get command definitions

commands = Musician.GetCommands()

Returns

  • commands (table)

Musician.Help

Display command-line help

Musician.Help()

Musician.RunCommandLine

Run command line

Musician.RunCommandLine(commandLine)

Arguments

  • commandLine (string)

Musician.StopPlayerSong

Stop a song playing by a player

Musician.StopPlayerSong(playerName, remove)

Arguments

  • playerName (string)
  • remove (boolean)

Musician.OnSongPlayed

Handle playing song

Musician.OnSongPlayed(event, song)

Arguments

  • event (table)
  • song (Musician.Song)

Musician.ImportSource

Import song from encoded string

Musician.ImportSource(str)

Arguments

  • str (string)

Musician.OnSourceImportSuccessful

Handle successful source import

Musician.OnSourceImportSuccessful(event, song)

Arguments

  • event (string)
  • song (Musician.Song)

Musician.OnSourceImportFailed

Handle failed source import

Musician.OnSourceImportFailed()

Musician.OnUpdate

Perform all on-frame actions

Musician.OnUpdate(frame, elapsed)

Arguments

  • frame (Frame)
  • elapsed (number)

Musician.MutePlayer

Mute or unmute a player

Musician.MutePlayer(playerName, isMuted)

Arguments

  • playerName (string)
  • isMuted (boolean)

Musician.PlayerIsMuted

Return true if the player is muted

isMuted = Musician.PlayerIsMuted(playerName)

Arguments

  • playerName (string)

Returns

  • isMuted (boolean)

Musician.OnHyperlinkEnter

Hyperlink mouse enter handler

Musician.OnHyperlinkEnter()

Musician.OnHyperlinkLeave

Hyperlink mouse leave handler

Musician.OnHyperlinkLeave()

Musician.OnHyperlinkClick

Hyperlink click handler

Musician.OnHyperlinkClick(self, link, text, button)

Arguments

  • self (Frame)
  • link (string)
  • text (string)
  • button (string)

Musician.EnableHyperlinks

Enable hyperlinks support on frame

Musician.EnableHyperlinks(self)

Arguments

  • self (Frame)

Musician.GetPlayerMenuItems

Return menu entries for player menu

items = Musician.GetPlayerMenuItems(unit, chatTarget, name, server)

Arguments

  • unit (string)
  • chatTarget (string)
  • name (string)
  • server (string)

Returns

  • items (table)

Musician.SetupHooks

Setup hooks

Musician.SetupHooks()

Musician.AddTipsAndTricks

Add a tips and tricks callback

Musician.AddTipsAndTricks(callback, priority)

Arguments

  • callback (function)
  • priority (boolean) If true, add the tip to the top of the list

Musician.ShowTipsAndTricks

Show the first tips and tricks

Musician.ShowTipsAndTricks(callback)

Arguments

  • callback (function)