zeidu

好东西和大家一起分享,记录下来,以便以后有需要来拿。

百度网盘下载地址:

链接:https://pan.baidu.com/s/1ojqgkM6mHnFdOUgTs4XsTA
提取码:1234

备用下载地址:https://nzz.lanzous.com/i2qC9gjsr8d

 

  高度可定制的安卓音乐应用程序,音乐播放器有很多新的变化
  
  新特性:
  UI,修改了很多,一些大的改变和一些小型
  ——获取专辑封面文件之前从网上抓取
  ——能够编辑专辑,艺术家,播放列表和类型图像(长按图片)
  能见度——选项卡控件(只显示标签)
  ——抓住从web上可用的高质量图像
  ——能力选择小部件样式(完全黑暗或整体光)
  ——扩展的通知
  音频正在屏幕上可视化

<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">

    <!-- App name -->
    <string name="app_name">音乐播放器名称</string>

    <!-- Content descriptions for the Bottom Action Bar -->
    <string name="cd_favorite">标记为喜爱的</string>
    <string name="cd_search">搜索您的音乐库</string>
    <string name="cd_overflow">更多选项</string>
    <string name="cd_bottom_action_bar_album_art">专辑图片</string>
    <string name="cd_repeat">重复一首或全部</string>
    <string name="cd_previous">前一首</string>
    <string name="cd_play">暂停/继续</string>
    <string name="cd_next">下一首</string>
    <string name="cd_shuffle">随机播放</string>

    <!-- AudioPlayer title -->
    <string name="nowplaying">现在播放</string>

    <!-- Used to indicate the number of albums for an artist -->
    <plurals name="Nalbums">

        <!-- Number of albums is one -->
        <item quantity="one">1 张专辑</item>
        <!-- Number of albums is more than one -->
        <item quantity="other"><xliff:g id="count">%d</xliff:g> 张专辑</item>
    </plurals>

    <!-- Used to indicate the number of songs for an album -->

    <plurals name="Nsongs">

        <!-- Number of songs is one -->
        <item quantity="one">1 首歌曲</item>
        <item quantity="other"><xliff:g id="count">%d</xliff:g> 首歌曲</item>
    </plurals>

    <!-- Toasts after adding song(s) to playlists -->
    <plurals name="NNNtrackstoplaylist">
        <!-- message shown when one song was added -->
        <item quantity="one">1 首歌曲添加到播放列表.</item>
        <!-- message shown when zero or more than one song was added -->
        <item quantity="other"><xliff:g id="number" example="27">%d</xliff:g> 首歌曲添加到播放列表.</item>
    </plurals>

    <!-- Headers -->
    <string name="album_header">专辑列表</string>
    <string name="track_header">曲目列表</string>

    <!-- Options MenuItems -->
    <string name="settings">设置</string>
    <string name="shuffle_all">全部随机播放</string>
    <string name="share">分享</string>
    <string name="play_store">Play 商店</string>

    <!-- Set track as ringtone -->
    <string name="set_as_ringtone">\"<xliff:g id="name" example="Alarm Bell">%s</xliff:g>\" 设置为手机铃声</string>

    <!-- Transient popup message shown after renaming a playlist -->
    <string name="rename_playlist">重命名播放列表</string>

    <!-- Shuffle and repeat messages -->
    <string name="repeat_one">重复播放当前歌曲</string>
    <string name="repeat_all">重复播放所有歌曲</string>
    <string name="repeat_off">重复播放已关闭</string>
    <string name="shuffle_off">随机播放已关闭</string>
    <string name="shuffle_on">重复播放已开启</string>

    <!-- Share Intent -->
    <string name="now_listening_to">现在播放:</string>
    <string name="by">艺术家:</string>
    <string name="share_track_using">分享此曲目</string>

    <!-- ContextMenu items -->
    <string name="play_all">全部播放</string>
    <string name="add_to_playlist">添加到播放列表</string>
    <string name="use_as_ringtone">设置为手机铃声</string>
    <string name="delete_playlist">删除播放列表</string>
    <string name="search">搜索</string>
    <string name="remove">从播放列表中移除</string>

    <!-- App Widgets -->
    <string name="apollo_1x1">Apollo (1x1)</string>
    <string name="apollo_4x1">Apollo (4x1)</string>
    <string name="apollo_4x2">Apollo (4x2)</string>

    <!-- Unknown genre name -->
    <string name="unknown">未知</string>

    <!-- Settings -->
    <string name="about">关于 Apollo</string>
    <string name="eqalizer">均衡器</string>
    <string name="header_interface">界面</string>
    <string name="themes">主题</string>
    <string name="apollo_themes">选择 Apollo 的主题</string>
    <string name="select_theme">选择您的主题</string>
    <string name="version">Apollo 版本</string>

    <!-- Theme layout Buttons -->
    <string name="apply_theme">应用主题</string>
    <string name="get_more_themes">下载更多主题</string>

    <!-- Playlists menu -->
    <string name="favorite">喜爱</string>
    <string name="queue">队列</string>
    <string name="new_playlist">新建</string>
    <string name="new_playlist_name_template">播放列表 <xliff:g id="number">%d</xliff:g></string>
    <string name="save">保存</string>
    <string name="overwrite">覆盖</string>

    <!-- Tabs -->
    <string name="tab_recent">最近</string>
    <string name="tab_artists">艺术家</string>
    <string name="tab_albums">专辑</string>
    <string name="tab_songs">歌曲</string>
    <string name="tab_playlists">播放列表</string>
    <string name="tab_genres">流派</string>

    <!-- Something went wrong -->
    <string name="error">错误</string>

    <!-- External file dialog -->
    <string name="play_external_question_msg">选择应用于: \n\n<b><xliff:g id="name">%s</xliff:g></b>的操作</string>
    <string name="play_external_question_button_play">播放</string>
    <string name="play_external_question_button_queue">队列</string>
    <string name="play_external_question_button_cancel">取消</string>
    <string name="play_external_error">无法播放文件</string>

</resources>
    private void reloadQueue() {
        String q = null;

        int id = mCardId;
        if (mPreferences.contains("cardid")) {
            id = mPreferences.getInt("cardid", ~mCardId);
        }
        if (id == mCardId) {
            // Only restore the saved playlist if the card is still
            // the same one as when the playlist was saved
            q = mPreferences.getString("queue", "");
        }
        int qlen = q != null ? q.length() : 0;
        if (qlen > 1) {
            // Log.i("@@@@ service", "loaded queue: " + q);
            int plen = 0;
            int n = 0;
            int shift = 0;
            for (int i = 0; i < qlen; i++) {
                char c = q.charAt(i);
                if (c == \';\') {
                    ensurePlayListCapacity(plen + 1);
                    mPlayList[plen] = n;
                    plen++;
                    n = 0;
                    shift = 0;
                } else {
                    if (c >= \'0\' && c <= \'9\') {
                        n += ((c - \'0\') << shift);
                    } else if (c >= \'a\' && c <= \'f\') {
                        n += ((10 + c - \'a\') << shift);
                    } else {
                        // bogus playlist data
                        plen = 0;
                        break;
                    }
                    shift += 4;
                }
            }
            mPlayListLen = plen;

            int pos = mPreferences.getInt("curpos", 0);
            if (pos < 0 || pos >= mPlayListLen) {
                // The saved playlist is bogus, discard it
                mPlayListLen = 0;
                return;
            }
            mPlayPos = pos;

            // When reloadQueue is called in response to a card-insertion,
            // we might not be able to query the media provider right away.
            // To deal with this, try querying for the current file, and if
            // that fails, wait a while and try again. If that too fails,
            // assume there is a problem and don\'t restore the state.
            Cursor crsr = MusicUtils.query(this, Audio.Media.EXTERNAL_CONTENT_URI, new String[] {
                "_id"
            }, "_id=" + mPlayList[mPlayPos], null, null);
            if (crsr == null || crsr.getCount() == 0) {
                // wait a bit and try again
                SystemClock.sleep(3000);
                crsr = getContentResolver().query(Audio.Media.EXTERNAL_CONTENT_URI, mCursorCols,
                        "_id=" + mPlayList[mPlayPos], null, null);
            }
            if (crsr != null) {
                crsr.close();
            }

            // Make sure we don\'t auto-skip to the next song, since that
            // also starts playback. What could happen in that case is:
            // - music is paused
            // - go to UMS and delete some files, including the currently
            // playing one
            // - come back from UMS
            // (time passes)
            // - music app is killed for some reason (out of memory)
            // - music service is restarted, service restores state, doesn\'t
            // find
            // the "current" file, goes to the next and: playback starts on its
            // own, potentially at some random inconvenient time.
            mOpenFailedCounter = 20;
            mQuietMode = true;
            openCurrentAndNext();
            mQuietMode = false;
            if (!mPlayer.isInitialized()) {
                // couldn\'t restore the saved state
                mPlayListLen = 0;
                return;
            }

            long seekpos = mPreferences.getLong("seekpos", 0);
            seek(seekpos >= 0 && seekpos < duration() ? seekpos : 0);
            Log.d(LOGTAG, "restored queue, currently at position " + position() + "/" + duration()
                    + " (requested " + seekpos + ")");

            int repmode = mPreferences.getInt("repeatmode", REPEAT_NONE);
            if (repmode != REPEAT_ALL && repmode != REPEAT_CURRENT) {
                repmode = REPEAT_NONE;
            }
            mRepeatMode = repmode;

            int shufmode = mPreferences.getInt("shufflemode", SHUFFLE_NONE);
            if (shufmode != SHUFFLE_AUTO && shufmode != SHUFFLE_NORMAL) {
                shufmode = SHUFFLE_NONE;
            }
            if (shufmode != SHUFFLE_NONE) {
                // in shuffle mode we need to restore the history too
                q = mPreferences.getString("history", "");
                qlen = q != null ? q.length() : 0;
                if (qlen > 1) {
                    plen = 0;
                    n = 0;
                    shift = 0;
                    mHistory.clear();
                    for (int i = 0; i < qlen; i++) {
                        char c = q.charAt(i);
                        if (c == \';\') {
                            if (n >= mPlayListLen) {
                                // bogus history data
                                mHistory.clear();
                                break;
                            }
                            mHistory.add(n);
                            n = 0;
                            shift = 0;
                        } else {
                            if (c >= \'0\' && c <= \'9\') {
                                n += ((c - \'0\') << shift);
                            } else if (c >= \'a\' && c <= \'f\') {
                                n += ((10 + c - \'a\') << shift);
                            } else {
                                // bogus history data
                                mHistory.clear();
                                break;
                            }
                            shift += 4;
                        }
                    }
                }
            }
            if (shufmode == SHUFFLE_AUTO) {
                if (!makeAutoShuffleList()) {
                    shufmode = SHUFFLE_NONE;
                }
            }
            mShuffleMode = shufmode;
        }
    }

 

分类:

技术点:

相关文章: