Create this code :
Qt Code:
  1. class JMediaPlayer : public QWidget
  2. {
  3. Q_OBJECT
  4. public:
  5. JMediaPlayer(QWidget *parent = 0, bool initVideo = true);
  6. ~JMediaPlayer();
  7. private:
  8. Phonon::MediaObject * mediaObject;
  9. Phonon::AudioOutput * audioOutput;
  10. Phonon::VideoWidget * videoWidget;
  11. Phonon::Path audioOutputPath;
  12.  
  13. Phonon::Effect * audiopanorama;
  14. Phonon::Effect * equalizer;
  15. ...
  16. ...
  17. ...
  18. ...
  19.  
  20. JMediaPlayer::JMediaPlayer(QWidget *parent, bool initVideo)
  21. : QWidget(parent), video(initVideo)
  22. { mediaObject = new Phonon::MediaObject(this);
  23. videoWidget = new Phonon::VideoWidget(this);
  24.  
  25. if (video) Phonon::createPath(mediaObject, videoWidget);
  26.  
  27. audioOutput = new Phonon::AudioOutput(Phonon::MusicCategory, this);
  28. audioOutputPath = Phonon::createPath(mediaObject, audioOutput);
  29. }
  30. void JMediaPlayer::audiopanoramaEnable( bool state )
  31. {
  32. if ( state ) {
  33. QList<Phonon::EffectDescription> availableEffects = Phonon::BackendCapabilities::availableAudioEffects();
  34. for (int i=0; i<availableEffects.size(); i++){
  35. if ( availableEffects[i].name() == "audiopanorama") {
  36. audioOutputPath.insertEffect(availableEffects[i]);
  37. audiopanorama = new Phonon::Effect(availableEffects[i]);
  38. }
  39. }
  40. QList<Phonon::Effect *> currEffects = audioOutputPath.effects();
  41. qDebug() << "effects in path - " << currEffects.size();
  42. foreach (Phonon::Effect * effect, currEffects){
  43. qDebug() << "name - " << effect->description().name();
  44. }
  45. }
  46. }
  47.  
  48. void JMediaPlayer::balanceLeft()
  49. {
  50. for (int k=0 ; k < audiopanorama->parameters().size() ; ++k) {
  51. Phonon::EffectParameter param = audiopanorama->parameters()[k];
  52. QVariant currentValue = audiopanorama->parameterValue(param);
  53. audiopanorama->setParameterValue(param, currentValue.toDouble() + 0.1);
  54. }
  55. }
  56.  
  57. void JMediaPlayer::balanceRight()
  58. {
  59. for (int k=0 ; k < audiopanorama->parameters().size() ; ++k) {
  60. Phonon::EffectParameter param = audiopanorama->parameters()[k];
  61. QVariant currentValue = audiopanorama->parameterValue(param);
  62. audiopanorama->setParameterValue(param, currentValue.toDouble() - 0.1);
  63. }
  64. }
To copy to clipboard, switch view to plain text mode 
audioOutputPath.effects() (in 40) include effect AUDIOPANORAMA ... but no worked .
In '/usr/local/Trolltech/Qt-4.4.0/demo/mediaplayer' all work.
Why ?