捐赠 | 广告 | 注册 | 发布 | 上传 | 关于我们    
  粤ICP备10103342号-1 DELPHI盒子 | 盒子文章 | 盒子问答悬赏 | 最新更新 | 盒子检索 | 下载中心 | 高级搜索    
  精品专区 | 繁體中文 | 奖励公告栏 | 直通车账号登陆 | 关闭GOOGLE广告 | 临时留言    
 
广告
评论:winamp v2.X 歌词显示插件
carbe 19277 2005/11/17 16:52:33
谁知道如果让歌词横着滚动,从右向左滚动。怎么修改代码?现在这个只能实现歌词从下到上滚动
qiyuanwj 17744 2005/9/11 22:44:54
CheckLrcFile函数预留的几个备用的变量,现在没用了,修改的时候注意将无用的变量删了,不好意思:)
qiyuanwj 17743 2005/9/11 22:32:57
Bug报告以及解决方法:
U_Main.pas单元中的TDisPlay.readfile过程中,看下面的代码:

begin
  sj := copy(temp, pos('[', temp) + 1, pos(']', temp) - pos('[', temp) - 1);
  temp := copy(temp, pos(']', temp) + 1, length(temp) - pos(']', temp));
  if strisint(copy(sj, 1, 2)) and strisint(copy(sj, 4, 2)) then
  begin
    sj := inttostr(( strtoint(copy(sj, 1, 2)) * 60 * 1000 + //{歌词时间 [16.29.074] 中的16}
          strtoint(copy(sj, 4, 2)) * 1000 +  // { [16.29.074] 中的29}
          strtoint(copy(sj, 7, 2)) * 10     // { [16.29.074] 中的074    如果是这样的时间格式 [00:17] 这样的就要出错}
          ) - offset);
    sj := format('%10s', [sj]);
    tmp.Add(sj);
  end;
  y := pos('[', temp);
end;

代码修改为:
增加一个字符串变量ss,

begin
  sj := copy(temp, pos('[', temp) + 1, pos(']', temp) - pos('[', temp) - 1); //取出类似[16:29.074]中的时间
  temp := copy(temp, pos(']', temp) + 1, length(temp) - pos(']', temp)); //取出歌词
  if strisint(copy(sj, 1, 2)) and strisint(copy(sj, 4, 2)) then
    begin
      ss:=sj;
      sj := inttostr((
      strtoint(copy(sj, 1, 2)) * 60 * 1000 + 
      strtoint(copy(sj, 4, 2)) * 1000 ) - offset);
      if  strisint(copy(ss, 7, 2)) then
          sj:= inttostr(( strtoint(copy(ss, 7, 2)) * 10)+strtoint(sj));
      sj := format('%10s', [sj]);
      tmp.Add(sj);
    end;
    y := pos('[', temp);
 end;

另外,如果歌词文件有问题,比如少一个“[”或“]”则程序就会死循环,耗尽cpu,直至当机。
加两个歌词文件的完整校验函数,主要是判断是不是缺少“[”或“]”。

//////////自编某一字符串中两个子字符串出现的次数是否相等的函数(判断[  ]  是否个数一样)
function CheckStrTotal(S, string1, string2: string): Boolean;
var
  str1, str2: string;
  i, j, nb1, nb2, StrLen: integer;
begin
  str1 := S;
  str2 := S;
  nb1 := 0;
  nb2 := 0;

  i := pos(string1, str1);
  while i <> 0 do
  begin
    i := pos(string1, str1);
    if i > 0 then
    begin
      StrLen := length(string1);
      delete(str1, i, StrLen);
      nb1 := nb1 + 1;
    end;
  end;

  j := pos(string2, str2);
  while j <> 0 do
  begin
    j := pos(string2, str2);
    if j > 0 then
    begin
      StrLen := length(string2);
      delete(str2, j, StrLen);
      nb2 := nb2 + 1;
    end;
  end;

  if nb1 = nb2 then
    Result := True
  else
    Result := false;
end;

//////////检查lrc文件的完整性,  防止死循环//////////
function CheckLrcFile(LrcfileStr: string): Boolean;
var
  strlist: tstringlist;
  str1, str2: string;
  i, j, mm, nn: integer;
begin
  try
    strlist := tstringlist.Create;
    strlist.LoadFromFile(LrcfileStr);
    for i := 0 to strlist.Count - 1 do
    begin
      if CheckStrTotal(strlist[i], '[', ']') then
        Result := True
      else
      begin
        Result := false;
        break;
      end;
    end;
  finally
    strlist.Free;
  end;
end;

其中CheckLrcFile函数在Readfile之前加入。
lines 13314 2005/3/17 21:20:53
好,DOWN下来看看。。。

感谢哥们提供!!!!
第一页 上一页 下一页 最后页 有 4 条纪录 共1页 1 - 4
 用户名:
 密 码:
自动登陆(30天有效)
 
  DELPHI盒子版权所有 技术支持:深圳市麟瑞科技有限公司 1999-2024 V4.01 粤ICP备10103342号-1 更新RSS列表