コード例 #1
0
ファイル: MainForm.cs プロジェクト: notisrac/TimeNazi
        public MainForm()
        {
            logger.Debug("MainForm()");
            InitializeComponent();
            this.Icon = Properties.Resources.clock;
            // create the refresh image button's completely flat appearance
            //btnRefreshImage.FlatStyle = FlatStyle.Flat;
            //btnRefreshImage.FlatAppearance.BorderColor = Color.FromArgb(0, 255, 255, 255); //Transparent
            //btnRefreshImage.FlatAppearance.BorderSize = 0;
            //btnRefreshImage.FlatAppearance.MouseOverBackColor = pnlMainContent.BackColor;
            //btnRefreshImage.FlatAppearance.MouseDownBackColor = pnlMainContent.BackColor;

            _sizMainPanelSize = pnlMainContent.Size;
            _sizMainPanelSize.Height -= pbPictureBox.Height;
            _updateRealClock();

            try
            {
                logger.Debug("setting up audio device control");
                // set up the audio device control
                MMDeviceEnumerator mmdEnumerator = new MMDeviceEnumerator();
                _mmdAudioDevice = mmdEnumerator.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia);
            }
            catch (Exception ex)
            {
                logger.Error(ex, "Error while trying to set up the audio device: {0}", ex.Message);
            }
            #if !DEBUG
            btnExit.Visible = false;
            #endif
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: ThiefMaster/coreaudio-dotnet
 public Form1()
 {
     InitializeComponent();
     MMDeviceEnumerator DevEnum = new MMDeviceEnumerator();
     device = DevEnum.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia);
     tbMaster.Value = (int)(device.AudioEndpointVolume.MasterVolumeLevelScalar * 100);
     device.AudioEndpointVolume.OnVolumeNotification += new AudioEndpointVolumeNotificationDelegate(AudioEndpointVolume_OnVolumeNotification);
     timer1.Enabled = true;
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: raddeus/MuteStar
 public MainForm()
 {
     DevEnum = new MMDeviceEnumerator();
     device = DevEnum.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia);
     InitializeComponent();
     Rectangle workingArea = Screen.GetWorkingArea(this);
     this.Location = new Point(workingArea.Right - Size.Width,
                               workingArea.Bottom - Size.Height);
     lblStatusBar.Text = "Ready | Stopped";
 }
コード例 #4
0
        public MainWindow()
        {
            InitializeComponent();

            MMDeviceEnumerator DevEnum = new MMDeviceEnumerator();
            device = DevEnum.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia);

            OscServer oscServer;
            oscServer = new OscServer(TransportType.Udp, IPAddress.Any, Port);

            oscServer.FilterRegisteredMethods = false;
            oscServer.RegisterMethod(AliveMethod);
            oscServer.RegisterMethod(TestMethod);
            oscServer.BundleReceived += new EventHandler<OscBundleReceivedEventArgs>(oscServer_BundleReceived);
            oscServer.MessageReceived += new EventHandler<OscMessageReceivedEventArgs>(oscServer_MessageReceived);
            oscServer.ReceiveErrored += new EventHandler<Bespoke.Common.ExceptionEventArgs>(oscServer_ReceiveErrored);
            oscServer.ConsumeParsingExceptions = false;

            oscServer.Start();
        }
コード例 #5
0
 public void SetDefaultAudioEndpoint(MMDevice device)
 {
     //Marshal.ThrowExceptionForHR(((IMMDeviceEnumerator)_realEnumerator).SetDefaultAudioEndpoint(device.ReadDevice));
     device.Selected = true;
 }
コード例 #6
0
 public MMDeviceEventArgs(MMDevice device)
 {
     _device = device;
 }
コード例 #7
0
 public MMDeviceStateEventArgs(MMDevice device, DEVICE_STATE newState)
     : base(device)
 {
     _newState = newState;
 }
コード例 #8
0
 public DefaultAudioDeviceEventArgs(MMDevice device, EDataFlow flow, ERole role) : base(device)
 {
     _flow = flow;
     _role = role;
 }
コード例 #9
0
 public void SetDefaultAudioEndpoint(MMDevice device)
 {
     //Marshal.ThrowExceptionForHR(((IMMDeviceEnumerator)_realEnumerator).SetDefaultAudioEndpoint(device.ReadDevice));
     device.Selected = true;
 }
コード例 #10
0
ファイル: WinMixer.cs プロジェクト: ThiefMaster/rotaryboard
 public Mixer(MMDevice device)
 {
     dev = device;
 }
コード例 #11
0
ファイル: WinMixer.cs プロジェクト: ThiefMaster/rotaryboard
 public Mixer()
 {
     dev = Devices.DefaultPlayback;
 }