CS183 -- Lab 1: Using Existing Classes



->Courses
->CS183
-->Quiz 1
->Lab 1
-->Lab 2
-->Project 1
-->Project 2
->Electronic Submission
->Old Exams
->C++ Examples
->MSVC++ Info
->STL Info
->MFC/GUI Info
->Software
->Tentative Schedule
->Course Policies

[Courses]
[Rich][Home][Rich]
[PHome]

Spring Quarter 2002

Course Objectives Addressed

  • Understand the rationale for object-oriented design and programming.
  • Understand data abstraction and abstract data types.
  • Be able to document the design and implementation of small software systems.

Overview

The purpose of this lab is to design and implement a stand-alone program that incorporates basic C++ programming concepts. These concepts, covered in CS-182, are prerequisites for CS-183.

Acknowledgement

This lab was developed by Dr. Chris Taylor and relies on the Xaudio SDK.

Problem Statement

Write a program that will read (a user selectable) play list file that contains a list of MP3 filenames. The program should then load and play the list of files in alphabetical order according to their title (not filename).

Your program should make use of the Xaudio SDK (Software Development Toolkit) and an existing class library containing the single MP3 class. The MP3 class and Xaudio SDK do all the hard work related to loading decoding and playing the MP3 files. The definition of this class is in the file MP3.h, while the implementation is in MP3.cpp. Both files are contained in MP3code.zip (updated 3-22-2002). You should not modify the MP3 files, but you will need to add them to your project.

Your program must make use of the STL list class to store the track list. You may not use any global data objects (at file scope).

Detailed Instructions

If you have never used the Microsoft Visual C++ compiler, you may want to take a look at the following CS182 lab assignment for help on how to create a project workspace in MSVC++.

If you have difficulties with any part of the lab, consult the instructor for assistance. The basic sequence is:

  1. Download the following files:
    • The SDK 3.2.9 for Win95/98/Me/NT/2000 (C/C++ and Delphi). (Note: your use of this SDK is limited to educational activities. If you are interested in using it for software projects outside of this course, please consult InterTrust for licensing information.)
    • MP3code.zip: the source files for the MP3 class.
    • mp3files.zip: a boat-load of mp3 files that will be used throughout the quarter.
    • tracklist.txt: a track list that should be played.
  2. Create a project workspace:
    • Create an empty Win32 console application project.
    • Unzip MP3code.zip and mp3files.zip into the empty project directory. Unzip the Xaudio SDK zip file to a location of your choosing. Note: you can use something like PowerArchiver if you currently don't have an unzipper.
    • Copy audio_output.h, decoder.h, file_input.h, file_output.h, mpeg_codec.h, properties.h, wave_codec.h, and xaudio.h header files from the xasdk-3.2.9.5\include\ subdirectory into the project subdirectory.
    • Copy xaudio.lib from the xasdk-3.2.9.5\lib\static\mtd\ subdirectory into the project subdirectory.
    • In the project settings (Alt-F7) do the following:
      • Under the C/C++ tab, change /MLd to /MTd.
      • Under the Link tab, add winmm.lib wsock32.lib xaudio.lib to the Object/library modules list.
    • Add MP3.h and MP3.cpp to the project.
  3. Study the MP3.h header file to determine what member functions are available to you and how they work.
  4. Prepare a design to meet the problem specifications, identifying:
    • Data objects.
    • Program structure (selection and iteration statements, etc.)
  5. Write the program (source code) to implement your design. Be sure to include internal documentation (comments) describing all data objects, function interfaces, and significant program segments.
  6. Test the program.
  7. Submit the lab report (details below).
  8. Demostrate your working program at the beginning of lab.

Note: Be sure to include MP3.h before the list header file to avoid name conflicts.

Lab report

The lab report should consist of the following:

  • Your design documentation. (One or two paragraphs describing your approach to solving the problem. This section should convince me that you were thinking when you made the decisions that you did about how to design your program.)
  • A brief description of any problems you encountered or questions you have regarding the lab.
  • A summary of your activity log indicating how much time you spent on the assignment. In addition to the total time spent on the project, please report the time in the following categories:
    • Designing
    • Coding
    • Debugging (before you think it's working)
    • Testing (after you think it's working)
    • Writing report
    • Other
  • Any suggestions you have for how the lab could be improved.
  • The documented source code for your program. Do not include the files in MP3code.zip or mp3files.zip or the files associated with the Xaudio library.

Lab report template

As with any report you submit, correct spelling and grammar are required. In addition, your report should be submitted electronically following the Electronic submission guidelines. (You may wish to consult the sample report before submitting your report.) Be sure to keep copies of all your files, in case something gets lost. It may be wise to keep a diskette backup as well.

Your grade will depend on quality of design and clarity of the code and documentation, as well as whether your program produces the correct results. If you have any questions, consult your instructor.

© 2001-2002 Dr. Christopher C. Taylor Office: CC-27C Phone: 277-7339 Last Updated: Mon Mar 25 16:14:26 2002
I am responsible for all content posted on these pages; MSOE is welcome to share these opinions but may not want to.