Compare commits
No commits in common. "8aa65958d046012c0ceab023e3943c8f94acb380" and "973d6e63c50f2425417e1dfc263938641b383fc3" have entirely different histories.
8aa65958d0
...
973d6e63c5
7 changed files with 13 additions and 13 deletions
|
@ -16,7 +16,7 @@ pub const RandomNoise = struct {
|
||||||
|
|
||||||
pub fn init(
|
pub fn init(
|
||||||
allocator: *std.mem.Allocator,
|
allocator: *std.mem.Allocator,
|
||||||
params: anytype,
|
params: var,
|
||||||
) ?RandomNoise {
|
) ?RandomNoise {
|
||||||
var r = std.rand.DefaultPrng.init(params.seed);
|
var r = std.rand.DefaultPrng.init(params.seed);
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ pub const WildNoise = struct {
|
||||||
|
|
||||||
pub fn init(
|
pub fn init(
|
||||||
allocator: *std.mem.Allocator,
|
allocator: *std.mem.Allocator,
|
||||||
params: anytype,
|
params: var,
|
||||||
) ?WildNoise {
|
) ?WildNoise {
|
||||||
var r = std.rand.DefaultPrng.init(params.seed);
|
var r = std.rand.DefaultPrng.init(params.seed);
|
||||||
|
|
||||||
|
@ -112,7 +112,7 @@ pub const Write = struct {
|
||||||
|
|
||||||
pub fn init(
|
pub fn init(
|
||||||
allocator: *std.mem.Allocator,
|
allocator: *std.mem.Allocator,
|
||||||
params: anytype,
|
params: var,
|
||||||
) Write {
|
) Write {
|
||||||
return Write{
|
return Write{
|
||||||
.data = params.data,
|
.data = params.data,
|
||||||
|
@ -133,7 +133,7 @@ pub const Embed = struct {
|
||||||
sndfile: *c.SNDFILE = undefined,
|
sndfile: *c.SNDFILE = undefined,
|
||||||
buf: []f32 = undefined,
|
buf: []f32 = undefined,
|
||||||
|
|
||||||
pub fn init(allocator: *std.mem.Allocator, params: anytype) @This() {
|
pub fn init(allocator: *std.mem.Allocator, params: var) @This() {
|
||||||
return Embed{
|
return Embed{
|
||||||
.allocator = allocator,
|
.allocator = allocator,
|
||||||
.filepath = params.path,
|
.filepath = params.path,
|
||||||
|
|
|
@ -425,7 +425,7 @@ pub const Image = struct {
|
||||||
self: *Image,
|
self: *Image,
|
||||||
comptime Plugin: type,
|
comptime Plugin: type,
|
||||||
position: plugins.Position,
|
position: plugins.Position,
|
||||||
extra: anytype,
|
extra: var,
|
||||||
) !void {
|
) !void {
|
||||||
var plugin_opt: ?Plugin = Plugin.init(self.allocator, extra);
|
var plugin_opt: ?Plugin = Plugin.init(self.allocator, extra);
|
||||||
if (plugin_opt == null) {
|
if (plugin_opt == null) {
|
||||||
|
|
|
@ -497,7 +497,7 @@ pub const Lang = struct {
|
||||||
self.has_error = false;
|
self.has_error = false;
|
||||||
self.line = 0;
|
self.line = 0;
|
||||||
}
|
}
|
||||||
fn doError(self: *Lang, comptime fmt: []const u8, args: anytype) void {
|
fn doError(self: *Lang, comptime fmt: []const u8, args: var) void {
|
||||||
std.debug.warn("ERROR! at line {}: ", .{self.line});
|
std.debug.warn("ERROR! at line {}: ", .{self.line});
|
||||||
std.debug.warn(fmt, args);
|
std.debug.warn(fmt, args);
|
||||||
std.debug.warn("\n", .{});
|
std.debug.warn("\n", .{});
|
||||||
|
|
|
@ -36,7 +36,7 @@ fn copyCommandToHeap(allocator: *std.mem.Allocator, command: langs.Command, comp
|
||||||
return &heap_cmd.base;
|
return &heap_cmd.base;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn doRepl(allocator: *std.mem.Allocator, args_it: anytype) !void {
|
pub fn doRepl(allocator: *std.mem.Allocator, args_it: var) !void {
|
||||||
var stdout_file = std.io.getStdOut();
|
var stdout_file = std.io.getStdOut();
|
||||||
const stdout = &stdout_file.outStream();
|
const stdout = &stdout_file.outStream();
|
||||||
const scri_path = try (args_it.next(allocator) orelse @panic("expected scri path"));
|
const scri_path = try (args_it.next(allocator) orelse @panic("expected scri path"));
|
||||||
|
|
|
@ -142,7 +142,7 @@ pub fn makeContext(allocator: *std.mem.Allocator, plugin_uri: []const u8) !Conte
|
||||||
};
|
};
|
||||||
defer c.lilv_node_free(uri);
|
defer c.lilv_node_free(uri);
|
||||||
|
|
||||||
const plugins: *const c.LilvPlugins = c.lilv_world_get_all_plugins(world).?;
|
const plugins: *const c.LilvPlugins = c.lilv_world_get_all_plugins(world);
|
||||||
|
|
||||||
var plugin: *const c.LilvPlugin = c.lilv_plugins_get_by_uri(plugins, uri) orelse blk: {
|
var plugin: *const c.LilvPlugin = c.lilv_plugins_get_by_uri(plugins, uri) orelse blk: {
|
||||||
std.debug.warn("Plugin <{}> not found\n", .{plugin_uri});
|
std.debug.warn("Plugin <{}> not found\n", .{plugin_uri});
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
const std = @import("std");
|
const std = @import("std");
|
||||||
const langs = @import("lang.zig");
|
const langs = @import("lang.zig");
|
||||||
|
|
||||||
fn printCommandWithParams(stream: anytype, command: anytype) !void {
|
fn printCommandWithParams(stream: var, command: var) !void {
|
||||||
const Parameters = @TypeOf(command.parameters);
|
const Parameters = @TypeOf(command.parameters);
|
||||||
try stream.print(" {} {}", .{ command.split, command.index });
|
try stream.print(" {} {}", .{ command.split, command.index });
|
||||||
inline for (@typeInfo(Parameters).Struct.fields) |field| {
|
inline for (@typeInfo(Parameters).Struct.fields) |field| {
|
||||||
|
@ -13,7 +13,7 @@ fn printCommandWithParams(stream: anytype, command: anytype) !void {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn printCommand(stream: anytype, cmd: *langs.Command, comptime tag: langs.Command.Tag) !void {
|
fn printCommand(stream: var, cmd: *langs.Command, comptime tag: langs.Command.Tag) !void {
|
||||||
const CommandStruct = langs.Command.tagToType(tag);
|
const CommandStruct = langs.Command.tagToType(tag);
|
||||||
const casted = cmd.cast(CommandStruct).?;
|
const casted = cmd.cast(CommandStruct).?;
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ fn printCommand(stream: anytype, cmd: *langs.Command, comptime tag: langs.Comman
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn printList(list: langs.CommandList, stream: anytype) !void {
|
pub fn printList(list: langs.CommandList, stream: var) !void {
|
||||||
for (list.items) |cmd| {
|
for (list.items) |cmd| {
|
||||||
const command = @tagName(cmd.tag);
|
const command = @tagName(cmd.tag);
|
||||||
try stream.print("{}", .{command});
|
try stream.print("{}", .{command});
|
||||||
|
|
|
@ -209,7 +209,7 @@ pub const Runner = struct {
|
||||||
try magick.runRotate(image, rotate_cmd.deg, c_bgfill);
|
try magick.runRotate(image, rotate_cmd.deg, c_bgfill);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn executeLV2Command(self: *@This(), command: anytype) !void {
|
fn executeLV2Command(self: *@This(), command: var) !void {
|
||||||
const pos = plugin.Position{
|
const pos = plugin.Position{
|
||||||
.split = command.split,
|
.split = command.split,
|
||||||
.index = command.index,
|
.index = command.index,
|
||||||
|
@ -231,7 +231,7 @@ pub const Runner = struct {
|
||||||
try image.runPlugin(typ.lv2_url, pos, params);
|
try image.runPlugin(typ.lv2_url, pos, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn executeCustomCommand(self: *@This(), command: anytype) !void {
|
fn executeCustomCommand(self: *@This(), command: var) !void {
|
||||||
const pos = plugin.Position{
|
const pos = plugin.Position{
|
||||||
.split = command.split,
|
.split = command.split,
|
||||||
.index = command.index,
|
.index = command.index,
|
||||||
|
|
Loading…
Reference in a new issue