Auto-stop (stop at end of every song)

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

bmeyns
Posts: 2
Joined: Mon Nov 15, 2010 6:35 am

Auto-stop (stop at end of every song)

Post by bmeyns » Mon Nov 15, 2010 6:45 am

Based on the SilenceBetweenSongs script by Eyal, I've made a basic variant: "stop after every song"
You can enable/disable this option from the Play menu-items

Code: Select all

    ' Stop at end of song script v1.0
    ' By bmeyns, 2010.11.15 (based on SilenceBetweenSongs.vbs by Eyal)
    '
    ' This script adds an entry in Play menu that let you
    ' enable/disable a default stopping at end of a song.
    ' Requires MediaMonkey 3.1.0.1218 or newer (?)
    '
    ' Location: MediaMonkey\Scripts\Auto\StopAtEndOfSong.vbs
    '------------------
    Option Explicit

    Dim AutoStopEnabled : AutoStopEnabled = True

    Dim AppTitle : AppTitle = "StopAtEndOfSong"
    Dim Version : Version = "1.0"
    Dim MenuItem

    '------------------
    Sub OnStartup
      InitButton
      AutoStop
    End Sub 

    Sub InitButton() 
       SDB.IniFile.StringValue(AppTitle,"Version") = Version   '"1.0"

        If Not SDB.IniFile.ValueExists(AppTitle,"Enabled") Then
           SDB.IniFile.BoolValue(AppTitle,"Enabled") = AutoStopEnabled
        End If
        AutoStopEnabled = SDB.IniFile.BoolValue(AppTitle,"Enabled")

       Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Play,4,1)
        MenuItem.Caption = "Auto-stop *"
       Script.RegisterEvent MenuItem, "OnClick", "ToggleAutoStop"
        MenuItem.Visible = True
       MenuItem.Checked = AutoStopEnabled
       
        ' Child of [Player] in the options:
        SDB.UI.AddOptionSheet "Auto-stop", Script.ScriptPath, "InitSheet", "SaveSheet", -2
    End Sub

    '------------------
    Sub ToggleAutoStop(p)
        AutoStopEnabled = Not AutoStopEnabled
        MenuItem.Checked = AutoStopEnabled
        SDB.IniFile.BoolValue(AppTitle,"Enabled") = AutoStopEnabled

        If AutoStopEnabled then
            SDB.IniFile.BoolValue(AppTitle,"CrossfadeState") = SDB.Player.IsCrossfade
            SDB.Player.IsCrossfade = False
        Else
            SDB.Player.IsCrossfade = SDB.IniFile.BoolValue(AppTitle,"CrossfadeState")
        End If
        AutoStop  
    End Sub

    Sub AutoStop
        If AutoStopEnabled Then
           Script.RegisterEvent SDB, "OnPlay", "PlayerOnPlay"
           '--Script.RegisterEvent SDB, "OnTrackEnd", "PlayerTrackEnd"
        Else
            Script.UnregisterEvents SDB
            SDB.Player.StopAfterCurrent = False
        End If
    End Sub

    '------------------
    Sub PlayerOnPlay()
      If AutoStopEnabled Then
        SDB.Player.StopAfterCurrent = True
      End If
    End Sub

    '---------------------
    Sub InitSheet(Sheet)
       Dim oPanel1, oCheck1

       Set oPanel1 = SDB.UI.NewGroupBox(Sheet)
       oPanel1.Common.SetRect 100,80,240,50
       oPanel1.Caption = "Auto-stop"

       With SDB.UI.NewLabel(Sheet)
          .Common.Left = 460
          .Common.Top = 5
          .Caption = "v" & Version
       End With
       
       With SDB.UI.NewLabel(Sheet)
          .Alignment = 2    'Center
          .Common.SetRect 100,30,100,40
          .Caption = "Automatically stops at the end of every song"
       End With

       Set oCheck1 = SDB.UI.NewCheckBox(oPanel1)
       With oCheck1
            .Caption = "Enable"
           .Common.Left = 25
           .Common.Top = 25
           .Common.ControlName = "ChEnable"
            .Checked = AutoStopEnabled
        End With
       
    End Sub


    '---------------------
    Sub SaveSheet(Sheet)
       Dim v
        Set v = Sheet.Common.ChildControl("ChEnable")
        If v.Checked <> AutoStopEnabled then
            ToggleAutoStop 0
        End If
        SDB.IniFile.BoolValue(AppTitle,"Enabled") = AutoStopEnabled         'Not necessary????
    End Sub

