Turkce Gta Forumu [TR]

Sitemize Giriş İçin Tıklayın

Join the forum, it's quick and easy

Turkce Gta Forumu [TR]

Turkce Gta Forumu [TR]

Would you like to react to this message? Create an account in a few clicks or log in to continue.

    Basit Winamp Player Yapımı

    Sipsi Çakıcı
    Sipsi Çakıcı
    Administratör
    Administratör


    Cinsiyet : Erkek Mesaj Sayısı : 357
    Rep Puanı : 5
    Kayıt tarihi : 22/04/10
    Yaş : 31
    Nerden : İstanbul

    Basit Winamp Player Yapımı Empty Basit Winamp Player Yapımı

    Mesaj tarafından Sipsi Çakıcı Çarş. Haz. 16, 2010 6:12 am

    Bu derste C# ile basit bir Winamp player yapımını görelim.
    Bu derste C# ile basit bir Winamp player yapımını görelim.

    [Resimleri görebilmek için üye olun veya giriş yapın.]

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.IO;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;

    namespace WindowsFormsApplication4
    {
    public partial class Form1 : Form
    {
    [DllImport("winmm.dll")]
    private static extern long mciSendString(string strCommand, StringBuilder strReturn, int iReturnLength, IntPtr hwndCallback);
    public string Pcommand;
    public bool isOpen;
    public Form1()
    {
    InitializeComponent();
    }
    private void button1_Click(object sender, EventArgs e)
    {
    openFileDialog1.Filter = "Media File(*.mpg,*.dat,*.avi,*.wmv,*.wav,*.mp3)|*.wav;*.mp3;*.mpg;*.dat;*.avi;*.wmv";
    openFileDialog1.ShowDialog();
    if (openFileDialog1.FileName != "")
    textBox1.Text = openFileDialog1.FileName;
    }
    private void button2_Click(object sender, EventArgs e)
    {
    Pcommand = "open "" + textBox1.Text + "" type mpegvideo alias MediaFile";
    mciSendString(Pcommand, null, 0, IntPtr.Zero);
    isOpen = true;
    Play(true);
    }
    private void button3_Click(object sender, EventArgs e)
    {
    Pcommand = "close MediaFile";
    mciSendString(Pcommand, null, 0, IntPtr.Zero);
    isOpen = false;
    }
    private void button4_Click(object sender, EventArgs e)
    {
    Application.Exit();
    }
    public void Play(bool loop)
    {
    if (isOpen)
    {
    Pcommand = "play MediaFile";
    if (loop)
    Pcommand += " REPEAT";
    mciSendString(Pcommand, null, 0, IntPtr.Zero);
    }
    }
    }
    }

    [Linkleri görebilmek için üye olun veya giriş yapın.]

      Forum Saati Çarş. Mayıs 08, 2024 10:01 pm