當前位置: 首頁>>代碼示例>>Java>>正文


Java PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH屬性代碼示例

本文整理匯總了Java中android.support.v4.media.session.PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH屬性的典型用法代碼示例。如果您正苦於以下問題:Java PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH屬性的具體用法?Java PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH怎麽用?Java PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.support.v4.media.session.PlaybackStateCompat的用法示例。


在下文中一共展示了PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH屬性的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getAvailableActions

private long getAvailableActions() {
    long actions =
            PlaybackStateCompat.ACTION_PLAY_PAUSE |
                    PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID |
                    PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH |
                    PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS |
                    PlaybackStateCompat.ACTION_SKIP_TO_NEXT;
    if (playback.isPlaying()) {
        actions |= PlaybackStateCompat.ACTION_PAUSE;
    } else {
        actions |= PlaybackStateCompat.ACTION_PLAY;
    }
    //
    if(isRepeat){
        actions|=PlaybackStateCompat.ACTION_SET_REPEAT_MODE;
    }
    //
    if(isShuffle){
        actions|=PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE_ENABLED;
    }
    return actions;
}
 
開發者ID:vpaliyX,項目名稱:Melophile,代碼行數:22,代碼來源:PlaybackManager.java

示例2: recycle

static void recycle(Segment segment) {
    if (segment.next != null || segment.prev != null) {
        throw new IllegalArgumentException();
    } else if (!segment.shared) {
        synchronized (SegmentPool.class) {
            if (byteCount + PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH > MAX_SIZE) {
                return;
            }
            byteCount += PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH;
            segment.next = next;
            segment.limit = 0;
            segment.pos = 0;
            next = segment;
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:16,代碼來源:SegmentPool.java

示例3: getAvailableActions

@PlaybackStateCompat.Actions
private long getAvailableActions() {
    long actions =
            PlaybackStateCompat.ACTION_PLAY
                    | PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID
                    | PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH
                    | PlaybackStateCompat.ACTION_SKIP_TO_NEXT
                    | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS;
    if (isPlaying()) {
        actions |= PlaybackStateCompat.ACTION_PAUSE;
    }
    return actions;
}
 
開發者ID:googlecodelabs,項目名稱:musicplayer-devices,代碼行數:13,代碼來源:PlaybackManager.java

示例4: getAvailableActions

@PlaybackStateCompat.Actions
private long getAvailableActions() {
    long actions = PlaybackStateCompat.ACTION_PLAY_PAUSE
            | PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID
            | PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH;
    if (mMediaPlayerGlue.isPlaying()) {
        actions |= PlaybackStateCompat.ACTION_PAUSE;
    } else {
        actions |= PlaybackStateCompat.ACTION_PLAY;
    }
    return actions;
}
 
開發者ID:googlesamples,項目名稱:leanback-homescreen-channels,代碼行數:12,代碼來源:VideoFragment.java

示例5: write

public void write(Buffer source, long byteCount) {
    if (source == null) {
        throw new IllegalArgumentException("source == null");
    } else if (source == this) {
        throw new IllegalArgumentException("source == this");
    } else {
        Util.checkOffsetAndCount(source.size, 0, byteCount);
        while (byteCount > 0) {
            if (byteCount < ((long) (source.head.limit - source.head.pos))) {
                Segment tail = this.head != null ? this.head.prev : null;
                if (tail != null && tail.owner) {
                    if ((byteCount + ((long) tail.limit)) - ((long) (tail.shared ? 0 : tail.pos)) <= PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH) {
                        source.head.writeTo(tail, (int) byteCount);
                        source.size -= byteCount;
                        this.size += byteCount;
                        return;
                    }
                }
                source.head = source.head.split((int) byteCount);
            }
            Segment segmentToMove = source.head;
            long movedByteCount = (long) (segmentToMove.limit - segmentToMove.pos);
            source.head = segmentToMove.pop();
            if (this.head == null) {
                this.head = segmentToMove;
                Segment segment = this.head;
                Segment segment2 = this.head;
                Segment segment3 = this.head;
                segment2.prev = segment3;
                segment.next = segment3;
            } else {
                this.head.prev.push(segmentToMove).compact();
            }
            source.size -= movedByteCount;
            this.size += movedByteCount;
            byteCount -= movedByteCount;
        }
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:39,代碼來源:Buffer.java

示例6: take

static Segment take() {
    synchronized (SegmentPool.class) {
        if (next != null) {
            Segment result = next;
            next = result.next;
            result.next = null;
            byteCount -= PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH;
            return result;
        }
        return new Segment();
    }
}
 
開發者ID:JackChan1999,項目名稱:boohee_v5.6,代碼行數:12,代碼來源:SegmentPool.java

示例7: getAvailableActions

/**
 * Set the current capabilities available on this session. Note: If a capability is not
 * listed in the bitmask of capabilities then the MediaSession will not handle it. For
 * example, if you don't want ACTION_STOP to be handled by the MediaSession, then don't
 * included it in the bitmask that's returned.
 */
@PlaybackStateCompat.Actions
private long getAvailableActions() {
    long actions = PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID
                   | PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH
                   | PlaybackStateCompat.ACTION_SKIP_TO_NEXT
                   | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS;
    switch (mState) {
        case PlaybackStateCompat.STATE_STOPPED:
            actions |= PlaybackStateCompat.ACTION_PLAY
                       | PlaybackStateCompat.ACTION_PAUSE;
            break;
        case PlaybackStateCompat.STATE_PLAYING:
            actions |= PlaybackStateCompat.ACTION_STOP
                       | PlaybackStateCompat.ACTION_PAUSE
                       | PlaybackStateCompat.ACTION_SEEK_TO;
            break;
        case PlaybackStateCompat.STATE_PAUSED:
            actions |= PlaybackStateCompat.ACTION_PLAY
                       | PlaybackStateCompat.ACTION_STOP;
            break;
        default:
            actions |= PlaybackStateCompat.ACTION_PLAY
                       | PlaybackStateCompat.ACTION_PLAY_PAUSE
                       | PlaybackStateCompat.ACTION_STOP
                       | PlaybackStateCompat.ACTION_PAUSE;
    }
    return actions;
}
 
開發者ID:nazmulidris,項目名稱:mediasession-mediaplayer,代碼行數:34,代碼來源:MediaPlayerAdapter.java

示例8: getAvailableActions

/**
 * Set the current capabilities available on this session. Note: If a capability is not
 * listed in the bitmask of capabilities then the MediaSession will not handle it. For
 * example, if you don't want ACTION_STOP to be handled by the MediaSession, then don't
 * included it in the bitmask that's returned.
 */
@PlaybackStateCompat.Actions
private long getAvailableActions() {
    long actions = PlaybackStateCompat.ACTION_PLAY_FROM_MEDIA_ID
            | PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH
            | PlaybackStateCompat.ACTION_SKIP_TO_NEXT
            | PlaybackStateCompat.ACTION_SKIP_TO_PREVIOUS;
    switch (mState) {
        case PlaybackStateCompat.STATE_STOPPED:
            actions |= PlaybackStateCompat.ACTION_PLAY
                    | PlaybackStateCompat.ACTION_PAUSE;
            break;
        case PlaybackStateCompat.STATE_PLAYING:
            actions |= PlaybackStateCompat.ACTION_STOP
                    | PlaybackStateCompat.ACTION_PAUSE
                    | PlaybackStateCompat.ACTION_SEEK_TO;
            break;
        case PlaybackStateCompat.STATE_PAUSED:
            actions |= PlaybackStateCompat.ACTION_PLAY
                    | PlaybackStateCompat.ACTION_STOP;
            break;
        default:
            actions |= PlaybackStateCompat.ACTION_PLAY
                    | PlaybackStateCompat.ACTION_PLAY_PAUSE
                    | PlaybackStateCompat.ACTION_STOP
                    | PlaybackStateCompat.ACTION_PAUSE;
    }
    return actions;
}
 
開發者ID:fendoudebb,項目名稱:PlayAndroid,代碼行數:34,代碼來源:MediaPlayerManager.java


注:本文中的android.support.v4.media.session.PlaybackStateCompat.ACTION_PLAY_FROM_SEARCH屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。