Old 29th March 2005, 02:42   #241
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
It keeps the bitrate, but there is no sample rate data AFAIK. There is no samplerate column in the ML so this has no effect on your browsing speed in the ML as it is never shown.

There may be a way to get the samplerate data, as the 'view file info' manages to do it for songs that aren't playing. Perhaps the get extended info API call has a sample rate meta field for mp3s. In ActiveWinamp, whatever tag you pass to the ATFString method first gets tried in the ML, then through the IPC_GET_EXTENDED_FILE_INFO_HOOKABLE call. Although srate is intercepted and uses the above call, which is only useful for the currently playing item. Which is actually a bit of a bug, as it should apply to the current Media Item instead, but its not really a big deal. If there is a way to get the sample rate of non-playing items, I will use that instead.
shaneh is offline   Reply With Quote
Old 29th March 2005, 11:51   #242
roytam1
Member
 
Join Date: Aug 2003
Posts: 81
I've some questions.
How can I set a selection? ActiveWinamp doesn't have playlist.selselect(number).
How can I enqueue a playlist without using media library? playlist(number).enqueue doesn't work.
roytam1 is offline   Reply With Quote
Old 29th March 2005, 11:55   #243
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
ActiveWinamp doesnt provide a means to set the selection. Winamp provides no such API so this isnt possible. If you can provide the code to set the selection, I can add it to aw. However I will not add mouse/keyboard emulated hacks.

You can enqueue a playlist file like so:
http://activewinamp.sourceforge.net/..._playlist_file

If you mean just set the position of the playlist, use:
playlist.position = x
play
shaneh is offline   Reply With Quote
Old 30th March 2005, 06:16   #244
roytam1
Member
 
Join Date: Aug 2003
Posts: 81
I should a more clear about my question.
I want to enqueue a entry of current playlist. e.g. I want to enqueue No. 30 then I can use playlist(30).enqueue to enqueue it.
roytam1 is offline   Reply With Quote
Old 30th March 2005, 07:15   #245
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
I am still unclear what you mean. playlist(30).enqueue works as expected for me.

The playlist item number 30 is enqueued to the end of the playlist.

Maybe you are referring to 'enqueuing' in jtfe or something? That is not how winamp works normally. The playlist... is your playlist. Enqueing an item enqueues it to the playlist.

What do you want to happen when you call:
playlist(30).enqueue?

Do you want the item to play? Do you want the item to be enqueued to the end of the playlist?

If you want the item to be the next item to play, that is not how winamp works. To handle that, handle the song change event and set the playlist position manually. Or use the JTFE API to set the next item, if it has one that does that.
shaneh is offline   Reply With Quote
Old 1st April 2005, 11:31   #246
antu^jamban
Junior Member
 
Join Date: Mar 2005
Posts: 3
Thanks for the info shaneh.
antu^jamban is offline   Reply With Quote
Old 8th April 2005, 15:30   #247
antu^jamban
Junior Member
 
Join Date: Mar 2005
Posts: 3
If I understand you clearly, all the info is gathered from ML. What if a person have ML removed or not installed? So we can't get any info rite?
antu^jamban is offline   Reply With Quote
Old 8th April 2005, 16:28   #248
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
I really don't understand why JTFE was born at all. The way I see it, enqueue means to put things at the end of the playlist. The playlist is essentially a queue to me.
But people like it to be a song list instead so then JTFE was invented to step in inbetween.

DrO said he was going to implement a JTFE API which would offer his own Playlist selection API too I guess.
saivert is offline   Reply With Quote
Old 8th April 2005, 16:38   #249
DrO
 
Join Date: Sep 2003
Posts: 27,880
Quote:
Originally posted by saivert
I really don't understand why JTFE was born at all.
since people like temporary playlists and don't want to mess up their main playlist order + it was a Winamp3 feature that people wanted

-daz
DrO is offline   Reply With Quote
Old 8th April 2005, 16:57   #250
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
Exactly!

Well. I really pointed out that in my post too, if you read more closely. And I do know it was a Winamp3 feature.

@ShaneH: How long have you come in the development process for AW? Do you write a log? What's the next step?
saivert is offline   Reply With Quote
Old 8th April 2005, 17:26   #251
DrO
 
Join Date: Sep 2003
Posts: 27,880
saivert: i missed that bit of your post (was skim reading whilst at work)

