


Icon Sub-Sets by rowancompsciguy 4 comments
if an application tries to use an Icon that you didn't put in your theme (and it is active), kde will use default.kde icon set for that icon (in kde 3 it is crystalsvg) - May 06 2007

Various KDE 1.-4. Improvements by Linuster 58 comments
I think they are using this in Basket, if I remember well... - Feb 15 2007

Various KDE 1.-4. Improvements by TheNacho 41 comments
Nice hack. I haven't got the time to compile it but someday i'll give it a try. Is there something similar for yakuake? - Feb 15 2007

Amarok 1.x Scripts by maacruz 274 comments
I achieved this by putting all the code that was in if sinput.startswith('engineStateChange: playing') in a function, and plus a few troubleshooting i got it working. it would be better, though, if the playing volume was also updated when its manualy apply_replaygain'ed, and that in the configuration dialog you can select wether or not to applyreplaygain when its not available, but I don't have more time right now ;). well, here is the code that I put before the #main_loop comment in amarok_replaygain.py:
def update_volume (is_playing):
#reread amarok config if possible
if not(is_playing) and (amarok_version>=10302):#changing track also sends the playing signal, so to avoid latency and osd messing the config will be read only if the previous state was "stop"
read_amarok_config()
is_playing = True
proft1 = time.time()
song_url = str(amarok_dcop.player.encodedURL()[1])
if debug: flog.write('Get url time: '+str(time.time()-proft1)+'\n')
if song_url.startswith('file:'): #we can only read tags on local files
pregain = float(replaygain_config['pregain'])
mode = replaygain_config['mode']
song_name = urllib.url2pathname(song_url)[5:]
proft = time.time()
song_gain,peak = read_tags(song_name,mode)
if debug: flog.write('Tag reading time: '+str(time.time()-proft)+'\n')
if not(isNaN(song_gain)):
gain = song_gain+pregain
if gain>calibration[0][1]+1:#warn of out of range gain
os.popen('dcop knotify default notify eventname amarok "'+_('Replaygain script warning\ngain too big by ').encode(LC,'replace')+str(gain-calibration[0][1])+'dB" "" "" 16 0')
gain = calibration[0][1]
if (gain+peak > calibration[0][1])and(replaygain_config['no_peak'] == 'false'): #will peak clip?
gain = gain-peak #if so limit gain
if debug: flog.write('Final gain: '+str(gain)+'\n')
else:
amarok_dcop.playlist.popupMessage(_('This song has no replaygain info. Applying replaygain...').encode(LC,'replace'))
gain = float(replaygain_config['gain_default'])+pregain
if replaygain_config['mode'] == 'track':
mymode = TRACK_TAGS
elif replaygain_config['mode'] == 'album':
mymode = ALBUM_TAGS
apply_replaygain([song_url],mymode)
is_playing=update_volume(is_playing)
v = gain2vol(gain)
if v < 5:
os.popen('dcop knotify default notify eventname amarok "'+_('Replaygain script warning\ngain too low by ').encode(LC,'replace')+str(gain-calibration[len(calibration)-1][1])+'dB" "" "" 16 0')
#support crossfade
if is_crossfaded or replaygain_config['smooth'] == 'true':
if amarok_osd and osd_disabled:#if the crossfade thread is running it may have disabled the osd, so we show osd or the song change will not have osd
if (time.time()-last_osd_time) < osd_duration:
amarok_dcop.player.showOSD()
amarok_dcop.player.showOSD() #if osd was showing the first command would hide it so it must be shown again
if debug: flog.write('hide and show osd\n')
else:
amarok_dcop.player.showOSD()
if debug: flog.write('show osd\n')
last_osd_time = time.time()
stop_thread = True #signal crossfade thread to stop if running
timer.cancel() #interrupt thread timer
thread_lock.acquire() #wait till thread has exited
thread_lock.release()
if is_crossfaded:
start_new_thread(do_crossfade,(v,crosstime,thread_lock,timer))
else:
start_new_thread(do_crossfade,(v,float(replaygain_config['smooth_time']),thread_lock,timer))
else: #no crossfade
proft = time.time()
if replaygain_config['no_osd'] == 'true' and amarok_osd:
amarok_dcop.player.enableOSD(False)
vol_upd_list.append(v)
amarok_dcop.player.setVolume(v)
if replaygain_config['no_osd'] == 'true' and amarok_osd:
amarok_dcop.player.enableOSD(True)
if debug: flog.write('Setvolume time: '+str(time.time()-proft)+'\n')
if debug: flog.write('Total trackchange time: '+str(time.time()-proft1)+'\n')
if time.time()-proft1>0.5:
if is_console_dcop:
msgbox(_('Large lag has been detected:\nYou may install kdebindings3-python/python-kde3'),mode='msgbox',nonblock=True,dontagain='kdebindings')
else:
if replaygain_config['no_osd'] == 'true' and amarok_osd:
msgbox(_('Large lag has been detected:\nIt is recomended to disable the script osd control'),mode='msgbox',nonblock=True,dontagain='osd')
else:
msgbox(_('Large lag has been detected:\nYou may try removing or reducing covers'),mode='msgbox',nonblock=True,dontagain='covers')
else:
song_gain = float('NaN')
return is_playing
and in the condtional if sinput.startswith('engineStateChange: playing'):
is_playing = update_volume(is_playing)
hope I help to improve this awesome script! ;) - Jan 21 2007