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

New ui & audio backend #35

Merged
merged 60 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
227e7e4
Browser and Settings
zX3no Aug 2, 2023
59f25ad
Settings
zX3no Aug 2, 2023
3efd7f9
Queue
zX3no Aug 2, 2023
df0803b
Fixed issues with latest winter version
zX3no Aug 2, 2023
0f8c4f7
Queue
zX3no Aug 2, 2023
04d2711
Playlist
zX3no Aug 2, 2023
c592ce4
Help, search and input events
zX3no Aug 3, 2023
d821fa9
Fixed input and raw mode
zX3no Aug 3, 2023
38a2622
Cleaned up help menu.
zX3no Aug 3, 2023
b0182d4
Adjusted polling rate for proper audio playback
zX3no Aug 3, 2023
b9cd5d2
Fixed styling issues with queue
zX3no Aug 3, 2023
4916b33
Fixed search and key states
zX3no Aug 4, 2023
3869b65
Fixed playlists failing to delete
zX3no Aug 5, 2023
4d14c7b
Clippy
zX3no Aug 5, 2023
602a912
Updated README
zX3no Aug 5, 2023
d60dcf6
Fixed scrolling issues
zX3no Aug 6, 2023
3498797
cleanup
zX3no Aug 15, 2023
f2d4187
Improved search bindings
zX3no Aug 20, 2023
f5e05e9
Removed walkdir
zX3no Aug 20, 2023
cfb116f
Updated winwalk
zX3no Aug 20, 2023
335f409
benchmarks
zX3no Aug 22, 2023
230ec76
Fixed search empty when query is empty
zX3no Aug 26, 2023
72ea9e2
Bump deps
zX3no Aug 26, 2023
83642da
Improved WASAPI error handling
zX3no Sep 10, 2023
d24a783
Updated winwalk
zX3no Sep 20, 2023
9db0c42
Rewrote wasapi backend
zX3no Sep 26, 2023
73bc21a
Ring buffer
zX3no Sep 27, 2023
22f61f2
Cleaned up profiling
zX3no Sep 29, 2023
e2f25ca
Clean up
zX3no Sep 29, 2023
89b4fd6
Testing ring buffer
zX3no Sep 29, 2023
88934bf
Testing thread locking options
zX3no Sep 29, 2023
3f20cab
Static and heap ringbuffer
zX3no Oct 1, 2023
c2d7cb0
testing
zX3no Oct 1, 2023
4c34541
Ring buffer resizing
zX3no Oct 1, 2023
bb70983
todo
zX3no Oct 1, 2023
386049a
cleanup
zX3no Oct 20, 2023
db51087
Update to latest winter
zX3no Nov 9, 2023
ceb023d
Testing macros
zX3no Dec 4, 2023
fa4a778
Fixed issue with search backspace
zX3no Dec 4, 2023
99e2f15
Testing new decoder
zX3no Dec 4, 2023
a58abac
Updated winter
zX3no Dec 5, 2023
d2bb731
Improved player
zX3no Dec 11, 2023
1221a85
Testing new player
zX3no Dec 12, 2023
705e41a
testing
zX3no Dec 12, 2023
054aba6
Testing SegQueue and lock free vector
zX3no Dec 12, 2023
f37cb55
Working thread safe buffer
zX3no Dec 14, 2023
5744d98
Working player
zX3no Dec 17, 2023
eb72a2e
Fixed crash in search menu
zX3no Dec 17, 2023
67d12b9
Cursor support
zX3no Dec 17, 2023
e3e431c
Fixed queue index
zX3no Dec 17, 2023
3c86eb6
Cleanup
zX3no Dec 17, 2023
8ecbcbd
Fixed UI crashes
zX3no Dec 18, 2023
e73ddbf
Fixed some playback issues
zX3no Dec 18, 2023
3475e5b
Fixed playlist rendering
zX3no Dec 19, 2023
75f1c7f
Fixed settings not saving, added shift up/down for larger jumps, fixe…
zX3no Dec 20, 2023
ca1150c
removed dbg!
zX3no Dec 20, 2023
fd736d7
clippy
zX3no Dec 20, 2023
3472b2c
Sleep while size is zero
zX3no Dec 20, 2023
5ac4d5d
Cleaned up dependencies
zX3no Dec 21, 2023
f84b42e
Updated README.md
zX3no Dec 21, 2023
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
Prev Previous commit
Next Next commit
Fixed issues with latest winter version
  • Loading branch information
