コード例 #1
0
ファイル: controller.js プロジェクト: inverse/web-scrobbler
		/**
		 * Reset controller state.
		 */
		resetState() {
			this.playbackTimer.reset();
			this.replayDetectionTimer.reset();

			if (this.currentSong !== null) {
				this.clearNowPlayingNotification();
			}
			this.currentSong = null;
		}
コード例 #2
0
ファイル: controller.js プロジェクト: inverse/web-scrobbler
		/**
		 * Make the controller to ignore current song.
		 */
		skipCurrentSong() {
			if (!this.currentSong) {
				return;
			}

			this.pageAction.setSongSkipped(this.currentSong);

			this.currentSong.flags.isSkipped = true;

			this.playbackTimer.reset();
			this.replayDetectionTimer.reset();

			this.clearNowPlayingNotification();
		}
コード例 #3
0
ファイル: controller.js プロジェクト: inverse/web-scrobbler
		/** Public functions */

		/**
		 * Switch the state of controller.
		 * @param {Boolean} flag True means enabled and vice versa
		 */
		setEnabled(flag) {
			this.isEnabled = flag;

			if (flag) {
				this.pageAction.setSiteSupported();
			} else {
				this.pageAction.setSiteDisabled();
			}

			if (!flag && this.currentSong) {
				this.playbackTimer.reset();
				this.replayDetectionTimer.reset();

				this.clearNowPlayingNotification();
			}
		}