Sorry about this guys but I'm apparently not doing something right with
the SVN DIFF thing. Give me time, I'll get it.
I guess it's better to send patches here than not at all, right?
Updating to 1.8.0rc1 showed some interesting oversights on my part with
the sixmixer plugin. I've attached a patch to correct the bugs and add
new portions of code. Seems to work OK with 1.8.0 and 1.7.5.
As part of fixing the sixmixer plugin, I added code to several of the
TV plugins and one Audio plugin to detect and ignore certain mixer
calls when sixmixer is in use. The patches for those individual files
are attached.
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping
diff -Naur ./freevo-1.8.0rc1/src/plugins/sixmixer.py ./freevo-1.8.0rc1_MODIFIED/src/plugins/sixmixer.py
--- ./freevo-1.8.0rc1/src/plugins/sixmixer.py 2007-11-23 14:42:18.000000000 -0500
+++ ./freevo-1.8.0rc1_MODIFIED/src/plugins/sixmixer.py 2007-12-24 00:15:38.000000000 -0500
@@ -2,7 +2,7 @@
# -----------------------------------------------------------------------
# sixmixer.py - A 6-channel volume control interface for freevo.
# -----------------------------------------------------------------------
# $Id: sixmixer.py 10156 2007-11-23 19:42:18Z duncan $
#
# Description:
# Six-channel audio control for the Freevo Media Center Environment
@@ -24,7 +24,12 @@
# Usage: Simply add the following lines to your local_conf.py:
# plugin.remove('mixer')
# plugin.activate('sixmixer')
-# plugin.activate('idlebar.sixvolume')
+# EVENTS['global']['1'] = Event('SUR_VOLUP', arg=5)
+# EVENTS['global']['4'] = Event('SUR_VOLDOWN', arg=5)
+# EVENTS['global']['2'] = Event('CTR_VOLUP', arg=5)
+# EVENTS['global']['5'] = Event('CTR_VOLDOWN', arg=5)
+# EVENTS['global']['3'] = Event('LFE_VOLUP', arg=5)
+# EVENTS['global']['6'] = Event('LFE_VOLDOWN', arg=5)
#
# -----------------------------------------------------------------------
# Freevo - A Home Theater PC framework
@@ -74,6 +79,10 @@
self.surVolume = 0
self.ctrVolume = 0
self.lfeVolume = 0
+ self.lineinVolume = 0 # Used on BTTV cards for audio input
+ self.micVolume = 0 # Used on BTTV cards for audio input
+ self.igainVolume = 0 # XXX Used on SB Live
+ self.ogainVolume = 0 # XXX Ditto
self.NoAdjust = 0
self.CalcVol = 0
self.VolSpan = 0
@@ -82,11 +91,11 @@
self.StepFactor = 0
self.CalcVolList = []
- self.setMainVolume(config.MAX_VOLUME)
- self.setPcmVolume(config.DEFAULT_PCM_VOLUME)
- self.setSurVolume(config.DEFAULT_SUR_VOLUME)
- self.setCtrVolume(config.DEFAULT_CTR_VOLUME)
- self.setLfeVolume(config.DEFAULT_LFE_VOLUME)
+ self.setMainVolume(config.MIXER_VOLUME_MAX)
+ self.setPcmVolume(config.MIXER_VOLUME_DFLT_PCM)
+ self.setSurVolume(config.MIXER_VOLUME_DFLT_SUR)
+ self.setCtrVolume(config.MIXER_VOLUME_DFLT_CTR)
+ self.setLfeVolume(config.MIXER_VOLUME_DFLT_LFE)
def eventhandler(self, event = None, menuw=None, arg=None):
@@ -115,32 +124,32 @@
self.ShowVolume(event.arg)
return True
- elif event == SUR_VOLUP:
+ elif event == MIXER_SUR_VOLUP:
self.incSurVolume(event.arg)
rc.post_event(Event(OSD_MESSAGE, arg=_('Surround: %s%%') % self.getSurVolume()))
return True
- elif event == SUR_VOLDOWN:
+ elif event == MIXER_SUR_VOLDOWN:
self.decSurVolume(event.arg)
rc.post_event(Event(OSD_MESSAGE, arg=_('Surround: %s%%') % self.getSurVolume()))
return True
- elif event == CTR_VOLUP:
+ elif event == MIXER_CTR_VOLUP:
self.incCtrVolume(event.arg)
rc.post_event(Event(OSD_MESSAGE, arg=_('Center: %s%%') % self.getCtrVolume()))
return True
- elif event == CTR_VOLDOWN:
+ elif event == MIXER_CTR_VOLDOWN:
self.decCtrVolume(event.arg)
rc.post_event(Event(OSD_MESSAGE, arg=_('Center: %s%%') % self.getCtrVolume()))
return True
- elif event == LFE_VOLUP:
+ elif event == MIXER_LFE_VOLUP:
self.incLfeVolume(event.arg)
rc.post_event(Event(OSD_MESSAGE, arg=_('LFE: %s%%') % self.getLfeVolume()))
return True
- elif event == LFE_VOLDOWN:
+ elif event == MIXER_LFE_VOLDOWN:
self.decLfeVolume(event.arg)
rc.post_event(Event(OSD_MESSAGE, arg=_('LFE: %s%%') % self.getLfeVolume()))
return True
@@ -289,15 +298,99 @@
self.NoAdjust = 1
self._setVolume('Center', self.ctrVolume, 'unmute')
+ def getIgainVolume(self):
+ return self.igainVolume
+
+ def setIgainVolume(self, volume):
+ self.ctrVolume = volume
+ self._setVolume('Igain', self.igainVolume, 'unmute')
+
+ def incIgainVolume(self, step=5):
+ self.igainVolume += step
+ if self.igainVolume >= 100:
+ self.igainVolume = 100
+ self.NoAdjust = -1
+ self._setVolume('Igain', self.igainVolume, 'unmute')
+
+ def decIgainVolume(self, step=5):
+ self.igainVolume -= step
+ if self.igainVolume <= 0:
+ self.igainVolume = 0
+ self.NoAdjust = 1
+ self._setVolume('Igain', self.igainVolume, 'unmute')
+
+ def getOgainVolume(self):
+ return self.ogainVolume
+
+ def setOgainVolume(self, volume):
+ self.ogainVolume = volume
+ self._setVolume('Ogain', self.ogainVolume, 'unmute')
+
+ def incOgainVolume(self, step=5):
+ self.ogainVolume += step
+ if self.ogainVolume >= 100:
+ self.ogainVolume = 100
+ self.NoAdjust = -1
+ self._setVolume('Ogain', self.ogainVolume, 'unmute')
+
+ def decOgainVolume(self, step=5):
+ self.ogainVolume -= step
+ if self.ogainVolume <= 0:
+ self.ogainVolume = 0
+ self.NoAdjust = 1
+ self._setVolume('Ogain', self.ogainVolume, 'unmute')
+
+ def getMicVolume(self):
+ return self.ctrVolume
+
+ def setMicVolume(self, volume):
+ self.micVolume = volume
+ self._setVolume('Mic', self.micVolume, 'unmute')
+
+ def incMicVolume(self, step=5):
+ self.micVolume += step
+ if self.micVolume >= 100:
+ self.micVolume = 100
+ self.NoAdjust = -1
+ self._setVolume('Mic', self.micVolume, 'unmute')
+
+ def decMicVolume(self, step=5):
+ self.micVolume -= step
+ if self.micVolume <= 0:
+ self.micVolume = 0
+ self.NoAdjust = 1
+ self._setVolume('Mic', self.micVolume, 'unmute')
+
+ def getLineinVolume(self):
+ return self.lineinVolume
+
+ def setLineinVolume(self, volume):
+ self.lineinVolume = volume
+ self._setVolume('Line', self.lineinVolume, 'unmute')
+
+ def incLineinVolume(self, step=5):
+ self.lineinVolume += step
+ if self.lineinVolume >= 100:
+ self.lineinVolume = 100
+ self.NoAdjust = -1
+ self._setVolume('Line', self.lineinVolume, 'unmute')
+
+ def decLineinVolume(self, step=5):
+ self.lineinVolume -= step
+ if self.lineinVolume <= 0:
+ self.lineinVolume = 0
+ self.NoAdjust = 1
+ self._setVolume('Line', self.lineinVolume, 'unmute')
+
def reset(self):
- self.setMainVolume(config.MAX_VOLUME)
- self.setPcmVolume(config.DEFAULT_PCM_VOLUME)
- self.setSurVolume(config.DEFAULT_SUR_VOLUME)
- self.setCtrVolume(config.DEFAULT_CTR_VOLUME)
- self.setLfeVolume(config.DEFAULT_LFE_VOLUME)
+ self.setMainVolume(config.MIXER_VOLUME_MAX)
+ self.setPcmVolume(config.MIXER_VOLUME_DFLT_PCM)
+ self.setSurVolume(config.MIXER_VOLUME_DFLT_SUR)
+ self.setCtrVolume(config.MIXER_VOLUME_DFLT_CTR)
+ self.setLfeVolume(config.MIXER_VOLUME_DFLT_LFE)
def CalcVolume(self, step=5):
- # Create a lis of our volumes
+ # Create a list of our volumes
self.CalcVolList = [self.getPcmVolume(),self.getSurVolume(),self.getCtrVolume(),self.getLfeVolume()]
# Sort from low to high
self.CalcVolList.sort()
diff -Naur ./freevo-1.8.0rc1/src/tv/plugins/ivtv_xine_tv.py ./freevo-1.8.0rc1_MODIFIED/src/tv/plugins/ivtv_xine_tv.py
--- ./freevo-1.8.0rc1/src/tv/plugins/ivtv_xine_tv.py 2007-12-13 15:59:47.000000000 -0500
+++ ./freevo-1.8.0rc1_MODIFIED/src/tv/plugins/ivtv_xine_tv.py 2007-12-23 23:13:05.000000000 -0500
@@ -814,7 +814,7 @@
def prepare(self):
- if (self.mixer != None):
+ if ((self.mixer != None) and (str(self.mixer).find('sixmixer') < 0)):
if config.MIXER_MAJOR_CTRL == "VOL":
@@ -834,7 +834,7 @@
def start(self):
- if (self.mixer != None):
+ if ((self.mixer != None) and (str(self.mixer).find('sixmixer') < 0)):
self.mixer.setLineinVolume(config.MIXER_VOLUME_TV_IN)
self.mixer.setIgainVolume(config.MIXER_VOLUME_TV_IN)
@@ -855,7 +855,7 @@
def stop(self):
- if (self.mixer != None):
+ if ((self.mixer != None) and (str(self.mixer).find('sixmixer') < 0)):
self.mixer.setLineinVolume(0)
self.mixer.setMicVolume(0)
diff -Naur ./freevo-1.8.0rc1/src/tv/plugins/mplayer.py ./freevo-1.8.0rc1_MODIFIED/src/tv/plugins/mplayer.py
--- ./freevo-1.8.0rc1/src/tv/plugins/mplayer.py 2007-11-19 14:00:03.000000000 -0500
+++ ./freevo-1.8.0rc1_MODIFIED/src/tv/plugins/mplayer.py 2007-12-23 22:59:58.000000000 -0500
@@ -182,10 +182,10 @@
# btaudio (different dsp device) will be added later
mixer = plugin.getbyname('MIXER')
- if mixer and config.MIXER_MAJOR_CTRL == 'VOL':
+ if mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'VOL':
mixer_vol = mixer.getMainVolume()
mixer.setMainVolume(0)
- elif mixer and config.MIXER_MAJOR_CTRL == 'PCM':
+ elif mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'PCM':
mixer_vol = mixer.getPcmVolume()
mixer.setPcmVolume(0)
@@ -201,15 +201,15 @@
# Suppress annoying audio clicks
time.sleep(0.4)
# XXX Hm.. This is hardcoded and very unflexible.
- if mixer and mode == 'vcr':
+ if mixer and str(mixer).find('sixmixer') < 0 and mode == 'vcr':
mixer.setMicVolume(config.MIXER_VOLUME_VCR_IN)
- elif mixer:
+ elif mixer and str(mixer).find('sixmixer') < 0:
mixer.setLineinVolume(config.MIXER_VOLUME_TV_IN)
mixer.setIgainVolume(config.MIXER_VOLUME_TV_IN)
- if mixer and config.MIXER_MAJOR_CTRL == 'VOL':
+ if mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'VOL':
mixer.setMainVolume(mixer_vol)
- elif mixer and config.MIXER_MAJOR_CTRL == 'PCM':
+ elif mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'PCM':
mixer.setPcmVolume(mixer_vol)
_debug_('%s: started %s app' % (time.time(), self.mode))
@@ -218,7 +218,7 @@
def Stop(self, channel_change=0):
mixer = plugin.getbyname('MIXER')
- if mixer and not channel_change:
+ if mixer and str(mixer).find('sixmixer') < 0 and not channel_change:
mixer.setLineinVolume(0)
mixer.setMicVolume(0)
mixer.setIgainVolume(0) # Input on emu10k cards.
diff -Naur ./freevo-1.8.0rc1/src/tv/plugins/tvtime.py ./freevo-1.8.0rc1_MODIFIED/src/tv/plugins/tvtime.py
--- ./freevo-1.8.0rc1/src/tv/plugins/tvtime.py 2007-12-21 05:31:06.000000000 -0500
+++ ./freevo-1.8.0rc1_MODIFIED/src/tv/plugins/tvtime.py 2007-12-23 22:58:48.000000000 -0500
@@ -453,10 +453,10 @@
# TV is on line in
# VCR is mic in
# btaudio (different dsp device) will be added later
- if mixer and config.MIXER_MAJOR_CTRL == 'VOL':
+ if mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'VOL':
mixer_vol = mixer.getMainVolume()
mixer.setMainVolume(0)
- elif mixer and config.MIXER_MAJOR_CTRL == 'PCM':
+ elif mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'PCM':
mixer_vol = mixer.getPcmVolume()
mixer.setPcmVolume(0)
@@ -469,15 +469,15 @@
# Suppress annoying audio clicks
time.sleep(0.4)
# BUG Hm.. This is hardcoded and very unflexible.
- if mixer and mode == 'vcr':
+ if mixer and str(mixer).find('sixmixer') < 0 and mode == 'vcr':
mixer.setMicVolume(config.MIXER_VOLUME_VCR_IN)
- elif mixer:
+ elif mixer and str(mixer).find('sixmixer') < 0:
mixer.setLineinVolume(config.MIXER_VOLUME_TV_IN)
mixer.setIgainVolume(config.MIXER_VOLUME_TV_IN)
- if mixer and config.MIXER_MAJOR_CTRL == 'VOL':
+ if mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'VOL':
mixer.setMainVolume(mixer_vol)
- elif mixer and config.MIXER_MAJOR_CTRL == 'PCM':
+ elif mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'PCM':
mixer.setPcmVolume(mixer_vol)
_debug_('%s: started %s app' % (time.time(), self.mode))
@@ -485,7 +485,7 @@
def Stop(self, channel_change=0):
mixer = plugin.getbyname('MIXER')
- if mixer and not channel_change:
+ if mixer and str(mixer).find('sixmixer') < 0 and not channel_change:
mixer.setLineinVolume(0)
mixer.setMicVolume(0)
mixer.setIgainVolume(0) # Input on emu10k cards.
diff -Naur ./freevo-1.8.0rc1/src/tv/plugins/xawtv.py ./freevo-1.8.0rc1_MODIFIED/src/tv/plugins/xawtv.py
--- ./freevo-1.8.0rc1/src/tv/plugins/xawtv.py 2007-10-19 03:19:19.000000000 -0400
+++ ./freevo-1.8.0rc1_MODIFIED/src/tv/plugins/xawtv.py 2007-12-23 23:02:15.000000000 -0500
@@ -175,10 +175,10 @@
# TV is on line in
# VCR is mic in
# btaudio (different dsp device) will be added later
- if mixer and config.MIXER_MAJOR_CTRL == 'VOL':
+ if mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'VOL':
mixer_vol = mixer.getMainVolume()
mixer.setMainVolume(0)
- elif mixer and config.MIXER_MAJOR_CTRL == 'PCM':
+ elif mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'PCM':
mixer_vol = mixer.getPcmVolume()
mixer.setPcmVolume(0)
@@ -196,15 +196,15 @@
# Suppress annoying audio clicks
time.sleep(0.4)
# BUG Hm.. This is hardcoded and very unflexible.
- if mixer and mode == 'vcr':
+ if mixer and str(mixer).find('sixmixer') < 0 and mode == 'vcr':
mixer.setMicVolume(config.MIXER_VOLUME_VCR_IN)
- elif mixer:
+ elif mixer and str(mixer).find('sixmixer') < 0:
mixer.setLineinVolume(config.MIXER_VOLUME_TV_IN)
mixer.setIgainVolume(config.MIXER_VOLUME_TV_IN)
- if mixer and config.MIXER_MAJOR_CTRL == 'VOL':
+ if mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'VOL':
mixer.setMainVolume(mixer_vol)
- elif mixer and config.MIXER_MAJOR_CTRL == 'PCM':
+ elif mixer and str(mixer).find('sixmixer') < 0 and config.MIXER_MAJOR_CTRL == 'PCM':
mixer.setPcmVolume(mixer_vol)
_debug_('%s: started %s app' % (time.time(), self.mode))
@@ -212,7 +212,7 @@
def Stop(self, channel_change=0):
mixer = plugin.getbyname('MIXER')
- if mixer and not channel_change:
+ if mixer and str(mixer).find('sixmixer') < 0 and not channel_change:
mixer.setLineinVolume(0)
mixer.setMicVolume(0)
mixer.setIgainVolume(0) # Input on emu10k cards.
diff -Naur ./freevo-1.8.0rc1/src/audio/plugins/radioplayer.py ./freevo-1.8.0rc1_MODIFIED/src/audio/plugins/radioplayer.py
--- ./freevo-1.8.0rc1/src/audio/plugins/radioplayer.py 2007-12-13 15:38:15.000000000 -0500
+++ ./freevo-1.8.0rc1_MODIFIED/src/audio/plugins/radioplayer.py 2007-12-23 23:17:56.000000000 -0500
@@ -2,7 +2,7 @@
# -----------------------------------------------------------------------
# radioplayer.py - the Freevo Radioplayer plugin for radio
# -----------------------------------------------------------------------
# $Id: radioplayer.py 10206 2007-12-13 20:38:15Z duncan $
#
# Notes:
# Todo:
@@ -73,9 +73,10 @@
"""
try:
_debug_('url=%r' % (item.url), 2)
- _debug_('item.__dict__=%r' % (item.__dict__))
+ _debug_('mode=%r' % (item.mode), 2)
+ _debug_('mimetype=%r' % (item.mimetype), 2)
except Exception, e:
- _debug_('%s' % e)
+ print e
if item.url.startswith('radio://'):
_debug_('%r good' % (item.url))
return 2
@@ -93,14 +94,14 @@
self.starttime = time.time()
try:
- _debug_('play() %s' % self.item.station)
+ print 'RadioPlayer.play() %s' % self.item.station
except AttributeError:
return 'Cannot play with RadioPlayer - no station'
self.mode = 'play'
mixer = plugin.getbyname('MIXER')
- if mixer:
+ if mixer and str(mixer).find('sixmixer') < 0:
mixer_vol = config.MIXER_VOLUME_RADIO_IN
mixer.setLineinVolume(mixer_vol)
mixer.setIgainVolume(mixer_vol)
@@ -109,11 +110,11 @@
if config.RADIO_CMD.find('ivtv-radio') >= 0:
# IVTV cards
- _debug_('%s -f %s &' % (config.RADIO_CMD, self.item.station))
+ print '%s -f %s &' % (config.RADIO_CMD, self.item.station)
os.system('%s -f %s &' % (config.RADIO_CMD, self.item.station))
else:
# BTTV cards
- _debug_('%s' % (config.RADIO_CMD_START % self.item.station))
+
os.system('%s' % (config.RADIO_CMD_START % self.item.station))
thread.start_new_thread(self.__update_thread, ())
@@ -129,7 +130,7 @@
print 'Radio Player Stop'
self.mode = 'stop'
mixer = plugin.getbyname('MIXER')
- if mixer:
+ if mixer and str(mixer).find('sixmixer') < 0:
mixer.setLineinVolume(0)
mixer.setMicVolume(0)
mixer.setIgainVolume(0) # Input on emu10k cards.
@@ -140,7 +141,6 @@
os.system('killall -9 aplay')
else:
# BTTV cards
- _debug_('%s' % (config.RADIO_CMD_STOP))
os.system('%s' % config.RADIO_CMD_STOP)
rc.post_event(PLAY_END)
@@ -157,7 +157,6 @@
self.item.elapsed = int(time.time() - self.starttime)
self.playerGUI.refresh()
-
def eventhandler(self, event, menuw=None):
"""
eventhandler for mplayer control. If an event is not bound in this
@@ -171,7 +170,6 @@
# everything else: give event to the items eventhandler
return self.item.eventhandler(event)
-
def __update_thread(self):
"""
OSD update thread
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel