urgent help: find out the drive letter of the flashdisk

This forum is for questions / discussions regarding development of addons / tweaks for MediaMonkey.

Moderator: Gurus

tutenchamun

urgent help: find out the drive letter of the flashdisk

Post by tutenchamun » Sat Dec 26, 2009 4:37 am

hi everybody,
I am about to write a script, that automacically generates artis playlists for all mp3's on a synched flashdrive.

There is one missing bit to it, how am I ablte to get the actual driveletter of the removable drive.
I currently only find the mediID string (looks very windows device'ish).
I've spent hours now to work through the api .but had no success so far.

any suggestions ?

please help

Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: urgent help: find out the drive letter of the flashdisk

Post by Bex » Sat Dec 26, 2009 5:07 am

http://www.mediamonkey.com/wiki/index.p ... riveLetter
It returns a long so you need to to add 65 to it and use Chr() to get the actual letter:
DriveLetterStr=Chr(Media.DriveLetter+65)

But what do you start with, MediaID , serialnumber or something else?
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts

tutenchamun

Re: urgent help: find out the drive letter of the flashdisk

Post by tutenchamun » Sat Dec 26, 2009 7:45 am

hm ... need to to think about it ...

I started of, selecting the device in the treenode manually - then start the script and figure it all out through the actual selected node ... and do a view sql statements - it is all there in the db apart from the drive letter ... thats then where i hung ...

I had it all working already, as earlier versions had the drive-letter within brackets under the node-caption - thats gone now ... so ...

I#ll get back to here as soon as found a way.

thanks so far

Guest

Re: urgent help: find out the drive letter of the flashdisk

Post by Guest » Sat Dec 26, 2009 12:31 pm

im not at all getting there ... the media object is of no use, if I cannot find out how to instaciate it with the currently selected device and then access it.

I#m thinking to go through MyComputer and search for the device caption and then extract the driveletter.

I do not want to believe that this all would not work easier ... I just cant find the right api calls.

Eyal
Posts: 3110
Joined: Sun Jun 26, 2005 9:27 am
Location: Québec

Re: urgent help: find out the drive letter of the flashdisk

Post by Eyal » Sat Dec 26, 2009 2:22 pm

SDBDevice or SDBDeviceList ?
Skins for MediaMonkey: Cafe, Carbon, Helium, Spotify, Zekton. [ Wiki Zone ].

Guest

Re: urgent help: find out the drive letter of the flashdisk

Post by Guest » Sat Dec 26, 2009 2:59 pm

... i now did exactly that, browse through the mycomputer child nodes searching for the caption of the selected removeable media ... extract the DriveLetter from this nodes caption and use it ... fine ... works

still, I have the feeling, there is an api call doing this ... I just couldnt figure it out ...

Guest

Re: urgent help: find out the drive letter of the flashdisk

Post by Guest » Sat Dec 26, 2009 3:01 pm

--- I tried the SDBDevie and List, but this does not contain the DriveLetters.
Iterating through the Devices, I found the ID's, but no letters, even the DriveLetterIndex of all disks is "-1" - apart from one USB controller - "8"

Bex
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Re: urgent help: find out the drive letter of the flashdisk

Post by Bex » Sat Dec 26, 2009 4:34 pm

So try, Chr(8+65), I think that should give you the driveletter.
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts

Post Reply