![]() |
#281 |
mlipod moderator
(Senior Member) Join Date: Jun 2005
Location: Germany
Posts: 3,457
|
Removing a file from the ML?
Hi,
I'd like to remove an item from the media library. Can this be done with ActiveWinamp? Reason: I remove a file from harddisc in my VB script, but it still shows up in the ML. I have to "delete dead files" manually, which I'd like to avoid. Thanks, Achim WinAmp Pro 5.5 with ml_iPod 3.10 + dev.patches (download it) ml_iPod documentation Wiki - ml_iPod FAQ - search ml_iPod forum - iPhone/iTouch - Found a bug? Donations to support the ml_iPod project can be done HERE |
![]() |
![]() |
![]() |
#282 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
AFAIK this currently can't be done. However modfying/updating etc the ML is something that will be included in the next release of ActiveWinamp. I will try get these features in soon so that people can at least use the CVS version to do these things, while I work on some of the other stuff which will hold back the next release for a bit.
|
![]() |
![]() |
![]() |
#283 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Yeah! That's right. Let him work.
I know for a fact that the next version of ActiveWinamp will kick ass. shaneh told me so. Just a question: Will ActiveWinamp use a preferences page in the next version and have a nice script editor on a separate prefs page? I once did this in my NxS Script Control (the plug-in I abandoned when you released ActiveWinamp). I can send you the code (I still kept it around in case I wanted to pick it up again). |
![]() |
![]() |
![]() |
#284 |
Junior Member
Join Date: Jul 2005
Posts: 8
|
saving the current playlist
Hi, is it possible with ActiveWinamp to write a script that saves the current playlist with a certain name? (I want to temporarily swap out the current playlist by saving it to a name that includes the date and the current playlist index.)
|
![]() |
![]() |
![]() |
#285 |
Feed me a stray dog
(Major Dude) Join Date: Oct 2004
Posts: 1,122
|
Hi, still using ActiveWinamp to make some great playlists. I need a hand with this one that a friend help me with. What do I need to do to this script to make it insert the tracks after the currently playing file rather than enqueue them?
dim i,j,Dict1,keys,tracks,num,idxs Set Dict1 = CreateObject("Scripting.dictionary") Dict1.CompareMode = BinaryCompare x = playlist.getselection() mlq = medialibrary.runqueryarray("type = 0 AND lastplay isempty AND genre = """ + x(1).genre + """") i = 0 for each track in mlq Dict1(track.artist)=Dict1(track.artist) + ":" + CStr(i) i = i + 1 next Randomize itms = Dict1.Items num = 100 do while (tracks<num) Rand = Int( (Dict1.Count-1) * Rnd) idxs = Split(itms(Rand), ":", -1, 1) Rand2 = CInt(idxs(Int(ubound(idxs)+1 * Rnd))) mlq(Rand2).enqueue tracks=tracks+1 Loop quit Thanks for helping, M p.s. Will version 2 include support for year? I hope so. |
![]() |
![]() |
![]() |
#286 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
You can get year thorugh the ATFString method. Just do ATFString("%year%") and you have it.
There is a lot of work for ShaneH to do before we will see a ActiveWinamp. A year property will probably be added for the next version (1.5 or something). I will continue to check the last CVS revisions (if ShaneH has updated it). |
![]() |
![]() |
![]() |
#287 |
Feed me a stray dog
(Major Dude) Join Date: Oct 2004
Posts: 1,122
|
I got it sorted out. I had to change
mlq(Rand2).enqueue to mlq(Rand2).insert(x(1).position) Cool. |
![]() |
![]() |
![]() |
#288 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
@¿¢?: Please add your scripts to the ActiveWinamp wiki so other can benefit from your work. And why do you have that hard to read nick? Use plaintext nick. It's so much easier. You are a n00b with that nick. Thinking it is cool and all that. IT*S NOT FRIGGIN COOL WITH NICKS CONTAINING CHARACTERS OUTSIDE A-Z RANGE.
|
![]() |
![]() |
![]() |
#289 |
Feed me a stray dog
(Major Dude) Join Date: Oct 2004
Posts: 1,122
|
Well.
I haven't put any of the scripts I use in the wiki because I don't feel that I've written them. I don't have the slightest technical knowledge about coding or scripting. All I do is take the examples that are included with the activewinamp package and modify them to suit my listening habits. Anybody who understands media library queries can do this. If I were to add them to the wiki I would feel like I was taking credit for work that I hadn't myself done, because all I'm doing is changing a word here & there. If you go back and look, all of my posts in this thread are very basic questions that if I knew how to script I wouldn't even have to ask. If shaneh doesn't object to me putting these scripts in the wiki then I'd be proud to. As far as the nick, I think it looks cool. You type it using the alt key & the number pad. Pfft. |
![]() |
![]() |
![]() |
#290 |
Forum King, M.D.
|
i put mine up, and i copied directly from shaneh. but it would have taken other people a long time to figure out how to do what i did. imo, 70% of users arent coders. any bit can help.
|
![]() |
![]() |
![]() |
#291 |
Banned
Join Date: Jan 2001
Location: Norway
Posts: 927
|
Rock on
Oh yeah. Spanish upside down question mark blended with a cent and a regular question mark. That rocks my computer so much the harddrive spins out of sync. Alt-0191, Alt-0162, ? So very advanced and quote: "pfft".
Stop being so pestering and get a real nick. Shaneh has other things to do than looking at this shit. Use the Wiki for what it's worth. Other people can then just fix code right there. Actually: Using Winamp requires you to be a coder since it's so much shit you must do to get everything right. |
![]() |
![]() |
![]() |
#292 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
@¿¢?: Yes, good to see youve worked it out. A lot of people seem to have trouble with the insert method for some reason. There is an example in the wiki to do it, but the next version will hopefulyl have some better docs and at least a link to the wiki. As saivert said, you can get the year through ATFString but I will try make more things properties hopefully.
Feel free to add whatever you like to the wiki but use your best judgement. Small changes to existing scripts probably arent necessary, but if you think itd be helpful or useful to someone by all means throw it up. If its inappropriate, I or someone else can easily roll it back or edit it, thats the idea of a wiki. You can add your own section or have them all in a single page or whatever you feel is best. @saivert: try calm down a bit. its just a nick, its not offending anyone. For someone that doesnt have much 'technical knowledge' perhaps it is 'cool', it really doesnt matter either way. |
![]() |
![]() |
![]() |
#293 |
Junior Member
Join Date: Jul 2005
Posts: 8
|
Anyone running ActiveWinamp w/ Winamp 5.094?
ActiveWinamp scripts don't seem to be working for me anymore, and I haven't figured out why. I did upgrade from Winamp 5.093 to Winamp 5.094 two days ago so I'm wondering if that could possibly be it ...
Is ActiveWinamp running ok with Winamp 5.094 for anyone? |
![]() |
![]() |
![]() |
#294 |
Junior Member
Join Date: Aug 2005
Location: Umeå - Sweden
Posts: 1
|
Same problem here.
|
![]() |
![]() |
![]() |
#295 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Works fine for me. Exactly what isn't working? I assume the script menu is appearing? Do simple:
msgbox "hey" quit scripts work? There is a bug where if 'format titles using ATF' isn't selected it won't be able to 'getselection' at all. Also, make sure to get the dll from the cvs and use that instead. |
![]() |
![]() |
![]() |
#296 |
Junior Member
Join Date: Jul 2005
Posts: 8
|
Thanks for the reply Shane.
> There is a bug where if 'format titles using ATF' isn't selected it won't be able to 'getselection' at all It looks like that's what I was encountering. I turned that option back on and ActiveWinamp's working fine with Winamp 5.094. |
![]() |
![]() |
![]() |
#297 |
Forum King, M.D.
|
im curious if someone can make me another script. It should take the rating of a file and enqueue the file that number of times. so after all is said and done, songs with ratings 0 and 1 have 1 entry in the playlist, songs with a rating of 2 exist twice in the playlist, songs that have a rating of 5 will be in the playlist five times.
I forgot who actually came up with this idea (its somewhere around here in the forum) but this method will help influence the shuffle based on rating. they were doing it manually. |
![]() |
![]() |
![]() |
#298 |
Forum Sot
(Major Dude) Join Date: Mar 2004
Location: Marietta, Ga. U.S.A.
Posts: 3,916
|
Hey Shane, finally did some playin' around with your lib and I really must say I'm impressed.
Do you have any Docs written up for it yet? |
![]() |
![]() |
![]() |
#299 | |
Junior Member
|
Quote:
|
|
![]() |
![]() |
![]() |
#300 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Yes it would be possible, however the IPC's for updating items in the ML require a pointer to a buffer in-process which contains the item information. Not very easy or plausible with VBscript or from an external app. It kinda defeats the purpose of using ActiveWinamp to use a hack like that.
The rating and playcount meta data can already be updated by simply setting the properties, this is not difficult to add for the other meta data too, just not as necessary so wasn't done. I also want to make some better APIs for accessing/enumerating all the extended_info meta data, not just a fixed set. @CaboWaboAddict: The docs are included, plus the type library info is included as part of the lib. Plus there is a wiki, though its currently broken thanks to sourceforge, Im fixing it atm. |
![]() |
![]() |
![]() |
#301 | |
Junior Member
|
Quote:
Problem is, once I change the filename, the item does no longer exist in library. So I can't reinstate its previous stats in the media library until it is there once again. I even tried looking into simulating the drag&drop behavior of the library but still without luck. Suggestions? |
|
![]() |
![]() |
![]() |
#302 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Thats currently not possible, but something I will eventually add. The problem is the meta data update methods currently only 'update', not 'add or update'. I guess all thats really needed is an 'medialibrary.additem(mediaitem)' method, which would let you add an item using the meta data in the mediaitem if its supplied.
Alternatively, if you have a MediaItem object which was obtained from the ML, and you change the .filename propery, I could make it do an add, using the meta data contained in the object. Its something I would need to think about, because that would be kind of high-level behaviour which I want to avoid. It can acutally update more than just rating and playcount, you can modify title, album, genre etc too, I just forgot I had added that. The only way to currently do something like that would be to send a 'refresh library' IPC to the ML after moving the files around. It wouldnt work too well. Otherwise you can mdofiy the source to ActiveWinamp to use add/updates instead of just updates, or to do what I described above. |
![]() |
![]() |
![]() |
#303 |
Junior Member
|
Hey.
I changed the message to ADDORUPATE and added a SET property to filename. All seems to be working great =) I can add new items from C# now. I am also going to add a "Delete from ML" function to the COM object. Thanks for your help ![]() Do you want me to do anything with that? I am not usual to working with CVS so I am not sure how (or if I can) do anything there. |
![]() |
![]() |
![]() |
#304 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
You would need CVS write access which requires me to add you as a dev. TortoiseCVS is a nice client if you ever want to use CVS under windows.
Anyway, you can email me those patches if you like, however Im not sure if I would add them as is. The reason why I used 'update' rather than 'addorupdate' is because I didn't want items to be added to the ML when changing meta data on items that weren't in the ml behind the scenes like that. For example, using LoadItem(c:\song.mp3) then changing the artist/title etc on that item shouldn't just add it to the ML. Adding an item to the ML should be a deliberate action IMHO, and not a by product of changing meta data. So I would need to think carefully about how I would go about it. I think the idea of using additem(mediaitem) would work best, Im still sceptical about having the filename property read/write coupled with such high level behaviour. I think read only would be better, as it closer reflects the reality of the ML API. Thus people using AW write code that works well with the underlying API, rather than the higher level API without realising whats happening behind the scenes. Though this is just my opinion. Unfortuantly, its not great practice to go about changing the API or behaviour randomly. Id recommend not distributing anything built on custom versions of AW, as it would break if the official version was installed. Unfortuantly this puts you and others in a difficult situation as you need functionality which hasn't been provided, and may not be able to wait for an update - which has unfortuantly been a long time coming. Ive said it before, but hopefully in the next couple weeks I will have some updates to AW and ml_tree happening. |
![]() |
![]() |
![]() |
#305 |
Junior Member
Join Date: Sep 2005
Location: Vancouver, WA. U.S.A.
Posts: 1
|
Does anyone have any C# sample projects or complete script samples I can get my grubby mits on. I'm a noob with respect to C# even worse when it comes to COM interop and I'm just not getting it, I've spent too many hours today trying and all I've managed to come up with is this:
using System; using System.IO; using System.Runtime; using System.Runtime.InteropServices; namespace WinAmpTest { class WinAmpTest1 { public static ActiveWinamp.MediaItem MI; [STAThread] public static void Main(string[] args) { string fname = @"c:\WATEST\ape.mp3"; ActiveWinamp.ApplicationClass WA = new ActiveWinamp.ApplicationClass(); MI = WA.LoadItem(ref fname); WA.Play(); Console.Write(MI.Artist); Console.WriteLine(WA.GetWaVersion()); // Keep App window open till enter pressed Console.WriteLine("[Press Enter]"); Console.ReadLine(); } } } All it does is start Winamp and plays the loaded track and displays a long of the version which appears to me to be meaningless. At the very least I had hoped it get the Track Artist but the MI object only contain a filename. I'm certain due my inept understanding and coding skills I'm missing some code but the docs are rather light right now and all the samples I've seen for VBScript are not helping me understand how to do it. Ulitmately what I want to do is start Winamp and load an item into the playlist. not that hard really but I'm stumped. Eaxactly what I want to do is be able to stuff data into the Shoutcast Source plug-in Title and URL metadata fields. the only way I've found programatically to do it so far is to load Winamp trigger a changestatus event and have the plugin detect it. If someone has complete scripts I can get hold of that show the whole picture for VBSCript I would be most appreciative. I've tried about 8 VBscript samples so far and just seem to be missing something. Many thanks Phil |
![]() |
![]() |
![]() |
#306 |
Junior Member
|
Hey, you should use the WinAmp Library to get the id3 information:
code: In the Query you can enter whatever file you need to find. P.S Naturally you can use foreach to iterate the array instead of for. |
![]() |
![]() |
![]() |
#307 |
Junior Member
Join Date: Jan 2004
Posts: 31
|
Hi,
Hi, I've a script to make a database from the playlist... code: How can I get the filename, not the path? So e.g. for a file: "D:\Music\Elvis Presley - A Little Less Conversation.mp3" I want "Elvis Presley - A Little Less Conversation.mp3" And how can I get the folder of that song? And how can I assign a hotkey to the whole script? Last edited by Cadish; 7th September 2005 at 14:51. |
![]() |
![]() |
![]() |
#308 |
Junior Member
Join Date: Apr 2004
Location: NL
Posts: 23
|
I've written a couple of .vbs files that mimic pressing the play/pause, stop, backward, forward buttons, respectively.
The code for the forward button is as follows: code: Quite straightforward - but not working good enough. When I put winamp on shuffle mode, forward goes to the next song in the queue instead of a random song. Is there any way to check whether shuffle is on or off? (Or better even, is there an easier way to mimic the forward-button?) |
![]() |
![]() |
![]() |
#310 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
The application.skip method mimics the "forward" button. Otherwise, you can use CLEveR as vitalyb posted.
|
![]() |
![]() |
![]() |
#311 |
Junior Member
Join Date: Jun 2001
Posts: 37
|
WScript
How do you access the WScript object and its methods from a script runing "inside" winamp?
More specifically, I need to run "wscript.sleep 1000" within a "startup_xxx.vbs" script. I get a message "Object Requred: Wscript". I tried "Set WScript = CreateObject("WSH.WScript"). |
![]() |
![]() |
![]() |
#312 |
Junior Member
Join Date: Jun 2001
Posts: 37
|
I hacked the sleep function by executing another VBS script:
objShell.Run "WScript.exe Delay.vbs " & iSleep,, true Someone please explain this to me... This code works: sPLFolder = "I:\Music - Playlists\" sPlayList = "test.m3u" Set objPlayList = objWinAmp.LoadItem(sPLFolder & sPlayList) This gives me a type mismatch error on LoadItem: sPLFolder = "I:\Music - Playlists\" sPlayList = "test.m3u" sFileName = sPLFolder & sPlayList Set objPlayList = objWinAmp.LoadItem(sFileName) |
![]() |
![]() |
![]() |
#313 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
You cannot access the sleep method of wscript, as it is a host supplied method and not a method of the object. I have provided a settimeout method host method for AW however which can be used to sleep.
Both versions of your code work fine for me, although I am running it as an internal script rather than external, and so dont have the 'objWinamp.' bit. It is likely to be your host environment - which I assume is wscript or VB something. You could try declaring sFileName as a string, or setting it as sFileName = "" at first to make your host realise that it is a string, or try using the + operator instead of &. |
![]() |
![]() |
![]() |
#314 |
Junior Member
Join Date: Jun 2001
Posts: 37
|
Thank you for checking. The coding problem may be due to running v1.0. I recently found the v1.2 on the sourceforge cvs, so maybe that took care of it.
I saw the SetTImeOut method but wasn't quite sure about how it worked. The Sleep method of WScript has "DoEvents" functionality in VB. Does the SetTimeOut method allow the CPU to process other instuctions also? Also, my startup script (which runs internally) has an indefinite do...loop (why I need to sleep between loops). I've noticed that when I exit winamp, although the window closes, the winamp.exe process stays in task manager. In fact, it causes windows pop-up the "ending program" dialog when logging off. I tried to set a flag with the Application_ApplicationExited event that kicks out of the loop (Do until fExited:,,,:Loop), but the ApplicationExited event isn't triggering. I've tried several other events also, but no luck. However, the sample startup_log.vbs file does work. Last edited by bdmagee; 9th October 2005 at 19:13. |
![]() |
![]() |
![]() |
#315 |
Junior Member
Join Date: Jun 2001
Posts: 37
|
Problem with Winamp hanging in process list was due to a flakey plug-in, not activewinamp script. Sorry about that folks.
Last edited by bdmagee; 9th October 2005 at 21:00. |
![]() |
![]() |
![]() |
#316 |
Junior Member
Join Date: Oct 2005
Posts: 1
|
Website is down
www.myplugins.info appears to be offline. Is there anywhere else I can find information/new versions?
|
![]() |
![]() |
![]() |
#317 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
The site should be up again soon, you can find a bit of info at:
http://sourceforge.net/projects/activewinamp/ The updated version is in the CVS. You will need to browse around and find the "Release" and download the gen_activewa.dll file and copy it over. |
![]() |
![]() |
![]() |
#318 |
Junior Member
Join Date: Jun 2004
Posts: 20
|
Hi,
Does ActiveWinamp allow enumerating and playing back radiostations in the Media Library? |
![]() |
![]() |
![]() |
#319 |
Junior Member
Join Date: Aug 2005
Posts: 2
|
Is it possible to view Internet radio stream information from this plugin? I have managed to display the ID3 tag info using VB script but I cannot seem to find any info regarding streams. When using title it shows stream number but not stream name or current title
|
![]() |
![]() |
![]() |
#320 |
Feed me a stray dog
(Major Dude) Join Date: Oct 2004
Posts: 1,122
|
I did finally upload some things to the wiki a month or so ago.
Reading the 5.2 beta thread is worrying b/c it looks that activewinamp is going to be broken by the change to 'get playlist selection.' Somebody please tell me otherwise. |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|