本文整理汇总了Python中PyQt4.phonon.Phonon.createPath方法的典型用法代码示例。如果您正苦于以下问题:Python Phonon.createPath方法的具体用法?Python Phonon.createPath怎么用?Python Phonon.createPath使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.phonon.Phonon
的用法示例。
在下文中一共展示了Phonon.createPath方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def __init__(self):
QtGui.QWidget.__init__(self)
self.setGeometry(300, 300, 250, 150)
self.setWindowTitle('VLC_Subs')
# self.setWindowIcon(QtGui.QIcon('\\icon\vlc.ico'))
self.thread = SleepProgress()
self.media = Phonon.MediaObject(self)
self.media.stateChanged.connect(self.handleStateChanged)
self.video = Phonon.VideoWidget(self)
self.video.setMinimumSize(300, 300)
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self)
Phonon.createPath(self.media, self.audio)
Phonon.createPath(self.media, self.video)
if path:
self.media.setCurrentSource(Phonon.MediaSource(path))
self.media.play()
layout = QtGui.QVBoxLayout(self)
self.thread = SleepProgress()
self.nameLabel = QtGui.QLabel("0.0%")
self.nameLine = QtGui.QLineEdit()
self.progressbar = QtGui.QProgressBar()
self.progressbar.setMinimum(1)
self.progressbar.setMaximum(100)
layout.addWidget(self.progressbar)
layout.addWidget(self.nameLabel)
self.thread.partDone.connect(self.updatePBar)
self.thread.procDone.connect(self.fin)
layout.addWidget(self.video, 1)
self.thread.start()
示例2: __init__
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def __init__(self):
QtGui.QPushButton.__init__(self, "Choose File")
self.mediaObject = Phonon.MediaObject(self)
self.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
Phonon.createPath(self.mediaObject, self.audioOutput)
self.mediaObject.stateChanged.connect(self.handleStateChanged)
self.clicked.connect(self.handleButton)
示例3: set_video_player
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def set_video_player(self):
self.mediaObject = Phonon.MediaObject(self.tab_2)
self.videoWidget = Phonon.VideoWidget(self.tab_2)
self.videoWidget.setGeometry(QtCore.QRect(199, 0, 641, 461))
self.videoWidget.setObjectName(_fromUtf8("videoPlayer"))
Phonon.createPath(self.mediaObject, self.videoWidget)
self.audioOutput = Phonon.AudioOutput(Phonon.VideoCategory, self.tab_2)
Phonon.createPath(self.mediaObject, self.audioOutput)
self.metaInformationResolver = Phonon.MediaObject(self.tab_2)
self.mediaObject.setTickInterval(1000)
self.videoWidget.setScaleMode(0)
QtCore.QObject.connect(self.mediaObject, QtCore.SIGNAL('tick(qint64)'),self.tick)
QtCore.QObject.connect(self.mediaObject,QtCore.SIGNAL('stateChanged(Phonon::State, Phonon::State)'),self.stateChanged)
QtCore.QObject.connect(self.metaInformationResolver,QtCore.SIGNAL('stateChanged(Phonon::State, Phonon::State)'),self.metaStateChanged)
QtCore.QObject.connect(self.mediaObject,QtCore.SIGNAL('currentSourceChanged(Phonon::MediaSource)'),self.sourceChanged)
self.setupActions()
# self.setupMenus()
self.setupUi2()
self.timeLcd.display("00:00")
self.video_id = self.videoWidget.winId()
self.source = ''
示例4: __init__
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def __init__(self, parent=None):
QtGui.QMainWindow.__init__(self, parent)
Ui_MainWindow.__init__(self)
# QtGui.QDialog.__init__(self)
self.setupUi(self)
self.songModel = SongModel()
self.initPlaylist()#初始化播放列表
self.player = Phonon.MediaObject()
self.output = Phonon.AudioOutput(Phonon.MusicCategory)
self.player.setCurrentSource(Phonon.MediaSource(self.url))
Phonon.createPath(self.player, self.output)
# Phonon.createPath(self.mediaObject, self.player)
self.player.setTickInterval(1000)
self.player.tick.connect(self.tock)
self.pushButton_play.clicked.connect(self.play_clicked)#播放按钮单击信号
self.player.stateChanged.connect(self.state_changed)#播放状态改变信号
self.player.finished.connect(self.finished)#播放结束信号
# Phonon.SeekSlider(self.player, self)#进度条
# self.seekSlider2 = Phonon.SeekSlider(self)
self.seekSlider2.setMediaObject(self.player)
self.seekSlider2.setTracking(True)
# self.seekSlider2.show()
# self.listWidget.itemSelectionChanged.connect(self.item_changed)#列表选项改变信号
self.listWidget.itemClicked.connect(self.item_clicked)#列表选项点击信号
self.pushButton_open_files.clicked.connect(self.open_files)#打开文件
self.pushButton_open_dir.clicked.connect(self.open_dir)#打开文件夹
self.pushButton_remove.clicked.connect(self.remove_item) #移除当前选中
self.volumeSlider.setAudioOutput(self.output)#音量控制器
self.pushButton_sort.clicked.connect(self.sort)#排序
self.pushButton_search.clicked.connect(self.search_music)#在线歌曲搜索
self.init_btn_enabled()
self.dst = os.path.join(basedir, 'tmp.txt')
示例5: __init__
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def __init__(self, peer, stream_adapter, parent=None):
super(MainWindow, self).__init__(parent)
self.__track_list = TrackModel()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.ui.trackListView.setModel(self.__track_list)
self.ui.trackListView.doubleClicked.connect(self.list_double_clicked)
self.ui.trackListView.clicked.connect(self.list_clicked)
self.ui.searchBtn.clicked.connect(self.search)
self.ui.playBtn.clicked.connect(self.play)
self.ui.stopBtn.clicked.connect(self.stop)
self.ui.pauseBtn.clicked.connect(self.pause)
self.setWindowTitle('Zalgo')
self.__peer = peer
self.__recv_contr = None
self.__stream_adapter = stream_adapter
self.__hashes = []
self.__pid = ''
self.__playing_now = None
self.__audio_output = Phonon.AudioOutput(Phonon.MusicCategory, self)
self.__media_object = Phonon.MediaObject(self)
self.__media_object.setTickInterval(1000)
self.__media_object.stateChanged.connect(self.state_changed)
self.__media_object.tick.connect(self.tick)
self.ui.seekSlider.setMediaObject(self.__media_object)
self.ui.volumeSlider.setAudioOutput(self.__audio_output)
Phonon.createPath(self.__media_object, self.__audio_output)
示例6: __init__
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)
self.layout = QtGui.QVBoxLayout()
self.layout.setContentsMargins(0,0,0,0)
self.setLayout(self.layout)
self.mediaObject = Phonon.MediaObject(self)
self.videoWidget = Phonon.VideoWidget(self)
self.videoWidget.setSizePolicy(QtGui.QSizePolicy.MinimumExpanding, QtGui.QSizePolicy.MinimumExpanding)
self.audioOutput = Phonon.AudioOutput(Phonon.VideoCategory, self)
Phonon.createPath(self.mediaObject, self.videoWidget)
Phonon.createPath(self.mediaObject, self.audioOutput)
self.layout.addWidget(self.videoWidget)
self.toolBar = QtGui.QToolBar()
self.toolBar.setMovable(False)
self.toolBar.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
self.layout.addWidget(self.toolBar)
self.playButton = QtGui.QToolButton()
self.playButton.setText("Play")
self.playButton.clicked.connect(self.play)
self.toolBar.addWidget(self.playButton)
self.pauseButton = QtGui.QToolButton()
self.pauseButton.setText("Pause")
self.pauseButton.clicked.connect(self.pause)
self.toolBar.addWidget(self.pauseButton)
self.seekSlider = Phonon.SeekSlider()
self.seekSlider.setMediaObject(self.mediaObject)
self.toolBar.addWidget(self.seekSlider)
示例7: init
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def init(self):
self.setHasConfigurationInterface(True)
#Get configuration
self.configuration = self.config()
self.launchers = str(self.configuration.readEntry("launchers", self.default_launchers).toString())
self.launchers = pickle.loads(self.launchers)
self.use_fixed_width = (self.configuration.readEntry("use_fixed_width", False).toBool())
self.fixed_width = self.configuration.readEntry("fixed_width", 100).toInt()[0]
self.layout_orientation = self.configuration.readEntry("layout_orientation", Qt.Horizontal).toInt()[0]
self.background_type = self.configuration.readEntry("background_type", "default").toString()
self.show_volume = (self.configuration.readEntry("show_volume", True).toBool())
self.last_volume = (self.configuration.readEntry("last_volume", 75).toInt())[0]
self.use_icons = (self.configuration.readEntry("use_icons", True).toBool())
print self.fixed_width
#basic setup
self.setAspectRatioMode(Plasma.IgnoreAspectRatio)
self.theme = Plasma.Svg(self)
self.theme.setImagePath("widgets/background")
self.set_background()
self.media_object = Phonon.MediaObject(self)
self.active_button= None
self.audio_out = Phonon.AudioOutput(Phonon.MusicCategory, self)
#Add the widgets to the layout
self.refresh_launchers()
self.setLayout(self.mylayout)
self.volume_change(self.last_volume)
self.connect(self.media_object, SIGNAL("metaDataChanged()"), self.update_metadata)
Phonon.createPath(self.media_object, self.audio_out)
示例8: __init__
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def __init__(self):
super(QtGui.QWidget,self).__init__()
self.ui = musicplayerui.Ui_Form()
self.ui.setupUi(self)
self.setWindowFlags(self.windowFlags()|QtCore.Qt.FramelessWindowHint|QtCore.Qt.WindowSystemMenuHint)
#self.setAttribute(QtCore.Qt.WA_NoSystemBackground,True)
self.setAttribute(QtCore.Qt.WA_TranslucentBackground,True)
self.setAttribute(QtCore.Qt.WA_NoSystemBackground,True)
#self.setWindowOpacity(0.2)
self.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory,self)
self.mediaObject = Phonon.MediaObject(self)
self.mediaObject.setTickInterval(1000)
self.mediaObject.stateChanged.connect(self.statechange)
Phonon.createPath(self.mediaObject,self.audioOutput)
self.ui.pb4.setAutoRepeat(True)
self.ui.pb5.setAutoRepeat(True)
self.connect(self.ui.pb1,QtCore.SIGNAL('clicked()'),self.mediaObject.play)
self.connect(self.ui.pb2,QtCore.SIGNAL('clicked()'),self.mediaObject.pause)
self.connect(self.ui.pb3,QtCore.SIGNAL('clicked()'),self.mediaObject.stop)
self.connect(self.ui.pb4,QtCore.SIGNAL('clicked()'),self.volumeup)
self.connect(self.ui.pb5,QtCore.SIGNAL('clicked()'),self.volumedown)
self.ui.volumeSlider.setAudioOutput(self.audioOutput)
self.ui.seekSlider.setMediaObject(self.mediaObject)
示例9: init_music
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def init_music(self):
self.m_media = Phonon.MediaObject(self)
self.m_output = audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
Phonon.createPath(self.m_media, audioOutput)
self.song_playlist = None
self.m_media.aboutToFinish.connect(self.play_next_song)
self.play_next_song()
self.play_pause_music_action = play_pause_music_action = QAction(u"Music", self)
play_pause_music_action.setCheckable(True)
play_pause_music_action.toggled.connect(self.play_pause_music)
self.view_menu.addAction(play_pause_music_action)
play_pause_music_action.setChecked(True)
self.s_media = Phonon.MediaObject(self)
self.s_output = audioOutput = Phonon.AudioOutput(Phonon.GameCategory, self)
Phonon.createPath(self.s_media, audioOutput)
self.__sound_sources = {}
for soundname, soundfile in SOUNDS.items():
self.__sound_sources[soundname] = Phonon.MediaSource(\
resfile('audio/sound/'+ soundfile))
self.sound_action = sound_action = QAction(u"Sound", self)
sound_action.setCheckable(True)
sound_action.toggled.connect(self.mute)
self.__last_s_volume = self.s_output.volume()
sound_action.setChecked(True)
self.view_menu.addAction(sound_action)
示例10: __init__
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def __init__(self, name=None, archivo=None, ruta=None):
super(ReproductorMultimedia, self).__init__()
self.puerto = "COM10"
rutaAbs = os.path.abspath(os.path.curdir)
self.ruta = rutaAbs + ruta
self.carpeta = "Muestras/"
self.setWindowTitle('Reproductor Multimedia')
self.media = Phonon.MediaObject(self)
self.media.stateChanged.connect(self.handleStateChanged)
self.video = Phonon.VideoWidget(self)
self.video.setMinimumSize(800, 400)
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self)
Phonon.createPath(self.media, self.audio)
Phonon.createPath(self.media, self.video)
self.button = QtGui.QPushButton('Reproducir Video', self)
self.button.clicked.connect(self.handleButton)
self.button.setMinimumSize(100, 30)
layout = QtGui.QVBoxLayout(self)
layout.addWidget(self.video, 1)
layout.addWidget(self.button)
self.closeThread = False
self.datos = name
self.nombreArchivo = archivo
self.setWindowIcon(QtGui.QIcon('Icon/icon.jpg'))
self.show()
示例11: init_tanooki
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def init_tanooki():
global audioOutput
global mediaObject
audioOutput = Phonon.AudioOutput(Phonon.MusicCategory)
mediaObject = Phonon.MediaObject()
mediaObject.setTickInterval(1000)
Phonon.createPath(mediaObject, audioOutput)
示例12: openMultimedia
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def openMultimedia(self):
if self.controller.audio_dir:
pass
else:
self.controller.audio_dir = tempfile.mkdtemp(prefix="VTAudio")
tmp_dir = os.path.join(self.controller.audio_dir, "audio")
if os.path.isdir(tmp_dir) == True:
pass
else:
os.mkdir(os.path.join(self.controller.audio_dir, "audio"))
self.audioMedia = Phonon.MediaObject()
self.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory)
Phonon.createPath(self.audioMedia, self.audioOutput)
self.paused = False
self.filename = QtGui.QFileDialog.getOpenFileName(self, 'Open File',
'/', "Music (*.mp3 *.wav *.ogg *.mpc *.flac *.au *.raw *.dct *.aac *.m4a *.wma *.amr *.awb)")
if self.filename != "":
bname = os.path.basename(str(self.filename))
fbasename, fextension = os.path.splitext(bname)
fd, temp_fname = tempfile.mkstemp(suffix=fextension, prefix="VTAudio", dir=tmp_dir)
os.close(fd)
self.file = open(self.filename, 'r')
shutil.copyfile(self.filename, temp_fname)
self.audio_filename = temp_fname
self.fname = os.path.basename(temp_fname)
self.controller.setAudioMediaObject(self.audioMedia)
self.controller.update_audio(self.fname)
示例13: RunGoal
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def RunGoal(self, goal=None, gwp=None):
if goal is None or gwp is None: return
message = "Goal: "+str(goal.title)+"\nFinished: "+str( self._currentDateTime().toString() )+"\nStarted: "+str(goal.registeredTime.toString())+"\nDT: "+str(goal.seconds)+" milliseconds"
print "Running Goal",message,"\n"
if goal.imagePath != "":
splashPix = QtGui.QPixmap(goal.imagePath)
else:
splashPix = QtGui.QPixmap("No_Image_Available.png")
if splashPix.isNull():
print "Null pix, avoiding creating a splashscreen"
else:
splash = ExtraSplashScreen(splashPix, QtCore.Qt.WindowStaysOnTopHint)
splash.setMask( splashPix.mask() )
splash.show()
if goal.mp3Path != "":
mediaSource = Phonon.MediaSource(goal.mp3Path)
mediaObject = Phonon.MediaObject(self)
audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
Phonon.createPath(mediaObject, audioOutput)
mediaObject.setCurrentSource(mediaSource)
splash.shown.connect(mediaObject.play)
splash.hidden.connect(mediaObject.stop)
self.splashes.append(splash)
splash.hidden.connect(lambda : self._cleanupSplashScreen(splash) )
self.RemoveGoalWidgetPart(gwp, goal)
示例14: __init__
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def __init__(self):
QtGui.QWidget.__init__(self)
# media
self.media = Phonon.MediaObject(self)
self.media.stateChanged.connect(self.handleStateChanged)
self.video = Phonon.VideoWidget(self)
self.video.setMinimumSize(200, 200)
self.audio = Phonon.AudioOutput(Phonon.VideoCategory, self)
Phonon.createPath(self.media, self.audio)
Phonon.createPath(self.media, self.video)
# control button
self.button = QtGui.QPushButton('选择文件', self)
self.button.clicked.connect(self.handleButton)
# for display of time lapse
self.info = QtGui.QLabel(self)
# layout
layout = QtGui.QGridLayout(self)
layout.addWidget(self.video, 1, 1, 3, 3)
layout.addWidget(self.info, 4, 1, 1, 3)
layout.addWidget(self.button, 5, 1, 1, 3)
# signal-slot, for time lapse
self.thread = PollTimeThread(self)
self.thread.update.connect(self.update)
示例15: initUI
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import createPath [as 别名]
def initUI(self):
self.setWindowTitle("zTunes")
self.mediaObject = Phonon.MediaObject()
audioOutput = Phonon.AudioOutput(Phonon.MusicCategory, self)
Phonon.createPath(self.mediaObject, audioOutput)
self.mainToolBar = QtGui.QToolBar("Main Toolbar")
self.mainToolBar.setStyleSheet("QToolBar { background: palette(window); border-bottom: 1px solid palette(shadow); }")
self.mainToolBar.setMovable(False)
self.mainToolBar.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
changeSourceAction = QtGui.QAction(QtGui.QIcon().fromTheme("document-open"), "Change current source...", self)
changeSourceAction.triggered.connect(self.changeSource)
seekBackwardAction = QtGui.QAction(QtGui.QIcon().fromTheme("media-seek-backward"), "Seek backward", self)
seekBackwardAction.triggered.connect(self.seekBackward)
seekBackwardAction.setShortcut("Left")
self.togglePlayPauseAction = QtGui.QAction(QtGui.QIcon().fromTheme("media-playback-start"), "Play/Pause", self)
self.togglePlayPauseAction.setCheckable(True)
self.togglePlayPauseAction.triggered.connect(self.togglePlayPause)
seekForwardAction = QtGui.QAction(QtGui.QIcon().fromTheme("media-seek-forward"), "Seek backward", self)
seekForwardAction.triggered.connect(self.seekForward)
seekForwardAction.setShortcut("Right")
seekAction = QtGui.QAction(QtGui.QIcon().fromTheme("go-jump"), "Seek...", self)
seekAction.triggered.connect(self.seek)
self.mainToolBar.addAction(changeSourceAction)
self.mainToolBar.addAction(seekBackwardAction)
self.mainToolBar.addAction(self.togglePlayPauseAction)
self.mainToolBar.addAction(seekForwardAction)
self.mainToolBar.addAction(seekAction)
self.addToolBar(self.mainToolBar)