-
Notifications
You must be signed in to change notification settings - Fork 4
/
com.myronmarston.music.Dynamic.html
166 lines (164 loc) · 17.4 KB
/
com.myronmarston.music.Dynamic.html
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>Coverage Report</title>
<link title="Style" type="text/css" rel="stylesheet" href="css/main.css"/>
<script type="text/javascript" src="js/popup.js"></script>
</head>
<body>
<h5>Coverage Report - com.myronmarston.music.Dynamic</h5>
<div class="separator"> </div>
<table class="report">
<thead><tr> <td class="heading">Classes in this File</td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Line Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Branch Coverage</a></td> <td class="heading"><a class="dfn" href="help.html" onclick="popupwindow('help.html'); return false;">Complexity</a></td></tr></thead>
<tr><td><a href="com.myronmarston.music.Dynamic.html">Dynamic</a></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">91%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:90px"><span class="text">20/22</span></div></div></td></tr></table></td><td><table cellpadding="0px" cellspacing="0px" class="percentgraph"><tr class="percentgraph"><td align="right" class="percentgraph" width="40">75%</td><td class="percentgraph"><div class="percentgraph"><div class="greenbar" style="width:75px"><span class="text">6/8</span></div></div></td></tr></table></td><td class="value"><span class="hidden">0.0;</span>0</td></tr>
</table>
<div class="separator"> </div>
<table cellspacing="0" cellpadding="0" class="src">
<tr> <td class="numLine"> 1</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment">/*</span></pre></td></tr>
<tr> <td class="numLine"> 2</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * Copyright 2008, Myron Marston <myron DOT marston AT gmail DOT com></span></pre></td></tr>
<tr> <td class="numLine"> 3</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine"> 4</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * This file is part of Fractal Composer.</span></pre></td></tr>
<tr> <td class="numLine"> 5</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine"> 6</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * Fractal Composer is free software: you can redistribute it and/or modify</span></pre></td></tr>
<tr> <td class="numLine"> 7</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * it under the terms of the GNU General Public License as published by</span></pre></td></tr>
<tr> <td class="numLine"> 8</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * the Free Software Foundation, either version 3 of the License, or</span></pre></td></tr>
<tr> <td class="numLine"> 9</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * at your option any later version.</span></pre></td></tr>
<tr> <td class="numLine"> 10</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine"> 11</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * Fractal Composer is distributed in the hope that it will be useful,</span></pre></td></tr>
<tr> <td class="numLine"> 12</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span></pre></td></tr>
<tr> <td class="numLine"> 13</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span></pre></td></tr>
<tr> <td class="numLine"> 14</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * GNU General Public License for more details.</span></pre></td></tr>
<tr> <td class="numLine"> 15</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> *</span></pre></td></tr>
<tr> <td class="numLine"> 16</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * You should have received a copy of the GNU General Public License</span></pre></td></tr>
<tr> <td class="numLine"> 17</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * along with Fractal Composer. If not, see <http://www.gnu.org/licenses/>. </span></pre></td></tr>
<tr> <td class="numLine"> 18</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine"> 19</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 20</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">package</span> com.myronmarston.music;</pre></td></tr>
<tr> <td class="numLine"> 21</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 22</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine"> 23</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * Pre-defined volume levels based on musical dynamics.</span></pre></td></tr>
<tr> <td class="numLine"> 24</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * </span></pre></td></tr>
<tr> <td class="numLine"> 25</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * @author Myron</span></pre></td></tr>
<tr> <td class="numLine"> 26</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLineCover"> 27</td> <td class="nbHitsCovered"> 69</td> <td class="src"><pre class="src"> <span class="keyword">public</span> enum Dynamic {</pre></td></tr>
<tr> <td class="numLineCover"> 28</td> <td class="nbHitsCovered"> 21</td> <td class="src"><pre class="src"> PPP(10),</pre></td></tr>
<tr> <td class="numLineCover"> 29</td> <td class="nbHitsCovered"> 21</td> <td class="src"><pre class="src"> PP(25),</pre></td></tr>
<tr> <td class="numLineCover"> 30</td> <td class="nbHitsCovered"> 21</td> <td class="src"><pre class="src"> P(50),</pre></td></tr>
<tr> <td class="numLineCover"> 31</td> <td class="nbHitsCovered"> 21</td> <td class="src"><pre class="src"> MP(60),</pre></td></tr>
<tr> <td class="numLineCover"> 32</td> <td class="nbHitsCovered"> 21</td> <td class="src"><pre class="src"> MF(70),</pre></td></tr>
<tr> <td class="numLineCover"> 33</td> <td class="nbHitsCovered"> 21</td> <td class="src"><pre class="src"> F(85),</pre></td></tr>
<tr> <td class="numLineCover"> 34</td> <td class="nbHitsCovered"> 21</td> <td class="src"><pre class="src"> FF(100),</pre></td></tr>
<tr> <td class="numLineCover"> 35</td> <td class="nbHitsCovered"> 21</td> <td class="src"><pre class="src"> FFF(120);</pre></td></tr>
<tr> <td class="numLine"> 36</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 37</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">private</span> <span class="keyword">final</span> <span class="keyword">int</span> midiVolume;</pre></td></tr>
<tr> <td class="numLine"> 38</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">private</span> <span class="keyword">static</span> String regexPattern;</pre></td></tr>
<tr> <td class="numLine"> 39</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLineCover"> 40</td> <td class="nbHitsCovered"> 168</td> <td class="src"><pre class="src"> <span class="keyword">private</span> Dynamic(<span class="keyword">int</span> midiVolume) {</pre></td></tr>
<tr> <td class="numLineCover"> 41</td> <td class="nbHitsCovered"> 168</td> <td class="src"><pre class="src"> <span class="keyword">this</span>.midiVolume = midiVolume;</pre></td></tr>
<tr> <td class="numLineCover"> 42</td> <td class="nbHitsCovered"> 168</td> <td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 43</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 44</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine"> 45</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * Gets the midi volume for this dynamic.</span></pre></td></tr>
<tr> <td class="numLine"> 46</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * </span></pre></td></tr>
<tr> <td class="numLine"> 47</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * @return midi volume</span></pre></td></tr>
<tr> <td class="numLine"> 48</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine"> 49</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">public</span> <span class="keyword">int</span> getMidiVolume() {</pre></td></tr>
<tr> <td class="numLineCover"> 50</td> <td class="nbHitsCovered"> 246</td> <td class="src"><pre class="src"> <span class="keyword">return</span> <span class="keyword">this</span>.midiVolume;</pre></td></tr>
<tr> <td class="numLine"> 51</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 52</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 53</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine"> 54</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * Gets a list of possible dynamic values.</span></pre></td></tr>
<tr> <td class="numLine"> 55</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * </span></pre></td></tr>
<tr> <td class="numLine"> 56</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * @return a string containing a list of possible dynamic values</span></pre></td></tr>
<tr> <td class="numLine"> 57</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine"> 58</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">public</span> <span class="keyword">static</span> String getDynamicExampleString() {</pre></td></tr>
<tr> <td class="numLineCover"> 59</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> StringBuilder str = <span class="keyword">new</span> StringBuilder();</pre></td></tr>
<tr> <td class="numLineCover"> 60</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> Dynamic[] values = Dynamic.values(); <span class="comment">// cache the array...</span></pre></td></tr>
<tr> <td class="numLine"> 61</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLineCover"> 62</td> <td class="nbHitsCovered"><a title="Line 62: Conditional coverage 100% (2/2)."> 9</a></td> <td class="src"><pre class="src"> <a title="Line 62: Conditional coverage 100% (2/2)."> <span class="keyword">for</span> (<span class="keyword">int</span> i = 0; i < values.length; i++) {</a></pre></td></tr>
<tr> <td class="numLineCover"> 63</td> <td class="nbHitsCovered"> 8</td> <td class="src"><pre class="src"> str.append(values[i].toString()); </pre></td></tr>
<tr> <td class="numLine"> 64</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLineCover"> 65</td> <td class="nbHitsCovered"><a title="Line 65: Conditional coverage 100% (2/2)."> 8</a></td> <td class="src"><pre class="src"> <a title="Line 65: Conditional coverage 100% (2/2)."> <span class="keyword">if</span> (i == values.length - 2) str.append(<span class="string">" or "</span>); </a></pre></td></tr>
<tr> <td class="numLineCover"> 66</td> <td class="nbHitsCovered"><a title="Line 66: Conditional coverage 100% (2/2)."> 7</a></td> <td class="src"><pre class="src"> <a title="Line 66: Conditional coverage 100% (2/2)."> <span class="keyword">else</span> <span class="keyword">if</span> (i < values.length - 2) str.append(<span class="string">", "</span>); </a></pre></td></tr>
<tr> <td class="numLine"> 67</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 68</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLineCover"> 69</td> <td class="nbHitsCovered"> 1</td> <td class="src"><pre class="src"> <span class="keyword">return</span> str.toString(); </pre></td></tr>
<tr> <td class="numLine"> 70</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 71</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> </pre></td></tr>
<tr> <td class="numLine"> 72</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment">/**</span></pre></td></tr>
<tr> <td class="numLine"> 73</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * Gets a regular expression pattern string based on this dynamic enum that </span></pre></td></tr>
<tr> <td class="numLine"> 74</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * can be used to parse a note string.</span></pre></td></tr>
<tr> <td class="numLine"> 75</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * </span></pre></td></tr>
<tr> <td class="numLine"> 76</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> * @return a regular expression pattern string</span></pre></td></tr>
<tr> <td class="numLine"> 77</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="comment"> */</span></pre></td></tr>
<tr> <td class="numLine"> 78</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> <span class="keyword">public</span> <span class="keyword">static</span> String getRegexPattern() {</pre></td></tr>
<tr> <td class="numLineCover"> 79</td> <td class="nbHitsUncovered"><a title="Line 79: Conditional coverage 0% (0/2)."> 0</a></td> <td class="src"><pre class="src"><span class="srcUncovered"> <a title="Line 79: Conditional coverage 0% (0/2)."> <span class="keyword">if</span> (regexPattern == <span class="keyword">null</span>) regexPattern = <span class="string">"(?:,(.*))?"</span>; </a></span></pre></td></tr>
<tr> <td class="numLineCover"> 80</td> <td class="nbHitsUncovered"> 0</td> <td class="src"><pre class="src"><span class="srcUncovered"> <span class="keyword">return</span> regexPattern;</span></pre></td></tr>
<tr> <td class="numLine"> 81</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> }</pre></td></tr>
<tr> <td class="numLine"> 82</td> <td class="nbHits"> </td>
<td class="src"><pre class="src"> }</pre></td></tr>
</table>
<div class="footer">Report generated by <a href="http://cobertura.sourceforge.net/" target="_top">Cobertura</a> 1.9 on 6/20/08 4:06 PM.</div>
</body>
</html>