Old 18th October 2004, 13:56   #121
shaneh
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.
shaneh is offline   Reply With Quote
Old 20th October 2004, 11:43   #122
CaAl
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.
Attached Files
File Type: zip three_from_one.zip (988 Bytes, 635 views)
CaAl is offline   Reply With Quote
Old 8th November 2004, 02:47   #123
shaneh
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.
shaneh is offline   Reply With Quote
Old 8th November 2004, 05:36   #124
jsonnabend
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
jsonnabend is offline   Reply With Quote
Old 8th November 2004, 07:34   #125
shaneh
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.
shaneh is offline   Reply With Quote
Old 8th November 2004, 15:33   #126
jsonnabend
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
jsonnabend is offline   Reply With Quote
Old 8th November 2004, 23:03   #127
AnodA
Member
 
Join Date: Aug 2004
Location: AC
Posts: 73
Quote:
Originally posted by shaneh
Released as "ActiveWinamp" to the plugins page.

http://www.winamp.com/plugins/details.php?id=143299
Can't find this in Plugin Pages
AnodA is offline   Reply With Quote
Old 8th November 2004, 23:06   #128
DrO
 
Join Date: Sep 2003
Posts: 27,880
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
DrO is offline   Reply With Quote
Old 9th November 2004, 04:35   #129
shaneh
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.
shaneh is offline   Reply With Quote
Old 10th November 2004, 17:23   #130
jgallen23
Junior Member
 
Join Date: Apr 2001
Posts: 8
Send a message via AIM to jgallen23
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
jgallen23 is offline   Reply With Quote
Old 11th November 2004, 01:55   #131
shaneh
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
shaneh is offline   Reply With Quote
Old 11th November 2004, 16:25   #132
jgallen23
Junior Member
 
Join Date: Apr 2001
Posts: 8
Send a message via AIM to jgallen23
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
jgallen23 is offline   Reply With Quote
Old 12th November 2004, 03:13   #133
shaneh
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.
shaneh is offline   Reply With Quote
Old 12th November 2004, 17:57   #134
jgallen23
Junior Member
 
Join Date: Apr 2001
Posts: 8
Send a message via AIM to jgallen23
where can I get id3com??
jgallen23 is offline   Reply With Quote
Old 12th November 2004, 18:21   #135
jgallen23
Junior Member
 
Join Date: Apr 2001
Posts: 8
Send a message via AIM to jgallen23
I got id3lib, which is an id3com, is that what I need? Also, once I get that, where do I put the files?
jgallen23 is offline   Reply With Quote
Old 13th November 2004, 03:40   #136
shaneh
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.
shaneh is offline   Reply With Quote
Old 13th November 2004, 05:34   #137
billyvnilly
Forum King, M.D.
 
billyvnilly's Avatar
 
Join Date: Mar 2004
Location: Detroit burbs
Posts: 3,379
Send a message via ICQ to billyvnilly Send a message via AIM to billyvnilly
i tried explaining that to him before. i suggested that he use mp3tag (a mass tagger). You can create a playlist in winamp. save it. open the playlist in mp3tag and mass tag their genres. and it saves it to id3v1 and id3v2.
billyvnilly is offline   Reply With Quote
Old 13th November 2004, 07:03   #138
jgallen23
Junior Member
 
Join Date: Apr 2001
Posts: 8
Send a message via AIM to jgallen23
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
jgallen23 is offline   Reply With Quote
Old 14th November 2004, 20:35   #139
jgallen23
Junior Member
 
Join Date: Apr 2001
Posts: 8
Send a message via AIM to jgallen23
shaneh, where can I find the id3com you used in the script examples?
jgallen23 is offline   Reply With Quote
Old 14th November 2004, 20:59   #140
Thunder Pussy
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,
Thunder Pussy is offline   Reply With Quote
Old 15th November 2004, 02:57   #141
shaneh
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?
shaneh is offline   Reply With Quote
Old 15th November 2004, 04:55   #142
Thunder Pussy
Feed me a stray dog
(Major Dude)
 
Join Date: Oct 2004
Posts: 1,122
Quote:
Originally posted by shaneh
@¿¢?: 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?
The one I tried & wasn't successful at was to enqueue the current ml selection after current with a hotkey.

A site for the scripts is a great idea. Maybe I'll catch up by then & can add some to the database. :-)
Thunder Pussy is offline   Reply With Quote
Old 15th November 2004, 05:47   #143
shaneh
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.
shaneh is offline   Reply With Quote
Old 15th November 2004, 17:33   #144
jgallen23
Junior Member
 
Join Date: Apr 2001
Posts: 8
Send a message via AIM to jgallen23
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
jgallen23 is offline   Reply With Quote
Old 15th November 2004, 20:09   #145
Lion12
Senior Member
 
Lion12's Avatar
 
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:
code:

'sendto_Instance1.vbs
Dim x, WshShell

Set WshShell=CreateObject("WScript.Shell")
x = GetSendToItems

if ubound(x,1) > 0 then

