summaryrefslogtreecommitdiff
path: root/metawatch/metawatchanalog.cpp
blob: 60993d42ebcdf04f727b2beefa64aab643517d62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#include "metawatchanalog.h"

using namespace sowatch;

// TODO : Figure out what to do with the buttons
// TODO : Figure out how the OLED screen protocol works, including scrolling
// TODO : Idle and Notification screens for the Analog Metawatch

MetaWatchAnalog::MetaWatchAnalog(const QBluetoothAddress& address, QSettings* settings, QObject *parent) :
	MetaWatch(address, settings, parent)
{
}

int MetaWatchAnalog::metric(PaintDeviceMetric metric) const
{
	switch (metric) {
	case PdmWidth:
		return screenWidth;
	case PdmHeight:
		return screenHeight;
	case PdmWidthMM:
		return 8;
	case PdmHeightMM:
		return 8;
	case PdmNumColors:
		return 2;
	case PdmDepth:
		return 1;
	case PdmDpiX:
	case PdmPhysicalDpiX:
		return 96;
	case PdmDpiY:
	case PdmPhysicalDpiY:
		return 96;
	}

	return -1;
}

QString MetaWatchAnalog::model() const
{
	return "metawatch-analog";
}

void MetaWatchAnalog::updateNotificationCount(Notification::Type type, int count)
{
	Q_UNUSED(type);
	Q_UNUSED(count);
	// Analog doesn't do anything with this
}

void MetaWatchAnalog::updateWeather(WeatherNotification *weather)
{
	Q_UNUSED(weather);
	// Analog doesn't do anything with this
}

void MetaWatchAnalog::displayIdleScreen()
{
	qDebug() << "displaying idle screen";
	MetaWatch::displayIdleScreen();
}

void MetaWatchAnalog::displayNotification(Notification *n)
{
	qDebug() << "display notification" << n->title() << n->body();

	// Render the notification and display it before invoking haptic feedback
	_currentMode = NotificationMode;
	// TODO

	MetaWatch::displayNotification(n);
}

void MetaWatchAnalog::displayApplication()
{
	qDebug() << "entering application mode";

	MetaWatch::displayApplication();
}

void MetaWatchAnalog::update(Mode mode, const QList<QRect> &rects)
{
	if (!_connected) return;
	Q_UNUSED(mode);
	Q_UNUSED(rects);
	// TODO
}

void MetaWatchAnalog::clear(Mode mode, bool black)
{
	if (!_connected) return;
	Q_UNUSED(mode);
	Q_UNUSED(black);
	// TODO Still need to understand this
}

void MetaWatchAnalog::handleWatchConnected()
{

}