-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmscoreserver.cpp
61 lines (49 loc) · 2.2 KB
/
mscoreserver.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//=============================================================================
// MuseScore
// Music Composition & Notation
// $Id:$
//
// Copyright (C) 2013 Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License version 2
// as published by the Free Software Foundation and appearing in
// the file LICENSE.GPL
//=============================================================================
#include <stdio.h>
#include "libmscore/mscore.h"
#include "config.h"
#include "dualfilelogger.h"
#include "httplistener.h"
#include "mscorecontroller.h"
QString revision;
//---------------------------------------------------------
// main
//---------------------------------------------------------
int main(int argc, char* argv[])
{
QGuiApplication _app(argc, argv);
QGuiApplication* app = &_app;
MScore::PDPI = 300; // view.logicalDpiX();
MScore::DPI = MScore::PDPI; // logical drawing resolution
MScore::DPMM = MScore::DPI / INCH; // dots/mm
MScore::init();
app->setApplicationName("MuseScoreServer");
app->setOrganizationName("MuseScore");
QString configFileName = QDir::homePath() + "/mscoreserver/mscoreserver.ini";
// Configure logging into files
QSettings* mainLogSettings = new QSettings(configFileName, QSettings::IniFormat, app);
mainLogSettings->beginGroup("mainLogFile");
QSettings* debugLogSettings = new QSettings(configFileName, QSettings::IniFormat,app);
debugLogSettings->beginGroup("debugLogFile");
Logger* logger = new DualFileLogger(mainLogSettings, debugLogSettings, 10000, app);
logger->installMsgHandler();
// Configure session store
QSettings* sessionSettings = new QSettings(configFileName,QSettings::IniFormat,app);
sessionSettings->beginGroup("sessions");
// Static::sessionStore = new HttpSessionStore(sessionSettings,app);
QSettings* listenerSettings = new QSettings(configFileName,QSettings::IniFormat,app);
listenerSettings->beginGroup("listener");
new HttpListener(listenerSettings, new MScoreController(app), app);
return app->exec();
}