@Override
	public void run() {
		long previousTime = System.currentTimeMillis();
		long currentTime = previousTime;

		if (soundSystem == null) {
			errorMessage("SoundSystem was null in method run().", 0);
			cleanup();
			return;
		}

		// Start out asleep:
		snooze(3600000);

		while (!dying()) {
			// Perform user-specific source management:
			soundSystem.ManageSources();

			// Process all queued commands:
			soundSystem.CommandQueue(null);

			// Remove temporary sources every ten seconds:
			currentTime = System.currentTimeMillis();
			if ((!dying()) && ((currentTime - previousTime) > 10000)) {
				previousTime = currentTime;
				soundSystem.removeTemporarySources();
			}

			// Wait for more commands:
			if (!dying())
				snooze(3600000);
		}

		cleanup(); // Important!
	}