Old 12th July 2006, 06:22   #441
Nightbreed
Junior Member
 
Nightbreed's Avatar
 
Join Date: Jul 2006
Location: Philadelphia, PA
Posts: 6
Hi.. I've been able to get all the media info to display correctly, namely the artist, Title, etc... however the Lastplayed doesn't seem to return anything. Is this broken or am I probably calling it wrong?
Nightbreed is offline   Reply With Quote
Old 12th July 2006, 06:53   #442
MonteCarloPearl
Junior Member
 
Join Date: Jun 2006
Posts: 19
OK Here is the fruit of my labor. I want to thank ShaneH for an awesome plugin without which I could not have completed this project. Furthermore thanks to NeFast and Osmosis for putting together a great script and helping to adapt it to my particular situation even though my environment is nowhere near what theirs is. Also thanks to all that have contributed to this whole thread as I learned from a lot of people. I had just about no scripting experience prior to this and because of this thread and a couple other resources I think I did pretty good. I will include the script I am using in production as well as a more general use adaptation. For a complete idea of what my production script does refer to my first post on page 10 posted 6/22/06 at 4:04. Enjoy and thanks again.
MonteCarloPearl is offline   Reply With Quote
Old 12th July 2006, 06:54   #443
MonteCarloPearl
Junior Member
 
Join Date: Jun 2006
Posts: 19
Heres my production script again refer to my previous post to get an idea of what it does.

As far as the repeat issue I played 95% of my entire media list 700+ videos without a single repeat before the safety kicked in and ended the script.
Attached Files
File Type: txt playlist_party shuffle video no repeat v5.vbs.txt (4.8 KB, 694 views)
MonteCarloPearl is offline   Reply With Quote
Old 12th July 2006, 07:01   #444
MonteCarloPearl
Junior Member
 
Join Date: Jun 2006
Posts: 19
And for all the other beginners out there

And lastly, for all the other beginners out there I found this resource almost invaluable.

http://msdn.microsoft.com/library/de...7ecff00da4.asp

I will also include a very early version of my script. As you can see I made rampant use of "msgbox" to stop the script and get an idea of what it was doing. You real coders will just laugh but for someone like me (that pretty much doesnt have a clue) this really helped my troubleshooting. Thanks again to all.
Attached Files
File Type: txt playlist_party playcount and playlist dup test.vbs.txt (7.6 KB, 706 views)
MonteCarloPearl is offline   Reply With Quote
Old 13th July 2006, 15:39   #445
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
sorry i've been too busy to help you with your later questions. i'm glad you worked it out. i'll check out your scripts and that msdn vbscript page. personally i've been using w3schools: http://www.w3schools.com/vbscript/vb..._functions.asp and highly recommend it as well.

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 17th July 2006, 03:49   #446
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
ended up using Marquis' enqueue cache to fix the repeat problem. Breaks the current weighting attempt though, so another will have to be devised. Since this resolves my major issues with the script i've posted the 15 track version to the Examples wiki, and the 20 track version is here for those who would prefer a longer playlist and don't feel like changing it themselves:
Attached Files
File Type: txt playlist_party shuffle (20).vbs.txt (3.8 KB, 731 views)
osmosis is offline   Reply With Quote
Old 20th July 2006, 00:23   #447
MonteCarloPearl
Junior Member
 
Join Date: Jun 2006
Posts: 19
How can I enqueue a script? There is an example to insert a script but I can't get it to work. I need to enqueue a script named "onetoall.vbs" and "onetoone.vbs". These scripts are stored in the scripts folder along with the others. In my case I need these to get put in just before and just after the Movie clip is inserted in the modified party shuffle script I uploaded a few days ago. Also, on another front, there is mention in the help file of a volume property. Can this be used to control the volume level? i.e. turn up for certain clips and down for others? If so how would I do it? Thanks
MonteCarloPearl is offline   Reply With Quote
Old 20th July 2006, 03:13   #448
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
example from the wiki on inserting:

code:
Set mi = LoadItem("C:\song.mp3")
mi.Enqueue

'Or insert it at a given position

mi.insert 5

'Alternatively, you can obtain the MediaItem from the
'Media Library or the Playlist. ie.

Set mi2 = Playlist(4)
mi2.Enqueue



