Exemple #1
0
void PageOutput::OnBrowse() {

	QString filters;
	for(int i = 0; i < CONTAINER_OTHER; ++i) {
		if(i != 0)
			filters += ";;";
		filters += m_containers[i].filter;
	}
	for(unsigned int i = 0; i < m_containers_av.size(); ++i) {
		if(!m_containers_av[i].filter.isEmpty())
			filters += ";;" + m_containers_av[i].filter;
	}

	enum_container container = GetContainer();
	unsigned int container_av = GetContainerAV();
	QString selected_filter = (container == CONTAINER_OTHER)? m_containers_av[container_av].filter : m_containers[container].filter;
	QString selected_file = QFileDialog::getSaveFileName(this, tr("Save recording as"),
		GetFile(), filters, &selected_filter, QFileDialog::DontConfirmOverwrite);

	if(selected_file.isNull())
		return;

	m_lineedit_file->clear();
	QFileInfo fi(selected_file);
	if(fi.suffix().isEmpty()) {
		QStringList suffixes = (container == CONTAINER_OTHER)? m_containers_av[container_av].suffixes : m_containers[container].suffixes;
		if(!suffixes.isEmpty())
			selected_file += "." + suffixes[0];
	} else {
		bool found = false;
		for(int i = 0; i < CONTAINER_OTHER; ++i) {
			if(m_containers[i].suffixes.contains(fi.suffix(), Qt::CaseInsensitive)) {
				SetContainer((enum_container) i);
				found = true;
				break;
			}
		}
		if(!found) {
			for(unsigned int i = 0; i < m_containers_av.size(); ++i) {
				if(m_containers_av[i].suffixes.contains(fi.suffix(), Qt::CaseInsensitive)) {
					SetContainer(CONTAINER_OTHER);
					SetContainerAV(i);
					break;
				}
			}
		}
	}
	SetFile(selected_file);

	OnUpdateContainerFields();

}
void
PIInspectorTable::SetElementSelf(
	DMElement*	inElement)
{

	// Validate pointers.

	ValidateThis_();
	ValidateObject_(inElement);

	// Sanity check: Make sure we have an object.

	DMObject* object = (dynamic_cast<DMObject*>(inElement));
	ValidateObject_(object);
	
	// Okay, it's an object. Create type views for all of its attributes.

	SetContainer(object);
	
	// See if there's an inspected object caption. If so, change its name.
	
	if (mInspectedObjectCaption != nil) {
	
		ValidateObject_(mInspectedObjectCaption);
		
		LStr255 displayableName;
		inElement->GetDisplayableName(displayableName);
		mInspectedObjectCaption->SetDescriptor(displayableName);
		mInspectedObjectCaption->Refresh();
	
	}
}
void
CLTypeEntryItem::SetElementSelf(
	DMElement*	inElement)
{
	
	// Validate pointers.
	
	ValidateThis_();
	ValidateObject_(inElement);
	
	// Make sure we really have a VETypeEntry.

	mTypeEntry = (dynamic_cast<VETypeEntry*>(inElement));
	ValidateObject_(mTypeEntry);

	// See how we're sorting the classes. If it's alphabetical,
	// we don't need to specify the container for subclasses.
	
	CLDisplayClassTable* table = (dynamic_cast<CLDisplayClassTable*>(mOVTable));
	ValidateObject_(table);
	
	if (!table->GetAlphabeticDisplay()) {
	
		// Hierarchical sort: Specify container for submodels.
	
		DMElement* subComponents = mTypeEntry->GetSubClasses();
		if (subComponents != nil) {
			mExpanded = true;
			SetSubItemComparator(new CLClassNameComparator);
			SetContainer(subComponents);
		}
	}
}
Exemple #4
0
VOID SysInterceptNtRoutine(
	
	PVOID des,
	PVOID container,
	PVOID containerBH
){

	UCHAR *pChar = NULL;
	ULONG offset = 0L;

	if ( !des || !container || !containerBH ) return ;

	SetContainer( des, container );

	FillWithNop( containerBH, 6 );

#if 1
	
	pChar = des;
	*pChar = 0xe9;	pChar++;

	offset = ( ULONG)container -( ULONG)des -5;
	FillOffset( pChar, offset, sizeof( ULONG) );
	
#endif 	

}
Exemple #5
0
Request::RequestDialog::RequestDialog(const char *title,
                                      const char *primary, const char *secondary, const char *ok_text,
                                      GCallback ok_cb, const char *cancel_text, GCallback cancel_cb,
                                      void *user_data)
    : SplitDialog(title), ok_cb(ok_cb), cancel_cb(cancel_cb), user_data(user_data)
{
    SetColorScheme("generalwindow");

    lbox = new CppConsUI::ListBox(AUTOSIZE, AUTOSIZE);
    if (primary)
        lbox->AppendWidget(*(new CppConsUI::Label(AUTOSIZE, 1, primary)));
    if (primary && secondary)
        lbox->AppendWidget(*(new CppConsUI::Spacer(AUTOSIZE, 1)));
    if (secondary)
        lbox->AppendWidget(*(new CppConsUI::Label(AUTOSIZE, 1, secondary)));
    if (primary || secondary)
        lbox->AppendWidget(*(new CppConsUI::HorizontalLine(AUTOSIZE)));
    SetContainer(*lbox);

    if (ok_text)
        AddButton(ok_text, RESPONSE_OK);
    if (ok_text && cancel_text)
        AddSeparator();
    if (cancel_text)
        AddButton(cancel_text, RESPONSE_CANCEL);
    signal_response.connect(sigc::mem_fun(this,
                                          &RequestDialog::ResponseHandler));
}
Exemple #6
0
bool GPIOServoFunction::SetCalibrationPosition(GPIOServoFunctionServo Servo, GPIOServoFunctionPosition Position) {
	if (Servo != GPIOServoFunctionServoNone && Position != GPIOServoFunctionPositionNone) {
		_CurrentCalibrationSets[Servo]->SetPosition(Position);
		int Pos = _CurrentCalibrationSets[Servo]->GetValueForPosition(Position);
		return SetContainer(GPIO::InternalFunctions::GPIOServoFunctionContainer((Servo == GPIOServoFunctionServoLeft ? Pos : -1), (Servo == GPIOServoFunctionServoRight ? Pos : -1), false), true, true);
	}
	return false;
}
void SGameplayTagWidget::VerifyAssetTagValidity()
{
	FGameplayTagContainer LibraryTags;

	// Create a set that is the library of all valid tags
	TArray< TSharedPtr<FGameplayTagNode> > NodeStack;

	UGameplayTagsManager& TagsManager = IGameplayTagsModule::Get().GetGameplayTagsManager();
	
	TagsManager.GetFilteredGameplayRootTags(TEXT(""), NodeStack);

	while (NodeStack.Num() > 0)
	{
		TSharedPtr<FGameplayTagNode> CurNode = NodeStack.Pop();
		if (CurNode.IsValid())
		{
			LibraryTags.AddTag(TagsManager.RequestGameplayTag(CurNode->GetCompleteTag()));
			NodeStack.Append(CurNode->GetChildTagNodes());
		}
	}

	// Find and remove any tags on the asset that are no longer in the library
	for (int32 ContainerIdx = 0; ContainerIdx < TagContainers.Num(); ++ContainerIdx)
	{
		UObject* OwnerObj = TagContainers[ContainerIdx].TagContainerOwner.Get();
		FGameplayTagContainer* Container = TagContainers[ContainerIdx].TagContainer;

		if (Container)
		{
			FGameplayTagContainer EditableContainer = *Container;
			FGameplayTagContainer InvalidTags;
			for (auto It = Container->CreateConstIterator(); It; ++It)
			{
				if (!LibraryTags.HasTag(*It, EGameplayTagMatchType::Explicit, EGameplayTagMatchType::Explicit))
				{
					InvalidTags.AddTag(*It);
				}
			}
			if (InvalidTags.Num() > 0)
			{
				FString InvalidTagNames;

				for (auto InvalidIter = InvalidTags.CreateConstIterator(); InvalidIter; ++InvalidIter)
				{
					EditableContainer.RemoveTag(*InvalidIter);
					InvalidTagNames += InvalidIter->ToString() + TEXT("\n");
				}
				SetContainer(Container, &EditableContainer, OwnerObj);

				FFormatNamedArguments Arguments;
				Arguments.Add(TEXT("Objects"), FText::FromString( InvalidTagNames ));
				FText DialogText = FText::Format( LOCTEXT("GameplayTagWidget_InvalidTags", "Invalid Tags that have been removed: \n\n{Objects}"), Arguments );
				OpenMsgDlgInt( EAppMsgType::Ok, DialogText, LOCTEXT("GameplayTagWidget_Warning", "Warning") );
			}
		}
	}
}
void SGameplayTagWidget::OnTagUnchecked(TSharedPtr<FGameplayTagNode> NodeUnchecked)
{
	FScopedTransaction Transaction( LOCTEXT("GameplayTagWidget_RemoveTags", "Remove Gameplay Tags"));
	if (NodeUnchecked.IsValid())
	{
		UGameplayTagsManager& TagsManager = IGameplayTagsModule::Get().GetGameplayTagsManager();

		for (int32 ContainerIdx = 0; ContainerIdx < TagContainers.Num(); ++ContainerIdx)
		{
			UObject* OwnerObj = TagContainers[ContainerIdx].TagContainerOwner.Get();
			FGameplayTagContainer* Container = TagContainers[ContainerIdx].TagContainer;
			FGameplayTag Tag = TagsManager.RequestGameplayTag(NodeUnchecked->GetCompleteTag());

			if (Container)
			{
				FGameplayTagContainer EditableContainer = *Container;
				EditableContainer.RemoveTag(Tag);

				TWeakPtr<FGameplayTagNode> ParentNode = NodeUnchecked->GetParentTagNode();
				if (ParentNode.IsValid())
				{
					// Check if there are other siblings before adding parent
					bool bOtherSiblings = false;
					for (auto It = ParentNode.Pin()->GetChildTagNodes().CreateConstIterator(); It; ++It)
					{
						Tag = TagsManager.RequestGameplayTag(It->Get()->GetCompleteTag());
						if (EditableContainer.HasTag(Tag, EGameplayTagMatchType::Explicit, EGameplayTagMatchType::Explicit))
						{
							bOtherSiblings = true;
							break;
						}
					}
					// Add Parent
					if (!bOtherSiblings)
					{
						Tag = TagsManager.RequestGameplayTag(ParentNode.Pin()->GetCompleteTag());
						EditableContainer.AddTag(Tag);
					}
				}

				// Uncheck Children
				for (const auto& ChildNode : NodeUnchecked->GetChildTagNodes())
				{
					UncheckChildren(ChildNode, EditableContainer);
				}

				SetContainer(Container, &EditableContainer, OwnerObj);
			}
			
		}
	}
}
Exemple #9
0
void PageOutput::LoadProfileSettings(QSettings* settings) {

	// choose default container and codecs
	enum_container default_container = (enum_container) 0;
	for(unsigned int i = 0; i < VIDEO_CODEC_COUNT; ++i) {
		if(AVFormatIsInstalled(m_containers[i].avname)) {
			default_container = (enum_container) i;
			break;
		}
	}
	enum_video_codec default_video_codec = (enum_video_codec) 0;
	for(unsigned int i = 0; i < VIDEO_CODEC_COUNT; ++i) {
		if(AVCodecIsInstalled(m_video_codecs[i].avname) && m_containers[default_container].supported_video_codecs.count((enum_video_codec) i)) {
			default_video_codec = (enum_video_codec) i;
			break;
		}
	}
	enum_audio_codec default_audio_codec = (enum_audio_codec) 0;
	for(unsigned int i = 0; i < AUDIO_CODEC_COUNT; ++i) {
		if(AVCodecIsInstalled(m_audio_codecs[i].avname) && m_containers[default_container].supported_audio_codecs.count((enum_audio_codec) i)) {
			default_audio_codec = (enum_audio_codec) i;
			break;
		}
	}

	// load settings
	SetFile(settings->value("output/file", "").toString());
	SetSeparateFiles(settings->value("output/separate_files", false).toBool());
	SetContainer(StringToEnum(settings->value("output/container", QString()).toString(), default_container));
	SetContainerAV(FindContainerAV(settings->value("output/container_av", QString()).toString()));

	SetVideoCodec(StringToEnum(settings->value("output/video_codec", QString()).toString(), default_video_codec));
	SetVideoCodecAV(FindVideoCodecAV(settings->value("output/video_codec_av", QString()).toString()));
	SetVideoKBitRate(settings->value("output/video_kbit_rate", 5000).toUInt());
	SetH264CRF(settings->value("output/video_h264_crf", 23).toUInt());
	SetH264Preset((enum_h264_preset) settings->value("output/video_h264_preset", H264_PRESET_SUPERFAST).toUInt());
	SetVP8CPUUsed(settings->value("output/video_vp8_cpu_used", 5).toUInt());
	SetVideoOptions(settings->value("output/video_options", "").toString());
	SetVideoAllowFrameSkipping(settings->value("output/video_allow_frame_skipping", true).toBool());

	SetAudioCodec(StringToEnum(settings->value("output/audio_codec", QString()).toString(), default_audio_codec));
	SetAudioCodecAV(FindAudioCodecAV(settings->value("output/audio_codec_av", QString()).toString()));
	SetAudioKBitRate(settings->value("output/audio_kbit_rate", 128).toUInt());
	SetAudioOptions(settings->value("output/audio_options", "").toString());

	// update things
	OnUpdateContainerFields();
	OnUpdateVideoCodecFields();
	OnUpdateAudioCodecFields();

}
Exemple #10
0
void ChMatterSPH::AddNode(ChVector<double> initial_state) {
    auto newp = std::make_shared<ChNodeSPH>();

    newp->SetContainer(this);

    newp->SetPos(initial_state);

    nodes.push_back(newp);

    newp->variables.SetUserData((void*)this);  // UserData unuseful in future cuda solver?

    newp->collision_model->AddPoint(0.1);  //***TEST***
    newp->collision_model->BuildModel();   // will also add to system, if collision is on.
}
Exemple #11
0
bool GPIOServoFunction::SetEmotion (GPIOServoFunctionEmotion Emotion) {
	if (_CurrentEmotion != Emotion) {
		GPIOServoFunctionContainer::EmotionMap::const_iterator it = GPIOEmotions.find(Emotion);
		if (it != GPIOEmotions.end()) {
			const GPIOServoFunctionContainer &Degree = it->second;

			if (Degree.Right > -1 || Degree.Left > -1) {
				return SetContainer(Degree);
			}
		}
	}

	return false;
}
FReply SGameplayTagWidget::OnClearAllClicked()
{
	FScopedTransaction Transaction( LOCTEXT("GameplayTagWidget_RemoveAllTags", "Remove All Gameplay Tags") );

	for (int32 ContainerIdx = 0; ContainerIdx < TagContainers.Num(); ++ContainerIdx)
	{
		UObject* OwnerObj = TagContainers[ContainerIdx].TagContainerOwner.Get();
		FGameplayTagContainer* Container = TagContainers[ContainerIdx].TagContainer;

		if (Container)
		{
			FGameplayTagContainer EmptyContainer;
			SetContainer(Container, &EmptyContainer, OwnerObj);
		}
	}
	return FReply::Handled();
}
void SGameplayTagWidget::OnTagChecked(TSharedPtr<FGameplayTagNode> NodeChecked)
{
	FScopedTransaction Transaction( LOCTEXT("GameplayTagWidget_AddTags", "Add Gameplay Tags") );

	UGameplayTagsManager& TagsManager = IGameplayTagsModule::Get().GetGameplayTagsManager();

	for (int32 ContainerIdx = 0; ContainerIdx < TagContainers.Num(); ++ContainerIdx)
	{
		TWeakPtr<FGameplayTagNode> CurNode(NodeChecked);
		UObject* OwnerObj = TagContainers[ContainerIdx].TagContainerOwner.Get();
		FGameplayTagContainer* Container = TagContainers[ContainerIdx].TagContainer;

		if (Container)
		{
			FGameplayTagContainer EditableContainer = *Container;

			bool bRemoveParents = false;

			while (CurNode.IsValid())
			{
				FGameplayTag Tag = TagsManager.RequestGameplayTag(CurNode.Pin()->GetCompleteTag());

				if (bRemoveParents == false)
				{
					bRemoveParents = true;
					if (bMultiSelect == false)
					{
						EditableContainer.RemoveAllTags();
					}
					EditableContainer.AddTag(Tag);
				}
				else
				{
					EditableContainer.RemoveTag(Tag);
				}

				CurNode = CurNode.Pin()->GetParentTagNode();
			}
			SetContainer(Container, &EditableContainer, OwnerObj);
		}
	}
}
Exemple #14
0
StagePanel::StagePanel(wxWindow* parent, wxTopLevelWindow* frame,
					   ee::PropertySettingPanel* property,
					   LibraryPanel* library)
	: EditPanel(parent, frame)
	, ee::SpritesPanelImpl(GetStageImpl())
	, m_sym()
	, m_library(library)
{
	m_sym = std::make_shared<Symbol>();
	SetContainer(std::make_shared<SymbolContainer>(m_sym));

	SetEditOP(std::make_shared<ee::ArrangeSpriteOP<SelectSpritesOP>>(
		this, GetStageImpl(), this, property, nullptr, ee::ArrangeSpriteConfig(), new ArrangeSpriteImpl(this, property)));

	SetCanvas(std::make_shared<StageCanvas>(this, library));

	SetDropTarget(new ee::StageDropTarget(this, GetStageImpl(), library));

	ee::MODULE_STAGE.impl = this;

	RegistSubject(ee::ClearSpriteSJ::Instance());
}
Exemple #15
0
SItemPanel::SItemPanel(SWindow *pFrameHost,pugi::xml_node xmlNode,IItemContainer *pItemContainer)
    :m_pFrmHost(pFrameHost)
    ,m_pItemContainer(pItemContainer)
    ,m_dwData(0)
    ,m_crBk(CR_INVALID)
    ,m_crHover(CR_INVALID)
    ,m_crSelBk(RGBA(0,0,128,255))
    ,m_lpItemIndex(-1)
{
    SASSERT(m_pFrmHost);
    SASSERT(m_pItemContainer);
    SetContainer(this);
    if(xmlNode) 
    {
        InitFromXml(xmlNode);
        BuildWndTreeZorder();
    }
    m_evtSet.addEvent(EVENTID(EventItemPanelClick));
    m_evtSet.addEvent(EVENTID(EventItemPanelDbclick));
    m_evtSet.addEvent(EVENTID(EventItemPanelRclick));
    m_evtSet.addEvent(EVENTID(EventItemPanelHover));
    m_evtSet.addEvent(EVENTID(EventItemPanelLeave));
}
void
CLDisplayClassTable::SetElementSelf(
	DMElement*	inElement)
{

	// Validate pointers.
	
	ValidateThis_();
	ValidateObject_(inElement);

	// Sanity check: Make sure we have a type list.

	mCatalogPage = (dynamic_cast<VECatalogPage*>(inElement));
	ValidateObject_(mCatalogPage);
	
	// Okay, it's a catalog page. Create type views for all of its classes.

	if (mAlphabeticSort)
		AddSubClasses(mCatalogPage);
	else
		SetContainer(mCatalogPage->GetSubClasses());

}
void
VEHierOutlineItem::SetElementSelf(
	DMElement*	inElement)
{
	
	// Validate pointers.
	
	ValidateThis_();
	ValidateObject_(inElement);
	
	// Make sure we really have a VEModelObject.

	mModelObject = (dynamic_cast<VEModelObject*>(inElement));
	ValidateObject_(mModelObject);

	// Specify container for submodels.
	
	DMElement* subPanes = mModelObject->GetSubObjectList();
	if (subPanes != nil) {
		ValidateObject_(subPanes);
		mExpanded = true;
		SetContainer(subPanes);
	}
}
Exemple #18
0
StagePanel::StagePanel(wxWindow* parent, wxTopLevelWindow* frame,
					   const std::shared_ptr<Symbol>& sym,
					   ee::PropertySettingPanel* property,
					   LibraryPanel* library,
					   wxGLContext* glctx,
					   ee::CrossGuides* guides)
	: EditPanel(parent, frame)
	, m_sym(sym)
	, ee::SpritesPanelImpl(GetStageImpl())
	, m_library(library)
{
	SetContainer(std::make_shared<SymbolContainer>(m_sym));

	auto editop = std::make_shared<ee::ArrangeSpriteOP<SelectSpritesOP>>(
		this, GetStageImpl(), this, property, nullptr, ee::ArrangeSpriteConfig(), new ArrangeSpriteImpl(this, property));
	std::dynamic_pointer_cast<SelectSpritesOP>(editop)->SetGuides(guides);
	SetEditOP(editop);

	SetCanvas(std::make_shared<StageCanvas>(this, library, glctx));

	SetDropTarget(new ee::StageDropTarget(this, GetStageImpl(), library));

	RegistSubject(ee::ClearSpriteSJ::Instance());
}
void LSBSoundCoder::SetupContainer( const WAVContainer* _container )
{
    // Set current container
    SetContainer(_container);
    m_CurrSamplePosition = 0;
}