File Coverage

lib/SDL2/HapticCustom.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package SDL2::HapticCustom {
2 2     2   16 use SDL2::Utils;
  2         6  
  2         16  
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             # Custom
18             channels => 'uint8',
19             period => 'uint16',
20             samples => 'uint16',
21             data => 'opaque', # 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::HapticCustom - A structure containing a template for a Custom 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::HapticCustom is exclusively for the C effect.
43              
44             A custom force feedback effect is much like a periodic effect, where the
45             application can define its exact shape. You will have to allocate the data
46             yourself. Data should consist of channels * samples Uint16 samples.
47              
48             If channels is one, the effect is rotated using the defined direction.
49             Otherwise it uses the samples in data for the different axes.
50              
51             =head1 Fields
52              
53             =over
54              
55             =item C - C
56              
57             =item C - Direction of the effect
58              
59             =item C - Duration of the effect
60              
61             =item C - Delay before starting the effect
62              
63             =item C
64              
65             =item C - How soon it can be triggered again after button
66              
67             =item C - Axes to use, minimum of one
68              
69             =item C - Sample periods
70              
71             =item C - Amount of samples
72              
73             =item C - Should contain C items
74              
75             =item C - Duration of the attack
76              
77             =item C - Level at the start of the attack
78              
79             =item C - Duration of the fade
80              
81             =item C - Level at the end of the fade
82              
83             =back
84              
85             =head1 AUTHOR
86              
87             Sanko Robinson Esanko@cpan.orgE
88              
89             =begin stopwords
90              
91              
92             =end stopwords
93              
94             =cut
95              
96             };
97             1;