Advertisement
Guest User

Old School Vertical

a guest
May 28th, 2015
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1.  
  2.  
  3. // old school display of frequencies vertical
  4. if (displayType == 21) {
  5. fadeAmt = 255;
  6. double width = c.getWidth() / 8;
  7. if (visible) {
  8. for (int n = 0; n < 8; n++) {
  9.  
  10. int h = 0;
  11. for (int i = n * (resolution / 8); i < ((n * resolution / 8) + resolution / 8); i++) {
  12. if (Math.abs(data[i]) > h) {
  13. h = Math.abs(data[i]);
  14. }
  15. }
  16. if (n == 0) {
  17. h = h / 4;
  18. }
  19.  
  20. if (waveColor == 0) {
  21. p.setColor(Color.argb(255, 0, 255, 255 - 32 * n));
  22. }
  23. if (waveColor == 1) {
  24. p.setColor(Color.argb(255, 255, 255 - 32 * n, 0));
  25. }
  26.  
  27.  
  28.  
  29. h = h * 20;
  30.  
  31. if (h > c.getHeight() - 10){
  32. h = c.getHeight() - 10;
  33. }
  34.  
  35. c.drawRect((int) ((n+1) * (width) - width + 1), c.getHeight() - h,
  36. (int) (((n+1) * width)), (c.getHeight()), p);
  37.  
  38. //White blocks on top
  39.  
  40. if (boxArray[n] < h){
  41. boxArray[n] = h;
  42. }
  43. int m = boxArray[n];
  44.  
  45. c.drawRect((int) ((n+1) * (width) - width + 1), (c.getHeight() - 10) - m,
  46. (int) (((n+1) * width)), c.getHeight() - m, p);
  47.  
  48. if (boxArray[n] > 0){
  49. boxArray[n] -= 6;
  50. }
  51. }
  52. }
  53. tempData = data;
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement