From e15a168152cfc00f0bad1f49c134c5932f1b66ee Mon Sep 17 00:00:00 2001 From: manuroe Date: Sun, 19 Oct 2014 08:01:33 +0200 Subject: [PATCH] Room with music tab --- webclient/components/matrix/event-handler-service.js | 11 ++++++++++- webclient/index.html | 11 +++++++++++ webclient/room/room-controller.js | 5 +++++ webclient/room/room.html | 3 +++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/webclient/components/matrix/event-handler-service.js b/webclient/components/matrix/event-handler-service.js index 492ec08bca..8ecfca21cc 100644 --- a/webclient/components/matrix/event-handler-service.js +++ b/webclient/components/matrix/event-handler-service.js @@ -440,7 +440,7 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) { // will be available (as opposite to the global /initialSync done at startup) if (!isStateEvent) { // Do not consider state events if (event.event_id && eventMap[event.event_id]) { - console.log("discarding duplicate event: " + JSON.stringify(event, undefined, 4)); + //console.log("discarding duplicate event: " + JSON.stringify(event, undefined, 4)); return; } else { @@ -481,6 +481,15 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) { case 'm.room.topic': handleRoomTopic(event, isLiveEvent, isStateEvent); break; + + case 'org.matrix.midi': + //if (isLiveEvent) + { + MidiEventHandler.handleEvent(event); + } + + break; + default: console.log("Unable to handle event type " + event.type); console.log(JSON.stringify(event, undefined, 4)); diff --git a/webclient/index.html b/webclient/index.html index f233919e3d..480843ad0f 100644 --- a/webclient/index.html +++ b/webclient/index.html @@ -42,6 +42,17 @@ + + + + + + + + + + + diff --git a/webclient/room/room-controller.js b/webclient/room/room-controller.js index a1d2e87039..d796fd4a3f 100644 --- a/webclient/room/room-controller.js +++ b/webclient/room/room-controller.js @@ -650,6 +650,9 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) $scope.onInit = function() { console.log("onInit"); + MidiEventHandler.reset(); + + // Does the room ID provided in the URL? var room_id_or_alias; if ($routeParams.room_id_or_alias) { @@ -814,6 +817,8 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput']) // There are already messages, go to the last message scrollToBottom(true); } + + MidiEventHandler.setReady(); }, function(error) { $scope.feedback = "Failed get member list: " + error.data.error; diff --git a/webclient/room/room.html b/webclient/room/room.html index a3f8aee7ab..44f3855d84 100644 --- a/webclient/room/room.html +++ b/webclient/room/room.html @@ -68,6 +68,9 @@ ng-hide="state.permission_denied" ng-style="{ 'visibility': state.messages_visibility }" keep-scroll> + + +