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