Tech Off Thread

4 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

how to convert Windows Media Player nonstandard url format "wmpcd://0/8" to standard "

Back to Forum: Tech Off
  • User profile image
    anilp

    The title says it all.
    WMP returns its own format when I call getUrl() on IWMPPlayer4.
    So how to convert Windows Media Player nonstandard url format "wmpcd://0/8" to W3C standard "file:/D:/Track08.cda"?
    thanks,
    Anil

  • User profile image
    DCMonkey

    The wmpcd url protcol syntax is wmpcd://drive/track where drive is the zero based index of the drive and track is the track number.

    You could enumerate your drives (for Win32 look at GetDriveType() and for .Net 2.0 look at DriveInfo.GetDrives()) and save the drive letters of the CD drives to an array.

    Then use a regex or just crawl the string to extract the drive index and track index, lookup the corresponding drive letter in your array and build your file:// url.

  • User profile image
    anilp

    DCMonkey wrote:
    

    The wmpcd url protcol syntax is wmpcd://drive/track where drive is the zero based index of the drive and track is the track number.

    You could enumerate your drives (for Win32 look at GetDriveType() and for .Net 2.0 look at DriveInfo.GetDrives()) and save the drive letters of the CD drives to an array.

    Then use a regex or just crawl the string to extract the drive index and track index, lookup the corresponding drive letter in your array and build your file:// url.



    what would it do for regular audio files that are not CD tracks - do I need to also hack this?
    My point is, If windows doesnt use standard url format, then it should provide some kind of routine or code to do so.

  • User profile image
    DCMonkey

    anilp wrote:
    
    DCMonkey wrote: 

    The wmpcd url protcol syntax is wmpcd://drive/track where drive is the zero based index of the drive and track is the track number.

    You could enumerate your drives (for Win32 look at GetDriveType() and for .Net 2.0 look at DriveInfo.GetDrives()) and save the drive letters of the CD drives to an array.

    Then use a regex or just crawl the string to extract the drive index and track index, lookup the corresponding drive letter in your array and build your file:// url.



    what would it do for regular audio files that are not CD tracks - do I need to also hack this?
    My point is, If windows doesnt use standard url format, then it should provide some kind of routine or code to do so.


    I imagine regular audio files would return whatever protocol they were accessed with (file:, http: etc). Try it and see.

    .cda files aren't really files anyways, so returning a file: url is more a convention that a "standard".

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.