-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feat/lower-latency-with-timer
- Loading branch information
Showing
7 changed files
with
95 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from __future__ import absolute_import | ||
from .Interface import Interface | ||
|
||
import Live | ||
|
||
|
||
class Application(Interface): | ||
def __init__(self, c_instance, socket, application): | ||
super(Application, self).__init__(c_instance, socket) | ||
self.application = application | ||
self.log_message("Version: " + self.get_version(self.get_ns())) | ||
|
||
def get_ns(self, nsid=None): | ||
return self.application | ||
|
||
def get_major_version(self, ns): | ||
return ns.get_major_version() | ||
|
||
def get_minor_version(self, ns): | ||
return ns.get_minor_version() | ||
|
||
def get_bugfix_version(self, ns): | ||
return ns.get_bugfix_version() | ||
|
||
def get_version(self, ns): | ||
return str(ns.get_major_version()) + "." + str(ns.get_minor_version()) + "." + str(ns.get_bugfix_version()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { withAbleton } from "../util/tests"; | ||
import { GettableProperties } from "./application"; | ||
import "jest-extended"; | ||
|
||
const gettableProps: (keyof GettableProperties)[] = [ | ||
"major_version", | ||
"minor_version", | ||
"bugfix_version", | ||
"version", | ||
"open_dialog_count", | ||
"current_dialog_message", | ||
"current_dialog_button_count", | ||
]; | ||
|
||
describe("Application", () => { | ||
it("should be able to read all properties without erroring", async () => { | ||
await withAbleton(async (ab) => { | ||
await Promise.all(gettableProps.map((p) => ab.application.get(p))); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Ableton } from ".."; | ||
import { Namespace } from "."; | ||
|
||
export interface GettableProperties { | ||
bugfix_version: number; | ||
major_version: number; | ||
minor_version: number; | ||
version: string; | ||
current_dialog_button_count: number; | ||
current_dialog_message: string; | ||
open_dialog_count: number; | ||
// More properties are available | ||
} | ||
|
||
export interface TransformedProperties {} | ||
|
||
export interface SettableProperties {} | ||
|
||
export interface ObservableProperties { | ||
open_dialog_count: number; | ||
} | ||
|
||
export class Application extends Namespace< | ||
GettableProperties, | ||
TransformedProperties, | ||
SettableProperties, | ||
ObservableProperties | ||
> { | ||
constructor(ableton: Ableton) { | ||
super(ableton, "application"); | ||
} | ||
|
||
public async pressCurrentDialogButton(index: number) { | ||
return this.sendCommand("press_current_dialog_button", [index]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters