@@ -167,6 +167,10 @@ static void usage (void);
167
167
168
168
static int decode_only = 0 ; /* Set to 0 or 1 to decode only one channel. 2 for both. */
169
169
170
+ static int sample_number = -1 ; /* Sample number from the file. */
171
+ /* Incremented only for channel 0. */
172
+ /* Use to print timestamp, relative to beginning */
173
+ /* of file, when frame was decoded. */
170
174
171
175
int main (int argc , char * argv [])
172
176
{
@@ -495,6 +499,8 @@ int main (int argc, char *argv[])
495
499
if (audio_sample >= 256 * 256 )
496
500
e_o_f = 1 ;
497
501
502
+ if (c == 0 ) sample_number ++ ;
503
+
498
504
if (decode_only == 0 && c != 0 ) continue ;
499
505
if (decode_only == 1 && c != 1 ) continue ;
500
506
@@ -572,16 +578,16 @@ int audio_get (int a)
572
578
573
579
void rdq_append (rrbb_t rrbb )
574
580
{
575
- int chan ;
581
+ int chan , subchan , slice ;
576
582
alevel_t alevel ;
577
- int subchan ;
578
583
579
584
580
585
chan = rrbb_get_chan (rrbb );
581
586
subchan = rrbb_get_subchan (rrbb );
587
+ slice = rrbb_get_slice (rrbb );
582
588
alevel = rrbb_get_audio_level (rrbb );
583
589
584
- hdlc_rec2_try_to_fix_later (rrbb , chan , subchan , alevel );
590
+ hdlc_rec2_try_to_fix_later (rrbb , chan , subchan , slice , alevel );
585
591
rrbb_delete (rrbb );
586
592
}
587
593
@@ -590,7 +596,7 @@ void rdq_append (rrbb_t rrbb)
590
596
* This is called when we have a good frame.
591
597
*/
592
598
593
- void dlq_append (dlq_type_t type , int chan , int subchan , packet_t pp , alevel_t alevel , retry_t retries , char * spectrum )
599
+ void dlq_append (dlq_type_t type , int chan , int subchan , int slice , packet_t pp , alevel_t alevel , retry_t retries , char * spectrum )
594
600
{
595
601
596
602
char stemp [500 ];
@@ -627,6 +633,15 @@ void dlq_append (dlq_type_t type, int chan, int subchan, packet_t pp, alevel_t a
627
633
text_color_set (DW_COLOR_DEBUG );
628
634
dw_printf ("\n" );
629
635
dw_printf ("DECODED[%d] " , packets_decoded );
636
+
637
+ /* Insert time stamp relative to start of file. */
638
+
639
+ double sec = (double )sample_number / my_audio_config .adev [0 ].samples_per_sec ;
640
+ int min = (int )(sec / 60. );
641
+ sec -= min * 60 ;
642
+
643
+ dw_printf ("%d:%07.4f " , min , sec );
644
+
630
645
if (h != AX25_SOURCE ) {
631
646
dw_printf ("Digipeater " );
632
647
}
@@ -641,27 +656,38 @@ void dlq_append (dlq_type_t type, int chan, int subchan, packet_t pp, alevel_t a
641
656
642
657
#endif
643
658
644
- #if defined(EXPERIMENT_G ) || defined(EXPERIMENT_H )
645
- int j ;
646
-
647
- for (j = 0 ; j < MAX_SUBCHANS ; j ++ ) {
648
- if (spectrum [j ] == '|' ) {
649
- count [j ]++ ;
650
- }
651
- }
652
- #endif
659
+ // #if defined(EXPERIMENT_G) || defined(EXPERIMENT_H)
660
+ // int j;
661
+ //
662
+ // for (j=0; j<MAX_SUBCHANS; j++) {
663
+ // if (spectrum[j] == '|') {
664
+ // count[j]++;
665
+ // }
666
+ // }
667
+ // #endif
653
668
654
669
655
670
// Display non-APRS packets in a different color.
656
671
657
- // TODO: display subchannel if appropriate .
672
+ // Display channel with subchannel/slice if applicable .
658
673
659
674
if (ax25_is_aprs (pp )) {
660
675
text_color_set (DW_COLOR_REC );
661
- dw_printf ("[%d] " , chan );
662
676
}
663
677
else {
664
678
text_color_set (DW_COLOR_DEBUG );
679
+ }
680
+
681
+ if (my_audio_config .achan [chan ].num_subchan > 1 && my_audio_config .achan [chan ].num_slicers == 1 ) {
682
+ dw_printf ("[%d.%d] " , chan , subchan );
683
+ }
684
+ else if (my_audio_config .achan [chan ].num_subchan == 1 && my_audio_config .achan [chan ].num_slicers > 1 ) {
685
+ dw_printf ("[%d.%d] " , chan , slice );
686
+ }
687
+ else if (my_audio_config .achan [chan ].num_subchan > 1 && my_audio_config .achan [chan ].num_slicers > 1 ) {
688
+ dw_printf ("[%d.%d.%d] " , chan , subchan , slice );
689
+ }
690
+ else {
665
691
dw_printf ("[%d] " , chan );
666
692
}
667
693
@@ -671,7 +697,7 @@ void dlq_append (dlq_type_t type, int chan, int subchan, packet_t pp, alevel_t a
671
697
672
698
ax25_delete (pp );
673
699
674
- } /* end app_process_rec_packet */
700
+ } /* end fake dlq_append */
675
701
676
702
677
703
void ptt_set (int ot , int chan , int ptt_signal )
0 commit comments