Being able to select from a variety of different "sources" is what makes a player very powerful and useful. A source could be any of the following:
Any of these can be considered an input source. The other interesting thing they all have in common is that they can all be represented by a PlayListModel (a collection of songs).
The SourceSelector widget, shown docked on the left in Figure 25.9, permits the user to select the currently playing "source," which in this case corresponds to a PlayListModel. However, the SourceSelector manages a mapping of models to views, to make switching views easy and fast.
Clicking on one of the sources in the selector tree should change the currently visible table or list view in the central widget. Figure 25.10 shows one possible way of designing the classes that provides a view and a selector of a collection of sources.
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