mIRC Home    About    Download    Register    News    Help

Print Thread
Slight Dir mp3 play issue #199618 17/05/08 04:47 PM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
This is the method im using from my Dj Studio script i made I recently started to sort my actual folders instead of everything being togheter so now when I do happen to click on lets say Mp3 which has lick Rock,Trance etc... has folders inside it doesnt let me execute the mp3's

this is my method of use

Code:
%dj.path = $$sdir(C:\,Select Mp3 dir) | noop $findfile($qt(%dj.path),*.mp3,0,did -a $dname 1 $nopath($1-))


then

Code:
.splay -p $+(%dj.path,$did(1).seltext)


I store the path then use $findfile to loop through the mp3 dir, which works on single dir access but not to a few dirs.

I want no path in the list, i know if I would allow a path anything could be executed.

To anyone that helps thanks ahead.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Re: Slight Dir mp3 play issue [Re: Lpfix5] #199620 17/05/08 05:18 PM
Joined: Jul 2006
Posts: 3,923
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,923
This is because you using only the first path (%dj.path) and miss the real path when you put it in the list ($nopath)

You have to change your method, one possibility could be to use a hidden list in the dialog and add the real filename :

Code:
%dj.path = $$sdir(C:\,Select Mp3 dir) | noop $findfile($qt(%dj.path),*.mp3,0,did -a $dname 1 $nopath($1-) [ $chr(124) ] did -a $dname ID_Hidden_list $nofile($1-))


And then use :
Code:
.splay -p $+($did(ID_Hidden_list,$did(1).seltext),$did(1).seltext)




#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Re: Slight Dir mp3 play issue [Re: Lpfix5] #199621 17/05/08 05:21 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
The only thing that I'm able to think of, atm, is that the full path to the mp3 that you're trying to play doesn't match the path in your %dj.path variable. This would be the case if you had something like:
%dj.path = C:\Music\Rock
Full path & file "C:\Music\Rock\Billy Joel\Glass Houses\Track 2.mp3"
Your file name that's added to the dialog will show as Track 2.mp3
So when you try to play it, mIRC tries to play C:\Music\Rock\Track 2.mp3

mIRC is still missing part of the path information.
I can think of two ways around this.
1) Use
Code:
%dj.path = $$sdir(C:\,Select Mp3 dir) | noop $findfile($qt(%dj.path),*.mp3,0,0,did -a $dname 1 $nopath($1-))

Not my recommendation, as this will only perform the $findfile for that specific directory, and not any sub-directories that may be present. Meaning that you'd have to re-run the code for each sub-directory, and only having the information for 1 directory level at a time.

2) Add another list box to your dialog, the same size and location as your list ID 1, but have it hidden, and store the full path and title in the 2nd list, then when selecting an item in ID 1, auto-select that same line in the 2nd list, and use that for your /splay command
This is the one I recommend, as it will allow you to use multiple sub-directories off of your main mp3 directory, without having to run the code for the specific directory each time.

Re: Slight Dir mp3 play issue [Re: Wims] #199622 17/05/08 05:23 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Great minds think alike

Re: Slight Dir mp3 play issue [Re: RusselB] #199624 17/05/08 05:32 PM
Joined: Jul 2006
Posts: 3,923
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,923
Thanks smile.
starbucks_mafia, i've seen your post, but i think use an hash table here isn't needed


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Re: Slight Dir mp3 play issue [Re: Wims] #199628 17/05/08 07:50 PM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Quote:
starbucks_mafia, i've seen your post, but i think use an hash table here isn't needed
I don't see a post by starbucks_mafia or anyone in regards to using a hash table for this topic...although, I do agree it's not needed...actually, I think it would be a waste for this.

Re: Slight Dir mp3 play issue [Re: RusselB] #199642 18/05/08 04:01 AM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
I just got back, ill try what you said wims, and RUsselB the second theory is better just like wims posted


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Re: Slight Dir mp3 play issue [Re: Lpfix5] #199644 18/05/08 05:15 AM
Joined: Aug 2004
Posts: 7,252
R
RusselB Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Aug 2004
Posts: 7,252
Yes, I thought you would agree with that. I just wanted to try to make sure that you had all of the possibilities accounted for. If you're going to go with the code that wims posted, please note that there is a small error in
Code:
.splay -p $+($did(ID_Hidden_list,$did(1).seltext),$did(1).seltext)

It should be
Code:
.splay -p $+($did(ID_Hidden_list,$did(1).sel),$did(1).seltext)
otherwise you're going to get an incorrect response, since $did is going to be looking for a number in that location, not a string, so the string returned will be evaluated as 0

Re: Slight Dir mp3 play issue [Re: RusselB] #199652 18/05/08 03:03 PM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
spotted it in a few seconds, when I had original did the string, as for dialog stuff I play in it all the time I know all the functions etc..

I remember back in the day when i didnt even know how to start making the "GUI" part of a dialog lol.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }