diff options
Diffstat (limited to 'native-app')
-rwxr-xr-x | native-app/index.js | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/native-app/index.js b/native-app/index.js index 2f174ea..16ef810 100755 --- a/native-app/index.js +++ b/native-app/index.js @@ -1,28 +1,24 @@ #!/usr/bin/env node -const basePath = '/home/florrie/Documents/interactive-bgm'; - -const logFile = basePath + '/native-app/log'; - -const log = msg => { - require('fs').appendFileSync(logFile, msg + '\n'); -}; - - -log('Started ' + Date()); - const { spawn } = require('child_process'); const EventEmitter = require('events'); const FIFO = require('fifo-js'); const http = require('http'); +const path = require('path'); +const fs = require('fs'); -log('Loaded modules'); +const basePath = path.resolve(__dirname, '..'); +const logFile = basePath + '/native-app/log'; +const log = msg => fs.appendFileSync(logFile, msg + '\n'); + +log('Started ' + Date()); class TrackPlayer { constructor(file) { this.file = file; this.volume = 0; this.storedVolume = this.volume; + log('Created track: ' + file); } loadProcess() { |