;*****************************************************************************************
;*                   Voy-View 1.10 (c) 1996 Richter Arno                                 *
;*                                                                                       *
;* The script is divided in several blocks (datatypes), which means that every block     *
;* is nearly identical.                                                                  *
;* The differences are the text at >requestchoice<, the viewer and the IDs (JPEG,GIF,..  *
;*                                                                                       *
;* Lines to edit I have marked with >******<                                             *
;*                                                                                       *
;* On my system the MUI-Screen is named >MUI-Screen.16bit< and runs under CyberGFX       *
;* on a Retina board.                                                                    *
;*                                                                                       *
;* I think that if V runs on 16bit screen it doesn't have to be that the viewer gets     *
;* a screen for its own.                                                                 *
;*                                                                                       *
;*****************************************************************************************

; Please enter the Drawers here !!!!
set VerzA hd2:dfü/download/www ; Drawer, in that V saves the files ******
set VerzB hd2:dfü/download/www/gfx ; Drawer, TO where VoyView moves the files. ******
set Schirm MUI-Screen.16bit ;Name of the MUI Public screen ******


failat 21
delete > nil: env:ende ; ...if the variable is already set...
wait 10 ; wait until V have been fully loaded.


cd $VerzA

lab start

;*** JPEG ***
set Typ #?jpg ;Enter here the datatype (#?. - please LEAVE !!!) ******
ECHO $typ len 3 > env:typ2

dir $typ > env:datei ;select files to process

list sub $typ2 lformat %e > env:dateityp ;filter datatypes

IF $dateityp eq $typ2 ;if it is a JPEG file...

  requestchoice VoyView "View JPEG-Graphic ?" "Yes |No " pubscreen $schirm > env:ergebnis ;Prompt, IF the file should be viewed or not

     IF $ergebnis eq "1"
        hd1:utilities/cyberutils/cybershow $datei AS PS=$schirm BT Effects PF JPegQual=95 ;Viewing the file on the V-Screen
     endif

  requestchoice VoyView "Delete JPEG-Graphic ?" "Yes |No " Pubscreen $schirm > env:ergebnis ;Prompt, IF the file should be erased, or not

     IF $ergebnis eq "1"
        delete > nil: $datei ;deleting the file
     endif

     IF $ergebnis eq "0"
        rename > nil: $datei TO $VerzB ; moving the file
     endif

endif


;*** JPEG 2 ***
set Typ #?jpeg ;Enter here the datatype (#?. - please LEAVE !!!) ******
ECHO $typ len 4 > env:typ2 ; ...4, because the suffix has 4 letters

dir $typ > env:datei

list sub $typ2 lformat %e > env:dateityp

IF $dateityp eq $typ2

  requestchoice VoyView "View JPEG-Graphic ?" "Yes |No " pubscreen $schirm > env:ergebnis ;Prompt, IF the file should be viewed or not

     IF $ergebnis eq "1"
        hd1:utilities/cyberutils/cybershow $datei AS PS=$schirm BT Effects PF JPegQual=95 ;Viewing the file on the V-Screen
     endif

  requestchoice VoyView "Delete JPEG-Graphic ?" "Yes |No " Pubscreen $schirm > env:ergebnis ;Prompt, IF the file should be erased, or not

     IF $ergebnis eq "1"
        delete > nil: $datei ;deleting the file
     endif

     IF $ergebnis eq "0"
        rename > nil: $datei TO $VerzB ; moving the file
     endif
endif


;*** GIF ***
set Typ #?gif ;Enter here the datatype (#? - please LEAVE !!!) ******
ECHO $typ len 3 > env:typ2

dir $typ > env:datei

list sub $typ2 lformat %e > env:dateityp

IF $dateityp eq $typ2

  requestchoice VoyView "View GIF-Graphic ?" "Yes |No " pubscreen $schirm > env:ergebnis ;Prompt, IF the file should be viewed or not

     IF $ergebnis eq "1"
        hd1:utilities/cyberutils/cybershow $datei AS PS=$schirm BT Effects PF JPegQual=95 ;Viewing the file on the V-Screen
     endif

  requestchoice VoyView "Delete GIF-Graphic ?" "Yes |No " Pubscreen $schirm > env:ergebnis ;Prompt, IF the file should be erased, or not

     IF $ergebnis eq "1"
        delete > nil: $datei ;deleting the file
     endif

     IF $ergebnis eq "0"
        rename > nil: $datei TO $VerzB ; moving the file
     endif
endif

;*** MPEG ***
set Typ #?mpg ;please enter here the datatype (#? - please LEAVE !!!) ******
ECHO $typ len 3 > env:typ2

dir $typ > env:datei

list sub $typ2 lformat %e > env:dateityp

IF $dateityp eq $typ2

  requestchoice VoyView "Play MPEG Animation ?" "Yes |No " pubscreen $schirm > env:ergebnis ;Prompt, IF the file should be viewed or not

     IF $ergebnis eq "1"
         stack 50000
         setenv x11/usepub $schirm
         hd1:utilities/xanim/xanim +Ae +Ak +Av100 +b +r +R +T1 $datei
         setenv x11/usepub 70Hz.2
     endif

  requestchoice VoyView "Delete MPEG Animation ?" "Yes |No " Pubscreen $schirm > env:ergebnis ;Prompt, IF the file should be erased, or not

     IF $ergebnis eq "1"
        delete > nil: $datei ;deleting the file
     endif

     IF $ergebnis eq "0"
        rename > nil: $datei TO $VerzB ; moving the file
     endif
endif


wait 10

IF exists env:ende ;if V exits, $ende must get any value that this script can exit, too.
  delete > nil: env:ende
  delete > nil: env:datei
  delete > nil: env:ergebnis
  delete > nil: env:dateityp
  delete > nil: env:typ2
  delete > nil: env:schirm
  quit
endif


skip start back ; after >wait 5< it starts above.

