C++ (Qt)QList<Phonon::AudioChannelDescription> audchan = m_controller->availableAudioChannels();m_controller->setCurrentAudioChannel(&audchan[1]);
C++ (Qt)void MediaPlayer::setFile(const QString &fileName){ setWindowTitle(fileName.right(fileName.length() - fileName.lastIndexOf('/') - 1)); m_MediaObject.setCurrentSource(Phonon::MediaSource(fileName)); m_MediaObject.play(); m_controller = new Phonon::MediaController(&m_MediaObject); QList<Phonon::AudioChannelDescription> audchan = m_controller->availableAudioChannels(); m_controller->setCurrentAudioChannel(audchan[1]);}
C++ (Qt)Phonon::MediaController *m_controller;
C++ (Qt)void MediaPlayer::setFile(const QString &fileName){ setWindowTitle(fileName.right(fileName.length() - fileName.lastIndexOf('/') - 1)); m_MediaObject.setCurrentSource(Phonon::MediaSource(fileName)); m_MediaObject.play(); m_controller = new Phonon::MediaController(&m_MediaObject); connect(m_controller, SIGNAL(availableAudioChannelsChanged()), this, SLOT(selectAudio()));} void MediaPlayer::selectAudio(){ QList<Phonon::AudioChannelDescription> audchan = m_controller->availableAudioChannels(); m_controller->setCurrentAudioChannel(audchan[1]);}