diff --git a/src/dialogs/Viewer.cxx b/src/dialogs/Viewer.cxx index bd50bfd1..a36a80be 100644 --- a/src/dialogs/Viewer.cxx +++ b/src/dialogs/Viewer.cxx @@ -385,12 +385,12 @@ void viewer_redraw() brwsViewer->column_widths(cols); } -void viewaddchr(int ch, int freq, char c) +void viewaddchr(int ch, int freq, char c, int md) { if (!dlgViewer) return; if (progStatus.spot_recv) - spot_recv(c, ch, freq); + spot_recv(c, ch, freq, md); if (rfc != wf->rfcarrier() || usb != wf->USB()) viewer_redraw(); diff --git a/src/include/Viewer.h b/src/include/Viewer.h index 08015576..6847fa9f 100644 --- a/src/include/Viewer.h +++ b/src/include/Viewer.h @@ -20,7 +20,7 @@ extern Fl_Double_Window *dlgViewer; extern Fl_Double_Window* createViewer(); extern void openViewer(); -extern void viewaddchr(int ch, int freq, char c); +extern void viewaddchr(int ch, int freq, char c, int md); extern void initViewer(); extern void viewclearchannel(int ch); extern void viewer_paste_freq(int freq); diff --git a/src/include/spot.h b/src/include/spot.h index 1ae58336..b0e46f1c 100644 --- a/src/include/spot.h +++ b/src/include/spot.h @@ -35,7 +35,7 @@ typedef void (*spot_recv_cb_t)(trx_mode mode, int afreq, const char* str, const typedef void (*spot_log_cb_t)(const char* call, const char* loc, long long freq, trx_mode mode, time_t rtime, void* data); -void spot_recv(char c, int decoder = -1, int afreq = 0); +void spot_recv(char c, int decoder = -1, int afreq = 0, int md = 0); void spot_log(const char* callsign, const char* locator = "", long long freq = 0LL, trx_mode mode = NUM_MODES, time_t rtime = -1L); void spot_manual(const char* callsign, const char* locator = "", diff --git a/src/psk/viewpsk.cxx b/src/psk/viewpsk.cxx index 32d38aae..5592bc8c 100644 --- a/src/psk/viewpsk.cxx +++ b/src/psk/viewpsk.cxx @@ -151,7 +151,7 @@ void viewpsk::rx_bit(int ch, int bit) shreg[ch] = 0; if (c == '\n' || c == '\r') c = ' '; if (isprint(c)) { - REQ(&viewaddchr, ch, (int)frequency[ch], c); + REQ(&viewaddchr, ch, (int)frequency[ch], c, viewmode); timeout[ch] = now + progdefaults.VIEWERtimeout; } } diff --git a/src/spot/spot.cxx b/src/spot/spot.cxx index 295457d3..56aa35ce 100644 --- a/src/spot/spot.cxx +++ b/src/spot/spot.cxx @@ -66,15 +66,19 @@ static tr1::unordered_map buffers; static cblist_t cblist; static rcblist_t rcblist; -void spot_recv(char c, int decoder, int afreq) +void spot_recv(char c, int decoder, int afreq, int md) { static trx_mode last_mode = NUM_MODES + 1; - if (decoder == -1) // mode without multiple decoders + if (decoder == -1) { // mode without multiple decoders decoder = active_modem->get_mode(); - if (last_mode != active_modem->get_mode()) { + if (last_mode != active_modem->get_mode()) { + buffers.clear(); + last_mode = active_modem->get_mode(); + } + } else if (last_mode != md) { buffers.clear(); - last_mode = active_modem->get_mode(); + last_mode = md; } if (afreq == 0) afreq = active_modem->get_freq();