zoukankan      html  css  js  c++  java
  • 第五次团队作业

    作业要求:

    做一个MP3文件播放器。
    具体要实现的是程序能够打开MP3文件,并可以播放这个文件。控制台程序或是gui程序都可以。gui是Graphical User Interface的简写,简单理解就是窗口的意思。
    思路:
    1、程序要知道文件的路径,控制台程序可以以参数的形式告诉程序,gui程序可以通过一个按钮来实现。
    2、打开这个文件。
    3、播放这个文件。播放MP3文件需要有MP3库来支持,可以上网查,调用库中的播放方法来实现播放。
    4、播放完关闭文件,然后程序可以给个播放完的提示,提示完就可以退出了。
    我们现在做的是一个最简单的播放器,但是我的目的是经过三四轮的迭代让其成为一个产品。

    代码实现:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.IO;
    
    namespace WindowsFormsApplication1
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
          
           
            private void button1_Click(object sender, EventArgs e)//清空列表
            {
                listBox1.Items.Clear();
            }
    
           
            private void 打开文件ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                openFileDialog1.RestoreDirectory = false;
                openFileDialog1.Filter = "mp3|*.mp3|avi|*.avi";
                openFileDialog1.FilterIndex = 0;
                if (openFileDialog1.ShowDialog() == DialogResult.OK)
                {
    
                    if (!listBox1.Items.Contains(openFileDialog1.FileName))
                    {
                        listBox1.Items.Add(openFileDialog1.FileName);
                        axWindowsMediaPlayer1.URL = openFileDialog1.FileName;
                        axWindowsMediaPlayer1.Ctlcontrols.play();
                    }
                }
                
    
            }
    
            private void 打开目录ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                if (folderBrowserDialog1.ShowDialog() == DialogResult.OK)
                {
                    Getfiles(folderBrowserDialog1.SelectedPath);
                }
            }
    
    
            private void Getfiles(string path)//获取目录,
            {
                DirectoryInfo dir = new DirectoryInfo(path);
                foreach (FileInfo fi in dir.GetFiles("*.mp3"))//获取目录下mp3格式的文件
                {
                    listBox1.Items.Add(fi.FullName);
                }
                foreach (DirectoryInfo di in dir.GetDirectories())//对于目录下的目录进行递归
                {
                    Getfiles(di.FullName);
                }
            }
    
            private void Form1_DragDrop(object sender, DragEventArgs e)//获取文件
            {
                string[] filenames = (string[])e.Data.GetData(DataFormats.FileDrop);
                for (int i = 0; i < filenames.Length; i++)
                {
                    if (!listBox1.Items.Contains(filenames[i]))
                        listBox1.Items.Add(filenames[i]);
                }
                axWindowsMediaPlayer1.URL = listBox1.Items[listBox1.Items.Count - 1].ToString();
            }
         
    
            private void button7_Click(object sender, EventArgs e)//下一曲
            {
                axWindowsMediaPlayer1.URL = listBox1.Items[listBox1.SelectedIndex + 1].ToString();
                listBox1.SetSelected(listBox1.SelectedIndex + 1, true);
                axWindowsMediaPlayer1.Ctlcontrols.play();
            }
    
            private void button5_Click(object sender, EventArgs e)//播放和暂停
            {
                if (axWindowsMediaPlayer1.playState == WMPLib.WMPPlayState.wmppsPlaying)
                {
                    axWindowsMediaPlayer1.Ctlcontrols.pause();
                    button5.Text = "播放";
                }
                else
                {
                    axWindowsMediaPlayer1.Ctlcontrols.play();
                    button5.Text = "暂停";
                }
            }
    
           
    
           
    
            private void button3_Click(object sender, EventArgs e)//上一曲
            {
                axWindowsMediaPlayer1.URL = listBox1.Items[listBox1.SelectedIndex - 1].ToString();
                listBox1.SetSelected(listBox1.SelectedIndex - 1, true);
                axWindowsMediaPlayer1.Ctlcontrols.play();
            }
    
       
    
        
        }
    }
    

    调试实现:

       耗时分析

    psp Personal Software Process Stages Time(h)
    planning .计划 9
    .Estimate .估计这个任务需要多长时间 4
    Development .开发 70
    .Analysis .需求分析 3
    .Design Spec .生成设计文档 2
    .Design Review .设计复审 4
    • Coding Standard .代码规范 2
     • Design .具体设计 10
     • Coding .具体编码 4
    • Code Review .代码复审 3
     • Text .测试 3
    Reporting .报告 4
    • Test Report .测试报告 3
    • Size Measurement .计算工作量 0.5
     • Postmortem&Process Improvement Plan .事后总结并提出改进计划 4

    团队总结:

    关于这次团队作业,我感觉非常不理想,我感觉非常失败,完成的没有达到我的预期,人多做出来的东西不理想,就是失败,我感觉还需要多合作,多交流,这是问题所在,我们还需要多看书,自学,大学最重要的不是学习,而是学会学习的能力!

    分工布置

    赵文涛:总工作  5分

    李宁:需求分析 1分

    姚震:代码规范 1分

    娄豪:代码复审 1分

    肖雪峰:测试   1分

    杨栗:计算工作量 1分

  • 相关阅读:
    用ruby抓取网页
    [转] 从项目管理角度看敏捷开发
    ruby学习笔记(9)
    [转] 从项目管理角度看敏捷开发
    ruby学习笔记(8)
    ruby学习笔记(7)
    [转] 什么是敏捷开发
    netbeans tomcat
    maven
    jersey
  • 原文地址:https://www.cnblogs.com/zwt0626/p/4946212.html
Copyright © 2011-2022 走看看