コード例 #1
0
LRESULT CMainDlg::OnPresetBell3(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
static FMInstrParam bell3 =
{    1,  0.000,  0.010,  1.000,  3.000,  0.000,  0.100,  0.000,
 1.414, 10.000,  1.000,  5.000,  2.000,  1.000,  0.100,  0.000,
 4.000,  0.000,  0.010,  2.000,  3.000,  0.000,  0.100,  0.000 };

	SetPreset(&bell3);
	return 0;
}
コード例 #2
0
LRESULT CMainDlg::OnPresetWood(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
static FMInstrParam wood1 =
{    2,  0.000,  0.001,  1.000,  0.400,  0.000,  0.100,  0.000,
 2.000,  4.500,  0.015,  0.500,  0.400,  0.100,  0.100,  0.000,
 4.000,  2.000,  0.100,  0.500,  0.200,  0.100,  0.100,  0.000 };

	SetPreset(&wood1);
	return 0;
}
コード例 #3
0
LRESULT CMainDlg::OnPresetPlucked(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
static FMInstrParam plucked =
{    2,  0.000,  0.001,  1.000,  1.000,  0.000,  0.100,  0.000,
 1.500,  3.000,  0.001,  2.000,  1.000,  0.500,  0.100,  0.000,
 4.000,  1.000,  0.001,  2.000,  0.300,  0.500,  0.050,  0.000 };

	SetPreset(&plucked);
	return 0;
}
コード例 #4
0
LRESULT CMainDlg::OnPresetPiano(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
static FMInstrParam piano = 
{    2,  0.000,  0.015,  1.000,  3.000,  0.000,  0.100,  0.000,
 2.996,  3.000,  0.010,  1.000,  2.000,  0.600,  0.150,  0.200,
 5.001,  2.000,  0.010,  1.500,  1.000,  0.200,  0.100,  0.100 };

	SetPreset(&piano);
	return 0;
}
コード例 #5
0
LRESULT CMainDlg::OnPresetClarinet(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
static FMInstrParam clar = 
{    3,  0.000,  0.100,  1.000,  0.200,  0.900,  0.200,  0.000,
 2.000,  0.500,  0.030,  2.000,  0.100,  0.800,  0.200,  0.200,
 4.000,  0.200,  0.010,  0.600,  0.100,  0.400,  0.100,  0.000 };

	SetPreset(&clar);
	return 0;
}
コード例 #6
0
LRESULT CMainDlg::OnPresetSynth(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
static FMInstrParam synth = 
{    2,  0.000,  0.040,  1.000,  0.100,  0.700,  0.200,  0.000,
 1.000,  0.000,  0.040,  3.000,  0.150,  0.800,  0.200,  0.000,
 4.000,  0.000,  0.050,  2.000,  0.100,  0.200,  0.150,  0.000 };

	SetPreset(&synth);
	return 0;
}
コード例 #7
0
LRESULT CMainDlg::OnPresetFlute(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
static FMInstrParam flute = 
{    3,  0.000,  0.200,  1.000,  0.200,  0.900,  0.200,  0.000,
 3.000,  0.000,  0.030,  0.700,  0.100,  0.150,  0.200,  0.000,
 1.000,  0.400,  0.010,  0.500,  0.200,  0.200,  0.150,  0.000 };

	SetPreset(&flute);
	return 0;
};
コード例 #8
0
LRESULT CMainDlg::OnPresetOrgan(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
static FMInstrParam organ = 
{    3,  0.000,  0.050,  1.000,  0.100,  0.950,  0.100,  0.000,
 2.001,  1.000,  0.050,  3.000,  0.000,  3.000,  0.050,  1.000,
 5.999,  1.000,  0.100,  1.200,  0.000,  1.200,  0.050,  0.500 };

	SetPreset(&organ);
	return 0;
};
コード例 #9
0
LRESULT CMainDlg::OnPresetBass(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
static FMInstrParam bass =
{    3,  0.000,  0.005,  1.000,  1.400,  0.000,  0.080,  0.000,
 1.000,  1.000,  0.200,  1.200,  1.000,  0.500,  0.100,  0.200,
 2.000,  1.500,  0.005,  1.000,  0.100,  0.600,  0.100,  0.000 };

	SetPreset(&bass);
	return 0;
}
コード例 #10
0
LRESULT CMainDlg::OnPresetStrings(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
static FMInstrParam string = 
{    2,  0.000,  0.150,  1.000,  0.100,  0.950,  0.150,  0.000,
 4.000,  2.000,  0.050,  1.500,  0.000,  1.500,  0.150,  1.000,
 3.000,  0.000,  0.010,  1.000,  0.000,  1.000,  0.150,  0.500 };


	SetPreset(&string);
	return 0;
}
コード例 #11
0
ファイル: main.cpp プロジェクト: EQ4/axLib
void DrumMachine::OnChangeTemplate(const axButtonMsg& msg)
{
	//cout << "Change template." << endl;
	string f = OpenFileDialog("/home/alexarse/Desktop/axLib/axProjects/FileDialog/main", 
							  "/home/alexarse/Desktop/axLib/axProjects/MidiSequencer/axPresets");

	// cout << "FILE : " << f << endl;
	// cout << "EXT : " << axGetExtension(f) << endl;

	// if(axGetExtension(f) == "seq")
	{
		// SetPreset("axPresets/template1.txt");
		SetPreset(f);
	}
}
コード例 #12
0
BonkEnc::ConfigureFLAC::ConfigureFLAC()
{
	Point	 pos;
	Size	 size;

	currentConfig = BonkEnc::currentConfig;

	preset = currentConfig->flac_preset;
	streamable_subset = currentConfig->flac_streamable_subset;
	do_mid_side_stereo = currentConfig->flac_do_mid_side_stereo;
	loose_mid_side_stereo = currentConfig->flac_loose_mid_side_stereo;
	blocksize = currentConfig->flac_blocksize / 8;
	max_lpc_order = currentConfig->flac_max_lpc_order;
	qlp_coeff_precision = currentConfig->flac_qlp_coeff_precision;
	do_qlp_coeff_prec_search = currentConfig->flac_do_qlp_coeff_prec_search;
	do_exhaustive_model_search = currentConfig->flac_do_exhaustive_model_search;
	min_residual_partition_order = currentConfig->flac_min_residual_partition_order;
	max_residual_partition_order = currentConfig->flac_max_residual_partition_order;

	mainWnd			= new Window(String(BonkEnc::i18n->TranslateString("%1 encoder configuration")).Replace("%1", "FLAC"), currentConfig->wndPos + Point(80, 80), Size(520, 332));
	mainWnd->SetRightToLeft(BonkEnc::i18n->IsActiveLanguageRightToLeft());

	mainWnd_titlebar	= new Titlebar(TB_CLOSEBUTTON);
	divbar			= new Divider(39, OR_HORZ | OR_BOTTOM);

	layer_simple		= new Layer(BonkEnc::i18n->TranslateString("Basic"));
	layer_format		= new Layer(BonkEnc::i18n->TranslateString("Format"));
	layer_advanced		= new Layer(BonkEnc::i18n->TranslateString("Expert"));

	pos.x = 175;
	pos.y = 29;
	size.cx = 0;
	size.cy = 0;

	btn_cancel		= new Button(BonkEnc::i18n->TranslateString("Cancel"), NIL, pos, size);
	btn_cancel->onAction.Connect(&ConfigureFLAC::Cancel, this);
	btn_cancel->SetOrientation(OR_LOWERRIGHT);

	pos.x -= 88;

	btn_ok			= new Button(BonkEnc::i18n->TranslateString("OK"), NIL, pos, size);
	btn_ok->onAction.Connect(&ConfigureFLAC::OK, this);
	btn_ok->SetOrientation(OR_LOWERRIGHT);

	pos.x = 7;
	pos.y = 7;
	size.cx = 498;
	size.cy = 245;

	tabwidget		= new TabWidget(pos, size);

	pos.x = 7;
	pos.y = 11;
	size.cx = 480;
	size.cy = 39;

	group_preset		= new GroupBox(BonkEnc::i18n->TranslateString("Presets"), pos, size);

	pos.x += 9;
	pos.y += 13;

	text_preset		= new Text(BonkEnc::i18n->TranslateString("Use preset:"), pos);

	pos.x += (text_preset->textSize.cx + 8);
	pos.y -= 3;
	size.cx = 453 - text_preset->textSize.cx;
	size.cy = 0;

	combo_preset		= new ComboBox(pos, size);
	combo_preset->AddEntry(BonkEnc::i18n->TranslateString("Custom settings"));
	combo_preset->AddEntry(String("0").Append(", ").Append(BonkEnc::i18n->TranslateString("Fastest encoding")));
	combo_preset->AddEntry("1");
	combo_preset->AddEntry("2");
	combo_preset->AddEntry("3");
	combo_preset->AddEntry("4");
	combo_preset->AddEntry("5");
	combo_preset->AddEntry("6");
	combo_preset->AddEntry("7");
	combo_preset->AddEntry(String("8").Append(", ").Append(BonkEnc::i18n->TranslateString("Best compression")));
	combo_preset->SelectNthEntry(currentConfig->flac_preset + 1);
	combo_preset->onSelectEntry.Connect(&ConfigureFLAC::SetPreset, this);

	pos.x = 7;
	pos.y = 62;
	size.cx = 150;
	size.cy = 65;

	group_stereo		= new GroupBox(BonkEnc::i18n->TranslateString("Stereo mode"), pos, size);

	pos.x += 10;
	pos.y += 13;
	size.cx = 130;
	size.cy = 0;

	check_mid_side_stereo	= new CheckBox(BonkEnc::i18n->TranslateString("Joint Stereo"), pos, size, &do_mid_side_stereo);
	check_mid_side_stereo->onAction.Connect(&ConfigureFLAC::SetStereoMode, this);

	pos.y += 25;

	check_loose_mid_side	= new CheckBox(BonkEnc::i18n->TranslateString("Adaptive Joint Stereo"), pos, size, &loose_mid_side_stereo);

	pos.x = 7;
	pos.y = 11;
	size.cx = 480;
	size.cy = 66;

	group_format		= new GroupBox(BonkEnc::i18n->TranslateString("Format"), pos, size);

	pos.x += 10;
	pos.y += 13;
	size.cy = 0;

	check_streamable_subset	= new CheckBox(BonkEnc::i18n->TranslateString("Use streamable subset"), pos, size, &streamable_subset);
	check_streamable_subset->onAction.Connect(&ConfigureFLAC::SetStreamableSubset, this);
	check_streamable_subset->SetWidth(check_streamable_subset->textSize.cx + 21);

	pos.x -= 1;
	pos.y += 27;

	text_blocksize		= new Text(BonkEnc::i18n->TranslateString("Blocksize:"), pos);

	pos.x += text_blocksize->textSize.cx + 7;
	pos.y -= 2;
	size.cx = 319;

	slider_blocksize	= new Slider(pos, size, OR_HORZ, &blocksize, 24, 4096);
	slider_blocksize->onValueChange.Connect(&ConfigureFLAC::SetBlockSize, this);

	pos.x += 328;
	pos.y -= 1;
	size.cx = 37;

	edit_blocksize		= new EditBox("", pos, size, 5);
	edit_blocksize->onInput.Connect(&ConfigureFLAC::EditBlockSize, this);

	pos.x += 44;
	pos.y += 3;

	text_blocksize_bytes	= new Text(BonkEnc::i18n->TranslateString("bytes"), pos);

	pos.x = 7;
	pos.y = 11;
	size.cx = 480;
	size.cy = 56;

	group_apodization	= new GroupBox(BonkEnc::i18n->TranslateString("Apodization"), pos, size);

	pos.x += 9;
	pos.y += 13;
	size.cy = 0;

	text_apodization	= new Text(BonkEnc::i18n->TranslateString("Apodization function(s):"), pos);

	pos.x += text_apodization->textSize.cx + 7;
	pos.y -= 3;
	size.cx = 454 - text_apodization->textSize.cx;

	edit_apodization	= new EditBox(currentConfig->flac_apodization, pos, size);

	list_apodization	= new ListBox(pos, size);
	list_apodization->AddEntry("bartlett");
	list_apodization->AddEntry("bartlett_hann");
	list_apodization->AddEntry("blackman");
	list_apodization->AddEntry("blackman_harris_4term_92db");
	list_apodization->AddEntry("connes");
	list_apodization->AddEntry("flattop");
	list_apodization->AddEntry("gauss(0.2)");
	list_apodization->AddEntry("hamming");
	list_apodization->AddEntry("hann");
	list_apodization->AddEntry("kaiser_bessel");
	list_apodization->AddEntry("nuttall");
	list_apodization->AddEntry("rectangle");
	list_apodization->AddEntry("triangle");
	list_apodization->AddEntry("tukey(0.5)");
	list_apodization->AddEntry("welch");

	edit_apodization->SetDropDownList(list_apodization);

	pos.x += 2;
	pos.y += 25;

	text_apodization_explain= new Text(String(BonkEnc::i18n->TranslateString("Note:")).Append(" ").Append(BonkEnc::i18n->TranslateString("You can specify multiple functions separated by semicolons.")), pos);

	pos.x = 7;
	pos.y = 79;
	size.cx = 480;
	size.cy = 62;

	group_lpc		= new GroupBox(BonkEnc::i18n->TranslateString("Linear predictor"), pos, size);

	pos.x += 9;
	pos.y += 13;

	text_max_lpc_order	= new Text(String(BonkEnc::i18n->TranslateString("Maximum LPC order")).Append(":"), pos);

	pos.x += 7;
	pos.y -= 2;
	size.cx = 250;

	slider_max_lpc_order	= new Slider(pos, size, OR_HORZ, &max_lpc_order, 0, 32);
	slider_max_lpc_order->onValueChange.Connect(&ConfigureFLAC::SetLPCOrder, this);

	pos.x += 257;
	pos.y += 2;

	text_max_lpc_order_value= new Text(BonkEnc::i18n->TranslateString("disabled"), pos);

	pos.x += 50;
	pos.y -= 2;
	size.cx = 150;
	size.cy = 0;

	check_exhaustive_model	= new CheckBox(BonkEnc::i18n->TranslateString("Exhaustive model search"), pos, size, &do_exhaustive_model_search);

	pos.x -= 314;
	pos.y += 25;

	text_qlp_precision	= new Text(String(BonkEnc::i18n->TranslateString("Quantized LPC precision")).Append(":"), pos);

	pos.x += 7;
	pos.y -= 2;
	size.cx = 250;

	slider_qlp_precision	= new Slider(pos, size, OR_HORZ, &qlp_coeff_precision, 0, 32);
	slider_qlp_precision->onValueChange.Connect(&ConfigureFLAC::SetQLPPrecision, this);

	pos.x += 257;
	pos.y += 2;

	text_qlp_precision_value= new Text(BonkEnc::i18n->TranslateString("auto"), pos);

	pos.x += 50;
	pos.y -= 2;
	size.cx = 150;
	size.cy = 0;

	check_qlp_precision_search= new CheckBox(BonkEnc::i18n->TranslateString("Optimize LPC quantization"), pos, size, &do_qlp_coeff_prec_search);
	check_qlp_precision_search->onAction.Connect(&ConfigureFLAC::SetQLPSearch, this);

	Int	 maxTextSize = Math::Max(text_max_lpc_order_value->textSize.cx, text_qlp_precision_value->textSize.cx);

	check_exhaustive_model->SetX(text_max_lpc_order_value->GetX() + maxTextSize + 8); check_exhaustive_model->SetWidth(189 - maxTextSize);
	check_qlp_precision_search->SetX(text_max_lpc_order_value->GetX() + maxTextSize + 8); check_qlp_precision_search->SetWidth(189 - maxTextSize);

	pos.x = 7;
	pos.y = 153;
	size.cx = 296;
	size.cy = 62;

	group_rice		= new GroupBox(BonkEnc::i18n->TranslateString("Residual coding"), pos, size);

	pos.x += 9;
	pos.y += 13;

	text_min_part_order	= new Text(String(BonkEnc::i18n->TranslateString("Minimum partition order")).Append(":"), pos);

	pos.x += 7;
	pos.y -= 2;
	size.cx = 250;

	slider_min_part_order	= new Slider(pos, size, OR_HORZ, &min_residual_partition_order, 0, 16);
	slider_min_part_order->onValueChange.Connect(&ConfigureFLAC::SetRiceOrder, this);

	pos.x += 257;
	pos.y += 2;

	text_min_part_order_value= new Text("", pos);

	pos.x -= 264;
	pos.y += 23;

	text_max_part_order	= new Text(String(BonkEnc::i18n->TranslateString("Maximum partition order")).Append(":"), pos);

	pos.x += 7;
	pos.y -= 2;
	size.cx = 250;

	slider_max_part_order	= new Slider(pos, size, OR_HORZ, &max_residual_partition_order, 0, 16);
	slider_max_part_order->onValueChange.Connect(&ConfigureFLAC::SetRiceOrder, this);

	pos.x += 257;
	pos.y += 2;

	text_max_part_order_value= new Text("", pos);

	maxTextSize = Math::Max(Math::Max(text_min_part_order->textSize.cx, text_max_part_order->textSize.cx), Math::Max(text_max_lpc_order->textSize.cx, text_qlp_precision->textSize.cx));

	slider_min_part_order->SetX(group_lpc->GetX() + 16 + maxTextSize); slider_min_part_order->SetWidth(250 - maxTextSize);
	slider_max_part_order->SetX(group_lpc->GetX() + 16 + maxTextSize); slider_max_part_order->SetWidth(250 - maxTextSize);
	slider_max_lpc_order->SetX(group_lpc->GetX() + 16 + maxTextSize); slider_max_lpc_order->SetWidth(250 - maxTextSize);
	slider_qlp_precision->SetX(group_lpc->GetX() + 16 + maxTextSize); slider_qlp_precision->SetWidth(250 - maxTextSize);

	SetStereoMode();
	SetStreamableSubset();
	SetBlockSize();
	SetRiceOrder();
	SetLPCOrder();
	SetQLPSearch();
	SetQLPPrecision();
	SetPreset();

	Add(mainWnd);

	mainWnd->Add(btn_ok);
	mainWnd->Add(btn_cancel);
	mainWnd->Add(tabwidget);
	mainWnd->Add(mainWnd_titlebar);
	mainWnd->Add(divbar);

	tabwidget->Add(layer_simple);
	tabwidget->Add(layer_format);
	tabwidget->Add(layer_advanced);

	layer_simple->Add(group_preset);
	layer_simple->Add(text_preset);
	layer_simple->Add(combo_preset);
	layer_simple->Add(group_stereo);
	layer_simple->Add(check_mid_side_stereo);
	layer_simple->Add(check_loose_mid_side);

	layer_format->Add(group_format);
	layer_format->Add(check_streamable_subset);
	layer_format->Add(text_blocksize);
	layer_format->Add(slider_blocksize);
	layer_format->Add(edit_blocksize);
	layer_format->Add(text_blocksize_bytes);

	layer_advanced->Add(group_apodization);
	layer_advanced->Add(text_apodization);
	layer_advanced->Add(edit_apodization);
	layer_advanced->Add(text_apodization_explain);

	layer_advanced->Add(group_lpc);
	layer_advanced->Add(text_max_lpc_order);
	layer_advanced->Add(slider_max_lpc_order);
	layer_advanced->Add(text_max_lpc_order_value);
	layer_advanced->Add(check_exhaustive_model);
	layer_advanced->Add(check_qlp_precision_search);
	layer_advanced->Add(text_qlp_precision);
	layer_advanced->Add(slider_qlp_precision);
	layer_advanced->Add(text_qlp_precision_value);

	layer_advanced->Add(group_rice);
	layer_advanced->Add(text_min_part_order);
	layer_advanced->Add(text_max_part_order);
	layer_advanced->Add(slider_min_part_order);
	layer_advanced->Add(text_min_part_order_value);
	layer_advanced->Add(slider_max_part_order);
	layer_advanced->Add(text_max_part_order_value);

	mainWnd->SetFlags(mainWnd->GetFlags() | WF_NOTASKBUTTON);
	mainWnd->SetIcon(ImageLoader::Load("freac.pci:0"));
}
コード例 #13
0
ファイル: ScriptConsole.c プロジェクト: BraXi/DayZ-SA-Scripts
//--------------------------------------------------------------------------
bool ScriptConsole::OnClick(Widget w, int x, int y, int button)
{
	int objects_row_index;
	PlayerBase player = GetGame().GetPlayer();

	if ( w == m_ClientLogClearButton )
	{
		this.Clear();
		return true;
	}
	else if ( w == m_PositionsListbox )
	{
		string position_name = GetCurrentPositionName();
		vector position = m_ProfileUIFixed.GetPositionByName( position_name );
		m_TeleportX.SetText( ftoa( position[0] ) );
		m_TeleportY.SetText( ftoa( position[2] ) );
		return true;
	}
	else if ( w == m_TeleportButton )
	{
		string pos_x = m_TeleportX.GetText();
		string pos_y = m_TeleportX.GetText();
		string pos_z = "0";
		vector v = String2Vector(pos_x + " " + pos_z +" " + pos_y); 
		m_Developer.SetPlayerPosition(player, v );
		return true;
	}
	else if ( w == m_ObjectsTextListbox )
	{
		m_PresetItemsTextListbox.SelectRow(-1);
		HideItemButtons();
		ShowItemTransferButtons();
		m_SelectedObjectText.SetText( "Object : " + GetCurrentObjectName() );

		m_SelectedObject = GetCurrentObjectName();
		m_SelectedObjectIsPreset = false;
		return true;
	}
	else if ( w == m_ObjectFilter )
	{
		ChangeFilter();
		return true;
	}
	else if ( w == m_SpawnInInvButton || w == m_SpawnGroundButton )
	{
		objects_row_index = m_ObjectsTextListbox.GetSelectedRow();
		if ( m_SelectedObject != "" )
		{
			int spawn_type = SPAWNTYPE_INVENTORY;
			switch( w )
			{
				case m_SpawnGroundButton:
				{
					spawn_type = SPAWNTYPE_GROUND;
				}
				break;
			}
			
			
			// int damage = -1;
			// int quantity = -1; 
			// m_Developer.SpawnItem(player, object_name, spawn_type, damage, quantity );

			float distance = atof( m_SpawnDistanceEditBox.GetText() );
			if ( m_SelectedObjectIsPreset )
			{
				SetPreset( true, m_SelectedObject, spawn_type, distance );
			}
			else
			{
				m_Developer.SpawnItem(player, m_SelectedObject, spawn_type, -1, -1, distance );
			}
			
		}
		return true;
	}
	else if ( w == m_DiagToggleButton )
	{
		int toggle_row_index = m_DiagToggleTextListbox.GetSelectedRow();
		bool toggle_state = GetGame().GetDiagModeEnable( toggle_row_index );
		GetGame().SetDiagModeEnable( toggle_row_index, not( toggle_state) );
		return true;
	}
	else if ( w == m_DiagDrawButton )
	{
		int draw_row_index = m_DiagDrawmodeTextListbox.GetSelectedRow();
		GetGame().SetDiagDrawMode( draw_row_index );
		return true;
	}
	else if ( w == m_SQFApplyButton )
	{
		this.ApplySQF();
		return true;
	}
	else if ( w == m_SQFOKButton )
	{
		this.ApplySQF();
		Close();
		return true;
	}
	else if ( w == m_CloseConsoleButton )
	{
		Close();
		return true;
	}
	else if ( w == m_PresetsTextListbox )
	{
		RenderPresetItems();
		ShowPresetButtons();
		ShowItemTransferButtons();
		m_SelectedObjectText.SetText( "Preset : " + GetCurrentPresetName() );
		m_SelectedObject = GetCurrentPresetName();
		m_SelectedObjectIsPreset = true;
		return true;
	}
	else if ( w == m_PresetItemsTextListbox )
	{
		m_ObjectsTextListbox.SelectRow(-1);
		ShowItemButtons();
		ShowItemTransferButtons();
		m_SelectedObjectText.SetText( "Object : " + GetCurrentItemName() );
		m_SelectedObject = GetCurrentItemName();
		m_SelectedObjectIsPreset = false;

		return true;
	}
	else if ( w == m_PresetSetDefaultButton )
	{
		if ( GetCurrentPresetName()!= "" )
		{
			SetDefaultPreset( GetCurrentPresetIndex() );
		}
		return true;
	}
	else if ( w == m_PresetNewButton )
	{
		g_Game.GetUIManager().EnterScriptedMenu(MENU_SCRIPTCONSOLE_DIALOG_PRESET_NAME, this);
		return true;
	}
	else if ( w == m_PresetDeleteButton )
	{
		if ( GetCurrentPresetName()!= "" )
		{
			DeletePreset();
		}
		return true;
	}
	else if ( w == m_PresetRenameButton )
	{
		if ( GetCurrentPresetName()!= "" )
		{
			g_Game.GetUIManager().EnterScriptedMenu(MENU_SCRIPTCONSOLE_DIALOG_PRESET_RENAME, this);
		}
		return true;
	}
	else if ( w == m_PresetAddItemtButton )
	{
		AddItemToPreset();
		return true;
	}
	else if ( w == m_PresetRemoveItemButton )
	{
		RemoveItemFromPreset();
		return true;
	}
	else if ( w == m_ItemMoveUpButton )
	{
		ItemMoveUp();
		return true;
	}
	else if ( w == m_ItemMoveDownButton )
	{
		ItemMoveDown();
		return true;
	}

	// tabs
	for (int i = 0; i < TABS_COUNT; i++)
	{
		if (w == m_Tab_buttons[i])
		{
			SelectTab(i);
			return true;
		}
	}

	return false;
}
コード例 #14
0
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
{
	// center the dialog on the screen
	CenterWindow();

	// set icons
	HICON hIcon = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON), LR_DEFAULTCOLOR);
	SetIcon(hIcon, TRUE);
	HICON hIconSmall = (HICON)::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDR_MAINFRAME), 
		IMAGE_ICON, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR);
	SetIcon(hIconSmall, FALSE);

	// register object for message filtering and idle updates
	CMessageLoop* pLoop = _Module.GetMessageLoop();
	ATLASSERT(pLoop != NULL);
	pLoop->AddMessageFilter(this);
	pLoop->AddIdleHandler(this);

	UIAddChildWindowContainer(m_hWnd);

	gen1Frq = GetDlgItem(IDC_CAR_FREQ);
	gen1Atk = GetDlgItem(IDC_CAR_ATTACK);
	gen1Dec = GetDlgItem(IDC_CAR_DECAY);
	gen1Vol = GetDlgItem(IDC_CAR_VOLUME);
	gen1Sus = GetDlgItem(IDC_CAR_SUSTAIN);
	gen1Rel = GetDlgItem(IDC_CAR_RELEASE);
	gen1FrqEd = GetDlgItem(IDC_CFRQ_EDIT);
	gen1AtkEd = GetDlgItem(IDC_CATK_EDIT);
	gen1DecEd = GetDlgItem(IDC_CDEC_EDIT);
	gen1VolEd = GetDlgItem(IDC_CVOL_EDIT);
	gen1SusEd = GetDlgItem(IDC_CSUS_EDIT);
	gen1RelEd = GetDlgItem(IDC_CREL_EDIT);

	InitValue(gen1Frq, gen1FrqEd, 0, 120, 12);
	PutSetting(gen1Frq, gen1FrqEd, 48.0, 1, 120);
	InitValue(gen1Vol, gen1VolEd, 0, 100, 10);
	InitValue(gen1Sus, gen1SusEd, 0, 100, 10);
	InitValue(gen1Atk, gen1AtkEd, 0, 4000, 400);
	InitValue(gen1Dec, gen1DecEd, 0, 4000, 400);
	InitValue(gen1Rel, gen1RelEd, 0, 4000, 400);

	gen2Mul = GetDlgItem(IDC_MOD1_MULT);
	gen2Ndx = GetDlgItem(IDC_MOD1_START);
	gen2Atk = GetDlgItem(IDC_MOD1_ATTACK);
	gen2Pck = GetDlgItem(IDC_MOD1_PEAK);
	gen2Dec = GetDlgItem(IDC_MOD1_DECAY);
	gen2Sus = GetDlgItem(IDC_MOD1_SUSTAIN);
	gen2Rel = GetDlgItem(IDC_MOD1_RELEASE);
	gen2End = GetDlgItem(IDC_MOD1_END);
	gen2MulEd = GetDlgItem(IDC_M1M_EDIT);
	gen2NdxEd = GetDlgItem(IDC_M1I_EDIT);
	gen2AtkEd = GetDlgItem(IDC_M1A_EDIT);
	gen2PckEd = GetDlgItem(IDC_M1P_EDIT);
	gen2DecEd = GetDlgItem(IDC_M1D_EDIT);
	gen2SusEd = GetDlgItem(IDC_M1S_EDIT);
	gen2RelEd = GetDlgItem(IDC_M1R_EDIT);
	gen2EndEd = GetDlgItem(IDC_M1E_EDIT);

	InitValue(gen2Mul, gen2MulEd, 0,  100,  10);
	InitValue(gen2Ndx, gen2NdxEd, 0,  500,  50);
	InitValue(gen2Pck, gen2PckEd, 0,  500,  50);
	InitValue(gen2Sus, gen2SusEd, 0,  500,  50);
	InitValue(gen2End, gen2EndEd, 0,  500,  50);
	InitValue(gen2Atk, gen2AtkEd, 0, 4000, 400);
	InitValue(gen2Dec, gen2DecEd, 0, 4000, 400);
	InitValue(gen2Rel, gen2RelEd, 0, 4000, 400);

	gen3Mul = GetDlgItem(IDC_MOD2_MULT);
	gen3Ndx = GetDlgItem(IDC_MOD2_START);
	gen3Atk = GetDlgItem(IDC_MOD2_ATTACK);
	gen3Pck = GetDlgItem(IDC_MOD2_PEAK);
	gen3Dec = GetDlgItem(IDC_MOD2_DECAY);
	gen3Sus = GetDlgItem(IDC_MOD2_SUSTAIN);
	gen3Rel = GetDlgItem(IDC_MOD2_RELEASE);
	gen3End = GetDlgItem(IDC_MOD2_END);
	gen3MulEd = GetDlgItem(IDC_M2M_EDIT);
	gen3NdxEd = GetDlgItem(IDC_M2I_EDIT);
	gen3AtkEd = GetDlgItem(IDC_M2A_EDIT);
	gen3PckEd = GetDlgItem(IDC_M2P_EDIT);
	gen3DecEd = GetDlgItem(IDC_M2D_EDIT);
	gen3SusEd = GetDlgItem(IDC_M2S_EDIT);
	gen3RelEd = GetDlgItem(IDC_M2R_EDIT);
	gen3EndEd = GetDlgItem(IDC_M2E_EDIT);

	InitValue(gen3Mul, gen3MulEd, 0,  100,  10);
	InitValue(gen3Ndx, gen3NdxEd, 0,  500,  50);
	InitValue(gen3Pck, gen3PckEd, 0,  500,  50);
	InitValue(gen3Sus, gen3SusEd, 0,  500,  50);
	InitValue(gen3End, gen3EndEd, 0,  500,  50);
	InitValue(gen3Atk, gen3AtkEd, 0, 4000, 400);
	InitValue(gen3Dec, gen3DecEd, 0, 4000, 400);
	InitValue(gen3Rel, gen3RelEd, 0, 4000, 400);

	durValEd = GetDlgItem(IDC_DUR_EDIT);
	durValEd.SetWindowText("4.0");
	volValEd = GetDlgItem(IDC_VOL);
	volValEd.SetWindowText("0.707");

	btnPlay = GetDlgItem(IDC_PLAY);
	btnLoop = GetDlgItem(IDC_LOOP);
	btnStop = GetDlgItem(IDC_STOP);
	RECT btnrc;
	btnPlay.GetClientRect(&btnrc);
	int cxy;
	if ((btnrc.bottom - btnrc.top) < 30)
		cxy = 16;
	else
		cxy = 32;
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_PLAY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnPlay.SetIcon(hIcon);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_LOOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnLoop.SetIcon(hIcon);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_STOP), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStop.SetIcon(hIcon);
	btnStop.EnableWindow(FALSE);

	CButton btnStyle;
	HBITMAP bm;

	btnStyle = GetDlgItem(IDC_STACK);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_STACK), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);
	btnStyle.SetCheck(BST_CHECKED);
	btnStyle = GetDlgItem(IDC_STACK2);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_STACK2), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);
	btnStyle = GetDlgItem(IDC_WYE);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_WYE), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);
	btnStyle = GetDlgItem(IDC_DELTA);
	bm = (HBITMAP) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDB_DELTA), IMAGE_BITMAP, 48, 48, LR_DEFAULTCOLOR);
	btnStyle.SetBitmap(bm);

	btnStyle = GetDlgItem(IDC_COPY_CLIP);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_COPY), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_SAVE);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_WVFILE), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);
	btnStyle = GetDlgItem(IDC_HELP2);
	hIcon = (HICON) ::LoadImage(_Module.GetResourceInstance(), MAKEINTRESOURCE(IDI_HELP2), IMAGE_ICON, cxy, cxy, LR_DEFAULTCOLOR);
	btnStyle.SetIcon(hIcon);

	SetPreset(&resetParams);

	return TRUE;
}
コード例 #15
0
ファイル: appLib.c プロジェクト: feifei1987720/3535
void appLibInit()
{
	
	int channelNo = 0;
	int streamNo = 0;
	memset(&g_devChannelInfo, 0, sizeof(g_devChannelInfo));
	/*  */
	g_devChannelInfo[channelNo][streamNo].channelNo = channelNo;
	g_devChannelInfo[channelNo][streamNo].streamNo = streamNo;

	//	procMsgInit(&gMsgId, &gSemId);
	//	printf("gMsgId === %d. gSemId = %d\r\n", gMsgId, gSemId);

	//	startGuiSerVer();
	//   int num=GetDisplayNum();
	//    Printf("@@@@@@@@@@@@@@@@@@@@@@@@@@@diskplay_num =%d\r\n",num);
	//   if(num<4 && num >32)
	//   {
	//      num =32;
	//  }
	//  ONVIF_SetDisplayNum(num);
	
	TCPComTools();
	appLibStartThread();

	appParamInit();


#if 0
	sdk_cruise_param_t   cruise_param;
	int i= 0,j,n;
	for(i=0;i!=1;++i)
	{
		for(j=0;j!=3;++j)
		{
			for(n=0;n!=32;++n)
			{
				cruise_param.line = j;
				cruise_param.enable = 1;
				cruise_param.cruise_preset[n].dwell_time = 1;
				cruise_param.cruise_preset[n].enable = 1;
				cruise_param.cruise_preset[n].speed = 1;
				cruise_param.cruise_preset[n].num = 1;
				cruise_param.cruise_preset[n].preset.num = 2;
				cruise_param.cruise_preset[n].preset.enable = 1;

			}
			SetPtzCruiseAllPreset( i, &cruise_param );
		}
	}

	sdk_preset_t preset;

	for(i=0;i!=1;++i)
	{
		for(j=0;j!=128;++j)
		{
			preset.enable = 1;
			preset.num = j;
			SetPreset(i,&preset);


		}
	}
	Printf("@@@@@@@@@@ptzCruiseInit   finish set preset\r\n");

#endif

	ptzCruiseInit();


	// ONVIF_EventServerStart(onvifEvent);
}
コード例 #16
0
void
MetricThresholdAttributes::SetFromNode(DataNode *parentNode)
{
    if(parentNode == 0)
        return;

    DataNode *searchNode = parentNode->GetNode("MetricThresholdAttributes");
    if(searchNode == 0)
        return;

    DataNode *node;
    if((node = searchNode->GetNode("preset")) != 0)
    {
        // Allow enums to be int or string in the config file
        if(node->GetNodeType() == INT_NODE)
        {
            int ival = node->AsInt();
            if(ival >= 0 && ival < 21)
                SetPreset(Preset(ival));
        }
        else if(node->GetNodeType() == STRING_NODE)
        {
            Preset value;
            if(Preset_FromString(node->AsString(), value))
                SetPreset(value);
        }
    }
    if((node = searchNode->GetNode("Hexahedron")) != 0)
        SetHexahedron(node->AsBool());
    if((node = searchNode->GetNode("hex_lower")) != 0)
        SetHex_lower(node->AsDouble());
    if((node = searchNode->GetNode("hex_upper")) != 0)
        SetHex_upper(node->AsDouble());
    if((node = searchNode->GetNode("Tetrahedron")) != 0)
        SetTetrahedron(node->AsBool());
    if((node = searchNode->GetNode("tet_lower")) != 0)
        SetTet_lower(node->AsDouble());
    if((node = searchNode->GetNode("tet_upper")) != 0)
        SetTet_upper(node->AsDouble());
    if((node = searchNode->GetNode("Wedge")) != 0)
        SetWedge(node->AsBool());
    if((node = searchNode->GetNode("wed_lower")) != 0)
        SetWed_lower(node->AsDouble());
    if((node = searchNode->GetNode("wed_upper")) != 0)
        SetWed_upper(node->AsDouble());
    if((node = searchNode->GetNode("Pyramid")) != 0)
        SetPyramid(node->AsBool());
    if((node = searchNode->GetNode("pyr_lower")) != 0)
        SetPyr_lower(node->AsDouble());
    if((node = searchNode->GetNode("pyr_upper")) != 0)
        SetPyr_upper(node->AsDouble());
    if((node = searchNode->GetNode("Triangle")) != 0)
        SetTriangle(node->AsBool());
    if((node = searchNode->GetNode("tri_lower")) != 0)
        SetTri_lower(node->AsDouble());
    if((node = searchNode->GetNode("tri_upper")) != 0)
        SetTri_upper(node->AsDouble());
    if((node = searchNode->GetNode("Quad")) != 0)
        SetQuad(node->AsBool());
    if((node = searchNode->GetNode("quad_lower")) != 0)
        SetQuad_lower(node->AsDouble());
    if((node = searchNode->GetNode("quad_upper")) != 0)
        SetQuad_upper(node->AsDouble());
}
コード例 #17
0
LRESULT CMainDlg::OnPresetReset(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	SetPreset(&resetParams);
	return 0;
}