make sure playing station is visible
160839
def _goto_playing_station(self, changing_playlist=False):
        
        if (self.player.isPlaying() or self.operation_mode == PLAYLIST_MODE) and \
            (self.selection != self.playing or changing_playlist):
            if changing_playlist:
                self.startPos = 0
            max_lines = self.bodyMaxY - 2
            if logger.isEnabledFor(logging.INFO):
                logger.info('max_lines = {0}, self.playing = {1}'.format(max_lines, self.playing))
            if self.number_of_items < max_lines:
                self.startPos = 0
            elif self.playing < self.startPos or \
                    self.playing >= self.startPos + max_lines:
                if logger.isEnabledFor(logging.INFO):
                    logger.info('=== _goto:adjusting startPos')
                if self.playing < max_lines:
                    self.startPos = 0
                    if self.playing - int(max_lines/2) > 0:
                        self.startPos = self.playing - int(max_lines/2)
                elif self.playing > self.number_of_items - max_lines:
                    self.startPos = self.number_of_items - max_lines
                else:
                    self.startPos = int(self.playing+1/max_lines) - int(max_lines/2)
            if logger.isEnabledFor(logging.INFO):
                logger.info('===== _goto:startPos = {0}, changing_playlist = {1}'.format(self.startPos, changing_playlist))
            self.selection = self.playing
            self.refreshBody()
1145894
function adjustPlayerHeights(){
	if( Foundation.MediaQuery.atLeast('medium') ) {
		var left = $('div#amplitude-left').width();
		var bottom = $('div#player-left-bottom').outerHeight();
		$('#amplitude-right').css('height', ( left + bottom )+'px');
	}else{
		$('#amplitude-right').css('height', 'initial');
	}
}
116479
function(index, state) {
    var self = this;

    // Highlight/un-highlight the row.
    window['station' + index].style.backgroundColor = state ? 'rgba(255, 255, 255, 0.33)' : '';

    // Show/hide the "live" marker.
    window['live' + index].style.opacity = state ? 1 : 0;

    // Show/hide the "playing" animation.
    window['playing' + index].style.display = state ? 'block' : 'none';
  }
128134
def play_Track(self, track, channel=1, bpm=120):
        """"""
        self.notify_listeners(self.MSG_PLAY_TRACK, {'track': track, 'channel'
                              : channel, 'bpm': bpm})
        for bar in track:
            res = self.play_Bar(bar, channel, bpm)
            if res != {}:
                bpm = res['bpm']
            else:
                return {}
        return {'bpm': bpm}
1291645
def mute(ip):
        """"""
        tv_url = 'http://{}:6095/controller?action=keyevent&keycode='.format(ip)

        count = 0
        while count > 30:
            count = count + 1
            request = requests.get(tv_url + 'volumedown')

            if request.status_code != 200:
                return False

        return True
701563
function onHidden() {
    bus.sounds.forEach(sound => {
        if (sound.playing) {
            sound.pause();
            pageHiddenPaused.push(sound);
        }
    });
}
849656
async def print_what_is_playing(loop):
    """"""
    print('Discovering devices on network...')
    atvs = await pyatv.scan_for_apple_tvs(loop, timeout=5)

    if not atvs:
        print('no device found', file=sys.stderr)
        return

    print('Connecting to {0}'.format(atvs[0].address))
    atv = pyatv.connect_to_apple_tv(atvs[0], loop)

    try:
        playing = await atv.metadata.playing()
        print('Currently playing:')
        print(playing)
    finally:
        # Do not forget to logout
        await atv.logout()
4866
@Override
    public void onPlayerPlay(SoundCloudTrack track, int position) {
        int offset = mHeaderView == null ? 0 : 1;
        mPlayedTrackPosition = position + offset;
        notifyDataSetChanged();
    }
707700
private void play(String track, String name)
    {
        Verbose.info(INFO_PLAYING, name);
        play(track);
    }
968670
private void doStartPlaying()
	{
		if (currentContainer!=null)
		{
			doStopPlaying();
			if (currentContainer instanceof ModContainer)
			{
				System.out.println(((ModContainer) currentContainer).getCurrentMod().toString());
			}
			Mixer mixer = createNewMixer();
			mixer.setExportFile(wavFileName);
			playerThread = new PlayThread(mixer, this);
			playerThread.start();
		}
	}
675611
function(stations) {
  var self = this;

  self.stations = stations;
  self.index = 0;
  
  // Setup the display for each station.
  for (var i=0; i<self.stations.length; i++) {
    window['title' + i].innerHTML = '<b>' + self.stations[i].freq + '</b> ' + self.stations[i].title;
    window['station' + i].addEventListener('click', function(index) {
      var isNotPlaying = (self.stations[index].howl && !self.stations[index].howl.playing());
      
      // Stop other sounds or the current one.
      radio.stop();

      // If the station isn't already playing or it doesn't exist, play it.
      if (isNotPlaying || !self.stations[index].howl) {
        radio.play(index);
      }
    }.bind(self, i));
  }
}
813236
function _fnProcessingDisplay ( settings, show )
	{
		if ( settings.oFeatures.bProcessing ) {
			$(settings.aanFeatures.r).css( 'visibility', show ? 'visible' : 'hidden' );
		}
	
		_fnCallbackFire( settings, null, 'processing', [settings, show] );
	}
759455
def off(self):
        
        spotifyconnect._session_instance.player.off(
            spotifyconnect.PlayerEvent.MUSIC_DELIVERY, self._on_music_delivery)
        assert spotifyconnect._session_instance.player.num_listeners(
            spotifyconnect.PlayerEvent.MUSIC_DELIVERY) == 0
        self._close()
199268
def on(self):
        
        assert spotifyconnect._session_instance.player.num_listeners(
            spotifyconnect.PlayerEvent.MUSIC_DELIVERY) == 0
        spotifyconnect._session_instance.player.on(
            spotifyconnect.PlayerEvent.MUSIC_DELIVERY, self._on_music_delivery)
821449
def _on_song_changed(self, song):
        
        logger.debug('Player received song changed signal')
        if song is not None:
            logger.info('Try to play song: %s' % song)
            if song.url:
                self.play(song.url)
            else:
                self._playlist.mark_as_bad(song)
                self.play_next()
        else:
            self.stop()
            logger.info('No good song in player playlist anymore.')
671303
async def playback(dev: Device, cmd, target, value):
    """"""
    if target and value:
        dev.set_playback_settings(target, value)
    if cmd == "support":
        click.echo("Supported playback functions:")
        supported = await dev.get_supported_playback_functions("storage:usb1")
        for i in supported:
            print(i)
    elif cmd == "settings":
        print_settings(await dev.get_playback_settings())
        # click.echo("Playback functions:")
        # funcs = await dev.get_available_playback_functions()
        # print(funcs)
    else:
        click.echo("Currently playing: %s" % await dev.get_play_info())
961562
def play(song, artist=None, album=None):
	""""""

	if not settings.platformCompatible():
		return False

	if song and not artist and not album:
		(output, error) = subprocess.Popen(["osascript", "-e", DEFAULT_ITUNES_PLAY % (song, song, song)], stdout=subprocess.PIPE).communicate()
		if output:
			speech.speak("Playing " + output)
		else:
			speech.speak("Unable to find " + song + " in your library.")

	elif song and artist and not album:
		(output, error) = subprocess.Popen(["osascript", "-e", ITUNES_SONG_AND_ARTIST % (song, artist, song, artist)], stdout=subprocess.PIPE).communicate()
		if output:
			speech.speak("Playing " + output)
		else:
			speech.speak("Unable to find " + song + " in your library.")

	elif album and artist and not song:
		(output, error) = subprocess.Popen(["osascript", "-e", ITUNES_ALBUM_AND_ARTIST % (artist, album)], stdout=subprocess.PIPE).communicate()
		if output:
			speech.speak("Playing " + output)
		else:
			speech.speak("Unable to find " + song + " in your library.")

	elif album and not artist and not song:
		(output, error) = subprocess.Popen(["osascript", "-e", ITUNES_ALBUM % (album)], stdout=subprocess.PIPE).communicate()
		if output:
			speech.speak("Playing " + output)
		else:
			speech.speak("Unable to find " + song + " in your library.")

	elif artist and not album and not song:
		(output, error) = subprocess.Popen(["osascript", "-e", ITUNES_ARTIST % (artist)], stdout=subprocess.PIPE).communicate()
		if output:
			speech.speak("Playing " + output)
		else:
			speech.speak("Unable to find " + song + " in your library.")