Buildable check-in of new UNFINISHED and UNTESTED Multimedia assembly.

pull/250/head
dahall 2021-05-14 13:07:29 -06:00
parent fb9aa91326
commit 97a973c6e5
13 changed files with 16119 additions and 0 deletions

View File

@ -0,0 +1,28 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
{
public static partial class WinMm
{
/*
JOYCAPS
JOYCAPSA
JOYCAPSW
JOYINFO
JOYINFOEX
joyConfigChanged
joyGetDevCaps
joyGetDevCapsA
joyGetDevCapsW
joyGetNumDevs
joyGetPos
joyGetPosEx
joyGetThreshold
joyReleaseCapture
joySetCapture
joySetThreshold
*/
}
}

4860
PInvoke/Multimedia/MSAcm.cs Normal file

File diff suppressed because it is too large Load Diff

928
PInvoke/Multimedia/MmReg.cs Normal file
View File

@ -0,0 +1,928 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
{
/// <summary>Items from the WinMm.dll</summary>
public static partial class WinMm
{
/// <summary>Format type.</summary>
[PInvokeData("mmreg.h", MSDNShortId = "NS:mmreg.waveformat_tag")]
[Flags]
public enum WAVE_FORMAT : ushort
{
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_UNKNOWN = 0x0000,
/// <summary>Waveform-audio data is PCM.</summary>
WAVE_FORMAT_PCM,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_ADPCM = 0x0002,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_IEEE_FLOAT = 0x0003,
/// <summary>Compaq Computer Corp.</summary>
WAVE_FORMAT_VSELP = 0x0004,
/// <summary>IBM Corporation</summary>
WAVE_FORMAT_IBM_CVSD = 0x0005,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_ALAW = 0x0006,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_MULAW = 0x0007,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_DTS = 0x0008,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_DRM = 0x0009,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_WMAVOICE9 = 0x000A,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_WMAVOICE10 = 0x000B,
/// <summary>OKI</summary>
WAVE_FORMAT_OKI_ADPCM = 0x0010,
/// <summary>Intel Corporation</summary>
WAVE_FORMAT_DVI_ADPCM = 0x0011,
/// <summary>Intel Corporation</summary>
WAVE_FORMAT_IMA_ADPCM = WAVE_FORMAT_DVI_ADPCM,
/// <summary>Videologic</summary>
WAVE_FORMAT_MEDIASPACE_ADPCM = 0x0012,
/// <summary>Sierra Semiconductor Corp</summary>
WAVE_FORMAT_SIERRA_ADPCM = 0x0013,
/// <summary>Antex Electronics Corporation</summary>
WAVE_FORMAT_G723_ADPCM = 0x0014,
/// <summary>DSP Solutions, Inc.</summary>
WAVE_FORMAT_DIGISTD = 0x0015,
/// <summary>DSP Solutions, Inc.</summary>
WAVE_FORMAT_DIGIFIX = 0x0016,
/// <summary>Dialogic Corporation</summary>
WAVE_FORMAT_DIALOGIC_OKI_ADPCM = 0x0017,
/// <summary>Media Vision, Inc.</summary>
WAVE_FORMAT_MEDIAVISION_ADPCM = 0x0018,
/// <summary>Hewlett-Packard Company</summary>
WAVE_FORMAT_CU_CODEC = 0x0019,
/// <summary>Hewlett-Packard Company</summary>
WAVE_FORMAT_HP_DYN_VOICE = 0x001A,
/// <summary>Yamaha Corporation of America</summary>
WAVE_FORMAT_YAMAHA_ADPCM = 0x0020,
/// <summary>Speech Compression</summary>
WAVE_FORMAT_SONARC = 0x0021,
/// <summary>DSP Group, Inc</summary>
WAVE_FORMAT_DSPGROUP_TRUESPEECH = 0x0022,
/// <summary>Echo Speech Corporation</summary>
WAVE_FORMAT_ECHOSC1 = 0x0023,
/// <summary>Virtual Music, Inc.</summary>
WAVE_FORMAT_AUDIOFILE_AF36 = 0x0024,
/// <summary>Audio Processing Technology</summary>
WAVE_FORMAT_APTX = 0x0025,
/// <summary>Virtual Music, Inc.</summary>
WAVE_FORMAT_AUDIOFILE_AF10 = 0x0026,
/// <summary>Aculab plc</summary>
WAVE_FORMAT_PROSODY_1612 = 0x0027,
/// <summary>Merging Technologies S.A.</summary>
WAVE_FORMAT_LRC = 0x0028,
/// <summary>Dolby Laboratories</summary>
WAVE_FORMAT_DOLBY_AC2 = 0x0030,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_GSM610 = 0x0031,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_MSNAUDIO = 0x0032,
/// <summary>Antex Electronics Corporation</summary>
WAVE_FORMAT_ANTEX_ADPCME = 0x0033,
/// <summary>Control Resources Limited</summary>
WAVE_FORMAT_CONTROL_RES_VQLPC = 0x0034,
/// <summary>DSP Solutions, Inc.</summary>
WAVE_FORMAT_DIGIREAL = 0x0035,
/// <summary>DSP Solutions, Inc.</summary>
WAVE_FORMAT_DIGIADPCM = 0x0036,
/// <summary>Control Resources Limited</summary>
WAVE_FORMAT_CONTROL_RES_CR10 = 0x0037,
/// <summary>Natural MicroSystems</summary>
WAVE_FORMAT_NMS_VBXADPCM = 0x0038,
/// <summary>Crystal Semiconductor IMA ADPCM</summary>
WAVE_FORMAT_CS_IMAADPCM = 0x0039,
/// <summary>Echo Speech Corporation</summary>
WAVE_FORMAT_ECHOSC3 = 0x003A,
/// <summary>Rockwell International</summary>
WAVE_FORMAT_ROCKWELL_ADPCM = 0x003B,
/// <summary>Rockwell International</summary>
WAVE_FORMAT_ROCKWELL_DIGITALK = 0x003C,
/// <summary>Xebec Multimedia Solutions Limited</summary>
WAVE_FORMAT_XEBEC = 0x003D,
/// <summary>Antex Electronics Corporation</summary>
WAVE_FORMAT_G721_ADPCM = 0x0040,
/// <summary>Antex Electronics Corporation</summary>
WAVE_FORMAT_G728_CELP = 0x0041,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_MSG723 = 0x0042,
/// <summary>Intel Corp.</summary>
WAVE_FORMAT_INTEL_G723_1 = 0x0043,
/// <summary>Intel Corp.</summary>
WAVE_FORMAT_INTEL_G729 = 0x0044,
/// <summary>Sharp</summary>
WAVE_FORMAT_SHARP_G726 = 0x0045,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_MPEG = 0x0050,
/// <summary>InSoft, Inc.</summary>
WAVE_FORMAT_RT24 = 0x0052,
/// <summary>InSoft, Inc.</summary>
WAVE_FORMAT_PAC = 0x0053,
/// <summary>ISO/MPEG Layer3 Format Tag</summary>
WAVE_FORMAT_MPEGLAYER3 = 0x0055,
/// <summary>Lucent Technologies</summary>
WAVE_FORMAT_LUCENT_G723 = 0x0059,
/// <summary>Cirrus Logic</summary>
WAVE_FORMAT_CIRRUS = 0x0060,
/// <summary>ESS Technology</summary>
WAVE_FORMAT_ESPCM = 0x0061,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE = 0x0062,
/// <summary>Canopus, co., Ltd.</summary>
WAVE_FORMAT_CANOPUS_ATRAC = 0x0063,
/// <summary>APICOM</summary>
WAVE_FORMAT_G726_ADPCM = 0x0064,
/// <summary>APICOM</summary>
WAVE_FORMAT_G722_ADPCM = 0x0065,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_DSAT = 0x0066,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_DSAT_DISPLAY = 0x0067,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_BYTE_ALIGNED = 0x0069,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_AC8 = 0x0070,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_AC10 = 0x0071,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_AC16 = 0x0072,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_AC20 = 0x0073,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_RT24 = 0x0074,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_RT29 = 0x0075,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_RT29HW = 0x0076,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_VR12 = 0x0077,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_VR18 = 0x0078,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_TQ40 = 0x0079,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_SC3 = 0x007A,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_SC3_1 = 0x007B,
/// <summary>Softsound, Ltd.</summary>
WAVE_FORMAT_SOFTSOUND = 0x0080,
/// <summary>Voxware Inc</summary>
WAVE_FORMAT_VOXWARE_TQ60 = 0x0081,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_MSRT24 = 0x0082,
/// <summary>AT&amp;T Labs, Inc.</summary>
WAVE_FORMAT_G729A = 0x0083,
/// <summary>Motion Pixels</summary>
WAVE_FORMAT_MVI_MVI2 = 0x0084,
/// <summary>DataFusion Systems (Pty) (Ltd)</summary>
WAVE_FORMAT_DF_G726 = 0x0085,
/// <summary>DataFusion Systems (Pty) (Ltd)</summary>
WAVE_FORMAT_DF_GSM610 = 0x0086,
/// <summary>Iterated Systems, Inc.</summary>
WAVE_FORMAT_ISIAUDIO = 0x0088,
/// <summary>OnLive! Technologies, Inc.</summary>
WAVE_FORMAT_ONLIVE = 0x0089,
/// <summary>Multitude Inc.</summary>
WAVE_FORMAT_MULTITUDE_FT_SX20 = 0x008A,
/// <summary>Infocom</summary>
WAVE_FORMAT_INFOCOM_ITS_G721_ADPCM = 0x008B,
/// <summary>Convedia Corp.</summary>
WAVE_FORMAT_CONVEDIA_G729 = 0x008C,
/// <summary>Congruency Inc.</summary>
WAVE_FORMAT_CONGRUENCY = 0x008D,
/// <summary>Siemens Business Communications Sys</summary>
WAVE_FORMAT_SBC24 = 0x0091,
/// <summary>Sonic Foundry</summary>
WAVE_FORMAT_DOLBY_AC3_SPDIF = 0x0092,
/// <summary>MediaSonic</summary>
WAVE_FORMAT_MEDIASONIC_G723 = 0x0093,
/// <summary>Aculab plc</summary>
WAVE_FORMAT_PROSODY_8KBPS = 0x0094,
/// <summary>ZyXEL Communications, Inc.</summary>
WAVE_FORMAT_ZYXEL_ADPCM = 0x0097,
/// <summary>Philips Speech Processing</summary>
WAVE_FORMAT_PHILIPS_LPCBB = 0x0098,
/// <summary>Studer Professional Audio AG</summary>
WAVE_FORMAT_PACKED = 0x0099,
/// <summary>Malden Electronics Ltd.</summary>
WAVE_FORMAT_MALDEN_PHONYTALK = 0x00A0,
/// <summary>Racal recorders</summary>
WAVE_FORMAT_RACAL_RECORDER_GSM = 0x00A1,
/// <summary>Racal recorders</summary>
WAVE_FORMAT_RACAL_RECORDER_G720_A = 0x00A2,
/// <summary>Racal recorders</summary>
WAVE_FORMAT_RACAL_RECORDER_G723_1 = 0x00A3,
/// <summary>Racal recorders</summary>
WAVE_FORMAT_RACAL_RECORDER_TETRA_ACELP = 0x00A4,
/// <summary>NEC Corp.</summary>
WAVE_FORMAT_NEC_AAC = 0x00B0,
/// <summary>For Raw AAC, with format block AudioSpecificConfig() (as defined by MPEG-4), that follows WAVEFORMATEX</summary>
WAVE_FORMAT_RAW_AAC1 = 0x00FF,
/// <summary>Rhetorex Inc.</summary>
WAVE_FORMAT_RHETOREX_ADPCM = 0x0100,
/// <summary>BeCubed Software Inc.</summary>
WAVE_FORMAT_IRAT = 0x0101,
/// <summary>Vivo Software</summary>
WAVE_FORMAT_VIVO_G723 = 0x0111,
/// <summary>Vivo Software</summary>
WAVE_FORMAT_VIVO_SIREN = 0x0112,
/// <summary>Philips Speech Processing</summary>
WAVE_FORMAT_PHILIPS_CELP = 0x0120,
/// <summary>Philips Speech Processing</summary>
WAVE_FORMAT_PHILIPS_GRUNDIG = 0x0121,
/// <summary>Digital Equipment Corporation</summary>
WAVE_FORMAT_DIGITAL_G723 = 0x0123,
/// <summary>Sanyo Electric Co., Ltd.</summary>
WAVE_FORMAT_SANYO_LD_ADPCM = 0x0125,
/// <summary>Sipro Lab Telecom Inc.</summary>
WAVE_FORMAT_SIPROLAB_ACEPLNET = 0x0130,
/// <summary>Sipro Lab Telecom Inc.</summary>
WAVE_FORMAT_SIPROLAB_ACELP4800 = 0x0131,
/// <summary>Sipro Lab Telecom Inc.</summary>
WAVE_FORMAT_SIPROLAB_ACELP8V3 = 0x0132,
/// <summary>Sipro Lab Telecom Inc.</summary>
WAVE_FORMAT_SIPROLAB_G729 = 0x0133,
/// <summary>Sipro Lab Telecom Inc.</summary>
WAVE_FORMAT_SIPROLAB_G729A = 0x0134,
/// <summary>Sipro Lab Telecom Inc.</summary>
WAVE_FORMAT_SIPROLAB_KELVIN = 0x0135,
/// <summary>VoiceAge Corp.</summary>
WAVE_FORMAT_VOICEAGE_AMR = 0x0136,
/// <summary>Dictaphone Corporation</summary>
WAVE_FORMAT_G726ADPCM = 0x0140,
/// <summary>Dictaphone Corporation</summary>
WAVE_FORMAT_DICTAPHONE_CELP68 = 0x0141,
/// <summary>Dictaphone Corporation</summary>
WAVE_FORMAT_DICTAPHONE_CELP54 = 0x0142,
/// <summary>Qualcomm, Inc.</summary>
WAVE_FORMAT_QUALCOMM_PUREVOICE = 0x0150,
/// <summary>Qualcomm, Inc.</summary>
WAVE_FORMAT_QUALCOMM_HALFRATE = 0x0151,
/// <summary>Ring Zero Systems, Inc.</summary>
WAVE_FORMAT_TUBGSM = 0x0155,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_MSAUDIO1 = 0x0160,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_WMAUDIO2 = 0x0161,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_WMAUDIO3 = 0x0162,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_WMAUDIO_LOSSLESS = 0x0163,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_WMASPDIF = 0x0164,
/// <summary>Unisys Corp.</summary>
WAVE_FORMAT_UNISYS_NAP_ADPCM = 0x0170,
/// <summary>Unisys Corp.</summary>
WAVE_FORMAT_UNISYS_NAP_ULAW = 0x0171,
/// <summary>Unisys Corp.</summary>
WAVE_FORMAT_UNISYS_NAP_ALAW = 0x0172,
/// <summary>Unisys Corp.</summary>
WAVE_FORMAT_UNISYS_NAP_16K = 0x0173,
/// <summary>SyCom Technologies</summary>
WAVE_FORMAT_SYCOM_ACM_SYC008 = 0x0174,
/// <summary>SyCom Technologies</summary>
WAVE_FORMAT_SYCOM_ACM_SYC701_G726L = 0x0175,
/// <summary>SyCom Technologies</summary>
WAVE_FORMAT_SYCOM_ACM_SYC701_CELP54 = 0x0176,
/// <summary>SyCom Technologies</summary>
WAVE_FORMAT_SYCOM_ACM_SYC701_CELP68 = 0x0177,
/// <summary>Knowledge Adventure, Inc.</summary>
WAVE_FORMAT_KNOWLEDGE_ADVENTURE_ADPCM = 0x0178,
/// <summary>Fraunhofer IIS</summary>
WAVE_FORMAT_FRAUNHOFER_IIS_MPEG2_AAC = 0x0180,
/// <summary>Digital Theatre Systems, Inc.</summary>
WAVE_FORMAT_DTS_DS = 0x0190,
/// <summary>Creative Labs, Inc</summary>
WAVE_FORMAT_CREATIVE_ADPCM = 0x0200,
/// <summary>Creative Labs, Inc</summary>
WAVE_FORMAT_CREATIVE_FASTSPEECH8 = 0x0202,
/// <summary>Creative Labs, Inc</summary>
WAVE_FORMAT_CREATIVE_FASTSPEECH10 = 0x0203,
/// <summary>UHER informatic GmbH</summary>
WAVE_FORMAT_UHER_ADPCM = 0x0210,
/// <summary>Ulead Systems, Inc.</summary>
WAVE_FORMAT_ULEAD_DV_AUDIO = 0x0215,
/// <summary>Ulead Systems, Inc.</summary>
WAVE_FORMAT_ULEAD_DV_AUDIO_1 = 0x0216,
/// <summary>Quarterdeck Corporation</summary>
WAVE_FORMAT_QUARTERDECK = 0x0220,
/// <summary>I-link Worldwide</summary>
WAVE_FORMAT_ILINK_VC = 0x0230,
/// <summary>Aureal Semiconductor</summary>
WAVE_FORMAT_RAW_SPORT = 0x0240,
/// <summary>ESS Technology, Inc.</summary>
WAVE_FORMAT_ESST_AC3 = 0x0241,
/// <summary></summary>
WAVE_FORMAT_GENERIC_PASSTHRU = 0x0249,
/// <summary>Interactive Products, Inc.</summary>
WAVE_FORMAT_IPI_HSX = 0x0250,
/// <summary>Interactive Products, Inc.</summary>
WAVE_FORMAT_IPI_RPELP = 0x0251,
/// <summary>Consistent Software</summary>
WAVE_FORMAT_CS2 = 0x0260,
/// <summary>Sony Corp.</summary>
WAVE_FORMAT_SONY_SCX = 0x0270,
/// <summary>Sony Corp.</summary>
WAVE_FORMAT_SONY_SCY = 0x0271,
/// <summary>Sony Corp.</summary>
WAVE_FORMAT_SONY_ATRAC3 = 0x0272,
/// <summary>Sony Corp.</summary>
WAVE_FORMAT_SONY_SPC = 0x0273,
/// <summary>Telum Inc.</summary>
WAVE_FORMAT_TELUM_AUDIO = 0x0280,
/// <summary>Telum Inc.</summary>
WAVE_FORMAT_TELUM_IA_AUDIO = 0x0281,
/// <summary>Norcom Electronics Corp.</summary>
WAVE_FORMAT_NORCOM_VOICE_SYSTEMS_ADPCM = 0x0285,
/// <summary>Fujitsu Corp.</summary>
WAVE_FORMAT_FM_TOWNS_SND = 0x0300,
/// <summary>Micronas Semiconductors, Inc.</summary>
WAVE_FORMAT_MICRONAS = 0x0350,
/// <summary>Micronas Semiconductors, Inc.</summary>
WAVE_FORMAT_MICRONAS_CELP833 = 0x0351,
/// <summary>Brooktree Corporation</summary>
WAVE_FORMAT_BTV_DIGITAL = 0x0400,
/// <summary>Intel Corp.</summary>
WAVE_FORMAT_INTEL_MUSIC_CODER = 0x0401,
/// <summary>Ligos</summary>
WAVE_FORMAT_INDEO_AUDIO = 0x0402,
/// <summary>QDesign Corporation</summary>
WAVE_FORMAT_QDESIGN_MUSIC = 0x0450,
/// <summary>On2 Technologies</summary>
WAVE_FORMAT_ON2_VP7_AUDIO = 0x0500,
/// <summary>On2 Technologies</summary>
WAVE_FORMAT_ON2_VP6_AUDIO = 0x0501,
/// <summary>AT&amp;T Labs, Inc.</summary>
WAVE_FORMAT_VME_VMPCM = 0x0680,
/// <summary>AT&amp;T Labs, Inc.</summary>
WAVE_FORMAT_TPC = 0x0681,
/// <summary>Clearjump</summary>
WAVE_FORMAT_LIGHTWAVE_LOSSLESS = 0x08AE,
/// <summary>Ing C. Olivetti &amp; C., S.p.A.</summary>
WAVE_FORMAT_OLIGSM = 0x1000,
/// <summary>Ing C. Olivetti &amp; C., S.p.A.</summary>
WAVE_FORMAT_OLIADPCM = 0x1001,
/// <summary>Ing C. Olivetti &amp; C., S.p.A.</summary>
WAVE_FORMAT_OLICELP = 0x1002,
/// <summary>Ing C. Olivetti &amp; C., S.p.A.</summary>
WAVE_FORMAT_OLISBC = 0x1003,
/// <summary>Ing C. Olivetti &amp; C., S.p.A.</summary>
WAVE_FORMAT_OLIOPR = 0x1004,
/// <summary>Lernout &amp; Hauspie</summary>
WAVE_FORMAT_LH_CODEC = 0x1100,
/// <summary>Lernout &amp; Hauspie</summary>
WAVE_FORMAT_LH_CODEC_CELP = 0x1101,
/// <summary>Lernout &amp; Hauspie</summary>
WAVE_FORMAT_LH_CODEC_SBC8 = 0x1102,
/// <summary>Lernout &amp; Hauspie</summary>
WAVE_FORMAT_LH_CODEC_SBC12 = 0x1103,
/// <summary>Lernout &amp; Hauspie</summary>
WAVE_FORMAT_LH_CODEC_SBC16 = 0x1104,
/// <summary>Norris Communications, Inc.</summary>
WAVE_FORMAT_NORRIS = 0x1400,
/// <summary>ISIAudio</summary>
WAVE_FORMAT_ISIAUDIO_2 = 0x1401,
/// <summary>AT&amp;T Labs, Inc.</summary>
WAVE_FORMAT_SOUNDSPACE_MUSICOMPRESS = 0x1500,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_MPEG_ADTS_AAC = 0x1600,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_MPEG_RAW_AAC = 0x1601,
/// <summary>Microsoft Corporation (MPEG-4 Audio Transport Streams (LOAS/LATM)</summary>
WAVE_FORMAT_MPEG_LOAS = 0x1602,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_NOKIA_MPEG_ADTS_AAC = 0x1608,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_NOKIA_MPEG_RAW_AAC = 0x1609,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_VODAFONE_MPEG_ADTS_AAC = 0x160A,
/// <summary>Microsoft Corporation</summary>
WAVE_FORMAT_VODAFONE_MPEG_RAW_AAC = 0x160B,
/// <summary>
/// Microsoft Corporation (MPEG-2 AAC or MPEG-4 HE-AAC v1/v2 streams with any payload (ADTS, ADIF, LOAS/LATM, RAW). Format block
/// includes MP4 AudioSpecificConfig() -- see HEAACWAVEFORMAT below
/// </summary>
WAVE_FORMAT_MPEG_HEAAC = 0x1610,
/// <summary>Voxware Inc.</summary>
WAVE_FORMAT_VOXWARE_RT24_SPEECH = 0x181C,
/// <summary>Sonic Foundry</summary>
WAVE_FORMAT_SONICFOUNDRY_LOSSLESS = 0x1971,
/// <summary>Innings Telecom Inc.</summary>
WAVE_FORMAT_INNINGS_TELECOM_ADPCM = 0x1979,
/// <summary>Lucent Technologies</summary>
WAVE_FORMAT_LUCENT_SX8300P = 0x1C07,
/// <summary>Lucent Technologies</summary>
WAVE_FORMAT_LUCENT_SX5363S = 0x1C0C,
/// <summary>CUSeeMe</summary>
WAVE_FORMAT_CUSEEME = 0x1F03,
/// <summary>NTCSoft</summary>
WAVE_FORMAT_NTCSOFT_ALF2CM_ACM = 0x1FC4,
/// <summary>FAST Multimedia AG</summary>
WAVE_FORMAT_DVM = 0x2000,
/// <summary></summary>
WAVE_FORMAT_DTS2 = 0x2001,
/// <summary></summary>
WAVE_FORMAT_MAKEAVIS = 0x3313,
/// <summary>Divio, Inc.</summary>
WAVE_FORMAT_DIVIO_MPEG4_AAC = 0x4143,
/// <summary>Nokia</summary>
WAVE_FORMAT_NOKIA_ADAPTIVE_MULTIRATE = 0x4201,
/// <summary>Divio, Inc.</summary>
WAVE_FORMAT_DIVIO_G726 = 0x4243,
/// <summary>LEAD Technologies</summary>
WAVE_FORMAT_LEAD_SPEECH = 0x434C,
/// <summary>LEAD Technologies</summary>
WAVE_FORMAT_LEAD_VORBIS = 0x564C,
/// <summary>xiph.org</summary>
WAVE_FORMAT_WAVPACK_AUDIO = 0x5756,
/// <summary>Apple Lossless</summary>
WAVE_FORMAT_ALAC = 0x6C61,
/// <summary>Ogg Vorbis</summary>
WAVE_FORMAT_OGG_VORBIS_MODE_1 = 0x674F,
/// <summary>Ogg Vorbis</summary>
WAVE_FORMAT_OGG_VORBIS_MODE_2 = 0x6750,
/// <summary>Ogg Vorbis</summary>
WAVE_FORMAT_OGG_VORBIS_MODE_3 = 0x6751,
/// <summary>Ogg Vorbis</summary>
WAVE_FORMAT_OGG_VORBIS_MODE_1_PLUS = 0x676F,
/// <summary>Ogg Vorbis</summary>
WAVE_FORMAT_OGG_VORBIS_MODE_2_PLUS = 0x6770,
/// <summary>Ogg Vorbis</summary>
WAVE_FORMAT_OGG_VORBIS_MODE_3_PLUS = 0x6771,
/// <summary>3COM Corp.</summary>
WAVE_FORMAT_3COM_NBX = 0x7000,
/// <summary>Opus</summary>
WAVE_FORMAT_OPUS = 0x704F,
/// <summary></summary>
WAVE_FORMAT_FAAD_AAC = 0x706D,
/// <summary>AMR Narrowband</summary>
WAVE_FORMAT_AMR_NB = 0x7361,
/// <summary>AMR Wideband</summary>
WAVE_FORMAT_AMR_WB = 0x7362,
/// <summary>AMR Wideband Plus</summary>
WAVE_FORMAT_AMR_WP = 0x7363,
/// <summary>GSMA/3GPP</summary>
WAVE_FORMAT_GSM_AMR_CBR = 0x7A21,
/// <summary>GSMA/3GPP</summary>
WAVE_FORMAT_GSM_AMR_VBR_SID = 0x7A22,
/// <summary>Comverse Infosys</summary>
WAVE_FORMAT_COMVERSE_INFOSYS_G723_1 = 0xA100,
/// <summary>Comverse Infosys</summary>
WAVE_FORMAT_COMVERSE_INFOSYS_AVQSBC = 0xA101,
/// <summary>Comverse Infosys</summary>
WAVE_FORMAT_COMVERSE_INFOSYS_SBC = 0xA102,
/// <summary>Symbol Technologies</summary>
WAVE_FORMAT_SYMBOL_G729_A = 0xA103,
/// <summary>VoiceAge Corp.</summary>
WAVE_FORMAT_VOICEAGE_AMR_WB = 0xA104,
/// <summary>Ingenient Technologies, Inc.</summary>
WAVE_FORMAT_INGENIENT_G726 = 0xA105,
/// <summary>ISO/MPEG-4</summary>
WAVE_FORMAT_MPEG4_AAC = 0xA106,
/// <summary>Encore Software</summary>
WAVE_FORMAT_ENCORE_G726 = 0xA107,
/// <summary>ZOLL Medical Corp.</summary>
WAVE_FORMAT_ZOLL_ASAO = 0xA108,
/// <summary>xiph.org</summary>
WAVE_FORMAT_SPEEX_VOICE = 0xA109,
/// <summary>Vianix LLC</summary>
WAVE_FORMAT_VIANIX_MASC = 0xA10A,
/// <summary>Microsoft</summary>
WAVE_FORMAT_WM9_SPECTRUM_ANALYZER = 0xA10B,
/// <summary>Microsoft</summary>
WAVE_FORMAT_WMF_SPECTRUM_ANAYZER = 0xA10C,
/// <summary></summary>
WAVE_FORMAT_GSM_610 = 0xA10D,
/// <summary></summary>
WAVE_FORMAT_GSM_620 = 0xA10E,
/// <summary></summary>
WAVE_FORMAT_GSM_660 = 0xA10F,
/// <summary></summary>
WAVE_FORMAT_GSM_690 = 0xA110,
/// <summary></summary>
WAVE_FORMAT_GSM_ADAPTIVE_MULTIRATE_WB = 0xA111,
/// <summary>Polycom</summary>
WAVE_FORMAT_POLYCOM_G722 = 0xA112,
/// <summary>Polycom</summary>
WAVE_FORMAT_POLYCOM_G728 = 0xA113,
/// <summary>Polycom</summary>
WAVE_FORMAT_POLYCOM_G729_A = 0xA114,
/// <summary>Polycom</summary>
WAVE_FORMAT_POLYCOM_SIREN = 0xA115,
/// <summary>Global IP</summary>
WAVE_FORMAT_GLOBAL_IP_ILBC = 0xA116,
/// <summary>RadioTime</summary>
WAVE_FORMAT_RADIOTIME_TIME_SHIFT_RADIO = 0xA117,
/// <summary>Nice Systems</summary>
WAVE_FORMAT_NICE_ACA = 0xA118,
/// <summary>Nice Systems</summary>
WAVE_FORMAT_NICE_ADPCM = 0xA119,
/// <summary>Vocord Telecom</summary>
WAVE_FORMAT_VOCORD_G721 = 0xA11A,
/// <summary>Vocord Telecom</summary>
WAVE_FORMAT_VOCORD_G726 = 0xA11B,
/// <summary>Vocord Telecom</summary>
WAVE_FORMAT_VOCORD_G722_1 = 0xA11C,
/// <summary>Vocord Telecom</summary>
WAVE_FORMAT_VOCORD_G728 = 0xA11D,
/// <summary>Vocord Telecom</summary>
WAVE_FORMAT_VOCORD_G729 = 0xA11E,
/// <summary>Vocord Telecom</summary>
WAVE_FORMAT_VOCORD_G729_A = 0xA11F,
/// <summary>Vocord Telecom</summary>
WAVE_FORMAT_VOCORD_G723_1 = 0xA120,
/// <summary>Vocord Telecom</summary>
WAVE_FORMAT_VOCORD_LBC = 0xA121,
/// <summary>Nice Systems</summary>
WAVE_FORMAT_NICE_G728 = 0xA122,
/// <summary>France Telecom</summary>
WAVE_FORMAT_FRACE_TELECOM_G729 = 0xA123,
/// <summary>CODIAN</summary>
WAVE_FORMAT_CODIAN = 0xA124,
/// <summary>flac.sourceforge.net</summary>
WAVE_FORMAT_FLAC = 0xF1AC,
/// <summary>Microsoft</summary>
WAVE_FORMAT_EXTENSIBLE = 0xFFFE,
/// <summary>
/// New wave format development should be based on the WAVEFORMATEXTENSIBLE structure. WAVEFORMATEXTENSIBLE allows you to avoid
/// having to register a new format tag with Microsoft. However, if you must still define a new format tag, the
/// WAVE_FORMAT_DEVELOPMENT format tag can be used during the development phase of a new wave format. Before shipping, you MUST
/// acquire an official format tag from Microsoft.
/// </summary>
WAVE_FORMAT_DEVELOPMENT = 0xFFFF,
}
/// <summary>
/// The <c>PCMWAVEFORMAT</c> structure describes the data format for PCM waveform-audio data. This structure has been superseded by
/// the WAVEFORMATEX structure.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-pcmwaveformat typedef struct pcmwaveformat_tag { WAVEFORMAT wf;
// WORD wBitsPerSample; } PCMWAVEFORMAT;
[PInvokeData("mmreg.h", MSDNShortId = "NS:mmreg.pcmwaveformat_tag")]
[StructLayout(LayoutKind.Sequential)]
public struct PCMWAVEFORMAT
{
/// <summary>A WAVEFORMAT structure containing general information about the format of the data.</summary>
public WAVEFORMAT wf;
/// <summary>Number of bits per sample.</summary>
public ushort wBitsPerSample;
}
/// <summary>
/// The <c>WAVEFILTER</c> structure defines a filter for waveform-audio data. Only filter information common to all waveform-audio
/// data filters is included in this structure. For filters that require additional information, this structure is included as the
/// first member in another structure along with the additional information.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-wavefilter typedef struct wavefilter_tag { DWORD cbStruct;
// DWORD dwFilterTag; DWORD fdwFilter; DWORD dwReserved[5]; } WAVEFILTER;
[PInvokeData("mmreg.h", MSDNShortId = "NS:mmreg.wavefilter_tag")]
[StructLayout(LayoutKind.Sequential)]
public struct WAVEFILTER
{
/// <summary>
/// Size, in bytes, of the <c>WAVEFILTER</c> structure. The size specified in this member must be large enough to contain the
/// base <c>WAVEFILTER</c> structure.
/// </summary>
public uint cbStruct;
/// <summary>Waveform-audio filter type. Filter tags are registered with Microsoft Corporation for various filter algorithms.</summary>
public uint dwFilterTag;
/// <summary>
/// Flags for the <c>dwFilterTag</c> member. The flags defined for this member are universal to all filters. Currently, no flags
/// are defined.
/// </summary>
public uint fdwFilter;
/// <summary>Reserved for system use; should not be examined or modified by an application.</summary>
private readonly uint dwReserved1;
private readonly uint dwReserved2;
private readonly uint dwReserved3;
private readonly uint dwReserved4;
private readonly uint dwReserved5;
}
/// <summary>
/// The <c>WAVEFORMAT</c> structure describes the format of waveform-audio data. Only format information common to all
/// waveform-audio data formats is included in this structure. This structure has been superseded by the WAVEFORMATEX structure.
/// </summary>
/// <remarks>
/// For formats that require additional information, this structure is included as a member in another structure along with the
/// additional information.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/mmreg/ns-mmreg-waveformat typedef struct waveformat_tag { WORD wFormatTag;
// WORD nChannels; DWORD nSamplesPerSec; DWORD nAvgBytesPerSec; WORD nBlockAlign; } WAVEFORMAT;
[PInvokeData("mmreg.h", MSDNShortId = "NS:mmreg.waveformat_tag")]
[StructLayout(LayoutKind.Sequential)]
public struct WAVEFORMAT
{
/// <summary>
/// <para>Format type. The following type is defined:</para>
/// <list type="table">
/// <listheader>
/// <term>Name</term>
/// <term>Description</term>
/// </listheader>
/// <item>
/// <term>WAVE_FORMAT_PCM</term>
/// <term>Waveform-audio data is PCM.</term>
/// </item>
/// </list>
/// </summary>
public WAVE_FORMAT wFormatTag;
/// <summary>Number of channels in the waveform-audio data. Mono data uses one channel and stereo data uses two channels.</summary>
public ushort nChannels;
/// <summary>Sample rate, in samples per second.</summary>
public uint nSamplesPerSec;
/// <summary>
/// Required average data transfer rate, in bytes per second. For example, 16-bit stereo at 44.1 kHz has an average data rate of
/// 176,400 bytes per second (2 channels — 2 bytes per sample per channel — 44,100 samples per second).
/// </summary>
public uint nAvgBytesPerSec;
/// <summary>
/// Block alignment, in bytes. The block alignment is the minimum atomic unit of data. For PCM data, the block alignment is the
/// number of bytes used by a single sample, including data for both channels if the data is stereo. For example, the block
/// alignment for 16-bit stereo PCM is 4 bytes (2 channels — 2 bytes per sample).
/// </summary>
public ushort nBlockAlign;
}
}
}

View File

@ -0,0 +1,575 @@
using System;
using System.Runtime.InteropServices;
namespace Vanara.PInvoke
{
/// <summary>Items from the WinMm.dll</summary>
public static partial class WinMm
{
/// <summary>
/// The <c>DRVCALLBACK</c> function is the callback function used with the waveform-audio input device. This function is a
/// placeholder for the application-defined function name. The address of this function can be specified in the callback-address
/// parameter of the <c>waveInOpen</c> function.
/// </summary>
/// <param name="hdrvr">Handle to the waveform-audio device associated with the callback function.</param>
/// <param name="uMsg">
/// <para>Waveform-audio input message. It can be one of the following messages.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>WIM_CLOSE</term>
/// <term>Sent when the device is closed using the waveInClose function.</term>
/// </item>
/// <item>
/// <term>WIM_DATA</term>
/// <term>Sent when the device driver is finished with a data block sent using the waveInAddBuffer function.</term>
/// </item>
/// <item>
/// <term>WIM_OPEN</term>
/// <term>Sent when the device is opened using the waveInOpen function.</term>
/// </item>
/// </list>
/// </param>
/// <param name="dwUser">User instance data specified with <c>waveInOpen</c>.</param>
/// <param name="dwParam1">Message parameter.</param>
/// <param name="dwParam2">Message parameter.</param>
/// <returns>This function does not return a value.</returns>
/// <remarks>
/// Applications should not call any system-defined functions from inside a callback function, except for
/// <c>EnterCriticalSection</c>, <c>LeaveCriticalSection</c>, <c>midiOutLongMsg</c>, <c>midiOutShortMsg</c>,
/// <c>OutputDebugString</c>, <c>PostMessage</c>, <c>PostThreadMessage</c>, <c>SetEvent</c>, <c>timeGetSystemTime</c>,
/// <c>timeGetTime</c>, <c>timeKillEvent</c>, and <c>timeSetEvent.</c> Calling other wave functions will cause deadlock.
/// </remarks>
// https://docs.microsoft.com/en-us/previous-versions/dd743849(v=vs.85) void CALLBACK waveInProc( HWAVEIN hwi, UINT uMsg, DWORD_PTR
// dwInstance, DWORD_PTR dwParam1, DWORD_PTR dwParam2 );
[UnmanagedFunctionPointer(CallingConvention.Winapi)]
public delegate void DRVCALLBACK(IntPtr hdrvr, uint uMsg, IntPtr dwUser, IntPtr dwParam1, IntPtr dwParam2);
/// <summary>
/// Flags used with waveOutOpen(), waveInOpen(), midiInOpen(), and midiOutOpen() to specify the type of the dwCallback parameter.
/// </summary>
[PInvokeData("mmsyscom.h", MSDNShortId = "NF:mmeapi.waveInOpen")]
[Flags]
public enum CALLBACK_FLAGS : uint
{
/// <summary>No callback mechanism. This is the default setting.</summary>
CALLBACK_NULL = 0x00000000,
/// <summary>The dwCallback parameter is a window handle.</summary>
CALLBACK_WINDOW = 0x00010000,
/// <summary>The dwCallback parameter is a task handle.</summary>
CALLBACK_TASK = 0x00020000,
/// <summary>The dwCallback parameter is a callback procedure address.</summary>
CALLBACK_FUNCTION = 0x00030000,
/// <summary>The dwCallback parameter is a thread identifier.</summary>
CALLBACK_THREAD = CALLBACK_TASK,
/// <summary>The dwCallback parameter is an event handle.</summary>
CALLBACK_EVENT = 0x00050000,
}
/// <summary>Multimedia function result codes.</summary>
[PInvokeData("mmsyscon.h")]
public enum MMRESULT
{
/// <summary>no error</summary>
MMSYSERR_NOERROR = 0,
/// <summary>unspecified error</summary>
MMSYSERR_ERROR = MMSYSERR_BASE + 1,
/// <summary>Specified device identifier is out of range.</summary>
MMSYSERR_BADDEVICEID = MMSYSERR_BASE + 2,
/// <summary>driver failed enable</summary>
MMSYSERR_NOTENABLED = MMSYSERR_BASE + 3,
/// <summary>Specified resource is already allocated.</summary>
MMSYSERR_ALLOCATED = MMSYSERR_BASE + 4,
/// <summary>Specified device handle is invalid.</summary>
MMSYSERR_INVALHANDLE = MMSYSERR_BASE + 5,
/// <summary>No device driver is present.</summary>
MMSYSERR_NODRIVER = MMSYSERR_BASE + 6,
/// <summary>Unable to allocate or lock memory.</summary>
MMSYSERR_NOMEM = MMSYSERR_BASE + 7,
/// <summary>function isn't supported</summary>
MMSYSERR_NOTSUPPORTED = MMSYSERR_BASE + 8,
/// <summary>Specified error number is out of range.</summary>
MMSYSERR_BADERRNUM = MMSYSERR_BASE + 9,
/// <summary>invalid flag passed</summary>
MMSYSERR_INVALFLAG = MMSYSERR_BASE + 10,
/// <summary>invalid parameter passed</summary>
MMSYSERR_INVALPARAM = MMSYSERR_BASE + 11,
/// <summary>handle being used simultaneously on another thread (eg callback)</summary>
MMSYSERR_HANDLEBUSY = MMSYSERR_BASE + 12,
/// <summary>specified alias not found</summary>
MMSYSERR_INVALIDALIAS = MMSYSERR_BASE + 13,
/// <summary>bad registry database</summary>
MMSYSERR_BADDB = MMSYSERR_BASE + 14,
/// <summary>registry key not found</summary>
MMSYSERR_KEYNOTFOUND = MMSYSERR_BASE + 15,
/// <summary>registry read error</summary>
MMSYSERR_READERROR = MMSYSERR_BASE + 16,
/// <summary>registry write error</summary>
MMSYSERR_WRITEERROR = MMSYSERR_BASE + 17,
/// <summary>registry delete error</summary>
MMSYSERR_DELETEERROR = MMSYSERR_BASE + 18,
/// <summary>registry value not found</summary>
MMSYSERR_VALNOTFOUND = MMSYSERR_BASE + 19,
/// <summary>driver does not call DriverCallback</summary>
MMSYSERR_NODRIVERCB = MMSYSERR_BASE + 20,
/// <summary>more data to be returned</summary>
MMSYSERR_MOREDATA = MMSYSERR_BASE + 21,
/// <summary>Attempted to open with an unsupported waveform-audio format.</summary>
WAVERR_BADFORMAT = WAVERR_BASE + 0,
/// <summary>There are still buffers in the queue.</summary>
WAVERR_STILLPLAYING = WAVERR_BASE + 1,
/// <summary>The buffer pointed to by the pwh parameter hasn't been prepared.</summary>
WAVERR_UNPREPARED = WAVERR_BASE + 2,
/// <summary>device is synchronous</summary>
WAVERR_SYNC = WAVERR_BASE + 3,
/// <summary>last error in range</summary>
WAVERR_LASTERROR = WAVERR_BASE + 3,
}
/// <summary>Time format.</summary>
[PInvokeData("Mmsystem.h")]
public enum MMTIME_TYPE
{
/// <summary>time in milliseconds</summary>
TIME_MS = 0x0001,
/// <summary>number of wave samples</summary>
TIME_SAMPLES = 0x0002,
/// <summary>current byte offset</summary>
TIME_BYTES = 0x0004,
/// <summary>SMPTE time</summary>
TIME_SMPTE = 0x0008,
/// <summary>MIDI time</summary>
TIME_MIDI = 0x0010,
/// <summary>Ticks within MIDI stream</summary>
TIME_TICKS = 0x0020,
}
/// <summary>Flags for playing the sound.</summary>
[PInvokeData("Mmsystem.h")]
[Flags]
public enum SND : uint
{
/// <summary>
/// The sound is played synchronously, and PlaySound returns after the sound event completes. This is the default behavior.
/// </summary>
SND_SYNC = 0x0000,
/// <summary>
/// The sound is played asynchronously and PlaySound returns immediately after beginning the sound. To terminate an
/// asynchronously played waveform sound, call PlaySound with pszSound set to NULL.
/// </summary>
SND_ASYNC = 0x0001,
/// <summary>
/// No default sound event is used. If the sound cannot be found, PlaySound returns silently without playing the default sound.
/// </summary>
SND_NODEFAULT = 0x0002,
/// <summary>The pszSound parameter points to a sound loaded in memory. For more information, see Playing WAVE Resources.</summary>
SND_MEMORY = 0x0004,
/// <summary>
/// The sound plays repeatedly until PlaySound is called again with the pszSound parameter set to NULL. If this flag is set, you
/// must also set the SND_ASYNC flag.
/// </summary>
SND_LOOP = 0x0008,
/// <summary>
/// The specified sound event will yield to another sound event that is already playing in the same process. If a sound cannot
/// be played because the resource needed to generate that sound is busy playing another sound, the function immediately returns
/// FALSE without playing the requested sound. If this flag is not specified, PlaySound attempts to stop any sound that is
/// currently playing in the same process. Sounds played in other processes are not affected.
/// </summary>
SND_NOSTOP = 0x0010,
/// <summary>
/// Not supported. Note Previous versions of the documentation implied incorrectly that this flag is supported. The function
/// ignores this flag.
/// </summary>
SND_NOWAIT = 0x00002000,
/// <summary>
/// The pszSound parameter is a system-event alias in the registry or the WIN.INI file. Do not use with either SND_FILENAME or SND_RESOURCE.
/// </summary>
SND_ALIAS = 0x00010000,
/// <summary>The pszSound parameter is a predefined identifier for a system-event alias. See Remarks.</summary>
SND_ALIAS_ID = 0x00110000,
/// <summary>
/// The pszSound parameter is a file name. If the file cannot be found, the function plays the default sound unless the
/// SND_NODEFAULT flag is set.
/// </summary>
SND_FILENAME = 0x00020000,
/// <summary>
/// The pszSound parameter is a resource identifier; hmod must identify the instance that contains the resource. For more
/// information, see Playing WAVE Resources.
/// </summary>
SND_RESOURCE = 0x00040004,
/// <summary>Not supported.</summary>
SND_PURGE = 0x0040,
/// <summary>
/// The pszSound parameter is an application-specific alias in the registry. You can combine this flag with the SND_ALIAS or
/// SND_ALIAS_ID flag to specify an application-defined sound alias.
/// </summary>
SND_APPLICATION = 0x0080,
/// <summary>
/// Note Requires Windows Vista or later. If this flag is set, the function triggers a SoundSentry event when the sound is
/// played. SoundSentry is an accessibility feature that causes the computer to display a visual cue when a sound is played. If
/// the user did not enable SoundSentry, the visual cue is not displayed.
/// </summary>
SND_SENTRY = 0x00080000,
/// <summary>Treat this as a "ring" from a communications app - don't duck me</summary>
SND_RING = 0x00100000,
/// <summary>
/// Note Requires Windows Vista or later. If this flag is set, the sound is assigned to the audio session for system
/// notification sounds. The system volume-control program (SndVol) displays a volume slider that controls system notification
/// sounds. Setting this flag puts the sound under the control of that volume slider If this flag is not set, the sound is
/// assigned to the default audio session for the application's process. For more information, see the documentation for the
/// Core Audio APIs.
/// </summary>
SND_SYSTEM = 0x00200000,
}
/// <summary>Makes a four character code.</summary>
/// <param name="ch0">The first character.</param>
/// <param name="ch1">The second character.</param>
/// <param name="ch2">The third character.</param>
/// <param name="ch3">The fourth character.</param>
/// <returns>The character code.</returns>
public static uint MAKEFOURCC(char ch0, char ch1, char ch2, char ch3) => (byte)ch0 | ((uint)(byte)ch1 << 8) |
((uint)(byte)ch2 << 16) | ((uint)(byte)ch3 << 24);
/// <summary>
/// The <c>PlaySound</c> function plays a sound specified by the given file name, resource, or system event. (A system event may be
/// associated with a sound in the registry or in the WIN.INI file.)
/// </summary>
/// <param name="pszSound">
/// <para>
/// A string that specifies the sound to play. The maximum length, including the null terminator, is 256 characters. If this
/// parameter is <c>NULL</c>, any currently playing waveform sound is stopped.
/// </para>
/// <para>
/// Three flags in fdwSound ( <c>SND_ALIAS</c>, <c>SND_FILENAME</c>, and <c>SND_RESOURCE</c>) determine whether the name is
/// interpreted as an alias for a system event, a file name, or a resource identifier. If none of these flags are specified,
/// <c>PlaySound</c> searches the registry or the WIN.INI file for an association with the specified sound name. If an association
/// is found, the sound event is played. If no association is found in the registry, the name is interpreted as a file name.
/// </para>
/// </param>
/// <param name="hmod">
/// Handle to the executable file that contains the resource to be loaded. This parameter must be <c>NULL</c> unless
/// <c>SND_RESOURCE</c> is specified in fdwSound.
/// </param>
/// <param name="fdwSound">
/// <para>Flags for playing the sound. The following values are defined.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>SND_APPLICATION</term>
/// <term>
/// The pszSound parameter is an application-specific alias in the registry. You can combine this flag with the SND_ALIAS or
/// SND_ALIAS_ID flag to specify an application-defined sound alias.
/// </term>
/// </item>
/// <item>
/// <term>SND_ALIAS</term>
/// <term>
/// The pszSound parameter is a system-event alias in the registry or the WIN.INI file. Do not use with either SND_FILENAME or SND_RESOURCE.
/// </term>
/// </item>
/// <item>
/// <term>SND_ALIAS_ID</term>
/// <term>The pszSound parameter is a predefined identifier for a system-event alias. See Remarks.</term>
/// </item>
/// <item>
/// <term>SND_ASYNC</term>
/// <term>
/// The sound is played asynchronously and PlaySound returns immediately after beginning the sound. To terminate an asynchronously
/// played waveform sound, call PlaySound with pszSound set to NULL.
/// </term>
/// </item>
/// <item>
/// <term>SND_FILENAME</term>
/// <term>
/// The pszSound parameter is a file name. If the file cannot be found, the function plays the default sound unless the
/// SND_NODEFAULT flag is set.
/// </term>
/// </item>
/// <item>
/// <term>SND_LOOP</term>
/// <term>
/// The sound plays repeatedly until PlaySound is called again with the pszSound parameter set to NULL. If this flag is set, you
/// must also set the SND_ASYNC flag.
/// </term>
/// </item>
/// <item>
/// <term>SND_MEMORY</term>
/// <term>The pszSound parameter points to a sound loaded in memory. For more information, see Playing WAVE Resources.</term>
/// </item>
/// <item>
/// <term>SND_NODEFAULT</term>
/// <term>No default sound event is used. If the sound cannot be found, PlaySound returns silently without playing the default sound.</term>
/// </item>
/// <item>
/// <term>SND_NOSTOP</term>
/// <term>
/// The specified sound event will yield to another sound event that is already playing in the same process. If a sound cannot be
/// played because the resource needed to generate that sound is busy playing another sound, the function immediately returns FALSE
/// without playing the requested sound. If this flag is not specified, PlaySound attempts to stop any sound that is currently
/// playing in the same process. Sounds played in other processes are not affected.
/// </term>
/// </item>
/// <item>
/// <term>SND_NOWAIT</term>
/// <term>
/// Not supported. Note Previous versions of the documentation implied incorrectly that this flag is supported. The function ignores
/// this flag.
/// </term>
/// </item>
/// <item>
/// <term>SND_PURGE</term>
/// <term>Not supported.</term>
/// </item>
/// <item>
/// <term>SND_RESOURCE</term>
/// <term>
/// The pszSound parameter is a resource identifier; hmod must identify the instance that contains the resource. For more
/// information, see Playing WAVE Resources.
/// </term>
/// </item>
/// <item>
/// <term>SND_SENTRY</term>
/// <term>
/// Note Requires Windows Vista or later. If this flag is set, the function triggers a SoundSentry event when the sound is played.
/// SoundSentry is an accessibility feature that causes the computer to display a visual cue when a sound is played. If the user did
/// not enable SoundSentry, the visual cue is not displayed.
/// </term>
/// </item>
/// <item>
/// <term>SND_SYNC</term>
/// <term>The sound is played synchronously, and PlaySound returns after the sound event completes. This is the default behavior.</term>
/// </item>
/// <item>
/// <term>SND_SYSTEM</term>
/// <term>
/// Note Requires Windows Vista or later. If this flag is set, the sound is assigned to the audio session for system notification
/// sounds. The system volume-control program (SndVol) displays a volume slider that controls system notification sounds. Setting
/// this flag puts the sound under the control of that volume slider If this flag is not set, the sound is assigned to the default
/// audio session for the application's process. For more information, see the documentation for the Core Audio APIs.
/// </term>
/// </item>
/// </list>
/// </param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
/// <remarks>
/// <para>
/// The sound specified by pszSound must fit into available physical memory and be playable by an installed waveform-audio device driver.
/// </para>
/// <para>
/// <c>PlaySound</c> searches the following directories for sound files: the current directory; the Windows directory; the Windows
/// system directory; directories listed in the PATH environment variable; and the list of directories mapped in a network. If the
/// function cannot find the specified sound and the <c>SND_NODEFAULT</c> flag is not specified, <c>PlaySound</c> uses the default
/// system event sound instead. If the function can find neither the system default entry nor the default sound, it makes no sound
/// and returns <c>FALSE</c>.
/// </para>
/// <para>If the <c>SND_ALIAS_ID</c> flag is specified in fdwSound, the pszSound parameter must be one of the following values.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Description</term>
/// </listheader>
/// <item>
/// <term>SND_ALIAS_SYSTEMASTERISK</term>
/// <term>"SystemAsterisk" event.</term>
/// </item>
/// <item>
/// <term>SND_ALIAS_SYSTEMDEFAULT</term>
/// <term>"SystemDefault" event.</term>
/// </item>
/// <item>
/// <term>SND_ALIAS_SYSTEMEXCLAMATION</term>
/// <term>"SystemExclamation" event.</term>
/// </item>
/// <item>
/// <term>SND_ALIAS_SYSTEMEXIT</term>
/// <term>"SystemExit" event.</term>
/// </item>
/// <item>
/// <term>SND_ALIAS_SYSTEMHAND</term>
/// <term>"SystemHand" event.</term>
/// </item>
/// <item>
/// <term>SND_ALIAS_SYSTEMQUESTION</term>
/// <term>"SystemQuestion" event.</term>
/// </item>
/// <item>
/// <term>SND_ALIAS_SYSTEMSTART</term>
/// <term>"SystemStart" event.</term>
/// </item>
/// <item>
/// <term>SND_ALIAS_SYSTEMWELCOME</term>
/// <term>"SystemWelcome" event.</term>
/// </item>
/// </list>
/// <para>
/// The <c>SND_ASYNC</c> flag causes <c>PlaySound</c> to return immediately without waiting for the sound to finish playing. If you
/// combine the <c>SND_MEMORY</c> and <c>SND_ASYNC</c> flags, the memory buffer that contains the sound must remain valid until the
/// sound has completed playing.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/previous-versions//dd743680(v=vs.85) BOOL PlaySound( LPCTSTR pszSound, HMODULE hmod, DWORD
// fdwSound );
[DllImport(Lib_Winmm, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("Mmsystem.h")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool PlaySound([In, Optional, MarshalAs(UnmanagedType.LPTStr)] string pszSound, [In, Optional] HINSTANCE hmod, [In, Optional] SND fdwSound);
/// <summary>
/// The <c>sndPlaySound</c> function plays a waveform sound specified either by a file name or by an entry in the registry or the
/// WIN.INI file. This function offers a subset of the functionality of the <c>PlaySound</c> function; <c>sndPlaySound</c> is being
/// maintained for backward compatibility.
/// </summary>
/// <param name="lpszSound">
/// A string that specifies the sound to play. This parameter can be either an entry in the registry or in WIN.INI that identifies a
/// system sound, or it can be the name of a waveform-audio file. (If the function does not find the entry, the parameter is treated
/// as a file name.) If this parameter is <c>NULL</c>, any currently playing sound is stopped.
/// </param>
/// <param name="fuSound">
/// <para>Flags for playing the sound. The following values are defined.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>SND_ASYNC</term>
/// <term>
/// The sound is played asynchronously and the function returns immediately after beginning the sound. To terminate an
/// asynchronously played sound, call sndPlaySound with lpszSound set to NULL.
/// </term>
/// </item>
/// <item>
/// <term>SND_LOOP</term>
/// <term>
/// The sound plays repeatedly until sndPlaySound is called again with the lpszSound parameter set to NULL. You must also specify
/// the SND_ASYNC flag to loop sounds.
/// </term>
/// </item>
/// <item>
/// <term>SND_MEMORY</term>
/// <term>
/// The parameter specified by lpszSound points to an image of a waveform sound in memory. The data passed must be trusted by the application.
/// </term>
/// </item>
/// <item>
/// <term>SND_NODEFAULT</term>
/// <term>If the sound cannot be found, the function returns silently without playing the default sound.</term>
/// </item>
/// <item>
/// <term>SND_NOSTOP</term>
/// <term>
/// If a sound is currently playing in the same process, the function immediately returns FALSE, without playing the requested sound.
/// </term>
/// </item>
/// <item>
/// <term>SND_SENTRY</term>
/// <term>
/// Note Requires Windows Vista or later. If this flag is set, the function triggers a SoundSentry event when the sound is played.
/// For more information, see PlaySound.
/// </term>
/// </item>
/// <item>
/// <term>SND_SYNC</term>
/// <term>The sound is played synchronously and the function does not return until the sound ends.</term>
/// </item>
/// <item>
/// <term>SND_SYSTEM</term>
/// <term>
/// Note Requires Windows Vista or later. If this flag is set, the sound is assigned to the audio session for system notification
/// sounds. For more information, see PlaySound.
/// </term>
/// </item>
/// </list>
/// </param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
/// <remarks>
/// <para>
/// If the specified sound cannot be found, <c>sndPlaySound</c> plays the system default sound. If there is no system default entry
/// in the registry or WIN.INI file, or if the default sound cannot be found, the function makes no sound and returns <c>FALSE</c>.
/// </para>
/// <para>
/// The specified sound must fit in available physical memory and be playable by an installed waveform-audio device driver. If
/// <c>sndPlaySound</c> does not find the sound in the current directory, the function searches for it using the standard
/// directory-search order.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/previous-versions/dd798676(v=vs.85) BOOL sndPlaySound( LPCTSTR lpszSound, UINT fuSound );
[DllImport(Lib_Winmm, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("Mmsystem.h")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool sndPlaySound([In, Optional] string lpszSound, uint fuSound);
/// <summary>Multimedia time.</summary>
// https://docs.microsoft.com/en-us/previous-versions/dd757347(v=vs.85) typedef struct mmtime_tag { UINT wType; union { DWORD ms;
// DWORD sample; DWORD cb; DWORD ticks; struct { BYTE hour; BYTE min; BYTE sec; BYTE frame; BYTE fps; BYTE dummy; BYTE pad[2]; }
// smpte; struct { DWORD songptrpos; } midi; } u; } MMTIME, *PMMTIME, *LPMMTIME;
[PInvokeData("Mmsystem.h")]
[StructLayout(LayoutKind.Sequential)]
public struct MMTIME
{
/// <summary>Time format.</summary>
public MMTIME_TYPE wType;
/// <summary>The value.</summary>
public uint u;
}
}
}

3370
PInvoke/Multimedia/MmeApi.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<ProjectExtensions>
<SupportedDlls>winmm.dll;msacm32.dll;avifil32.dll</SupportedDlls>
</ProjectExtensions>
<PropertyGroup>
<Description>PInvoke API (methods, structures and constants) imported from Windows Multimedia (winmm.dll, msacm32.dll, avifil32.dll).</Description>
<AssemblyTitle>$(AssemblyName)</AssemblyTitle>
<TargetFrameworks>net20;net35;net40;net45;net5.0-windows;netstandard2.0;netcoreapp2.0;netcoreapp2.1;netcoreapp3.0;netcoreapp3.1</TargetFrameworks>
<AssemblyName>Vanara.PInvoke.Multimedia</AssemblyName>
<PackageId>$(AssemblyName)</PackageId>
<PackageTags>pinvoke;vanara;net-extensions;interop;winmm;windows multimedia;wav;waveform;audio;msacm32;avifil32</PackageTags>
<PackageReleaseNotes />
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\..\Core\Vanara.Core.csproj" />
<ProjectReference Include="..\ComDlg32\Vanara.PInvoke.ComDlg32.csproj" />
<ProjectReference Include="..\Gdi32\Vanara.PInvoke.Gdi32.csproj" />
<ProjectReference Include="..\Kernel32\Vanara.PInvoke.Kernel32.csproj" />
<ProjectReference Include="..\Shared\Vanara.PInvoke.Shared.csproj" />
</ItemGroup>
</Project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,916 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using static Vanara.PInvoke.Gdi32;
namespace Vanara.PInvoke
{
/// <summary>Items from the Msvfw32.dll</summary>
public static partial class Msvfw32
{
private const string Lib_Msvfw32 = "msvfw32.dll";
/// <summary>Applicable flags for the function.</summary>
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibBegin")]
[Flags]
public enum DDF : uint
{
/// <summary>
/// Last buffered bitmap needs to be redrawn. If drawing fails with this value, a buffered image is not available and a new
/// image needs to be specified before the display can be updated.
/// </summary>
DDF_UPDATE = 0x0002,
/// <summary>Use the current DC handle and the palette currently associated with the DC.</summary>
DDF_SAME_HDC = 0x0004,
/// <summary>
/// Use the current drawing parameters for DrawDibDraw. Use this value only if lpbi, dxDest, dyDest, dxSrc, and dySrc have not
/// changed since using DrawDibDraw or DrawDibBegin. This flag supersedes the DDF_SAME_DIB and DDF_SAME_SIZE flags.
/// </summary>
DDF_SAME_DRAW = 0x0008,
/// <summary>
/// Current image is not drawn, but is decompressed. DDF_UPDATE can be used later to draw the image. This flag supersedes the
/// DDF_PREROLL flag.
/// </summary>
DDF_DONTDRAW = 0x0010,
/// <summary>
/// Allows palette animation. If this value is present, DrawDib reserves as many entries as possible by setting PC_RESERVED in
/// the palPalEntry array entries of the LOGPALETTE structure, and the palette can be animated by using the DrawDibChangePalette
/// function. If your application uses the DrawDibBegin function with the DrawDibDraw function, set this value with DrawDibBegin
/// rather than DrawDibDraw.
/// </summary>
DDF_ANIMATE = 0x0020,
/// <summary>
/// Causes DrawDib to try to use an off-screen buffer so DDF_UPDATE can be used. This disables decompression and drawing
/// directly to the screen. If DrawDib is unable to create an off-screen buffer, it will decompress or draw directly to the
/// screen. For more information, see the DDF_UPDATE and DDF_DONTDRAW values described for DrawDibDraw.
/// </summary>
DDF_BUFFER = 0x0040,
/// <summary>
/// Draws the image by using GDI. Prohibits DrawDib functions from decompressing, stretching, or dithering the image. This
/// strips DrawDib of capabilities that differentiate it from the StretchDIBits function.
/// </summary>
DDF_JUSTDRAWIT = 0x0080,
/// <summary>Not supported.</summary>
DDF_FULLSCREEN = 0x0100,
/// <summary>
/// Realizes the palette used for drawing as a background task, leaving the current palette used for the display unchanged.
/// (This value is mutually exclusive of DDF_SAME_HDC.)
/// </summary>
DDF_BACKGROUNDPAL = 0x0200,
/// <summary>this is a partial frame update, hint</summary>
DDF_NOTKEYFRAME = 0x0400,
/// <summary>hurry up please!</summary>
DDF_HURRYUP = 0x0800,
/// <summary>
/// Always dithers the DIB to a standard palette regardless of the palette of the DIB. If your application uses DrawDibBegin
/// with DrawDibDraw, set this value with DrawDibBegin rather than DrawDibDraw.
/// </summary>
DDF_HALFTONE = 0x1000,
}
/// <summary>The <c>DrawDib</c> function changes parameters of a DrawDib DC or initializes a new DrawDib DC.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="hdc">Handle to a DC for drawing. This parameter is optional.</param>
/// <param name="dxDst">Width, in <c>MM_TEXT</c> client units, of the destination rectangle.</param>
/// <param name="dyDst">Height, in <c>MM_TEXT</c> client units, of the destination rectangle.</param>
/// <param name="lpbi">
/// Pointer to a BITMAPINFOHEADER structure containing the image format. The color table for the DIB follows the image format and
/// the <c>biHeight</c> member must be a positive value.
/// </param>
/// <param name="dxSrc">Width, in pixels, of the source rectangle.</param>
/// <param name="dySrc">Height, in pixels, of the source rectangle.</param>
/// <param name="wFlags">
/// <para>Applicable flags for the function. The following values are defined.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>DDF_ANIMATE</term>
/// <term>
/// Allows palette animation. If this value is present, DrawDib reserves as many entries as possible by setting PC_RESERVED in the
/// palPalEntry array entries of the LOGPALETTE structure, and the palette can be animated by using the DrawDibChangePalette
/// function. If your application uses the DrawDibBegin function with the DrawDibDraw function, set this value with DrawDibBegin
/// rather than DrawDibDraw.
/// </term>
/// </item>
/// <item>
/// <term>DDF_BACKGROUNDPAL</term>
/// <term>
/// Realizes the palette used for drawing as a background task, leaving the current palette used for the display unchanged. (This
/// value is mutually exclusive of DDF_SAME_HDC.)
/// </term>
/// </item>
/// <item>
/// <term>DDF_BUFFER</term>
/// <term>
/// Causes DrawDib to try to use an off-screen buffer so DDF_UPDATE can be used. This disables decompression and drawing directly to
/// the screen. If DrawDib is unable to create an off-screen buffer, it will decompress or draw directly to the screen. For more
/// information, see the DDF_UPDATE and DDF_DONTDRAW values described for DrawDibDraw.
/// </term>
/// </item>
/// <item>
/// <term>DDF_DONTDRAW</term>
/// <term>
/// Current image is not drawn, but is decompressed. DDF_UPDATE can be used later to draw the image. This flag supersedes the
/// DDF_PREROLL flag.
/// </term>
/// </item>
/// <item>
/// <term>DDF_FULLSCREEN</term>
/// <term>Not supported.</term>
/// </item>
/// <item>
/// <term>DDF_HALFTONE</term>
/// <term>
/// Always dithers the DIB to a standard palette regardless of the palette of the DIB. If your application uses DrawDibBegin with
/// DrawDibDraw, set this value with DrawDibBegin rather than DrawDibDraw.
/// </term>
/// </item>
/// <item>
/// <term>DDF_JUSTDRAWIT</term>
/// <term>
/// Draws the image by using GDI. Prohibits DrawDib functions from decompressing, stretching, or dithering the image. This strips
/// DrawDib of capabilities that differentiate it from the StretchDIBits function.
/// </term>
/// </item>
/// <item>
/// <term>DDF_SAME_DRAW</term>
/// <term>
/// Use the current drawing parameters for DrawDibDraw. Use this value only if lpbi, dxDest, dyDest, dxSrc, and dySrc have not
/// changed since using DrawDibDraw or DrawDibBegin. This flag supersedes the DDF_SAME_DIB and DDF_SAME_SIZE flags.
/// </term>
/// </item>
/// <item>
/// <term>DDF_SAME_HDC</term>
/// <term>Use the current DC handle and the palette currently associated with the DC.</term>
/// </item>
/// <item>
/// <term>DDF_UPDATE</term>
/// <term>
/// Last buffered bitmap needs to be redrawn. If drawing fails with this value, a buffered image is not available and a new image
/// needs to be specified before the display can be updated.
/// </term>
/// </item>
/// </list>
/// </param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
/// <remarks>
/// <para>
/// This function prepares to draw a DIB specified by lpbi to the DC. The image is stretched to the size specified by dxDest and
/// dyDest. If dxDest and dyDest are set to 1, the DIB is drawn to a 1:1 scale without stretching.
/// </para>
/// <para>
/// You can update the flags of a DrawDib DC by reissuing <c>DrawDibBegin</c>, specifying the new flags, and changing at least one
/// of the following settings: dxDest, dyDest, lpbi, dxSrc, or dySrc.
/// </para>
/// <para>If the parameters of <c>DrawDibBegin</c> have not changed, subsequent calls to the function have no effect.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibbegin BOOL VFWAPI DrawDibBegin( HDRAWDIB hdd, HDC hdc, int
// dxDst, int dyDst, LPBITMAPINFOHEADER lpbi, int dxSrc, int dySrc, UINT wFlags );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibBegin")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibBegin([In] HDRAWDIB hdd, [In, Optional] HDC hdc, int dxDst, int dyDst, in BITMAPINFOHEADER lpbi, int dxSrc, int dySrc, DDF wFlags);
/// <summary>The <c>DrawDibChangePalette</c> function sets the palette entries used for drawing DIBs.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="iStart">Starting palette entry number.</param>
/// <param name="iLen">Number of palette entries.</param>
/// <param name="lppe">Pointer to an array of palette entries.</param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
/// <remarks>
/// <para>
/// This function changes the physical palette only if the current DrawDib palette is realized by calling the DrawDibRealize function.
/// </para>
/// <para>
/// If the color table is not changed, the next call to the DrawDibDraw function that does not specify DDF_SAME_DRAW calls the
/// DrawDibBegin function implicitly.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibchangepalette BOOL VFWAPI DrawDibChangePalette( HDRAWDIB
// hdd, int iStart, int iLen, LPPALETTEENTRY lppe );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibChangePalette")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibChangePalette([In] HDRAWDIB hdd, int iStart, int iLen, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] PALETTEENTRY[] lppe);
/// <summary>The <c>DrawDibClose</c> function closes a DrawDib DC and frees the resources DrawDib allocated for it.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibclose BOOL VFWAPI DrawDibClose( HDRAWDIB hdd );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibClose")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibClose(HDRAWDIB hdd);
/// <summary>The <c>DrawDibDraw</c> function draws a DIB to the screen.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="hdc">Handle to the DC.</param>
/// <param name="xDst">The x-coordinate, in <c>MM_TEXT</c> client coordinates, of the upper left corner of the destination rectangle.</param>
/// <param name="yDst">The y-coordinate, in <c>MM_TEXT</c> client coordinates, of the upper left corner of the destination rectangle.</param>
/// <param name="dxDst">
/// Width, in <c>MM_TEXT</c> client coordinates, of the destination rectangle. If dxDst is 1, the width of the bitmap is used.
/// </param>
/// <param name="dyDst">
/// Height, in <c>MM_TEXT</c> client coordinates, of the destination rectangle. If dyDst is 1, the height of the bitmap is used.
/// </param>
/// <param name="lpbi">
/// Pointer to the BITMAPINFOHEADER structure containing the image format. The color table for the DIB within
/// <c>BITMAPINFOHEADER</c> follows the format and the <c>biHeight</c> member must be a positive value; <c>DrawDibDraw</c> will not
/// draw inverted DIBs.
/// </param>
/// <param name="lpBits">Pointer to the buffer that contains the bitmap bits.</param>
/// <param name="xSrc">
/// The x-coordinate, in pixels, of the upper left corner of the source rectangle. The coordinates (0,0) represent the upper left
/// corner of the bitmap.
/// </param>
/// <param name="ySrc">
/// The y-coordinate, in pixels, of the upper left corner of the source rectangle. The coordinates (0,0) represent the upper left
/// corner of the bitmap.
/// </param>
/// <param name="dxSrc">Width, in pixels, of the source rectangle.</param>
/// <param name="dySrc">Height, in pixels, of the source rectangle.</param>
/// <param name="wFlags">
/// <para>Applicable flags for drawing. The following values are defined.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>DDF_BACKGROUNDPAL</term>
/// <term>
/// Realizes the palette used for drawing in the background, leaving the actual palette used for display unchanged. This value is
/// valid only if DDF_SAME_HDC is not set.
/// </term>
/// </item>
/// <item>
/// <term>DDF_DONTDRAW</term>
/// <term>Current image is decompressed but not drawn. This flag supersedes the DDF_PREROLL flag.</term>
/// </item>
/// <item>
/// <term>DDF_FULLSCREEN</term>
/// <term>Not supported.</term>
/// </item>
/// <item>
/// <term>DDF_HALFTONE</term>
/// <term>
/// Always dithers the DIB to a standard palette regardless of the palette of the DIB. If your application uses the DrawDibBegin
/// function, set this value in DrawDibBegin rather than in DrawDibDraw.
/// </term>
/// </item>
/// <item>
/// <term>DDF_HURRYUP</term>
/// <term>
/// Data does not have to be drawn (that is, it can be dropped) and DDF_UPDATE will not be used to recall this information. DrawDib
/// checks this value only if it is required to build the next frame; otherwise, the value is ignored.This value is usually used to
/// synchronize video and audio. When synchronizing data, applications should send the image with this value in case the driver
/// needs to buffer the frame to decompress subsequent frames.
/// </term>
/// </item>
/// <item>
/// <term>DDF_NOTKEYFRAME</term>
/// <term>DIB data is not a key frame.</term>
/// </item>
/// <item>
/// <term>DDF_SAME_HDC</term>
/// <term>Use the current DC handle and the palette currently associated with the DC.</term>
/// </item>
/// <item>
/// <term>DDF_SAME_DRAW</term>
/// <term>
/// Use the current drawing parameters for DrawDibDraw. Use this value only if lpbi, dxDst, dyDst, dxSrc, and dySrc have not changed
/// since using DrawDibDraw or DrawDibBegin. DrawDibDraw typically checks the parameters, and if they have changed, DrawDibBegin
/// prepares the DrawDib DC for drawing. This flag supersedes the DDF_SAME_DIB and DDF_SAME_SIZE flags.
/// </term>
/// </item>
/// <item>
/// <term>DDF_UPDATE</term>
/// <term>
/// Last buffered bitmap is to be redrawn. If drawing fails with this value, a buffered image is not available and a new image needs
/// to be specified before the display can be updated.
/// </term>
/// </item>
/// </list>
/// </param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
/// <remarks>
/// <para>
/// <c>DDF_DONTDRAW</c> causes <c>DrawDibDraw</c> to decompress but not display an image. A subsequent call to <c>DrawDibDraw</c>
/// specifying <c>DDF_UPDATE</c> displays the image.
/// </para>
/// <para>
/// If the DrawDib DC does not have an off-screen buffer specified, specifying <c>DDF_DONTDRAW</c> causes the frame to be drawn to
/// the screen immediately. Subsequent calls to <c>DrawDibDraw</c> specifying <c>DDF_UPDATE</c> fail.
/// </para>
/// <para>
/// Although they are set at different times, <c>DDF_UPDATE</c> and <c>DDF_DONTDRAW</c> can be used together to create composite
/// images off-screen. When the off-screen image is complete, you can display the image by calling <c>DrawDibDraw</c>.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibdraw BOOL VFWAPI DrawDibDraw( HDRAWDIB hdd, HDC hdc, int
// xDst, int yDst, int dxDst, int dyDst, LPBITMAPINFOHEADER lpbi, LPVOID lpBits, int xSrc, int ySrc, int dxSrc, int dySrc, UINT
// wFlags );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibDraw")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibDraw([In] HDRAWDIB hdd, [In] HDC hdc, int xDst, int yDst, int dxDst, int dyDst, in BITMAPINFOHEADER lpbi, [In, Optional] IntPtr lpBits, int xSrc, int ySrc, int dxSrc, int dySrc, DDF wFlags);
/// <summary>The <c>DrawDibDraw</c> function draws a DIB to the screen.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="hdc">Handle to the DC.</param>
/// <param name="xDst">The x-coordinate, in <c>MM_TEXT</c> client coordinates, of the upper left corner of the destination rectangle.</param>
/// <param name="yDst">The y-coordinate, in <c>MM_TEXT</c> client coordinates, of the upper left corner of the destination rectangle.</param>
/// <param name="dxDst">
/// Width, in <c>MM_TEXT</c> client coordinates, of the destination rectangle. If dxDst is 1, the width of the bitmap is used.
/// </param>
/// <param name="dyDst">
/// Height, in <c>MM_TEXT</c> client coordinates, of the destination rectangle. If dyDst is 1, the height of the bitmap is used.
/// </param>
/// <param name="lpbi">
/// Pointer to the BITMAPINFOHEADER structure containing the image format. The color table for the DIB within
/// <c>BITMAPINFOHEADER</c> follows the format and the <c>biHeight</c> member must be a positive value; <c>DrawDibDraw</c> will not
/// draw inverted DIBs.
/// </param>
/// <param name="lpBits">Pointer to the buffer that contains the bitmap bits.</param>
/// <param name="xSrc">
/// The x-coordinate, in pixels, of the upper left corner of the source rectangle. The coordinates (0,0) represent the upper left
/// corner of the bitmap.
/// </param>
/// <param name="ySrc">
/// The y-coordinate, in pixels, of the upper left corner of the source rectangle. The coordinates (0,0) represent the upper left
/// corner of the bitmap.
/// </param>
/// <param name="dxSrc">Width, in pixels, of the source rectangle.</param>
/// <param name="dySrc">Height, in pixels, of the source rectangle.</param>
/// <param name="wFlags">
/// <para>Applicable flags for drawing. The following values are defined.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Meaning</term>
/// </listheader>
/// <item>
/// <term>DDF_BACKGROUNDPAL</term>
/// <term>
/// Realizes the palette used for drawing in the background, leaving the actual palette used for display unchanged. This value is
/// valid only if DDF_SAME_HDC is not set.
/// </term>
/// </item>
/// <item>
/// <term>DDF_DONTDRAW</term>
/// <term>Current image is decompressed but not drawn. This flag supersedes the DDF_PREROLL flag.</term>
/// </item>
/// <item>
/// <term>DDF_FULLSCREEN</term>
/// <term>Not supported.</term>
/// </item>
/// <item>
/// <term>DDF_HALFTONE</term>
/// <term>
/// Always dithers the DIB to a standard palette regardless of the palette of the DIB. If your application uses the DrawDibBegin
/// function, set this value in DrawDibBegin rather than in DrawDibDraw.
/// </term>
/// </item>
/// <item>
/// <term>DDF_HURRYUP</term>
/// <term>
/// Data does not have to be drawn (that is, it can be dropped) and DDF_UPDATE will not be used to recall this information. DrawDib
/// checks this value only if it is required to build the next frame; otherwise, the value is ignored.This value is usually used to
/// synchronize video and audio. When synchronizing data, applications should send the image with this value in case the driver
/// needs to buffer the frame to decompress subsequent frames.
/// </term>
/// </item>
/// <item>
/// <term>DDF_NOTKEYFRAME</term>
/// <term>DIB data is not a key frame.</term>
/// </item>
/// <item>
/// <term>DDF_SAME_HDC</term>
/// <term>Use the current DC handle and the palette currently associated with the DC.</term>
/// </item>
/// <item>
/// <term>DDF_SAME_DRAW</term>
/// <term>
/// Use the current drawing parameters for DrawDibDraw. Use this value only if lpbi, dxDst, dyDst, dxSrc, and dySrc have not changed
/// since using DrawDibDraw or DrawDibBegin. DrawDibDraw typically checks the parameters, and if they have changed, DrawDibBegin
/// prepares the DrawDib DC for drawing. This flag supersedes the DDF_SAME_DIB and DDF_SAME_SIZE flags.
/// </term>
/// </item>
/// <item>
/// <term>DDF_UPDATE</term>
/// <term>
/// Last buffered bitmap is to be redrawn. If drawing fails with this value, a buffered image is not available and a new image needs
/// to be specified before the display can be updated.
/// </term>
/// </item>
/// </list>
/// </param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
/// <remarks>
/// <para>
/// <c>DDF_DONTDRAW</c> causes <c>DrawDibDraw</c> to decompress but not display an image. A subsequent call to <c>DrawDibDraw</c>
/// specifying <c>DDF_UPDATE</c> displays the image.
/// </para>
/// <para>
/// If the DrawDib DC does not have an off-screen buffer specified, specifying <c>DDF_DONTDRAW</c> causes the frame to be drawn to
/// the screen immediately. Subsequent calls to <c>DrawDibDraw</c> specifying <c>DDF_UPDATE</c> fail.
/// </para>
/// <para>
/// Although they are set at different times, <c>DDF_UPDATE</c> and <c>DDF_DONTDRAW</c> can be used together to create composite
/// images off-screen. When the off-screen image is complete, you can display the image by calling <c>DrawDibDraw</c>.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibdraw BOOL VFWAPI DrawDibDraw( HDRAWDIB hdd, HDC hdc, int
// xDst, int yDst, int dxDst, int dyDst, LPBITMAPINFOHEADER lpbi, LPVOID lpBits, int xSrc, int ySrc, int dxSrc, int dySrc, UINT
// wFlags );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibDraw")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibDraw([In] HDRAWDIB hdd, [In] HDC hdc, int xDst, int yDst, int dxDst, int dyDst, [In, Optional] IntPtr lpbi, [In, Optional] IntPtr lpBits, int xSrc, int ySrc, int dxSrc, int dySrc, DDF wFlags);
/// <summary>
/// The <c>DrawDibEnd</c> function clears the flags and other settings of a DrawDib DC that are set by the DrawDibBegin or
/// DrawDibDraw functions.
/// </summary>
/// <param name="hdd">Handle to the DrawDib DC to free.</param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibend BOOL VFWAPI DrawDibEnd( HDRAWDIB hdd );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibEnd")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibEnd([In] HDRAWDIB hdd);
/// <summary>The <c>DrawDibGetBuffer</c> function retrieves the location of the buffer used by DrawDib for decompression.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="lpbi">
/// Pointer to a BITMAPINFO structure. This structure is made up of a BITMAPINFOHEADER structure and a 256-entry table defining the
/// colors used by the bitmap.
/// </param>
/// <param name="dwSize">Size, in bytes, of the BITMAPINFO structure pointed to by lpbi</param>
/// <param name="dwFlags">Reserved; must be zero.</param>
/// <returns>
/// Returns the address of the buffer or <c>NULL</c> if no buffer is used. if lpbr is not <c>NULL</c>, it is filled with a copy of
/// the BITMAPINFO structure describing the buffer.
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibgetbuffer LPVOID VFWAPI DrawDibGetBuffer( HDRAWDIB hdd,
// LPBITMAPINFOHEADER lpbi, DWORD dwSize, DWORD dwFlags );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibGetBuffer")]
public static extern IntPtr DrawDibGetBuffer([In] HDRAWDIB hdd, out BITMAPINFOHEADER lpbi, uint dwSize, uint dwFlags = 0);
/// <summary>The <c>DrawDibGetPalette</c> function retrieves the palette used by a DrawDib DC.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <returns>Returns a handle to the palette if successful or <c>NULL</c> otherwise.</returns>
/// <remarks>
/// <para>
/// This function assumes the DrawDib DC contains a valid palette entry, implying that a call to this function must follow calls to
/// the DrawDibDraw or DrawDibBegin functions.
/// </para>
/// <para>
/// You should rarely need to call this function because you can realize the correct palette in response to a window message by
/// using the DrawDibRealize function.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibgetpalette HPALETTE VFWAPI DrawDibGetPalette( HDRAWDIB hdd );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibGetPalette")]
public static extern SafeHPALETTE DrawDibGetPalette([In] HDRAWDIB hdd);
/// <summary>The <c>DrawDibOpen</c> function opens the DrawDib library for use and creates a DrawDib DC for drawing.</summary>
/// <returns>Returns a handle to a DrawDib DC if successful or <c>NULL</c> otherwise.</returns>
/// <remarks>
/// When drawing multiple DIBs simultaneously, create a DrawDib DC for each of the images that will be simultaneously on-screen.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibopen HDRAWDIB VFWAPI DrawDibOpen();
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibOpen")]
public static extern SafeHDRAWDIB DrawDibOpen();
/// <summary>The <c>DrawDibProfileDisplay</c> function determines settings for the display system when using DrawDib functions.</summary>
/// <param name="lpbi">
/// Pointer to a BITMAPINFOHEADER structure that contains bitmap information. You can also specify <c>NULL</c> to verify that the
/// profile information is current. If the profile information is not current, DrawDib will rerun the profile tests to obtain a
/// current set of information. When you call <c>DrawDibProfileDisplay</c> with this parameter set to <c>NULL</c>, the return value
/// is meaningless.
/// </param>
/// <returns>
/// <para>
/// Returns a value that indicates the fastest drawing and stretching capabilities of the display system. This value can be zero if
/// the bitmap format is not supported or one or more of the following values.
/// </para>
/// <list type="table">
/// <listheader>
/// <term>Return code</term>
/// <term>Description</term>
/// </listheader>
/// <item>
/// <term>PD_CAN_DRAW_DIB</term>
/// <term>DrawDib can draw images using this format. Stretching might or might not also be supported.</term>
/// </item>
/// <item>
/// <term>PD_CAN_STRETCHDIB</term>
/// <term>DrawDib can stretch and draw images using this format.</term>
/// </item>
/// <item>
/// <term>PD_STRETCHDIB_1_1_OK</term>
/// <term>StretchDIBits draws unstretched images using this format faster than an alternative method.</term>
/// </item>
/// <item>
/// <term>PD_STRETCHDIB_1_2_OK</term>
/// <term>StretchDIBits draws stretched images (in a 1:2 ratio) using this format faster than an alternative method.</term>
/// </item>
/// <item>
/// <term>PD_STRETCHDIB_1_N_OK</term>
/// <term>StretchDIBits draws stretched images (in a 1:N ratio) using this format faster than an alternative method.</term>
/// </item>
/// </list>
/// </returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibprofiledisplay LRESULT VFWAPI DrawDibProfileDisplay(
// LPBITMAPINFOHEADER lpbi );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibProfileDisplay")]
public static extern IntPtr DrawDibProfileDisplay(in BITMAPINFOHEADER lpbi);
/// <summary>The <c>DrawDibRealize</c> function realizes the palette of the DrawDib DC for use with the specified DC.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="hdc">Handle to the DC containing the palette.</param>
/// <param name="fBackground">
/// Background palette flag. If this value is nonzero, the palette is a background palette. If this value is zero and the DC is
/// attached to a window, the logical palette becomes the foreground palette when the window has the input focus. (A DC is attached
/// to a window when the window class style is CS_OWNDC or when the DC is obtained by using the GetDC function.)
/// </param>
/// <returns>
/// Returns the number of entries in the logical palette mapped to different values in the system palette. If an error occurs or no
/// colors were updated, it returns zero.
/// </returns>
/// <remarks>
/// To select the palette of the DrawDib DC as a background palette, use the DrawDibDraw function and specify the DDF_BACKGROUNDPAL flag.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibrealize UINT VFWAPI DrawDibRealize( HDRAWDIB hdd, HDC hdc,
// BOOL fBackground );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibRealize")]
public static extern uint DrawDibRealize([In] HDRAWDIB hdd, [In] HDC hdc, [MarshalAs(UnmanagedType.Bool)] bool fBackground);
/// <summary>The <c>DrawDibSetPalette</c> function sets the palette used for drawing DIBs.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="hpal">Handle to the palette. Specify <c>NULL</c> to use the default palette.</param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibsetpalette BOOL VFWAPI DrawDibSetPalette( HDRAWDIB hdd,
// HPALETTE hpal );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibSetPalette")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibSetPalette([In] HDRAWDIB hdd, [In, Optional] HPALETTE hpal);
/// <summary>The <c>DrawDibStart</c> function prepares a DrawDib DC for streaming playback.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="rate">Playback rate, in microseconds per frame.</param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibstart BOOL VFWAPI DrawDibStart( HDRAWDIB hdd, DWORD rate );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibStart")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibStart([In] HDRAWDIB hdd, uint rate);
/// <summary>The <c>DrawDibStop</c> function frees the resources used by a DrawDib DC for streaming playback.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibstop BOOL VFWAPI DrawDibStop( HDRAWDIB hdd );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibStop")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibStop([In] HDRAWDIB hdd);
/// <summary>
/// The <c>DrawDibTime</c> function retrieves timing information about the drawing operation and is used during debug operations.
/// </summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="lpddtime">Pointer to a DRAWDIBTIME structure.</param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
/// <remarks>This function is present only in the debug version of the Microsoft Windows Software Development Kit (SDK) libraries.</remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibtime BOOL VFWAPI DrawDibTime( HDRAWDIB hdd, LPDRAWDIBTIME
// lpddtime );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibTime")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool DrawDibTime([In] HDRAWDIB hdd, out DRAWDIBTIME lpddtime);
/// <summary>The <c>DrawDibUpdate</c> macro draws the last frame in the DrawDib off-screen buffer.</summary>
/// <param name="hdd">Handle to a DrawDib DC.</param>
/// <param name="hdc">Handle of the DC.</param>
/// <param name="x">The x-coordinate, in MM_TEXT client coordinates, of the upper left corner of the destination rectangle.</param>
/// <param name="y">The y-coordinate, in MM_TEXT client coordinates, of the upper left corner of the destination rectangle.</param>
/// <returns>Returns <c>TRUE</c> if successful or <c>FALSE</c> otherwise.</returns>
/// <remarks>
/// <para>The <c>DrawDibUpdate</c> macro is defined as follows:</para>
/// <para>
/// <code> #define DrawDibUpdate( hdd, hdc, x, y) \ DrawDibDraw( hdd, hdc, x, y, 0, 0, NULL, NULL, 0, 0, \ 0, 0, DDF_UPDATE)</code>
/// </para>
/// <para>This macro can be used to refresh an image or a portion of an image displayed by your application.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-drawdibupdate void DrawDibUpdate( hdd, hdc, x, y );
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.DrawDibUpdate")]
public static bool DrawDibUpdate([In] HDRAWDIB hdd, [In] HDC hdc, int x, int y) => DrawDibDraw(hdd, hdc, x, y, 0, 0, default, default, 0, 0, 0, 0, DDF.DDF_UPDATE);
/// <summary>
/// The <c>GetOpenFileNamePreview</c> function selects a file by using the Open dialog box. The dialog box also allows the user to
/// preview the currently specified AVI file. This function augments the capability found in the GetOpenFileName function.
/// </summary>
/// <param name="lpofn">
/// Pointer to an <c>OPENFILENAME</c> structure used to initialize the dialog box. On return, the structure contains information
/// about the user's file selection.
/// </param>
/// <returns>Returns a handle to the selected file.</returns>
/// <remarks>
/// <para>Note</para>
/// <para>
/// The vfw.h header defines GetOpenFileNamePreview as an alias which automatically selects the ANSI or Unicode version of this
/// function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that
/// not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions
/// for Function Prototypes.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-getopenfilenamepreviewa BOOL VFWAPI GetOpenFileNamePreviewA(
// LPOPENFILENAMEA lpofn );
[DllImport(Lib_Msvfw32, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.GetOpenFileNamePreviewA")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetOpenFileNamePreview(ref ComDlg32.OPENFILENAME lpofn);
/// <summary>
/// The <c>GetSaveFileNamePreview</c> function selects a file by using the Save As dialog box. The dialog box also allows the user
/// to preview the currently specified file. This function augments the capability found in the GetSaveFileName function.
/// </summary>
/// <param name="lpofn">
/// Pointer to an <c>OPENFILENAME</c> structure used to initialize the dialog box. On return, the structure contains information
/// about the user's file selection.
/// </param>
/// <returns>Returns a handle to the selected file.</returns>
/// <remarks>
/// <para>Note</para>
/// <para>
/// The vfw.h header defines GetSaveFileNamePreview as an alias which automatically selects the ANSI or Unicode version of this
/// function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that
/// not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions
/// for Function Prototypes.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-getsavefilenamepreviewa BOOL VFWAPI GetSaveFileNamePreviewA(
// LPOPENFILENAMEA lpofn );
[DllImport(Lib_Msvfw32, SetLastError = false, CharSet = CharSet.Auto)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.GetSaveFileNamePreviewA")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetSaveFileNamePreview(ref ComDlg32.OPENFILENAME lpofn);
/// <summary>
/// The <c>StretchDIB</c> function copies a device independent bitmap from one memory location to another and resizes the image to
/// fit the destination rectangle.
/// </summary>
/// <param name="biDst">Pointer to a BITMAPINFOHEADER structure that describes the destination bitmap.</param>
/// <param name="lpDst">Pointer to the memory buffer that will receive the copied pixel bits.</param>
/// <param name="DstX">X coordinate of the destination rectangle's origin.</param>
/// <param name="DstY">Y coordinate of the destination rectangle's origin.</param>
/// <param name="DstXE">Width, in pixels, of the destination rectangle.</param>
/// <param name="DstYE">Height, in pixels, of the destination rectangle.</param>
/// <param name="biSrc">Pointer to a BITMAPINFOHEADER structure that describes the source bitmap.</param>
/// <param name="lpSrc">Pointer to the source bitmap data.</param>
/// <param name="SrcX">X coordinate of the source rectangle's origin.</param>
/// <param name="SrcY">Y coordinate of the source rectangle's origin.</param>
/// <param name="SrcXE">Width, in pixels, of the source rectangle.</param>
/// <param name="SrcYE">Height, in pixels, of the source rectangle.</param>
/// <returns>None</returns>
/// <remarks>
/// <para>The size of the destination buffer must be large enough to accommodate any alignment bytes at the end of each pixel row.</para>
/// <para>
/// This function does nothing if biSrc and biDst have different values for biBitCount or if the value for biSrc. biBitCount does
/// not equal 8, 16, or 24.
/// </para>
/// <para>
/// This function performs no dithering or other smoothing. Pixel values are merely dropped or duplicated on a line-by-line,
/// column-by-column basis.
/// </para>
/// <para>
/// This function does not do any special processing based on pixel encoding except for calculating the number of bits per pixel. In
/// particular this function will not generate correct results when pixels are encoded in groups of more than 1 pixel, as in the
/// case of a YUV format where U and V are decimated and so are not represented equally in each pixel.
/// </para>
/// <para>Before including Vfw.h, you must add the following line to your code:</para>
/// <para>
/// <code> #define DRAWDIB_INCLUDE_STRETCHDIB</code>
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-stretchdib void StretchDIB( LPBITMAPINFOHEADER biDst, LPVOID lpDst,
// int DstX, int DstY, int DstXE, int DstYE, LPBITMAPINFOHEADER biSrc, LPVOID lpSrc, int SrcX, int SrcY, int SrcXE, int SrcYE );
[DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("vfw.h", MSDNShortId = "NF:vfw.StretchDIB")]
public static extern void StretchDIB(in BITMAPINFOHEADER biDst, [Out] IntPtr lpDst, int DstX, int DstY, int DstXE, int DstYE, in BITMAPINFOHEADER biSrc, [In] IntPtr lpSrc, int SrcX, int SrcY, int SrcXE, int SrcYE);
/// <summary>
/// The <c>DRAWDIBTIME</c> structure contains elapsed timing information for performing a set of DrawDib operations. The DrawDibTime
/// function resets the count and the elapsed time value for each operation each time it is called.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/ns-vfw-drawdibtime typedef struct { LONG timeCount; LONG timeDraw; LONG
// timeDecompress; LONG timeDither; LONG timeStretch; LONG timeBlt; LONG timeSetDIBits; } DRAWDIBTIME, *LPDRAWDIBTIME;
[PInvokeData("vfw.h", MSDNShortId = "NS:vfw.__unnamed_struct_12")]
[StructLayout(LayoutKind.Sequential)]
public struct DRAWDIBTIME
{
/// <summary>
/// <para>Number of times the following operations have been performed since DrawDibTime was last called:</para>
/// <list type="bullet">
/// <item>
/// <term>Draw a bitmap on the screen.</term>
/// </item>
/// <item>
/// <term>Decompress a bitmap.</term>
/// </item>
/// <item>
/// <term>Dither a bitmap.</term>
/// </item>
/// <item>
/// <term>Stretch a bitmap.</term>
/// </item>
/// <item>
/// <term>Transfer bitmap data by using the BitBlt function.</term>
/// </item>
/// <item>
/// <term>Transfer bitmap data by using the SetDIBits function.</term>
/// </item>
/// </list>
/// </summary>
public int timeCount;
/// <summary>Time to draw bitmaps.</summary>
public int timeDraw;
/// <summary>Time to decompress bitmaps.</summary>
public int timeDecompress;
/// <summary>Time to dither bitmaps.</summary>
public int timeDither;
/// <summary>Time to stretch bitmaps.</summary>
public int timeStretch;
/// <summary>Time to transfer bitmaps by using the BitBlt function.</summary>
public int timeBlt;
/// <summary>Time to transfer bitmaps by using the SetDIBits function.</summary>
public int timeSetDIBits;
}
/// <summary>Provides a handle to a DrawDib DC.</summary>
[StructLayout(LayoutKind.Sequential)]
public struct HDRAWDIB : IHandle
{
private readonly IntPtr handle;
/// <summary>Initializes a new instance of the <see cref="HDRAWDIB"/> struct.</summary>
/// <param name="preexistingHandle">An <see cref="IntPtr"/> object that represents the pre-existing handle to use.</param>
public HDRAWDIB(IntPtr preexistingHandle) => handle = preexistingHandle;
/// <summary>Returns an invalid handle by instantiating a <see cref="HDRAWDIB"/> object with <see cref="IntPtr.Zero"/>.</summary>
public static HDRAWDIB NULL => new(IntPtr.Zero);
/// <summary>Gets a value indicating whether this instance is a null handle.</summary>
public bool IsNull => handle == IntPtr.Zero;
/// <summary>Performs an explicit conversion from <see cref="HDRAWDIB"/> to <see cref="IntPtr"/>.</summary>
/// <param name="h">The handle.</param>
/// <returns>The result of the conversion.</returns>
public static explicit operator IntPtr(HDRAWDIB h) => h.handle;
/// <summary>Performs an implicit conversion from <see cref="IntPtr"/> to <see cref="HDRAWDIB"/>.</summary>
/// <param name="h">The pointer to a handle.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator HDRAWDIB(IntPtr h) => new(h);
/// <summary>Implements the operator !=.</summary>
/// <param name="h1">The first handle.</param>
/// <param name="h2">The second handle.</param>
/// <returns>The result of the operator.</returns>
public static bool operator !=(HDRAWDIB h1, HDRAWDIB h2) => !(h1 == h2);
/// <summary>Implements the operator ==.</summary>
/// <param name="h1">The first handle.</param>
/// <param name="h2">The second handle.</param>
/// <returns>The result of the operator.</returns>
public static bool operator ==(HDRAWDIB h1, HDRAWDIB h2) => h1.Equals(h2);
/// <inheritdoc/>
public override bool Equals(object obj) => obj is HDRAWDIB h && handle == h.handle;
/// <inheritdoc/>
public override int GetHashCode() => handle.GetHashCode();
/// <inheritdoc/>
public IntPtr DangerousGetHandle() => handle;
}
/// <summary>Provides a <see cref="SafeHandle"/> for <see cref="HDRAWDIB"/> that is disposed using <see cref="DrawDibClose"/>.</summary>
public class SafeHDRAWDIB : SafeHANDLE
{
/// <summary>Initializes a new instance of the <see cref="SafeHDRAWDIB"/> class and assigns an existing handle.</summary>
/// <param name="preexistingHandle">An <see cref="IntPtr"/> object that represents the pre-existing handle to use.</param>
/// <param name="ownsHandle">
/// <see langword="true"/> to reliably release the handle during the finalization phase; otherwise, <see langword="false"/> (not recommended).
/// </param>
public SafeHDRAWDIB(IntPtr preexistingHandle, bool ownsHandle = true) : base(preexistingHandle, ownsHandle) { }
/// <summary>Initializes a new instance of the <see cref="SafeHDRAWDIB"/> class.</summary>
private SafeHDRAWDIB() : base() { }
/// <summary>Performs an implicit conversion from <see cref="SafeHDRAWDIB"/> to <see cref="HDRAWDIB"/>.</summary>
/// <param name="h">The safe handle instance.</param>
/// <returns>The result of the conversion.</returns>
public static implicit operator HDRAWDIB(SafeHDRAWDIB h) => h.handle;
/// <inheritdoc/>
protected override bool InternalReleaseHandle() => DrawDibClose(handle);
}
/*
ICAbout
ICClose
ICCompress
ICCompressBegin
ICCompressEnd
ICCompressGetFormat
ICCompressGetFormatSize
ICCompressGetSize
ICCompressorChoose
ICCompressorFree
ICCompressQuery
ICConfigure
ICDecompress
ICDecompressBegin
ICDecompressEnd
ICDecompressEx
ICDecompressExBegin
ICDecompressExEnd
ICDecompressExQuery
ICDecompressGetFormat
ICDecompressGetFormatSize
ICDecompressGetPalette
ICDecompressOpen
ICDecompressQuery
ICDecompressSetPalette
ICDraw
ICDrawBegin
ICDrawChangePalette
ICDrawEnd
ICDrawFlush
ICDrawGetTime
ICDrawOpen
ICDrawQuery
ICDrawRealize
ICDrawRenderBuffer
ICDrawSetTime
ICDrawStart
ICDrawStartPlay
ICDrawStop
ICDrawStopPlay
ICDrawSuggestFormat
ICDrawWindow
ICGetBuffersWanted
ICGetDefaultKeyFrameRate
ICGetDefaultQuality
ICGetDisplayFormat
ICGetInfo
ICGetState
ICGetStateSize
ICImageCompress
ICImageDecompress
ICInfo
ICInstall
ICLocate
ICOpen
ICOpenFunction
ICQueryAbout
ICQueryConfigure
ICRemove
ICSendMessage
ICSeqCompressFrame
ICSeqCompressFrameEnd
ICSeqCompressFrameStart
ICSetState
ICSetStatusProc
*/
}
}

View File

@ -0,0 +1,464 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using static Vanara.PInvoke.AviFil32;
namespace Vanara.PInvoke
{
/// <summary>Items from the AviFil32.dll</summary>
public static partial class AviFil32
{
/// <summary>
/// The <c>IAVIEditStream</c> interface supports manipulating and modifying editable streams. Uses IUnknown::QueryInterface,
/// IUnknown::AddRef, IUnknown::Release in addition to the following custom methods:
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nn-vfw-iavieditstream
[PInvokeData("vfw.h", MSDNShortId = "NN:vfw.IAVIEditStream")]
[ComImport, Guid("00020024-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAVIEditStream
{
/// <summary>
/// The <c>Cut</c> method removes a portion of a stream and places it in a temporary stream. Called when an application uses the
/// EditStreamCut function.
/// </summary>
/// <param name="plStart">Pointer to a buffer that receives the starting position of the operation.</param>
/// <param name="plLength">Pointer to a buffer that receives the length, in frames, of the operation.</param>
/// <returns>Pointer to a buffer that receives a pointer to the interface to the new stream.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavieditstream-cut HRESULT Cut( LONG *plStart, LONG *plLength,
// PAVISTREAM *ppResult );
IAVIStream Cut(ref int plStart, ref int plLength);
/// <summary>
/// The <c>Copy</c> method copies a stream or a portion of it to a temporary stream. Called when an application uses the
/// EditStreamCopy function.
/// </summary>
/// <param name="plStart">Pointer to a buffer that receives the starting position of the operation.</param>
/// <param name="plLength">Pointer to a buffer that receives the length, in frames, of the operation.</param>
/// <returns>Pointer to a buffer that receives a pointer to the interface to the new stream.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavieditstream-copy HRESULT Copy( LONG *plStart, LONG
// *plLength, PAVISTREAM *ppResult );
IAVIStream Copy(ref int plStart, ref int plLength);
/// <summary>
/// The <c>Paste</c> method copies a stream or a portion of it in another stream. Called when an application uses the
/// EditStreamPaste function.
/// </summary>
/// <param name="plPos">Pointer to a buffer that receives the starting position of the operation.</param>
/// <param name="plLength">Pointer to a buffer that receives the length, in bytes, of the data to paste from the source stream.</param>
/// <param name="pstream">Pointer to the interface to the source stream.</param>
/// <param name="lStart">Starting position of the copy operation within the source stream.</param>
/// <param name="lEnd">Ending position of the copy operation within the source stream.</param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavieditstream-paste HRESULT Paste( LONG *plPos, LONG
// *plLength, PAVISTREAM pstream, LONG lStart, LONG lEnd );
void Paste(ref int plPos, ref int plLength, [In, Out] IAVIStream pstream, [In] int lStart, [In] int lEnd);
/// <summary>The <c>Clone</c> method duplicates a stream. Called when an application uses the EditStreamClone function.</summary>
/// <returns>Receives a pointer to the interface to the new stream.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavieditstream-clone HRESULT Clone( PAVISTREAM *ppResult );
IAVIStream Clone();
/// <summary>
/// The <c>SetInfo</c> method changes the characteristics of a stream. Called when an application uses the EditStreamSetInfo function.
/// </summary>
/// <param name="lpInfo">Pointer to an AVISTREAMINFO structure containing the new stream characteristics.</param>
/// <param name="cbInfo">Size, in bytes, of the buffer.</param>
/// <returns>Returns the HRESULT defined by OLE.</returns>
/// <remarks>
/// <para>For handlers written in C++, <c>SetInfo</c> has the following syntax:</para>
/// <para>
/// <code> HRESULT SetInfo(AVISTREAMINFO *lpInfo, LONG cbInfo);</code>
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavieditstream-setinfo HRESULT SetInfo( AVISTREAMINFOW *lpInfo,
// LONG cbInfo );
void SetInfo(in AVISTREAMINFO lpInfo, [In] int cbInfo);
};
/// <summary>
/// The <c>IAVIFile</c> interface supports opening and manipulating files and file headers, and creating and obtaining stream
/// interfaces. Uses IUnknown::QueryInterface, IUnknown::AddRef, and IUnknown::Release in addition to the following custom methods:
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nn-vfw-iavifile
[PInvokeData("vfw.h", MSDNShortId = "NN:vfw.IAVIFile")]
[ComImport, Guid("00020020-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAVIFile
{
/// <summary>
/// The <c>Info</c> method returns with information about an AVI file. Called when an application uses the AVIFileInfo function.
/// </summary>
/// <param name="pfi">A pointer to an AVIFILEINFO structure. The method fills the structure with information about the file.</param>
/// <param name="lSize">The size, in bytes, of the buffer specified by pfi.</param>
/// <remarks>
/// <para>
/// If the buffer allocated is too small for the structure, this method should fail the call by returning AVIERR_BUFFERTOOSMALL.
/// Otherwise, it should fill the structure and return its size.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavifile-info HRESULT Info( AVIFILEINFOW *pfi, LONG lSize );
void Info(out AVIFILEINFO pfi, [In] int lSize);
/// <summary>
/// The <c>GetStream</c> method opens a stream by accessing it in a file. Called when an application uses the AVIFileGetStream function.
/// </summary>
/// <param name="ppStream">Pointer to a buffer that receives a pointer to the interface to a stream.</param>
/// <param name="fccType">Four-character code indicating the type of stream to locate.</param>
/// <param name="lParam">Stream number.</param>
/// <remarks>
/// <para>
/// It is typically easier to implement this method by creating all of the stream objects in advance by using the IAVIFile::Open
/// method. Then, this method accesses the interface to the specified stream.
/// </para>
/// <para>
/// Remember to increment the reference count maintained by the <c>AddRef</c> method for the stream when this method is used.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavifile-getstream HRESULT GetStream( PAVISTREAM *ppStream,
// DWORD fccType, LONG lParam );
void GetStream(out IAVIStream ppStream, [In] uint fccType, [In] int lParam);
/// <summary>
/// The <c>CreateStream</c> method creates a stream for writing. Called when an application uses the AVIFileCreateStream function.
/// </summary>
/// <param name="ppStream">Pointer to a buffer that receives a pointer to the interface to the new stream.</param>
/// <param name="psi">Pointer to an AVISTREAMINFO structure defining the stream to create.</param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavifile-createstream HRESULT CreateStream( PAVISTREAM
// *ppStream, AVISTREAMINFOW *psi );
void CreateStream(out IAVIStream ppStream, in AVISTREAMINFO psi);
/// <summary>The <c>WriteData</c> method writes file headers. Called when an application uses the AVIFileWriteData function.</summary>
/// <param name="ckid">A chunk ID.</param>
/// <param name="lpData">A pointer specifying the memory from which the data is written.</param>
/// <param name="cbData">A LONG specifying the number of bytes to write.</param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavifile-writedata HRESULT WriteData( DWORD ckid, LPVOID
// lpData, LONG cbData );
void WriteData([In] uint ckid, [In] IntPtr lpData, [In] int cbData);
/// <summary>The <c>ReadData</c> method reads file headers. Called when an application uses the AVIFileReadData function.</summary>
/// <param name="ckid">A chunk identfier.</param>
/// <param name="lpData">A pointer specifying the memory into which the data is read.</param>
/// <param name="lpcbData">A pointer to a LONG specifying the number of bytes read.</param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavifile-readdata HRESULT ReadData( DWORD ckid, LPVOID lpData,
// LONG *lpcbData );
void ReadData([In] uint ckid, [Out] IntPtr lpData, ref int lpcbData);
/// <summary>
/// The <c>EndRecord</c> method writes the "REC" chunk in a tightly interleaved AVI file (having a one-to-one interleave factor
/// of audio to video). Called when an application uses the AVIFileEndRecord function.
/// </summary>
/// <remarks>
/// <para>This file handler method is typically not used.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavifile-endrecord HRESULT EndRecord();
void EndRecord();
/// <summary>Deletes the stream.</summary>
/// <param name="fccType">Four-character code indicating the type of stream to delete.</param>
/// <param name="lParam">Stream number.</param>
void DeleteStream([In] uint fccType, [In] int lParam);
}
/// <summary>
/// The <c>IAVIStream</c> interface supports creating and manipulating data streams within a file. Uses IUnknown::QueryInterface,
/// IUnknown::AddRef, IUnknown::Release in addition to the following custom methods:
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nn-vfw-iavistream
[PInvokeData("vfw.h", MSDNShortId = "NN:vfw.IAVIStream")]
[ComImport, Guid("00020021-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAVIStream
{
/// <summary>
/// The <c>Create</c> method initializes a stream handler that is not associated with any file. Called when an application uses
/// the AVIStreamCreate function.
/// </summary>
/// <param name="lParam1">Stream handler-specific data.</param>
/// <param name="lParam2">Stream handler-specific data.</param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistream-create HRESULT Create( LPARAM lParam1, LPARAM
// lParam2 );
void Create(IntPtr lParam1, IntPtr lParam2);
/// <summary>
/// The <c>Info</c> method fills and returns an AVISTREAMINFO structure with information about a stream. Called when an
/// application uses the AVIStreamInfo function.
/// </summary>
/// <param name="psi">Pointer to an AVISTREAMINFO structure to contain stream information.</param>
/// <param name="lSize">Size, in bytes, of the structure specified by psi.</param>
/// <remarks>
/// <para>
/// If the buffer allocated is too small for the structure, the <c>Info</c> method should fail the call by returning
/// AVIERR_BUFFERTOOSMALL. Otherwise, it should fill the structure and return its size.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistream-info HRESULT Info( AVISTREAMINFOW *psi, LONG lSize );
void Info(out AVISTREAMINFO psi, [In] int lSize);
/// <summary>
/// The <c>FindSample</c> method obtains the position in a stream of a key frame or a nonempty frame. Called when an application
/// uses the AVIStreamFindSample function.
/// </summary>
/// <param name="lPos">Position of the sample or frame.</param>
/// <param name="lFlags">
/// <para>Applicable flags. The following values are defined.</para>
/// <list type="table">
/// <listheader>
/// <term>Value</term>
/// <term>Description</term>
/// </listheader>
/// <item>
/// <term>FIND_ANY</term>
/// <term>Searches for a nonempty frame.</term>
/// </item>
/// <item>
/// <term>FIND_FORMAT</term>
/// <term>Searches for a format change.</term>
/// </item>
/// <item>
/// <term>FIND_KEY</term>
/// <term>Searches for a key frame.</term>
/// </item>
/// <item>
/// <term>FIND_NEXT</term>
/// <term>Searches forward through a stream, beginning with the current frame.</term>
/// </item>
/// <item>
/// <term>FIND_PREV</term>
/// <term>Searches backward through a stream, beginning with the current frame.</term>
/// </item>
/// </list>
/// <para>
/// The FIND_ANY, FIND_KEY, and FIND_FORMAT flags are mutually exclusive, as are the FIND_NEXT and FIND_PREV flags. You must
/// specify one value from each group.
/// </para>
/// </param>
/// <returns>Returns the location of the key frame corresponding to the frame specified by the application.</returns>
/// <remarks>
/// <para>If key frames are not significant in your custom format, return the position specified for lPos.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistream-findsample LONG FindSample( LONG lPos, LONG lFlags );
[PreserveSig]
int FindSample([In] int lPos, [In] FINDF lFlags);
/// <summary>
/// The <c>ReadFormat</c> method obtains format information from a stream. Fills and returns a structure with the data in an
/// application-defined buffer. If no buffer is supplied, determines the buffer size needed to retrieve the buffer of format
/// data. Called when an application uses the AVIStreamReadFormat function.
/// </summary>
/// <param name="lPos">Position of the sample or frame.</param>
/// <param name="lpFormat">
/// Pointer to the buffer for the format data. Specify <c>NULL</c> to request the required size of the buffer.
/// </param>
/// <param name="lpcbFormat">
/// Pointer to a buffer that receives the size, in bytes, of the buffer specified by lpFormat. When this method is called, the
/// contents of this parameter indicates the size of the buffer specified by lpFormat. When this method returns control to the
/// application, the contents of this parameter specifies the amount of data read or the required size of the buffer.
/// </param>
/// <remarks>
/// <para>
/// The type of data stored in a stream dictates the format information and the structure that contains the format information.
/// A stream handler should return all applicable format information in this structure, including palette information when the
/// format uses a palette. A stream handler should not return stream data with the structure.
/// </para>
/// <para>
/// Standard video stream handlers provide format information in a <c>BITMAPINFOHEADER</c> structure. Standard audio stream
/// handlers provide format information in a <c>PCMWAVEFORMAT</c> structure. Other data streams can use other structures that
/// describe the stream data.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistream-readformat HRESULT ReadFormat( LONG lPos, LPVOID
// lpFormat, LONG *lpcbFormat );
void ReadFormat([In] int lPos, [Out, Optional] IntPtr lpFormat, ref int lpcbFormat);
/// <summary>
/// The <c>SetFormat</c> method sets format information in a stream. Called when an application uses the AVIStreamSetFormat function.
/// </summary>
/// <param name="lPos">Pointer to the interface to a stream.</param>
/// <param name="lpFormat">Pointer to the buffer for the format data.</param>
/// <param name="cbFormat">Address containing the size, in bytes, of the buffer specified by lpFormat.</param>
/// <remarks>
/// <para>
/// Standard video stream handlers provide format information in a <c>BITMAPINFOHEADER</c> structure. Standard audio stream
/// handlers provide format information in a <c>PCMWAVEFORMAT</c> structure. Other data streams can use other structures that
/// describe the stream data.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistream-setformat HRESULT SetFormat( LONG lPos, LPVOID
// lpFormat, LONG cbFormat );
void SetFormat([In] int lPos, [In] IntPtr lpFormat, [In] int cbFormat);
/// <summary>
/// The <c>Read</c> method reads data from a stream and copies it to an application-defined buffer. If no buffer is supplied, it
/// determines the buffer size needed to retrieve the next buffer of data. Called when an application uses the AVIStreamRead function.
/// </summary>
/// <param name="lStart">Starting sample or frame number to read.</param>
/// <param name="lSamples">Number of samples to read.</param>
/// <param name="lpBuffer">
/// Pointer to the application-defined buffer to contain the stream data. You can also specify <c>NULL</c> to request the
/// required size of the buffer. Many applications precede each read operation with a query for the buffer size to see how large
/// a buffer is needed.
/// </param>
/// <param name="cbBuffer">Size, in bytes, of the buffer specified by lpBuffer.</param>
/// <param name="plBytes">Pointer to a buffer that receives the number of bytes read.</param>
/// <param name="plSamples">Pointer to a buffer that receives the number of samples read.</param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistream-read HRESULT Read( LONG lStart, LONG lSamples,
// LPVOID lpBuffer, LONG cbBuffer, LONG *plBytes, LONG *plSamples );
void Read([In] int lStart, [In] int lSamples, [Out, Optional] IntPtr lpBuffer, [In] int cbBuffer, out int plBytes, out int plSamples);
/// <summary>The <c>Write</c> method writes data to a stream. Called when an application uses the AVIStreamWrite function.</summary>
/// <param name="lStart">Starting sample or frame number to write.</param>
/// <param name="lSamples">Number of samples to write.</param>
/// <param name="lpBuffer">Pointer to the buffer for the data.</param>
/// <param name="cbBuffer">Size, in bytes, of the buffer specified by lpBuffer.</param>
/// <param name="dwFlags">
/// Applicable flags. The AVIF_KEYFRAME flag is defined and indicates that this frame contains all the information needed for a
/// complete image.
/// </param>
/// <param name="plSampWritten">Pointer to a buffer used to contain the number of samples written.</param>
/// <param name="plBytesWritten">Pointer to a buffer that receives the number of bytes written.</param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistream-write HRESULT Write( LONG lStart, LONG lSamples,
// LPVOID lpBuffer, LONG cbBuffer, DWORD dwFlags, LONG *plSampWritten, LONG *plBytesWritten );
void Write([In] int lStart, [In] int lSamples, [In] IntPtr lpBuffer, [In] int cbBuffer, [In] AVIIF dwFlags, out int plSampWritten, out int plBytesWritten);
/// <summary>The <c>Delete</c> method deletes data from a stream.</summary>
/// <param name="lStart">Starting sample or frame number to delete.</param>
/// <param name="lSamples">Number of samples to delete.</param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistream-delete HRESULT Delete( LONG lStart, LONG lSamples );
void Delete([In] int lStart, [In] int lSamples);
/// <summary>
/// The <c>ReadData</c> method reads data headers of a stream. Called when an application uses the AVIStreamReadData function.
/// </summary>
/// <param name="fcc">Four-character code of the stream header to read.</param>
/// <param name="lp">Pointer to the buffer to contain the header data.</param>
/// <param name="lpcb">
/// Size, in bytes, of the buffer specified by lpBuffer. When this method returns control to the application, the contents of
/// this parameter specifies the amount of data read.
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistream-readdata HRESULT ReadData( DWORD fcc, LPVOID lp,
// LONG *lpcb );
void ReadData([In] uint fcc, [Out, Optional] IntPtr lp, ref int lpcb);
/// <summary>
/// The <c>WriteData</c> method writes headers for a stream. Called when an application uses the AVIStreamWriteData function.
/// </summary>
/// <param name="fcc">Four-character code of the stream header to write.</param>
/// <param name="lp">Pointer to the buffer that contains the header data to write.</param>
/// <param name="cb">Size, in bytes, of the buffer specified by lpBuffer.</param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistream-writedata HRESULT WriteData( DWORD fcc, LPVOID lp,
// LONG cb );
void WriteData([In] uint fcc, [In] IntPtr lp, [In] int cb);
}
/// <summary>
/// The <c>IAVIStreaming</c> interface supports preparing open data streams for playback in streaming operations. Uses
/// IUnknown::QueryInterface, IUnknown::AddRef, IUnknown::Release in addition to the following custom methods:
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nn-vfw-iavistreaming
[PInvokeData("vfw.h", MSDNShortId = "NN:vfw.IAVIStreaming")]
[ComImport, Guid("00020022-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IAVIStreaming
{
/// <summary>
/// The <c>Begin</c> method prepares for the streaming operation. Called when an application uses the AVIStreamBeginStreaming function.
/// </summary>
/// <param name="lStart">Starting frame for streaming.</param>
/// <param name="lEnd">Ending frame for streaming.</param>
/// <param name="lRate">
/// Speed at which the file is read relative to its normal playback rate. Normal speed is 1000. Larger values indicate faster
/// speeds; smaller values indicate slower speeds.
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistreaming-begin HRESULT Begin( LONG lStart, LONG lEnd, LONG
// lRate );
void Begin([In] int lStart, [In] int lEnd, [In] int lRate);
/// <summary>
/// The <c>End</c> method ends the streaming operation. Called when an application uses the AVIStreamEndStreaming function.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-iavistreaming-end HRESULT End();
void End();
};
//[ComImport, Guid("00020025-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
//public interface IAVIPersistFile : System.Runtime.InteropServices.ComTypes.IPersistFile
//{
// new void GetClassID(out Guid pClassID);
// new int IsDirty();
// new void Load(string pszFileName, int dwMode);
// new void Save(string pszFileName, bool fRemember);
// new void SaveCompleted(string pszFileName);
// new void GetCurFile(out string ppszFileName);
// void Reserved1();
//}
/// <summary>
/// The <c>IGetFrame</c> interface supports extracting, decompressing, and displaying individual frames from an open stream. Uses
/// IUnknown::QueryInterface, IUnknown::AddRef, IUnknown::Release in addition to the following custom methods:
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nn-vfw-igetframe
[PInvokeData("vfw.h", MSDNShortId = "NN:vfw.IGetFrame")]
[ComImport, Guid("00020023-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IGetFrame
{
/// <summary>
/// The <c>GetFrame</c> method retrieves a decompressed copy of a frame from a stream. Called when an application uses the
/// AVIStreamGetFrame function.
/// </summary>
/// <param name="lPos">Frame to copy and decompress.</param>
/// <returns>Returns the address of the decompressed frame data.</returns>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-igetframe-getframe LPVOID GetFrame( LONG lPos );
[PreserveSig]
IntPtr GetFrame([In] int lPos);
/// <summary>
/// The <c>Begin</c> method prepares to extract and decompress copies of frames from a stream. Called when an application uses
/// the AVIStreamGetFrameOpen function.
/// </summary>
/// <param name="lStart">Starting frame for extracting and decompressing.</param>
/// <param name="lEnd">Ending frame for extracting and decompressing.</param>
/// <param name="lRate">
/// Speed at which the file is read relative to its normal playback rate. Normal speed is 1000. Larger values indicate faster
/// speeds; smaller values indicate slower speeds.
/// </param>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-igetframe-begin HRESULT Begin( LONG lStart, LONG lEnd, LONG
// lRate );
void Begin([In] int lStart, [In] int lEnd, [In] int lRate);
/// <summary>
/// The <c>End</c> method ends frame extraction and decompression. Called when an application uses the AVIStreamGetFrameClose function.
/// </summary>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-igetframe-end HRESULT End();
void End();
/// <summary>
/// The <c>SetFormat</c> method sets the decompressed image format of the frames being extracted and optionally provides a
/// buffer for the decompression operation.
/// </summary>
/// <param name="lpbi">
/// Pointer to a BITMAPINFOHEADER structure defining the decompressed image format. You can also specify <c>NULL</c> or the value
/// <code>((LPBITMAPINFOHEADER) 1)</code>
/// for this parameter. <c>NULL</c> causes the decompressor to choose a format that is appropriate for editing (normally a
/// 24-bit image depth format). The value
/// <code>((LPBITMAPINFOHEADER) 1)</code>
/// causes the decompressor to choose a format appropriate for the current display mode.
/// </param>
/// <param name="lpBits">
/// Pointer to a buffer to contain the decompressed image data. Specify <c>NULL</c> to have this method allocate a buffer.
/// </param>
/// <param name="x">
/// The x-coordinate of the destination rectangle within the DIB specified by lpbi. This parameter is used when lpBits is not <c>NULL</c>.
/// </param>
/// <param name="y">
/// The y-coordinate of the destination rectangle within the DIB specified by lpbi. This parameter is used when lpBits is not <c>NULL</c>.
/// </param>
/// <param name="dx">Width of the destination rectangle. This parameter is used when lpBits is not <c>NULL</c>.</param>
/// <param name="dy">Height of the destination rectangle. This parameter is used when lpBits is not <c>NULL</c>.</param>
/// <remarks>
/// <para>
/// The x, y, dx, and dy parameters identify the portion of the bitmap specified by lpbi and lpBits that receives the
/// decompressed image.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-igetframe-setformat HRESULT SetFormat( LPBITMAPINFOHEADER lpbi,
// LPVOID lpBits, int x, int y, int dx, int dy );
void SetFormat(in Gdi32.BITMAPINFOHEADER lpbi, [In, Optional] IntPtr lpBits, [In] int x, [In] int y, [In] int dx, [In] int dy);
}
}
}

View File

@ -0,0 +1,331 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using static Vanara.PInvoke.WinMm;
namespace Vanara.PInvoke
{
/// <summary>Items from the Vfw32.dll</summary>
public static partial class Vfw32
{
/*
CAPCONTROLCALLBACK
CAPERRORCALLBACKA
CAPERRORCALLBACKW
CAPSTATUSCALLBACKA
CAPSTATUSCALLBACKW
CAPVIDEOCALLBACK
CAPWAVECALLBACK
CAPYIELDCALLBACK
IAVIEditStream
IAVIFile
IAVIStream
IAVIStreaming
IGetFrame
AVIBuildFilterA
AVIBuildFilterW
AVIClearClipboard
AVIFileAddRef
AVIFileCreateStream
AVIFileCreateStreamA
AVIFileCreateStreamW
AVIFileEndRecord
AVIFileExit
AVIFileGetStream
AVIFileInfo
AVIFileInfoA
AVIFileInfoW
AVIFileInit
AVIFileOpen
AVIFileOpenA
AVIFileOpenW
AVIFileReadData
AVIFileRelease
AVIFileWriteData
AVIGetFromClipboard
AVIMakeCompressedStream
AVIMakeFileFromStreams
AVIMakeStreamFromClipboard
AVIPutFileOnClipboard
AVISaveA
AVISaveOptions
AVISaveOptionsFree
AVISaveVA
AVISaveVW
AVISaveW
AVIStreamAddRef
AVIStreamBeginStreaming
AVIStreamCreate
AVIStreamDataSize
AVIStreamEnd
AVIStreamEndStreaming
AVIStreamEndTime
AVIStreamFindSample
AVIStreamFormatSize
AVIStreamGetFrame
AVIStreamGetFrameClose
AVIStreamGetFrameOpen
AVIStreamInfoA
AVIStreamInfoW
AVIStreamIsKeyFrame
AVIStreamLength
AVIStreamLengthTime
AVIStreamNearestKeyFrame
AVIStreamNearestKeyFrameTime
AVIStreamNearestSample
AVIStreamNearestSampleTime
AVIStreamNextKeyFrame
AVIStreamNextKeyFrameTime
AVIStreamNextSample
AVIStreamNextSampleTime
AVIStreamOpenFromFileA
AVIStreamOpenFromFileW
AVIStreamPrevKeyFrame
AVIStreamPrevKeyFrameTime
AVIStreamPrevSample
AVIStreamPrevSampleTime
AVIStreamRead
AVIStreamReadData
AVIStreamReadFormat
AVIStreamRelease
AVIStreamSampleSize
AVIStreamSampleToSample
AVIStreamSampleToTime
AVIStreamSetFormat
AVIStreamStart
AVIStreamStartTime
AVIStreamTimeToSample
AVIStreamWrite
AVIStreamWriteData
capCaptureAbort
capCaptureGetSetup
capCaptureSequence
capCaptureSequenceNoFile
capCaptureSetSetup
capCaptureSingleFrame
capCaptureSingleFrameClose
capCaptureSingleFrameOpen
capCaptureStop
capCreateCaptureWindowA
capCreateCaptureWindowW
capDlgVideoCompression
capDlgVideoDisplay
capDlgVideoFormat
capDlgVideoSource
capDriverConnect
capDriverDisconnect
capDriverGetCaps
capDriverGetName
capDriverGetVersion
capEditCopy
capFileAlloc
capFileGetCaptureFile
capFileSaveAs
capFileSaveDIB
capFileSetCaptureFile
capFileSetInfoChunk
capGetAudioFormat
capGetAudioFormatSize
capGetDriverDescriptionA
capGetDriverDescriptionW
capGetMCIDeviceName
capGetStatus
capGetUserData
capGetVideoFormat
capGetVideoFormatSize
capGrabFrame
capGrabFrameNoStop
capOverlay
capPaletteAuto
capPaletteManual
capPaletteOpen
capPalettePaste
capPaletteSave
capPreview
capPreviewRate
capPreviewScale
capSetAudioFormat
capSetCallbackOnCapControl
capSetCallbackOnError
capSetCallbackOnFrame
capSetCallbackOnStatus
capSetCallbackOnVideoStream
capSetCallbackOnWaveStream
capSetCallbackOnYield
capSetMCIDeviceName
capSetScrollPos
capSetUserData
capSetVideoFormat
CreateEditableStream
DrawDibBegin
DrawDibChangePalette
DrawDibClose
DrawDibDraw
DrawDibEnd
DrawDibGetBuffer
DrawDibGetPalette
DrawDibOpen
DrawDibProfileDisplay
DrawDibRealize
DrawDibSetPalette
DrawDibStart
DrawDibStop
DrawDibTime
DrawDibUpdate
EditStreamClone
EditStreamCopy
EditStreamCut
EditStreamPaste
EditStreamSetInfoA
EditStreamSetInfoW
EditStreamSetNameA
EditStreamSetNameW
GetOpenFileNamePreviewA
GetOpenFileNamePreviewW
GetSaveFileNamePreviewA
GetSaveFileNamePreviewW
ICAbout
ICClose
ICCompress
ICCompressBegin
ICCompressEnd
ICCompressGetFormat
ICCompressGetFormatSize
ICCompressGetSize
ICCompressorChoose
ICCompressorFree
ICCompressQuery
ICConfigure
ICDecompress
ICDecompressBegin
ICDecompressEnd
ICDecompressEx
ICDecompressExBegin
ICDecompressExEnd
ICDecompressExQuery
ICDecompressGetFormat
ICDecompressGetFormatSize
ICDecompressGetPalette
ICDecompressOpen
ICDecompressQuery
ICDecompressSetPalette
ICDraw
ICDrawBegin
ICDrawChangePalette
ICDrawEnd
ICDrawFlush
ICDrawGetTime
ICDrawOpen
ICDrawQuery
ICDrawRealize
ICDrawRenderBuffer
ICDrawSetTime
ICDrawStart
ICDrawStartPlay
ICDrawStop
ICDrawStopPlay
ICDrawSuggestFormat
ICDrawWindow
ICGetBuffersWanted
ICGetDefaultKeyFrameRate
ICGetDefaultQuality
ICGetDisplayFormat
ICGetInfo
ICGetState
ICGetStateSize
ICImageCompress
ICImageDecompress
ICInfo
ICInstall
ICLocate
ICOpen
ICOpenFunction
ICQueryAbout
ICQueryConfigure
ICRemove
ICSendMessage
ICSeqCompressFrame
ICSeqCompressFrameEnd
ICSeqCompressFrameStart
ICSetState
ICSetStatusProc
MCIWndCanConfig
MCIWndCanEject
MCIWndCanPlay
MCIWndCanRecord
MCIWndCanSave
MCIWndCanWindow
MCIWndChangeStyles
MCIWndClose
MCIWndCreateA
MCIWndCreateW
MCIWndDestroy
MCIWndEject
MCIWndEnd
MCIWndGetActiveTimer
MCIWndGetAlias
MCIWndGetDest
MCIWndGetDevice
MCIWndGetDeviceID
MCIWndGetEnd
MCIWndGetError
MCIWndGetFileName
MCIWndGetInactiveTimer
MCIWndGetLength
MCIWndGetMode
MCIWndGetPalette
MCIWndGetPosition
MCIWndGetPositionString
MCIWndGetRepeat
MCIWndGetSource
MCIWndGetSpeed
MCIWndGetStart
MCIWndGetStyles
MCIWndGetTimeFormat
MCIWndGetVolume
MCIWndGetZoom
MCIWndHome
MCIWndNew
MCIWndOpen
MCIWndOpenDialog
MCIWndOpenInterface
MCIWndPause
MCIWndPlay
MCIWndPlayFrom
MCIWndPlayFromTo
MCIWndPlayReverse
MCIWndPlayTo
MCIWndPutDest
MCIWndPutSource
MCIWndRealize
MCIWndRecord
MCIWndRegisterClass
MCIWndResume
MCIWndReturnString
MCIWndSave
MCIWndSaveDialog
MCIWndSeek
MCIWndSendString
MCIWndSetActiveTimer
MCIWndSetInactiveTimer
MCIWndSetOwner
MCIWndSetPalette
MCIWndSetRepeat
MCIWndSetSpeed
MCIWndSetTimeFormat
MCIWndSetTimers
MCIWndSetVolume
MCIWndSetZoom
MCIWndStep
MCIWndStop
MCIWndUseFrames
MCIWndUseTime
MCIWndValidateMedia
mmioFOURCC
StretchDIB
*/
}
}

View File

@ -0,0 +1,331 @@
#pragma warning disable IDE1006 // Naming Styles
using System;
using System.Runtime.InteropServices;
using static Vanara.PInvoke.WinMm;
namespace Vanara.PInvoke
{
/// <summary>Items from the Vfw32.dll</summary>
public static partial class Vfw32
{
/*
CAPCONTROLCALLBACK
CAPERRORCALLBACKA
CAPERRORCALLBACKW
CAPSTATUSCALLBACKA
CAPSTATUSCALLBACKW
CAPVIDEOCALLBACK
CAPWAVECALLBACK
CAPYIELDCALLBACK
IAVIEditStream
IAVIFile
IAVIStream
IAVIStreaming
IGetFrame
AVIBuildFilterA
AVIBuildFilterW
AVIClearClipboard
AVIFileAddRef
AVIFileCreateStream
AVIFileCreateStreamA
AVIFileCreateStreamW
AVIFileEndRecord
AVIFileExit
AVIFileGetStream
AVIFileInfo
AVIFileInfoA
AVIFileInfoW
AVIFileInit
AVIFileOpen
AVIFileOpenA
AVIFileOpenW
AVIFileReadData
AVIFileRelease
AVIFileWriteData
AVIGetFromClipboard
AVIMakeCompressedStream
AVIMakeFileFromStreams
AVIMakeStreamFromClipboard
AVIPutFileOnClipboard
AVISaveA
AVISaveOptions
AVISaveOptionsFree
AVISaveVA
AVISaveVW
AVISaveW
AVIStreamAddRef
AVIStreamBeginStreaming
AVIStreamCreate
AVIStreamDataSize
AVIStreamEnd
AVIStreamEndStreaming
AVIStreamEndTime
AVIStreamFindSample
AVIStreamFormatSize
AVIStreamGetFrame
AVIStreamGetFrameClose
AVIStreamGetFrameOpen
AVIStreamInfoA
AVIStreamInfoW
AVIStreamIsKeyFrame
AVIStreamLength
AVIStreamLengthTime
AVIStreamNearestKeyFrame
AVIStreamNearestKeyFrameTime
AVIStreamNearestSample
AVIStreamNearestSampleTime
AVIStreamNextKeyFrame
AVIStreamNextKeyFrameTime
AVIStreamNextSample
AVIStreamNextSampleTime
AVIStreamOpenFromFileA
AVIStreamOpenFromFileW
AVIStreamPrevKeyFrame
AVIStreamPrevKeyFrameTime
AVIStreamPrevSample
AVIStreamPrevSampleTime
AVIStreamRead
AVIStreamReadData
AVIStreamReadFormat
AVIStreamRelease
AVIStreamSampleSize
AVIStreamSampleToSample
AVIStreamSampleToTime
AVIStreamSetFormat
AVIStreamStart
AVIStreamStartTime
AVIStreamTimeToSample
AVIStreamWrite
AVIStreamWriteData
capCaptureAbort
capCaptureGetSetup
capCaptureSequence
capCaptureSequenceNoFile
capCaptureSetSetup
capCaptureSingleFrame
capCaptureSingleFrameClose
capCaptureSingleFrameOpen
capCaptureStop
capCreateCaptureWindowA
capCreateCaptureWindowW
capDlgVideoCompression
capDlgVideoDisplay
capDlgVideoFormat
capDlgVideoSource
capDriverConnect
capDriverDisconnect
capDriverGetCaps
capDriverGetName
capDriverGetVersion
capEditCopy
capFileAlloc
capFileGetCaptureFile
capFileSaveAs
capFileSaveDIB
capFileSetCaptureFile
capFileSetInfoChunk
capGetAudioFormat
capGetAudioFormatSize
capGetDriverDescriptionA
capGetDriverDescriptionW
capGetMCIDeviceName
capGetStatus
capGetUserData
capGetVideoFormat
capGetVideoFormatSize
capGrabFrame
capGrabFrameNoStop
capOverlay
capPaletteAuto
capPaletteManual
capPaletteOpen
capPalettePaste
capPaletteSave
capPreview
capPreviewRate
capPreviewScale
capSetAudioFormat
capSetCallbackOnCapControl
capSetCallbackOnError
capSetCallbackOnFrame
capSetCallbackOnStatus
capSetCallbackOnVideoStream
capSetCallbackOnWaveStream
capSetCallbackOnYield
capSetMCIDeviceName
capSetScrollPos
capSetUserData
capSetVideoFormat
CreateEditableStream
DrawDibBegin
DrawDibChangePalette
DrawDibClose
DrawDibDraw
DrawDibEnd
DrawDibGetBuffer
DrawDibGetPalette
DrawDibOpen
DrawDibProfileDisplay
DrawDibRealize
DrawDibSetPalette
DrawDibStart
DrawDibStop
DrawDibTime
DrawDibUpdate
EditStreamClone
EditStreamCopy
EditStreamCut
EditStreamPaste
EditStreamSetInfoA
EditStreamSetInfoW
EditStreamSetNameA
EditStreamSetNameW
GetOpenFileNamePreviewA
GetOpenFileNamePreviewW
GetSaveFileNamePreviewA
GetSaveFileNamePreviewW
ICAbout
ICClose
ICCompress
ICCompressBegin
ICCompressEnd
ICCompressGetFormat
ICCompressGetFormatSize
ICCompressGetSize
ICCompressorChoose
ICCompressorFree
ICCompressQuery
ICConfigure
ICDecompress
ICDecompressBegin
ICDecompressEnd
ICDecompressEx
ICDecompressExBegin
ICDecompressExEnd
ICDecompressExQuery
ICDecompressGetFormat
ICDecompressGetFormatSize
ICDecompressGetPalette
ICDecompressOpen
ICDecompressQuery
ICDecompressSetPalette
ICDraw
ICDrawBegin
ICDrawChangePalette
ICDrawEnd
ICDrawFlush
ICDrawGetTime
ICDrawOpen
ICDrawQuery
ICDrawRealize
ICDrawRenderBuffer
ICDrawSetTime
ICDrawStart
ICDrawStartPlay
ICDrawStop
ICDrawStopPlay
ICDrawSuggestFormat
ICDrawWindow
ICGetBuffersWanted
ICGetDefaultKeyFrameRate
ICGetDefaultQuality
ICGetDisplayFormat
ICGetInfo
ICGetState
ICGetStateSize
ICImageCompress
ICImageDecompress
ICInfo
ICInstall
ICLocate
ICOpen
ICOpenFunction
ICQueryAbout
ICQueryConfigure
ICRemove
ICSendMessage
ICSeqCompressFrame
ICSeqCompressFrameEnd
ICSeqCompressFrameStart
ICSetState
ICSetStatusProc
MCIWndCanConfig
MCIWndCanEject
MCIWndCanPlay
MCIWndCanRecord
MCIWndCanSave
MCIWndCanWindow
MCIWndChangeStyles
MCIWndClose
MCIWndCreateA
MCIWndCreateW
MCIWndDestroy
MCIWndEject
MCIWndEnd
MCIWndGetActiveTimer
MCIWndGetAlias
MCIWndGetDest
MCIWndGetDevice
MCIWndGetDeviceID
MCIWndGetEnd
MCIWndGetError
MCIWndGetFileName
MCIWndGetInactiveTimer
MCIWndGetLength
MCIWndGetMode
MCIWndGetPalette
MCIWndGetPosition
MCIWndGetPositionString
MCIWndGetRepeat
MCIWndGetSource
MCIWndGetSpeed
MCIWndGetStart
MCIWndGetStyles
MCIWndGetTimeFormat
MCIWndGetVolume
MCIWndGetZoom
MCIWndHome
MCIWndNew
MCIWndOpen
MCIWndOpenDialog
MCIWndOpenInterface
MCIWndPause
MCIWndPlay
MCIWndPlayFrom
MCIWndPlayFromTo
MCIWndPlayReverse
MCIWndPlayTo
MCIWndPutDest
MCIWndPutSource
MCIWndRealize
MCIWndRecord
MCIWndRegisterClass
MCIWndResume
MCIWndReturnString
MCIWndSave
MCIWndSaveDialog
MCIWndSeek
MCIWndSendString
MCIWndSetActiveTimer
MCIWndSetInactiveTimer
MCIWndSetOwner
MCIWndSetPalette
MCIWndSetRepeat
MCIWndSetSpeed
MCIWndSetTimeFormat
MCIWndSetTimers
MCIWndSetVolume
MCIWndSetZoom
MCIWndStep
MCIWndStop
MCIWndUseFrames
MCIWndUseTime
MCIWndValidateMedia
mmioFOURCC
StretchDIB
*/
}
}

1666
PInvoke/Multimedia/Vfw.cs Normal file

File diff suppressed because it is too large Load Diff

View File

@ -313,6 +313,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CfgMgr32", "UnitTests\PInvo
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Vanara.PInvoke.Lz32", "PInvoke\Lz32\Vanara.PInvoke.Lz32.csproj", "{553081F3-A380-44B4-94ED-E8CE510F3E96}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Vanara.PInvoke.Multimedia", "PInvoke\Multimedia\Vanara.PInvoke.Multimedia.csproj", "{A7936B0B-A16B-42A5-A6DA-5D00FA98EEDD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1021,6 +1023,12 @@ Global
{553081F3-A380-44B4-94ED-E8CE510F3E96}.DebugNoTests|Any CPU.Build.0 = Debug|Any CPU
{553081F3-A380-44B4-94ED-E8CE510F3E96}.Release|Any CPU.ActiveCfg = Release|Any CPU
{553081F3-A380-44B4-94ED-E8CE510F3E96}.Release|Any CPU.Build.0 = Release|Any CPU
{A7936B0B-A16B-42A5-A6DA-5D00FA98EEDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A7936B0B-A16B-42A5-A6DA-5D00FA98EEDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A7936B0B-A16B-42A5-A6DA-5D00FA98EEDD}.DebugNoTests|Any CPU.ActiveCfg = Debug|Any CPU
{A7936B0B-A16B-42A5-A6DA-5D00FA98EEDD}.DebugNoTests|Any CPU.Build.0 = Debug|Any CPU
{A7936B0B-A16B-42A5-A6DA-5D00FA98EEDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A7936B0B-A16B-42A5-A6DA-5D00FA98EEDD}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1158,6 +1166,7 @@ Global
{17DE6265-EE0F-42E5-AE1A-7ACCDD8A45E8} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90}
{6F4649D2-CB4E-463A-A5DE-CCC3B0DBD07A} = {385CAD2D-0A5E-4F80-927B-D5499D126B90}
{553081F3-A380-44B4-94ED-E8CE510F3E96} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90}
{A7936B0B-A16B-42A5-A6DA-5D00FA98EEDD} = {212ABBD0-B724-4CFA-9D6D-E3891547FA90}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {543FAC75-2AF1-4EF1-9609-B242B63FEED4}