mIRC Homepage

Com to get WMP now playing?

Posted By: pball

Com to get WMP now playing? - 07/11/11 11:02 PM

I'm trying to make a WMP now playing script for a friend and the only plugin which exports now playing info I've found is lousy shareware. So I figured this would be a good time to learn how to use coms.

My friend found a C# project which uses COMs to get all the tracks in the WMP library so it shouldn't be hard to get the now playing (if you know wtf your doing). http://www.codeproject.com/KB/audio-video/WindowsMediaListToXml.aspx

So I'm really asking if it's possible could someone make a COM based script to do this and explain the process. Not only will I love someone long time but I learn best from solid examples so hopefully I'd learn a lot.
Posted By: FroggieDaFrog

Re: Com to get WMP now playing? - 08/11/11 12:49 AM

This can't be done. I've looked into it quite a bit.
Posted By: pball

Re: Com to get WMP now playing? - 08/11/11 12:59 AM

aww, guess i just need to see if there is another plugin that makes an xml file or something with now playing info, that is free
Posted By: FroggieDaFrog

Re: Com to get WMP now playing? - 08/11/11 01:05 AM

I have a WMP plugin that will write the now playing to a .txt file, but it can't output the "path\file" of now playing
Posted By: pball

Re: Com to get WMP now playing? - 08/11/11 01:52 AM

I found a plugin to do that. The only problem now is that mirc doesn't like null tokens. So I need a simple a way process a string with null tokens or something frown

Author|Title|Duration|FileSize|FileType

author and title aren't guaranteed to exist

Update:
yay I found another alias to get tokens including null tokens, the one i had just started failing no clue why
Posted By: FroggieDaFrog

Re: Com to get WMP now playing? - 08/11/11 02:46 AM

Code:
if ($regex(<tokens>,/([^\|]*)(?:$|\|)/g)) {
  ;$regml(1) = author
  ;$regml(2) = title
  ;$regml(3) = diratopm
  ;$regml(4) = filesize
  ;$regml(5) = FileType
}
Posted By: Tomao

Re: Com to get WMP now playing? - 08/11/11 04:14 AM

Here is the non-regex version in reply to froggie's:
Code:
tokenize 124 Author|Title|Duration|FileSize|FileType
;$1 = author
;$2 = title
;$3 = diratopm
;$4 = filesize
;$5 = filetype
Posted By: FroggieDaFrog

Re: Com to get WMP now playing? - 08/11/11 05:20 AM

what about empty tokens? Author||duration|FileSize|FileType ...that was his issue after all
Posted By: Tomao

Re: Com to get WMP now playing? - 08/11/11 07:37 AM

Whoops, my bad. I misunderstood the question.
© 2021 mIRC Discussion Forums