Skip to content

Commit f17027b

Browse files
committed
random fix
1 parent c5fde71 commit f17027b

13 files changed

Lines changed: 91 additions & 179 deletions

File tree

Cargo.lock

Lines changed: 21 additions & 110 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cargo-features = ["profile-rustflags", "trim-paths"]
22

33
[package]
44
name = "bit_flipper"
5-
version = "0.3.3"
5+
version = "0.3.4"
66
edition = "2024"
77
authors = ["_eyewave <89079979+eye-wave@users.noreply.github.com>"]
88
license = "GPL-3.0-or-later"
@@ -20,15 +20,14 @@ baseview = { git = "https://github.com/RustAudio/baseview.git", features = [
2020
bytemuck = "1.23.0"
2121
crossbeam = "0.8"
2222
dirs = "6.0.0"
23+
fastrand = "2.3.0"
2324
image = { version = "0.25.6", default-features = false, features = ["png"] }
2425
log = { version = "*", features = ["max_level_error"] }
2526
nih_plug = { git = "https://github.com/robbert-vdh/nih-plug.git", features = [
2627
"assert_process_allocs",
2728
"standalone",
2829
] }
29-
once_cell = "1.21.3"
3030
pollster = "0.4.0"
31-
rand = "^0.9"
3231
raw-window-handle = "0.5"
3332
raw-window-handle-06 = { package = "raw-window-handle", version = "0.6" }
3433
serde = { version = "1.0", features = ["derive"] }

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,23 @@ A very simple distortion plugin that performs direct bit manipulation on audio s
1212
<img src="./assets/plugin_preview_02.png" width=310>
1313
</div>
1414

15+
## Custom themes support !
16+
```text
17+
(Linux) $XDG_CONFIG_HOME/bit_flipper/
18+
(Windows) %APPDATA%\bit_flipper\
19+
(macOS) ~/Library/Application Support/bit_flipper/
20+
````
21+
22+
* On Linux, this typically resolves to `~/.config/bit_flipper/`.
23+
* On Windows, it will use the standard AppData folder.
24+
25+
⚠️ **Sandboxed environments (Flatpak, Snap, etc.)** may redirect the config directory to a sandbox path.
26+
For example, when running inside Flatpak, the textures may be stored under:
27+
28+
```text
29+
/var/app/com.bitwig.BitwigStudio/config/bit_flipper/
30+
```
31+
1532
## Tested on:
1633

1734
- ⣴⠶⣦ Bitwig on Pop!\_OS 22.04 🐧

assets/textures/__palette__.png

-8 Bytes
Loading
-1 Bytes
Loading
-148 Bytes
Loading

src/drop_files.rs

Lines changed: 0 additions & 52 deletions
This file was deleted.

src/editor.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use crate::editor::theme::load_textures;
12
use crate::model::FlipModes;
23
use crate::{BitFlipperParams, BufHandle, UI_SCALE};
34
use core::{CustomWgpuEditor, baseview_window_to_surface_target};
@@ -16,6 +17,7 @@ pub const VIEW_WIDTH: u16 = 200;
1617
pub const VIEW_HEIGHT: u16 = 200;
1718

1819
mod core;
20+
mod theme;
1921
mod ui;
2022

2123
fn downscale(pos: (f32, f32)) -> (i16, i16) {
@@ -109,11 +111,13 @@ impl CustomWgpuWindow {
109111
.await
110112
.expect("Failed to create device");
111113

114+
let (palette_texture, atlas_texture) = load_textures();
115+
112116
let surface_config = surface.get_default_config(&adapter, width, height).unwrap();
113117
surface.configure(&device, &surface_config);
114118
let tex_format = surface_config.format;
115119

116-
let texture_atlas = Arc::new(TextureAtlas::new(&device, &queue));
120+
let texture_atlas = Arc::new(TextureAtlas::new(&device, &atlas_texture, &queue));
117121

118122
let bg_pipeline = Arc::new(BackgroundPipeline::new(
119123
&device,
@@ -168,7 +172,13 @@ impl CustomWgpuWindow {
168172
});
169173

170174
let grayscale_view = grayscale_texture.create_view(&Default::default());
171-
let postprocess = Postprocess::new(&device, &queue, tex_format, &grayscale_view);
175+
let postprocess = Postprocess::new(
176+
&device,
177+
&queue,
178+
&palette_texture,
179+
tex_format,
180+
&grayscale_view,
181+
);
172182

173183
Self {
174184
gui_context,

0 commit comments

Comments
 (0)