mutterkey
KDE-first push-to-talk transcription tool for KDE Plasma
Loading...
Searching...
No Matches
MutterkeyService Class Referencefinal

Coordinates the daemon-mode push-to-talk workflow. More...

#include <service.h>

Signals

void transcriptionReady (const QString &text)
 Emitted when a transcription result has been copied successfully.
 
void transcriptionFailed (const RuntimeError &error)
 Emitted when recording or transcription fails.
 

Public Member Functions

 MutterkeyService (const AppConfig &config, std::shared_ptr< const TranscriptionEngine > transcriptionEngine, QClipboard *clipboard, QObject *parent=nullptr)
 Creates the service with a fixed runtime configuration.
 
 ~MutterkeyService () override
 Stops background work and joins the transcription thread.
 
bool start (QString *errorMessage=nullptr)
 Starts the hotkey, worker thread, and optional backend warmup.
 
void stop ()
 Stops recording, hotkey registration, and background transcription.
 
QJsonObject diagnostics () const
 Returns current service diagnostics for diagnose mode.
 
bool invokeShortcut (QString *errorMessage=nullptr)
 Invokes the registered shortcut action for diagnostics.
 

Detailed Description

Coordinates the daemon-mode push-to-talk workflow.

The service owns the recorder, clipboard writer, hotkey manager, and a dedicated transcription thread. The worker object itself lives on the transcription thread, while this service stays on the main thread and coordinates cross-thread requests through Qt signal and slot delivery.

Definition at line 28 of file service.h.

Constructor & Destructor Documentation

◆ MutterkeyService()

MutterkeyService::MutterkeyService ( const AppConfig config,
std::shared_ptr< const TranscriptionEngine transcriptionEngine,
QClipboard *  clipboard,
QObject *  parent = nullptr 
)
explicit

Creates the service with a fixed runtime configuration.

Parameters
configStartup configuration snapshot copied into the service.
transcriptionEngineShared immutable engine used by the worker thread.
clipboardNon-owning pointer to the application clipboard.
parentOptional QObject parent.

Member Function Documentation

◆ diagnostics()

QJsonObject MutterkeyService::diagnostics ( ) const

Returns current service diagnostics for diagnose mode.

Returns
JSON object with runtime counters and subsystem state.

◆ invokeShortcut()

bool MutterkeyService::invokeShortcut ( QString *  errorMessage = nullptr)

Invokes the registered shortcut action for diagnostics.

Parameters
errorMessageOptional output for invocation failures.
Returns
true when invocation was dispatched.

◆ start()

bool MutterkeyService::start ( QString *  errorMessage = nullptr)

Starts the hotkey, worker thread, and optional backend warmup.

Parameters
errorMessageOptional output for startup failures.
Returns
true when the service reached a running state.

◆ transcriptionFailed

void MutterkeyService::transcriptionFailed ( const RuntimeError error)
signal

Emitted when recording or transcription fails.

Parameters
errorStructured failure description.

◆ transcriptionReady

void MutterkeyService::transcriptionReady ( const QString &  text)
signal

Emitted when a transcription result has been copied successfully.

Parameters
textFinal transcribed text.

The documentation for this class was generated from the following file: