Warning, file /education/marble/src/plugins/render/routing/AudioOutput.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2011 Dennis Nienhüser <nienhueser@kde.org>
0004 //
0005 
0006 #ifndef MARBLE_AUDIOOUTPUT_H
0007 #define MARBLE_AUDIOOUTPUT_H
0008 
0009 #include <QObject>
0010 
0011 namespace Marble
0012 {
0013 
0014 class Route;
0015 class AudioOutputPrivate;
0016 
0017 /**
0018   * Audio (mainly voice) output of driving instructions
0019   */
0020 class AudioOutput : public QObject
0021 {
0022     Q_OBJECT
0023 
0024 public:
0025     /** Constructor */
0026     explicit AudioOutput( QObject* parent = nullptr );
0027 
0028     /** Destructor */
0029     ~AudioOutput() override;
0030 
0031     /**
0032       * Generate an audible notification (if needed) after the position on the route has changed.
0033       * No notification will be generated if the turn point with the given index is too far away,
0034       * has been announced previously, if the output is @see setMuted or the needed sounds cannot
0035       * be found in the Marble data path.
0036       * @param route The route
0037       * @param distanceManeuver The distance in meters to the next turn point
0038       * @param distanceTarget The distance to the target
0039       * @param deviated Whether the route is deviated
0040       */
0041     void update( const Route &route, qreal distanceManeuver, qreal distanceTarget, bool deviated );
0042 
0043     /** Toggle muting (neither sound nor voice output) */
0044     void setMuted( bool muted );
0045 
0046     bool isMuted() const;
0047 
0048     /**
0049       * Change the speaker to use.
0050       * @param speaker A directory name in audio/speakers in Marble's data path. This directory
0051       * is expected to contain ogg files containing the instructions: TurnLeft.ogg, RbExit3.ogg etc.
0052       * Disabled by setSoundEnabled(true) and overridden by setMuted(true).
0053       * @see setSoundEnabled
0054       * @see setMuted
0055       */
0056     void setSpeaker( const QString &speaker );
0057 
0058     QString speaker() const;
0059 
0060     /**
0061       * Toggle whether sound output is used instead of a speaker. Overridden by setMuted(true).
0062       * @see setMuted
0063       */
0064     void setSoundEnabled( bool enabled );
0065 
0066     bool isSoundEnabled() const;
0067 
0068 private:
0069     Q_PRIVATE_SLOT( d, void audioOutputFinished() )
0070 
0071     Q_PRIVATE_SLOT( d, void playInstructions() )
0072 
0073     AudioOutputPrivate * const d;
0074 };
0075 
0076 }
0077 
0078 #endif // MARBLE_AUDIOOUTPUT_H