コード例 #1
0
ファイル: soundfile.cpp プロジェクト: Guildenstern/Tartini
void SoundFile::rec2play()
{
    stream->close();
    stream->open_read(filename);
    filteredStream->close();
    filteredStream->open_read(filteredFilename);
    //beginning();
    jumpToChunk(totalChunks());
    fprintf(stderr, "filteredFilename = %s\n", filteredFilename);
    fprintf(stderr, "totalChunks = %d\n", totalChunks());
}
コード例 #2
0
unsigned Aggregate::displayChunks() const {
    fancyprint(activeChunks() << "/" << totalChunks(),NOTIFY);

    int j = m_chunk.size();
    for(auto i=0;i<m_chunk.size();i++){
        uintmax_t lower = std::atoi(m_chunk[i]->file()->filename().c_str());
        uintmax_t down= m_chunk[i]->txn()->range().lb()+m_chunk[i]->txn()->bytesDone();
        uintmax_t higher = m_chunk[i]->txn()->range().ub();
        std::string myColor;

        if(m_chunk[i]->txn()->isComplete())
            myColor = SUCCESS;
        else if(m_chunk[i]->txn()->hasFailed())
            myColor = ERROR;
        else if(m_chunk[i]->txn()->isDownloading())
            myColor = WARNING;
        else
            myColor = NOTIFY;

        fancyprint(lower << ":" << down << ":"<< higher<< " ",myColor);
    }

    std::cout << progressbar(progress(),COLOR(0,CC::WHITE,CC::PURPLE),COLOR(0,CC::PURPLE,CC::WHITE));
    print( " " << round(progress(),2) << "%\t"
            << formatTime(timeRemaining()) << "\t"
            << formatByte(speed()) << "ps\t");

    return j+1;
}
コード例 #3
0
ファイル: soundfile.cpp プロジェクト: Guildenstern/Tartini
bool SoundFile::inFile()
{
    int c = currentChunk();
    return (c >= 0 && c < totalChunks());
}