#[derive(Copy, Clone)]
#[allow(dead_code)]
pub enum MediaType {
MediaTypeNone,
MediaTypeVideo,
MediaTypeAudio,
}
pub enum InstanceType {
InstanceTypeSide,
InstanceTypeLink,
}
#[derive(Copy, Clone)]
#[allow(dead_code)]
pub struct Timer {
tid: i32,
milliseconds: i32,
}
impl Timer {
pub fn get_tid(&self) -> i32 {
self.tid
}
pub fn get_milliseconds(&self) -> i32 {
self.milliseconds
}
pub fn new(_tid: i32, _milliseconds: i32) -> Self {
Timer {
tid: _tid,
milliseconds: _milliseconds,
}
}
}
pub trait BasePlugin {
fn get_name(&self) -> String;
fn get_author(&self) -> String;
fn get_args(&mut self, args: std::collections::HashMap<String, String>) -> Vec<String>;
fn get_allow_custom_args(&self) -> Vec<&'static str> {
let vec: Vec<&'static str> = Vec::new();
vec
}
fn get_filter_name(&self) -> String;
fn get_media_type(&self) -> MediaType;
fn validate_user_args(
&mut self,
args: std::collections::HashMap<String, String>,
) -> Result<bool, &'static str>;
fn print_log(&self, level: super::util::os::PrintLogLevel, log: &str) {
super::util::os::print_log(level, &format!("[{}] {}", self.get_name(), log).to_string())
}
fn register_task(&self) -> Vec<Timer> {
let empty: Vec<Timer> = Vec::new();
empty
}
fn register_message_keys(&self) -> Vec<super::proto::keys::EventMessageAction> {
let empty: Vec<super::proto::keys::EventMessageAction> = Vec::new();
empty
}
#[warn(unused_variables)]
fn execute_task(&mut self, _tid: u32) {}
#[allow(unused_variables)]
fn execute_message(&mut self, action: i32, body: String) {}
#[allow(unused_variables)]
fn get_instance_type(&mut self) -> InstanceType {
InstanceType::InstanceTypeLink
}
#[allow(unused_variables)]
fn hook_created(&mut self) -> i32 {
0
}
}