Browse Source

* madopenal sample fixes
* libmodplug 0.7 should work with modplug.pas headers now

git-svn-id: trunk@4704 -

ivost 19 years ago
parent
commit
047c650ca3
2 changed files with 12 additions and 14 deletions
  1. 5 8
      packages/extra/modplug/modplug.pas
  2. 7 6
      packages/extra/openal/examples/madopenal.pas

+ 5 - 8
packages/extra/modplug/modplug.pas

@@ -115,19 +115,16 @@ type
 procedure ModPlug_GetSettings(settings: PModPlug_Settings); cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF};
 procedure ModPlug_SetSettings(const settings: PModPlug_Settings); cdecl; external {$IFDEF DYNLINK}modpluglib{$ENDIF};
 
-
-// libc functions
-//function _new(s: cuint): pointer; cdecl;
-//procedure _delete(p: pointer); cdecl;
-
 implementation
 
-{function _new(s: cuint): pointer; cdecl;
+function cppNew(s: cint): pointer; cdecl; public; alias : '_Znaj'; alias : '_Znwj';
 begin
+  GetMem(Result, s);
 end;
 
-procedure _delete(p: pointer); cdecl;
+procedure cppDelete(p: pointer); cdecl; public; alias : '_ZdlPv'; alias : '_ZdaPv';
 begin
-end;}
+  FreeMem(p);
+end;
 
 end.

+ 7 - 6
packages/extra/openal/examples/madopenal.pas

@@ -3,7 +3,7 @@ program test;
 {$mode objfpc}
 
 uses
-  classes, sysutils, ctypes, openal, mad, ogg, vorbis, a52, dts, modplug;
+  classes, sysutils, ctypes, openal, mad, ogg, vorbis, a52, dts, modplug, matroska;
 
 var
   source     : TStream;
@@ -180,7 +180,7 @@ begin
   end;
 
   // Under windows, AL_LOOPING = AL_TRUE breaks queueing, no idea why
-  alSourcei(al_source, AL_LOOPING, {AL_FALSE}AL_TRUE);
+  alSourcei(al_source, AL_LOOPING, AL_FALSE);
   alSourcePlay(al_source);
 end;
 
@@ -225,17 +225,18 @@ var
   tmp: pointer;
 begin
 // define codec
-  {WriteLn('Define codec');
+  WriteLn('Define codec');
   Writeln('  (1) mp3');
   Writeln('  (2) ogg');
   Writeln('  (3) ac3');
   Writeln('  (4) dts');
   Writeln('  (5) xm,mod,it,s3m');
+  Writeln('  (6) mka');
   Write('Enter: '); ReadLn(codec);
-  Write('File: '); ReadLn(Filename);}
+  Write('File: '); ReadLn(Filename);
 
-  codec := 4;
-  Filename := 'test.dts';
+  {codec := 4;
+  Filename := 'test.dts';}
 
 
 // load file