zX3no committed Aug 2, 2023
commit df0803bd15adcb7fa93f67b99b3c92b8d0bdd3c0
31 changes: 13 additions & 18 deletions gonk/src/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ pub fn draw(
browser: &mut Browser,
area: winter::Rect,
buf: &mut winter::Buffer,
mouse: Option<Event>,
mouse: Option<(u16, u16)>,
) {
let size = area.width / 3;
let rem = area.width % 3;
Expand All @@ -101,7 +101,7 @@ pub fn draw(
Constraint::Length(size + rem)
);

if let Some(Event::Mouse(x, y)) = mouse {
if let Some((x, y)) = mouse {
let rect = Rect {
x,
y,
Expand All @@ -116,34 +116,29 @@ pub fn draw(
}
}

let artists: Vec<_> = browser.artists.iter().map(|a| text!(a)).collect();
let artists = lines(artists, None, None);
let artists: Vec<_> = browser.artists.iter().map(|a| lines!(a)).collect();
let albums: Vec<_> = browser.albums.iter().map(|a| lines!(&a.title)).collect();
let songs: Vec<_> = browser.songs.iter().map(|(s, _)| lines!(s)).collect();

let albums: Vec<_> = browser.albums.iter().map(|a| text!(&a.title)).collect();
let albums = lines(albums, None, None);

let songs: Vec<_> = browser.songs.iter().map(|(s, _)| text!(s)).collect();
let songs = lines(songs, None, None);

fn browser_list<'a>(title: &'static str, items: Lines<'a>, use_symbol: bool) -> List<'a> {
fn list<'a>(title: &'static str, items: Vec<Lines<'a>>, use_symbol: bool) -> List<'a> {
let block = block(
Some(text!(title, bold())),
Borders::ALL,
BorderType::Rounded,
)
.margin(1);
let symbol = if use_symbol { ">" } else { " " };
list(Some(block), [items], Some(symbol), None)
winter::list(Some(block), items, Some(symbol), None)
}

let artists = browser_list("─Aritst", artists, browser.mode == Mode::Artist);
let albums = browser_list("─Album", albums, browser.mode == Mode::Album);
let songs = browser_list("─Song", songs, browser.mode == Mode::Song);
let artists = list("Aritst", artists, browser.mode == Mode::Artist);
let albums = list("Album", albums, browser.mode == Mode::Album);
let songs = list("Song", songs, browser.mode == Mode::Song);

//TODO: Re-work list_state and index.
artists.draw(chunks[0], buf, &mut list_state(browser.artists.index()));
albums.draw(chunks[1], buf, &mut list_state(browser.albums.index()));
songs.draw(chunks[2], buf, &mut list_state(browser.songs.index()));
artists.draw(chunks[0], buf, browser.artists.index());
albums.draw(chunks[1], buf, browser.albums.index());
songs.draw(chunks[2], buf, browser.songs.index());
}

pub fn refresh(browser: &mut Browser, db: &Database) {
Expand Down
9 changes: 3 additions & 6 deletions gonk/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,9 @@ fn draw_log(area: Rect, buf: &mut Buffer) -> Rect {
Constraint::Min(2),
Constraint::Length(3)
);
lines(
[text![msg]],
Some(block(None, Borders::ALL, BorderType::Rounded)),
None,
)
.draw(area[1], buf);
lines([text![msg]])
.block(None, Borders::ALL, BorderType::Rounded)
.draw(area[1], buf);
area[0]
} else {
area
Expand Down
2 changes: 1 addition & 1 deletion gonk/src/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ pub fn draw(queue: &mut Queue, area: winter::Rect, buf: &mut winter::Buffer, mou
);
let header = header!["", "#", "Title", "Album", "Artist"];
let table = table(Some(header), Some(block), &con, rows, None, style());
table.draw(area[1], buf, &mut table_state(ui_index));
table.draw(area[1], buf, ui_index);

let row_bounds = Some(table.get_row_bounds(ui_index, table.get_row_height(area[1])));
row_bounds
Expand Down
6 changes: 3 additions & 3 deletions gonk/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ pub fn draw<'a>(settings: &'a mut Settings, area: winter::Rect, buf: &mut winter
let mut items = Vec::new();
for device in &settings.devices {
let item = if device.name == settings.current_device {
lines([text!(">> ", dim()), text!(&device.name)], None, None)
lines([text!(">> ", dim()), text!(&device.name)])
} else {
lines([text!(" "), text!(&device.name)], None, None)
lines([text!(" "), text!(&device.name)])
};
items.push(item);
}
Expand All @@ -89,5 +89,5 @@ pub fn draw<'a>(settings: &'a mut Settings, area: winter::Rect, buf: &mut winter
None,
);

list.draw(area, buf, &mut list_state(settings.index));
list.draw(area, buf, settings.index);
}