a mega cool windows xp app

feat: add a few more stations

dunkirk.sh 52c565ab 2135fde8

verified
Changed files
+26 -18
+26 -18
main.cpp
··· 27 27 } RadioStation; 28 28 29 29 RadioStation g_stations[] = { 30 - {14.230f, "SomaFM Groove", "Downtempo and chillout", "http://ice1.somafm.com/groovesalad-128-mp3"}, 31 - {15.770f, "Radio Paradise", "Eclectic music mix", "http://stream.radioparadise.com/mp3-128"}, 32 - {17.895f, "Jazz Radio", "Smooth jazz", "http://jazz-wr04.ice.infomaniak.ch/jazz-wr04-128.mp3"}, 33 - {21.500f, "Classical Music", "Classical radio", "http://stream.wqxr.org/wqxr"}, 30 + {10.230f, "SomaFM Groove", "Downtempo and chillout", "http://ice1.somafm.com/groovesalad-128-mp3"}, 31 + {11.470f, "WBGO Jazz88", "Jazz from Newark", "http://wbgo.streamguys.net/wbgo128"}, 32 + {12.650f, "Radio Paradise", "Eclectic music mix", "http://stream.radioparadise.com/mp3-128"}, 33 + {13.890f, "Classical Music", "Classical radio", "http://stream.wqxr.org/wqxr"}, 34 + {15.120f, "Jazz Radio", "Smooth jazz", "http://jazz-wr04.ice.infomaniak.ch/jazz-wr04-128.mp3"}, 35 + {16.350f, "FIP", "Eclectic French radio", "http://direct.fipradio.fr/live/fip-midfi.mp3"}, 36 + {18.810f, "TSF Jazz", "French jazz radio", "http://tsfjazz.ice.infomaniak.ch/tsfjazz-high.mp3"}, 37 + {20.040f, "Dublab", "Electronic and experimental", "http://dublab.out.airtime.pro:8000/dublab_a"}, 38 + {21.270f, "BBC World Service", "Global news and culture", "http://stream.live.vc.bbcmedia.co.uk/bbc_world_service"}, 39 + {23.730f, "WFMU", "Freeform experimental radio", "http://stream0.wfmu.org/freeform-128k"}, 40 + {24.960f, "ChillHop Music", "Lo-fi hip hop", "http://ice1.somafm.com/fluid"}, 41 + {27.420f, "Worldwide FM", "Global music discovery", "http://worldwidefm.out.airtime.pro:8000/worldwidefm_a"}, 34 42 }; 35 43 36 44 #define NUM_STATIONS (sizeof(g_stations) / sizeof(RadioStation)) ··· 111 119 112 120 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow) { 113 121 // Don't allocate console by default - will be toggled via menu 114 - 122 + 115 123 const char* CLASS_NAME = "ShortwaveRadio"; 116 124 117 125 WNDCLASS wc = {}; ··· 468 476 469 477 // Main panel with simplified metallic gradient effect 470 478 RECT panel = {10, 10, rect->right - 10, rect->bottom - 10}; 471 - 479 + 472 480 // Simplified gradient effect with fewer steps 473 481 for (int i = 0; i < 8; i++) { 474 482 int gray = 45 + i * 3; ··· 522 530 RadioStation* currentStation = FindNearestStation(g_radio.frequency); 523 531 if (currentStation && g_radio.signalStrength > 30) { 524 532 RECT stationRect = {50, 320, 550, 360}; 525 - 533 + 526 534 // Winamp-style display background 527 535 HBRUSH displayBrush = CreateSolidBrush(RGB(0, 0, 0)); 528 536 FillRect(hdc, &stationRect, displayBrush); ··· 531 539 // Beveled border 532 540 HPEN lightBorderPen = CreatePen(PS_SOLID, 1, RGB(64, 64, 64)); 533 541 HPEN darkBorderPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0)); 534 - 542 + 535 543 SelectObject(hdc, darkBorderPen); 536 544 MoveToEx(hdc, stationRect.left, stationRect.bottom, NULL); 537 545 LineTo(hdc, stationRect.left, stationRect.top); 538 546 LineTo(hdc, stationRect.right, stationRect.top); 539 - 547 + 540 548 SelectObject(hdc, lightBorderPen); 541 549 LineTo(hdc, stationRect.right, stationRect.bottom); 542 550 LineTo(hdc, stationRect.left, stationRect.bottom); 543 - 551 + 544 552 DeleteObject(lightBorderPen); 545 553 DeleteObject(darkBorderPen); 546 554 ··· 567 575 void DrawFrequencyDisplay(HDC hdc, int x, int y, float frequency) { 568 576 // Winamp-style LCD display with beveled edges 569 577 RECT display = {x - 100, y - 25, x + 100, y + 25}; 570 - 578 + 571 579 // Dark background 572 580 HBRUSH blackBrush = CreateSolidBrush(RGB(0, 0, 0)); 573 581 FillRect(hdc, &display, blackBrush); ··· 601 609 sprintf(freqText, "%.3f MHz", frequency); 602 610 603 611 SetBkMode(hdc, TRANSPARENT); 604 - 612 + 605 613 // Create glow effect by drawing text multiple times with slight offsets 606 614 HFONT lcdFont = CreateFont(20, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, 607 615 DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ··· 785 793 void DrawSignalMeter(HDC hdc, int x, int y, int strength) { 786 794 // Winamp-style meter background with bevel 787 795 RECT meter = {x, y, x + 80, y + 20}; 788 - 796 + 789 797 // Dark background 790 798 HBRUSH meterBrush = CreateSolidBrush(RGB(16, 16, 16)); 791 799 FillRect(hdc, &meter, meterBrush); ··· 851 859 void DrawVUMeter(HDC hdc, int x, int y, float leftLevel, float rightLevel) { 852 860 // Winamp-style VU meter with classic look 853 861 RECT meterBg = {x, y, x + 80, y + 40}; 854 - 862 + 855 863 // Dark background 856 864 HBRUSH bgBrush = CreateSolidBrush(RGB(16, 16, 16)); 857 865 FillRect(hdc, &meterBg, bgBrush); ··· 887 895 int leftWidth = (int)(leftLevel * 65); 888 896 if (leftWidth > 0) { 889 897 RECT leftBar = {x + 8, y + 12, x + 8 + leftWidth, y + 17}; 890 - 898 + 891 899 // Determine color based on level 892 900 COLORREF leftColor; 893 901 if (leftLevel > 0.8f) leftColor = RGB(255, 64, 64); // Red ··· 914 922 int rightWidth = (int)(rightLevel * 65); 915 923 if (rightWidth > 0) { 916 924 RECT rightBar = {x + 8, y + 22, x + 8 + rightWidth, y + 27}; 917 - 925 + 918 926 // Determine color based on level 919 927 COLORREF rightColor; 920 928 if (rightLevel > 0.8f) rightColor = RGB(255, 64, 64); // Red ··· 1352 1360 // Extract left and right channel levels and apply volume scaling 1353 1361 float rawLeft = (float)LOWORD(level) / 32768.0f; 1354 1362 float rawRight = (float)HIWORD(level) / 32768.0f; 1355 - 1363 + 1356 1364 // Apply the same volume scaling as the actual audio output 1357 1365 float streamVolume = g_radio.volume * (g_radio.signalStrength / 100.0f); 1358 1366 g_audio.vuLevelLeft = rawLeft * streamVolume; ··· 1370 1378 // Apply static volume scaling 1371 1379 float staticVolume = (100.0f - g_radio.signalStrength) / 100.0f; 1372 1380 float scaledStaticVolume = g_radio.volume * staticVolume * g_audio.staticVolume; 1373 - 1381 + 1374 1382 // Ensure minimum static when radio is on but no strong signal 1375 1383 if (g_radio.power && g_radio.signalStrength < 50.0f) { 1376 1384 scaledStaticVolume = fmax(scaledStaticVolume, g_radio.volume * 0.1f);