Page 12 of 13

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Fri Aug 15, 2008 6:52 am
by trixmoto
No, OnStop is fired when the stop button is clicked. The only way to do this currently would be to use the OnPlay and keep a note of the previous track each time. Of course this won't work for the very last track, so your request for a new event is probably necessary for this to work 100%.

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Fri Aug 15, 2008 4:39 pm
by PartialGestalt
Thanks for the followup -- I guess I'll just stick to polling for now....

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Fri Aug 15, 2008 8:28 pm
by Peke
@PartialGestalt
There is no dedicated Event for On TrackEnd But Here is how I solve that using Both Stop And Play.

Code: Select all

Public CacheTrackInfo
Set CacheTrackInfo = Null
Function  OnPlayStop
If Not (CacheTrackInfo = Null) Then
  ' First Do whatever it is needed to do on Track End
  CacheTrackInfo = Player.CurrentTrack
Else
  CacheTrackInfo = Player.CurrentTrack           
end if
End Function
that way it will always do function on last played track.

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Wed Aug 27, 2008 1:32 am
by MoDementia
Event to add custom menus to nodes
Although this has been discussed here I don't think it was added to this thread

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Thu Aug 28, 2008 9:24 pm
by MoDementia
Access to the main track window column sorting criteria

My script can switch between sets of column postion / hidden/visible but their sort status is not available?

Re:

Posted: Tue Oct 14, 2008 11:50 pm
by flashk
DaledeSilva wrote:in the wishlist, this is mentioned:

::SDBTracksWindow
Clear method

I too would like to be able to do SDB.MainTracksWindow.Clear

at the moment you can add tracks to the window WITHOUT moving to a new node.. and you can remove selected... but you can't create a completely new list WITHOUT moving to a new node.
What is the status on this? I would really like to have this functionality as well. I've also made an album art browsing docking panel and would like to fill the main tracks window with all the tracks of the selected album without having to jump to a node.

Re: Re:

Posted: Wed Oct 15, 2008 8:45 am
by ZvezdanD
flashk wrote:
DaledeSilva wrote:I too would like to be able to do SDB.MainTracksWindow.Clear
What is the status on this? I would really like to have this functionality as well.
How about:

Code: Select all

    Dim oShell
    Set oShell = CreateObject("WScript.Shell")
    oShell.SendKeys "^a"
    SDB.ProcessMessages
    SDB.MainTracksWindow.RemoveSelectedTracks

Re: Re:

Posted: Wed Oct 15, 2008 9:54 am
by flashk
ZvezdanD wrote:How about:

Code: Select all

    Dim oShell
    Set oShell = CreateObject("WScript.Shell")
    oShell.SendKeys "^a"
    SDB.ProcessMessages
    SDB.MainTracksWindow.RemoveSelectedTracks
Thanks, but the MainTracksWindow will not have input focus when I want to to clear the list, so the Ctrl + A keystroke will not be sent to it. Having a Clear method, as many other people have requested, would be the easiest solution.

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Wed Oct 15, 2008 10:29 am
by Bex
I haven't tried this but it should work if you go to a node which clears the MainWindow.
Something like:

Code: Select all

  SDB.MainTree.CurrentNode.NodeType = 12 'Library
  SDB.MainTracksWindow.Refresh
But I agree that we should have a proper Clear method

Re: Re:

Posted: Wed Oct 15, 2008 11:15 am
by ZvezdanD
flashk wrote:Having a Clear method, as many other people have requested, would be the easiest solution.
Yeah, I agree, but there are many more important things in API that are waiting on a queue for a long time. Let's face it, MM developers don't listen scripters at all. When some of them answered to someone in this forum last time (beside of Peke who is also very rarely here)? When they are updated their API last time, beside of two or three not so very significant methods/properties? Here are only changes for several years: ActiveFilterQuery, GetFilterQuery, rather pathetic SDBUIMultiLineEdit and ... I think there is no more.

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Thu Oct 16, 2008 9:27 pm
by flashk
Bex wrote:I haven't tried this but it should work if you go to a node which clears the MainWindow.
Something like:

Code: Select all

  SDB.MainTree.CurrentNode.NodeType = 12 'Library
  SDB.MainTracksWindow.Refresh
But I agree that we should have a proper Clear method
Thanks for the tip Bex! The code you posted works, but you need to restore the NodeType after adding the tracks to the window. Here is the final code I use to clear the main tracks window without jumping to a different node:

Code: Select all

' Save current node type
originalNodeType = SDB.MainTree.CurrentNode.NodeType

' Clear current tracks from window
SDB.MainTree.CurrentNode.NodeType = 12
SDB.MainTracksWindow.Refresh

' Add my own tracks
SDB.MainTracksWindow.AddTracksFromQuery "some query"
SDB.MainTracksWindow.FinishAdding

' IMPORTANT!! Restore original node type
SDB.MainTree.CurrentNode.NodeType = originalNodeType

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Fri Oct 17, 2008 1:08 am
by twinbee
Ability to add add a track to SDBTracksWindow via song ID (instead of just ISDBSongData). It would work like AddTrackById for ISDBPlaylist.

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Fri Oct 17, 2008 2:18 am
by Bex
@flashk,
Cool! :D

@twinbee,
That already possible:
SDB.MainTracksWindow.AddTracksFromQuery("WHERE Songs.ID=" & SongsID)
http://www.mediamonkey.com/wiki/index.p ... sFromQuery

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Fri Oct 17, 2008 4:20 am
by twinbee
That already possible:
SDB.MainTracksWindow.AddTracksFromQuery("WHERE Songs.ID=" & SongsID)
Wouldn't that be slower though, considering it has to scan through the whole database looking for the correct ID?

Then again, maybe that's what AddTrackById does anyway (I initially thought it was more direct). I imagine that adding through ISDBSongData will be much quicker in that case.

Re: Scripting Functionality Thread (NO Script Requests Here!)

Posted: Fri Oct 17, 2008 11:11 am
by Bex
No, SDB.MainTracksWindow.AddTracksFromQuery() is the fastest way to add tracks to the main window, as long as you don't have slow SQL's.