Init the ICED library

This commit is contained in:
Nikolai Rodionov 2023-11-21 11:04:34 +01:00
parent 733552b64b
commit b81ef95218
Signed by: allanger
GPG Key ID: 906851F91B1DA3EF
3 changed files with 68 additions and 2 deletions

10
Cargo.toml Normal file
View File

@ -0,0 +1,10 @@
[package]
name = "voids-midi"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
iced = "0.10.0"
midir = {version = "0.9.1", features = [ "jack" ] }

View File

@ -1,3 +1,6 @@
# flocking-midi
> !! Currently it's not even a Flocking MIDI, just something that can be built
# Flocking MIDI
A virtual midi device that uses flocking algorithm for creating different midi signals.
A virtual midi device that uses flocking algorithm for creating different midi signals.

53
src/main.rs Normal file
View File

@ -0,0 +1,53 @@
use iced::executor;
use iced::window;
use iced::Application;
use iced::Command;
use iced::Length;
use iced::Settings;
use iced::Theme;
use iced::widget::{column, container};
struct Voids {}
impl Application for Voids {
type Executor = executor::Default;
type Message = ();
type Theme = Theme;
type Flags = ();
fn new(_flags: Self::Flags) -> (Self, iced::Command<Self::Message>) {
(Voids {}, Command::none())
}
fn title(&self) -> String {
"voids dummy".to_string()
}
fn update(&mut self, _message: Self::Message) -> iced::Command<Self::Message> {
Command::none()
}
fn view(&self) -> iced::Element<'_, Self::Message, iced::Renderer<Self::Theme>> {
let content = column![];
container(content)
.width(Length::Fill)
.height(Length::Fill)
.padding(20)
.into()
}
}
pub fn main() -> iced::Result {
#[cfg(not(target_arch = "wasm32"))]
Voids::run(Settings {
window: window::Settings {
size: (500, 800),
..window::Settings::default()
},
..Settings::default()
})
}