Compare commits

...

5 commits

Author SHA1 Message Date
Silvio Brändle
ffb34753ce
Add design pattern 2025-01-27 23:59:42 +01:00
Cédric Ackermann
594a530852
Update actual structure 2025-01-27 18:20:41 +01:00
533bc57232
update README.md 2025-01-27 14:37:32 +01:00
Silvio Braendle
409bcfb768
Improve file pick label 2025-01-27 13:39:51 +01:00
Silvio Brändle
ccb46ce1ea
Merge pull request #2 from silvio2402/addComments
add some comments
2025-01-27 12:36:25 +01:00
2 changed files with 20 additions and 3 deletions

View file

@ -1,13 +1,26 @@
# syncaud # syncaud
## Requirements
- [At least one custom exception class that extends Exception should be written.](./src/client_handler.rs#L6) (The struct `BindError` is a custom exception, which defines the error type for binding errors.)
- [At least one inheritance implementation must be included.](./src/client_handler.rs#L37) (The `NetworkListener` implements the `ClientHandler` and `Listener` trait.)
- [At least one custom (non-Spring Boot interface) interface should be created and used.](./src/client_handler.rs#14) (The `ClientHandler` trait is like an interface in Rust.)
## Design Pattern
In our code we adhered to the Strategy Design Pattern as described [here](https://rust-unofficial.github.io/patterns/patterns/behavioural/strategy.html). For example, the ClientHandler trait acts as the strategy interface and the NetworkListener implements the strategy via the trait. This means that in the future, this strategy could be replaced to allow for a different communication medium, e.g. Serial.
## Featurelist ## Featurelist
- The user interface should be interactive and usable by any person. - The user interface should be interactive and usable by any person.
- Sounds are played synchronously across multiple devices. - Sounds are played synchronously across multiple devices.
- Any mp3 file can be uploaded by the user to play. - Any mp3 file can be uploaded by the user to play.
## Planned structure ## Planned structure
![syncaud(1)](https://github.com/user-attachments/assets/264a3af8-717f-43ed-9c51-2d1da54b8c8a) ![syncaud(1)](https://github.com/user-attachments/assets/264a3af8-717f-43ed-9c51-2d1da54b8c8a)
## Actual structure ## Actual structure
!![Syncaud](https://github.com/user-attachments/assets/97cc57de-a53d-48e3-b09e-8057bba05bac)
![Syncaud(2)](https://github.com/user-attachments/assets/0b610dec-5589-40e5-82c3-34384649bd61)

View file

@ -77,7 +77,11 @@ impl eframe::App for UIApp {
} }
// Displaying the picked file path // Displaying the picked file path
ui.label(format!("Picked file: {:?}", self.picked_file)); let picked_file_label = match &self.picked_file {
Some(path) => format!("Picked file: {:?}", path),
None => "No file picked".to_owned(),
};
ui.label(picked_file_label);
ui.add_space(25.0); // Adding space in the UI ui.add_space(25.0); // Adding space in the UI
ui.separator(); // Adding a separator line ui.separator(); // Adding a separator line