and in order to put a script as a playlist entry you use script:\.. so you should be able to set mi or whatever to LoadItem("script:\onetoall.vbs") etc and have it do that.

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 24th July 2006, 22:48   #449
MonteCarloPearl
Junior Member
 
Join Date: Jun 2006
Posts: 19
Still working out the external script

Thanks Osmosis that gets my scripts enqueued perfectly. I now have a question on how external apps get played or called from the playlist. I assume when winamp gets to them it should launch them and then go on to play the next item in the playlist. Is this correct? Is there anything that needs to get added in order for an external app to get launched?

My problem is that while my progams show up in the playlist they are not being executed. I know the programs work cause if I double click them (outside of winamp)they do exactly what they are supposed to do. In Winamp they show up on the playlist, winamp gets to them, then goes to the next item and never errors out.

Additional Info -

My AlltoOne and OnetoOne programs are simple 4byte commands sent out Com2 to a video router that causes it to change configurations. No reply is necessary. The zip file here contains my latest version of the party script, the eternal programs it calls and the source for the external programs. AlltoOne and OnetoOne require .Net 2.0 installed which I have done and they were created using VB Express edition.
Attached Files
File Type: zip patio scripts.zip (15.6 KB, 572 views)
MonteCarloPearl is offline   Reply With Quote
Old 24th July 2006, 22:54   #450
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
sorry, i guess there was a bit of a misunderstanding. i thought you were trying to enqueue other scripts.

script:\ is only used to call .vbs's (not .exe's) as that's all that activewinamp has support for from the playlist. make 2 .vbs's that run their respective .exe and you should be fine. I'd guide you through that but I don't know how to do that offhand. however, if you look at the wiki or any of your vbscript resources, i'm sure they can show you how to call external exe's from within a script.

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 24th July 2006, 23:02   #451
MonteCarloPearl
Junior Member
 
Join Date: Jun 2006
Posts: 19
That makes sense! I will review the examples and if I have more trouble I shall post. Thanks!
MonteCarloPearl is offline   Reply With Quote
Old 24th July 2006, 23:18   #452
MonteCarloPearl
Junior Member
 
Join Date: Jun 2006
Posts: 19
Got it thanks again for that one little piece I was missing! I created the AlltoOne.VBS and heres what It looks like:

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "D:\AlltoOne.exe"
quit

It gets called from playlist, lanches my app and just works awesome!
Things are looking great and now I am in final testing!
MonteCarloPearl is offline   Reply With Quote
Old 25th July 2006, 08:39   #453
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
Good to hear MonteCarlo, glad to help.

And man.. i was just looking back through this thread and it looks like there are A LOT of scripts that aren't on the wiki.. if any of them still work then someone should put them up for everyone.

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 7th August 2006, 17:05   #454
IllBugYou
Junior Member
 
Join Date: Jan 2006
Posts: 35
C# code to enqueue a file

Can someone help me with enqueuing a file using this as a COM object in C#.



PHP Code:
private static ActiveWinamp.Application winamp = new ActiveWinamp.Application();
          
String m;
          
"c:\mysong.mp3";
          
winamp.LoadItem(ref m); 
Everything's works up to that point, but I can't find the method enqueue and make it work.

I had this:
PHP Code:
ActiveWinamp.MediaItem myNewFile = new ActiveWinamp.MediaItem();
myNewFile.Enqueue(); 
but that just causes the application to crash.

Any help would be greatly appreciated. Thanks.
IllBugYou is offline   Reply With Quote
Old 8th August 2006, 02:25   #455
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
LoadItem returns a MediaItem. Thus you would do something like:

ActiveWinamp.MediaItem myNewFile = winamp.LoadItem("song.mp3");
myNewFile.Enqueue;

I will look into why trying to enqueue an empty media item crashes. Probably just trying to convert a NULL string to ansi or something.
shaneh is offline   Reply With Quote
Old 8th August 2006, 15:35   #456
IllBugYou
Junior Member
 
Join Date: Jan 2006
Posts: 35
Quote:
Originally posted by shaneh
LoadItem returns a MediaItem. Thus you would do something like:

ActiveWinamp.MediaItem myNewFile = winamp.LoadItem("song.mp3");
myNewFile.Enqueue;

I will look into why trying to enqueue an empty media item crashes. Probably just trying to convert a NULL string to ansi or something.
Small Correction for C# newbs like me: myNewFile.Enqueue();

Works like a charm!

Thanks Shane! This tool is incredible!
IllBugYou is offline   Reply With Quote
Old 14th August 2006, 09:30   #457
tka.lee
Junior Member
 
Join Date: May 2006
Posts: 7
increase/decrease playcount problem

I just updated to Winamp v5.24 (x86) (June 21) and it's done something weird to the increase/decrease playcount scripts. When I decrease playcount it goes straight to 4294967295. Then I increase it and it goes to 1, but no higher.

Help! I'm a newbie and know nothing about coding. I read about a page ago on this thread that shaneh was going to release a new activewinamp version. Any news on that?

Failing that, is there a workaround that will restore the script functions?

A related shaneh plugin worry (this time with playcount tracking replacement): Some files will crash the player when the playcount tracker kicks in. When I disable the tracker there's no problem, but then tracks don't count up. Has anyone noticed this, or has a fix?

Thanks!
tka.lee is offline   Reply With Quote
Old 14th August 2006, 09:31   #458
tka.lee
Junior Member
 
Join Date: May 2006
Posts: 7
Forgot to say, shane, I love your plugins, and had no problems until I upgraded the main program. (so sad..)
tka.lee is offline   Reply With Quote
Old 14th August 2006, 09:34   #459
shaneh
Major Dude
 
Join Date: Jan 2004
Location: Brisbane, Australia
Posts: 1,193
Are you using the latest gen_activewa.dll from the CVS? Make sure you are.
http://www.myplugins.info/activewinamp/doku.php/

The playlist tracking plugin is a bit broken if the song has no playcounts attached to it. You could write a sendto script to assign a playcount of 0 to everything with no playcount. I probably should update it, Im not sure if it even works anymore.
shaneh is offline   Reply With Quote
Old 14th August 2006, 15:12   #460
Lucky Luke
Junior Member
 
Join Date: Feb 2005
Posts: 5
Hi Shane,

I have a little problem trying to create a winamp object Jscript.

I'm creating a MSN Plus Live script.

Here's the code:
code:

var winamp;
var playlist;
var shell;

function OnEvent_Initialize(MessengerStart)
{
try
{
winamp = new ActiveXObject('ActiveWinamp.Application');
}
catch (e)
{
Debug.Trace("Could not create winamp Object");
MsgPlus.DisplayToast("MSN Winamp", "Could not create winamp object. Have you installed ActiveWinamp?\n\nClick here to install Active Winamp", "", "OnWinampErrorToastClick");
}

shell = new ActiveXObject('WScript.Shell');

var x;
for(x in winamp)
{
Debug.Trace(x);
}

// So far, so good. Ik get no errors
// But in my script debugger, I also get 0 properties
// (See for loop above)
}

function OnEvent_Uninitialize(MessengerExit)
{
}

function OnWinampErrorToastClick(param)
{
shell.Run("http://www.myplugins.info/activewinamp");
}

function OnGetScriptMenu()
{
return "<ScriptMenu><MenuEntry Id='MenuCurrentSong'>Send Current Song</MenuEntry></ScriptMenu>";
}

function OnEvent_MenuClicked(id, Location, wnd)
{
if(id == "MenuCurrentSong")
{
wnd.SendMessage(winamp.playlist[winamp.playlist.position].ATFSTring("[%artist% - ]$if2(%title%,$filepart(%filename%))"));
// At the line above, I get an error. winamp.playlist[...] is null or something
}
}




See the comments. I get no errors when creating the object. But is has no properties at all...

Does anybody know what the problem can be?
Lucky Luke is offline   Reply With Quote
Old 15th August 2006, 01:37   #461
tka.lee
Junior Member
 
Join Date: May 2006
Posts: 7
Quote:
Originally posted by shaneh
Are you using the latest gen_activewa.dll from the CVS? Make sure you are.
http://www.myplugins.info/activewinamp/doku.php/

The playlist tracking plugin is a bit broken if the song has no playcounts attached to it. You could write a sendto script to assign a playcount of 0 to everything with no playcount. I probably should update it, Im not sure if it even works anymore.
Thanks for the advice, Shane. I'll try that out tonight after work.
tka.lee is offline   Reply With Quote
Old 15th August 2006, 09:03   #462
tka.lee
Junior Member
 
