![]() |
#121 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
You can write a startup script that does the following:
settimeout 50000, getref("myfunc") sub myfunc settimeout 50000, getref("myfunc") msgbox "interval" 'possibly quit on some condition end sub As for the on/off functionality. You can open the configuration dialog and click 'run script' to run a script. When you want to turn it off, click the running script in this dialog. Its not the best interface for achieving this, but it should work ok. I'll work on making a tick mark against a menu item type interface later on. |
![]() |
![]() |
![]() |
#122 |
Junior Member
Join Date: Apr 2004
Location: NL
Posts: 23
|
Three from One script
A while back, MTV Europe had a show called Three From One. They played three songs in a row from the same artist.
I've written a script that automatically enqueues a song each time a new song is played, in such a way that you'll get three songs in a row from a random artist, followed by three in a row from another random artist. (If the artist doesn't have three songs in you media library, it will of course play fewer songs). It's attached. Toggling the script on/off can be done via the configurationwindow of Shaneh's plugin. |
![]() |
![]() |
![]() |
#123 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Released as "ActiveWinamp" to the plugins page.
http://www.winamp.com/plugins/details.php?id=143299 Be sure to delete gen_script1.dll from your plugins directory before starting winamp after installing, otherwise you will get problems. You will need to re-register the gen_activewa.dll if you don't. |
![]() |
![]() |
![]() |
#124 |
Junior Member
Join Date: Nov 2004
Posts: 7
|
I'm trying to use ActiveWinamp in a Delphi program, but I keep getting the error that the IPlaylist class is not registered. Any ideas what may be causing this?
TIA - Jeff |
![]() |
![]() |
![]() |
#125 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Are you trying to instantiate the playlist object directly or are you obtaining it from the IApplication class?
You must get the ActiveWinamp.Application object, and from that get the playlist object from the "playlist" property. Havent used delphi before, but you will need to import the gen_ActiveWinamp Type Library too however that is done. |
![]() |
![]() |
![]() |
#126 |
Junior Member
Join Date: Nov 2004
Posts: 7
|
Shaneh -
Thanks for the input. You were correct about the cause. It looks like I'm good to go, at least until the next issue. ![]() Thanks again. - Jeff |
![]() |
![]() |
![]() |
#127 | |
Member
Join Date: Aug 2004
Location: AC
Posts: 73
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#128 |
Join Date: Sep 2003
Posts: 27,873
|
looks like the dodgy download server is back in use
![]() the plugin is submitted and was showing the published list, guess you'll have to wait for a different server to come into use (not much that can be done) -daz |
![]() |
![]() |
![]() |
#129 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
You can try:
http://205.188.244.130/plugins/brows...ry=999&ctype=P .138 seems to be dodge. Just refreshing a few times should get you the other ip anyway. |
![]() |
![]() |
![]() |
#130 |
Junior Member
|
I've been looking for a way to mass change the genre of my playlist and I was wondering if this is something that I could do with this plugin. I know a little VB.net, but not enough to get started, could somebody give me a little help to get me started. Thanks
Greg |
![]() |
![]() |
![]() |
#131 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Yeah, just do a query for what you want to change with "runqueryarray" or get it from the currently selected items, or from the send to menu or wherever, then loop through and change each items genre.
A quick example which puts it on the "send to" menu: ---sendto_change genre.vbs---- x = GetSendToItems newgenre = InputBox("Genre") for each track in x track.genre = newgenre next quit -------- Or to change the selection in the playlist. ---playlist_change genre.vbs---- x = playlist.GetSelection newgenre = InputBox("Genre") for each track in x track.genre = newgenre next quit ----------- or to just change the entire playlist newgenre = InputBox("Genre") for each track in playlist track.genre = newgenre next quit |
![]() |
![]() |
![]() |
#132 |
Junior Member
|
Thanks!....now will that write to the ID3v1 tag or ID3v2 tag. I'd prefer it to write to the ID3v2 tag so I can make up my own genres
|
![]() |
![]() |
![]() |
#133 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
It will write it to the Media library... If you want tag writing you need to get ID3COM. Look at the sendto_export to id3.vbs examples.
Its not too difficult, but if youre not too familiar with it, you may be better off with some kind of mass tagger. |
![]() |
![]() |
![]() |
#134 |
Junior Member
|
where can I get id3com??
|
![]() |
![]() |
![]() |
#135 |
Junior Member
|
I got id3lib, which is an id3com, is that what I need? Also, once I get that, where do I put the files?
|
![]() |
![]() |
![]() |
#136 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
You need to put id3com.dll wherever you like, then run
regsvr32 id3com.dll and you will be able to use it. However, it is a bit tricky to use. As I said, you may be better off with some kind of mass tagger. |
![]() |
![]() |
![]() |
#138 |
Junior Member
|
I have Tag&Rename which works fine, but I want it to be able to do it on the fly without using another program. I think I follow what you did in your script examples, we'll see if I can figure it out
![]() |
![]() |
![]() |
![]() |
#139 |
Junior Member
|
shaneh, where can I find the id3com you used in the script examples?
|
![]() |
![]() |
![]() |
#140 |
Feed me a stray dog
(Major Dude) Join Date: Oct 2004
Posts: 1,122
|
I realize this plugin (thanks shaneh) is geared toward the do-it-yourself users, but it would be cool if users would post their scripts so those who aren't so adept at writing scripts could make use of the added features, and learn from others' work as well. So far I've dabbled a little (successfully) with simple modifications to existing scripts but when it comes to writing a script whole-cloth I have to admit the included help-file is a little over my head. Earlier in this thread there was quite a bit of posting of scripts, I kinda wish there was more of that.
Regards, |
![]() |
![]() |
![]() |
#141 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
http://mysite.wanadoo-members.co.uk/...ock/ID3COM.htm
Has a version, not sure how recent though. ID3Com hasnt had an update in a while, its now part of id3lib or something. Not too sure. An issue with it is it only takes a number for the genre, rather than a string and then converting it. So you will need to do that yourself, unless you can find some other library that uses a string. http://www.kindel.com/mp3/id3com/default.htm Seems to take a string, but it didnt seem to work for me if the genre field doesnt exist to begin with. The author of that is putting the code towards id3com so Im not sure which is more recent. x = GetSendToItems if ubound(x,1) > 0 Then set id3co = CreateObject("ID3Com.ID3COMTag") newgenre = CStr(InputBox("New Genre")) for each track in x id3co.link track.filename if id3co.HasV2Tag then 'set id3 tag (only takes a number) id3co.Genre = 0 'set media library data track.genre = newgenre id3co.SaveV2Tag end if id3co.Clear next end if quit Will work, but note the fact it just sets the genre to '0' (Blues). You will have to work out a way to decide what genre number to use (0-255). If you can find a command line id3 tagger which takes a filename and a argument, such as: id3tag "song.mp3" -genre Dance or whatever, you can use wscript.shell.run to run the command on every item rather than using id3com. There should be an example in this thread by saivert on running an external program. @¿¢?: Sure I encourage that, I intend to setup a site which will have a repository of scripts, similar to the winamp plugin database. Will take a little while, but in the meantime is there any particular script you are after? |
![]() |
![]() |
![]() |
#142 | |
Feed me a stray dog
(Major Dude) Join Date: Oct 2004
Posts: 1,122
|
Quote:
A site for the scripts is a great idea. Maybe I'll catch up by then & can add some to the database. :-) |
|
![]() |
![]() |
![]() |
#143 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
You cant do that actually. The current ml selection is known when the item is selected on the 'send to' menu. Unfortuantly this is a limitation of winamp, there is no documented way to get the selection in the media library other than by selecting an item on the 'send to' menu.
Thus, the command is 'getsendtoitems' as it is the items 'collected' by the Send To menu. And getselected() is a method of the playlist, thus gets selected items in the playlist. I will take a look and see if there is a practical way to get the selected items in the media library, but it wont appear in activewinamp until the next revision if so. |
![]() |
![]() |
![]() |
#144 |
Junior Member
|
shaneh, for id3v1 the genre is stored as a number, but for id3v2, the genre is whatever you name it. That's why I just want to change id3v2, it looks like you are saving the v2 tag, but that's odd that it still stores it as a number
|
![]() |
![]() |
![]() |
#145 |
Senior Member
Join Date: Nov 2004
Location: Germany Markings: The Cheshire Cat
Posts: 168
|
multi instance with activeWA
Hi out there!
I've running two instances of winamp classed as 'Instance1' and 'Instance2'. Using only the library of one instance I have to send items through the 'sendto', right? I tried something like this: (just the same with 'sendto_Instance2')code: Seems not to work correctly but I can't figure out the reason. Right way to do this, or is there a (better) internal way? Or is it better to have two diffrent winamp installation folders? regs |
![]() |
![]() |
![]() |
#146 |
Feed me a stray dog
(Major Dude) Join Date: Oct 2004
Posts: 1,122
|
Hello, I'm doing some more experimenting and have a question: How do we randomize the results of an insert script? What I've done so far is modify the insert all from album script to make it insert all from genre.
x = playlist.getselection() if ubound(x,1) > 0 then mlq = medialibrary.runqueryarray("genre HAS """ + x(1).genre + """") for each track in mlq if strcomp(track.filename, x(1).filename) <> 0 then track.insert(x(1).position) end if next end if quit Thank you for your help and patience with me, shaneh. I am just beginning to learn this language. Best regards, /edit Firefox crashed when I tried to post the formatted text so I had to post it as plain text. |
![]() |
![]() |
![]() |
#147 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
What you are trying to do is a pretty common CS problem- randomizing an array. There are various ways to do it, but a simple way with just a small array is to loop through the array swapping each item with a random other item.
Randomize x = playlist.getselection() if ubound(x,1) > 0 then mlq = medialibrary.runqueryarray("genre HAS """ + x(1).genre + """") i = 0 for each track in mlq i = i + 1 swapitems mlq(i), mlq(Int((ubound(mlq,1)) * Rnd + 1)) next for each track in mlq if strcomp(track.filename, x(1).filename) <> 0 then track.insert(x(1).position) end if next end if quit sub swapitems(ByRef val1, ByRef val2) set temp = val2 set val2 = val1 set val1 = temp End Sub There are a few ways to make this more efficient, for example, there is no real need to loop through the array twice, you can modifiy it to just do it once. I should have added support for jscript for scripting as well, but didnt have time. Hopefully I will add jscript and maybe perl support in a later release. Adding other language support for the internal scripting is not too difficult fortuantly. VBScript is not too difficult to learn though, and made more sense to use as the default language for now. |
![]() |
![]() |
![]() |
#148 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
@Lion12: ActiveWinamp was not really designed with multiple instances in mind. If you popup a msgbox with the track names instead of running winamp.exe does it display the right names? Does the /ADD command work when not using from a script?
|
![]() |
![]() |
![]() |
#149 |
Senior Member
Join Date: Nov 2004
Location: Germany Markings: The Cheshire Cat
Posts: 168
|
Jeah, multiple instances with winamp seems to be a really damn thing but many people would like to have two instances running for different reasons...
![]() Back to main topic: 1.) the names appear correctly 2.) yes, there seems to be a problem: the tracks are added to the instance last having focus. So I can't use /CLASS and /ADD at once? Some weird shell thing: I start Winwamp with $...\winamp.exe /CLASS"one" and winamp starts. I type again $...\winamp.exe /CLASS"one" and another winamp opens. (of coures only if 'allow multiple instances' is checked) Searched the forums and the old sdk but it makes me even more ![]() This seems not to be related to your plugin so I will only ask you if it's planed to consider multiple instances or some kind of workaround within your scriptring plugin? Something like GETWND/TOWND?? ![]() Thanx for your attention! EDIT: btw: it's no problem to send files to another mediaplayer this way. This helps a little bit by now ![]() Last edited by Lion12; 17th November 2004 at 16:36. |
![]() |
![]() |
![]() |
#150 |
Junior Member
Join Date: Nov 2004
Posts: 19
|
ActiveWinamp script for Nero Cover Designer
Hi Y'all.
I've created an ActiveWinamp script that sends the current track selection to Nero 6 Cover Designer. This is a first pass and could use some error trapping etc, but it works as is. I'm sure the general population would appreciate this so I'd like to find a home for it. Suggestions? Feedback? BTW Shane, ActiveWinamp rocks!! code: Last edited by maynardkrebs; 22nd November 2004 at 03:05. |
![]() |
![]() |
![]() |
#151 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
Cool script, I really should get on making that site with plugins and script etc. After I finish making some updates to Toaster I will look into it.
Though I think .ATFString("%lengthf%") may have saved you some time in formatting the time. I realise the tags are not documented in ActiveWinamp, I probably should have included them in the documentation. They are included in my other plugin, Toaster, though. |
![]() |
![]() |
![]() |
#152 |
Junior Member
Join Date: Nov 2004
Location: Drifting the Mindscape
Posts: 2
|
maynardkrebs, how difficult would it be to write a script that would add the selected song to an open Nero compilation (audio CD or ISO)? That would make burning CDs an absolute snap.
Primathon |
![]() |
![]() |
![]() |
#153 | |
Junior Member
Join Date: Nov 2004
Posts: 19
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#154 | |
Junior Member
Join Date: Nov 2004
Posts: 19
|
Quote:
Thanks for the ATFString tip. I found the Toaster doc and that simplified things. My latest incarnation is attached. Notice the hack job using the dict object. I was looking for a way to query the media items selections directly but hit a brick wall. Some thoughts: - Having a query method for track selections similar to that for the media lib object would be useful. - Adding stats support in the query would be useful (#Artists, #Albums/Artist, #Tracks/Album, Total Time etc). That would have eliminated my having to calculate those values using my ugly hack. ![]() - Bug or Feature?: when a sendto script is invoked with nothing selected, nothing happens with the script. I added a ubound check to trap this condition (as I've seen you use in your code) but I'm wondering if this is necessary. Does the script just punt if there is nothing selected? thanx maynard code: |
|
![]() |
![]() |
![]() |
#155 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
What Ive done with ActiveWinamp is try to map as much as possible that is possible under the Winamp API into a COM interface with a pretty much 1:1 match.
You can do complex queiries on the media library, becase the media library lets you do those queries. The playlist and 'send to' items etc do not give you this possibility because its not possible under the Winamp API. You would have to do it yourself using your own code regardless of whether you are using ActiveWinamp or not. Generally speaking, if somethings complicated to do using ActiveWinamp, you would probably have to jump through similar hoops just using the normal Winamp API. (this doesnt apply to more complicated hooking tricks etc however). Stats support also isnt supported under Winamp, you would need to do this yourself normally. I wouldnt want to automatically generate these stats, as it would slow it down for when you dont want these stats. Its possible I could add some support functions which let you pass in an array of media items to generate some stats etc. However the idea of ActiveWinamp is it lets you write the code and do things the way you want them done, without using prewritten stuff. Basically you are making use of the primitive Winamp API, but without having to deal with all the crap and technicalities that usually goes along with writing a plugin. -sendto: I guess that Winamp doesnt signal the menu item if nothing is selected, so ActiveWinamp wont run the script. The checks are just done for the sake of logic, and perhaps if you try run the script using 'runscript()' or something I guess. Note Getsendtoitems() returns the collection of items that was last selected when a "script:" menu item was chosen. When running a script from the 'send to' menu, this is obviously the items that are currently selected. However if you call 'GetSendToItems()' at other times, (ie from playlist_* scripts) you will get the last selection. |
![]() |
![]() |
![]() |
#156 |
Junior Member
Join Date: Nov 2004
Posts: 19
|
COM Lib for APE Tags
Hey Shane.
Thanks for the previous reply. I understand the limitations you have to work with... New question. Do you know of another COM library for APE tags similar to ID3COM? I've been using MP3Gain and would like to be able to "see" which files I've tagged as normalized in my library. Right now the only way I'm aware of to do this is to load the files into MP3Gain to get status ![]() Thanks |
![]() |
![]() |
![]() |
#157 |
Junior Member
Join Date: Nov 2004
Location: Germany
Posts: 7
|
Hello Shaneh,
you have done a great job here. Thanks to your efforts I could do my "iTunes2winAmp" bridge within 48 hours. Kindly see this: http://www.aqua-soft.org/board/showthread.php?t=21327 These desktop iTunes remote widgets coded to be using the iTunes COM API can now all be redirected to winAmp. Not seen on the screenshot is that AndreasV's AveTunes widget would offer an iTunes list of playlists at its context menu and I even could get that redone with the excellent media library bindings! Really excellent job - I have only two minor issues: - IApplication:: put_Position() has no effect with WinAmp 5.03. - IMediaItem::Enqueue is slow if you have to enqueue thousands of items - I miss enqueueing the results of a media library query at a whole: Best would be to return the query as an IPlaylist* and have a IApplication:: putref_Playlist() implemented (just an idea), I could dump the contents into a temp .m3u file and shellexecute winamp on it but even that wouldn't be as seamless as double clicking the playlist in the media lib. TIA, herd |
![]() |
![]() |
![]() |
#158 |
Major Dude
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
|
IApplication:
![]() IMediaItem::Enqueue: There is an API to add a returned query to Winamp, however ActiveWinamp converts queries to its own internal "MediaItem" objects. This is done for 2 reasons: 1) The query needs to be freed as it is allocated by winamp. 2) It makes playlist items, items loaded by filename, items not in the ml etc all the same, which makes using AW much nicer. Which explains why its called 'runqueryarray', as it creates and returns an array of objects. The "playlist" object doesnt actually keep an array of current items, it queries them from the playlist dynamically. ie, get_Item() actually creates a MediaItem from querying winamps playlist. Thus its not too logical to return a 'playlist' as a result of a query. I could, and actually did intend, to create another type of query method on the media library, that would return a less flexible query results object. This object would however let you do things like mass updates and send it to winamp etc. I would add a function to convert it to an array of mediaitems also. Alternatively, I could add a function on the medialibrary that lets you pass in an array of MediaItems, and it converts it to a format suitable for sending to Winamp, ML style. Or just send it to Winamp itself. I would need to see how the ML does it to see if it uses some trick to do it quicker. I downloaded and read the doc for the fake iTunes proxy thing. You state that ActiveWinamp only supports one client, though it should support as many as you like. What makes you think it only supports one client? It only supports one server/winamp instance, if thats what you meant. @maynardkrebs: Sorry, Im not aware of such a component. You may be able to find some component which lets you do binary access on a file and query the tag yourself, if its in a easy parsed format. Otherwise, if there is an .exe which lets you do tag operations, its possible to get the output of cmdline programs and work with that.. |
![]() |
![]() |
![]() |
#159 | |
Junior Member
Join Date: Nov 2004
Location: Germany
Posts: 7
|
Quote:
I found out that dumping 3000 songs to an .m3u and executing winamp on it is slightly faster than enqueueing them in a loop but still not as seamless as from the media library - If you could address the issue in a later release it would be fine but in the meantime I'll gig into the IPC_** vs. WM_COPYDATA stuff. Again, thanks a lot. |
|
![]() |
![]() |
![]() |
#160 |
Junior Member
Join Date: Nov 2004
Location: Germany
Posts: 7
|
I just found another one:
IMediaItem returns only a partial IP-Address if the current track is a radio stream - there seems to be no possibility to get the streams display name, am I right? |
![]() |
![]() |
![]() |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|