Esempio n. 1
0
 def setUp(self):
     self.configObject = readconfig.getConfigObject()
     playerGUI = mock.MagicMock()
     playerGUI.winState = 'fullscreen'
     playerGUI.slide_mode = 5
     self.configObject.setConfig('TEMP', Key='PLAYER', Value=playerGUI)
     self.configObject.setDebug('debugM', 'True')
 def setUp(self):
     self.configObject = readconfig.getConfigObject()
     playerGUI = MagicMock()
     playerGUI.winState = 'fullscreen'
     playerGUI.diaMode = 5
     self.configObject.setConfig('TEMP', Key='PLAYER', Value=playerGUI)
     self.configObject.setDebug('debugM', 'True')
Esempio n. 3
0
def isInMimeTypes(song):
	oConfig = readconfig.getConfigObject()
	debug = oConfig.getConfig('debug', ' ', 'debugM')
	contentType = types.guess_type(song) # Mimetype herausfinden
	if debug : logging.debug("Angegebene Datei ist vom Typ: %s" % (contentType[0]) )
	if contentType[0] in FLAC_MIMES \
	or contentType[0] in OGG_MIMES \
	or contentType[0] in WMA_MIMES \
	or contentType[0] in MPG_MIMES : 
		return True
	else:
		return False
Esempio n. 4
0
def isInMimeTypes(song):
    oConfig = readconfig.getConfigObject()
    debug = oConfig.getConfig('debug', ' ', 'debugM')
    contentType = types.guess_type(song)  # Mimetype herausfinden
    if debug:
        logging.debug("Angegebene Datei ist vom Typ: %s" % (contentType[0]))
    if contentType[0] in FLAC_MIMES \
    or contentType[0] in OGG_MIMES \
    or contentType[0] in WMA_MIMES \
    or contentType[0] in MPG_MIMES :
        return True
    else:
        return False
Esempio n. 5
0
	def __init__(self, ausschalter, hauptschalter):
		super(playerGUI, self).__init__()
		self._ausschalter = ausschalter
		self._hauptschalter = hauptschalter
		pygame.init()
		pygame.key.set_repeat(1, 1)
		# Legt fest, wie oft Tastendruecke automatisch wiederholt werden
		# Das erste Argument gibt an ab wann, das zweite in welchen
		# Intervallen der Tastendruck wiederholt wird
		# self._config = readconfig.getConfigObject()
		self._config = readconfig.getConfigObject()
		self._config.setConfig('TEMP', Key='PLAYER', Value=self)
		bResume = self._config.getConfig('TEMP', Key='RESUME')
		# Erstellt einen Zeitnehmer
		self._gapless = self._config.getConfig('audio_engine', 'audio_engine', 'gapless')
		self._resize = False
		self.diaShowPics = None
		self.timerIndex = 0

		self.replayGain = self._config.getConfig('audio_engine', 'audio_engine', 'replayGain')
		self.set_slide_mode(self._config.getConfig('gui', 'misc', 'showPics'))

		# gstPlayer wird als GTK-thread gestartet
		logging.debug('Trying to start GstPlayer...')
		self._gstPlayer = GstPlayer(ausschalter)
		self._gstPlayer.start()
		logging.debug('Trying to start GstPlayer... done.')
		oPlaylist = self._config.getConfig('TEMP', Key='PLAYLIST')
		self.isPlaylist = oPlaylist.isPlaylist()
		self.playlist = oPlaylist.getPlaylist()
		self.actSong = 0
		if bResume:
			datei = open(LIST_NAME, "r")
			self.actSong = int(datei.read())
			datei.close()
		self.pos = "0"
		self.status = "Stop"
		self.fullscreen = self._config.getConfig('TEMP', Key='FULLSCREEN')
		self.winState = 'window'
		if self.fullscreen: self.winState = 'fullscreen'

		self.init_display()
		self.play_next_song()
		return
Esempio n. 6
0
except:
    pass
try:
    import random
    import logging
    import codecs  # utf8 support
    import StringIO
    from dacapo.config import readconfig
    from dacapo.ui.blitpicture import BlitPicture
except ImportError, err:
    errorhandling.Error.show()
    sys.exit(2)

# ----------- Globale Variablen/Objekte ----------------------- #
HOMEDIR = os.path.expanduser('~')
CONFIG = readconfig.getConfigObject()


class AudioFile(object):
    def __init__(self, filename):
        self.fileOpen = False
        self.syncLyricFile = None
        self.guiPlayer = CONFIG.getConfig('TEMP', Key='PLAYER')
        self.LEERCD = HOMEDIR + '/.dacapo/' + CONFIG.getConfig(
            'gui', 'misc', 'picNoCover')
        self.debug = CONFIG.getConfig('debug', ' ', 'debugM')
        self.mp3Tags = CONFIG.getConfig('gui', 'metaData', 'MP3-Tags')
        self.fileOpen = False
        self.filename = filename
        self.clearTags()
        self.tags = dict()
Esempio n. 7
0
except:
    pass
try:
    import random
    import logging
    import codecs      # utf8 support
    import StringIO
    from dacapo.config import readconfig
    from dacapo.ui.blitpicture import BlitPicture
except ImportError, err:
    errorhandling.Error.show()
    sys.exit(2)

# ----------- Globale Variablen/Objekte ----------------------- #
HOMEDIR = os.path.expanduser('~')
CONFIG = readconfig.getConfigObject()

class AudioFile(object):

	def __init__(self, filename):
		self.fileOpen = False
		self.syncLyricFile = None
		self.guiPlayer = CONFIG.getConfig('TEMP', Key='PLAYER')
		self.LEERCD = HOMEDIR + '/.dacapo/' + CONFIG.getConfig('gui', 'misc', 'picNoCover')
		self.debug = CONFIG.getConfig('debug', ' ', 'debugM')
		self.mp3Tags = CONFIG.getConfig('gui', 'metaData', 'MP3-Tags')
		self.fileOpen = False
		self.filename = filename
		self.clearTags()
		self.tags = dict()
		self.loadFile()
Esempio n. 8
0
	def __init__(self, *args, **kwargs):
		logging.debug(u'Starte...')
		self.config = readconfig.getConfigObject()
		self.counter = 0
		super(SetDacapoLyricFlag, self).__init__(*args, **kwargs)
Esempio n. 9
0
 def setUp(self):
     self.verbosity = 4
     configObject = readconfig.getConfigObject()
     player = mock.MagicMock()
     player.playNextSong.return_value = None
     configObject.setConfig('TEMP', Key='PLAYER', Value=player)
Esempio n. 10
0
 def __init__(self, *args, **kwargs):
     logging.debug(u'Starte...')
     self.config = readconfig.getConfigObject()
     self.counter = 0
     super(SetDacapoLyricFlag, self).__init__(*args, **kwargs)
Esempio n. 11
0
 def setUp(self):
     self.verbosity=4
     configObject = readconfig.getConfigObject()
     player = mock.MagicMock()
     player.playNextSong.return_value = None
     configObject.setConfig('TEMP', Key='PLAYER', Value=player)