本文整理汇总了C++中StHandle::getPath方法的典型用法代码示例。如果您正苦于以下问题:C++ StHandle::getPath方法的具体用法?C++ StHandle::getPath怎么用?C++ StHandle::getPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StHandle
的用法示例。
在下文中一共展示了StHandle::getPath方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: anAutoLock
StHandle<StStereoParams> StPlayList::openRecent(const size_t theItemId) {
StMutexAuto anAutoLock(myMutex);
if(theItemId >= myRecent.size()) {
return StHandle<StStereoParams>();
}
const StHandle<StRecentItem> aRecent = myRecent[theItemId];
const StHandle<StFileNode> aFile = aRecent->File;
if(aFile->size() == 2) {
// stereo pair from two files
clear();
addOneFile(aFile->getValue(0)->getPath(),
aFile->getValue(1)->getPath());
} else if(aFile->size() == 1) {
// playlist
open(aFile->getPath(), aFile->getValue(0)->getSubPath());
} else {
// single file
open(aFile->getPath());
}
return aRecent->Params;
}
示例2: removePhysically
bool StPlayList::removePhysically(const StHandle<StFileNode>& theFileNode) {
StString aPath = theFileNode->getPath();
StPlayItem* aRemItem = NULL;
StMutexAuto anAutoLock(myMutex);
if(myCurrent == NULL) {
// empty playlist
return false;
} else if(aPath != myCurrent->getPath()) {
// search play item
for(StPlayItem* anItem = myFirst; anItem != NULL; anItem = anItem->getNext()) {
if(aPath == anItem->getPath()) {
aRemItem = anItem;
break;
}
}
} else {
// walk to another playlist position
aRemItem = myCurrent;
const bool aPlayedFlag = aRemItem->getPlayedFlag();
if(myCurrent->hasNext()) {
myCurrent = myCurrent->getNext();
} else if(myCurrent->hasPrev()) {
myCurrent = myCurrent->getPrev();
} else {
myCurrent = NULL;
myPlayedCount = 0;
}
if(myCurrent != NULL) {
if(aRemItem->getPlayedFlag() != aPlayedFlag) {
// the item has not been played yet - mark it as such
aRemItem->setPlayedFlag(aPlayedFlag);
} else {
// one played item has been removed
--myPlayedCount;
}
}
}
// remove item itself
const bool isDeleted = aRemItem != NULL
&& StFileNode::removeFile(aPath);
if(isDeleted) {
delPlayItem(aRemItem);
delete aRemItem;
}
anAutoLock.unlock();
signals.onPlaylistChange();
return isDeleted;
}
示例3: addToNode
void StPlayList::addToNode(const StHandle<StFileNode>& theFileNode,
const StString& thePathToAdd) {
StString aPath = theFileNode->getPath();
StMutexAuto anAutoLock(myMutex);
if(myCurrent == NULL) {
return;
} else if(aPath != myCurrent->getPath()) {
for(StPlayItem* anItem = myFirst; anItem != NULL; anItem = anItem->getNext()) {
if(aPath == anItem->getPath()) {
myCurrent = anItem;
break;
}
}
}
StFileNode* aFileNode = myCurrent->getFileNode();
if(aFileNode->getParent() != &myFoldersRoot) {
// convert filenode to metafile with empty root
aFileNode->reParent(&myFoldersRoot);
aFileNode->setSubPath(StString());
aFileNode->add(new StFileNode(aPath, aFileNode));
}
aFileNode->add(new StFileNode(thePathToAdd, aFileNode));
}
示例4: getResourceManager
bool StOutIZ3D::create() {
StWindow::show();
if(!StWindow::create()) {
return false;
}
// initialize GL context
myContext = StWindow::getContext();
myContext->setMessagesQueue(myMsgQueue);
const StHandle<StResourceManager>& aResMgr = getResourceManager();
if(!myContext->isGlGreaterEqual(2, 0)) {
myMsgQueue->pushError(stCString("OpenGL 2.0 is required by iZ3D Output"));
myIsBroken = true;
return true;
}
StWindow::stglMakeCurrent(ST_WIN_MASTER);
myContext->stglSetVSync((StGLContext::VSync_Mode )StWindow::params.VSyncMode->getValue());
StWindow::params.VSyncMode->signals.onChanged += stSlot(this, &StOutIZ3D::doSwitchVSync);
// INIT iZ3D tables textures
StAVImage aTableImg;
StHandle<StResource> aTableOld = aResMgr->getResource(StString("textures") + SYS_FS_SPLITTER + "iz3dTableOld.png");
uint8_t* aData = NULL;
int aDataSize = 0;
if(!aTableOld.isNull()
&& !aTableOld->isFile()
&& aTableOld->read()) {
aData = (uint8_t* )aTableOld->getData();
aDataSize = aTableOld->getSize();
}
if(!aTableImg.load(!aTableOld.isNull() ? aTableOld->getPath() : StString(), StImageFile::ST_TYPE_PNG, aData, aDataSize)) {
myMsgQueue->pushError(StString("iZ3D output - critical error:\n") + aTableImg.getState());
myIsBroken = true;
return true;
}
myTexTableOld.setMinMagFilter(*myContext, GL_NEAREST); // we need not linear filtrating for lookup-table!
if(!myTexTableOld.init(*myContext, aTableImg.getPlane())) {
myMsgQueue->pushError(stCString("iZ3D output - critical error:\nLookup-table initalization failed!"));
myIsBroken = true;
return true;
}
StHandle<StResource> aTableNew = aResMgr->getResource(StString("textures") + SYS_FS_SPLITTER + "iz3dTableNew.png");
aData = NULL;
aDataSize = 0;
if(!aTableNew.isNull()
&& !aTableNew->isFile()
&& aTableNew->read()) {
aData = (uint8_t* )aTableNew->getData();
aDataSize = aTableNew->getSize();
}
if(!aTableImg.load(!aTableNew.isNull() ? aTableNew->getPath() : StString(), StImageFile::ST_TYPE_PNG, aData, aDataSize)) {
myMsgQueue->pushError(StString("iZ3D output - critical error:\n") + aTableImg.getState());
myIsBroken = true;
return true;
}
myTexTableNew.setMinMagFilter(*myContext, GL_NEAREST); // we need not linear filtrating for lookup-table!
if(!myTexTableNew.init(*myContext, aTableImg.getPlane())) {
myMsgQueue->pushError(stCString("iZ3D output - critical error:\nLookup-table initalization failed!"));
myIsBroken = true;
return true;
}
// INIT shaders
if(!myShaders.init(*myContext)) {
myMsgQueue->pushError(stCString("iZ3D output - critical error:\nShaders initialization failed!"));
myIsBroken = true;
return true;
}
myIsBroken = false;
return true;
}