<commit_before><template>
	<div class="panel sources-panel">
		<div class="scene" v-if="currentScene">
			<h3 class="scene-name" v-text="currentScene.name"></h3>

			<div class="sources">
				<button class="source"
				        v-for="source in currentScene.sources" :key="source.name"
				        :class="{ active: source.render }" v-text="source.name"
				        @click="toggleSource(currentScene.name, source.name, !source.render)">
				</button>
			</div>
		</div>
	</div>
</template>

<script>
	import OBSUserMixin from '../../mixins/obs-user'

	export default {
		computed: {
			currentScene() {
				return this.obs.scenes.find(scene => {
					return scene.name === this.obs.currentScene
				})
			}
		},

		methods: {
			isCurrentScene(scene) {
				return scene.name === this.obs.currentScene
			},

			async toggleSource(scene, source, render) {
				await this.$obs.setSourceRender(scene, source, render)
				// No automatic update as of obs-websocket 0.3.1
				this.$emit('force-refresh')
			}
		},

		mixins: [OBSUserMixin],

		props: {
			obs: Object,
			settings: Object
		}
	}
</script>
<commit_msg>Add scene selector to sources panel<commit_after><template>
	<div class="panel sources-panel">
		<div class="scene" v-if="currentScene">
			<!--<h3 class="scene-name" v-text="currentScene.name"></h3>-->
			<div class="scene-name">
				<select v-model="currentScene">
					<option v-for="scene in this.obs.scenes" v-bind:value="scene">{{ scene.name }}</option>
				</select>
                        </div>

			<div class="sources">
				<button class="source"
				        v-for="source in currentScene.sources" :key="source.name"
				        :class="{ active: source.render }" v-text="source.name"
				        @click="toggleSource(currentScene.name, source.name, !source.render)">
				</button>
			</div>
		</div>
	</div>
</template>

<script>
	import OBSUserMixin from '../../mixins/obs-user'

	export default {
		methods: {
			isCurrentScene(scene) {
				return scene.name === this.obs.currentScene
			},

			async toggleSource(scene, source, render) {
				await this.$obs.setSourceRender(scene, source, render)
				// No automatic update as of obs-websocket 0.3.1
				this.$emit('force-refresh')
			}
		},

		mixins: [OBSUserMixin],

		props: {
			obs: Object,
			settings: Object,
			selectedScene: Object
		}
	}
</script>

{'fraction_non_alphanumeric': 0.1681643132220796, 'fraction_numerical': 0.004278990158322636, 'mean_word_length': 2.982964224872232, 'pattern_counts': {'":': 0, '<': 38, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3098088', 'n_tokens_mistral': 928, 'n_tokens_neox': 771, 'n_words': 159}