summaryrefslogtreecommitdiff
path: root/plugins/Watrack/formats
diff options
context:
space:
mode:
authorVadim Dashevskiy <watcherhd@gmail.com>2014-12-31 22:11:10 +0000
committerVadim Dashevskiy <watcherhd@gmail.com>2014-12-31 22:11:10 +0000
commitec7b7cf1c956bf17b60d788d73530fcbd12bf51f (patch)
tree45450baf5b76d8e57b9f198cb1fd9f8db9a6d31f /plugins/Watrack/formats
parent813851def848b52b92f59c379706ada6bebceba9 (diff)
temporary revert
git-svn-id: http://svn.miranda-ng.org/main/trunk@11705 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Watrack/formats')
-rw-r--r--plugins/Watrack/formats/fmt_mp3.pas16
-rw-r--r--plugins/Watrack/formats/fmt_ogg.pas29
-rw-r--r--plugins/Watrack/formats/fmt_real.pas40
-rw-r--r--plugins/Watrack/formats/fmt_wma.pas4
-rw-r--r--plugins/Watrack/formats/tag_id3v1.inc10
-rw-r--r--plugins/Watrack/formats/tag_id3v2.inc12
6 files changed, 56 insertions, 55 deletions
diff --git a/plugins/Watrack/formats/fmt_mp3.pas b/plugins/Watrack/formats/fmt_mp3.pas
index e9d5d68eed..45c0888daa 100644
--- a/plugins/Watrack/formats/fmt_mp3.pas
+++ b/plugins/Watrack/formats/fmt_mp3.pas
@@ -125,18 +125,18 @@ end;
function SearchStart(f:THANDLE; var l:array of byte):Boolean;
var
CurPos:longint;
- buf:array [0..ScanSize] of byte;
+ Buf:array [0..ScanSize] of byte;
i,j:integer;
begin
CurPos:=FilePos(f)-4;
Seek(f,CurPos);
- j:=BlockRead(f,buf,ScanSize);
+ j:=BlockRead(f,Buf,ScanSize);
i:=0;
while i<j do
begin
- if (i<(j-2)) and (buf[i]=$FF) and //FF FB E4
- ((buf[i+1] and $E0)=$E0) and
- ((buf[i+2] and $F0)<>$F0) then
+ if (i<(j-2)) and (Buf[i]=$FF) and //FF FB E4
+ ((Buf[i+1] and $E0)=$E0) and
+ ((Buf[i+2] and $F0)<>$F0) then
begin
Seek(f,CurPos+i);
BlockRead(f,l,4);
@@ -257,7 +257,7 @@ var
w:word;
b:byte;
flag:integer;
- version,Layer:integer;
+ version,layer:integer;
// vbitrate:integer;
// FrmCnt:integer;
begin
@@ -385,8 +385,8 @@ begin
end;
l:=ReadDWord(p,endptr);
version:=(l2b(l)[1] and $18) shr 3;
- Layer :=(l2b(l)[1] and $06) shr 1;
- Info.kbps :=btable[version and 1][Layer-1][l2b(l)[2] shr 4];
+ layer :=(l2b(l)[1] and $06) shr 1;
+ Info.kbps :=btable[version and 1][layer-1][l2b(l)[2] shr 4];
Info.khz :=(stable[version][(l2b(l)[2] and $0C) shr 2]) div 1000;
Info.channels:=l2b(l)[3] shr 6;
if Info.channels=3 then
diff --git a/plugins/Watrack/formats/fmt_ogg.pas b/plugins/Watrack/formats/fmt_ogg.pas
index fbe959d48b..d0ba567d08 100644
--- a/plugins/Watrack/formats/fmt_ogg.pas
+++ b/plugins/Watrack/formats/fmt_ogg.pas
@@ -5,12 +5,12 @@ unit fmt_OGG;
interface
uses wat_api;
-function ReadOGG(var Info:tSongInfo):boolean; cdecl;
-function ReadSPX(var Info:tSongInfo):boolean; cdecl;
-function ReadfLaC(var Info:tSongInfo):boolean; cdecl;
+function ReadOGG(var Info:wat_api.tSongInfo):boolean; cdecl;
+function ReadSPX(var Info:wat_api.tSongInfo):boolean; cdecl;
+function ReadfLaC(var Info:wat_api.tSongInfo):boolean; cdecl;
implementation
-uses windows,common,io,tags,srv_format,base64,utils;
+uses windows,common,io,tags,srv_format,utils, m_api;
const
OGGSign = $5367674F; //OggS
@@ -95,12 +95,12 @@ const
5 : CUESHEET
}
type
- tMetaHdr = packed record
+ MetaHdr = packed record
blocktype:byte;
blocklen:array [0..2] of byte;
end;
type
- tStreamInfo = packed record
+ StreamInfo = packed record
MinBlockSize:word;
MaxBlocksize:word;
MinFrameSize:array [0..2] of byte;
@@ -109,9 +109,10 @@ type
MD5:array [0..15] of byte;
end;
-procedure OGGGetComment(ptr:PAnsiChar;size:integer;var Info:tSongInfo);
+procedure OGGGetComment(ptr:PAnsiChar;size:integer;var Info:wat_api.tSongInfo);
var
- clen,alen,len,values:dword;
+ alen,len,values:dword;
+ clen:int;
ls:PAnsiChar;
value:PAnsiChar;
cover:pByte;
@@ -150,7 +151,7 @@ begin
else if (Info.track=0) and (lstrcmpia(ls,'TRACKNUMBER')=0) then Info.track:=StrToInt(value)
- else if (cover=nil) and (lstrcmpia(ls,'COVERART')=0) then clen:=Base64Decode(value,cover)
+ else if (cover=nil) and (lstrcmpia(ls,'COVERART')=0) then cover:=mir_base64_decode(value,clen)
else if lstrcmpia(ls,'COVERARTMIME')=0 then ext:=GetImageType(nil,value);
end;
dec(values);
@@ -184,7 +185,7 @@ begin
end;
end;
-function ReadSPX(var Info:tSongInfo):boolean; cdecl;
+function ReadSPX(var Info:wat_api.tSongInfo):boolean; cdecl;
var
f:THANDLE;
OGGHdr:tOGGHdr;
@@ -242,7 +243,7 @@ begin
result:=0;
end;
-function ReadOGG(var Info:tSongInfo):boolean; cdecl;
+function ReadOGG(var Info:wat_api.tSongInfo):boolean; cdecl;
var
f:THANDLE;
OGGHdr:tOGGHdr;
@@ -367,12 +368,12 @@ begin
CloseHandle(f);
end;
-function ReadfLaC(var Info:tSongInfo):boolean; cdecl;
+function ReadfLaC(var Info:wat_api.tSongInfo):boolean; cdecl;
var
f:THANDLE;
data64:int64;
- hdr:tMetaHdr;
- frm:tStreamInfo;
+ hdr:MetaHdr;
+ frm:StreamInfo;
id:dword;
flag:integer;
size:dword;
diff --git a/plugins/Watrack/formats/fmt_real.pas b/plugins/Watrack/formats/fmt_real.pas
index 1d69a2f353..8d5f5bf72d 100644
--- a/plugins/Watrack/formats/fmt_real.pas
+++ b/plugins/Watrack/formats/fmt_real.pas
@@ -23,7 +23,7 @@ const
type
tChunk = packed record
ID:dword;
- len:dword; //with Chunk;
+ Len:dword; //with Chunk;
end;
type
@@ -43,32 +43,32 @@ type
procedure SkipStr(var p:PAnsiChar;alen:integer);
var
- llen:integer;
+ len:integer;
begin
if alen=2 then
- llen:=(ord(p[0]) shl 8)+ord(p[1])
+ len:=(ord(p[0]) shl 8)+ord(p[1])
else
- llen:=ord(p[0]);
+ len:=ord(p[0]);
inc(p,alen);
-// if llen>0 then
- inc(p,llen);
+// if len>0 then
+ inc(p,len);
end;
function ReadStr(var p:PAnsiChar;alen:integer):PAnsiChar;
var
- llen:integer;
+ len:integer;
begin
if alen=2 then
- llen:=(ord(p[0]) shl 8)+ord(p[1])
+ len:=(ord(p[0]) shl 8)+ord(p[1])
else
- llen:=ord(p[0]);
+ len:=ord(p[0]);
inc(p,alen);
- if llen>0 then
+ if len>0 then
begin
- mGetMem(result,llen+1);
- move(p^,result^,llen);
- result[llen]:=#0;
- inc(p,llen);
+ mGetMem(result,len+1);
+ move(p^,result^,len);
+ result[len]:=#0;
+ inc(p,len);
end
else
result:=nil;
@@ -103,15 +103,15 @@ begin
while FilePos(f)<fsize do
begin
BlockRead(f,chunk,SizeOf(chunk));
- chunk.len:=BSwap(chunk.len);
+ chunk.Len:=BSwap(chunk.Len);
if (not (AnsiChar(chunk.ID and $FF) in ['A'..'Z','a'..'z','.'])) or
- (chunk.len<SizeOf(chunk)) then
+ (chunk.Len<SizeOf(chunk)) then
break;
if (chunk.ID=blkPROP) or (chunk.ID=blkCONT) or (chunk.ID=blkMDPR) then
begin
- mGetMem(buf,chunk.len-SizeOf(chunk));
+ mGetMem(buf,chunk.Len-SizeOf(chunk));
p:=buf;
- BlockRead(f,buf^,chunk.len-SizeOf(chunk));
+ BlockRead(f,buf^,chunk.Len-SizeOf(chunk));
if chunk.ID=blkPROP then
begin
inc(p,22);
@@ -273,7 +273,7 @@ begin
end
else if chunk.ID=blkRMMD then //comment
begin
- Skip(f,chunk.len-SizeOf(chunk));
+ Skip(f,chunk.Len-SizeOf(chunk));
{
BlockRead(f,chunk,SizeOf(chunk)); //RJMD
chunk.len:=BSwap(chunk.len);
@@ -289,7 +289,7 @@ begin
if chunk.ID=blk_RMF then
if FilePos(f)<>SizeOf(chunk) then // channels-1: ofs=$0A
break;
- Skip(f,chunk.len-SizeOf(chunk));
+ Skip(f,chunk.Len-SizeOf(chunk));
end;
end;
ReadID3v1(f,Info);
diff --git a/plugins/Watrack/formats/fmt_wma.pas b/plugins/Watrack/formats/fmt_wma.pas
index 8027ce052d..ed575147ac 100644
--- a/plugins/Watrack/formats/fmt_wma.pas
+++ b/plugins/Watrack/formats/fmt_wma.pas
@@ -295,7 +295,7 @@ type
size :word;
bitmap :BITMAPINFOHEADER;
end;
- tPrefix = packed record
+ Prefix = packed record
StreamType :tGUID;
ECGUID :tGUID; // Error Correction
TimeOffset :int64;
@@ -309,7 +309,7 @@ var
tmpguid:pGUID;
begin
tmpguid:=pointer(ptr);
- inc(ptr,SizeOf(tPrefix)); //ofset to Type-Specific Data
+ inc(ptr,SizeOf(Prefix)); //ofset to Type-Specific Data
if CompareGUID(tmpguid^,ASF_Audio_Media) then
begin
Info.channels:=pAudio(ptr)^.Channels;
diff --git a/plugins/Watrack/formats/tag_id3v1.inc b/plugins/Watrack/formats/tag_id3v1.inc
index 5e1f89539a..bd1db906bb 100644
--- a/plugins/Watrack/formats/tag_id3v1.inc
+++ b/plugins/Watrack/formats/tag_id3v1.inc
@@ -61,7 +61,7 @@ procedure ID3v1_CheckLyric(var Info:tSongInfo;f:THANDLE;ofs:integer);
const
maxlen = 5100;
var
- TagHdr:array [0..9] of AnsiChar;
+ tagHdr:array [0..9] of AnsiChar;
buf:array [0..maxlen] of AnsiChar;
ptr,ptr1:PAnsiChar;
i,size:integer;
@@ -69,9 +69,9 @@ var
c:dword;
begin
Seek(f,ofs);
- BlockRead(f,TagHdr,LyricEndLen);
- TagHdr[9]:=#0;
- if StrCmp(TagHdr,Lyric1End,LyricEndLen)=0 then
+ BlockRead(f,tagHdr,LyricEndLen);
+ tagHdr[9]:=#0;
+ if StrCmp(tagHdr,Lyric1End,LyricEndLen)=0 then
begin
if Info.lyric=nil then
begin
@@ -91,7 +91,7 @@ begin
end;
end;
end
- else if StrCmp(TagHdr,Lyric2End,LyricEndLen)=0 then
+ else if StrCmp(tagHdr,Lyric2End,LyricEndLen)=0 then
begin
Seek(f,ofs-6);
BlockRead(f,buf,6);
diff --git a/plugins/Watrack/formats/tag_id3v2.inc b/plugins/Watrack/formats/tag_id3v2.inc
index 5ee98ca9e1..78660fdb6d 100644
--- a/plugins/Watrack/formats/tag_id3v2.inc
+++ b/plugins/Watrack/formats/tag_id3v2.inc
@@ -307,17 +307,17 @@ begin
end;
end;
-function ID3v2_PreReadTag(var Frm:tID3v2FrameHdr;var src:PAnsiChar;ver:integer):PAnsiChar;
+function ID3v2_PreReadTag(var frm:tID3v2FrameHdr;var src:PAnsiChar;ver:integer):PAnsiChar;
var
i:cardinal;
dst:PAnsiChar;
begin
- mGetMem(result,Frm.Size);
- if Unsync or ((Frm.Flags and $0200)<>0) then
+ mGetMem(result,frm.Size);
+ if Unsync or ((frm.Flags and $0200)<>0) then
begin
dst:=result;
i:=0;
- while i<Frm.Size do
+ while i<frm.Size do
begin
dst^:=src^;
inc(src);
@@ -332,8 +332,8 @@ begin
end
else
begin
- move(src^,result^,Frm.Size);
- inc(src,Frm.Size);
+ move(src^,result^,frm.Size);
+ inc(src,frm.Size);
end;
end;