本文整理汇总了Python中PySide.phonon.Phonon.createPlayer方法的典型用法代码示例。如果您正苦于以下问题:Python Phonon.createPlayer方法的具体用法?Python Phonon.createPlayer怎么用?Python Phonon.createPlayer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.phonon.Phonon
的用法示例。
在下文中一共展示了Phonon.createPlayer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: play_sound_helper
# 需要导入模块: from PySide.phonon import Phonon [as 别名]
# 或者: from PySide.phonon.Phonon import createPlayer [as 别名]
def play_sound_helper(self, sound_file, sound_loop, sound_loop_times):
self.media = Phonon.createPlayer(Phonon.MusicCategory, Phonon.MediaSource(sound_file))
if sound_loop_times > 0 and sound_loop:
for i in range(sound_loop_times):
self.media.enqueue(Phonon.MediaSource(sound_file))
self.media.play()
示例2: __init__
# 需要导入模块: from PySide.phonon import Phonon [as 别名]
# 或者: from PySide.phonon.Phonon import createPlayer [as 别名]
def __init__(self, modem):
super(ModemIndicator, self).__init__()
self._modem = modem
self.signalLevelChanged(0)
menu = self.createMenu()
self.setContextMenu(menu)
self.player = Phonon.createPlayer(Phonon.MusicCategory)
self.player.stateChanged.connect(self._playerLog)
示例3: __init__
# 需要导入模块: from PySide.phonon import Phonon [as 别名]
# 或者: from PySide.phonon.Phonon import createPlayer [as 别名]
def __init__(self):
QtGui.QMainWindow.__init__(self)
# Cargo el archivo con los elementos graficos
loader = QtUiTools.QUiLoader()
self.ui = loader.load("p.ui")
# Abro la ventana
self.ui.show()
# Creo un reproductor de tipo musica
self.player = Phonon.createPlayer(Phonon.MusicCategory)
# Conecto los eventos
self.connect(self.ui.btnPlay, QtCore.SIGNAL("clicked()"), self.play)
self.connect(self.ui.btnPause, QtCore.SIGNAL("clicked()"), self.pause)
self.connect(self.player, QtCore.SIGNAL("metaDataChanged()"), self.metaData)
示例4: __init__
# 需要导入模块: from PySide.phonon import Phonon [as 别名]
# 或者: from PySide.phonon.Phonon import createPlayer [as 别名]
def __init__(self):
super(Window, self).__init__()
icon = get_icon(ICONS_DIR, ICON_NAME)
self.player = Phonon.createPlayer(Phonon.NoCategory, get_sound(SOUNDS_DIR, SOUND_NAME))
self.setWindowIcon(icon)
self.setWindowTitle(APP_NAME)
self.load_config()
self.tomato_bar = QProgressBar(self)
self.tomato_bar.setMaximum(self.tomato_duration)
self.tomato_bar.setFormat(BAR_FORMAT)
self.break_bar = QProgressBar(self)
self.break_bar.setMaximum(self.break_duration)
self.break_bar.setFormat(BAR_FORMAT)
self.break_bar.hide()
self.tomato_button = QPushButton(TOMATO_BUTTON_TEXT, self)
self.tomato_button.clicked.connect(self.start_tomato)
self.break_button = QPushButton(BREAK_BUTTON_TEXT, self)
self.break_button.clicked.connect(self.start_break)
layout = QHBoxLayout(self)
layout.addWidget(self.tomato_bar)
layout.addWidget(self.break_bar)
layout.addWidget(self.tomato_button)
layout.addWidget(self.break_button)
self.setLayout(layout)
self.tomato_timer = QTimer()
self.tomato_timer.timeout.connect(partial(self.increment_bar, self.tomato_bar, self.finish_tomato))
self.break_timer = QTimer()
self.break_timer.timeout.connect(partial(self.increment_bar, self.break_bar, self.finish_break))
self.tray = QSystemTrayIcon(icon, self)
self.tray.activated.connect(self.try_toogle_show)
self.tray.show()