public MediaPlayer(Liedje liedje, string filename) { InitializeComponent(); DoNotTriggerUpdateEvent = true; selectionPanel.Size = new Size(this.Size.Width, this.Size.Height); fadeinPanel.Size = new Size(0, this.Size.Height); fadeoutPanel.Size = new Size(0, this.Size.Height); currentPanel.Size = new Size(3, this.Size.Height); this.filename = filename; if (filename != "") { lengte = liedje.Lengte; wmp = new AxWMPLib.AxWindowsMediaPlayer(); wmp.CreateControl(); wmp.URL = filename; wmp.PlayStateChange += wmp_PlayStateChange; wmp.Ctlcontrols.stop(); ChangeButtonText("Play"); label3.Text = liedje.Artiest + " / " + liedje.Titel; label4.Text = "0.00 / 0.00"; numericUpDown1.Maximum = (decimal)lengte; numericUpDown2.Maximum = (decimal)lengte; numericUpDown3.Maximum = (decimal)lengte; numericUpDown3.Value = (decimal)lengte; UpdateSelection(); } }
public CtrlSong() { songs = new List <Song>(); IndexSong = 0; wmPlayer = new AxWMPLib.AxWindowsMediaPlayer(); wmPlayer.CreateControl(); }
private void Form1_Load(object sender, EventArgs e) { CryptageEtHachage.CombineUsersElements(CryptageEtHachage.HashPasswordsAndScores(Variables.UserNom), CryptageEtHachage.HashPasswordsAndScores(Variables.UserPass), Application.StartupPath + "\\users.xml"); // Audio manzu3 hek wahdu prof.Load(Application.StartupPath + "\\Prof.xml"); if (Variables.ExisteMessage(Variables.UserNom)) { pictureBox2.Image = Properties.Resources.newMsg; } for (lecons lcs = lecons.Conjugaison1; lcs < lecons.Clock; lcs++) { prof.Load(Application.StartupPath + "\\Prof.xml"); if ((int)lcs < 5) { if (Variables.exSup[i] != prof.SelectSingleNode("Prof/Francais/" + lcs + " / Questions").InnerText.Split(',').Length.ToString()) { Suppex.Image = Properties.Resources.newASsignment; break; } ; i++; } else if ((int)lcs < 16) { if (Variables.exSup[i] != prof.SelectSingleNode("Prof/Maths/" + lcs + "/Questions").InnerText.Split(',').Length.ToString()) { Suppex.Image = Properties.Resources.newASsignment; break; } ; i++; } else { if (Variables.exSup[i] != prof.SelectSingleNode("Prof/Sciences/" + lcs + "/Questions").InnerText.Split(',').Length.ToString()) { Suppex.Image = Properties.Resources.newASsignment; break; } ; i++; } } dr = Variables.XmlReader(Application.StartupPath + "\\users.xml"); Variables.exSup = dr[0]["exSupp"].ToString().Split(','); if ((string)dr[0]["Type"] == "Prof") { Suppex.Visible = false; addFile.Visible = true; } else { addFile.Visible = false; Suppex.Visible = true; } mediaplayer.CreateControl(); mediaplayer.URL = Application.StartupPath + "\\Sounds\\Intro0.m4a"; mediaplayer.Ctlcontrols.play(); }
public TrimVideoControl() { InitializeComponent(); BackColor = Color.Transparent; // Try creating WMP control // We do this here so we can gracefully catch errors if the control doesn't load try { wmPlayer = new AxWMPLib.AxWindowsMediaPlayer(); ((System.ComponentModel.ISupportInitialize)(wmPlayer)).BeginInit(); //SuspendLayout(); wmPlayer.CreateControl(); wmPlayer.Parent = this; wmPlayer.Name = "wmPlayer"; wmPlayer.Ctlenabled = true; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(TrimVideoControl)); wmPlayer.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("wmPlayer.OcxState"))); wmPlayer.Location = new Point(12, 13); wmPlayer.Size = new Size(636, 358); wmPlayer.enableContextMenu = true; wmPlayer.stretchToFit = true; wmPlayer.uiMode = "none"; wmPlayer.settings.autoStart = false; wmPlayer.ErrorEvent += wmPlayer_ErrorEvent; wmPlayer.MediaChange += wmPlayer_MediaChange; wmPlayer.MediaError += wmPlayer_MediaError; wmPlayer.OpenStateChange += wmPlayer_OpenStateChange; wmPlayer.PlayStateChange += wmPlayer_PlayStateChange; wmPlayer.Warning += wmPlayer_Warning; this.Controls.Add(wmPlayer); ((System.ComponentModel.ISupportInitialize)(wmPlayer)).EndInit(); //this.ResumeLayout(false); //this.PerformLayout(); //wmPlayer.Show(); //wmPlayer.BringToFront(); } catch (Exception ex) { Logger.Error("Error creating WMP control: " + ex); } videoPlayerSeekHelper.mediaPlayer = wmPlayer; videoPlayerSeekHelper.DoneWorking += new VideoPlayerSeekHelper.DoneWorkingEventHandler(videoPlayerSeekHelper_DoneWorking); }
//Initializes the music player //Passes it the URL for the music (badly done) private void createMusic() { musicPlayer = new AxWMPLib.AxWindowsMediaPlayer(); musicPlayer.CreateControl(); musicPlayer.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(this.musicPlayer_PlayStateChange); musicPlayer.URL = "C:\\Users\\arturpopov\\Desktop\\C#\\projectSharp\\MatchThree\\WindowsFormsApplication1\\WindowsFormsApplication1\\Resources\\song18_0.mp3"; musicPlayer.Ctlcontrols.play(); sfx = new SoundPlayer(); sfx.LoadCompleted += new AsyncCompletedEventHandler(this.loadedSFX); //First sound. Makes sure there is a sfx for the first match sfx.Stream = Resources.Item1A; }
private void button2_Click(object sender, EventArgs e) { axWindowsMediaPlayer1.URL = TxtPath.Text; axWindowsMediaPlayer1.Ctlcontrols.play(); wmPlayer = new AxWMPLib.AxWindowsMediaPlayer(); wmPlayer.CreateControl(); wmPlayer.enableContextMenu = false; ((System.ComponentModel.ISupportInitialize)(wmPlayer)).BeginInit(); wmPlayer.Name = "wmPlayer"; wmPlayer.Enabled = true; wmPlayer.Dock = System.Windows.Forms.DockStyle.Fill; this.Controls.Add(wmPlayer); ((System.ComponentModel.ISupportInitialize)(wmPlayer)).EndInit(); wmPlayer.uiMode = "none"; wmPlayer.URL = @"C:\..."; wmPlayer.settings.setMode("loop", true); wmPlayer.Ctlcontrols.play(); }
public bool createVideo(string videoName, int videoHeight, int VideoWidth, string playerType) { try { #if WMP if (playerType == "WMP") //WindowsMediaPlayer { if (videoName.Length > 0) { axWindowsMediaPlayer1 = new AxWMPLib.AxWindowsMediaPlayer(); axWindowsMediaPlayer1.CreateControl(); axWindowsMediaPlayer1.Parent = this; axWindowsMediaPlayer1.enableContextMenu = false; axWindowsMediaPlayer1.Size = new Size(VideoWidth, videoHeight); //axWindowsMediaPlayer1.URL = videoName; axWindowsMediaPlayer1.openPlayer(videoName); axWindowsMediaPlayer1.Show(); } } #endif #if DIRECTX if (playerType == "DIRECTX") { if ((secVideo == null) && (videoName.Length != 0)) { secVideo = new Video(videoName, true); secVideo.Owner = this; secVideo.Size = new Size(VideoWidth, videoHeight); secVideo.HideCursor(); } } #endif } catch (Exception ex) { MessageBox.Show("Exception, Unable to set video " + videoName + ": " + ex.Message); return(false); } return(true); }
public MainForm() { InitializeComponent(); timer.Tick += new EventHandler(timer_Tick); wplayer.PlayStateChange += new AxWMPLib._WMPOCXEvents_PlayStateChangeEventHandler(wplayer_PlayStateChange); wplayer.CreateControl(); wplayer.settings.volume = uxVolumeControl.Value * 10; comb.Location = new Point(300, 200); this.Controls.Add(comb); pd.DocumentName = "Print Document"; volume = uxVolumeControl.Value; waveIn = new WaveIn(); waveIn.DataAvailable += new EventHandler <WaveInEventArgs>(waveIn_DataAvailable); waveIn.WaveFormat = new NAudio.Wave.WaveFormat(16000, 1); }
public MediaPlayer() { InitializeComponent(); DoNotTriggerUpdateEvent = true; selectionPanel.Size = new Size(this.Size.Width, this.Size.Height); fadeinPanel.Size = new Size(0, this.Size.Height); fadeoutPanel.Size = new Size(0, this.Size.Height); currentPanel.Size = new Size(3, this.Size.Height); wmp = new AxWMPLib.AxWindowsMediaPlayer(); wmp.CreateControl(); wmp.Ctlcontrols.stop(); ChangeButtonText("Play"); numericUpDown1.Maximum = (decimal)lengte; numericUpDown2.Maximum = (decimal)lengte; numericUpDown3.Maximum = (decimal)lengte; numericUpDown3.Value = (decimal)lengte; UpdateSelection(); }
String songStarted; //bandera, detecta cuando ya se inicia una cancion public ReproductionCtrl() { songStarted = ""; player = new AxWMPLib.AxWindowsMediaPlayer(); player.CreateControl(); }