Esempio n. 1
0
bool CControllerManager::SaveControllerSettings(LPCTSTR pszName) const
{
	int Index=FindController(pszName);
	if (Index<0)
		return false;

	const ControllerInfo &Info=m_ControllerList[Index];
	if (!Info.fSettingsChanged)
		return true;

	CSettings Settings;
	TCHAR szFileName[MAX_PATH];

	if (!Info.pController->GetIniFileName(szFileName,lengthof(szFileName)))
		return false;
	if (Settings.Open(szFileName,CSettings::OPEN_WRITE)
			&& Settings.SetSection(Info.pController->GetIniFileSection())) {
		const int NumButtons=Info.pController->NumButtons();
		const CCommandList &CommandList=GetAppClass().CommandList;

		for (int i=0;i<NumButtons;i++) {
			TCHAR szName[64];
			LPCTSTR pszText=NULL;

			::wsprintf(szName,TEXT("Button%d_Command"),i);
			if (Info.Settings.AssignList[i]!=0)
				pszText=CommandList.GetCommandTextByID(Info.Settings.AssignList[i]);
			Settings.Write(szName,pszText!=NULL?pszText:TEXT(""));
		}
		if (!Info.pController->IsActiveOnly())
			Settings.Write(TEXT("ActiveOnly"),Info.Settings.fActiveOnly);
	}
	return true;
}
Esempio n. 2
0
bool CInformationPanel::WriteSettings(CSettings &Settings)
{
	for (int i=0;i<NUM_ITEMS;i++) {
		const CItem *pItem=m_ItemList[i];
		Settings.Write(pItem->GetName(),pItem->IsVisible());
	}
	return true;
}
Esempio n. 3
0
bool CSideBarOptions::WriteSettings(CSettings &Settings)
{
	Settings.Clear();

	Settings.Write(TEXT("ShowPopup"),m_fShowPopup);
	Settings.Write(TEXT("ShowToolTips"),m_fShowToolTips);
	Settings.Write(TEXT("ShowChannelLogo"),m_fShowChannelLogo);
	Settings.Write(TEXT("PopupOpacity"),m_PopupOpacity);
	Settings.Write(TEXT("Place"),(int)m_Place);

	Settings.Write(TEXT("ItemCount"),(int)m_ItemNameList.size());
	for (size_t i=0;i<m_ItemNameList.size();i++) {
		TCHAR szName[32];
		StdUtil::snprintf(szName,lengthof(szName),TEXT("Item%d"),(int)i);
		Settings.Write(szName,m_ItemNameList[i]);
	}
	/*
	const CCommandList *pCommandList=m_pSideBar->GetCommandList();
	for (size_t i=0;i<m_ItemList.size();i++) {
		TCHAR szName[32];

		StdUtil::snprintf(szName,lengthof(szName),TEXT("Item%d"),i);
		if (m_ItemList[i]==ITEM_SEPARATOR)
			Settings.Write(szName,TEXT(""));
		else
			Settings.Write(szName,pCommandList->GetCommandTextByID(m_ItemList[i]));
	}
	*/

	return true;
}
Esempio n. 4
0
bool CGeneralOptions::WriteSettings(CSettings &Settings)
{
	Settings.Write(TEXT("DriverDirectory"),m_BonDriverDirectory);
	Settings.Write(TEXT("DefaultDriverType"),(int)m_DefaultDriverType);
	Settings.Write(TEXT("DefaultDriver"),m_DefaultBonDriverName);
	Settings.Write(TEXT("Driver"),GetAppClass().CoreEngine.GetDriverFileName());
	Settings.Write(TEXT("Resident"),m_fResident);
	Settings.Write(TEXT("KeepSingleTask"),m_fKeepSingleTask);
	Settings.Write(TEXT("StandaloneProgramGuide"),m_fStandaloneProgramGuide);
	Settings.Write(TEXT("Enable1SegFallback"),m_fEnable1SegFallback);

	return true;
}
Esempio n. 5
0
bool CVideoDecoderOptions::WriteSettings(CSettings &Settings)
{
	CMediaViewer &MediaViewer = GetAppClass().CoreEngine.m_DtvEngine.m_MediaViewer;
	VideoDecoderSettings DecoderSettings;

	if (!MediaViewer.GetVideoDecoderSettings(&DecoderSettings))
		return false;

	Settings.Write(TEXT("EnableDeinterlace"), DecoderSettings.bEnableDeinterlace);
	Settings.Write(TEXT("DeinterlaceMethod"), static_cast<int>(DecoderSettings.DeinterlaceMethod));
	Settings.Write(TEXT("AdaptProgressive"), DecoderSettings.bAdaptProgressive);
	Settings.Write(TEXT("AdaptTelecine"), DecoderSettings.bAdaptTelecine);
	Settings.Write(TEXT("SetInterlacedFlag"), DecoderSettings.bSetInterlacedFlag);
	Settings.Write(TEXT("Brightness"), DecoderSettings.Brightness);
	Settings.Write(TEXT("Contrast"), DecoderSettings.Contrast);
	Settings.Write(TEXT("Hue"), DecoderSettings.Hue);
	Settings.Write(TEXT("Saturation"), DecoderSettings.Saturation);
	Settings.Write(TEXT("NumThreads"), DecoderSettings.NumThreads);
	Settings.Write(TEXT("EnableDXVA2"), DecoderSettings.bEnableDXVA2);

	return true;
}
Esempio n. 6
0
bool CMenuOptions::WriteSettings(CSettings &Settings)
{
	Settings.Clear();

	Settings.Write(TEXT("MaxChannelMenuRows"),m_MaxChannelMenuRows);
	Settings.Write(TEXT("MaxChannelMenuEventInfo"),m_MaxChannelMenuEventInfo);

	bool fDefault=true;
	if (m_MenuItemList.size()!=lengthof(m_DefaultMenuItemList)) {
		fDefault=false;
	} else {
		for (int i=0;i<lengthof(m_DefaultMenuItemList);i++) {
			if (m_MenuItemList[i].ID!=m_DefaultMenuItemList[i].ID
					|| !m_MenuItemList[i].fVisible) {
				fDefault=false;
				break;
			}
		}
	}
	if (!fDefault) {
		Settings.Write(TEXT("ItemCount"),(int)m_MenuItemList.size());
		const CCommandList *pCommandList=GetAppClass().GetCommandList();
		for (size_t i=0;i<m_MenuItemList.size();i++) {
			TCHAR szName[32];

			::wsprintf(szName,TEXT("Item%d_ID"),i);
			if (m_MenuItemList[i].ID==MENU_ID_SEPARATOR) {
				Settings.Write(szName,TEXT(""));
			} else {
				Settings.Write(szName,pCommandList->GetCommandTextByID(IDToCommand(m_MenuItemList[i].ID)));
			}
			::wsprintf(szName,TEXT("Item%d_State"),i);
			Settings.Write(szName,m_MenuItemList[i].fVisible?ITEM_STATE_VISIBLE:0);
		}
	}

	return true;
}
Esempio n. 7
0
bool CControllerManager::WriteSettings(CSettings &Settings)
{
	if (!m_CurController.empty())
		Settings.Write(TEXT("CurController"),m_CurController);
	return true;
}
Esempio n. 8
0
bool CEpgOptions::WriteSettings(CSettings &Settings)
{
	CLogoManager &LogoManager=GetAppClass().LogoManager;

	Settings.Write(TEXT("SaveEpgData"),m_fSaveEpgFile);
	Settings.Write(TEXT("EpgDataFileName"),m_szEpgFileName);
	Settings.Write(TEXT("EpgUpdateWhenStandby"),m_fUpdateWhenStandby);
	Settings.Write(TEXT("EpgUpdateBSExtended"),m_fUpdateBSExtended);
	Settings.Write(TEXT("EpgUpdateCSExtended"),m_fUpdateCSExtended);
	Settings.Write(TEXT("UseEpgData"),m_fUseEDCBData);
	Settings.Write(TEXT("EpgDataFolder"),m_szEDCBDataFolder);
	Settings.Write(TEXT("EpgTimeMode"),(int)m_EpgTimeMode);

	Settings.Write(TEXT("SaveLogoData"),m_fSaveLogoFile);
	Settings.Write(TEXT("LogoDataFileName"),m_szLogoFileName);
	Settings.Write(TEXT("SaveRawLogo"),LogoManager.GetSaveLogo());
	Settings.Write(TEXT("SaveBmpLogo"),LogoManager.GetSaveLogoBmp());
	Settings.Write(TEXT("LogoDirectory"),LogoManager.GetLogoDirectory());

	TVTest::StyleUtil::WriteFontSettings(Settings,TEXT("EventInfoFont"),m_EventInfoFont);

	return true;
}
Esempio n. 9
0
bool CLogger::WriteSettings(CSettings &Settings)
{
	Settings.Write(TEXT("OutputLogToFile"),m_fOutputToFile);
	return true;
}
Esempio n. 10
0
bool COperationOptions::WriteSettings(CSettings &Settings)
{
	Settings.Write(TEXT("DisplayDragMove"),m_fDisplayDragMove);
	Settings.Write(TEXT("HideCursor"),m_fHideCursor);
	Settings.Write(TEXT("VolumeStep"),m_VolumeStep);
	Settings.Write(TEXT("AudioDelayStep"),m_AudioDelayStep);

	TCHAR szCommand[TVTest::CWheelCommandManager::MAX_COMMAND_PARSABLE_NAME];
	m_WheelCommandManager.GetCommandParsableName(m_WheelCommand,szCommand,lengthof(szCommand));
	Settings.Write(TEXT("WheelCommand"),szCommand);
	m_WheelCommandManager.GetCommandParsableName(m_WheelShiftCommand,szCommand,lengthof(szCommand));
	Settings.Write(TEXT("WheelShiftCommand"),szCommand);
	m_WheelCommandManager.GetCommandParsableName(m_WheelCtrlCommand,szCommand,lengthof(szCommand));
	Settings.Write(TEXT("WheelCtrlCommand"),szCommand);
	m_WheelCommandManager.GetCommandParsableName(m_WheelTiltCommand,szCommand,lengthof(szCommand));
	Settings.Write(TEXT("WheelTiltCommand"),szCommand);

	Settings.Write(TEXT("StatusBarWheel"),m_fStatusBarWheel);
	Settings.Write(TEXT("ReverseWheelChannel"),m_fWheelChannelReverse);
	Settings.Write(TEXT("ReverseWheelVolume"),m_fWheelVolumeReverse);
	Settings.Write(TEXT("WheelChannelDelay"),m_WheelChannelDelay);
	Settings.Write(TEXT("WheelZoomStep"),m_WheelZoomStep);
	if (m_pCommandList!=NULL) {
		Settings.Write(TEXT("LeftDoubleClickCommand"),
			GetCommandText(m_pCommandList,m_LeftDoubleClickCommand));
		Settings.Write(TEXT("RightClickCommand"),
			GetCommandText(m_pCommandList,m_RightClickCommand));
		Settings.Write(TEXT("MiddleClickCommand"),
			GetCommandText(m_pCommandList,m_MiddleClickCommand));
	}
	return true;
}
Esempio n. 11
0
bool CPanelOptions::WriteSettings(CSettings &Settings)
{
	int CurPage=GetAppClass().Panel.Form.GetCurPageID();
	if (CurPage>=0 && (size_t)CurPage<m_AvailItemList.size())
		Settings.Write(TEXT("InfoCurTab"),m_AvailItemList[CurPage].ID);
	Settings.Write(TEXT("PanelFirstTab"),m_InitialTab);
	Settings.Write(TEXT("PanelSnapAtMainWindow"),m_fSnapAtMainWindow);
	Settings.Write(TEXT("PanelAttachToMainWindow"),m_fAttachToMainWindow);
	Settings.Write(TEXT("PanelOpacity"),m_Opacity);
	Settings.Write(TEXT("PanelTabStyle"),(int)m_TabStyle);
	Settings.Write(TEXT("PanelTabTooltip"),m_fTabTooltip);

	// Font
	Settings.Write(TEXT("PanelFontName"),m_Font.lfFaceName);
	Settings.Write(TEXT("PanelFontSize"),(int)m_Font.lfHeight);
	Settings.Write(TEXT("PanelFontWeight"),(int)m_Font.lfWeight);
	Settings.Write(TEXT("PanelFontItalic"),(int)m_Font.lfItalic);
	Settings.Write(TEXT("CaptionPanelFontSpec"),m_fSpecCaptionFont);
	Settings.Write(TEXT("CaptionPanelFont"),&m_CaptionFont);

	// アイテムリスト
	Settings.Write(TEXT("PanelTabCount"),(int)m_ItemList.size());
	for (int i=0;i<(int)m_ItemList.size();i++) {
		const PanelItemInfo &Item=m_ItemList[i];
		TCHAR szName[32];

		StdUtil::snprintf(szName,lengthof(szName),TEXT("PanelTab%d_ID"),i);
		Settings.Write(szName,Item.ID);
		StdUtil::snprintf(szName,lengthof(szName),TEXT("PanelTab%d_Visible"),i);
		Settings.Write(szName,Item.fVisible);
	}

	// Information panel
	// UI未実装
	//Settings.Write(TEXT("InfoPanelUseRichEdit"),m_fProgramInfoUseRichEdit);

	return true;
}
Esempio n. 12
0
bool CChannelManager::SaveChannelSettings(LPCTSTR pszFileName,LPCTSTR pszDriverName)
{
	if (m_TuningSpaceList.IsEmpty() || m_fChannelFileHasStreamIDs)
		return true;

	CSettings Settings;
	int SpaceCount;

	TRACE(TEXT("ストリーム情報の保存 : \"%s\" [%s]\n"),pszFileName,pszDriverName);
	if (!Settings.Open(pszFileName,CSettings::OPEN_WRITE)
			|| !Settings.SetSection(::PathFindFileName(pszDriverName)))
		return false;
	SpaceCount=m_TuningSpaceList.NumSpaces();
	Settings.Clear();
	Settings.Write(TEXT("SpaceCount"),SpaceCount);
	for (int i=0;i<SpaceCount;i++) {
		const CChannelList *pList=m_TuningSpaceList.GetChannelList(i);
		int NumChannels=pList->NumChannels();
		TCHAR szName[64];

		::wsprintf(szName,TEXT("Space%d_Count"),i);
		Settings.Write(szName,NumChannels);
		int LastIndex=0;
		for (int j=0;j<NumChannels;j++) {
			int Index=pList->GetChannelIndex(j);
			if (Index>LastIndex)
				LastIndex=Index;
		}
		int *pServiceCount=new int[LastIndex+1];
		int Map=0;
		for (int j=0;j<=LastIndex;j++) {
			int NumServices=0;
			for (int k=0;k<NumChannels;k++) {
				if (pList->GetChannelIndex(k)==j)
					NumServices++;
			}
			if (NumServices>0) {
				::wsprintf(szName,TEXT("Space%d_ChannelMap%d"),i,Map++);
				Settings.Write(szName,j);
				::wsprintf(szName,TEXT("Space%d_Channel%d_Count"),i,j);
				Settings.Write(szName,NumServices);
			}
			pServiceCount[j]=0;
		}
		for (int j=0;j<NumChannels;j++) {
			const CChannelInfo *pChInfo=pList->GetChannelInfo(j);

			if (pChInfo->GetNetworkID()!=0) {
				::wsprintf(szName,TEXT("Space%d_Channel%d_NID"),
					pChInfo->GetSpace(),pChInfo->GetChannelIndex());
				Settings.Write(szName,pChInfo->GetNetworkID());
			}
			if (pChInfo->GetTransportStreamID()!=0) {
				::wsprintf(szName,TEXT("Space%d_Channel%d_TSID"),
					pChInfo->GetSpace(),pChInfo->GetChannelIndex());
				Settings.Write(szName,pChInfo->GetTransportStreamID());
			}
			if (pChInfo->GetServiceID()!=0) {
				::wsprintf(szName,TEXT("Space%d_Channel%d_Service%d_SID"),
					pChInfo->GetSpace(),pChInfo->GetChannelIndex(),
					pServiceCount[pChInfo->GetChannelIndex()]);
				Settings.Write(szName,pChInfo->GetServiceID());
			}
			pServiceCount[pChInfo->GetChannelIndex()]++;
		}
		delete [] pServiceCount;
	}
	return true;
}
Esempio n. 13
0
bool CViewOptions::WriteSettings(CSettings &Settings)
{
	Settings.Write(TEXT("AdjustAspectResizing"),m_fAdjustAspectResizing);
	Settings.Write(TEXT("SnapToWindowEdge"),m_fSnapAtWindowEdge);
	Settings.Write(TEXT("NearCornerResizeOrigin"),m_fNearCornerResizeOrigin);
	Settings.Write(TEXT("ZoomKeepAspectRatio"),m_fZoomKeepAspectRatio);
	Settings.Write(TEXT("PanScanAdjustWindow"),(int)m_PanScanAdjustWindowMode);
	Settings.Write(TEXT("Remember1SegWindowSize"),m_fRemember1SegWindowSize);
	Settings.Write(TEXT("MinimizeToTray"),m_fMinimizeToTray);
	Settings.Write(TEXT("DisablePreviewWhenMinimized"),m_fDisablePreviewWhenMinimized);
	Settings.Write(TEXT("UseLogoIcon"),m_fUseLogoIcon);
	Settings.Write(TEXT("TitleEventTime"),m_fShowTitleEventTime);
	Settings.Write(TEXT("ShowLogo"),m_fShowLogo);
	Settings.Write(TEXT("LogoFileName"),m_szLogoFileName);
	Settings.Write(TEXT("NoScreenSaver"),m_fNoScreenSaver);
	Settings.Write(TEXT("NoMonitorLowPower"),m_fNoMonitorLowPower);
	Settings.Write(TEXT("NoMonitorLowPowerActiveOnly"),m_fNoMonitorLowPowerActiveOnly);

	return true;
}