Git Product home page Git Product logo

vizia-sample-browser's Introduction

Vizia


A declarative desktop GUI framework for the Rust programming language.



Features

  • Cross-platform (Windows, Linux, MacOS)

    Build desktop applications which look and behave the same for Windows, Mac, and Linux.
  • Declarative

    Write GUI code in a declarative way in pure Rust (no DSL macros).
  • Reactive

    Views derive from application state. Change the state and the views which bind to it update automatically.
  • Flexible layout

    Create flexible layouts which adapt to changes in size. Powered by morphorm.
  • Powerful styling

    Take advantage of CSS with hot-reloading to fully customize the style of your application.
  • Animations

    Bring your application to life with animatable style properties.
  • Built-in views and themes

    Utilize over 25 ready-made views as well as two built-in themes (light and dark) to get you started. Includes 4250+ icons, provided by Tabler Icons.
  • Accessibility

    Make you applications accessible to assistive technologies such as screen readers, powered by accesskit.
  • Localization

    Adapt your application to different locales, including translating text with fluent.
  • GPU accelerated rendering

    Vizia leverages the GPU for fast graphical updates, powered by femtovg.
  • Audio plugin development

    Vizia provides an alternative baseview windowing backend for audio plugin development, for example with the nih-plug framework.

At a Glance

A simple counter application. Run with cargo run --example counter.

use vizia::prelude::*;

// Define some model data
#[derive(Lens)]
pub struct AppData {
    count: i32,
}

// Define events to mutate the data
pub enum AppEvent {
    Increment,
}

// Describe how the data is mutated in response to events
impl Model for AppData {
    fn event(&mut self, _: &mut EventContext, event: &mut Event) {
        event.map(|app_event, _| match app_event {
            AppEvent::Increment => {
                self.count += 1;
            }
        });
    }
}

fn main() {
    // Create an application
    Application::new(|cx| {

        // Build the model data into the tree
        AppData { count: 0 }.build(cx);

        // Declare views which make up the UI
        HStack::new(cx, |cx| {
          
            // Declare a button which emits an event
            Button::new(cx, |cx| Label::new(cx, "Increment"))
              .on_press(|cx| cx.emit(AppEvent::Increment));

            // Declare a label which is bound to part of the model, updating when it changes
            Label::new(cx, AppData::count).width(Pixels(50.0));
        })
        .child_space(Stretch(1.0))  // Apply style and layout modifiers
        .col_between(Pixels(50.0));
    })
    .title("Counter") // Configure window properties
    .inner_size((400, 100))
    .run();
}

Learning

Book

A quickstart guide for vizia is available here.

Docs

Auto-generated code documentation can be found here.

Examples

A list of examples is included in the repository.

To run an example with the winit (default) windowing backend:

cargo run --release --example name_of_example

Baseview

To run an example with the baseview windowing backend:

cargo run --release --example name_of_example --no-default-features --features baseview

Contributing and Community

For help with vizia, or to get involved with contributing to the project, come join us on our discord.

License and Attribution

Vizia is licensed under MIT.

Vizia logo designed by Lunae Somnia.

vizia-sample-browser's People

Contributors

geom3trik avatar lunaesomnia avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

lunaesomnia

vizia-sample-browser's Issues

Sample Playback

Requisites

  • The Sample Playback section is divided in two subsections: a sample waveform and basic playback controls.

  • The sample shown in the Sample Playback must be the sample file selected in the Sample Inspector section.

  • The user must be able to play, stop, seek, loop, change start and end positions and pause inside the Sample Playback section.

  • The Sample Playback section must show the sample file’s current seek time, playback status and all of the audio file’s details.

Basic Infrastructure

This step is heavily focused on managing the file system and setting up the data for the application.

This step includes some sub-sections under each item in the checklist as a rough guideline of what needs to be done to accomplish that requisite. It may not reflect the actual implementation.

Requisites

  • The user may be able to create a Collection in any directory. The Collection is a special file (named “.vsb”) that is stored under the directory it’s created.

    • Define a serializable Collection structure
    • Create a store() and retreive() functions to store/retrieve data from/to the .vsb file
  • The user may be able to open a folder or directory, along with any audio file inside. The application must automatically create a Collection in place.

    • Some research must be done to know how to make this work exactly on each operating system
    • (Optionally) Passing the directory as the first argument in the CLI should open the Collection.
  • The user may be able to define tags for any audio file. A tag is formed of a string of up to 12 characters and an associated color. A tag may only include letters, numbers and spaces.

Sample Inspector

Requisites

  • The Sample Inspector is divided in four sub-sections: a search box, a filtering menu button, a list structure and a selected folder details panel.

  • The Sample Inspector may have different icons for each type of element in the tree, as well as different extensions.

  • The user may be able to assign or edit an audio file’s name, favorite flag, pitch and tags.

  • The user may be able to search, filter and sort audio files inside the Sample Inspector section based on name, extension, duration, favorites, pitch, tags, sample rate and bits per sample.

  • The Sample Inspector must show the file type, name, extension and, depending on the available space, favorite flag, tags (if any) and audio duration (if any). It will include a tag if enough space is available for it, then the audio duration, and lastly the rest of the tags individually if possible.

  • The user may be able to rescale the Sample Inspector vertically in the same way as the Directory Tree rescales horizontally, by clicking and dragging the upper size of the section.

Directory Tree

Requisites

  • The Directory Tree is divided in three subsections: a search box, a filtering menu button and a directory tree structure.

  • The user may be able to search, filter and sort directories inside the Directory Tree section based on name.

  • A user may rescale the Directory Tree horizontally upon clicking and dragging the side of its right border. It may be hidden upon reaching 50% of the initial size. Even in the hidden state, the Directory Tree must be accessible to rescaling.

  • Any directory in the Directory Tree must show the name and a toggle button to show or hide that directory's inner directories.

UI Backbone & Design

Requisites

  • The application’s UI will be divided in three main sections:

    • Directory Tree: Details every folder and subfolder of the Collection, highlighting the selected one.
    • Sample Inspector: Details the information of the samples inside the folder highlighted from the Directory Tree. If no folder is highlighted, all samples under the Collection will be shown.
    • Sample Playback: Contains simple controls and waveform rendering of a selected audio file.
  • The application’s UI must be determined by the following layout: Image

Audio Engine

Requisites

  • A sample must be an audio file. A file is considered an audio file if it’s extension is one of the following:

    • mp3
    • wav
    • flac
    • cogg
  • The user must be able to play, pause and stop the selected sample in the Sample Playback section.

  • The user must be able to seek to any instant of the selected sample in the Sample Playback section.

  • The user must be able to loop the selected sample inside the Sample Playback section.

  • The user must be able to change start and end positions of the selected sample inside the Sample Playback section.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.