Old 7th March 2011, 04:33   #681
Skurvy_Pirate
Junior Member
 
Join Date: Feb 2011
Posts: 13
Thanks! Working great now!
Skurvy_Pirate is offline   Reply With Quote
Old 24th May 2011, 16:06   #682
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 837
sendto_Set Playcount.vbs
Quote:
x = GetSendToItems

if ubound(x,1) > 0 then
for each track in x
s = inputbox(track.title+vbCrLf+vbCrLf+"Currently: "+cStr(track.playcount),"Set Playcount",cStr(track.playcount))
if s <> empty then track.playcount = cInt(s)
next
end if

quit
This will run from the ML via SendTo, but not from the PL for some reason.. and for some reason the ML SendTo seems to trigger things twice, regardless of what is actually in the script.. so double dialog boxes. Anyone got any ideas?

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 10th June 2011, 14:36   #683
martixy
Junior Member
 
Join Date: Jun 2011
Posts: 4
http://forums.winamp.com/showthread.php?t=331171
Help? There are cases where this would be very helpful. For ex. duplicate songs, one of better quality, one of lesser, where you'd want the better quality one; OR songs that are meant to play one after the other.
martixy is offline   Reply With Quote
Old 15th June 2011, 08:30   #684
SteelSureal
Junior Member
 
Join Date: May 2008
Location: Vancouver
Posts: 2
Quote:
Originally Posted by osmosis View Post
That usually happens when you haven't registered the AW plugin dll with Windows:
Elevated command prompt. Go to your plugin dir. "regsvr32 gen_activewa.dll" (without the quotes).
No seriously, what Osmosis said here.

I ran a shoutcast station for over 5 years with activewinamp interfacing with winamp to do a host of things. I haven't had it running since upgrading to windows 7 for a while now, and this was just one step of many, but you need to regsvr32 on the activewa dll in order to add it to your references in your c# project.
SteelSureal is offline   Reply With Quote
Old 30th June 2011, 04:16   #685
aurelbdx
Junior Member
 
Join Date: Jun 2011
Posts: 3
Hi everybody,

I have a favor to ask you. Can you make me a scipt like “enqueue_random_albums” (Author: MarquisEXB ) but a modified script that displays only one song per album (or few mixed songs per album but not the full album) and without separators.

I would like a script that displays random files from media library to playlist but with the possibility to choose the genre, the years and the playcount like in this script.


Quote:
on error resume next
Randomize

'dim i,j,Dict1,tracks,num,idxs

TheQuery=getMLQquery("type=0 &! (album ISEMPTY)")
msgbox TheQuery

mlq = medialibrary.runqueryarray(TheQuery)

Set Dict1 = CreateObject("Scripting.dictionary")
Dict1.CompareMode = BinaryCompare

i = 0
AllAlbums="" ' string that contains all album names

for each track in mlq
if instr(AllAlbums,ucase(track.album)) = 0 then
i = i + 1
AllAlbums=AllAlbums&vbcrlf& ucase(track.album)
Dict1(ucase(track.artist))=Dict1(ucase(track.artist)) & vbcrlf & _
CStr(i) & asc(178) & ucase(track.album)
end if
next

itms = Dict1.Items
numArt=ubound(itms)+1

num = CInt(InputBox("Albums: " & i & vbcrlf & _
"Artists: " & numArt & vbcrlf & _
"Choose the # of albums","#","3"))

if numart>=num then

do while (tracks<num)

safe = 0

do
safe=safe+1
Randomize
RandArtist = Int(numArt*Rnd) ' This is the artist
loop until (safe > 10000) or (instr(AllArtists,RandArtist & ";")=0)

AllArtists=AllArtists & RandArtist & ";"
'msgbox AllArtists & vbcrlf & "-" & itms(rand)

arrSong = Split(itms(RandArtist ), vbcrlf)
Randomize
TheAlbum = split(arrSong(int(ubound(arrSong)*RND +1)),asc(178) )(1)

InsertAlbum theAlbum

tracks=tracks+1
Loop
else
msgbox "Too many songs"
end if

quit

''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''' FUNCTIONS
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

function InsertAlbum(thealbum)

mlq2 = medialibrary.runqueryarray("album = """ + thealbum + """")
Set Dict2 = CreateObject("Scripting.dictionary")
Dict2.CompareMode = BinaryCompare

i = 0
min=1000000
max=0

' This section is to sort by track number.

for each song in mlq2
i=i+1
theTrack=song.track
Dict1(theTrack)=i
if theTrack<min then
min=theTrack
end if
if theTrack>Max then
max=theTrack
end if
next

for z= min to max
if len(dict1(z)) > 0 then
mlq2(dict1(z)).enqueue
end if
next 'z

set sep = LoadItem("X:-- " & thealbum & " (" & ubound(mlq2) & ") --------------------------")
sep.insert(playlist.count)

mlq2=""
end function

private function getMLQquery(strInitial)
' This asks the user some questions so that
' you can choose music as you see fit.

dim genres,years,ratings,extra

genres=cSTR(InputBox("Genre(s) BEGINS with... ?","GENRES","alt,new,punk,lo,hip-r,ska"))
Randomize
ranYear = int(rnd()*datediff("yyyy", #01-01-1977#, now())) + 1977
years=cSTR(INputBox("Year? [ex: > 2000) -- or > 1995 AND Year < 2000]","YEAR","year >= " & ranYear))
ratings = cSTR(InputBox("Ratings?","Rating","rating > 1 "))
Extra=cSTR(INputBox("Extra? [ex: & (lastplay < [3 weeks ago] OR playcount < 1)","EXTRA","(lastplay < [3 weeks ago] OR playcount < 1)"))

if len(extra) > 0 then
extra = " & (" & extra & ") "
end if

if len(ratings) > 0 then
ratings = " & (" & ratings & ") "
end if

if len(years) > 0 then
years = " & (" & years & ") "
end if

if len(genres) > 0 then

genre=split(genres,",")

if ubound(genre) >0 then
genreline="& ("
for each onegenre in genre
genreline=genreline & " genre begins """ & onegenre & """ OR "
next
genreline = genreline & " Genre begins "" QQQ "") "
else
genreline="& GENRE BEGINS """ + genre(0) +""""

end if
else
genreline=""
end if

GetMLQquery= strInitial &ratings & genreline & years &extra
end function

Thank you in advance and sorry for my English.

- Aurel -
aurelbdx is offline   Reply With Quote
Old 15th September 2011, 22:37   #686
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 837
Quote:
one song per album, without separators, choose the genre, the years and the playcount
Aurel: you can do all of that with Party Shuffle.

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 15th September 2011, 22:48   #687
aurelbdx
Junior Member
 
Join Date: Jun 2011
Posts: 3
thanks Osmosis but with Party Shuffle I can't to choose genre, years and playcount
aurelbdx is offline   Reply With Quote
Old 15th September 2011, 22:50   #688
osmosis
Major Dude
 
osmosis's Avatar
 
Join Date: Jan 2006
Location: Cananada
Posts: 837
Yes you can, check the RATE CONFIG CODE at the end of the script. Your files don't actually need to be rated, this is how the script works. It adjusts the likelihood the song will be played based on your criteria; this includes genre, year and playcount.

If you want a pulldown then you could always add that in too like in Marquis' excellent script.

Request: A little SmartView Query Language love.
osmosis is offline   Reply With Quote
Old 15th September 2011, 23:05   #689
aurelbdx
Junior Member
 
Join Date: Jun 2011
Posts: 3
I would like this function:

Quote:
private function getMLQquery(strInitial)
' This asks the user some questions so that
' you can choose music as you see fit.

dim genres,years,ratings,extra

genres=cSTR(InputBox("Genre(s) BEGINS with... ?","GENRES","alt,new,punk,lo,hip-r,ska"))
Randomize
ranYear = int(rnd()*datediff("yyyy", #01-01-1977#, now())) + 1977
years=cSTR(INputBox("Year? [ex: > 2000) -- or > 1995 AND Year < 2000]","YEAR","year >= " & ranYear))
ratings = cSTR(InputBox("Ratings?","Rating","rating > 1 "))
Extra=cSTR(INputBox("Extra? [ex: & (lastplay < [3 weeks ago] OR playcount < 1)","EXTRA","(lastplay < [3 weeks ago] OR playcount < 1)"))
aurelbdx is offline   Reply With Quote
Old 21st June 2015, 13:12   #690
SilverbackNet
Junior Member
 
Join Date: Jun 2015
Posts: 6
I might be the only one who still uses this, but....

As mentioned in the announcement thread, I forked the project today to get it working for what I needed:

https://bitbucket.org/silverbacknet/activewinamp

Source->Release to get the latest dll.

Changes:
Quote:
Accepts .js and .ps1 (PowerShell) files
Upgraded to full Unicode support
Unicode support also fixed the rating, playcount, lastplay, etc bugs.

To use PowerShell at all, you have to open an admin command prompt and run:
code:
%windir%\syswow64\windowspowershell\v1.0\powershell Set-ExecutionPolicy RemoteSigned

Otherwise PS scripts can't run outside of the PS sandbox. Scripts are named and located the same as before, only with a .ps1 ext.

I'm going to upload some sample scripts, but to use it in a PS script, start with:
code:
$aw = New-Object -ComObject ActiveWinamp.Application

at the top; from there, you can access $aw.playlist, $aw.medialibrary, etc, as you would in VBS. The plugin automatically executes the x86 PS, since Winamp will never be x64. You can call them from the command line, like:
code:
powershell -file "AnyScript.ps1"

If you do, I really recommend adding an x64 guard at the top, like so:
code:
if ($env:Processor_Architecture -ne "x86") {
write-warning 'Switching to x86 mode...'
&"$env:windir\syswow64\windowspowershell\v1.0\powershell.exe" -noninteractive -noprofile -file $myinvocation.Mycommand.path -executionpolicy bypass
exit
}



I'm going to be adding all of the library fields that aren't available yet next.
SilverbackNet 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