Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bindings for Media Control Interface (MCI) #982

Open
wants to merge 11 commits into
base: 0.3
Choose a base branch
from
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,7 @@ winhttp = []
wininet = []
winineti = []
winioctl = []
winmm = []
winnetwk = []
winnls = []
winnt = []
Expand Down
3 changes: 2 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const DATA: &'static [(&'static str, &'static [&'static str], &'static [&'static
("minwinbase", &["basetsd", "minwindef", "ntstatus", "winnt"], &[]),
("mmdeviceapi", &["guiddef", "minwindef", "propidl", "propsys", "unknwnbase", "winnt", "wtypes"], &["mmdevapi"]),
("mmeapi", &["basetsd", "imm", "minwindef", "mmsystem", "winnt"], &["winmm"]),
("mmsystem", &["basetsd", "minwindef", "mmreg", "winnt"], &[]),
("mmsystem", &["basetsd", "imm", "minwindef", "mmreg", "winnt"], &[]),
("msaatext", &[], &[]),
("mscat", &["guiddef", "minwindef", "mssip", "wincrypt", "winnt"], &[]),
("mschapp", &["basetsd", "minwindef", "winnt"], &["advapi32"]),
Expand Down Expand Up @@ -371,6 +371,7 @@ const DATA: &'static [(&'static str, &'static [&'static str], &'static [&'static
("wininet", &["basetsd", "minwinbase", "minwindef", "ntdef", "windef", "winineti", "winnt"], &["wininet"]),
("winineti", &["minwindef"], &[]),
("winioctl", &["basetsd", "devpropdef", "guiddef", "minwindef", "winnt"], &[]),
("winmm", &["basetsd", "minwindef", "winnt"], &["winmm"]),
("winnetwk", &["basetsd", "minwindef", "windef", "winerror", "winnt"], &["mpr"]),
("winnls", &["basetsd", "guiddef", "minwinbase", "minwindef", "winnt"], &["kernel32"]),
("winnt", &["basetsd", "excpt", "guiddef", "ktmtypes", "minwindef", "ntdef", "vcruntime"], &["kernel32"]),
Expand Down
45 changes: 42 additions & 3 deletions src/um/mmeapi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according to those terms.
use shared::basetsd::{DWORD_PTR, UINT_PTR};
use shared::minwindef::{DWORD, LPBYTE, LPDWORD, LPWORD, PDWORD, UINT};
use shared::minwindef::{BOOL, DWORD, LPBYTE, LPDWORD, LPWORD, PDWORD, UINT};
use um::imm::LPUINT;
use um::mmsystem::{
HMIDI, HMIDIIN, HMIDIOUT, HMIDISTRM, HWAVEIN, HWAVEOUT, LPCWAVEFORMATEX, LPHMIDIIN, LPHMIDIOUT,
LPHMIDISTRM, LPHWAVEIN, LPHWAVEOUT, LPMIDIHDR, LPMIDIINCAPSW, LPMIDIOUTCAPSW, LPMMTIME,
LPWAVEHDR, LPWAVEINCAPSW, LPWAVEOUTCAPSW, MMRESULT
LPWAVEHDR, LPWAVEINCAPSW, LPWAVEOUTCAPSW, MCIDEVICEID, MCIERROR, MMRESULT, YIELDPROC,
};
use um::winnt::{LPWSTR, PVOID};
use um::winnt::{HANDLE, LPCSTR, LPCWSTR, LPWSTR, PVOID};
extern "system" {
pub fn waveOutGetNumDevs() -> UINT;
// pub fn waveOutGetDevCapsA();
Expand Down Expand Up @@ -333,4 +333,43 @@ extern "system" {
dw1: DWORD_PTR,
dw2: DWORD_PTR,
) -> MMRESULT;
pub fn mciExecute(
pszCommand: LPCSTR
) -> BOOL;
pub fn mciGetCreatorTask(
IDDevice: MCIDEVICEID
) -> MMRESULT;
pub fn mciGetDeviceID(
lpszDevice: LPCWSTR
) -> MCIDEVICEID;
pub fn mciGetDeviceIDFromElementID(
dwElementID: DWORD,
lpstrType: LPCWSTR
) -> MCIDEVICEID;
pub fn mciGetErrorString(
fdwError: DWORD,
lpszErrorText: LPWSTR,
cchErrorText: UINT
) -> BOOL;
pub fn mciGetYieldProc(
IDDevice: MCIDEVICEID,
lpdwYieldData: LPDWORD
) -> YIELDPROC;
pub fn mciSendCommand(
IDDevice: MCIDEVICEID,
uMsg: UINT,
fdwCommand: DWORD_PTR,
dwParam: DWORD_PTR
) -> MCIERROR;
pub fn mciSendString(
lpszCommand: LPCWSTR,
lpszReturnString: LPWSTR,
cchReturn: UINT,
hwndCallback: HANDLE
) -> MCIERROR;
pub fn mciSetYieldProc(
IDDevice: MCIDEVICEID,
yp: YIELDPROC,
dwYieldData: DWORD
) -> UINT;
}
Loading