-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlaunchpad_page.js
79 lines (66 loc) · 1.72 KB
/
launchpad_page.js
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
/**
* Copyright 2014-2015 Alan Drees
*
* Purpose:
* Launchpad Page base object
*
* Requires:
*
*/
var Launchpad = Launchpad || {};
/**\fn Launchpad.Page
*
* Constructor function for the Launchpad.Page object
*
* @param None
*
* @returns None
*/
Launchpad.Page = function(controller, name)
{
this.canScrollLeft = false;
this.canScrollRight = false;
this.canScrollUp = false;
this.canScrollDown = false;
this.name = name;
this.controller = controller;
}
/**\fn Launchpad.Page.prototype.updateOutputState
*
* Placeholder function for the updateOutputState. Must be overloaded in the child object.
*
* @param None
*
* @returns None
*/
Launchpad.Page.prototype.updateOutputState = function()
{
console.log(this.name + "'s updateOutputState function not overloaded");
};
/**\fn Launchpad.Page.prototype.updateScrollButtons
*
* Updates the scroll buttons LED state
*
* @param None
*
* @returns None
*/
Launchpad.Page.prototype.updateScrollButtons = function()
{
this.controller.setTopLED(0, this.canScrollUp ? Launchpad.Colour.GREEN_FULL : Launchpad.Colour.GREEN_LOW);
this.controller.setTopLED(1, this.canScrollDown ? Launchpad.Colour.GREEN_FULL : Launchpad.Colour.GREEN_LOW);
this.controller.setTopLED(2, this.canScrollLeft ? Launchpad.Colour.GREEN_FULL : Launchpad.Colour.GREEN_LOW);
this.controller.setTopLED(3, this.canScrollRight ? Launchpad.Colour.GREEN_FULL : Launchpad.Colour.GREEN_LOW);
};
/**\fn Launchpad.Page.prototype.shouldKeyBeUsedForNoteInport
*
* Unknown purpose. Presumed placeholder with no usage in the grid page.
*
* @param None
*
* @returns None
*/
Launchpad.Page.prototype.shouldKeyBeUsedForNoteInport = function(x,y)
{
return false;
}