Join Date: May 2006
Posts: 7
Shane, I tried out the latest gen_activewa.dll and it's worked a beaut so far.

Cheers, yr a star!

Tony
tka.lee is offline   Reply With Quote
Old 25th August 2006, 22:14   #463
Anreal
Junior Member
 
Join Date: Aug 2006
Location: Russia
Posts: 5
Quote:
Originally posted by osmosis
ended up using Marquis' enqueue cache to fix the repeat problem. Breaks the current weighting attempt though, so another will have to be devised. Since this resolves my major issues with the script i've posted the 15 track version to the Examples wiki, and the 20 track version is here for those who would prefer a longer playlist and don't feel like changing it themselves:
Hi, I have modified your script that it work with Smart View. Also I have added checking of presence of a finded song in the view of a recently played songs (with rating staf). but it's work very slowly and perhaps not so properly as I would like.
Attached Files
File Type: txt sendto_smartview_party shuffle (20)_weighted.txt (2.3 KB, 551 views)
Anreal is offline   Reply With Quote
Old 25th August 2006, 23:03   #464
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
oh awsome, smartview, very clever! even more iTunes-y (not in a bad way in this case)

checking it out now... having trouble getting it to actually work.. i guess i have to have a track selected to actually make the Send To work.. but then i get Line 51 Subscript out of range: 'RandArtist' .. i'll take a look at the code see what i can work out.

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 26th August 2006, 15:36   #465
Anreal
Junior Member
 
Join Date: Aug 2006
Location: Russia
Posts: 5
Yes, I see, for the moment it's work only if you select big numbre of songs (100 or more), I dont know why it's work like this.
Anreal is offline   Reply With Quote
Old 26th August 2006, 19:46   #466
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
i tried it by selecting my entire library since i thought that might be the case that it needed it all, didn't work, i get a Error Line 57 - Type Mismatch: 'mlqHistory' hmm, just got it again now with only 100 selected as well.

perhaps you could explain how you set up and use this script with the ML and PL and everything in a bit more detail?

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 27th August 2006, 11:52   #467
Anreal
Junior Member
 
Join Date: Aug 2006
Location: Russia
Posts: 5
Sorry, it is an old error, I have forgotten to update a text file before to upload it. You should change mlqHistory on mlqForHistory in that place or download this file one more time.

P.S.: I use this script for entire Smart View (~1000 songs). I choose that Smart View with right click, I choose my script, and that's all.

Last edited by Anreal; 27th August 2006 at 13:09.
Anreal is offline   Reply With Quote
Old 27th August 2006, 12:00   #468
Anreal
Junior Member
 
Join Date: Aug 2006
Location: Russia
Posts: 5
Ups, i dont have permission to update Attachment in my early post.
Attached Files
File Type: txt sendto_smartview_party shuffle (20)_weighted.txt (2.3 KB, 515 views)

Last edited by Anreal; 27th August 2006 at 13:17.
Anreal is offline   Reply With Quote
Old 27th August 2006, 17:06   #469
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
ah there it goes. cool idea, you're right about it queueing the files up quite slowly though, at least on first load. if i had to guess i'd say it must be the rating loop that causes it, especially since none of my tracks are rated. do you think that could be the case?

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 27th August 2006, 23:00   #470
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
very slight optimization of my last post of the party shuffle (20 track version) available as a forum attachment here: playlist_Party Shuffle (20).vbs.txt.

don't know why i didn't think to just make a subfunction for the trackloading before. :P

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 28th August 2006, 07:47   #471
azizabdulmalik
Junior Member
 
Join Date: Aug 2006
Location: South East Asia
Posts: 3
Send a message via Yahoo to azizabdulmalik
yeah, playlist_Party Shuffle (20).vbs.txt is a good script!
azizabdulmalik is offline   Reply With Quote
Old 28th August 2006, 21:57   #472
Anreal
Junior Member
 
Join Date: Aug 2006
Location: Russia
Posts: 5
Quote:
Originally posted by osmosis
ah there it goes. cool idea, you're right about it queueing the files up quite slowly though, at least on first load. if i had to guess i'd say it must be the rating loop that causes it, especially since none of my tracks are rated. do you think that could be the case?
Yes, it's a rating fault, I have worked on it litle bit and voila - new version, without a Randomization bug (in case of a small selection) and others.

P.S.: And I have find a new one - if you launch the script twice then track finded on event ChangedTrack is not from second selection of tracks but first. Only complete winamp restart may help.
Attached Files
File Type: txt sendto_smartview_party shuffle (20)_weighted_v2.txt (3.9 KB, 541 views)
Anreal is offline   Reply With Quote
Old 29th August 2006, 18:16   #473
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
you could just go into the ActiveWinamp plugin display and kill the one/both of the ones you don't want instead of restarting.

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 30th August 2006, 17:26   #474
gonemad
Member
 
Join Date: May 2006
Posts: 52
edit: nm looks like you changed it
gonemad is offline   Reply With Quote
Old 21st September 2006, 22:38   #475
Ike987
Junior Member
 
Join Date: Aug 2006
Posts: 4
Nice script osmosis, very useful. Can I assign this script to a hotkey somehow so I can run it from anywhere?
Ike987 is offline   Reply With Quote
Old 21st September 2006, 22:45   #476
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
shane made all scripts automatically have global hotkey function. goto global hotkeys and it should be there.
billyvnilly is offline   Reply With Quote
Old 21st September 2006, 22:53   #477
Ike987
Junior Member
 
Join Date: Aug 2006
Posts: 4
That was quick, thanks. Didn't expect it to be that easy!
Ike987 is offline   Reply With Quote
Old 28th September 2006, 17:21   #478
lual
Junior Member
 
Join Date: Jul 2004
Location: Austria
Posts: 15
hi folks,
as i've seen on
http://www.myplugins.info/activewinamp.htm
there should be this script...
"Automatic shutdown of Winamp or Computer at end of playlist"
but where is it? i can't find it.
i'd like to shutdown windows. preferable with a 10 seconds selfclosing messagebox to interrupt the script. (but that feature is not so importand.)
please help me.
regards lual
lual is offline   Reply With Quote
Old 28th September 2006, 22:18   #479
lual
Junior Member
 
Join Date: Jul 2004
Location: Austria
Posts: 15
i've got it by myself.

here is my own solution...
code:

'Script by lual 2006-09-28
'Call this script in winamp-playlist to shutdown winXP
'script:\Shutdown Windows.vbs

idy = SetTimeout(60000, GetRef("downsys"))

Answer=MsgBox("Last chance to cancel the countdown."+vbCR+vbLF+_
"OK to shutdow immediately.",_
vbOKCancel+vbDefaultButton1+vbCritical+vbMessageBoxSetForeground,_
"System will shutdown in 60 seconds!")

If Answer=vbCancel then
CancelTimer(idy)
MsgBox "Shutdown request cancelled.",vbInformation,"On the road again."
Quit
Else
CancelTimer(idy)
downsys
End if

Quit

Sub downsys()
Dim WSHShell
Set WSHShell = CreateObject("WScript.Shell")

'methods of shut down windows described e.g. here...
'http://www.aumha.org/win5/a/shutcut.php

'this didn't worked well for me...
'WSHShell.Run "TSSHUTDN.EXE /POWERDOWN", 1, false

'this is better, but needs the tool from...
'http://www.aumha.org/downloads/shutdown.zip
'(copy shutdown.exe in your script dir)
'(don't mix it this with the windows command "shutdown")
' -h: Hibernate.
'WSHShell.Run "C:\Programme\Winamp\Plugins\Scripts\shutdown.exe -h -f", 1, false
' -u: Shutdown (Turn Off).
WSHShell.Run "C:\Programme\Winamp\Plugins\Scripts\shutdown.exe -u -f", 1, false

Quit
End Sub


____
lual
lual is offline   Reply With Quote
Old 29th September 2006, 22:29   #480
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 841
any progress with the sendto script Anreal? i had a thought. if you weren't doing the sendto from the ML (ie. the PL editor's Send To menu) could you make it default to the whole library? that way you could still trigger it from the PL editor nicely.

@laul: there's also a rundll method of shortcutting to the shutting down of windows and your computer. would probably be better since it wouldn't require 3rd party exes, but if that doesn't work then you'd want to change your directories in the call to have the %PROGRAMFILES% environment variable. that way it would work on any system.

see http://vlaurie.com/computers2/Articles/environment.htm
and http://www.burzurq.com/forum/shutdown_icon.html (i'd go with %WINDIR% if scripting the rundll method)

Request: A little SmartView Query Language love.
osmosis 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