Skip to content
Snippets Groups Projects
Commit 7dd40924 authored by SeeLook's avatar SeeLook
Browse files

Initialize sound from C++, after root QML file is loaded, connect to it...

Initialize sound from C++, after root QML file is loaded, connect to it scordature check, single note mode and etc. to improve launch time
parent f47af530
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,7 @@ Tsound::~Tsound()
//#################################################################################################
void Tsound::init() {
QTimer::singleShot(1000, [=]{
QTimer::singleShot(500, [=]{
#if !defined (Q_OS_ANDROID) && (defined (Q_OS_LINUX) || defined (Q_OS_WIN))
TrtAudio::initJACKorASIO(GLOB->A->JACKorASIO);
#endif
......@@ -315,7 +315,7 @@ bool Tsound::listening() const {
bool Tsound::playing() const {
return player->isPlaying();
return player ? player->isPlaying() : false;
}
......
......@@ -166,6 +166,7 @@ int main(int argc, char *argv[])
o << "\033[01;35m[Nootka launch time: " << startElapsed.nsecsElapsed() / 1000000.0 << " [ms]\033[01;00m\n";
#endif
}
sound.init();
firstTime = false;
exitCode = a->exec();
delete e;
......
......@@ -41,8 +41,6 @@ Score {
scoreObj.nameColor: GLOB.nameColor
scoreObj.nameStyle: GLOB.noteNameStyle
scoreObj.enableDoubleAccidentals: GLOB.enableDoubleAccids
scoreObj.allowAdding: !GLOB.singleNoteMode
Timer { id: zoomTimer; interval: 500 }
MouseArea {
......@@ -83,11 +81,14 @@ Score {
// private
property var scordature: null
Component.onCompleted: {
scoreObj.singleNote = GLOB.singleNoteMode
updateScord()
Connections {
target: SOUND
onInitialized: {
scoreObj.singleNote = GLOB.singleNoteMode
scoreObj.allowAdding = Qt.binding(function() { return !GLOB.singleNoteMode })
updateScord()
}
}
Connections {
target: GLOB
onKeyNameChanged: keyName.text = Qt.binding(keyName.getKeyNameText)
......
......@@ -88,7 +88,6 @@ ApplicationWindow {
Component.onCompleted: {
Noo.mainScore = score
checkSingleMode()
SOUND.init()
}
function checkSingleMode() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment