⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 m1_w5.m

📁 这是一个用于语音信号处理的工具箱
💻 M
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%	m1_w5.m
%	
%	jmw
%	6/17/94
%	6/09/94
%
%	User-Defined mapping windowS.
%  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if (~isempty(w5_h))
        ;
        % do nothing, window is already open
        return;      
else
                
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% do following ONLY if window was just opened

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%define variables vis and vis_str
vis=[];
vis_str=[];

% make maps window

if (isempty(w5_saved_position))

	w5_h=figure('Position',[100 50  w5_width w5_ht],...
		'Numbertitle','off','Name',...
		'Maps: User-Defined Mapping Method' ,...
		'Resize','on',...
		'Color',BACK_COLOR);
else
	w5_h=figure('Position',w5_saved_position,...
		'Numbertitle','off','Name',...
		'Maps: User-Defined Mapping Method' ,...
		'Resize','on',...
		'Color',BACK_COLOR);
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make display window

if (isempty(w5_display_saved_position))

	w5_display_h=figure('Position',[200 50 400 400],...
		'Numbertitle','off','Name','Maps: Display' ,'Resize','on',...
		'Visible','off','Color',BACK_COLOR);
else
	if(DISPLAYMODE == 3)
		vis = 0;
		vis_str = sprintf('off');
	else
		vis = 1;
		vis_str = sprintf('on');
	end;
		
	w5_display_h=figure('Position',w5_display_saved_position,...
		'Numbertitle','off','Name','Maps: Display' ,'Resize','on',...
		'Visible',vis_str,'Color',BACK_COLOR);	
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make dummy edit window

w5_edit_h = [];

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make w5_h active window

figure(w5_h);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% add 'OK' function button

ok_ht = w5_ht - 50;
w5_pb_ok_h=uicontrol('Style','Pushbutton','Position',[20 ok_ht 60 30],'String','OK',...
                'Callback','w5_ok');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% make method display popup menus

for i=2:MAXRB,
	offset = 50;	
	temp_pos = [(i-1)*(80 + 20)+offset 40 80 30];
	w5_pu_seg_h(i) = uicontrol('Style','popupmenu','Position',...
		temp_pos, 'String',...
 'User 1 | User 2 | User 3 | Random | Fixed 1 | Fixed 2 | Fixed 3 | Fixed 4',...
	'Callback','w5_pu_se', 'Value', W5PUSEGSTATE(i) );	
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% display first choice for each segment (NON-changable by user)

offset = (8 * MAXRB + 30);
for i=2:MAXRB,
	w5_t_pos(i,:) = [ (i-1)*(80 + 20)-offset+50  40];
	s=sprintf('%s', choice_1(i,:));
	text('Units','pixels','Position',w5_t_pos(i,:),...
		'String', s,...
		'Color',TEXT_COLOR );

	w5_t_pos(i,:) = [ (i-1)*(80 + 20)-offset+75  70];
	s=sprintf('%d', i);
		text('Units','pixels','Position',w5_t_pos(i,:),...
		'String', s ,...
		'Color',TEXT_COLOR);
	axis off;
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% display titles for Segment Mapping Data

w5_t_pos(i,:) = [ 0  26];
s=sprintf('Segment Mapping');
text('Position',w5_t_pos(i,:),...
		'String', s ,...
		'Color',TEXT_COLOR);

w5_t_pos(i,:) = [ 0  70];
s=sprintf('Index:');
text('Units','pixels','Position',w5_t_pos(i,:),...
		'String', s,...
		'Color',TEXT_COLOR );

w5_t_pos(i,:) = [ 0  40];
s=sprintf('Type:');
text('Units','pixels','Position',w5_t_pos(i,:),...
		'String', s,...
		'Color',TEXT_COLOR );

w5_t_pos(i,:) = [ 0  -10];
s=sprintf('Map:');
text('Units','pixels','Position',w5_t_pos(i,:),...
		'String', s,...
		'Color',TEXT_COLOR );

% display titles for Display

w5_t_pos(i,:) = [ 0  83];
s=sprintf('Display');
text('Position',w5_t_pos(i,:),...
		'String', s ,...
		'Color',TEXT_COLOR);

% display titles for User Maps

w5_t_pos(i,:) = [ 50 83];
s=sprintf('User Maps');
text('Position',w5_t_pos(i,:),...
		'String', s,...
		'Color',TEXT_COLOR );

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% create dividing lines (horizontal)
line([0 100],[30 30 ],...
		'Color',TEXT_COLOR);		% for "Segment Mapping" Title
line([0 40],[87 87 ],...
		'Color',TEXT_COLOR);		% for Display
line([50 100],[87 87 ],...
		'Color',TEXT_COLOR);	% for User Maps

axis([0 100 0 100]);
axis off;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% add 'Display' function button and associated buttons

w5_rb_display_h(1)=uicontrol('Position',[0.13*w5_width display_ht 80 30],...
	'String','Segment','Callback','w5_rb_di',...
	'Style','radiobutton','Value',W5DISPLAY(1));

w5_rb_display_h(2)=uicontrol('Position',[0.13*w5_width display_ht-30 80 30],...
	'String','Global','Callback','w5_rb_di',...
	'Style','radiobutton','Value',W5DISPLAY(2));

w5_rb_display_h(3)=uicontrol('Position',[0.13*w5_width display_ht-60 80 30],...
	'String','OFF','Callback','w5_rb_di',...
	'Style','radiobutton','Value',W5DISPLAY(3));

w5_rb_display_h(4)=uicontrol('Position',[0.13*w5_width display_ht-90 80 30],...
	'String','Map','Callback','w5_rb_di',...
	'Style','radiobutton','Value',W5DISPLAY(4));

w5_pu_display_h=uicontrol('Position',[0.2*w5_width display_ht-140 80 30],...
	'Callback','w5_pu_di','Style','popupmenu','String',...
'User 1 | User 2 | User 3 | Random | Fixed 1 | Fixed 2 | Fixed 3 | Fixed 4',...
	'Value',DISPLAYMAP);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% create User Map Buttons

w5_pu_user_h(1)=uicontrol('Position',[0.52*w5_width display_ht 80 30],...
	'String','Edit','Callback', 'w5_e_ped',...
	'Style','pushbutton');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

if isempty(vis)   % (vis == 1)
	w5_di	% repaint w5 _display if w5_reopened and display req'd
end;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

end; % end if (~isempty(w5_h))

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

clear vis vis_str offset ok_ht temp_pos 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -