[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

WMP WIN32OLE in Ruby/IRB problem

Mike

10/7/2006 1:52:00 PM

The following code plays the playlist thourgh IRB in FXRI, but playback
doesn't start when using IRB from the command line.

oPlayer = WIN32OLE.new("WMPlayer.ocx.7")
oPlayer.Settings.autoStart = 1
oPlayListCollection = oPlayer.PlayListCollection.GetAll()
oPlayer.currentPlaylist = oPlayListCollection.item(0) #plays in FXRI,
nothing happens in IRB


also

oPlayer.Controls.play # doesn't work in IRB either.

I'm a newbie, so maybe I'm missing something obvious? any thoughts
appreciated.

1 Answer

Patrick Spence

10/10/2006 7:49:00 PM

0

Mike wrote:
> The following code plays the playlist thourgh IRB in FXRI, but playback
> doesn't start when using IRB from the command line.
>
> oPlayer = WIN32OLE.new("WMPlayer.ocx.7")
> oPlayer.Settings.autoStart = 1
> oPlayListCollection = oPlayer.PlayListCollection.GetAll()
> oPlayer.currentPlaylist = oPlayListCollection.item(0) #plays in FXRI,
> nothing happens in IRB
>
>
> also
>
> oPlayer.Controls.play # doesn't work in IRB either.
>
> I'm a newbie, so maybe I'm missing something obvious? any thoughts
> appreciated.

I'm seeing the same problem here. I thought it was something funky that
IRB is doing, or *not* doing. Then I cobbled-up a script and ran it...
still doesn't play. The only way I could get anything to play was by
using the .openPlayer() method.

oPlayer.openPlayer(<my .mp3 file>)

I added the following line after the one that assigns the
currentPlayList property...

puts("Playing track \"#{oPlayer.currentMedia.name}\" from the
\"#{oPlayer.currentPlayList.name}\" playlist")

which spits out something like:
Playing track "Mix 04-05" from the "All Music" playlist


--
Posted via http://www.ruby-....