m2_ww1.m
来自「这是一个用于语音信号处理的工具箱」· M 代码 · 共 146 行
M
146 行
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% m2_ww1.m
%
% callback for window-display pushbutton 1 for m2
%
% Move Segment boundaries
%
% jmw
% 7/22/94
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (~isempty(ww1_h))
;
% do nothing, window is already open
return;
else
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% do following ONLY if window was just opened
% initialize window:
% calculate size
ww1_width = 700; %760;
ww1_height = 100 + (tmp_seg_cnt * 40);
if (isempty(ww1_saved_pos))
ww1_h=figure('Position',...
[50 100 ww1_width ww1_height],'Numbertitle','off','Name',...
'Move Segment Boundaries','Resize','on',...
'Color',BACK_COLOR);
else
pos=[ww1_saved_pos(1) ww1_saved_pos(2) ww1_saved_pos(3) ww1_height];
ww1_h=figure('Position',pos,'Numbertitle',...
'off','Name','Move Segment Boundaries','Resize','on',...
'Color',BACK_COLOR);
end;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% store original values of boundaries...
TMP_SB = tmp_seg_range(:,1);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add 'OK' function button
ww1_pb_ok_h=uicontrol('Position',[20 ww1_height-50 60 30],'String','OK',...
'Callback','ww1_ok');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add 'Update' function button
ww1_pb_update_h=uicontrol('Position',[110 ww1_height-50 60 30],...
'String','Update','Callback','ww1_upd','Visible', 'off');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add 'Cancel' function button
ww1_pb_cancel_h=uicontrol('Position',[200 ww1_height-50 60 30],...
'String','Cancel','Callback','ww1_ca','Visible', 'off');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% add control pairs (# = tmP_seg_cnt) (slider and text/value windows)
% calculate length of sliders
ww2_s_max=length(tmp_residue);
ww2_s_max=ww2_s_max/1000;
ww2_s_max=ceil(ww2_s_max);
ww2_s_max=ww2_s_max*1000;
% slider and text/value positions
ww1_s_pos(1,:) = [215 ww1_height-130 460 20]; % slider
ww1_e_pos(1,:) = [145 ww1_height-130 60 20 ]; % edit/text/value box
ww1_t_pos(1,:) = [-90 ww1_height-160+((6-tmp_seg_cnt)*2) ];
for i=2:(tmp_seg_cnt-1),
ww1_s_pos(i,:) = ww1_s_pos(i-1,:) + [ 0 -40 0 0 ];
ww1_e_pos(i,:) = ww1_e_pos(i-1,:) + [ 0 -40 0 0 ];
ww1_t_pos(i,:) = ww1_t_pos(i-1,:) + [ 0 -40 ];
end;
% make sliders
for i=1:(tmp_seg_cnt-1),
ww1_s_h(i)=uicontrol('Units','Pixels','Position',ww1_s_pos(i,:),...
'Style', 'Slider',...
'Value',TMP_SB(i+1),...
'Max',ww2_s_max,...
'Callback','ww1_s');
end;
% make test/value displays
for i=1:(tmp_seg_cnt-1),
ww1_e_h(i)=uicontrol('Position',ww1_e_pos(i,:),...
'Style','Edit',...
'String',sprintf('%d',TMP_SB(i+1)));
end;
for i=1:(tmp_seg_cnt-1),
text('Units','Pixels',[tmp_choice_1(i,:) ' /' tmp_choice_1(i+1,:)],...
'Position',ww1_t_pos(i,:),'String',...
'color',TEXT_COLOR );
axis off;
end;
%'Units','Pixels',[tmp_choice_1(i,:) ' /' tmp_choice_1(i+1,:)],...
% add text labels
axis([0 1 0 1]);
text('Units','Pixels','Position',[ -70 ww1_height-158] ,'String',...
'silent/semivowel',...
'color',TEXT_COLOR);
text('Units','Pixels','Position',[ -70 ww1_height-196] ,'String',...
'semivowel/vowel',...
'color',TEXT_COLOR);
text('Units','Pixels','Position',[ -70 ww1_height-237] ,'String',...
'vowel/semivowel',...
'color',TEXT_COLOR);
text('Units','Pixels','Position',[ -70 ww1_height-275] ,'String',...
'semivowel/univ stop',...
'color',TEXT_COLOR);
text('Units','Pixels','Position',[ -70 ww1_height-317] ,'String',...
'univ stop/silent',...
'color',TEXT_COLOR);
axis off;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
end; % end ~isempty(ww1_h)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?