Scripting Functionality Thread (NO Script Requests Here!)

发表回复

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

BBCode 允许
[img] 允许
[url] 允许
表情 允许

主题浏览
   

展开视图 主题浏览: Scripting Functionality Thread (NO Script Requests Here!)

Re: Scripting Functionality Thread (NO Script Requests Here!

Nanya » 周二 10月 23, 2012 5:34 pm

T'would be nice to have the ability to click on a spot on an SDBUITrackBar to change its value, (perhaps there already is, but it's just undocumented).

Having the ability to return to a previous view after a refresh would also be nice, i.e., selected tracks, visible tracks, etc..

And what about controls to modify TrackBrowser selections?

(Amateur here, perhaps I've just missed all these features. :D )

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

ZvezdanD » 周一 9月 14, 2009 3:10 pm

I agree with the previous. Also, I need OnPlaylistModified (static as well as auto-playlists).

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

flashk » 周一 9月 14, 2009 2:52 pm

I would really like a OnTrackListModified event that behaves similarly to the OnNowPlayingModified event, except for the main tracks window. The problem with OnTrackListFilled is that it doesn't handle tracks being removed, reordered, or resorted.

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

ZvezdanD » 周二 5月 12, 2009 5:43 pm

I really need OnAfterTracksMove event.

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

MoDementia » 周二 12月 30, 2008 3:32 pm

Yep an event wold be needed in this case.
As a work around you could add to the trigger to up date another table with the deletions, but it would be another click to read that table and confirm deletions.
Might not be too bad, ie instead of a popup every deletion just review the list after a deleting session.

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

trixmoto » 周二 12月 30, 2008 7:36 am

Well if the event had a parameter to cancel the delete that would be cool, but not actually something that I need. The script I'm working on communicates with an online repository so when you delete a track in the repository from MM I want to give the user the option to also delete it from the repository automatically.

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

MoDementia » 周二 12月 30, 2008 1:29 am

You're right, but a popup to do what? there is no undelete :(

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

trixmoto » 周一 12月 29, 2008 4:21 pm

Thanks, I'll take a look. :)

EDIT: Whilst this does seem to allow me to clean up my own database table, it does not allow me to add the other functionality I require (like showing a popup window to the user). Looks like I'm still gonna need an event unless I'm mistaken?

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

MoDementia » 周一 12月 29, 2008 3:51 pm

I use a trigger for this type of thing, I think sync the sync has one

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

trixmoto » 周一 12月 29, 2008 3:49 pm

Anybody else with there was an OnDelete event? For the script I'm currently working on I am creating a table to extend the Songs table and when a song is deleted I'd really like to be able to delete my own record as well. I can of course tidy these up later on, but I'd like to add some other functionality as well that would need to happen as the track is being deleted.

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

Bex » 周四 12月 18, 2008 3:52 am

No I haven't tested it yet. Perhaps SDB.MainTree.CurrentNode.NodeType = 11, which is the location, works better in MM3.1?

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

ZvezdanD » 周四 12月 18, 2008 1:53 am

Bex 写了:I agree that we should have a proper Clear method
I tried to replace SDB.MainTracksWindow.RemoveSelectedTracks in my scripts with:

代码: 全选

        SDB.MainTree.CurrentNode.NodeType = 12
        SDB.MainTracksWindow.Refresh
because it is much faster, but unfortunately after adding new tracks with SDB.MainTracksWindow.AddTrack I could not get tracks sorted as before. I tried to restore NodeType, SortCriteria and SortGroup of that node but neither of that helped. Do you have some suggestion for this or should I stay with my solution?

By the way, have you tried your suggestion with a new possibility of MM 3.1 to display all tracks in the tracklist even when you select Library node?

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

twinbee » 周四 11月 20, 2008 5:21 am

To return to this point...
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.
I have about 5000 songs in my database so far. As before, I need to add tracks by ID to the TracksWindow. Using AddTracksFromQuery() is around 10 times slower than a way I have found which is rather kludgy (so I would prefer replaced) but is lightning quick - this is basically what happens:

When Mediamonkey boots up, I copy each SongData object for all tracks to an Objects array thusly:

代码: 全选

Set it = SDB.Database.QuerySongs("id > 0")
Do While Not it.EOF
	SDB.Objects(it.Item.ID) = it.Item    ' Copy the SongData object to each Object in the array
	it.Next
Loop
I then use later: mytrackswindow.AddTrack( SDB.Objects( id(n)) ) - where "id" is an array containing thousands of ID numbers. Doing it this way is much faster than AddTracksFromQuery() alone. Even if I use ID IN(" & MyString & ")" (which I think you mentioned a while back), my above kludgy method is almost twice as fast (and also, using ID IN.... won't keep the order of the thousands of ID numbers (separated by commas) in MyString - though perhaps there's a way around that?).

This is why my reasoning for allowing the AddTrackById method for SDBTracksWindow would be a great boon. Thousands of ID numbers could be added directly without having to scan the database for each and every ID as with AddTracksFromQuery(). Am I overlooking something?

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

Bex » 周五 10月 17, 2008 11:11 am

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.

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

twinbee » 周五 10月 17, 2008 4:20 am

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.

页首