diff --git a/CMakeLists.txt b/CMakeLists.txt index af7d17c0c488d2489f8704c7ab0e7d45bb35608f..5760dfd20120ecf3d2adad7018f39cdc0224f16a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,8 @@ ${PROJECT_NAME}-${Nootka_VERSION_FULL} set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/src) set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/src) -add_subdirectory(src) +add_subdirectory(src) ########################################################################### # uninstall target diff --git a/TODO b/TODO index 777fa30d439c7aecdfdab2d1740617f600dab312..aeec1e8e8b2299a012c1a76c8b05e8eb340bcb01 100755 --- a/TODO +++ b/TODO @@ -1,5 +1,6 @@ TODO List +- check question mark scaling for left-handed (TODO) - keep exam file in /tmp and restore it when crash or so @@ -19,7 +20,6 @@ TODO List Tnote - overload + and - operators to raise/drop a note - - consider to change TnotesList type to QList<Tnote> TEXAMEXECUTOR - think about hide octave in note name format when octaves are not required in answers. diff --git a/changes b/changes new file mode 100644 index 0000000000000000000000000000000000000000..b886e32ed4ceb6fc9bddfd8471b1ed932e8e3c95 --- /dev/null +++ b/changes @@ -0,0 +1,233 @@ +1.1.0 alpha + - ported to Qt5 + +================================================================ + +1.0.1 + - finished German translation + BUGS FIXES + - fixed crash with some JACK configurations + - small scaling issues in a chart + +1.0.0 + Nootka says: I'm number one + BUGS FIXES + - fixed grand staff lines width and switching to single staff + +0.9.8 rc4 + - alternate note names on an axis chart + - adjusting pitch detection range to possibilities of a clef + BUGS FIXES + - fixed animation of corrected position for left-handed players layout + - styles of note names on linear charts are displayed properly + - fixed desktop entry for rpm packages + +0.9.7 rc3 + Nootka says: I speak German + - added German translation + BUGS FIXES + - fixed acting with non pitch-ordered strung/tuned guitars + - fixed/improved electric/bass guitar look + - fixed layout in different window sizes + - improved rpm validation results + - fixed detecting clef type from older versions of Nootka files + +0.9.6 rc2 + BUGS FIXES + - fixed high CPU usage with PulseAudio + - fingerboard properly hides highlighted string + - font scaling fixes and placement of texts (note name) + - translations fixes + +0.9.5 rc1 + Nootka says: I'm afraid of exams + - added exercise mode, without penalties and elapsing time + - more options for exercises (clues, additional note names, etc.) + - extended support for instruments different than guitar + - transposing is possible in a range ±12 semitones (octave) + - Nootka gives 'Certificate of Exam Completion' when you pass + - exam can check intonation of a sound and its accuracy is configurable + - English language in Nootka was corrected and improved + - buttons with octaves and accidentals are highlighted during answering + - audio input device settings dialog is more clear and neat + - GUI layout enhancements + - crossing of played notes is fluent now - it was cleaned from cracks + - preview of a level was improved and levels can be deleted as well + - intonation view displays differences more accurate + - added animations of accidentals corresponding with key signature + - tons of smaller fixes/improvements + BUGS FIXES + - Nootka doesn't crash when guitar or singing is out of tune + - fixed random crash when midi output was in use + - piano stave is properly locked in exams and level creator + - audio devices not supported rate of 44100 Hz work properly + - fixed switching instrument type when an exam is continued + - fixed losing default audio device in Linux ALSA + +0.8.95 beta + Nootka says: I speak Russian and play bass + - Nootka can play natural bass and electric guitar sounds + - Russian translation added + - pitch detection improvements - minimal note duration is configurable + - compiling under Windows is simpler now + - possible launching without installation + - a lot of small improvements + BUGS FIXES + - fixed crashes related with DirectSound under Windows + - many small bugs were repaired + +0.8.89 prebeta (not so official release) + - added support for bass guitars + - strings number can be changed, width depends on their pitch + - added possibility to display notes on grand stave + - support for different clefs (bass, alto, tenor) + - range of detected pitches was extended and is configurable + - settings dialog launches faster and takes less memory + - default settings can be restored + Under the hood + - score widget written from scratch and ready for further changes + +0.8.77 beta + - added intonation view of played sound + - checking for new versions of an application + - improved reaction on detected pitch (faster and fluid) + - audio output supports change of base frequency + Under the hood + - audio layer ported to RtAudio + - under Linux added support for PulseAudio & JACK (experimental) + - sound data compressed to ogg + +0.8.60 beta + - added bar charts + - new types of chart: sorted by question type and by mistakes + - line on a chart showing progress of an exam + - added tip how to confirm an answer + - images on tips are clickable to simpler navigate through an exam + - changes preview + Under the hood + - many improvements in a chart engine + +0.8.51 stable + BUGS FIXES + - eliminated some memory leaks related with charts and tips + - fixed crash for exams with all answers incorrect + +0.8.5 stable + Nootka says: I will tell You about what You've been thinking for so long... + - added detailed description of an application in first run wizard + BUGS FIXES + - fixed crash after right click on exam help window + - made application more proof on abnormal DPI settings + - proper recognizing answers on wrong strings + - fixed shortened sound output under Windows + - a few smaller bugs were fixed + +0.8.4 rc1 + - tons of visual changes to fix, adjust and improve + - time of wrong aswers is no more included to average + BUGS FIXES + - fixed proper note pitch in exams with single key + - fixed crashes related with preferences window + - proper displaying natural signs in questions preview + - proper counting of number of mandatory questions in exams + - fixed translation of color/open/save dialogues + +0.8.3 beta + Nootka says: I speak French + - French translation added + - exams can be finished after answering specified number of questions + - displaying progress of an exam end details + - mistakes are stored and are asked oftener + - New chart - ordered by key signatures + - implemented question and answer as position on a guitar + - recognizing answers with proper sound but wrong string + - simpler level creator and improved validation of levels + - improved hints during an exam + BUGS FIXES + - in Nootka font- fixed look of string numbers under Windows + +0.8.2 beta + - Added new charts - data sorted by note pitch and fret number + - improved dialog window to start/continue exams + - new, more detailed dialogues with question during exams + - A few settings of a chart + +0.8.1 beta + - !!! Added analyze of an exam results - first chart !!! + - opening Level Creator from starting exam dialog + - starting exams from Level Creator dialog + Under the hood + - implementation of chart engine + +0.8 final + Nootka says: I can hear You + - added support for MacOs and related issues + - during exams double accidentals buttons in Note Name are hidden if no needed + - GUI texts improved + - adjustments and bug-fixes for some rare question/answer combinations + BUGS FIXES + - fixed behaviour of the buttons in Note Name Widget + - fixed segmentation fault after probing audio input + - fixed forcing accidentals on ear training level + - a lot of smallest + +0.8 beta + - !!! Added sound input and pitch detection !!! + - added possibility to change base pitch of a1 note + - simple preview of an exam results + - expert's mode in an exam + - help window during exams + - better sound output under Windows (in Linux it remains good) + - layout of widgets was improved + - Bespin QT style "friendly" - more clear look of buttons + BUGS FIXES + - right mouse button does what it has to do + - fixed hanging up on an exam start for some levels + - a lot of small bug-fixes + Under the hood + - cpack rules for building deb & rpm & src packages + - ported audio lib to "Qt native" QtMultimedia + +0.7.8 + Nootka says: I speak Czech + - added Czech translation + - added language selector to settings + - added translations for associated Nootka files under Windows + BUGS FIXES + - key signatures suffixes are translated properly + - removed untranslated strings + - fixed segmentation fault occurred after run on some + platforms (Fedora, Debian) + +0.7.7 + Nootka says: I can play + - !!! Sound output added, also questions as played sound !!! + - added midi playback + - added playback with natural sound of classical guitar + - support for opening external nootka files + - polish translation + - associate Nootka files with executable also under Windows + - added button for fast switch on/off hints + - questions and answers view is more clear + - right mouse button asks questions and checks answers + - preventing to use levels with a range out of current tune and frets number + - possibility of changing colors + (note pointer, finger/string pointer, questions/answers colors etc.) + BUGS FIXES + - fixed drawing last fret out of a fingerboard + - fixed proper position of a clef and accidentals + - fixed encoding characters under non UTF8 systems + - Guitar is disabled during exams in proper way + - Fixed behaviour of right mouse button over fingerboard + - and few smaller bugs + +0.7.0 + - !!! executing exams !!! + - storing user settings + - created nootka font + - added first run wizard + +0.6 + - Levels creator dialog + Under the hood + - all resources moved out of executable file diff --git a/packaging/CMakeLists.txt b/packaging/CMakeLists.txt index 37993fdc874805f7cfbbb4b761a0eb5b13570bdf..be55a8bd8ad85950423b001fdada3e3cebfa78ce 100755 --- a/packaging/CMakeLists.txt +++ b/packaging/CMakeLists.txt @@ -160,6 +160,11 @@ message(STATUS " Binary nootka is in src folder, so launch it invoking: ./src/nootka ") + +# message(STATUS " +# QT5: ${QtCore_location} ${CMAKE_MAKE_PROGRAM} +# ") + if(WIN32) GET_FILENAME_COMPONENT(VORBIS_DIR ${VORBIS_LIBRARIES} PATH) GET_FILENAME_COMPONENT(MAKE_DIR ${CMAKE_MAKE_PROGRAM} PATH) @@ -169,13 +174,13 @@ if(WIN32) COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QT_BINARY_DIR}/QtCore4.dll ${CMAKE_BINARY_DIR}/src/. COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QT_BINARY_DIR}/QtGui4.dll ${CMAKE_BINARY_DIR}/src/. COMMAND ${CMAKE_COMMAND} -E copy_if_different ${QT_BINARY_DIR}/QtNetwork4.dll ${CMAKE_BINARY_DIR}/src/. - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FFTW3_LIBRARIES} ${CMAKE_BINARY_DIR}/src/. - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${VORBIS_LIBRARIES} ${CMAKE_BINARY_DIR}/src/. #libvorbisfile.dll - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${VORBIS_DIR}/libvorbis.dll ${CMAKE_BINARY_DIR}/src/. - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${VORBIS_DIR}/libogg.dll ${CMAKE_BINARY_DIR}/src/. +# COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FFTW3_LIBRARIES} ${CMAKE_BINARY_DIR}/src/. +# COMMAND ${CMAKE_COMMAND} -E copy_if_different ${VORBIS_LIBRARIES} ${CMAKE_BINARY_DIR}/src/. #libvorbisfile.dll +# COMMAND ${CMAKE_COMMAND} -E copy_if_different ${VORBIS_DIR}/libvorbis.dll ${CMAKE_BINARY_DIR}/src/. +# COMMAND ${CMAKE_COMMAND} -E copy_if_different ${VORBIS_DIR}/libogg.dll ${CMAKE_BINARY_DIR}/src/. COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MAKE_DIR}/libgcc_s_dw2-1.dll ${CMAKE_BINARY_DIR}/src/. COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MAKE_DIR}/libstdc++-6.dll ${CMAKE_BINARY_DIR}/src/. - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MAKE_DIR}/mingwm10.dll ${CMAKE_BINARY_DIR}/src/. +# COMMAND ${CMAKE_COMMAND} -E copy_if_different ${MAKE_DIR}/mingwm10.dll ${CMAKE_BINARY_DIR}/src/. COMMAND echo Copying files... COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/gpl ${CMAKE_BINARY_DIR}/src/. COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/changes ${CMAKE_BINARY_DIR}/src/. diff --git a/picts/chart-icon.rc b/picts/chart-icon.rc old mode 100644 new mode 100755 index 7e09e6d77afc15d9d7d5ade788ec25e69b8c8762..c57acecf6dfb97e1614217a8c5a9ab041051dc3f --- a/picts/chart-icon.rc +++ b/picts/chart-icon.rc @@ -1 +1 @@ -IDI_ICON1 ICON DISCARDABLE "chart.ico" +IDI_ICON1 ICON DISCARDABLE "charts.ico" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 06f4ac60d28cb1be1ac3ca4fe32e1e2d4022e5c5..e808a6bb0cb6aa1ae728580494b98d52b14c6daf 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,6 +8,9 @@ set(CMAKE_AUTOMOC ON) find_package(Qt5Widgets) +# set(QtCore_location Qt5::Core "" CACHE INTERNAL "" FORCE) +# get_target_property(QtCore_location Qt5::Core LOCATION) + if(UNIX AND NOT APPLE) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro") @@ -24,9 +27,29 @@ add_subdirectory( libs/core ) include_directories( libs/core ) -add_subdirectory( charts ) # nootka analyzer - -add_subdirectory( updater ) # nootka updater +# add_subdirectory( charts ) # nootka analyzer + +# add_subdirectory( updater ) # nootka updater + +# nootka executable +set(NOOTKA_SRC + main.cpp + mainwindow.cpp + + guitar/tfingerboard.cpp + + score/tscoreview.cpp + score/tsimplescore.cpp + score/tmainscore.cpp + + widgets/troundedlabel.cpp + + animations/tstrikedoutitem.cpp +) + + +add_executable(nootka WIN32 ${NOOTKA_SRC} ) +target_link_libraries(nootka NootkaCore Qt5::Widgets) # get_directory_property( DirDefs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS ) diff --git a/src/animations/tstrikedoutitem.cpp b/src/animations/tstrikedoutitem.cpp index 62db5dcd7386634ed3c9cad033396aefca565512..6702d8b9c75cbd441620e5db2656558a55e93438 100644 --- a/src/animations/tstrikedoutitem.cpp +++ b/src/animations/tstrikedoutitem.cpp @@ -17,7 +17,7 @@ ***************************************************************************/ #include "tstrikedoutitem.h" -#include "tblinkingitem.h" +#include <animations/tblinkingitem.h> #include <QPen> #include <QGraphicsScene> diff --git a/src/charts/CMakeLists.txt b/src/charts/CMakeLists.txt old mode 100644 new mode 100755 index 1891ef0702bfac2e4dcd864aa2f8763c2062ebc5..08a848f3ce91bef1bcf62f7ed58b622414a5e960 --- a/src/charts/CMakeLists.txt +++ b/src/charts/CMakeLists.txt @@ -28,7 +28,7 @@ set(ANALYZER_SRC if(MINGW) # dress up win executable in nice nootka icon ONLY FOR MINGW !!!!!!!!!!!!! add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/chartico.o - COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_CURRENT_SOURCE_DIR}/../picts/chart-icon.rc + COMMAND windres.exe -I${CMAKE_CURRENT_SOURCE_DIR} -i${CMAKE_SOURCE_DIR}/picts/chart-icon.rc -o ${CMAKE_CURRENT_BINARY_DIR}/chartico.o ) set(ANALYZER_SRC ${ANALYZER_SRC} ${CMAKE_CURRENT_BINARY_DIR}/chartico.o) endif(MINGW) diff --git a/src/guitar/tfingerboard.cpp b/src/guitar/tfingerboard.cpp index 9434015d8201497cc106bafcb2a037ae6dc7a8fb..1dbe093696d901385232106fbcf4f396a2c0a979 100644 --- a/src/guitar/tfingerboard.cpp +++ b/src/guitar/tfingerboard.cpp @@ -17,13 +17,13 @@ ***************************************************************************/ #include "tfingerboard.h" -#include "tglobals.h" -#include "ttune.h" -#include <tgraphicstexttip.h> +#include <tglobals.h> +#include <music/ttune.h> +#include <graphics/tgraphicstexttip.h> #include <animations/tstrikedoutitem.h> #include <animations/tcombinedanim.h> #include <tcolor.h> -#include <QtGui> +#include <QtWidgets> #include <QDebug> extern Tglobals *gl; @@ -816,7 +816,7 @@ void TfingerBoard::paintQuestMark() { m_questMark->setFont(f); int off = -1, off2 = 0; if (!gl->GisRightHanded) { - m_questMark->scale(-1, 1); +// m_questMark->scale(-1, 1); TODO if (m_questPos.fret() == 1) off = 1; else diff --git a/src/guitar/tfingerboard.h b/src/guitar/tfingerboard.h index c96d2e29c83113281212195daadef19c73e05f00..31cd922d2bba6e0cf3015c267b6138db6c9fd8e2 100644 --- a/src/guitar/tfingerboard.h +++ b/src/guitar/tfingerboard.h @@ -19,8 +19,8 @@ #ifndef TFINGERBOARD_H #define TFINGERBOARD_H -#include "tnote.h" -#include "tfingerpos.h" +#include <music/tnote.h> +#include <tfingerpos.h> #include <QWidget> #include <QGraphicsView> #include <QGraphicsLineItem> diff --git a/src/libs/core/music/tnote.cpp b/src/libs/core/music/tnote.cpp index 8a26e1a55c516c8e943a31448af456c8f54848b7..0e121c711d179cbd1e3439f59f10842bad8c0638 100644 --- a/src/libs/core/music/tnote.cpp +++ b/src/libs/core/music/tnote.cpp @@ -16,7 +16,7 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ***************************************************************************/ #include "tnote.h" -#include "tnamestylefilter.h" +#include <music/tnamestylefilter.h> #include <sstream> #include <string> diff --git a/src/libs/core/music/tnote.cpp-qlist b/src/libs/core/music/tnote.cpp-qlist new file mode 100644 index 0000000000000000000000000000000000000000..30fe322cab94d68487312f4f7bc8445015d2b7c6 --- /dev/null +++ b/src/libs/core/music/tnote.cpp-qlist @@ -0,0 +1,403 @@ +/*************************************************************************** + * Copyright (C) 2006-2013 by Tomasz Bojczuk * + * tomaszbojczuk@gmail.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program. If not, see <http://www.gnu.org/licenses/>. * + ***************************************************************************/ +#include "tnote.h" +#include "tnamestylefilter.h" + +#include <sstream> +#include <string> +#include <iostream> +#include <unistd.h> + +std::string IntToString(int num) { + std::ostringstream myStream; + myStream << num << std::flush; + return(myStream.str()); +} + + +std::string CharToString(char chr) { + std::ostringstream myStream; + myStream << (int) chr << std::flush; + return(myStream.str()); +} + + +QString accidInSpan(char accid) { + QString accTxt = ""; + switch (accid) { + case -2: accTxt = "B"; break; + case -1: accTxt = "b"; break; + case 1: accTxt = "#"; break; + case 2: accTxt = "x"; break; + default: accTxt = ""; + } + return QString("<span style=\"font-family: nootka;\">%1</span>").arg(accTxt); +} + +/*static*/ +std::string Tnote::m_solmization[7] = {"Do", "Re", "Mi", "Fa", "Sol", "La", "Si"}; +std::string Tnote::m_solmizationRu[7] = {"До", "Ре", "Ми", "Фа", "Соль", "ЛÑ", "Си"}; +// QString Tnote::m_KodalySharps[6] = {"Di", "Ri", "", "Fi", "Si", "Li"}; +// QString Tnote::m_KodalyFlats[7] = {"", "Ra", "Me", "", "Se", "Le", "Te" }; + +Tnote::EnameStyle Tnote::defaultStyle = Tnote::e_norsk_Hb; + + +//############################################################################################# +//################################ PUBLIC ##################################################### +//############################################################################################# +Tnote::Tnote () +{ + note = 0; + octave = 0; + acidental = Tnote::e_Natural; +} + + +Tnote::Tnote( char m_diatonNote, char m_octave, char m_acidental) +{ + note = m_diatonNote; + octave = m_octave; + acidental = m_acidental; +} + + +Tnote::Tnote (short chromaticNrOfNote) +{ + switch ((chromaticNrOfNote + 143) % 12 + 1) { + case 1: note = 1; acidental = 0; break; + case 2: note = 1; acidental = 1; break; + case 3: note = 2; acidental = 0; break; + case 4: note = 2; acidental = 1; break; + case 5: note = 3; acidental = 0; break; + case 6: note = 4; acidental = 0; break; + case 7: note = 4; acidental = 1; break; + case 8: note = 5; acidental = 0; break; + case 9: note = 5; acidental = 1; break; + case 10: note = 6; acidental = 0; break; + case 11: note = 6; acidental = 1; break; + case 12: note = 7; acidental = 0; break; + } + octave = ((chromaticNrOfNote+143) / 12 - 12) ; +} + + +Tnote::~Tnote () +{} + + +short Tnote::getChromaticNrOfNote() { + char a; + switch (Tnote::note) { + case 1: a = 1; break; // note C + case 2: a = 3; break; // D + case 3: a = 5; break; // E + case 4: a = 6; break; // F + case 5: a = 8; break; // G + case 6: a = 10; break; // A + case 7: a = 12; break; // H + } + return a + (Tnote::octave)*12 + Tnote::acidental; +} + + +Tnote Tnote::showAsNatural() { + return Tnote(Tnote(note,octave,acidental).getChromaticNrOfNote()); +} + + +Tnote Tnote::showWithFlat() { + if (acidental != Tnote::e_Flat) { + Tnote outputNote = Tnote::showAsNatural(); +// Tnote::showAsNatural() allways returns notes with sharps or neutral, and never returns H# or E#, but +// C or F, + if (outputNote.acidental == Tnote::e_Sharp) { + outputNote.note++; + outputNote.acidental = Tnote::e_Flat; + } + else //so only for H changed to Cb we have to increment octave, + if (outputNote.note == 7 || outputNote.note == 3) { + if (outputNote.note == 7) {outputNote.octave++; outputNote.note = 1;} + if (outputNote.note == 3) outputNote.note = 4;//and for E simply convert to Fb + outputNote.acidental = Tnote::e_Flat; + } + return outputNote; + } + else return Tnote(note,octave,acidental); +} + + +Tnote Tnote::showWithSharp() { + if (acidental != Tnote::e_Sharp) { + Tnote outputNote = Tnote::showAsNatural(); + if (outputNote.acidental == Tnote::e_Natural) { + if (outputNote.note == 4) { outputNote.note = 3; outputNote.acidental = Tnote::e_Sharp;} + else + if (outputNote.note == 1) + {outputNote.octave--; outputNote.note = 7; outputNote.acidental = Tnote::e_Sharp;} + } + return outputNote; + } + else return Tnote(note,octave,acidental); +} + + +Tnote Tnote::showWithDoubleSharp() { + if (acidental != Tnote::e_DoubleSharp) { + Tnote outputNote = Tnote::showAsNatural(); + if (outputNote.acidental == Tnote::e_Natural) { + if (outputNote.note == 4) {outputNote.acidental = Tnote::e_Sharp; outputNote.note = 3;} + else + if (outputNote.note == 1) + {outputNote.acidental = Tnote::e_Sharp; outputNote.note = 7; outputNote.octave--;} + else + {outputNote.acidental = Tnote::e_DoubleSharp; outputNote.note--;} + } + return outputNote; + } + else return Tnote(note,octave,acidental); +} + + +Tnote Tnote::showWithDoubleFlat() { + if (acidental != Tnote::e_DoubleFlat) { + Tnote outputNote = Tnote(note,octave,acidental); + if (outputNote.acidental == Tnote::e_Flat && ( (outputNote.note == 3) || (outputNote.note == 7)) ) { + if (outputNote.note == 3) {outputNote.acidental = Tnote::e_DoubleFlat; outputNote.note = 4;} + else + {outputNote.acidental = Tnote::e_DoubleFlat; outputNote.note = 1; outputNote.octave++;} + } + else { + outputNote = outputNote.showAsNatural(); + //Tnote outputNote = Tnote::showAsNatural(); + if (outputNote.acidental == Tnote::e_Natural) { + if (outputNote.note == 3) {outputNote.acidental = Tnote::e_Flat; outputNote.note = 4;} + else + if (outputNote.note == 7) + {outputNote.acidental = Tnote::e_Flat; outputNote.note = 1; outputNote.octave++;} + else + {outputNote.acidental = Tnote::e_DoubleFlat; outputNote.note++;} + } + else + if (outputNote.acidental == Tnote::e_Sharp) { + if (outputNote.note == 2) + {outputNote.acidental = Tnote::e_DoubleFlat; outputNote.note = 4;} + else + if (outputNote.note == 6) + {outputNote.acidental = Tnote::e_DoubleFlat; outputNote.note = 1; outputNote.octave++;} + else + outputNote = outputNote.showWithFlat(); + } + } + return outputNote; + } + else return Tnote(note,octave,acidental); +} + + +short Tnote::compareNotes( Tnote otherNote, short ignoreOctave ) { + if (!ignoreOctave) + if ( (note == otherNote.note) && ( acidental == otherNote.acidental) + && (octave == otherNote.octave) ) return 1; + else return 0; + else + if ( (note == otherNote.note) && ( acidental == otherNote.acidental) ) + return 1; + else return 0; +} + + +TnotesList Tnote::getTheSameNotes(bool enableDbAccids) { + TnotesList notesL; + short cnt;//counter of notes. With double accids is 5 (4) without 3 (2) + notesL << (Tnote(note, octave, acidental)); + if (notesL[0].acidental != Tnote::e_Natural) + notesL << (notesL[0].showAsNatural()); + if (notesL[0].acidental != Tnote::e_Sharp) + notesL << (notesL[0].showWithSharp()); + if (notesL[0].acidental != Tnote::e_Flat) + notesL << (notesL[0].showWithFlat()); + if (enableDbAccids) { + if (notesL[0].acidental != Tnote::e_DoubleSharp) + notesL << (notesL[0].showWithDoubleSharp()); + if (notesL[0].acidental != Tnote::e_DoubleFlat) + notesL << (notesL[0].showWithDoubleFlat()); + cnt = 4; + } + else cnt = 2; + for( int m=0; m < cnt; m++) { + for( int n=cnt; n > m; n--){ + if ((notesL[m].note != 0) && (notesL[n].note != 0) ) + if(notesL[m].compareNotes(notesL[n]) ) notesL[n].note = 0; + } + } + TnotesList::iterator m = notesL.end(); + while( m != notesL.begin() ){ + --m; + if (!(*m).note) notesL.erase(m); + } + return notesL; +} + + +std::string Tnote::getName( EnameStyle notation, bool showOctave ) { + std::string noteStr; + if (note < 1 || note > 7) { + std::cout << "Oops !! getName() with note=0\n"; + return "none"; + } + switch (TnameStyleFilter::get(notation)) { + case e_italiano_Si: + noteStr = m_solmization[note - 1] + signsAcid[acidental + 2]; + break; + case e_russian_Ci: + noteStr = m_solmizationRu[note - 1] + signsAcid[acidental + 2]; + break; + case e_deutsch_His: + noteStr = Letters[note - 1]; + switch (acidental) { + case e_Natural: break; + case e_DoubleSharp: noteStr = noteStr + "isis"; break; + case e_Sharp: noteStr = noteStr + "is"; break; + case e_DoubleFlat: switch (note) { + case 3: noteStr = noteStr + "ses"; break; + case 6: noteStr = noteStr + "sas"; break; + default: noteStr = noteStr + "eses"; break; + } + break; + case e_Flat: switch (note) { + case 3: noteStr = noteStr + "s"; break; + case 6: noteStr = noteStr + "s"; break; + case 7: noteStr = "B"; break; + default: noteStr = noteStr + "es"; break; + } + break; + } + break; + case e_nederl_Bis: + noteStr = Letters[note-1]; + if (note == 7) noteStr = "B"; + switch( acidental ){ + case e_Natural: break; + case e_DoubleSharp: noteStr = noteStr + "isis"; break; + case e_Sharp: noteStr = noteStr + "is"; break; + case e_DoubleFlat: + switch (note) { + case 3: noteStr = noteStr + "ses"; break; + case 6: noteStr = noteStr + "ses"; break; + default: noteStr = noteStr + "eses"; break; + } + break; + case e_Flat: + switch (note) { + case 3: noteStr = noteStr + "s"; break; + case 6: noteStr = noteStr + "s"; break; + default: noteStr = noteStr + "es"; break; + } + break; + } + break; + default: + noteStr = Letters[note - 1]; + if ((notation == e_english_Bb) && (note == 7)) noteStr = "B"; + noteStr = noteStr + signsAcid[acidental + 2]; + break; + } + if (showOctave) + noteStr = noteStr + CharToString(octave); + return noteStr; +} + + +std::string Tnote::getName( Tnote eNote, EnameStyle notation, bool showOctave ) +{ + note = eNote.note; + acidental = eNote.acidental; + octave = eNote.octave; + return getName(notation, showOctave); +} + + +QString Tnote::toText(Tnote::EnameStyle notation, bool showOctave) { + return QString::fromUtf8(getName(notation, showOctave).data()); +} + + +QString Tnote::toRichText(Tnote::EnameStyle notation, bool showOctave) { + QString result = toText(notation, false); + if (notation == Tnote::e_italiano_Si || + notation == Tnote::e_russian_Ci || + notation == Tnote::e_english_Bb || + notation == Tnote::e_norsk_Hb ) { + if (acidental) + result.replace(QString::fromStdString(signsAcid[acidental + 2]), QString("<sub>%1</sub>").arg(accidInSpan(acidental))); + } + if (acidental == -2) + result.replace("B", "!"); // store capital B otherwise toLower() make it lower + result = result.toLower(); // it converts double flat (B) to single flat (b) + if (acidental == -2) + result.replace("!", "B"); // bring back capital B + if (showOctave) { + if (octave < 0) { //first letter capitalize + QString l1 = result.mid(0, 1).toUpper(); + result.replace(0, 1, l1); + if (octave < -1) + result = result + QString("<sub>%1</sub>").arg(int(octave*(-1)-1)); + } + if (octave > 0) + result = result + QString("<sup>%1</sup>").arg((int)octave); + } + return result; +} + + +bool Tnote::operator ==( const Tnote N2 ) { + return ( note == N2.note && octave == N2.octave && acidental == N2.acidental); +} + + +bool Tnote::operator !=( const Tnote N2 ) { + return ( note != N2.note || octave != N2.octave || acidental != N2.acidental); +} + + +bool getNoteFromStream(QDataStream &in, Tnote &n) { + bool ok = true; + qint8 nn, oo, aa; + in >> nn >> oo >> aa; + if (nn < 1 || nn > 8 || aa < -2 || aa > 2) { + nn = 1; aa = 0; oo = 0; + ok = false; + } + n = Tnote(nn, oo, aa); + return ok; +} + + +QDataStream &operator << (QDataStream &out, const Tnote &n) { + out << (qint8)n.note << (qint8)n.octave << (qint8)n.acidental; + return out; +} + + +QDataStream &operator>> (QDataStream &in, Tnote &n) { + qint8 nn, oo, aa; + in >> nn >> oo >> aa; + n = Tnote(nn, oo, aa); + return in; +} diff --git a/src/libs/core/music/tnote.h b/src/libs/core/music/tnote.h index a401a3975065a3fafe92358bd0b18cea3fb532e7..fec17f95f7bb464a07c45f7e1490bddc20470261 100644 --- a/src/libs/core/music/tnote.h +++ b/src/libs/core/music/tnote.h @@ -19,18 +19,19 @@ #define TNOTE_H #include <string> -#include <vector> #include <QDataStream> +#include <vector> #include <nootkacoreglobal.h> class Tnote; +// typedef QList<Tnote> TnotesList; typedef std::vector<Tnote> TnotesList; -const std::string Letters [7] = {"C","D","E","F","G","A","H"}; -const std::string signsAcid[5] = {"bb","b","","#","x",}; +NOOTKACORE_EXPORT const std::string Letters [7] = {"C","D","E","F","G","A","H"}; +NOOTKACORE_EXPORT const std::string signsAcid[5] = {"bb","b","","#","x",}; /** @@ -150,7 +151,7 @@ private: }; /** This function is substitute of >> operator for @class Tnote. * It checks is Tnote valid, and return Boolean about it. */ -bool getNoteFromStream(QDataStream &in, Tnote &n); +NOOTKACORE_EXPORT bool getNoteFromStream(QDataStream &in, Tnote &n); NOOTKACORE_EXPORT QDataStream &operator<< (QDataStream &out, const Tnote &n); NOOTKACORE_EXPORT QDataStream &operator>> (QDataStream &in, Tnote &n); diff --git a/src/libs/core/score/tscorenote.cpp b/src/libs/core/score/tscorenote.cpp index d3c5811e0e303b01d2c6d7de7c0d9dddb0c1fe8a..9e7ddc0ebcab7d5008111517d8eacdf2fbc57cf3 100644 --- a/src/libs/core/score/tscorenote.cpp +++ b/src/libs/core/score/tscorenote.cpp @@ -161,7 +161,8 @@ void TscoreNote::setColor(QColor color) { void TscoreNote::setPointedColor(QColor color) { m_workColor = color; - m_workNote->setPen(QPen(m_workColor)); + m_workNote->setPen(QPen(m_workColor, 0.2)); +// m_workNote->setPen(Qt::NoPen); m_workNote->setBrush(QBrush(m_workColor, Qt::SolidPattern)); m_workAccid->setBrush(QBrush(m_workColor)); for (int i = 0; i < m_upLines.size(); i++) diff --git a/src/libs/core/tinitcorelib.cpp b/src/libs/core/tinitcorelib.cpp old mode 100644 new mode 100755 index ffbb058fcc5b41ec3e9661346d6792d4d5739e1d..1e3d8d5aa0d479663f448ac1ff940dcc6441af0d --- a/src/libs/core/tinitcorelib.cpp +++ b/src/libs/core/tinitcorelib.cpp @@ -55,7 +55,7 @@ void prepareTranslations(QApplication* a) { #if defined(Q_OS_LINUX) qtTranslator.load("qt_" + ll, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); #else - qtTranslator.load("qt_" + ll, gl->path + "lang"); + qtTranslator.load("qt_" + ll, Tglob::glob()->path + "lang"); #endif a->installTranslator(&qtTranslator); diff --git a/src/main.cpp b/src/main.cpp index 3108f1d41e28483de67665c998265e505cdc1011..e6456d7a86ea227d599388555adb7ede5c5173dc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,9 +16,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. * ***************************************************************************/ -#include <QtGui> #include "mainwindow.h" -#include "tglobals.h" +#include <tinitcorelib.h> +#include <QPointer> +#include <QFile> +#include <QSettings> +#include <QApplication> Tglobals *gl; bool resetConfig; @@ -40,49 +43,27 @@ int main(int argc, char *argv[]) } resetConfig = false; a = new QApplication(argc, argv); -#if defined (Q_OS_MAC) - QApplication::setStyle(new QPlastiqueStyle); -#endif +// #if defined (Q_OS_MAC) +// QApplication::setStyle(new QPlastiqueStyle); +// #endif // qDebug() << a->style()->objectName(); gl = new Tglobals(); gl->path = Tglobals::getInstPath(qApp->applicationDirPath()); confFile = gl->config->fileName(); -// loading translations - QString ll = gl->lang; - if (ll == "") - ll = QLocale::system().name(); - QTranslator qtTranslator; -#if defined(Q_OS_LINUX) - qtTranslator.load("qt_" + ll, QLibraryInfo::location(QLibraryInfo::TranslationsPath)); -#else - qtTranslator.load("qt_" + ll, gl->path + "lang"); -#endif - a->installTranslator(&qtTranslator); - - QTranslator nooTranslator; - nooTranslator.load("nootka_" + ll, gl->path + "lang"); - a->installTranslator(&nooTranslator); -// loading nootka font - QFontDatabase fd; -// #if defined(Q_OS_WIN32) - int fid = fd.addApplicationFont(gl->path + "fonts/nootka.ttf"); -// #else -// int fid = fd.addApplicationFont(gl->path + "fonts/nootka.otf"); -// #endif - if (fid == -1) { - QMessageBox::critical(0, "", QCoreApplication::translate("main", "<center>Can not load a font.<br>Try to install nootka.ttf manually.</center>")); - return 111; - } + initCoreLibrary(gl); + prepareTranslations(a); + if (!loadNootkaFont(a)) + return 111; // creating main window w = new MainWindow(); #if defined (Q_OS_MAC) - // to alow opening nootka files by clicking them in MacOs finder + // to allow opening nootka files by clicking them in MacOs finder a->installEventFilter(w); #endif w->show(); - if (firstTime && argc > 1) - w->openFile(QString::fromLocal8Bit(argv[argc - 1])); +// if (firstTime && argc > 1) +// w->openFile(QString::fromLocal8Bit(argv[argc - 1])); firstTime = false; exitCode = a->exec(); delete w; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a89fead2bcf424c56886c03593ca3d599b4484d9..bff73a4247695f1c4c2dcb2e87895f178e9e10fc 100755 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -17,203 +17,149 @@ ***************************************************************************/ #include "mainwindow.h" -#include "tglobals.h" -#include "tsettingsdialog.h" -#include "tlevelcreatordlg.h" -#include "tlevelselector.h" -#include "taboutnootka.h" -#include "tfirstrunwizzard.h" -#include "tsupportnootka.h" -#include "tnootkalabel.h" +#include <tglobals.h> +#include "score/tmainscore.h" #include "widgets/troundedlabel.h" -#include "widgets/tanimedchbox.h" -#include "texamsettings.h" -#include <tupdateprocess.h> -#include <tcolor.h> -#include "tsound.h" -#include "tpushbutton.h" -#include "tmainscore.h" -#include "texam.h" -#include "tprogresswidget.h" -#include "texamview.h" -#include "taudioparams.h" -#include "tpitchview.h" -#include "tanalysdialog.h" -#include "tquestionpoint.h" -#include "tnotename.h" -#include "tfingerboard.h" -#include <QtGui> +#include "guitar/tfingerboard.h" +// // #include "tsettingsdialog.h" +// // #include "tlevelcreatordlg.h" +// // #include "tlevelselector.h" +// // #include "taboutnootka.h" +// // #include "tfirstrunwizzard.h" +// // #include "tsupportnootka.h" +// // #include "tnootkalabel.h" +// #include "widgets/tanimedchbox.h" +// #include "texamsettings.h" +// #include <tupdateprocess.h> +// #include <tcolor.h> +// #include "tsound.h" +// #include "tpushbutton.h" +// #include "tmainscore.h" +// #include "texam.h" +// #include "tprogresswidget.h" +// #include "texamview.h" +// #include "taudioparams.h" +// #include "tpitchview.h" +// #include "tanalysdialog.h" +// #include "tquestionpoint.h" +// #include "tnotename.h" +#include <QtWidgets> extern Tglobals *gl; extern bool resetConfig; + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), - ex(0), - m_isPlayerFree(true), - m_pitchContainer(0), - m_rightLay(0), - m_extraFontOffset(0) + m_statusText(""), + m_curBG(-1), m_prevBg(-1), + m_lockStat(false) +// ex(0), +// m_isPlayerFree(true), +// m_pitchContainer(0), +// m_rightLay(0), +// m_extraFontOffset(0) { - Ttune::prepareDefinedTunes(); -#if defined(Q_OS_MAC) - QColor shadowC(palette().text().color()); - shadowC.setAlpha(50); - shadowC = Tcolor::merge(shadowC, palette().base().color()); - TpushButton::setCheckColor(gl->SpointerColor, palette().base().color()); - TquestionPoint::setColors(QColor(gl->EanswerColor.name()), QColor(gl->EquestionColor.name()), - QColor(gl->EnotBadColor.name()), shadowC, palette().window().color()); -#else - TpushButton::setCheckColor(palette().highlight().color(), palette().highlightedText().color() ); - TquestionPoint::setColors(QColor(gl->EanswerColor.name()), QColor(gl->EquestionColor.name()), - QColor(gl->EnotBadColor.name()), palette().shadow().color(), palette().base().color()); -#endif +// #if defined(Q_OS_MAC) +// TquestionPoint::setColors(QColor(gl->EanswerColor.name()), QColor(gl->EquestionColor.name()), +// QColor(gl->EnotBadColor.name()), shadowC, palette().window().color()); +// #else +// TquestionPoint::setColors(QColor(gl->EanswerColor.name()), QColor(gl->EquestionColor.name()), +// QColor(gl->EnotBadColor.name()), palette().shadow().color(), palette().base().color()); +// #endif #if defined(Q_OS_LINUX) - setWindowIcon(QIcon(gl->path+"picts/nootka.svg")); + setWindowIcon(QIcon(gl->path + "picts/nootka.svg")); #else - setWindowIcon(QIcon(gl->path+"picts/nootka.png")); + setWindowIcon(QIcon(gl->path + "picts/nootka.png")); #endif setMinimumSize(720, 480); gl->config->beginGroup("General"); setGeometry(gl->config->value("geometry", QRect(50, 50, 750, 480)).toRect()); - if (gl->isFirstRun) { - TfirstRunWizzard *firstWizz = new TfirstRunWizzard(); - firstWizz->exec(); - delete firstWizz; - gl->isFirstRun = false; - } else { // show support window once but not with first run wizard - QString newVersion = gl->config->value("version", "").toString(); - if (newVersion != gl->version) { - QTimer::singleShot(200, this, SLOT(showSupportDialog())); - } else { // check for updates - gl->config->endGroup(); - gl->config->beginGroup("Updates"); - if (gl->config->value("enableUpdates", true).toBool() && TupdateProcess::isPossible()) { - TupdateProcess *process = new TupdateProcess(true, this); - process->start(); - } - } - } +// if (gl->isFirstRun) { +// TfirstRunWizzard *firstWizz = new TfirstRunWizzard(); +// firstWizz->exec(); +// delete firstWizz; +// gl->isFirstRun = false; +// } else { // show support window once but not with first run wizard +// QString newVersion = gl->config->value("version", "").toString(); +// if (newVersion != gl->version) { +// QTimer::singleShot(200, this, SLOT(showSupportDialog())); +// } else { // check for updates +// gl->config->endGroup(); +// gl->config->beginGroup("Updates"); +// if (gl->config->value("enableUpdates", true).toBool() && TupdateProcess::isPossible()) { +// TupdateProcess *process = new TupdateProcess(true, this); +// process->start(); +// } +// } +// } gl->config->endGroup(); - TkeySignature::setNameStyle(gl->SnameStyleInKeySign, gl->SmajKeyNameSufix, gl->SminKeyNameSufix); - - sound = new Tsound(this); +// sound = new Tsound(this); -// qDebug() << style()->objectName(); //------------------------------------------------------------------- // Creating GUI elements innerWidget = new QWidget(this); nootBar = new QToolBar(tr("main toolbar"), innerWidget); - nootBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum); +// nootBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum); if (gl->hintsEnabled) nootBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); else nootBar->setToolButtonStyle(Qt::ToolButtonIconOnly); score = new TmainScore(innerWidget); - score->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - pitchView = new TpitchView(sound->sniffer, this); - sound->setPitchView(pitchView); +// score->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); +// pitchView = new TpitchView(sound->sniffer, this); +// sound->setPitchView(pitchView); // Hints - label with clues - QHBoxLayout *statLay = new QHBoxLayout; m_statLab = new TroundedLabel(innerWidget); m_statLab->setWordWrap(true); m_statLab->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Ignored); m_statLab->setContentsMargins(1, 1, 1, 1); // overwrite 5 px margins of TroundedLabel - statLay->addWidget(m_statLab, 0, Qt::AlignTop); - // Expert corner - autoRepeatChB = new TanimedChBox(innerWidget); - autoRepeatChB->hide(); - autoRepeatChB->setStatusTip(TexamSettings::autoNextQuestTxt()); - autoRepeatChB->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - expertAnswChB = new TanimedChBox(innerWidget); - expertAnswChB->hide(); - expertAnswChB->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - expertAnswChB->setStatusTip(TexamSettings::expertsAnswerTxt()); - correctChB = new TanimedChBox(innerWidget); - correctChB->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - correctChB->setStatusTip(tr("show correct answer for every mistake")); - correctChB->hide(); - - progress = new TprogressWidget(innerWidget); - examResults = new TexamView(innerWidget); - examResults->setStyleBg(Tcolor::bgTag(gl->EanswerColor), Tcolor::bgTag(gl->EquestionColor), - Tcolor::bgTag(gl->EnotBadColor)); - - progress->hide(); - examResults->hide(); QColor C(palette().text().color()); -#if defined (Q_OS_WIN) - C.setAlpha(20); -#else - C.setAlpha(15); -#endif - C = Tcolor::merge(C, palette().window().color()); - nootLabel = new TnootkaLabel(gl->path + "picts/logo.png", innerWidget, C); +// #if defined (Q_OS_WIN) +// C.setAlpha(20); +// #else +// C.setAlpha(15); +// #endif +// C = Tcolor::merge(C, palette().window().color()); +// nootLabel = new TnootkaLabel(gl->path + "picts/logo.png", innerWidget, C); - noteName = new TnoteName(innerWidget); - noteName->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); - noteName->setEnabledDblAccid(gl->doubleAccidentalsEnabled); +// noteName = new TnoteName(innerWidget); +// noteName->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); +// noteName->setEnabledDblAccid(gl->doubleAccidentalsEnabled); guitar = new TfingerBoard(innerWidget); //------------------------------------------------------------------- // Setting layout - QVBoxLayout *chBlay = new QVBoxLayout; - chBlay->addWidget(correctChB); - chBlay->addWidget(autoRepeatChB); - chBlay->addWidget(expertAnswChB); - chBlay->addStretch(1); - statLay->addLayout(chBlay); - QHBoxLayout *toolAndHintLay = new QHBoxLayout; - toolAndHintLay->addWidget(nootBar, 0, Qt::AlignTop); - toolAndHintLay->addLayout(statLay); - m_scoreLay = new QVBoxLayout; - m_scoreLay->addWidget(score); - m_scoreLay->addWidget(pitchView); - QVBoxLayout *rightPaneLay = new QVBoxLayout; - rightPaneLay->addStretch(1); - rightPaneLay->addWidget(progress); - rightPaneLay->addWidget(examResults); - rightPaneLay->addWidget(nootLabel); - rightPaneLay->addStretch(1); - rightPaneLay->addWidget(noteName); - rightPaneLay->addStretch(1); - m_rightLay = rightPaneLay; - QHBoxLayout *scoreAndNameLay = new QHBoxLayout; - scoreAndNameLay->addLayout(m_scoreLay); - scoreAndNameLay->addLayout(rightPaneLay); - QVBoxLayout *mainLay = new QVBoxLayout; - mainLay->addLayout(toolAndHintLay); - mainLay->addLayout(scoreAndNameLay); - mainLay->addWidget(guitar); - innerWidget->setLayout(mainLay); - setCentralWidget(innerWidget); + QVBoxLayout *mainLay = new QVBoxLayout; + mainLay->addWidget(nootBar); + mainLay->addWidget(m_statLab); + mainLay->addWidget(score); + mainLay->addWidget(guitar); + innerWidget->setLayout(mainLay); + setCentralWidget(innerWidget); //------------------------------------------------------------------- - m_statusText = ""; - m_prevBg = -1; - m_curBG = -1; - m_lockStat = false; - m_levelCreatorExist = false; +// m_levelCreatorExist = false; createActions(); connect(score, SIGNAL(noteChanged(int,Tnote)), this, SLOT(noteWasClicked(int,Tnote))); - connect(score, SIGNAL(clefChanged(Tclef)), this, SLOT(adjustAmbitus())); - connect(score, SIGNAL(pianoStaffSwitched()), this, SLOT(adjustAmbitus())); - connect(noteName, SIGNAL(noteNameWasChanged(Tnote)), this, SLOT(noteNameWasChanged(Tnote))); - connect(noteName, SIGNAL(heightTooSmall()), this, SLOT(fixNoteNameSize())); - connect(guitar, SIGNAL(guitarClicked(Tnote)), this, SLOT(guitarWasClicked(Tnote))); - connect(sound, SIGNAL(detectedNote(Tnote)), this, SLOT(soundWasPlayed(Tnote))); - - if (gl->A->OUTenabled && !sound->isPlayable()) - QMessageBox::warning(this, "", tr("Problems with sound output")); +// connect(score, SIGNAL(clefChanged(Tclef)), this, SLOT(adjustAmbitus())); +// connect(score, SIGNAL(pianoStaffSwitched()), this, SLOT(adjustAmbitus())); +// connect(noteName, SIGNAL(noteNameWasChanged(Tnote)), this, SLOT(noteNameWasChanged(Tnote))); +// connect(noteName, SIGNAL(heightTooSmall()), this, SLOT(fixNoteNameSize())); +// connect(guitar, SIGNAL(guitarClicked(Tnote)), this, SLOT(guitarWasClicked(Tnote))); +// connect(sound, SIGNAL(detectedNote(Tnote)), this, SLOT(soundWasPlayed(Tnote))); + +// if (gl->A->OUTenabled && !sound->isPlayable()) +// QMessageBox::warning(this, "", tr("Problems with sound output")); } @@ -232,28 +178,25 @@ MainWindow::~MainWindow() void MainWindow::createActions() { settingsAct = new QAction(tr("Settings"), this); settingsAct->setStatusTip(tr("Application preferences")); -// settingsAct->setToolTip(settingsAct->statusTip()); settingsAct->setIcon(QIcon(gl->path+"picts/systemsettings.png")); - connect(settingsAct, SIGNAL(triggered()), this, SLOT(createSettingsDialog())); +// connect(settingsAct, SIGNAL(triggered()), this, SLOT(createSettingsDialog())); levelCreatorAct = new QAction(this); - connect(levelCreatorAct, SIGNAL(triggered()), this, SLOT(openLevelCreator())); +// connect(levelCreatorAct, SIGNAL(triggered()), this, SLOT(openLevelCreator())); startExamAct = new QAction(this); - connect(startExamAct, SIGNAL(triggered()), this, SLOT(startExamSlot())); +// connect(startExamAct, SIGNAL(triggered()), this, SLOT(startExamSlot())); setStartExamActParams(); // set text and icon also for levelCreatorAct analyseAct = new QAction(tr("Analyze", "could be Chart as well"), this); analyseAct->setIcon(QIcon(gl->path+"picts/charts.png")); analyseAct->setStatusTip(tr("Analysis of exam results")); -// analyseAct->setToolTip(analyseAct->statusTip()); - connect(analyseAct, SIGNAL(triggered()), this, SLOT(analyseSlot())); +// connect(analyseAct, SIGNAL(triggered()), this, SLOT(analyseSlot())); aboutAct = new QAction(tr("About"), this); aboutAct->setStatusTip(tr("About Nootka")); -// aboutAct->setToolTip(aboutAct->statusTip()); aboutAct->setIcon(QIcon(gl->path+"picts/about.png")); - connect(aboutAct, SIGNAL(triggered()), this, SLOT(aboutSlot())); +// connect(aboutAct, SIGNAL(triggered()), this, SLOT(aboutSlot())); nootBar->addAction(settingsAct); nootBar->addAction(levelCreatorAct); @@ -264,9 +207,10 @@ void MainWindow::createActions() { nootBar->setMovable(false); } + void MainWindow::setStartExamActParams() { levelCreatorAct->setText(tr("Level")); - levelCreatorAct->setStatusTip(TlevelCreatorDlg::levelCreatorTxt()); +// levelCreatorAct->setStatusTip(TlevelCreatorDlg::levelCreatorTxt()); // levelCreatorAct->setToolTip(levelCreatorAct->statusTip()); levelCreatorAct->setIcon(QIcon(gl->path+"picts/levelCreator.png")); @@ -276,6 +220,7 @@ void MainWindow::setStartExamActParams() { startExamAct->setIcon(QIcon(gl->path+"picts/startExam.png")); } + void MainWindow::setStatusMessage(QString msg) { if (!m_lockStat) m_statLab->setText("<center>" + msg + "</center>"); @@ -302,7 +247,7 @@ void MainWindow::setMessageBg(QColor bg) { m_curBG = bg; } - +/* void MainWindow::clearAfterExam(TexamExecutor::Estate examState) { setStartExamActParams(); delete ex; @@ -468,25 +413,25 @@ void MainWindow::analyseSlot() { delete ad; sound->go(); } - +*/ void MainWindow::noteWasClicked(int index, Tnote note) { Q_UNUSED(index) - if (m_isPlayerFree) - sound->play(note); - if (gl->showEnharmNotes){ - TnotesList noteList; - noteList.push_back(note); - noteList.push_back(score->getNote(1)); - noteList.push_back(score->getNote(2)); - noteName->setNoteName(noteList); - } else - noteName->setNoteName(note); +// if (m_isPlayerFree) +// sound->play(note); +// if (gl->showEnharmNotes){ +// TnotesList noteList; +// noteList << (note); +// noteList << (score->getNote(1)); +// noteList << (score->getNote(2)); +// noteName->setNoteName(noteList); +// } //else +// noteName->setNoteName(note); if (guitar->isVisible()) guitar->setFinger(note); } - +/* void MainWindow::noteNameWasChanged(Tnote note) { sound->play(note); score->setNote(0, note); @@ -525,7 +470,7 @@ void MainWindow::soundWasPlayed(Tnote note) { score->setNote(0, note); if (guitar->isVisible()) guitar->setFinger(note); -} +}*/ //########################################################################################## //####################### PROTECTED SLOTS ######################################## @@ -538,7 +483,7 @@ void MainWindow::restoreMessage() { m_prevMsg = ""; } - +/* void MainWindow::showSupportDialog() { sound->wait(); sound->stopPlaying(); @@ -625,7 +570,7 @@ void MainWindow::adjustAmbitus() { } else sound->setDefaultAmbitus(); } - +*/ //########################################################################################## @@ -644,10 +589,10 @@ bool MainWindow::event(QEvent *event) { setMessageBg(-1); m_statLab->setText("<center>" + se->tip() + "</center>"); } - } else - if (ex && (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease)) { - ex->event(event); - } + } // else // TODO +// if (ex && (event->type() == QEvent::MouseButtonPress || event->type() == QEvent::MouseButtonRelease)) { +// ex->event(event); +// } return QMainWindow::event(event); } @@ -663,84 +608,84 @@ void MainWindow::updateSize(QSize newS) { qreal fact = (qreal)(m_statFontSize * 1.5) / (qreal)fMetr.boundingRect("A").height(); f.setPointSize(f.pointSize() * fact); m_statLab->setFont(f); - int newGuitH = (newS.height() - nootBar->height()) * 0.25; - if (gl->instrument == e_electricGuitar || gl->instrument == e_bassGuitar) { - QPixmap rosePix(gl->path + "picts/pickup.png"); - qreal pickCoef = ((newGuitH * 2.9) / 614.0) * 0.6; - m_rosettePixmap = rosePix.scaled(rosePix.width() * pickCoef, rosePix.height() * pickCoef, Qt::KeepAspectRatio); - pickCoef = (newGuitH * 3.3) / 535; - int xPic = (newS.width()) * 0.8571428571 + 20 * pickCoef;; - int yPic = (newS.height() - newGuitH) - 30 * pickCoef; - if (!gl->GisRightHanded) - xPic = newS.width() - xPic - m_rosettePixmap.width(); // reversed - guitar->setPickUpRect(QRect(QPoint(xPic, yPic), m_rosettePixmap.size())); - } +// int newGuitH = (newS.height() - nootBar->height()) * 0.25; +// if (gl->instrument == e_electricGuitar || gl->instrument == e_bassGuitar) { +// QPixmap rosePix(gl->path + "picts/pickup.png"); +// qreal pickCoef = ((newGuitH * 2.9) / 614.0) * 0.6; +// m_rosettePixmap = rosePix.scaled(rosePix.width() * pickCoef, rosePix.height() * pickCoef, Qt::KeepAspectRatio); +// pickCoef = (newGuitH * 3.3) / 535; +// int xPic = (newS.width()) * 0.8571428571 + 20 * pickCoef;; +// int yPic = (newS.height() - newGuitH) - 30 * pickCoef; +// if (!gl->GisRightHanded) +// xPic = newS.width() - xPic - m_rosettePixmap.width(); // reversed +// guitar->setPickUpRect(QRect(QPoint(xPic, yPic), m_rosettePixmap.size())); +// } guitar->setFixedHeight((newS.height() - nootBar->height()) * 0.25); - setWidgetsFont(); +// setWidgetsFont(); - if (gl->instrument != e_noInstrument) { - pitchView->resize(m_statFontSize); - if (m_pitchContainer) { - m_pitchContainer->layout()->removeWidget(pitchView); - m_pitchContainer->deleteLater(); - m_pitchContainer = 0; - guitar->show(); - m_rightLay->addWidget(pitchView); - } - QPixmap bgPix; - qreal guitH; - qreal ratio; - if (gl->instrument == e_classicalGuitar) { - guitar->setPickUpRect(QRect()); - bgPix = QPixmap(gl->path + "picts/body.png"); // size 800x535 - guitH = qRound(((double)guitar->height() / 350.0) * 856.0); - int guitW = centralWidget()->width() / 2; - m_bgPixmap = bgPix.scaled(guitW, guitH, Qt::IgnoreAspectRatio); - } else { - if (gl->instrument == e_bassGuitar) - bgPix = QPixmap(gl->path + "picts/body-bass.png"); // size - else - bgPix = QPixmap(gl->path + "picts/body-electro.png"); - guitH = guitar->height() * 2.9; - ratio = guitH / bgPix.height(); - m_bgPixmap = bgPix.scaled(qRound(bgPix.width() * ratio), guitH, Qt::KeepAspectRatio); - } +// if (gl->instrument != e_noInstrument) { +// pitchView->resize(m_statFontSize); +// if (m_pitchContainer) { +// m_pitchContainer->layout()->removeWidget(pitchView); +// m_pitchContainer->deleteLater(); +// m_pitchContainer = 0; +// guitar->show(); +// m_rightLay->addWidget(pitchView); +// } +// QPixmap bgPix; +// qreal guitH; +// qreal ratio; +// if (gl->instrument == e_classicalGuitar) { +// guitar->setPickUpRect(QRect()); +// bgPix = QPixmap(gl->path + "picts/body.png"); // size 800x535 +// guitH = qRound(((double)guitar->height() / 350.0) * 856.0); +// int guitW = centralWidget()->width() / 2; +// m_bgPixmap = bgPix.scaled(guitW, guitH, Qt::IgnoreAspectRatio); +// } else { +// if (gl->instrument == e_bassGuitar) +// bgPix = QPixmap(gl->path + "picts/body-bass.png"); // size +// else +// bgPix = QPixmap(gl->path + "picts/body-electro.png"); +// guitH = guitar->height() * 2.9; +// ratio = guitH / bgPix.height(); +// m_bgPixmap = bgPix.scaled(qRound(bgPix.width() * ratio), guitH, Qt::KeepAspectRatio); +// } // if (gl->instrument == e_classicalGuitar) { // QPixmap rosePix(gl->path + "picts/rosette.png"); // size 341x281 // m_rosettePixmap = rosePix.scaled(341 * ratio, 281 * ratio, Qt::KeepAspectRatio); - } else { // no guitar - pitch view instead - pitchView->resize(m_statFontSize * 1.7); - if (!m_pitchContainer) { - guitar->hide(); - m_pitchContainer = new QWidget(innerWidget); - m_pitchContainer->setObjectName("m_pitchContainer"); - m_pitchContainer->setStyleSheet("QWidget#m_pitchContainer {" + Tcolor::bgTag(palette().window().color()) + - "border-radius: 10px;" + QString("background-image: url(%1);}").arg(gl->path + "picts/scoresettbg.png")); - m_rightLay->removeWidget(pitchView); - QVBoxLayout *pitchLay = new QVBoxLayout; - pitchLay->addStretch(1); - pitchLay->addWidget(pitchView); - pitchLay->addStretch(1); - m_pitchContainer->setLayout(pitchLay); - innerWidget->layout()->addWidget(m_pitchContainer); - } - } - if (m_pitchContainer) - m_pitchContainer->setFixedHeight((height() - nootBar->height()) * 0.25); - +// } else { // no guitar - pitch view instead +// pitchView->resize(m_statFontSize * 1.7); +// if (!m_pitchContainer) { +// guitar->hide(); +// m_pitchContainer = new QWidget(innerWidget); +// m_pitchContainer->setObjectName("m_pitchContainer"); +// m_pitchContainer->setStyleSheet("QWidget#m_pitchContainer {" + Tcolor::bgTag(palette().window().color()) + +// "border-radius: 10px;" + QString("background-image: url(%1);}").arg(gl->path + "picts/scoresettbg.png")); +// m_rightLay->removeWidget(pitchView); +// QVBoxLayout *pitchLay = new QVBoxLayout; +// pitchLay->addStretch(1); +// pitchLay->addWidget(pitchView); +// pitchLay->addStretch(1); +// m_pitchContainer->setLayout(pitchLay); +// innerWidget->layout()->addWidget(m_pitchContainer); +// } +// } +// if (m_pitchContainer) +// m_pitchContainer->setFixedHeight((height() - nootBar->height()) * 0.25); +// setUpdatesEnabled(true); - fixPitchViewPos(); +// fixPitchViewPos(); QTimer::singleShot(2, this, SLOT(update())); } void MainWindow::resizeEvent(QResizeEvent * event) { updateSize(innerWidget->size()); - emit sizeChanged(innerWidget->size()); +// emit sizeChanged(innerWidget->size()); QTimer::singleShot(3, this, SLOT(fixPitchViewPos())); } - +/* void MainWindow::closeEvent(QCloseEvent *event) { if (!settingsAct->isEnabled() && ex) { if (ex->closeNootka()) @@ -759,12 +704,12 @@ void MainWindow::paintEvent(QPaintEvent* ) { painter.scale(-1, 1); } if (gl->instrument == e_classicalGuitar || gl->instrument == e_noInstrument) { - painter.drawPixmap(guitar->posX12fret() + 7, guitar->geometry().bottom()/*height()*/ - m_bgPixmap.height(), m_bgPixmap); + painter.drawPixmap(guitar->posX12fret() + 7, guitar->geometry().bottom() - m_bgPixmap.height(), m_bgPixmap); // painter.drawPixmap(width() - qRound(m_rosettePixmap.width() * 0.75), // height() - ratio * 250 - (height() - guitar->geometry().bottom()), m_rosettePixmap ); } else { qreal ratio = (guitar->height() * 3.3) / 535; - painter.drawPixmap(guitar->fbRect().right() - 235 * ratio, height() - m_bgPixmap.height() /*+ 20 * ratio*/, m_bgPixmap); + painter.drawPixmap(guitar->fbRect().right() - 235 * ratio, height() - m_bgPixmap.height() , m_bgPixmap); if (!gl->GisRightHanded) painter.resetTransform(); painter.drawPixmap(guitar->pickRect()->x(), guitar->pickRect()->y(), m_rosettePixmap); @@ -782,3 +727,4 @@ bool MainWindow::eventFilter(QObject* obj, QEvent* event) { return QObject::eventFilter(obj, event); } } + */ diff --git a/src/mainwindow.h b/src/mainwindow.h index fa983ec598b15decd178f6a13c5539693f0c6fd1..5f0da667e408583bf8c200fecdf860b104b41129 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -19,13 +19,13 @@ #ifndef MAINWINDOW_H #define MAINWINDOW_H -#include "tnote.h" -#include "tlevel.h" -#include <texamexecutor.h> +#include <music/tnote.h> +#include <exam/tlevel.h> +// #include <texamexecutor.h> #include <QMainWindow> -class TanimedChBox; +// class TanimedChBox; class QVBoxLayout; class TnootkaLabel; class TroundedLabel; @@ -41,8 +41,8 @@ class Tsound; class MainWindow : public QMainWindow { - friend class TexamExecutor; - friend class Tcanvas; +// friend class TexamExecutor; +// friend class Tcanvas; Q_OBJECT @@ -57,76 +57,76 @@ public: /** Returns font size used in status message label in pixels. * Its size depends on whole window size and is used for fonts' sizes * of others widgets. */ - int getFontSize() {return m_statFontSize; } +// int getFontSize() {return m_statFontSize; } QString statusMessage() { return m_statusText; } QWidget *innerWidget; /** Returns point of bottomLeft examResults.*/ - QPoint relatedPoint(); +// QPoint relatedPoint(); public slots: - void openFile(QString runArg); // opens *.nel or *.noo file - void createSettingsDialog(); - void openLevelCreator(QString levelFile = ""); - void startExamSlot(); - void aboutSlot(); - void analyseSlot(); - +// void openFile(QString runArg); // opens *.nel or *.noo file +// void createSettingsDialog(); +// void openLevelCreator(QString levelFile = ""); +// void startExamSlot(); +// void aboutSlot(); +// void analyseSlot(); +// void noteWasClicked(int index, Tnote note); - void noteNameWasChanged(Tnote note); - void guitarWasClicked(Tnote note); - void soundWasPlayed(Tnote note); +// void noteNameWasChanged(Tnote note); +// void guitarWasClicked(Tnote note); +// void soundWasPlayed(Tnote note); -signals: - void sizeChanged(QSize size); +// signals: +// void sizeChanged(QSize size); protected: TmainScore *score; - TnoteName *noteName; +// TnoteName *noteName; TfingerBoard *guitar; - Tsound *sound; - TexamView *examResults; - TexamExecutor *ex; - TnootkaLabel *nootLabel; // displays Nootka logo - TanimedChBox *autoRepeatChB, *expertAnswChB, *correctChB; - TpitchView *pitchView; - TprogressWidget *progress; +// Tsound *sound; +// TexamView *examResults; +// TexamExecutor *ex; +// TnootkaLabel *nootLabel; // displays Nootka logo +// TanimedChBox *autoRepeatChB, *expertAnswChB, *correctChB; +// TpitchView *pitchView; +// TprogressWidget *progress; QToolBar *nootBar; QAction *settingsAct, *levelCreatorAct, *startExamAct, *aboutAct, *analyseAct; - void clearAfterExam(TexamExecutor::Estate examState = TexamExecutor::e_finished); +// void clearAfterExam(TexamExecutor::Estate examState = TexamExecutor::e_finished); void updateSize(QSize newS); /** Updates position and sizes of the widgets. */ - /* Invokes TnoteName::resize(). Also does the same for TexamView (examResults) and TprogressWidget. - * Font size is calculated from m_statFontSize + m_extraFontOffset */ - void setWidgetsFont(); - +// /* Invokes TnoteName::resize(). Also does the same for TexamView (examResults) and TprogressWidget. +// * Font size is calculated from m_statFontSize + m_extraFontOffset */ +// void setWidgetsFont(); +// void resizeEvent(QResizeEvent *event); bool event(QEvent *event); - void closeEvent(QCloseEvent *event); - bool eventFilter(QObject* obj, QEvent* event); - void paintEvent(QPaintEvent *); +// void closeEvent(QCloseEvent *event); +// bool eventFilter(QObject* obj, QEvent* event); +// void paintEvent(QPaintEvent *); protected slots: void restoreMessage(); - void showSupportDialog(); +// void showSupportDialog(); /** Checks is score not too width and places pitchView under when it is. * Or opposite - moves pitchView. * Also avoid collision score and note name. */ - void fixPitchViewPos(); +// void fixPitchViewPos(); /** In first attempt it tries to increase window size if there is screen space in spare. * If not, Invokes TnoteName::resize() with smallest font size to decrease it. * Also does the same for TexamView (examResults) and TprogressWidget */ - void fixNoteNameSize(); +// void fixNoteNameSize(); /** This slot is invoked when clef is changed by clicking score. * It adjust ambitus to score possibilities if clef is differ than default * or to instrument scale if clef backs to default */ - void adjustAmbitus(); +// void adjustAmbitus(); private: @@ -137,15 +137,16 @@ private: * and stops any status messages in this time.*/ bool m_lockStat; QColor m_prevBg, m_curBG; - QPixmap m_bgPixmap, m_rosettePixmap; - int m_statFontSize, m_extraFontOffset; - bool m_levelCreatorExist; /** Keeps true when Dialog windows is opened, to avoid opening another file. */ - Tlevel m_level; - bool m_isPlayerFree; - QWidget *m_pitchContainer; - QVBoxLayout *m_rightLay, *m_scoreLay; - - +// QPixmap m_bgPixmap, m_rosettePixmap; + int m_statFontSize; +// int m_extraFontOffset; +// bool m_levelCreatorExist; /** Keeps true when Dialog windows is opened, to avoid opening another file. */ +// Tlevel m_level; +// bool m_isPlayerFree; +// QWidget *m_pitchContainer; +// QVBoxLayout *m_rightLay, *m_scoreLay; +// +// void createActions(); void setStartExamActParams(); /** it sets icon and status text in startExamAct. */ diff --git a/src/score/tmainscore.cpp b/src/score/tmainscore.cpp index c152f8687db6414de38fca591706f63142f03159..d2fec4f920c30a5a8610713b99f8d47b531d43a1 100644 --- a/src/score/tmainscore.cpp +++ b/src/score/tmainscore.cpp @@ -17,16 +17,16 @@ ***************************************************************************/ #include "tmainscore.h" -#include "tscorestaff.h" -#include "tscorenote.h" -#include "tscorekeysignature.h" -#include "tscorecontrol.h" -#include "tscoreclef.h" -#include "tscorescene.h" +#include <score/tscorestaff.h> +#include <score/tscorenote.h> +#include <score/tscorekeysignature.h> +#include <score/tscorecontrol.h> +#include <score/tscoreclef.h> +#include <score/tscorescene.h> #include "tscoreview.h" -#include "ttune.h" -#include "tglobals.h" -#include <tgraphicstexttip.h> +#include <music/ttune.h> +#include <tglobals.h> +#include <graphics/tgraphicstexttip.h> #include <animations/tstrikedoutitem.h> #include <animations/tblinkingitem.h> #include <tcolor.h> diff --git a/src/score/tsimplescore.cpp b/src/score/tsimplescore.cpp index 5d0a6efaf80e5a05e64d6b537bad400e4e847f22..7be66e67106632266261283db8c3ccc96459934a 100755 --- a/src/score/tsimplescore.cpp +++ b/src/score/tsimplescore.cpp @@ -18,15 +18,15 @@ #include "tsimplescore.h" -#include "tscorescene.h" -#include "tscorestaff.h" -#include "tscorecontrol.h" -#include "tscorenote.h" -#include "tscorekeysignature.h" -#include "tscoreclef.h" -#include "tscorepianostaff.h" -#include "tscoreview.h" -#include "tinstrument.h" +#include <score/tscorescene.h> +#include <score/tscorestaff.h> +#include <score/tscorecontrol.h> +#include <score/tscorenote.h> +#include <score/tscorekeysignature.h> +#include <score/tscoreclef.h> +#include <score/tscorepianostaff.h> +#include <score/tscoreview.h> +#include <music/tinstrument.h> #include <tcolor.h> #include <QHBoxLayout> #include <QMouseEvent> @@ -54,9 +54,6 @@ TsimpleScore::TsimpleScore(int notesNumber, QWidget* parent, bool controler) : m_score->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); m_score->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); m_score->setFrameShape(QFrame::NoFrame); -// QSizePolicy policy(sizePolicy()); -// policy.setHeightForWidth(true); -// m_score->setSizePolicy(policy); m_scene = new TscoreScene(m_score); connect(m_scene, SIGNAL(statusTip(QString)), this, SLOT(statusTipChanged(QString))); diff --git a/src/score/tsimplescore.h b/src/score/tsimplescore.h index 64890bf15120ebe452dd3f72e106788702243ffc..0ba3c7729cfb0c9ee717e91f993c4280d4353dde 100644 --- a/src/score/tsimplescore.h +++ b/src/score/tsimplescore.h @@ -21,9 +21,9 @@ #define TSIMPLESCORE_H #include <QWidget> -#include "tclef.h" -#include "tnote.h" -#include "tkeysignature.h" +#include <music/tclef.h> +#include <music/tnote.h> +#include <music/tkeysignature.h> class QGraphicsSimpleTextItem; class TscoreView;