class AudioPanel : public QWidget

Consistent, spiffy audio control panel.

Inheritance:

AudioPanel


Public Methods

AudioPanel( QWidget *parent, char *dn, bool bigsize=true, bool compact=false, bool useEject=true )
inline void changeFont( QFont& f)
inline void changePalette( QPalette& p )
void loadeject()
[signal]
void pluginAudioControl( AudioDev *audiodev )
void pluginDisplayChange( AudioDev *audiodev )
void pluginPanels( APDialog *prog_dlg=NULLDLG, APDialog *config_dlg=NULLDLG, APDialog *playlst_dlg=NULLDLG )
void quit()
[signal]
inline void setDisplayColor( QColor& col )
inline void setDisplayFont( QFont& f )
inline void setLockedColor( QColor& col )
void setPanelIcon( QPixmap& ipix )
void setPanelIcon( QImage& iimg )
void setPanelIcon( const char *xpm0[] )
inline void setTimeModeLabelFont( QFont& f )
inline void setUnlockedColor( QColor& col )
~AudioPanel( void )

Documentation

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:

  1. 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.

  2. 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.

  3. Create an object derived from AudioPanel to control your player device.

  4. Use pluginAudioControl and pluginDisplayChange to automagically connect all of the buttons and displays on the AudioPanel to your device signals.

  5. 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.

  
  ----------------------------------------------------------
  ----------------------------------------------------------
  

AudioPanel( QWidget *parent, char *dn, bool bigsize=true, bool compact=false, bool useEject=true )
Class Constructor. You can specify several parameters to control its appearance.

Parameters:
parent - The parent widget. Most likely a null pointer [i.e the desktop is the parent].
dn - A string containing the name of the panel - i.e the program's name.
bigsize - Set true to use larger buttons. false uses buttons 75% smaller than the "large" size.
compact - Set true to use abbreviated button labels and short title and item label displays. The default, false uses full length labels.
useEject - The default value of true uses a pixmap of an eject button on the load/eject button. false uses a pixmap of a file folder instead.

~AudioPanel( void )
Class Destructor.

inline void setDisplayColor( QColor& col )
Parts of the AudioPanel, such as the track number, volume meter, and time counter, have a different foreground color than the rest of the panel. This method sets that color.
See Also:
pDisplay

inline void setLockedColor( QColor& col )
Sets the color that the lock-light displays when the panel is locked.
See Also:
pControl

inline void setUnlockedColor( QColor& col )
Sets the color that the lock-light displays when the panel is unlocked.
See Also:
pControl

inline void setTimeModeLabelFont( QFont& f )
Changes the font used to display the current time display mode.

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.

See Also:
pDisplay

inline void setDisplayFont( QFont& f )
Changes the font used to display the title and track labels. Make sure the font you choose fits in the title and track label widgets!
See Also:
pDisplay

inline void changePalette( QPalette& p )
Changes the global palette.

inline void changeFont( QFont& f)
Changes the global font [used for button labels and such].

As with all of the font-changing commands, make sure your new font fits on the panel.

See Also:
setTimeModeLabelFont, setDisplayFont

void setPanelIcon( const char *xpm0[] )
Sets the panel's icon. Not only calls the Qt-methods to do so, but also calls some XLib routines to permit the use of pixmaps with transparent regions!

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 */".

void setPanelIcon( QPixmap& ipix )
Overloaded verison of setPanelIcon(const char *[]).

void setPanelIcon( QImage& iimg )
Overloaded verison of setPanelIcon(const char *[]).

void pluginAudioControl( AudioDev *audiodev )
Connects the signals on several of the audio control buttons to the corresponding slots on the AudioDev object, audiodev.

You'll need to create new object that's a child of an AudioDev object.

See Also:
pAudio, pSpecial, AudioDev,

void pluginDisplayChange( AudioDev *audiodev )
Connects the signals on several display-controlling buttons to the corresponding slots on the AudioDev object, audiodev.

You'll need to create new object that's a child of an AudioDev object.

See Also:
pDisplay, AudioDev,

void pluginPanels( APDialog *prog_dlg=NULLDLG, APDialog *config_dlg=NULLDLG, APDialog *playlst_dlg=NULLDLG )
Connects the {\bg open}()slot of the specified APDialog objects to the slots on the "Program", "Config.", and "Catalog" buttons, respectively.

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.

See Also:
MaintainDB, Program

void loadeject()
Signal

Emitted when the Load/Eject button is clicked and the lock button is off.

See Also:
bControl.

void quit()
Signal

Emitted when the power button is clicked and the lock button is off.

See Also:
bControl.


This class has no child classes.
See Also:
AudioDev, APDialog, pAudio, pControl, pSpecial, pDisplay

alphabetic index hierarchy of classes


Copyright 1997 by John Weiss [John.Weiss@colorado.edu] "generated by doc++"?! More like mangled ...

generated by doc++