(defvar media-list nil)(defvar main-media nil)(defvar sub-media nil)(defvar digital-media-list nil)(defvar analog-media-list nil)(defvar scart0-media nil)(defvar scart1-media nil)(defvar scart2-media nil)(defvar frame-visual-list nil)(defvar current-frame nil)(defvar tvp-dev nil)(defvar main-ds-dev nil)(defvar main-sp-dev nil)(defvar main-hp-dev nil)(defvar main-monout-dev nil)(defvar main-optout-dev nil)(defvar sub-ds-dev nil)(defvar sub-hp-dev nil)(defvar frame-dev nil)(defvar visual-dev nil)(defvar scart0-dev nil)(defvar scart1-dev nil)(defvar scart2-dev nil)(defvar qlink-dev nil)(defvar qlink-mode nil)(defvar tv-media nil)(defvar av1-media nil)(defvar av2-media nil)(defvar av3-media nil)(defvar scart-mute-media nil)(defvar USER-MUTE-FLAG #x01)(defvar CP-MUTE-FLAG #x02)(defstruct media display speaker headphone monitorout opticalout mute cp)(defun new-media (key)(unless (assoc key media-list)(setf media-list (cons (list key (make-media
(display-property ds-prop)(soundout-property so-prop)(soundout-property so-prop)(monitorout-property mo-prop)(opticalout-property op-prop)
nil
(list nil nil nil nil nil)))
media-list))))(defmacro get-media (key)
`(nth 1 (assoc ,key media-list)))(defun set-media-group (key add del)(when del
(delete (get-media del) (assoc key media-list)))(when add
(setf-cdr (last (assoc key media-list)) (cons (get-media add) nil))))(defun set-digital-media (key)(unless (assoc key digital-media-list)(setf digital-media-list (cons (list key nil)
digital-media-list))))(defmacro digital-media-p (key)
`(if (assoc ,key digital-media-list) t nil))(defun set-analog-media (key tuner)(unless (assoc key analog-media-list)(setf analog-media-list (cons (list key tuner nil)
analog-media-list))))(defmacro analog-media-p (key)
`(if (assoc ,key analog-media-list) t nil))(defmacro get-atnr-dev (key)
`(nth 1 (assoc ,key analog-media-list)))(defmacro set-atnr-prop (key prop)
`(setf (nth 2 (assoc ,key analog-media-list)) prop))(defmacro get-atnr-prop (key)
`(nth 2 (assoc ,key analog-media-list)))(defmacro new-frame-component ()
`(frame-component df-comp))(defun set-frame-comp1 (key comp)(when (df-comp-p comp)(setf (df-prop-single (get-frame key)) comp)(setf (df-prop-split-left (get-frame key)) comp)(setf (df-prop-pinp-base (get-frame key)) comp)))(defun set-frame-comp2 (key comp)(when (df-comp-p comp)(setf (df-prop-split-right (get-frame key)) comp)(setf (df-prop-pinp-window (get-frame key)) comp)))(defun new-frame-visual (key)(unless (assoc key frame-visual-list)(setf frame-visual-list (cons (list key (frame-property df-prop) (visual-property dv-prop))
frame-visual-list))(set-frame-comp1 key (new-frame-component))(set-frame-comp2 key (new-frame-component))))(defmacro get-frame (key)
`(nth 1 (assoc ,key frame-visual-list)))(defmacro get-visual (key)
`(nth 2 (assoc ,key frame-visual-list)))(defun set-frame-visual-group (key add del)(when del
(delete (get-frame del) (assoc key frame-visual-list))(delete (get-visual del) (assoc key frame-visual-list)))(when add
(setf-cdr (last (assoc key frame-visual-list)) (list (get-frame add) (get-visual add)))))(defun set-ds-src (key type no m ec-mode)(let ((prop))(setf prop (media-display (get-media key)))(setf (ds-prop-src-type prop) type)(setf (ds-prop-src-no prop) no)(setf (ds-prop-src-media prop) m)(setf (ds-prop-src-ec-mode prop) ec-mode)))(defun set-ds-colsys (key mode type)(let ((prop))(setf prop (media-display (get-media key)))(setf (ds-prop-colsys-mode prop) mode)(setf (ds-prop-colsys-type prop) type)))(defun set-ds-setup (key setup)(let ((prop))(setf prop (media-display (get-media key)))(setf (ds-prop-setup prop) setup)))(defun set-ds-id1-det (key id1-det)(let ((prop))(setf prop (media-display (get-media key)))(setf (ds-prop-id1-det prop) id1-det)))(defun set-ds-mv-det (key mv-det)(let ((prop))(setf prop (media-display (get-media key)))(setf (ds-prop-mv-det prop) mv-det)))(defun set-sp-src (key type no)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-src-type prop) type)(setf (so-prop-src-no prop) no)))(defun set-hp-src (key type no)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-src-type prop) type)(setf (so-prop-src-no prop) no)))(defun set-sp-volume (key rate correct balance)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-volume-rate prop) rate)(setf (so-prop-volume-correct prop) correct)(setf (so-prop-volume-balance prop) balance)))(defun set-hp-volume (key rate correct balance)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-volume-rate prop) rate)(setf (so-prop-volume-correct prop) correct)(setf (so-prop-volume-balance prop) balance)))(defun set-sp-bass (key rate)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-bass-rate prop) rate)))(defun set-hp-bass (key rate)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-bass-rate prop) rate)))(defun set-sp-treble (key rate)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-treble-rate prop) rate)))(defun set-hp-treble (key rate)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-treble-rate prop) rate)))(defun set-sp-bbe (key bbe viva)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-bbe-bbe prop) bbe)(setf (so-prop-bbe-viva prop) viva)))(defun set-sp-sound-menu (key menu)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-sound-menu prop) menu)))(defun set-hp-sound-menu (key menu)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-sound-menu prop) menu)))(defun set-sp-bassboost (key bassboost)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-bassboost prop) bassboost)))(defun set-hp-bassboost (key bassboost)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-bassboost prop) bassboost)))(defun set-sp-bass-attack (key bass-attack)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-bass-attack prop) bass-attack)))(defun set-hp-bass-attack (key bass-attack)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-bass-attack prop) bass-attack)))(defun set-sp-mei-surround (key surround)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-mei-surround prop) surround)))(defun set-hp-mei-surround (key surround)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-mei-surround prop) surround)))(defun set-sp-srs-surround (key surround)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-srs-surround prop) surround)))(defun set-hp-srs-surround (key surround)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-srs-surround prop) surround)))(defun set-sp-ai-sound (key ai-sound)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-ai-sound prop) ai-sound)))(defun set-hp-ai-sound (key ai-sound)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-ai-sound prop) ai-sound)))(defun set-sp-equalizer (key equalizer)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-equalizer prop) equalizer)))(defun set-hp-equalizer (key equalizer)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-equalizer prop) equalizer)))(defun set-sp-surround-preset (key surround)(let ((prop))(setf prop (media-speaker (get-media key)))(setf (so-prop-surround-preset prop) surround)))(defun set-hp-surround-preset (key surround)(let ((prop))(setf prop (media-headphone (get-media key)))(setf (so-prop-surround-preset prop) surround)))(defun set-monout-asrc (key type no)(let ((prop))(setf prop (media-monitorout (get-media key)))(setf (mo-prop-asrc-type prop) type)(setf (mo-prop-asrc-no prop) no)))(defun set-monout-vsrc (key type no)(let ((prop))(setf prop (media-monitorout (get-media key)))(setf (mo-prop-vsrc-type prop) type)(setf (mo-prop-vsrc-no prop) no)))(defun set-monout-amute (key amute)(let ((prop))(setf prop (media-monitorout (get-media key)))(setf (mo-prop-amute prop) amute)))(defun set-monout-vmute (key vmute)(let ((prop))(setf prop (media-monitorout (get-media key)))(setf (mo-prop-vmute prop) vmute)))(defun set-optout-src (key type no)(let ((prop))(setf prop (media-opticalout (get-media key)))(setf (op-prop-src-type prop) type)(setf (op-prop-src-no prop) no)))(defun set-optout-pass-through (key pass)(let ((prop))(setf prop (media-opticalout (get-media key)))(setf (op-prop-pass-through prop) pass)))(defun set-frame-type (key type)(let ((prop))(setf prop (get-frame key))(setf (df-prop-frame-type prop) type)))(defun set-comp-input-path (comp input-path)(setf (df-comp-input-path comp) input-path))(defun set-comp-source (comp h-start v-start h-size v-size)(when h-start (setf (df-comp-source-h-start comp) h-start))(when v-start (setf (df-comp-source-v-start comp) v-start))(when h-size (setf (df-comp-source-h-size comp) h-size))(when v-size (setf (df-comp-source-v-size comp) v-size)))(defun set-comp-source-option (comp h-pos v-pos active-v-1035 sidecut no-overscan reserved)(when h-pos (setf (df-comp-source-option-h-pos comp) h-pos))(when v-pos (setf (df-comp-source-option-v-pos comp) v-pos))(when active-v-1035 (setf (df-comp-source-option-active-v-1035 comp) active-v-1035))(when sidecut (setf (df-comp-source-option-sidecut comp) sidecut))(when no-overscan (setf (df-comp-source-option-no-overscan comp) no-overscan))(when reserved (setf (df-comp-source-option-reserved comp) reserved)))(defun set-comp-dest (comp h-start v-start h-size v-size)(when h-start (setf (df-comp-dest-h-start comp) h-start))(when v-start (setf (df-comp-dest-v-start comp) v-start))(when h-size (setf (df-comp-dest-h-size comp) h-size))(when v-size (setf (df-comp-dest-v-size comp) v-size)))(defun set-comp-dest-option (comp h-pos v-pos adj-square-pixel-16x9 just-mode reserved)(when h-pos (setf (df-comp-dest-option-h-pos comp) h-pos))(when v-pos (setf (df-comp-dest-option-v-pos comp) v-pos))(when adj-square-pixel-16x9 (setf (df-comp-dest-option-adj-square-pixel-16x9 comp) adj-square-pixel-16x9))(when just-mode (setf (df-comp-dest-option-just-mode comp) just-mode))(when reserved (setf (df-comp-dest-option-reserved comp) reserved)))(defmacro set-frame-single (key comp)
`(set-frame-comp1 ,key ,comp))(defmacro set-frame-single-input-path (key input-path)
`(setf (df-comp-input-path (df-prop-single (get-frame ,key))) ,input-path))(defmacro set-frame-single-source (key h-start v-start h-size v-size)
`(set-comp-source (df-prop-single (get-frame ,key)) ,h-start ,v-start ,h-size ,v-size))(defmacro set-frame-single-source-option (key h-pos v-pos active-v-1035 sidecut no-overscan reserved)
`(set-comp-source-option (df-prop-single (get-frame ,key)) ,h-pos ,v-pos ,active-v-1035 ,sidecut ,no-overscan ,reserved))(defmacro set-frame-single-dest (key h-start v-start h-size v-size)
`(set-comp-dest (df-prop-single (get-frame ,key)) ,h-start ,v-start ,h-size ,v-size))(defmacro set-frame-single-dest-option (key h-pos v-pos adj-square-pixel-16x9 just-mode reserved)
`(set-comp-dest-option (df-prop-single (get-frame ,key)) ,h-pos ,v-pos ,adj-square-pixel-16x9 ,just-mode ,reserved))(defmacro set-frame-split-left (key comp)
`(set-frame-comp1 ,key ,comp))(defmacro set-frame-split-left-input-path (key input-path)
`(setf (df-comp-input-path (df-prop-split-left (get-frame ,key))) ,input-path))(defmacro set-frame-split-left-source (key h-start v-start h-size v-size)
`(set-comp-source (df-prop-split-left (get-frame ,key)) ,h-start ,v-start ,h-size ,v-size))(defmacro set-frame-split-left-source-option (key h-pos v-pos active-v-1035 sidecut no-overscan reserved)
`(set-comp-source-option (df-prop-split-left (get-frame ,key)) ,h-pos ,v-pos ,active-v-1035 ,sidecut ,no-overscan ,reserved))(defmacro set-frame-split-left-dest (key h-start v-start h-size v-size)
`(set-comp-dest (df-prop-split-left (get-frame ,key)) ,h-start ,v-start ,h-size ,v-size))(defmacro set-frame-split-left-dest-option (key h-pos v-pos adj-square-pixel-16x9 just-mode reserved)
`(set-comp-dest-option (df-prop-split-left (get-frame ,key)) ,h-pos ,v-pos ,adj-square-pixel-16x9 ,just-mode ,reserved))(defmacro set-frame-split-right (key comp)
`(set-frame-comp2 ,key ,comp))(defmacro set-frame-split-right-input-path (key input-path)
`(setf (df-comp-input-path (df-prop-split-right (get-frame ,key))) ,input-path))(defmacro set-frame-split-right-source (key h-start v-start h-size v-size)
`(set-comp-source (df-prop-split-right (get-frame ,key)) ,h-start ,v-start ,h-size ,v-size))(defmacro set-frame-split-right-source-option (key h-pos v-pos active-v-1035 sidecut no-overscan reserved)
`(set-comp-source-option (df-prop-split-right (get-frame ,key)) ,h-pos ,v-pos ,active-v-1035 ,sidecut ,no-overscan ,reserved))(defmacro set-frame-split-right-dest (key h-start v-start h-size v-size)
`(set-comp-dest (df-prop-split-right (get-frame ,key)) ,h-start ,v-start ,h-size ,v-size))(defmacro set-frame-split-right-dest-option (key h-pos v-pos adj-square-pixel-16x9 just-mode reserved)
`(set-comp-dest-option (df-prop-split-right (get-frame ,key)) ,h-pos ,v-pos ,adj-square-pixel-16x9 ,just-mode ,reserved))(defmacro set-frame-pinp-base (key comp)
`(set-frame-comp1 ,key ,comp))(defmacro set-frame-pinp-base-input-path (key input-path)
`(setf (df-comp-input-path (df-prop-pinp-base (get-frame ,key))) ,input-path))(defmacro set-frame-pinp-base-source (key h-start v-start h-size v-size)
`(set-comp-source (df-prop-pinp-base (get-frame ,key)) ,h-start ,v-start ,h-size ,v-size))(defmacro set-frame-pinp-base-source-option (key h-pos v-pos active-v-1035 sidecut no-overscan reserved)
`(set-comp-source-option (df-prop-pinp-base (get-frame ,key)) ,h-pos ,v-pos ,active-v-1035 ,sidecut ,no-overscan ,reserved))(defmacro set-frame-pinp-base-dest (key h-start v-start h-size v-size)
`(set-comp-dest (df-prop-pinp-base (get-frame ,key)) ,h-start ,v-start ,h-size ,v-size))(defmacro set-frame-pinp-base-dest-option (key h-pos v-pos adj-square-pixel-16x9 just-mode reserved)
`(set-comp-dest-option (df-prop-pinp-base (get-frame ,key)) ,h-pos ,v-pos ,adj-square-pixel-16x9 ,just-mode ,reserved))(defmacro set-frame-pinp-window (key comp)
`(set-frame-comp2 ,key ,comp))(defmacro set-frame-pinp-window-input-path (key input-path)
`(setf (df-comp-input-path (df-prop-pinp-window (get-frame ,key))) ,input-path))(defmacro set-frame-pinp-window-source (key h-start v-start h-size v-size)
`(set-comp-source (df-prop-pinp-window (get-frame ,key)) ,h-start ,v-start ,h-size ,v-size))(defmacro set-frame-pinp-window-source-option (key h-pos v-pos active-v-1035 sidecut no-overscan reserved)
`(set-comp-source-option (df-prop-pinp-window (get-frame ,key)) ,h-pos ,v-pos ,active-v-1035 ,sidecut ,no-overscan ,reserved))(defmacro set-frame-pinp-window-dest (key h-start v-start h-size v-size)
`(set-comp-dest (df-prop-pinp-window (get-frame ,key)) ,h-start ,v-start ,h-size ,v-size))(defmacro set-frame-pinp-wondow-dest-option (key h-pos v-pos adj-square-pixel-16x9 just-mode reserved)
`(set-comp-dest-option (df-prop-pinp-window (get-frame ,key)) ,h-pos ,v-pos ,adj-square-pixel-16x9 ,just-mode ,reserved))(defun set-frame-param-option (key option)(let ((prop))(setf prop (get-frame key))(setf (df-prop-param-option-data prop) option)))(defun set-frame-frame-option (key option)(let ((prop))(setf prop (get-frame key))(setf (df-prop-frame-option prop) option)))(defun set-frame-mask-option (key option)(let ((prop))(setf prop (get-frame key))(setf (df-prop-mask-option prop) option)))(defun set-frame-private-data (key lst)(let ((prop))(setf prop (get-frame key))(setf (df-prop-private-data prop) lst)))(defun set-visual-color (key val ofs type)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-color-val prop) val)(setf (dv-prop-color-ofs prop) ofs)(setf (dv-prop-color-type prop) type)))(defun set-visual-tint (key tint)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-tint prop) tint)))(defun set-visual-contrast (key contrast)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-contrast prop) contrast)))(defun set-visual-bright (key bright)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-bright prop) bright)))(defun set-visual-sharpness (key sharpness)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-sharpness prop) sharpness)))(defun set-visual-backlight (key backlight)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-backlight prop) backlight)))(defun set-visual-black-extension (key black-extension)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-black-extension prop) black-extension)))(defun set-visual-white-char (key white-char)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-white-char prop) white-char)))(defun set-visual-drv (key r-drv b-drv r-cut b-cut)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-drv-r-drv prop) r-drv)(setf (dv-prop-drv-b-drv prop) b-drv)(setf (dv-prop-drv-r-cut prop) r-cut)(setf (dv-prop-drv-b-cut prop) b-cut)))(defun set-visual-rgb-gain (key r-gain g-gain b-gain)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-rgb-gain-r-gain prop) r-gain)(setf (dv-prop-rgb-gain-g-gain prop) g-gain)(setf (dv-prop-rgb-gain-b-gain prop) b-gain)))(defun set-visual-nr (key video wecor offset mpeg mosq)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-nr-video prop) video)(setf (dv-prop-nr-wecor prop) wecor)(setf (dv-prop-nr-offset prop) offset)(setf (dv-prop-nr-mpeg prop) mpeg)(setf (dv-prop-nr-mosq prop) mosq)))(defun set-visual-picmode (key picmode)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-picmode prop) picmode)))(defun set-visual-color-balance (key color-balance)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-color-balance prop) color-balance)))(defun set-visual-edge-correct (key edge-correct)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-edge-correct prop) edge-correct)))(defun set-visual-detail-correct (key detail-correct)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-detail-correct prop) detail-correct)))(defun set-visual-bright-setting (key bright-setting)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-bright-setting prop) bright-setting)))(defun set-visual-gamma-correct (key gamma-correct)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-gamma-correct prop) gamma-correct)))(defun set-visual-power-save (key power-save)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-power-save prop) power-save)))(defun set-visual-cont-save (key cont-save)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-cont-save prop) cont-save)))(defun set-visual-text-contrast (key text-contrast)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-text-contrast prop) text-contrast)))(defun set-visual-refresh-rate (key type mode)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-refresh-rate-type prop) type)(setf (dv-prop-refresh-rate-mode prop) mode)))(defun set-visual-demo (key demo)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-demo prop) demo)))(defun set-visual-pqcor (key pqcor)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-pqcor prop) pqcor)))(defun set-visual-colsp-adj (key colsp-adj)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-colsp-adj prop) colsp-adj)))(defun set-visual-color-mgmt (key color-mgmt)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-color-mgmt prop) color-mgmt)))(defun set-visual-cats (key cats)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-cats prop) cats)))(defun set-visual-pict-ai (key pict-ai)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-pict-ai prop) pict-ai)))(defun set-visual-technical (key technical)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-technical prop) technical)))(defun set-visual-contour-emphasis (key contour-emphasis)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-contour-emphasis prop) contour-emphasis)))(defun set-visual-bright-correct (key bright-correct)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-bright-correct prop) bright-correct)))(defun set-visual-comb-3d (key comb-3d)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-comb-3d prop) comb-3d)))(defun set-visual-colmtx-480p (key colmtx-480p)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-colmtx-480p prop) colmtx-480p)))(defun set-visual-dcr (key dcr)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-dcr prop) dcr)))(defun set-visual-film-dejuder (key film-dejuder)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-film-dejuder prop) film-dejuder)))(defun set-visual-thx-md (key thx-md)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-thx-md prop) thx-md)))(defun set-visual-ex-contrast (key ex-contrast)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-ex-contrast prop) ex-contrast)))(defun set-visual-backlight-blink (key backlight-blink)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-backlight-blink prop) backlight-blink)))(defun set-visual-contrast-ai (key contrast-ai)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-contrast-ai prop) contrast-ai)))(defun set-visual-sfc (key sfc)(let ((prop))(setf prop (get-visual key))(setf (dv-prop-sfc prop) sfc)))(defmacro set-tvp (dev)
`(setf tvp-dev ,dev))(defmacro set-main-ds (dev)
`(setf main-ds-dev ,dev))(defmacro set-main-sp (dev)
`(setf main-sp-dev ,dev))(defmacro set-main-hp (dev)
`(setf main-hp-dev ,dev))(defmacro set-main-monout (dev)
`(setf main-monout-dev ,dev))(defmacro set-main-optout (dev)
`(setf main-optout-dev ,dev))(defmacro set-sub-ds (dev)
`(setf sub-ds-dev ,dev))(defmacro set-sub-hp (dev)
`(setf sub-hp-dev ,dev))(defmacro set-frame (dev)
`(setf frame-dev ,dev))(defmacro set-visual (dev)
`(setf visual-dev ,dev))(defmacro set-scart0 (dev)
`(setf scart0-dev ,dev))(defmacro set-scart1 (dev)
`(setf scart1-dev ,dev))(defmacro set-scart2 (dev)
`(setf scart2-dev ,dev))(defun sync-display (key)(when tvp-dev
(when (and main-ds-dev
(or (eq key main-media)(find (get-media key) (assoc main-media media-list))))(when (check-mute main-media main-ds-dev)(display-mute main-ds-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(display-set main-ds-dev (media-display x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute main-media main-ds-dev)(display-unmute main-ds-dev)))(when (and sub-ds-dev
(or (eq key sub-media)(find (get-media key) (assoc sub-media media-list))))(when (check-mute sub-media sub-ds-dev)(display-mute sub-ds-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(display-set sub-ds-dev (media-display x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute sub-media sub-ds-dev)(display-unmute sub-ds-dev)))))(defun sync-speaker (key)(when tvp-dev
(if swap-audio
(progn
(when (or (eq key sub-media)(find (get-media key) (assoc sub-media media-list)))(when (check-mute sub-media main-sp-dev)(soundout-mute main-sp-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(soundout-set main-sp-dev (media-speaker x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute sub-media main-sp-dev)(soundout-unmute main-sp-dev))))(when (or (eq key main-media)(find (get-media key) (assoc main-media media-list)))(when (check-mute main-media main-sp-dev)(soundout-mute main-sp-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(soundout-set main-sp-dev (media-speaker x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute main-media main-sp-dev)(soundout-unmute main-sp-dev))))))(defun sync-headphone (key)(when tvp-dev
(if swap-audio
(progn
(when (and main-hp-dev
(or (eq key sub-media)(find (get-media key) (assoc sub-media media-list))))(when (check-mute sub-media main-hp-dev)(soundout-mute main-hp-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(soundout-set main-hp-dev (media-headphone x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute sub-media main-hp-dev)(soundout-unmute main-hp-dev)))(when (and sub-hp-dev
(or (eq key sub-media)(find (get-media key) (assoc sub-media media-list))))(when (check-mute sub-media sub-hp-dev)(soundout-mute sub-hp-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(soundout-set sub-hp-dev (media-headphone x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute sub-media sub-hp-dev)(soundout-unmute sub-hp-dev))))(when (and main-hp-dev
(or (eq key main-media)(find (get-media key) (assoc main-media media-list))))(when (check-mute main-media main-hp-dev)(soundout-mute main-hp-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(soundout-set main-hp-dev (media-headphone x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute main-media main-hp-dev)(soundout-unmute main-hp-dev)))(when sub-hp-dev
(when (check-mute main-media sub-hp-dev)(soundout-mute sub-hp-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(soundout-set sub-hp-dev (media-headphone x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute main-media sub-hp-dev)(soundout-unmute sub-hp-dev))))))(defun sync-monitorout (key)(when tvp-dev
(when (and main-monout-dev
(or (eq key main-media)(find (get-media key) (assoc main-media media-list))))(when (check-mute main-media main-monout-dev)(monitorout-mute main-monout-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(monitorout-set main-monout-dev (media-monitorout x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute main-media main-monout-dev)(monitorout-unmute main-monout-dev)))))(defun sync-opticalout (key)(when tvp-dev
(if swap-audio
(progn
(when (and main-optout-dev
(or (eq key sub-media)(find (get-media key) (assoc sub-media media-list))))(when (check-mute sub-media main-optout-dev)(optical-output-mute main-optout-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(opticalout-set main-optout-dev (media-opticalout x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute sub-media main-optout-dev)(optical-output-unmute main-optout-dev))))(when (and main-optout-dev
(or (eq key main-media)(find (get-media key) (assoc main-media media-list))))(when (check-mute main-media main-optout-dev)(optical-output-mute main-optout-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(opticalout-set main-optout-dev (media-opticalout x)))(cdr (assoc key media-list)))(tvp-sync tvp-dev)(when (check-unmute main-media main-optout-dev)(optical-output-unmute main-optout-dev))))))(defun sync-scart0 (key)(when tvp-dev
(when (and scart0-dev
(or (eq key scart0-media)(find (get-media key) (assoc scart0-media media-list))))(when (or (check-mute scart0-media scart0-dev) (find scart0-media scart-mute-media))(monitorout-mute scart0-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(monitorout-set scart0-dev (media-monitorout x)))(cdr (assoc key media-list)))(let ((sync-prop))(setf sync-prop (monitorout-property mo-prop))(setf (mo-prop-asrc-sync-mode sync-prop) 0)(setf (mo-prop-vsrc-sync-mode sync-prop) 0)(monitorout-set scart0-dev sync-prop))(tvp-sync tvp-dev)(when (and (check-unmute scart0-media scart0-dev) (not (find scart0-media scart-mute-media)))(monitorout-unmute scart0-dev)))))(defun sync-scart1 (key)(when tvp-dev
(when (and scart1-dev
(or (eq key scart1-media)(find (get-media key) (assoc scart1-media media-list))))(when (or (check-mute scart1-media scart1-dev) (find scart1-media scart-mute-media))(monitorout-mute scart1-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(monitorout-set scart1-dev (media-monitorout x)))(cdr (assoc key media-list)))(let ((sync-prop))(setf sync-prop (monitorout-property mo-prop))(setf (mo-prop-asrc-sync-mode sync-prop) 0)(setf (mo-prop-vsrc-sync-mode sync-prop) 0)(monitorout-set scart1-dev sync-prop))(tvp-sync tvp-dev)(when (and (check-unmute scart1-media scart1-dev) (not (find scart1-media scart-mute-media)))(monitorout-unmute scart1-dev)))))(defun sync-scart2 (key)(when tvp-dev
(when (and scart2-dev
(or (eq key scart2-media)(find (get-media key) (assoc scart2-media media-list))))(when (or (check-mute scart2-media scart2-dev) (find scart2-media scart-mute-media))(monitorout-mute scart2-dev))(tvp-load tvp-dev)(mapcar #'(lambda (x)(monitorout-set scart2-dev (media-monitorout x)))(cdr (assoc key media-list)))(let ((sync-prop))(setf sync-prop (monitorout-property mo-prop))(setf (mo-prop-asrc-sync-mode sync-prop) 0)(setf (mo-prop-vsrc-sync-mode sync-prop) 0)(monitorout-set scart2-dev sync-prop))(tvp-sync tvp-dev)(when (and (check-unmute scart2-media scart2-dev) (not (find scart2-media scart-mute-media)))(monitorout-unmute scart2-dev)))))(defun sync-frame (key)(when tvp-dev
(when (and frame-dev
(or (eq key current-frame)(find (get-frame key) (assoc current-frame frame-visual-list))))(tvp-load tvp-dev)(mapcar #'(lambda (x)(when (df-prop-p x)(frame-set frame-dev x)))(cdr (assoc key frame-visual-list)))(tvp-sync tvp-dev))))(defun sync-visual (key)(when tvp-dev
(when (and visual-dev
(or (eq key current-frame)(find (get-visual key) (assoc current-frame frame-visual-list))))(tvp-load tvp-dev)(mapcar #'(lambda (x)(when (dv-prop-p x)(visual-set visual-dev x)))(cdr (assoc key frame-visual-list)))(tvp-sync tvp-dev))))(defun mute-main-ds ()(device-flag-set main-ds-dev USER-MUTE-FLAG)(display-mute main-ds-dev))(defun mute-main-sp ()(device-flag-set main-sp-dev USER-MUTE-FLAG)(soundout-mute main-sp-dev))(defun mute-main-hp ()(device-flag-set main-hp-dev USER-MUTE-FLAG)(soundout-mute main-hp-dev))(defun mute-main-monout ()(device-flag-set main-monout-dev USER-MUTE-FLAG)(monitorout-mute main-monout-dev))(defun mute-main-optout ()(device-flag-set main-optout-dev USER-MUTE-FLAG)(optical-output-mute main-optout-dev))(defun mute-sub-ds ()(device-flag-set sub-ds-dev USER-MUTE-FLAG)(display-mute sub-ds-dev))(defun mute-sub-hp ()(device-flag-set sub-hp-dev USER-MUTE-FLAG)(soundout-mute sub-hp-dev))(defun mute-scart0 ()(device-flag-set scart0-dev USER-MUTE-FLAG)(monitorout-mute scart0-dev))(defun mute-scart1 ()(device-flag-set scart1-dev USER-MUTE-FLAG)(monitorout-mute scart1-dev))(defun mute-scart2 ()(device-flag-set scart2-dev USER-MUTE-FLAG)(monitorout-mute scart2-dev))(defun mute-media (key)(unless (media-mute (get-media key))(setf (media-mute (get-media key)) t)(when (eq key main-media)(when main-ds-dev
(display-mute main-ds-dev))(when main-sp-dev
(soundout-mute main-sp-dev))(when main-hp-dev
(soundout-mute main-hp-dev))(when main-monout-dev
(monitorout-mute main-monout-dev))(when main-optout-dev
(optical-output-mute main-optout-dev)))(when (eq key sub-media)(when sub-ds-dev
(display-mute sub-ds-dev))(when sub-hp-dev
(soundout-mute sub-hp-dev)))(when (and scart0-dev (eq key scart0-media))(monitorout-mute scart0-dev))(when (and scart1-dev (eq key scart1-media))(monitorout-mute scart1-dev))(when (when scart2-dev (eq key scart2-media))(monitorout-mute scart2-dev))))(defun unmute-main-ds ()(device-flag-unset main-ds-dev USER-MUTE-FLAG)(when main-media
(sync-display main-media)))(defun unmute-main-sp ()(device-flag-unset main-sp-dev USER-MUTE-FLAG)(when main-media
(sync-speaker main-media)))(defun unmute-main-hp ()(device-flag-unset main-hp-dev USER-MUTE-FLAG)(when main-media
(sync-headphone main-media)))(defun unmute-main-monout ()(device-flag-unset main-monout-dev USER-MUTE-FLAG)(when main-media
(sync-monitorout main-media)))(defun unmute-main-optout ()(device-flag-unset main-optout-dev USER-MUTE-FLAG)(when main-media
(sync-opticalout main-media)))(defun unmute-sub-ds ()(device-flag-unset sub-ds-dev USER-MUTE-FLAG)(when sub-media
(sync-display sub-media)))(defun unmute-sub-hp ()(device-flag-unset sub-hp-dev USER-MUTE-FLAG)(when sub-media
(sync-headphone sub-media)))(defun unmute-scart0 ()(device-flag-unset scart0-dev USER-MUTE-FLAG)(when scart0-media
(sync-scart0 scart0-media)))(defun unmute-scart1 ()(device-flag-unset scart1-dev USER-MUTE-FLAG)(when scart1-media
(sync-scart1 scart1-media)))(defun unmute-scart2 ()(device-flag-unset scart2-dev USER-MUTE-FLAG)(when scart2-media
(sync-scart2 scart2-media)))(defun unmute-media (key)(when (and key (media-mute (get-media key)))(setf (media-mute (get-media key)) nil)(sync-display key)(sync-speaker key)(sync-headphone key)(sync-monitorout key)(sync-opticalout key)(sync-scart0 key)(sync-scart1 key)(sync-scart2 key)))(defmacro set-ds-cp (key on-off)
`(setf (nth 0 (media-cp (get-media ,key))) ,on-off))(defmacro get-ds-cp (key)
`(nth 0 (media-cp (get-media ,key))))(defmacro set-sp-cp (key on-off)
`(setf (nth 1 (media-cp (get-media ,key))) ,on-off))(defmacro get-sp-cp (key)
`(nth 1 (media-cp (get-media ,key))))(defmacro set-hp-cp (key on-off)
`(setf (nth 2 (media-cp (get-media ,key))) ,on-off))(defmacro get-hp-cp (key)
`(nth 2 (media-cp (get-media ,key))))(defmacro set-monout-cp (key on-off)
`(setf (nth 3 (media-cp (get-media ,key))) ,on-off))(defmacro get-monout-cp (key)
`(nth 3 (media-cp (get-media ,key))))(defmacro set-optout-cp (key on-off)
`(setf (nth 4 (media-cp (get-media ,key))) ,on-off))(defmacro get-optout-cp (key)
`(nth 4 (media-cp (get-media ,key))))(defun ref-cp (key dev)(if (or (eq dev main-ds-dev)(eq dev sub-ds-dev))(get-ds-cp key)(if (eq dev main-sp-dev)(get-sp-cp key)(if (or (eq dev main-hp-dev) (eq dev sub-hp-dev))(get-hp-cp key)(if (eq dev main-monout-dev)(get-monout-cp key)(if (eq dev main-optout-dev)(get-optout-cp key)
nil))))))(defmacro set-cp-mute (dev)
`(device-flag-set ,dev CP-MUTE-FLAG))(defmacro set-cp-unmute (dev)
`(device-flag-unset ,dev CP-MUTE-FLAG))(defun main-digital-tune (key)(when (and tvp-dev (digital-media-p key))(when (eq key main-media)(tvp-load tvp-dev)(mapcar #'(lambda (x)(when main-ds-dev
(display-set main-ds-dev (media-display x)))(when main-sp-dev
(soundout-set main-sp-dev (media-speaker x)))(when main-hp-dev
(soundout-set main-hp-dev (media-headphone x)))(when main-monout-dev
(monitorout-set main-monout-dev (media-monitorout x)))(when main-optout-dev
(opticalout-set main-optout-dev (media-opticalout x))))(cdr (assoc key media-list)))(tvp-sync tvp-dev))))(defun sub-digital-tune (key)(when (and tvp-dev (digital-media-p key))(when (eq key sub-media)(tvp-load tvp-dev)(mapcar #'(lambda (x)(when sub-ds-dev
(display-set sub-ds-dev (media-display x)))(when sub-hp-dev
(soundout-set sub-hp-dev (media-headphone x))))(cdr (assoc key media-list)))(tvp-sync tvp-dev))))(defun main-analog-tune (key prop)(when (and tvp-dev (analog-media-p key))(when (eq key main-media)(tvp-load tvp-dev)(mapcar #'(lambda (x)(when main-ds-dev
(display-set main-ds-dev (media-display x)))(unless swap-audio
(when main-sp-dev
(soundout-set main-sp-dev (media-speaker x)))(when main-hp-dev
(soundout-set main-hp-dev (media-headphone x))))(when main-monout-dev
(monitorout-set main-monout-dev (media-monitorout x)))(when main-optout-dev
(opticalout-set main-optout-dev (media-opticalout x))))(cdr (assoc key media-list)))(atnr-set (get-atnr-dev key) prop)(tvp-sync tvp-dev))(set-atnr-prop key prop)))(defun sub-analog-tune (key prop)(when (and tvp-dev (analog-media-p key))(when (eq key sub-media)(tvp-load tvp-dev)(mapcar #'(lambda (x)(when sub-ds-dev
(display-set sub-ds-dev (media-display x)))(when sub-hp-dev
(soundout-set sub-hp-dev (media-headphone x))))(cdr (assoc key media-list)))(atnr-set (get-atnr-dev key) prop)(tvp-sync tvp-dev))(set-atnr-prop key prop)))(defun stand-analog-tune (key prop)(when (and tvp-dev (analog-media-p key))(tvp-load tvp-dev)(atnr-set (get-atnr-dev key) prop)(tvp-sync tvp-dev)(set-atnr-prop key prop)))(defun sync-atnr (key)(when (and tvp-dev (analog-media-p key))(tvp-load tvp-dev)(atnr-set (get-atnr-dev key) (get-atnr-prop key))(tvp-sync tvp-dev)))(defun sync-atnr-with-prop (key prop)(when (and tvp-dev (analog-media-p key))(tvp-load tvp-dev)(atnr-set (get-atnr-dev key) prop)(tvp-sync tvp-dev)))(defvar select-media-hook nil)(defmacro add-select-media-hook (fun)
`(setf select-media-hook ,fun))(defvar sp-sync-mode nil)(defvar hp-sync-mode nil)(defvar aout-sync-mode nil)(defvar vout-sync-mode nil)(defvar opt-sync-mode nil)(defmacro config-sp-sync-mode ()
`(setf sp-sync-mode t))(defmacro config-hp-sync-mode ()
`(setf hp-sync-mode t))(defmacro config-aout-sync-mode ()
`(setf aout-sync-mode t))(defmacro config-vout-sync-mode ()
`(setf vout-sync-mode t))(defmacro config-opt-sync-mode ()
`(setf opt-sync-mode t))(defun select-media (new-main new-sub new-frame)(when tvp-dev
(set-scart-media new-main)(tvp-load tvp-dev)(when select-media-hook
(funcall select-media-hook new-main new-sub new-frame))(main-mute-all new-main)(sub-mute-all new-sub)(scart-mute-all)(let ((prop) (atnr-act-main nil) (atnr-act-sub nil) (last-act))(when new-main
(mapcar #'(lambda (x)(when main-ds-dev
(when (display-set main-ds-dev (media-display x))(setf atnr-act-main t)))(unless (and swap-audio new-sub)(when main-sp-dev
(setf (so-prop-src-sync-mode (media-speaker x)) (if sp-sync-mode 1 0))(soundout-set main-sp-dev (media-speaker x)))(when main-hp-dev
(setf (so-prop-src-sync-mode (media-headphone x)) (if hp-sync-mode 1 0))(soundout-set main-hp-dev (media-headphone x))(when sub-hp-dev
(soundout-set sub-hp-dev (media-headphone x))))(when main-optout-dev
(setf (op-prop-src-sync-mode (media-opticalout x)) (if opt-sync-mode 1 0))(opticalout-set main-optout-dev (media-opticalout x))))(when main-monout-dev
(setf (mo-prop-asrc-sync-mode (media-monitorout x)) (if aout-sync-mode 1 0))(setf (mo-prop-vsrc-sync-mode (media-monitorout x)) (if vout-sync-mode 1 0))(monitorout-set main-monout-dev (media-monitorout x))))(cdr (assoc new-main media-list))))(when new-sub
(mapcar #'(lambda (x)(when sub-ds-dev
(when (display-set sub-ds-dev (media-display x))(setf atnr-act-sub t)))(if (and swap-audio new-sub)(progn
(when main-sp-dev
(setf (so-prop-src-sync-mode (media-speaker x)) (if sp-sync-mode 2 0))(soundout-set main-sp-dev (media-speaker x)))(when main-hp-dev
(setf (so-prop-src-sync-mode (media-headphone x)) (if hp-sync-mode 2 0))(soundout-set main-hp-dev (media-headphone x)))(when sub-hp-dev
(setf (so-prop-src-sync-mode (media-headphone x)) (if hp-sync-mode 2 0))(soundout-set sub-hp-dev (media-headphone x)))(when main-optout-dev
(setf (op-prop-src-sync-mode (media-opticalout x)) (if opt-sync-mode 2 0))(opticalout-set main-optout-dev (media-opticalout x))))(when sub-hp-dev
(setf (so-prop-src-sync-mode (media-headphone x)) (if hp-sync-mode 2 0))(soundout-set sub-hp-dev (media-headphone x)))))(cdr (assoc new-sub media-list))))(when new-frame
(mapcar #'(lambda (x)(when (and frame-dev (df-prop-p x))(frame-set frame-dev x))(when (and visual-dev (dv-prop-p x))(visual-set visual-dev x)))(cdr (assoc new-frame frame-visual-list))))(when (and new-main (analog-media-p new-main) (get-atnr-prop new-main))(unless (eq new-main main-media)(when atnr-act-main
(setf last-act (atnr-prop-tune-act (get-atnr-prop new-main)))(setf (atnr-prop-tune-act (get-atnr-prop new-main)) 1))(atnr-set (get-atnr-dev new-main) (get-atnr-prop new-main))(when atnr-act-main
(setf (atnr-prop-tune-act (get-atnr-prop new-main)) last-act))))(when (and new-sub (analog-media-p new-sub) (get-atnr-prop new-sub))(unless (eq new-sub sub-media)(when atnr-act-sub
(setf last-act (atnr-prop-tune-act (get-atnr-prop new-sub)))(setf (atnr-prop-tune-act (get-atnr-prop new-sub)) 1))(atnr-set (get-atnr-dev new-sub) (get-atnr-prop new-sub))(when atnr-act-sub
(setf (atnr-prop-tune-act (get-atnr-prop new-sub)) last-act)))))(set-scart-dev new-main new-sub)(tvp-sync tvp-dev)(main-unmute-all new-main)(sub-unmute-all new-sub)(scart-unmute-all)(setf main-media new-main)(setf sub-media new-sub)(setf current-frame new-frame)))(defmacro get-current-main-media ()
`main-media)(defmacro get-current-sub-media ()
`sub-media)(defmacro get-current-frame-visual ()
`current-frame)(defmacro set-av1-media (lst)
`(setf av1-media ,lst))(defmacro set-av2-media (lst)
`(setf av2-media ,lst))(defmacro set-av3-media (lst)
`(setf av3-media ,lst))(defmacro set-scart-mute-media (lst)
`(setf scart-mute-media ,lst))(defun set-qlink (dev mode)(when (and tvp-dev dev mode)(setf qlink-dev dev)(setf qlink-mode mode)(set-scart-media main-media)(scart-mute-all)(tvp-load tvp-dev)(set-scart-dev main-media sub-media)(tvp-sync tvp-dev)(scart-unmute-all)))(defun set-tv-media (key)(unless (eq tv-media key)(if (or (eq tv-media main-media)(eq tv-media sub-media))(setf tv-media key)(setf tv-media key)(set-qlink qlink-dev qlink-mode))))(defvar swap-audio nil)(defun swap-audio-on ()(setf swap-audio t)(select-media main-media sub-media current-frame))(defun swap-audio-off ()(setf swap-audio nil)(select-media main-media sub-media current-frame))(defmacro check-mute (md dev)
`(and ,md ,dev (or (device-flag-setp ,dev USER-MUTE-FLAG) (device-flag-setp ,dev CP-MUTE-FLAG)(ref-cp ,md ,dev) (media-mute (get-media ,md)))))(defmacro check-unmute (md dev)
`(and ,md ,dev (not (device-flag-setp ,dev USER-MUTE-FLAG)) (not (device-flag-setp ,dev CP-MUTE-FLAG))(not (ref-cp ,md ,dev)) (not (media-mute (get-media ,md)))))(defun main-mute-all (md)(when (check-mute md main-ds-dev)(display-mute main-ds-dev))(if swap-audio
(when (check-mute md sub-hp-dev)(soundout-mute sub-hp-dev))(when (check-mute md main-sp-dev)(soundout-mute main-sp-dev))(when (check-mute md main-hp-dev)(soundout-mute main-hp-dev))(when (check-mute md main-optout-dev)(optical-output-mute main-optout-dev)))(when (check-mute md main-monout-dev)(monitorout-mute main-monout-dev)))(defun main-unmute-all (md)(when (check-unmute md main-ds-dev)(display-unmute main-ds-dev))(when (check-unmute md sub-hp-dev)(soundout-unmute sub-hp-dev))(when (check-unmute md main-sp-dev)(soundout-unmute main-sp-dev))(when (check-unmute md main-hp-dev)(soundout-unmute main-hp-dev))(when (check-unmute md main-optout-dev)(optical-output-unmute main-optout-dev))(when (check-unmute md main-monout-dev)(monitorout-unmute main-monout-dev)))(defun sub-mute-all (md)(when (check-mute md sub-ds-dev)(display-mute sub-ds-dev))(if swap-audio
(progn
(when (check-mute md main-sp-dev)(soundout-mute main-sp-dev))(when (check-mute md main-hp-dev)(soundout-mute main-hp-dev))(when (check-mute md main-optout-dev)(optical-output-mute main-optout-dev)))(when (check-mute md sub-hp-dev)(soundout-mute sub-hp-dev))))(defun sub-unmute-all (md)(when (check-unmute md sub-ds-dev)(display-unmute sub-ds-dev))(if swap-audio
(progn
(when (check-unmute md main-sp-dev)(soundout-unmute main-sp-dev))(when (check-unmute md main-hp-dev)(soundout-unmute main-hp-dev))(when (check-unmute md main-optout-dev)(optical-output-unmute main-optout-dev)))(when (check-unmute md sub-hp-dev)(soundout-unmute sub-hp-dev))))(defun scart-mute-all ()(when (or (check-mute scart0-media scart0-dev) (find scart0-media scart-mute-media))(monitorout-mute scart0-dev))(when (or (check-mute scart1-media scart1-dev) (find scart1-media scart-mute-media))(monitorout-mute scart1-dev))(when (or (check-mute scart2-media scart2-dev) (find scart2-media scart-mute-media))(monitorout-mute scart2-dev)))(defun scart-unmute-all ()(when (and (check-unmute scart0-media scart0-dev) (not (find scart0-media scart-mute-media)))(monitorout-unmute scart0-dev))(when (and (check-unmute scart1-media scart1-dev) (not (find scart1-media scart-mute-media)))(monitorout-unmute scart1-dev))(when (and (check-unmute scart2-media scart2-dev) (not (find scart2-media scart-mute-media)))(monitorout-unmute scart2-dev)))(defun qlink-media (md)(if (eq qlink-mode 'tv)(progn
tv-media)(if (eq qlink-mode 'av1)(progn
(car av1-media))(if (eq qlink-mode 'av2)(progn
(car av2-media))(if (eq qlink-mode 'av3)(progn
(car av3-media))(if (or (and (eq qlink-dev scart0-dev)(find md av1-media))(and (eq qlink-dev scart1-dev)(find md av2-media))(and (eq qlink-dev scart2-dev)(find md av3-media)))(progn
tv-media)
md))))))(defun set-scart-media (new-main)(when (and scart0-dev new-main)(setf scart0-media (if (eq scart0-dev qlink-dev)(qlink-media new-main)
tv-media)))(when (and scart1-dev new-main)(setf scart1-media (if (eq scart1-dev qlink-dev)(qlink-media new-main)
tv-media)))(when (and scart2-dev new-main)(setf scart2-media (if (eq scart2-dev qlink-dev)(qlink-media new-main)
tv-media))))(defun set-scart-dev (new-main new-sub)(let ((prop) (sync-prop))(when (or new-main new-sub)(setf sync-prop (monitorout-property mo-prop))(setf (mo-prop-asrc-sync-mode sync-prop) 0)(setf (mo-prop-vsrc-sync-mode sync-prop) 0)(when (and scart0-dev scart0-media)(setf prop (media-monitorout (get-media scart0-media)))(monitorout-set scart0-dev prop)(monitorout-set scart0-dev sync-prop))(when (and scart1-dev scart1-media)(setf prop (media-monitorout (get-media scart1-media)))(monitorout-set scart1-dev prop)(monitorout-set scart1-dev sync-prop))(when (and scart2-dev scart2-media)(setf prop (media-monitorout (get-media scart2-media)))(monitorout-set scart2-dev prop)(monitorout-set scart2-dev sync-prop)))))
