ryantollefson Posted September 8, 2007 Share Posted September 8, 2007 (edited) I'm trying to get the current status of Media Player. I want to be able to have a playlist going in Media Player, and then whenever I run the script it will give me the currently playing song. Basically I want it to be just like the iTunes current status script (http://www.autoitscript.com/forum/index.php?showtopic=21334&hl=album%20art&st=0), but for Media Player.I've seen the post on getting MP3 & WMA info from a song (http://www.autoitscript.com/forum/index.php?showtopic=39256&st=0&p=400171&#entry400171), but that method only seems to work if you open the song with your script, not if the song is already going. I've also been looking at: http://www.autoitscript.com/forum/index.php?showtopic=52415. And the MSDN site for the Media Player object: http://msdn2.microsoft.com/en-us/library/bb249349.aspx.I think I have all the elements I need, I just can't seem to put it all together... Any help is greatly appreciated. Thanks. Edited September 8, 2007 by ryantollefson Link to comment Share on other sites More sharing options...
kjactive Posted September 9, 2007 Share Posted September 9, 2007 (edited) HalloThe command you want looks like this.currentMedia.sourceURLand you can get the playlist name like this.currentPlaylist.nameGUICreate ("Embedded Medieplayer control Test", 620, 425, -1, -1,BitOr($WS_OVERLAPPEDWINDOW,$WS_VISIBLE,$WS_CLIPSIBLINGS)) $TagsPageC = GuiCtrlCreateLabel('Visit Tags Page', 5, 405, 100, 15, $SS_CENTER) Global $GUIActiveX = GUICtrlCreateObj( $oRP, 10, 10 , 600 , 385 ) Global $oRPEvt = ObjEvent($oRP,"MediaPlayer_") With $oRP; .URL = 'C:\temp\test.wpl' Consolewrite(.currentMedia.sourceURL & @CRLF) EndWith Sleep(5000) $oRP = 0 ExitYou can use this example to put code into lifehttp://www.autoitscript.com/forum/index.ph...mp;#entry397363kjactive Edited September 9, 2007 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
ryantollefson Posted September 9, 2007 Author Share Posted September 9, 2007 Thanks so far... I think I understand the code you posted, and this should be the object right? Global $oRP = ObjCreate("WMPlayer.OCX") But this still won't get the info for a song that is already playing in Media Player (before running the script). This sets the .url in the script & starts that song, and then retrieves the .url from the current song; but I can't figure out how to get this to work if you don't define the .url in your script prior to calling .currentMedia.sourceURL Link to comment Share on other sites More sharing options...
kjactive Posted September 10, 2007 Share Posted September 10, 2007 (edited) I haven't worked specified with playlists but durring years with WMPlayer.OCX component from wmp.dll a lot but to get the current playing title this is the command... .getItemInfoByType("Title", "",0) Syntax: .currentMedia.getItemInfoByType(name, language, index) // ("author", "", 0) ec. if you don't define the .url in your script prior to callingI don't get this - you can't get information on a playlist that isn't loaded yet but maybe I don't get your questen right and it's the mediecollect object your looking for: http://msdn2.microsoft.com/en-US/library/bb262724.aspx .mediaCollection.add('C:\temp\test.wpl') The medieplayer component nature is that it's a large collection of objects all activated as one - some components has to be initiated one by one but not this one - there is a lot of options and ways to use this large components. To major general different ways to code objects is: to let events tricker your code or to make component pools that again can be done different - one has to code very personal as there are that many options, personal I offen use pools ( collection of commands ) as these can be a bit more easy to control I think anyway... Available WMPlayer.OCX Component objects: Cdrom Object CdromCollection Object ClosedCaption Object Controls Object DVD Object Error Object ErrorItem Object Media Object MediaCollection Object MetadataPicture Object MetadataText Object Network Object Player Object PlayerApplication Object Playlist Object PlaylistArray Object PlaylistCollection Object Query Object Settings Object StringCollection Object More information on the objects: http://msdn2.microsoft.com/en-us/library/bb249259.aspx Hope this helps you to fiddle your playlists.... kjactive Edited September 10, 2007 by kjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
ryantollefson Posted September 10, 2007 Author Share Posted September 10, 2007 Thanks for the help so far .I haven't finished looking through everything you posted about yet, but I wanted to reply so it was clear what I'm trying to accomplish.What I want:Don't start script yetOpen Windows Media PlayerStart playing a song or playlistNow run my AutoIt scriptHave the script detect what song is currently playing in Windows Media PlayerIn other words, I want to be able to manually start a song playing (script won't open the song), then when I choose to run the script it will just detect the already playing song from Windows Media Player. Link to comment Share on other sites More sharing options...
kjactive Posted September 10, 2007 Share Posted September 10, 2007 Do I get you right, you want to hackin/lockon the medieplayer from a external autoit3 script and change settings - I've never tryed that one...best of luckkjactive Au3PP 4.1 - Autoit3 preprocessor, optimize speed, performance to scripts and do executes....[/url]Au3Calibur - Create libraries of commonly used code excerptsWords manipulate UDF, functions that is lent from the rexx language, topics and index file includedCustomDialog UDF to include custom made dialogs like a extended colorpick requester to scripts...[url="ftp://fritidshjemmet.com/Autoit3/SysColor.zip"]SysColor UDF a low level color library to manipulate RGB and Hex values...Shell32 UDF to Automate Windows® operating tasks from native dialog and Wizards browsers... Optimized the CodeWicard with options to generate browser code etc... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now