aboutsummaryrefslogtreecommitdiffstats
path: root/doc/codesnippets/doc/src/snippets/code
diff options
context:
space:
mode:
authorChristian Tismer <ctismer@gmail.com>2015-07-04 16:25:13 +0200
committerChristian Tismer <ctismer@gmail.com>2015-07-04 16:25:13 +0200
commit5d15b87de6fb45367a46dd25a8a95822f6a9c635 (patch)
tree5daf706d99a6e1c40096ef9fce1747d91c320889 /doc/codesnippets/doc/src/snippets/code
parentde09fdd1a317bd57f6cb3ff104c5b6a6a7b782fc (diff)
remove all traces of phonon
Diffstat (limited to 'doc/codesnippets/doc/src/snippets/code')
-rw-r--r--doc/codesnippets/doc/src/snippets/code/doc_src_phonon-api.qdoc192
1 files changed, 0 insertions, 192 deletions
diff --git a/doc/codesnippets/doc/src/snippets/code/doc_src_phonon-api.qdoc b/doc/codesnippets/doc/src/snippets/code/doc_src_phonon-api.qdoc
deleted file mode 100644
index 3f0771e37..000000000
--- a/doc/codesnippets/doc/src/snippets/code/doc_src_phonon-api.qdoc
+++ /dev/null
@@ -1,192 +0,0 @@
-//! [0]
-class PushStream (AbstractMediaStream):
- def __init__(self, parent = None):
- AbstractMediaStream.__init(self, parent)
- self.timer = QTimer(self)
- self.setStreamSize(self.getMediaStreamSize())
-
- self.timer.timeout.connect(self.moreData)
- self.timer.setInterval(0)
-
- @Slot()
- def moreData(self):
- data = self.getMediaData()
- if data.isEmpty():
- self.endOfData()
- else:
- self.writeData(data)
-
- def needData(self):
- self.timer.start()
- self.moreData()
-
- def enoughData(self):
- self.timer.stop()
-//! [0]
-
-
-//! [1]
-class PushStream (AbstractMediaStream):
- def __init__(self, parent = None):
- AbstractMediaStream.__init(self, parent)
- self.setStreamSize(self.getMediaStreamSize())
-
- @Slot()
- def needData(self):
- data = self.getMediaData()
- if data.isEmpty():
- self.endOfData()
- else:
- self.writeData(data)
-//! [1]
-
-
-//! [2]
-self.seekStream(0)
-//! [2]
-
-
-//! [3]
-m = MediaObject()
-fileName = "/home/foo/bar.ogg"
-url = QUrl("http://www.example.com/stream.mp3")
-someBuffer = QBuffer()
-m.setCurrentSource(fileName)
-m.setCurrentSource(url)
-m.setCurrentSource(someBuffer)
-m.setCurrentSource(Phonon.Cd)
-//! [3]
-
-
-//! [4]
-player = VideoPlayer(Phonon.VideoCategory, parentWidget)
-player.finished.connect(player.deleteLater)
-player.play(url)
-//! [4]
-
-
-//! [5]
-audioPlayer.load(url)
-audioPlayer.play()
-//! [5]
-
-
-//! [6]
-media = MediaObject(self)
-media.finished.connect(self.slotFinished)
-media.setCurrentSource("/home/username/music/filename.ogg")
-
-# ...
-
-media.play()
-//! [6]
-
-
-//! [7]
-media.setCurrentSource(":/sounds/startsound.ogg")
-media.enqueue("/home/username/music/song.mp3")
-media.enqueue(":/sounds/endsound.ogg")
-//! [7]
-
-
-//! [8]
- media.setCurrentSource(":/sounds/startsound.ogg")
- media.aboutToFinish.connect(lambda : media.enqueue("/home/username/music/song.mp3"))
-//! [8]
-
-
-//! [9]
-x = 200
-media.setTickInterval(x)
-assert(x == producer.tickInterval())
-//! [9]
-
-
-//! [10]
-x = 200
-media.setTickInterval(x)
-assert(x >= producer.tickInterval() and x <= * producer.tickInterval())
-//! [10]
-
-
-//! [11]
-//! [12]
- self.media.hasVideoChanged[bool].connect(hasVideoChanged)
- self.media.setCurrentSource("somevideo.avi")
- self.media.hasVideo() # returns false
-
- @Slot(bool)
- def hasVideoChanged(self, b):
- # b == true
- media.hasVideo() # returns true
-//! [12]
-//! [11]
-
-//! [13]
-self.setMetaArtist(media.metaData("ARTIST"))
-self.setMetaAlbum(media.metaData("ALBUM"))
-self.setMetaTitle(media.metaData("TITLE"))
-self.setMetaDate(media.metaData("DATE"))
-self.setMetaGenre(media.metaData("GENRE"))
-self.setMetaTrack(media.metaData("TRACKNUMBER"))
-self.setMetaComment(media.metaData("DESCRIPTION"))
-//! [13]
-
-
-//! [14]
-url = QUrl("http://www.example.com/music.ogg")
-media.setCurrentSource(url)
-//! [14]
-
-
-//! [15]
-progressBar.setRange(0, 100) # this is the default
-self.media.bufferStatus[int].connect(progressBar.setValue)
-//! [15]
-
-
-//! [16]
-BackendCapabilities.notifier.capabilitiesChanged.connect(...)
-//! [16]
-
-
-//! [17]
-cb = QComboBox(parentWidget)
-model = ObjectDescriptionModel(cb)
-model.setModelData(BackendCapabilities.availableAudioOutputDevices())
-cb.setModel(model)
-cb.setCurrentIndex(0) # select first entry
-//! [17]
-
-
-//! [18]
-cbIndex = cb.currentIndex()
-selectedDevice = model.modelData(cbIndex)
-//! [18]
-
-
-//! [19]
-path = Phonon.createPath(...)
-effect = Effect(this)
-path.insertEffect(effect)
-//! [19]
-
-
-//! [20]
-media = MediaObject()
-output = AudioOutput(Phonon.MusicCategory)
-path = Phonon.createPath(media, output)
-assert(path.isValid()) # for this simple case the path should always be
- # valid - there are unit tests to ensure it
-# insert an effect
-effectList = BackendCapabilities.availableAudioEffects()
-if effectList:
- effect = path.insertEffect(effectList[0])
-//! [20]
-
-
-//! [21]
-media = MediaObject(parent)
-vwidget = VideoWidget(parent)
-Phonon.createPath(media, vwidget)
-//! [21]