Consistent, spiffy audio control panel.
The AudioPanel object is a Qt-widget that creates a spiffy audio control panel with lots and lots of options. There are methods for setting various colors and fonts, as well as two different sizes and two styles of labelling.Rather than try to place all of the necessary Qt-components on its own, AudioPanel uses 4 sub-widgets, all of which are private members: pAudio, pControl, pSpecial, and pDisplay. AudioPanel contains several methods that take care of the necessary signal-slot connections. All connections go to an AudioDev object or an APDialog, so that any audio device can use the panel, not just CDROM drives! There is even flexibility in some of the button icons.
If you decide to use the AudioPanel in a program of your own, follow these tips:
- In the constructor, AudioPanel, be sure to set the parameter useEject appropriately. If your program plays files [sound, mpeg, etc.], set this to false. This replaces the "eject" icon on the loadeject button with a file folder.
- Connect loadeject to a slot:
- If your program plays "hard media" [like a CD], connect this to the AudioDev slot that controls the device eject mechanism.
- If your program plays files, connect this slot to some QObject derived from a file browser.
- Create an object derived from AudioPanel to control your player device.
- Use pluginAudioControl and pluginDisplayChange to automagically connect all of the buttons and displays on the AudioPanel to your device signals.
- Use pluginPanels to connect the AudioPanel to special panel objects derived from an APDialog object.
- You can use the MaintainDB, Config and Program objects, or you can create your own.
- I strongly suggest you use MaintainDB, since it automagically interfaces to WorkMan-style and Xmcd-style databases.
Check out the documentation for other member methods to see how to use them.
I would really prefer that you not modify the internals of this class, or that of APDialog, pAudio, pControl, pSpecial, and pDisplay. [The one exception is, of course, bugfixes.] If you really, really need access to any of the signals and slots of pAudio, pControl, pSpecial, or pDisplay, I'd prefer that you contact me. I'll make modifications and add a set of "wrapper" functions to access the desired objects.
---------------------------------------------------------- ----------------------------------------------------------
The font I've chosen displays well at a small pointsize. I've
also set the label widths based on this font and its size.
Changing the default using setTimeModeLabelFont could
cause undesired results [clipped text, no text, etc.]. You need to make sure you choose a small enough pointsize so
that the text for the time display mode fits on the panel. You shouldn't use this unless you're sure that the new font
you've chosen looks good at small pointsizes.
As with all of the font-changing commands, make sure your new
font fits on the panel.
If you compile your program using a version of Qt older than
v1.31, you need the following fix: the first item in
xpm[] must be the string "/* XPM */".
You'll need to create new object that's a child of an
AudioDev object.
You'll need to create new object that's a child of an
AudioDev object.
Any parameter with a null-value is ignored; no connection
takes place. So, if your program doesn't use one of the
aforementioned buttons, feed the appropriate parameter a "0". I suggest that you create a MaintainDB object and feed
its pointer to the parameter playlst_dlg.
MaintainDB lets you use playlist databases, specifically
those used by WorkMan and Xmcd. You'll probably want to create your own dialog [derived from
APDialog] for the "Config." button.
Emitted when the Load/Eject button is clicked and the
lock button is off.
Emitted when the power button is clicked and the lock
button is off.
~AudioPanel( void )
inline void setDisplayColor( QColor& col )
inline void setLockedColor( QColor& col )
inline void setUnlockedColor( QColor& col )
inline void setTimeModeLabelFont( QFont& f )
inline void setDisplayFont( QFont& f )
inline void changePalette( QPalette& p )
inline void changeFont( QFont& f)
void setPanelIcon( const char *xpm0[] )
void setPanelIcon( QPixmap& ipix )
void setPanelIcon( QImage& iimg )
void pluginAudioControl( AudioDev *audiodev )
void pluginDisplayChange( AudioDev *audiodev )
void pluginPanels( APDialog *prog_dlg=NULLDLG, APDialog *config_dlg=NULLDLG, APDialog *playlst_dlg=NULLDLG )
void loadeject()
void quit()
Copyright 1997 by John Weiss [John.Weiss@colorado.edu]
"generated by doc++"?! More like mangled generated by doc++