Menu system broken

Dependencies:   ANSITermMenuSystem

Fork of menuSystemMbed by Ryan Scott

Files at this revision

API Documentation at this revision

Comitter:
Rybowonder
Date:
Sat May 04 17:37:57 2013 +0000
Parent:
7:df9f5b6dd4ed
Commit message:
For Mitchener

Changed in this revision

Constantdisplay.cpp Show annotated file Show diff for this revision Revisions of this file
Constantdisplay.h Show annotated file Show diff for this revision Revisions of this file
HANDLER_DeletetrackPage.cpp Show annotated file Show diff for this revision Revisions of this file
HANDLER_PlaybackmenuPage.cpp Show annotated file Show diff for this revision Revisions of this file
HANDLER_PlayscreenPage.cpp Show annotated file Show diff for this revision Revisions of this file
HANDLER_PlaytrackPage.cpp Show annotated file Show diff for this revision Revisions of this file
InitializeMenus.cpp Show annotated file Show diff for this revision Revisions of this file
menuIDs.h Show annotated file Show diff for this revision Revisions of this file
--- a/Constantdisplay.cpp	Fri Apr 26 16:17:18 2013 +0000
+++ b/Constantdisplay.cpp	Sat May 04 17:37:57 2013 +0000
@@ -61,6 +61,21 @@
      if (sign < 0)
          s[i++] = '-';
      s[i] = '\0';
+     reverse(s);
  }
 
+void Constantdisplay::reverse(char *s)
+{
+    char *j;
+    int c;
+ 
+   j = s + strlen(s) - 1;
+  while(s < j) {
+    c = *s;
+    *s++ = *j;
+    *j-- = c;
+  }
+}
 
+
+
--- a/Constantdisplay.h	Fri Apr 26 16:17:18 2013 +0000
+++ b/Constantdisplay.h	Sat May 04 17:37:57 2013 +0000
@@ -12,7 +12,7 @@
 #include "CdisplayItem.h"
 
 class Constantdisplay {
-    static const int MAXCDISPLAYITEMS = 3;
+    static const int MAXCDISPLAYITEMS = 4;
     CdisplayItem CdisplayItem[MAXCDISPLAYITEMS];
     int maxitems;
 
@@ -26,6 +26,7 @@
  //   void erase();
     void updatedisplayitem(int ID, char * updateText);
     void itoa(int n, char s[]);
+    void reverse(char *s);
 };
 
 #endif /* defined(__menuSystem__MainMenu__) */
--- a/HANDLER_DeletetrackPage.cpp	Fri Apr 26 16:17:18 2013 +0000
+++ b/HANDLER_DeletetrackPage.cpp	Sat May 04 17:37:57 2013 +0000
@@ -4,6 +4,7 @@
 #include "MainMenu.h"
 #include "console.h"
 
+//extern Serial pc(USBTX, USBRX);
 extern BusInOut switches; //(p21, p22, p23, p24)
 extern MainMenu pageMenu[MAXPAGES ];
 extern volatile bool exittorecord;
@@ -42,7 +43,7 @@
                     userSelection = pageMenu[DELETESCR].getHighlightedItem() ;
                     break;
                 }//eo select
-
+/*
                 // is the user selection an ACTION  assigned to this page
                 if (userSelection != 0 && userSelection > DELETETRACKOFFSET )  //page selections are 0 through 12
                     {
@@ -50,7 +51,7 @@
                     switch(userSelection)
                         {
                     
-                        case EX_DELETETRACK:
+                        case D_TRACKFILE:
                             printXY("Example Track selected          ", 5, 10); // Discuss with Brad ************---------------**************---------*************
                             //call function to perform task
                             break;
@@ -59,6 +60,7 @@
                     // eo place code here ......
                     userSelection = 0;
                     }
+*/
                 wait_ms(200);
                 if (exittorecord == true)
                     break;
--- a/HANDLER_PlaybackmenuPage.cpp	Fri Apr 26 16:17:18 2013 +0000
+++ b/HANDLER_PlaybackmenuPage.cpp	Sat May 04 17:37:57 2013 +0000
@@ -7,6 +7,7 @@
 extern BusInOut switches; //(p21, p22, p23, p24)
 extern MainMenu pageMenu[MAXPAGES ];
 extern volatile bool exittorecord;
+extern Serial pc;
 
 int PlaybackmenuPageHandler()
 {
@@ -39,8 +40,12 @@
                     break;
                 case 0x07:
                     pageMenu[PLAYBACK].erase();
-                    userSelection = pageMenu[PLAYBACK].getHighlightedItem() - PLAYBACKMENUOFFSET;
+                    
+                    if (pageMenu[PLAYBACK].getHighlightedItem()== 702) userSelection = 9;
+                    if (pageMenu[PLAYBACK].getHighlightedItem()== 701) userSelection = 8;
                     exitCurrentMenu = true;
+       //             pc.printf("userselction: %d \n", userSelection);
+         //           pc.printf("highlighteditem: %d \n", pageMenu[PLAYBACK].getHighlightedItem());
                     break;
                 }//eo select
             wait_ms(200);
--- a/HANDLER_PlayscreenPage.cpp	Fri Apr 26 16:17:18 2013 +0000
+++ b/HANDLER_PlayscreenPage.cpp	Sat May 04 17:37:57 2013 +0000
@@ -44,6 +44,7 @@
                 }//eo select
 
                 // is the user selection an ACTION  assigned to this page
+/*                
                 if (userSelection != 0 && userSelection > PLAYSCROFFSET)  //page selections are 0 through 12
                     {
                     // place code here to handle actions processed directly from this page
@@ -52,7 +53,7 @@
                     switch(userSelection)
                         {
                     
-                        case EX_PLAYTRACK :
+                        case P_TRACKFILE :
                             printXY("Example Track selected          ", 5, 10); //***********---------------***************------------********** Discuss with Brad
                             //call function to perform task
                             break;
@@ -62,6 +63,7 @@
                     // eo place code here ......
                     userSelection = 0;
                     }
+*/                    
                 wait_ms(200);
                 if (exittorecord == true)
                    break;
--- a/HANDLER_PlaytrackPage.cpp	Fri Apr 26 16:17:18 2013 +0000
+++ b/HANDLER_PlaytrackPage.cpp	Sat May 04 17:37:57 2013 +0000
@@ -44,13 +44,14 @@
                 }//eo select
 
                 // is the user selection an ACTION  assigned to this page
+/*
                 if (userSelection != 0 && userSelection > PLAYTRACKOFFSET)  //page selections are 0 through 12
                     {
                     // place code here to handle actions processed directly from this page
                     switch(userSelection)
                         {
                     
-                        case EX_PLAYTRACK :
+                        case P_TRACKFILE :
                             printXY("Example Track selected          ", 5, 10); //***********---------------***************------------********** Discuss with Brad
                             //call function to perform task
                             break;
@@ -60,6 +61,7 @@
                     // eo place code here ......
                     userSelection = 0;
                     }
+*/                    
                 wait_ms(200);
                 if (exittorecord == true)
                  break;
--- a/InitializeMenus.cpp	Fri Apr 26 16:17:18 2013 +0000
+++ b/InitializeMenus.cpp	Sat May 04 17:37:57 2013 +0000
@@ -13,29 +13,29 @@
     pageMenu[HOME].setMaxItems(3);
     pageMenu[HOME].setTitle("HOME           ");
     
-    pageMenu[RECORDSET].setMenuItem(0, RECSETOUT, "Output", 2, 1);
-  //  pageMenu[RECORDSET].setMenuItem(1, RECSETIN, "Input", 2, 2);
+  //  pageMenu[RECORDSET].setMenuItem(0, RECSETOUT, "Output", 2, 1);
+    pageMenu[RECORDSET].setMenuItem(0, RECSETIN, "Input", 2, 1);
     pageMenu[RECORDSET].setMenuItem(1, RECSETFILTERS, "Filter", 2, 2);
-    pageMenu[RECORDSET].setMenuItem(2, RECSETSAMPFRQ, "Samp Rate", 2, 3);
+ //   pageMenu[RECORDSET].setMenuItem(2, RECSETSAMPFRQ, "Samp Rate", 2, 3);
   //  pageMenu[RECORDSET].setMenuItem(4, RECSETAGC, "AGC", 2, 5);
-    pageMenu[RECORDSET].setMaxItems(3);
+    pageMenu[RECORDSET].setMaxItems(2);
     pageMenu[RECORDSET].setTitle("REC OPTIONS    ");
 
     
  //   pageMenu[OUTPUT].setMenuItem(0, LINE, "Line", 2, 1);
-    pageMenu[OUTPUT].setMenuItem(0, HEADPHONES, "1) Internal", 2, 2);
-    pageMenu[OUTPUT].setMenuItem(1, SPEAKERS, "2) External", 2, 3);
-    pageMenu[OUTPUT].setMaxItems(2);
-    pageMenu[OUTPUT].setTitle("OUTPUT         ");
-    pageMenu[OUTPUT].setselectstatus();
+  //  pageMenu[OUTPUT].setMenuItem(0, HEADPHONES, "1) Internal", 2, 2);
+  //  pageMenu[OUTPUT].setMenuItem(1, SPEAKERS, "2) External", 2, 3);
+   // pageMenu[OUTPUT].setMaxItems(2);
+   // pageMenu[OUTPUT].setTitle("OUTPUT         ");
+   // pageMenu[OUTPUT].setselectstatus();
     
- /*   
+    
     pageMenu[INPUT].setMenuItem(0, INMIC, "Mic", 2, 1);
     pageMenu[INPUT].setMenuItem(1, INLINE, "Line", 2, 2);
     pageMenu[INPUT].setMaxItems(2); 
     pageMenu[INPUT].setTitle("INPUT           "); 
     pageMenu[INPUT].setselectstatus();    
-*/
+
     pageMenu[FILTER].setMenuItem(0, FILTER1, "1) On", 2, 1);
     pageMenu[FILTER].setMenuItem(1, FILTER2, "2) Off", 2, 2);
   //  pageMenu[FILTER].setMenuItem(2, FILTER3, "Band Pass", 2, 3);
@@ -43,12 +43,14 @@
     pageMenu[FILTER].setMaxItems(2);  
     pageMenu[FILTER].setTitle("FILTER         "); 
     pageMenu[FILTER].setselectstatus(); 
-    
+ 
+/*    
     pageMenu[SAMPRATE].setMenuItem(0, SPEED1, "1) 44.1k", 2, 1);
     pageMenu[SAMPRATE].setMenuItem(1, SPEED2, "2) 48k", 2, 2);
     pageMenu[SAMPRATE].setMaxItems(2);
     pageMenu[SAMPRATE].setTitle("SAMPRATE       ");  
     pageMenu[SAMPRATE].setselectstatus();
+*/    
     
 /*    
     pageMenu[AGC].setMenuItem(0, AGCON, "ON", 2, 1);
@@ -58,16 +60,22 @@
     pageMenu[AGC].setselectstatus();   
 */    
     
-    pageMenu[PLAYBACK].setMenuItem(0, PLAYTRACK, "Play Tracks", 2, 1);
-    pageMenu[PLAYBACK].setMenuItem(1, DELETETRACK, "Delete Tracks", 2, 2);
+    pageMenu[PLAYBACK].setMenuItem(0, PLAYTRACK, "Play ", 2, 1);
+    pageMenu[PLAYBACK].setMenuItem(1, DELETETRACK, "Delete ", 2, 2);
     pageMenu[PLAYBACK].setMaxItems(2);
     pageMenu[PLAYBACK].setTitle("PLAYBACK      ");   
     
-    pageMenu[PLAY].setMenuItem(0, EX_PLAYTRACK, "Example track", 2, 1);
-    pageMenu[PLAY].setMaxItems(1); 
+    pageMenu[PLAY].setMenuItem(0, P_TRACKFILE1, "FILE 1", 2, 1);
+    pageMenu[PLAY].setMenuItem(1, P_TRACKFILE2, "FILE 2", 2, 2);
+    pageMenu[PLAY].setMenuItem(2, P_TRACKFILE3, "FILE 3", 2, 3);
+    pageMenu[PLAY].setMaxItems(3); 
+    pageMenu[PLAY].setTitle("PLAY TRACK        "); 
     
-    pageMenu[DELETESCR].setMenuItem(0, EX_DELETETRACK, "Example track", 2, 1);
-    pageMenu[DELETESCR].setMaxItems(1); 
+    pageMenu[DELETESCR].setMenuItem(0, D_TRACKFILE1, "FILE 1", 2, 1);
+    pageMenu[DELETESCR].setMenuItem(1, D_TRACKFILE2, "FILE 2", 2, 2);
+    pageMenu[DELETESCR].setMenuItem(2, D_TRACKFILE3, "FILE 3", 2, 3);
+    pageMenu[DELETESCR].setMaxItems(3); 
+    pageMenu[DELETESCR].setTitle("DELETE TRACK      "); 
     
     pageMenu[SCREENSET].setMenuItem(0, CONTRAST, "Contrast", 2, 1);
     pageMenu[SCREENSET].setMaxItems(1); 
@@ -84,8 +92,5 @@
     pageMenu[WARNINGSCR].setMenuItem(1, DELETEYES , "DO NOT Delete", 2, 2);
     pageMenu[WARNINGSCR].setMaxItems(2);    
     
-//    pageMenu[RECORDSCR].setMenuItem(0, CONTRASTUP, "Increase Contrast", 5, 2);
-//    pageMenu[RECORDSCR].setMenuItem(1, CONTRASTDOWN , "Decrease Contrast", 5, 3);
-//    pageMenu[RECORDSCR].setMaxItems(2);  
 
 }
\ No newline at end of file
--- a/menuIDs.h	Fri Apr 26 16:17:18 2013 +0000
+++ b/menuIDs.h	Sat May 04 17:37:57 2013 +0000
@@ -65,13 +65,17 @@
 #define   DELETETRACK            702   
 
 //PLAY MENU
-#define   PLAYTRACKOFFSET        800
-#define   EX_PLAYTRACK           801
+#define   PLAYTRACKOFFSET         800
+#define   P_TRACKFILE1            801
+#define   P_TRACKFILE2            802
+#define   P_TRACKFILE3            803
 //Discuss with Brad  ***-------------------------------*****
 
 //DELETESCR MENU
 #define   DELETETRACKOFFSET      900
-#define   EX_DELETETRACK         901
+#define   D_TRACKFILE1           901
+#define   D_TRACKFILE2           902
+#define   D_TRACKFILE3           903
 //Discuss with Brad ***--------------------------------*****
 
 //SCREENSET MENU