traverso-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Traverso-devel] Idea: Audio Import Option(Copy Audio File to Sessio


From: Remon | Traverso-DAW
Subject: Re: [Traverso-devel] Idea: Audio Import Option(Copy Audio File to Session Dir)
Date: Wed, 29 May 2019 12:59:21 +0200

Hello Renzhi,

Thanks for the suggestion.

We already have code in place to properly import audio files, see NewProjectDialog::copy_files()

As noted in that function, we need a dedicated Widget to show the user all available import options, including conversions to other formats/samplerate etc.

AudioFileCopyConvert.cpp does (most if not) all the copy/conversions for us.

Basically, we need a QWidget derived class that shows all the possible import options and re-use that in NewProjectDialog and a to be created TImportDialog

Hope this gives you some guidance, any suggestions are of course much appreciated


Best wishes,
Remon

Op wo 29 mei 2019 om 09:42 schreef 石任之 <address@hidden>:
1. WHY WE NEED IT
In most audio production scenario, we import many audio files that stored in
different directory among machine(environment) into the Traverso.

But when we bring the session to another  environment , all clips should be reseted one by one.

So copy the audio file into project will make the porject more self-included.

2. INTERACTION
 -1 When import Audio, show a dialog to ask user if copy audio files into Session dir.
 -2 Traverso show a ProgressDialog until finish copy operation.
 -3 This option can be set in Preference window.

3. HOW TO ARCHIEVE THAT
Just copy the file, and reset AudioSource path.
And find some place to store the settings.

I write some simple code like following...
===============================================================================
bool copyFile(QFile& srcFile, QFile& desFile, QProgressDialog& dialog)
{
    char* byteTemp = new char[4096];
    double totalCopySize = 0;

    QDataStream in(&srcFile);
    QDataStream out(&desFile);

    while (!in.atEnd())
    {
        int readSize = 0;
        readSize = in.readRawData(byteTemp, 4096);
        out.writeRawData(byteTemp, readSize);
        totalCopySize += readSize;

        dialog.setValue(int((totalprogress + totalCopySize) / totalSize * 100));

        QCoreApplication::processEvents();
        if(dialog.wasCanceled())
        {

            QMessageBox::critical(this, "Notice",
                                  "User Canceled Copy Operation",
                                  QMessageBox::Ok);

            break;
        }
    }
    if (totalCopySize == srcfileSize)
    {
        qDebug("success");
        totalprogress += srcfileSize;
        return true;
    }else {
        return false;
    }
}
===============================================================================
Any suggestion? Thanks.
Best regards.
Renzhi Shi
_______________________________________________
Traverso-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/traverso-devel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]