From e613b85829d675003477fdd53473ec8936c75fb7 Mon Sep 17 00:00:00 2001 From: lwvmobile Date: Wed, 21 Dec 2022 22:02:13 -0500 Subject: [PATCH] Lockout TG Audio Playback and Keyboard Shortcuts; --- src/dsd_mbe.c | 39 +++++++++++++++++++++++++++++++++------ src/dsd_ncurses.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 6 deletions(-) diff --git a/src/dsd_mbe.c b/src/dsd_mbe.c index e558c81..c30dd85 100644 --- a/src/dsd_mbe.c +++ b/src/dsd_mbe.c @@ -128,15 +128,39 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a for (i = 0; i < 88; i++) + { + imbe_d[i] = 0; + } + + for (i = 0; i < 49; i++) + { + ambe_d[i] = 0; + } + + //set playback mode for this frame + char mode[8]; + + //if we are using allow/whitelist mode, then write 'B' to mode for block + //comparison below will look for an 'A' to write to mode if it is allowed + if (opts->trunk_use_allow_list == 1) sprintf (mode, "%s", "B"); + + int groupNumber = 0; + + if (state->currentslot == 0) groupNumber = state->lasttg; + else groupNumber = state->lasttgR; + + for (i = 0; i < state->group_tally; i++) + { + if (state->group_array[i].groupNumber == groupNumber) { - imbe_d[i] = 0; + strcpy (mode, state->group_array[i].groupMode); } + } - for (i = 0; i < 49; i++) - { - ambe_d[i] = 0; - } + //set flag to not play audio this time, but won't prevent writing to wav files + if (strcmp(mode, "B") == 0) opts->audio_out = 0; + //end set playback mode for this frame if ((state->synctype == 0) || (state->synctype == 1)) { @@ -608,5 +632,8 @@ processMbeFrame (dsd_opts * opts, dsd_state * state, char imbe_fr[8][23], char a } } - + //reset audio out flag for next repitition + if (strcmp(mode, "B") == 0) opts->audio_out = 1; + //restore flag for null output type + if (opts->audio_out_type == 9) opts->audio_out = 0; } diff --git a/src/dsd_ncurses.c b/src/dsd_ncurses.c index 794a3c5..71938a1 100644 --- a/src/dsd_ncurses.c +++ b/src/dsd_ncurses.c @@ -3062,6 +3062,39 @@ if (c == 115) //'s' key, stop playing wav or symbol in files openPulseInput(opts); } +//Lockout bug in EDACS prevents any group from tuning when using this, not sure why yet +//WARNING! USE THESE WITH CAUTION! IF BREAKING ISSUES OBSERVED, THEN RESTART AND DON'T USE THEM!! +if (opts->frame_provoice != 1 && c == 49) //'1' key, lockout slot 1 or conventional tg from tuning/playback during session +{ + state->group_array[state->group_tally].groupNumber = state->lasttg; + sprintf (state->group_array[state->group_tally].groupMode, "%s", "B"); + sprintf (state->group_array[state->group_tally].groupName, "%s", "LOCKOUT"); + state->group_tally++; + + //test tuning away to break sync, if not working so well, then disable + //RIGCTL + if (opts->frame_provoice != 1 && opts->p25_is_tuned == 1 && opts->use_rigctl == 1) SetFreq(opts->rigctl_sockfd, 450000000); + + //rtl_udp + if (opts->frame_provoice != 1 && opts->p25_is_tuned == 1 && opts->audio_in_type == 3) rtl_udp_tune (opts, state, 450000000); + +} + +if (opts->frame_provoice != 1 && c == 50) //'2' key, lockout slot 2 tdma tgR from tuning/playback during session +{ + state->group_array[state->group_tally].groupNumber = state->lasttgR; + sprintf (state->group_array[state->group_tally].groupMode, "%s", "B"); + sprintf (state->group_array[state->group_tally].groupName, "%s", "LOCKOUT"); + state->group_tally++; + + //test tuning away to break sync, if not working so well, then disable + //RIGCTL + if (opts->p25_is_tuned == 1 && opts->use_rigctl == 1) SetFreq(opts->rigctl_sockfd, 450000000); + + //rtl_udp + if (opts->p25_is_tuned == 1 && opts->audio_in_type == 3) rtl_udp_tune (opts, state, 450000000); + +} //anything with an entry box will need the inputs and outputs stopped first //so probably just write a function to handle c input, and when c = certain values