Set default mic gain values to better (lower) values for most devices and make level meter more responsive during tx

pull/3/head
Doug McLain 3 years ago
parent 015b2a2637
commit e357125929

@ -431,12 +431,13 @@ Item {
y: (parent.height / rows + 1) * 3; y: (parent.height / rows + 1) * 3;
width: parent.width / 4; width: parent.width / 4;
height: parent.height / rows; height: parent.height / rows;
text: qsTr("Mic gain") text: qsTr("TX")
color: "white" color: "white"
font.pixelSize: parent.height / 30; font.pixelSize: parent.height / 30;
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
Slider { Slider {
property double v;
visible: true visible: true
id: _slidermicGain id: _slidermicGain
x: (parent.width / 4) + 10 x: (parent.width / 4) + 10
@ -445,7 +446,9 @@ Item {
height: parent.height / rows; height: parent.height / rows;
value: 0.5 value: 0.5
onValueChanged: { onValueChanged: {
v = value * 100;
droidstar.set_input_volume(value); droidstar.set_input_volume(value);
micgain_label.text = "TX " + v.toFixed(1);
} }
} }
Text { Text {

@ -1,5 +1,5 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<manifest package="org.dudetronics.droidstar" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="-- %%INSERT_VERSION_NAME%% --" android:versionCode="66" android:installLocation="auto"> <manifest package="org.dudetronics.droidstar" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="-- %%INSERT_VERSION_NAME%% --" android:versionCode="67" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30"/> <uses-sdk android:minSdkVersion="21" android:targetSdkVersion="30"/>
<!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application. <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.

@ -62,7 +62,6 @@ public:
bool get_hwtx() { return m_hwtx; } bool get_hwtx() { return m_hwtx; }
void set_hostname(std::string); void set_hostname(std::string);
void set_callsign(std::string); void set_callsign(std::string);
void set_input_src(uint8_t s, QString t) { m_ttsid = s; m_ttstext = t; }
struct MODEINFO { struct MODEINFO {
qint64 ts; qint64 ts;
int status; int status;

@ -514,7 +514,7 @@ void DCSCodec::send_frame(uint8_t *ambe)
} }
m_udp->writeDatagram(txdata, m_address, m_modeinfo.port); m_udp->writeDatagram(txdata, m_address, m_modeinfo.port);
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level() * 2);
update(m_modeinfo); update(m_modeinfo);
#ifdef DEBUG #ifdef DEBUG

@ -547,7 +547,7 @@ void DMRCodec::send_frame()
m_modeinfo.stream_state = STREAM_IDLE; m_modeinfo.stream_state = STREAM_IDLE;
} }
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level() * 8);
emit update(m_modeinfo); emit update(m_modeinfo);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "SEND:%d: ", txdata.size()); fprintf(stderr, "SEND:%d: ", txdata.size());

