-
Notifications
You must be signed in to change notification settings - Fork 5
/
mpsy_up_down_gui.m
123 lines (101 loc) · 5.03 KB
/
mpsy_up_down_gui.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
% a GUI for the recording answers of the test subject in up-down tasks
%
% Usage: mpsy_up_down_gui
%
% Copyright (C) 2003, 2004 Martin Hansen
% Author : Martin Hansen, <psylab AT jade-hs.de>
% Date : 29 Sep 2003
% Updated: < 1 Dez 2016 15:17, martin>
% Updated: <14 Jan 2004 11:30, hansen>
%% This file is part of PSYLAB, a collection of scripts for
%% designing and controlling interactive psychoacoustical listening
%% experiments.
%% This file is free software; you can redistribute it and/or modify
%% it under the terms of the GNU General Public License as published
%% by the Free Software Foundation; either version 2 of the License,
%% or (at your option) any later version. See the GNU General
%% Public License for more details: http://www.gnu.org/licenses/gpl
%% This file is distributed in the hope that it will be useful,
%% but WITHOUT ANY WARRANTY; without even the implied warranty of
%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
%% ===== the GUI for querying the user answer =====
%% The contents of the 'Tag'-property is a RESERVED WORD, DO NOT CHANGE!
psylab_gui = figure('Color', 0.1*round(10*rand(1,3)), ...
'Position',[200 150 650 450], ...
'Tag','psylab_answer_gui', ...
'Name', ['up_down_answer_gui * psylab version' mpsy_version ], ...
'NumberTitle','off', ...
'Toolbar','None', ...
'Menubar','None');
afc_but(1) = uicontrol('Parent', psylab_gui, ...
'Unit','normalized', ...
'Callback','M.UD=1; guidata(psylab_gui, M.UD);', ...
'Position',[0.2 0.5 0.6 0.2], ...
'String','DOWN (1)', ...
'Tag','ButDOWN');
afc_but(2) = uicontrol('Parent', psylab_gui, ...
'Unit','normalized', ...
'Callback','M.UD=2; guidata(psylab_gui, M.UD);', ...
'Position',[0.2 0.75 0.6 0.2], ...
'String','UP (2)', ...
'Tag','ButUP');
% Allow for user-input via keyboard presses as an alternative for
% button-clicks. The answer is calculated from the "CurrentCharacter" and
% transformed into its number representation in M.UD ("Up/Down answer")
set(psylab_gui, 'KeyPressFcn', 'M.UD=double(get(gcf, ''CurrentCharacter''))-double(''0''); guidata(psylab_gui, M.UD);');
% allow for smooth stop of psylab run when deleting the AFC figure:
set(psylab_gui, 'DeleteFcn', 'M.UD = 9; M.QUIT = 1;');
% a text field, e.g. for giving feeback to the user.
%% The contents of the 'Tag'-property is a RESERVED WORD, DO NOT CHANGE!
afc_fb = uicontrol('Parent', psylab_gui, ...
'Unit','normalized', 'Position',[0.1 0.02 0.8 0.12], ...
'Tag','psylab_feedback', ...
'Style','text', ...
'String','', ...
'FontSize', 14, 'ForegroundColor', 'red');
% a text field, e.g. for providing information to the user.
%% The contents of the 'Tag'-property is a RESERVED WORD, DO NOT CHANGE!
afc_info = uicontrol('Parent', psylab_gui, ...
'Unit','normalized', 'Position',[0.1 0.17 0.8 0.25], ...
'Tag','psylab_info', ...
'Style','text', ...
'String', sprintf('user answer possible via keyboard press \n(while focus is on figure background)'), ...
'FontSize', 14, 'ForegroundColor', [0.4 0 0.2]);
%%% ============================================================
%%% information about licenses, distribution, non-warranty
%%% ============================================================
psylab_about = uimenu('Parent', psylab_gui, ...
'Label', 'About PSYLAB');
psylab_version = uimenu('Parent', psylab_about, ...
'Label', 'PSYLAB Version', ...
'Callback', 'mpsy_version;');
psylab_author = uimenu('Parent', psylab_about, ...
'Label', 'View PSYLAB ABOUT in command window', ...
'Callback', 'type PSYLAB-ABOUT');
psylab_distribution = uimenu('Parent', psylab_about, ...
'Label', 'View PSYLAB DISTRIBUTION information in command window', ...
'Callback', 'type DISTRIBUTION;');
psylab_nowarranty = uimenu('Parent', psylab_about, ...
'Label', 'View PSYLAB NON-WARRANTY in command window', ...
'Callback', 'type NO-WARRANTY;');
psylab_license0 = uimenu('Parent', psylab_about, ...
'Label', 'View LICENSES');
psylab_license = uimenu('Parent', psylab_license0, ...
'Label', 'View PSYLAB LICENSE', ...
'Callback', 'type PSYLAB-LICENSE;');
psylab_gpl = uimenu('Parent', psylab_license0, ...
'Label', 'View GNU GENERAL PUBLIC LICENSE in command window', ...
'Callback', 'type GNU-GPL;');
psylab_webpage = uimenu('Parent', psylab_about, 'label', 'Get psylab here: www.hoertechnik-audiologie.de/psylab');
psylab_quitmenu = uimenu('Parent', psylab_gui, ...
'Label', 'Quit');
psylab_quitrun = uimenu('Parent', psylab_quitmenu, ...
'Label', 'quit only this run (8)', ...
'Callback', 'M.UD=8; guidata(psylab_gui, M.UD);');
psylab_quitexp = uimenu('Parent', psylab_quitmenu, ...
'Label', 'quit experiment (9)', ...
'Callback', 'M.UD=9; guidata(psylab_gui, M.UD);');
% End of file: mpsy_up_down_gui.m
% Local Variables:
% time-stamp-pattern: "40/Updated: <%2d %3b %:y %02H:%02M, %u>"
% End: