Skip to content

Commit

Permalink
Merge branch 'release/1.12.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphiiko committed Apr 4, 2024
2 parents 99cb5a9 + 2cdd87e commit ab1a9a0
Show file tree
Hide file tree
Showing 30 changed files with 65 additions and 202 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.12.4]

### Fixed

- VRChat microphone mute automations blocking keyboard- and controller bindings from toggling the microphone mute state.

## [1.12.3]

### Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oyasumi",
"version": "1.12.3",
"version": "1.12.4",
"author": "Raphiiko",
"license": "MIT",
"type": "module",
Expand Down
4 changes: 2 additions & 2 deletions src-core/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumivr"
version = "1.12.3"
version = "1.12.4"
description = ""
authors = ["Raphiiko"]
license = "MIT"
Expand Down
14 changes: 11 additions & 3 deletions src-core/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ use log::{info, warn, LevelFilter};
use oyasumivr_shared::windows::is_elevated;
use serde_json::json;
use tauri::{plugin::TauriPlugin, AppHandle, Manager, Wry};
use tauri_plugin_aptabase::EventTracker;
use tauri_plugin_log::{LogTarget, RotationStrategy};

fn main() {
Expand Down Expand Up @@ -71,10 +72,17 @@ fn main() {
.system_tray(system_tray::init_system_tray())
.on_system_tray_event(system_tray::handle_system_tray_events())
.on_window_event(system_tray::handle_window_events())
.invoke_handler(configure_command_handlers());
// Run Oyasumi
app.run(tauri::generate_context!())
.invoke_handler(configure_command_handlers())
.build(tauri::generate_context!())
.expect("An error occurred while running the application");
// Run OyasumiVR
app.run(|handler, event| match event {
tauri::RunEvent::Exit { .. } => {
handler.track_event("app_exited", None);
handler.flush_events_blocking();
}
_ => {}
})
}

async fn load_configs() {
Expand Down
6 changes: 3 additions & 3 deletions src-core/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"package": {
"productName": "OyasumiVR",
"version": "1.12.3"
"version": "1.12.4"
},
"tauri": {
"allowlist": {
Expand Down Expand Up @@ -188,7 +188,7 @@
"center": true,
"theme": "Dark",
"transparent": true,
"userAgent": "OyasumiVR/1.12.3 (https://github.com/Raphiiko/OyasumiVR)"
"userAgent": "OyasumiVR/1.12.4 (https://github.com/Raphiiko/OyasumiVR)"
},
{
"width": 700,
Expand All @@ -200,7 +200,7 @@
"center": true,
"theme": "Dark",
"transparent": true,
"userAgent": "OyasumiVR/1.12.3 (https://github.com/Raphiiko/OyasumiVR)"
"userAgent": "OyasumiVR/1.12.4 (https://github.com/Raphiiko/OyasumiVR)"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion src-elevated-sidecar/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumivr-elevated-sidecar"
version = "1.12.3"
version = "1.12.4"
authors = ["Raphiiko"]
license = "MIT"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion src-overlay-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "oyasumivr-overlay-ui",
"version": "1.12.3",
"version": "1.12.4",
"private": true,
"scripts": {
"dev": "vite dev",
Expand Down
2 changes: 1 addition & 1 deletion src-shared-rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oyasumivr-shared"
version = "1.12.3"
version = "1.12.4"
authors = ["Raphiiko"]
edition = "2021"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src-shared-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "src-shared-ts",
"description": "Shared typescript code for Oyasumi modules",
"scripts": {},
"version": "1.12.3",
"version": "1.12.4",
"author": "Raphiiko",
"license": "MIT",
"type": "module",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h3>Navigation</h3>
<div class="row">
<button class="btn btn-secondary" (click)="navigateTo(['translation'])"
>Translation Module
>Translation Module
</button>
</div>
<h3>Actions</h3>
Expand All @@ -11,22 +11,17 @@ <h3>Actions</h3>
<h3>Notification Sounds</h3>
<div class="row">
<button class="btn btn-secondary" (click)="playSound('notification_bell')"
>notification_bell
>notification_bell
</button>
<button class="btn btn-secondary" (click)="playSound('notification_block')"
>notification_block
>notification_block
</button>
<button class="btn btn-secondary" (click)="playSound('mic_mute')">mic_mute</button>
<button class="btn btn-secondary" (click)="playSound('mic_unmute')">mic_unmute</button>
<app-slider-setting [(value)]="soundVolume" [max]="200"></app-slider-setting>
</div>
<h3>VRChat microphone muting</h3>
<p>Muted: {{ automation.muted | async }}</p>
<p>Mode: {{ automation.mode | async }}</p>
<button class="btn btn-primary" (click)="automation.toggleMute()">Toggle</button>
<button class="btn btn-primary" (click)="automation.setMute(true)">Mute</button>
<button class="btn btn-primary" (click)="automation.setMute(false)">Unmute</button>
<button class="btn btn-secondary" (click)="automation.setMode('TOGGLE')">Set Toggle Mode</button>
<button class="btn btn-secondary" (click)="automation.setMode('PUSH_TO_MUTE')"
>Set Push To Mute Mode
</button>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export class EventLogBSBLedChangedEntryParser extends EventLogEntryParser<EventL
return 'bsbLedChanged';
}

override headerInfoTitle(entry: EventLogBSBLedChanged): string {
override headerInfoTitle(): string {
return 'comp.event-log-entry.type.bsbLedChanged.title';
}

Expand Down
7 changes: 7 additions & 0 deletions src-ui/app/migrations/automation-configs.migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const migrations: { [v: number]: (data: any) => any } = {
11: from10to11,
12: from11to12,
13: from12to13,
14: from13to14,
};

export function migrateAutomationConfigs(data: any): AutomationConfigs {
Expand Down Expand Up @@ -52,6 +53,12 @@ function resetToLatest(data: any): any {
return data;
}

function from13to14(data: any): any {
data.version = 14;
delete data['VRCHAT_MIC_MUTE_AUTOMATIONS'].mode;
return data;
}

function from12to13(data: any): any {
data.version = 13;
[
Expand Down
8 changes: 3 additions & 5 deletions src-ui/app/models/automations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export type AutomationType =
| 'BIGSCREEN_BEYOND_RGB_CONTROL';

export interface AutomationConfigs {
version: 13;
version: 14;
GPU_POWER_LIMITS: GPUPowerLimitsAutomationConfig;
MSI_AFTERBURNER: MSIAfterburnerAutomationConfig;
// SLEEP MODE AUTOMATIONS
Expand Down Expand Up @@ -241,11 +241,10 @@ export interface SleepingAnimationsAutomationConfig extends AutomationConfig {
footLockReleaseWindow: number;
}

export type VRChatVoiceMode = 'TOGGLE' | 'PUSH_TO_MUTE';
export type VRChatVoiceMode = 'TOGGLE' | 'PUSH_TO_TALK';
export type VRChatMicMuteStateOption = 'MUTE' | 'UNMUTE' | 'NONE';

export interface VRChatMicMuteAutomationsConfig extends AutomationConfig {
mode: VRChatVoiceMode;
onSleepModeEnable: VRChatMicMuteStateOption;
onSleepModeDisable: VRChatMicMuteStateOption;
onSleepPreparation: VRChatMicMuteStateOption;
Expand Down Expand Up @@ -379,7 +378,7 @@ export interface BigscreenBeyondRgbControlAutomationsConfig extends AutomationCo
//

export const AUTOMATION_CONFIGS_DEFAULT: AutomationConfigs = {
version: 13,
version: 14,
// BRIGHTNESS AUTOMATIONS
BRIGHTNESS_CONTROL_ADVANCED_MODE: {
enabled: false,
Expand Down Expand Up @@ -535,7 +534,6 @@ export const AUTOMATION_CONFIGS_DEFAULT: AutomationConfigs = {
},
VRCHAT_MIC_MUTE_AUTOMATIONS: {
enabled: true,
mode: 'TOGGLE',
onSleepModeEnable: 'NONE',
onSleepModeDisable: 'NONE',
onSleepPreparation: 'NONE',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class HardwareBrightnessControlService {
public readonly brightnessStream: Observable<number> = this._brightness.asObservable();

constructor(
private openvr: OpenVRService,
openvr: OpenVRService,
private appSettingsService: AppSettingsService // private bsbFanAutomationService: BigscreenBeyondFanAutomationService
) {
this.driverValveIndex = new ValveIndexHardwareBrightnessControlDriver(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ export class SimpleBrightnessControlService {
// Set brightness when the hardware brightness driver availability changes
this.hardwareBrightnessControl.driverIsAvailable
.pipe(
skip(1),
distinctUntilChanged(),
tap((available) => (this.hardwareBrightnessDriverAvailable = available)),
filter(() => !this._advancedMode.value)
filter(() => !this._advancedMode.value),
skip(1),
distinctUntilChanged()
)
.subscribe(() => {
this.setBrightness(this.brightness, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { Injectable } from '@angular/core';
import { OscService } from '../osc.service';
import {
BehaviorSubject,
debounceTime,
delay,
filter,
firstValueFrom,
Expand All @@ -17,7 +16,6 @@ import { AutomationConfigService } from '../automation-config.service';
import {
AUTOMATION_CONFIGS_DEFAULT,
VRChatMicMuteAutomationsConfig,
VRChatVoiceMode,
} from '../../models/automations';
import { cloneDeep, isArray } from 'lodash';
import { SleepService } from '../sleep.service';
Expand All @@ -36,10 +34,6 @@ const WRITE_ADDR = '/input/Voice';
export class VRChatMicMuteAutomationService {
private _muted = new BehaviorSubject<boolean | null>(null);
public muted = this._muted.asObservable();
private _mode = new BehaviorSubject<VRChatVoiceMode>(
AUTOMATION_CONFIGS_DEFAULT.VRCHAT_MIC_MUTE_AUTOMATIONS.mode
);
public mode = this._mode.asObservable();
private config: VRChatMicMuteAutomationsConfig = cloneDeep(
AUTOMATION_CONFIGS_DEFAULT.VRCHAT_MIC_MUTE_AUTOMATIONS
);
Expand All @@ -58,7 +52,6 @@ export class VRChatMicMuteAutomationService {

this.automationConfigs.configs.subscribe((configs) => {
this.config = configs.VRCHAT_MIC_MUTE_AUTOMATIONS;
this._mode.next(this.config.mode);
});
// Listen for the muted state
this.osc.messages.subscribe((message) => {
Expand Down Expand Up @@ -131,53 +124,28 @@ export class VRChatMicMuteAutomationService {
});
// In case the muted state is not known (This happens when OyasumiVR is launched after VRChat is already active)
// We poll the muted state through OSCQuery every 3 seconds, until it is known.
merge(interval(3000), this._mode.pipe(skip(1)))
merge(interval(3000))
.pipe(
debounceTime(100),
filter(() => this._muted.value === null),
switchMap(() => this.fetchMutedState())
)
.subscribe();
}

async setMode(mode: VRChatVoiceMode) {
await this.automationConfigs.updateAutomationConfig<VRChatMicMuteAutomationsConfig>(
'VRCHAT_MIC_MUTE_AUTOMATIONS',
{
mode,
}
);
}

async toggleMute(ensureStateKnown = true) {
if (ensureStateKnown && !(await this.fetchMutedState())) return;
switch (this._mode.value) {
case 'TOGGLE':
await this.osc.send_int(WRITE_ADDR, 0);
await firstValueFrom(of(null).pipe(delay(150)));
await this.osc.send_int(WRITE_ADDR, 1);
await firstValueFrom(of(null).pipe(delay(150)));
break;
case 'PUSH_TO_MUTE':
await this.osc.send_int(WRITE_ADDR, this._muted.value ? 0 : 1);
await firstValueFrom(of(null).pipe(delay(150)));
break;
}
await this.osc.send_int(WRITE_ADDR, 0);
await firstValueFrom(of(null).pipe(delay(150)));
await this.osc.send_int(WRITE_ADDR, 1);
await firstValueFrom(of(null).pipe(delay(150)));
await this.osc.send_int(WRITE_ADDR, 0);
await firstValueFrom(of(null).pipe(delay(150)));
}

async setMute(state: boolean) {
switch (this._mode.value) {
case 'TOGGLE':
if (this._muted.value !== state) {
if (this._muted.value !== null) this._muted.next(state);
await this.toggleMute(false);
}
break;
case 'PUSH_TO_MUTE':
if (this._muted.value !== null) this._muted.next(state);
await this.osc.send_int(WRITE_ADDR, state ? 0 : 1);
await firstValueFrom(of(null).pipe(delay(150)));
break;
if (this._muted.value !== state) {
if (this._muted.value !== null) this._muted.next(state);
await this.toggleMute(false);
}
}

Expand Down
4 changes: 1 addition & 3 deletions src-ui/app/services/telemetry.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import {
} from 'rxjs';
import { TELEMETRY_SETTINGS_DEFAULT, TelemetrySettings } from '../models/telemetry-settings';
import { migrateTelemetrySettings } from '../migrations/telemetry-settings.migrations';
import { HttpClient } from '@angular/common/http';
import { cloneDeep } from 'lodash';
import { AppSettingsService } from './app-settings.service';
import { invoke } from '@tauri-apps/api';
import { trackEvent } from '@aptabase/tauri';

Expand All @@ -28,7 +26,7 @@ export class TelemetryService {
);
public settings: Observable<TelemetrySettings> = this._settings.asObservable();

constructor(private http: HttpClient, private appSettings: AppSettingsService) {}
constructor() {}

async init() {
await this.loadSettings();
Expand Down
Loading

0 comments on commit ab1a9a0

Please sign in to comment.