Name That Tune (Using Random Part of a Song)

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Name That Tune (Using Random Part of a Song)

Postby magcynic » Wed Sep 20, 2017 5:46 pm

Is there a script or addon that lets me go through a list of songs that starts each song at a random point or, at the very least, a certain number of seconds/minutes into the song?
magcynic
 
Posts: 1
Joined: Wed Sep 20, 2017 5:43 pm

Re: Name That Tune (Using Random Part of a Song)

Postby Peke » Fri Sep 22, 2017 8:17 pm

You can try this. In Notepad save it as <MEDIAMONKEYINSTALLFOLDER>\Scripts\Auto\intro.vbs And you should get meny Intro ON/OFF to play 10 of each middle of playlist track
Code: Select all
'Dim SDB
'Set SDB = CreateObject("SongsDB.SDBApplication")

Dim IntroTime
IntroTime = 10

Sub IntroTimer( Timer)
  If SDB.IniFile.BoolValue("Player Tools","Intro Playback") Then
    If SDB.Player.isPlaying = Not SDB.Player.isPaused Then
      SDB.Player.Next
      While SDB.Player.IsStartingPlayback
        SDB.ProcessMessages
      Wend
      SDB.Player.Playbacktime = round(SDB.Player.CurrentSong.SongLength / 2)
    End If
  Else
    Script.UnregisterEvents Timer
  End If
End Sub

Sub OnStartup
  Set MyPreviewButton = SDB.UI.AddMenuItem(SDB.UI.AddToolbar("Player Tools"), 0, 0)
  SDB.Objects("MyPreviewButton") = MyPreviewButton
  MyPreviewButton.OnClickFunc = "MyPreviewButtonAction"
  MyPreviewButton.UseScript = Script.ScriptPath
  MyPreviewButton.Hint = SDB.Localize("Enable, disable Intro Playback")
  MyPreviewButton.Caption = SDB.Localize("Intro OFF")
  SDB.IniFile.BoolValue("Player Tools","Intro Playback") = False
End Sub

Sub MyPreviewButtonAction(arg)
  If SDB.IniFile.BoolValue("Player Tools","Intro Playback") Then
    SDB.IniFile.BoolValue("Player Tools","Intro Playback") = False
    Set IntTmr = SDB.Objects("IntTmr")
    SDB.Objects("MyPreviewButton").Caption = SDB.Localize("Intro OFF")
    Script.UnregisterEvents IntTmr
  Else
    SDB.IniFile.BoolValue("Player Tools","Intro Playback") = True
    Set IntTmr = SDB.CreateTimer(IntroTime*1000)
    SDB.Objects("IntTmr") = IntTmr
    SDB.Objects("MyPreviewButton").Caption = SDB.Localize("Intro ON")
    Script.RegisterEvent IntTmr, "OnTimer", "IntroTimer"
  End If
End Sub
 
Best regards,
Pavle
MM Core Developer and Admin of free MediaMonkey extensions Hosting
Image
Image
How to add Images to forum
Peke
 
Posts: 10830
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia


Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 17 guests