Replay Song Script (18.08.2006)

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

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

Replay Song Script (18.08.2006)

Post by Peke » Fri Aug 18, 2006 2:33 am

As requested many times tha MM lacks of more advanced Song Repeat method I have made one small script that will add functionality to Repeat Currently Played Son for as long as you like.

Instalation is simple. Just Make AdvRepeat,vbs in <Mediamonkey>\Scripts\Auto folder and Copy/Paste code Below, restart MM and you will get Repeat song Button in Standard Toolbar of MM.

It works like ON/OFF switch so you activate and deactivate it with same button.

Code: Select all

'==========================================================================
' NAME: Advanced Song Repeat v1.0
'
' AUTHOR: Peke
' DATE  : 18.8.2006
'==========================================================================

'Dim SDB
'Set SDB = CreateObject("SongsDB.SDBApplication")

Dim ini
Set ini = SDB.IniFile

Sub OnStartup
  ini.BoolValue("AdvRepeat","Enabled") = False
  ini.IntValue("AdvRepeat","SongID") = -1
  Set AdvRepeatButton = SDB.UI.AddMenuItem(SDB.UI.Menu_TbStandard,0,0)
  SDB.Objects("AdvRepeatButton") = AdvRepeatButton
  AdvRepeatButton.Caption = "Advanced Repeat"
  AdvRepeatButton.OnClickFunc = "AdvRepeatONOFF"
  AdvRepeatButton.UseScript = Script.ScriptPath
  AdvRepeatButton.Hint = "Repeat Current Song"
  AdvRepeatButton.IconIndex = 25
  Call Script.RegisterEvent(SDB, "OnPlay", "AdvRepeatTrack")
End Sub

Sub AdvRepeatONOFF(arg)
  If ini.BoolValue("AdvRepeat","Enabled") Then
    ini.BoolValue("AdvRepeat","Enabled") = False
    ini.IntValue("AdvRepeat","SongID") = -1
    SDB.Player.CurrentSongIndex = ini.IntValue("AdvRepeat","SongIndex")
    ini.IntValue("AdvRepeat","SongIndex") = SDB.Player.CurrentSongIndex
  Else
    ini.BoolValue("AdvRepeat","Enabled") = True
    If SDB.Player.isPlaying Then
      SetRepeat()
    End If
  End If
End Sub

Sub AdvRepeatTrack
  SetRepeat()
End Sub

Sub SetRepeat
  If ini.BoolValue("AdvRepeat","Enabled") Then
    ini.IntValue("AdvRepeat","SongID") = SDB.Player.CurrentSong.SongID
    Call SDB.Player.PlaylistAddTrack(SDB.Player.CurrentSong)
    Call SDB.Player.PlaylistMoveTrack(SDB.Player.PlaylistCount-1, SDB.Player.CurrentSongIndex+1)
    ini.IntValue("AdvRepeat","SongIndex") = SDB.Player.CurrentSongIndex
    SDB.Player.PlaylistDelete(SDB.Player.CurrentSongIndex)
  End If 
End Sub
P.S. Script is free to use, modify, ... and anyone willing to expand its basic functionality is welcome. I hope that someone will make some use of it.
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

Post by Guest » Fri Aug 18, 2006 3:04 am

Ideal. Thanks for taking the time to do this. :)

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

Post by Peke » Fri Aug 18, 2006 5:08 pm

:) No prob. Glad that you like it
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

rovingcowboy
Posts: 14153
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Sun Apr 29, 2007 10:53 am

how did this get lost in the day to day postings? too bad i missed it before now!! 8)
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 5 Android 5) 6. Proscan tablet Android 4.3 ) 7. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

Lauren

Post by Lauren » Mon May 07, 2007 2:28 pm

Hi,

I tried to install this code and I could not for the life of me manage to get the button. I installed it in the auto folder and did everything right, but something must be going wrong as I don't have the auto repeat button!!

I have the script saved in MediaMonkey\scripts\auto, in a Notepad document. I have restarted MM and tried everything (yes, I took Shuffle off).

A little help?

Thanks!

rovingcowboy
Posts: 14153
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Mon May 07, 2007 3:03 pm

name that note pad document this name.

AdvRepeat.vbs

then you should get it to work. 8)
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 5 Android 5) 6. Proscan tablet Android 4.3 ) 7. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

Lauren

Post by Lauren » Mon May 07, 2007 3:32 pm

I have it saved as that. But it still won't work.

I tried save as, and it did say 'AdvRepeat.vbs.txt' . I don't know if that changes anything...

If it does, I don't know how to get rid of the .txt extension.

Thanks!

rovingcowboy
Posts: 14153
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Mon May 07, 2007 3:40 pm

right click on the file.

then on the menu that comes up click on rename

then click on the name and use the arrow keys to move
the cursor to the far right which will be the end of the name
you have there now then just hit the backspace button to
back up and remove the .txt from the name making it in to
the needed one of .vbs

in the future when you save code in the notepad files and you know it needs to be .vbs just save it as a .txt file then rename
it as said how above its easier that way.

:D
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 5 Android 5) 6. Proscan tablet Android 4.3 ) 7. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

Lauren

Post by Lauren » Mon May 07, 2007 3:46 pm

Sorry I keep asking things!!

I did that, and in the actual 'renameable' bit of the file, there is no .txt extension. It just says AdvRepeat.vbs .

*le sigh*

I cannot get this to work and it is annoying me.

Maybe I just can't see the button? Where should it show up? In the player? Or somewhere else.

Teknojnky
Posts: 5533
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Mon May 07, 2007 3:50 pm

Set AdvRepeatButton = SDB.UI.AddMenuItem(SDB.UI.Menu_TbStandard,0,0)
should show up on the 'standard' toolbar.

The standard toolbar is the one with the rip/device sync/enqueue buttons.

Lauren

Post by Lauren » Mon May 07, 2007 3:58 pm

Right, so now I know where it should show up...and it's not there!

*bangs head against wall*

rovingcowboy
Posts: 14153
Joined: Sat Oct 25, 2003 7:57 am
Location: (Texas)
Contact:

Post by rovingcowboy » Mon May 07, 2007 4:01 pm

do you see any .exe or .txt or .mp3

or any .??? on any of your other files.

if you do not see any then you have your
computer set to hide the file extentions

and the only reason you see the vbs on that
one is because the computer thinks it is part
of the name of the file.

so you need to do this off line.

click on the word tools on the windows explorer
and then on folder options.
then on that panel you will see a tab for settings?

there are 3 tabs on it just click the second tab
it will show you the different settings you can
tell your computer what to do with in reason.
look for the option to show all file extentsions.

and select that option.
make sure you only select that option
and do not change the one for show system file
extentions.

you just want to change the normal non system
files.

then click the okay button
on the bottom right of the panel.

now look at that file again and you should
see the real .txt that is on the end of the name.
then you can change the name.

go back to the folder options and re check the
option to hide the file extenstions if you want to.

then come back on line and tell us what happened.
Last edited by rovingcowboy on Mon May 07, 2007 4:18 pm, edited 1 time in total.
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 5 Android 5) 6. Proscan tablet Android 4.3 ) 7. amd a8-5600 apu 3.60ghz mm version 4 windows 7 pro bought from computer store.

Lauren

Post by Lauren » Mon May 07, 2007 4:10 pm

C:\Program Files\MediaMonkey\Scripts\Auto\AdvRepeat.vbs

That is where I have the file saved.

On all my music files, I have the .mp3 extension. This is the only script that I have in the Auto folder. The other .txt document in the Auto folder is the 'auto' notepad file that I presume was there when MM installed.

On the AdvRepeat.vbs file, that is the name of the file. When you click on "Save As", it says "C:\Program Files\MediaMonkey\Scripts\Auto\AdvRepeat.vbs.txt already exists. Do you want to replace it?".

This is driving me maaaad! I appreciate the help, though!

Teknojnky
Posts: 5533
Joined: Tue Sep 06, 2005 11:01 pm
Contact:

Post by Teknojnky » Mon May 07, 2007 4:14 pm

Lauren wrote:On the AdvRepeat.vbs file, that is the name of the file. When you click on "Save As", it says "C:\Program Files\MediaMonkey\Scripts\Auto\AdvRepeat.vbs.txt already exists. Do you want to replace it?".

This is driving me maaaad! I appreciate the help, though!
You have to remove the .txt from the file name.

Windows > control panel > folder options > click 'view' tab > uncheck 'hide extentions of known file types'.

Guest

Post by Guest » Mon May 07, 2007 4:19 pm

Teknojnky wrote:
Lauren wrote:On the AdvRepeat.vbs file, that is the name of the file. When you click on "Save As", it says "C:\Program Files\MediaMonkey\Scripts\Auto\AdvRepeat.vbs.txt already exists. Do you want to replace it?".

This is driving me maaaad! I appreciate the help, though!
You have to remove the .txt from the file name.

Windows > control panel > folder options > click 'view' tab > uncheck 'hide extentions of known file types'.
AHA!!!

That works now!!

Thank you so so so much!! Yay!

*listens to same song over and over*

:D

xxx

Post Reply