/// <summary> /// 设置窗口加载事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void SettingForm_Load(object sender, EventArgs e) { _waveDisplayControl = new WaveDisplayConfigControl(); //_standardControl = new StandardConfigControl(); _commonControl = new CommonConfigControl(); _networkControl = new NetworkConfigControl(); _standard = new StandardConfig(); _waveDisplayControl.WaveConfigs = _configData.WaveConfigs; _commonControl.AutoScrollVelocity = _configData.AutoScrollVelocity; _commonControl.MeterageRadius = _configData.MeterageRadius; _commonControl.SignRadius = _configData.SignRadius; _commonControl.MediaPath = _configData.MediaPath; //添加空格只是让下面的节点靠下一点 List <string> configItems = new List <string>(); configItems.Add(""); configItems.Add("通用设置"); configItems.Add("多波形显示设置"); configItems.Add("标准设置"); //configItems.Add("网络设置"); foreach (var key in configItems) { Node rootNode = new Node(key); if (string.IsNullOrEmpty(key)) { rootNode.Selectable = false; rootNode.StyleMouseOver = null; } treeSetting.Nodes.Add(rootNode); } LoadControls(treeSetting.Nodes[1]); }
public static void RunStandardBase64(string assembly, string method, string type, string[] args, IAgentInstance agent) { if (agent != null) { StandardConfig modconfig = new StandardConfig { Assembly = assembly, Method = method, Moduleclass = type, Parameters = args.ToArray <string>() }; TaskMsg task = new TaskMsg { TaskType = "standard", Instanceid = RandomAString(10, new Random()), StandardTask = modconfig, Agentid = agent.AgentId }; if (agent.Pivoter != null) { task.AgentPivot = agent.Pivoter.AgentId; } agent.SendCommand(task); } }
private void PopulateTreeView(int parentId, TreeNode parentNode) { int total_files = Directory.GetFiles(ProjectConfig.projectPath).Length; List <TreeViewItem> filteredItems = null; if (ProjectConfig.projectSettings["PlanType"].ToString() == "Standard Plan") { documentList = StandardDocument.DocumentList; filteredItems = StandardConfig.getProjectNodes().Where(item => item.ParentID == parentId).ToList(); } else if (ProjectConfig.projectSettings["PlanType"].ToString() == "Quick Plan") { documentList = QuickDocument.DocumentList; filteredItems = QuickConfig.getProjectNodes().Where(item => item.ParentID == parentId).ToList(); } else if (ProjectConfig.projectSettings["PlanType"].ToString() == "Financial Plan") { documentList = FinancialDocument.DocumentList; filteredItems = FinancialConfig.getProjectNodes().Where(item => item.ParentID == parentId).ToList(); } else { MessageBox.Show("We encountered some config issues"); } TreeNode childNode; foreach (var i in filteredItems) { if (parentNode == null) { childNode = this.treeView1.Nodes.Add(Name = i.Text, Text = i.Text); } else { childNode = parentNode.Nodes.Add(Name = i.Text, Text = i.Text); } PopulateTreeView(i.ID, childNode); } }
public bool UpdateStandardConfig(StandardConfigModel model) { AutomationStandardsContext db = new AutomationStandardsContext(); StandardConfig Result = db.StandardConfig.First(d => d.StandardConfigID == model.StandardConfigID); Standard st = db.Standard.First(x => x.StandardID == model.StandardID); Result.Standard = st; bool RenameCol = false; string OldCol = "", NewCol = "", TableName = ""; if (Result.FieldName != model.FieldName) { RenameCol = true; OldCol = Result.FieldName; NewCol = model.FieldName; TableName = Result.Standard.DBTableName; } Result.DisplayName = model.DisplayName; Result.FieldName = model.FieldName; Result.SortOrder = model.SortOrder; Result.VersionNumber = model.VersionNumber; Result.UseToolTip = model.UseToolTip; Result.ToolTip = model.ToolTip; Result.UseStandardData = model.UseStandardData; Result.AllowMultiSelect = model.AllowMultiSelect; Result.StandardLUID = model.StandardLUID; Result.StandardLUValue = model.StandardLUValue; Result.StandardUseFilter = model.StandardUseFilter; Result.StandardFilterSQL = model.StandardFilterSQL; try { db.SaveChanges(); if (RenameCol) { StandardSQLManagement sql = new StandardSQLManagement(); bool SQLOK = sql.RenameColumn(TableName, OldCol, NewCol); return(SQLOK); } SetStandardVersion(model.StandardID); return(true); } catch (DbEntityValidationException ex) { string body = ""; foreach (var eve in ex.EntityValidationErrors) { body += string.Format("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); body += "<br>"; foreach (var ve in eve.ValidationErrors) { body += string.Format("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } ////GlobalFunctions gf = new //GlobalFunctions(); ////gf.SendErrorModelEmail(this.GetType().Name, body); return(false); } }
public bool InsertStandardConfig(StandardConfigModel model) { AutomationStandardsContext db = new AutomationStandardsContext(); StandardConfig Result = new StandardConfig(); Result.StandardID = model.StandardID; //Result.FieldName = model.FieldName; Result.FieldName = model.DisplayName.Replace(" ", ""); Result.DisplayName = model.DisplayName; Result.DataTypeID = model.DataTypeID; Result.SortOrder = model.SortOrder; Result.VersionNumber = model.VersionNumber; Result.UseToolTip = model.UseToolTip; Result.ToolTip = model.ToolTip; Result.UseStandardData = model.UseStandardData; Result.AllowMultiSelect = model.AllowMultiSelect; Result.StandardLUID = model.StandardLUID; Result.StandardLUValue = model.StandardLUValue; Result.StandardUseFilter = model.StandardUseFilter; Result.StandardFilterSQL = model.StandardFilterSQL; db.StandardConfig.Add(Result); try { db.SaveChanges(); model.StandardConfigID = Result.StandardConfigID; //Add Column To the Table StandardSQLManagement sql = new StandardSQLManagement(); var Standard = db.Standard.First(s => s.StandardID == model.StandardID); var DBType = db.StandardDataType.First(d => d.DataTypeID == model.DataTypeID); string DefaultValue = ""; bool AllowNull = true; if (DBType.SQLDataType == "BIT") { DefaultValue = "(0)"; } sql.AddColumn(Standard.DBTableName, Result.FieldName, DBType.SQLDataType, DefaultValue, AllowNull); SetStandardVersion(model.StandardID); return(true); } catch (DbEntityValidationException ex) { string body = ""; foreach (var eve in ex.EntityValidationErrors) { body += string.Format("Entity of type \"{0}\" in state \"{1}\" has the following validation errors:", eve.Entry.Entity.GetType().Name, eve.Entry.State); body += "<br>"; foreach (var ve in eve.ValidationErrors) { body += string.Format("- Property: \"{0}\", Error: \"{1}\"", ve.PropertyName, ve.ErrorMessage); } } ////GlobalFunctions gf = new //GlobalFunctions(); ////gf.SendErrorModelEmail(this.GetType().Name, body); return(false); } }
private static extern IntPtr criAtomExVoicePool_AllocateStandardVoicePool( ref StandardConfig config, IntPtr work, int work_size);
/** * <summary>標準ボイスプールの作成</summary> * <param name="numVoices">ボイス数</param> * <param name="maxChannels">最大チャンネル数</param> * <param name="maxSamplingRate">最大サンプリングレート</param> * <param name="streamingFlag">ストリーム再生を行うかどうか</param> * <returns>CriAtomExVoicePoolオブジェクト</returns> * \par 説明: * 標準ボイスプールを作成します。<br/> * (標準ボイスは、ADXデータとHCAデータの両方の再生に対応したボイスです。)<br/> * <br/> * 本関数を実行することで、ADXとHCAの再生が可能なボイスがプールされます。<br/> * AtomExプレーヤでADXやHCAデータ(もしくはADXやHCAデータを含むキュー)の再生を行うと、 * AtomExプレーヤは作成された標準ボイスプールからボイスを取得し、再生を行います。<br/> * <br/> * ボイスプールの作成に成功すると、戻り値としてCriAtomExVoicePoolオブジェクトが返されます。<br/> * ボイスプールの作成に失敗すると、本関数は null を返します。<br/> * ボイスプールの作成に失敗した理由については、エラーコールバックのメッセージで確認可能です。<br/> * \par 備考: * ボイスプール作成時には、第1引数( numVoices )で指定した数のボイスが作成されます。<br/> * 作成するボイスの数が多いほど、同時に再生可能な音声の数は増えますが、 * 反面、使用するメモリは増加します。<br/> * <br/> * ボイスプール作成時には、ボイス数の他に、再生可能な音声のチャンネル数、 * サンプリング周波数、ストリーム再生の有無を指定します。<br/> * <br/> * 最大チャンネル数(第2引数の numChannels )は、 * ボイスプール内のボイスが再生できる音声データのチャンネル数になります。<br/> * チャンネル数を少なくすることで、ボイスプールの作成に必要なメモリサイズは小さくなりますが、 * 指定されたチャンネル数を越えるデータは再生できなくなります。<br/> * 例えば、ボイスプールをモノラルで作成した場合、ステレオのデータは再生できません。<br/> * (ステレオデータを再生する場合、AtomExプレーヤは、 * ステレオが再生可能なボイスプールからのみボイスを取得します。)<br/> * ただし、ステレオのボイスプールを作成した場合、モノラルデータ再生時にステレオ * ボイスプールのボイスが使用される可能性はあります。<br/> * <br/> * 最大サンプリングレート(第3引数の maxSamplingRate )についても、 * 値を下げることでもボイスプールに必要なメモリサイズは小さくすることが可能ですが、指 * 定されたサンプリングレートを越えるデータは再生できなくなります。<br/> * (指定されたサンプリングレート以下のデータのみが再生可能です。)<br/> * <br/> * ストリーミング再生の有無(第4引数の streamingFlag )についても、 * オンメモリ再生のみのボイスプールはストリーミング再生可能なボイスプールに比べ、 * サイズが小さくなります。<br/> * <br/> * 尚、AtomExプレーヤがデータを再生した際に、 * ボイスプール内のボイスが全て使用中であった場合、 * ボイスプライオリティによる発音制御が行われます。<br/> * \attention * 本関数を実行する前に、ライブラリを初期化しておく必要があります。<br/> * <br/> * ストリーム再生用のボイスプールは、内部的にボイスの数分だけローダ( CriFsLoader ) * を確保します。<br/> * ストリーム再生用のボイスプールを作成する場合、ボイス数分のローダが確保できる設定で * ライブラリを初期化する必要があります。<br/> * <br/> * 本関数は完了復帰型の関数です。<br/> * ボイスプールの作成にかかる時間は、プラットフォームによって異なります。<br/> * ゲームループ等の画面更新が必要なタイミングで本関数を実行するとミリ秒単位で * 処理がブロックされ、フレーム落ちが発生する恐れがあります。<br/> * ボイスプールの作成/破棄は、シーンの切り替わり等、負荷変動を許容できる * タイミングで行うようお願いいたします。<br/> * \sa CriAtomExVoicePool::Dispose */ public static CriAtomExVoicePool AllocateStandardVoicePool( int numVoices, int maxChannels, int maxSamplingRate, bool streamingFlag) { var config = new StandardConfig(); config.identifier = 0; config.num_voices = numVoices; config.max_channels = maxChannels; config.max_sampling_rate = maxSamplingRate; config.streaming_flag = streamingFlag; config.sound_renderer_type = CriAtomEx.SoundRendererType.Default; config.decode_latency = 0; IntPtr handle = criAtomExVoicePool_AllocateStandardVoicePool(ref config, IntPtr.Zero, 0); if (handle == IntPtr.Zero) { return null; } return new CriAtomExVoicePool(handle); }