MultiMedia Soft forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

SMF - Just Installed!

Author Topic: Help me. How to set inputs WithOut the ComboBox.  (Read 2839 times)

sak2005

  • Newbie
  • *
  • Posts: 13
    • View Profile
Help me. How to set inputs WithOut the ComboBox.
« on: June 30, 2015, 11:01:11 PM »

How to set input device and set input channel WithOut the ComboBox. :)
« Last Edit: July 01, 2015, 10:45:27 AM by sak2005 »
Logged

Administrator

  • Administrator
  • Full Member
  • *****
  • Posts: 231
    • View Profile
    • MultiMedia Soft
Re: Help me. How to set inputs WithOut the ComboBox.
« Reply #1 on: July 01, 2015, 03:05:18 PM »

Hello,

the attached zipped file seems to be corrupted as it cannot be opened with WinZip.
In any case, the way to choose the input device depends upon the way your program will work and upon your user interface but, in any case, each PC may have its own architecture and installation language so you should give your final user a way to select it without problems: the combobox is usually the best approach but this is obviously your choice.

Kind Regards

Severino Delaurenti
MultiMedia Soft
Logged

sak2005

  • Newbie
  • *
  • Posts: 13
    • View Profile
Re: Help me. How to set inputs WithOut the ComboBox.
« Reply #2 on: July 12, 2015, 09:51:37 AM »

Hello,

the attached zipped file seems to be corrupted as it cannot be opened with WinZip.
In any case, the way to choose the input device depends upon the way your program will work and upon your user interface but, in any case, each PC may have its own architecture and installation language so you should give your final user a way to select it without problems: the combobox is usually the best approach but this is obviously your choice.

Kind Regards

Severino Delaurenti
MultiMedia Soft

If I wrote this statement is incorrect.
Suggestions .

