From 0071296532d7c7edd101543a2119360b43af113a Mon Sep 17 00:00:00 2001 From: Dave Rice Date: Thu, 25 Jul 2024 09:57:27 -0700 Subject: [PATCH 1/2] add commander cable control option --- Resources/vrecord_functions | 1 + vrecord | 216 +++++++++++++++++++++++++----------- 2 files changed, 152 insertions(+), 65 deletions(-) diff --git a/Resources/vrecord_functions b/Resources/vrecord_functions index cb5e1ac2..e85444c0 100644 --- a/Resources/vrecord_functions +++ b/Resources/vrecord_functions @@ -59,6 +59,7 @@ _update_config_file(){ echo "NTSC_169_SAR_CHOICE=\"${NTSC_169_SAR_CHOICE}\"" echo "PAL_43_SAR_CHOICE=\"${PAL_43_SAR_CHOICE}\"" echo "PAL_169_SAR_CHOICE=\"${PAL_169_SAR_CHOICE}\"" + echo "DECK_CONTROL_CHOICE=\"${DECK_CONTROL_CHOICE}\"" echo "AUDIO_MAPPING_CHOICE=\"${AUDIO_MAPPING_CHOICE}\"" echo "TIMECODE_CHOICE=\"${TIMECODE_CHOICE}\"" echo "STANDARD_CHOICE=\"${STANDARD_CHOICE}\"" diff --git a/vrecord b/vrecord index 3ef2459c..7e759159 100755 --- a/vrecord +++ b/vrecord @@ -709,9 +709,13 @@ _set_up_edit_form() { } # initialize deckcontrol temp files +if [[ -n "$(which sony9pin)" ]] ; then + SONY9PIN_DEVICE_ID="$( (sony9pin > /dev/null) 2>&1 | grep "A10K" | head -n 1 | cut -d ":" -f 1 | sed 's| ||g')" +fi FFMPEG_STATUS_TMP="$(_maketemp .ffmpeg.status.txt)" DECKCONTROL_STATUS_TMP="$(_maketemp .deckcontrol.status.txt)" DECKCONTROL_TIMECODE_TMP="$(_maketemp .deckcontrol.timecode.txt)" +DECKCONTROL_TIMECODE_TMP2="$(_maketemp .deckcontrol.timecode2.txt)" DVRESCUE_STATUS_TMP="$(_maketemp .dvrescue.status.txt)" echo "" > "${FFMPEG_STATUS_TMP}" echo "disabled" > "$DECKCONTROL_STATUS_TMP" @@ -751,7 +755,7 @@ PLAYBACK_OPT_GUI=" OPTIONAL_TOOLS_GUI=$(cat << CONFIG_FORM - + $(_gtk_vbox_list "WAVEFORM_SCALE_CHOICE" "100" "Select Waveform Scale" "${WAVEFORM_SCALE_OPTIONS[@]}") @@ -789,6 +793,16 @@ OPTIONAL_TOOLS_GUI=$(cat << CONFIG_FORM + + + + + + + $(_gtk_vbox_list "DECK_CONTROL_CHOICE" "-1" "deckcontrol" "${DECK_CONTROL_OPTIONS[@]}") + + + @@ -928,6 +942,137 @@ _get_deckcontrol_button(){ fi } +_get_deckcontrol_interface(){ + DECK_CONTROL_CHOICE="${1}" + if [[ "${DECK_CONTROL_CHOICE}" == "deckcontrol" ]] ; then + echo " + + + + + + decklink_status + \"${DECKCONTROL_STATUS_TMP}\" + + + + + + + + decklink_timecode + \"${DECKCONTROL_TIMECODE_TMP}\" + + + + + deckcontrol_timer + disabled + { deckcontrol getcurrentstate | grep \"state:\|detect\" | sed \"s/VTR control state: //g\" > \"${DECKCONTROL_STATUS_TMP}\" ; deckcontrol gettimecode | grep \"TC=\" | cut -c 4- > \"${DECKCONTROL_TIMECODE_TMP}\" ; } & + refresh:decklink_status + refresh:decklink_timecode + + + + + false + deckcontrol_toggle + + if true enable:deckcontrol_timer + if true enable:decklink_status + if true enable:decklink_timecode + if true enable:deckcontrol_rewind + if true enable:deckcontrol_prev + if true enable:deckcontrol_play + if true enable:deckcontrol_stop + if true enable:deckcontrol_next + if true enable:deckcontrol_ff + if true enable:deckcontrol_eject + if false disable:deckcontrol_timer + if false disable:decklink_status + if false disable:decklink_timecode + if false disable:deckcontrol_rewind + if false disable:deckcontrol_prev + if false disable:deckcontrol_play + if false disable:deckcontrol_stop + if false disable:deckcontrol_next + if false disable:deckcontrol_ff + if false disable:deckcontrol_eject + + $(_get_deckcontrol_button "deckcontrol_rewind" "gtk-media-rewind" "Rewind" "deckcontrol rewind") + $(_get_deckcontrol_button "deckcontrol_prev" "gtk-media-previous" "Step Back" "deckcontrol stepback") + $(_get_deckcontrol_button "deckcontrol_play" "gtk-media-play" "Play" "deckcontrol play") + $(_get_deckcontrol_button "deckcontrol_stop" "gtk-media-stop" "Stop" "deckcontrol stop") + $(_get_deckcontrol_button "deckcontrol_next" "gtk-media-next" "Step Fwd" "deckcontrol stepforward") + $(_get_deckcontrol_button "deckcontrol_ff" "gtk-media-forward" "FF" "deckcontrol fastforward") + $(_get_deckcontrol_button "deckcontrol_eject" "" "Eject" "deckcontrol eject") + " + elif [[ "${DECK_CONTROL_CHOICE}" == "sony9pin" && -n "${SONY9PIN_DEVICE_ID}" ]] ; then + echo " + + + + + + decklink_timecode + \"${DECKCONTROL_TIMECODE_TMP}\" + + + + + deckcontrol_timer2 + disabled + { (sony9pin \"${SONY9PIN_DEVICE_ID}\" 2 > /dev/null) 2>&1 | awk '{print \$2}' > \"${DECKCONTROL_TIMECODE_TMP}\" ; } & + refresh:decklink_timecode + + + + + + false + deckcontrol_toggle + + if true enable:rewind_report + if true enable:deckcontrol_timer + if true enable:deckcontrol_timer2 + if true enable:decklink_status + if true enable:decklink_timecode + if true enable:deckcontrol_rewind + if true enable:deckcontrol_prev + if true enable:deckcontrol_play + if true enable:deckcontrol_stop + if true enable:deckcontrol_next + if true enable:deckcontrol_ff + if true enable:deckcontrol_eject + if false disable:rewind_report + if false disable:deckcontrol_timer + if false disable:deckcontrol_timer2 + if false disable:decklink_status + if false disable:decklink_timecode + if false disable:deckcontrol_rewind + if false disable:deckcontrol_prev + if false disable:deckcontrol_play + if false disable:deckcontrol_stop + if false disable:deckcontrol_next + if false disable:deckcontrol_ff + if false disable:deckcontrol_eject + + $(_get_deckcontrol_button "deckcontrol_rewind" "gtk-media-rewind" "Rewind" "sony9pin ${SONY9PIN_DEVICE_ID} r") + $(_get_deckcontrol_button "deckcontrol_prev" "gtk-media-previous" "Step Back" "sony9pin ${SONY9PIN_DEVICE_ID} w") + $(_get_deckcontrol_button "deckcontrol_play" "gtk-media-play" "Play" "sony9pin ${SONY9PIN_DEVICE_ID} p") + $(_get_deckcontrol_button "deckcontrol_stop" "gtk-media-stop" "Stop" "sony9pin ${SONY9PIN_DEVICE_ID} s") + $(_get_deckcontrol_button "deckcontrol_next" "gtk-media-next" "Step Fwd" "sony9pin ${SONY9PIN_DEVICE_ID} x") + $(_get_deckcontrol_button "deckcontrol_ff" "gtk-media-forward" "FF" "sony9pin ${SONY9PIN_DEVICE_ID} f") + $(_get_deckcontrol_button "deckcontrol_eject" "" "Eject" "sony9pin ${SONY9PIN_DEVICE_ID} e") + " + fi +} + DECKLINK_INPUT_GUI=$(cat << DECKLINK_FORM @@ -954,70 +1099,10 @@ DECKLINK_INPUT_GUI=$(cat << DECKLINK_FORM ${PLAYBACK_OPT_GUI} ${SIDECAR_FILES_GUI} - - - - - - - decklink_status - "${DECKCONTROL_STATUS_TMP}" - - - - - - - - decklink_timecode - "${DECKCONTROL_TIMECODE_TMP}" - - - - deckcontrol_timer - disabled - { deckcontrol getcurrentstate | grep "state:\|detect" | sed "s/VTR control state: //g" > "${DECKCONTROL_STATUS_TMP}" ; deckcontrol gettimecode | grep "TC=" | cut -c 4- > "${DECKCONTROL_TIMECODE_TMP}" ; } & - refresh:decklink_status - refresh:decklink_timecode - - - - - - false - deckcontrol_toggle - - if true enable:deckcontrol_timer - if true enable:decklink_status - if true enable:decklink_timecode - if true enable:deckcontrol_rewind - if true enable:deckcontrol_prev - if true enable:deckcontrol_play - if true enable:deckcontrol_stop - if true enable:deckcontrol_next - if true enable:deckcontrol_ff - if true enable:deckcontrol_eject - if false disable:deckcontrol_timer - if false disable:decklink_status - if false disable:decklink_timecode - if false disable:deckcontrol_rewind - if false disable:deckcontrol_prev - if false disable:deckcontrol_play - if false disable:deckcontrol_stop - if false disable:deckcontrol_next - if false disable:deckcontrol_ff - if false disable:deckcontrol_eject - - - $(_get_deckcontrol_button "deckcontrol_rewind" "gtk-media-rewind" "Rewind" "deckcontrol rewind") - $(_get_deckcontrol_button "deckcontrol_prev" "gtk-media-previous" "Step Back" "deckcontrol stepback") - $(_get_deckcontrol_button "deckcontrol_play" "gtk-media-play" "Play" "deckcontrol play") - $(_get_deckcontrol_button "deckcontrol_stop" "gtk-media-stop" "Stop" "deckcontrol stop") - $(_get_deckcontrol_button "deckcontrol_next" "gtk-media-next" "Step Fwd" "deckcontrol stepforward") - $(_get_deckcontrol_button "deckcontrol_ff" "gtk-media-forward" "FF" "deckcontrol fastforward") - $(_get_deckcontrol_button "deckcontrol_eject" "" "Eject" "deckcontrol eject") - - + + + + $(_get_deckcontrol_interface "${DECK_CONTROL_CHOICE}") @@ -2338,6 +2423,7 @@ NTSC_43_SAR_OPTIONS=("10/11" "8/9" "9/10" "4320/4739") NTSC_169_SAR_OPTIONS=("40/33" "32/27" "6/5" "5760/4739") PAL_43_SAR_OPTIONS=("12/11" "16/15" "128/117") PAL_169_SAR_OPTIONS=("16/11" "64/45" "512/351") +DECK_CONTROL_OPTIONS=("deckcontrol" "sony9pin") CHANNEL_MAPPING_OPTIONS=("2 Stereo Tracks (Channels 1 & 2 -> 1st Track Stereo, Channels 3 & 4 -> 2nd Track Stereo)" "1 Stereo Track (From Channels 1 & 2)" "1 Stereo Track (From Channels 3 & 4)" "Channel 1 -> 1st Track Mono, Channel 2 -> 2nd Track Mono" "Channel 2 -> 1st Track Mono, Channel 1 -> 2nd Track Mono" "Channel 1 -> Single Track Mono" "Channel 2 -> Single Track Mono") TIMECODE_OPTIONS=("none" "rp188vitc" "rp188vitc2" "rp188ltc" "rp188any" "vitc" "vitc2" "serial") STANDARD_OPTIONS=("NTSC" "PAL") From 927049dd3f650f637e66d47bdb9c12af9ea3502d Mon Sep 17 00:00:00 2001 From: Dave Rice Date: Fri, 26 Jul 2024 11:09:42 -0700 Subject: [PATCH 2/2] send the rewind report to the terminal --- vrecord | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/vrecord b/vrecord index 7e759159..f827959f 100755 --- a/vrecord +++ b/vrecord @@ -1030,7 +1030,8 @@ _get_deckcontrol_interface(){ rewind_report disabled - sony9pin -c ${SONY9PIN_DEVICE_ID} r 1>&2 & >/dev/null + _update_config_file + rewind_report @@ -1569,6 +1570,12 @@ _edit_mode(){ RUNTYPE="audiopassthrough" elif [[ "${EXIT}" = "refresh" ]] ; then RUNTYPE="edit" + elif [[ "${EXIT}" = "rewind_report" ]] ; then + _report -dt "Gathering a rewind report. We'll rewind it while reporting on what the deck is saying." + _review_all_options + sony9pin -c ${SONY9PIN_DEVICE_ID} r + _report -dt "End of rewind report" + RUNTYPE="edit" elif [[ "${EXIT}" = "timecode_scan" ]] ; then _report -dt "Scanning each supported type of timecode." _review_all_options