kwave  18.07.70
main.cpp File Reference
#include "config.h"
#include <errno.h>
#include <stdio.h>
#include <QApplication>
#include <QCommandLineParser>
#include <QString>
#include <KAboutData>
#include <KCrash>
#include <kcrash_version.h>
#include <KDBusService>
#include <KLocalizedString>
#include <kxmlgui_version.h>
#include "libkwave/String.h"
#include "App.h"
#include "Splash.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

static void addDataStrings (KAboutData &aboutdata)
 
int main (int argc, char **argv)
 

Function Documentation

◆ addDataStrings()

static void addDataStrings ( KAboutData &  aboutdata)
static

add data concerning the developers and contributers to the about data

Definition at line 43 of file main.cpp.

References _, and probe_fast_memcpy().

Referenced by main().

44 {
45  //Developers
46  aboutdata.addAuthor(
47  i18n("Thomas Eschenbacher"),
48  i18n("Project leader since 2000, core development"),
49  _("Thomas.Eschenbacher@gmx.de"),
50  i18n("http://kwave.sourceforge.net")
51  );
52  aboutdata.addAuthor(
53  i18n("Martin Wilz"),
54  i18n("Creator of the project, development 1998-2000"),
55  _("martin@wilz.de"),
56  i18n("http://www.wilz.de"));
57  aboutdata.addAuthor(
58  i18n("Ralf Waspe"),
59  i18n("Creator of the Help/About dialog"),
60  _("rwaspe@web.de"),
61  QString());
62  aboutdata.addAuthor(
63  i18n("Caulier Gilles"),
64  i18n("splashscreen, tests and bugfixes"),
65  _("caulier.gilles@free.fr"),
66  i18n("http://caulier.gilles.free.fr"));
67  aboutdata.addAuthor(
68  i18n("Dave Flogeras"),
69  i18n("Notch filter plugin"),
70  _("d.flogeras@unb.ca"),
71  QString());
72  aboutdata.addAuthor(
73  i18n("Rik Hemsley"),
74  i18n("Level meter"),
75  _("rik@kde.org"),
76  i18n("http://rikkus.info/esoundlevelmeter.html"));
77  aboutdata.addAuthor(
78  i18n("Joerg-Christian Boehme"),
79  i18n("PulseAudio record plugin"),
80  _("joerg@chaosdorf.de"),
81  QString());
82 
83  // people who helped
84  aboutdata.addCredit(
85  i18n("Stefan Westerfeld"),
86  i18n("Author of aRts"),
87  _("stefan@space.twc.de"),
88  QString());
89  aboutdata.addCredit(
90  i18n("Sven-Steffen Arndt"),
91  i18n("Kwave homepage and German online help"),
92  _("ssa29@gmx.de"),
93  QString());
94  aboutdata.addCredit(
95  i18n("Aurelien Jarno"),
96  i18n("Debian packager"),
97  _("aurel32@debian.org"),
98  QString());
99  aboutdata.addCredit(
100  i18n("Robert M. Stockmann"),
101  i18n("Packaging for Mandrake / X86_64"),
102  _("stock@stokkie.net"),
103  QString());
104 // aboutdata.addCredit(i18n("Diederick de Vries"),
105 // i18n("Packaging for Crux Linux"),
106 // _("diederick76@gmail.com"),
107 // _("http://crux.nu/portdb/?command=viewport&repo=diederick&name=kwave"));
108  aboutdata.addCredit(
109  i18n("Martin Kuball"),
110  i18n("Tester"),
111  _("makube@user.sourceforge.net"),
112  QString());
113  aboutdata.addCredit(
114  i18n("Robert Leslie"),
115  i18n("Author of the 'mad' MP3 decoder library"),
116  _("rob@mars.org"),
117  i18n("http://www.mars.org/home/rob/proj/mpeg"));
118  aboutdata.addCredit(
119  i18n("T.H.F. Klok and Cedric Tefft"),
120  i18n("Maintainers of the 'id3lib' library"),
121  QString(),
122  i18n("http://www.id3lib.org/"));
123  aboutdata.addCredit(
124  i18n("Michael Pruett"),
125  i18n("Author of the 'audiofile' library"),
126  _("mpruett@sgi.com"),
127  i18n("http://www.68k.org/~michael/audiofile/"));
128  aboutdata.addCredit(
129  i18n("Carlos R."),
130  i18n("Spanish translation"),
131  _("pureacetone@gmail.com"),
132  QString());
133  aboutdata.addCredit(
134  i18n("Erik de Castro Lopo"),
135  i18n("Author of the 'sndfile' library"),
136  _("erikd@zip.com.au"),
137  i18n("http://www.mega-nerd.com/libsndfile/"));
138  aboutdata.addCredit(
139  i18n("Pavel Fric"),
140  i18n("Czech translation"),
141  _("pavelfric@seznam.cz"),
142  i18n("http://fripohled.blogspot.com"));
143  aboutdata.addCredit(
144  i18n("Panagiotis Papadopoulos"),
145  i18n("String and i18n updates"),
146  _("pano_90@gmx.net"),
147  QString());
148 }
#define _(m)
Definition: memcpy.c:66
Here is the call graph for this function:
Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 156 of file main.cpp.

References _, addDataStrings(), Kwave::connect(), Kwave::Splash::done(), Kwave::App::newInstance(), probe_fast_memcpy(), and Kwave::App::processCmdline().

157 {
158  int retval = 0;
159 
160  // create the application instance first
161  Kwave::App app(argc, argv);
162 
163  // initialize the crash handler (only if KCrash >= 5.15 is available)
164 #if KCrash_VERSION >= ((5 << 16) | (15 << 8) | (0))
165  KCrash::initialize();
166 #endif
167 
168  // manually connect the translation catalog, otherwise i18n will not work
169  KLocalizedString::setApplicationDomain(PROJECT_NAME);
170 
171  QCommandLineParser cmdline;
172  cmdline.addHelpOption();
173  cmdline.addVersionOption();
174  cmdline.addOption(QCommandLineOption(
175  _("disable-splashscreen"),
176  i18n("Disable the Splash Screen.")
177  ));
178  cmdline.addOption(QCommandLineOption(
179  _("iconic"),
180  i18n("Start Kwave iconified.")
181  ));
182  cmdline.addOption(QCommandLineOption(
183  _("logfile"),
184  i18nc("description of command line parameter",
185  "Log all commands into a file <file>."),
186  i18nc("placeholder of command line parameter", "file")
187  ));
188  cmdline.addOption(QCommandLineOption(
189  _("gui"),
190  i18nc("description of command line parameter",
191  "Select a GUI type: SDI, MDI or TAB mode."),
192  i18nc("placeholder of command line parameter", "sdi|mdi|tab")
193  ));
194  cmdline.addPositionalArgument(
195  _("files"),
196  i18nc("description of command line parameter",
197  "List of audio files, Kwave macro files "\
198  "or Kwave URLs to open (optionally)"),
199  i18nc("placeholder of command line parameter", "[files...]")
200  );
201 
202  KAboutData about(
203  _(PROJECT_NAME),
204  i18n("Kwave"),
205  _(KWAVE_VERSION),
206  i18n("A sound editor built on KDE Frameworks 5"),
207  KAboutLicense::GPL_V2,
208  i18n("(c) 2016, Thomas Eschenbacher"),
209  QString(),
210  _("http://www.kde.org/applications/multimedia/kwave"),
211  _("Thomas.Eschenbacher@gmx.de")
212  );
213  addDataStrings(about);
214 
215  about.setOrganizationDomain(QByteArray("kde.org"));
216  about.setDesktopFileName(QStringLiteral("org.kde.kwave"));
217 
218  /* use the about data above for this application */
219  KAboutData::setApplicationData(about);
220 
221  /* show some version info */
222  printf("\nThis is %s v%s (compiled with KDE Frameworks %s)\n",
223  about.productName().toLatin1().data(),
224  about.version().toLatin1().data(),
225  KXMLGUI_VERSION_STRING
226  );
227 
228  app.processCmdline(&cmdline);
229  app.setApplicationName(_("kwave"));
230  app.setApplicationVersion(_(KWAVE_VERSION));
231  app.setAttribute(Qt::AA_UseHighDpiPixmaps, true); // enable high dpi support
232  cmdline.process(app);
233  about.setupCommandLine(&cmdline);
234  about.processCommandLine(&cmdline);
235 
236  /* let Kwave be a "unique" application, only one instance */
237  KDBusService service(KDBusService::Unique);
238 
239  /* check for an optimized version of memcpy() */
240 #ifdef WITH_OPTIMIZED_MEMCPY
242  printf("\n");
243 #endif /* WITH_OPTIMIZED_MEMCPY */
244 
245  // check whether to start up without splash screen or in iconic mode
246  // which implicitly also disables the splash screen
247  Kwave::Splash splash(_("pics/kwave-splash.png"));
248  bool show_splash = !(cmdline.isSet(_("disable-splashscreen")) ||
249  cmdline.isSet(_("iconic")));
250  if (show_splash) splash.show();
251 
252  // now as the splash screen is in place, we can start a new instance
253  retval = app.newInstance(app.arguments(), QString());
254 
256  &service,
257  SIGNAL(activateRequested(QStringList,QString)),
258  &app,
259  SLOT(newInstance(QStringList,QString))
260  );
261 
262  if (retval != ECANCELED)
263  retval = app.exec();
264 
265  splash.done();
266  splash.close();
267 
268  return retval;
269 }
bool connect(Kwave::StreamObject &source, const char *output, Kwave::StreamObject &sink, const char *input)
Definition: Connect.cpp:48
Definition: App.h:44
void probe_fast_memcpy(void)
Definition: memcpy.c:604
#define _(m)
Definition: memcpy.c:66
static void addDataStrings(KAboutData &aboutdata)
Definition: main.cpp:43
Here is the call graph for this function: