Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Can't compile on OpenBSD #32

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
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
203 changes: 155 additions & 48 deletions Cargo.lock

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
members = ["audio", "common", "input", "io", "render", "text"]

[workspace.package]
version = "0.2.3"
version = "0.2.4"
authors = ["Esther Alter <subalterngames@gmail.com>"]
description = "A minimalist and ergonomic MIDI sequencer"
documentation = "https://github.com/subalterngames/cacophony"
Expand All @@ -12,7 +12,7 @@ edition = "2021"
serde_json = "1.0"
rust-ini = "0.18"
directories = "5.0.1"
midir = "0.9.1"
midir = "0.10.0"
csv = "1.2.1"
cpal = "0.13.1"
hound = "3.5.0"
Expand Down Expand Up @@ -83,10 +83,11 @@ branch = "speech_dispatcher_voices_panic"
[features]
speech_dispatcher_0_11 = ["text/speech_dispatcher_0_11"]
speech_dispatcher_0_9 = ["text/speech_dispatcher_0_9"]
jack = ["input/jack"]

[package]
name = "cacophony"
version = "0.2.3"
version = "0.2.4"
authors = ["Esther Alter <subalterngames@gmail.com>"]
description = "A minimalist and ergonomic MIDI sequencer"
documentation = "https://github.com/subalterngames/cacophony"
Expand Down Expand Up @@ -122,7 +123,7 @@ path = "text"
name = "Cacophony"
identifier = "com.subalterngames.cacophony"
icon = ["icon/32.png", "icon/64.png", "icon/128.png", "icon/256.png"]
version = "0.2.3"
version = "0.2.4"
resources = ["data/*"]
copyright = "Copyright (c) Subaltern Games LLC 2023. All rights reserved."
short_description = "A minimalist and ergonomic MIDI sequencer."
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ Windows:

1. `cargo build --release`

### OpenBSD

1. Install and configure jack
1. `cargo build --release --features jack

## Tests

To test, just `cargo test --all`.
Expand Down
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# 0.2.x

## 0.2.4

- Added an optional `jack` feature so that Cacophony can be built on Open/Free/etcBSD: `cargo build --release --features jack`
- Fixed some incorrectly-formatted rows in text.csv
- Fixed some clippy warnings

## 0.2.3

- Optimized text and rectangle rendering, which reduces CPU usage by around 5%.
Expand Down
8 changes: 4 additions & 4 deletions common/src/u64_or_f32.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use serde::de::{Error, Visitor};
use serde::{Deserialize, Serialize};
use std::fmt;
use std::fmt::{self, Display};

/// A value that is expressed as a u64 or an f32.
#[derive(Debug, PartialEq, Copy, Clone, Default)]
Expand Down Expand Up @@ -46,9 +46,9 @@ impl From<f32> for U64orF32 {
}
}

impl ToString for U64orF32 {
fn to_string(&self) -> String {
self.u.to_string()
impl Display for U64orF32 {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.u)
}
}

Expand Down
4 changes: 2 additions & 2 deletions data/text.csv
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,9 @@ PIANO_ROLL_PANEL_INPUT_TTS_TIME_7,\0 to set the playback time to the cursor.
PIANO_ROLL_PANEL_INPUT_TTS_VIEW_SINGLE_TRACK_0,"\0, \1, \2, and \3 to move the view."
PIANO_ROLL_PANEL_INPUT_TTS_VIEW_SINGLE_TRACK_1,\0 and \1 to set the view to the start and end.
PIANO_ROLL_PANEL_INPUT_TTS_VIEW_SINGLE_TRACk_2,\0 and \1 to zoom in and out.
PIANO_ROLL_PANEL_INPUT_TTS_VIEW_SINGLE_TRACK_3,\0 to reset the zoom level."
PIANO_ROLL_PANEL_INPUT_TTS_VIEW_SINGLE_TRACK_3,\0 to reset the zoom level.
PIANO_ROLL_PANEL_INPUT_TTS_VIEW_MULTI_TRACK_0,\0 and \1 to move the view.
PIANO_ROLL_PANEL_INPUT_TTS_VIEW_MULTI_TRACK_1,\0 and \1 to set the view to the start and end."
PIANO_ROLL_PANEL_INPUT_TTS_VIEW_MULTI_TRACK_1,\0 and \1 to set the view to the start and end.
PIANO_ROLL_MODE_TIME,Time
PIANO_ROLL_MODE_VIEW,View
PIANO_ROLL_MODE_SELECT,Select
Expand Down
5 changes: 4 additions & 1 deletion input/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,7 @@ parking_lot = { workspace = true }
clap = { workspace = true }

[dependencies.common]
path = "../common"
path = "../common"

[features]
jack = ["midir/jack"]
8 changes: 4 additions & 4 deletions input/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ impl Input {
.iter()
.filter(|c| Self::is_valid_char(c))
.copied()
.collect(),
.collect::<Vec<char>>(),
)
}

Expand All @@ -329,7 +329,7 @@ impl Input {
.iter()
.filter(|c| Self::is_valid_char(c) && !ILLEGAL_FILENAME_CHARACTERS.contains(c))
.copied()
.collect(),
.collect::<Vec<char>>(),
)
}

Expand Down Expand Up @@ -358,7 +358,7 @@ impl Input {
.iter()
.filter(|c| c.is_ascii_digit())
.copied()
.collect(),
.collect::<Vec<char>>(),
);
// Try to get a value.
match T::from_str(string.as_str()) {
Expand All @@ -369,7 +369,7 @@ impl Input {
}

/// Modify a string with qwerty input from this frame.
fn modify_string(&self, string: &mut String, chars: &Vec<char>) -> bool {
fn modify_string(&self, string: &mut String, chars: &[char]) -> bool {
// Delete the last character.
if self.backspace {
string.pop().is_some()
Expand Down
2 changes: 1 addition & 1 deletion io/src/export_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ impl Panel for ExportPanel {
// We're done.
let export_state = conn.export_state.lock();
if *export_state == ExportState::NotExporting {
state.panels = self.panels.clone();
self.panels.clone_from(&state.panels);
state.focus.set(self.focus);
}
None
Expand Down
2 changes: 1 addition & 1 deletion io/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ impl IO {
// We aren't exporting already.
if export_state == ExportState::NotExporting {
self.pre_export_focus = state.focus.get();
self.pre_export_panels = state.panels.clone();
self.pre_export_panels.clone_from(&state.panels);
self.open_file_panel.export(state, paths_state, conn)
}
} else if input.happened(&InputEvent::ImportMidi) {
Expand Down
4 changes: 2 additions & 2 deletions io/src/popup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ impl Popup {
/// Enable the panel. Store the state of the active panels. Set the state's active panels.
pub fn enable(&mut self, state: &mut State, panels: Vec<PanelType>) {
self.focus = state.focus.get();
self.panels = state.panels.clone();
self.panels.clone_from(&state.panels);
state.panels = panels;
state.focus = Index::new(0, state.panels.len());
}

/// Disable the panel. Set the state's active panels.
pub fn disable(&self, state: &mut State) {
state.panels = self.panels.clone();
state.panels.clone_from(&self.panels);
state.focus = Index::new(self.focus, self.panels.len());
}
}