A lot of pointless stuff
This commit is contained in:
18
lib/build.rs
18
lib/build.rs
@@ -1,17 +1,29 @@
|
||||
use std::{env, io::Result, path::PathBuf};
|
||||
use std::{env, fs, io::Result, path::PathBuf};
|
||||
|
||||
fn main() -> Result<()> {
|
||||
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
|
||||
//let proto_dir = "proto";
|
||||
//let paths = fs::read_dir(proto_dir).unwrap();
|
||||
//for path in paths {
|
||||
// prost_build::compile_protos(&[path.unwrap().path()], &[proto_dir])?;
|
||||
// let path_str = path.unwrap().path().to_str().unwrap().to_string();
|
||||
// let descriptor = format!("{}_descriptor.bin", path_str);
|
||||
// tonic_prost_build::configure()
|
||||
// .file_descriptor_set_path(out_dir.join("audio_backend_descriptor.bin"))
|
||||
// .compile_protos(&["proto/audio_backend.proto"], &["proto"])
|
||||
// .unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
|
||||
//}
|
||||
//
|
||||
|
||||
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
|
||||
tonic_prost_build::configure()
|
||||
.file_descriptor_set_path(out_dir.join("audio_backend_descriptor.bin"))
|
||||
.compile_protos(&["proto/audio_backend.proto"], &["proto"])
|
||||
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
|
||||
|
||||
tonic_prost_build::configure()
|
||||
.file_descriptor_set_path(out_dir.join("track_descriptor.bin"))
|
||||
.compile_protos(&["proto/track.proto"], &["proto"])
|
||||
.unwrap_or_else(|e| panic!("Failed to compile protos {:?}", e));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -3,12 +3,41 @@ package termix.audio_backend;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service AudioBackend {
|
||||
rpc StartClient(google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
service AudioBackendRPC {
|
||||
// Stop the active audio server
|
||||
rpc StopClient(google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
// Start the audio server of choice
|
||||
rpc StartClient(DesiredAudioBacked) returns (google.protobuf.Empty);
|
||||
// Get information about the possible audio backend configuration options
|
||||
rpc DescribeBackend(DesiredAudioBacked) returns (AudioBackendDescription);
|
||||
rpc InitConnection(google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
rpc GetAvailableBackends(google.protobuf.Empty) returns (BackendList);
|
||||
}
|
||||
|
||||
enum SupportedAudioBackends {
|
||||
AB_UNSPECIFIED = 0;
|
||||
AB_JACK = 1;
|
||||
AB_COREAUDIO = 2;
|
||||
}
|
||||
|
||||
message DesiredAudioBacked {
|
||||
SupportedAudioBackends backend = 1;
|
||||
CoreAudioOptions core_audio_opts = 2;
|
||||
}
|
||||
|
||||
message AudioBackendDescription {
|
||||
CoreAudioAvailableOptions core_audio_description = 1;
|
||||
}
|
||||
|
||||
message CoreAudioAvailableOptions {
|
||||
repeated string input_devices = 1;
|
||||
repeated string output_devices = 2;
|
||||
}
|
||||
|
||||
message CoreAudioOptions {
|
||||
string input_device = 1;
|
||||
}
|
||||
|
||||
message BackendList {
|
||||
repeated Backend backends = 1;
|
||||
}
|
||||
@@ -16,7 +45,3 @@ message BackendList {
|
||||
message Backend {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message Shirt {
|
||||
google.protobuf.Empty dummy = 1;
|
||||
}
|
||||
|
||||
19
lib/proto/track.proto
Normal file
19
lib/proto/track.proto
Normal file
@@ -0,0 +1,19 @@
|
||||
syntax = "proto3";
|
||||
package termix.track;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
service TrackOp {
|
||||
rpc Create(Track) returns (google.protobuf.Empty);
|
||||
rpc List(google.protobuf.Empty) returns (Tracks);
|
||||
}
|
||||
|
||||
message Track {
|
||||
string name = 1;
|
||||
}
|
||||
|
||||
message Tracks {
|
||||
repeated Track tracks = 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user