This project is an enhanced version of the Qt Audio Recorder example, modified for educational purposes to demonstrate various design patterns in C++/Qt application development.
The original Qt Audio Recorder example provides a simple GUI application for recording audio using Qt's multimedia capabilities. This project extends that foundation by implementing several design patterns to demonstrate software engineering principles in a practical context.
This project implements the following design patterns:
-
Observer Pattern: Implemented through
Observer
andSubject
interfaces to allow various components to monitor recording state changes.StatusObserver
: Updates the UI status bar with recording stateRecordingTimeDisplay
: Updates the recording time displayLogFileObserver
: Logs recording events to a file
-
State Pattern: Manages recording state transitions with:
RecordingState
: Behavior when recordingPausedState
: Behavior when pausedStoppedState
: Behavior when stopped
-
Command Pattern: Encapsulates recording operations as objects:
StartRecordingCommand
: Initiates recordingPauseRecordingCommand
: Pauses recordingResumeRecordingCommand
: Resumes recordingStopRecordingCommand
: Stops recording- Includes a command history feature visible in the UI
-
Strategy Pattern: Allows different audio encoding approaches:
ConstantQualityStrategy
: Prioritizes quality over file sizeConstantBitRateStrategy
: Maintains consistent bit rate
-
Facade Pattern: Simplifies access to the recording subsystem:
RecordingFacade
: Provides a unified interface to the various recording components
- Qt 6.0 or higher
- C++17 compatible compiler
- Open the project file
audiorecorder.pro
in Qt Creator - Configure the project for your development environment
- Build and run the application
This project is distributed under the BSD 3-Clause License. See the LICENSE file for details.
The original Qt example code is Copyright (C) 2017 The Qt Company Ltd. and is used under the BSD 3-Clause License.
- Qt Company for providing the original audio recorder example
- This project is for educational purposes only