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";
setActivePinia(pinia);
import { useStateStore } from "../store/stateStore.js";
const state = useStateStore(pinia);
import main_modals from "./main_modals.vue";
import main_top_navbar from "./main_top_navbar.vue";
import main_audio from "./main_audio.vue";

View file

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

View file

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

View file

@ -171,6 +171,14 @@ client.on("data", function (socketdata) {
stateStore.arq_state = data["arq_state"];
stateStore.mode = data["mode"];
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.ptt_state = data["ptt_state"];
stateStore.speed_level = data["speed_level"];

View file

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

View file

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