Just Intonation  Version 1.3.1 (19)
Explore key-independent dynamically adapting tuning in just intonation
StartupSound Class Reference

Class for playing a startup soundThis module manages to play a short audio file at startup (welcome jingle). More...

#include <startupsound.h>

Inheritance diagram for StartupSound:
Inheritance graph
Collaboration diagram for StartupSound:
Collaboration graph

Public Slots

void enable (bool enabled)
 Public slot: Enable / disable startup sound. More...
 
void play (double volume)
 Play startup sound. More...
 

Public Member Functions

 StartupSound (const QString &resourcefile)
 Constructor. More...
 
bool isEnabled ()
 StartupSound::isEnabled. More...
 
void setVerbosity (int verbosity)
 Set the verbosity level of the class-specific messages. More...
 
int getVerbosity ()
 Get the actual verbosity level. More...
 

Private Attributes

QString mResourceFile
 Resource file object. More...
 
QMediaPlayer mPlayer
 Pointer to the player. More...
 

Detailed Description

Class for playing a startup sound

This module manages to play a short audio file at startup (welcome jingle).

This module manages to play a short audio file at startup. The file should be stored both in mp3 format (for Apple) and int ogg format (for Linux and Android) as resource files (qrc:/...). The QMediaPlayer forwards the request to a platform-dependent streamer. Since some streamers cannot process resource files directly, the audio file (specified when calling the constructor) is first downloaded and then played.

Definition at line 46 of file startupsound.h.

Constructor & Destructor Documentation

StartupSound::StartupSound ( const QString &  resourcefile)

Constructor.

Parameters
resourcefile: Location of the resource audio file
See also
config.h

Definition at line 41 of file startupsound.cpp.

Member Function Documentation

void StartupSound::enable ( bool  enabled)
slot

Public slot: Enable / disable startup sound.

This function enables or disables the startup sounds and stores this information in the QSettings.

Parameters
enabled: True if startup sound is enabled, false otherwise

Definition at line 75 of file startupsound.cpp.

int Log::getVerbosity ( )
inherited

Get the actual verbosity level.

Returns
: Verbosity level (1...4)

Definition at line 118 of file log.cpp.

bool StartupSound::isEnabled ( )

StartupSound::isEnabled.

Returns
True if enabled, false otherwise

Definition at line 58 of file startupsound.cpp.

void StartupSound::play ( double  volume)
slot

Play startup sound.

This function plays the startup sound from a resource that was specified when calling the constructor. A QMediaPlayer is created dynamically in the heap and it is not deleted. Therefore, do not use this function repeatedly for recurrent sounds.

Parameters
volume: Volume [0..1]

Definition at line 95 of file startupsound.cpp.

Here is the call graph for this function:

void Log::setVerbosity ( int  verbosity)
inherited

Set the verbosity level of the class-specific messages.

Parameters
verbosity: Verbosity level (1...4)

Definition at line 107 of file log.cpp.

Member Data Documentation

QMediaPlayer StartupSound::mPlayer
private

Pointer to the player.

Definition at line 59 of file startupsound.h.

QString StartupSound::mResourceFile
private

Resource file object.

Definition at line 58 of file startupsound.h.


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