| @@ -1680,22 +1680,6 @@ int LoadSpect(const char *path, int control) | |||
| total = 0; | |||
| for(frame=0; frame < spectseq->numframes; frame++) | |||
| { | |||
| #ifdef deleted | |||
| for(ix=0; ix<8; ix++) | |||
| { | |||
| // find which files have certain markers set | |||
| if(spectseq->frames[frame]->markers & (1<<ix)) | |||
| { | |||
| markers_used[ix]++; | |||
| if((ix==3) || (ix==4)) | |||
| { | |||
| fprintf(f_errors,"Marker %d: %s\n",ix,path); | |||
| } | |||
| } | |||
| } | |||
| #endif | |||
| if(spectseq->frames[frame]->keyframe) | |||
| { | |||
| if(seq_out.n_frames == 1) | |||
| @@ -164,32 +164,6 @@ int TestSynthCallback(short *wav, int numsamples, espeak_EVENT *events) | |||
| //****************************************************************************************************** | |||
| #ifdef deleted | |||
| static int RuLex_sorter(char **a, char **b) | |||
| {//======================================= | |||
| char *pa, *pb; | |||
| int xa, xb; | |||
| int ix; | |||
| pa = *a; | |||
| pb = *b; | |||
| xa = strlen(pa)-1; | |||
| xb = strlen(pb)-1; | |||
| while((xa >= 0) && (xb >= 0)) | |||
| { | |||
| if((ix = (pa[xa] - pb[xb])) != 0) | |||
| return(ix); | |||
| xa--; | |||
| xb--; | |||
| } | |||
| return(pa - pb); | |||
| } /* end of strcmp2 */ | |||
| #endif | |||
| static const unsigned short KOI8_R[0x60] = { | |||
| 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556, // a0 | |||
| 0x2557, 0x2558, 0x2559, 0x255a, 0x255b, 0x255c, 0x255d, 0x255e, // a8 | |||
| @@ -766,17 +740,7 @@ void Lexicon_De() | |||
| if((c2 = pronounce[ix+1]) == 'i') | |||
| { | |||
| defer_stress =1; | |||
| #ifdef deleted | |||
| if(stress == 4) | |||
| { | |||
| *p++ = 'i'; | |||
| c =':'; | |||
| } | |||
| else | |||
| #endif | |||
| { | |||
| c = 'I'; | |||
| } | |||
| c = 'I'; | |||
| ix++; | |||
| } | |||
| } | |||
| @@ -1171,33 +1135,6 @@ void Lexicon_Ru() | |||
| int syllables; | |||
| } SUFFIX; | |||
| #ifdef deleted | |||
| FILE *f_roots; | |||
| int sfx; | |||
| const char *suffix; | |||
| int wlen; | |||
| int len; | |||
| static SUFFIX suffixes[] = { | |||
| {NULL,0}, | |||
| {"ичу",2}, | |||
| {"ского",2}, | |||
| {"ская",2}, | |||
| {"ски",1}, | |||
| {"ские",2}, | |||
| {"ский",1}, | |||
| {"ским",1}, | |||
| {"ское",2}, | |||
| {"ской",1}, | |||
| {"ском",1}, | |||
| {"скую",2}, | |||
| {"а",1}, | |||
| {"е",1}, | |||
| {"и",1}, | |||
| {NULL,0}}; | |||
| #endif | |||
| memset(counts,0,sizeof(counts)); | |||
| if(gui_flag) | |||
| @@ -1374,32 +1311,6 @@ void Lexicon_Ru() | |||
| //CharStats(); | |||
| } | |||
| } | |||
| #ifdef deleted | |||
| if(check_root) | |||
| { | |||
| // does this word match any suffixes ? | |||
| wlen = strlen(word); | |||
| for(sfx=0;(suffix = suffixes[sfx].suffix) != NULL; sfx++) | |||
| { | |||
| len = strlen(suffix); | |||
| if(len >= (wlen-2)) | |||
| continue; | |||
| if(ru_stress > (vcount - suffixes[sfx].syllables)) | |||
| continue; | |||
| if(strcmp(suffix,&word[wlen-len])==0) | |||
| { | |||
| strcpy(word2,word); | |||
| word2[wlen-len] = 0; | |||
| // fprintf(f_roots,"%s\t $%d\t\\ %s\n",word2,ru_stress,suffix); | |||
| fprintf(f_roots,"%s\t $%d\n",word2,ru_stress); | |||
| } | |||
| } | |||
| } | |||
| #endif | |||
| } | |||
| fclose(f_in); | |||
| @@ -1419,25 +1330,6 @@ void Lexicon_Ru() | |||
| if(f_log != NULL) | |||
| { | |||
| #ifdef deleted | |||
| // list tables of frequency of stress position for words of different syllable lengths | |||
| int j,k; | |||
| for(ix=2; ix<12; ix++) | |||
| { | |||
| fprintf(f_log,"%2d syllables\n",ix); | |||
| for(k=0; k<10; k++) | |||
| { | |||
| fprintf(f_log," %2d :",k); | |||
| for(j=1; j<=ix; j++) | |||
| { | |||
| fprintf(f_log,"%6d ",counts[ix][j][k]); | |||
| } | |||
| fprintf(f_log,"\n"); | |||
| } | |||
| fprintf(f_log,"\n\n"); | |||
| } | |||
| #endif | |||
| fclose(f_log); | |||
| } | |||
| @@ -2246,36 +2138,6 @@ void CharsetToUnicode(const char *charset) | |||
| #ifdef deleted | |||
| void Test2() | |||
| { | |||
| // | |||
| char buf[120]; | |||
| FILE *f; | |||
| FILE *f_out; | |||
| unsigned char *p; | |||
| f = fopen("/home/jsd1/tmp1/list","r"); | |||
| if(f == NULL) return; | |||
| f_out = fopen("/home/jsd1/tmp1/list_out","w"); | |||
| if(f_out == NULL) return; | |||
| while(!feof(f)) | |||
| { | |||
| if(fgets(buf,sizeof(buf),f) == NULL) | |||
| break; | |||
| p = (unsigned char *)buf; | |||
| while(*p > ' ') p++; | |||
| *p = 0; | |||
| fprintf(f_out,"%s . . .\n",buf); | |||
| } | |||
| fclose(f); | |||
| fclose(f_out); | |||
| } | |||
| #endif | |||
| #define MAX_WALPHA 0x24f | |||
| void Make_walpha_tab() | |||
| {//=================== | |||
| @@ -444,22 +444,6 @@ static int compile_line(char *linebuf, char *dict_line, int *hash) | |||
| p = linebuf; | |||
| // while(isspace2(*p)) p++; | |||
| #ifdef deleted | |||
| if(*p == '$') | |||
| { | |||
| if(memcmp(p,"$textmode",9) == 0) | |||
| { | |||
| text_mode = 1; | |||
| return(0); | |||
| } | |||
| if(memcmp(p,"$phonememode",12) == 0) | |||
| { | |||
| text_mode = 0; | |||
| return(0); | |||
| } | |||
| } | |||
| #endif | |||
| step = 0; | |||
| c = 0; | |||
| @@ -976,14 +960,12 @@ static void copy_rule_string(char *string, int *state_out) | |||
| if(c == '\\') | |||
| { | |||
| c = *p++; // treat next character literally | |||
| //#ifdef deleted | |||
| if((c >= '0') && (c <= '3') && (p[0] >= '0') && (p[0] <= '7') && (p[1] >= '0') && (p[1] <= '7')) | |||
| { | |||
| // character code given by 3 digit octal value; | |||
| c = (c-'0')*64 + (p[0]-'0')*8 + (p[1]-'0'); | |||
| p += 2; | |||
| } | |||
| //endif | |||
| literal = 1; | |||
| } | |||
| if(hexdigit_input) | |||
| @@ -1714,15 +1714,6 @@ void SetWordStress(Translator *tr, char *output, unsigned int *dictionary_flags, | |||
| ph = phoneme_tab[p[0]]; | |||
| } | |||
| #ifdef deleted | |||
| int gap = tr->langopts.word_gap & 0x700; | |||
| if((gap) && (vowel_stress[1] >= 4) && (prev_stress >= 4)) | |||
| { | |||
| /* two primary stresses together, insert a short pause */ | |||
| *output++ = pause_phonemes[gap >> 8]; | |||
| } | |||
| else | |||
| #endif | |||
| if((tr->langopts.vowel_pause & 0x30) && (ph->type == phVOWEL)) | |||
| { | |||
| // word starts with a vowel | |||
| @@ -2760,15 +2751,6 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c | |||
| return(0); | |||
| } | |||
| } | |||
| #ifdef deleted | |||
| // can't switch to a tone language, because the tone-phoneme numbers are not valid for the original language | |||
| if((letter >= 0x4e00) && (letter < 0xa000) && (tr->langopts.ideographs != 1)) | |||
| { | |||
| // Chinese ideogram | |||
| sprintf(phonemes,"%czh",phonSWITCH); | |||
| return(0); | |||
| } | |||
| #endif | |||
| // is it a bracket ? | |||
| if(letter == 0xe000+'(') | |||
| @@ -2869,12 +2851,6 @@ int TranslateRules(Translator *tr, char *p_start, char *phonemes, int ph_size, c | |||
| if(word_flags & FLAG_UNPRON_TEST) | |||
| return(match1.end_type | 1); | |||
| #ifdef deleted | |||
| // ?? allow $unpr while translating rules, not just on initial FLAG_UNPRON_TEST | |||
| if((match1.end_type & SUFX_UNPRON) && !(word_flags & FLAG_SUFFIX_REMOVED)) | |||
| return(match1.end_type); | |||
| #endif | |||
| if((match1.phonemes[0] == phonSWITCH) && ((word_flags & FLAG_DONT_SWITCH_TRANSLATOR)==0)) | |||
| { | |||
| // an instruction to switch language, return immediately so we can re-translate | |||
| @@ -1257,13 +1257,6 @@ void CalcPitches(Translator *tr, int clause_type) | |||
| else | |||
| calc_pitches(option, st_start, ix, group_tone); | |||
| #ifdef deleted | |||
| if((ix < n_st) || (clause_type == 0)) | |||
| calc_pitches(option, st_start, ix, group_tone_emph); // split into > 1 tone groups, use emphatic tone | |||
| else | |||
| calc_pitches(option, st_start, ix, group_tone); | |||
| #endif | |||
| st_start = ix; | |||
| } | |||
| if((st_start < st_ix) && (syl->flags & SYL_END_CLAUSE)) | |||
| @@ -151,25 +151,6 @@ static double resonator2(resonator_ptr r, double input) | |||
| /* | |||
| function ANTIRESONATOR | |||
| This is a generic anti-resonator function. The code is the same as resonator | |||
| except that a,b,c need to be set with setzeroabc() and we save inputs in | |||
| p1/p2 rather than outputs. There is currently only one of these - "rnz" | |||
| Output = (rnz.a * input) + (rnz.b * oldin1) + (rnz.c * oldin2) | |||
| */ | |||
| #ifdef deleted | |||
| static double antiresonator(resonator_ptr r, double input) | |||
| { | |||
| register double x = (double)r->a * (double)input + (double)r->b * (double)r->p1 + (double)r->c * (double)r->p2; | |||
| r->p2 = (double)r->p1; | |||
| r->p1 = (double)input; | |||
| return (double)x; | |||
| } | |||
| #endif | |||
| static double antiresonator2(resonator_ptr r, double input) | |||
| { | |||
| register double x = (double)r->a * (double)input + (double)r->b * (double)r->p1 + (double)r->c * (double)r->p2; | |||
| @@ -450,37 +431,6 @@ if(option_log_frames) | |||
| out = outbypas - out; | |||
| #ifdef deleted | |||
| // for testing | |||
| if (kt_globals.outsl != 0) | |||
| { | |||
| switch(kt_globals.outsl) | |||
| { | |||
| case 1: | |||
| out = voice; | |||
| break; | |||
| case 2: | |||
| out = aspiration; | |||
| break; | |||
| case 3: | |||
| out = frics; | |||
| break; | |||
| case 4: | |||
| out = glotout; | |||
| break; | |||
| case 5: | |||
| out = par_glotout; | |||
| break; | |||
| case 6: | |||
| out = outbypas; | |||
| break; | |||
| case 7: | |||
| out = sourc; | |||
| break; | |||
| } | |||
| } | |||
| #endif | |||
| out = resonator(&(kt_globals.rsn[Rout]),out); | |||
| temp = (int)(out * wdata.amplitude * kt_globals.amp_gain0) ; /* Convert back to integer */ | |||
| @@ -1148,18 +1098,7 @@ int Wavegen_Klatt(int resume) | |||
| if(end_wave > 0) | |||
| { | |||
| #ifdef deleted | |||
| if(end_wave == 2) | |||
| { | |||
| fade = (kt_globals.T0 - kt_globals.nper)/4; // samples until end of current cycle | |||
| if(fade < 64) | |||
| fade = 64; | |||
| } | |||
| else | |||
| #endif | |||
| { | |||
| fade = 64; // not followd by formant synthesis | |||
| } | |||
| fade = 64; // not followd by formant synthesis | |||
| // fade out to avoid a click | |||
| kt_globals.fadeout = fade; | |||
| @@ -458,20 +458,6 @@ printf("%3d: speedf %d %d %d pause=%d %d wav=%d lenmod=%d %d\n",wpm,speed1, | |||
| #endif // of INCLUDE_SONIC | |||
| #ifdef deleted | |||
| void SetAmplitude(int amp) | |||
| {//======================= | |||
| static unsigned char amplitude_factor[] = {0,5,6,7,9,11,14,17,21,26, 32, 38,44,50,56,63,70,77,84,91,100 }; | |||
| if((amp >= 0) && (amp <= 20)) | |||
| { | |||
| option_amplitude = (amplitude_factor[amp] * 480)/256; | |||
| } | |||
| } | |||
| #endif | |||
| void SetParameter(int parameter, int value, int relative) | |||
| {//====================================================== | |||
| // parameter: reset-all, amp, pitch, speed, linelength, expression, capitals, number grouping | |||
| @@ -597,8 +597,6 @@ void MarkerEvent(int type, unsigned int char_position, int value, int value2, un | |||
| if((type == espeakEVENT_MARK) || (type == espeakEVENT_PLAY)) | |||
| ep->id.name = &namedata[value]; | |||
| else | |||
| //#ifdef deleted | |||
| // temporarily removed, don't introduce until after eSpeak version 1.46.02 | |||
| if(type == espeakEVENT_PHONEME) | |||
| { | |||
| int *p; | |||
| @@ -607,7 +605,6 @@ void MarkerEvent(int type, unsigned int char_position, int value, int value2, un | |||
| p[1] = value2; | |||
| } | |||
| else | |||
| //#endif | |||
| { | |||
| ep->id.number = value; | |||
| } | |||
| @@ -1035,26 +1032,7 @@ ESPEAK_API espeak_ERROR espeak_SetVoiceByName(const char *name) | |||
| {//============================================================ | |||
| ENTER("espeak_SetVoiceByName"); | |||
| //#ifdef USE_ASYNC | |||
| // I don't think there's a need to queue change voice requests | |||
| #ifdef deleted | |||
| espeak_ERROR a_error; | |||
| if(synchronous_mode) | |||
| { | |||
| return(SetVoiceByName(name)); | |||
| } | |||
| t_espeak_command* c = create_espeak_voice_name(name); | |||
| a_error = fifo_add_command(c); | |||
| if (a_error != EE_OK) | |||
| { | |||
| delete_espeak_command(c); | |||
| } | |||
| return a_error; | |||
| #else | |||
| return(SetVoiceByName(name)); | |||
| #endif | |||
| } // end of espeak_SetVoiceByName | |||
| @@ -1063,25 +1041,7 @@ ESPEAK_API espeak_ERROR espeak_SetVoiceByProperties(espeak_VOICE *voice_selector | |||
| {//============================================================================== | |||
| ENTER("espeak_SetVoiceByProperties"); | |||
| //#ifdef USE_ASYNC | |||
| #ifdef deleted | |||
| espeak_ERROR a_error; | |||
| if(synchronous_mode) | |||
| { | |||
| return(SetVoiceByProperties(voice_selector)); | |||
| } | |||
| t_espeak_command* c = create_espeak_voice_spec( voice_selector); | |||
| a_error = fifo_add_command(c); | |||
| if (a_error != EE_OK) | |||
| { | |||
| delete_espeak_command(c); | |||
| } | |||
| return a_error; | |||
| #else | |||
| return(SetVoiceByProperties(voice_selector)); | |||
| #endif | |||
| } // end of espeak_SetVoiceByProperties | |||
| @@ -1559,24 +1559,6 @@ SetLengthMods(tr,3); // all equal | |||
| } | |||
| break; | |||
| #ifdef deleted | |||
| case L('t','h'): // Thai | |||
| { | |||
| static const short stress_lengths_th[8] = {230,150, 230,230, 230,0, 230,250}; | |||
| static const unsigned char stress_amps_th[] = {22,16, 22,22, 22,22, 22,22 }; | |||
| SetupTranslator(tr,stress_lengths_th,stress_amps_th); | |||
| tr->langopts.stress_rule = 0; // stress on final syllable of a "word" | |||
| tr->langopts.stress_flags = S_NO_DIM; // don't automatically set diminished stress (may be set in the intonation module) | |||
| tr->langopts.tone_language = 1; // Tone language, use CalcPitches_Tone() rather than CalcPitches() | |||
| tr->langopts.length_mods0 = tr->langopts.length_mods; // don't lengthen vowels in the last syllable | |||
| // tr->langopts.tone_numbers = 1; // a number after letters indicates a tone number (eg. pinyin or jyutping) | |||
| tr->langopts.word_gap = 0x21; // length of a final vowel is less dependent on the next consonant, don't merge consonant with next word | |||
| } | |||
| break; | |||
| #endif | |||
| case L('t','r'): // Turkish | |||
| case L('a','z'): // Azerbaijan | |||
| { | |||
| @@ -1129,17 +1129,6 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt | |||
| return(0); | |||
| } | |||
| #ifdef deleted | |||
| p = &wordx[word_length-3]; // this looks wrong. Doesn't consider multi-byte chars. | |||
| if(memcmp(p,"'s ",3) == 0) | |||
| { | |||
| // remove a 's suffix and pronounce this separately (not as an individual letter) | |||
| add_plural_suffix = 1; | |||
| p[0] = ' '; | |||
| p[1] = ' '; | |||
| last_char = p[-1]; | |||
| } | |||
| #endif | |||
| length=0; | |||
| while(wordx[length] != ' ') length++; | |||
| } | |||
| @@ -1164,17 +1153,6 @@ int TranslateWord(Translator *tr, char *word_start, int next_pause, WORD_TAB *wt | |||
| return(0); | |||
| } | |||
| #ifdef deleted | |||
| // ?? allow $unpr while translating rules, not just on initial FLAG_UNPRON_TEST | |||
| if(end_type & SUFX_UNPRON) | |||
| { | |||
| phonemes[0] = 0; // discard and retranslate as individual letters | |||
| SpeakIndividualLetters(tr, wordx, phonemes, 0); | |||
| strcpy(word_phonemes, phonemes); | |||
| return(0); | |||
| } | |||
| #endif | |||
| if((phonemes[0] == 0) && (end_phonemes[0] == 0)) | |||
| { | |||
| int wc; | |||
| @@ -1548,21 +1526,6 @@ if(end_type & SUFX_UNPRON) | |||
| dictionary_flags[0] &= ~FLAG_PAUSE1; | |||
| } | |||
| #ifdef deleted | |||
| // but it causes problems if these are not a person name | |||
| if(tr->translator_name == L('h','u')) | |||
| { | |||
| // lang=hu, If the last two words of a clause have capital letters (eg. a person name), unstress the last word. | |||
| if((wflags & (FLAG_LAST_WORD | FLAG_FIRST_UPPER | FLAG_ALL_UPPER | FLAG_FIRST_WORD)) == (FLAG_LAST_WORD | FLAG_FIRST_UPPER)) | |||
| { | |||
| if(((wtab[-1].flags & (FLAG_FIRST_UPPER | FLAG_ALL_UPPER)) == FLAG_FIRST_UPPER) && ((tr->clause_terminator != 0x90028) || (wflags & FLAG_HAS_DOT))) | |||
| { | |||
| ChangeWordStress(tr,word_phonemes,3); | |||
| } | |||
| } | |||
| } | |||
| #endif | |||
| if((wflags & FLAG_HYPHEN) && (tr->langopts.stress_flags & S_HYPEN_UNSTRESS)) | |||
| { | |||
| ChangeWordStress(tr,word_phonemes,3); | |||
| @@ -2858,15 +2821,6 @@ void *TranslateClause(Translator *tr, FILE *f_text, const void *vp_input, int *t | |||
| { | |||
| // speak as words | |||
| #ifdef deleted | |||
| if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(prev_out)) | |||
| { | |||
| // TESTING, explicit indication of stressed syllable by /2 after the word | |||
| word_mark = next_in-'0'; | |||
| source_index++; | |||
| c = ' '; | |||
| } | |||
| #endif | |||
| if((c == 0x92) || (c == 0xb4) || (c == 0x2019) || (c == 0x2032)) | |||
| c = '\''; // 'microsoft' quote or sexed closing single quote, or prime - possibly used as apostrophe | |||
| @@ -3166,15 +3120,6 @@ if((c == '/') && (tr->langopts.testing & 2) && IsDigit09(next_in) && IsAlpha(pre | |||
| } | |||
| } | |||
| else | |||
| #ifdef deleted | |||
| // Brackets are now recognised in TranslateRules() | |||
| if(IsBracket(c)) | |||
| { | |||
| pre_pause_add = 4; | |||
| c = ' '; | |||
| } | |||
| else | |||
| #endif | |||
| if(lookupwchar(breaks,c) != 0) | |||
| { | |||
| c = ' '; // various characters to treat as space | |||
| @@ -392,41 +392,6 @@ static unsigned char pk_shape2[PEAKSHAPEW+1] = { | |||
| static unsigned char *pk_shape; | |||
| static void WavegenInitPkData(int which) | |||
| {//===================================== | |||
| // this is only needed to set up the presets for pk_shape1 and pk_shape2 | |||
| // These have already been pre-calculated and preset | |||
| #ifdef deleted | |||
| int ix; | |||
| int p; | |||
| float x; | |||
| float y[PEAKSHAPEW]; | |||
| float maxy=0; | |||
| if(which==0) | |||
| pk_shape = pk_shape1; | |||
| else | |||
| pk_shape = pk_shape2; | |||
| p = 0; | |||
| for(ix=0;ix<PEAKSHAPEW;ix++) | |||
| { | |||
| x = (4.5*ix)/PEAKSHAPEW; | |||
| if(x >= pk_shape_x[which][p+3]) p++; | |||
| y[ix] = polint(&pk_shape_x[which][p],&pk_shape_y[which][p],3,x); | |||
| if(y[ix] > maxy) maxy = y[ix]; | |||
| } | |||
| for(ix=0;ix<PEAKSHAPEW;ix++) | |||
| { | |||
| p = (int)(y[ix]*255/maxy); | |||
| pk_shape[ix] = (p >= 0) ? p : 0; | |||
| } | |||
| pk_shape[PEAKSHAPEW]=0; | |||
| #endif | |||
| } // end of WavegenInitPkData | |||
| #ifdef USE_PORTAUDIO | |||
| // PortAudio interface | |||
| @@ -782,8 +747,6 @@ void WavegenInit(int rate, int wavemult_fact) | |||
| } | |||
| } | |||
| WavegenInitPkData(1); | |||
| WavegenInitPkData(0); | |||
| pk_shape = pk_shape2; // pk_shape2 | |||
| #ifdef INCLUDE_KLATT | |||
| @@ -169,21 +169,6 @@ void InitProsodyDisplay() | |||
| string = wxString(envelope_names[ix].mnem, wxConvLocal); | |||
| menu_envelopes->Append(0x100+envelope_names[ix].value, string); | |||
| } | |||
| #ifdef deleted | |||
| menu_envelopes->Append(0x100,_T("fall")); | |||
| menu_envelopes->Append(0x102,_T("rise")); | |||
| menu_envelopes->Append(0x104,_T("fall-rise")); | |||
| // menu_envelopes->Append(0x105,_T("fall-rise (R)")); | |||
| menu_envelopes->Append(0x106,_T("fall-rise 2")); | |||
| // menu_envelopes->Append(0x107,_T("fall-rise 2(R)")); | |||
| menu_envelopes->Append(0x108,_T("rise-fall")); | |||
| menu_envelopes->Append(0x10a,_T("fall-rise 3")); | |||
| menu_envelopes->Append(0x10c,_T("fall-rise 4")); | |||
| menu_envelopes->Append(0x10e,_T("fall 2")); | |||
| menu_envelopes->Append(0x110,_T("rise 2")); | |||
| menu_envelopes->Append(0x112,_T("rise-fall-rise")); | |||
| #endif | |||
| menu_prosody = new wxMenu; | |||
| menu_prosody->Append(1,_T("Pitch envelope"),menu_envelopes); | |||
| menu_prosody->Append(2,_T("Amplitude")); | |||
| @@ -260,7 +260,6 @@ class SpectDisplay: public wxScrolledWindow | |||
| private: | |||
| void RefreshFrame(int frame); | |||
| void SetKeyframe(SpectFrame *sf, int yes); | |||
| void PlayChild(int number, PitchEnvelope pitchenv); | |||
| void SetExtent(); | |||
| int sframe; | |||
| int pk_num; | |||
| @@ -433,23 +433,6 @@ void SpectDisplay::SavePitchenv(PitchEnvelope &pitch) | |||
| void SpectDisplay::PlayChild(int number, PitchEnvelope pitchenv) | |||
| {//========================================================= | |||
| #ifdef deleted | |||
| SpectSeq *seq; | |||
| if(number >= canvaslistix) return; | |||
| if((seq = canvaslist[number]->spectseq) == NULL) | |||
| return; | |||
| ReadDialogValues(); | |||
| seq->MakeWave(0,seq->numframes-1,pitchenv); | |||
| #endif | |||
| } // end of PlayChild | |||
| void SpectDisplay::SetKeyframe(SpectFrame *sf, int yes) | |||
| {//==================================================== | |||
| if(sf->keyframe == yes) return; // already done | |||
| @@ -841,12 +824,7 @@ void SpectDisplay::OnKey(wxKeyEvent& event) | |||
| if(key>='0' && key<='9') | |||
| { | |||
| i = key-'0'; | |||
| if(event.ControlDown()) | |||
| { | |||
| if(i==0) i=10; | |||
| PlayChild(i-1,voicedlg->pitchenv); | |||
| } | |||
| else | |||
| if(!event.ControlDown()) | |||
| { | |||
| // select peak number | |||
| if((pk_num = i) >= N_PEAKS) pk_num = N_PEAKS-1; | |||
| @@ -71,59 +71,6 @@ wxFont font_phonetic_large; | |||
| wxTextAttr style_phonetic_large; | |||
| #ifdef deleted | |||
| class IPATextCtrl : public wxTextCtrl | |||
| { | |||
| public: | |||
| void OnKey(wxKeyEvent& event); | |||
| IPATextCtrl(wxWindow *parent,wxWindowID id,const wxPoint& pos,const wxSize& size); | |||
| DECLARE_EVENT_TABLE() | |||
| }; | |||
| BEGIN_EVENT_TABLE(IPATextCtrl, wxTextCtrl) | |||
| EVT_CHAR(IPATextCtrl::OnKey) | |||
| END_EVENT_TABLE() | |||
| IPATextCtrl::IPATextCtrl(wxWindow *parent,wxWindowID id,const wxPoint& pos,const wxSize& size) : | |||
| wxTextCtrl(parent,id,_T(""),pos,size,wxTE_MULTILINE) | |||
| { | |||
| wxTextAttr attr; | |||
| wxFont font = wxFont(12,wxFONTFAMILY_ROMAN,wxFONTSTYLE_NORMAL,wxFONTWEIGHT_LIGHT); | |||
| attr.SetFont(font); | |||
| SetDefaultStyle(attr); | |||
| } | |||
| void IPATextCtrl::OnKey(wxKeyEvent& event) | |||
| { | |||
| long key; | |||
| wchar_t wbuf[3]; | |||
| key = event.m_keyCode; | |||
| key = event.GetKeyCode(); | |||
| if(event.ControlDown()) | |||
| key = key & 0x1f; | |||
| if(key==0xd && !event.ControlDown()) | |||
| event.Skip(); // ENTER | |||
| else | |||
| if(key != 8 && key < 0x7f) | |||
| { | |||
| wbuf[0] = ipa1[key]; | |||
| wbuf[1] = 0; | |||
| WriteText(wxString(wbuf)); | |||
| } | |||
| else | |||
| event.Skip(); | |||
| } | |||
| #endif | |||
| void PlayWavFile(const char *fname) | |||
| {//================================ | |||
| char command[120]; | |||
| @@ -263,74 +263,6 @@ void VoiceDlg::OnSpin(wxSpinEvent& event) | |||
| ReadParams(); | |||
| } | |||
| #ifdef deleted | |||
| void VoiceDlg::Save() | |||
| {//================== | |||
| int pk; | |||
| wxString filename; | |||
| FILE *f; | |||
| filename = wxFileSelector(_T("Save voice"),path_voices,_T(""),_T(""),_T("*"),wxSAVE); | |||
| if(filename.IsEmpty()) | |||
| return; | |||
| f = fopen(filename.mb_str(wxConvLocal),"w"); | |||
| if(f == NULL) | |||
| { | |||
| wxLogError(_T("Failed to open '%s'"),filename.c_str()); | |||
| return; | |||
| } | |||
| wxFileName fn(filename); | |||
| path_voices = fn.GetPath(); | |||
| ReadParams(); | |||
| fprintf(f,"%3d %3d\n",vd_pitch1->GetValue(),vd_pitch2->GetValue()); | |||
| for(pk=0; pk<N_PEAKS+1; pk++) | |||
| { | |||
| fprintf(f,"%3d %3d %3d\n",voice_pcnt[pk][0],voice_pcnt[pk][1],voice_pcnt[pk][2]); | |||
| } | |||
| fclose(f); | |||
| } // end of VoiceDlg::Save | |||
| void VoiceDlg::Load() | |||
| {//=============================== | |||
| wxString filename; | |||
| int pk, j; | |||
| filename = wxFileSelector(_T("Load voice"),path_voices,_T(""),_T(""),_T("*"),wxOPEN); | |||
| if(filename.IsEmpty()) return; | |||
| wxFileInputStream stream(filename); | |||
| if(stream.Ok() == FALSE) | |||
| { | |||
| wxLogError(_T("Failed to open '%s'"),filename.c_str()); | |||
| return; | |||
| } | |||
| wxFileName fn(filename); | |||
| path_voices = fn.GetPath(); | |||
| wxTextInputStream s(stream); | |||
| s >> pitch1; | |||
| s >> pitch2; | |||
| for(pk=0; pk<N_PEAKS+1; pk++) | |||
| { | |||
| for(j=0; j<3; j++) | |||
| { | |||
| s >> voice_pcnt[pk][j]; | |||
| SetSpinCtrl(vd[pk][j],voice_pcnt[pk][j]); | |||
| } | |||
| } | |||
| SetSpinCtrl(voicedlg->vd_pitch1,pitch1); | |||
| SetSpinCtrl(voicedlg->vd_pitch2,pitch2); | |||
| ReadParams(); | |||
| } // end of VoiceDlg::Load | |||
| #endif | |||
| void VoiceDlg::SetFromSpect(SpectSeq* spect) | |||
| {//========================================= | |||