set tx audio level

This commit is contained in:
DJ2LS 2023-10-26 11:19:21 +02:00
parent fc76844362
commit c299c3e82b
6 changed files with 23 additions and 8 deletions

View file

@ -3,9 +3,6 @@ import { setActivePinia } from "pinia";
import pinia from "../store/index"; import pinia from "../store/index";
setActivePinia(pinia); setActivePinia(pinia);
import { useStateStore } from "../store/stateStore.js";
const state = useStateStore(pinia);
import main_modals from "./main_modals.vue"; import main_modals from "./main_modals.vue";
import main_top_navbar from "./main_top_navbar.vue"; import main_top_navbar from "./main_top_navbar.vue";
import main_audio from "./main_audio.vue"; import main_audio from "./main_audio.vue";

View file

@ -4,6 +4,7 @@
import { setActivePinia } from "pinia"; import { setActivePinia } from "pinia";
import pinia from "../store/index"; import pinia from "../store/index";
setActivePinia(pinia); setActivePinia(pinia);
import { saveSettingsToFile } from "../js/settingsHandler";
import { useStateStore } from "../store/stateStore.js"; import { useStateStore } from "../store/stateStore.js";
const state = useStateStore(pinia); const state = useStateStore(pinia);
@ -11,6 +12,10 @@ const state = useStateStore(pinia);
import { useChatStore } from "../store/chatStore.js"; import { useChatStore } from "../store/chatStore.js";
const chat = useChatStore(pinia); const chat = useChatStore(pinia);
import { useSettingsStore } from "../store/settingsStore.js";
const settings = useSettingsStore(pinia);
import { import {
deleteChatByCallsign, deleteChatByCallsign,
getNewMessagesByDXCallsign, getNewMessagesByDXCallsign,
@ -23,7 +28,8 @@ function tuneAudio() {
} }
function set_audio_level() { function set_audio_level() {
setTxAudioLevel(state.audio_level); saveSettingsToFile()
setTxAudioLevel(settings.tx_audio_level);
} }
function deleteChat() { function deleteChat() {
@ -1194,7 +1200,7 @@ const transmissionSpeedChartDataMessageInfo = computed(() => ({
</div> </div>
<div class="input-group input-group-sm mb-1"> <div class="input-group input-group-sm mb-1">
<span class="input-group-text">TX Level</span> <span class="input-group-text">TX Level</span>
<span class="input-group-text">{{ state.audio_level }}</span> <span class="input-group-text">{{ settings.tx_audio_level }}</span>
<span class="input-group-text w-75"> <span class="input-group-text w-75">
<input <input
type="range" type="range"
@ -1204,7 +1210,7 @@ const transmissionSpeedChartDataMessageInfo = computed(() => ({
step="1" step="1"
id="audioLevelTX" id="audioLevelTX"
@click="set_audio_level()" @click="set_audio_level()"
v-model="state.audio_level" v-model="settings.tx_audio_level "
/></span> /></span>
</div> </div>
</div> </div>

View file

@ -55,6 +55,7 @@ const configDefaultSettings =
"daemon_port": 3001,\ "daemon_port": 3001,\
"rx_audio" : "",\ "rx_audio" : "",\
"tx_audio" : "",\ "tx_audio" : "",\
"tx_audio_level" : 100,\
"mycall": "AA0AA-0",\ "mycall": "AA0AA-0",\
"myssid": "0",\ "myssid": "0",\
"mygrid": "JN40aa",\ "mygrid": "JN40aa",\

View file

@ -171,6 +171,14 @@ client.on("data", function (socketdata) {
stateStore.arq_state = data["arq_state"]; stateStore.arq_state = data["arq_state"];
stateStore.mode = data["mode"]; stateStore.mode = data["mode"];
stateStore.bandwidth = data["bandwidth"]; stateStore.bandwidth = data["bandwidth"];
stateStore.tx_audio_level = data["audio_level"];
// if audio level is different from config one, send new audio level to modem
if (parseInt(stateStore.audio_level) !== parseInt(settings.tx_audio_level)){
setTxAudioLevel(settings.tx_audio_level);
}
stateStore.dbfs_level = data["audio_dbfs"]; stateStore.dbfs_level = data["audio_dbfs"];
stateStore.ptt_state = data["ptt_state"]; stateStore.ptt_state = data["ptt_state"];
stateStore.speed_level = data["speed_level"]; stateStore.speed_level = data["speed_level"];

View file

@ -5,6 +5,7 @@ export const useSettingsStore = defineStore("settingsStore", () => {
// audio // audio
var tx_audio = ref(); var tx_audio = ref();
var rx_audio = ref(); var rx_audio = ref();
var tx_audio_level = ref();
// network // network
var modem_host = ref("127.0.0.1"); var modem_host = ref("127.0.0.1");
@ -157,6 +158,7 @@ export const useSettingsStore = defineStore("settingsStore", () => {
enable_mesh_features: enable_mesh_features.value, enable_mesh_features: enable_mesh_features.value,
tx_audio: tx_audio.value, tx_audio: tx_audio.value,
rx_audio: rx_audio.value, rx_audio: rx_audio.value,
tx_audio_level: tx_audio_level.value,
}; };
return config_export; return config_export;
@ -224,5 +226,6 @@ export const useSettingsStore = defineStore("settingsStore", () => {
rx_audio, rx_audio,
getSerialDevices, getSerialDevices,
serial_devices, serial_devices,
tx_audio_level,
}; };
}); });

View file

@ -40,7 +40,7 @@ export const useStateStore = defineStore("stateStore", () => {
var audio_recording = ref(""); var audio_recording = ref("");
var hamlib_status = ref(""); var hamlib_status = ref("");
var audio_level = ref(""); var tx_audio_level = ref("");
var alc = ref(""); var alc = ref("");
var is_codec2_traffic = ref(""); var is_codec2_traffic = ref("");
@ -158,7 +158,7 @@ export const useStateStore = defineStore("stateStore", () => {
arq_total_bytes, arq_total_bytes,
audio_recording, audio_recording,
hamlib_status, hamlib_status,
audio_level, tx_audio_level,
alc, alc,
updateTncState, updateTncState,
arq_transmission_percent, arq_transmission_percent,