@ -42,7 +42,8 @@ DroidStar::DroidStar(QObject *parent) :
m_dmrid(0), m_dmrid(0),
m_essid(0), m_essid(0),
m_dmr_destid(0), m_dmr_destid(0),
m_outlevel(0) m_outlevel(0),
m_tts(0)
{ {
qRegisterMetaType<M17Codec::MODEINFO>("Codec::MODEINFO"); qRegisterMetaType<M17Codec::MODEINFO>("Codec::MODEINFO");
m_settings_processed = false; m_settings_processed = false;
@ -213,6 +214,9 @@ void DroidStar::tts_changed(QString tts)
else if(tts == "TTS3"){ else if(tts == "TTS3"){
m_tts = 3; m_tts = 3;
} }
else{
m_tts = 0;
}
emit input_source_changed(m_tts, m_ttstxt); emit input_source_changed(m_tts, m_ttstxt);
} }
@ -1623,7 +1627,7 @@ void DroidStar::update_nxdn_data(Codec::MODEINFO info)
if( (connect_status == Codec::CONNECTING) && ( info.status == Codec::CONNECTED_RW)){ if( (connect_status == Codec::CONNECTING) && ( info.status == Codec::CONNECTED_RW)){
connect_status = Codec::CONNECTED_RW; connect_status = Codec::CONNECTED_RW;
emit connect_status_changed(2); emit connect_status_changed(2);
emit in_audio_vol_changed(0.3); emit in_audio_vol_changed(0.1);
emit swtx_state(!m_nxdn->get_hwtx()); emit swtx_state(!m_nxdn->get_hwtx());
emit swrx_state(!m_nxdn->get_hwrx()); emit swrx_state(!m_nxdn->get_hwrx());
emit update_log("Connected to " + m_protocol + " " + m_host + " " + m_hostname + ":" + QString::number(m_port)); emit update_log("Connected to " + m_protocol + " " + m_host + " " + m_hostname + ":" + QString::number(m_port));
@ -1704,7 +1708,7 @@ void DroidStar::update_dmr_data(Codec::MODEINFO info)
if( (connect_status == Codec::CONNECTING) && ( info.status == Codec::CONNECTED_RW)){ if( (connect_status == Codec::CONNECTING) && ( info.status == Codec::CONNECTED_RW)){
connect_status = Codec::CONNECTED_RW; connect_status = Codec::CONNECTED_RW;
emit connect_status_changed(2); emit connect_status_changed(2);
emit in_audio_vol_changed(0.3); emit in_audio_vol_changed(0.1);
emit swtx_state(!m_dmr->get_hwtx()); emit swtx_state(!m_dmr->get_hwtx());
emit swrx_state(!m_dmr->get_hwrx()); emit swrx_state(!m_dmr->get_hwrx());
emit update_log("Connected to " + m_protocol + " " + m_host + " " + m_hostname + ":" + QString::number(m_port)); emit update_log("Connected to " + m_protocol + " " + m_host + " " + m_hostname + ":" + QString::number(m_port));
@ -1789,7 +1793,7 @@ void DroidStar::update_ysf_data(Codec::MODEINFO info)
if( (connect_status == Codec::CONNECTING) && (info.status == Codec::CONNECTED_RW)){ if( (connect_status == Codec::CONNECTING) && (info.status == Codec::CONNECTED_RW)){
connect_status = Codec::CONNECTED_RW; connect_status = Codec::CONNECTED_RW;
emit connect_status_changed(2); emit connect_status_changed(2);
emit in_audio_vol_changed(0.2); emit in_audio_vol_changed(0.1);
emit swtx_state(!m_ysf->get_hwtx()); emit swtx_state(!m_ysf->get_hwtx());
emit swrx_state(!m_ysf->get_hwrx()); emit swrx_state(!m_ysf->get_hwrx());
emit update_log("Connected to " + m_protocol + " " + m_host + " " + m_hostname + ":" + QString::number(m_port)); emit update_log("Connected to " + m_protocol + " " + m_host + " " + m_hostname + ":" + QString::number(m_port));
@ -1877,7 +1881,7 @@ void DroidStar::update_p25_data(Codec::MODEINFO info)
if( (connect_status == Codec::CONNECTING) && (info.status == Codec::CONNECTED_RW)){ if( (connect_status == Codec::CONNECTING) && (info.status == Codec::CONNECTED_RW)){
connect_status = Codec::CONNECTED_RW; connect_status = Codec::CONNECTED_RW;
emit connect_status_changed(2); emit connect_status_changed(2);
emit in_audio_vol_changed(0.3); emit in_audio_vol_changed(0.2);
emit swtx_state(!m_p25->get_hwtx()); emit swtx_state(!m_p25->get_hwtx());
emit swrx_state(!m_p25->get_hwrx()); emit swrx_state(!m_p25->get_hwrx());
emit update_log("Connected to " + m_protocol + " " + m_host + " " + m_hostname + ":" + QString::number(m_port)); emit update_log("Connected to " + m_protocol + " " + m_host + " " + m_hostname + ":" + QString::number(m_port));

@ -261,8 +261,8 @@ public slots:
void url_downloaded(QString); void url_downloaded(QString);
unsigned short get_output_level(){ return m_outlevel; } unsigned short get_output_level(){ return m_outlevel; }
void set_output_level(unsigned short l){ m_outlevel = l; } void set_output_level(unsigned short l){ m_outlevel = l; }
void tts_changed(QString); // { m_tts = tts; }; void tts_changed(QString);
void tts_text_changed(QString); // { m_ttstxt = ttstxt; }; void tts_text_changed(QString);
private: private:
int connect_status; int connect_status;
bool m_update_host_files; bool m_update_host_files;

@ -35,7 +35,6 @@ public:
QString get_host() { return m_host; } QString get_host() { return m_host; }
int get_port() { return m_port; } int get_port() { return m_port; }
int get_cnt() { return m_cnt; } int get_cnt() { return m_cnt; }
void set_input_src(uint8_t s, QString t) { m_ttsid = s; m_ttstext = t; }
signals: signals:
void update(); void update();
void update_output_level(unsigned short); void update_output_level(unsigned short);

@ -772,7 +772,7 @@ void M17Codec::transmit()
} }
txframe.clear(); txframe.clear();
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level() * 2);
int r = get_mode() ? 0x05 : 0x07; int r = get_mode() ? 0x05 : 0x07;
if(m_tx){ if(m_tx){

@ -249,7 +249,7 @@ ApplicationWindow {
mainTab.dmrtgidEdit.visible = false; mainTab.dmrtgidEdit.visible = false;
mainTab.comboM17CAN.visible = false; mainTab.comboM17CAN.visible = false;
mainTab.privateBox.visible = false; mainTab.privateBox.visible = false;
mainTab.sliderMicGain.value = 0.2; mainTab.sliderMicGain.value = 0.1;
} }
if(droidstar.get_mode() === "FCS"){ if(droidstar.get_mode() === "FCS"){
//mainTab.comboMode.width = mainTab.width / 2; //mainTab.comboMode.width = mainTab.width / 2;
@ -264,7 +264,7 @@ ApplicationWindow {
mainTab.dmrtgidEdit.visible = false; mainTab.dmrtgidEdit.visible = false;
mainTab.comboM17CAN.visible = false; mainTab.comboM17CAN.visible = false;
mainTab.privateBox.visible = false; mainTab.privateBox.visible = false;
mainTab.sliderMicGain.value = 0.2; mainTab.sliderMicGain.value = 0.1;
} }
if(droidstar.get_mode() === "DMR"){ if(droidstar.get_mode() === "DMR"){
//mainTab.comboMode.width = (mainTab.width / 5) - 5; //mainTab.comboMode.width = (mainTab.width / 5) - 5;
@ -280,7 +280,7 @@ ApplicationWindow {
mainTab.dmrtgidEdit.visible = true; mainTab.dmrtgidEdit.visible = true;
mainTab.comboM17CAN.visible = false; mainTab.comboM17CAN.visible = false;
mainTab.privateBox.visible = true; mainTab.privateBox.visible = true;
mainTab.sliderMicGain.value = 0.3; mainTab.sliderMicGain.value = 0.1;
} }
if(droidstar.get_mode() === "P25"){ if(droidstar.get_mode() === "P25"){
//mainTab.comboMode.width = mainTab.width / 2; //mainTab.comboMode.width = mainTab.width / 2;
@ -296,7 +296,7 @@ ApplicationWindow {
mainTab.dmrtgidEdit.visible = true; mainTab.dmrtgidEdit.visible = true;
mainTab.comboM17CAN.visible = false; mainTab.comboM17CAN.visible = false;
mainTab.privateBox.visible = false; mainTab.privateBox.visible = false;
mainTab.sliderMicGain.value = 0.3; mainTab.sliderMicGain.value = 0.2;
} }
if(droidstar.get_mode() === "NXDN"){ if(droidstar.get_mode() === "NXDN"){
//mainTab.comboMode.width = mainTab.width / 2; //mainTab.comboMode.width = mainTab.width / 2;
@ -311,7 +311,7 @@ ApplicationWindow {
mainTab.dmrtgidEdit.visible = false; mainTab.dmrtgidEdit.visible = false;
mainTab.comboM17CAN.visible = false; mainTab.comboM17CAN.visible = false;
mainTab.privateBox.visible = false; mainTab.privateBox.visible = false;
mainTab.sliderMicGain.value = 0.3; mainTab.sliderMicGain.value = 0.1;
} }
if(droidstar.get_mode() === "M17"){ if(droidstar.get_mode() === "M17"){
//mainTab.comboMode.width = mainTab.width / 2; //mainTab.comboMode.width = mainTab.width / 2;

@ -363,7 +363,7 @@ void NXDNCodec::send_frame()
m_modeinfo.srcid = m_nxdnid; m_modeinfo.srcid = m_nxdnid;
m_modeinfo.frame_number = m_txcnt; m_modeinfo.frame_number = m_txcnt;
m_modeinfo.dstid = m_modeinfo.gwid; m_modeinfo.dstid = m_modeinfo.gwid;
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level() * 8);
emit update(m_modeinfo); emit update(m_modeinfo);
} }

@ -402,7 +402,7 @@ void P25Codec::transmit()
m_modeinfo.frame_number = 0; m_modeinfo.frame_number = 0;
m_txcodecq.clear(); m_txcodecq.clear();
} }
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level() * 6);
emit update(m_modeinfo); emit update(m_modeinfo);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "SEND: "); fprintf(stderr, "SEND: ");

@ -619,7 +619,7 @@ void REFCodec::send_frame(uint8_t *ambe)
} }
m_udp->writeDatagram(txdata, m_address, m_modeinfo.port); m_udp->writeDatagram(txdata, m_address, m_modeinfo.port);
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level() * 2);
emit update(m_modeinfo); emit update(m_modeinfo);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "SEND:%d: ", txdata.size()); fprintf(stderr, "SEND:%d: ", txdata.size());

@ -552,7 +552,7 @@ void XRFCodec::send_frame(uint8_t *ambe)
} }
m_udp->writeDatagram(txdata, m_address, m_modeinfo.port); m_udp->writeDatagram(txdata, m_address, m_modeinfo.port);
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level() * 2);
update(m_modeinfo); update(m_modeinfo);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "SEND:%d: ", txdata.size()); fprintf(stderr, "SEND:%d: ", txdata.size());

@ -763,7 +763,7 @@ void YSFCodec::send_frame()
m_udp->writeDatagram(txdata, m_address, m_modeinfo.port); m_udp->writeDatagram(txdata, m_address, m_modeinfo.port);
m_modeinfo.stream_state = STREAM_IDLE; m_modeinfo.stream_state = STREAM_IDLE;
} }
emit update_output_level(m_audio->level()); emit update_output_level(m_audio->level() * 8);
emit update(m_modeinfo); emit update(m_modeinfo);
} }

Loading…
Cancel
Save