| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package SDL2::HapticPeriodic { |
|
2
|
2
|
|
|
2
|
|
15
|
use SDL2::Utils; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
18
|
|
|
3
|
|
|
|
|
|
|
has |
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# Header |
|
6
|
|
|
|
|
|
|
type => 'uint16', |
|
7
|
|
|
|
|
|
|
direction => 'opaque', # SDL_HapticDirection |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Replay |
|
10
|
|
|
|
|
|
|
length => 'uint32', |
|
11
|
|
|
|
|
|
|
delay => 'uint16', |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Trigger |
|
14
|
|
|
|
|
|
|
button => 'uint16', |
|
15
|
|
|
|
|
|
|
interval => 'uint16', |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# Periodic |
|
18
|
|
|
|
|
|
|
periodic => 'sint16', |
|
19
|
|
|
|
|
|
|
magnitude => 'sint16', |
|
20
|
|
|
|
|
|
|
offset => 'sint16', |
|
21
|
|
|
|
|
|
|
phase => 'uint16', |
|
22
|
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# Envelope |
|
24
|
|
|
|
|
|
|
attack_length => 'uint16', |
|
25
|
|
|
|
|
|
|
attack_level => 'uint16', |
|
26
|
|
|
|
|
|
|
fade_length => 'uint16', |
|
27
|
|
|
|
|
|
|
fade_level => 'uint16'; |
|
28
|
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
=encoding utf-8 |
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 NAME |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
SDL2::HapticPeriodic - A structure containing a template for a Periodic effect |
|
34
|
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
use SDL2 qw[:all]; |
|
38
|
|
|
|
|
|
|
# TODO: I need to whip up a quick example |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
A SDL2::HapticPeriodic contains a template for a Periodic effect. |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
The struct handles the following effects: |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=over |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=item C |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=item C |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=item C |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=item C |
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=item C |
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=back |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
A periodic effect consists in a wave-shaped effect that repeats itself over |
|
61
|
|
|
|
|
|
|
time. The type determines the shape of the wave and the parameters determine |
|
62
|
|
|
|
|
|
|
the dimensions of the wave. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Phase is given by hundredth of a degree meaning that giving the phase a value |
|
65
|
|
|
|
|
|
|
of 9000 will displace it 25% of its period. Here are sample values: |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=over |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=item C<0> - No phase displacement |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=item C<9000> - Displaced 25% of its period |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=item C<18000> - Displaced 50% of its period |
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=item C<27000> - Displaced 75% of its period |
|
76
|
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=item C<36000> - Displaced 100% of its period, same as 0, but 0 is preferred |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=back |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
Examples: |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
SDL_HAPTIC_SINE |
|
84
|
|
|
|
|
|
|
__ __ __ __ |
|
85
|
|
|
|
|
|
|
/ \ / \ / \ / |
|
86
|
|
|
|
|
|
|
/ \__/ \__/ \__/ |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
SDL_HAPTIC_SQUARE |
|
89
|
|
|
|
|
|
|
__ __ __ __ __ |
|
90
|
|
|
|
|
|
|
| | | | | | | | | | |
|
91
|
|
|
|
|
|
|
| |__| |__| |__| |__| | |
|
92
|
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
SDL_HAPTIC_TRIANGLE |
|
94
|
|
|
|
|
|
|
/\ /\ /\ /\ /\ |
|
95
|
|
|
|
|
|
|
/ \ / \ / \ / \ / |
|
96
|
|
|
|
|
|
|
/ \/ \/ \/ \/ |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
SDL_HAPTIC_SAWTOOTHUP |
|
99
|
|
|
|
|
|
|
/| /| /| /| /| /| /| |
|
100
|
|
|
|
|
|
|
/ | / | / | / | / | / | / | |
|
101
|
|
|
|
|
|
|
/ |/ |/ |/ |/ |/ |/ | |
|
102
|
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
SDL_HAPTIC_SAWTOOTHDOWN |
|
104
|
|
|
|
|
|
|
\ |\ |\ |\ |\ |\ |\ | |
|
105
|
|
|
|
|
|
|
\ | \ | \ | \ | \ | \ | \ | |
|
106
|
|
|
|
|
|
|
\| \| \| \| \| \| \| |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
=head1 Fields |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=over |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=item C - C, C, C, C, or C |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=item C - Direction of the effect |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=item C - Duration of the effect |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=item C - Delay before starting the effect |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=item C |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=item C - How soon it can be triggered again after button |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item C - Period of the wave |
|
125
|
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
=item C - Peak value; if negative, equivalent to 180 degrees extra phase shift |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item C - Mean value of the wave |
|
129
|
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
=item C - Positive phase shift given by hundredth of a degree |
|
131
|
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item C - Duration of the attack |
|
133
|
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
=item C - Level at the start of the attack |
|
135
|
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=item C - Duration of the fade |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=item C - Level at the end of the fade |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
=back |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
=head1 AUTHOR |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
Sanko Robinson Esanko@cpan.orgE |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=begin stopwords |
|
147
|
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
struct |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=end stopwords |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=cut |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
}; |
|
155
|
|
|
|
|
|
|
1; |