@@ -109,10 +109,10 @@ static const char* http_nocache = "Cache-Control: no-cache\r\n";
109
109
110
110
static string to_hex (uint32_t value, int width)
111
111
{
112
- std:: stringstream sidstream;
112
+ stringstream sidstream;
113
113
sidstream << " 0x" <<
114
- std:: setfill (' 0' ) << std:: setw (width) <<
115
- std:: hex << value;
114
+ setfill (' 0' ) << setw (width) <<
115
+ hex << value;
116
116
return sidstream.str ();
117
117
}
118
118
@@ -191,7 +191,7 @@ void WebRadioInterface::check_decoders_required()
191
191
const auto sid = s.serviceId ;
192
192
193
193
try {
194
- const bool is_active = std:: find_if (
194
+ const bool is_active = find_if (
195
195
carousel_services_active.cbegin (),
196
196
carousel_services_active.cend (),
197
197
[&](const ActiveCarouselService& acs) {
@@ -244,7 +244,7 @@ void WebRadioInterface::check_decoders_required()
244
244
phs_changed.notify_all ();
245
245
}
246
246
247
- void WebRadioInterface::retune (const std:: string& channel)
247
+ void WebRadioInterface::retune (const string& channel)
248
248
{
249
249
// Ensure two closely occurring retune() calls don't get stuck
250
250
unique_lock<mutex> retune_lock (retune_mut);
@@ -423,7 +423,7 @@ static http_request_t parse_http_headers(Socket& s) {
423
423
constexpr auto CL = " Content-Length" ;
424
424
if (r.headers .count (CL) == 1 ) {
425
425
try {
426
- const int content_length = std:: stoi (r.headers [CL]);
426
+ const int content_length = stoi (r.headers [CL]);
427
427
if (content_length > 1024 * 1024 ) {
428
428
cerr << " Unreasonable POST Content-Length: " << content_length << endl;
429
429
return r;
@@ -503,14 +503,14 @@ bool WebRadioInterface::dispatch_client(Socket&& client)
503
503
else {
504
504
bool url_handled = false ;
505
505
const regex regex_slide (R"( ^[/]slide[/]([^ ]+))" );
506
- std:: smatch match_slide;
506
+ smatch match_slide;
507
507
if (regex_search (req.url , match_slide, regex_slide)) {
508
508
success = send_slide (s, match_slide[1 ]);
509
509
url_handled = true ;
510
510
}
511
511
512
512
const regex regex_stream (R"( ^[/]stream[/]([^ ]+))" );
513
- std:: smatch match_stream;
513
+ smatch match_stream;
514
514
if (regex_search (req.url , match_stream, regex_stream)) {
515
515
success = send_stream (s, match_stream[1 ]);
516
516
url_handled = true ;
@@ -519,7 +519,7 @@ bool WebRadioInterface::dispatch_client(Socket&& client)
519
519
if (decode_settings.outputCodec == OutputCodec::MP3)
520
520
{
521
521
const regex regex_mp3 (R"( ^[/]mp3[/]([^ ]+))" );
522
- std:: smatch match_mp3;
522
+ smatch match_mp3;
523
523
if (regex_search (req.url , match_mp3, regex_mp3)) {
524
524
success = send_stream (s, match_mp3[1 ]);
525
525
url_handled = true ;
@@ -529,7 +529,7 @@ bool WebRadioInterface::dispatch_client(Socket&& client)
529
529
if (decode_settings.outputCodec == OutputCodec::FLAC)
530
530
{
531
531
const regex regex_flac (R"( ^[/]flac[/]([^ ]+))" );
532
- std:: smatch match_flac;
532
+ smatch match_flac;
533
533
if (regex_search (req.url , match_flac, regex_flac)) {
534
534
success = send_stream (s, match_flac[1 ]);
535
535
url_handled = true ;
@@ -568,10 +568,10 @@ bool WebRadioInterface::dispatch_client(Socket&& client)
568
568
}
569
569
570
570
bool WebRadioInterface::send_file (Socket& s,
571
- const std:: string& filename,
572
- const std:: string& content_type)
571
+ const string& filename,
572
+ const string& content_type)
573
573
{
574
- std:: filesystem::path path_name;
574
+ filesystem::path path_name;
575
575
if (!base_dir.empty ())
576
576
{
577
577
path_name = base_dir;
@@ -790,10 +790,10 @@ bool WebRadioInterface::send_mux_json(Socket& s)
790
790
m.timestamp .time_since_epoch ());
791
791
792
792
const auto s = duration_cast<seconds>(ms);
793
- const std:: time_t t = s.count ();
794
- const std:: size_t fractional_seconds = ms.count () % 1000 ;
793
+ const time_t t = s.count ();
794
+ const size_t fractional_seconds = ms.count () % 1000 ;
795
795
796
- ss << std:: ctime (&t) << " ." << fractional_seconds;
796
+ ss << ctime (&t) << " ." << fractional_seconds;
797
797
798
798
switch (m.level ) {
799
799
case message_level_t ::Information:
@@ -883,21 +883,21 @@ bool WebRadioInterface::send_mux_playlist(Socket& s)
883
883
return true ;
884
884
}
885
885
886
- bool WebRadioInterface::send_stream (Socket& s, const std:: string& stream)
886
+ bool WebRadioInterface::send_stream (Socket& s, const string& stream)
887
887
{
888
888
unique_lock<mutex> lock (rx_mut);
889
889
ASSERT_RX;
890
890
891
891
for (const auto & srv : rx->getServiceList ()) {
892
892
if (rx->serviceHasAudioComponent (srv) and
893
893
(to_hex (srv.serviceId , 4 ) == stream or
894
- (uint32_t )std:: stoul (stream) == srv.serviceId )) {
894
+ (uint32_t )stoul (stream) == srv.serviceId )) {
895
895
try {
896
896
auto & ph = phs.at (srv.serviceId );
897
897
898
898
lock.unlock ();
899
899
900
- std:: string http_contenttype;
900
+ string http_contenttype;
901
901
902
902
switch (decode_settings.outputCodec )
903
903
{
@@ -941,11 +941,11 @@ bool WebRadioInterface::send_stream(Socket& s, const std::string& stream)
941
941
return false ;
942
942
}
943
943
944
- bool WebRadioInterface::send_slide (Socket& s, const std:: string& stream)
944
+ bool WebRadioInterface::send_slide (Socket& s, const string& stream)
945
945
{
946
946
for (const auto & wph : phs) {
947
947
if (to_hex (wph.first , 4 ) == stream or
948
- (uint32_t )std:: stoul (stream) == wph.first ) {
948
+ (uint32_t )stoul (stream) == wph.first ) {
949
949
const auto mot = wph.second .getMOT ();
950
950
951
951
if (mot.data .empty ()) {
@@ -973,8 +973,8 @@ bool WebRadioInterface::send_slide(Socket& s, const std::string& stream)
973
973
headers << http_nocache;
974
974
975
975
headers << " Last-Modified: " ;
976
- std:: time_t t = chrono::system_clock::to_time_t (mot.time );
977
- headers << put_time (std:: gmtime (&t), " %a, %d %b %Y %T GMT" );
976
+ time_t t = chrono::system_clock::to_time_t (mot.time );
977
+ headers << put_time (gmtime (&t), " %a, %d %b %Y %T GMT" );
978
978
headers << " \r\n " ;
979
979
980
980
headers << " \r\n " ;
@@ -1027,7 +1027,7 @@ bool WebRadioInterface::send_impulseresponse(Socket& s)
1027
1027
1028
1028
lock_guard<mutex> lock (plotdata_mut);
1029
1029
vector<float > cir_db (last_CIR.size ());
1030
- std:: transform (last_CIR.begin (), last_CIR.end (), cir_db.begin (),
1030
+ transform (last_CIR.begin (), last_CIR.end (), cir_db.begin (),
1031
1031
[](float y) { return 10 .0f * log10 (y); });
1032
1032
1033
1033
size_t lengthBytes = cir_db.size () * sizeof (float );
@@ -1078,7 +1078,7 @@ bool WebRadioInterface::send_spectrum(Socket& s)
1078
1078
if (samples.size () != (size_t )dabparams.T_u )
1079
1079
return false ;
1080
1080
1081
- std:: copy (samples.begin (), samples.end (), spectrumBuffer);
1081
+ copy (samples.begin (), samples.end (), spectrumBuffer);
1082
1082
1083
1083
// Do FFT to get the spectrum
1084
1084
spectrum_fft_handler.do_FFT ();
@@ -1112,13 +1112,13 @@ bool WebRadioInterface::send_constellation(Socket& s)
1112
1112
{
1113
1113
const size_t decim = OfdmDecoder::constellationDecimation;
1114
1114
const size_t num_iqpoints = (dabparams.L -1 ) * dabparams.K / decim;
1115
- std:: vector<float > phases (num_iqpoints);
1115
+ vector<float > phases (num_iqpoints);
1116
1116
1117
1117
lock_guard<mutex> lock (plotdata_mut);
1118
1118
if (last_constellation.size () == num_iqpoints) {
1119
1119
phases.resize (num_iqpoints);
1120
1120
for (size_t i = 0 ; i < num_iqpoints; i++) {
1121
- const float y = 180 .0f / (float )M_PI * std:: arg (last_constellation[i]);
1121
+ const float y = 180 .0f / (float )M_PI * arg (last_constellation[i]);
1122
1122
phases[i] = y;
1123
1123
}
1124
1124
@@ -1174,7 +1174,7 @@ bool WebRadioInterface::send_channel(Socket& s)
1174
1174
return true ;
1175
1175
}
1176
1176
1177
- bool WebRadioInterface::handle_fft_window_placement_post (Socket& s, const std:: string& fft_window_placement)
1177
+ bool WebRadioInterface::handle_fft_window_placement_post (Socket& s, const string& fft_window_placement)
1178
1178
{
1179
1179
cerr << " POST fft window: " << fft_window_placement << endl;
1180
1180
@@ -1220,7 +1220,7 @@ bool WebRadioInterface::handle_fft_window_placement_post(Socket& s, const std::s
1220
1220
return true ;
1221
1221
}
1222
1222
1223
- bool WebRadioInterface::handle_coarse_corrector_post (Socket& s, const std:: string& coarseCorrector)
1223
+ bool WebRadioInterface::handle_coarse_corrector_post (Socket& s, const string& coarseCorrector)
1224
1224
{
1225
1225
cerr << " POST coarse : " << coarseCorrector << endl;
1226
1226
@@ -1263,7 +1263,7 @@ bool WebRadioInterface::handle_coarse_corrector_post(Socket& s, const std::strin
1263
1263
return true ;
1264
1264
}
1265
1265
1266
- bool WebRadioInterface::handle_channel_post (Socket& s, const std:: string& channel)
1266
+ bool WebRadioInterface::handle_channel_post (Socket& s, const string& channel)
1267
1267
{
1268
1268
cerr << " POST channel: " << channel << endl;
1269
1269
@@ -1294,7 +1294,7 @@ void WebRadioInterface::handle_phs()
1294
1294
for (auto & s : serviceList) {
1295
1295
auto scs = rx->getComponents (s);
1296
1296
1297
- if (std:: find (
1297
+ if (find (
1298
1298
carousel_services_available.cbegin (),
1299
1299
carousel_services_available.cend (),
1300
1300
s.serviceId ) == carousel_services_available.cend ()) {
@@ -1307,12 +1307,12 @@ void WebRadioInterface::handle_phs()
1307
1307
1308
1308
if (phs.count (s.serviceId ) == 0 ) {
1309
1309
WebProgrammeHandler ph (s.serviceId , decode_settings.outputCodec );
1310
- phs.emplace (std:: make_pair (s.serviceId , move (ph)));
1310
+ phs.emplace (make_pair (s.serviceId , move (ph)));
1311
1311
}
1312
1312
}
1313
1313
1314
1314
using namespace chrono ;
1315
- size_t max_services_in_carousel = std:: min (
1315
+ size_t max_services_in_carousel = min (
1316
1316
carousel_services_available.size (),
1317
1317
(size_t )decode_settings.num_decoders_in_carousel );
1318
1318
@@ -1554,34 +1554,34 @@ void WebRadioInterface::onFIBDecodeSuccess(bool crcCheckOk, const uint8_t* fib)
1554
1554
new_fib_block_available.notify_one ();
1555
1555
}
1556
1556
1557
- void WebRadioInterface::onNewImpulseResponse (std:: vector<float >&& data)
1557
+ void WebRadioInterface::onNewImpulseResponse (vector<float >&& data)
1558
1558
{
1559
1559
lock_guard<mutex> lock (plotdata_mut);
1560
1560
last_CIR = move (data);
1561
1561
}
1562
1562
1563
- void WebRadioInterface::onNewNullSymbol (std:: vector<DSPCOMPLEX>&& data)
1563
+ void WebRadioInterface::onNewNullSymbol (vector<DSPCOMPLEX>&& data)
1564
1564
{
1565
1565
lock_guard<mutex> lock (plotdata_mut);
1566
1566
last_NULL = move (data);
1567
1567
}
1568
1568
1569
- void WebRadioInterface::onConstellationPoints (std:: vector<DSPCOMPLEX>&& data)
1569
+ void WebRadioInterface::onConstellationPoints (vector<DSPCOMPLEX>&& data)
1570
1570
{
1571
1571
lock_guard<mutex> lock (plotdata_mut);
1572
1572
last_constellation = move (data);
1573
1573
}
1574
1574
1575
- void WebRadioInterface::onMessage (message_level_t level, const std:: string& text, const std:: string& text2)
1575
+ void WebRadioInterface::onMessage (message_level_t level, const string& text, const string& text2)
1576
1576
{
1577
- std:: string fullText;
1577
+ string fullText;
1578
1578
if (text2.empty ())
1579
1579
fullText = text;
1580
1580
else
1581
1581
fullText = text + text2;
1582
1582
1583
1583
lock_guard<mutex> lock (data_mut);
1584
- const auto now = std:: chrono::system_clock::now ();
1584
+ const auto now = chrono::system_clock::now ();
1585
1585
pending_message_t m = { .level = level, .text = fullText, .timestamp = now};
1586
1586
pending_messages.emplace_back (move (m));
1587
1587
@@ -1603,7 +1603,7 @@ void WebRadioInterface::onTIIMeasurement(tii_measurement_t&& m)
1603
1603
1604
1604
void WebRadioInterface::onInputFailure ()
1605
1605
{
1606
- std:: exit (1 );
1606
+ exit (1 );
1607
1607
}
1608
1608
1609
1609
list<tii_measurement_t > WebRadioInterface::getTiiStats ()
@@ -1634,7 +1634,7 @@ list<tii_measurement_t> WebRadioInterface::getTiiStats()
1634
1634
avg.error = error / len;
1635
1635
1636
1636
// Calculate the median
1637
- std:: nth_element (delays.begin (), delays.begin () + len/2 , delays.end ());
1637
+ nth_element (delays.begin (), delays.begin () + len/2 , delays.end ());
1638
1638
avg.delay_samples = delays[len/2 ];
1639
1639
}
1640
1640
else {
@@ -1645,7 +1645,7 @@ list<tii_measurement_t> WebRadioInterface::getTiiStats()
1645
1645
l.push_back (move (avg));
1646
1646
}
1647
1647
1648
- using namespace std :: chrono;
1648
+ using namespace chrono ;
1649
1649
const auto now = steady_clock::now ();
1650
1650
// Remove a single entry every second to make the flukes
1651
1651
// disappear
0 commit comments