Skip to content

Commit

Permalink
RECURSIVE music folder add
Browse files Browse the repository at this point in the history
  • Loading branch information
elpoeprod committed Oct 17, 2024
1 parent 52d48ea commit b4c5443
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 25 deletions.
42 changes: 21 additions & 21 deletions elpAudio/objects/ButtonAddFile.gml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,12 @@ applies_to=self
image_speed=0
sprite_index=global.__ico_admus
draw=0

add=0
click=0

file=''
showagain=1
image_blend=__butaddmuscol
prevdir=working_directory

globalvar __pl_window;__pl_window=-1
#define Alarm_0
/*"/*'/**//* YYD ACTION
lib_id=1
action_id=603
applies_to=self
*/
if click>1 {
file=get_open_filename('All supported files|'+__fformats,'')
if file='' nothing=1 else ds_list_add(global.list,file)}
click=0
#define Step_0
/*"/*'/**//* YYD ACTION
lib_id=1
Expand Down Expand Up @@ -83,8 +70,16 @@ applies_to=self
*/
if !window_get_active() exit
image_index=0
click=2
alarm[0]=1

file=get_open_filename('All supported files|'+__fformats,'')

if file!='' {
if FileIsSupported(file) then {
ds_list_add(global.list,file)
prevdir=filename_dir(file)
} else
show_message("Unsupported file: "+file)
}
#define Mouse_8
/*"/*'/**//* YYD ACTION
lib_id=1
Expand Down Expand Up @@ -117,9 +112,7 @@ if select=0 then {

file=get_open_filename('All supported files|'+__fformats,'')

if file='' then
nothing=1
else {
if file!='' {
if FileIsSupported(file) then {
ds_list_add(global.list,file)
prevdir=filename_dir(file)
Expand All @@ -133,8 +126,15 @@ if select=1 then {
folder=get_directory_alt('Add folder to your playlist','')
if folder='' then
nothing=1
else
GetMusicFromFolder(folder+'\')
else {
if !__recursive GetMusicFromFolder(folder+'\')
else {
listt=file_find_list(folder,'*.*',fa_hidden,1,1)
i=0
repeat ds_list_size(listt) {val=ds_list_find_value(listt,i) if FileIsSupported(val) ds_list_add(global.list,val) i+=1}
ds_list_destroy(listt)
}
}
} //select=1
Expand Down
11 changes: 7 additions & 4 deletions elpAudio/scripts/SettingsLoad.gml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ global.thesong=''
global.volume=100
global.randomized=0
global._loaded_list=0
global.list_type=0 // 0 - regular, 1 and on will be used later
global.list_type=0
global.preloaded=0
global.curpreloaded=-1
global.preloadedsong=-1
Expand Down Expand Up @@ -67,7 +67,8 @@ __customcaption_idle,__customcaption_play,__customcaption_ch1,__customcaption_ch
__enable_fswitch,__elp_enable_old_themes,
__preload_type,__open_migrated_list,
__DisVisWhenNotAct,__PreloadNextSong,
__FrameSkip,__millisecs
__FrameSkip,__millisecs,
__recursive
;

__elp_enable_old_themes=0; // enable old themes (BAD!!!!!!!!!!!!!!)
Expand All @@ -86,6 +87,7 @@ __DisVisWhenNotAct=0; // disable visualiser when window is not active nor
__PreloadNextSong=1; // preload next song when current song is about to end
__FrameSkip=0; // skip frames enabler
__millisecs=1; // frames for skip (if __FrameSkip==1)
__recursive=0; // recursive file adder in Add File button

__customcaption_idle='elpAudio '+Get_elpAudioVersion();
__customcaption_play='';
Expand All @@ -102,8 +104,8 @@ global.current= ini_read_real('','lastSong',0)
__visualiser= ini_read_real('','lastVisualiser',0)
__visual_freq= ini_read_real('','visualiserBars',64)
__customcaption_idle= ini_read_string('Caption','customCaptionIdle','elpAudio %v')
__customcaption_play= ini_read_string('Caption','customCaptionPlay','(%t1:%ta1) elpAudio %v [%pn/%ps]')
__customcaption_ch1= ini_read_string('Caption','customCaptionChange1','(%t1 / %ta1) elpAudio %v [%pn/%ps]')
__customcaption_play= ini_read_string('Caption','customCaptionPlay','(%t1/%ta1) elpAudio %v [%pn/%ps]')
__customcaption_ch1= ini_read_string('Caption','customCaptionChange1','(%t1/%ta1) elpAudio %v [%pn/%ps]')
__customcaption_ch2= ini_read_string('Caption','customCaptionChange2','(%sn) elpAudio %v [%pn/%ps]')
__changecaption= ini_read_real('Caption','changeCaption',1)
__captionchangespd= ini_read_real('Caption','captionChangeSpeed',3)*60
Expand All @@ -121,6 +123,7 @@ __FrameSkip= ini_read_real('','SkipFrames',0)
__millisecs= ini_read_real('','FramesForSkip',1)
set_synchronization( ini_read_real('','VerticalSync',0))
__monitorpos= ini_read_real('','MonitorPositions',0)
__recursive= ini_read_real('','RecursiveFolders',0)
ini_close()
} else {
var ffff;ffff=file_text_open_write('settings.ini')
Expand Down

0 comments on commit b4c5443

Please sign in to comment.