Avid Pro Audio Community

Avid Pro Audio Community

How to Join & Post  •  Community Terms of Use  •  Help Us Help You

Knowledge Base Search  •  Community Search  •  Learn & Support


Avid Home Page

Go Back   Avid Pro Audio Community > Dev > Pro Tools Scripting SDK Toolkit

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 05-10-2023, 06:51 PM
0x07dc 0x07dc is offline
Member
 
Join Date: Mar 2023
Location: United State of America
Posts: 8
Default PtslCCppExport.h is missing (no file or directory)

I tried writing, compiling, and running the example program (in the root directory's README.md), but I am getting the error:

Code:
Source/CppPTSLClient.h(71): fatal error C1083: Cannot open include file: 'PtslCCppExport.h': No such file or directory
I understand that PtslCCppExport.h is located in WinBuild/Generated (for Windows), but I was wondering why following the example very specifically doesn't work. I am aware I could just include the absolute path, but that seems hacky and risks any form of code-portability to non-Windows systems.

Therefore, why am I getting this error, knowing I followed the example? I imagine when building the client, these issues regarding the OS should be taken care of, so the resulting code would be portable across operating systems.

For reference, the example program is:

Code:
#include "CppPTSLClient.h"

PTSLC_CPP::ClientConfig config {
    "localhost:31416",	// server address -- note the server port!
    false,				// turn off stand-alone mode -- look for a server instead of launching our own (see CppPTSLClient::LocateServer)
    false				// do not skip auto launch -- try to launch Pro Tools if it is not running already
};
auto client = std::make_unique<PTSLC_CPP::CppPTSLClient>(config);

PTSLC_CPP::RegisterConnectionRequest registrationReq;

registrationReq.companyName = "YOUR COMPANY NAME";
registrationReq.applicationName = "YOUR APPLICATION NAME";

auto registrationRsp = client->RegisterConnection(registrationReq);
parse_response(registrationRsp); 


//void Import(const ImportRequest& request);

PTSLC_CPP::ImportRequest request;
request.commandType = PTSLC_CPP::CommandType::Import;
request.sessionPath = "D:\\ProTools\\Library\\new_session\\new_session.ptx";
request.importType = PTSLC_CPP::ImportType::Session;
request.audioOptions = PTSLC_CPP::AudioMediaOptions::CopyFromSource;
request.audioHandleSize = 1000; // in ms
request.videoOptions = PTSLC_CPP::VideoMediaOptions::CopyFromSource;
request.matchOptions = PTSLC_CPP::MatchTrackOptions::ImportAsNewTrack;
request.playlistOptions = PTSLC_CPP::MainPlaylistOptions::ImportOverlayNewOnExistingPlaylists;
request.trackDataPresetPath = "D:\\ProTools\\Library\\Test\\Test.ptpreset";
request.clipGain = true;
request.clipsAndMedia = true;
request.volumeAutomation = true;



void parse_response(PTSLC_CPP::CommandResponse * rsp) {
    if(rsp) {
        if(rsp->status.type == PTSLC_CPP::CommandStatusType::Completed) {
            std::cout << "Command completed successfully!\n"
        }
        else {
            std::shared_ptr<PTSLC_CPP::CommandError> error = rsp->error;
            string errStr = error ? error->errorMessage : string();

            switch(rsp->status.type) {
                case CommandStatusType::CompletedWithBadResponse: {
                    std::cerr << "Command completed but returned an invalid response." << std::endl;
                    break;
                }
                case CommandStatusType::Failed: {
                    if(errStr.empty()) {
                        std::cerr << "Command failed with no error message." << std::endl;
                    }
                    else {
                        std::cerr << "Command failed with error message: " << errStr << std::endl;
                    }
                    break;
                }
                case CommandStatusType::FailedWithBadErrorResponse: {
                    std::cerr << "Command failed with a bad error response." << std::endl;
                    break;
                }
                default: break;
            }
        }
    }
    else {
        std::cerr << "Response pointer was null" << std::endl;
    }
}


int main(int argc, char *argv[]){
    auto response = client->Import(request);
    parse_response(response);
    return 0;
}
Reply With Quote
  #2  
Old 05-11-2023, 01:37 PM
0x07dc 0x07dc is offline
Member
 
Join Date: Mar 2023
Location: United State of America
Posts: 8
Default Re: PtslCCppExport.h is missing (no file or directory)

I found the answer. I was using the files in the Source directory. When I switched to using the include directory located in "install\Debug\PTSLC_CPP\include" the error was resolved.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No such file or directory (2) IrelandM Pro Tools 12 3 03-05-2021 01:05 PM
Plugin directory security weakness - check your plugin directory permissions Darryl Ramm macOS 13 01-21-2020 04:54 AM
No such file or directory (2) while creating "Plug-In Settings". SnakeyD2 Pro Tools 11 3 11-08-2016 11:12 AM
master PT audio file directory? tragibigzanda 003, Mbox 2, Digi 002, original Mbox, Digi 001 (Mac) 2 10-28-2009 01:11 PM
Normalized audio file in root directory avaldes 003, Mbox 2, Digi 002, original Mbox, Digi 001 (Mac) 0 05-14-2006 08:14 AM


All times are GMT -7. The time now is 05:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Limited. Forum Hosted By: URLJet.com