3.0.1.1127 --- player does not want to stop via scripting

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: 3.0.1.1127 --- player does not want to stop via scripting

by Teknojnky » Tue Jan 08, 2008 10:49 am

seems to be fixed, thanks!

Re: 3.0.1.1127 --- player does not want to stop via scriptin

by PetrCBR » Mon Jan 07, 2008 3:06 pm

Thanks. Will be fixed in next release.

3.0.1.1127 --- player does not want to stop via scripting

by Teknojnky » Fri Jan 04, 2008 4:56 pm

This script which worked fine in mm2 does not stop the player properly.

Pause does seem to work.

I added a msgbox before and after 2 stop statements and neither stop is working.

Code: Select all

'========================================================================== 
' 
' MediaMonkey Script 
' 
' NAME: Stop After Current 
' DESCRIPTION: adds 2 icons to the standard toolbar, to stop and pause 
'   after the current song finishes' 
' VERSION: 1.0 
' DATE  : July 16, 2007 
' AUTHOR: Teknojnky 
' 
' INSTALL: 
' - Copy script to MM directory scripts\auto 
' 
' TODO: 
' 
' 
'========================================================================== 
' 
Option Explicit 

'Public StopAfterTBB 
'Public PauseAfterTBB 
  
  
Sub OnStartUp() 

    Do While Not SDB.IsRunning
      SDB.ProcessMessages
    Loop


' add toolbar icons for pause after, and stop after, on the player toolbar 

' add separater' 
  SDB.UI.AddMenuItemSep SDB.UI.Menu_TbStandard,0,0 
  
' toggle pause button' 

  Dim PauseAfterTBB : Set PauseAfterTBB = SDB.UI.AddMenuItem(SDB.UI.Menu_TBStandard,0,0) 
  PauseAfterTBB.Caption = SDB.Localize("Pauses play after currently playing song") 
  PauseAfterTBB.OnClickFunc = "PauseAfter" 
  PauseAfterTBB.UseScript = Script.ScriptPath 
  PauseAfterTBB.IconIndex = 2 
  SDB.Objects("PauseAfterTBB") = PauseAfterTBB 

' toggle stop button' 
  
  Dim StopAfterTBB : Set StopAfterTBB = SDB.UI.AddMenuItem(SDB.UI.Menu_TBStandard,0,0) 
  StopAfterTBB.Caption = SDB.Localize("Stops play after currently playing song") 
  StopAfterTBB.OnClickFunc = "StopAfter" 
  StopAfterTBB.UseScript = Script.ScriptPath 
  StopAfterTBB.IconIndex = 3 
  SDB.Objects("StopAfterTBB") = StopAfterTBB 

End Sub 


Sub PauseAfter(PauseAfterTBB) 

  Script.UnRegisterAllEvents 

  If PauseAfterTBB.Checked = False Then 
    PauseAfterTBB.Checked = True 
    SDB.Objects("StopAfterTBB").Checked = False     
    Call Script.RegisterEvent(SDB, "OnPlay", "DoAfter") 
  ElseIf PauseAfterTBB.Checked = True Then 
    PauseAfterTBB.Checked = False 

  End If 
  
End Sub 


Sub StopAfter(StopAfterTBB) 

  Script.UnRegisterAllEvents 
  
  If StopAfterTBB.Checked = False Then 
    StopAfterTBB.Checked = True 
    SDB.Objects("PauseAfterTBB").Checked = False     
    Call Script.RegisterEvent(SDB, "OnPlay", "DoAfter") 
  ElseIf StopAfterTBB.Checked = True Then 
    StopAfterTBB.Checked = False 
  End If 
'     SDB.Player.Stop
End Sub 


Sub DoAfter()  
  Script.UnRegisterAllEvents 
  If SDB.Objects("PauseAfterTBB").Checked = True Then  
    SDB.Player.Pause 

  ElseIf SDB.Objects("StopAfterTBB").Checked = True Then 
    SDB.Player.Stop 
msgbox("Player should have stopped before or at least after this")
    SDB.Player.Stop
  End If 
  
  SDB.Objects("PauseAfterTBB").Checked = False 
  SDB.Objects("StopAfterTBB").Checked = False     
End Sub 

Top