1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4     Rosegarden
5     A MIDI and audio sequencer and musical notation editor.
6     Copyright 2000-2021 the Rosegarden development team.
7 
8     This program is free software; you can redistribute it and/or
9     modify it under the terms of the GNU General Public License as
10     published by the Free Software Foundation; either version 2 of the
11     License, or (at your option) any later version.  See the file
12     COPYING included with this distribution for more information.
13 */
14 
15 #ifndef RG_DUMMYDRIVER_H
16 #define RG_DUMMYDRIVER_H
17 
18 #include "SoundDriver.h"
19 
20 #include <QObject>
21 #include <QString>
22 
23 namespace Rosegarden
24 {
25 
26 
27 /// Allow Rosegarden to run without sound support.
28 class DummyDriver : public SoundDriver
29 {
30 public:
31     DummyDriver(MappedStudio *studio, const QString &pastLog = "") :
32         SoundDriver(studio, "DummyDriver - no sound"),
33         m_pastLog(pastLog)
34     {
35     }
36 
getStatusLog()37     QString getStatusLog() override
38     {
39         if (m_pastLog.isEmpty())
40             return QObject::tr("No sound driver available: Application compiled without sound support?");
41 
42         return QObject::tr("No sound driver available: Sound driver startup failed, log follows: \n\n%1").arg(m_pastLog);
43     }
44 
45 protected:
46     QString m_pastLog;
47 };
48 
49 
50 }
51 
52 #endif // RG_DUMMYDRIVER_H
53 
54