Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

MIXERCONTROL (Structures)
 
.
Summary
The MIXERCONTROLDETAILS_UNSIGNED structure retrieves and sets unsigned type control properties for an audio mixer control.
Summary
TODO - a short description

C# Definition:

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)]
public struct MIXERCONTROLDETAILS_UNSIGNED
[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Auto, Size = 68 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)]
struct MIXERCONTROL
{
     private UInt32 dwValue;

     #region Properties

     public UInt32 Value
     {
        get { return this.dwValue; }
        set { this.dwValue = value; }
     }

     #endregion
   [FieldOffset(0)]    public UInt32        cbStruct;    
   [FieldOffset(4)]    public UInt32        dwControlID;      
   [FieldOffset(8)]    public UInt32        dwControlType;    
   [FieldOffset(12)]    public UInt32        fdwControl;      
   [FieldOffset(16)]    public UInt32        cMultipleItems;    
   [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MIXER_SHORT_NAME_CHARS)]
   [FieldOffset(20)]    public string        szShortName;
   [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MIXER_LONG_NAME_CHARS)]
   [FieldOffset(20 + MIXER_SHORT_NAME_CHARS)]
   public string        szName;

   // Union "Bounds" start
   [FieldOffset(20 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)]
   public UnionBoundsSigned ubs;
   [FieldOffset(20 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)]
   public UnionBoundsUnsigned ubus;   //insatnce of UnionBoundsSigned struct
   /* [MarshalAs(UnmanagedType.ByValArray, SizeConst=6)]
    [FieldOffset(20 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)]
    public UInt32[]  dwReserved1;*/
   // Union "Bounds" end

   // Union "Metrics" start
   // additonal 6 DWORDs
   [FieldOffset(20 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS + 24)]
   public UInt32    cSteps;        
   [FieldOffset(20 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS + 24)]
   public UInt32    cbCustomData;      
   /* [MarshalAs(UnmanagedType.ByValArray, SizeConst=6)]
    [FieldOffset(20 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS + 24)]
    public UInt32[]    dwReserved2;*/
   // Union "Metrics" end
}


VB Definition:

Structure MIXERCONTROLDETAILS_UNSIGNED
   Public dwValue as Integer
End Structure

User-Defined Field Types:

None.

<StructLayout(LayoutKind.Explicit, Size:=68 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
Structure MIXERCONTROL
  <FieldOffset(0)> Dim cbStruct As UInteger
  <FieldOffset(4)> Dim dwControlID As UInteger
  <FieldOffset(8)> Dim dwControlType As ControlType
  <FieldOffset(12)> Dim fdwControl As UInteger
  <FieldOffset(16)> Dim cMultipleItem As UInteger
  <FieldOffset(20), MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MIXER_SHORT_NAME_CHARS)> _
  Dim szShortName As String
  <FieldOffset(20 + MIXER_SHORT_NAME_CHARS), MarshalAs(UnmanagedType.ByValTStr, sizeConst:=MIXER_LONG_NAME_CHARS)> _
  Dim szName As String

  'Union "Bounds"
  <FieldOffset(20 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim lMinimum As ULong
  <FieldOffset(28 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim lMaximum As ULong
  <FieldOffset(20 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwMinimum As UInteger
  <FieldOffset(24 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwMaximum As UInteger

Notes:

the integer in vb can be Int32

  <FieldOffset(20 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved1 As UInteger
  <FieldOffset(24 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved2 As UInteger
  <FieldOffset(28 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved3 As UInteger
  <FieldOffset(32 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved4 As UInteger
  <FieldOffset(36 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved5 As UInteger
  <FieldOffset(40 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved6 As UInteger


  'Union "Metrics"
  <FieldOffset(44 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim cSteps As UInteger
  <FieldOffset(44 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim cbCustomData As UInteger

  <FieldOffset(44 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved7 As UInteger
  <FieldOffset(48 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved8 As UInteger
  <FieldOffset(52 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved9 As UInteger
  <FieldOffset(56 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved10 As UInteger
  <FieldOffset(60 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved11 As UInteger
  <FieldOffset(64 + MIXER_SHORT_NAME_CHARS + MIXER_LONG_NAME_CHARS)> _
  Dim dwReserved12 As UInteger
End Structure

User-Defined Field Types:

None.

Documentation

Notes:

The original structure has a union of two structs and an array. In .NET this kind of union cannot be reproduced because, at runtime, the application crashes, the exception says that it's not possible to put both a numeric type and a class type at the same offset (in this situation, a dwReserved() UInt32 Array and the two UInt32 fields); so we have to replace it with other fields (is possible to force offset leaving "empty space", with no field filling it like in C# implementation?!).

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions