• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VolumeProviderCompat类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中android.support.v4.media.VolumeProviderCompat的典型用法代码示例。如果您正苦于以下问题:Java VolumeProviderCompat类的具体用法?Java VolumeProviderCompat怎么用?Java VolumeProviderCompat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



VolumeProviderCompat类属于android.support.v4.media包,在下文中一共展示了VolumeProviderCompat类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getVolumeAttributes

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public ParcelableVolumeInfo getVolumeAttributes() {
    int volumeType;
    int stream;
    int controlType;
    int max;
    int current;
    synchronized (MediaSessionImplBase.this.mLock) {
        volumeType = MediaSessionImplBase.this.mVolumeType;
        stream = MediaSessionImplBase.this.mLocalStream;
        VolumeProviderCompat vp = MediaSessionImplBase.this.mVolumeProvider;
        if (volumeType == 2) {
            controlType = vp.getVolumeControl();
            max = vp.getMaxVolume();
            current = vp.getCurrentVolume();
        } else {
            controlType = 2;
            max = MediaSessionImplBase.this.mAudioManager.getStreamMaxVolume(stream);
            current = MediaSessionImplBase.this.mAudioManager.getStreamVolume(stream);
        }
    }
    return new ParcelableVolumeInfo(volumeType, stream, controlType, max, current);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:23,代码来源:MediaSessionCompat.java


示例2: updatePlaybackInfoFromSelectedRoute

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
private void updatePlaybackInfoFromSelectedRoute() {
    if (mSelectedRoute != null) {
        mPlaybackInfo.volume = mSelectedRoute.getVolume();
        mPlaybackInfo.volumeMax = mSelectedRoute.getVolumeMax();
        mPlaybackInfo.volumeHandling = mSelectedRoute.getVolumeHandling();
        mPlaybackInfo.playbackStream = mSelectedRoute.getPlaybackStream();
        mPlaybackInfo.playbackType = mSelectedRoute.getPlaybackType();

        final int count = mRemoteControlClients.size();
        for (int i = 0; i < count; i++) {
            RemoteControlClientRecord record = mRemoteControlClients.get(i);
            record.updatePlaybackInfo();
        }
        if (mMediaSession != null) {
            int controlType = VolumeProviderCompat.VOLUME_CONTROL_FIXED;
            if (mPlaybackInfo.volumeHandling
                    == RouteInfo.PLAYBACK_VOLUME_VARIABLE) {
                controlType = VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE;
            }
            mMediaSession.configureVolume(controlType, mPlaybackInfo.volumeMax,
                    mPlaybackInfo.volume);
        }
    }
}
 
开发者ID:commonsguy,项目名称:cwac-mediarouter,代码行数:25,代码来源:MediaRouter.java


示例3: setPlaybackToRemote

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void setPlaybackToRemote(VolumeProviderCompat volumeProvider) {
    if (volumeProvider == null) {
        throw new IllegalArgumentException("volumeProvider may not be null");
    }
    if (this.mVolumeProvider != null) {
        this.mVolumeProvider.setCallback(null);
    }
    this.mVolumeType = 2;
    this.mVolumeProvider = volumeProvider;
    sendVolumeInfoChanged(new ParcelableVolumeInfo(this.mVolumeType, this.mLocalStream, this.mVolumeProvider.getVolumeControl(), this.mVolumeProvider.getMaxVolume(), this.mVolumeProvider.getCurrentVolume()));
    volumeProvider.setCallback(this.mVolumeCallback);
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:13,代码来源:MediaSessionCompat.java


示例4: getTypedValue

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
/**
 * 获取单个自定义属性的TypedValue
 * @param context   上下文
 * @param attrRes   attrid
 * @return  {@link TypedValue}
 */
public static TypedValue getTypedValue(@NonNull Context context, @VolumeProviderCompat.ControlType int attrRes)
{
    TypedValue typedValue = new TypedValue();
    context.getTheme().resolveAttribute(attrRes, typedValue, true);
    return typedValue;
}
 
开发者ID:tyzlmjj,项目名称:Tools,代码行数:13,代码来源:AttrUtils.java


示例5: getBoolean

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
/**
 * 获取boolean类型值
 * @param context   上下文
 * @param attrRes   attrid
 * @return  boolean类型值
 */
public static boolean getBoolean(@NonNull Context context, @VolumeProviderCompat.ControlType int attrRes)
{
    if("true".equals(getTypedValue(context,attrRes).coerceToString()))
    {
        return true;
    }
    return false;
}
 
开发者ID:tyzlmjj,项目名称:Tools,代码行数:15,代码来源:AttrUtils.java


示例6: setPlaybackToRemote

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void setPlaybackToRemote(VolumeProviderCompat volumeprovidercompat)
{
    if (volumeprovidercompat == null)
    {
        throw new IllegalArgumentException("volumeProvider may not be null");
    }
    if (mVolumeProvider != null)
    {
        mVolumeProvider.setCallback(null);
    }
    mVolumeType = 2;
    mVolumeProvider = volumeprovidercompat;
    sendVolumeInfoChanged(new ParcelableVolumeInfo(mVolumeType, mLocalStream, mVolumeProvider.getVolumeControl(), mVolumeProvider.getMaxVolume(), mVolumeProvider.getCurrentVolume()));
    volumeprovidercompat.setCallback(mVolumeCallback);
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:16,代码来源:MediaSessionCompat.java


示例7: onVolumeChanged

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void onVolumeChanged(VolumeProviderCompat volumeprovidercompat)
{
    if (mVolumeProvider != volumeprovidercompat)
    {
        return;
    } else
    {
        volumeprovidercompat = new ParcelableVolumeInfo(mVolumeType, mLocalStream, volumeprovidercompat.getVolumeControl(), volumeprovidercompat.getMaxVolume(), volumeprovidercompat.getCurrentVolume());
        sendVolumeInfoChanged(volumeprovidercompat);
        return;
    }
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:13,代码来源:MediaSessionCompat.java


示例8: onLoad

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
protected void onLoad(Bundle savedInstanceState) {
    super.onLoad(savedInstanceState);
    controller.getCurrentRenderer(new Action1<ComponentName>() {
        @Override
        public void call(ComponentName componentName) {
            final List<RendererInfo> infos = loader.getPluginInfos();
            for (RendererInfo info : infos) {
                if (componentName == null) {
                    //local is null
                    info.setActive(info.getComponentName() == null);
                } else {
                    info.setActive(componentName.equals(info.getComponentName()));
                }
            }
            if (hasView()) {
                getView().getAdapter().replaceAll(infos);
            }
        }
    });
    PlaybackInfoCompat playbackInfo = controller.getPlaybackInfo();
    if (playbackInfo == null || playbackInfo.getPlaybackType() !=
            MediaControllerCompat.PlaybackInfo.PLAYBACK_TYPE_REMOTE ||
            playbackInfo.getVolumeControl() != VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE) {
        getView().mVolumeControl.setVisibility(View.GONE);
    } else {
        getView().mVolumeSeekbar.setMax(playbackInfo.getMaxVolume());
        getView().mVolumeSeekbar.setProgress(playbackInfo.getCurrentVolume());
        getView().mVolumeSeekbar.setOnSeekBarChangeListener(this);
    }
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:32,代码来源:RendererScreenPresenter.java


示例9: onVolumeChanged

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void onVolumeChanged(VolumeProviderCompat volumeProvider) {
    if (MediaSessionImplBase.this.mVolumeProvider == volumeProvider) {
        MediaSessionImplBase.this.sendVolumeInfoChanged(new ParcelableVolumeInfo(MediaSessionImplBase.this.mVolumeType, MediaSessionImplBase.this.mLocalStream, volumeProvider.getVolumeControl(), volumeProvider.getMaxVolume(), volumeProvider.getCurrentVolume()));
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:6,代码来源:MediaSessionCompat.java


示例10: isChangeable

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public boolean isChangeable() {
    return getVolumeControl() != VolumeProviderCompat.VOLUME_CONTROL_FIXED;
}
 
开发者ID:tanguyantoine,项目名称:react-native-music-control,代码行数:4,代码来源:MusicControlListener.java


示例11: CustomVolumeProvider

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public CustomVolumeProvider() {
    super(VolumeProviderCompat.VOLUME_CONTROL_ABSOLUTE, 100, 50);
    inactive = checkInactivity();
}
 
开发者ID:SpiritCroc,项目名称:Modular-Remote,代码行数:5,代码来源:GlobalActionHandler.java


示例12: setPlaybackToRemote

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void setPlaybackToRemote(VolumeProviderCompat volumeprovidercompat)
{
    MediaSessionCompatApi21.setPlaybackToRemote(mSessionObj, volumeprovidercompat.getVolumeProvider());
}
 
开发者ID:Hamz-a,项目名称:MyCTFWriteUps,代码行数:5,代码来源:MediaSessionCompat$MediaSessionImplApi21.java


示例13: setPlaybackToRemote

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public void setPlaybackToRemote(VolumeProviderCompat volumeProvider) {
}
 
开发者ID:kingargyle,项目名称:adt-leanback-support,代码行数:4,代码来源:MediaSessionCompat.java


示例14: getVolumeProvider

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public VolumeProviderCompat getVolumeProvider() {
    return null;
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:5,代码来源:LocalRenderer.java


示例15: setPlaybackToRemote

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
public void setPlaybackToRemote(VolumeProviderCompat volumeProviderCompat) {
    mProxy.setPlaybackToRemote(volumeProviderCompat);
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:4,代码来源:MediaSessionHolder.java


示例16: setPlaybackToRemote

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public void setPlaybackToRemote(VolumeProviderCompat volumeProviderCompat) {
    mSession.setPlaybackToRemote(volumeProviderCompat);
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:5,代码来源:MediaSessionHolderK.java


示例17: setPlaybackToRemote

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public void setPlaybackToRemote(VolumeProviderCompat volumeProviderCompat) {
    mSession.setPlaybackToRemote((VolumeProvider)volumeProviderCompat.getVolumeProvider());
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:5,代码来源:MediaSessionHolderL.java


示例18: getVolumeProvider

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public VolumeProviderCompat getVolumeProvider() {
    return mService.get().getVolumeProvider();
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:5,代码来源:CastRendererServiceBinder.java


示例19: getVolumeProvider

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
@Override
public VolumeProviderCompat getVolumeProvider() {
    setupVolumeProvider();
    return mVolumeProvider;
}
 
开发者ID:OpenSilk,项目名称:Orpheus,代码行数:6,代码来源:CastRendererService.java


示例20: getString

import android.support.v4.media.VolumeProviderCompat; //导入依赖的package包/类
/**
 * 获取字符串
 * @param context   上下文
 * @param attrRes   attrid
 * @return  String类型内容
 */
public static String getString(@NonNull Context context, @VolumeProviderCompat.ControlType int attrRes)
{
    return getTypedValue(context,attrRes).coerceToString().toString();
}
 
开发者ID:tyzlmjj,项目名称:Tools,代码行数:11,代码来源:AttrUtils.java



注:本文中的android.support.v4.media.VolumeProviderCompat类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CommandSummon类代码示例发布时间:2022-05-22
下一篇:
Java DocumentUndoManagerRegistry类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap