The source file, AudioPlayerDialog.py
, used in the earlier section will be used here as well. The class AudioPlayerDialog
inherits QMainWindow
.
If you have not done so already, download the Python source file
AudioPlayerDialog.py
.Let's start with the constructor of the class,
AudioPlayerDialog
.1 def __init__(self): 2 QMainWindow.__init__(self) 3 self.mediaSource = None 4 self.audioPath = '' 5 self.addedEffects = {} 6 self.effectsDict = {} 7 8 # Initialize some other variables. 9 self._filePath = '' 10 self._dirPath = '' 11 self._dialog = None 12 # Create media object , audio sink and path 13 self.mediaObj = phonon.Phonon.MediaObject(self) 14 self.audioSink = Phonon.AudioOutput( 15 Phonon.MusicCategory, 16 self) 17 self.audioPath = Phonon.createPath(self.mediaObj, 18 self.audioSink...