'Set the playback state.
Must be :attr:`PLAYING`, :attr:`PAUSED`, or :attr:`STOPPED`.
Possible states and transitions:
.. digraph:: state_transitions
"STOPPED" -> "PLAYING" [ label="play" ]
"STOPPED" -> "PAUSED" [ label="pause" ]
"PLAYING" -> "STOPPED" [ label="stop" ]
"PLAYING" -> "PAUSED" [ label="pause" ]
"PLAYING" -> "PLAYING" [ label="play" ]
"PAUSED" -> "PLAYING" [ label="resume" ]
"PAUSED" -> "STOPPED" [ label="stop" ]'

def set_state(self, new_state):

    validation.check_choice(new_state, validation.PLAYBACK_STATES)
    (old_state, self._state) = (self.get_state(), new_state)
    logger.debug(u'Changing    state:    %s    ->    %s', old_state, new_state)
    self._trigger_playback_state_changed(old_state, new_state)