LED LEVEL SPEAKERS TRANSPARENT
Code: [Select]
Option Explicit Off
Option Strict On
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Public Class MainForm
    Private WithEvents lblVuL As Label
    Private WithEvents lblVuR As Label
    Private aSR As AudioSoundRecorder.AudioSoundRecorder
    Private nID As Int16
    Private nIC As Int16
    Private nVol As Int16
    Private hWndVuMeterLeft As IntPtr()
    Private hWndVuMeterRight As IntPtr()
    Public Sub New()
        MyBase.New()
        InitializeComponent()
        Me.Height = 54
        lblVuL = New Label
        lblVuR = New Label
        lblVuL.BackColor = Color.Black
        lblVuL.AutoSize = False
        lblVuL.Size = New Size(300, 10)
        lblVuR.BackColor = Color.Black
        lblVuR.AutoSize = False
        lblVuR.Size = New Size(300, 10)
        lblVuR.Location = New Point(0, 10)
        Me.Controls.AddRange(New Control() {lblVuL, lblVuR})
        aSR = New AudioSoundRecorder.AudioSoundRecorder
        Me.Controls.Add(aSR)
        hWndVuMeterLeft = New IntPtr(1) {}
        hWndVuMeterRight = New IntPtr(1) {}
        nID = 0 'rec device.
        nIC = 4 'rec channel.
        nVol = 5 'rec volume.
        AddHandler aSR.VUMeterValueChange, AddressOf aSR_VUMeterValueChange
    End Sub
    Private Sub MainForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Location = New Point(CInt(My.Computer.Screen.WorkingArea.Right / 2 + 210), CInt(My.Computer.Screen.WorkingArea.Bottom - 20))
        Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
        Me.TransparencyKey = Color.Black
        aSR.InitRecordingSystem()
        aSR.DisplayVUMeter.Create(lblVuL.Handle)
        hWndVuMeterLeft(0) = CreateVuMeter(lblVuL, AudioSoundRecorder.enumGraphicBarOrientations.GRAPHIC_BAR_ORIENT_HORIZONTAL)
        aSR.DisplayVUMeter.Create(lblVuR.Handle)
        hWndVuMeterRight(0) = CreateVuMeter(lblVuR, AudioSoundRecorder.enumGraphicBarOrientations.GRAPHIC_BAR_ORIENT_HORIZONTAL)
        aSR.EncodeFormats.ForRecording = AudioSoundRecorder.enumEncodingFormats.ENCODING_FORMAT_NOFILE
        aSR.SetInputDeviceChannelVolume(nID, nIC, nVol)
    End Sub
    Private Sub MainForm_Shown(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Shown
        aSR.StartFromDirectSoundDevice(nID, nIC, "")
        MoveControl(Me, lblVuL)
    End Sub
    Private Sub aSR_VUMeterValueChange(ByVal sender As System.Object, ByVal e As AudioSoundRecorder.VUMeterValueChangeEventArgs)
        For i As Integer = 0 To 1
            aSR.GraphicBarsManager.SetValue(hWndVuMeterLeft(i), e.nPeakLeft)
            aSR.GraphicBarsManager.SetValue(hWndVuMeterRight(i), e.nPeakRight)
        Next i
    End Sub
#Region "VUmeter CreatedFields"
    Private Function CreateVuMeter(ByVal ctrlPosition As Label, ByVal nOrientation As AudioSoundRecorder.enumGraphicBarOrientations) As IntPtr
        Dim hWnd As IntPtr = aSR.GraphicBarsManager.Create(Me.Handle, ctrlPosition.Left, ctrlPosition.Top, ctrlPosition.Width, ctrlPosition.Height)
        aSR.GraphicBarsManager.SetRange(hWnd, 0, 32767)
        Dim settings As AudioSoundRecorder.GRAPHIC_BAR_SETTINGS = New AudioSoundRecorder.GRAPHIC_BAR_SETTINGS()
        aSR.GraphicBarsManager.GetGraphicalSettings(hWnd, settings)
        settings.bAutomaticDrop = True
        settings.nOrientation = nOrientation
        aSR.GraphicBarsManager.SetGraphicalSettings(hWnd, settings)
        Return hWnd
    End Function
#End Region
#Region "Drag Move Event Fields"
    Private formLabel As New Form
    Private mouseX As Integer
    Private mouseY As Integer
    Private drag As Boolean
    Private Function MoveControl(ByVal hForm As Form, ByVal hCtl As Label) As System.Drawing.Point
        formLabel = hForm
        lblVuL = hCtl
        lblVuR = hCtl
    End Function
    Private Sub label1_MouseDown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblVuL.MouseDown, lblVuR.MouseDown
        drag = True
        mouseX = Control.MousePosition.X - formLabel.Left
        mouseY = Control.MousePosition.Y - formLabel.Top
    End Sub
    Private Sub label1_MouseMove(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblVuL.MouseMove, lblVuR.MouseMove
        If drag Then
            formLabel.Left = Control.MousePosition.X - mouseX
            formLabel.Top = Control.MousePosition.Y - mouseY
        End If
    End Sub
    Private Sub label1_MouseUp(ByVal sender As Object, ByVal e As EventArgs) Handles lblVuL.MouseUp, lblVuR.MouseUp
        drag = False
    End Sub
    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown
        drag = True
        mouseX = Control.MousePosition.X - Me.Left
        mouseY = Control.MousePosition.Y - Me.Top
    End Sub
    Private Sub Form1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove
        If drag Then
            Me.Left = Control.MousePosition.X - mouseX
            Me.Top = Control.MousePosition.Y - mouseY
        End If
    End Sub
    Private Sub Form1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseUp
        drag = False
    End Sub
    Private Sub lblVuL_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblVuL.MouseEnter
        lblVuL.Cursor = Cursors.Cross
    End Sub
    Private Sub lblVuR_MouseEnter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblVuR.MouseEnter
        lblVuR.Cursor = Cursors.Cross
    End Sub
    Private Sub lblVuL_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblVuL.MouseLeave
        lblVuL.Cursor = Cursors.Default
    End Sub
    Private Sub lblVuR_MouseLeave(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lblVuR.MouseLeave
        lblVuR.Cursor = Cursors.Default
    End Sub
#End Region
#Region "KeyStroke Events"
    Private bool As Boolean = False
    Private cVol As Integer = 0
    Private Sub MainForm_KeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles MyBase.KeyDown
        Select Case e.KeyCode
            Case Keys.Enter
                aSR.StartFromDirectSoundDevice(nID, nIC, "")
                bool = True
            Case Keys.End
                aSR.Stop()
                bool = False
            Case Keys.Left
                cVol -= 1
                If cVol < 0 Then Return
                aSR.SetInputDeviceChannelVolume(nID, nIC, CShort(cVol))
            Case Keys.Right
                cVol += 1
                If cVol > 100 Then Return
                aSR.SetInputDeviceChannelVolume(nID, nIC, CShort(cVol))
            Case Keys.Escape
                aSR.Stop()
                Me.Close()
        End Select
    End Sub
#End Region
End Class
« Last Edit: July 12, 2015, 10:02:59 AM by sak2005 »
Logged

Administrator

  • Administrator
  • Full Member
  • *****
  • Posts: 231
    • View Profile
    • MultiMedia Soft
Re: Help me. How to set inputs WithOut the ComboBox.
« Reply #3 on: July 12, 2015, 10:35:38 AM »

Hello,

I'm sorry but if you don't specify what's incorrect "FOR YOU" inside the code snippet, we have no way to understand what you need.
Please, note that continuing to send this kind of messages, in which you write very few words without apparent connection with the code snippet, don't give us any possibility to be of help: please, make a further effort to be clear in what you ask.

Kind Regards

Severino Delaurenti
MultiMedia Soft
Logged