From 59b2541ea882e360b6ba9c724f238e545a9aa4fe Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Thu, 26 Sep 2024 16:16:31 +0200 Subject: add WIP audio facade --- img/facade-audio.puml | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 img/facade-audio.puml (limited to 'img') diff --git a/img/facade-audio.puml b/img/facade-audio.puml new file mode 100644 index 0000000..0b0e6ea --- /dev/null +++ b/img/facade-audio.puml @@ -0,0 +1,39 @@ +@startuml +!include theme.ipuml +skinparam Linetype ortho + + +package crepe { + class Sound { + +Sound(crepe::api::Resource) + + +pause() + +play() + +rewind() + +set_volume(float) + +set_looping(bool) + + -_handle : SoLoud::handle + -_paused : bool + } + + class SoundSystem { + + } +} + +package SoLoud { + class Soloud + class WavStream + class Wav +} + +' layout +crepe -[hidden]down- SoLoud +SoLoud.Wav -[hidden]right- SoLoud.WavStream +SoLoud.WavStream -[hidden]right- SoLoud.Soloud + +crepe.Sound ..> (SoLoud.WavStream, SoLoud.Wav) : either +crepe.SoundSystem ..> SoLoud.Soloud + +@enduml -- cgit v1.2.3 From 900805f3d6ddcf31fc3141a460e888c3f90a8099 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sat, 28 Sep 2024 17:09:52 +0200 Subject: update audio facade class diagram --- img/facade-audio.puml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'img') diff --git a/img/facade-audio.puml b/img/facade-audio.puml index 0b0e6ea..f760652 100644 --- a/img/facade-audio.puml +++ b/img/facade-audio.puml @@ -24,16 +24,13 @@ package crepe { package SoLoud { class Soloud - class WavStream class Wav } ' layout crepe -[hidden]down- SoLoud -SoLoud.Wav -[hidden]right- SoLoud.WavStream -SoLoud.WavStream -[hidden]right- SoLoud.Soloud -crepe.Sound ..> (SoLoud.WavStream, SoLoud.Wav) : either +crepe.Sound ..> SoLoud.Wav crepe.SoundSystem ..> SoLoud.Soloud @enduml -- cgit v1.2.3 From 44da8d4f03be549ddb8b56941e6ab7c3eaca5eca Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sun, 29 Sep 2024 17:21:36 +0200 Subject: more facade class diagram --- design.tex | 22 +++++++++++++++++++++- img/facade-audio.puml | 38 +++++++++++++++++++++++++++----------- img/theme.ipuml | 3 +++ 3 files changed, 51 insertions(+), 12 deletions(-) (limited to 'img') diff --git a/design.tex b/design.tex index dcde483..9d5f999 100644 --- a/design.tex +++ b/design.tex @@ -38,9 +38,29 @@ workflows. \subsection{Audio} +\subsubsection{Library} + \subsubsection{Fa\c{c}ade} -\includepumldiag{img/facade-audio.puml} +\Cref{fig:class-audio-facade} shows a class diagram of the audio fa\c{c}ade. It +contains the following classes: +\begin{description} + \item[SoundSystem] This is a wrapper around the \codeinline{SoLoud::soloud} + `engine' class, and is therefore implemented as a singleton. This ensures the + audio engine is initialized before \codeinline{Sound} is able to use it. + + This class is friends with \codeinline{Sound}, so only \codeinline{Sound} is able + to get the \codeinline{SoundSystem} instance. + \item[Sound] This is a wrapper around the \codeinline{SoLoud::Wav} class, and uses + cr\^epe's \codeinline{api::Resource} class to load an audio sample instead. +\end{description} + +\begin{figure} + \centering + \includepumldiag{img/facade-audio.puml} + \caption{Audio fa\c{c}ade class diagram} + \label{fig:class-audio-facade} +\end{figure} \subsection{Input} diff --git a/img/facade-audio.puml b/img/facade-audio.puml index f760652..b256f47 100644 --- a/img/facade-audio.puml +++ b/img/facade-audio.puml @@ -4,33 +4,49 @@ skinparam Linetype ortho package crepe { - class Sound { - +Sound(crepe::api::Resource) + package api { + class Resource <> + } + class Sound { + +Sound(resource) + -- +pause() +play() +rewind() +set_volume(float) +set_looping(bool) - - -_handle : SoLoud::handle - -_paused : bool + -- + -sample : SoLoud::Wav + -handle : SoLoud::handle + -- + -load(resource) } - class SoundSystem { - + class SoundSystem <> { + -instance() : SoundSystem& <> + -- + -SoundSystem() + -~SoundSystem() + -- + -engine : SoLoud::Soloud } } package SoLoud { - class Soloud - class Wav + class Soloud <> + class Wav <> } ' layout crepe -[hidden]down- SoLoud -crepe.Sound ..> SoLoud.Wav -crepe.SoundSystem ..> SoLoud.Soloud +crepe.Sound --> SoLoud.Wav +crepe.SoundSystem --> SoLoud.Soloud + +crepe.Sound .> crepe.SoundSystem +crepe.SoundSystem .> crepe.Sound + +crepe.Sound .> crepe.api.Resource @enduml diff --git a/img/theme.ipuml b/img/theme.ipuml index 4e3613e..f716ddf 100644 --- a/img/theme.ipuml +++ b/img/theme.ipuml @@ -8,3 +8,6 @@ skinparam Nodesep 25 skinparam Padding 2 skinparam Ranksep 50 skinparam RoundCorner 0 + +hide <> stereotype +hide <> members -- cgit v1.2.3 From f91594111d9af7082444cbd434d2d52e6bd40700 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Tue, 1 Oct 2024 17:57:47 +0200 Subject: rename SoundSystem to SoundContext --- design.tex | 4 ++-- img/facade-audio.puml | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'img') diff --git a/design.tex b/design.tex index 9d5f999..1e42c03 100644 --- a/design.tex +++ b/design.tex @@ -45,12 +45,12 @@ workflows. \Cref{fig:class-audio-facade} shows a class diagram of the audio fa\c{c}ade. It contains the following classes: \begin{description} - \item[SoundSystem] This is a wrapper around the \codeinline{SoLoud::soloud} + \item[SoundContext] This is a wrapper around the \codeinline{SoLoud::soloud} `engine' class, and is therefore implemented as a singleton. This ensures the audio engine is initialized before \codeinline{Sound} is able to use it. This class is friends with \codeinline{Sound}, so only \codeinline{Sound} is able - to get the \codeinline{SoundSystem} instance. + to get the \codeinline{SoundContext} instance. \item[Sound] This is a wrapper around the \codeinline{SoLoud::Wav} class, and uses cr\^epe's \codeinline{api::Resource} class to load an audio sample instead. \end{description} diff --git a/img/facade-audio.puml b/img/facade-audio.puml index b256f47..6749915 100644 --- a/img/facade-audio.puml +++ b/img/facade-audio.puml @@ -14,8 +14,8 @@ package crepe { +pause() +play() +rewind() - +set_volume(float) - +set_looping(bool) + -volume : float <<+set>> <<+get>> + -looping : bool <<+set>> <<+get>> -- -sample : SoLoud::Wav -handle : SoLoud::handle @@ -23,11 +23,11 @@ package crepe { -load(resource) } - class SoundSystem <> { - -instance() : SoundSystem& <> + class SoundContext <> { + -instance() : SoundContext& <> -- - -SoundSystem() - -~SoundSystem() + -SoundContext() + -~SoundContext() -- -engine : SoLoud::Soloud } @@ -42,10 +42,10 @@ package SoLoud { crepe -[hidden]down- SoLoud crepe.Sound --> SoLoud.Wav -crepe.SoundSystem --> SoLoud.Soloud +crepe.SoundContext --> SoLoud.Soloud -crepe.Sound .> crepe.SoundSystem -crepe.SoundSystem .> crepe.Sound +crepe.Sound .> crepe.SoundContext +crepe.SoundContext .> crepe.Sound crepe.Sound .> crepe.api.Resource -- cgit v1.2.3 From 523793d0fa64acbb9a04403a5c6054941a5296d0 Mon Sep 17 00:00:00 2001 From: Loek Le Blansch Date: Sat, 5 Oct 2024 15:00:41 +0200 Subject: cleanup + sync design with crepe `loek/audio` source branch --- img/facade-audio.puml | 23 ++++++++++------------- img/theme.ipuml | 17 +++++++++++++++-- latexmkrc | 2 ++ projdoc.cls | 2 +- time.txt | 1 + 5 files changed, 29 insertions(+), 16 deletions(-) (limited to 'img') diff --git a/img/facade-audio.puml b/img/facade-audio.puml index 6749915..60af60f 100644 --- a/img/facade-audio.puml +++ b/img/facade-audio.puml @@ -2,14 +2,11 @@ !include theme.ipuml skinparam Linetype ortho - package crepe { - package api { - class Resource <> - } + class Asset <> class Sound { - +Sound(resource) + +Sound(asset) -- +pause() +play() @@ -20,7 +17,7 @@ package crepe { -sample : SoLoud::Wav -handle : SoLoud::handle -- - -load(resource) + -load(asset) } class SoundContext <> { @@ -31,6 +28,11 @@ package crepe { -- -engine : SoLoud::Soloud } + + Sound .> SoundContext + SoundContext .> Sound + + Sound .left> Asset } package SoLoud { @@ -38,15 +40,10 @@ package SoLoud { class Wav <> } -' layout -crepe -[hidden]down- SoLoud - crepe.Sound --> SoLoud.Wav crepe.SoundContext --> SoLoud.Soloud -crepe.Sound .> crepe.SoundContext -crepe.SoundContext .> crepe.Sound - -crepe.Sound .> crepe.api.Resource +' LAYOUT +crepe -[hidden]down- SoLoud @enduml diff --git a/img/theme.ipuml b/img/theme.ipuml index f716ddf..ae3b1c7 100644 --- a/img/theme.ipuml +++ b/img/theme.ipuml @@ -1,13 +1,26 @@ +' vim:ft=plantuml + !theme plain skinparam ClassAttributeIconSize 0 skinparam ClassFontStyle bold skinparam DefaultFontName Inter -skinparam DefaultFontSize 14 +skinparam DefaultFontSize 10 skinparam MaxMessageSize 200 skinparam Nodesep 25 -skinparam Padding 2 +' skinparam Padding 0 skinparam Ranksep 50 skinparam RoundCorner 0 +skinparam PackageStyle rectangle +skinparam PackageFontStyle italic + +hide class circle +' class <> for third-party classes hide <> stereotype hide <> members + +' rectangle <> +hide <> stereotype +skinparam Rectangle<>BorderStyle dashed +skinparam Rectangle<>BorderColor gray + diff --git a/latexmkrc b/latexmkrc index d2c3cdc..cdc2001 100644 --- a/latexmkrc +++ b/latexmkrc @@ -12,6 +12,8 @@ $clean_ext .= ' %R.ist %R.xdy bbl run.xml'; 'plan', 'research', 'timerep', + 'design', + 'requirements', ); push @file_not_found, '^Package .* No file `([^\\\']*)\\\''; diff --git a/projdoc.cls b/projdoc.cls index 8a2c05d..b369b18 100644 --- a/projdoc.cls +++ b/projdoc.cls @@ -330,7 +330,7 @@ % adjust scale for puml diagrams \newcommand{\includepumldiag}[1]{% \StrSubstitute{#1}{.puml}{.eps}[\filename]% - \fitimg{\includegraphics[scale=0.6]{\filename}}% + \fitimg{\includegraphics[scale=0.75]{\filename}}% } % prevent page break between two paragraphs diff --git a/time.txt b/time.txt index 4494d0a..bdb122d 100644 --- a/time.txt +++ b/time.txt @@ -57,6 +57,7 @@ loek: 2024-10-01 30m implementation :: audio facade and API loek: 2024-10-03 1h30m project meeting loek: 2024-10-04 15m research :: read others' research loek: 2024-10-04 1h15m project meeting +loek: 2024-10-05 1h10m refacting :: unify unit tests + update code style max: 2024-09-02 1h project kickoff max: 2024-09-02 45m first project meeting -- cgit v1.2.3