Room with music tab

This commit is contained in:
manuroe 2014-10-19 08:01:33 +02:00
parent e9abbe89f3
commit e15a168152
4 changed files with 29 additions and 1 deletions

View file

@ -440,7 +440,7 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
// will be available (as opposite to the global /initialSync done at startup) // will be available (as opposite to the global /initialSync done at startup)
if (!isStateEvent) { // Do not consider state events if (!isStateEvent) { // Do not consider state events
if (event.event_id && eventMap[event.event_id]) { 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; return;
} }
else { else {
@ -481,6 +481,15 @@ function(matrixService, $rootScope, $q, $timeout, mPresence) {
case 'm.room.topic': case 'm.room.topic':
handleRoomTopic(event, isLiveEvent, isStateEvent); handleRoomTopic(event, isLiveEvent, isStateEvent);
break; break;
case 'org.matrix.midi':
//if (isLiveEvent)
{
MidiEventHandler.handleEvent(event);
}
break;
default: default:
console.log("Unable to handle event type " + event.type); console.log("Unable to handle event type " + event.type);
console.log(JSON.stringify(event, undefined, 4)); console.log(JSON.stringify(event, undefined, 4));

View file

@ -42,6 +42,17 @@
<script src="components/fileInput/file-input-directive.js"></script> <script src="components/fileInput/file-input-directive.js"></script>
<script src="components/fileUpload/file-upload-service.js"></script> <script src="components/fileUpload/file-upload-service.js"></script>
<script src="components/utilities/utilities-service.js"></script> <script src="components/utilities/utilities-service.js"></script>
<script type='text/javascript' src='js/MIDI.js'></script>
<script src="components/matrix/midi-event-handler.js"></script>
<script src="./inc/Base64.js" type="text/javascript"></script>
<script src="./inc/base64binary.js" type="text/javascript"></script>
<script type='text/javascript' src='js/vextab/underscore-min.js'></script>
<script type='text/javascript' src='js/vextab/vexflow-debug.js'></script>
<script type='text/javascript' src='js/vextab/tabdiv-debug.js'></script>
<script type='text/javascript' src='js/vextab/vextab_parser.js'></script>
</head> </head>
<body> <body>

View file

@ -650,6 +650,9 @@ angular.module('RoomController', ['ngSanitize', 'matrixFilter', 'mFileInput'])
$scope.onInit = function() { $scope.onInit = function() {
console.log("onInit"); console.log("onInit");
MidiEventHandler.reset();
// Does the room ID provided in the URL? // Does the room ID provided in the URL?
var room_id_or_alias; var room_id_or_alias;
if ($routeParams.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 // There are already messages, go to the last message
scrollToBottom(true); scrollToBottom(true);
} }
MidiEventHandler.setReady();
}, },
function(error) { function(error) {
$scope.feedback = "Failed get member list: " + error.data.error; $scope.feedback = "Failed get member list: " + error.data.error;

View file

@ -68,6 +68,9 @@
ng-hide="state.permission_denied" ng-hide="state.permission_denied"
ng-style="{ 'visibility': state.messages_visibility }" ng-style="{ 'visibility': state.messages_visibility }"
keep-scroll> keep-scroll>
<canvas id="boo" style="width:95%;"></canvas>
<table id="messageTable" infinite-scroll="paginateMore()"> <table id="messageTable" infinite-scroll="paginateMore()">
<tr ng-repeat="msg in events.rooms[room_id].messages" <tr ng-repeat="msg in events.rooms[room_id].messages"
ng-class="(events.rooms[room_id].messages[$index + 1].user_id !== msg.user_id ? 'differentUser' : '') + (msg.user_id === state.user_id ? ' mine' : '')" scroll-item> ng-class="(events.rooms[room_id].messages[$index + 1].user_id !== msg.user_id ? 'differentUser' : '') + (msg.user_id === state.user_id ? ' mine' : '')" scroll-item>