Skip to content

Commit

Permalink
Auto format imports
Browse files Browse the repository at this point in the history
  • Loading branch information
slerpyyy committed Sep 10, 2021
1 parent 5edb7d2 commit 9e489d8
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 32 deletions.
8 changes: 5 additions & 3 deletions src/jockey/audio.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use super::Config;
use crate::util::RingBuffer;
use std::sync::{Arc, Mutex};

use cpal::traits::{DeviceTrait, HostTrait, StreamTrait};
use num_complex::Complex;
use rustfft::{Fft, FftPlanner};
use std::sync::{Arc, Mutex};

use super::Config;
use crate::util::RingBuffer;

pub const AUDIO_SAMPLES: usize = 8192;
pub const FFT_ATTACK: f32 = 0.5;
Expand Down
3 changes: 2 additions & 1 deletion src/jockey/beatsync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ impl BeatSync {

#[cfg(test)]
mod test {
use super::*;
use std::{ops::Sub, time::Duration};

use super::*;

#[test]
fn three_beats() {
let mut sync = BeatSync::new();
Expand Down
6 changes: 4 additions & 2 deletions src/jockey/midi.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
use super::Config;
use midir::{ConnectError, Ignore, MidiInput, MidiInputConnection, MidiInputPort};
use std::{
collections::HashMap,
io::Write,
sync::mpsc::{channel, Receiver},
time::Instant,
};

use midir::{ConnectError, Ignore, MidiInput, MidiInputConnection, MidiInputPort};

use super::Config;

pub const MIDI_N: usize = 32;

pub struct Midi {
Expand Down
16 changes: 9 additions & 7 deletions src/jockey/mod.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
use crate::util::*;
use gl::types::*;
use glutin::platform::run_return::EventLoopExtRunReturn;
use imgui::im_str;
use imgui_winit_support::{HiDpiMode, WinitPlatform};
use notify::Watcher;
use std::io::Write;
use std::{
collections::{hash_map::DefaultHasher, HashMap},
ffi::CString,
future::Future,
hash::{Hash, Hasher},
io::Write,
mem::MaybeUninit,
pin::Pin,
rc::Rc,
sync::atomic::{AtomicBool, Ordering},
time::{Duration, Instant},
};

use gl::types::*;
use glutin::platform::run_return::EventLoopExtRunReturn;
use imgui::im_str;
use imgui_winit_support::{HiDpiMode, WinitPlatform};
use notify::Watcher;

use crate::util::*;

mod audio;
mod beatsync;
mod config;
Expand Down
6 changes: 4 additions & 2 deletions src/jockey/network.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use super::*;
use ndi::{self, FindCreateError, FindSourcesTimeout};
use std::{
iter::FromIterator,
sync::{Arc, Mutex},
thread,
};

use ndi::{self, FindCreateError, FindSourcesTimeout};

use super::*;

static NDI_RECEIVER_NAME: &'static str = "Sh4derJockey";

#[derive(Debug)]
Expand Down
10 changes: 6 additions & 4 deletions src/jockey/pipeline.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
use super::uniforms::*;
use crate::{jockey::*, util::Cache};
use async_std::task::yield_now;
use serde_yaml::Value;
use std::{
collections::{HashMap, HashSet},
ffi::CString,
path::Path,
rc::Rc,
};

use async_std::task::yield_now;
use serde_yaml::Value;

use super::uniforms::*;
use crate::{jockey::*, util::Cache};

pub type PipelinePartial = Box<dyn Future<Output = Result<(Pipeline, UpdateRequest), String>>>;

#[derive(Debug, Clone)]
Expand Down
6 changes: 4 additions & 2 deletions src/jockey/stage.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use crate::util::*;
use std::ffi::CString;

use gl::types::*;
use serde_yaml::Value;
use std::ffi::CString;

use crate::util::*;

pub const PASS_VERT: &str = include_str!("shaders/pass.vert");
pub const PASS_FRAG: &str = include_str!("shaders/pass.frag");
Expand Down
5 changes: 3 additions & 2 deletions src/jockey/uniforms.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use lazy_static::lazy_static;
use std::ffi::CString;

use lazy_static::lazy_static;

lazy_static! {
// slerpy's golf coding stuff
// slerpys golf coding stuff
pub static ref R_NAME: CString = CString::new("R").unwrap();
pub static ref K_NAME: CString = CString::new("K").unwrap();

Expand Down
3 changes: 2 additions & 1 deletion src/util/cache.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::Texture;
use std::{collections::HashMap, rc::Rc};

use super::Texture;

static mut CACHE_INTERNAL: Option<HashMap<String, CacheEntry>> = None;

#[derive(Debug)]
Expand Down
7 changes: 4 additions & 3 deletions src/util/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use gl::types::*;
use lazy_static::lazy_static;
use regex::Regex;
use std::{
collections::HashSet,
ffi::{c_void, CString},
};

use gl::types::*;
use lazy_static::lazy_static;
use regex::Regex;

mod average;
mod cache;
mod ringbuffer;
Expand Down
9 changes: 4 additions & 5 deletions src/util/texture.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
#![allow(dead_code)]
use crate::util::*;
use crate::*;
use std::{cell::RefCell, fmt::Debug, rc::Rc, u8};

use as_any::AsAny;
use core::panic;
use image::DynamicImage;
use serde_yaml::Value;
use std::cell::RefCell;
use std::{fmt::Debug, rc::Rc, u8};

use crate::{util::*, *};

fn _assert_is_object_safe(_: &dyn Texture) {}

Expand Down

0 comments on commit 9e489d8

Please sign in to comment.