11 |
|
|
12 |
|
#include <foreach.hpp> |
13 |
|
#include <hash.hpp> |
14 |
– |
#include <iconv.hpp> |
14 |
|
#include <regex.hpp> |
15 |
|
#include <scopes.hpp> |
16 |
|
#include <timing.hpp> |
17 |
|
|
19 |
– |
#include <Audacious.hpp> |
18 |
|
#include <GPS.hpp> |
19 |
|
|
20 |
|
#include <sys/types.h> |
32 |
|
enum { Running, Audio }; |
33 |
|
enum { Stopped, Paused, Playing } audio; |
34 |
|
Timing::Time now; |
37 |
– |
IConv::IConv ascii; |
38 |
– |
Display display; |
39 |
– |
Pthreads::ThreadMutex displayLock; |
35 |
|
Audacious::Audacious audacious; |
36 |
|
//GPS::GPS gps; |
37 |
+ |
MusicLibrary::Library library; |
38 |
|
MenuList *list; |
39 |
|
bool append; |
40 |
< |
|
41 |
< |
inline std::string Filter(const std::string input) |
46 |
< |
{ |
47 |
< |
std::string output(ascii.Convert(input)); |
48 |
< |
|
49 |
< |
std::replace(output.begin(), output.end(), '~', '\xce'); |
50 |
< |
|
51 |
< |
return output; |
52 |
< |
} |
40 |
> |
Display display; |
41 |
> |
Pthreads::ThreadMutex displayLock; |
42 |
|
|
43 |
|
void Mode_(bool change = false) |
44 |
|
{ |
105 |
|
display.SetCursorStyle(Display::InvertingBlinkingBlock); |
106 |
|
|
107 |
|
append = true; |
108 |
< |
list = new TopList(display, audacious, append); |
108 |
> |
list = new TopList(display, audacious, append, library); |
109 |
|
|
110 |
|
list->Render(); |
111 |
|
} |
268 |
|
} |
269 |
|
|
270 |
|
public: |
271 |
< |
DashInterface(const std::string &device) : mode(Uname), audio(Stopped), ascii(_B("ASCII//TRANSLIT//IGNORE"), _B("UTF-8")), display(device, reinterpret_cast<Display::Callback>(::Buttons), this) |
271 |
> |
DashInterface(const std::string &device) : mode(Uname), audio(Stopped), display(device, reinterpret_cast<Display::Callback>(::Buttons), this) |
272 |
|
{ |
273 |
|
_synchronized (displayLock) |
274 |
|
{ |