コード例 #1
0
ファイル: Deck.cs プロジェクト: androidhacker/DotNetProjs
		public void Init(frmCUEPlayer parent, Deck nextDeck)
		{
			MdiParent = parent;
			mixer = (parent as frmCUEPlayer).Mixer;
			writer = new MixingWriter(mixer, iSource);
			this.nextDeck = nextDeck;
			Show();
		}
コード例 #2
0
ファイル: Browser.cs プロジェクト: androidhacker/DotNetProjs
		public void Init(frmCUEPlayer parent)
		{
			_config = parent.Config;
			MdiParent = parent;
			Show();
			fileSystemTreeView1.IconManager = parent.IconMgr;
			fileSystemTreeView1.SelectedFolder = ExtraSpecialFolder.MyMusic;
		}
コード例 #3
0
ファイル: Deck.cs プロジェクト: dan-huang/CUETools
 public void Init(frmCUEPlayer parent, Deck nextDeck)
 {
     MdiParent     = parent;
     mixer         = (parent as frmCUEPlayer).Mixer;
     writer        = new MixingWriter(mixer, iSource);
     this.nextDeck = nextDeck;
     Show();
 }
コード例 #4
0
ファイル: Browser.cs プロジェクト: dan-huang/CUETools
 public void Init(frmCUEPlayer parent)
 {
     _config   = parent.Config;
     MdiParent = parent;
     Show();
     fileSystemTreeView1.IconManager    = parent.IconMgr;
     fileSystemTreeView1.SelectedFolder = ExtraSpecialFolder.MyMusic;
 }
コード例 #5
0
ファイル: Icecast.cs プロジェクト: dan-huang/CUETools
        public void Init(frmCUEPlayer parent)
        {
            MdiParent = parent;
            Show();
            _mixer                 = parent.Mixer;
            buffer                 = new AudioPipe(_mixer.PCM, _mixer.PCM.SampleRate * 10); // 10 secs
            _mixer.AudioRead      += new EventHandler <CUETools.DSP.Mixer.AudioReadEventArgs>(Mixer_AudioRead);
            parent.updateMetadata += new EventHandler <UpdateMetadataEvent>(parent_updateMetadata);

            flushThread              = new Thread(FlushThread);
            flushThread.Priority     = ThreadPriority.AboveNormal;
            flushThread.IsBackground = true;
            flushThread.Name         = "Icecast";
            flushThread.Start();
        }
コード例 #6
0
ファイル: Icecast.cs プロジェクト: androidhacker/DotNetProjs
		public void Init(frmCUEPlayer parent)
		{
			MdiParent = parent;
			Show();
			_mixer = parent.Mixer;
			buffer = new AudioPipe(_mixer.PCM, _mixer.PCM.SampleRate * 10); // 10 secs
			_mixer.AudioRead += new EventHandler<CUETools.DSP.Mixer.AudioReadEventArgs>(Mixer_AudioRead);
			parent.updateMetadata += new EventHandler<UpdateMetadataEvent>(parent_updateMetadata);

			flushThread = new Thread(FlushThread);
			flushThread.Priority = ThreadPriority.AboveNormal;
			flushThread.IsBackground = true;
			flushThread.Name = "Icecast";
			flushThread.Start();
		}
コード例 #7
0
ファイル: Output.cs プロジェクト: xinghuaman/cuetools.net
        public void Init(frmCUEPlayer parent)
        {
            MdiParent = parent;
            _device   = WasapiOut.GetDefaultAudioEndpoint();
            _device.AudioEndpointVolume.OnVolumeNotification += new AudioEndpointVolumeNotificationDelegate(AudioEndpointVolume_OnVolumeNotification);
            mediaSliderVolume.Value = (int)(_device.AudioEndpointVolume.MasterVolumeLevelScalar * 100);
            //mediaSliderVolume.Maximum = (int)(_device.AudioEndpointVolume.VolumeRange);
            Show();

            int delay = 100;

            try
            {
                _player = new WasapiOut(_device, NAudio.CoreAudioApi.AudioClientShareMode.Shared, true, delay, new AudioPCMConfig(32, 2, 44100));
            }
            catch
            {
                _player = null;
            }
            if (_player == null)
            {
                try
                {
                    _player = new WasapiOut(_device, NAudio.CoreAudioApi.AudioClientShareMode.Shared, true, delay, new AudioPCMConfig(32, 2, 48000));
                    SOXResamplerConfig cfg;
                    cfg.Quality       = SOXResamplerQuality.Very;
                    cfg.Phase         = 50;
                    cfg.AllowAliasing = false;
                    cfg.Bandwidth     = 0;
                    _resampler        = new SOXResampler(parent.Mixer.PCM, _player.Settings.PCM, cfg);
                    resampled         = new AudioBuffer(_player.Settings.PCM, parent.Mixer.BufferSize * 2 * parent.Mixer.PCM.SampleRate / _player.Settings.PCM.SampleRate);
                }
                catch (Exception ex)
                {
                    _player = null;
                    Trace.WriteLine(ex.Message);
                }
            }
            parent.Mixer.AudioRead += new EventHandler <AudioReadEventArgs>(Mixer_AudioRead);
            if (_player != null)
            {
                _player.Play();
            }
        }
コード例 #8
0
ファイル: Playlist.cs プロジェクト: dan-huang/CUETools
 public void Init(frmCUEPlayer parent)
 {
     _config   = parent.Config;
     dataSet   = parent.DataSet;
     MdiParent = parent;
     Show();
     _icon_mgr = parent.IconMgr;
     listViewTracks.SmallImageList = _icon_mgr.ImageList;
     foreach (DataSet1.PlaylistRow row in dataSet.Playlist)
     {
         try
         {
             listViewTracks.Items.Add(ToItem(row));
         }
         catch (Exception ex)
         {
             Trace.WriteLine(ex.Message);
         }
     }
 }
コード例 #9
0
ファイル: Playlist.cs プロジェクト: androidhacker/DotNetProjs
		public void Init(frmCUEPlayer parent)
		{
			_config = parent.Config;
			dataSet = parent.DataSet;
			MdiParent = parent;
			Show();
			_icon_mgr = parent.IconMgr;
			listViewTracks.SmallImageList = _icon_mgr.ImageList;
			foreach (DataSet1.PlaylistRow row in dataSet.Playlist)
			{
				try
				{
					listViewTracks.Items.Add(ToItem(row));
				}
				catch (Exception ex)
				{
					Trace.WriteLine(ex.Message);
				}
			}
		}
コード例 #10
0
ファイル: Output.cs プロジェクト: androidhacker/DotNetProjs
		public void Init(frmCUEPlayer parent)
		{
			MdiParent = parent;
			_device = WasapiOut.GetDefaultAudioEndpoint();
			_device.AudioEndpointVolume.OnVolumeNotification += new AudioEndpointVolumeNotificationDelegate(AudioEndpointVolume_OnVolumeNotification);
			mediaSliderVolume.Value = (int)(_device.AudioEndpointVolume.MasterVolumeLevelScalar * 100);
			//mediaSliderVolume.Maximum = (int)(_device.AudioEndpointVolume.VolumeRange);
			Show();

			int delay = 100;
			try
			{
				_player = new WasapiOut(_device, NAudio.CoreAudioApi.AudioClientShareMode.Shared, true, delay, new AudioPCMConfig(32, 2, 44100));
			}
			catch
			{
				_player = null;
			}
			if (_player == null)
			{
				try
				{
					_player = new WasapiOut(_device, NAudio.CoreAudioApi.AudioClientShareMode.Shared, true, delay, new AudioPCMConfig(32, 2, 48000));
					SOXResamplerConfig cfg;
					cfg.Quality = SOXResamplerQuality.Very;
					cfg.Phase = 50;
					cfg.AllowAliasing = false;
					cfg.Bandwidth = 0;
					_resampler = new SOXResampler(parent.Mixer.PCM, _player.PCM, cfg);
					resampled = new AudioBuffer(_player.PCM, parent.Mixer.BufferSize * 2 * parent.Mixer.PCM.SampleRate / _player.PCM.SampleRate);
				}
				catch (Exception ex)
				{
					_player = null;
					Trace.WriteLine(ex.Message);
				}
			}
			parent.Mixer.AudioRead += new EventHandler<AudioReadEventArgs>(Mixer_AudioRead);
			if (_player != null)
				_player.Play();
		}