ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/truck/DashInterface/DashInterface.cpp
(Generate patch)

Comparing DashInterface/DashInterface.cpp (file contents):
Revision 42 by douglas, 2008-03-06T13:04:20-08:00 vs.
Revision 44 by douglas, 2008-03-06T15:21:03-08:00

# Line 24 | Line 24
24   #include <sys/utsname.h>
25  
26   #include "Display.hpp"
27 + #include "MenuList.hpp"
28  
29   bool debug(false);
30  
# Line 32 | Line 33 | class DashInterface
33          enum Mode { Uname, Music, English, Metric, Nautical, Menu } mode, previous;
34          enum { Running, Audio };
35          enum { Stopped, Paused, Playing } audio;
35        enum Level { Top, Artist, Album, Song } level;
36          Timing::Time now;
37          IConv::IConv ascii;
38          Display display;
39          Pthreads::ThreadMutex displayLock;
40          Audacious::Audacious audacious;
41          //GPS::GPS gps;
42 +        MenuList *list;
43 +        bool append;
44  
45          inline std::string Filter(const std::string input)
46          {
# Line 100 | Line 102 | class DashInterface
102                          return;
103                  case Menu:
104                          if (change)
105 <                                level = Top;
105 >                        {
106 >                                display.SetCursorStyle(Display::InvertingBlinkingBlock);
107 >
108 >                                append = true;
109 >                                list = new TopList(display, audacious, append);
110 >
111 >                                list->Render();
112 >                        }
113                  }
114          }
115  
# Line 226 | Line 235 | update:                        Mode_(change);
235                                  switch (activity)
236                                  {
237                                  case Display::UpPress:
238 +                                        return (++*list).Render();
239                                  case Display::DownPress:
240 +                                        return (--*list).Render();
241                                  case Display::LeftPress:
242 +                                        list = list->Left();
243 +
244 +                                        goto render;
245                                  case Display::RightPress:
246 +                                        list = list->Right();
247 +
248 +                                        goto render;
249                                  case Display::EnterPress:
250 <                                        return;
250 >                                        list = list->Enter();
251 >
252 > render:                         if (list != NULL)
253 >                                                return list->Render();
254 >
255 >                                        goto exit;
256                                  case Display::ExitPress:
257 <                                        mode = previous;
257 >                                        delete list;
258 >
259 > exit:                           mode = previous;
260  
261 +                                        display.SetCursorStyle(Display::NoCursor);
262                                          display.Set(0, 0, _B("  "));
263                                          display.Set(18, 0, _B("  "));
264  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines