def mixable_button_color(mixer_track, song, selected_track=None):
    color = 'Mixer.NoTrack'
    if mixer_track:
        if can_play_clips(mixer_track) and is_clip_stop_pending(mixer_track):
            color = track_color_with_pending_stop(mixer_track)
        elif mixer_track.solo:
            color = 'Mixer.SoloOn'
        elif mixer_track == selected_track and not mixer_track.mute:
            color = 'Mixer.TrackSelected'
        elif mixer_track.mute or mixer_track.muted_via_solo:
            color = 'Mixer.MutedTrack'
        else:
            color = translate_color_index(mixer_track.color_index)
    return color
def mixable_button_color(mixer_track, song, selected_track = None):
    color = 'Mixer.NoTrack'
    if mixer_track:
        if can_play_clips(mixer_track) and is_clip_stop_pending(mixer_track):
            color = track_color_with_pending_stop(mixer_track)
        elif mixer_track.solo:
            color = 'Mixer.SoloOn'
        elif mixer_track == selected_track and not mixer_track.mute:
            color = 'Mixer.TrackSelected'
        elif mixer_track.mute or mixer_track.muted_via_solo:
            color = 'Mixer.MutedTrack'
        else:
            color = translate_color_index(mixer_track.color_index)
    return color
 def _color_for_button(self, track):
     if is_clip_stop_pending(track):
         return track_color_with_pending_stop(track)
     elif track.playing_slot_index >= 0:
         if track.solo:
             return 'StopClips.SoloedTrack'
         elif track.mute:
             return 'StopClips.MutedTrack'
         elif track.clip_slots[track.playing_slot_index].is_recording:
             pulse_to = RECORDING_COLOR
         else:
             pulse_to = UNLIT_COLOR
         return make_pulsing_track_color(track, pulse_to)
     else:
         return super(StopClipComponent, self)._color_for_button(track)
Esempio n. 4
0
 def _color_for_button(self, track):
     if is_clip_stop_pending(track):
         return track_color_with_pending_stop(track)
     elif track.playing_slot_index >= 0:
         if track.solo:
             return 'StopClips.SoloedTrack'
         elif track.mute:
             return 'StopClips.MutedTrack'
         elif track.clip_slots[track.playing_slot_index].is_recording:
             pulse_to = RECORDING_COLOR
         else:
             pulse_to = UNLIT_COLOR
         return make_pulsing_track_color(track, pulse_to)
     else:
         return super(StopClipComponent, self)._color_for_button(track)
Esempio n. 5
0
def stop_clip_button_color(track, song, _):
    if liveobj_valid(track) and not is_chain(track) and bool(track.clip_slots):
        if is_clip_stop_pending(track):
            return track_color_with_pending_stop(track)
        if track.playing_slot_index >= 0:
            if track.solo:
                return 'StopClips.SoloedTrack'
            if track.mute:
                return 'StopClips.MutedTrack'
            if track.clip_slots[track.playing_slot_index].is_recording:
                pulse_to = RECORDING_COLOR
            else:
                pulse_to = UNLIT_COLOR
            return make_pulsing_track_color(track, pulse_to)
        return 'Session.StoppedClip'
    else:
        return 'Mixer.NoTrack'
def stop_clip_button_color(track, song, _):
    if liveobj_valid(track) and not is_chain(track) and bool(track.clip_slots):
        if is_clip_stop_pending(track):
            return track_color_with_pending_stop(track)
        elif track.playing_slot_index >= 0:
            if track.solo:
                return 'StopClips.SoloedTrack'
            if track.mute:
                return 'StopClips.MutedTrack'
            if track.clip_slots[track.playing_slot_index].is_recording:
                pulse_to = RECORDING_COLOR
            else:
                pulse_to = UNLIT_COLOR
            return make_pulsing_track_color(track, pulse_to)
        else:
            return 'Session.StoppedClip'
    else:
        return 'Mixer.NoTrack'
Esempio n. 7
0
def mixable_button_color(mixer_track, song, selected_track = None):
    color = 'Mixer.NoTrack'
    if mixer_track:
        mixer_track_parent_track = find_parent_track(mixer_track.proxied_object)
        is_frozen_chain = mixer_track_parent_track.is_frozen and not isinstance(mixer_track.proxied_object, Live.Track.Track)
        if can_play_clips(mixer_track) and is_clip_stop_pending(mixer_track):
            color = track_color_with_pending_stop(mixer_track)
        elif mixer_track.solo:
            color = 'Mixer.SoloOn'
        elif mixer_track == selected_track and not mixer_track.mute:
            color = 'Mixer.TrackSelected'
        elif mixer_track.mute or mixer_track.muted_via_solo:
            color = 'Mixer.MutedTrack'
        elif is_frozen_chain:
            color = 'Mixer.FrozenChain'
        else:
            color = IndexedColor.from_live_index(mixer_track.color_index, DISPLAY_BUTTON_SHADE_LEVEL)
    return color
Esempio n. 8
0
def mixable_button_color(mixer_track, song, selected_track=None):
    color = 'Mixer.NoTrack'
    if mixer_track:
        mixer_track_parent_track = find_parent_track(mixer_track.proxied_object)
        is_frozen_chain = mixer_track_parent_track.is_frozen and not isinstance(mixer_track.proxied_object, Live.Track.Track)
        if can_play_clips(mixer_track) and is_clip_stop_pending(mixer_track):
            color = track_color_with_pending_stop(mixer_track)
        elif mixer_track.solo:
            color = 'Mixer.SoloOn'
        elif mixer_track == selected_track and not mixer_track.mute:
            color = 'Mixer.TrackSelected'
        elif mixer_track.mute or mixer_track.muted_via_solo:
            color = 'Mixer.MutedTrack'
        elif is_frozen_chain:
            color = 'Mixer.FrozenChain'
        else:
            color = IndexedColor.from_live_index(mixer_track.color_index, DISPLAY_BUTTON_SHADE_LEVEL)
    return color