/// <summary> /// Initializes a new instance of the TrackDetails class. /// </summary> public PlayerDetails() { InitializeComponent(); Timer = new BASSTimer(100); //this.Timer = new System.Windows.Forms.Timer(); Timer.Interval = 100; Load += new EventHandler(TrackDetails_Load); KryptonManager.GlobalPaletteChanged += new EventHandler(KryptonManager_GlobalPaletteChanged); slider.Slid += new EventHandler(Slider_Slid); btnPlay.Click += new EventHandler(btnPlay_Click); btnPause.Click += new EventHandler(btnPlay_Click); Timer.Tick += new EventHandler(Timer_Tick); btnPrevious.Click += new EventHandler(btnPrevious_Click); btnSkipToEnd.Click += new EventHandler(btnSkipToEnd_Click); btnNext.Click += new EventHandler(btnNext_Click); sldVolume.Scrolled += new MediaSlider.MediaSlider.ScrollDelegate(sldVolume_Slid); VisualsShown = false; AlbumArtShown = true; slider.Minimum = 0; slider.Maximum = 0; SetThemeState(); _bassVisuals.MaxFFT = BASSData.BASS_DATA_FFT1024; _bassVisuals.MaxFrequencySpectrum = Utils.FFTFrequency2Index(16000, 1024, 44100); }
/// <summary> /// Initializes a new instance of the <see cref="TrackWave" /> class. /// </summary> public TrackWave() { InitializeComponent(); // create a secure timer _timer = new BASSTimer(50); _timer.Tick += timer_Tick; Mode = TrackWaveMode.Shuffler; }
private AudioPlayer() { _updateTimer = new BASSTimer(50); _updateTimer.Tick += UpdateTimerTick; Directory.CreateDirectory(MainCacheDirectory); Songs = new ObservableCollection<Song>(); Songs.CollectionChanged += SongsCollectionChanged; }
public PlayBarBASSVM() { PlayList = new ObservableCollection<Song>(); _playedList = new ObservableCollection<Song>(); _mySync = new SYNCPROC(EndSync); //MusicPlayer = new MusicPlayerBASS(); Devices = BASSHelper.GetDeviceInfoList(); //initalizing BASS InitBASS(); _updateTimer = new Un4seen.Bass.BASSTimer(_updateTimerInterval); _updateTimer.Tick += new EventHandler(timerUpdate_Tick); //PlayStream(); SelectedSoundCard = Devices[1]; }
private void Form1_Load(object sender, EventArgs e) { if (Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_LATENCY, this.Handle)) { BASS_INFO info = new BASS_INFO(); Bass.BASS_GetInfo(info); deviceLatencyMS = info.latency; } else { MessageBox.Show(this, "Bass init Error"); } updateTimer = new BASSTimer(updateInterval); updateTimer.Tick += new EventHandler(updateTimer_Tick); sync = new SYNCPROC(endPosition); }
public void InitializeSound() { if (SoundInitialized != true) { if (Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, Program.playerWindow.Handle)) { BassTimer = new BASSTimer(500); BassTimer.Tick += new EventHandler(BassTimer_Tick); SoundInitialized = true; TagInfo = new TAG_INFO(); } else { SoundInitialized = false; BASSError err = Bass.BASS_ErrorGetCode(); throw new Exception("Cannot init bass: " + err.ToString()); } } }
public void init(int Device) { if(inicialized) { Bass.BASS_RecordFree(); } Bass.BASS_RecordInit(-1); Un4seen.Bass.BASSError error; if((error=Bass.BASS_ErrorGetCode())!=0) MessageBox.Show("Bass Error Code: "+error, "Music Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); Bass.BASS_RecordSetDevice(Device); if ((error = Bass.BASS_ErrorGetCode()) != 0) MessageBox.Show("Bass Error Code: " + error, "Music Error", MessageBoxButtons.OK, MessageBoxIcon.Hand); myRecProc = new RECORDPROC(MyRecording); recChannel = Bass.BASS_RecordStart(22050, 2, BASSFlag.BASS_RECORD_PAUSE, myRecProc, IntPtr.Zero); Bass.BASS_ChannelPlay(recChannel, false); updateTimer = new Un4seen.Bass.BASSTimer(50); updateTimer.Tick += new EventHandler(timerUpdate_Tick); mySpectrumInit(); inicialized = true; }
public SM(Form form) { this.form = form; if (Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero)) { BASS_INFO info = new BASS_INFO(); Bass.BASS_GetInfo(info); Console.WriteLine(info.ToString()); _deviceLatencyMS = info.latency; } else Console.WriteLine("Bass_Init error!"); // create a secure timer _updateTimer = new Un4seen.Bass.BASSTimer(_updateInterval); _updateTimer.Tick += new EventHandler(timerUpdate_Tick); _sync = new SYNCPROC(EndPosition); th = new Thread(new ThreadStart(DelegateValueUpdate)); th.Start(); }
//Konstruktor public Form1() { //A splash elnyomásához BassNet.Registration("*****@*****.**", "2X14323717152222"); if (!Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_LATENCY, this.Handle)) MessageBox.Show(this, "Bass_Init error!"); //Timer a zene streamje és az UI közötti szinkronizációhoz _updateTimer = new Un4seen.Bass.BASSTimer(_updateInterval); _updateTimer.Tick += new EventHandler(timerUpdate_Tick); //Callback a pausekori hangerő fadehez pausefading = new SYNCPROC(delegate(int handle, int channel, int data, IntPtr user) { if (paused) Bass.BASS_ChannelPause(channel); }); nexttrack = new SYNCPROC(delegate(int handle, int channel, int data, IntPtr user) { playlist_stop_Click(null, EventArgs.Empty); if (playlist.Rows.Count > playlist.CurrentRow.Index + 1) { playlist_forward_Click(null, EventArgs.Empty); } }); InitializeComponent(); playlist.AutoGenerateColumns = false; playlist.Columns[0].DataPropertyName = "asstring"; playlist.Columns[1].DataPropertyName = "length"; playlist.Columns[1].DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleRight; playlist.DataSource = trackList; }
public void Open(string path) { path = path; timer = new BASSTimer(interval); Bass.BASS_StreamFree(channel); BASSFlag flag = BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_PRESCAN; channel = Bass.BASS_StreamCreateFile(path, 0, 0, flag); isopened = true; if (channel == 0) { //throw (new FormatException(Bass.BASS_ErrorGetCode().ToString())); isopened = false; } }
public AudioEngine() { Path = @"http://psv4.vk.me/c613621/u23628424/audios/45049760ad7c.mp3?extra=xy8j8Fwc0OnSqJcxvITYLiX-D4akkd_Rkl8cvuVgLlLvD9G133yv-_MAqCspCcmxxUdw9OMZGdrq702KUJ2PdO1oGDkTRvw&/Scratch%20Bandits%20Crew%20-%20Surround%20Me.mp3"; //Path = @"D:\Documents and Settings\Admin\Рабочий стол\C#\Music Primer\6ddb8171688e23.mp3"; // Path = @"http://www.sky.fm/mp3/the80s.pls"; //Path = @"http://download.wavetlan.com/SVV/Media/HTTP/WMA/WMALossless/Coldplay_StrawberrySwing_WMALossless.wma"; //Path = @"http://yp.shoutcast.com/sbin/tunein-station.pls?id=193174"; //+Path = @"http://yp.shoutcast.com/sbin/tunein-station.pls?id=193174"; //Path = @"http://radiocaroline259.nl/winamp_rc259_320.pls"; //Path = @"http://yp.shoutcast.com/sbin/tunein-station.pls?id=94181"; //Path = @"http://yp.shoutcast.com/sbin/tunein-station.pls?id=256410"; //Path = @"http://flacradio.esy.es/playlist/AI-Radio.m3u"; //Path = @"http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/llnw/bbc_1xtra.m3u8"; ListSongs = new List<string>( Directory.GetFiles(@"D:\Documents and Settings\Admin\Рабочий стол\C#\Music Primer")); /* ListSongs = new List<string>(); ListSongs.Add(@"http://cs1-34v4.vk-cdn.net/p6/d1483bd42febd1.mp3?extra=vi0VwGa9y_QGmZqu8zXS2NNAuPHuBuHM-yChSaH3-vezjVEJMN7tvO6WDQq3CRsOk0SJw9apaTVSamib5nHTPROhCr8kCz3n&/CunninLynguists%20-%20Darkness%20(Dream%20On)%20(Instrumental).mp3"); ListSongs.Add(@"http://psv4.vk.me/c613231/u23628424/audios/bca9f0bb9989.mp3?extra=c7lN4T5gQC3FOQPpHCgWnmtCTk2F89a-HjouOB5qAPoKePRg_0OSR7nbm8tsFqS1ypEXhrV5khECX449brMq9qzqtiYNOfq1&/Mr.%20Moods%20-%20Rainbow.mp3"); ListSongs.Add(@"http://psv4.vk.me/c613924/u64887148/audios/73b365664dbb.mp3?extra=qbIEMne5L7HEkwI8l57HvsJbjpHEap8WEapQ5BVETzm-bo_6lpu3UPJ4gDnGJyc-G4-7cWHb_gqO9fDT9Ly87XQPYfwcEcaO&/PhybaOptikz%20-%20Chronicles.mp3"); ListSongs.Add(@"http://psv4.vk.me/c521100/u4594424/audios/0277415e656d.mp3?extra=tUmU_lLbAdXrMsDon27ayCWW3l6soR7fHTiQ0-6Qj6xuim7tQLXcEBXS0lq9uJ1TxuFkG-4xyQyWR004b_BL7nkaLcKZqMbd&/Roger%20Molls%20-%20You.mp3"); ListSongs.Add(@"http://psv4.vk.me/c613126/u247179947/audios/5b4259f1d5c3.mp3?extra=Fo_qX0TC-RHoozxSTQQZBedY9vxIlLk1VcPyRMziMarqYxCBZqIhX7cCPCPfB4XvYy2Gbnz9Zdl34KXdNtXu0ovlSeG_B86E&/Keizan%20-%20Keizan%20-%20Damn%20feat%20Dj%20Meloman.mp3"); ListSongs.Add(@"http://psv4.vk.me/c611427/u221922242/audios/d196c39b7b28.mp3?extra=OgcU7H3jJrRB94KkUdGFxqXRlGwh7ttN3sIB0LGRqYUIxFpXfm48v6FQWyHWHge3DDI5U02KBoSRHOJTQX9Pdwj31aeoWBFw&/Billa%20Qause%20-%20Slow%20Down.mp3"); ListSongs.Add(@"http://psv4.vk.me/c611324/u1444216/audios/36a640799476.mp3?extra=sr0Y8gulc4N5Wr4wEPavdJ98vK3FRAFX6pQbCC6JeDypyPoT8RGLsR4618C8CpZE1YaLlUfGmFMAyJCsXsnjSo4sg-lH87qq&/GRiZ%20-%20Love%20Will%20Follow%20You%20(feat.%20Russ%20Liquid).mp3"); ListSongs.Add(@"http://psv4.vk.me/c613327/u23628424/audios/fb86d3ceae8f.mp3?extra=q7-2v9Jh_Cq0V4QlhgEz7E4pvf3NxS9yPCE5MIdu_0NQsdQ13572JElzEgZt9Kj7VafbWfxb-vq2IP1BvLLqCE6MSD7MZRA6&/Kinack%20-%20Shine.mp3"); ListSongs.Add(@"http://cs1-42v4.vk-cdn.net/p23/7ffb834f38273a.mp3?extra=-mJYId08Rdph4HddpqC6noOAFcs6jvCw0hauKmXWQkREoEUclM-MMSstShqEYPguWrAemIoc5zA57nx89XmbnkHGh-E_5WgD&/Frameworks%20-%20Music%20Box.mp3"); ListSongs.Add(@"http://psv4.vk.me/c613121/u23628424/audios/659402091c6c.mp3?extra=ZfCP0UugdWy6oapnqKBTnvwtC2vXa_WQXZsE648_vkKMgn2e-3nP1E1fREEgJnUsSka0pMvOHvOlBwU6oyjird1po-WO0J8W&/Travelers%20Of%20Tyme%20-%20Raining%20Castanets%20(The%20Rains%20of%20Castamere).mp3"); */ WahWahEffect = new WahWahService(); PitchShiftEffect = new PitchShiftService(); PhaserEffect = new PhaserService(); ChorusEffect = new ChorusService(); DistortionEffect = new DistortionService(); DynamicAmplificationEffect = new DynamicAmplificationService(); ReverberationEffect = new ReverberationService(); EchoEffect = new EchoService(); CompressorEffect = new CompressorService(); BiQuadFilterEffect = new BiQuadFilterService(); DSPEffect = new DSP(); WaveFormClass = new WaveFormService(); Spectrum = new Spectrum(); MemoryPlay = true; _timer = new BASSTimer(); _timer.Tick += MusicTrackTick; _timer.Start(); CurrentVolume = 1; Crossfade = new CrossfadeService(CurrentVolume); EqualizerEffect = new EqualizerService(); CrossfadeActive = true; SoundOutProvider = new SoundOutProviderBASS(); _myUserAgentPtr = Marshal.StringToHGlobalAnsi(_myUserAgent); _positionEventAggregator = new EventAggregator(); _waveFormEventAggregator = new EventAggregator(); DownloadMode = DownloadTypes.NoDownload; _syncProcPos = SyncMethodPos; Bass.BASS_SetConfigPtr(BASSConfig.BASS_CONFIG_NET_AGENT, _myUserAgentPtr); SoundOutProvider.SetConfig(BASSConfig.BASS_CONFIG_FLOATDSP, true); SoundOutProvider.SetConfig(BASSConfig.BASS_CONFIG_NET_TIMEOUT, 5000); SoundOutProvider.SetConfig(BASSConfig.BASS_CONFIG_WMA_PREBUF, 0); SoundOutProvider.SetConfig(BASSConfig.BASS_CONFIG_NET_PREBUF, 0); SoundOutProvider.SetConfig(BASSConfig.BASS_CONFIG_NET_PLAYLIST, 2); }
public void Open(string path) { _timer = new BASSTimer(Interval); Bass.BASS_StreamFree(_channel); _channel = Bass.BASS_StreamCreateFile(path, 0, 0, BASSFlag.BASS_SAMPLE_FLOAT | BASSFlag.BASS_STREAM_PRESCAN | BASSFlag.BASS_STREAM_DECODE); _channel = Un4seen.Bass.AddOn.Fx.BassFx.BASS_FX_TempoCreate(_channel, 0); _isopened = true; if (_channel == 0) { //throw (new FormatException(Bass.BASS_ErrorGetCode().ToString())); _isopened = false; } Bass.BASS_ChannelGetAttribute(_channel, BASSAttribute.BASS_ATTRIB_FREQ, ref _freq); }
private static void StartTicker() { if (ticker == null) { ticker = new BASSTimer(tickInterval); ticker.Tick += new EventHandler(Tick); } stopTicker = false; ticker.Start(); }
private void OnLoad(object sender, EventArgs e) { _playListForm = new PlayList(this); _specIdx = Options.MainSettings.PlayerSpectrumIndex; _playList = new SortableBindingList<PlayListData>(); lbTitleText.Text = ""; lbArtistText.Text = ""; lbAlbumText.Text = ""; playBackSlider.Enabled = false; // create a secure timer _updateTimer = new BASSTimer(_updateInterval); _updateTimer.Tick += timerUpdate_Tick; }
public Status SetTimer(int updateInterval, EventHandler e) { _updateTimer = new BASSTimer(updateInterval); _updateTimer.Tick += e; return Status.Ok; }
private static void BaseInit() { vs = new Visuals(); _timer = new BASSTimer(); _timer.Enabled = false; _isReady = true; }