| |

VB & Windows APIRe: midi port treiber name | |  | Autor: mikeb69 | Datum: 06.11.07 21:20 |
| hallo buchel,
ich hab mir mal erlaubt das beispiel von martoeng nach vb.net umzusetzen.
Imports System
Imports System.Runtime
Imports System.Runtime.InteropServices
Public Class Form1
Private Declare Function midiOutGetNumDevs Lib "winmm.dll" () As Short
Private Declare Function midiOutGetDevCaps Lib "winmm.dll" Alias _
"midiOutGetDevCapsA" (ByVal uDeviceID As Integer, ByRef lpCaps As _
MIDIOUTCAPS, ByVal uSize As Integer) As Integer
Private Const MAXPNAMELEN As Integer = 32
'Konstanten die den Inhalt von MIDIOUTCAPS.wTechnologie beschreiben
Private Const MOD_MIDIPORT As Short = 1
Private Const MOD_SYNTH As Short = 2
Private Const MOD_SQSYNTH As Short = 3
Private Const MOD_FMSYNTH As Short = 4
Private Const MOD_MAPPER As Short = 5
Private Const MOD_WAVETABLE As Short = 6
Private Const MOD_SWSYNTH As Short = 7
'String die den Inhalt von MIDIOUTCAPS.wTechnologie beschreiben
Private Technologie() As String = {"Unkonwn", "MIDI hardware port", _
"Synthesizer", "Square wave synthesizer", "FM synthesizer", "Microsoft" & _
"MIDI mapper", "Hardware wavetable synthesizer", "Software synthesizer", _
"Unknown"}
<StructLayout(LayoutKind.Sequential)> Private Structure MIDIOUTCAPS
Public Const MAXPNAMELEN = 32
Public wMid As Short
Public wPid As Short
Public vDriverVersion As Int32
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MAXPNAMELEN)> Public _
szPname As String
Public wTechnology As Short
Public wVoices As Short
Public wNotes As Short
Public wChannelMask As Short
Public dwSupport As Int32
End Structure
Private Sub Form1_Shown(ByVal sender As Object, ByVal e As _
System.EventArgs) Handles Me.Shown
Dim count As Short = midiOutGetNumDevs
Dim midicaps As New MIDIOUTCAPS
For i As Integer = 0 To count - 1
'holt alle midi-device eingenschaften
midiOutGetDevCaps(i, midicaps, CInt(Marshal.SizeOf(midicaps)))
'darstellen der informationen
With midicaps
MessageBox.Show("Manufacturer identifier: " & _
.wMid.ToString & vbCrLf & _
"Product identifier: " & .wPid.ToString & _
vbCrLf & _
"Version number of the device driver: " & _
.vDriverVersion.ToString & vbCrLf & _
"Product name: " & .szPname & vbCrLf & _
"Type of the MIDI output device: " & _
Technologie(.wTechnology) & vbCrLf & _
"Number of voices supported: " & _
.wVoices.ToString & vbCrLf & _
"Maximum number of simultaneous notes: " & _
.wNotes.ToString & vbCrLf & _
"Channels that an internal synthesizer: " & _
.wChannelMask.ToString & vbCrLf & _
"Optional functionality supported by the" & _
"device: " & .dwSupport.ToString)
End With
Next
End Sub
End Class gruss
mikeb69 |  |
 | Sie sind nicht angemeldet! Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.
Einloggen | Neu registrieren |
  |
|
sevGraph (VB/VBA) 
Grafische Auswertungen
Präsentieren Sie Ihre Daten mit wenig Aufwand in grafischer Form. sevGraph unterstützt hierbei Balken-, Linien- und Stapel-Diagramme (Stacked Bars), sowie 2D- und 3D-Tortendiagramme und arbeitet vollständig datenbankunabhängig! Weitere InfosTipp des Monats Access-Tools Vol.1 
Über 400 MByte Inhalt
Mehr als 250 Access-Beispiele, 25 Add-Ins und ActiveX-Komponenten, 16 VB-Projekt inkl. Source, mehr als 320 Tipps & Tricks für Access und VB
Nur 24,95 EURWeitere Infos
|
|
|
Copyright ©2000-2025 vb@rchiv Dieter Otter Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.
Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel
|
|