List Boxes and Recursive Searches

Multimedia Builder

List Boxes and Recursive Searches

Postby Sk8cynic » Wed Jul 03, 2019 10:52 am

A little help, please...

I am trying to find a way to populate a list box with the contents of a folder that resides in a sub-folder inside the <SrcDir> folder, such as <SrcDir>\Music1, etc. With the code shown below, I am able to populate the list box, but a recursive search is done and lists the content of ALL of the subfolders below the <SrcDir> instead of just the folder I want. Is this possible to do? Here is the code I currently have that doesn't work:

SearchForFiles("<SrcDir>","Music1","*.mp3")
ListBoxAddItem("SongList","RESET")
ListBoxAddItem("SongList","<List>")
ListBoxSortItems("SongList","NAME")
SongListReset()
ListBoxGetItems("SongList","<List>")

According to the Help file, a recursive search is always done on the <SrcDir> which then causes a complete listing. I also looked at some of the MMB examples, but didn't find a solution.

BTW, anybody heard from Delboy?
Sk8cynic
 
Posts: 28
Joined: Thu Oct 04, 2012 12:51 pm

Re: List Boxes and Recursive Searches

Postby weakzone » Wed Jul 03, 2019 3:53 pm

Dear Sk8cynic,
Please check attached file.

Thanks
Attachments
SongList.zip
(18.7 KiB) Downloaded 28 times
weakzone
 
Posts: 10
Joined: Tue May 14, 2019 4:48 pm

Re: List Boxes and Recursive Searches

Postby Sk8cynic » Thu Jul 04, 2019 10:53 am

Hi Weakzone,

Thank you very much for your help! Now I just have to figure out how to do multi-select on files and load those into the list box.
Sk8cynic
 
Posts: 28
Joined: Thu Oct 04, 2012 12:51 pm

Re: List Boxes and Recursive Searches

Postby polartech » Mon Jul 08, 2019 1:45 am

Sk8cynic wrote:
BTW, anybody heard from Delboy?


Good question.. just looked at his profile and last visited is showing as

Tue Oct 09, 2018 2:57 pm

Hope he is ok! :)
polartech
 
Posts: 71
Joined: Sun Oct 31, 2010 3:29 am
Location: York, UK

Re: List Boxes and Recursive Searches

Postby weakzone » Tue Jul 09, 2019 11:39 am

Dear Sk8cynic,
Please check attached file. Here I used a plugin name plugy for Open Multiple File.

Thanks
Attachments
SongList_MultiSelect.zip
(113.39 KiB) Downloaded 24 times
weakzone
 
Posts: 10
Joined: Tue May 14, 2019 4:48 pm

Re: List Boxes and Recursive Searches

Postby Sk8cynic » Wed Jul 10, 2019 10:57 pm

Weakzone,

Once again...thank you so much for your help!
Sk8cynic
 
Posts: 28
Joined: Thu Oct 04, 2012 12:51 pm

Re: List Boxes and Recursive Searches

Postby Sk8cynic » Wed Jul 17, 2019 3:00 pm

Weakzone / Others,

Thank you for the help on multi-selection of music files. Here is the code that performs this task with the plugy.dll plugin:

status = 0
ListBoxAddItem("SongList","RESET")
SongListReset()
***
filter$='Audio files|*.mp3|Any files|*.*||'
PluginSet("plugy","filter$")
PluginRun("plugy","d_filter")
title$='Multi Select Files'
PluginSet("plugy","title$")
PluginRun("plugy","d_multi_title")
PluginRun("plugy","d_multi_open")
PluginGet("plugy","status")
If (status) Then
For i=1 To status
**file
PluginSet("plugy","i")
PluginRun("plugy","d_file")
PluginGet("plugy","files$")
****
ListBoxAddItem("SongList","STRING:files$")
ListBoxAddItem("SongList","<List>")
Next i
***
ListBoxSortItems("SongList","NAME")
**SongListReset()
ListBoxGetItems("SongList","<List>")
End

Is there a way to modify the above code so that when files are selected, only the music file name such as mysong.mp3 is listed and not the full path of the file(s)?

Thanks!
Sk8cynic
 
Posts: 28
Joined: Thu Oct 04, 2012 12:51 pm

Re: List Boxes and Recursive Searches

Postby weakzone » Wed Jul 17, 2019 6:09 pm

Dear Sk8cynic,
Please check attached file. Here I used a temporary file for save and load list. You can delete after Song List Reset.

Thanks
Attachments
SongList_MultiSelect_update.zip
(113.55 KiB) Downloaded 20 times
weakzone
 
Posts: 10
Joined: Tue May 14, 2019 4:48 pm

Re: List Boxes and Recursive Searches

Postby Sk8cynic » Wed Jul 17, 2019 9:24 pm

Hi Weakzone,

Once again....thank you for your help.

I tried the revised code. Initially, it works and does not display the complete path. However, If I try to add files to the list a second time (append) without clearing it first, the entry is multiplied and duplicated even if different files are selected. A third attempt to load files results in the entire folder being loaded even if one or two files are selected.

Strange.... ;)
Sk8cynic
 
Posts: 28
Joined: Thu Oct 04, 2012 12:51 pm


Return to MMB

Who is online

Users browsing this forum: No registered users and 1 guest