Commit 220f50b7 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Now passes round a message when "Player" is selected from the iconbar menu.If...

Now passes round a message when "Player" is selected from the iconbar menu.If it bounces an attempt will be made to run CDFSFiler$Player and the message resent.If it still bounces the internal player is used.

This avoids the need for endless patches and filters on CDFSFiler.
Message block is very simple
 data + 0 = drive number for which the player is required
 data + 4 = flags word,currently zero

Version 2.46. Tagged as 'CDFSFiler-2_46'
parent 5fd8b4c4
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "2.45"
Module_Version SETA 245
Module_MajorVersion SETS "2.46"
Module_Version SETA 246
Module_MinorVersion SETS ""
Module_Date SETS "09 Jan 2003"
Module_ApplicationDate SETS "09-Jan-03"
Module_Date SETS "24 Mar 2003"
Module_ApplicationDate SETS "24-Mar-03"
Module_ComponentName SETS "CDFSFiler"
Module_ComponentPath SETS "RiscOS/Sources/FileSys/CDFS/CDFSFiler"
Module_FullVersion SETS "2.45"
Module_HelpVersion SETS "2.45 (09 Jan 2003)"
Module_FullVersion SETS "2.46"
Module_HelpVersion SETS "2.46 (24 Mar 2003)"
END
/* (2.45)
/* (2.46)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.68.
*
*/
#define Module_MajorVersion_CMHG 2.45
#define Module_MajorVersion_CMHG 2.46
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 09 Jan 2003
#define Module_Date_CMHG 24 Mar 2003
#define Module_MajorVersion "2.45"
#define Module_Version 245
#define Module_MajorVersion "2.46"
#define Module_Version 246
#define Module_MinorVersion ""
#define Module_Date "09 Jan 2003"
#define Module_Date "24 Mar 2003"
#define Module_ApplicationDate "09-Jan-03"
#define Module_ApplicationDate "24-Mar-03"
#define Module_ComponentName "CDFSFiler"
#define Module_ComponentPath "RiscOS/Sources/FileSys/CDFS/CDFSFiler"
#define Module_FullVersion "2.45"
#define Module_HelpVersion "2.45 (09 Jan 2003)"
#define Module_LibraryVersionInfo "2:45"
#define Module_FullVersion "2.46"
#define Module_HelpVersion "2.46 (24 Mar 2003)"
#define Module_LibraryVersionInfo "2:46"
......@@ -120,12 +120,15 @@ cnt SETA cnt-1
; Constants
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TAB * 9
LF * 10
CR * 13
space * 32
delete * 127
icon_bar_height * 134
TAB * 9
LF * 10
CR * 13
space * 32
delete * 127
icon_bar_height * 134
^ &4BE00
Message_CDFSFilerOpenPlayer # 1
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Data structure offsets
......@@ -182,6 +185,7 @@ buttonstate # 4
windowhandle # 4
iconhandle # 4
menuhandle # 4
msgbounces # 4
ndrives * 28 ; allow for drives 0..27
iconbaricons # ndrives*4 ; associate icon handle with index
......@@ -682,6 +686,7 @@ taskidentifier
MessagesList DCD Message_HelpRequest
DCD Message_MenuWarning
DCD Message_WindowClosed
DCD Message_CDFSFilerOpenPlayer
DCD 0
]
......@@ -828,7 +833,7 @@ CDFSFiler_Start ROUT
BVS ErrorAbort
ADR r1, iconbaricons ; initialise all icon handles to -1
ADR r3, player_playlists ; initialise all playlists to non existant
ADRL r3, player_playlists ; initialise all playlists to non existant
ADRL r4, playerstate_list ; scan the drives and mark as exists
MOV r2, #0 ; (used in AddToIconBar)
01 MOV r14, #-1
......@@ -2336,8 +2341,28 @@ change_icon_text
Pull "r1,r3,pc"
;-----------------------------------------------------------------------------------------------
;
; In r4 = drive number
messagetoPlayer
SUB sp, sp, #128 ; make temp frame for message
LDR r0, =Message_CDFSFilerOpenPlayer
STR r0, [sp, #message_action]
STR r4, [sp, #message_data] ; drive number
MOV r2, #0 ; reserved flags
STR r2, [sp, #message_data + 4]
STR r2, [sp, #message_yourref]
MOV r0, #28
STR r0, [sp, #message_size]
MOV r0, #User_Message_Recorded
MOV r1, sp
SWI XWimp_SendMessage ; broadcast it
ADD sp, sp, #128 ; free temp frame
MOV pc, lr
;-----------------------------------------------------------------------------------------------
;
; In r0 = message action
; r1 -> media name
......@@ -2365,7 +2390,7 @@ messagetoFiler Entry
STR r1, [sp, #message_size]
MOV r0, #User_Message_Recorded
MOV r1, sp
LDR r2, FilerHandle ; send it to the Filer
LDR r2, FilerHandle ; send it to the Filer
SWI XWimp_SendMessage
ADD sp, sp, #256 ; free temp frame
EXIT
......@@ -2706,6 +2731,43 @@ go_cd_volume
ADREQL r0, EH__Driver_NoDrive
BEQ GCV_LookupError
; Shout a message to anyone who might want to override the built in player
BL messagetoPlayer
MOV r0, #2
STR r0, msgbounces ; when zero,give up and use the internal one
EXIT
go_cd_volume_unclaimed
; The user message bounced
LDR r4, [r1, #message_data]
LDR r0, msgbounces
SUBS r0, r0, #1
BEQ go_cd_volume_internal ; two strikes and you're out
STR r0, msgbounces
; Let's have a go at running the external player
MOV r5, r4
ADR r0, playervariable
MOV r2, #-1
MOV r3, #0
MOV r4, #3
SWI XOS_ReadVarVal
TEQ r2, #0
MOV r4, r5
BEQ go_cd_volume_internal ; no player variable so skip straight to the internal one
ADR r0, playervariablerun
SWI XWimp_StartTask
BL messagetoPlayer ; having run something,try messaging to it again
CLRV
EXIT
go_cd_volume_internal
; Remember the volume if need to cancel
MOV r0, r4
BL get_volume_level
......@@ -2803,6 +2865,12 @@ go_cd_volume
EXIT
playervariablerun
DCB "Run <CDFSFiler$Player>",13
ALIGN
playervariable DCB "CDFSFiler$Player",0
ALIGN
; r0->error block
GCV_LookupError
BL lookuperror
......@@ -2913,6 +2981,7 @@ dismount DCB "Dismount n ",0 ; NB space still needed
freespace DCB "Showfree -FS CDFS n ",0; NB space still needed
ALIGN
;----------------------------------------
; In r1 -> "CDFS::discname"
......@@ -3818,24 +3887,6 @@ getmedialoop
SWI XOS_CLI
EXIT VS
;--------------------------------------------------
; Ambiguous disc name error not reported any more
;--------------------------------------------------
[ Module_Version <= 201
;****** Ask if you wish to forget about the old disc OK
ADR r0, err_ambiguous
MOV r1, #2_011
BL ReportError
TEQ r1, #1 ; did the user say "OK"?
EXIT NE ; no!
]
;***** *dismount cdfs::discname - this closes all of the windows on desktop
LDR r1, [sp] ; dismount by disc name (inc. dirs)
......@@ -3890,104 +3941,6 @@ checkambiguous Entry "r1-r5"
TEQ r14, r2
EXIT
;--------------------------------------------
; Ambiguous disc names are no longer reported
;--------------------------------------------
[ Module_Version <= 201
err_ambiguous
DCD 1
DCB "This disc has a name that has been seen before. "
DCB "Forget the old one?", 0
ALIGN
]
;-------------------------------------------------------------------------------
; Old way of getting the disc name
;-------------------------------------------------------------------------------
[ Module_Version <= 201
star_dir_CDFS DCB "%Dir CDFS:", 0
star_back DCB "%Back", 0
ALIGN
GetMediaName_nochecks Entry "r1-r7"
ADRL r1, dirnamebuffer
ADR r2, star_dir_CDFS ; "%dir CDFS:" needed anyway
BL strcpy ; (even if SCSI_DescribeDisc used)
MOV r0, #0 ; Read current FS
MOV r1, #0
SWI XOS_Args ; returns R0 = filing system number
EXIT VS
MOV r6, r0 ; Preserve FS
ADRL r1, dirnamebuffer
LDR r2, [sp, #0] ; r1in
BL strcat ; r1 -> r1(string) + r2(string) +null
MOV r0, r1
SWI XOS_CLI ; dir CDFS::0 or whatever drive
EXIT VS
ADRL r2, userdata+&80 ; r2 -> buffer
MOV r3, #&80 ; r3 = buffer size
MOV r0, #OSGBPB_ReadDiscName ; #5
SWI XOS_GBPB
MOV r3, r0
MOV r7, psr
addr r0, star_back ; issue '%back' always
SWI XOS_CLI
MOV r4, r0
MOV r5, psr
MOV r0, #FSControl_SelectFS ; restore FS always
MOV r1, r6
SWI XOS_FSControl
MOVVC r0, r4
TEQVCP r5, #0
MOVVC r0, r3
TEQVCP r7, #0
EXIT VS
ADRL r2, userdata+&80
LDRB r3, [r2], #1 ; length of discname
MOV r14, #0 ; if "Unnamed" SCSI returns null
STRB r14, [r2, r3] ; put in terminator. r2 -> discname
gotdiscname
LDRB r14, [r2] ; r2 -> disc name
CMP r14, #delete ; (delete or <= space) = terminator
CMPNE r14, #space ; if null, recover drive number instead
LDRLS r2, [sp, #0] ; r1in = ':4' etc
ADDLS r2, r2, #1 ; r2 -> '4' etc
ADRL r3, dirnamebuffer
ADD r1, r3, #:LEN:"%dir CDFS:"
MOV r14, #":" ; Append ':'
STRB r14, [r1], #1
BL strcpy_space ; Append discname: not strcat !
ADD r1, r3, #:LEN:"%dir "
STR r1, [sp, #0] ; return 'CDFS::DiscName' or 'CDFS::4'
EXIT
|
;-----------------------------------------------------------------------------------------
; New way of getting the disc name
;-----------------------------------------------------------------------------------------
GetMediaName_nochecks Entry "r1-r7"
; Build up a buffer of 'CDFS::x.$'
......@@ -4030,8 +3983,7 @@ GetMediaName_nochecks Entry "r1-r7"
; Return a pointer to the name
STR r2, [ sp ]
EXIT
]
EXIT
; ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; Out cx0, cy0 = coords of mouse pointer
......@@ -4364,17 +4316,15 @@ event_user_message Entry
LDR r0, [r1, #message_action]
;----------------------------------------
; Interactive help for menus
;----------------------------------------
[ Module_Version > 201
LDR r14, =Message_HelpRequest
CMP r0, r14
BEQ returnhelp
]
;----------------------------------------
LDR r14, =Message_CDFSFilerOpenPlayer
CMP r0, r14
BEQ go_cd_volume_unclaimed
CMP r0, #Message_Quit
EXIT NE
......@@ -4873,7 +4823,7 @@ updateplaylist
TEQ r0, r1
ADDNE r6, r6, #1
BNE %BT15
ADR r3, playerstate_list
ADRL r3, playerstate_list
LDR r1, CurrentVolumeDrive
ADD r1, r3, r1, LSL#2
ASSERT playerstate_listposn = 8
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment