Silence Between Songs v3.0 [MM3] updated 2010-12-26

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Silence Between Songs v1.0 [MM3]

Post by nohitter151 »

dsgoen wrote:I get an Product Installation Error with this script. MediaMonkey Version 3.2.0.1294.

It does show up in the Extensions pane, but nothing displays in the Options pane.

Any suggestions? I really need this function for classical music.

David
http://www.mediamonkey.com/support/inde ... ticleid=59
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
onnotabak

Re: Silence Between Songs v1.0 [MM3]

Post by onnotabak »

I've enhanced the code in order to take care of repeat and shuffle.
Also the next song is selected before the pause rather than after.
If pressed play during the gap the next song is started immediatly.
This shortens the gap if needed.

Code: Select all

' Gap / Silence Between Songs script v2.1
' By Eyal, 2009.09.16
' By Onno Tabak 2010-04-21 with small part of Gap.vbs by Soren Werk
'
' This script adds an entry in Play menu that let you
' enable/disable a silence time between playing songs.
' Delay time is configurable through Options|Player|SBS.
' Requires MediaMonkey 3.1.0.1218 or newer.
'
' Repeat and Shuffle is accounted for.
' Next song selected before gap
'
' Location: MediaMonkey\Scripts\Auto\SilenceBetweenSongs.vbs
'------------------
Option Explicit

'Set Silence Time in seconds (default = 5):
Dim SilenceTime : SilenceTime = 5
Dim SilenceEnabled : SilenceEnabled = True
Dim GapProgress
Dim GapTimer

Dim AppTitle : AppTitle = "SilenceBetweenSongs"
Dim Version : Version = "2.0"
Dim MenuItem

'------------------
Sub OnStartup
  InitButton
  SilenceBetweenSongs
  InitTimer
End Sub  

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

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

    If Not SDB.IniFile.ValueExists(AppTitle,"SilenceTime") Then
    	SDB.IniFile.StringValue(AppTitle,"SilenceTime") = SilenceTime
    End If

    If Not SDB.IniFile.ValueExists(AppTitle,"CrossfadeState") Then
    	SDB.IniFile.BoolValue(AppTitle,"CrossfadeState") = SDB.Player.IsCrossfade
    End If

    SilenceTime = SDB.IniFile.StringValue(AppTitle,"SilenceTime")
    SilenceEnabled = SDB.IniFile.BoolValue(AppTitle,"Enabled")

	Set MenuItem = SDB.UI.AddMenuItem(SDB.UI.Menu_Play,4,2)
    MenuItem.Caption = "Silence between songs"
	Script.RegisterEvent MenuItem, "OnClick", "ToggleSilence"
    MenuItem.Visible = True
	MenuItem.Checked = SilenceEnabled
	
    ' Child of [Player] in the options:
    SDB.UI.AddOptionSheet "Silence between songs", Script.ScriptPath, "InitSheet", "SaveSheet", -2
End Sub

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

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

Sub SilenceBetweenSongs
    If SilenceEnabled Then
       Script.RegisterEvent SDB, "OnPlay", "PlayerOnPlay" 
       Script.RegisterEvent SDB, "OnTrackEnd", "PlayerTrackEnd"
    Else
        Script.UnregisterEvents SDB
        SDB.Player.StopAfterCurrent = False
    End If
End Sub

'------------------
Sub InitTimer()
  Set GapTimer = SDB.CreateTimer(1000)
  GapTimer.Enabled = False
  Script.RegisterEvent GapTimer, "OnTimer", "GapOnTimer"
End Sub

'------------------
Sub PlayerOnPlay()
  If SilenceEnabled Then
    SDB.Player.StopAfterCurrent = True
  End If
  If  GapTimer.Enabled = True Then  
    GapTimer.Enabled = False
    Set GapProgress = Nothing
  End If
End Sub

