当前位置: 首页>>代码示例>>Java>>正文


Java PlayQueue.getCurrentFile方法代码示例

本文整理汇总了Java中net.sourceforge.subsonic.domain.PlayQueue.getCurrentFile方法的典型用法代码示例。如果您正苦于以下问题:Java PlayQueue.getCurrentFile方法的具体用法?Java PlayQueue.getCurrentFile怎么用?Java PlayQueue.getCurrentFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.sourceforge.subsonic.domain.PlayQueue的用法示例。


在下文中一共展示了PlayQueue.getCurrentFile方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doSet

import net.sourceforge.subsonic.domain.PlayQueue; //导入方法依赖的package包/类
public PlayQueueInfo doSet(HttpServletRequest request, HttpServletResponse response, int[] ids) throws Exception {
    Player player = getCurrentPlayer(request, response);
    PlayQueue playQueue = player.getPlayQueue();
    MediaFile currentFile = playQueue.getCurrentFile();
    PlayQueue.Status status = playQueue.getStatus();

    playQueue.clear();
    PlayQueueInfo result = doAdd(request, response, ids, null);

    int index = currentFile == null ? -1 : playQueue.getFiles().indexOf(currentFile);
    playQueue.setIndex(index);
    playQueue.setStatus(status);
    return result;
}
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:15,代码来源:PlayQueueService.java

示例2: prepare

import net.sourceforge.subsonic.domain.PlayQueue; //导入方法依赖的package包/类
private void prepare() throws IOException {
    PlayQueue playQueue = player.getPlayQueue();

    // If playlist is in auto-random mode, populate it with new random songs.
    if (playQueue.getIndex() == -1 && playQueue.getRandomSearchCriteria() != null) {
        populateRandomPlaylist(playQueue);
    }

    MediaFile result;
    synchronized (playQueue) {
        result = playQueue.getCurrentFile();
    }
    MediaFile file = result;
    if (file == null) {
        close();
    } else if (!file.equals(currentFile)) {
        close();
        LOG.info(player.getUsername() + " listening to \"" + FileUtil.getShortPath(file.getFile()) + "\"");
        mediaFileService.incrementPlayCount(file);

        // Don't scrobble REST players (except Sonos)
        if (player.getClientId() == null || player.getClientId().equals(SonosHelper.SUBSONIC_CLIENT_ID)) {
            audioScrobblerService.register(file, player.getUsername(), false, null);
        }

        TranscodingService.Parameters parameters = transcodingService.getParameters(file, player, maxBitRate, preferredTargetFormat, videoTranscodingSettings);
        currentInputStream = transcodingService.getTranscodedInputStream(parameters);
        currentFile = file;
        status.setFile(currentFile.getFile());
    }
}
 
开发者ID:sindremehus,项目名称:subsonic,代码行数:32,代码来源:PlayQueueInputStream.java

示例3: prepare

import net.sourceforge.subsonic.domain.PlayQueue; //导入方法依赖的package包/类
private void prepare() throws IOException {
    PlayQueue playQueue = player.getPlayQueue();

    // If playlist is in auto-random mode, populate it with new random songs.
    if (playQueue.getIndex() == -1 && playQueue.getRandomSearchCriteria() != null) {
        populateRandomPlaylist(playQueue);
    }

    MediaFile result;
    synchronized (playQueue) {
        result = playQueue.getCurrentFile();
    }
    MediaFile file = result;
    if (file == null) {
        close();
    } else if (!file.equals(currentFile)) {
        close();
        LOG.info(player.getUsername() + " listening to \"" + FileUtil.getShortPath(file.getFile()) + "\"");
        mediaFileService.incrementPlayCount(file);
        mediaFileService.updateStatisticsUser(player.getUsername(), file);

        if (player.getClientId() == null) {  // Don't scrobble REST players.
            audioScrobblerService.register(file, player.getUsername(), false, null);
        }

        TranscodingService.Parameters parameters = transcodingService.getParameters(file, player, maxBitRate, preferredTargetFormat, videoTranscodingSettings, true);
        currentInputStream = transcodingService.getTranscodedInputStream(parameters);
        currentFile = file;
        status.setFile(currentFile.getFile());
    }
}
 
开发者ID:FutureSonic,项目名称:FutureSonic-Server,代码行数:32,代码来源:PlayQueueInputStream.java


注:本文中的net.sourceforge.subsonic.domain.PlayQueue.getCurrentFile方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。