-daz
DrO is offline   Reply With Quote
Old 9th April 2005, 00:37   #252
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
@antu^jamban: If the file isnt found in the ML, it tries the extended_info call instead. Obiously calls to get rating and playcount etc will not return anything useful. Take a look at the code in mediaitem.cpp to see how it goes.

@saivert: I dont keep a log as such, but you can follow the trackers in soureforge and see the cvs logs etc. Im tempted to do another release soon, as Ive fixed quite a few important bugs. Though I would lke to work on internal scripting support a bit more first, and support for some more stuff such as video and equalizer things etc.
shaneh is offline   Reply With Quote
Old 9th April 2005, 12:52   #253
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
I see you are goig for a Wiki style page for ActiveWinamp.sf.net. Nice. Then people can post their own examples there for others to see.
saivert is offline   Reply With Quote
Old 28th April 2005, 03:23   #254
grahamskaraoke
Junior Member
 
Join Date: Apr 2005
Location: Ontario, Canada
Posts: 8
Developing a program using your excellent plugin and went to install it on a windows98 machine. Winamp does not show it listed in the general purpose plugin section. Is there any extra steps I need to use it on Windows 98. I ran the active winamp install and did not show any errors. The plugin and help file are in the plugin directory. I am also running gen_scripting.dll as there was a couple of things that I in my ignorance could not figure out how to do in Active Winamp.
Thanks for all the hard work.
grahamskaraoke is offline   Reply With Quote
Old 28th April 2005, 03:55   #255
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Thats very strange that its not shown in the list of plugins. I don't program with compatilibty with '98 etc anymore (just as I dont program for compatability with DOS), but it should at least be shown in that list I would think. I'm guessing Winamp is failing when trying to load the .dll and silently not doing aynthing about it. Possibly because of a missing dependency, use dependency walker to check if this is the case (you can ignore the mpr.dll missing import):
http://www.dependencywalker.com/

What is it you could not do with ActiveWinamp? Most likely there is a way.

Also, make sure you copy over the latest version of gen_activewa.dll from the CVS after you install it. Theres a fair few updates, but nothing that would increase compatability with 98 I wouldnt think.
shaneh is offline   Reply With Quote
Old 28th April 2005, 05:31   #256
grahamskaraoke
Junior Member
 
Join Date: Apr 2005
Location: Ontario, Canada
Posts: 8
Really appreciated the quick reply shane. I will try the dependency walker as soon as I get access to that machine again. As for what I couldn't figure out I've got to go through the code and will let you know. Could it possibly be a conflict between active WA and gen_scripting.dll. Works great on XP.

Does the release version on sf.net contain the support for multiple instances of winamp, or is that still being worked on.

Little background. I've been a karaoke/disc jockey for twenty years and recently had major surgery and cannot work right now so decided to have a go at creating the ulitmate software (IMHO) benefiting from my years of experience.

Thanks for the excellent software/support.
grahamskaraoke is offline   Reply With Quote
Old 28th April 2005, 05:43   #257
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
I don't think it is a conflict problem. At the very least you should be seeing it in the list, so I suspect it is a failure to load the .dll problem.

The multiple instance support is kind of difficult, its currently not supported in the cvs version, and the version posted in here that has the support has a variety of other problems. Im not sure whether I will support it, there are various technical reasons why not. will see.

You might be interested in taking a look at MediaMonkey for your purposes, it has some nice inbuilt scripting support and is in active development unlike Winamp. It also supports a lot of winamp plugins. Not sure about the multiple instance support though.
shaneh is offline   Reply With Quote
Old 28th April 2005, 17:41   #258
grahamskaraoke
Junior Member
 
Join Date: Apr 2005
Location: Ontario, Canada
Posts: 8
Thanks Shane I'll check it out.
grahamskaraoke is offline   Reply With Quote
Old 29th April 2005, 06:20   #259
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
Re: About the multiple instancing problem
When someone call the ActiveWinamp object when Winamp is not running, is it launching Winamp with the /class parameter then? Maybe it could do this to make sure it know which Winamp it is controlling. And you could call a method on the ActiveWinamp root object called SetWinampClass(string) that tells the object which Winamp to use. Just an idea.

And can you use the Window Station/Desktop API to obtain the handle of a running Winamp when the ActiveWinamp object is called from ASP script? Maybe it requires the "Allow interaction with logged on user" privilege or something similar. Or maybe the only way for a process that is started under a non-logged on user (i.e. SYSTEM, or IADM_USR, whatever) to communicate with a program running under the logged on user is by using named pipes.
saivert is offline   Reply With Quote
Old 29th April 2005, 11:19   #260
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
The problem is quite tough. I havent actually seen an app which handles it too well. Being a single document interface app, with the possiblity of being launched in either single instance or multiple instance mode makes it even trickier.

Coupled with the fact the COM server is handled in a .DLL which is part of an EXE which actually itself isn't a COM server doesn't help. Ive been thinking about making the COM server another .exe which actually launches winamp.exe (possible with a /class param), or just have the /class included as a param for the com server.

Knowing which instance of winamp AW is controlling isn't really much of an issue, as it can just control the in-process instance. The trouble is the way AW grabs this instance is by registering, then getting, the active object. Its the 'active object' problem that is causing issues, and seems to cause issues for many com servers.

Feel free to checkout the source and have a go at implementing it. You will want to look into monikers too probably. And make sure it works with 'createobject' and 'getobject', in both single instance and multiple instance mode. And when winamp isn't and is already running.

Anyway, its complicated...
shaneh is offline   Reply With Quote
Old 1st May 2005, 04:24   #261
grahamskaraoke
Junior Member
 
Join Date: Apr 2005
Location: Ontario, Canada
Posts: 8
Once again I need a little help shane. How can I get the length of the currently playing song from your plugin. This is so I can figure the percentage played and near the end (94%) load the next song.

I did try Media Monkey but I found it not as stable as Winamp. To get around my previous problem I am using Winamp 2.95 with gen_scripting.dll and Active_WA on winamp 5.08. This gives me the multiple instances I needed. Thanks for any help.
grahamskaraoke is offline   Reply With Quote
Old 1st May 2005, 06:08   #262
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
You can just use the .length property of a media item. ie, playlist(3).length

or

set mi = loaditem("C:\song.mp3")
mi.length

or wherever else you obtain a media item. Im not sure if works perfectly if the item isn't in your ML, but hopefully it will.

Be warned that the length is often wrong. This will be the case regardless of whether you are using this plugin or not. Even winamp displays the wrong time sometimes and the 'time remaining' display just works in over time as it tries to catch up. I have no idea why this error occurs, something to do with the .mp3 format and difficulty in getting an accurate time I suppose.

The other way is to poll winamp for the length and time elapsed etc, it tends to get more accurate the longer the item is played. You probaly wont find an elegant solution to what you are trying to do, no-one else has.

Use this with SendMsg. ie:

#define IPC_GETOUTPUTTIME 105
/* int res = SendMessage(hwnd_winamp,WM_WA_IPC,mode,IPC_GETOUTPUTTIME);
** returns the position in milliseconds of the current track (mode = 0),
** or the track length, in seconds (mode = 1). Returns -1 if not playing or error.
*/


length = SendMsg(1024, 1, 105)
shaneh is offline   Reply With Quote
Old 7th May 2005, 07:07   #263
maynardkrebs
Junior Member
 
Join Date: Nov 2004
Posts: 19
Maynard Script Collection 0505

Attached is a zip file containing some scripts I've created. Hope they are useful...
  • sendto_File Copy.vbs - Copies selections in Media Library to specified destination folder.
  • sendto_File Move.vbs - Moves selections in Media Library to specified destination folder.
  • sendto_File Delete.vbs - Batch deletes selections from Media Library without warning prompts for each file as does the standard WA delete operation.
  • sendto_MP3Gain.vbs - Launches MP3Gain with selections in Media Library.
  • sendto_Nero Cover Designer.vbs - Launches Nero Cover Designer with selections from Media Library and populates NCD layout with Artist/Album/Track info.
TBD
Change Copy/Move operations to use configurable ATF for folder destination (ex. <Artist>\<Album>\<File>)

Cheers
Maynard
Attached Files
File Type: zip maynard script collection.0505.zip (4.2 KB, 583 views)
maynardkrebs is offline   Reply With Quote
Old 7th May 2005, 09:42   #264
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Nice contribution maynardkrebs, you can also add scripts to the ActiveWinamp wiki to easily update/share/have others edit etc.
http://activewinamp.sourceforge.net/...=examples:root

I hope to have a new release of AW out sometime soon, as there are quite a few bugs already fixed in the CVS version. You should definetely use the version available in the CVS at the sourceforge site, as some bugs that have been fixed are a bit problematic.
shaneh is offline   Reply With Quote
Old 7th May 2005, 15:04   #265
maynardkrebs
Junior Member
 
Join Date: Nov 2004
Posts: 19
hey shane.

Glad you found a home for AW. Thanks for tip on latest versions at sourceforge.

maynard
maynardkrebs is offline   Reply With Quote
Old 9th May 2005, 01:46   #266
roytam1
Member
 
Join Date: Aug 2003
Posts: 81
Attached is a zip file containing a script I've created. Hope it is useful...

startup_randsong.vbs - Random play of current playlist, needs regsvr32 MersenneTwister.dll to use.

and MersenneTwister.dll is a fast random number generator in ActiveX DLL form.
Attached Files
File Type: rar startup_randsong.rar (8.1 KB, 512 views)
roytam1 is offline   Reply With Quote
Old 20th May 2005, 00:23   #267
neFAST
Member
 
Join Date: Sep 2004
Location: Montreal
Posts: 56
Send a message via ICQ to neFAST
Here's is a "iTunes party suffle"-like i wrote.
Use it in combination with a playlist containing
PHP Code:
#EXTM3U
#EXTINF:-1,X:\¯¯¯¯¯¯Party Shuffle______________________
X:\¯¯¯¯¯¯Party Shuffle______________________.
I plan to check the number of tracks in playlist to maintain its size to 25
PHP Code:
' +----------------------+
|     Party Shuffle    |
' +----------------------+
Automatically enqueues a new song each time a song is played.
' Brought to you by neF4ST

Dim mlq,mlq2,artist,tracks
Randomize

' "smart" 
random slightly faster with big libraries
mlq 
medialibrary.runqueryarray("type = 0 and trackno = 1")

Sub Application_ChangedTrack 

if playlist(1).filename="X:\¯¯¯¯¯¯Party Shuffle______________________.x" then

if playlist.position=1 then
    
' This is the first launch
    ' 
we add 20-1 songs
    
do while (tracks<=19)
       
Rand Int(ubound(mlq)*Rnd+1)
       
