remove excessive use of space.
This commit is contained in:
parent
4d5522f1bf
commit
499fcff6dd
2 changed files with 231 additions and 230 deletions
60
cimp.bas
60
cimp.bas
|
|
@ -36,16 +36,16 @@ if ipc_status = 0 then
|
|||
' --- CLIENT MODE ---
|
||||
dim cmd_msg as string
|
||||
|
||||
Select Case command$(1)
|
||||
Case "--soundbank"
|
||||
select case command$(1)
|
||||
case "--soundbank"
|
||||
cmd_msg="SOUNDBANK:"+_cwd$ +slash+command$(2)
|
||||
Case "--next"
|
||||
case "--next"
|
||||
cmd_msg="NEXT"
|
||||
|
||||
Case "--prev"
|
||||
case "--prev"
|
||||
cmd_msg="PREV"
|
||||
|
||||
Case "-v", "--volume"
|
||||
case "-v","--volume"
|
||||
cmd_msg="VOL:"+command$(2)
|
||||
|
||||
case "--pause"
|
||||
|
|
@ -68,28 +68,28 @@ if ipc_status = 0 then
|
|||
cmd_msg="NYAN"
|
||||
case "--nyan-off"
|
||||
cmd_msg="NYANOFF"
|
||||
Case "--add"
|
||||
For i = 2 To _commandcount
|
||||
case "--add"
|
||||
for i=2 to _commandcount
|
||||
cmd_msg="ADD:"+_cwd$ +slash+command$(i)
|
||||
ipc_send_message cmd_msg
|
||||
Next i
|
||||
System
|
||||
next i
|
||||
system
|
||||
|
||||
Case "--playlist"
|
||||
case "--playlist"
|
||||
cmd_msg="GET_PLAYLIST"
|
||||
|
||||
Case Else
|
||||
case else
|
||||
' Default behavior: Resolve target file/playlist and replace active queue
|
||||
cmd_msg="PLAY:"+_cwd$ +slash+command$(1)
|
||||
ipc_send_message cmd_msg
|
||||
If _commandcount > 1 Then
|
||||
For i = 2 To _commandcount
|
||||
if _commandcount>1 then
|
||||
for i=2 to _commandcount
|
||||
cmd_msg="ADD:"+_cwd$ +slash+command$(i)
|
||||
ipc_send_message cmd_msg
|
||||
Next i
|
||||
System
|
||||
End If
|
||||
End Select
|
||||
next i
|
||||
system
|
||||
end if
|
||||
end select
|
||||
|
||||
' Send instruction to the main player instance
|
||||
ipc_send_message cmd_msg
|
||||
|
|
@ -294,7 +294,7 @@ while keyin<>27
|
|||
elseif left$(client_cmd,10)="SOUNDBANK:" then
|
||||
if client_cmd="default" then loadsoundbank "" else loadsoundbank mid$(client_cmd,11)
|
||||
|
||||
if _SNDPLAYING(musichandle) then
|
||||
if _sndplaying(musichandle) then
|
||||
|
||||
' a hack to make qb64pe load the midi file that is already loaded.
|
||||
' qb64 can't open the same file again with a new sound bank for some reason
|
||||
|
|
@ -753,33 +753,33 @@ sub loadsoundbank (filename as string)
|
|||
end sub
|
||||
|
||||
|
||||
FUNCTION GetConfig$ (FileName as string)
|
||||
SELECT CASE left$(_OS$,instr(_OS$,"]"))
|
||||
CASE "[WINDOWS]"
|
||||
function GetConfig$ (FileName as string)
|
||||
select case left$(_os$,instr(_os$,"]"))
|
||||
case "[WINDOWS]"
|
||||
dim appdata as string
|
||||
appdata = ENVIRON$("APPDATA")
|
||||
if appdata = "" then appdata = ENVIRON$("USERPROFILE") + "\AppData\Roaming"
|
||||
appdata=environ$("APPDATA")
|
||||
if appdata="" then appdata=environ$("USERPROFILE")+"\AppData\Roaming"
|
||||
if right$(appdata,1)<>"\" then appdata=appdata+"\"
|
||||
GetConfig=appdata+FileName
|
||||
|
||||
CASE "[MACOSX]"
|
||||
case "[MACOSX]"
|
||||
dim homemac as string
|
||||
homemac = ENVIRON$("HOME")
|
||||
homemac=environ$("HOME")
|
||||
if homemac="" then homemac="/tmp"
|
||||
if right$(homemac,1)="/" then homemac=left$(homemac,len(homemac)-1)
|
||||
GetConfig=homemac+"/Library/Application Support/"+FileName
|
||||
|
||||
CASE ELSE ' Linux and other Unix-like systems
|
||||
case else ' Linux and other Unix-like systems
|
||||
dim xdg as string,baseDir as string,homelinux as string
|
||||
xdg = ENVIRON$("XDG_CONFIG_HOME")
|
||||
xdg=environ$("XDG_CONFIG_HOME")
|
||||
if xdg<>"" then
|
||||
baseDir=xdg
|
||||
else
|
||||
homelinux = ENVIRON$("HOME")
|
||||
homelinux=environ$("HOME")
|
||||
if homelinux="" then homelinux="/tmp"
|
||||
baseDir=homelinux+"/.config"
|
||||
end if
|
||||
if right$(baseDir,1)="/" then baseDir=left$(baseDir,len(baseDir)-1)
|
||||
GetConfig=baseDir+"/"+FileName
|
||||
END SELECT
|
||||
END FUNCTION
|
||||
end select
|
||||
end function
|
||||
|
|
|
|||
1
test.bas
Normal file
1
test.bas
Normal file
|
|
@ -0,0 +1 @@
|
|||
print 5--5
|
||||
Loading…
Reference in a new issue