Skip to content

Commit

Permalink
Make it build with winapi 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Boddlnagg committed Dec 8, 2017
1 parent 510c268 commit 3dc18a2
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ libc = "0.2.7"
coremidi = "0.3.0"

[target.'cfg(windows)'.dependencies]
winapi = "0.2.4"
winmm-sys = "0.2.0"

winapi = { git = "https://github.com/retep998/winapi-rs", branch="dev", features=["mmsystem", "mmeapi"] }
6 changes: 4 additions & 2 deletions src/backend/winmm/handler.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use std::{mem, slice};
use std::io::{Write, stderr};

use super::winapi::*;
use super::winmm_sys::midiInAddBuffer;
use super::winapi::shared::basetsd::DWORD_PTR;
use super::winapi::shared::minwindef::{DWORD, UINT};
use super::winapi::um::mmeapi::*;
use super::winapi::um::mmsystem::*;
use super::HandlerData;
use ::Ignore;

Expand Down
21 changes: 18 additions & 3 deletions src/backend/winmm/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
extern crate winapi;
extern crate winmm as winmm_sys;

use std::{mem, ptr, slice};
use std::ffi::OsString;
Expand All @@ -10,9 +9,10 @@ use std::thread::sleep;
use std::time::Duration;
use memalloc::{allocate, deallocate};

use self::winapi::*;
use self::winapi::shared::basetsd::{DWORD_PTR, UINT_PTR};
use self::winapi::shared::minwindef::{DWORD, UINT};

use self::winmm_sys::{
use self::winapi::um::mmeapi::{
midiInGetNumDevs,
midiInGetDevCapsW,
midiInOpen,
Expand All @@ -34,6 +34,21 @@ use self::winmm_sys::{
midiOutShortMsg,
};

use self::winapi::um::mmsystem::{
HMIDIIN,
HMIDIOUT,
MIDIINCAPSW,
MIDIOUTCAPSW,
MMSYSERR_NOERROR,
MMSYSERR_BADDEVICEID,
MIDIERR_NOTREADY,
MIDIERR_STILLPLAYING,
CALLBACK_FUNCTION,
MIDIHDR,
LPMIDIHDR,
CALLBACK_NULL
};

use ::{MidiMessage, Ignore};
use ::errors::*;

Expand Down

0 comments on commit 3dc18a2

Please sign in to comment.