Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

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

6 changes: 5 additions & 1 deletion apps/desktop/src/components/main/body/sessions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ function TabContentNoteInner({
<StatusBanner
skipReason={skipReason}
showConsentBanner={showConsentBanner}
showTimeline={showTimeline}
/>
</>
);
Expand All @@ -272,9 +273,11 @@ function TabContentNoteInner({
function StatusBanner({
skipReason,
showConsentBanner,
showTimeline,
}: {
skipReason: string | null;
showConsentBanner: boolean;
showTimeline: boolean;
}) {
const { leftsidebar, chat } = useShell();
const [chatPanelWidth, setChatPanelWidth] = useState(0);
Expand Down Expand Up @@ -329,9 +332,10 @@ function StatusBanner({
transition={{ duration: 0.3, ease: "easeOut" }}
style={{ left: `calc(50% + ${totalOffset}px)` }}
className={cn([
"fixed -translate-x-1/2 bottom-6 z-50",
"fixed -translate-x-1/2 z-50",
"whitespace-nowrap text-center text-xs",
skipReason ? "text-red-400" : "text-stone-300",
showTimeline ? "bottom-[76px]" : "bottom-6",
])}
>
{skipReason || "Ask for consent when using Hyprnote"}
Expand Down
2 changes: 0 additions & 2 deletions apps/web/src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2583,8 +2583,6 @@ declare module '@tanstack/react-router' {
fullPath: '/api/admin/kanban/create'
preLoaderRoute: typeof ApiAdminKanbanCreateRouteImport
parentRoute: typeof rootRouteImport
}
parentRoute: typeof rootRouteImport
}
'/api/admin/import/google-docs': {
id: '/api/admin/import/google-docs'
Expand Down
3 changes: 2 additions & 1 deletion crates/audio-device/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ cidre = { workspace = true, features = ["av"] }
libpulse-binding = "2.30.1"

[target.'cfg(target_os = "windows")'.dependencies]
windows = { version = "0.58", features = ["Win32_Media_Audio", "Win32_System_Com", "Win32_UI_Shell_PropertiesSystem", "Win32_Devices_FunctionDiscovery"] }
windows = { version = "0.58", features = ["Win32_Media_Audio", "Win32_Media_Audio_Endpoints", "Win32_System_Com", "Win32_UI_Shell_PropertiesSystem", "Win32_Devices_FunctionDiscovery"] }
windows-core = "0.58"

[dev-dependencies]
tokio = { workspace = true, features = ["rt", "macros"] }
20 changes: 8 additions & 12 deletions crates/audio-device/src/windows.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
use std::os::windows::ffi::OsStringExt;
use windows::Win32::Devices::FunctionDiscovery::PKEY_Device_FriendlyName;
use windows::Win32::Media::Audio::{
DEVICE_STATE_ACTIVE, Endpoints, IAudioEndpointVolume, IMMDevice, IMMDeviceEnumerator,
MMDeviceEnumerator, eAll, eCapture, eConsole, eRender,
DEVICE_STATE_ACTIVE, IMMDevice, IMMDeviceEnumerator, MMDeviceEnumerator, eAll, eCapture,
eConsole, eRender,
};
use windows::Win32::Media::Audio::Endpoints::IAudioEndpointVolume;
use windows::Win32::System::Com::{
CLSCTX_ALL, COINIT_MULTITHREADED, CoCreateInstance, CoInitializeEx, CoUninitialize, STGM_READ,
};
Expand Down Expand Up @@ -78,7 +79,7 @@
impl ComGuard {
fn new() -> Result<Self, Error> {
unsafe {
CoInitializeEx(None, COINIT_MULTITHREADED).map_err(|e| {
CoInitializeEx(None, COINIT_MULTITHREADED).ok().map_err(|e| {
Error::AudioSystemError(format!("COM initialization failed: {}", e))
})?;
}
Expand Down Expand Up @@ -122,18 +123,12 @@
.GetValue(&PKEY_Device_FriendlyName)
.map_err(|e| Error::EnumerationFailed(format!("Failed to get device name: {}", e)))?;

let name = prop.Anonymous.Anonymous.Anonymous.pwszVal;
if name.is_null() {
let name = prop.to_string();
if name.is_empty() {
return Err(Error::EnumerationFailed("Device name is null".into()));
}

let len = (0..).take_while(|&i| *name.add(i) != 0).count();
let slice = std::slice::from_raw_parts(name, len);
let os_string = OsString::from_wide(slice);

os_string
.into_string()
.map_err(|_| Error::EnumerationFailed("Invalid device name encoding".into()))
Ok(name)
}
}

Expand Down Expand Up @@ -355,6 +350,7 @@
for role in 0..3u32 {
policy_config
.SetDefaultEndpoint(PCWSTR(device_id_wide.as_ptr()), role)
.ok()
.map_err(|e| {
Error::SetDefaultFailed(format!("Failed to set default endpoint: {}", e))
})?;
Expand Down Expand Up @@ -498,7 +494,7 @@
})?;

volume_control
.SetMute(muted.into(), std::ptr::null())

Check failure on line 497 in crates/audio-device/src/windows.rs

View workflow job for this annotation

GitHub Actions / desktop_ci (windows, windows-latest)

type annotations needed
.map_err(|e| Error::AudioSystemError(format!("Failed to set mute state: {}", e)))?;

Ok(())
Expand Down
Loading