Click here to Skip to main content
15,896,557 members
Articles / Mobile Apps / Windows Mobile

Audio Book Player

Rate me:
Please Sign up or sign in to vote.
4.86/5 (36 votes)
11 Jun 2009CPOL6 min read 198.8K   3.5K   84  
Audio player designed specifically for listening to audio books
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace abPlayer
{
    public partial class frmMediaProps : Form
    {
        String[] props = null;

        public frmMediaProps()
        {
            InitializeComponent();
        }

        public DialogResult ShowDialog(String path)
        {
            lblName.Text = path;
            Cursor.Current = Cursors.WaitCursor;
            try { props = new cMP3Info(path).MediaProperties; }
            catch { props = new String[0]; }
            Cursor.Current = Cursors.Default;
            return base.ShowDialog();
        }

        private void picOK_Click(object sender, EventArgs e)
        {
            DialogResult = DialogResult.OK;
        }

        private void frmMediaProps_Paint(object sender, PaintEventArgs e)
        {
            SizeF strWH = e.Graphics.MeasureString("0", Font);
            for (int i = 0; i < props.GetLength(0); i++)
            {
                e.Graphics.DrawString(props[i], Font, new SolidBrush(Color.White),
                    2, lblName.Height + 14 + i * (strWH.Height + 3));
            }
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions