Just Intonation  Version 1.3.0 (18)
Explore scale-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 ()
 Play startup sound. More...
 

Public Member Functions

 StartupSound (const QString &resourcefile)
 Constructor. More...
 
bool isEnabled ()
 StartupSound::isEnabled. More...
 
void setVerbosity (int verbosity)
 Set verbosity level of qDebug() messages. More...
 

Private Attributes

QString mResourceFile
 Resource file object. More...
 
int mVerbosity
 Verbosity of qDebug() messages. 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 44 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 47 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 78 of file startupsound.cpp.

bool StartupSound::isEnabled ( )

StartupSound::isEnabled.

Returns
True if enabled, false otherwise

Definition at line 61 of file startupsound.cpp.

void StartupSound::play ( )
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.

Definition at line 116 of file startupsound.cpp.

Here is the call graph for this function:

void StartupSound::setVerbosity ( int  level)

Set verbosity level of qDebug() messages.

The levels are:

  • 0: no messages
  • 1: errors only
  • 2: errors and warnings
  • 3: in addition non-repeating messages (e.g. at startup)
  • 4: all messages

Definition at line 99 of file startupsound.cpp.

Member Data Documentation

QString StartupSound::mResourceFile
private

Resource file object.

Definition at line 57 of file startupsound.h.

int StartupSound::mVerbosity
private

Verbosity of qDebug() messages.

Definition at line 58 of file startupsound.h.


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