Peke
Posts: 12302
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Re: Auto-stop (stop at end of every song)

Post by Peke » Sun Dec 26, 2010 7:37 pm

Nice Script, simple but useful.
Best regards,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add SCREENSHOTS to forum

Guest

Re: Auto-stop (stop at end of every song)

Post by Guest » Tue May 15, 2012 6:43 am

Does this work in V4. I installed it and now all files stop.

Thanks

MMFrLife
Posts: 2774
Joined: Fri Oct 26, 2012 9:04 pm

Re: Auto-stop (stop at end of every song)

Post by MMFrLife » Wed Jan 27, 2016 11:51 am

Guest wrote:Does this work in V4. I installed it and now all files stop.

Thanks
I have no problem using it with 4.1.9.1764 portable
MM user since 2003 (lifetime since 2012) "Trying to imagine life without music gives me a headache"
track properties; dir/fn mask configurations; check out ZvezdanD's scripts
MMW 4.1.18.1842b; fav scripts > RegExp Find & Replace 5.1.0; Magic Nodes 5.1.0; Advanced Duplicate Find & Fix 3.8.2;
Backup 6.0; Clear Now Playing Button 1.2
...always back it up, especially before doing anything major!!!
Win. explorer alt. for power users [free]; great file/folder renamer [used by nasa]

Babsi

Re: Auto-stop (stop at end of every song)

Post by Babsi » Thu Feb 07, 2019 11:41 am

Hi,

I am a dance instructor and had to switch to a new device, and the new iTunes doesn't allow this feature anymore, so I was directed here. I need to be able for each song to stop, and I don't want to have to remember to press "stop after current" each time.

I have never done an add-on script and don't know anything about coding or inserting code language. What exactly do I do with the code you provided? I would appreciate exact instructions for dummies, thank you :)

Peke
Posts: 12302
Joined: Tue Jun 10, 2003 7:21 pm
Location: Serbia
Contact:

Re: Auto-stop (stop at end of every song)

Post by Peke » Sun Feb 10, 2019 5:18 am

Hi,
Here it is:
1. Open Notepad
2. In first post click on Select ALL -> Right click on any part of selected text -> Copy
3. Go to notepad
4. Right click on empty space -> Paste
5. File Save
6. navigate to MMW install folder eg. "C:\Program Files (x86)\MediaMonkey\Scripts\Auto\"
7. Enter Save name "SilenceBetweenSongs.vbs" and save file
8. Restart MMW and under Play menu you should have New Option. Also under Tools -> Options you can set its settings.
Best regards,
Pavle
MediaMonkey Team lead QA/Tech Support guru
Admin of Free MediaMonkey addon Site HappyMonkeying
Image
Image
How to add SCREENSHOTS to forum

Babsi

Re: Auto-stop (stop at end of every song)

Post by Babsi » Wed Feb 13, 2019 4:11 pm

Hi,

Thank you. Unfortunately, I need even more basic instructions. I don't know how to open Notepad. I don't see it on my computer. Is this something I need to download?

And where do I find the MMW install folder? How do I get there?

Thanks so much.

Lowlander
Posts: 46003
Joined: Sat Sep 06, 2003 5:53 pm
Location: MediaMonkey 5

Re: Auto-stop (stop at end of every song)

Post by Lowlander » Wed Feb 13, 2019 4:26 pm

Notepad should already be installed on your PC as it comes with Windows. Open Start Menu and type notepad.

The install folder is where you installed MediaMonkey. Check C:\Program Files (x86)\MediaMonkey or C:\Program Files\MediaMonkey
Lowlander (MediaMonkey user since 2003)

Post Reply