mlq2 medialibrary.runqueryarray("artist = """ mlq(Rand).artist """")
       
Rand2 Int(ubound(mlq2)*Rnd+1)
       
mlq2(Rand2).enqueue
       tracks
=tracks+1
    Loop
    
'now let's play
    play
end 
if

if 
playlist.position>5 then
    
' We add a new song
    Rand = Int(ubound(mlq)*Rnd+1)
    mlq2 = medialibrary.runqueryarray("artist = """ + mlq(Rand).artist + """")
    Rand2 = Int(ubound(mlq2)*Rnd+1)
    mlq2(Rand2).enqueue

    ' 
We remove the first song of the playlist
    playlist
.deleteindex(2)
end if

end if

End Sub 
neFAST is offline   Reply With Quote
Old 24th May 2005, 22:34   #268
grahamskaraoke
Junior Member
 
Join Date: Apr 2005
Location: Ontario, Canada
Posts: 8
Another dumb question

Shane I got another dumb question for you. The song that is currently playing in Winamp when there is a blank playlist. Is there a way to get artist tile for the currently playing song.

i.e. Someone uses the loadfile dialog from the winamp interface. Calls to the playlist.item.whatever show up as member item does not evalueate to object. Thanks
grahamskaraoke is offline   Reply With Quote
Old 25th May 2005, 08:58   #269
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
My big rant which will tick DrO off: Flaws in API

Using Load file dialog (or as I like to call it Open Song) will add the song to the playlist. Winamp always does this. It first clears the playlist, then adds the song to it and starts playing. If someone clears the playlist while the song plays, no info about song can be retrieved as the playlist is empty.

Winamp has major flaws in it's API and currently no one at Nullsoft is caring shit about it. I wished Peter Pawlowski did something to the API the short time he spent at Nullsoft, but nooo. Instead he got fed up and started on his own player (Foobar2000) which has an extensive C++ class based API more powerful than Winamp can ever dream of with it's simple window message/struct system.

I'm also wondering if I should quit Winamp development and focus on one of the more up to date players. Maybe give fb2k/MediaMonkey a try. Implement free form skinning for fb2k based on code from the Wasabi project (which was a good start but lacked a dedicated dev team).

Just my 2 cents...
saivert is offline   Reply With Quote
Old 2nd June 2005, 16:41   #270
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
hey shane, ive learned to make a few scripts from all of your examples, but have yet to understand how to do 2 things in one script.

I (and others asking in tech support) would really like it if you could provide a 'sort by album and then track' script.

many thanks
billyvnilly is offline   Reply With Quote
Old 6th June 2005, 12:33   #271
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Ive added this example to:
http://activewinamp.sourceforge.net/...bum_then_track
shaneh is offline   Reply With Quote
Old 6th June 2005, 19:37   #272
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
This is more an informal post:

I just love the wiki you set up. Now I never ever have to watch these forum pages with some posts messing up the layout with those very long code lines. People can now posts their examples on the wiki and have them fixed (if any errors are present).
saivert is offline   Reply With Quote
Old 20th June 2005, 11:17   #273
benedict101
Junior Member
 
Join Date: May 2005
Posts: 2
seek

Hello,

I've just discovered ActiveWinamp and it seems like the perfect solution to a problem I'm having.

I'm creating a HTA based media centre (aka HTPC) that uses freeware software to do all the playback. Obviously all of the software has to be controlable without it's interface showing so ActiveWinamp is a great solution.

The one thing that seems to be missing from ActiveWinamp is the ability to seek in a file. Is this feature possible? Is it currently impliment and I'm being very stupid?

Cheers
Benedict
benedict101 is offline   Reply With Quote
Old 20th June 2005, 11:27   #274
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Get the latest gen_activewa.dll from the CVS and use the application.position = x property.
shaneh is offline   Reply With Quote
Old 20th June 2005, 17:17   #275
kyllingfot
Junior Member
 
Join Date: Jun 2005
Posts: 1
I have a query about ActiveWinamp.

It seems it triggers the Application_ChangedStatus twice if you are already playing a file and then press play in Winamp (starts playing from the beginning). Is this the wanted behaviour (feature) or not (bug)? And both times the PlayState is reported as being '1'.
kyllingfot is offline   Reply With Quote
Old 20th June 2005, 23:05   #276
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Yes thats probably buggy, but then so is the song notification event system from Winamp (actually there isn't really one). Its also buggy in that it doesn't trigger when a http stream title changes. Its a difficult problem with many hacks involved to do well. For example Toaster goes to great lengths to just detect these track change events without these problems, most other plugins which do track change event stuff just poll the winamp window title every few ms and look for changes, which is a bloody terrible way of doing it.

Youre welcome to look at the code and submit changes, the necessary code is in PLWndProc of ScriptManager.cpp:
http://cvs.sourceforge.net/viewcvs.p...=1.7&view=auto
shaneh is offline   Reply With Quote
Old 19th July 2005, 20:13   #277
jsonnabend
Junior Member
 
Join Date: Nov 2004
Posts: 7
Insert Into Playlist

I'm a big fan of ActiveWinamp. Quick question: is there any way to insert an item into the playlist at position x? I'd like to find the currently playing index and insert an item immediately after it.

TIA

- Jeff
jsonnabend is offline   Reply With Quote
Old 20th July 2005, 14:37   #278
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
Yeah! I think it's a long time ago since ActiveWinamp only was a proof of concept. Now the code has grown and everyone is free to contribute if they want.

I'm going to get the latest revision from CVS, and have s serious look at the code.
saivert is offline   Reply With Quote
Old 21st July 2005, 12:43   #279
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
@jsonnabend:

You first create the item as a MediaItem, then call its insert method. See:
http://activewinamp.sourceforge.net/...enqueue_a_file

@saivert:
The code is a bit of a mess because its been hacked up over time, it really needs to be cleaned up. But it'd be great to have others looking into it. The current cvs version already fixes a number of bugs, and Id like to get a bunch of interface improvements done soon so I can get out another release rather than have people using the buggy version.
shaneh is offline   Reply With Quote
Old 21st July 2005, 16:53   #280
saivert
Banned
 
saivert's Avatar
 
Join Date: Jan 2001
Location: Norway
Posts: 927
I am working on a module called wa_getplselitems that should make it easier to get the selected items in the playlist. All you have to do is to include the wa_getplselitems.h file and link with wa_getplselitems.c. Then read comments in wa_getplselitems.h for example usage. I'm using the code from the AW project, but I'm using a real C array instead (using malloc, realloc and free).
saivert 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