Skip to content

Commit

Permalink
fixed wideband chat
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvdb committed Feb 9, 2024
1 parent 46760ea commit b372f53
Show file tree
Hide file tree
Showing 30 changed files with 81 additions and 90 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
15 changes: 3 additions & 12 deletions wbchat.cs → ExtraFeatures/BATCWebchat/wbchat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,10 @@ private void Client_OnDisconnected(object sender, string e)

public static void AddItem(System.Windows.Forms.ListBox LB, Object obj)
{
if (LB == null)
{
return;
}

if (LB.InvokeRequired)
{
UpdateLBDelegate ulb = new UpdateLBDelegate(AddItem);

if (LB != null && !LB.Disposing && LB.IsDisposed)
LB.Invoke(ulb, new object[] { LB, obj });
}
else
Expand All @@ -122,7 +116,6 @@ public void updateTitle(wbchat frm, string new_title)
{
UpdateFormTitle ulb = new UpdateFormTitle(updateTitle);

if (frm != null && !frm.Disposing && frm.IsDisposed)
frm.Invoke(ulb, new object[] { frm, new_title });
}
else
Expand All @@ -139,8 +132,7 @@ public static void AddChat(RichTextBox rtb, string tstr, string nick, string msg
{
UpdateRTBDelegate ulb = new UpdateRTBDelegate(AddChat);

if (rtb != null && !rtb.Disposing && rtb.IsDisposed)
rtb.Invoke(ulb, new object[] { rtb, tstr, nick, msg });
rtb.Invoke(ulb, new object[] { rtb, tstr, nick, msg });
}
else
{
Expand Down Expand Up @@ -175,7 +167,6 @@ public static void ClearChat(RichTextBox rtb)
if (rtb.InvokeRequired)
{
ClearRTBDelegate crd = new ClearRTBDelegate(ClearChat);
if (rtb != null && !rtb.Disposing && rtb.IsDisposed)
rtb.Invoke(crd, new Object[] { rtb });
}
else
Expand All @@ -189,8 +180,7 @@ public static void ClearAll(System.Windows.Forms.ListBox LB, Object obj)
if (LB.InvokeRequired)
{
UpdateLBDelegate ulb = new UpdateLBDelegate(ClearAll);
if (LB != null && !LB.Disposing && LB.IsDisposed)
LB.Invoke(ulb, new object[] { LB, obj });
LB.Invoke(ulb, new object[] { LB, obj });
}
else
{
Expand Down Expand Up @@ -269,6 +259,7 @@ class chatMessage

private void Client_OnConnected(object sender, EventArgs e)
{
Console.WriteLine("Connected socketio");
lblConnected.Text = "Connected: True";
}

Expand Down
File renamed without changes.
40 changes: 20 additions & 20 deletions Form1.Designer.cs → MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

File renamed without changes.
File renamed without changes.
21 changes: 10 additions & 11 deletions Form1.cs → MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace opentuner
{
public partial class Form1 : Form
public partial class MainForm : Form
{
OTMediaPlayer media_player_1;
OTMediaPlayer media_player_2;
Expand All @@ -43,11 +43,11 @@ public partial class Form1 : Form

OTSource videoSource = new MinitiounerSource(0);

private delegate void updateNimStatusGuiDelegate(Form1 gui, TunerStatus new_status);
private delegate void updateTSStatusGuiDelegate(int device, Form1 gui, TSStatus new_status);
private delegate void updateMediaStatusGuiDelegate(int tuner, Form1 gui, MediaStatus new_status);
private delegate void updateNimStatusGuiDelegate(MainForm gui, TunerStatus new_status);
private delegate void updateTSStatusGuiDelegate(int device, MainForm gui, TSStatus new_status);
private delegate void updateMediaStatusGuiDelegate(int tuner, MainForm gui, MediaStatus new_status);
private delegate void UpdateLBDelegate(ListBox LB, Object obj);
private delegate void updateRecordingStatusDelegate(Form1 gui, bool recording_status, string id);
private delegate void updateRecordingStatusDelegate(MainForm gui, bool recording_status, string id);

Thread ts_parser_t = null;
Thread ts_parser_2_t = null;
Expand Down Expand Up @@ -82,7 +82,6 @@ public partial class Form1 : Form
public string prop_freq_carrier_offset { set { this.lblFreqCar.Text = value; } }
public string prop_db_margin { set { this.lbldbMargin.Text = value; } get { return this.lbldbMargin.Text; } }
public string prop_req_freq { set { this.lblReqFreq.Text = value; } }

public int prop_rf_input { set { this.lblRfInput.Text = (value == 1 ? "A" : "B"); } }

// tuner 2 properties
Expand Down Expand Up @@ -249,7 +248,7 @@ private async void SoftBlink(Control ctrl, Color c1, Color c2, short CycleTime_m
}
}

public static void updateRecordingStatus(Form1 gui, bool recording_status, string id)
public static void updateRecordingStatus(MainForm gui, bool recording_status, string id)
{
if (gui == null)
return;
Expand Down Expand Up @@ -300,7 +299,7 @@ private void debug(string msg)
UpdateLB(dbgListBox, msg);
}

public static void updateMediaStatusGui(int tuner, Form1 gui, MediaStatus new_status)
public static void updateMediaStatusGui(int tuner, MainForm gui, MediaStatus new_status)
{
if (gui == null)
return;
Expand Down Expand Up @@ -332,7 +331,7 @@ public static void updateMediaStatusGui(int tuner, Form1 gui, MediaStatus new_st
}


public static void updateTSStatusGui(int device, Form1 gui, TSStatus new_status)
public static void updateTSStatusGui(int device, MainForm gui, TSStatus new_status)
{
if (gui == null)
return;
Expand Down Expand Up @@ -364,7 +363,7 @@ public static void updateTSStatusGui(int device, Form1 gui, TSStatus new_status)

}

public void updateNimStatusGui(Form1 gui, TunerStatus new_status)
public void updateNimStatusGui(MainForm gui, TunerStatus new_status)
{
if (gui == null)
return;
Expand Down Expand Up @@ -530,7 +529,7 @@ public void updateNimStatusGui(Form1 gui, TunerStatus new_status)
}
}

public Form1()
public MainForm()
{

ThreadPool.GetMinThreads(out int workers, out int ports);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Form1.resx → MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3958,7 +3958,7 @@
<value>1723, 1196</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Open Tuner Test (ZR6TG) - 2024/02/06</value>
<value>Open Tuner (ZR6TG) - 0.9 - 2024/02/08</value>
</data>
<data name="&gt;&gt;autoTuneToolStripMenuItem.Name" xml:space="preserve">
<value>autoTuneToolStripMenuItem</value>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions MediaSources/Minitiouner/stv0910.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private byte stv0910_init_regs(bool EnableSerialTS)

if ( (val1 != 0x51) || (val2 != 0x20 ))
{
return errors.ERROR_DEMOD_INIT;
return Errors.ERROR_DEMOD_INIT;
}

// init all registers in the list
Expand Down Expand Up @@ -211,7 +211,7 @@ private byte stv0910_setup_clocks()
timeout++;
if (timeout == STV0910_PLL_LOCK_TIMEOUT)
{
err = errors.ERROR_DEMOD_PLL_TIMEOUT;
err = Errors.ERROR_DEMOD_PLL_TIMEOUT;
//printf("ERROR: STV0910 pll lock timeout\n");
}
if (err == 0) stv0910_read_reg_field(stv0910_regs.FSTV0910_PLLLOCK, ref _lock) ;
Expand Down Expand Up @@ -245,6 +245,7 @@ public byte stv0910_init(bool EnableSerialTS)
return err;
}

// setup receive of the demodulator
public byte stv0910_setup_receive(byte demod, UInt32 sr)
{
byte err = 0;
Expand Down Expand Up @@ -612,7 +613,7 @@ public byte stv0910_read_puncture_rate(byte demod, ref byte rate)
case STV0910_PUNCTURE_5_6: rate = 5; break;
case STV0910_PUNCTURE_6_7: rate = 6; break;
case STV0910_PUNCTURE_7_8: rate = 7; break;
default: err = errors.ERROR_VITERBI_PUNCTURE_RATE; break;
default: err = Errors.ERROR_VITERBI_PUNCTURE_RATE; break;
}

if (err != 0) Console.WriteLine("ERROR: STV0910 read puncture rate");
Expand Down
6 changes: 3 additions & 3 deletions MediaSources/Minitiouner/stv6120.cs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ byte stv6120_cal_lowpass(byte nimtuner)
timeout++;
if (timeout == STV6120_CAL_TIMEOUT)
{
err = errors.ERROR_TUNER_CAL_LOWPASS_TIMEOUT;
err = Errors.ERROR_TUNER_CAL_LOWPASS_TIMEOUT;
Console.WriteLine("ERROR: tuner wait on CAL_lowpass timed out\n");
}
} while ((err == 0) && ((val & (1 << stv6120_regs.STV6120_STAT1_CALRCSTRT_SHIFT)) == (1 << stv6120_regs.STV6120_STAT1_CALRCSTRT_SHIFT)));
Expand Down Expand Up @@ -591,7 +591,7 @@ byte stv6120_set_freq(byte nimtuner, UInt32 freq)
if ((err == 0) && (timeout == STV6120_CAL_TIMEOUT))
{
Console.WriteLine("ERROR: tuner wait on CAL timed out\n");
err = errors.ERROR_TUNER_CAL_TIMEOUT;
err = Errors.ERROR_TUNER_CAL_TIMEOUT;
}
}

Expand All @@ -616,7 +616,7 @@ byte stv6120_set_freq(byte nimtuner, UInt32 freq)
if ((err == 0) && (timeout == STV6120_CAL_TIMEOUT))
{
Console.WriteLine("ERROR: tuner wait on lock timed out: " + err.ToString() + "\n");
err = errors.ERROR_TUNER_LOCK_TIMEOUT;
err = Errors.ERROR_TUNER_LOCK_TIMEOUT;
}
}

Expand Down
4 changes: 2 additions & 2 deletions MediaSources/Minitiouner/stvvglna.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public byte stvvglna_read_agc(byte input, ref byte gain, ref byte vgo)
timeout++;
if ((err == 0) && (timeout == STVVGLNA_AGC_TIMEOUT))
{
err = errors.ERROR_LNA_AGC_TIMEOUT;
err = Errors.ERROR_LNA_AGC_TIMEOUT;
Console.WriteLine("Error: read AGC timeout\n");
}
}
Expand Down Expand Up @@ -111,7 +111,7 @@ public byte stvvglna_init(byte input, byte state, ref bool lna_ok)
if ((val & stvvglna_regs.STVVGLNA_REG0_IDENT_MASK) != stvvglna_regs.STVVGLNA_REG0_IDENT_DEFAULT)
{
Console.WriteLine("ERROR: failed to recognise LNA ID {0} {1}", input, val);
err = errors.ERROR_LNA_ID;
err = Errors.ERROR_LNA_ID;
}

if (state == STVVGLNA_ON)
Expand Down
2 changes: 1 addition & 1 deletion Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static void Main()

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Application.Run(new MainForm());
}
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion errors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace opentuner
{
static class errors
static class Errors
{
public const byte ERROR_NONE = 0;
public const byte ERROR_ARGS = 1;
Expand Down
Loading

0 comments on commit b372f53

Please sign in to comment.