This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn set_param(&self, id: spa::param::ParamType, flags: u32, param: &[u8]) { | |
unsafe { | |
spa_interface_call_method!( | |
self.proxy.as_ptr(), | |
pw_sys::pw_node_methods, | |
set_param, | |
id.as_raw(), | |
flags, | |
param.as_ptr() as *const spa::sys::spa_pod | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct SomeProps { | |
volume: Option<f32>, | |
mute: Option<bool>, | |
channel_volumes: Option<Vec<f32>>, | |
} | |
const PROPS_KEY_CHANNEL_VOLUMES: u32 = 65544; | |
const PROPS_KEY_VOLUME: u32 = 65539; | |
const PROPS_KEY_MUTE: u32 = 65540; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void on_process(void *userdata) { | |
static int counter; | |
struct data *data = userdata; | |
struct pw_buffer *b = NULL; | |
struct spa_buffer *buf = NULL; | |
int16_t *dst = NULL; | |
if (!_setformat_requested) { | |
if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int stride = plugin.fmt.channels * (plugin.fmt.bps / 8); | |
int buffer_size = 1024 * (plugin.fmt.bps/8) * plugin.fmt.channels; | |
int bytes_per_channel = (buffer_size > buf->datas[0].maxsize ? buf->datas[0].maxsize : buffer_size) / plugin.fmt.channels; | |
int nframes = bytes_per_channel / stride; | |
// nframes is now 512 when I expected 1024 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void on_process(void *userdata) { | |
struct data *data = userdata; | |
struct pw_buffer *b = NULL; | |
struct spa_buffer *buf = NULL; | |
int16_t *dst = NULL; | |
if (!_setformat_requested) { | |
int stride = (plugin.fmt.channels * plugin.fmt.bps) / 8; | |
if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) { | |
pw_log_warn("out of buffers: %m"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <netlink/route/link.h> | |
int main(int argc, char *argv[]) | |
{ | |
struct rtnl_link *link; | |
struct nl_sock *sk; | |
int err; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inputplf = DB_decoder_t( | |
plugin: plug, | |
open: {(hints: UInt32) -> UnsafeMutablePointer<DB_fileinfo_t>? in | |
let ptr: UnsafeMutablePointer<fileinfo> = UnsafeMutablePointer<fileinfo>.allocate(capacity: 1) | |
ptr.initialize(repeating: fileinfo(dbfileinfo: DB_fileinfo_t(), frequency: 440), count: 1) | |
return UnsafeMutablePointer<DB_fileinfo_t>(OpaquePointer(ptr)) | |
}, | |
init: {(info: UnsafeMutablePointer<DB_fileinfo_t>?, it: UnsafeMutablePointer<DB_playItem_t>?) -> Int32 in | |
0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// swift-tools-version: 5.7 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
import PackageDescription | |
let package = Package( | |
name: "ddbswift", | |
products: [ | |
// Products define the executables and libraries a package produces, and make them visible to other packages. | |
.library( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fixes for adwaita gtk2 | |
# Fix too big buttons | |
style "button" { | |
GtkButton::inner-border = {3, 3, 2, 2} | |
} | |
# Fix prelight assuming dialog bg color | |
style "notebook_checkbutton" { | |
bg[PRELIGHT] = {1.0, 1.0, 1.0} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cairo.h> | |
#include <cairo/cairo.h> | |
#include <gtk/gtk.h> | |
typedef struct { | |
float x, y; | |
} coord_t; | |
static void do_drawing(cairo_t *); |