Luke Cartwright / Mbed 2 deprecated ELEC2645_Project_el18loc_nearlythere

Dependencies:   mbed

Committer:
lukeocarwright
Date:
Sat May 09 13:45:23 2020 +0000
Revision:
13:27300c533dd1
Parent:
8:f305ea78b2b1
Child:
14:9cfe0041cc4e
ADSR faders moving

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 7:33cb5f2db1ee 8
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 8:f305ea78b2b1 16
lukeocarwright 7:33cb5f2db1ee 17 class Front
lukeocarwright 7:33cb5f2db1ee 18 {
lukeocarwright 7:33cb5f2db1ee 19 public:
lukeocarwright 7:33cb5f2db1ee 20 //variables
lukeocarwright 7:33cb5f2db1ee 21 int submenu;
lukeocarwright 8:f305ea78b2b1 22 int a;
lukeocarwright 8:f305ea78b2b1 23 int d;
lukeocarwright 8:f305ea78b2b1 24 int s;
lukeocarwright 8:f305ea78b2b1 25 int r;
lukeocarwright 13:27300c533dd1 26 int dir;
lukeocarwright 13:27300c533dd1 27 int dir_1;
lukeocarwright 7:33cb5f2db1ee 28 //methods
lukeocarwright 7:33cb5f2db1ee 29 //constructor
lukeocarwright 7:33cb5f2db1ee 30 Front();
lukeocarwright 7:33cb5f2db1ee 31
lukeocarwright 7:33cb5f2db1ee 32 //destructior
lukeocarwright 7:33cb5f2db1ee 33 ~Front();
lukeocarwright 7:33cb5f2db1ee 34
lukeocarwright 8:f305ea78b2b1 35
lukeocarwright 7:33cb5f2db1ee 36 //runs whole front pannel
lukeocarwright 7:33cb5f2db1ee 37 void frontrun(N5110 &lcd, Gamepad &pad, int submenu);
lukeocarwright 7:33cb5f2db1ee 38
lukeocarwright 13:27300c533dd1 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 13:27300c533dd1 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 13:27300c533dd1 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