Пример #1
0
 def setWindowTitleFile(self, fileName):
     parent = self.parent()
     if parent:
         parent.setWindowIcon(QtGui.QIcon(resources.fetch("tapeRecorder48.png")))
         parent.setWindowTitle(self.titleMixMaster + fileName)
     else:
         self.setWindowIcon(QtGui.QIcon(resources.fetch("tapeRecorder48.png")))
         self.setWindowTitle(self.titleMixMaster + fileName)
Пример #2
0
    def __init__(self, parent, prefSaver, thumbTmpRoot):
        QtGui.QWidget.__init__(self, parent)
        self.setupUi(self)

        self.tableView = SceneTree(self, thumbTmpRoot = thumbTmpRoot)
        self.tableView.setupData()
        self.tableView.setFrameShape(QtGui.QFrame.NoFrame)

        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(self.tableView)
        vbox.setMargin(0)
        self.playListContainer.setLayout(vbox)

        # set the icons
        self.cmdAddSource.setIcon(QtGui.QIcon(resources.fetch("add.png")))
        self.cmdAddSource.setText("")
        self.cmdAddVariantSource.setIcon(QtGui.QIcon(resources.fetch("subadd.png")))
        self.cmdAddVariantSource.setText("")
        self.cmdRemoveSource.setIcon(QtGui.QIcon(resources.fetch("remove.png")))
        self.cmdRemoveSource.setText("")
        self.cmdClearPlaylist.setIcon(QtGui.QIcon(resources.fetch("clearPage.png")))
        self.cmdClearPlaylist.setText("")
        self.cmdMoveSourceUp.setIcon(QtGui.QIcon(resources.fetch("up.png")))
        self.cmdMoveSourceUp.setText("")
        self.cmdMoveSourceDown.setIcon(QtGui.QIcon(resources.fetch("down.png")))
        self.cmdMoveSourceDown.setText("")
        self.cmdEditSource.setIcon(QtGui.QIcon(resources.fetch("pencil.png")))
        self.cmdEditSource.setText("")
        self.cmdSetDefaultPad.setIcon(QtGui.QIcon(resources.fetch("apply.png")))
        self.cmdSetDefaultPad.setText("")
        self.cmdPublish.setIcon(QtGui.QIcon(resources.fetch("publish.png")))
        self.cmdApplyPad.setIcon(QtGui.QIcon(resources.fetch("apply.png")))
        self.cmdApplyPad.setText("")
        self.cmdHelp.setIcon(QtGui.QIcon(resources.fetch("help.png")))
        self.cmdHelp.setText("")
        self.cmdSavePlaylist.setIcon(QtGui.QIcon(resources.fetch("saveFile.png")))
        self.lblMixMasterIcon.setPixmap(QtGui.QPixmap(resources.fetch("tapeRecorder32.png")))
        self.cmdPlay.setIcon(QtGui.QIcon(resources.fetch("play.png")))
        self.cmdImportPlaylist.setIcon(QtGui.QIcon(resources.fetch("page_lightning.png")))
        self.cmdCloseEditSourcePanel.setIcon(QtGui.QIcon(resources.fetch("close.png")))

        self.cmdAddVariantSource.setEnabled(False)

        self.cmdImportPlaylist.setFocus()
        # show the edit source by default
        self.pnlEditSource.hide()
        self.clearSourceEditPanel()

        version = os.environ["MIXMASTER_VERSION"] if os.environ.has_key("MIXMASTER_VERSION") else ""
        self.titleMixMaster = "Mix Master - %s : " % version
        self.setWindowTitleFile("")

        self.connect (  self.tableView,
                QtCore.SIGNAL("frameScrubChange"),
                self.syncFrameScrubChange)

        self.connect (  self.tableView,
                QtCore.SIGNAL("frameScrubFinish"),
                self.handleFrameScrubFinish)

        self.connect (  self.cmdEditAudioPrompt,
                QtCore.SIGNAL("clicked()"),
                self.handleEditAudioPrompt)

        self.connect (  self.cmdClearPlaylist,
                QtCore.SIGNAL("clicked()"),
                self.clearPlaylist)

        self.connect (  self.cmdAddSource,
                QtCore.SIGNAL("clicked()"),
                self.handleAddSource)

        self.connect (  self.cmdRemoveSource,
                QtCore.SIGNAL("clicked()"),
                self.removeSource)

        self.connect (  self.cmdMoveSourceUp,
                QtCore.SIGNAL("clicked()"),
                self.moveSourceUp)

        self.connect (  self.cmdMoveSourceDown,
                QtCore.SIGNAL("clicked()"),
                self.moveSourceDown)

        self.connect ( self.cmdEditSource,
                QtCore.SIGNAL("clicked()"),
                self.editSource
                       )

        self.connect ( self.cmdCloseEditSourcePanel,
                QtCore.SIGNAL("clicked()"),
                self.closeEditSource
                       )

        self.connect ( self.cmdEditSourcePrompt,
                QtCore.SIGNAL("clicked()"),
                self.handleEditSourcePrompt
                       )

        self.connect ( self.cmdAudioSource,
                QtCore.SIGNAL("clicked()"),
                self.handleEditAudioSource
                       )

        self.connect ( self.tableView,
                QtCore.SIGNAL("sourceSelectionChanged"),
                self.handleShotSelectionChanged
                       )

        self.connect ( self.tableView,
                QtCore.SIGNAL("sourceCellClicked"),
                self.handleCellSelectionChanged
                       )

        self.connect ( self.tableView,
                QtCore.SIGNAL("sourceEditTrigger"),
                self.playlistEditTrigger
                       )

        self.connect ( self.spnStart,
                QtCore.SIGNAL("valueChanged (int)"),
                self.syncSourceEditPanelToSelection
                       )

        self.connect ( self.spnEnd,
                QtCore.SIGNAL("valueChanged (int)"),
                self.syncSourceEditPanelToSelection
                       )

        self.connect ( self.spnPerShotAudioOffset,
                QtCore.SIGNAL("valueChanged (int)"),
                self.syncSourceEditPanelToSelection
                       )

        self.connect ( self.spnHeadHold,
                QtCore.SIGNAL("valueChanged (int)"),
                self.syncSourceEditPanelToSelection
                       )

        self.connect ( self.spnTailHold,
                QtCore.SIGNAL("valueChanged (int)"),
                self.syncSourceEditPanelToSelection
                       )

        self.connect ( self.cmdApplyPad,
                QtCore.SIGNAL("clicked()"),
                self.applyFramePadding
                       )

        self.connect ( self.cmdSetDefaultPad,
                QtCore.SIGNAL("clicked()"),
                self.setDefaultPad
                       )

        self.connect ( self.cmdHelp,
                       QtCore.SIGNAL("clicked()"),
                       self.showHelp
                       )

        # state data
        self.stateTankVersionChanging = False
        self.stateSyncing = False
        self.cmdPublish.hide()

        # create the preference saver
        if prefSaver == None:
            self.pref = guiPrefSaver.QtGuiPreference("/tmp/mixMaster.conf")
        else:
            self.pref = prefSaver

        # save the text
        self.pref.bootstrapWidget (  widget      = self.lblDefaultPad,
                                     widgetName  = "defaultFramePadding",
                                     widgetType  =  guiPrefSaver.TEXTBOX
                                     )

        self.pref.bootstrapWidget (  widget      = self.chkUseFrameNum,
                                     widgetName  = "repectFrameNumber",
                                     widgetType  =  guiPrefSaver.CHECKBOX
                                     )

        # save the dialog position and size
        self.pref.bootstrapWidget (  widget      = self,
                                     widgetName  = "dialog window",
                                     widgetType  = guiPrefSaver.WINDOW,
                                     defaultValue = "119;76;1250;921"
                                     )

        # when dialog close, call the save preference function
        self.connect(self,
                     QtCore.SIGNAL("finished (int)"),
                     self.savePref
                     )
Пример #3
0
import os, sys, traceback
import subprocess

from PyQt4 import QtCore, QtGui, uic
import tank

import drGadgets.lib.qtGuiPreference as guiPrefSaver

import resources
from SceneTree import SceneTree

from rv_tools.util import get_frame_sequence_source

Ui_MixMasterMain = uic.loadUiType(resources.fetch("MixMasterGui.ui"))[0]

class MixMasterGui(Ui_MixMasterMain, QtGui.QWidget):
    '''
    The main panel for mix master
    '''
    def __init__(self, parent, prefSaver, thumbTmpRoot):
        QtGui.QWidget.__init__(self, parent)
        self.setupUi(self)

        self.tableView = SceneTree(self, thumbTmpRoot = thumbTmpRoot)
        self.tableView.setupData()
        self.tableView.setFrameShape(QtGui.QFrame.NoFrame)

        vbox = QtGui.QVBoxLayout()
        vbox.addWidget(self.tableView)
        vbox.setMargin(0)
        self.playListContainer.setLayout(vbox)