Consolidate all public files into one folder

This commit is contained in:
IrosTheBeggar 2017-01-24 02:40:46 -05:00
parent cb84aa4657
commit 0cf7172108
22 changed files with 51 additions and 5077 deletions

View File

@ -1,7 +1 @@
{
"code":80141,
"command":{
"type":"play",
"url":"xxx"
}
}
"{'code':55414, "command":{"action":"next"}}"

View File

@ -26,11 +26,11 @@ mstream.use(bodyParser.urlencoded({ extended: true })); // support encoded bodie
// Setup WebApp
if(program.userinterface){
mstream.use( express.static(fe.join(__dirname, program.userinterface) ));
mstream.use( '/public', express.static(fe.join(__dirname, program.userinterface) ));
// Serve the webapp
mstream.get('/', function (req, res) {
res.sendFile( fe.join(program.userinterface, 'mstream.html'), { root: __dirname });
res.sendFile( fe.join('public', 'mstream.html'), { root: __dirname });
});
}
@ -251,10 +251,10 @@ var sharedTokenMap = {
};
mstream.use( '/public-shared', express.static(fe.join(__dirname, 'public-shared') ));
// mstream.use( '/public-shared', express.static(fe.join(__dirname, 'public-shared') ));
// Serve the webapp
mstream.all('/shared/*', function (req, res) {
res.sendFile( fe.join('public-shared', 'mstream.html'), { root: __dirname });
res.sendFile( fe.join('public', 'shared.html'), { root: __dirname });
});
// Setup shared

Binary file not shown.

Before

Width:  |  Height:  |  Size: 443 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

File diff suppressed because one or more lines are too long

View File

@ -1,799 +0,0 @@
(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
exports.FLACDemuxer = require('./src/demuxer');
exports.FLACDecoder = require('./src/decoder');
require('./src/ogg');
},{"./src/decoder":2,"./src/demuxer":3,"./src/ogg":4}],2:[function(require,module,exports){
(function (global){
/*
* FLAC.js - Free Lossless Audio Codec decoder in JavaScript
* Original C version from FFmpeg (c) 2003 Alex Beregszaszi
* JavaScript port by Devon Govett and Jens Nockert of Official.fm Labs
*
* Licensed under the same terms as the original. The original
* license follows.
*
* FLAC.js is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FLAC.js is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
var AV = (typeof window !== "undefined" ? window['AV'] : typeof global !== "undefined" ? global['AV'] : null);
var FLACDecoder = AV.Decoder.extend(function() {
AV.Decoder.register('flac', this);
this.prototype.setCookie = function(cookie) {
this.cookie = cookie;
// initialize arrays
this.decoded = [];
for (var i = 0; i < this.format.channelsPerFrame; i++) {
this.decoded[i] = new Int32Array(cookie.maxBlockSize);
}
// for 24 bit lpc frames, this is used to simulate a 64 bit int
this.lpc_total = new Int32Array(2);
};
const BLOCK_SIZES = new Int16Array([
0, 192, 576 << 0, 576 << 1, 576 << 2, 576 << 3, 0, 0,
256 << 0, 256 << 1, 256 << 2, 256 << 3, 256 << 4, 256 << 5, 256 << 6, 256 << 7
]);
const SAMPLE_RATES = new Int32Array([
0, 88200, 176400, 192000,
8000, 16000, 22050, 24000, 32000, 44100, 48000, 96000,
0, 0, 0, 0
]);
const SAMPLE_SIZES = new Int8Array([
0, 8, 12, 0, 16, 20, 24, 0
]);
const MAX_CHANNELS = 8,
CHMODE_INDEPENDENT = 0,
CHMODE_LEFT_SIDE = 8,
CHMODE_RIGHT_SIDE = 9,
CHMODE_MID_SIDE = 10;
this.prototype.readChunk = function() {
var stream = this.bitstream;
if (!stream.available(32))
return;
// frame sync code
if ((stream.read(15) & 0x7FFF) !== 0x7FFC)
throw new Error('Invalid sync code');
var isVarSize = stream.read(1), // variable block size stream code
bsCode = stream.read(4), // block size
srCode = stream.read(4), // sample rate code
chMode = stream.read(4), // channel mode
bpsCode = stream.read(3); // bits per sample
stream.advance(1); // reserved bit
// channels
this.chMode = chMode;
var channels;
if (chMode < MAX_CHANNELS) {
channels = chMode + 1;
this.chMode = CHMODE_INDEPENDENT;
} else if (chMode <= CHMODE_MID_SIDE) {
channels = 2;
} else {
throw new Error('Invalid channel mode');
}
if (channels !== this.format.channelsPerFrame)
throw new Error('Switching channel layout mid-stream not supported.');
// bits per sample
if (bpsCode === 3 || bpsCode === 7)
throw new Error('Invalid sample size code');
this.bps = SAMPLE_SIZES[bpsCode];
if (this.bps !== this.format.bitsPerChannel)
throw new Error('Switching bits per sample mid-stream not supported.');
// sample number or frame number
// see http://www.hydrogenaudio.org/forums/index.php?s=ea7085ffe6d57132c36e6105c0d434c9&showtopic=88390&pid=754269&st=0&#entry754269
var ones = 0;
while (stream.read(1) === 1)
ones++;
var frame_or_sample_num = stream.read(7 - ones);
for (; ones > 1; ones--) {
stream.advance(2); // == 2
frame_or_sample_num = (frame_or_sample_num << 6) | stream.read(6);
}
// block size
if (bsCode === 0)
throw new Error('Reserved blocksize code');
else if (bsCode === 6)
this.blockSize = stream.read(8) + 1;
else if (bsCode === 7)
this.blockSize = stream.read(16) + 1;
else
this.blockSize = BLOCK_SIZES[bsCode];
// sample rate
var sampleRate;
if (srCode < 12)
sampleRate = SAMPLE_RATES[srCode];
else if (srCode === 12)
sampleRate = stream.read(8) * 1000;
else if (srCode === 13)
sampleRate = stream.read(16);
else if (srCode === 14)
sampleRate = stream.read(16) * 10;
else
throw new Error('Invalid sample rate code');
stream.advance(8); // skip CRC check
// subframes
for (var i = 0; i < channels; i++)
this.decodeSubframe(i);
stream.align();
stream.advance(16); // skip CRC frame footer
var is32 = this.bps > 16,
output = new ArrayBuffer(this.blockSize * channels * (is32 ? 4 : 2)),
buf = is32 ? new Int32Array(output) : new Int16Array(output),
blockSize = this.blockSize,
decoded = this.decoded,
j = 0;
switch (this.chMode) {
case CHMODE_INDEPENDENT:
for (var k = 0; k < blockSize; k++) {
for (var i = 0; i < channels; i++) {
buf[j++] = decoded[i][k];
}
}
break;
case CHMODE_LEFT_SIDE:
for (var i = 0; i < blockSize; i++) {
var left = decoded[0][i],
right = decoded[1][i];
buf[j++] = left;
buf[j++] = (left - right);
}
break;
case CHMODE_RIGHT_SIDE:
for (var i = 0; i < blockSize; i++) {
var left = decoded[0][i],
right = decoded[1][i];
buf[j++] = (left + right);
buf[j++] = right;
}
break;
case CHMODE_MID_SIDE:
for (var i = 0; i < blockSize; i++) {
var left = decoded[0][i],
right = decoded[1][i];
left -= right >> 1;
buf[j++] = (left + right);
buf[j++] = left;
}
break;
}
return buf;
};
this.prototype.decodeSubframe = function(channel) {
var wasted = 0,
stream = this.bitstream,
blockSize = this.blockSize,
decoded = this.decoded;
this.curr_bps = this.bps;
if (channel === 0) {
if (this.chMode === CHMODE_RIGHT_SIDE)
this.curr_bps++;
} else {
if (this.chMode === CHMODE_LEFT_SIDE || this.chMode === CHMODE_MID_SIDE)
this.curr_bps++;
}
if (stream.read(1))
throw new Error("Invalid subframe padding");
var type = stream.read(6);
if (stream.read(1)) {
wasted = 1;
while (!stream.read(1))
wasted++;
this.curr_bps -= wasted;
}
if (this.curr_bps > 32)
throw new Error("decorrelated bit depth > 32 (" + this.curr_bps + ")");
if (type === 0) {
var tmp = stream.read(this.curr_bps, true);
for (var i = 0; i < blockSize; i++)
decoded[channel][i] = tmp;
} else if (type === 1) {
var bps = this.curr_bps;
for (var i = 0; i < blockSize; i++)
decoded[channel][i] = stream.read(bps, true);
} else if ((type >= 8) && (type <= 12)) {
this.decode_subframe_fixed(channel, type & ~0x8);
} else if (type >= 32) {
this.decode_subframe_lpc(channel, (type & ~0x20) + 1);
} else {
throw new Error("Invalid coding type");
}
if (wasted) {
for (var i = 0; i < blockSize; i++)
decoded[channel][i] <<= wasted;
}
};
this.prototype.decode_subframe_fixed = function(channel, predictor_order) {
var decoded = this.decoded[channel],
stream = this.bitstream,
bps = this.curr_bps;
// warm up samples
for (var i = 0; i < predictor_order; i++)
decoded[i] = stream.read(bps, true);
this.decode_residuals(channel, predictor_order);
var a = 0, b = 0, c = 0, d = 0;
if (predictor_order > 0)
a = decoded[predictor_order - 1];
if (predictor_order > 1)
b = a - decoded[predictor_order - 2];
if (predictor_order > 2)
c = b - decoded[predictor_order - 2] + decoded[predictor_order - 3];
if (predictor_order > 3)
d = c - decoded[predictor_order - 2] + 2 * decoded[predictor_order - 3] - decoded[predictor_order - 4];
switch (predictor_order) {
case 0:
break;
case 1:
case 2:
case 3:
case 4:
var abcd = new Int32Array([a, b, c, d]),
blockSize = this.blockSize;
for (var i = predictor_order; i < blockSize; i++) {
abcd[predictor_order - 1] += decoded[i];
for (var j = predictor_order - 2; j >= 0; j--) {
abcd[j] += abcd[j + 1];
}
decoded[i] = abcd[0];
}
break;
default:
throw new Error("Invalid Predictor Order " + predictor_order);
}
};
this.prototype.decode_subframe_lpc = function(channel, predictor_order) {
var stream = this.bitstream,
decoded = this.decoded[channel],
bps = this.curr_bps,
blockSize = this.blockSize;
// warm up samples
for (var i = 0; i < predictor_order; i++) {
decoded[i] = stream.read(bps, true);
}
var coeff_prec = stream.read(4) + 1;
if (coeff_prec === 16)
throw new Error("Invalid coefficient precision");
var qlevel = stream.read(5, true);
if (qlevel < 0)
throw new Error("Negative qlevel, maybe buggy stream");
var coeffs = new Int32Array(32);
for (var i = 0; i < predictor_order; i++) {
coeffs[i] = stream.read(coeff_prec, true);
}
this.decode_residuals(channel, predictor_order);
if (this.bps <= 16) {
for (var i = predictor_order; i < blockSize - 1; i += 2) {
var d = decoded[i - predictor_order],
s0 = 0, s1 = 0, c = 0;
for (var j = predictor_order - 1; j > 0; j--) {
c = coeffs[j];
s0 += c * d;
d = decoded[i - j];
s1 += c * d;
}
c = coeffs[0];
s0 += c * d;
d = decoded[i] += (s0 >> qlevel);
s1 += c * d;
decoded[i + 1] += (s1 >> qlevel);
}
if (i < blockSize) {
var sum = 0;
for (var j = 0; j < predictor_order; j++)
sum += coeffs[j] * decoded[i - j - 1];
decoded[i] += (sum >> qlevel);
}
} else {
// simulate 64 bit integer using an array of two 32 bit ints
var total = this.lpc_total;
for (var i = predictor_order; i < blockSize; i++) {
// reset total to 0
total[0] = 0;
total[1] = 0;
for (j = 0; j < predictor_order; j++) {
// simulate `total += coeffs[j] * decoded[i - j - 1]`
multiply_add(total, coeffs[j], decoded[i - j - 1]);
}
// simulate `decoded[i] += total >> qlevel`
// we know that qlevel < 32 since it is a 5 bit field (see above)
decoded[i] += (total[0] >>> qlevel) | (total[1] << (32 - qlevel));
}
}
};
const TWO_PWR_32_DBL = Math.pow(2, 32);
// performs `total += a * b` on a simulated 64 bit int
// total is an Int32Array(2)
// a and b are JS numbers (32 bit ints)
function multiply_add(total, a, b) {
// multiply a * b (we can use normal JS multiplication for this)
var r = a * b;
var n = r < 0;
if (n)
r = -r;
var r_low = (r % TWO_PWR_32_DBL) | 0;
var r_high = (r / TWO_PWR_32_DBL) | 0;
if (n) {
r_low = ~r_low + 1;
r_high = ~r_high;
}
// add result to total
var a48 = total[1] >>> 16;
var a32 = total[1] & 0xFFFF;
var a16 = total[0] >>> 16;
var a00 = total[0] & 0xFFFF;
var b48 = r_high >>> 16;
var b32 = r_high & 0xFFFF;
var b16 = r_low >>> 16;
var b00 = r_low & 0xFFFF;
var c48 = 0, c32 = 0, c16 = 0, c00 = 0;
c00 += a00 + b00;
c16 += c00 >>> 16;
c00 &= 0xFFFF;
c16 += a16 + b16;
c32 += c16 >>> 16;
c16 &= 0xFFFF;
c32 += a32 + b32;
c48 += c32 >>> 16;
c32 &= 0xFFFF;
c48 += a48 + b48;
c48 &= 0xFFFF;
// store result back in total
total[0] = (c16 << 16) | c00;
total[1] = (c48 << 16) | c32;
}
const INT_MAX = 32767;
this.prototype.decode_residuals = function(channel, predictor_order) {
var stream = this.bitstream,
method_type = stream.read(2);
if (method_type > 1)
throw new Error('Illegal residual coding method ' + method_type);
var rice_order = stream.read(4),
samples = (this.blockSize >>> rice_order);
if (predictor_order > samples)
throw new Error('Invalid predictor order ' + predictor_order + ' > ' + samples);
var decoded = this.decoded[channel],
sample = predictor_order,
i = predictor_order;
for (var partition = 0; partition < (1 << rice_order); partition++) {
var tmp = stream.read(method_type === 0 ? 4 : 5);
if (tmp === (method_type === 0 ? 15 : 31)) {
tmp = stream.read(5);
for (; i < samples; i++)
decoded[sample++] = stream.read(tmp, true);
} else {
for (; i < samples; i++)
decoded[sample++] = this.golomb(tmp, INT_MAX, 0);
}
i = 0;
}
};
const MIN_CACHE_BITS = 25;
this.prototype.golomb = function(k, limit, esc_len) {
var data = this.bitstream,
offset = data.bitPosition,
buf = data.peek(32 - offset) << offset,
v = 0;
var log = 31 - clz(buf | 1); // log2(buf)
if (log - k >= 32 - MIN_CACHE_BITS && 32 - log < limit) {
buf >>>= log - k;
buf += (30 - log) << k;
data.advance(32 + k - log);
v = buf;
} else {
for (var i = 0; data.read(1) === 0; i++)
buf = data.peek(32 - offset) << offset;
if (i < limit - 1) {
if (k)
buf = data.read(k);
else
buf = 0;
v = buf + (i << k);
} else if (i === limit - 1) {
buf = data.read(esc_len);
v = buf + 1;
} else {
v = -1;
}
}
return (v >> 1) ^ -(v & 1);
};
// Should be in the damned standard library...
function clz(input) {
var output = 0,
curbyte = 0;
while(true) { // emulate goto in JS using the break statement :D
curbyte = input >>> 24;
if (curbyte) break;
output += 8;
curbyte = input >>> 16;
if (curbyte & 0xff) break;
output += 8;
curbyte = input >>> 8;
if (curbyte & 0xff) break;
output += 8;
curbyte = input;
if (curbyte & 0xff) break;
output += 8;
return output;
}
if (!(curbyte & 0xf0))
output += 4;
else
curbyte >>>= 4;
if (curbyte & 0x8)
return output;
if (curbyte & 0x4)
return output + 1;
if (curbyte & 0x2)
return output + 2;
if (curbyte & 0x1)
return output + 3;
// shouldn't get here
return output + 4;
}
});
module.exports = FLACDecoder;
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],3:[function(require,module,exports){
(function (global){
/*
* FLAC.js - Free Lossless Audio Codec decoder in JavaScript
* By Devon Govett and Jens Nockert of Official.fm Labs
*
* FLAC.js is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FLAC.js is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
*/
var AV = (typeof window !== "undefined" ? window['AV'] : typeof global !== "undefined" ? global['AV'] : null);
var FLACDemuxer = AV.Demuxer.extend(function() {
AV.Demuxer.register(this);
this.probe = function(buffer) {
return buffer.peekString(0, 4) === 'fLaC';
}
const STREAMINFO = 0,
PADDING = 1,
APPLICATION = 2,
SEEKTABLE = 3,
VORBIS_COMMENT = 4,
CUESHEET = 5,
PICTURE = 6,
INVALID = 127,
STREAMINFO_SIZE = 34;
this.prototype.readChunk = function() {
var stream = this.stream;
if (!this.readHeader && stream.available(4)) {
if (stream.readString(4) !== 'fLaC')
return this.emit('error', 'Invalid FLAC file.');
this.readHeader = true;
}
while (stream.available(1) && !this.last) {
if (!this.readBlockHeaders) {
var tmp = stream.readUInt8();
this.last = (tmp & 0x80) === 0x80,
this.type = tmp & 0x7F,
this.size = stream.readUInt24();
}
if (!this.foundStreamInfo && this.type !== STREAMINFO)
return this.emit('error', 'STREAMINFO must be the first block');
if (!stream.available(this.size))
return;
switch (this.type) {
case STREAMINFO:
if (this.foundStreamInfo)
return this.emit('error', 'STREAMINFO can only occur once.');
if (this.size !== STREAMINFO_SIZE)
return this.emit('error', 'STREAMINFO size is wrong.');
this.foundStreamInfo = true;
var bitstream = new AV.Bitstream(stream);
var cookie = {
minBlockSize: bitstream.read(16),
maxBlockSize: bitstream.read(16),
minFrameSize: bitstream.read(24),
maxFrameSize: bitstream.read(24)
};
this.format = {
formatID: 'flac',
sampleRate: bitstream.read(20),
channelsPerFrame: bitstream.read(3) + 1,
bitsPerChannel: bitstream.read(5) + 1
};
this.emit('format', this.format);
this.emit('cookie', cookie);
var sampleCount = bitstream.read(36);
this.emit('duration', sampleCount / this.format.sampleRate * 1000 | 0);
stream.advance(16); // skip MD5 hashes
this.readBlockHeaders = false;
break;
/*
I am only looking at the least significant 32 bits of sample number and offset data
This is more than sufficient for the longest flac file I have (~50 mins 2-channel 16-bit 44.1k which uses about 7.5% of the UInt32 space for the largest offset)
Can certainly be improved by storing sample numbers and offests as doubles, but would require additional overriding of the searchTimestamp and seek functions (possibly more?)
Also the flac faq suggests it would be possible to find frame lengths and thus create seek points on the fly via decoding but I assume this would be slow
I may look into these thigns though as my project progresses
*/
case SEEKTABLE:
for(var s=0; s<this.size/18; s++)
{
if(stream.peekUInt32(0) == 0xFFFFFFFF && stream.peekUInt32(1) == 0xFFFFFFFF)
{
//placeholder, ignore
stream.advance(18);
} else {
if(stream.readUInt32() > 0)
{
this.emit('error', 'Seek points with sample number >UInt32 not supported');
}
var samplenum = stream.readUInt32();
if(stream.readUInt32() > 0)
{
this.emit('error', 'Seek points with stream offset >UInt32 not supported');
}
var offset = stream.readUInt32();
stream.advance(2);
this.addSeekPoint(offset, samplenum);
}
}
break;
case VORBIS_COMMENT:
// see http://www.xiph.org/vorbis/doc/v-comment.html
this.metadata || (this.metadata = {});
var len = stream.readUInt32(true);
this.metadata.vendor = stream.readString(len);
var length = stream.readUInt32(true);
for (var i = 0; i < length; i++) {
len = stream.readUInt32(true);
var str = stream.readString(len, 'utf8'),
idx = str.indexOf('=');
this.metadata[str.slice(0, idx).toLowerCase()] = str.slice(idx + 1);
}
// TODO: standardize field names across formats
break;
case PICTURE:
var type = stream.readUInt32();
if (type !== 3) { // make sure this is album art (type 3)
stream.advance(this.size - 4);
} else {
var mimeLen = stream.readUInt32(),
mime = stream.readString(mimeLen),
descLen = stream.readUInt32(),
description = stream.readString(descLen),
width = stream.readUInt32(),
height = stream.readUInt32(),
depth = stream.readUInt32(),
colors = stream.readUInt32(),
length = stream.readUInt32(),
picture = stream.readBuffer(length);
this.metadata || (this.metadata = {});
this.metadata.coverArt = picture;
}
// does anyone want the rest of the info?
break;
default:
stream.advance(this.size);
this.readBlockHeaders = false;
}
if (this.last && this.metadata)
this.emit('metadata', this.metadata);
}
while (stream.available(1) && this.last) {
var buffer = stream.readSingleBuffer(stream.remainingBytes());
this.emit('data', buffer);
}
}
});
module.exports = FLACDemuxer;
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}],4:[function(require,module,exports){
(function (global){
var AV = (typeof window !== "undefined" ? window['AV'] : typeof global !== "undefined" ? global['AV'] : null);
// if ogg.js exists, register a plugin
try {
var OggDemuxer = (typeof window !== "undefined" ? window['AV']['OggDemuxer'] : typeof global !== "undefined" ? global['AV']['OggDemuxer'] : null);
} catch (e) {};
if (!OggDemuxer) return;
OggDemuxer.plugins.push({
magic: "\177FLAC",
init: function() {
this.list = new AV.BufferList();
this.stream = new AV.Stream(this.list);
},
readHeaders: function(packet) {
var stream = this.stream;
this.list.append(new AV.Buffer(packet));
stream.advance(5); // magic
if (stream.readUInt8() != 1)
throw new Error('Unsupported FLAC version');
stream.advance(3);
if (stream.peekString(0, 4) != 'fLaC')
throw new Error('Not flac');
this.flac = AV.Demuxer.find(stream.peekSingleBuffer(0, stream.remainingBytes()));
if (!this.flac)
throw new Error('Flac demuxer not found');
this.flac.prototype.readChunk.call(this);
return true;
},
readPacket: function(packet) {
this.list.append(new AV.Buffer(packet));
this.flac.prototype.readChunk.call(this);
}
});
}).call(this,typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
},{}]},{},[1])
//# sourceMappingURL=flac.js.map

View File

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

View File

@ -1,86 +0,0 @@
// ///////////////////////////// Database Management
// // The Manage DB panel
// $('#manage_database').on('click', function(){
// // Hide the directory bar
// $('.directoryTitle').hide();
// // Change the panel name
// $('.panel_one_name').html('Database Management');
// //clear the list
// $('#filelist').empty();
// // Make an ajax request to get the current state of the db
// var request = $.ajax({
// url: "db_scripts/check_db_status.php",
// type: "GET",
// dataType: "json"
// });
// request.done(function( msg ) {
// // If there is an error
// if(msg.error){
// $('#filelist').html('<p>The database returned the following error:</p><p>' + msg.error + '</p>');
// return;
// }
// // if the DB is locked
// if(msg.locked){
// //
// $('#filelist').html('<p>The database is currently being built</p><input type="button" value="Check Progress" class="button secondary small" id="check_db_progress" >');
// return;
// }
// // If the db is empty
// if(msg.status == 'The database has not been created yet'){
// $('#filelist').html('<p>The database has not been set up yet. Clicking the button will scan your library and create a database</p><input type="button" class="button secondary small" value="Build Database" id="build_database">');
// return;
// }
// // If you got this far the db is made and working
// $('#filelist').html('<p>Your DB currently stores ' + msg.file_count + ' files</p><input type="button" class="button secondary rounded small" value="Rebuild Database" id="build_database">');
// });
// });
// // Build the database
// $('body').on('click', '#build_database', function(){
// $(this).prop("disabled", true);
// // Send out AJAX request to start building the DB
// $.ajax({
// url: "make_db.php",
// type: "GET",
// });
// // Append the check db button so the user can start checking right away
// $('#filelist').append('<input type="button" value="Check Progress" id="check_db_progress" >');
// });
// // Check DB build progress
// $('body').on('click', '#check_db_progress', function(){
// var request = $.ajax({
// url: "db_scripts/db_file_counts.php",
// type: "GET",
// dataType: "json"
// });
// request.done( function(msg){
// // remove a <p> tage with the id of "db_progress_report"
// $( "#db_progress_report" ).remove();
// // if file_count is 0, report that the the build script is not done counting files
// if(msg.file_count == 0){
// $('#filelist').append('<p id="db_progress_report">The create database script is still counting the files in the music collection. This operation can take some time. Try again in a bit</p>');
// return;
// }
// // Append new <p> tag with id of "db_progress_report"
// $('#filelist').append('<p id="db_progress_report">Progress: '+ msg.files_in_db +'/'+ msg.file_count +'</p>');
// });
// });

View File

@ -1,85 +0,0 @@
/*
* HTML5 Sortable jQuery Plugin
* http://farhadi.ir/projects/html5sortable
*
* Copyright 2012, Ali Farhadi
* Released under the MIT license.
*/
(function($) {
var dragging, placeholders = $();
$.fn.sortable = function(options) {
var method = String(options);
options = $.extend({
connectWith: false
}, options);
return this.each(function() {
if (/^enable|disable|destroy$/.test(method)) {
var items = $(this).children($(this).data('items')).attr('draggable', method == 'enable');
if (method == 'destroy') {
items.add(this).removeData('connectWith items')
.off('dragstart.h5s dragend.h5s selectstart.h5s dragover.h5s dragenter.h5s drop.h5s');
}
return;
}
var isHandle, index, items = $(this).children(options.items);
var placeholder = $('<' + (/^ul|ol$/i.test(this.tagName) ? 'li' : 'div') + ' class="sortable-placeholder">');
items.find(options.handle).mousedown(function() {
isHandle = true;
}).mouseup(function() {
isHandle = false;
});
$(this).data('items', options.items)
placeholders = placeholders.add(placeholder);
if (options.connectWith) {
$(options.connectWith).add(this).data('connectWith', options.connectWith);
}
items.attr('draggable', 'true').on('dragstart.h5s', function(e) {
if (options.handle && !isHandle) {
return false;
}
isHandle = false;
var dt = e.originalEvent.dataTransfer;
dt.effectAllowed = 'move';
dt.setData('Text', 'dummy');
index = (dragging = $(this)).addClass('sortable-dragging').index();
}).on('dragend.h5s', function() {
if (!dragging) {
return;
}
dragging.removeClass('sortable-dragging').show();
placeholders.detach();
if (index != dragging.index()) {
dragging.parent().trigger('sortupdate', {item: dragging});
}
dragging = null;
}).not('a[href], img').on('selectstart.h5s', function() {
this.dragDrop && this.dragDrop();
return false;
}).end().add([this, placeholder]).on('dragover.h5s dragenter.h5s drop.h5s', function(e) {
if (!items.is(dragging) && options.connectWith !== $(dragging).parent().data('connectWith')) {
return true;
}
if (e.type == 'drop') {
e.stopPropagation();
placeholders.filter(':visible').after(dragging);
dragging.trigger('dragend.h5s');
return false;
}
e.preventDefault();
e.originalEvent.dataTransfer.dropEffect = 'move';
if (items.is(this)) {
if (options.forcePlaceholderSize) {
placeholder.height(dragging.outerHeight());
}
dragging.hide();
$(this)[placeholder.index() < $(this).index() ? 'after' : 'before'](placeholder);
placeholders.not(placeholder).detach();
} else if (!placeholders.is(this) && !$(this).children(options.items).length) {
placeholders.detach();
$(this).append(placeholder);
}
return false;
});
});
};
})(jQuery);

View File

@ -8,27 +8,26 @@
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
<link rel="apple-touch-icon" href="img/apple-icon/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="76x76" href="img/apple-icon/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="120x120" href="img/apple-icon/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="152x152" href="img/apple-icon/apple-touch-icon-152x152.png">
<link rel="shortcut icon" sizes="120x120" href="img/apple-icon/apple-touch-icon-120x120.png">
<link rel="shortcut icon" type="image/png" href="favicon.png"/>
<link rel="apple-touch-icon" href="/public/img/apple-icon/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="76x76" href="/public/img/apple-icon/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="120x120" href="/public/img/apple-icon/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="152x152" href="/public/img/apple-icon/apple-touch-icon-152x152.png">
<link rel="shortcut icon" sizes="120x120" href="/public/img/apple-icon/apple-touch-icon-120x120.png">
<link rel="shortcut icon" type="image/png" href="/public/favicon.png"/>
<title>mStream Media Player - All your media. Everywhere you go.</title>
<link rel="stylesheet" href="css/foundation.css" />
<link rel="stylesheet" href="css/master.css">
<link rel="stylesheet" href="css/radio.css">
<link rel="stylesheet" href="/public/css/foundation.css" />
<link rel="stylesheet" href="/public/css/master.css">
<link rel="stylesheet" href="/public/css/radio.css">
<script src="js/modernizr.js"></script>
<script src="/public/js/modernizr.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<!-- <script type="text/javascript" src="js/sortable.js"></script> -->
<script type="text/javascript" src="js/cookie.js"></script>
<script type="text/javascript" src="/public/js/cookie.js"></script>
@ -38,7 +37,7 @@
<!-- Sortable JS -->
<script src="https://unpkg.com/sortablejs@latest"></script>
<!-- https://github.com/SortableJS/Vue.Draggable - v2.6 -->
<script src="/public-shared/js/vue-sortable.js"></script>
<script src="/public/js/vue-sortable.js"></script>
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/8bit-wonder" type="text/css"/>
@ -47,28 +46,18 @@
DO NOT Change to order these are loaded in
You do not need to worry about how these work
-->
<script src="/public-shared/js/aurora.js"></script>
<script src="/public-shared/js/flac.js"></script>
<script src="/public-shared/js/howler.core.min.js"></script>
<script src="/public-shared/js/mstream.js"></script>
<script src="/public-shared/js/mstream.api.js"></script>
<!--
<script src="js/aurora.js"></script>
<script src="js/flac.js"></script>
<script src="paper-player/webcomponentsjs/webcomponents-lite.js"></script>
<link rel="import" href="paper-player/paper-audio-player/paper-audio-player.html"> -->
<script src="/public/js/aurora.js"></script>
<script src="/public/js/flac.js"></script>
<script src="/public/js/howler.core.min.js"></script>
<script src="/public/js/mstream.player.js"></script>
<script src="/public/js/mstream.api.js"></script>
<script type="text/javascript" src="js/mstream.js"></script>
<script type="text/javascript" src="/public/js/mstream.js"></script>
@ -140,7 +129,7 @@
},
computed: {
imgsrc: function () {
return "/public-shared/img/"+(this.status.playing ? 'pause' : 'play')+"-white.svg";
return "/public/img/"+(this.status.playing ? 'pause' : 'play')+"-white.svg";
}
}
});
@ -268,36 +257,6 @@
<script>
// function AVPlayerPlay(){
// console.log('FLAC PLAY FUNCTION CALLED');
//
// if(AVplayer.playing){
// console.log('WTF');
// return;
// }
//
// AVplayer.play();
// var event = new CustomEvent("playing", { "detail": "Example of an event" });
// // Dispatch/Trigger/Fire the event
// document.getElementById("audio").dispatchEvent(event);
// }
//
// function AVPlayerPause(){
// AVplayer.pause();
// var event = new CustomEvent("pause", { "detail": "Example of an event" });
// // Dispatch/Trigger/Fire the event
// document.getElementById("audio").dispatchEvent(event);
// }
</script>
</head>
<body>
@ -309,7 +268,7 @@
<div class="large-3 medium-3 small-1 columns"><p></p></div><!-- Empty <p> tag is necessary so the div doesn't get compressed into a smaller space -->
<div class="large-6 medium-6 small-10 columns">
<object class="login-icon" type="image/svg+xml" data="img/mstream-icon.svg">
<object class="login-icon" type="image/svg+xml" data="/public/img/mstream-icon.svg">
Your browser does not support SVG
</object>
<form id="login-form" method="post">
@ -361,7 +320,7 @@
</section>
<section class="right tab-bar-section">
<h1 class="title"><img src="img/mstream-logo.png" class="logo" alt="MStream" width="181" height="auto"></h1>
<h1 class="title"><img src="/public/img/mstream-logo.png" class="logo" alt="MStream" width="181" height="auto"></h1>
<div class="radio-group hide-for-small">
<input class="get_file_explorer" type="radio" id="radio1" name="radios" value="all" checked>
@ -412,8 +371,8 @@
<div class="large-6 medium-6 small-12 columns">
<div class="controls leftControls">
<a title="Add Directory to Playlist" class="add" id='addall'><img src="img/glyphicons/png/glyphicons_131_inbox_plus.png" alt="" width="27" height="27"></a><!-- Add Directory to Playlist -->
<!-- <a title="Download Directory" class="downloadDirectory" id='download'><img src="img/glyphicons/png/glyphicons_181_download_alt.png" alt="" width="27" height="27"></a> --><!-- Download Directory -->
<a title="Add Directory to Playlist" class="add" id='addall'><img src="/public/img/glyphicons/png/glyphicons_131_inbox_plus.png" alt="" width="27" height="27"></a><!-- Add Directory to Playlist -->
<!-- <a title="Download Directory" class="downloadDirectory" id='download'><img src="/public/img/glyphicons/png/glyphicons_181_download_alt.png" alt="" width="27" height="27"></a> --><!-- Download Directory -->
<!-- <div class="scraper">
<label for="scraper" id="getInfo" class="scrape">Get track info</label>
<input class="left" type="checkbox" id="scraper">
@ -423,10 +382,10 @@
</div><!-- /libraryHeaderContainer -->
<div class="clear flatline"></div>
<div id="directory_bar" class="clear directoryTitle">
<button class="backButton tiny"><img src="img/glyphicons/png/glyphicons_435_undo.png" alt="Back" width="15" height="15"></button>
<button class="backButton tiny"><img src="/public/img/glyphicons/png/glyphicons_435_undo.png" alt="Back" width="15" height="15"></button>
<h4 class="directoryName"></h4> <!-- Current Directory -->
<input id="search_folders" class="hide" >
<a title="Search" id="search-explorer" ><img src="img/glyphicons/search.png" alt="" width="27" height="27"></a>
<a title="Search" id="search-explorer" ><img src="/public/img/glyphicons/search.png" alt="" width="27" height="27"></a>
</div>
@ -448,9 +407,9 @@
<div class="large-6 medium-6 small-12 columns">
<div class="controls">
<a title="Clear Playlist" class="clear" id='clear'><img src="img/glyphicons/png/glyphicons_192_circle_remove.png" alt="" width="27" height="27"></a><!-- Clear Playlist -->
<a title="Download Playlist" class="downloadPlaylist" id="downloadPlaylist"><img src="img/glyphicons/png/glyphicons_181_download_alt.png" width="27" height="27"></a> <!-- Download Playlist -->
<a title="Save Playlist" class="save" data-reveal-id="savePlaylist" ><img src="img/glyphicons/png/glyphicons_443_floppy_disk.png" alt="" width="27" height="27"></a><!-- Save Playlist -->
<a title="Clear Playlist" class="clear" id='clear'><img src="/public/img/glyphicons/png/glyphicons_192_circle_remove.png" alt="" width="27" height="27"></a><!-- Clear Playlist -->
<a title="Download Playlist" class="downloadPlaylist" id="downloadPlaylist"><img src="/public/img/glyphicons/png/glyphicons_181_download_alt.png" width="27" height="27"></a> <!-- Download Playlist -->
<a title="Save Playlist" class="save" data-reveal-id="savePlaylist" ><img src="/public/img/glyphicons/png/glyphicons_443_floppy_disk.png" alt="" width="27" height="27"></a><!-- Save Playlist -->
</div>
</div>
</div>
@ -480,14 +439,12 @@
<div class="jplay col">
<div class ="row">
<div id="jp_container_1" class="jp-audio">
<!-- <paper-audio-player id="mplayer" src="" color="#6684B2" title="Welcome To mStream"></paper-audio-player> -->
<div class="mstream-player">
<div id="previous-button" class="previous-button">
<div class="previous-border">
<img class="previous-image" src="/public-shared/img/previous-white.svg">
<img class="previous-image" src="/public/img/previous-white.svg">
</div>
</div>
@ -499,7 +456,7 @@
<div id="next-button" class="next-button">
<div class="next-border">
<img class="mext-image" src="/public-shared/img/next-white.svg">
<img class="mext-image" src="/public/img/next-white.svg">
</div>
</div>
@ -511,19 +468,15 @@
<div class="pbar" :style="widthcss"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<!-- <div class="row">
<div class="jplayX">
</div>
</div>
</div> -->
</div>
@ -542,7 +495,7 @@
</div>
</div>
<script src="js/foundation.min.js"></script>
<script src="/public/js/foundation.min.js"></script>
<script>
$(document).foundation();
</script>

View File

@ -1,6 +1,6 @@
<head>
<!-- mStream CSS -->
<link rel="stylesheet" href="/public-shared/css/shared.css">
<link rel="stylesheet" href="/public/css/shared.css">
<!-- Pure CSS -->
<link rel="stylesheet" href="https://unpkg.com/purecss@0.6.1/build/pure-min.css" integrity="sha384-CCTZv2q9I9m3UOxRLaJneXrrqKwUNOzZ6NGEUMwHtShDJ+nCoiXJCAgi05KfkLGY" crossorigin="anonymous">
@ -9,7 +9,7 @@
<!-- Sortable JS -->
<script src="https://unpkg.com/sortablejs@latest"></script>
<!-- https://github.com/SortableJS/Vue.Draggable - v2.6 -->
<script src="/public-shared/js/vue-sortable.js"></script>
<script src="/public/js/vue-sortable.js"></script>
<link rel="stylesheet" media="screen" href="https://fontlibrary.org/face/8bit-wonder" type="text/css"/>
@ -18,11 +18,11 @@
DO NOT Change to order these are loaded in
You do not need to worry about how these work
-->
<script src="/public-shared/js/aurora.js"></script>
<script src="/public-shared/js/flac.js"></script>
<script src="/public-shared/js/howler.core.min.js"></script>
<script src="/public-shared/js/mstream.js"></script>
<script src="/public-shared/js/mstream.api.js"></script>
<script src="/public/js/aurora.js"></script>
<script src="/public/js/flac.js"></script>
<script src="/public/js/howler.core.min.js"></script>
<script src="/public/js/mstream.player.js"></script>
<script src="/public/js/mstream.api.js"></script>
<!-- Look at this for an example of how to use the mStream Player -->
@ -90,7 +90,7 @@
},
computed: {
imgsrc: function () {
return "/public-shared/img/"+(this.status.playing ? 'pause' : 'play')+"-white.svg";
return "/public/img/"+(this.status.playing ? 'pause' : 'play')+"-white.svg";
}
}
});
@ -221,7 +221,7 @@
<!-- Header -->
<div class="header">
<div class="logo-box">
<img class="mstream-image" src="/public-shared/img/mstream-logo.svg">
<img class="mstream-image" src="/public/img/mstream-logo.svg">
</div>
</div>
@ -247,7 +247,7 @@
<div class="mstream-player">
<div id="previous-button" class="previous-button">
<div class="previous-border">
<img class="previous-image" src="/public-shared/img/previous-white.svg">
<img class="previous-image" src="/public/img/previous-white.svg">
</div>
</div>
@ -259,7 +259,7 @@
<div id="next-button" class="next-button">
<div class="next-border">
<img class="mext-image" src="/public-shared/img/next-white.svg">
<img class="mext-image" src="/public/img/next-white.svg">
</div>
</div>