-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
504 additions
and
91 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,5 @@ image = "0.24.7" | |
libusb1-sys = "0.6.4" | ||
libc = "0.2.148" | ||
itertools = "0.11.0" | ||
simple-error = "0.3.0" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pub mod katsukitty; | ||
pub mod katsukitty; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,49 @@ | ||
mod capture; | ||
|
||
use bytes::BytesMut; | ||
use rusb::Context; | ||
|
||
pub struct Cappy3ds<F> { | ||
data_callback: F, | ||
usb_context: Option<rusb::Context>, | ||
device_handle: Option<rusb::DeviceHandle<rusb::Context>>, | ||
} | ||
|
||
impl<F> Cappy3ds<F> | ||
where | ||
F: Fn(&[i16], BytesMut, BytesMut), | ||
{ | ||
pub fn new(data_callback: F) -> Self | ||
where | ||
F: Fn(&[i16], BytesMut, BytesMut), | ||
{ | ||
Self { | ||
data_callback, | ||
usb_context: None, | ||
device_handle: None, | ||
} | ||
} | ||
|
||
pub fn connect(&mut self) { | ||
match Context::new() { | ||
Ok(mut context) => match capture::katsukitty::connect(&mut context) { | ||
Ok(handle) => { | ||
self.device_handle = Some(handle); | ||
self.usb_context = Some(context); | ||
} | ||
Err(err) => { | ||
println!("{}", err); | ||
todo!(); | ||
} | ||
}, | ||
Err(e) => { | ||
println!("could not initialize libusb: {}", e); | ||
todo!(); | ||
} | ||
} | ||
} | ||
|
||
pub fn do_capture(self) { | ||
capture::katsukitty::do_capture(&mut self.device_handle.unwrap(), self.data_callback); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
mod capture; | ||
|
||
fn main() { | ||
capture::katsukitty::do_capture(); | ||
//capture::katsukitty::do_capture(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.