v0.2.2: Add monolib docs and readme

Signed-off-by: Ivan Bushchik <ivabus@ivabus.dev>
This commit is contained in:
Ivan Bushchik 2024-03-15 18:49:17 +03:00
parent 9165c43dae
commit 0afbed5758
No known key found for this signature in database
GPG key ID: 2F16FBF3262E090C
8 changed files with 47 additions and 9 deletions

6
Cargo.lock generated
View file

@ -597,7 +597,7 @@ checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c"
[[package]]
name = "lonelyradio"
version = "0.2.1"
version = "0.2.2"
dependencies = [
"chrono",
"clap",
@ -653,7 +653,7 @@ dependencies = [
[[package]]
name = "monoclient"
version = "0.2.1"
version = "0.2.2"
dependencies = [
"clap",
"monolib",
@ -661,7 +661,7 @@ dependencies = [
[[package]]
name = "monolib"
version = "0.2.1"
version = "0.2.2"
dependencies = [
"byteorder",
"rmp-serde",

View file

@ -4,7 +4,7 @@ members = [ "monoclient", "monolib"]
[package]
name = "lonelyradio"
description = "TCP radio for lonely ones"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
license = "MIT"
authors = ["Ivan Bushchik <ivabus@ivabus.dev>"]

View file

@ -6,6 +6,12 @@ Radio that uses unencrypted TCP socket for broadcasting tagged audio data.
Decodes audio streams using [symphonia](https://github.com/pdeljanov/Symphonia).
## Install
```shell
cargo install lonelyradio
```
## Build
```shell
@ -36,4 +42,4 @@ SwiftUI client is availible in [platform](./platform) directory.
## License
lonelyradio and monoclient are licensed under the terms of the [MIT license](./LICENSE).
lonelyradio, monolib and monoclient are licensed under the terms of the [MIT license](./LICENSE).

View file

@ -1,6 +1,6 @@
[package]
name = "monoclient"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
license = "MIT"

View file

@ -1,6 +1,6 @@
[package]
name = "monolib"
version = "0.2.1"
version = "0.2.2"
edition = "2021"
license = "MIT"
description = "A library implementing the lonely radio audio streaming protocol"

16
monolib/README.md Normal file
View file

@ -0,0 +1,16 @@
# Monolib
A library implementing the lonely radio audio streaming protocol
## Documentation
[Docs.rs](https://docs.rs/monolib)
## Examples
- [CLI](../monoclient)
- [SwiftUI](../platform/swiftui)
## License
monolib is licensed under the terms of the [MIT license](../LICENSE).

View file

@ -1,3 +1,19 @@
//! A library implementing the lonely radio audio streaming protocol
//!
//! Example usage (play for 10 seconds):
//! ```rust
//! extern crate monolib;
//! use std::thread::{sleep, spawn};
//! use std::time::Duration;
//!
//! spawn(|| monolib::run("someserver:someport"));
//! while monolib::get_metadata().is_none() {}
//! let seconds = md.length / md.sample_rate as u64 / 2;
//! println!("Playing: {} - {} - {} ({}:{:02})", md.artist, md.album, md.title, seconds / 60, seconds % 60);
//! sleep(Duration::from_secs(10));
//! monolib::stop();
//!```
/// Functions, providing C-like API
pub mod c;

View file

@ -26,8 +26,8 @@ class MonoLib {
struct ContentView: View {
let timer = Timer.publish(every: 0.25, on: .main, in: .common).autoconnect()
@State private var server: String = "ivabus.dev"
@State private var port: String = "5894"
@State private var server: String = ""
@State private var port: String = ""
@State private var playing: Bool = true
@State private var running: Bool = false