Commit 05056251 authored by Martin Schreiber's avatar Martin Schreiber

* msespeakng sonames.

* msedynload shows dlerror() messages.
* msespeakng ini() shows espeak-ng-data error message.
parent f3e48e4f
......@@ -31,7 +31,7 @@ const
'libespeak-ngsync.dll');
{$else}
espeaknglib: array[0..1] of filenamety =
('libespeak-ng.so.1','libespeak-ng.so');
('libespeak-ngsync.so.1','libespeak-ngsync.so');
{$endif}
ENS_GROUP_MASK = $70000000;
......@@ -145,7 +145,7 @@ type
tespeakerror = class(exception)
public
constructor create(const err: espeak_ng_STATUS);
constructor create(const err: espeak_ng_STATUS; const atext: string='');
end;
var
......@@ -392,17 +392,19 @@ begin
result:= string(pchar(@buf))
end;
procedure checkerror(const astate: espeak_ng_status);
procedure checkerror(const astate: espeak_ng_status; const atext: string);
begin
if astate <> 0 then begin
raise tespeakerror.create(astate);
raise tespeakerror.create(astate,atext);
end;
end;
procedure ini(const data: pointer);
begin
espeak_ng_InitializePath(data);
checkerror(espeak_ng_Initialize(@err));
checkerror(espeak_ng_Initialize(@err),
lineend+'espeak-ng-data directory not found'+lineend+
string(pchar(data)));
end;
procedure fini(const data: pointer);
......@@ -451,9 +453,10 @@ end;
{ tespeakerror }
constructor tespeakerror.create(const err: espeak_ng_STATUS);
constructor tespeakerror.create(const err: espeak_ng_STATUS;
const atext: string='');
begin
inherited create('eSpeak error:'+lineend+espeakngerrormessage(err));
inherited create('eSpeak error:'+atext+lineend+espeakngerrormessage(err));
end;
initialization
......
......@@ -363,7 +363,9 @@ end;
procedure tdispfielddatalink.recordchanged(afield: tfield);
begin
if (afield = nil) or (afield = field) then begin
if active and (field <> nil) and not (dataset.eof and dataset.bof) then begin
if active and (field <> nil) and
not (dataset.eof and dataset.bof and
(dataset.state <> dsinsert)) then begin
if field.isnull then begin
fintf.setnullvalue;
end
......
......@@ -86,7 +86,7 @@ function quotelibnames(const libnames: array of filenamety): msestring;
implementation
uses
msesysintf1{,msearrayutils};
msesysintf1{$ifdef linux},dl{$endif},msearrayutils,msestrings;
function getprocaddresses(const lib: tlibhandle;
const procedures: array of funcinfoty;
......@@ -186,9 +186,17 @@ function loadlib(const libnames: array of filenamety; out libname: filenamety;
const noexception: boolean = false): tlibhandle;
var
int1: integer;
s1: string;
{$ifdef linux}
p1: pchar;
ar1: stringarty;
{$endif}
begin
result:= 0;
libname:= '';
{$ifdef linux}
p1:= nil;
{$endif}
for int1:= 0 to high(libnames) do begin
{$ifdef FPC}
result:= loadlibrary(libnames[int1]);
......@@ -199,10 +207,20 @@ begin
libname:= libnames[int1];
break;
end;
{$ifdef linux}
p1:= dlerror();
additem(ar1,string(p1));
{$endif}
end;
if (result = 0) and not noexception then begin
raise exception.create(ansistring(errormessage+
'Library '+quotelibnames(libnames)+' not found.'));
s1:= ansistring(errormessage+
'Library '+quotelibnames(libnames)+' not found.');
{$ifdef linux}
if ar1 <> nil then begin
s1:= s1+lineend+concatstrings(ar1,lineend);
end;
{$endif}
raise exception.create(s1);
end;
end;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment