[beast: 28/47] EBEAST: provide App.project() accessor and preload partymonster.bse
- From: Tim Janik <timj src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [beast: 28/47] EBEAST: provide App.project() accessor and preload partymonster.bse
- Date: Sat, 2 Sep 2017 00:44:17 +0000 (UTC)
commit f408e5f157dabfdb017be1dd62e741e27604603d
Author: Tim Janik <timj gnu org>
Date: Fri May 26 00:45:50 2017 +0200
EBEAST: provide App.project() accessor and preload partymonster.bse
Signed-off-by: Tim Janik <timj gnu org>
ebeast/app.js | 18 +++++++++++-------
1 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/ebeast/app.js b/ebeast/app.js
index bc8d6bb..f21855a 100644
--- a/ebeast/app.js
+++ b/ebeast/app.js
@@ -11,7 +11,8 @@ const AppMethods = {
__proto__ : Electron.app
};
const App = { // global App object with defaults
- project: undefined,
+ current_project: undefined,
+ project: function () { return this.current_project; },
show_about: false,
__proto__ : AppMethods
};
@@ -88,8 +89,8 @@ const Toolbar = {
// == export start_app() ==
const MithrilApp = {
document_title (vnode) {
- if (App.project) {
- return App.project.uname + // FIXME
+ if (App.current_project) {
+ return App.project().uname + // FIXME
' – BEAST';
}
return "Beast - Music Synthesizer and Composer";
@@ -103,7 +104,7 @@ const MithrilApp = {
];
const vtree = (
m ('div#mithril.Mithril.vbox', {
- style: 'position: absolute; top: 0; left: 0; right: 0; bottom: 0;',
+ style: 'position: relative; top: 0; left: 0; right: 0; bottom: 0;',
}, app_body)
);
const newtitle = this.document_title (vtree);
@@ -113,7 +114,10 @@ const MithrilApp = {
}
};
module.exports.start_app = function () { // application setup after onready
- if (!App.project)
- App.project = Bse.server.create_project ('Untitled');
- m.mount (document.body, MithrilApp);
+ if (!App.current_project) {
+ App.current_project = Bse.server.create_project ('Untitled');
+ if (App.current_project)
+ App.current_project.restore_from_file ('../library/demo/partymonster.bse');
+ }
+ m.mount ($('#mount-mithril')[0], MithrilApp);
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]