index.js
function Playback (deviceIndex, displayMode, pixelFormat) {
  this.index = 0;
  this.deviceIndex = deviceIndex;
  this.displayMode = displayMode;
  this.pixelFormat = pixelFormat;
  this.running = true;
  this.emergencyBrake = null;
  if (arguments.length !== 3 || typeof deviceIndex !== 'number' ||
      typeof displayMode !== 'number' || typeof pixelFormat !== 'number' ) {
    this.emit('error', new Error('Playback requires three number arguments: ' +
      'index, display mode and pixel format'));
  } else {
    this.playback = macadamNative.playback({
      deviceIndex: deviceIndex,
      displayMode: displayMode,
      pixelFormat: pixelFormat
    }).catch(err => { this.emit('error', err); });
    /* process.on('exit', function () {
      console.log('Exiting node.');
      if (this.emergencyBrake) this.emergencyBrake.stop();
      this.running = false;
      process.exit(0);
    }); */
    process.on('SIGINT', () => {
      console.log('Received SIGINT.');
      if (this.emergencyBrake) this.emergencyBrake.stop();
      this.running = false;
      process.exit();
    });
  }

  EventEmitter.call(this);
}
function Playback (deviceIndex, displayMode, pixelFormat) {
  this.index = 0;
  this.deviceIndex = deviceIndex;
  this.displayMode = displayMode;
  this.pixelFormat = pixelFormat;
  this.running = true;
  this.emergencyBrake = null;
  if (arguments.length !== 3 || typeof deviceIndex !== 'number' ||
      typeof displayMode !== 'number' || typeof pixelFormat !== 'number' ) {
    this.emit('error', new Error('Playback requires three number arguments: ' +
      'index, display mode and pixel format'));
  } else {
    this.playback = macadamNative.playback({
      deviceIndex: deviceIndex,
      displayMode: displayMode,
      pixelFormat: pixelFormat
    }).catch(err => { this.emit('error', err); });
    /* process.on('exit', function () {
      console.log('Exiting node.');
      if (this.emergencyBrake) this.emergencyBrake.stop();
      this.running = false;
      process.exit(0);
    }); */
    process.on('SIGINT', () => {
      console.log('Received SIGINT.');
      if (this.emergencyBrake) this.emergencyBrake.stop();
      this.running = false;
      process.exit();
    });
  }

  EventEmitter.call(this);
}
function Playback ( deviceIndex , displayMode , pixelFormat ) { this . index = 0 ; this . deviceIndex = deviceIndex ; this . displayMode = displayMode ; this . pixelFormat = pixelFormat ; this . running = true ; this . emergencyBrake = null ; if ( arguments . length !== 3 || typeof deviceIndex !== 'number' || typeof displayMode !== 'number' || typeof pixelFormat !== 'number' ) { this . emit ( 'error' , new Error ( 'Playback requires three number arguments: ' + 'index, display mode and pixel format' ) ) ; } else { this . playback = macadamNative . playback ( { deviceIndex : deviceIndex , displayMode : displayMode , pixelFormat : pixelFormat } ) . catch ( err => { this . emit ( 'error' , err ) ; } ) ; /* process.on('exit', function () {
      console.log('Exiting node.');
      if (this.emergencyBrake) this.emergencyBrake.stop();
      this.running = false;
      process.exit(0);
    }); */ process . on ( 'SIGINT' , ( ) => { console . log ( 'Received SIGINT.' ) ; if ( this . emergencyBrake ) this . emergencyBrake . stop ( ) ; this . running = false ; process . exit ( ) ; } ) ; } EventEmitter . call ( this ) ; }
Playback class is deprecated
Playback class is deprecated