Mp3PlayerView

  • Widgets (Chapter 11)
  • Signals and slots (Section 9.3.3)
  • QProcess (Section 12.1)


The minimal MP3 player view has the following features:

  • Buttons: play, stop, next, and previous
  • Sliders: volume control and song progress
  • Label: to display "now playing" information

An example Mp3Player class based on Figure 25.7 is supplied to you. This particular implementation works by creating QProcess objects, running command-line programs, passing options, parsing the output, and displaying information based on it. It uses mpg321[3](for MP3 decoding) and alsaplayer[4](for volume control). You can reuse this class if you are using Linux.

[3] http://mpg321.sourceforge.net

[4] http://www.alsaplayer.org

Figure 25.7. Mp3Player


1.

Write another Mp3Player-derived class, better suited to your own platform or personal needs. It can be based on http://www.music.mcgill.ca/~gary/rtaudio/index.html#license or http://www.speech.kth.se/snack, two open-source libraries for playing media files. Alternately, you can write it as a plugin for an already existing media player, such as xmms or Winamp.

2.

Write a front-end to this Mp3Player class that allows you to load songs, start/stop, change volume, and see the play progress advance in the slider.

3.

Enhance Mp3Player and PlayerView so that you can change the position of the song playing by manipulating the song progress slider.



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

show all menu



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
Similar book on Amazon

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