'-----------------------
Sub PlayerTrackEnd()
  If SilenceEnabled and (SDB.Player.CurrentSongIndex+1 < SDB.Player.PlayListCount or SDB.Player.IsRepeat or SDB.Player.IsShuffle) Then
    Set GapProgress = SDB.Progress
    GapProgress.MaxValue = SilenceTime
    GapProgress.Text="Gap " & SilenceTime & " seconds."
    GapTimer.Enabled = True
  Else
    GapTimer.Enabled = False
    Set GapProgress = Nothing
  End If
End Sub

Sub GapOnTimer(Timer)
  If GapProgress.Value = 0 Then
    SDB.Player.Next
  End If
  If GapTimer.Enabled = True Then
    GapProgress.Increase
    GapProgress.Text="Gap " & SilenceTime - GapProgress.Value & " seconds."
  End If
  If GapProgress.Value >= GapProgress.MaxValue Then
    SDB.Player.Play  
    GapTimer.Enabled = False
    Set GapProgress = Nothing
  End If
End Sub

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

	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 = "Adds silence between playing songs." & vbcrlf & _
                   "Can also be enabled/disabled through Play menu."
	End With

	Set oPanel1 = SDB.UI.NewGroupBox(Sheet)
	oPanel1.Common.SetRect 100,80,240,100
	oPanel1.Caption = "Delay between songs"

	Set oCheck1 = SDB.UI.NewCheckBox(oPanel1)
	With oCheck1
        .Caption = "Enable"
    	.Common.Left = 25
    	.Common.Top = 25
    	.Common.ControlName = "ChEnable"
        .Checked = SilenceEnabled
    End With
    
     Set oSpin1 = SDB.UI.NewSpinEdit(oPanel1)
     With oSpin1
         .Common.Left = 25
         .Common.Top = 55
         .Common.Width = 45
         .MinValue = 1
         .MaxValue = 15
         .Common.ControlName = "EdLength"
         .Value = SilenceTime
     End With

    With SDB.UI.NewLabel(oPanel1)
        .caption = "second(s)"
        .Common.Left = 80
        .Common.Top = 58
    End With
    
End Sub


'---------------------
Sub SaveSheet(Sheet)
 	Dim v

    Set v = Sheet.Common.ChildControl("ChEnable")
    If v.Checked <> SilenceEnabled then
        ToggleSilence 0
    End If

    'SDB.IniFile.BoolValue(AppTitle,"Enabled") = SilenceEnabled         'Not necessary
    SilenceTime = Sheet.Common.ChildControl("EdLength").Value
    SDB.IniFile.StringValue(AppTitle,"SilenceTime") = SilenceTime
End Sub
Eyal
Posts: 3116
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by Eyal »

Thank you Onnotabak, that's great.
I added conditions to the code to stop playing after Shuffle has played all files, when Repeat is off.

Thanks to you, version 2.2 is now perfect.

-------------------
Download
2010-05-01 - V2.2
Via MediaFire : http://www.mediafire.com/file/ziemzaj5z ... ngs22.mmip
Via DataFileHost: http://www.datafilehost.com/download-645fd006.html

:~)
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
hays_r

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by hays_r »

I also get an error during installation. "Product installation error" from Windows 7 32 bit, as administrator, MM v. 3.2.0.1294
Eyal
Posts: 3116
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by Eyal »

Have you tried the last step in this eSupport?
If you're in Windows 7 and MediaMonkey is in the taskbar, right click the icon,
then right-click "MediaMonkey" and then Run as administrator.
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
fhoyos
Posts: 4
Joined: Thu Jul 15, 2010 9:35 pm

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by fhoyos »

Error #424 - Microsoft VBScript runtime error
Object required: 'GapProgress'
File: "C:\Program Files\MediaMonkey\Scripts\Auto\SilenceBetweenSongs.vbs", Line: 129, Column: 6

Please Help
Eyal
Posts: 3116
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by Eyal »

fhoyos wrote:Error #424 - Microsoft VBScript runtime error
Object required: 'GapProgress'
File: "C:\Program Files\MediaMonkey\Scripts\Auto\SilenceBetweenSongs.vbs", Line: 129, Column: 6
I'm sorry, I really don't know why you get this error.
This code part is increasing the progress bar when silence is generated. It was coded by Onnotabak.

You can try version 1.0 which doesn't use progress bar.
Please uninstall version 2.2 first. (menu Tools|Extensions)

Download Silence Between Songs v1.0:
http://www.mediafire.com/file/nmzjb2zym ... ngs10.mmip
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
fhoyos
Posts: 4
Joined: Thu Jul 15, 2010 9:35 pm

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by fhoyos »

Thanks Eyal
I will try
Roux

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by Roux »

I was excited to come across this addon, but after installing it and running Media Monkey I get "error message #438 - Microsoft runtime error Object doesn't support 'SDB.Player.StopAfterCurrent'. And then a second error much the same.

When I turn on, or off, "Silence Between Songs" I get 'error executing script event'. I have MM 3.1.0.1256.

I'd like to fix this, or learn how to uninstall it to remove the opening error messages. Thanks
nohitter151
Posts: 23640
Joined: Wed Aug 09, 2006 10:20 am
Location: NJ, USA
Contact:

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by nohitter151 »

Roux wrote:I was excited to come across this addon, but after installing it and running Media Monkey I get "error message #438 - Microsoft runtime error Object doesn't support 'SDB.Player.StopAfterCurrent'. And then a second error much the same.

When I turn on, or off, "Silence Between Songs" I get 'error executing script event'. I have MM 3.1.0.1256.

I'd like to fix this, or learn how to uninstall it to remove the opening error messages. Thanks
Update to MM 3.2.2. Your version is out-of-date.
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?

Please no PMs in reply to a post. Just reply in the thread.
Eyal
Posts: 3116
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by Eyal »

Sorry, I forget to mention system requirement for v2.x of this script.

V1.0 of the script requires MM 3.1.0.1218 or newer to work.
V2.x requires MM 3.1.2 or newer.

Thanks
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].
Guest

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by Guest »

"That was easy"... Thanks!
Ray Dupont
Posts: 2
Joined: Thu Aug 05, 2010 9:09 am

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by Ray Dupont »

Thanks Eyal,
It works fine for me too, with a W7 Familial Edition and MM3.
artworksmetal
Posts: 47
Joined: Wed Dec 07, 2005 10:41 am
Location: Virginia

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by artworksmetal »

Just what the doctored ordered. W7,latest MMG. didn't even have to restart MM.

Thank you for your effort.
MM Gold since 2005
MMA Pro since 7/14

The only thing to do with good advice is pass it on. It is never any use to oneself.
Oscar Wilde
rovingcowboy
Posts: 14163
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Re: Silence Between Songs v2.2 [MM3] updated 2010-05-01

Post by rovingcowboy »

okay i just got this v1 eayl i'm slow ya know. but i got tired of my announcer fighting with the songs to say his comments.
so i'll have to space the songs out some more and did not want to edit more silent space on the songs. so hope this works. 8)
maybe i'll get v2 also. just in case i need more.
roving cowboy / keith hall. My skins http://www.mediamonkey.com/forum/viewto ... =9&t=16724 for some help check on Monkey's helpful messages at http://www.mediamonkey.com/forum/viewto ... 4008#44008 MY SYSTEMS.1.Jukebox WinXp pro sp 3 version 3.5 gigabyte mb. 281 GHz amd athlon x2 240 built by me.) 2.WinXP pro sp3, vers 2.5.5 and vers 3.5 backup storage, shuttle 32a mb,734 MHz amd athlon put together by me.) 3.Dell demension, winxp pro sp3, mm3.5 spare jukebox.) 4.WinXp pro sp3, vers 3.5, dad's computer bought from computer store. )5. Samsung Galaxy A51 5G Android ) 6. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.
Post Reply