Visitor: Generating Playlists

Visitor Generating Playlists

  • Command line arguments (Section 1.8.1)
  • Visitor pattern (Section 8.1)


In the http://oop.mcs.suffolk.edu/dist folder, you will find filetagger.tar.gz, which contains interfaces PlayListModel and Mp3Song, as well as other classes you might reuse for future assignments. The assignment is to write a Playlist class and a program that generates instances of them by scanning directories for MP3 files. The program should be called playgen. Figure 25.4 shows how the interfaces are related to PlayList.

Figure 25.4. PlayList and PlayListModel


playgen (the application) should have a class called PlayGen, containing a PlayList* scan(QString dirname) that returns a new PlayList containing references to each song.

Usage:

playgen dirname


The program should print out the name of each file that it finds (on a line by itself). But it should do this by first loading the PlayList and then displaying the string produced by PlayList::toString().

Classes you can reuse: QFile and QFileInfo, or FileVisitor.




Part I: Introduction to C++ and Qt 4

C++ Introduction

Classes

Introduction to Qt

Lists

Functions

Inheritance and Polymorphism

Part II: Higher-Level Programming

Libraries

Introduction to Design Patterns

QObject

Generics and Containers

Qt GUI Widgets

Concurrency

Validation and Regular Expressions

Parsing XML

Meta Objects, Properties, and Reflective Programming

More Design Patterns

Models and Views

Qt SQL Classes

Part III: C++ Language Reference

Types and Expressions

Scope and Storage Class

Statements and Control Structures

Memory Access

Chapter Summary

Inheritance in Detail

Miscellaneous Topics

Part IV: Programming Assignments

MP3 Jukebox Assignments

Part V: Appendices

MP3 Jukebox Assignments

Bibliography

MP3 Jukebox Assignments



An Introduction to Design Patterns in C++ with Qt 4
An Introduction to Design Patterns in C++ with Qt 4
ISBN: 0131879057
EAN: 2147483647
Year: 2004
Pages: 268

Flylib.com © 2008-2020.
If you may any questions please contact us: flylib@qtcs.net