for each track in x
WshShell.Run "c:\\programs\\winamp\\winamp.exe /CLASS""Instance1"" /ADD """ & track.filename & """"
next

end if
quit

(just the same with 'sendto_Instance2')

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
Lion12 is offline   Reply With Quote
Old 16th November 2004, 21:49   #146
Thunder Pussy
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.
Thunder Pussy is offline   Reply With Quote
Old 17th November 2004, 05:11   #147
shaneh
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.
shaneh is offline   Reply With Quote
Old 17th November 2004, 07:38   #148
shaneh
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?
shaneh is offline   Reply With Quote
Old 17th November 2004, 15:59   #149
Lion12
Senior Member
 
Lion12's Avatar
 
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?? !? Donno that's possible.

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.
Lion12 is offline   Reply With Quote
Old 22nd November 2004, 02:49   #150
maynardkrebs
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:

' ActiveWinamp Script: "sendto_Nero Cover Designer.vbs"
' Desc: Nero Cover Designer SendTo Script

'########################
' CODE
'########################
Const ForReading = 1, ForWriting = 2, ForAppending = 8

Set wsh = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
cdcFile = wsh.ExpandEnvironmentStrings("%TEMP%") & "\watemp.cdc"
Set fcdc = fso.OpenTextFile(cdcFile, ForWriting, True)

sel = GetSendToItems
If ubound(sel) = 0 Then
MsgBox "No tracks selected", vbOKOnly+vbQuestion, "SendTo Nero Cover Designer"
Quit
End If

' Get total selection time
plTime = 0
for each track in sel
plTime= plTime + track.Length
next

' Write collection info
fcdc.WriteLine("[Parameters]")
fcdc.WriteLine("Language=English")
fcdc.WriteLine("[CDINFO]")
fcdc.WriteLine("Type=Audio-CD")
fcdc.WriteLine("Title=Winamp")
fcdc.WriteLine("Artist=Winamp")
fcdc.WriteLine("Tracks=" & ubound(sel))
fcdc.WriteLine("Playtime=" & ConvertSeconds(plTime))

' Write track info
i=1
for each track in sel
fcdc.WriteLine("[Track" & i & "]")
fcdc.WriteLine("Type=Audio")
fcdc.WriteLine("Artist=" & track.Artist)
fcdc.WriteLine("Title=" & track.Title)
fcdc.WriteLine("Playtime=" & ConvertSeconds(track.Length))
i=i+1
next

fcdc.Close

' Launch Nero Cover Designer
ncdPath = wsh.RegRead("HKLM\SOFTWARE\Classes\Nero Cover Designer.Document\shell\open\command\\")
ncdPath = Left(ncdPath, InStr(ncdPath, " /dde"))
wsh.Exec(ncdPath & " " & cdcFile)

Quit


'########################
' FUNCTIONS
'########################

Function ConvertSeconds(lSeconds)
Dim lTmpMinutes
Dim lTmpSeconds
Dim lTmpHours

If lSeconds > 59 Then
'Get's *just* the amount of seconds that will be returned
lTmpSeconds = lSeconds Mod 60
'Do we have more than an hour's worth of seconds?
If lSeconds > 3599 Then
'How many hours are we talking about
lTmpHours = Fix(lSeconds / 3600)

'Take the original seconds and figure out
'how many minutes we have. Then remove from that
'anything that says "60" for the minutes. So we
'don't have "2:60:05"
lTmpMinutes = lSeconds / 60 - (60 * lTmpHours)

'Finally return the value all nicely formatted up
ConvertSeconds = lTmpHours & ":" & _
FormatTime(lTmpMinutes) & ":" & _
FormatTime(lTmpSeconds)
Else
'Ok. We've got something less than an hour.
'How many minutes do we have?
lTmpMinutes = Fix(lSeconds / 60)

'Seconds were already figured above (lSeconds Mod
'60) so we just return the value and we be done.
ConvertSeconds = lTmpMinutes & ":" & _
FormatTime(lTmpSeconds)
End If
Else
'This is for the lazy that sends us less than even a
'*minutes* worth of seconds. Just dress it up and send
'it back.
ConvertSeconds = "0:" & FormatTime(lSeconds)
End If
End Function


Function FormatTime(tval)
If tval < 10 Then
FormatTime = "0" & tval
Else
FormatTime = CStr(tval)
End If
End Function


Last edited by maynardkrebs; 22nd November 2004 at 03:05.
maynardkrebs is offline   Reply With Quote
Old 23rd November 2004, 03:23   #151
shaneh
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.
shaneh is offline   Reply With Quote
Old 24th November 2004, 23:24   #152
Primathon
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
Primathon is offline   Reply With Quote
Old 25th November 2004, 01:21   #153
maynardkrebs
Junior Member
 
Join Date: Nov 2004
Posts: 19
Quote:
Originally posted by Primathon
how difficult would it be to write a script that would add the selected song to an open Nero compilation (audio CD or ISO)?
Not sure (yet) Nero does have an object interface that's accessible through scripting, but I've only given it a quick browse. If I come up with something I'll keep you posted.
maynardkrebs is offline   Reply With Quote
Old 25th November 2004, 02:34   #154
maynardkrebs
Junior Member
 
Join Date: Nov 2004
Posts: 19
Quote:
Originally posted by shaneh
Though I think .ATFString("%lengthf%") may have saved you some time in formatting the time.
Hey Shane.

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:

' ActiveWinamp Script
' File: sendto_Nero Cover Designer.vbs
' Desc: sendto script to pass the current track selections
' in Winamp to Nero Cover Designer
'
' v1.0 11/24/2004 6:01 PM maynardkrebs
'

'########################
' CODE
'########################
Const ForReading = 1, ForWriting = 2, ForAppending = 8

sel = GetSendToItems

If ubound(sel) = 0 Then
MsgBox "There are no tracks selected in Winamp", _
vbOKOnly+vbExclamation, "SendTo NCD"
Quit
End If

Set wsh = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
scdc = wsh.ExpandEnvironmentStrings("%TEMP%") & "\watemp.cdc"
Set fcdc = fso.OpenTextFile(scdc, ForWriting, True)
Set dict = CreateObject("Scripting.Dictionary")

' Total Hack: abusing the dictionary object as a searchable
' data struct for tracking the number of unique artists/albums
' in the current selection and deriving the cd label artist and
' album fields. The logic goes something like this:
' If:Artists Albums Then:LabelArtist LabelTitle
' 1 1 ArtistName AlbumName
' 1 >1 ArtistName Various
' >1 X Various Various
'
tSel = 0
For Each track In sel
key = track.Artist & Track.Album
If Not dict.Exists(key) Then
dict.Add key, track.Artist
End If
' Get the total selection time
tSel = tSel + track.Length
Next
'Assume single artist/single album then verify
cdcArtist = "Artist=" & sel(1).Artist
cdcAlbum = "Title=" & sel(1).Album
bMultArtists = False
If dict.Count > 1 Then
'multiple albums
cdcAlbum = "Title=Various"
artists = dict.Items
dict.RemoveAll
For Each artist In artists
If Not dict.Exists(artist) Then
dict.Add artist, ""
End If
Next
If dict.Count > 1 Then
' multiple artists
bMultArtists = True
cdcArtist = "Artist=Various"
End If
End If

' Write NCD collection info
fcdc.WriteLine("[Parameters]")
fcdc.WriteLine("Language=English")
fcdc.WriteLine("[CDINFO]")
fcdc.WriteLine("Type=Audio-CD")
fcdc.WriteLine(cdcAlbum)
fcdc.WriteLine(cdcArtist)
fcdc.WriteLine("Tracks=" & ubound(sel))
fcdc.WriteLine("Playtime=" & tSel)

' Write NCD track info
i=1
For Each track In sel
' Only include artist name if there are multiple artists
If bMultArtists Then artist = track.Artist Else artist = ""
fcdc.WriteLine("[Track" & i & "]")
fcdc.WriteLine("Type=Audio")
fcdc.WriteLine("Artist=" & artist)
fcdc.WriteLine("Title=" & track.Title)
fcdc.WriteLine(track.ATFString("Playtime=%lengthf%"))
i=i+1
Next

fcdc.Close

' Launch Nero Cover Designer
On Error Resume Next
ncdPath = wsh.RegRead("HKLM\SOFTWARE\Classes\Nero Cover " & _
"Designer.Document\shell\open\command\\")
ncdPath = Left(ncdPath, InStr(ncdPath, " /dde"))
wsh.Exec(ncdPath & " " & scdc)
If E******mber Then
MsgBox "There is a problem starting Nero Cover Designer", _
vbOKOnly+vbExclamation, "SendTo NCD"
End If
On Error GoTo 0

Quit

maynardkrebs is offline   Reply With Quote
Old 25th November 2004, 12:19   #155
shaneh
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.
shaneh is offline   Reply With Quote
Old 29th November 2004, 04:31   #156
maynardkrebs
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
maynardkrebs is offline   Reply With Quote
Old 29th November 2004, 19:37   #157
herd
Junior Member
 
herd's Avatar
 
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
herd is offline   Reply With Quote
Old 30th November 2004, 02:39   #158
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
IApplication:ut_Position: Yeah, thats a known issue. For some reason I couldnt find the API to seek in Winamp at the time. It is possible though, I'll add it in a future release. I left the function there so I could add it without breaking the interface, though thats kind of against COM rules... :P. You may use IApplication::SendMsg with IPC_JUMPTOTIME (106) to do it at the moment.

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..
shaneh is offline   Reply With Quote
Old 30th November 2004, 12:07   #159
herd
Junior Member
 
herd's Avatar
 
Join Date: Nov 2004
Location: Germany
Posts: 7
Quote:
Originally posted by shaneh
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.
Sorry I read something somewhere in the code samples and misunderstood that - I'll remove the false assumption. Thanks for the seek thing - worked like a charm.
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.
herd is offline   Reply With Quote
Old 2nd December 2004, 12:58   #160
herd
Junior Member
 
herd's Avatar
 
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?
herd is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump