Luke Cartwright / Mbed 2 deprecated ELEC2645_Project_el18loc_nearlythere

Dependencies:   mbed

Committer:
lukeocarwright
Date:
Tue May 19 15:04:33 2020 +0000
Revision:
14:9cfe0041cc4e
Parent:
13:27300c533dd1
Child:
18:204cd747b54a
Actually make proper sound atlast. Checked Concert A against piano. included more preprocessor debug (SLOW TIME) for Debug if output check required w. printf

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lukeocarwright 7:33cb5f2db1ee 1 #ifndef FRONT_H
lukeocarwright 7:33cb5f2db1ee 2 #define FRONT_H
lukeocarwright 7:33cb5f2db1ee 3
lukeocarwright 7:33cb5f2db1ee 4 #include "mbed.h"
lukeocarwright 7:33cb5f2db1ee 5 #include "N5110.h"
lukeocarwright 7:33cb5f2db1ee 6 #include "Gamepad.h"
lukeocarwright 8:f305ea78b2b1 7 #include "Menu.h"
lukeocarwright 14:9cfe0041cc4e 8 #include "Sound.h"
lukeocarwright 13:27300c533dd1 9
lukeocarwright 7:33cb5f2db1ee 10 /** Front class
lukeocarwright 7:33cb5f2db1ee 11 * @author Luke Cartwright, University of Leeds
lukeocarwright 7:33cb5f2db1ee 12 * @brief manages front pannel of Synth
lukeocarwright 7:33cb5f2db1ee 13 * @date May 2020
lukeocarwright 7:33cb5f2db1ee 14 */
lukeocarwright 8:f305ea78b2b1 15
lukeocarwright 7:33cb5f2db1ee 16 class Front
lukeocarwright 7:33cb5f2db1ee 17 {
lukeocarwright 7:33cb5f2db1ee 18 public:
lukeocarwright 7:33cb5f2db1ee 19 //variables
lukeocarwright 7:33cb5f2db1ee 20 int submenu;
lukeocarwright 8:f305ea78b2b1 21 int a;
lukeocarwright 8:f305ea78b2b1 22 int d;
lukeocarwright 8:f305ea78b2b1 23 int s;
lukeocarwright 8:f305ea78b2b1 24 int r;
lukeocarwright 13:27300c533dd1 25 int dir;
lukeocarwright 13:27300c533dd1 26 int dir_1;
lukeocarwright 14:9cfe0041cc4e 27 uint16_t out;
lukeocarwright 14:9cfe0041cc4e 28
lukeocarwright 14:9cfe0041cc4e 29 //Methods
lukeocarwright 14:9cfe0041cc4e 30 //Constructor
lukeocarwright 7:33cb5f2db1ee 31 Front();
lukeocarwright 7:33cb5f2db1ee 32
lukeocarwright 14:9cfe0041cc4e 33 //Destructior
lukeocarwright 7:33cb5f2db1ee 34 ~Front();
lukeocarwright 8:f305ea78b2b1 35
lukeocarwright 14:9cfe0041cc4e 36 //Runs whole front pannel
lukeocarwright 7:33cb5f2db1ee 37 void frontrun(N5110 &lcd, Gamepad &pad, int submenu);
lukeocarwright 14:9cfe0041cc4e 38
lukeocarwright 14:9cfe0041cc4e 39
lukeocarwright 7:33cb5f2db1ee 40 private:
lukeocarwright 7:33cb5f2db1ee 41 //variables
lukeocarwright 8:f305ea78b2b1 42 int menuflag;
lukeocarwright 13:27300c533dd1 43 int used; //1->4 (A<D<S<R)
lukeocarwright 13:27300c533dd1 44 bool use; //1=use 0=!use
lukeocarwright 13:27300c533dd1 45 bool initial; //sets to run 1st time
lukeocarwright 13:27300c533dd1 46 int adsr; //incrament correct val
lukeocarwright 13:27300c533dd1 47 int ud; //up/down
lukeocarwright 7:33cb5f2db1ee 48
lukeocarwright 8:f305ea78b2b1 49 //methods
lukeocarwright 8:f305ea78b2b1 50 //initial setup of front panel
lukeocarwright 13:27300c533dd1 51 void frontsetup(N5110 &lcd, Gamepad &pad, int submenu, bool initial);
lukeocarwright 8:f305ea78b2b1 52
lukeocarwright 8:f305ea78b2b1 53 //prints waveforms for front disp.
lukeocarwright 8:f305ea78b2b1 54 void printwav(N5110 &lcd, int submenu);
lukeocarwright 8:f305ea78b2b1 55
lukeocarwright 7:33cb5f2db1ee 56 //prints fader
lukeocarwright 7:33cb5f2db1ee 57 void printfader(N5110 &lcd,int x, int y);
lukeocarwright 13:27300c533dd1 58
lukeocarwright 8:f305ea78b2b1 59 //prints sliders
lukeocarwright 13:27300c533dd1 60 void printsliders(N5110 &lcd, int a, int d,int s,int r, int used);
lukeocarwright 14:9cfe0041cc4e 61
lukeocarwright 13:27300c533dd1 62 //prints individual slider
lukeocarwright 13:27300c533dd1 63 void printslider(N5110 &lcd, int x_val, int y_val, bool use);
lukeocarwright 14:9cfe0041cc4e 64
lukeocarwright 13:27300c533dd1 65 //incraments correct adsr value
lukeocarwright 13:27300c533dd1 66 int incrament_adsr(int used, int adsr, int ud);
lukeocarwright 7:33cb5f2db1ee 67 };
lukeocarwright 7:33cb5f2db1ee 68
lukeocarwright 7:33cb5f2db1ee 69 #endif