@protocol.commands.add(u'volume', change=protocol.INT)
def volume(context, change):
 if ((change < (-100)) or (change > 100)):
  raise exceptions.MpdArgError(u'Invalid volume value')
 old_volume = context.core.mixer.get_volume().get()
 if (old_volume is None):
  raise exceptions.MpdSystemError(u'problems setting volume')
 new_volume = min(max(0, (old_volume + change)), 100)
 success = context.core.mixer.set_volume(new_volume).get()
 if (not success):
  raise exceptions.MpdSystemError(u'problems setting volume')

@ protocol . commands . add ( u'volume' , change = protocol . INT ) def volume ( context , change ) : if ( ( change < ( - 100 ) ) or ( change > 100 ) ) : raise exceptions . MpdArgError ( u'Invalid volume value' ) old_volume = context . core . mixer . get_volume ( ) . get ( ) if ( old_volume is None ) : raise exceptions . MpdSystemError ( u'problems setting volume' ) new_volume = min ( max ( 0 , ( old_volume + change ) ) , 100 ) success = context . core . mixer . set_volume ( new_volume ) . get ( ) if ( not success ) : raise exceptions . MpdSystemError ( u'problems setting volume' )
returns the volume of a set of nodes .