本文整理汇总了C++中Project类的典型用法代码示例。如果您正苦于以下问题:C++ Project类的具体用法?C++ Project怎么用?C++ Project使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Project类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Clear
//-----------------------------------------------------------------------------
void GeneralPropertyGrid::RefreshOnProject ()
{
Clear();
Project *proj = Project::GetSingletonPtr();
if (!proj)
return;
mProjName = proj->GetName();
mProjWidth = proj->GetWidth();
mProjHeight = proj->GetHeight();
Float4 color = proj->GetColor();
mProjColor = Float3(color[0], color[1], color[2]);
mIsShowProjectInfo = proj->IsShowProjectInfo();
PropertyPage *page = AddPropertyPage("General");
page->AddProperty(PX2_LM.GetValue("Project"), Property::PT_CATEGORY, 0);
page->AddProperty(PX2_LM.GetValue("Name"), Property::PT_STRING, &mProjName,
false);
page->AddProperty(PX2_LM.GetValue("Width"), Property::PT_INT, &mProjWidth,
false);
page->AddProperty(PX2_LM.GetValue("Height"), Property::PT_INT,
&mProjHeight, false);
page->AddProperty(PX2_LM.GetValue("BackColor"), Property::PT_COLOR3FLOAT3,
&mProjColor);
page->AddProperty(PX2_LM.GetValue("Show"), Property::PT_CATEGORY, 0);
page->AddProperty(PX2_LM.GetValue("IsShowProjectInfo"),
Property::PT_BOOLCHECK, &mIsShowProjectInfo);
}
示例2: setMissingProjectProperties
void setMissingProjectProperties (Project& project) const
{
const String sanitisedProjectName (CodeHelpers::makeValidIdentifier (project.getTitle(), false, true, false));
setValueIfVoid (shouldBuildVST (project), true);
setValueIfVoid (shouldBuildAU (project), true);
setValueIfVoid (getPluginName (project), project.getTitle());
setValueIfVoid (getPluginDesc (project), project.getTitle());
setValueIfVoid (getPluginManufacturer (project), "yourcompany");
setValueIfVoid (getPluginManufacturerCode (project), "Manu");
setValueIfVoid (getPluginCode (project), "Plug");
setValueIfVoid (getPluginChannelConfigs (project), "{1, 1}, {2, 2}");
setValueIfVoid (getPluginIsSynth (project), false);
setValueIfVoid (getPluginWantsMidiInput (project), false);
setValueIfVoid (getPluginProducesMidiOut (project), false);
setValueIfVoid (getPluginSilenceInProducesSilenceOut (project), false);
setValueIfVoid (getPluginTailLengthSeconds (project), 0);
setValueIfVoid (getPluginEditorNeedsKeyFocus (project), false);
setValueIfVoid (getPluginAUExportPrefix (project), sanitisedProjectName + "AU");
setValueIfVoid (getPluginAUCocoaViewClassName (project), sanitisedProjectName + "AU_V1");
setValueIfVoid (getPluginRTASCategory (project), String::empty);
setValueIfVoid (project.getBundleIdentifier(), project.getDefaultBundleIdentifier());
setValueIfVoid (project.getAAXIdentifier(), project.getDefaultAAXIdentifier());
setValueIfVoid (getPluginAAXCategory (project), "AAX_ePlugInCategory_Dynamics");
}
示例3: project
void ProjectDialog::slotNext()
{
QWidget * vw = mStack->currentWidget();
if( vw == mPageOne ) {
Project p = project();
if( !p.isRecord() ){
if( p.name().isEmpty() ){
ResinError::nameEmpty( this, "Project Name" );
return;
}
if( Project::recordByName( p.name() ).isRecord() ){
ResinError::nameTaken( this, p.name() );
return;
}
if( p.shortName().isEmpty() ){
ResinError::nameEmpty( this, "Abbreviation" );
return;
}
}
mStack->setCurrentWidget( mPageTwo );
mPrevButton->show();
mOKButton->show();
mNextButton->hide();
} else
LOG_5( "ProjectDialog::slotNext(), error - should be mPageOne or mPageTwo" );
}
示例4: getAllPossibleModulePaths
static Array<File> getAllPossibleModulePaths (Project& project)
{
StringArray paths;
for (Project::ExporterIterator exporter (project); exporter.next();)
{
if (exporter->mayCompileOnCurrentOS())
{
for (int i = 0; i < project.getModules().getNumModules(); ++i)
{
const String path (exporter->getPathForModuleString (project.getModules().getModuleID (i)));
if (path.isNotEmpty())
paths.addIfNotAlreadyThere (path);
}
String oldPath (exporter->getLegacyModulePath());
if (oldPath.isNotEmpty())
paths.addIfNotAlreadyThere (oldPath);
}
}
Array<File> files;
for (int i = 0; i < paths.size(); ++i)
{
const File f (project.resolveFilename (paths[i]));
if (f.isDirectory())
{
files.add (f);
if (f.getChildFile ("modules").isDirectory())
files.addIfNotAlreadyThere (f.getChildFile ("modules"));
}
}
return files;
}
示例5: qDebug
int DBimpl::createProject(Project& project){
QSqlQuery query;
query.prepare(DatabaseQueries::insertProject);
query.bindValue(":projectName",project.getTitle());
query.bindValue(":description",project.getDescription());
query.bindValue(":minTeamSize",project.getMinTeamSize());
query.bindValue(":maxTeamSize",project.getMaxTeamSize());
query.bindValue(":results",0);
if(!query.exec())
{
qDebug() << query.lastError();
qDebug() << query.lastQuery();
return 0;
}
else {
int lastID = query.lastInsertId().toInt();
QList<Student*> students = project.getRegisteredStudents();
addStudentsToProject(lastID,&students);
project.setID(lastID);
return lastID;
}
}
示例6: GetDefaultResourcePaths
void BuildWindows::Initialize()
{
ToolSystem* tsystem = GetSubsystem<ToolSystem>();
Project* project = tsystem->GetProject();
Vector<String> defaultResourcePaths;
GetDefaultResourcePaths(defaultResourcePaths);
String projectResources = project->GetResourcePath();
for (unsigned i = 0; i < defaultResourcePaths.Size(); i++)
{
AddResourceDir(defaultResourcePaths[i]);
}
// TODO: smart filtering of cache
AddResourceDir(project->GetProjectPath() + "Cache/");
AddResourceDir(projectResources);
BuildResourceEntries();
}
示例7: AudioSource
// This constructor is called for existing (recorded/imported) audio sources
ReadSource::ReadSource(const QDomNode node)
: AudioSource()
{
set_state(node);
private_init();
Project* project = pm().get_project();
// FIXME The check below no longer makes sense!!!!!
// Check if the audiofile exists in our project audiosources dir
// and give it priority over the dir as given by the project.tpf file
// This makes it possible to move project directories without Traverso being
// unable to find it's audiosources!
if ( QFile::exists(project->get_root_dir() + "/audiosources/" + m_name) ||
QFile::exists(project->get_root_dir() + "/audiosources/" + m_name + "-ch0.wav") ) {
set_dir(project->get_root_dir() + "/audiosources/");
}
m_silent = (m_channelCount == 0);
}
示例8: GetDefaultResourcePaths
void BuildWindows::Initialize()
{
ToolSystem* tsystem = GetSubsystem<ToolSystem>();
Project* project = tsystem->GetProject();
Vector<String> defaultResourcePaths;
GetDefaultResourcePaths(defaultResourcePaths);
for (unsigned i = 0; i < defaultResourcePaths.Size(); i++)
{
AddResourceDir(defaultResourcePaths[i]);
}
BuildDefaultResourceEntries();
// Include the project resources and cache separately
AddProjectResourceDir(project->GetResourcePath());
AssetDatabase* db = GetSubsystem<AssetDatabase>();
String cachePath = db->GetCachePath();
AddProjectResourceDir(cachePath);
BuildProjectResourceEntries();
}
示例9: updateProject
int DBimpl::updateProject(const Project& project)
{
QSqlQuery query;
query.prepare(DatabaseQueries::updateProject);
query.bindValue(":projectName",project.getTitle());
query.bindValue(":description",project.getDescription());
query.bindValue(":minTeamSize",project.getMinTeamSize());
query.bindValue(":maxTeamSize",project.getMaxTeamSize());
query.bindValue(":projectID", project.getID());
if(!query.exec())
{
qDebug() << query.lastError();
qDebug() << query.lastQuery();
return 0;
}
else {
return 1;
}
}
示例10: execute
bool LocalTypeAnalysisPass::execute(UserProc *proc)
{
// Now we need to add the implicit assignments. Doing this earlier
// is extremely problematic, because of all the m[...] that change
// their sorting order as their arguments get subscripted or propagated into.
// Do this regardless of whether doing dfa-based TA, so things
// like finding parameters can rely on implicit assigns.
PassManager::get()->executePass(PassID::ImplicitPlacement, proc);
Project *project = proc->getProg()->getProject();
ITypeRecovery *rec = project->getTypeRecoveryEngine();
// Data flow based type analysis
// Want to be after all propagation, but before converting expressions to locals etc
if (rec && project->getSettings()->useTypeAnalysis) {
rec->recoverFunctionTypes(proc);
return true;
}
else {
return false;
}
}
示例11: getDependencies
static void getDependencies (Project& project, const String& moduleID, StringArray& dependencies)
{
ModuleDescription info (project.getModules().getModuleInfo (moduleID));
for (auto uid : info.getDependencies())
{
if (! dependencies.contains (uid, true))
{
dependencies.add (uid);
getDependencies (project, uid, dependencies);
}
}
}
示例12: run
void Linker :: run(Project& project, Image& image, ref_t tls_directory)
{
ImageInfo info(&project, &image);
info.entryPoint = image.getEntryPoint();
if (_mode64bit) {
createImportTable64(info);
}
else createImportTable(info);
mapImage(info);
fixImage(info);
Path path(project.StrSetting(opTarget));
if (emptystr(path))
throw InternalError(errEmptyTarget);
if (!createExecutable(info, path.c_str(), tls_directory))
project.raiseError(errCannotCreate, project.StrSetting(opTarget));
}
示例13: CheckCreateScript
bool ResourceOps::CheckCreateScript(const String& resourcePath, const String& resourceName, bool reportError)
{
Editor* editor = GetSubsystem<Editor>();
Project* project = editor->GetProject();
String fullpath = resourcePath + resourceName;
if (!resourceName.EndsWith(".js"))
fullpath += ".js";
FileSystem* fs = GetSubsystem<FileSystem>();
if (fs->FileExists(fullpath))
{
if (reportError)
{
String errorMsg;
errorMsg.AppendWithFormat("The script:\n\n%s\n\nalready exists", fullpath.CString());
editor->PostModalError("Create Script Error", errorMsg);
}
return false;
}
if (!project->IsScriptsDirOrFile(resourcePath))
{
if (reportError)
{
String errorMsg;
errorMsg.AppendWithFormat("Scripts must reside in or in a subfolder of the Scripts folder");
editor->PostModalError("Create Script Error", errorMsg);
}
return false;
}
return true;
}
示例14: K_ASSERT
Project* Project::CreateNewProject(const QString& projectFilePath)
{
QString file = projectFilePath;
if(!projectFilePath.endsWith(N_PROJECT_FILE_EXTENSION))
{
file.append(N_PROJECT_FILE_EXTENSION);
}
Project* result = DocumentInstance::CreateDocumentInstance<Project>(file);
K_ASSERT( result )
// Project layout is created here.
QDir projectRoot = result->fileInfo().dir();
if(!QFileInfo(projectRoot.path()).isWritable())
{
Kore::KoreEngine::Error(
tr("Could not create project !"),
tr("Project folder %s is not writable !").arg(projectRoot.path())
);
result->destroy();
return K_NULL;
}
// Create the resources folder.
projectRoot.mkdir(N_PROJECT_RESOURCES_FOLDER);
// Create the scenes folder.
projectRoot.mkdir(N_PROJECT_SCENES_FOLDER);
// Create the models folder.
projectRoot.mkdir(N_PROJECT_MODELS_FOLDER);
// TODO: Add default Project stuff (default scene, default model, default everything...)
return result;
}
示例15: Initialize
void BuildIOS::Initialize()
{
Editor* editor = GetSubsystem<Editor>();
Project* project = editor->GetProject();
FileSystem* fileSystem = GetSubsystem<FileSystem>();
#ifdef ATOMIC_PLATFORM_WINDOWS
String bundleResources = fileSystem->GetProgramDir();
#else
String bundleResources = fileSystem->GetAppBundleResourceFolder();
#endif
String projectResources = project->GetResourcePath();
String coreDataFolder = bundleResources + "CoreData/";
AddResourceDir(coreDataFolder);
AddResourceDir(projectResources);
BuildResourceEntries();
}