mirror of
https://github.com/Michatec/Radio.git
synced 2026-11-19 01:03:19 +01:00
feat: add web remote control with translations
- Implement embedded Ktor remote control server (port 8080) - Add REST API endpoints for play/pause/next/prev/status - Add web UI with localization support - Add remote control preference toggle and settings integration - Translate remote control strings to all supported languages
This commit is contained in:
1 parent
925a40fa08
commit
8fa73ff6f9
26 files changed
+1511
-8
No files matched your search
@@ -10,6 +10,7 @@
|
||||
**Radio is an application with a minimalist approach to listening to radio over the Internet.** <br>
|
||||
**Radio only offers a very basic search option, and it imports audio streaming links when you tap them in a web browser.** <br>
|
||||
**Radio now also supports Android TV and Cast to Devices (Beta) with the Version 14.5 and above.** <br>
|
||||
**New Feature Update: Web Control with API for devs.**<br>
|
||||
**Pull request are welcome at any time.**<br>
|
||||
|
||||
**Radio is free software. It is released under the [GPLv3 open source license](https://opensource.org/licenses/GPL-3.0).**
|
||||
|
||||
+3
-3
@@ -18,9 +18,9 @@ We appreciate responsible disclosure and will credit researchers who report vali
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| > 14.5 | :white_check_mark: |
|
||||
| < 14.5 | :x: |
|
||||
|---------| ------------------ |
|
||||
| > 15 | :white_check_mark: |
|
||||
| < 15 | :x: |
|
||||
|
||||
Only the latest stable release receives security updates. Users on older versions are encouraged to update.
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
plugins {
|
||||
alias(libs.plugins.android.application)
|
||||
alias(libs.plugins.kotlin.serialization)
|
||||
id("kotlin-parcelize")
|
||||
}
|
||||
|
||||
@@ -52,6 +53,13 @@ android {
|
||||
version = "3.22.1"
|
||||
}
|
||||
}
|
||||
|
||||
packaging {
|
||||
resources {
|
||||
excludes += "/META-INF/INDEX.LIST"
|
||||
excludes += "/META-INF/io.netty.versions.properties"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
@@ -78,6 +86,13 @@ dependencies {
|
||||
|
||||
implementation(libs.freedroidwarn)
|
||||
|
||||
// Ktor //
|
||||
implementation(libs.ktor.server.core)
|
||||
implementation(libs.ktor.server.netty)
|
||||
implementation(libs.ktor.server.content.negotiation)
|
||||
implementation(libs.ktor.serialization.kotlinx.json)
|
||||
implementation(libs.ktor.serialization.gson)
|
||||
|
||||
// Volley HTTP request //
|
||||
implementation(libs.volley)
|
||||
implementation(libs.material3)
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.6 KiB |
@@ -0,0 +1,169 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title data-t="title">Radio Remote</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/png" href="favicon.png">
|
||||
<link rel="stylesheet" href="style.css">
|
||||
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
|
||||
</head>
|
||||
<body class="dark-theme">
|
||||
<div class="dashboard">
|
||||
<header>
|
||||
<h1 data-t="title">Radio Remote</h1>
|
||||
<button id="menuBtn" class="icon-btn"><span class="material-icons">settings</span></button>
|
||||
</header>
|
||||
|
||||
<main id="mainDashboard">
|
||||
<section class="now-playing glass">
|
||||
<div class="current-station-info">
|
||||
<div class="current-text-info">
|
||||
<div id="currentName" class="current-name" data-t="status_loading">Loading...</div>
|
||||
<div id="currentMetadata" class="current-metadata"></div>
|
||||
</div>
|
||||
<img id="currentImage" class="current-img" src="favicon.png" alt="Station">
|
||||
</div>
|
||||
<div id="status" class="status-badge" data-t="status_loading">Loading...</div>
|
||||
<div class="controls">
|
||||
<button id="prevBtn" class="icon-btn large"><span class="material-icons">skip_previous</span></button>
|
||||
<button id="playPauseBtn" class="icon-btn x-large"><span class="material-icons" id="playPauseIcon">play_arrow</span></button>
|
||||
<button id="nextBtn" class="icon-btn large"><span class="material-icons">skip_next</span></button>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="station-section">
|
||||
<h2 data-t="stations_title">Station Collection</h2>
|
||||
<div id="stationList" class="station-grid"></div>
|
||||
</section>
|
||||
</main>
|
||||
|
||||
<main id="apiDocsView" class="hidden">
|
||||
<div class="glass api-container">
|
||||
<header class="api-header">
|
||||
<button id="backToDashboard" class="icon-btn"><span class="material-icons">arrow_back</span></button>
|
||||
<h1 data-t="api_docs">API Documentation</h1>
|
||||
</header>
|
||||
<div class="api-content">
|
||||
<p>The Radio app provides a REST API to control playback and query information.</p>
|
||||
|
||||
<h2>API Reference</h2>
|
||||
|
||||
<div class="endpoint">
|
||||
<h3><span class="method get">GET</span> <code>/api/status</code></h3>
|
||||
<p>Returns current playback status.</p>
|
||||
<div class="code-example">Response Example:</div>
|
||||
<pre>
|
||||
{
|
||||
"isPlaying": true,
|
||||
"currentStationUuid": "fc080549-...",
|
||||
"metadata": "Artist - Title"
|
||||
} </pre>
|
||||
</div>
|
||||
|
||||
<div class="endpoint">
|
||||
<h3><span class="method get">GET</span> <code>/api/stations</code></h3>
|
||||
<p>Returns all stations in collection.</p>
|
||||
<div class="code-example">Response Example:</div>
|
||||
<pre>
|
||||
[
|
||||
{
|
||||
"uuid": "fc080549-...",
|
||||
"name": "Station Name",
|
||||
"hasImage": true
|
||||
}
|
||||
] </pre>
|
||||
</div>
|
||||
|
||||
<div class="endpoint">
|
||||
<h3><span class="method get">GET</span> <code>/api/image/{uuid}</code></h3>
|
||||
<p>Returns the image for a specific station.</p>
|
||||
<div class="code-example">Response: Image (binary data, JPEG)</div>
|
||||
</div>
|
||||
|
||||
<div class="endpoint">
|
||||
<h3><span class="method get">GET</span> <code>/api/config</code></h3>
|
||||
<p>Returns the app version.</p>
|
||||
<div class="code-example">Response Example:</div>
|
||||
<pre>{ "version": "15.1" }</pre>
|
||||
</div>
|
||||
|
||||
<div class="endpoint">
|
||||
<h3><span class="method post">POST</span> <code>/api/play/{uuid}</code></h3>
|
||||
<p>Starts playback of a specific station.</p>
|
||||
<div class="code-example">Response Example:</div>
|
||||
<pre>{ "status": "ok" }</pre>
|
||||
</div>
|
||||
|
||||
<div class="endpoint">
|
||||
<h3><span class="method post">POST</span> <code>/api/pause</code></h3>
|
||||
<p>Pauses current playback.</p>
|
||||
<div class="code-example">Response Example:</div>
|
||||
<pre>{ "status": "ok" }</pre>
|
||||
</div>
|
||||
|
||||
<div class="endpoint">
|
||||
<h3><span class="method post">POST</span> <code>/api/resume</code></h3>
|
||||
<p>Resumes current playback.</p>
|
||||
<div class="code-example">Response Example:</div>
|
||||
<pre>{ "status": "ok" }</pre>
|
||||
</div>
|
||||
|
||||
<div class="endpoint">
|
||||
<h3><span class="method post">POST</span> <code>/api/next</code></h3>
|
||||
<p>Plays the next station.</p>
|
||||
<div class="code-example">Response Example:</div>
|
||||
<pre>{ "status": "ok" }</pre>
|
||||
</div>
|
||||
|
||||
<div class="endpoint">
|
||||
<h3><span class="method post">POST</span> <code>/api/prev</code></h3>
|
||||
<p>Plays the previous station.</p>
|
||||
<div class="code-example">Response Example:</div>
|
||||
<pre>{ "status": "ok" }</pre>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<div id="settingsPanel" class="settings-panel glass hidden">
|
||||
<div class="settings-content">
|
||||
<div class="settings-header">
|
||||
<h3 data-t="menu_theme">Theme</h3>
|
||||
<button id="closeMenuBtn" class="icon-btn"><span class="material-icons">close</span></button>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<span data-t="menu_theme">Theme</span>
|
||||
<label for="themeSelect"></label>
|
||||
<select id="themeSelect">
|
||||
<option value="auto_browser" data-t="theme_follow_browser">Follow Browser</option>
|
||||
<option value="dark" data-t="theme_dark">Dark</option>
|
||||
<option value="light" data-t="theme_light">Light</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="setting-item">
|
||||
<span data-t="menu_language">Language</span>
|
||||
<label for="langSelect"></label>
|
||||
<select id="langSelect">
|
||||
<option value="auto_browser" data-t="lang_auto_browser">Auto (Browser)</option>
|
||||
<option value="en">English</option>
|
||||
<option value="de">Deutsch</option>
|
||||
<option value="fr">Français</option>
|
||||
<option value="ru">Русский</option>
|
||||
<option value="nl">Nederlands</option>
|
||||
<option value="pl">Polski</option>
|
||||
<option value="ja">日本語</option>
|
||||
<option value="uk">Українська</option>
|
||||
<option value="el">Ελληνικά</option>
|
||||
<option value="da">Dansk</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="settings-footer">
|
||||
<button id="showApiDocsBtn" class="link-btn" data-t="api_docs">API Documentation</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="script.js?v=18"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,280 @@
|
||||
let currentLang = 'en';
|
||||
let translations = {};
|
||||
let allStations = [];
|
||||
let isUpdating = false;
|
||||
const STATE_IDLE = 1;
|
||||
const STATE_BUFFERING = 2;
|
||||
const STATE_READY = 3;
|
||||
const STATE_ENDED = 4;
|
||||
|
||||
function t(key) {
|
||||
return (translations[currentLang] && translations[currentLang][key]) ||
|
||||
(translations['en'] && translations['en'][key]) || key;
|
||||
}
|
||||
|
||||
function updateUILanguage() {
|
||||
document.querySelectorAll('[data-t]').forEach(el => {
|
||||
const key = el.getAttribute('data-t');
|
||||
const text = t(key);
|
||||
if (el.tagName === 'INPUT' && el.placeholder) {
|
||||
el.placeholder = text;
|
||||
} else {
|
||||
el.innerText = text;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async function loadTranslations() {
|
||||
try {
|
||||
const res = await fetch('/translations.json');
|
||||
translations = await res.json();
|
||||
updateUILanguage();
|
||||
} catch (e) {
|
||||
console.error("Failed to load translations", e);
|
||||
}
|
||||
}
|
||||
|
||||
async function updateStatus() {
|
||||
if (isUpdating) return;
|
||||
const statusEl = document.getElementById('status');
|
||||
const playPauseIcon = document.getElementById('playPauseIcon');
|
||||
const currentNameEl = document.getElementById('currentName');
|
||||
const currentMetadataEl = document.getElementById('currentMetadata');
|
||||
const currentImageEl = document.getElementById('currentImage');
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/status');
|
||||
if (!response.ok) return;
|
||||
|
||||
const data = await response.json();
|
||||
if (data.error) {
|
||||
statusEl.innerText = t('status_error') + ': ' + data.error;
|
||||
} else {
|
||||
let statusText = data.isPlaying ? t('status_playing') : t('status_paused');
|
||||
if (data.playbackState === STATE_BUFFERING) {
|
||||
statusText = "Buffering...";
|
||||
}
|
||||
statusEl.innerText = statusText;
|
||||
playPauseIcon.innerText = data.isPlaying ? 'pause' : 'play_arrow';
|
||||
|
||||
const stationUuid = data.currentStationUuid;
|
||||
updateActiveStation(stationUuid);
|
||||
|
||||
const station = allStations.find(s => s.uuid === stationUuid);
|
||||
if (station) {
|
||||
currentNameEl.innerText = station.name;
|
||||
currentMetadataEl.innerText = data.metadata || "";
|
||||
currentImageEl.src = station.hasImage ? '/api/image/' + station.uuid : 'favicon.png';
|
||||
} else {
|
||||
currentNameEl.innerText = data.isPlaying ? 'Unknown Station' : 'No Station Selected';
|
||||
currentMetadataEl.innerText = "";
|
||||
currentImageEl.src = 'favicon.png';
|
||||
}
|
||||
|
||||
if (themeSelect.value === 'auto_browser') {
|
||||
applyThemeUI(getBrowserTheme());
|
||||
}
|
||||
|
||||
if (langSelect.value === 'auto_browser') {
|
||||
const browserLang = navigator.language.split('-')[0];
|
||||
const targetLang = translations[browserLang] ? browserLang : 'en';
|
||||
if (targetLang !== currentLang) {
|
||||
currentLang = targetLang;
|
||||
updateUILanguage();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error("Status fetch failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
async function loadStations() {
|
||||
const list = document.getElementById('stationList');
|
||||
try {
|
||||
const response = await fetch('/api/stations');
|
||||
if (!response.ok) return;
|
||||
allStations = await response.json();
|
||||
list.innerHTML = '';
|
||||
if (allStations.length === 0) {
|
||||
list.innerText = t('stations_empty');
|
||||
return;
|
||||
}
|
||||
allStations.forEach(station => {
|
||||
const div = document.createElement('div');
|
||||
div.className = 'station-item';
|
||||
div.id = 'station-' + station.uuid;
|
||||
|
||||
const img = document.createElement('img');
|
||||
img.className = 'station-img';
|
||||
if (station.hasImage) {
|
||||
img.src = '/api/image/' + station.uuid;
|
||||
} else {
|
||||
img.src = 'favicon.png';
|
||||
}
|
||||
div.appendChild(img);
|
||||
|
||||
const name = document.createElement('div');
|
||||
name.className = 'station-name';
|
||||
name.innerText = station.name || 'Unnamed Station';
|
||||
div.appendChild(name);
|
||||
|
||||
div.onclick = () => playStation(station.uuid);
|
||||
list.appendChild(div);
|
||||
});
|
||||
updateStatus();
|
||||
} catch (e) {
|
||||
console.error("Load stations failed", e);
|
||||
}
|
||||
}
|
||||
|
||||
function updateActiveStation(uuid) {
|
||||
document.querySelectorAll('.station-item').forEach(el => el.classList.remove('active'));
|
||||
if (!uuid) return;
|
||||
const active = document.getElementById('station-' + uuid);
|
||||
if (active) active.classList.add('active');
|
||||
}
|
||||
|
||||
async function playStation(uuid) {
|
||||
updateActiveStation(uuid);
|
||||
document.getElementById('status').innerText = "Starting...";
|
||||
document.getElementById('playPauseIcon').innerText = 'pause';
|
||||
|
||||
const station = allStations.find(s => s.uuid === uuid);
|
||||
if (station) {
|
||||
document.getElementById('currentName').innerText = station.name;
|
||||
document.getElementById('currentMetadata').innerText = "";
|
||||
document.getElementById('currentImage').src = station.hasImage ? '/api/image/' + station.uuid : 'favicon.png';
|
||||
}
|
||||
|
||||
try {
|
||||
await fetch('/api/play/' + uuid, { method: 'POST' });
|
||||
setTimeout(updateStatus, 300);
|
||||
} catch (e) { console.error(e); }
|
||||
}
|
||||
|
||||
document.getElementById('playPauseBtn').onclick = async () => {
|
||||
const icon = document.getElementById('playPauseIcon');
|
||||
const isPlaying = icon.innerText === 'pause';
|
||||
|
||||
icon.innerText = isPlaying ? 'play_arrow' : 'pause';
|
||||
document.getElementById('status').innerText = isPlaying ? t('status_paused') : t('status_playing');
|
||||
|
||||
try {
|
||||
if (isPlaying) {
|
||||
await fetch('/api/pause', { method: 'POST' });
|
||||
} else {
|
||||
await fetch('/api/resume', { method: 'POST' });
|
||||
}
|
||||
setTimeout(updateStatus, 300);
|
||||
} catch (e) { console.error(e); }
|
||||
};
|
||||
|
||||
document.getElementById('prevBtn').onclick = () => {
|
||||
fetch('/api/prev', { method: 'POST' }).then(() => setTimeout(updateStatus, 300));
|
||||
};
|
||||
document.getElementById('nextBtn').onclick = () => {
|
||||
fetch('/api/next', { method: 'POST' }).then(() => setTimeout(updateStatus, 300));
|
||||
};
|
||||
|
||||
function applyThemeUI(theme) {
|
||||
document.body.className = theme + '-theme';
|
||||
}
|
||||
|
||||
function getBrowserTheme() {
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
||||
}
|
||||
|
||||
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', e => {
|
||||
if (themeSelect.value === 'auto_browser') {
|
||||
applyThemeUI(e.matches ? 'dark' : 'light');
|
||||
}
|
||||
});
|
||||
|
||||
const themeSelect = document.getElementById('themeSelect');
|
||||
themeSelect.onchange = () => {
|
||||
const val = themeSelect.value;
|
||||
localStorage.setItem('radio-remote-theme', val);
|
||||
if (val === 'auto_browser') {
|
||||
applyThemeUI(getBrowserTheme());
|
||||
} else {
|
||||
applyThemeUI(val);
|
||||
}
|
||||
updateStatus();
|
||||
};
|
||||
|
||||
const langSelect = document.getElementById('langSelect');
|
||||
langSelect.onchange = () => {
|
||||
const val = langSelect.value;
|
||||
localStorage.setItem('radio-remote-lang', val);
|
||||
if (val === 'auto_browser') {
|
||||
const browserLang = navigator.language.split('-')[0];
|
||||
currentLang = translations[browserLang] ? browserLang : 'en';
|
||||
} else {
|
||||
currentLang = val;
|
||||
}
|
||||
updateUILanguage();
|
||||
updateStatus();
|
||||
};
|
||||
|
||||
const menuBtn = document.getElementById('menuBtn');
|
||||
const closeMenuBtn = document.getElementById('closeMenuBtn');
|
||||
const settingsPanel = document.getElementById('settingsPanel');
|
||||
const showApiDocsBtn = document.getElementById('showApiDocsBtn');
|
||||
const backToDashboard = document.getElementById('backToDashboard');
|
||||
const mainDashboard = document.getElementById('mainDashboard');
|
||||
const apiDocsView = document.getElementById('apiDocsView');
|
||||
|
||||
function toggleMenu(e) {
|
||||
if (e) e.stopPropagation();
|
||||
settingsPanel.classList.toggle('hidden');
|
||||
}
|
||||
|
||||
menuBtn.onclick = toggleMenu;
|
||||
closeMenuBtn.onclick = () => settingsPanel.classList.add('hidden');
|
||||
|
||||
showApiDocsBtn.onclick = () => {
|
||||
mainDashboard.classList.add('hidden');
|
||||
apiDocsView.classList.remove('hidden');
|
||||
settingsPanel.classList.add('hidden');
|
||||
};
|
||||
|
||||
backToDashboard.onclick = () => {
|
||||
apiDocsView.classList.add('hidden');
|
||||
mainDashboard.classList.remove('hidden');
|
||||
};
|
||||
|
||||
document.addEventListener('click', (e) => {
|
||||
if (!settingsPanel.classList.contains('hidden') &&
|
||||
!settingsPanel.contains(e.target) &&
|
||||
!menuBtn.contains(e.target)) {
|
||||
settingsPanel.classList.add('hidden');
|
||||
}
|
||||
});
|
||||
|
||||
async function init() {
|
||||
await loadTranslations();
|
||||
|
||||
const savedTheme = localStorage.getItem('radio-remote-theme') || 'auto_browser';
|
||||
themeSelect.value = savedTheme;
|
||||
if (savedTheme === 'auto_browser') {
|
||||
applyThemeUI(getBrowserTheme());
|
||||
} else {
|
||||
applyThemeUI(savedTheme);
|
||||
}
|
||||
|
||||
const savedLang = localStorage.getItem('radio-remote-lang') || 'auto_browser';
|
||||
langSelect.value = savedLang;
|
||||
if (savedLang === 'auto_browser') {
|
||||
const browserLang = navigator.language.split('-')[0];
|
||||
currentLang = translations[browserLang] ? browserLang : 'en';
|
||||
} else {
|
||||
currentLang = savedLang;
|
||||
}
|
||||
|
||||
updateUILanguage();
|
||||
await loadStations();
|
||||
setInterval(updateStatus, 1000);
|
||||
}
|
||||
|
||||
init();
|
||||
@@ -0,0 +1,340 @@
|
||||
:root {
|
||||
--bg-color: #000000;
|
||||
--card-bg: rgba(25, 25, 25, 0.6);
|
||||
--text-color: #ffffff;
|
||||
--accent-color: #0084ff;
|
||||
--accent-glow: 0 0 15px rgba(0, 132, 255, 0.6);
|
||||
--glass-blur: blur(20px);
|
||||
--transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
|
||||
}
|
||||
|
||||
body.light-theme {
|
||||
--bg-color: #f1f5f9;
|
||||
--card-bg: rgba(255, 255, 255, 0.95);
|
||||
--text-color: #1e293b;
|
||||
--accent-color: #3b82f6;
|
||||
--accent-glow: 0 4px 20px rgba(59, 130, 246, 0.2);
|
||||
--glass-blur: blur(8px);
|
||||
}
|
||||
|
||||
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', -apple-system, system-ui, sans-serif;
|
||||
background: var(--bg-color);
|
||||
color: var(--text-color);
|
||||
transition: background 0.4s ease;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.dashboard {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 30px;
|
||||
animation: slideDown 0.6s ease-out;
|
||||
position: relative;
|
||||
z-index: 101;
|
||||
}
|
||||
|
||||
h1 { font-size: 1.6rem; font-weight: 800; margin: 0; letter-spacing: -0.5px; }
|
||||
|
||||
.glass {
|
||||
background: var(--card-bg);
|
||||
backdrop-filter: var(--glass-blur);
|
||||
-webkit-backdrop-filter: var(--glass-blur);
|
||||
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||
border-radius: 24px;
|
||||
}
|
||||
|
||||
body.light-theme .glass {
|
||||
border: 1px solid rgba(255, 255, 255, 0.5);
|
||||
box-shadow: 0 8px 32px rgba(31, 38, 135, 0.07);
|
||||
}
|
||||
|
||||
.now-playing {
|
||||
padding: 30px 40px;
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
box-shadow: var(--accent-glow);
|
||||
animation: fadeIn 0.8s ease-out;
|
||||
}
|
||||
|
||||
.current-station-info {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 25px;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 1px solid rgba(255,255,255,0.05);
|
||||
}
|
||||
|
||||
body.light-theme .current-station-info {
|
||||
border-bottom: 1px solid rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
.current-text-info {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
overflow: hidden;
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
.current-name {
|
||||
font-size: 1.4rem;
|
||||
font-weight: 800;
|
||||
color: var(--accent-color);
|
||||
text-shadow: var(--accent-glow);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.current-metadata {
|
||||
font-size: 0.95rem;
|
||||
font-weight: 500;
|
||||
opacity: 0.6;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: var(--text-color);
|
||||
}
|
||||
|
||||
.current-img {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
border-radius: 12px;
|
||||
object-fit: cover;
|
||||
box-shadow: var(--accent-glow);
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
display: inline-block;
|
||||
padding: 6px 14px;
|
||||
background: var(--accent-color);
|
||||
color: white;
|
||||
border-radius: 12px;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 700;
|
||||
margin-bottom: 25px;
|
||||
box-shadow: var(--accent-glow);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 30px;
|
||||
}
|
||||
|
||||
.icon-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--text-color);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
transition: var(--transition);
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.icon-btn:hover { background: rgba(128,128,128,0.1); transform: scale(1.1); }
|
||||
.icon-btn:active { transform: scale(0.9); }
|
||||
|
||||
.icon-btn.large .material-icons { font-size: 42px; }
|
||||
.icon-btn.x-large {
|
||||
background: rgba(128,128,128,0.05);
|
||||
border: 2px solid var(--accent-color);
|
||||
}
|
||||
.icon-btn.x-large .material-icons { font-size: 56px; color: var(--accent-color); }
|
||||
.icon-btn.x-large:hover { box-shadow: var(--accent-glow); }
|
||||
|
||||
.station-section h2 { margin-bottom: 20px; font-weight: 700; opacity: 0.9; font-size: 1.2rem; }
|
||||
|
||||
.station-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.station-item {
|
||||
padding: 16px;
|
||||
background: var(--card-bg);
|
||||
border-radius: 20px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: var(--transition);
|
||||
border: 1px solid rgba(255,255,255,0.03);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
body.light-theme .station-item {
|
||||
border: 1px solid rgba(0,0,0,0.02);
|
||||
box-shadow: 0 4px 6px rgba(0,0,0,0.02);
|
||||
}
|
||||
|
||||
.station-item:hover {
|
||||
transform: translateY(-8px);
|
||||
background: rgba(128,128,128,0.08);
|
||||
border-color: var(--accent-color);
|
||||
}
|
||||
|
||||
.station-item.active {
|
||||
background: var(--accent-color);
|
||||
color: white;
|
||||
box-shadow: var(--accent-glow);
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.station-img {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
border-radius: 12px;
|
||||
object-fit: cover;
|
||||
background: rgba(128,128,128,0.05);
|
||||
border: 1px solid rgba(128,128,128,0.1);
|
||||
}
|
||||
|
||||
.station-name {
|
||||
font-size: 0.95rem;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.hidden { display: none !important; }
|
||||
|
||||
/* API Documentation */
|
||||
.api-container { padding: 30px; margin-top: 20px; }
|
||||
.api-content pre {
|
||||
background: #0a0a0a;
|
||||
padding: 20px;
|
||||
border-radius: 12px;
|
||||
color: #00d4ff;
|
||||
border: 1px solid #222;
|
||||
font-size: 0.9rem;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
body.light-theme .api-content pre {
|
||||
background: #f8f9fa;
|
||||
color: #0066cc;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.code-example { color: #888; margin-top: 10px; font-size: 0.8rem; }
|
||||
|
||||
/* Settings Panel with Animation */
|
||||
.settings-panel {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
height: 100%;
|
||||
width: 320px;
|
||||
z-index: 1000;
|
||||
padding: 30px;
|
||||
transform: translateX(0);
|
||||
transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
|
||||
box-shadow: -10px 0 30px rgba(0,0,0,0.5);
|
||||
}
|
||||
|
||||
body.light-theme .settings-panel {
|
||||
box-shadow: -10px 0 30px rgba(0,0,0,0.05);
|
||||
}
|
||||
|
||||
.settings-panel.hidden {
|
||||
transform: translateX(105%);
|
||||
}
|
||||
|
||||
.settings-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.setting-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.setting-item span { font-size: 0.85rem; font-weight: 600; opacity: 0.7; text-transform: uppercase; }
|
||||
|
||||
select {
|
||||
background: #111111;
|
||||
color: #ffffff;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
padding: 12px;
|
||||
border-radius: 12px;
|
||||
outline: none;
|
||||
cursor: pointer;
|
||||
font-size: 1rem;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
option {
|
||||
background: #111111;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
body.light-theme select {
|
||||
background: #ffffff;
|
||||
color: #1a202c;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
body.light-theme option {
|
||||
background: #ffffff;
|
||||
color: #1a202c;
|
||||
}
|
||||
|
||||
.settings-footer {
|
||||
position: absolute;
|
||||
bottom: 30px;
|
||||
left: 30px;
|
||||
right: 30px;
|
||||
padding-top: 20px;
|
||||
border-top: 1px solid rgba(128,128,128,0.1);
|
||||
}
|
||||
|
||||
.link-btn {
|
||||
background: none;
|
||||
border: none;
|
||||
color: var(--accent-color);
|
||||
cursor: pointer;
|
||||
font-weight: 600;
|
||||
padding: 0;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.method { font-weight: bold; padding: 2px 8px; border-radius: 4px; font-size: 0.8rem; margin-right: 10px; }
|
||||
.get { background: #007bff; color: white; }
|
||||
.post { background: #28a745; color: white; }
|
||||
|
||||
/* Keyframes */
|
||||
@keyframes fadeIn { from { opacity: 0; transform: scale(0.98); } to { opacity: 1; transform: scale(1); } }
|
||||
@keyframes slideDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
|
||||
|
||||
@media (max-width: 600px) {
|
||||
.dashboard { padding: 15px; }
|
||||
.station-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
|
||||
.settings-panel { width: 85%; }
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
{
|
||||
"en": {
|
||||
"title": "Radio Remote",
|
||||
"status_loading": "Loading...",
|
||||
"status_playing": "Playing",
|
||||
"status_paused": "Paused",
|
||||
"status_error": "Error",
|
||||
"status_connection_error": "Connection Error",
|
||||
"controls_prev": "Previous",
|
||||
"controls_next": "Next",
|
||||
"controls_play_pause": "Play/Pause",
|
||||
"stations_title": "Station Collection",
|
||||
"stations_empty": "No stations found in collection.",
|
||||
"menu_theme": "Theme",
|
||||
"menu_language": "Language",
|
||||
"theme_light": "Light",
|
||||
"theme_dark": "Dark",
|
||||
"theme_follow_browser": "Follow Browser",
|
||||
"lang_auto_browser": "Auto (Browser)",
|
||||
"api_docs": "API Documentation"
|
||||
},
|
||||
"de": {
|
||||
"title": "Radio Fernbedienung",
|
||||
"status_loading": "Lädt...",
|
||||
"status_playing": "Wiedergabe",
|
||||
"status_paused": "Pause",
|
||||
"status_error": "Fehler",
|
||||
"status_connection_error": "Verbindungsfehler",
|
||||
"controls_prev": "Zurück",
|
||||
"controls_next": "Weiter",
|
||||
"controls_play_pause": "Play/Pause",
|
||||
"stations_title": "Sender-Sammlung",
|
||||
"stations_empty": "Keine Sender in der Sammlung gefunden.",
|
||||
"menu_theme": "Design",
|
||||
"menu_language": "Sprache",
|
||||
"theme_light": "Hell",
|
||||
"theme_dark": "Dunkel",
|
||||
"theme_follow_browser": "Browser folgen",
|
||||
"lang_auto_browser": "Auto (Browser)",
|
||||
"api_docs": "API Dokumentation"
|
||||
},
|
||||
"fr": {
|
||||
"title": "Télécommande Radio",
|
||||
"status_loading": "Chargement...",
|
||||
"status_playing": "Lecture",
|
||||
"status_paused": "Pause",
|
||||
"status_error": "Erreur",
|
||||
"status_connection_error": "Erreur de connexion",
|
||||
"controls_prev": "Précédent",
|
||||
"controls_next": "Suivant",
|
||||
"controls_play_pause": "Lecture/Pause",
|
||||
"stations_title": "Collection de Stations",
|
||||
"stations_empty": "Aucune station trouvée.",
|
||||
"menu_theme": "Thème",
|
||||
"menu_language": "Langue",
|
||||
"theme_light": "Clair",
|
||||
"theme_dark": "Sombre",
|
||||
"theme_follow_browser": "Suivre le Navigateur",
|
||||
"lang_auto_browser": "Auto (Navigateur)",
|
||||
"api_docs": "Documentation API"
|
||||
},
|
||||
"ru": {
|
||||
"title": "Пульт Радио",
|
||||
"status_loading": "Загрузка...",
|
||||
"status_playing": "Воспроизведение",
|
||||
"status_paused": "Пауза",
|
||||
"status_error": "Ошибка",
|
||||
"status_connection_error": "Ошибка соединения",
|
||||
"controls_prev": "Назад",
|
||||
"controls_next": "Вперед",
|
||||
"controls_play_pause": "Пуск/Пауза",
|
||||
"stations_title": "Коллекция станций",
|
||||
"stations_empty": "Станции не найдены.",
|
||||
"menu_theme": "Тема",
|
||||
"menu_language": "Язык",
|
||||
"theme_light": "Светлая",
|
||||
"theme_dark": "Темная",
|
||||
"theme_follow_browser": "Как in браузере",
|
||||
"lang_auto_browser": "Авто (Браузер)",
|
||||
"api_docs": "Документация API"
|
||||
},
|
||||
"nl": {
|
||||
"title": "Radio Afstandsbediening",
|
||||
"status_loading": "Laden...",
|
||||
"status_playing": "Afspelen",
|
||||
"status_paused": "Gepauzeerd",
|
||||
"status_error": "Fout",
|
||||
"status_connection_error": "Verbindingsfout",
|
||||
"controls_prev": "Vorige",
|
||||
"controls_next": "Volgende",
|
||||
"controls_play_pause": "Afspelen/Pauze",
|
||||
"stations_title": "Zendercollectie",
|
||||
"stations_empty": "Geen zenders gefunden.",
|
||||
"menu_theme": "Thema",
|
||||
"menu_language": "Taal",
|
||||
"theme_light": "Licht",
|
||||
"theme_dark": "Donker",
|
||||
"theme_follow_browser": "Browser volgen",
|
||||
"lang_auto_browser": "Auto (Browser)",
|
||||
"api_docs": "API Documentatie"
|
||||
},
|
||||
"pl": {
|
||||
"title": "Pilot Radio",
|
||||
"status_loading": "Ładowanie...",
|
||||
"status_playing": "Odtwarzanie",
|
||||
"status_paused": "Pauza",
|
||||
"status_error": "Błąd",
|
||||
"status_connection_error": "Błąd połączenia",
|
||||
"controls_prev": "Poprzedni",
|
||||
"controls_next": "Następny",
|
||||
"controls_play_pause": "Odtwarzaj/Pauza",
|
||||
"stations_title": "Kolekcja stacji",
|
||||
"stations_empty": "Nie znaleziono stacji.",
|
||||
"menu_theme": "Motyw",
|
||||
"menu_language": "Język",
|
||||
"theme_light": "Jasny",
|
||||
"theme_dark": "Ciemny",
|
||||
"theme_follow_browser": "Podążaj za przeglądarką",
|
||||
"lang_auto_browser": "Auto (Przeglądarka)",
|
||||
"api_docs": "Dokumentacja API"
|
||||
},
|
||||
"ja": {
|
||||
"title": "ラジオ リモコン",
|
||||
"status_loading": "読み込み中...",
|
||||
"status_playing": "再生中",
|
||||
"status_paused": "一時停止",
|
||||
"status_error": "エラー",
|
||||
"status_connection_error": "接続エラー",
|
||||
"controls_prev": "前へ",
|
||||
"controls_next": "次へ",
|
||||
"controls_play_pause": "再生/一時停止",
|
||||
"stations_title": "ステーション一覧",
|
||||
"stations_empty": "ステーションが見つかりませんでした。",
|
||||
"menu_theme": "テーマ",
|
||||
"menu_language": "言語",
|
||||
"theme_light": "ライト",
|
||||
"theme_dark": "ダーク",
|
||||
"theme_follow_browser": "ブラウザに従う",
|
||||
"lang_auto_browser": "自動 (ブラウザ)",
|
||||
"api_docs": "API ドキュメント"
|
||||
},
|
||||
"uk": {
|
||||
"title": "Пульт Радіо",
|
||||
"status_loading": "Завантаження...",
|
||||
"status_playing": "Відтворення",
|
||||
"status_paused": "Пауза",
|
||||
"status_error": "Помилка",
|
||||
"status_connection_error": "Помилка з'єднання",
|
||||
"controls_prev": "Назад",
|
||||
"controls_next": "Вперед",
|
||||
"controls_play_pause": "Пуск/Пауза",
|
||||
"stations_title": "Колекція станцій",
|
||||
"stations_empty": "Станцій не знайдено.",
|
||||
"menu_theme": "Тема",
|
||||
"menu_language": "Мова",
|
||||
"theme_light": "Світла",
|
||||
"theme_dark": "Темная",
|
||||
"theme_follow_browser": "Як у браузері",
|
||||
"lang_auto_browser": "Авто (Браузер)",
|
||||
"api_docs": "Документация API"
|
||||
},
|
||||
"el": {
|
||||
"title": "Ραδιοφωνικό Χειριστήριο",
|
||||
"status_loading": "Φόρτωση...",
|
||||
"status_playing": "Αναπαραγωγή",
|
||||
"status_paused": "Παύση",
|
||||
"status_error": "Σφάλμα",
|
||||
"status_connection_error": "Σφάλμα σύνδεσης",
|
||||
"controls_prev": "Προηγούμενο",
|
||||
"controls_next": "Επόμενο",
|
||||
"controls_play_pause": "Αναπαραγωγή/Παύση",
|
||||
"stations_title": "Συλλογή Σταθμών",
|
||||
"stations_empty": "Δεν βρέθηκαν σταθμοί.",
|
||||
"menu_theme": "Θέμα",
|
||||
"menu_language": "Γλώσσα",
|
||||
"theme_light": "Φωτεινό",
|
||||
"theme_dark": "Σκοτεινό",
|
||||
"theme_follow_browser": "Ακολουθήστε το πρόγραμμα περιήγησης",
|
||||
"lang_auto_browser": "Αυτόματο (Browser)",
|
||||
"api_docs": "Τεκμηρίωση API"
|
||||
},
|
||||
"da": {
|
||||
"title": "Radio Fjernbetjening",
|
||||
"status_loading": "Indlæser...",
|
||||
"status_playing": "Afspiller",
|
||||
"status_paused": "Pause",
|
||||
"status_error": "Fejl",
|
||||
"status_connection_error": "Forbindelsesfejl",
|
||||
"controls_prev": "Forrige",
|
||||
"controls_next": "Næste",
|
||||
"controls_play_pause": "Afspil/Pause",
|
||||
"stations_title": "Stationssamling",
|
||||
"stations_empty": "Ingen stationer fundet.",
|
||||
"menu_theme": "Tema",
|
||||
"menu_language": "Sprog",
|
||||
"theme_light": "Lyst",
|
||||
"theme_dark": "Mørkt",
|
||||
"theme_follow_browser": "Følg browser",
|
||||
"lang_auto_browser": "Auto (Browser)",
|
||||
"api_docs": "API Dokumentation"
|
||||
}
|
||||
}
|
||||
@@ -20,6 +20,7 @@ object Keys {
|
||||
const val ACTION_COLLECTION_CHANGED: String = "com.michatec.radio.action.COLLECTION_CHANGED"
|
||||
const val ACTION_THEME_CHANGED: String = "com.michatec.radio.action.THEME_CHANGED"
|
||||
const val ACTION_START: String = "com.michatec.radio.action.START"
|
||||
const val ACTION_REMOTE_SERVER_ERROR: String = "com.michatec.radio.action.REMOTE_SERVER_ERROR"
|
||||
|
||||
// intent extras
|
||||
const val EXTRA_COLLECTION_MODIFICATION_DATE: String = "COLLECTION_MODIFICATION_DATE"
|
||||
@@ -97,6 +98,7 @@ object Keys {
|
||||
const val PREF_CUSTOM_THEME_ENABLED: String = "CUSTOM_THEME_ENABLED"
|
||||
const val PREF_CUSTOM_THEME_INDEX: String = "CUSTOM_THEME_INDEX"
|
||||
const val PREF_ARGUMENTS: String = "ARGUMENTS"
|
||||
const val PREF_REMOTE_CONTROL_ENABLED: String = "REMOTE_CONTROL_ENABLED"
|
||||
|
||||
// default const values
|
||||
const val DEFAULT_SIZE_OF_METADATA_HISTORY: Int = 25
|
||||
|
||||
@@ -20,10 +20,12 @@ import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.appcompat.widget.Toolbar
|
||||
import androidx.core.app.ActivityCompat
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.localbroadcastmanager.content.LocalBroadcastManager
|
||||
import androidx.navigation.fragment.NavHostFragment
|
||||
import androidx.navigation.ui.AppBarConfiguration
|
||||
import androidx.navigation.ui.NavigationUI
|
||||
import androidx.navigation.ui.navigateUp
|
||||
import android.content.*
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.michatec.radio.helpers.AppThemeHelper
|
||||
import com.michatec.radio.helpers.FileHelper
|
||||
@@ -132,6 +134,21 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
|
||||
override fun onStart() {
|
||||
super.onStart()
|
||||
// register remote server error receiver
|
||||
LocalBroadcastManager.getInstance(this).registerReceiver(
|
||||
remoteServerErrorReceiver,
|
||||
IntentFilter(Keys.ACTION_REMOTE_SERVER_ERROR)
|
||||
)
|
||||
}
|
||||
|
||||
override fun onStop() {
|
||||
super.onStop()
|
||||
// unregister remote server error receiver
|
||||
LocalBroadcastManager.getInstance(this).unregisterReceiver(remoteServerErrorReceiver)
|
||||
}
|
||||
|
||||
/* Hides the loading/splash overlay */
|
||||
private fun hideLoadingOverlay() {
|
||||
findViewById<View>(R.id.loading_layout)?.let { overlay ->
|
||||
@@ -220,6 +237,24 @@ class MainActivity : AppCompatActivity() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Receiver for remote server error
|
||||
*/
|
||||
private val remoteServerErrorReceiver: BroadcastReceiver = object : BroadcastReceiver() {
|
||||
override fun onReceive(context: Context, intent: Intent) {
|
||||
if (intent.action == Keys.ACTION_REMOTE_SERVER_ERROR) {
|
||||
val snackbar = Snackbar.make(
|
||||
findViewById(R.id.main_root),
|
||||
R.string.error_webserver,
|
||||
Snackbar.LENGTH_LONG
|
||||
)
|
||||
snackbar.anchorView = findViewById(R.id.bottom_sheet)
|
||||
snackbar.show()
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
* End of declaration
|
||||
*/
|
||||
|
||||
@@ -60,6 +60,33 @@ class PlayerService : MediaLibraryService(), SharedPreferences.OnSharedPreferenc
|
||||
private var playLastStation: Boolean = false
|
||||
private var manuallyCancelledSleepTimer = false
|
||||
|
||||
private val remoteControlServer: RemoteControlServer by lazy {
|
||||
RemoteControlServer(this).apply {
|
||||
onPlayStation = { uuid ->
|
||||
playStation(uuid)
|
||||
}
|
||||
onPause = {
|
||||
player.pause()
|
||||
}
|
||||
onResume = {
|
||||
player.play()
|
||||
}
|
||||
onNext = {
|
||||
playNextStation()
|
||||
}
|
||||
onPrev = {
|
||||
playPreviousStation()
|
||||
}
|
||||
|
||||
onError = { error ->
|
||||
Log.e(TAG, "RemoteControlServer error: $error")
|
||||
PreferencesHelper.saveRemoteControlEnabled(false)
|
||||
val intent = Intent(Keys.ACTION_REMOTE_SERVER_ERROR)
|
||||
LocalBroadcastManager.getInstance(this@PlayerService).sendBroadcast(intent)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Native Audio Processor instance
|
||||
private val nativeAudioProcessor = NativeAudioProcessor()
|
||||
|
||||
@@ -77,6 +104,13 @@ class PlayerService : MediaLibraryService(), SharedPreferences.OnSharedPreferenc
|
||||
// initialize player and session
|
||||
initializePlayer()
|
||||
initializeSession()
|
||||
|
||||
// start remote control server if enabled
|
||||
if (PreferencesHelper.loadRemoteControlEnabled()) {
|
||||
remoteControlServer.setPlayer(player)
|
||||
remoteControlServer.start()
|
||||
}
|
||||
|
||||
val notificationProvider: DefaultMediaNotificationProvider = CustomNotificationProvider()
|
||||
notificationProvider.setSmallIcon(R.drawable.ic_notification_app_icon_white_24dp)
|
||||
setMediaNotificationProvider(notificationProvider)
|
||||
@@ -105,6 +139,12 @@ class PlayerService : MediaLibraryService(), SharedPreferences.OnSharedPreferenc
|
||||
}
|
||||
|
||||
|
||||
/* Overrides onStartCommand from Service */
|
||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||
super.onStartCommand(intent, flags, startId)
|
||||
return START_STICKY
|
||||
}
|
||||
|
||||
/* Overrides onTaskRemoved from Service */
|
||||
override fun onTaskRemoved(rootIntent: Intent?) {
|
||||
if (!player.playWhenReady) {
|
||||
@@ -369,6 +409,14 @@ class PlayerService : MediaLibraryService(), SharedPreferences.OnSharedPreferenc
|
||||
castPlayer.volume = 1f
|
||||
}
|
||||
}
|
||||
Keys.PREF_REMOTE_CONTROL_ENABLED -> {
|
||||
if (PreferencesHelper.loadRemoteControlEnabled()) {
|
||||
remoteControlServer.setPlayer(player)
|
||||
remoteControlServer.start()
|
||||
} else {
|
||||
remoteControlServer.stop()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,6 +442,13 @@ class PlayerService : MediaLibraryService(), SharedPreferences.OnSharedPreferenc
|
||||
}
|
||||
}
|
||||
|
||||
/* Starts playback of a radio station by UUID (centralized logic) */
|
||||
fun playStation(uuid: String) {
|
||||
val station = CollectionHelper.getStation(collection, uuid)
|
||||
if (station.isValid()) {
|
||||
playStation(station)
|
||||
}
|
||||
}
|
||||
|
||||
/* Starts playback of a radio station */
|
||||
private fun playStation(station: Station) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import android.content.ClipData
|
||||
import android.content.ClipboardManager
|
||||
import android.content.Context
|
||||
import android.content.Intent
|
||||
import android.content.pm.PackageManager
|
||||
import android.net.Uri
|
||||
import android.os.Bundle
|
||||
import android.util.Log
|
||||
@@ -13,21 +14,31 @@ import androidx.activity.result.ActivityResult
|
||||
import androidx.activity.result.contract.ActivityResultContracts.StartActivityForResult
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.core.net.toUri
|
||||
import androidx.media3.common.util.UnstableApi
|
||||
import androidx.navigation.fragment.findNavController
|
||||
import androidx.preference.*
|
||||
import androidx.preference.EditTextPreference
|
||||
import androidx.preference.Preference
|
||||
import androidx.preference.PreferenceCategory
|
||||
import androidx.preference.PreferenceFragmentCompat
|
||||
import com.google.android.material.snackbar.Snackbar
|
||||
import com.michatec.radio.dialogs.ErrorDialog
|
||||
import com.michatec.radio.dialogs.LanguageSelectionDialog
|
||||
import com.michatec.radio.dialogs.PresetSelectionDialog
|
||||
import com.michatec.radio.dialogs.ThemeSelectionDialog
|
||||
import com.michatec.radio.dialogs.YesNoDialog
|
||||
import com.michatec.radio.helpers.*
|
||||
import android.content.pm.PackageManager
|
||||
import com.michatec.radio.helpers.AppThemeHelper
|
||||
import com.michatec.radio.helpers.BackupHelper
|
||||
import com.michatec.radio.helpers.FileHelper
|
||||
import com.michatec.radio.helpers.LanguageHelper
|
||||
import com.michatec.radio.helpers.MarqueeSwitchPreference
|
||||
import com.michatec.radio.helpers.NetworkHelper
|
||||
import com.michatec.radio.helpers.PreferencesHelper
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers.IO
|
||||
import kotlinx.coroutines.launch
|
||||
import java.text.SimpleDateFormat
|
||||
import java.util.*
|
||||
import java.util.Date
|
||||
import java.util.Locale
|
||||
|
||||
|
||||
/*
|
||||
@@ -59,6 +70,7 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
|
||||
}
|
||||
|
||||
/* Overrides onCreatePreferences from PreferenceFragmentCompat */
|
||||
@UnstableApi
|
||||
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) {
|
||||
|
||||
val context = preferenceManager.context
|
||||
@@ -182,6 +194,29 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
|
||||
PreferencesHelper.loadEditStreamUrisEnabled(context)
|
||||
}
|
||||
|
||||
// set up "Remote Control" preference
|
||||
val preferenceRemoteControl = MarqueeSwitchPreference(context)
|
||||
preferenceRemoteControl.title = getString(R.string.pref_remote_control_title)
|
||||
preferenceRemoteControl.setIcon(R.drawable.ic_network_check_24dp)
|
||||
preferenceRemoteControl.key = Keys.PREF_REMOTE_CONTROL_ENABLED
|
||||
val localIp = NetworkHelper.getLocalIpAddress(context)
|
||||
preferenceRemoteControl.summary = if (localIp != null) {
|
||||
getString(R.string.pref_remote_control_url, localIp)
|
||||
} else {
|
||||
getString(R.string.pref_remote_control_summary)
|
||||
}
|
||||
preferenceRemoteControl.setDefaultValue(PreferencesHelper.loadRemoteControlEnabled())
|
||||
preferenceRemoteControl.setOnPreferenceChangeListener { _, newValue ->
|
||||
val enabled = newValue as Boolean
|
||||
if (enabled) {
|
||||
val intent = Intent(activity, PlayerService::class.java).apply {
|
||||
action = Keys.ACTION_START
|
||||
}
|
||||
activity?.startService(intent)
|
||||
}
|
||||
return@setOnPreferenceChangeListener true
|
||||
}
|
||||
|
||||
// set up "Arguments" preference
|
||||
val preferenceArguments = EditTextPreference(context)
|
||||
preferenceArguments.title = getString(R.string.pref_arguments_title)
|
||||
@@ -501,6 +536,7 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
|
||||
preferenceCategoryAdvanced.addPreference(preferenceBufferSize)
|
||||
preferenceCategoryAdvanced.addPreference(preferenceEnableEditingGeneral)
|
||||
preferenceCategoryAdvanced.addPreference(preferenceEnableEditingStreamUri)
|
||||
preferenceCategoryAdvanced.addPreference(preferenceRemoteControl)
|
||||
preferenceCategoryAdvanced.addPreference(preferenceArguments)
|
||||
|
||||
screen.addPreference(preferenceCategoryLinks)
|
||||
|
||||
@@ -34,6 +34,21 @@ object NetworkHelper {
|
||||
}
|
||||
|
||||
|
||||
/* Gets the IP address of the device on the local network */
|
||||
fun getLocalIpAddress(context: Context): String? {
|
||||
val connMgr = context.getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager
|
||||
val activeNetwork: Network = connMgr.activeNetwork ?: return null
|
||||
val linkProperties = connMgr.getLinkProperties(activeNetwork) ?: return null
|
||||
for (linkAddress in linkProperties.linkAddresses) {
|
||||
val address = linkAddress.address
|
||||
if (!address.isLoopbackAddress && address is InetAddress && address.hostAddress?.contains(":") == false) {
|
||||
return address.hostAddress
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
|
||||
/* Detects content type (mime type) from given URL string - async using coroutine - use only on separate threat */
|
||||
fun detectContentType(urlString: String): ContentType {
|
||||
Log.v(TAG, "Determining content type - Thread: ${Thread.currentThread().name}")
|
||||
|
||||
@@ -406,6 +406,18 @@ object PreferencesHelper {
|
||||
return arguments.any { it.lowercase().sha256() == targetHash }
|
||||
}
|
||||
|
||||
/* Loads whether remote control is enabled */
|
||||
fun loadRemoteControlEnabled(): Boolean {
|
||||
return sharedPreferences.getBoolean(Keys.PREF_REMOTE_CONTROL_ENABLED, false)
|
||||
}
|
||||
|
||||
/* Saves whether remote control is enabled */
|
||||
fun saveRemoteControlEnabled(enabled: Boolean) {
|
||||
sharedPreferences.edit {
|
||||
putBoolean(Keys.PREF_REMOTE_CONTROL_ENABLED, enabled)
|
||||
}
|
||||
}
|
||||
|
||||
/* SHA-256 helper */
|
||||
private fun String.sha256(): String {
|
||||
return try {
|
||||
|
||||
@@ -0,0 +1,274 @@
|
||||
package com.michatec.radio.helpers
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import androidx.media3.common.Player
|
||||
import com.michatec.radio.BuildConfig
|
||||
import io.ktor.http.*
|
||||
import io.ktor.serialization.gson.*
|
||||
import io.ktor.server.application.*
|
||||
import io.ktor.server.engine.*
|
||||
import io.ktor.server.netty.*
|
||||
import io.ktor.server.plugins.contentnegotiation.*
|
||||
import io.ktor.server.response.*
|
||||
import io.ktor.server.routing.*
|
||||
import kotlinx.coroutines.*
|
||||
import kotlinx.coroutines.sync.Mutex
|
||||
import kotlinx.coroutines.sync.withLock
|
||||
import java.io.File
|
||||
import java.net.BindException
|
||||
import kotlin.time.Duration.Companion.milliseconds
|
||||
|
||||
class RemoteControlServer(private val context: Context) {
|
||||
|
||||
private var server: EmbeddedServer<NettyApplicationEngine, NettyApplicationEngine.Configuration>? = null
|
||||
private var player: Player? = null
|
||||
private val serverScope = CoroutineScope(Dispatchers.IO + SupervisorJob())
|
||||
private val lifecycleMutex = Mutex()
|
||||
var onPlayStation: ((String) -> Unit)? = null
|
||||
var onPause: (() -> Unit)? = null
|
||||
var onResume: (() -> Unit)? = null
|
||||
var onNext: (() -> Unit)? = null
|
||||
var onPrev: (() -> Unit)? = null
|
||||
var onError: ((String) -> Unit)? = null
|
||||
|
||||
fun setPlayer(player: Player?) {
|
||||
this.player = player
|
||||
}
|
||||
|
||||
private fun safeReadAsset(path: String): ByteArray? {
|
||||
return try {
|
||||
context.assets.open(path).use { it.readBytes() }
|
||||
} catch (e: Exception) {
|
||||
Log.e("RemoteControlServer", "Failed to read asset: $path", e)
|
||||
null
|
||||
}
|
||||
}
|
||||
|
||||
fun start() {
|
||||
serverScope.launch {
|
||||
lifecycleMutex.withLock {
|
||||
if (server != null) {
|
||||
Log.d("RemoteControlServer", "Server is already running.")
|
||||
return@withLock
|
||||
}
|
||||
|
||||
var attempt = 1
|
||||
val maxAttempts = 5
|
||||
|
||||
while (attempt <= maxAttempts) {
|
||||
try {
|
||||
Log.i("RemoteControlServer", "Starting server (attempt $attempt)...")
|
||||
val newServer = embeddedServer(Netty, port = 8080, host = "0.0.0.0") {
|
||||
install(ContentNegotiation) {
|
||||
gson()
|
||||
}
|
||||
routing {
|
||||
get("/") {
|
||||
val content = safeReadAsset("web/index.html")
|
||||
if (content != null) {
|
||||
call.response.header(HttpHeaders.CacheControl, "no-cache, no-store, must-revalidate")
|
||||
call.respondBytes(content, ContentType.Text.Html)
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound)
|
||||
}
|
||||
}
|
||||
get("/style.css") {
|
||||
val content = safeReadAsset("web/style.css")
|
||||
if (content != null) {
|
||||
call.respondBytes(content, ContentType.Text.CSS)
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound)
|
||||
}
|
||||
}
|
||||
get("/script.js") {
|
||||
val content = safeReadAsset("web/script.js")
|
||||
if (content != null) {
|
||||
call.response.header(HttpHeaders.CacheControl, "no-cache, no-store, must-revalidate")
|
||||
call.respondBytes(content, ContentType.Application.JavaScript)
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound)
|
||||
}
|
||||
}
|
||||
get("/translations.json") {
|
||||
val content = safeReadAsset("web/translations.json")
|
||||
if (content != null) {
|
||||
call.respondBytes(content, ContentType.Application.Json)
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound)
|
||||
}
|
||||
}
|
||||
get("/favicon.png") {
|
||||
val content = safeReadAsset("web/favicon.png")
|
||||
if (content != null) {
|
||||
call.respondBytes(content, ContentType.Image.PNG)
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound)
|
||||
}
|
||||
}
|
||||
|
||||
get("/api/config") {
|
||||
try {
|
||||
call.respond(mapOf("version" to BuildConfig.VERSION_NAME))
|
||||
} catch (e: Exception) {
|
||||
call.respond(HttpStatusCode.InternalServerError, mapOf("error" to e.message))
|
||||
}
|
||||
}
|
||||
|
||||
get("/api/status") {
|
||||
val p = player
|
||||
if (p == null) {
|
||||
call.respond(HttpStatusCode.ServiceUnavailable, mapOf("error" to "Player not available"))
|
||||
} else {
|
||||
try {
|
||||
val status = withContext(Dispatchers.Main) {
|
||||
val metadataHistory = PreferencesHelper.loadMetadataHistory()
|
||||
val currentTrack = if (metadataHistory.isNotEmpty()) metadataHistory.last() else ""
|
||||
val mediaId = p.currentMediaItem?.mediaId ?: PreferencesHelper.loadLastPlayedStationUuid()
|
||||
|
||||
mapOf(
|
||||
"isPlaying" to p.isPlaying,
|
||||
"playbackState" to p.playbackState,
|
||||
"currentStationUuid" to mediaId,
|
||||
"metadata" to currentTrack
|
||||
)
|
||||
}
|
||||
call.respond(status)
|
||||
} catch (e: Exception) {
|
||||
call.respond(HttpStatusCode.InternalServerError, mapOf("error" to e.message))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
get("/api/stations") {
|
||||
try {
|
||||
val collection = withContext(Dispatchers.IO) {
|
||||
FileHelper.readCollection(context)
|
||||
}
|
||||
val simplifiedStations = collection.stations.map {
|
||||
mapOf(
|
||||
"uuid" to it.uuid,
|
||||
"name" to it.name,
|
||||
"hasImage" to it.smallImage.isNotEmpty()
|
||||
)
|
||||
}
|
||||
call.respond(simplifiedStations)
|
||||
} catch (e: Exception) {
|
||||
call.respond(HttpStatusCode.InternalServerError, mapOf("error" to e.message))
|
||||
}
|
||||
}
|
||||
|
||||
get("/api/image/{uuid}") {
|
||||
val uuid = call.parameters["uuid"]
|
||||
if (uuid != null) {
|
||||
try {
|
||||
val collection = withContext(Dispatchers.IO) {
|
||||
FileHelper.readCollection(context)
|
||||
}
|
||||
val station = CollectionHelper.getStation(collection, uuid)
|
||||
if (station.smallImage.isNotEmpty()) {
|
||||
val imageFile = File(context.getExternalFilesDir(""), FileHelper.determineDestinationFolderPath(com.michatec.radio.Keys.FILE_TYPE_IMAGE, uuid) + "/" + com.michatec.radio.Keys.STATION_IMAGE_FILE)
|
||||
if (imageFile.exists()) {
|
||||
call.respondBytes(imageFile.readBytes(), ContentType.Image.JPEG)
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound)
|
||||
}
|
||||
} else {
|
||||
call.respond(HttpStatusCode.NotFound)
|
||||
}
|
||||
} catch (_: Exception) {
|
||||
call.respond(HttpStatusCode.InternalServerError)
|
||||
}
|
||||
} else {
|
||||
call.respond(HttpStatusCode.BadRequest)
|
||||
}
|
||||
}
|
||||
|
||||
post("/api/play/{uuid}") {
|
||||
val uuid = call.parameters["uuid"]
|
||||
if (uuid != null) {
|
||||
Log.i("RemoteControlServer", "Play request for: $uuid")
|
||||
withContext(Dispatchers.Main) {
|
||||
onPlayStation?.invoke(uuid)
|
||||
}
|
||||
call.respond(mapOf("status" to "ok"))
|
||||
}
|
||||
}
|
||||
|
||||
post("/api/pause") {
|
||||
Log.i("RemoteControlServer", "Pause request")
|
||||
withContext(Dispatchers.Main) {
|
||||
onPause?.invoke()
|
||||
}
|
||||
call.respond(mapOf("status" to "ok"))
|
||||
}
|
||||
|
||||
post("/api/resume") {
|
||||
Log.i("RemoteControlServer", "Resume request")
|
||||
withContext(Dispatchers.Main) {
|
||||
onResume?.invoke()
|
||||
}
|
||||
call.respond(mapOf("status" to "ok"))
|
||||
}
|
||||
|
||||
post("/api/next") {
|
||||
Log.i("RemoteControlServer", "Next request")
|
||||
withContext(Dispatchers.Main) {
|
||||
onNext?.invoke()
|
||||
}
|
||||
call.respond(mapOf("status" to "ok"))
|
||||
}
|
||||
|
||||
post("/api/prev") {
|
||||
Log.i("RemoteControlServer", "Prev request")
|
||||
withContext(Dispatchers.Main) {
|
||||
onPrev?.invoke()
|
||||
}
|
||||
call.respond(mapOf("status" to "ok"))
|
||||
}
|
||||
}
|
||||
}
|
||||
server = newServer
|
||||
newServer.start(wait = false)
|
||||
Log.i("RemoteControlServer", "Server successfully started on port 8080")
|
||||
return@withLock
|
||||
} catch (e: Exception) {
|
||||
if (e is BindException || e.cause is BindException) {
|
||||
Log.w("RemoteControlServer", "Port 8080 busy, retrying in 1s...")
|
||||
delay(1000.milliseconds)
|
||||
attempt++
|
||||
} else {
|
||||
Log.e("RemoteControlServer", "Critical server error", e)
|
||||
onError?.invoke(e.localizedMessage ?: "Critical error")
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
Log.e("RemoteControlServer", "Failed to start after $maxAttempts attempts")
|
||||
onError?.invoke("Port 8080 is blocked by another process.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fun stop() {
|
||||
serverScope.launch {
|
||||
lifecycleMutex.withLock {
|
||||
stopInternal()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun stopInternal() {
|
||||
val s = server
|
||||
server = null
|
||||
if (s != null) {
|
||||
try {
|
||||
Log.i("RemoteControlServer", "Stopping server...")
|
||||
s.stop(50, 100)
|
||||
Log.i("RemoteControlServer", "Server stopped")
|
||||
} catch (e: Exception) {
|
||||
Log.e("RemoteControlServer", "Error stopping server", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -185,4 +185,10 @@
|
||||
<string name="widget_favorites_title">Favoritter</string>
|
||||
<string name="widget_favorites_empty">Ingen favoritter tilføjet endnu.</string>
|
||||
<string name="widget_favorites_description">Viser en liste over dine yndlingsstationer for hurtig adgang.</string>
|
||||
|
||||
<!-- Remote Control -->
|
||||
<string name="pref_remote_control_title">Fjernbetjening</string>
|
||||
<string name="pref_remote_control_summary">Betjen radioen fra din webbrowser</string>
|
||||
<string name="pref_remote_control_url">Betjen radioen fra http://%1$s:8080</string>
|
||||
<string name="error_webserver">Web fjernbetjeningsserver crashet/stoppede.</string>
|
||||
</resources>
|
||||
@@ -187,4 +187,10 @@
|
||||
<string name="widget_favorites_title">Favoriten</string>
|
||||
<string name="widget_favorites_empty">Noch keine Favoriten hinzugefügt.</string>
|
||||
<string name="widget_favorites_description">Zeigt eine Liste deiner Favoriten-Sender für den Schnellzugriff.</string>
|
||||
|
||||
<!-- Remote Control -->
|
||||
<string name="pref_remote_control_title">Fernbedienung</string>
|
||||
<string name="pref_remote_control_summary">Steuere das Radio über deinen Webbrowser</string>
|
||||
<string name="pref_remote_control_url">Steuere das Radio über http://%1$s:8080</string>
|
||||
<string name="error_webserver">Web-Fernbedienungsserver abgestürzt/gestoppt.</string>
|
||||
</resources>
|
||||
@@ -187,4 +187,10 @@
|
||||
<string name="widget_favorites_title">Αγαπημένα</string>
|
||||
<string name="widget_favorites_empty">Δεν έχουν προστεθεί ακόμα αγαπημένα.</string>
|
||||
<string name="widget_favorites_description">Εμφανίζει μια λίστα με τους αγαπημένους σας σταθμούς για γρήγορη πρόσβαση.</string>
|
||||
|
||||
<!-- Remote Control -->
|
||||
<string name="pref_remote_control_title">Τηλεχειριστήριο</string>
|
||||
<string name="pref_remote_control_summary">Ελέγξτε το ραδιόφωνο από το πρόγραμμα περιήγησής σας</string>
|
||||
<string name="pref_remote_control_url">Ελέγξτε το ραδιόφωνο από το http://%1$s:8080</string>
|
||||
<string name="error_webserver">Ο διακομιστής τηλεχειριστηρίου ιστού κατέρρευσε/σταμάτησε.</string>
|
||||
</resources>
|
||||
@@ -185,4 +185,10 @@
|
||||
<string name="widget_favorites_title">Favoris</string>
|
||||
<string name="widget_favorites_empty">Aucun favori ajouté pour le moment.</string>
|
||||
<string name="widget_favorites_description">Affiche une liste de vos stations préférées pour un accès rapide.</string>
|
||||
|
||||
<!-- Remote Control -->
|
||||
<string name="pref_remote_control_title">Télécommande</string>
|
||||
<string name="pref_remote_control_summary">Contrôlez la radio depuis votre navigateur web</string>
|
||||
<string name="pref_remote_control_url">Contrôlez la radio depuis http://%1$s:8080</string>
|
||||
<string name="error_webserver">Serveur de télécommande Web planté/arrêté.</string>
|
||||
</resources>
|
||||
@@ -130,9 +130,9 @@
|
||||
<string name="dialog_yes_no_positive_button_update_collection">更新</string>
|
||||
<string name="pref_audio_effects_title">オーディオエフェクト</string>
|
||||
<string name="pref_bass_boost_title">バスブースト</string>
|
||||
<string name="pref_bass_boost_summary">低音を増強します。</string>
|
||||
<string name="pref_security_title">セキュリティ</string>
|
||||
<string name="pref_security_summary">このアプリケーションのセキュリティについて詳しく知る</string>
|
||||
<string name="pref_bass_boost_summary">低音を増強します。</string>
|
||||
<string name="pref_reverb_title">リバーブ</string>
|
||||
<string name="pref_reverb_summary">リバーブミスを調整します。</string>
|
||||
<string name="pref_drc_title">ダイナミックレンジ圧縮</string>
|
||||
@@ -186,4 +186,10 @@
|
||||
<string name="widget_favorites_title">お気に入り</string>
|
||||
<string name="widget_favorites_empty">お気に入りはまだ追加されていません。</string>
|
||||
<string name="widget_favorites_description">お気に入りのステーションを一覧表示し、素早くアクセスできます。</string>
|
||||
|
||||
<!-- Remote Control -->
|
||||
<string name="pref_remote_control_title">リモコン</string>
|
||||
<string name="pref_remote_control_summary">ウェブブラウザからラジオを操作</string>
|
||||
<string name="pref_remote_control_url">http://%1$s:8080 からラジオを操作</string>
|
||||
<string name="error_webserver">Webリモートサーバーがクラッシュ/停止しました。</string>
|
||||
</resources>
|
||||
@@ -187,4 +187,10 @@
|
||||
<string name="widget_favorites_title">Favorieten</string>
|
||||
<string name="widget_favorites_empty">Nog geen favorieten toegevoegd.</string>
|
||||
<string name="widget_favorites_description">Toont een lijst met je favoriete zenders voor snelle toegang.</string>
|
||||
|
||||
<!-- Remote Control -->
|
||||
<string name="pref_remote_control_title">Afstandsbediening</string>
|
||||
<string name="pref_remote_control_summary">Bedien de radio vanuit je webbrowser</string>
|
||||
<string name="pref_remote_control_url">Bedien de radio via http://%1$s:8080</string>
|
||||
<string name="error_webserver">De webserver voor de afstandsbediening is gecrasht of gestopt.</string>
|
||||
</resources>
|
||||
@@ -187,4 +187,9 @@
|
||||
<string name="widget_favorites_title">Ulubione</string>
|
||||
<string name="widget_favorites_empty">Nie dodano jeszcze żadnych ulubionych.</string>
|
||||
<string name="widget_favorites_description">Wyświetla listę ulubionych stacji, zapewniając szybki dostęp.</string>
|
||||
<!-- Remote Control -->
|
||||
<string name="pref_remote_control_title">Pilot</string>
|
||||
<string name="pref_remote_control_summary">Steruj radiem z przeglądarki internetowej</string>
|
||||
<string name="pref_remote_control_url">Steruj radiem przez http://%1$s:8080</string>
|
||||
<string name="error_webserver">Serwer zdalnego sterowania uległ awarii/zatrzymaniu.</string>
|
||||
</resources>
|
||||
@@ -187,4 +187,10 @@
|
||||
<string name="widget_favorites_title">Избранное</string>
|
||||
<string name="widget_favorites_empty">Избранное пока не добавлено.</string>
|
||||
<string name="widget_favorites_description">Показывает список ваших любимых станций для быстрого доступа.</string>
|
||||
|
||||
<!-- Remote Control -->
|
||||
<string name="pref_remote_control_title">Удалённое управление</string>
|
||||
<string name="pref_remote_control_summary">Управляйте радио из вашего веб-браузера</string>
|
||||
<string name="pref_remote_control_url">Управляйте радио через http://%1$s:8080</string>
|
||||
<string name="error_webserver">Веб-сервер удалённого управления упал/остановлен.</string>
|
||||
</resources>
|
||||
@@ -187,4 +187,10 @@
|
||||
<string name="widget_favorites_title">Обране</string>
|
||||
<string name="widget_favorites_empty">Ще не додано жодної станції до обраного.</string>
|
||||
<string name="widget_favorites_description">Показує список ваших улюблених станцій для швидкого доступу.</string>
|
||||
|
||||
<!-- Remote Control -->
|
||||
<string name="pref_remote_control_title">Дистанційне керування</string>
|
||||
<string name="pref_remote_control_summary">Керуйте радіо з вашого веб-браузера</string>
|
||||
<string name="pref_remote_control_url">Керуйте радіо через http://%1$s:8080</string>
|
||||
<string name="error_webserver">Веб-сервер дистанційного керування аварійно зупинився/зупинено.</string>
|
||||
</resources>
|
||||
@@ -222,4 +222,10 @@
|
||||
<string name="widget_favorites_title">Favorites</string>
|
||||
<string name="widget_favorites_empty">No favorites added yet.</string>
|
||||
<string name="widget_favorites_description">Shows a list of your favorite stations for quick access.</string>
|
||||
|
||||
<!-- Remote Control -->
|
||||
<string name="pref_remote_control_title">Remote Control</string>
|
||||
<string name="pref_remote_control_summary">Control radio from your web browser</string>
|
||||
<string name="pref_remote_control_url">Control radio from http://%1$s:8080</string>
|
||||
<string name="error_webserver">Web Remote server crashed / stopped.</string>
|
||||
</resources>
|
||||
@@ -6,6 +6,7 @@ freedroidwarn = "V1.13"
|
||||
gson = "2.14.0"
|
||||
kotlin = "2.4.10"
|
||||
leanback = "1.2.0"
|
||||
ktor = "3.5.1"
|
||||
material = "1.14.0"
|
||||
material3 = "1.4.0"
|
||||
media = "1.8.0"
|
||||
@@ -39,7 +40,14 @@ volley = { group = "com.android.volley", name = "volley", version.ref = "volley"
|
||||
work-runtime-ktx = { group = "androidx.work", name = "work-runtime-ktx", version.ref = "workRuntimeKtx" }
|
||||
play-services-cast-framework = { group = "com.google.android.gms", name = "play-services-cast-framework", version.ref = "playServicesCastFramework" }
|
||||
|
||||
ktor-server-core = { group = "io.ktor", name = "ktor-server-core", version.ref = "ktor" }
|
||||
ktor-server-netty = { group = "io.ktor", name = "ktor-server-netty", version.ref = "ktor" }
|
||||
ktor-server-content-negotiation = { group = "io.ktor", name = "ktor-server-content-negotiation", version.ref = "ktor" }
|
||||
ktor-serialization-kotlinx-json = { group = "io.ktor", name = "ktor-serialization-kotlinx-json", version.ref = "ktor" }
|
||||
ktor-serialization-gson = { group = "io.ktor", name = "ktor-serialization-gson", version.ref = "ktor" }
|
||||
|
||||
[plugins]
|
||||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||||
android-library = { id = "com.android.library", version.ref = "agp" }
|
||||
jetbrains-kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||||
Reference in new issue
Block a user