• 2831阅读
  • 0回复

GetConfig/SetConfig 参数的C#枚举封装 [复制链接]

上一主题 下一主题
离线kewid
 

只看楼主 倒序阅读 使用道具 楼主  发表于: 2019-01-10
  
GetConfig/SetConfig ConfigIdEnum AplayerConfig.zip (15 K) 下载次数:39

   将GetConfig/SetConfig这对方法的ConfigId封装为C#的枚举,方便参数设置用。


形如:
  1. public enum AplayerConfig : int
  2.     {
  3.         /// <summary>
  4.         ///  str R 获取一个_APlayer_引擎的组成文件的信息串。
  5.         /// </summary>
  6.         APlayer_Info = 1,
  7.         /// <summary>
  8.         ///  str R/W 解码器路径,允许用户自定义解码器的存放路径,默认为_APlayer.DLL_所在的路径的_codecs_目录
  9.         /// </summary>
  10.         Codecs_path = 2
  11. //...完整代码见附件
  12. }

调用方法:
  1. public bool ConfigurePlayer(AplayerConfig config, object value)
  2.         {
  3.     int result = Player.SetConfig((int)config, value + "");
  4.     return result == 1;
  5.         }
  6.         public string GetConfigure(AplayerConfig config)
  7.         {
  8.     return Player.GetConfig((int)config);
  9.         }






快速回复
限100 字节
如果您在写长篇帖子又不马上发表,建议存为草稿
 
上一个 下一个