remove temporary files added by accident
This commit is contained in:
parent
5b2cff0ba0
commit
46f0abf154
1526
build/.Doxyfile.in,
1526
build/.Doxyfile.in,
File diff suppressed because it is too large
Load diff
21
build/.qped
21
build/.qped
|
@ -1,21 +0,0 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
||||||
<Ped version="1.0">
|
|
||||||
<Status>
|
|
||||||
<geometry x="0" y="0" w="800" h="1000" />
|
|
||||||
<Editor1>
|
|
||||||
<KontextList>
|
|
||||||
<Kontext>
|
|
||||||
<path>/home/ws/mscore/build/Doxyfile.in</path>
|
|
||||||
<column>58</column>
|
|
||||||
<line>803</line>
|
|
||||||
<xoff>0</xoff>
|
|
||||||
<yoff>43</yoff>
|
|
||||||
</Kontext>
|
|
||||||
<cur>1</cur>
|
|
||||||
</KontextList>
|
|
||||||
</Editor1>
|
|
||||||
<search>header</search>
|
|
||||||
<colorify>0</colorify>
|
|
||||||
<brackets>1</brackets>
|
|
||||||
</Status>
|
|
||||||
</Ped>
|
|
|
@ -1,642 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# MuseScore
|
|
||||||
# Linux Music Score Editor
|
|
||||||
# $Id:$
|
|
||||||
#
|
|
||||||
# Copyright (C) 2002-2010 by 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.
|
|
||||||
#
|
|
||||||
# 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, write to the Free Software
|
|
||||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
include (${PROJECT_SOURCE_DIR}/build/gch.cmake)
|
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(revision.h PROPERTIES GENERATED TRUE)
|
|
||||||
|
|
||||||
include_directories(
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
|
||||||
${PROJECT_SOURCE_DIR}
|
|
||||||
${PROJECT_SOURCE_DIR}/thirdparty
|
|
||||||
${PROJECT_SOURCE_DIR}/scriptdebug
|
|
||||||
${QTSINGLEAPPLICATION_INCLUDE_DIRS}
|
|
||||||
)
|
|
||||||
|
|
||||||
QT4_WRAP_UI (ui_headers
|
|
||||||
insertmeasuresdialog.ui barline.ui chord.ui chordrest.ui editinstrument.ui editstyle.ui
|
|
||||||
edittempo.ui element.ui hairpin.ui instrdialog.ui measure.ui measuresdialog.ui
|
|
||||||
note.ui page.ui pagesettings.ui mixer.ui playpanel.ui prefsdialog.ui
|
|
||||||
measureproperties.ui segment.ui text.ui textpalette.ui timedialog.ui
|
|
||||||
symboldialog.ui dynamic.ui tuplet.ui shortcutcapturedialog.ui slurtie.ui
|
|
||||||
slur.ui editdrumset.ui editstaff.ui line.ui linesegment.ui
|
|
||||||
voltaproperties.ui timesigproperties.ui
|
|
||||||
jumpproperties.ui markerproperties.ui boxproperties.ui
|
|
||||||
instrwizard.ui timesigwizard.ui newwizard.ui aboutbox.ui aboutmusicxmlbox.ui
|
|
||||||
chordedit.ui transposedialog.ui tempoproperties.ui
|
|
||||||
lineproperties.ui excerptsdialog.ui lyrics.ui stafftext.ui
|
|
||||||
tupletdialog.ui tupletproperties.ui
|
|
||||||
glissandoprop.ui articulation.ui metaedit.ui palette.ui
|
|
||||||
dynamicproperties.ui textline.ui slurproperties.ui debugger.ui
|
|
||||||
select.ui synthcontrol.ui splitstaff.ui cellproperties.ui beam.ui keyedit.ui
|
|
||||||
harmonyedit.ui selectinstr.ui tremolo.ui fretdprops.ui stafftype.ui
|
|
||||||
sectionbreak.ui hairpinproperties.ui spanner.ui bend.ui tremolobar.ui
|
|
||||||
textproperties.ui editpitch.ui editstringdata.ui slursegment.ui
|
|
||||||
accidental.ui clef.ui editraster.ui mediadialog.ui textstyle.ui
|
|
||||||
album.ui layer.ui articulationbase.ui inspector_element.ui inspector_vbox.ui
|
|
||||||
inspector_articulation.ui inspector_spacer.ui inspector_hbox.ui keysig.ui
|
|
||||||
inspector_segment.ui inspector_beam.ui inspector_note.ui
|
|
||||||
rest.ui inspector_chord.ui omrpanel.ui startdialog.ui masterpalette.ui
|
|
||||||
inspector_group_element.ui inspector_image.ui stem.ui
|
|
||||||
)
|
|
||||||
|
|
||||||
if (OMR)
|
|
||||||
set(OMR_MOCS omrpanel.h)
|
|
||||||
endif (OMR)
|
|
||||||
|
|
||||||
QT4_WRAP_CPP (mocs
|
|
||||||
scoreview.h editinstrument.h editstyle.h edittempo.h instrdialog.h debugger.h
|
|
||||||
musescore.h navigator.h pagesettings.h palette.h mixer.h playpanel.h
|
|
||||||
measureproperties.h seq.h textpalette.h textstyle.h
|
|
||||||
timedialog.h symboldialog.h shortcutcapturedialog.h simplebutton.h
|
|
||||||
greendotbutton.h recordbutton.h editdrumset.h editstaff.h selinstrument.h
|
|
||||||
voltaproperties.h timesigproperties.h
|
|
||||||
jumpproperties.h markerproperties.h boxproperties.h newwizard.h
|
|
||||||
transposedialog.h chordedit.h tempoproperties.h lineproperties.h
|
|
||||||
excerptsdialog.h stafftextproperties.h glissandoproperties.h
|
|
||||||
script.h articulationprop.h metaedit.h magbox.h voiceselector.h
|
|
||||||
textprop.h dynamicprop.h textproperties.h tupletdialog.h tupletproperties.h
|
|
||||||
slurproperties.h selectdialog.h synthcontrol.h drumroll.h pianoroll.h
|
|
||||||
piano.h ruler.h file.h
|
|
||||||
pianoview.h drumview.h splitstaff.h scoretab.h keyedit.h keycanvas.h harmonyedit.h
|
|
||||||
harmonycanvas.h updatechecker.h fretproperties.h fretcanvas.h editstafftype.h
|
|
||||||
prefsdialog.h sectionbreakprop.h hairpinprop.h bendproperties.h
|
|
||||||
bendcanvas.h tremolobarprop.h tremolobarcanvas.h
|
|
||||||
drumtools.h texteditor.h texttools.h edittools.h pianotools.h editpitch.h
|
|
||||||
editstringdata.h editraster.h mediadialog.h chordeditor.h chordview.h album.h layer.h
|
|
||||||
webpage.h inspector.h inspectorBase.h inspectorBeam.h masterpalette.h
|
|
||||||
inspectorGroupElement.h inspectorImage.h waveview.h
|
|
||||||
${OMR_MOCS}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
QT4_ADD_RESOURCES (qrc_files musescore-apple.qrc)
|
|
||||||
else (APPLE)
|
|
||||||
QT4_ADD_RESOURCES (qrc_files musescore.qrc)
|
|
||||||
endif (APPLE)
|
|
||||||
|
|
||||||
|
|
||||||
set (AUDIO "")
|
|
||||||
if (MINGW)
|
|
||||||
set (resource_file ${PROJECT_BINARY_DIR}/resfile.o)
|
|
||||||
else (MINGW)
|
|
||||||
if (USE_ALSA)
|
|
||||||
set (AUDIO ${AUDIO} alsa.cpp mididriver.cpp)
|
|
||||||
endif (USE_ALSA)
|
|
||||||
endif (MINGW)
|
|
||||||
|
|
||||||
if (USE_PORTAUDIO)
|
|
||||||
set (AUDIO ${AUDIO} pa.cpp)
|
|
||||||
endif (USE_PORTAUDIO)
|
|
||||||
|
|
||||||
if (USE_PULSEAUDIO)
|
|
||||||
set (AUDIO ${AUDIO} pulseaudio.cpp)
|
|
||||||
endif (USE_PULSEAUDIO)
|
|
||||||
|
|
||||||
if (USE_PORTMIDI)
|
|
||||||
set (AUDIO ${AUDIO} pm.cpp)
|
|
||||||
endif (USE_PORTMIDI)
|
|
||||||
|
|
||||||
if (USE_JACK)
|
|
||||||
set (AUDIO ${AUDIO} jackaudio.cpp jackweakapi.cpp)
|
|
||||||
endif (USE_JACK)
|
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
set (ExecutableName mscore MACOSX_BUNDLE)
|
|
||||||
set (MACOSX_BUNDLE_INFO_STRING MuseScore prerelease for Mac OSX)
|
|
||||||
set (MACOSX_BUNDLE_ICON_FILE mscore.icns)
|
|
||||||
set (MACOSX_BUNDLE_GUI_IDENTIFIER net.sourceforge.mscore)
|
|
||||||
set (MACOSX_BUNDLE_LONG_VERSION_STRING ${Mscore_VERSION_FULL})
|
|
||||||
set (MACOSX_BUNDLE_BUNDLE_NAME MuseScore)
|
|
||||||
set (MACOSX_BUNDLE_SHORT_VERSION_STRING ${Mscore_VERSION})
|
|
||||||
set (MACOSX_BUNDLE_BUNDLE_VERSION ${Mscore_VERSION_FULL})
|
|
||||||
set (MACOSX_BUNDLE_COPYRIGHT musescore.org)
|
|
||||||
else (APPLE)
|
|
||||||
set (ExecutableName mscore)
|
|
||||||
endif (APPLE)
|
|
||||||
|
|
||||||
if (OMR)
|
|
||||||
set(OMR_FILES omrpanel.cpp)
|
|
||||||
endif (OMR)
|
|
||||||
|
|
||||||
add_executable ( ${ExecutableName}
|
|
||||||
${qrc_files}
|
|
||||||
${ui_headers}
|
|
||||||
${mocs}
|
|
||||||
${PROJECT_BINARY_DIR}/all.h
|
|
||||||
${PCH}
|
|
||||||
${resource_file}
|
|
||||||
|
|
||||||
actions.cpp scoreview.cpp editinstrument.cpp editstyle.cpp
|
|
||||||
edittempo.cpp exportxml.cpp icons.cpp importbww.cpp importxml.cpp
|
|
||||||
instrdialog.cpp debugger.cpp menus.cpp importmidi.cpp
|
|
||||||
musescore.cpp navigator.cpp pagesettings.cpp palette.cpp
|
|
||||||
mixer.cpp playpanel.cpp preferences.cpp measureproperties.cpp
|
|
||||||
seq.cpp boxproperties.cpp textpalette.cpp
|
|
||||||
timedialog.cpp symboldialog.cpp shortcutcapturedialog.cpp
|
|
||||||
simplebutton.cpp musedata.cpp exportly.cpp
|
|
||||||
editdrumset.cpp editstaff.cpp voltaproperties.cpp
|
|
||||||
timesigproperties.cpp newwizard.cpp transposedialog.cpp
|
|
||||||
chordedit.cpp plugins.cpp excerptsdialog.cpp
|
|
||||||
metaedit.cpp magbox.cpp voiceselector.cpp capella.cpp
|
|
||||||
scscore.cpp sccursor.cpp scchord.cpp scnote.cpp scpart.cpp sctext.cpp
|
|
||||||
scmeasure.cpp scpageformat.cpp exportaudio.cpp exportmidi.cpp
|
|
||||||
textproperties.cpp screst.cpp scharmony.cpp slurproperties.cpp
|
|
||||||
synthcontrol.cpp drumroll.cpp pianoroll.cpp piano.cpp
|
|
||||||
pianoview.cpp drumview.cpp scoretab.cpp keyedit.cpp harmonyedit.cpp
|
|
||||||
updatechecker.cpp importove.cpp ove.cpp ruler.cpp
|
|
||||||
importgtp.cpp fotomode.cpp drumtools.cpp
|
|
||||||
selinstrument.cpp texteditor.cpp editstafftype.cpp texttools.cpp edittools.cpp
|
|
||||||
editpitch.cpp editstringdata.cpp editraster.cpp pianotools.cpp mediadialog.cpp
|
|
||||||
profile.cpp exportmp3.cpp chordeditor.cpp chordview.cpp
|
|
||||||
album.cpp webpage.cpp textstyle.cpp tempoproperties.cpp
|
|
||||||
lineproperties.cpp stafftextproperties.cpp splitstaff.cpp
|
|
||||||
tupletdialog.cpp tupletproperties.cpp glissandoproperties.cpp
|
|
||||||
articulationprop.cpp textprop.cpp dynamicprop.cpp
|
|
||||||
fretproperties.cpp sectionbreakprop.cpp hairpinprop.cpp
|
|
||||||
bendproperties.cpp tremolobarprop.cpp file.cpp keyb.cpp osc.cpp
|
|
||||||
layer.cpp jumpproperties.cpp selectdialog.cpp
|
|
||||||
propertymenu.cpp shortcut.cpp bb.cpp
|
|
||||||
midifile.cpp inspector.cpp dragelement.cpp svggenerator.cpp
|
|
||||||
inspectorBase.cpp inspectorBeam.cpp masterpalette.cpp
|
|
||||||
inspectorGroupElement.cpp dragdrop.cpp inspectorImage.cpp
|
|
||||||
waveview.cpp musicxmlsupport.cpp
|
|
||||||
${OMR_FILES}
|
|
||||||
${AUDIO}
|
|
||||||
)
|
|
||||||
|
|
||||||
if (STATIC_SCRIPT_BINDINGS AND BUILD_SCRIPTGEN)
|
|
||||||
target_link_libraries(mscore
|
|
||||||
qtscript_core
|
|
||||||
qtscript_gui
|
|
||||||
qtscript_network
|
|
||||||
qtscript_uitools
|
|
||||||
qtscript_xml
|
|
||||||
qtscript_webkit)
|
|
||||||
endif (STATIC_SCRIPT_BINDINGS AND BUILD_SCRIPTGEN)
|
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
set_target_properties (mscore
|
|
||||||
PROPERTIES
|
|
||||||
MACOSX_BUNDLE_INFO_PLIST ${PROJECT_SOURCE_DIR}/build/MacOSXBundleInfo.plist.in)
|
|
||||||
endif(APPLE)
|
|
||||||
|
|
||||||
if (OSC)
|
|
||||||
target_link_libraries(mscore ofqf)
|
|
||||||
endif (OSC)
|
|
||||||
|
|
||||||
if (MINGW)
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT ${PROJECT_BINARY_DIR}/resfile.o
|
|
||||||
COMMAND ${QT_WRC_EXECUTABLE} -i mscore.rc -o ${PROJECT_BINARY_DIR}/mscore.res
|
|
||||||
COMMAND ${QT_WINE_EXECUTABLE} /home/ws/.wine/drive_c/MingW/bin/windres.exe ${PROJECT_BINARY_DIR}/mscore.res -o ${PROJECT_BINARY_DIR}/resfile.o
|
|
||||||
DEPENDS ${PROJECT_SOURCE_DIR}/mscore/data/mscore.rc
|
|
||||||
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/mscore/data
|
|
||||||
)
|
|
||||||
set_source_files_properties(
|
|
||||||
${PROJECT_BINARY_DIR}/resfile.o
|
|
||||||
PROPERTIES generated true
|
|
||||||
)
|
|
||||||
# Windows: add -mconsole to LINK_FLAGS to get a console window for debug output
|
|
||||||
if(CMAKE_BUILD_TYPE MATCHES "DEBUG")
|
|
||||||
set_target_properties( mscore
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_FLAGS "-include ${PROJECT_BINARY_DIR}/all.h -g -Wall -Wextra -Winvalid-pch ${QT_DEFINITIONS} -DQT_SVG_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_SCRIPT_LIB"
|
|
||||||
LINK_FLAGS "${PROJECT_BINARY_DIR}/resfile.o -mwindows -mconsole -L ${CROSSQT}/lib"
|
|
||||||
)
|
|
||||||
else(CMAKE_BUILD_TYPE MATCHES "DEBUG")
|
|
||||||
set_target_properties( mscore
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_FLAGS "-include ${PROJECT_BINARY_DIR}/all.h -Wall -Wextra -Winvalid-pch ${QT_DEFINITIONS} -DQT_SVG_LIB -DQT_GUI_LIB -DQT_XML_LIB -DQT_CORE_LIB -DQT_SCRIPT_LIB"
|
|
||||||
LINK_FLAGS "-Wl,-S ${PROJECT_BINARY_DIR}/resfile.o -mwindows -L ${CROSSQT}/lib"
|
|
||||||
)
|
|
||||||
endif(CMAKE_BUILD_TYPE MATCHES "DEBUG")
|
|
||||||
|
|
||||||
target_link_libraries(mscore
|
|
||||||
libmscore
|
|
||||||
awl
|
|
||||||
mstyle
|
|
||||||
diff_match_patch
|
|
||||||
msynth
|
|
||||||
bww
|
|
||||||
zarchive
|
|
||||||
rtf2html
|
|
||||||
${QTSINGLEAPPLICATION_LIBRARIES}
|
|
||||||
fluid
|
|
||||||
portaudio
|
|
||||||
portmidi
|
|
||||||
winmm
|
|
||||||
vorbisfile
|
|
||||||
)
|
|
||||||
|
|
||||||
if (HAS_AUDIOFILE)
|
|
||||||
target_link_libraries(mscore libsndfile-1)
|
|
||||||
endif (HAS_AUDIOFILE)
|
|
||||||
|
|
||||||
if (OGGVORBIS)
|
|
||||||
target_link_libraries(mscore vorbis ogg)
|
|
||||||
endif (OGGVORBIS)
|
|
||||||
|
|
||||||
if (AEOLUS)
|
|
||||||
target_link_libraries(mscore aeolus)
|
|
||||||
endif (AEOLUS)
|
|
||||||
|
|
||||||
if (OMR)
|
|
||||||
target_link_libraries(mscore omr fitz openjpeg jbig2dec jpeg)
|
|
||||||
if (OCR)
|
|
||||||
target_link_libraries(mscore tesseract_api)
|
|
||||||
endif (OCR)
|
|
||||||
endif (OMR)
|
|
||||||
|
|
||||||
target_link_libraries(mscore ${QT_mingw_LIBRARIES})
|
|
||||||
|
|
||||||
install( TARGETS mscore RUNTIME DESTINATION bin )
|
|
||||||
|
|
||||||
install_files ( /bin .dll
|
|
||||||
${CROSS}/bin/mingwm10.dll
|
|
||||||
${CROSS}/bin/libgcc_s_dw2-1.dll
|
|
||||||
${CROSS}/lib/portaudio.dll
|
|
||||||
${CROSS}/lib/libsndfile-1.dll
|
|
||||||
${CROSS}/lib/libogg.dll
|
|
||||||
${CROSS}/lib/libvorbis.dll
|
|
||||||
${CROSS}/lib/libvorbisfile.dll
|
|
||||||
${CROSSQT}/bin/QtCore4.dll
|
|
||||||
${CROSSQT}/bin/QtGui4.dll
|
|
||||||
${CROSSQT}/bin/QtXml4.dll
|
|
||||||
${CROSSQT}/bin/QtSvg4.dll
|
|
||||||
${CROSSQT}/bin/QtScript4.dll
|
|
||||||
${CROSSQT}/bin/QtScriptTools4.dll
|
|
||||||
${CROSSQT}/bin/QtNetwork4.dll
|
|
||||||
${CROSSQT}/bin/QtWebKit4.dll
|
|
||||||
${CROSSQT}/bin/phonon4.dll
|
|
||||||
${CROSSQT}/bin/QtXmlPatterns4.dll
|
|
||||||
)
|
|
||||||
install_files ( /bin/iconengines .dll
|
|
||||||
${CROSSQT}/plugins/iconengines/qsvgicon4.dll
|
|
||||||
)
|
|
||||||
install_files ( /bin/imageformats .dll
|
|
||||||
${CROSSQT}/plugins/imageformats/qjpeg4.dll
|
|
||||||
${CROSSQT}/plugins/imageformats/qmng4.dll
|
|
||||||
${CROSSQT}/plugins/imageformats/qsvg4.dll
|
|
||||||
${CROSSQT}/plugins/imageformats/qtiff4.dll
|
|
||||||
)
|
|
||||||
|
|
||||||
else (MINGW)
|
|
||||||
target_link_libraries(mscore
|
|
||||||
${ALSA_LIB}
|
|
||||||
${QT_LIBRARIES}
|
|
||||||
${QT_QTSCRIPT_LIBRARY_RELEASE}
|
|
||||||
${QT_QTSCRIPT_TOOLS_LIBRARY_RELEASE}
|
|
||||||
diff_match_patch
|
|
||||||
libmscore
|
|
||||||
awl
|
|
||||||
mstyle
|
|
||||||
msynth
|
|
||||||
bww
|
|
||||||
zarchive
|
|
||||||
rtf2html
|
|
||||||
${QTSINGLEAPPLICATION_LIBRARIES}
|
|
||||||
fluid
|
|
||||||
z
|
|
||||||
dl
|
|
||||||
pthread
|
|
||||||
vorbisfile
|
|
||||||
)
|
|
||||||
if (USE_PORTAUDIO)
|
|
||||||
target_link_libraries(mscore ${PORTAUDIO_LIB})
|
|
||||||
endif (USE_PORTAUDIO)
|
|
||||||
|
|
||||||
if (USE_PULSEAUDIO)
|
|
||||||
target_link_libraries(mscore ${PULSEAUDIO_LIBRARY})
|
|
||||||
endif (USE_PULSEAUDIO)
|
|
||||||
|
|
||||||
set_target_properties (
|
|
||||||
mscore
|
|
||||||
PROPERTIES
|
|
||||||
COMPILE_FLAGS "-include ${PROJECT_BINARY_DIR}/all.h -g -Wall -Wno-overloaded-virtual -Winvalid-pch"
|
|
||||||
)
|
|
||||||
if (HAS_AUDIOFILE)
|
|
||||||
target_link_libraries(mscore sndfile)
|
|
||||||
endif (HAS_AUDIOFILE)
|
|
||||||
|
|
||||||
if (OGGVORBIS)
|
|
||||||
target_link_libraries(mscore vorbis ogg)
|
|
||||||
endif (OGGVORBIS)
|
|
||||||
|
|
||||||
if (AEOLUS)
|
|
||||||
target_link_libraries(mscore aeolus)
|
|
||||||
endif (AEOLUS)
|
|
||||||
|
|
||||||
if (OMR)
|
|
||||||
target_link_libraries(mscore omr fitz jbig2dec jpeg openjpeg fontconfig freetype)
|
|
||||||
if (OCR)
|
|
||||||
target_link_libraries(mscore tesseract_api)
|
|
||||||
endif (OCR)
|
|
||||||
endif (OMR)
|
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
if (USE_PORTMIDI)
|
|
||||||
target_link_libraries(mscore portmidi)
|
|
||||||
endif (USE_PORTMIDI)
|
|
||||||
target_link_libraries(mscore ${OsxFrameworks})
|
|
||||||
else (APPLE)
|
|
||||||
target_link_libraries(mscore rt)
|
|
||||||
endif (APPLE)
|
|
||||||
|
|
||||||
# gold does not use indirect shared libraries for symbol resolution, Linux only
|
|
||||||
if (NOT MINGW AND NOT APPLE)
|
|
||||||
if(USE_JACK)
|
|
||||||
target_link_libraries(mscore dl)
|
|
||||||
endif(USE_JACK)
|
|
||||||
target_link_libraries(mscore rt)
|
|
||||||
endif (NOT MINGW AND NOT APPLE)
|
|
||||||
|
|
||||||
if (QT45)
|
|
||||||
target_link_libraries(mscore ${QT_QTSCRIPT_TOOLS_LIBRARY_RELEASE} )
|
|
||||||
endif (QT45)
|
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
install (TARGETS mscore BUNDLE DESTINATION ${CMAKE_INSTALL_PREFIX})
|
|
||||||
install (FILES data/mscore.icns DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME})
|
|
||||||
install (FILES data/musescoreDocument.icns DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME})
|
|
||||||
else (APPLE)
|
|
||||||
install( TARGETS mscore RUNTIME DESTINATION bin )
|
|
||||||
install( FILES data/mscore.png DESTINATION share/pixmaps)
|
|
||||||
endif (APPLE)
|
|
||||||
endif (MINGW)
|
|
||||||
|
|
||||||
#======================================
|
|
||||||
# install icons if not embedded
|
|
||||||
#======================================
|
|
||||||
|
|
||||||
# if (NOT EMBED_ICONS)
|
|
||||||
install (FILES
|
|
||||||
data/greendot.svg
|
|
||||||
data/darkgreendot.svg
|
|
||||||
data/recordOn.svg
|
|
||||||
data/recordOff.svg
|
|
||||||
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}/icons
|
|
||||||
)
|
|
||||||
install (FILES
|
|
||||||
data/icons/text_top.svg
|
|
||||||
data/icons/text_bottom.svg
|
|
||||||
data/icons/text_vcenter.svg
|
|
||||||
data/icons/minus.svg
|
|
||||||
data/icons/flip.svg
|
|
||||||
data/icons/undo.svg
|
|
||||||
data/icons/redo.svg
|
|
||||||
data/icons/midiin.svg
|
|
||||||
data/icons/speaker.svg
|
|
||||||
data/icons/start.svg
|
|
||||||
data/icons/play.svg
|
|
||||||
data/icons/sbeam.svg
|
|
||||||
data/icons/mbeam.svg
|
|
||||||
data/icons/nbeam.svg
|
|
||||||
data/icons/beam32.svg
|
|
||||||
data/icons/beam64.svg
|
|
||||||
data/icons/abeam.svg
|
|
||||||
data/icons/fbeam1.svg
|
|
||||||
data/icons/fbeam2.svg
|
|
||||||
data/icons/fileopen.svg
|
|
||||||
data/icons/filenew.svg
|
|
||||||
data/icons/filesave.svg
|
|
||||||
data/icons/filesaveas.svg
|
|
||||||
data/icons/exit.svg
|
|
||||||
data/icons/viewmag.svg
|
|
||||||
data/icons/repeat.svg
|
|
||||||
data/icons/pan.svg
|
|
||||||
data/icons/noteentry.svg
|
|
||||||
data/icons/grace4.svg
|
|
||||||
data/icons/grace16.svg
|
|
||||||
data/icons/grace32.svg
|
|
||||||
data/icons/keyboard.svg
|
|
||||||
data/icons/tie.svg
|
|
||||||
data/icons/acciaccatura.svg
|
|
||||||
data/icons/appoggiatura.svg
|
|
||||||
data/icons/brevis.svg
|
|
||||||
data/icons/clef.svg
|
|
||||||
data/icons/dfermata.svg
|
|
||||||
data/icons/dlongfermata.svg
|
|
||||||
data/icons/dmarcato.svg
|
|
||||||
data/icons/dotdot.svg
|
|
||||||
data/icons/dot.svg
|
|
||||||
data/icons/downbow.svg
|
|
||||||
data/icons/downmordent.svg
|
|
||||||
data/icons/downprall.svg
|
|
||||||
data/icons/dportato.svg
|
|
||||||
data/icons/dshortfermata.svg
|
|
||||||
data/icons/dstaccatissimo.svg
|
|
||||||
data/icons/dverylongfermata.svg
|
|
||||||
data/icons/espressivo.svg
|
|
||||||
data/icons/flatflat.svg
|
|
||||||
data/icons/flat.svg
|
|
||||||
data/icons/longaUp.svg
|
|
||||||
data/icons/mordent.svg
|
|
||||||
data/icons/natural.svg
|
|
||||||
data/icons/note16.svg
|
|
||||||
data/icons/note2.svg
|
|
||||||
data/icons/note32.svg
|
|
||||||
data/icons/note4.svg
|
|
||||||
data/icons/note64.svg
|
|
||||||
data/icons/note8.svg
|
|
||||||
data/icons/note.svg
|
|
||||||
data/icons/ouvert.svg
|
|
||||||
data/icons/plus.svg
|
|
||||||
data/icons/plusstop.svg
|
|
||||||
data/icons/popping.svg
|
|
||||||
data/icons/prallmordent.svg
|
|
||||||
data/icons/prall.svg
|
|
||||||
data/icons/prallprall.svg
|
|
||||||
data/icons/quartrest.svg
|
|
||||||
data/icons/reverseturn.svg
|
|
||||||
data/icons/sforzatoaccent.svg
|
|
||||||
data/icons/sforzato.svg
|
|
||||||
data/icons/sharp.svg
|
|
||||||
data/icons/sharpsharp.svg
|
|
||||||
data/icons/slapping.svg
|
|
||||||
data/icons/snappizzicato.svg
|
|
||||||
data/icons/staccato.svg
|
|
||||||
data/icons/tapping.svg
|
|
||||||
data/icons/tenuto.svg
|
|
||||||
data/icons/thumb.svg
|
|
||||||
data/icons/trill.svg
|
|
||||||
data/icons/turn.svg
|
|
||||||
data/icons/ufermata.svg
|
|
||||||
data/icons/ulongfermata.svg
|
|
||||||
data/icons/umarcato.svg
|
|
||||||
data/icons/upbow.svg
|
|
||||||
data/icons/upmordent.svg
|
|
||||||
data/icons/uportato.svg
|
|
||||||
data/icons/upprall.svg
|
|
||||||
data/icons/ushortfermata.svg
|
|
||||||
data/icons/ustaccatissimo.svg
|
|
||||||
data/icons/uverylongfermata.svg
|
|
||||||
data/icons/editcut.svg
|
|
||||||
data/icons/editcopy.svg
|
|
||||||
data/icons/editpaste.svg
|
|
||||||
data/icons/fileprint.svg
|
|
||||||
data/icons/text_bold.svg
|
|
||||||
data/icons/text_italic.svg
|
|
||||||
data/icons/text_under.svg
|
|
||||||
data/icons/text_left.svg
|
|
||||||
data/icons/text_center.svg
|
|
||||||
data/icons/text_right.svg
|
|
||||||
data/icons/subscript.svg
|
|
||||||
data/icons/superscript.svg
|
|
||||||
data/icons/fotomode.svg
|
|
||||||
data/icons/hraster.svg
|
|
||||||
data/icons/vraster.svg
|
|
||||||
data/icons/repitch.svg
|
|
||||||
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}/icons/icons
|
|
||||||
)
|
|
||||||
install (FILES
|
|
||||||
data/icons-dark/text_top.svg
|
|
||||||
data/icons-dark/text_bottom.svg
|
|
||||||
data/icons-dark/text_vcenter.svg
|
|
||||||
data/icons-dark/minus.svg
|
|
||||||
data/icons-dark/flip.svg
|
|
||||||
data/icons-dark/undo.svg
|
|
||||||
data/icons-dark/redo.svg
|
|
||||||
data/icons-dark/midiin.svg
|
|
||||||
data/icons-dark/speaker.svg
|
|
||||||
data/icons-dark/start.svg
|
|
||||||
data/icons-dark/play.svg
|
|
||||||
data/icons-dark/sbeam.svg
|
|
||||||
data/icons-dark/mbeam.svg
|
|
||||||
data/icons-dark/nbeam.svg
|
|
||||||
data/icons-dark/beam32.svg
|
|
||||||
data/icons-dark/beam64.svg
|
|
||||||
data/icons-dark/abeam.svg
|
|
||||||
data/icons-dark/fbeam1.svg
|
|
||||||
data/icons-dark/fbeam2.svg
|
|
||||||
data/icons-dark/fileopen.svg
|
|
||||||
data/icons-dark/filenew.svg
|
|
||||||
data/icons-dark/filesave.svg
|
|
||||||
data/icons-dark/filesaveas.svg
|
|
||||||
data/icons-dark/exit.svg
|
|
||||||
data/icons-dark/viewmag.svg
|
|
||||||
data/icons-dark/repeat.svg
|
|
||||||
data/icons-dark/pan.svg
|
|
||||||
data/icons-dark/noteentry.svg
|
|
||||||
data/icons-dark/grace4.svg
|
|
||||||
data/icons-dark/grace16.svg
|
|
||||||
data/icons-dark/grace32.svg
|
|
||||||
data/icons-dark/keyboard.svg
|
|
||||||
data/icons-dark/tie.svg
|
|
||||||
data/icons-dark/acciaccatura.svg
|
|
||||||
data/icons-dark/appoggiatura.svg
|
|
||||||
data/icons-dark/brevis.svg
|
|
||||||
data/icons-dark/clef.svg
|
|
||||||
data/icons-dark/dfermata.svg
|
|
||||||
data/icons-dark/dlongfermata.svg
|
|
||||||
data/icons-dark/dmarcato.svg
|
|
||||||
data/icons-dark/dotdot.svg
|
|
||||||
data/icons-dark/dot.svg
|
|
||||||
data/icons-dark/downbow.svg
|
|
||||||
data/icons-dark/downmordent.svg
|
|
||||||
data/icons-dark/downprall.svg
|
|
||||||
data/icons-dark/dportato.svg
|
|
||||||
data/icons-dark/dshortfermata.svg
|
|
||||||
data/icons-dark/dstaccatissimo.svg
|
|
||||||
data/icons-dark/dverylongfermata.svg
|
|
||||||
data/icons-dark/espressivo.svg
|
|
||||||
data/icons-dark/flatflat.svg
|
|
||||||
data/icons-dark/flat.svg
|
|
||||||
data/icons-dark/longaUp.svg
|
|
||||||
data/icons-dark/mordent.svg
|
|
||||||
data/icons-dark/natural.svg
|
|
||||||
data/icons-dark/note16.svg
|
|
||||||
data/icons-dark/note2.svg
|
|
||||||
data/icons-dark/note32.svg
|
|
||||||
data/icons-dark/note4.svg
|
|
||||||
data/icons-dark/note64.svg
|
|
||||||
data/icons-dark/note8.svg
|
|
||||||
data/icons-dark/note.svg
|
|
||||||
data/icons-dark/ouvert.svg
|
|
||||||
data/icons-dark/plus.svg
|
|
||||||
data/icons-dark/plusstop.svg
|
|
||||||
data/icons-dark/popping.svg
|
|
||||||
data/icons-dark/prallmordent.svg
|
|
||||||
data/icons-dark/prall.svg
|
|
||||||
data/icons-dark/prallprall.svg
|
|
||||||
data/icons-dark/quartrest.svg
|
|
||||||
data/icons-dark/reverseturn.svg
|
|
||||||
data/icons-dark/sforzatoaccent.svg
|
|
||||||
data/icons-dark/sforzato.svg
|
|
||||||
data/icons-dark/sharp.svg
|
|
||||||
data/icons-dark/sharpsharp.svg
|
|
||||||
data/icons-dark/slapping.svg
|
|
||||||
data/icons-dark/snappizzicato.svg
|
|
||||||
data/icons-dark/staccato.svg
|
|
||||||
data/icons-dark/tapping.svg
|
|
||||||
data/icons-dark/tenuto.svg
|
|
||||||
data/icons-dark/thumb.svg
|
|
||||||
data/icons-dark/trill.svg
|
|
||||||
data/icons-dark/turn.svg
|
|
||||||
data/icons-dark/ufermata.svg
|
|
||||||
data/icons-dark/ulongfermata.svg
|
|
||||||
data/icons-dark/umarcato.svg
|
|
||||||
data/icons-dark/upbow.svg
|
|
||||||
data/icons-dark/upmordent.svg
|
|
||||||
data/icons-dark/uportato.svg
|
|
||||||
data/icons-dark/upprall.svg
|
|
||||||
data/icons-dark/ushortfermata.svg
|
|
||||||
data/icons-dark/ustaccatissimo.svg
|
|
||||||
data/icons-dark/uverylongfermata.svg
|
|
||||||
data/icons-dark/editcut.svg
|
|
||||||
data/icons-dark/editcopy.svg
|
|
||||||
data/icons-dark/editpaste.svg
|
|
||||||
data/icons-dark/fileprint.svg
|
|
||||||
data/icons-dark/text_bold.svg
|
|
||||||
data/icons-dark/text_italic.svg
|
|
||||||
data/icons-dark/text_under.svg
|
|
||||||
data/icons-dark/text_left.svg
|
|
||||||
data/icons-dark/text_center.svg
|
|
||||||
data/icons-dark/text_right.svg
|
|
||||||
data/icons-dark/subscript.svg
|
|
||||||
data/icons-dark/superscript.svg
|
|
||||||
data/icons-dark/fotomode.svg
|
|
||||||
data/icons-dark/hraster.svg
|
|
||||||
data/icons-dark/vraster.svg
|
|
||||||
data/icons-dark/repitch.svg
|
|
||||||
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}/icons/icons-dark
|
|
||||||
)
|
|
||||||
# endif (NOT EMBED_ICONS)
|
|
||||||
|
|
||||||
if (APPLE)
|
|
||||||
install (FILES
|
|
||||||
../fonts/gonville-20.otf
|
|
||||||
../fonts/mscore-20.otf
|
|
||||||
../fonts/mscore1-20.ttf
|
|
||||||
../fonts/MuseJazz.ttf
|
|
||||||
../fonts/FreeSerifMscore.ttf
|
|
||||||
../fonts/FreeSans.ttf
|
|
||||||
../fonts/mscore_tab_baroque.ttf
|
|
||||||
../fonts/mscore_tab_modern.ttf
|
|
||||||
../fonts/mscore_tab_renaiss.ttf
|
|
||||||
../fonts/mscore_tab_renaiss2.ttf
|
|
||||||
../fonts/mscore-BC.ttf
|
|
||||||
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}fonts
|
|
||||||
)
|
|
||||||
endif (APPLE)
|
|
||||||
|
|
||||||
ADD_DEPENDENCIES(${ExecutableName} mops1)
|
|
||||||
ADD_DEPENDENCIES(${ExecutableName} mops2)
|
|
||||||
|
|
2434
mscore/.actions.cpp,
2434
mscore/.actions.cpp,
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,658 +0,0 @@
|
||||||
//=============================================================================
|
|
||||||
// MuseScore
|
|
||||||
// Music Composition & Notation
|
|
||||||
// $Id: musescore.h 5657 2012-05-21 15:46:06Z lasconic $
|
|
||||||
//
|
|
||||||
// Copyright (C) 2002-2011 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.
|
|
||||||
//
|
|
||||||
// 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, write to the Free Software
|
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
#ifndef __MUSESCORE_H__
|
|
||||||
#define __MUSESCORE_H__
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include "globals.h"
|
|
||||||
#include "ui_measuresdialog.h"
|
|
||||||
#include "ui_insertmeasuresdialog.h"
|
|
||||||
#include "ui_aboutbox.h"
|
|
||||||
#include "ui_aboutmusicxmlbox.h"
|
|
||||||
#include "ui_startdialog.h"
|
|
||||||
#include "singleapp/src/QtSingleApplication"
|
|
||||||
#include "updatechecker.h"
|
|
||||||
|
|
||||||
class Shortcut;
|
|
||||||
class ScoreView;
|
|
||||||
class Element;
|
|
||||||
class ToolButton;
|
|
||||||
class PreferenceDialog;
|
|
||||||
class InstrumentsDialog;
|
|
||||||
class Instrument;
|
|
||||||
class MidiFile;
|
|
||||||
class TextStyleDialog;
|
|
||||||
class PlayPanel;
|
|
||||||
class InstrumentListEditor;
|
|
||||||
class Debugger;
|
|
||||||
class MeasureListEditor;
|
|
||||||
class Score;
|
|
||||||
class PageSettings;
|
|
||||||
class PaletteBox;
|
|
||||||
class Palette;
|
|
||||||
class PaletteScrollArea;
|
|
||||||
class Xml;
|
|
||||||
class MagBox;
|
|
||||||
class NewWizard;
|
|
||||||
class ExcerptsDialog;
|
|
||||||
class SynthControl;
|
|
||||||
class PianorollEditor;
|
|
||||||
class DrumrollEditor;
|
|
||||||
class Staff;
|
|
||||||
class ScoreView;
|
|
||||||
class ScoreTab;
|
|
||||||
class QScriptEngineDebugger;
|
|
||||||
class Drumset;
|
|
||||||
class TextTools;
|
|
||||||
class DrumTools;
|
|
||||||
class ScriptEngine;
|
|
||||||
class KeyEditor;
|
|
||||||
class ChordStyleEditor;
|
|
||||||
class Navigator;
|
|
||||||
class PianoTools;
|
|
||||||
class MediaDialog;
|
|
||||||
class Profile;
|
|
||||||
class AlbumManager;
|
|
||||||
class WebPageDockWidget;
|
|
||||||
class ChordList;
|
|
||||||
class EditTempo;
|
|
||||||
class Capella;
|
|
||||||
class CapVoice;
|
|
||||||
class Inspector;
|
|
||||||
class OmrPanel;
|
|
||||||
class NScrollArea;
|
|
||||||
class EditTools;
|
|
||||||
class Sym;
|
|
||||||
class MasterPalette;
|
|
||||||
|
|
||||||
extern QString mscoreGlobalShare;
|
|
||||||
static const int PROJECT_LIST_LEN = 6;
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// IconActions
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
struct IconAction {
|
|
||||||
int subtype;
|
|
||||||
const char* action;
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// LanguageItem
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
struct LanguageItem {
|
|
||||||
QString key;
|
|
||||||
QString name;
|
|
||||||
QString handbook;
|
|
||||||
LanguageItem(const QString k, const QString n) {
|
|
||||||
key = k;
|
|
||||||
name = n;
|
|
||||||
handbook = QString::null;
|
|
||||||
}
|
|
||||||
LanguageItem(const QString k, const QString n, const QString h) {
|
|
||||||
key = k;
|
|
||||||
name = n;
|
|
||||||
handbook = h;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// AboutBoxDialog
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
class AboutBoxDialog : public QDialog, Ui::AboutBox {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
AboutBoxDialog();
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// AboutMusicXMLBoxDialog
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
class AboutMusicXMLBoxDialog : public QDialog, Ui::AboutMusicXMLBox {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
AboutMusicXMLBoxDialog();
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// InsertMeasuresDialog
|
|
||||||
// Added by DK, 05.08.07
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
class InsertMeasuresDialog : public QDialog, public Ui::InsertMeasuresDialogBase {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
virtual void accept();
|
|
||||||
|
|
||||||
public:
|
|
||||||
InsertMeasuresDialog(QWidget* parent = 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// MeasuresDialog
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
class MeasuresDialog : public QDialog, public Ui::MeasuresDialogBase {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
virtual void accept();
|
|
||||||
|
|
||||||
public:
|
|
||||||
MeasuresDialog(QWidget* parent = 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// StartDialog
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
class StartDialog : public QDialog, public Ui::StartDialog {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void createScoreClicked();
|
|
||||||
void loadScoreClicked();
|
|
||||||
|
|
||||||
public:
|
|
||||||
StartDialog(QWidget* parent = 0);
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// MuseScoreApplication (mac only)
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
class MuseScoreApplication : public QtSingleApplication {
|
|
||||||
public:
|
|
||||||
QStringList paths;
|
|
||||||
MuseScoreApplication(const QString &id, int &argc, char **argv)
|
|
||||||
: QtSingleApplication(id, argc, argv) {
|
|
||||||
};
|
|
||||||
bool event(QEvent *ev);
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// MuseScore
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
class MuseScore : public QMainWindow {
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
ScoreState _sstate;
|
|
||||||
UpdateChecker* ucheck;
|
|
||||||
QList<Score*> scoreList;
|
|
||||||
Score* cs; // current score
|
|
||||||
ScoreView* cv; // current viewer
|
|
||||||
|
|
||||||
QVBoxLayout* layout; // main window layout
|
|
||||||
QSplitter* splitter;
|
|
||||||
ScoreTab* tab1;
|
|
||||||
ScoreTab* tab2;
|
|
||||||
NScrollArea* _navigator;
|
|
||||||
QSplitter* mainWindow;
|
|
||||||
|
|
||||||
QMenu* menuDisplay;
|
|
||||||
QMenu* openRecent;
|
|
||||||
|
|
||||||
MagBox* mag;
|
|
||||||
QComboBox* viewModeCombo;
|
|
||||||
QAction* playId;
|
|
||||||
|
|
||||||
QProgressBar* _progressBar;
|
|
||||||
PreferenceDialog* preferenceDialog;
|
|
||||||
QToolBar* cpitchTools;
|
|
||||||
QToolBar* fileTools;
|
|
||||||
QToolBar* transportTools;
|
|
||||||
QToolBar* entryTools;
|
|
||||||
TextTools* _textTools;
|
|
||||||
EditTools* _editTools;
|
|
||||||
PianoTools* _pianoTools;
|
|
||||||
WebPageDockWidget* _webPage;
|
|
||||||
MediaDialog* _mediaDialog;
|
|
||||||
DrumTools* _drumTools;
|
|
||||||
QToolBar* voiceTools;
|
|
||||||
InstrumentsDialog* instrList;
|
|
||||||
MeasuresDialog* measuresDialog;
|
|
||||||
InsertMeasuresDialog* insertMeasuresDialog;
|
|
||||||
MasterPalette* masterPalette;
|
|
||||||
|
|
||||||
QMenu* _fileMenu;
|
|
||||||
QMenu* menuEdit;
|
|
||||||
QMenu* menuNotes;
|
|
||||||
QMenu* menuLayout;
|
|
||||||
QMenu* menuStyle;
|
|
||||||
AlbumManager* albumManager;
|
|
||||||
|
|
||||||
QWidget* searchDialog;
|
|
||||||
QComboBox* searchCombo;
|
|
||||||
|
|
||||||
PlayPanel* playPanel;
|
|
||||||
InstrumentListEditor* iledit;
|
|
||||||
SynthControl* synthControl;
|
|
||||||
Debugger* debugger;
|
|
||||||
MeasureListEditor* measureListEdit;
|
|
||||||
PageSettings* pageSettings;
|
|
||||||
|
|
||||||
QWidget* symbolDialog;
|
|
||||||
|
|
||||||
PaletteScrollArea* clefPalette;
|
|
||||||
PaletteScrollArea* keyPalette;
|
|
||||||
KeyEditor* keyEditor;
|
|
||||||
ChordStyleEditor* chordStyleEditor;
|
|
||||||
QStatusBar* _statusBar;
|
|
||||||
QLabel* _modeText;
|
|
||||||
QLabel* _positionLabel;
|
|
||||||
NewWizard* newWizard;
|
|
||||||
|
|
||||||
PaletteBox* paletteBox;
|
|
||||||
Inspector* inspector;
|
|
||||||
OmrPanel* omrPanel;
|
|
||||||
|
|
||||||
bool _midiinEnabled;
|
|
||||||
bool _speakerEnabled;
|
|
||||||
QString lastOpenPath;
|
|
||||||
QList<QString> plugins;
|
|
||||||
ScriptEngine* se;
|
|
||||||
QString pluginPath;
|
|
||||||
QScriptEngineDebugger* scriptDebugger;
|
|
||||||
|
|
||||||
QDeclarativeEngine* qml;
|
|
||||||
|
|
||||||
QTimer* autoSaveTimer;
|
|
||||||
QList<QAction*> qmlPluginActions;
|
|
||||||
QList<QAction*> pluginActions;
|
|
||||||
QSignalMapper* pluginMapper;
|
|
||||||
|
|
||||||
PianorollEditor* pianorollEditor;
|
|
||||||
DrumrollEditor* drumrollEditor;
|
|
||||||
bool _splitScreen;
|
|
||||||
bool _horizontalSplit;
|
|
||||||
|
|
||||||
QString rev;
|
|
||||||
|
|
||||||
int _midiRecordId;
|
|
||||||
|
|
||||||
bool _fullscreen;
|
|
||||||
QList<LanguageItem> _languages;
|
|
||||||
|
|
||||||
QFileDialog* loadScoreDialog;
|
|
||||||
QFileDialog* saveScoreDialog;
|
|
||||||
QFileDialog* loadStyleDialog;
|
|
||||||
QFileDialog* saveStyleDialog;
|
|
||||||
QFileDialog* saveImageDialog;
|
|
||||||
QFileDialog* loadChordStyleDialog;
|
|
||||||
QFileDialog* saveChordStyleDialog;
|
|
||||||
QFileDialog* loadSoundFontDialog;
|
|
||||||
QFileDialog* loadBackgroundDialog;
|
|
||||||
QFileDialog* loadScanDialog;
|
|
||||||
QFileDialog* loadAudioDialog;
|
|
||||||
QFileDialog* loadDrumsetDialog;
|
|
||||||
QFileDialog* loadPaletteDialog;
|
|
||||||
QFileDialog* savePaletteDialog;
|
|
||||||
QFileDialog* saveDrumsetDialog;
|
|
||||||
|
|
||||||
QDialog* editRasterDialog;
|
|
||||||
QAction* hRasterAction;
|
|
||||||
QAction* vRasterAction;
|
|
||||||
|
|
||||||
QMenu* menuProfiles;
|
|
||||||
QActionGroup* profiles;
|
|
||||||
QAction* deleteProfileAction;
|
|
||||||
|
|
||||||
bool inChordEditor;
|
|
||||||
|
|
||||||
QComboBox* layerSwitch;
|
|
||||||
QComboBox* playMode;
|
|
||||||
QNetworkAccessManager* networkManager;
|
|
||||||
QAction* lastCmd;
|
|
||||||
Shortcut* lastShortcut;
|
|
||||||
EditTempo* editTempo;
|
|
||||||
|
|
||||||
QAction* metronomeAction;
|
|
||||||
QAction* panAction;
|
|
||||||
|
|
||||||
QLabel* cornerLabel;
|
|
||||||
|
|
||||||
//---------------------
|
|
||||||
|
|
||||||
virtual void closeEvent(QCloseEvent*);
|
|
||||||
|
|
||||||
virtual void dragEnterEvent(QDragEnterEvent*);
|
|
||||||
virtual void dropEvent(QDropEvent*);
|
|
||||||
|
|
||||||
void playVisible(bool flag);
|
|
||||||
void launchBrowser(const QString whereTo);
|
|
||||||
|
|
||||||
void loadScoreList();
|
|
||||||
void editInstrList();
|
|
||||||
void symbolMenu();
|
|
||||||
void showKeyEditor();
|
|
||||||
void saveFile();
|
|
||||||
void fingeringMenu();
|
|
||||||
void registerQmlPlugin(const QString&);
|
|
||||||
void registerPlugin(const QString& pluginPath);
|
|
||||||
void pluginExecuteFunction(int idx, const char* functionName);
|
|
||||||
int pluginIdxFromPath(QString pluginPath);
|
|
||||||
void addGlobalObjectToPluginEngine(const char * name, const QString & value );
|
|
||||||
void startDebugger();
|
|
||||||
void midiinToggled(bool);
|
|
||||||
void speakerToggled(bool);
|
|
||||||
void undo();
|
|
||||||
void redo();
|
|
||||||
void showPalette(bool);
|
|
||||||
void showInspector(bool);
|
|
||||||
void showOmrPanel(bool);
|
|
||||||
void showPlayPanel(bool);
|
|
||||||
void showNavigator(bool);
|
|
||||||
void showMixer(bool);
|
|
||||||
void showSynthControl();
|
|
||||||
void helpBrowser();
|
|
||||||
void splitWindow(bool horizontal);
|
|
||||||
void removeSessionFile();
|
|
||||||
void editChordStyle();
|
|
||||||
void startExcerptsDialog();
|
|
||||||
void initOsc();
|
|
||||||
void editRaster();
|
|
||||||
void showPianoKeyboard(bool);
|
|
||||||
void showMediaDialog();
|
|
||||||
void showAlbumManager();
|
|
||||||
void showLayerManager();
|
|
||||||
void gotoNextScore();
|
|
||||||
void gotoPreviousScore();
|
|
||||||
void updateUndoRedo();
|
|
||||||
void cmdAddChordName2();
|
|
||||||
static void convertCapella(Score*, Capella* cap);
|
|
||||||
void changeScore(int);
|
|
||||||
virtual void resizeEvent(QResizeEvent*);
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
void autoSaveTimerTimeout();
|
|
||||||
void helpBrowser1();
|
|
||||||
void about();
|
|
||||||
void aboutQt();
|
|
||||||
void aboutMusicXML();
|
|
||||||
void openRecentMenu();
|
|
||||||
void selectScore(QAction*);
|
|
||||||
void startPreferenceDialog();
|
|
||||||
void preferencesChanged();
|
|
||||||
void seqStarted();
|
|
||||||
void seqStopped();
|
|
||||||
void closePlayPanel();
|
|
||||||
void cmdAppendMeasures();
|
|
||||||
void cmdInsertMeasures();
|
|
||||||
void magChanged(int);
|
|
||||||
void showPageSettings();
|
|
||||||
void removeTab(int);
|
|
||||||
void removeTab();
|
|
||||||
void cmd(QAction*);
|
|
||||||
void cmd(QAction* a, const QString& cmd);
|
|
||||||
void clipboardChanged();
|
|
||||||
void endSearch();
|
|
||||||
void saveScoreDialogFilterSelected(const QString&);
|
|
||||||
#ifdef OSC
|
|
||||||
void oscIntMessage(int);
|
|
||||||
void oscPlay();
|
|
||||||
void oscStop();
|
|
||||||
void oscVolume(int val);
|
|
||||||
void oscTempo(int val);
|
|
||||||
void oscNext();
|
|
||||||
void oscNextMeasure();
|
|
||||||
void oscGoto(int m);
|
|
||||||
void oscSelectMeasure(int m);
|
|
||||||
void oscVolChannel(double val);
|
|
||||||
void oscPanChannel(double val);
|
|
||||||
void oscMuteChannel(double val);
|
|
||||||
void oscOpen(QString path);
|
|
||||||
void oscCloseAll();
|
|
||||||
void oscTriggerPlugin(QString list);
|
|
||||||
void oscColorNote(QVariantList list);
|
|
||||||
#endif
|
|
||||||
void createNewProfile();
|
|
||||||
void deleteProfile();
|
|
||||||
void showProfileMenu();
|
|
||||||
void changeProfile(QAction*);
|
|
||||||
void changeProfile(Profile* p);
|
|
||||||
void switchLayer(const QString&);
|
|
||||||
void switchPlayMode(int);
|
|
||||||
void networkFinished(QNetworkReply*);
|
|
||||||
void switchLayoutMode(int);
|
|
||||||
|
|
||||||
public slots:
|
|
||||||
void dirtyChanged(Score*);
|
|
||||||
void setPos(int tick);
|
|
||||||
void searchTextChanged(const QString& s);
|
|
||||||
void pluginTriggered(int);
|
|
||||||
void handleMessage(const QString& message);
|
|
||||||
void setCurrentScoreView(ScoreView*);
|
|
||||||
void setCurrentScoreView(int);
|
|
||||||
void setNormalState() { changeState(STATE_NORMAL); }
|
|
||||||
void setEditState() { changeState(STATE_EDIT); }
|
|
||||||
void setNoteEntryState() { changeState(STATE_NOTE_ENTRY); }
|
|
||||||
void setPlayState() { changeState(STATE_PLAY); }
|
|
||||||
void setSearchState() { changeState(STATE_SEARCH); }
|
|
||||||
void setFotomode() { changeState(STATE_FOTO); }
|
|
||||||
void checkForUpdate();
|
|
||||||
void registerPlugin(QAction*);
|
|
||||||
QMenu* fileMenu() const { return _fileMenu; }
|
|
||||||
void midiNoteReceived(int channel, int pitch, int velo);
|
|
||||||
void midiNoteReceived(int pitch, bool ctrl);
|
|
||||||
void instrumentChanged();
|
|
||||||
void showMasterPalette();
|
|
||||||
void selectionChanged(int);
|
|
||||||
|
|
||||||
public:
|
|
||||||
MuseScore();
|
|
||||||
~MuseScore();
|
|
||||||
bool checkDirty(Score*);
|
|
||||||
PlayPanel* getPlayPanel() const { return playPanel; }
|
|
||||||
QMenu* genCreateMenu(QWidget* parent = 0);
|
|
||||||
int appendScore(Score*);
|
|
||||||
void midiCtrlReceived(int controller, int value);
|
|
||||||
void showElementContext(Element* el);
|
|
||||||
void cmdAppendMeasures(int);
|
|
||||||
bool midiinEnabled() const;
|
|
||||||
bool playEnabled() const;
|
|
||||||
|
|
||||||
Score* currentScore() const { return cs; }
|
|
||||||
ScoreView* currentScoreView() const { return cv; }
|
|
||||||
|
|
||||||
void incMag();
|
|
||||||
void decMag();
|
|
||||||
void readSettings();
|
|
||||||
void writeSettings();
|
|
||||||
void play(Element* e) const;
|
|
||||||
void play(Element* e, int pitch) const;
|
|
||||||
bool loadPlugin(const QString& filename);
|
|
||||||
QString createDefaultName() const;
|
|
||||||
void startAutoSave();
|
|
||||||
double getMag(ScoreView*) const;
|
|
||||||
void setMag(double);
|
|
||||||
bool noScore() const { return scoreList.isEmpty(); }
|
|
||||||
|
|
||||||
TextTools* textTools();
|
|
||||||
EditTools* editTools();
|
|
||||||
void showDrumTools(Drumset*, Staff*);
|
|
||||||
void showWebPanel(bool on);
|
|
||||||
|
|
||||||
void updateTabNames();
|
|
||||||
QProgressBar* showProgressBar();
|
|
||||||
void hideProgressBar();
|
|
||||||
void updateRecentScores(Score*);
|
|
||||||
QFileDialog* saveAsDialog();
|
|
||||||
QFileDialog* saveCopyDialog();
|
|
||||||
|
|
||||||
QString lastSaveCopyDirectory;
|
|
||||||
QString lastSaveDirectory;
|
|
||||||
SynthControl* getSynthControl() const { return synthControl; }
|
|
||||||
void editInPianoroll(Staff* staff);
|
|
||||||
void editInDrumroll(Staff* staff);
|
|
||||||
PianorollEditor* getPianorollEditor() const { return pianorollEditor; }
|
|
||||||
DrumrollEditor* getDrumrollEditor() const { return drumrollEditor; }
|
|
||||||
void writeSessionFile(bool);
|
|
||||||
bool restoreSession(bool);
|
|
||||||
bool splitScreen() const { return _splitScreen; }
|
|
||||||
void setCurrentView(int tabIdx, int idx);
|
|
||||||
void loadPlugins();
|
|
||||||
void unloadPlugins();
|
|
||||||
ScoreState state() const { return _sstate; }
|
|
||||||
void changeState(ScoreState);
|
|
||||||
bool readLanguages(const QString& path);
|
|
||||||
void setRevision(QString& r){rev = r;}
|
|
||||||
QString revision() {return rev;}
|
|
||||||
Q_INVOKABLE void newFile();
|
|
||||||
Q_INVOKABLE void loadFile(const QString& url);
|
|
||||||
void loadFile(const QUrl&);
|
|
||||||
void openScore(const QString& fn);
|
|
||||||
bool hasToCheckForUpdate();
|
|
||||||
static bool unstable();
|
|
||||||
bool eventFilter(QObject *, QEvent *);
|
|
||||||
void setMidiRecordId(int id) { _midiRecordId = id; }
|
|
||||||
int midiRecordId() const { return _midiRecordId; }
|
|
||||||
void populatePalette();
|
|
||||||
void excerptsChanged(Score*);
|
|
||||||
bool processMidiRemote(MidiRemoteType type, int data);
|
|
||||||
ScoreTab* getTab1() const { return tab1; }
|
|
||||||
ScoreTab* getTab2() const { return tab2; }
|
|
||||||
void readScoreError(const QString&) const;
|
|
||||||
QList<LanguageItem>& languages() { return _languages; }
|
|
||||||
|
|
||||||
QStringList getOpenScoreNames(QString& dir, const QString& filter);
|
|
||||||
QString getSaveScoreName(const QString& title,
|
|
||||||
QString& name, const QString& filter, QString* selectedFilter);
|
|
||||||
QString getSaveScoreName(const QString& title,
|
|
||||||
QString& name, const QString& filter, QString* selectedFilter, bool selectFolder);
|
|
||||||
QString getStyleFilename(bool open, const QString& title = QString());
|
|
||||||
QString getFotoFilename();
|
|
||||||
QString getChordStyleFilename(bool open);
|
|
||||||
QStringList getSoundFont(const QString&);
|
|
||||||
QString getScanFile(const QString&);
|
|
||||||
QString getAudioFile(const QString&);
|
|
||||||
QString getDrumsetFilename(bool open);
|
|
||||||
QString getPaletteFilename(bool open);
|
|
||||||
QString getWallpaper(const QString& caption);
|
|
||||||
|
|
||||||
bool hRaster() const { return hRasterAction->isChecked(); }
|
|
||||||
bool vRaster() const { return vRasterAction->isChecked(); }
|
|
||||||
|
|
||||||
PaletteBox* getPaletteBox();
|
|
||||||
void disableCommands(bool val) { inChordEditor = val; }
|
|
||||||
|
|
||||||
void updateInputState(Score*);
|
|
||||||
|
|
||||||
void tupletDialog();
|
|
||||||
void selectSimilar(Element*, bool);
|
|
||||||
void selectElementDialog(Element* e);
|
|
||||||
void transpose();
|
|
||||||
|
|
||||||
Q_INVOKABLE void openExternalLink(const QString&);
|
|
||||||
Q_INVOKABLE void closeWebPanelPermanently();
|
|
||||||
|
|
||||||
void endCmd();
|
|
||||||
void printFile();
|
|
||||||
bool exportFile();
|
|
||||||
bool exportParts();
|
|
||||||
bool saveAs(Score*, bool saveCopy, const QString& path, const QString& ext);
|
|
||||||
bool savePsPdf(const QString& saveName, QPrinter::OutputFormat format);
|
|
||||||
bool savePsPdf(Score* cs, const QString& saveName, QPrinter::OutputFormat format);
|
|
||||||
bool readScore(Score*, QString name);
|
|
||||||
bool saveAs(Score*, bool saveCopy = false);
|
|
||||||
bool saveSelection(Score*);
|
|
||||||
void addImage(Score*, Element*);
|
|
||||||
bool savePng(Score*, const QString& name, bool screenshot, bool transparent, double convDpi, QImage::Format format);
|
|
||||||
bool saveAudio(Score*, const QString& name, const QString& type);
|
|
||||||
bool saveMp3(Score*, const QString& name);
|
|
||||||
bool saveMxl(Score*, const QString& name);
|
|
||||||
bool saveXml(Score*, const QString& name);
|
|
||||||
bool saveSvg(Score*, const QString& name);
|
|
||||||
bool savePng(Score*, const QString& name);
|
|
||||||
bool saveLilypond(Score*, const QString& name);
|
|
||||||
|
|
||||||
// static bool importPdf(Score*, const QString& path);
|
|
||||||
static bool importGTP(Score*, const QString& name);
|
|
||||||
static bool importBww(Score*, const QString& path);
|
|
||||||
static bool importMusicXml(Score*, const QString&);
|
|
||||||
static bool importCompressedMusicXml(Score*, const QString&);
|
|
||||||
static bool importMuseData(Score*, const QString& name);
|
|
||||||
static bool importLilypond(Score*, const QString& name);
|
|
||||||
static bool importBB(Score*, const QString& name);
|
|
||||||
static bool importCapella(Score*, const QString& name);
|
|
||||||
static bool importOve(Score*, const QString& name);
|
|
||||||
|
|
||||||
void closeScore(Score* score);
|
|
||||||
|
|
||||||
void addTempo();
|
|
||||||
void addMetronome();
|
|
||||||
|
|
||||||
Q_INVOKABLE QString getLocaleISOCode();
|
|
||||||
Navigator* navigator() const;
|
|
||||||
NScrollArea* navigatorScrollArea() const { return _navigator; }
|
|
||||||
void updateLayer();
|
|
||||||
void updatePlayMode();
|
|
||||||
bool metronome() const { return metronomeAction->isChecked(); }
|
|
||||||
bool panDuringPlayback() const { return panAction->isChecked(); }
|
|
||||||
void noteTooShortForTupletDialog();
|
|
||||||
void enableInputToolbar(bool enableInput);
|
|
||||||
void loadFiles();
|
|
||||||
|
|
||||||
static Palette* newTextPalette();
|
|
||||||
static Palette* newRepeatsPalette();
|
|
||||||
static Palette* newBreaksPalette();
|
|
||||||
static Palette* newBeamPalette();
|
|
||||||
static Palette* newDynamicsPalette();
|
|
||||||
static Palette* newFramePalette();
|
|
||||||
static Palette* newFingeringPalette();
|
|
||||||
static Palette* newFallDoitPalette();
|
|
||||||
static Palette* newTremoloPalette();
|
|
||||||
static Palette* newNoteHeadsPalette();
|
|
||||||
static Palette* newArticulationsPalette();
|
|
||||||
static Palette* newBracketsPalette();
|
|
||||||
static Palette* newBreathPalette();
|
|
||||||
static Palette* newArpeggioPalette();
|
|
||||||
static Palette* newClefsPalette();
|
|
||||||
static Palette* newGraceNotePalette();
|
|
||||||
static Palette* newKeySigPalette();
|
|
||||||
static Palette* newAccidentalsPalette();
|
|
||||||
static Palette* newBarLinePalette();
|
|
||||||
static Palette* newLinesPalette();
|
|
||||||
};
|
|
||||||
|
|
||||||
extern MuseScore* mscore;
|
|
||||||
extern QString dataPath;
|
|
||||||
|
|
||||||
extern QAction* getAction(const char*);
|
|
||||||
extern Shortcut* midiActionMap[128];
|
|
||||||
extern void setMscoreLocale(QString localeName);
|
|
||||||
extern QPixmap sym2pixmap(const Sym* s, qreal mag);
|
|
||||||
|
|
||||||
extern bool saveMidi(Score*, const QString& name);
|
|
||||||
extern bool importMidi(Score*, const QString& name);
|
|
||||||
extern void convertMidi(Score*, MidiFile* mf);
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,516 +0,0 @@
|
||||||
//=============================================================================
|
|
||||||
// MuseScore
|
|
||||||
// Linux Music Score Editor
|
|
||||||
// $Id: plugins.cpp 5568 2012-04-22 10:08:43Z wschweer $
|
|
||||||
//
|
|
||||||
// Copyright (C) 2009-2010 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.
|
|
||||||
//
|
|
||||||
// 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, write to the Free Software
|
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
#include "musescore.h"
|
|
||||||
#include "libmscore/score.h"
|
|
||||||
#include "libmscore/undo.h"
|
|
||||||
#include "globals.h"
|
|
||||||
#include "script.h"
|
|
||||||
#include "config.h"
|
|
||||||
#include "preferences.h"
|
|
||||||
#include "libmscore/chord.h"
|
|
||||||
#include "libmscore/note.h"
|
|
||||||
#include "libmscore/utils.h"
|
|
||||||
#include "sccursor.h"
|
|
||||||
#include "libmscore/mscore.h"
|
|
||||||
#include "plugins.h"
|
|
||||||
|
|
||||||
Q_DECLARE_METATYPE(Score*);
|
|
||||||
Q_DECLARE_METATYPE(SCursor*);
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// registerQmlPlugin
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void MuseScore::registerQmlPlugin(const QString& path)
|
|
||||||
{
|
|
||||||
printf("register qml plugin <%s>\n", qPrintable(path));
|
|
||||||
if (qml == 0) {
|
|
||||||
qml = new QDeclarativeEngine;
|
|
||||||
qmlRegisterType<QmlPlugin>("MuseScore", 1, 0, "MuseScore");
|
|
||||||
}
|
|
||||||
QDeclarativeComponent component(qml, QUrl::fromLocalFile(path));
|
|
||||||
QObject* obj = component.create();
|
|
||||||
if (obj == 0) {
|
|
||||||
qDebug("creating component failed");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
qDebug("component ok");
|
|
||||||
#if 1
|
|
||||||
QmlPlugin* item = qobject_cast<QmlPlugin*>(obj);
|
|
||||||
QString menuPath = item->menuPath();
|
|
||||||
printf(" menuPath: <%s>\n", qPrintable(menuPath));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
QDeclarativeView* view = new QDeclarativeView;
|
|
||||||
view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
|
|
||||||
view->setSource(QUrl::fromLocalFile(path));
|
|
||||||
view->show();
|
|
||||||
#endif
|
|
||||||
plugins.append(path);
|
|
||||||
createMenuEntry(menuPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// registerPlugin
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void MuseScore::registerPlugin(const QString& pluginPath)
|
|
||||||
{
|
|
||||||
QFileInfo np(pluginPath);
|
|
||||||
QString baseName = np.baseName();
|
|
||||||
|
|
||||||
foreach(QString s, plugins) {
|
|
||||||
QFileInfo fi(s);
|
|
||||||
if (fi.baseName() == baseName) {
|
|
||||||
if (MScore::debugMode)
|
|
||||||
qDebug(" Plugin <%s> already registered\n", qPrintable(pluginPath));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QFile f(pluginPath);
|
|
||||||
if (!f.open(QIODevice::ReadOnly)) {
|
|
||||||
if (MScore::debugMode)
|
|
||||||
qDebug("Loading Plugin <%s> failed\n", qPrintable(pluginPath));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (MScore::debugMode)
|
|
||||||
qDebug("Register Plugin <%s>", qPrintable(pluginPath));
|
|
||||||
|
|
||||||
if (np.suffix() == "qml") {
|
|
||||||
f.close();
|
|
||||||
registerQmlPlugin(pluginPath);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (se == 0) {
|
|
||||||
se = new ScriptEngine();
|
|
||||||
se->installTranslatorFunctions();
|
|
||||||
}
|
|
||||||
|
|
||||||
//load translation
|
|
||||||
QString pPath = np.absolutePath();
|
|
||||||
QSettings settings;
|
|
||||||
QString lName = settings.value("language", "system").toString();
|
|
||||||
if (lName.toLower() == "system")
|
|
||||||
lName = QLocale::system().name();
|
|
||||||
QTranslator* translator = new QTranslator;
|
|
||||||
if (translator->load("locale_"+lName, pPath+"/translations"))
|
|
||||||
qApp->installTranslator(translator);
|
|
||||||
|
|
||||||
QScriptValue val = se->evaluate(f.readAll(), pluginPath);
|
|
||||||
if (se->hasUncaughtException()) {
|
|
||||||
QScriptValue sv = se->uncaughtException();
|
|
||||||
#if 0
|
|
||||||
qDebug("Load plugin <%s>: line %d: %s\n",
|
|
||||||
qPrintable(pluginPath),
|
|
||||||
se->uncaughtExceptionLineNumber(),
|
|
||||||
qPrintable(sv.toString()));
|
|
||||||
#endif
|
|
||||||
QMessageBox::critical(0, "MuseScore Error",
|
|
||||||
tr("Error loading plugin\n"
|
|
||||||
"\"%1\" line %2:\n"
|
|
||||||
"%3").arg(pluginPath)
|
|
||||||
.arg(se->uncaughtExceptionLineNumber())
|
|
||||||
.arg(sv.toString())
|
|
||||||
);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
f.close();
|
|
||||||
QScriptValue init = val.property("init");
|
|
||||||
if (!init.isFunction()) {
|
|
||||||
qDebug("Load plugin <%s>: no init function found\n", qPrintable(pluginPath));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QScriptValue run = val.property("run");
|
|
||||||
if (!run.isFunction()) {
|
|
||||||
qDebug("Load plugin <%s>: no run function found\n", qPrintable(pluginPath));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
int majorVersion = val.property("majorVersion").toInt32();
|
|
||||||
int minorVersion = val.property("minorVersion").toInt32();
|
|
||||||
if (majorVersion) {
|
|
||||||
if (majorVersion != SCRIPT_MAJOR_VERSION) {
|
|
||||||
QString s = tr("Script\n%1\nis incompatible with current interface");
|
|
||||||
QMessageBox::warning(0,
|
|
||||||
QWidget::tr("MuseScore: register script plugin:"),
|
|
||||||
s.arg(pluginPath),
|
|
||||||
QString::null, QString::null, QString::null, 0, 1);
|
|
||||||
}
|
|
||||||
else if (minorVersion > SCRIPT_MINOR_VERSION) {
|
|
||||||
qDebug("Your MuseScore version may be too old to run script <%s> (minor version %d > %d)\n",
|
|
||||||
qPrintable(pluginPath), minorVersion, SCRIPT_MINOR_VERSION);
|
|
||||||
QString s = tr("MuseScore is too old to run script\n%1");
|
|
||||||
QMessageBox::warning(0,
|
|
||||||
QWidget::tr("MuseScore: register script plugin:"),
|
|
||||||
s.arg(pluginPath),
|
|
||||||
QString::null, QString::null, QString::null, 0, 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins.append(pluginPath);
|
|
||||||
|
|
||||||
//give access to pluginPath in init
|
|
||||||
se->globalObject().setProperty("pluginPath", se->newVariant(pPath));
|
|
||||||
|
|
||||||
init.call();
|
|
||||||
QString menu = val.property("menu").toString();
|
|
||||||
menu = qApp->translate(qPrintable(baseName), qPrintable(menu));
|
|
||||||
if (menu.isEmpty()) {
|
|
||||||
qDebug("Load plugin: no menu property\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
createMenuEntry(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// createMenuEntry
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void MuseScore::createMenuEntry(const QString& menu)
|
|
||||||
{
|
|
||||||
if (!pluginMapper)
|
|
||||||
return;
|
|
||||||
|
|
||||||
QStringList ml;
|
|
||||||
QString s;
|
|
||||||
bool escape = false;
|
|
||||||
foreach (QChar c, menu) {
|
|
||||||
if (escape) {
|
|
||||||
escape = false;
|
|
||||||
s += c;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (c == '\\')
|
|
||||||
escape = true;
|
|
||||||
else {
|
|
||||||
if (c == '.') {
|
|
||||||
ml += s;
|
|
||||||
s = "";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
s += c;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!s.isEmpty())
|
|
||||||
ml += s;
|
|
||||||
|
|
||||||
int n = ml.size();
|
|
||||||
QWidget* curMenu = menuBar();
|
|
||||||
|
|
||||||
for(int i = 0; i < n; ++i) {
|
|
||||||
QString m = ml[i];
|
|
||||||
bool found = false;
|
|
||||||
QList<QObject*> ol = curMenu->children();
|
|
||||||
foreach(QObject* o, ol) {
|
|
||||||
QMenu* menu = qobject_cast<QMenu*>(o);
|
|
||||||
if (!menu)
|
|
||||||
continue;
|
|
||||||
if (menu->objectName() == m || menu->title() == m) {
|
|
||||||
curMenu = menu;
|
|
||||||
found = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!found) {
|
|
||||||
if (i == 0) {
|
|
||||||
curMenu = new QMenu(m, menuBar());
|
|
||||||
curMenu->setObjectName(m);
|
|
||||||
menuBar()->insertMenu(menuBar()->actions().back(), (QMenu*)curMenu);
|
|
||||||
if (MScore::debugMode)
|
|
||||||
qDebug("add Menu <%s>\n", qPrintable(m));
|
|
||||||
}
|
|
||||||
else if (i + 1 == n) {
|
|
||||||
QStringList sl = m.split(":");
|
|
||||||
QAction* a = 0;
|
|
||||||
QMenu* cm = static_cast<QMenu*>(curMenu);
|
|
||||||
if (sl.size() == 2) {
|
|
||||||
QList<QAction*> al = cm->actions();
|
|
||||||
QAction* ba = 0;
|
|
||||||
foreach(QAction* ia, al) {
|
|
||||||
if (ia->text() == sl[0]) {
|
|
||||||
ba = ia;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
a = new QAction(sl[1], 0);
|
|
||||||
cm->insertAction(ba, a);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
a = cm->addAction(m);
|
|
||||||
}
|
|
||||||
registerPlugin(a);
|
|
||||||
if (MScore::debugMode)
|
|
||||||
qDebug("add action <%s>\n", qPrintable(m));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
curMenu = ((QMenu*)curMenu)->addMenu(m);
|
|
||||||
if (MScore::debugMode)
|
|
||||||
qDebug("add menu <%s>\n", qPrintable(m));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// pluginIdxFromPath
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
int MuseScore::pluginIdxFromPath(QString pluginPath) {
|
|
||||||
QFileInfo np(pluginPath);
|
|
||||||
QString baseName = np.baseName();
|
|
||||||
int idx = 0;
|
|
||||||
foreach(QString s, plugins) {
|
|
||||||
QFileInfo fi(s);
|
|
||||||
if (fi.baseName() == baseName) {
|
|
||||||
return idx;
|
|
||||||
}
|
|
||||||
idx++;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// addGlobalObjectToPluginEngine
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void MuseScore::addGlobalObjectToPluginEngine(const char * name, const QString & value )
|
|
||||||
{
|
|
||||||
se->globalObject().setProperty(name, se->newVariant(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// registerPlugin
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void MuseScore::registerPlugin(QAction* a)
|
|
||||||
{
|
|
||||||
if (!pluginMapper) {
|
|
||||||
qDebug("registerPlugin: no pluginMapper\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
pluginActions.append(a);
|
|
||||||
int pluginIdx = plugins.size() - 1; // plugin is already appended
|
|
||||||
printf("register plugin <%s> idx %d\n", qPrintable(plugins[pluginIdx]), pluginIdx);
|
|
||||||
connect(a, SIGNAL(triggered()), pluginMapper, SLOT(map()));
|
|
||||||
pluginMapper->setMapping(a, pluginIdx);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// loadPlugins
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void MuseScore::loadPlugins()
|
|
||||||
{
|
|
||||||
pluginMapper = new QSignalMapper(this);
|
|
||||||
connect(pluginMapper, SIGNAL(mapped(int)), SLOT(pluginTriggered(int)));
|
|
||||||
foreach(PluginDescription* d, preferences.pluginList) {
|
|
||||||
if (d->load) {
|
|
||||||
registerPlugin(d->path);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// unloadPlugins
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void MuseScore::unloadPlugins()
|
|
||||||
{
|
|
||||||
for (int idx = 0; idx < plugins.size() ; idx++) {
|
|
||||||
pluginExecuteFunction(idx, "onClose");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// loadPlugin
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
bool MuseScore::loadPlugin(const QString& filename)
|
|
||||||
{
|
|
||||||
bool result = false;
|
|
||||||
|
|
||||||
QDir pluginDir(mscoreGlobalShare + "plugins");
|
|
||||||
if (MScore::debugMode)
|
|
||||||
qDebug("Plugin Path <%s>\n", qPrintable(mscoreGlobalShare + "plugins"));
|
|
||||||
|
|
||||||
if (filename.endsWith(".js")){
|
|
||||||
QFileInfo fi(pluginDir, filename);
|
|
||||||
if (fi.exists()) {
|
|
||||||
QString path(fi.filePath());
|
|
||||||
registerPlugin(path);
|
|
||||||
result = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// ScriptEngine
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
ScriptEngine::ScriptEngine()
|
|
||||||
: QScriptEngine()
|
|
||||||
{
|
|
||||||
#if 0
|
|
||||||
QStringList sl = availableExtensions();
|
|
||||||
foreach(QString s, sl)
|
|
||||||
qDebug("available script extension: <%s>\n", qPrintable(s));
|
|
||||||
#endif
|
|
||||||
static const char* xts[] = {
|
|
||||||
"qt.core", "qt.gui", "qt.xml", "qt.network", "qt.uitools", "qt.webkit"
|
|
||||||
};
|
|
||||||
for (unsigned i = 0; i < sizeof(xts)/sizeof(*xts); ++i) {
|
|
||||||
importExtension(xts[i]);
|
|
||||||
if (hasUncaughtException()) {
|
|
||||||
QScriptValue val = uncaughtException();
|
|
||||||
qDebug("Error loading Script extension <%s>: %s\n",
|
|
||||||
xts[i], qPrintable(val.toString()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// create MuseScore bindings
|
|
||||||
//
|
|
||||||
|
|
||||||
globalObject().setProperty("Cursor", create_Cursor_class(this), QScriptValue::SkipInEnumeration);
|
|
||||||
globalObject().setProperty("Score", create_Score_class(this), QScriptValue::SkipInEnumeration);
|
|
||||||
globalObject().setProperty("Note", create_Note_class(this), QScriptValue::SkipInEnumeration);
|
|
||||||
globalObject().setProperty("Chord", create_Chord_class(this), QScriptValue::SkipInEnumeration);
|
|
||||||
globalObject().setProperty("Rest", create_Rest_class(this), QScriptValue::SkipInEnumeration);
|
|
||||||
globalObject().setProperty("Harmony", create_Harmony_class(this), QScriptValue::SkipInEnumeration);
|
|
||||||
globalObject().setProperty("Text", create_Text_class(this), QScriptValue::SkipInEnumeration);
|
|
||||||
globalObject().setProperty("Measure", create_Measure_class(this), QScriptValue::SkipInEnumeration);
|
|
||||||
globalObject().setProperty("Part", create_Part_class(this), QScriptValue::SkipInEnumeration);
|
|
||||||
globalObject().setProperty("PageFormat",create_PageFormat_class(this), QScriptValue::SkipInEnumeration);
|
|
||||||
|
|
||||||
globalObject().setProperty("mscore", newQObject(mscore));
|
|
||||||
globalObject().setProperty("division", newVariant(MScore::division));
|
|
||||||
globalObject().setProperty("mscoreVersion", newVariant(version()));
|
|
||||||
globalObject().setProperty("mscoreMajorVersion", newVariant(majorVersion()));
|
|
||||||
globalObject().setProperty("mscoreMinorVersion", newVariant(minorVersion()));
|
|
||||||
globalObject().setProperty("mscoreUpdateVersion", newVariant(updateVersion()));
|
|
||||||
globalObject().setProperty("mscoreDPI", newVariant(MScore::DPI));
|
|
||||||
//globalObject().setProperty("localeName", newVariant(lName));
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// pluginTriggered
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void MuseScore::pluginTriggered(int idx)
|
|
||||||
{
|
|
||||||
printf("plugin triggered %d\n", idx);
|
|
||||||
QString pp = plugins[idx];
|
|
||||||
QFileInfo fi(pp);
|
|
||||||
if (fi.suffix() == "qml") {
|
|
||||||
QDeclarativeView* view = new QDeclarativeView;
|
|
||||||
view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
|
|
||||||
view->setSource(QUrl::fromLocalFile(pp));
|
|
||||||
printf("show plugin <%s>\n", qPrintable(pp));
|
|
||||||
view->show();
|
|
||||||
QmlPlugin* p = (QmlPlugin*)(view->rootObject());
|
|
||||||
p->runPlugin();
|
|
||||||
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
pluginExecuteFunction(idx, "run");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MuseScore::pluginExecuteFunction(int idx, const char* functionName)
|
|
||||||
{
|
|
||||||
QString pp = plugins[idx];
|
|
||||||
QFile f(pp);
|
|
||||||
if (!f.open(QIODevice::ReadOnly)) {
|
|
||||||
if (MScore::debugMode)
|
|
||||||
qDebug("Loading Plugin <%s> failed\n", qPrintable(pp));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (MScore::debugMode)
|
|
||||||
qDebug("Run Plugin <%s> : <%s>\n", qPrintable(pp), functionName);
|
|
||||||
if (se == 0) {
|
|
||||||
se = new ScriptEngine();
|
|
||||||
se->installTranslatorFunctions();
|
|
||||||
if (MScore::debugMode) {
|
|
||||||
QStringList lp = qApp->libraryPaths();
|
|
||||||
foreach(const QString& s, lp)
|
|
||||||
qDebug("lib path <%s>\n", qPrintable(s));
|
|
||||||
|
|
||||||
QStringList sl = se->availableExtensions();
|
|
||||||
qDebug("available:\n");
|
|
||||||
foreach(const QString& s, sl)
|
|
||||||
qDebug(" <%s>\n", qPrintable(s));
|
|
||||||
|
|
||||||
sl = se->importedExtensions();
|
|
||||||
qDebug("imported:\n");
|
|
||||||
foreach(const QString& s, sl)
|
|
||||||
qDebug(" <%s>\n", qPrintable(s));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (scriptDebug) {
|
|
||||||
if (debugger == 0) {
|
|
||||||
scriptDebugger = new QScriptEngineDebugger();
|
|
||||||
scriptDebugger->attachTo(se);
|
|
||||||
}
|
|
||||||
scriptDebugger->action(QScriptEngineDebugger::InterruptAction)->trigger();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cs)
|
|
||||||
se->globalObject().setProperty("curScore", se->newVariant(qVariantFromValue(cs)));
|
|
||||||
|
|
||||||
QFileInfo fi(f);
|
|
||||||
pluginPath = fi.absolutePath();
|
|
||||||
se->globalObject().setProperty("pluginPath", se->newVariant(pluginPath));
|
|
||||||
|
|
||||||
QScriptValue val = se->evaluate(f.readAll(), pp);
|
|
||||||
f.close();
|
|
||||||
QScriptValue run = val.property(functionName);
|
|
||||||
if (!run.isFunction()) {
|
|
||||||
if (MScore::debugMode)
|
|
||||||
qDebug("Execute plugin: no %s function found\n", functionName);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach(Score* s, scoreList)
|
|
||||||
s->startCmd();
|
|
||||||
run.call();
|
|
||||||
if (se->hasUncaughtException()) {
|
|
||||||
QScriptValue sv = se->uncaughtException();
|
|
||||||
QMessageBox::critical(0, "MuseScore Error",
|
|
||||||
tr("Error loading plugin\n"
|
|
||||||
"\"%1\" line %2:\n"
|
|
||||||
"%3").arg(pluginPath)
|
|
||||||
.arg(se->uncaughtExceptionLineNumber())
|
|
||||||
.arg(sv.toString())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
foreach(Score* s, scoreList)
|
|
||||||
s->endCmd();
|
|
||||||
if(cs)
|
|
||||||
cs->end();
|
|
||||||
}
|
|
|
@ -1,45 +0,0 @@
|
||||||
//=============================================================================
|
|
||||||
// MuseScore
|
|
||||||
// Music Composition & Notation
|
|
||||||
//
|
|
||||||
// Copyright (C) 2012 Werner Schweer
|
|
||||||
//
|
|
||||||
// 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 LICENCE.GPL
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
#ifndef __PLUGINS_H__
|
|
||||||
#define __PLUGINS_H__
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// QmlPlugin
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
class QmlPlugin : public QDeclarativeItem {
|
|
||||||
Q_OBJECT
|
|
||||||
Q_PROPERTY(QString menuPath READ menuPath WRITE setMenuPath)
|
|
||||||
Q_PROPERTY(bool hasGui READ hasGui WRITE setHasGui)
|
|
||||||
Q_PROPERTY(int mscoreVersion READ mscoreVersion)
|
|
||||||
|
|
||||||
QString _menuPath;
|
|
||||||
bool _hasGui;
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void run();
|
|
||||||
|
|
||||||
public:
|
|
||||||
QmlPlugin(QDeclarativeItem* parent = 0) : QDeclarativeItem(parent) {}
|
|
||||||
|
|
||||||
void setMenuPath(const QString& s) { _menuPath = s; }
|
|
||||||
QString menuPath() const { return _menuPath; }
|
|
||||||
bool hasGui() const { return _hasGui; }
|
|
||||||
void setHasGui(bool val) { _hasGui = val; }
|
|
||||||
int mscoreVersion() const { return version(); }
|
|
||||||
void runPlugin() { emit run(); }
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,206 +0,0 @@
|
||||||
//=============================================================================
|
|
||||||
// MusE Score
|
|
||||||
// Linux Music Score Editor
|
|
||||||
// $Id: preferences.h 5660 2012-05-22 14:17:39Z wschweer $
|
|
||||||
//
|
|
||||||
// Copyright (C) 2002-2011 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.
|
|
||||||
//
|
|
||||||
// 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, write to the Free Software
|
|
||||||
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
//=============================================================================
|
|
||||||
|
|
||||||
#ifndef __PREFERENCES_H__
|
|
||||||
#define __PREFERENCES_H__
|
|
||||||
|
|
||||||
#include "globals.h"
|
|
||||||
|
|
||||||
enum SessionStart {
|
|
||||||
EMPTY_SESSION, LAST_SESSION, NEW_SESSION, SCORE_SESSION
|
|
||||||
};
|
|
||||||
|
|
||||||
// midi remote control values:
|
|
||||||
enum {
|
|
||||||
RMIDI_REWIND,
|
|
||||||
RMIDI_TOGGLE_PLAY,
|
|
||||||
RMIDI_PLAY,
|
|
||||||
RMIDI_STOP,
|
|
||||||
RMIDI_NOTE1,
|
|
||||||
RMIDI_NOTE2,
|
|
||||||
RMIDI_NOTE4,
|
|
||||||
RMIDI_NOTE8,
|
|
||||||
RMIDI_NOTE16,
|
|
||||||
RMIDI_NOTE32,
|
|
||||||
RMIDI_NOTE64,
|
|
||||||
RMIDI_REST,
|
|
||||||
RMIDI_DOT,
|
|
||||||
RMIDI_DOTDOT,
|
|
||||||
RMIDI_TIE,
|
|
||||||
RMIDI_NOTE_EDIT_MODE,
|
|
||||||
MIDI_REMOTES
|
|
||||||
};
|
|
||||||
|
|
||||||
enum MuseScoreStyleType {
|
|
||||||
STYLE_DARK,
|
|
||||||
STYLE_LIGHT,
|
|
||||||
STYLE_NATIVE
|
|
||||||
};
|
|
||||||
|
|
||||||
// MusicXML export break values
|
|
||||||
enum MusicxmlExportBreaks {
|
|
||||||
ALL_BREAKS, MANUAL_BREAKS, NO_BREAKS
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// PluginDescription
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
struct PluginDescription {
|
|
||||||
QString path;
|
|
||||||
bool load;
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// Preferences
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
struct Preferences {
|
|
||||||
bool bgUseColor;
|
|
||||||
bool fgUseColor;
|
|
||||||
QString bgWallpaper;
|
|
||||||
QString fgWallpaper;
|
|
||||||
QColor fgColor;
|
|
||||||
int iconHeight, iconWidth;
|
|
||||||
QColor dropColor;
|
|
||||||
bool enableMidiInput;
|
|
||||||
bool playNotes; // play notes on click
|
|
||||||
QString lPort; // audio port left
|
|
||||||
QString rPort; // audio port right
|
|
||||||
bool showNavigator;
|
|
||||||
bool showPlayPanel;
|
|
||||||
bool showWebPanel;
|
|
||||||
bool showStatusBar;
|
|
||||||
QPoint playPanelPos;
|
|
||||||
|
|
||||||
bool useAlsaAudio;
|
|
||||||
bool useJackAudio;
|
|
||||||
bool usePortaudioAudio;
|
|
||||||
bool usePulseAudio;
|
|
||||||
bool useJackMidi;
|
|
||||||
int midiPorts;
|
|
||||||
bool rememberLastMidiConnections;
|
|
||||||
|
|
||||||
QString alsaDevice;
|
|
||||||
int alsaSampleRate;
|
|
||||||
int alsaPeriodSize;
|
|
||||||
int alsaFragments;
|
|
||||||
int portaudioDevice;
|
|
||||||
QString portMidiInput;
|
|
||||||
|
|
||||||
bool antialiasedDrawing;
|
|
||||||
SessionStart sessionStart;
|
|
||||||
QString startScore;
|
|
||||||
QString defaultStyleFile;
|
|
||||||
bool showSplashScreen;
|
|
||||||
|
|
||||||
bool useMidiRemote;
|
|
||||||
MidiRemote midiRemote[MIDI_REMOTES];
|
|
||||||
|
|
||||||
bool midiExpandRepeats;
|
|
||||||
QString instrumentList; // file path of instrument templates
|
|
||||||
|
|
||||||
bool musicxmlImportLayout;
|
|
||||||
bool musicxmlImportBreaks;
|
|
||||||
bool musicxmlExportLayout;
|
|
||||||
MusicxmlExportBreaks musicxmlExportBreaks;
|
|
||||||
|
|
||||||
bool alternateNoteEntryMethod;
|
|
||||||
int proximity; // proximity for selecting elements on canvas
|
|
||||||
bool autoSave;
|
|
||||||
int autoSaveTime;
|
|
||||||
double pngResolution;
|
|
||||||
bool pngTransparent;
|
|
||||||
QString language;
|
|
||||||
|
|
||||||
bool replaceCopyrightSymbol;
|
|
||||||
double mag;
|
|
||||||
|
|
||||||
//update
|
|
||||||
int checkUpdateStartup;
|
|
||||||
|
|
||||||
float tuning; // synthesizer master tuning offset (440Hz)
|
|
||||||
float masterGain; // synthesizer master gain
|
|
||||||
float chorusGain;
|
|
||||||
float reverbGain;
|
|
||||||
float reverbRoomSize;
|
|
||||||
float reverbDamp;
|
|
||||||
float reverbWidth;
|
|
||||||
|
|
||||||
bool followSong;
|
|
||||||
QString importCharset;
|
|
||||||
QString importStyleFile;
|
|
||||||
int shortestNote; // for midi input
|
|
||||||
|
|
||||||
bool useOsc;
|
|
||||||
int oscPort;
|
|
||||||
bool singlePalette;
|
|
||||||
QString styleName;
|
|
||||||
int globalStyle; // 0 - dark, 1 - light
|
|
||||||
|
|
||||||
QString myScoresPath;
|
|
||||||
QString myStylesPath;
|
|
||||||
QString myImagesPath;
|
|
||||||
QString myTemplatesPath;
|
|
||||||
QString myPluginsPath;
|
|
||||||
QString mySoundFontsPath;
|
|
||||||
|
|
||||||
double nudgeStep10; // Ctrl + cursor key (default 1.0)
|
|
||||||
double nudgeStep50; // Alt + cursor key (default 5.0)
|
|
||||||
|
|
||||||
bool nativeDialogs;
|
|
||||||
|
|
||||||
int exportAudioSampleRate;
|
|
||||||
|
|
||||||
QString profile;
|
|
||||||
|
|
||||||
bool firstStartWeb;
|
|
||||||
|
|
||||||
bool dirty;
|
|
||||||
|
|
||||||
QList<PluginDescription*> pluginList;
|
|
||||||
|
|
||||||
bool readPluginList();
|
|
||||||
void writePluginList();
|
|
||||||
void updatePluginList();
|
|
||||||
|
|
||||||
Preferences();
|
|
||||||
void write();
|
|
||||||
void read();
|
|
||||||
void init();
|
|
||||||
bool readDefaultStyle();
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// ShortcutItem
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
class ShortcutItem : public QTreeWidgetItem {
|
|
||||||
|
|
||||||
bool operator<(const QTreeWidgetItem&) const;
|
|
||||||
|
|
||||||
public:
|
|
||||||
ShortcutItem() : QTreeWidgetItem() {}
|
|
||||||
};
|
|
||||||
|
|
||||||
extern Preferences preferences;
|
|
||||||
extern QString appStyleSheet();
|
|
||||||
extern bool useALSA, useJACK, usePortaudio;
|
|
||||||
#endif
|
|
21
mscore/.qped
21
mscore/.qped
|
@ -1,21 +0,0 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
||||||
<Ped version="1.0">
|
|
||||||
<Status>
|
|
||||||
<geometry x="788" y="0" w="889" h="1140" />
|
|
||||||
<Editor1>
|
|
||||||
<KontextList>
|
|
||||||
<Kontext>
|
|
||||||
<path>/home/ws/mscore/mscore/actions.cpp</path>
|
|
||||||
<column>0</column>
|
|
||||||
<line>2290</line>
|
|
||||||
<xoff>0</xoff>
|
|
||||||
<yoff>10</yoff>
|
|
||||||
</Kontext>
|
|
||||||
<cur>1</cur>
|
|
||||||
</KontextList>
|
|
||||||
</Editor1>
|
|
||||||
<search>omr</search>
|
|
||||||
<colorify>0</colorify>
|
|
||||||
<brackets>1</brackets>
|
|
||||||
</Status>
|
|
||||||
</Ped>
|
|
|
@ -1,480 +0,0 @@
|
||||||
//=============================================================================
|
|
||||||
// MuseScore
|
|
||||||
// Music Composition & Notation
|
|
||||||
// $Id:$
|
|
||||||
//
|
|
||||||
// Copyright (C) 2011 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 "globals.h"
|
|
||||||
#include "shortcut.h"
|
|
||||||
#include "musescore.h"
|
|
||||||
#include "icons.h"
|
|
||||||
#include "libmscore/xml.h"
|
|
||||||
|
|
||||||
bool Shortcut::dirty = false;
|
|
||||||
QMap<QString, Shortcut*> Shortcut::_shortcuts;
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// Shortcut
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
Shortcut::Shortcut()
|
|
||||||
{
|
|
||||||
_key = 0;
|
|
||||||
_descr = 0;
|
|
||||||
_text = 0;
|
|
||||||
_help = 0;
|
|
||||||
_state = 0;
|
|
||||||
_flags = 0;
|
|
||||||
_standardKey = QKeySequence::UnknownKey;
|
|
||||||
_context = Qt::WindowShortcut;
|
|
||||||
_icon = 0;
|
|
||||||
_action = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Shortcut::Shortcut(int s, int f, const char* name, Qt::ShortcutContext cont, const char* d,
|
|
||||||
const char* txt, const char* h, int i)
|
|
||||||
{
|
|
||||||
_key = name;
|
|
||||||
_descr = d;
|
|
||||||
_text = txt;
|
|
||||||
_help = h;
|
|
||||||
_state = s;
|
|
||||||
_flags = f;
|
|
||||||
_standardKey = QKeySequence::UnknownKey;
|
|
||||||
_context = cont;
|
|
||||||
_icon = i;
|
|
||||||
_action = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Shortcut::Shortcut(int s, int f, const char* name, const char* d,
|
|
||||||
const char* txt, const char* h, int i)
|
|
||||||
{
|
|
||||||
_key = name;
|
|
||||||
_descr = d;
|
|
||||||
_text = txt;
|
|
||||||
_help = h;
|
|
||||||
_state = s;
|
|
||||||
_flags = f;
|
|
||||||
_standardKey = QKeySequence::UnknownKey;
|
|
||||||
_context = Qt::WindowShortcut;
|
|
||||||
_icon = i;
|
|
||||||
_action = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Shortcut::Shortcut(const Shortcut& sc)
|
|
||||||
{
|
|
||||||
_key = sc._key;
|
|
||||||
_descr = sc._descr;
|
|
||||||
_text = sc._text;
|
|
||||||
_help = sc._help;
|
|
||||||
_state = sc._state;
|
|
||||||
_flags = sc._flags;
|
|
||||||
_standardKey = sc._standardKey;
|
|
||||||
_keys = sc._keys;
|
|
||||||
_context = sc._context;
|
|
||||||
_icon = sc._icon;
|
|
||||||
_action = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Shortcut::~Shortcut()
|
|
||||||
{
|
|
||||||
// delete _action;
|
|
||||||
// _action->deleteLater();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// clear
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Shortcut::clear()
|
|
||||||
{
|
|
||||||
_standardKey = QKeySequence::UnknownKey;
|
|
||||||
_keys.clear();
|
|
||||||
if (_action)
|
|
||||||
_action->setShortcuts(_keys);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// setKeys
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Shortcut::setKeys(const QList<QKeySequence>& ks)
|
|
||||||
{
|
|
||||||
_standardKey = QKeySequence::UnknownKey;
|
|
||||||
_keys = ks;
|
|
||||||
if (_action)
|
|
||||||
_action->setShortcuts(_keys);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// descr
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
QString Shortcut::descr() const
|
|
||||||
{
|
|
||||||
return qApp->translate("action", _descr);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// text
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
QString Shortcut::text() const
|
|
||||||
{
|
|
||||||
return qApp->translate("action", _text);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// help
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
QString Shortcut::help() const
|
|
||||||
{
|
|
||||||
return qApp->translate("action", _help);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// getShortcut
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
Shortcut* Shortcut::getShortcut(const char* id)
|
|
||||||
{
|
|
||||||
Shortcut* s = _shortcuts.value(id);
|
|
||||||
if (s == 0) {
|
|
||||||
qDebug("internal error: shortcut <%s> not found\n", id);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// getAction
|
|
||||||
// returns action for shortcut
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
QAction* getAction(const char* id)
|
|
||||||
{
|
|
||||||
Shortcut* s = Shortcut::getShortcut(id);
|
|
||||||
return s->action();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// aAction
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
QAction* Shortcut::action() const
|
|
||||||
{
|
|
||||||
if (_action)
|
|
||||||
return _action;
|
|
||||||
|
|
||||||
_action = new QAction(_text, 0);
|
|
||||||
_action->setData(_key);
|
|
||||||
|
|
||||||
if (_keys.isEmpty())
|
|
||||||
_action->setShortcuts(_standardKey);
|
|
||||||
else
|
|
||||||
_action->setShortcuts(_keys);
|
|
||||||
|
|
||||||
_action->setShortcutContext(_context);
|
|
||||||
if (_help) {
|
|
||||||
_action->setToolTip(help());
|
|
||||||
_action->setWhatsThis(help());
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
_action->setToolTip(descr());
|
|
||||||
_action->setWhatsThis(descr());
|
|
||||||
}
|
|
||||||
QList<QKeySequence> kl = _action->shortcuts();
|
|
||||||
if (!kl.isEmpty()) {
|
|
||||||
QString s(_action->toolTip());
|
|
||||||
s += " (";
|
|
||||||
for (int i = 0; i < kl.size(); ++i) {
|
|
||||||
if (i)
|
|
||||||
s += ",";
|
|
||||||
s += kl[i].toString(QKeySequence::NativeText);
|
|
||||||
}
|
|
||||||
s += ")";
|
|
||||||
_action->setToolTip(s);
|
|
||||||
}
|
|
||||||
if (_icon != -1)
|
|
||||||
_action->setIcon(*icons[_icon]);
|
|
||||||
return _action;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// addShortcut
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Shortcut::addShortcut(const QKeySequence& ks)
|
|
||||||
{
|
|
||||||
_keys.append(ks);
|
|
||||||
if (_action)
|
|
||||||
_action->setShortcuts(_keys);
|
|
||||||
dirty = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// keysToString
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
QString Shortcut::keysToString()
|
|
||||||
{
|
|
||||||
QAction* a = action();
|
|
||||||
QList<QKeySequence> kl = a->shortcuts();
|
|
||||||
QString s;
|
|
||||||
for (int i = 0; i < kl.size(); ++i) {
|
|
||||||
if (i)
|
|
||||||
s += "; ";
|
|
||||||
s += kl[i].toString(QKeySequence::NativeText);
|
|
||||||
}
|
|
||||||
return s;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// compareKeys
|
|
||||||
// return true if keys are equal
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
bool Shortcut::compareKeys(const Shortcut& sc) const
|
|
||||||
{
|
|
||||||
if (sc._keys.size() != _keys.size())
|
|
||||||
return false;
|
|
||||||
for (int i = 0; i < _keys.size(); ++i) {
|
|
||||||
if (sc._keys[i] != _keys[i])
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// initShortcuts
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Shortcut::init()
|
|
||||||
{
|
|
||||||
//
|
|
||||||
// initialize shortcut hash table
|
|
||||||
//
|
|
||||||
_shortcuts.clear();
|
|
||||||
for (unsigned i = 0;; ++i) {
|
|
||||||
if (sc[i]._key == 0)
|
|
||||||
break;
|
|
||||||
_shortcuts[sc[i]._key] = &sc[i];
|
|
||||||
}
|
|
||||||
load();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// save
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Shortcut::save()
|
|
||||||
{
|
|
||||||
QFile f(dataPath + "/shortcuts.xml");
|
|
||||||
if (!f.open(QIODevice::WriteOnly)) {
|
|
||||||
printf("cannot save shortcuts\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
Xml xml(&f);
|
|
||||||
xml.header();
|
|
||||||
xml.stag("Shortcuts");
|
|
||||||
for (unsigned i = 0;; ++i) {
|
|
||||||
Shortcut* s = &sc[i];
|
|
||||||
if (s->_key == 0)
|
|
||||||
break;
|
|
||||||
s->write(xml);
|
|
||||||
}
|
|
||||||
xml.etag();
|
|
||||||
f.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// write
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Shortcut::write(Xml& xml)
|
|
||||||
{
|
|
||||||
xml.stag("SC");
|
|
||||||
xml.tag("key", _key);
|
|
||||||
if (_standardKey != QKeySequence::UnknownKey)
|
|
||||||
xml.tag("std", QString("%1").arg(_standardKey));
|
|
||||||
foreach(QKeySequence ks, _keys)
|
|
||||||
xml.tag("seq", ks.toString(QKeySequence::PortableText));
|
|
||||||
xml.etag();
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// read
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Shortcut::load()
|
|
||||||
{
|
|
||||||
QFile f(dataPath + "/shortcuts.xml");
|
|
||||||
if (!f.exists()) {
|
|
||||||
f.setFileName(":/data/shortcuts.xml");
|
|
||||||
printf("load <:/data/shortcuts.xml>\n");
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
printf("load <%s>\n", qPrintable(f.fileName()));
|
|
||||||
}
|
|
||||||
if (!f.open(QIODevice::ReadOnly)) {
|
|
||||||
printf("cannot open shortcuts\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QDomDocument doc;
|
|
||||||
int line, column;
|
|
||||||
QString err;
|
|
||||||
if (!doc.setContent(&f, false, &err, &line, &column)) {
|
|
||||||
printf("error reading shortcuts.xml at line %d column %d: %s\n",
|
|
||||||
line, column, qPrintable(err));
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
f.close();
|
|
||||||
|
|
||||||
QString key;
|
|
||||||
for (QDomElement e = doc.documentElement(); !e.isNull(); e = e.nextSiblingElement()) {
|
|
||||||
if (e.tagName() == "Shortcuts") {
|
|
||||||
for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
|
|
||||||
if (ee.tagName() == "SC") {
|
|
||||||
Shortcut* sc = 0;
|
|
||||||
for (QDomElement eee = ee.firstChildElement(); !eee.isNull(); eee = eee.nextSiblingElement()) {
|
|
||||||
const QString& tag(eee.tagName());
|
|
||||||
const QString& val(eee.text());
|
|
||||||
if (tag == "key") {
|
|
||||||
sc = getShortcut(val.toAscii().data());
|
|
||||||
if (!sc) {
|
|
||||||
printf("cannot find shortcut <%s>\n", qPrintable(val));
|
|
||||||
abort();
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
sc->clear();
|
|
||||||
}
|
|
||||||
else if (tag == "std")
|
|
||||||
sc->_standardKey = QKeySequence::StandardKey(val.toInt());
|
|
||||||
else if (tag == "seq")
|
|
||||||
sc->_keys.append(QKeySequence::fromString(val, QKeySequence::PortableText));
|
|
||||||
else
|
|
||||||
domError(eee);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
domError(ee);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
domError(e);
|
|
||||||
}
|
|
||||||
dirty = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// Shortcut1
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
struct Shortcut1 {
|
|
||||||
char* key;
|
|
||||||
QList<QKeySequence> keys;
|
|
||||||
QKeySequence::StandardKey standardKey;
|
|
||||||
|
|
||||||
Shortcut1() { key = 0; standardKey = QKeySequence::UnknownKey; }
|
|
||||||
~Shortcut1() { if (key) free(key); }
|
|
||||||
};
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// read
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
static QList<Shortcut1*> loadDefaultShortcuts()
|
|
||||||
{
|
|
||||||
QList<Shortcut1*> list;
|
|
||||||
QFile f(":/data/shortcuts.xml");
|
|
||||||
if (!f.open(QIODevice::ReadOnly)) {
|
|
||||||
printf("cannot open shortcuts\n");
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
QDomDocument doc;
|
|
||||||
int line, column;
|
|
||||||
QString err;
|
|
||||||
if (!doc.setContent(&f, false, &err, &line, &column)) {
|
|
||||||
printf("error reading shortcuts.xml at line %d column %d: %s\n",
|
|
||||||
line, column, qPrintable(err));
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
f.close();
|
|
||||||
|
|
||||||
QString key;
|
|
||||||
for (QDomElement e = doc.documentElement(); !e.isNull(); e = e.nextSiblingElement()) {
|
|
||||||
if (e.tagName() == "Shortcuts") {
|
|
||||||
for (QDomElement ee = e.firstChildElement(); !ee.isNull(); ee = ee.nextSiblingElement()) {
|
|
||||||
if (ee.tagName() == "SC") {
|
|
||||||
Shortcut1* sc = new Shortcut1;
|
|
||||||
sc->key = 0;
|
|
||||||
for (QDomElement eee = ee.firstChildElement(); !eee.isNull(); eee = eee.nextSiblingElement()) {
|
|
||||||
const QString& tag(eee.tagName());
|
|
||||||
const QString& val(eee.text());
|
|
||||||
if (tag == "key")
|
|
||||||
sc->key = strdup(val.toAscii().data());
|
|
||||||
else if (tag == "std")
|
|
||||||
sc->standardKey = QKeySequence::StandardKey(val.toInt());
|
|
||||||
else if (tag == "seq")
|
|
||||||
sc->keys.append(QKeySequence::fromString(val, QKeySequence::PortableText));
|
|
||||||
else
|
|
||||||
domError(eee);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
domError(ee);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
domError(e);
|
|
||||||
}
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// resetToBuildin
|
|
||||||
// reset all shortcuts to builtin values
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Shortcut::resetToDefault()
|
|
||||||
{
|
|
||||||
QList<Shortcut1*> sl = loadDefaultShortcuts();
|
|
||||||
foreach(Shortcut1* sc, sl) {
|
|
||||||
Shortcut* s = getShortcut(sc->key);
|
|
||||||
if (s) {
|
|
||||||
s->setKeys(sc->keys);
|
|
||||||
s->setStandardKey(sc->standardKey);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
qDeleteAll(sl);
|
|
||||||
dirty = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------
|
|
||||||
// reset
|
|
||||||
//---------------------------------------------------------
|
|
||||||
|
|
||||||
void Shortcut::reset()
|
|
||||||
{
|
|
||||||
_standardKey = QKeySequence::UnknownKey;
|
|
||||||
_keys.clear();
|
|
||||||
QList<Shortcut1*> sl = loadDefaultShortcuts();
|
|
||||||
foreach(Shortcut1* sc, sl) {
|
|
||||||
if (strcmp(sc->key, _key) == 0) {
|
|
||||||
setKeys(sc->keys);
|
|
||||||
setStandardKey(sc->standardKey);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
qDeleteAll(sl);
|
|
||||||
dirty = true;
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
#=============================================================================
|
|
||||||
# Mscore
|
|
||||||
# Linux Music Score Editor
|
|
||||||
# $Id:$
|
|
||||||
#
|
|
||||||
# Copyright (C) 2008 by 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.
|
|
||||||
#
|
|
||||||
# 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, write to the Free Software
|
|
||||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
||||||
#=============================================================================
|
|
||||||
|
|
||||||
install(FILES
|
|
||||||
abc_import.js
|
|
||||||
test.js
|
|
||||||
createscore.js
|
|
||||||
notenames.js
|
|
||||||
colornotes.js
|
|
||||||
fonttest.js
|
|
||||||
removenotes.js
|
|
||||||
removenotes.ui
|
|
||||||
chordchart.js
|
|
||||||
helloqml.js
|
|
||||||
DESTINATION ${Mscore_SHARE_NAME}${Mscore_INSTALL_NAME}plugins
|
|
||||||
)
|
|
||||||
|
|
||||||
subdirs(break)
|
|
|
@ -1,20 +0,0 @@
|
||||||
import QtQuick 1.0
|
|
||||||
import MuseScore 1.0
|
|
||||||
|
|
||||||
|
|
||||||
Item {
|
|
||||||
pluginPath: "Plugins/helloQml"
|
|
||||||
Rectangle {
|
|
||||||
id: simplebutton
|
|
||||||
color: "grey"
|
|
||||||
width: 150
|
|
||||||
height: 75
|
|
||||||
|
|
||||||
Text {
|
|
||||||
id: buttonLabel
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "Hello Qml"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
||||||
<Ped version="1.0">
|
|
||||||
<Status>
|
|
||||||
<geometry x="861" y="0" w="800" h="1000" />
|
|
||||||
<Editor1>
|
|
||||||
<KontextList>
|
|
||||||
<Kontext>
|
|
||||||
<path>/home/ws/mscore/share/plugins/helloqml.qml</path>
|
|
||||||
<column>2</column>
|
|
||||||
<line>1</line>
|
|
||||||
<xoff>0</xoff>
|
|
||||||
<yoff>1</yoff>
|
|
||||||
</Kontext>
|
|
||||||
<cur>1</cur>
|
|
||||||
</KontextList>
|
|
||||||
</Editor1>
|
|
||||||
<search></search>
|
|
||||||
<colorify>0</colorify>
|
|
||||||
<brackets>1</brackets>
|
|
||||||
</Status>
|
|
||||||
</Ped>
|
|
Loading…
Reference in a new issue