Merge branch 'development'

Conflicts:
	src/espeakedit.cpp
	src/options.cpp
This commit is contained in:
Reece H. Dunn
2014-01-28 19:04:40 +00:00
18 changed files with 443 additions and 347 deletions
+20 -3
View File
@@ -118,7 +118,7 @@ bool MyApp::OnInit(void)
int j;
const wxChar *p;
char param[80];
char param[120];
if(argc > 1)
@@ -180,20 +180,22 @@ if(argc > 1)
SetTopWindow(myframe);
wxInitAllImageHandlers();
// wxImage::AddHandler(wxPNGHandler);
wxLogStatus(_T("Using espeak_data at: ")+wxString(path_home, wxConvLocal));
return TRUE;
}
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
EVT_CHAR(MyFrame::OnKey)
EVT_MENU(MENU_ABOUT, MyFrame::OnAbout)
EVT_MENU(MENU_DOCS, MyFrame::OnAbout)
EVT_MENU(MENU_DOCS, MyFrame::OnAbout)
EVT_MENU(MENU_SPECTRUM, MyFrame::OnNewWindow)
EVT_MENU(MENU_SPECTRUM2, MyFrame::OnNewWindow)
EVT_MENU(MENU_PROSODY, MyFrame::OnProsody)
EVT_MENU(MENU_OPT_SPEED, MyFrame::OnOptions)
EVT_MENU(MENU_OPT_PUNCT, MyFrame::OnOptions)
EVT_MENU(MENU_OPT_SPELL, MyFrame::OnOptions)
EVT_MENU(MENU_OPT_SPELL2, MyFrame::OnOptions)
EVT_MENU(MENU_OPT_SPELL2, MyFrame::OnOptions)
EVT_MENU(MENU_PATH_DATA, MyFrame::OnOptions)
EVT_MENU(MENU_PATH0, MyFrame::OnOptions)
EVT_MENU(MENU_PATH1, MyFrame::OnOptions)
EVT_MENU(MENU_PATH2, MyFrame::OnOptions)
@@ -387,6 +389,7 @@ void MyFrame::PageCmd(wxCommandEvent& event)
break;
case SPECTSEQ_SAVEAS:
currentcanvas->Save();
screenpages->SetPageText(screenpages->GetSelection(), currentcanvas->spectseq->name+_T(" ²"));
break;
case SPECTSEQ_SAVESELECT:
currentcanvas->Save(_T(""), 1);
@@ -631,6 +634,20 @@ void OnOptions2(int event_id)
notebook->SetSelection(1);
break;
case MENU_PATH_DATA:
string = wxDirSelector(_T("espeak_data directory"), wxEmptyString);
if(!string.IsEmpty())
{
if(!wxDirExists(string+_T("/voices")))
{
wxLogError(_T("No 'voices' directory in ") + string);
break;
}
path_espeakdata = string;
wxLogMessage(_T("Quit and restart espeakedit to use the new espeak_data location"));
}
break;
case MENU_PATH0:
string = wxFileSelector(_T("Master phonemes file"),wxFileName(path_phfile).GetPath(),
_T("phonemes"),_T(""),_T("*"),wxOPEN);
+2
View File
@@ -112,6 +112,7 @@ extern wchar_t ipa1[256];
enum {
MENU_QUIT = 1,
MENU_OPEN,
MENU_SPECTRUM,
MENU_SPECTRUM2,
MENU_CLOSE_ALL,
@@ -124,6 +125,7 @@ enum {
MENU_OPT_SPELL,
MENU_OPT_SPELL2,
MENU_PATHS,
MENU_PATH_DATA,
MENU_PATH0,
MENU_PATH1,
MENU_PATH2,
+8
View File
@@ -39,6 +39,7 @@ extern int GetNumeric(wxTextCtrl *t);
extern void SetNumeric(wxTextCtrl *t, int value);
extern int samplerate;
wxString path_espeakdata;
wxString path_spectload;
wxString path_spectload2;
wxString path_pitches;
@@ -178,6 +179,12 @@ void ConfigInit(bool use_defaults)
}
else
{
pConfig->Read(_T("/espeakdata"),&path_espeakdata,wxEmptyString);
if(path_espeakdata != wxEmptyString)
{
strcpy(path_home, path_espeakdata.mb_str(wxConvLocal));
}
pConfig->Read(_T("/spectload"),&path_spectload,basedir+_T("/phsource"));
pConfig->Read(_T("/spectload2"),&path_spectload2,basedir+_T("/phsource"));
pConfig->Read(_T("/pitchpath"),&path_pitches,basedir+_T("/pitch"));
@@ -210,6 +217,7 @@ void ConfigSave(int exit)
#ifndef PLATFORM_WINDOWS
// pConfig->Write(_T("/samplerate"),samplerate);
#endif
pConfig->Write(_T("/espeakdata"),path_espeakdata);
pConfig->Write(_T("/spectload"),path_spectload);
pConfig->Write(_T("/spectload2"),path_spectload2);
pConfig->Write(_T("/pitchpath"),path_pitches);
+3 -2
View File
@@ -32,6 +32,7 @@ extern void ConfigInit(bool use_defaults);
extern void ConfigSave(int end);
extern void ConfigSetPaths();
extern wxString path_espeakdata;
extern wxString path_spectload;
extern wxString path_spectload2;
extern wxString path_pitches;
@@ -51,13 +52,13 @@ extern void OnOptions2(int event_id);
// not currently used
class Options : public wxDialog {
public:
public:
Options(wxWindow *parent);
~Options();
private:
void OnCommand(wxCommandEvent& event);
wxButton *m_save;
wxButton *m_close;
wxStaticText *m_lab[10];
+10 -10
View File
@@ -2524,6 +2524,16 @@ f_input = f_in; // for GetC etc
linelength++;
if((j = lookupwchar2(tr->chars_ignore,c1)) != 0)
{
if(j == 1)
{
// ignore this character (eg. zero-width-non-joiner U+200C)
continue;
}
c1 = j; // replace the character
}
if(iswalnum(c1))
any_alnum = 1;
else
@@ -2536,16 +2546,6 @@ f_input = f_in; // for GetC etc
c2 = ' ';
}
if((j = lookupwchar2(tr->chars_ignore,c1)) != 0)
{
if(j == 1)
{
// ignore this character (eg. zero-width-non-joiner U+200C)
continue;
}
c1 = j; // replace the character
}
if(c1 == 0xf0b)
c1 = ' '; // Tibet inter-syllabic mark, ?? replace by space ??
+6 -4
View File
@@ -523,12 +523,12 @@ void SpectDisplay::OnKey(wxKeyEvent& event)
if(event.ShiftDown())
{
x_inc = pk_inc1[pk_num];
y_inc = 0x40;
y_inc = 0x20;
}
else
{
x_inc = pk_inc2[pk_num];
y_inc = 0x100;
y_inc = 0x80;
}
switch(key)
@@ -996,7 +996,7 @@ void MyFrame::OnNewWindow(wxCommandEvent& event)
return;
}
wxFileName path = wxFileName(filename);
leaf = path.GetName();
leaf = path.GetName();
setlocale(LC_NUMERIC,"C"); // read numbers in the form 1.23456
spectseq->Load(stream);
@@ -1014,7 +1014,9 @@ void MyFrame::OnNewWindow(wxCommandEvent& event)
SpectDisplay *canvas = new SpectDisplay(screenpages, wxDefaultPosition, wxSize(width, height), spectseq);
screenpages->AddPage(canvas, leaf, true);
canvas->savepath = filename;
currentcanvas = canvas;
currentcanvas = canvas;
notebook->ChangeSelection(0); // select FormatDlg window
}
+1 -1
View File
@@ -35,7 +35,7 @@
#include "translate.h"
#include "wave.h"
const char *version_string = "1.47.16 21.Jan.14";
const char *version_string = "1.47.17 28.Jan.14";
const int version_phdata = 0x014709;
int option_device_number = -1;
+1
View File
@@ -72,6 +72,7 @@ extern int embedded_default[N_EMBEDDED_VALUES];
#define N_PEAKS 9
#define N_PEAKS2 9 // plus Notch and Fill (not yet implemented)
#define N_MARKERS 8
#define N_KLATTP 10 // this affects the phoneme data file format
+3 -2
View File
@@ -1050,7 +1050,7 @@ SetLengthMods(tr,3); // all equal
tr->langopts.unstressed_wd1 = 2;
tr->langopts.unstressed_wd2 = 2;
tr->langopts.param[LOPT_IT_LENGTHEN] = 2; // remove lengthen indicator from unstressed or non-penultimate syllables
tr->langopts.param[LOPT_IT_DOUBLING] = 2; // double the first consonant if the previous word ends in a stressed vowel
tr->langopts.param[LOPT_IT_DOUBLING] = 1; // double the first consonant if the previous word ends in a stressed vowel (changed to =1, 23.01.2014 - only use if prev.word has $double)
tr->langopts.param[LOPT_SONORANT_MIN] = 130; // limit the shortening of sonorants before short vowels
tr->langopts.param[LOPT_REDUCE] = 1; // reduce vowels even if phonemes are specified in it_list
tr->langopts.param[LOPT_ALT] = 2; // call ApplySpecialAttributes2() if a word has $alt or $alt2
@@ -1310,7 +1310,7 @@ SetLengthMods(tr,3); // all equal
tr->langopts.stress_rule = STRESSPOSN_1R; // stress on final syllable
tr->langopts.stress_flags = S_FINAL_DIM_ONLY | S_FINAL_NO_2 | S_INITIAL_2 | S_PRIORITY_STRESS;
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_DFRACTION_2 | NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_ROMAN;
tr->langopts.numbers = NUM_DECIMAL_COMMA | NUM_DFRACTION_2 | NUM_HUNDRED_AND | NUM_AND_UNITS | NUM_ROMAN_CAPITALS;
tr->langopts.numbers2 = NUM2_MULTIPLE_ORDINAL | NUM2_NO_TEEN_ORDINALS | NUM2_ORDINAL_NO_AND;
SetLetterVowel(tr,'y');
ResetLetterBits(tr,0x2);
@@ -1667,6 +1667,7 @@ SetLengthMods(tr,3); // all equal
tr->translator_name = name2;
ProcessLanguageOptions(&tr->langopts);
return(tr);
} // end of SelectTranslator
+1
View File
@@ -1092,6 +1092,7 @@ voice_t *LoadVoice(const char *vname, int control)
if((ix = SelectPhonemeTableName(phonemes_name)) < 0)
{
fprintf(stderr,"Unknown phoneme table: '%s'\n",phonemes_name);
ix = 0;
}
voice->phoneme_tab_ix = ix;
new_translator->phoneme_tab_ix = ix;