How to enable the DAPM widgets manually in ALSA? - linux-kernel

How to enable the DAPM widgets manually in ALSA?
Like writing something into somewhere should enable that DAPM widget and it related calls into the codec driver should happen.
Is there anything that we can do like this?
Eg:
For gpio stuff we can write something into some debugfs files and can control the gpio.
I am looking for something like this in ALSA DAPM
Note: I know setting the mixer controls and completing the path can power up the widgets

Related

How to attach all tap dev by cilium/ebpf ? What's the best way except attach tap dev one by one if it is not support?

How to attach all tap dev by cilium/ebpf ? What's the best way except attach tap dev one by one if it is not support ?
I read document not found mutil attach function.
As of the writing of this answer, there is no way to attach XDP/TC programs to multiple network devices within a single "call".
I believe the only program type where something like this is possible is with kprobes.
So you will have to list all devices and attach one by one.

Notification/subscription method for Windows 10 theme change

As yolu may have noticed, MS introduced a modern kind of 'theming' in Windows 10 regarding the basic OS elements like start menu and taskbar. With newer versions, you can choose a 'light' theme as an alternative to the default black theme.
I was wondering if there is an API or hook to elegantly and (more importantly) efficiently check live for theme changes (Did not find anything in the MS docs regarding this, but often enough these gems are pretty hidden there IMHO).
Specific problem: When you have a desktop application with a system tray icon, chances are high that you designed it to be bright. Nearly all of the modern Windows icons feature such a style (simple and white, yielding good readability on the black taskbar). Now you can provide a different version in a darker style for the light theme, but how to notice when to apply this on the fly?
I'm aware of the registry key under HCU (Software/Microsoft/Windows/CurrentVersion/Themes/Personalize) which is what I'm utilizing right now. However, blindly checking for change every x milliseconds seems pretty awkward.
If no such thing is available, I'm also happy to hear some ideas for more efficient implementations of such a check.
Method 1: Use RegNotifyChangeKeyValue
Notifies the caller about changes to the attributes or contents of a
specified registry key.
Methon 2: Use WM_SETTINGCHANGE
Applications should send WM_SETTINGCHANGE to all top-level windows when they make changes to system parameters. (This message cannot be sent directly to a window.) To send the WM_SETTINGCHANGE message to all top-level windows, use the SendMessageTimeout function with the hwnd parameter set to HWND_BROADCAST.
I tend to use the second method, I have tried, and have been able to work successfully.
Minimum code example:
case WM_SETTINGCHANGE:
{
if (!lstrcmp(LPCTSTR(lParam), L"ImmersiveColorSet"))
{
//theme has been changed
}
}

Linking xcos and scilab gui for real time control of model parameters

I am a scilab/xcos newbee. I have a model with multiple parameters I would like to change the block parameters in real time (seen on a real time graph). So I would like the functionality of the TK scale block for multiple parameters within a gui format. At the moment I have a gui which can adjust parameters, but changes to the parameters only take affect when I restart the simulation (as they are only updated once the simulation is finished running).
I have tried to use set_param but I am not sure it is the right tool for the job. It doesn't seem to access my xcos parameters.
Is it possible to control the parameters of an xcos model in real time with the slider and radio button functionality of a gui? How do I update my variables while the simulation is still running?
Thanks in advance.
SciLab/ScicosLab is certainly capable of creating interactive/responsive GUIs ( which you are refering to as "real-time"). Take a look at uicontrol module to learn how it should be implemented. To see some demos pleas run demo_gui() in the console and in the opened window go to the GUI section. For example:
A nice example can be found here and more examples here.
There is also the GUI Builder if you prefer a GUI drag and drop development environment

Create Transparent Windows in Haxe (Neko or Windows targets)

Im trying to make a simple OSX-like dock application using Haxe 3.1.3. I cant seem to work out how to make the main application window transparent (no titlebars, borders etc), as well as ignoring mouse events except on the icons themselves. Ideally no taskbar item either, just a system tray item.
I believe Haxe Windows target uses SDL, and am pretty sure that SDL can support this kind of behaviour? Im not sure how Neko target is compiled, or handles this... Is there some flags I can set in the Haxe application.xml or something like that? Or is this just not possible with the Haxe Windows or Neko targets?
EDIT
I Discovered that the Waxe haxelib, which can be compiled with Neko, has a bunch of flags in the Window.hx file - https://github.com/nmehost/waxe/blob/cd9739e007ed10918166588faf2339d623b22fc4/wx/Window.hx
These include such options as FRAME_NO_TASKBAR and BORDER_DOUBLE, which both work when passed as arguments to the wx.Frame.create() function in the Simple.hx Waxe sample project.
It also includes the flag TRANSPARENT_WINDOW, but this appears to do nothing. No idea why the other flags are working, but the TRANSPARENT_WINDOW flag doesnt.
In Openfl (it's openfl which uses sdl and a xml project), you can remove the window border with this in your application.xml:
<window borderless="true"/>
But I don't know a way to move the window without borders.
relevant discussion:
http://www.openfl.org/forums/#!/general:moving-borderless-windows

Detect external window update

I would like to detect when an external window is updated|redrawn. In other words, I want to catch some kind of an event whenever a specified window (not of my app) changes its content (e.g. by updating nested image, displaying new text message, layout change etc.). This question applies both to X11/GTK and win32 based systems. Do you know any way to achieve this?
With X11 you need to use Damage extension - DamageCreate / DamageSubtract requests and DamageNotify event. Not sure about gtk api ( Ideally there should be wrapper around X11/Damage and win32 but not sure if it exist ) - try to look at damage-event

Resources