Esempio n. 1
0
void BaseTrackView::updateGuiElements(){
    if(!mainController){
        return;
    }
    Audio::AudioPeak peak = mainController->getTrackPeak(getTrackID());
    if(peak.getMax() > maxPeak.getMax()){
        maxPeak.update(peak);
        double db = 20 * std::log10(maxPeak.getMax());
        ui->peaksDbLabel->setText(QString::number(db, 'f', 0));
    }
    //update the track peaks
    setPeaks( peak.getLeft(), peak.getRight());

    //update the track processors. At moment the VST plugins gui are updated. Some plugins need this to run your animations (see Ez Drummer, for example);
    mainController->getTrackNode(getTrackID())->updateProcessorsGui();//call idle in VST plugins
}
Esempio n. 2
0
void NinjamTrackView::updateBoostValue()
{
    BaseTrackView::updateBoostValue();
    Audio::AudioNode *trackNode = mainController->getTrackNode(getTrackID());
    if (trackNode) {
        cacheEntry.setBoost(trackNode->getBoost());
        mainController->getUsersDataCache()->updateUserCacheEntry(cacheEntry);
    }
}
Esempio n. 3
0
void BaseTrackView::updateGuiElements()
{
    if (!mainController)
        return;

    Audio::AudioPeak peak = mainController->getTrackPeak(getTrackID());
    if (peak.getMax() > maxPeak.getMax()) {
        maxPeak.update(peak);
        double db = Utils::linearToDb(maxPeak.getMax());
        peaksDbLabel->setText(QString::number(db, 'f', 0));
    }
    // update the track peaks
    setPeaks(peak.getLeft(), peak.getRight());

    // update the track processors. In this moment the VST plugins GUI are updated. Some plugins need this to run your animations (see Ez Drummer, for example);
    Audio::AudioNode *trackNode = mainController->getTrackNode(getTrackID());
    if (trackNode)
        trackNode->updateProcessorsGui();  // call idle in VST plugins
}
Esempio n. 4
0
void BaseTrackView::updateBoostValue()
{
    float boostValue = 0;
    if (buttonBoostMinus12->isChecked())
        boostValue = -12;
    else if (buttonBoostPlus12->isChecked())
        boostValue = 12;
    if (mainController)
        mainController->setTrackBoost(getTrackID(), boostValue);
}
Esempio n. 5
0
void NinjamTrackView::setUnlightStatus(bool status)
{
    BaseTrackView::setUnlightStatus(status);
    chunksDisplay->setVisible(!status && chunksDisplay->isVisible());

    if (status) {// remote user stop xmiting and the track is greyed/unlighted?
        Audio::AudioNode *trackNode = mainController->getTrackNode(getTrackID());
        if (trackNode)
            trackNode->resetLastPeak(); // reset the internal node last peak to avoid getting the last peak calculated when the remote user was transmiting.
    }
}
Esempio n. 6
0
void BaseTrackView::onBoostButtonClicked(){
    float boostValue = 0;
    if(ui->buttonBoostMinus12->isChecked()){
        boostValue = -12;
    }
    else if(ui->buttonBoostPlus12->isChecked()){
        boostValue = 12;
    }
    if(mainController){
        mainController->setTrackBoost(getTrackID(), boostValue);
    }
}
Esempio n. 7
0
LocalTrackView::~LocalTrackView()
{
    if (mainController)
        mainController->removeInputTrackNode(getTrackID());
}
Esempio n. 8
0
void LocalTrackView::reset()
{
    mainController->resetTrack(getTrackID());
}
// Rendering the PVA_FF_Atom in proper format (bitlengths, etc.) to an ostream.
bool
PVA_FF_TrackHeaderAtom::renderToFileStream(MP4_AUTHOR_FF_FILE_IO_WRAP *fp)
{
    int32 rendered = 0; // Keep track of number of bytes rendered
    uint32 trackID = 0;
    // Render PVA_FF_Atom type and size
    if (!renderAtomBaseMembers(fp))
    {
        return false;
    }
    rendered += getDefaultSize();

    if (getVersion() == 0)
    {
        if (!PVA_FF_AtomUtils::render32(fp,
                                        Oscl_Int64_Utils::get_uint64_lower32(getCreationTime())))
        {
            return false;
        }

        if (!PVA_FF_AtomUtils::render32(fp,
                                        Oscl_Int64_Utils::get_uint64_lower32(getModificationTime())))

        {
            return false;
        }
    }
    else // getVersion() == 1
    {
        if (!PVA_FF_AtomUtils::render64(fp, getCreationTime()))
        {
            return false;
        }
        if (!PVA_FF_AtomUtils::render64(fp, getModificationTime()))
        {
            return false;
        }
    }

    trackID = getTrackID();


    if (!PVA_FF_AtomUtils::render32(fp, trackID))
    {
        return false;
    }


    if (getVersion() == 0)
    {
        rendered += 12;
    }
    else
    {
        rendered += 20;
    }

    if (!PVA_FF_AtomUtils::render32(fp, _reserved1))
    {
        return false;
    }
    rendered += 4;

    /*
     * To ensure that the total track duration includes the duration of the
     * last sample as well, which in our case is same as the last but one.
     */

    uint64 totalDuration = getDuration();

    if (totalDuration == 0)
    {
        totalDuration = _currTrackDuration;
    }

    if (getVersion() == 0)
    {
        if (!PVA_FF_AtomUtils::render32(fp,
                                        Oscl_Int64_Utils::get_uint64_lower32(totalDuration)))
        {
            return false;
        }

        rendered += 4;
    }
    else // getVersion() == 1
    {
        if (!PVA_FF_AtomUtils::render64(fp, totalDuration))
        {
            return false;
        }

        rendered += 8;
    }

    if (!PVA_FF_AtomUtils::render32(fp, _reserved2[0]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved2[1]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved2[2]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render16(fp, _reserved3))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render16(fp, _reserved4))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved5[0]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved5[1]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved5[2]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved5[3]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved5[4]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved5[5]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved5[6]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved5[7]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved5[8]))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved6))
    {
        return false;
    }
    if (!PVA_FF_AtomUtils::render32(fp, _reserved7))
    {
        return false;
    }
    rendered += 60;

    return true;
}
Esempio n. 10
0
void NinjamTrackView::toggleMuteStatus()
{
    BaseTrackView::toggleMuteStatus();
    cacheEntry.setMuted(mainController->getTrackNode(getTrackID())->isMuted());
    mainController->getUsersDataCache()->updateUserCacheEntry(cacheEntry);
}
Esempio n. 11
0
void NinjamTrackView::setPan(int value)
{
    BaseTrackView::setPan(value);
    cacheEntry.setPan(mainController->getTrackNode(getTrackID())->getPan());
    mainController->getUsersDataCache()->updateUserCacheEntry(cacheEntry);
}