Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6748aa99d1 | ||
|
|
541d9d5ad6 | ||
|
|
10f2fab3d2 | ||
|
|
340c47baf0 | ||
|
|
3fdf9a1870 | ||
|
|
1c7efe8696 | ||
|
|
95729de5ee | ||
|
|
a9f1242841 | ||
|
|
1737caf1e0 | ||
|
|
fb25a51b5f | ||
|
|
f62830c1ee | ||
|
|
3e0f9d0216 | ||
|
|
77d6f7586a | ||
|
|
d18cf92277 | ||
|
|
3115642507 | ||
|
|
dcb9f4dfb9 | ||
|
|
46fe11b395 | ||
|
|
55f606bc07 | ||
|
|
aaddeb1a28 | ||
|
|
56c5390888 | ||
|
|
e5dc935ec5 | ||
|
|
3c767040b3 | ||
|
|
7de629794a | ||
|
|
a08905af5b | ||
|
|
b289c7a7a5 | ||
|
|
19829ebb1c | ||
|
|
78f4a3b0fc | ||
|
|
364c837a62 | ||
|
|
69c8580a22 | ||
|
|
07f96d132e | ||
|
|
98371cb148 | ||
|
|
1381709a58 | ||
|
|
6f78e46035 | ||
|
|
062b615bd1 | ||
|
|
92789f843e | ||
|
|
c9aa399e41 | ||
|
|
6f5029d4ba |
4
AUTHORS
4
AUTHORS
@@ -14,6 +14,10 @@ Javier Serrano Polo
|
||||
<jasp00/at/terra/dot/es>
|
||||
development
|
||||
|
||||
Andrew Kelley
|
||||
<superjoe30/at/gmail/dot/com>
|
||||
development
|
||||
|
||||
Andreas Brandmaier
|
||||
<andy/at/brandmaier/dot/de>
|
||||
BitInvader plugin
|
||||
|
||||
@@ -15,7 +15,7 @@ INCLUDE(FindPkgConfig)
|
||||
|
||||
SET(VERSION_MAJOR "0")
|
||||
SET(VERSION_MINOR "4")
|
||||
SET(VERSION_PATCH "0")
|
||||
SET(VERSION_PATCH "2")
|
||||
#SET(VERSION_SUFFIX "")
|
||||
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
|
||||
IF(VERSION_SUFFIX)
|
||||
@@ -54,14 +54,12 @@ IF(LMMS_BUILD_WIN32)
|
||||
SET(WANT_ALSA OFF)
|
||||
SET(WANT_JACK OFF)
|
||||
SET(WANT_PULSEAUDIO OFF)
|
||||
SET(WANT_STK OFF)
|
||||
SET(WANT_SYSTEM_SR OFF)
|
||||
SET(WANT_WINMM ON)
|
||||
SET(LMMS_HAVE_WINMM TRUE)
|
||||
SET(STATUS_ALSA "<not supported on this platform>")
|
||||
SET(STATUS_JACK "<not supported on this platform>")
|
||||
SET(STATUS_PULSEAUDIO "<not supported on this platform>")
|
||||
SET(STATUS_STK "<not supported on this platform>")
|
||||
SET(STATUS_WINMM "OK")
|
||||
ELSE(LMMS_BUILD_WIN32)
|
||||
SET(STATUS_WINMM "<not supported on this platform>")
|
||||
@@ -93,6 +91,7 @@ CHECK_INCLUDE_FILES(process.h LMMS_HAVE_PROCESS_H)
|
||||
CHECK_INCLUDE_FILES(locale.h LMMS_HAVE_LOCALE_H)
|
||||
|
||||
# check for Qt4
|
||||
SET(QT_MIN_VERSION "4.3.0")
|
||||
FIND_PACKAGE(Qt4 REQUIRED)
|
||||
SET(QT_USE_QTXML 1)
|
||||
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_INSTALL_TRANSLATIONS" OUTPUT_VARIABLE QT_TRANSLATIONS_DIR)
|
||||
@@ -624,7 +623,7 @@ SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}")
|
||||
IF(VERSION_SUFFIX)
|
||||
SET(CPACK_PACKAGE_VERSION_PATCH "${VERSION_PATCH}-${VERSION_SUFFIX}")
|
||||
ENDIF(VERSION_SUFFIX)
|
||||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "LMMS-${VERSION}")
|
||||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "LMMS ${VERSION}")
|
||||
IF(WIN32)
|
||||
SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/data\\\\nsis_branding.bmp")
|
||||
SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/data\\\\lmms.ico")
|
||||
|
||||
293
ChangeLog
293
ChangeLog
@@ -1,3 +1,296 @@
|
||||
2008-12-19 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* CMakeLists.txt:
|
||||
* README:
|
||||
made 0.4.2 release
|
||||
|
||||
* plugins/vst_base/vst_plugin.h:
|
||||
* plugins/vst_base/vst_plugin.cpp:
|
||||
* plugins/vst_effect/vst_effect_control_dialog.cpp:
|
||||
* plugins/vst_effect/vst_effect.cpp:
|
||||
* plugins/vestige/vestige.cpp:
|
||||
fixed crash when adding VST effects
|
||||
|
||||
* include/project_version.h:
|
||||
* src/core/project_version.cpp:
|
||||
fixed broken version comparing which indicated 0.x.y to be less than
|
||||
0.x.y-patch - fixes messed up projects when loading files created
|
||||
with LMMS 0.4.0
|
||||
|
||||
2008-12-17 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* CMakeLists.txt:
|
||||
* README:
|
||||
made 0.4.1 release
|
||||
|
||||
* cmake/modules/FindSTK.cmake:
|
||||
* include/combobox_model.h:
|
||||
* include/combobox.h:
|
||||
* src/core/config_mgr.cpp:
|
||||
* data/CMakeLists.txt:
|
||||
* CMakeLists.txt:
|
||||
added STK support to win32 version of LMMS
|
||||
|
||||
* data/locale/ja.ts:
|
||||
* data/locale/ja.qm:
|
||||
added Japanese localization files by
|
||||
Keishi Suenaga <skeishi/at/yahoo/dot/co/dot/jp>
|
||||
|
||||
* include/instrument_track.h:
|
||||
* src/tracks/instrument_track.cpp:
|
||||
backport: do not create a instrument track window just for calling
|
||||
dragEnterEvent() - use a static method instead
|
||||
|
||||
2008-12-17 Paul Giblock <drfaygo/at/gmail/dot/com>
|
||||
|
||||
* include/track.h:
|
||||
* src/core/track.cpp:
|
||||
backport: cache background per-object instead of per-class
|
||||
|
||||
2008-12-17 Andrew Kelley <superjoe30/at/gmail/dot/com>
|
||||
|
||||
* AUTHORS:
|
||||
backport: added Andrew Kelley as author
|
||||
|
||||
* src/core/timeline.cpp:
|
||||
* src/gui/automatable_model_view.cpp:
|
||||
* src/gui/automation_editor.cpp:
|
||||
* src/gui/piano_roll.cpp:
|
||||
* src/gui/widgets/automatable_button.cpp:
|
||||
* src/gui/widgets/automatable_slider.cpp:
|
||||
* src/gui/widgets/combobox.cpp:
|
||||
* src/gui/widgets/fader.cpp:
|
||||
* src/gui/widgets/knob.cpp:
|
||||
* src/gui/widgets/lcd_spinbox.cpp:
|
||||
* src/tracks/sample_track.cpp:
|
||||
backport: changed modifier detection from mainWindow::isCtrlPressed
|
||||
etc to Qt framework detection. Fixes a bunch of little glitches and
|
||||
enables horizontal scroll wheels.
|
||||
|
||||
* include/midi.h:
|
||||
* include/note.h:
|
||||
* include/panning.h:
|
||||
* include/panning_constants.h:
|
||||
* include/pattern.h:
|
||||
* include/piano_roll.h:
|
||||
* src/core/note.cpp:
|
||||
* src/core/piano.cpp:
|
||||
* src/tracks/pattern.cpp:
|
||||
backport: added support for panning editing of notes
|
||||
|
||||
2008-12-14 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* CMakeLists.txt:
|
||||
require at least Qt 4.3.0
|
||||
|
||||
2008-12-11 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* include/automation_pattern.h:
|
||||
* src/core/automation_pattern.cpp:
|
||||
do not disable automation when just editing first point of an
|
||||
automation pattern (closes #2146230)
|
||||
|
||||
* include/automation_pattern_view.h:
|
||||
* src/gui/automation_pattern_view.cpp:
|
||||
splitted view component out of automation_pattern.*
|
||||
|
||||
2008-12-10 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/vst_base/communication.h:
|
||||
* plugins/vst_base/vst_plugin.cpp:
|
||||
* plugins/vst_base/remote_vst_plugin.cpp:
|
||||
rewrote wide parts of LVSL backend:
|
||||
- now supports two threading models which makes LMMS support plugins
|
||||
like Sytrus, z3ta+ etc.
|
||||
- on win32 create native widget as parent for plugin's GUI, fixes
|
||||
warning message when loading KarmaSynth (closes #2276787)
|
||||
- try more symbol names for entry procedure
|
||||
|
||||
* include/aeffectx.h:
|
||||
- made "int"s to "const int"s
|
||||
- added CCONST macro
|
||||
|
||||
* include/remote_plugin.h:
|
||||
* src/core/remote_plugin.cpp:
|
||||
added support for debug messages from remote plugin
|
||||
|
||||
2008-12-08 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/vst_base/vst_plugin.cpp:
|
||||
win32-version: fixed crash when using VST plugins without GUI
|
||||
|
||||
* include/effect_chain.h:
|
||||
export effectChain for properly building FLP import DLL
|
||||
|
||||
* include/song_editor.h:
|
||||
* src/gui/song_editor.cpp:
|
||||
fixed recent commit (m_timeLine was not declared as member yet)
|
||||
|
||||
2008-12-07 Andrew Kelley <superjoe30/at/gmail/dot/com>
|
||||
|
||||
* src/gui/song_editor.cpp:
|
||||
fixed glitch where it would auto-scroll even if it was off in
|
||||
song-editor
|
||||
|
||||
2008-12-04 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/vst_base/remote_vst_plugin.cpp:
|
||||
explicitely declare updateSampleRate() and updateBufferSize() as virtual
|
||||
|
||||
* src/tracks/instrument_track.cpp:
|
||||
decreased step-property of volumeModel and panningModel from 1.0 to 0.1
|
||||
for allowing smoother transitions when automating etc.
|
||||
|
||||
2008-12-02 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* data/locale/ja.ts:
|
||||
* data/locale/ja.qm:
|
||||
added Japanese localization files by
|
||||
Keishi Suenaga <skeishi/at/yahoo/dot/co/dot/jp>
|
||||
|
||||
2008-12-01 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/triple_oscillator/triple_oscillator.cpp:
|
||||
per default play sub-octaves of first oscillator in osc 2 and 3
|
||||
|
||||
2008-11-22 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* src/core/automatable_model.cpp:
|
||||
fixed wrong logic in automatableModel::setValue() which led to bugs when
|
||||
changing linked controls to 0
|
||||
|
||||
* src/gui/file_browser.cpp:
|
||||
do not allow to import unhandled file types, e.g. ZynAddSubFX presets if
|
||||
plugin is not available (closes #2326384)
|
||||
|
||||
2008-11-21 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/flp_import/flp_import.h:
|
||||
* plugins/flp_import/flp_import.cpp:
|
||||
completely rewrote FLP import filter since it didn't work at all
|
||||
anymore - it now doesn't create or change any things in LMMS while
|
||||
importing and instead builds up a complete data structure first
|
||||
which represents the FL Studio project and then creates an LMMS
|
||||
project based upon this data structure
|
||||
- now supports projects from FL Studio 3 to 8
|
||||
- more verbose debug output
|
||||
- import volume, panning, pitch and FX channel for instrument tracks
|
||||
- import amplification, loop-mode and reverse-mode settings for
|
||||
AudioFileProcessor
|
||||
- import FX mixer settings and effects
|
||||
- import automation data
|
||||
- import channel- and pattern names
|
||||
- import volume and panning settings of individual notes
|
||||
- add notes of instrument layer master to each layer children for at
|
||||
least having a complete sound - need to replace with real layering
|
||||
support later
|
||||
- map more instruments to various LMMS instruments
|
||||
- fixed calculations of length and position of notes
|
||||
- fixed importing steps/dots
|
||||
- fixed scaling factor of various controls (arpeggio time,
|
||||
envelope sustain and amount, filter cut/res, TripleOsc volumes etc.)
|
||||
- if three user defined samples were found for TripleOscillator set
|
||||
first oscillator to oscillator::SawWave
|
||||
|
||||
* plugins/flp_import/unrtf.cpp:
|
||||
* plugins/flp_import/CMakeLists.txt:
|
||||
* plugins/flp_import/unrtf/error.h:
|
||||
* plugins/flp_import/unrtf/output.c:
|
||||
* plugins/flp_import/unrtf/html.c:
|
||||
* plugins/flp_import/unrtf/output.h:
|
||||
* plugins/flp_import/unrtf/malloc.c:
|
||||
* plugins/flp_import/unrtf/html.h:
|
||||
* plugins/flp_import/unrtf/attr.c:
|
||||
* plugins/flp_import/unrtf/parse.c:
|
||||
* plugins/flp_import/unrtf/word.c:
|
||||
* plugins/flp_import/unrtf/malloc.h:
|
||||
* plugins/flp_import/unrtf/util.c:
|
||||
* plugins/flp_import/unrtf/attr.h:
|
||||
* plugins/flp_import/unrtf/parse.h:
|
||||
* plugins/flp_import/unrtf/convert.c:
|
||||
* plugins/flp_import/unrtf/word.h:
|
||||
* plugins/flp_import/unrtf/util.h:
|
||||
* plugins/flp_import/unrtf/hash.c:
|
||||
* plugins/flp_import/unrtf/convert.h:
|
||||
* plugins/flp_import/unrtf/defs.h:
|
||||
* plugins/flp_import/unrtf/hash.h:
|
||||
* plugins/flp_import/unrtf/main.h:
|
||||
* plugins/flp_import/unrtf/error.c:
|
||||
updated to latest version of unrtf and improved string operations
|
||||
|
||||
* src/core/main.cpp:
|
||||
added support for importing file from commandline
|
||||
|
||||
* include/effect_chain.h:
|
||||
added method for enabling/disabling FX chain
|
||||
|
||||
* include/file_browser.h:
|
||||
* src/gui/file_browser.cpp:
|
||||
enhanced support for importing various file types directly from browser
|
||||
|
||||
* include/pattern.h:
|
||||
* src/tracks/pattern.cpp:
|
||||
added method for toggling steps
|
||||
|
||||
* include/fx_mixer.h:
|
||||
added method for accessing FX channels
|
||||
|
||||
* plugins/midi_import/midi_import.cpp:
|
||||
check for tempoAutomationPattern being NULL for not crashing when
|
||||
importing to BB-Editor
|
||||
|
||||
* include/instrument_track.h:
|
||||
return pointers instead of references to various internal models
|
||||
|
||||
* include/basic_filters.h:
|
||||
* include/bb_track_container.h:
|
||||
* include/instrument_track.h:
|
||||
* include/pattern.h:
|
||||
* include/track_container.h:
|
||||
* src/core/instrument_functions.cpp:
|
||||
* src/tracks/pattern.cpp:
|
||||
* src/gui/track_container_view.cpp:
|
||||
coding style fixes
|
||||
|
||||
2008-11-11 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* src/core/track.cpp:
|
||||
* src/core/timeline.cpp:
|
||||
* src/core/piano.cpp:
|
||||
* src/core/automation_pattern.cpp:
|
||||
* src/gui/piano_roll.cpp:
|
||||
* src/gui/fx_mixer_view.cpp:
|
||||
* src/gui/widgets/track_label_button.cpp:
|
||||
* src/gui/widgets/visualization_widget.cpp:
|
||||
* src/gui/widgets/combobox.cpp:
|
||||
* src/gui/widgets/tab_widget.cpp:
|
||||
* src/gui/widgets/kmultitabbar.cpp:
|
||||
* src/gui/widgets/envelope_and_lfo_view.cpp:
|
||||
* src/gui/widgets/cpuload_widget.cpp:
|
||||
* src/gui/widgets/fade_button.cpp:
|
||||
* src/gui/widgets/lcd_spinbox.cpp:
|
||||
* src/gui/widgets/group_box.cpp:
|
||||
* src/gui/widgets/fader.cpp:
|
||||
* src/gui/widgets/effect_rack_view.cpp:
|
||||
* src/gui/widgets/effect_view.cpp:
|
||||
* src/gui/automation_editor.cpp:
|
||||
set OpaquePaintEvent attribute for all widgets where suitable - makes
|
||||
whole GUI less sluggish :)
|
||||
|
||||
2008-11-04 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* plugins/sf2_player/sf2_player.cpp:
|
||||
fixed broken reference sharing
|
||||
|
||||
* include/automatable_model.h:
|
||||
* src/core/automatable_model.cpp:
|
||||
fixed loops when adding a controller to a model which is linked to
|
||||
another model
|
||||
|
||||
* src/core/effect.cpp:
|
||||
call saveSettings()/loadSettings() on model rather than loading/saving
|
||||
value directly - fixes lost automation on basic effect controls
|
||||
|
||||
2008-10-30 Tobias Doerffel <tobydox/at/users/dot/sourceforge/dot/net>
|
||||
|
||||
* CMakeLists.txt:
|
||||
|
||||
8
README
8
README
@@ -1,4 +1,4 @@
|
||||
Linux MultiMedia Studio 0.4.0
|
||||
Linux MultiMedia Studio 0.4.2
|
||||
==============================
|
||||
|
||||
Copyright (c) 2004-2008 by LMMS-developers
|
||||
@@ -52,15 +52,15 @@ Required libraries:
|
||||
- Qt >= 4.3.0 with devel-files (4.4.x recommended)
|
||||
|
||||
Optional, but strongly recommended:
|
||||
- JACK with devel-files
|
||||
- libvorbis & libogg with devel-files
|
||||
- libalsa with devel-files
|
||||
- libvorbis & libogg with devel-files
|
||||
- libfluidsynth with devel files
|
||||
- SDL with devel-files
|
||||
- libsamplerate >= 0.1.3 with devel-files
|
||||
- libsndfile with devel-files
|
||||
- WINE + WINE-devel-files
|
||||
- stk, libstk + libstk-dev
|
||||
- libfluidsynth with devel files
|
||||
- JACK with devel-files
|
||||
|
||||
For compiling you should have an up to date GCC with g++.
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FIND_PATH(STK_INCLUDE_DIR Stk.h /usr/include/stk /usr/local/include/stk)
|
||||
FIND_PATH(STK_INCLUDE_DIR Stk.h /usr/include/stk /usr/local/include/stk ${CMAKE_INSTALL_PREFIX}/include/stk)
|
||||
|
||||
FIND_LIBRARY(STK_LIBRARY NAMES stk PATH /usr/lib /usr/local/lib)
|
||||
FIND_LIBRARY(STK_LIBRARY NAMES stk PATH /usr/lib /usr/local/lib ${CMAKE_INSTALL_PREFIX}/lib)
|
||||
|
||||
IF (STK_INCLUDE_DIR AND STK_LIBRARY)
|
||||
SET(STK_FOUND TRUE)
|
||||
|
||||
@@ -11,3 +11,8 @@ INSTALL(FILES lmms.desktop DESTINATION ${DATA_DIR}/applications)
|
||||
INSTALL(FILES lmms.xml DESTINATION ${DATA_DIR}/mime/packages)
|
||||
ENDIF(LMMS_BUILD_LINUX)
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
FILE(GLOB RAWWAVES ${CMAKE_INSTALL_PREFIX}/share/stk/rawwaves/*.raw)
|
||||
INSTALL(FILES ${RAWWAVES} DESTINATION ${DATA_DIR}/stk/rawwaves)
|
||||
ENDIF(LMMS_BUILD_WIN32)
|
||||
|
||||
|
||||
BIN
data/locale/ja.qm
Normal file
BIN
data/locale/ja.qm
Normal file
Binary file not shown.
7093
data/locale/ja.ts
Normal file
7093
data/locale/ja.ts
Normal file
File diff suppressed because it is too large
Load Diff
61
data/presets/TripleOscillator/Supernova.xpf
Normal file
61
data/presets/TripleOscillator/Supernova.xpf
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE multimedia-project>
|
||||
<multimedia-project version="1.0" creator="Linux MultiMedia Studio (LMMS)" creatorversion="0.9.0-20081123" type="instrumenttracksettings" >
|
||||
<head/>
|
||||
<instrumenttracksettings muted="0" type="0" name="Supernova" >
|
||||
<instrumenttrack pan="0" fxch="0" pitch="0" basenote="69" vol="200" >
|
||||
<instrument name="tripleoscillator" >
|
||||
<tripleoscillator phoffset2="0" userwavefile0="" finer0="0" userwavefile1="" finer1="-4" userwavefile2="" finer2="2" coarse0="0" coarse1="0" coarse2="0" finel0="0" finel1="4" modalgo1="0" modalgo2="0" finel2="-2" pan0="0" modalgo3="2" pan1="0" stphdetun0="0" pan2="0" stphdetun1="0" wavetype0="3" stphdetun2="0" wavetype1="5" wavetype2="5" vol0="33" vol1="33" phoffset0="0" phoffset1="0" vol2="33" />
|
||||
</instrument>
|
||||
<eldata fres="0.5" ftype="7" fcut="3221" fwet="1" >
|
||||
<elvol lspd_denominator="4" pdel="0" userwavefile="" dec="0.13" lamt="0" syncmode="0" latt="0" rel="0.15" sus="0.5" amt="1" x100="0" att="0" lpdel="0" hold="0" lshp="0" lspd="0.1" ctlenvamt="0" lspd_numerator="4" />
|
||||
<elcut lspd_denominator="4" pdel="0" userwavefile="" dec="0.25" lamt="0" syncmode="8" latt="0.24" rel="0.1" sus="0.5" amt="0.665" x100="0" att="0" lpdel="0" hold="0" lshp="1" lspd="0.0161" ctlenvamt="0" lspd_numerator="3" />
|
||||
<elres lspd_denominator="4" pdel="0" userwavefile="" dec="0.5" lamt="0" syncmode="3" latt="0" rel="0.1" sus="0.5" amt="0" x100="0" att="0" lpdel="0" hold="0.5" lshp="3" lspd="0.0545" ctlenvamt="0" lspd_numerator="4" />
|
||||
</eldata>
|
||||
<chordcreator chord="0" chordrange="4" chord-enabled="1" />
|
||||
<arpeggiator arptime="273" arprange="3" arptime_denominator="4" syncmode="5" arpmode="0" arp-enabled="0" arp="0" arptime_numerator="4" arpdir="1" arpgate="100" />
|
||||
<midiport inputcontroller="0" inports="24:0 USB Oxygen 49:USB Oxygen 49 MIDI 1" fixedoutputvelocity="-1" inputchannel="0" outputcontroller="0" writable="0" outputchannel="1" fixedinputvelocity="-1" outputprogram="1" readable="1" />
|
||||
<fxchain numofeffects="6" enabled="1" >
|
||||
<effect autoquit_numerator="1" autoquit_denominator="1" syncmode="0" autoquit="0" gate="0" name="stereomatrix" wet="0.38" on="1" >
|
||||
<stereomatrixcontrols l-l="-0.5" l-r="-0.5" r-l="-0.5" r-r="-0.5" />
|
||||
<key/>
|
||||
</effect>
|
||||
<effect autoquit_numerator="1" autoquit_denominator="1" syncmode="0" autoquit="0" gate="0" name="ladspaeffect" wet="1" on="1" >
|
||||
<ladspacontrols port11="0.15" port01="0.16" port12="1" port02="1" port13="1.5708" port03="1.5708" port14="0" port04="0" port04link="1" port02link="1" port03link="1" link="0" ports="8" port01link="0" />
|
||||
<key>
|
||||
<attribute value="caps" name="file" />
|
||||
<attribute value="PhaserII" name="plugin" />
|
||||
</key>
|
||||
</effect>
|
||||
<effect autoquit_numerator="1" autoquit_denominator="1" syncmode="0" autoquit="0" gate="0" name="ladspaeffect" wet="0.75" on="1" >
|
||||
<ladspacontrols port11="0" port01="0" port12="0.5" port02="0.5" port13="0.5" port03="0.5" port14="0.5" port04="0.5" port04link="1" port02link="1" port03link="1" link="1" ports="8" port01link="1" />
|
||||
<key>
|
||||
<attribute value="caps" name="file" />
|
||||
<attribute value="ToneStack" name="plugin" />
|
||||
</key>
|
||||
</effect>
|
||||
<effect autoquit_numerator="1" autoquit_denominator="1" syncmode="0" autoquit="0" gate="0" name="ladspaeffect" wet="1" on="0" >
|
||||
<ladspacontrols link="1" ports="0" />
|
||||
<key>
|
||||
<attribute value="dc_remove_1207" name="file" />
|
||||
<attribute value="dcRemove" name="plugin" />
|
||||
</key>
|
||||
</effect>
|
||||
<effect autoquit_numerator="4" autoquit_denominator="4" syncmode="0" autoquit="8000" gate="0" name="ladspaeffect" wet="0.25" on="1" >
|
||||
<ladspacontrols port00="365" port01="50" port02="245" port03="50" port04="0" port05="0" port06="-70" port07="1" port08="0" port09="1" ports="10" />
|
||||
<key>
|
||||
<attribute value="tap_echo" name="file" />
|
||||
<attribute value="tap_stereo_echo" name="plugin" />
|
||||
</key>
|
||||
</effect>
|
||||
<effect autoquit_numerator="4" autoquit_denominator="4" syncmode="0" autoquit="1" gate="0" name="ladspaeffect" wet="1" on="1" >
|
||||
<ladspacontrols port00="1.5" ports="1" />
|
||||
<key>
|
||||
<attribute value="cmt" name="file" />
|
||||
<attribute value="amp_stereo" name="plugin" />
|
||||
</key>
|
||||
</effect>
|
||||
</fxchain>
|
||||
</instrumenttrack>
|
||||
</instrumenttracksettings>
|
||||
</multimedia-project>
|
||||
@@ -26,6 +26,10 @@
|
||||
#ifndef _AEFFECTX_H
|
||||
#define _AEFFECTX_H
|
||||
|
||||
#define CCONST(a, b, c, d)( ( ( (int) a ) << 24 ) | \
|
||||
( ( (int) b ) << 16 ) | \
|
||||
( ( (int) c ) << 8 ) | \
|
||||
( ( (int) d ) << 0 ) )
|
||||
|
||||
const int audioMasterAutomate = 0;
|
||||
const int audioMasterVersion = 1;
|
||||
@@ -79,44 +83,39 @@ const int audioMasterEditFile = 47; // currently unused
|
||||
const int audioMasterGetChunkFile = 48; // currently unused
|
||||
const int audioMasterGetInputSpeakerArrangement = 49; // currently unused
|
||||
|
||||
int effFlagsHasEditor = 1;
|
||||
int effFlagsCanReplacing = 1 << 4; // very likely
|
||||
int effFlagsIsSynth = 1 << 8; // currently unused
|
||||
const int effFlagsHasEditor = 1;
|
||||
const int effFlagsCanReplacing = 1 << 4; // very likely
|
||||
const int effFlagsIsSynth = 1 << 8; // currently unused
|
||||
|
||||
int effOpen = 0;
|
||||
int effClose = 1; // currently unused
|
||||
int effSetProgram = 2; // currently unused
|
||||
int effGetProgram = 3; // currently unused
|
||||
int effGetProgramName = 5; // currently unused
|
||||
int effGetParamName = 8; // currently unused
|
||||
int effSetSampleRate = 10;
|
||||
int effSetBlockSize = 11;
|
||||
int effMainsChanged = 12;
|
||||
int effEditGetRect = 13;
|
||||
int effEditOpen = 14;
|
||||
int effEditClose = 15;
|
||||
int effEditIdle = 19;
|
||||
int effEditTop = 20;
|
||||
int effProcessEvents = 25;
|
||||
int effGetEffectName = 45;
|
||||
int effGetParameterProperties = 47; // missing
|
||||
int effGetVendorString = 47;
|
||||
int effGetProductString = 48;
|
||||
int effGetVendorVersion = 49;
|
||||
int effCanDo = 51; // currently unused
|
||||
int effGetVstVersion = 58; // currently unused
|
||||
const int effOpen = 0;
|
||||
const int effClose = 1; // currently unused
|
||||
const int effSetProgram = 2; // currently unused
|
||||
const int effGetProgram = 3; // currently unused
|
||||
const int effGetProgramName = 5; // currently unused
|
||||
const int effGetParamName = 8; // currently unused
|
||||
const int effSetSampleRate = 10;
|
||||
const int effSetBlockSize = 11;
|
||||
const int effMainsChanged = 12;
|
||||
const int effEditGetRect = 13;
|
||||
const int effEditOpen = 14;
|
||||
const int effEditClose = 15;
|
||||
const int effEditIdle = 19;
|
||||
const int effEditTop = 20;
|
||||
const int effProcessEvents = 25;
|
||||
const int effGetEffectName = 45;
|
||||
const int effGetParameterProperties = 47; // missing
|
||||
const int effGetVendorString = 47;
|
||||
const int effGetProductString = 48;
|
||||
const int effGetVendorVersion = 49;
|
||||
const int effCanDo = 51; // currently unused
|
||||
const int effGetVstVersion = 58; // currently unused
|
||||
|
||||
int kEffectMagic =
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
0x50747356; // "VstP"
|
||||
#else
|
||||
0x56737450; // "PtsV"
|
||||
#endif
|
||||
int kVstLangEnglish = 1;
|
||||
int kVstMidiType = 1;
|
||||
int kVstParameterUsesFloatStep = 1 << 2;
|
||||
int kVstTempoValid = 1 << 10;
|
||||
int kVstTransportPlaying = 1 << 1;
|
||||
const int kEffectMagic = CCONST( 'V', 's', 't', 'P' );
|
||||
const int kVstLangEnglish = 1;
|
||||
const int kVstMidiType = 1;
|
||||
const int kVstParameterUsesFloatStep = 1 << 2;
|
||||
const int kVstTempoValid = 1 << 10;
|
||||
const int kVstTransportPlaying = 1 << 1;
|
||||
|
||||
|
||||
class remoteVstPlugin;
|
||||
@@ -232,7 +231,7 @@ public:
|
||||
// Zeroes 44-47
|
||||
char empty5[4];
|
||||
// Id 48-4b
|
||||
char unused_id[4];
|
||||
int32_t uniqueID;
|
||||
// Don't know 4c-4f
|
||||
char unknown1[4];
|
||||
// processReplacing 50-53
|
||||
|
||||
@@ -119,7 +119,8 @@ public:
|
||||
template<class T>
|
||||
inline T value( int _frameOffset = 0 ) const
|
||||
{
|
||||
if( unlikely( m_controllerConnection != NULL ) )
|
||||
if( unlikely( m_hasLinkedModels ||
|
||||
m_controllerConnection != NULL ) )
|
||||
{
|
||||
return castValue<T>( controllerValue( _frameOffset ) );
|
||||
}
|
||||
@@ -243,8 +244,10 @@ private:
|
||||
// standard)
|
||||
float m_oldValue;
|
||||
bool m_journalEntryReady;
|
||||
int m_setValueDepth;
|
||||
|
||||
autoModelVector m_linkedModels;
|
||||
bool m_hasLinkedModels;
|
||||
|
||||
|
||||
controllerConnection * m_controllerConnection;
|
||||
|
||||
@@ -123,44 +123,4 @@ private:
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
class automationPatternView : public trackContentObjectView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
automationPatternView( automationPattern * _pat, trackView * _parent );
|
||||
virtual ~automationPatternView();
|
||||
|
||||
|
||||
public slots:
|
||||
virtual void update( void );
|
||||
|
||||
|
||||
protected slots:
|
||||
void resetName( void );
|
||||
void changeName( void );
|
||||
void disconnectObject( QAction * _a );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void constructContextMenu( QMenu * );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re )
|
||||
{
|
||||
m_needsUpdate = true;
|
||||
trackContentObjectView::resizeEvent( _re );
|
||||
}
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
|
||||
|
||||
private:
|
||||
automationPattern * m_pat;
|
||||
QPixmap m_paintPixmap;
|
||||
bool m_needsUpdate;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
73
include/automation_pattern_view.h
Normal file
73
include/automation_pattern_view.h
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* automation_pattern_view.h - declaration of class automationPatternView
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _AUTOMATION_PATTERN_VIEW_H
|
||||
#define _AUTOMATION_PATTERN_VIEW_H
|
||||
|
||||
#include "track.h"
|
||||
|
||||
class automationPattern;
|
||||
|
||||
|
||||
class automationPatternView : public trackContentObjectView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
automationPatternView( automationPattern * _pat, trackView * _parent );
|
||||
virtual ~automationPatternView();
|
||||
|
||||
|
||||
public slots:
|
||||
virtual void update( void );
|
||||
|
||||
|
||||
protected slots:
|
||||
void resetName( void );
|
||||
void changeName( void );
|
||||
void disconnectObject( QAction * _a );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void constructContextMenu( QMenu * );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re )
|
||||
{
|
||||
m_needsUpdate = true;
|
||||
trackContentObjectView::resizeEvent( _re );
|
||||
}
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
|
||||
|
||||
private:
|
||||
automationPattern * m_pat;
|
||||
QPixmap m_paintPixmap;
|
||||
bool m_needsUpdate;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
@@ -45,7 +45,7 @@ template<ch_cnt_t CHANNELS/* = DEFAULT_CHANNELS*/>
|
||||
class basicFilters
|
||||
{
|
||||
public:
|
||||
enum filterTypes
|
||||
enum FilterTypes
|
||||
{
|
||||
LowPass,
|
||||
HiPass,
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
Notch,
|
||||
AllPass,
|
||||
Moog,
|
||||
NumOfFilters
|
||||
NumFilters
|
||||
} ;
|
||||
|
||||
static inline float minFreq( void )
|
||||
@@ -69,14 +69,14 @@ public:
|
||||
|
||||
inline void setFilterType( const int _idx )
|
||||
{
|
||||
m_doubleFilter = _idx >= NumOfFilters;
|
||||
m_doubleFilter = _idx >= NumFilters;
|
||||
if( !m_doubleFilter )
|
||||
{
|
||||
m_type = static_cast<filterTypes>( _idx );
|
||||
m_type = static_cast<FilterTypes>( _idx );
|
||||
return;
|
||||
}
|
||||
m_type = static_cast<filterTypes>( LowPass + _idx -
|
||||
NumOfFilters );
|
||||
m_type = static_cast<FilterTypes>( LowPass + _idx -
|
||||
NumFilters );
|
||||
if( m_subFilter == NULL )
|
||||
{
|
||||
m_subFilter = new basicFilters<CHANNELS>(
|
||||
@@ -289,7 +289,7 @@ private:
|
||||
// in/out history for moog-filter
|
||||
frame m_y1, m_y2, m_y3, m_y4, m_oldx, m_oldy1, m_oldy2, m_oldy3;
|
||||
|
||||
filterTypes m_type;
|
||||
FilterTypes m_type;
|
||||
bool m_doubleFilter;
|
||||
|
||||
float m_sampleRate;
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
tact lengthOfBB( int _bb );
|
||||
inline tact lengthOfCurrentBB( void )
|
||||
{
|
||||
return( lengthOfBB( currentBB() ) );
|
||||
return lengthOfBB( currentBB() );
|
||||
}
|
||||
int numOfBBs( void ) const;
|
||||
void removeBB( int _bb );
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
|
||||
|
||||
class comboBox : public QWidget, public intModelView
|
||||
class EXPORT comboBox : public QWidget, public intModelView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
class pixmapLoader;
|
||||
|
||||
|
||||
class comboBoxModel : public intModel
|
||||
class EXPORT comboBoxModel : public intModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
class effect;
|
||||
|
||||
|
||||
class effectChain : public model, public serializingObject
|
||||
class EXPORT effectChain : public model, public serializingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "fxchain" );
|
||||
return "fxchain";
|
||||
}
|
||||
|
||||
void appendEffect( effect * _effect );
|
||||
@@ -59,6 +59,11 @@ public:
|
||||
|
||||
void clear( void );
|
||||
|
||||
void setEnabled( bool _on )
|
||||
{
|
||||
m_enabledModel.setValue( _on );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
typedef QVector<effect *> effectList;
|
||||
|
||||
@@ -187,7 +187,8 @@ public:
|
||||
NotSupported,
|
||||
LoadAsProject,
|
||||
LoadAsPreset,
|
||||
LoadByPlugin
|
||||
LoadByPlugin,
|
||||
ImportAsProject
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +75,16 @@ public:
|
||||
|
||||
virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "fxmixer" );
|
||||
return "fxmixer";
|
||||
}
|
||||
|
||||
fxChannel * getEffectChannel( int _ch )
|
||||
{
|
||||
if( _ch >= 0 && _ch <= NumFxChannels )
|
||||
{
|
||||
return m_fxChannels[_ch];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -88,12 +88,12 @@ public:
|
||||
QString instrumentName( void ) const;
|
||||
inline const instrument * getInstrument( void ) const
|
||||
{
|
||||
return( m_instrument );
|
||||
return m_instrument;
|
||||
}
|
||||
|
||||
inline instrument * getInstrument( void )
|
||||
{
|
||||
return( m_instrument );
|
||||
return m_instrument;
|
||||
}
|
||||
|
||||
void deleteNotePluginData( notePlayHandle * _n );
|
||||
@@ -108,7 +108,7 @@ public:
|
||||
// translate pitch to midi-pitch [0,16383]
|
||||
inline int midiPitch( void ) const
|
||||
{
|
||||
return( (int)( ( m_pitchModel.value()+100 ) * 81.92 ) );
|
||||
return (int)( ( m_pitchModel.value()+100 ) * 81.92 );
|
||||
}
|
||||
|
||||
// play everything in given frame-range - creates note-play-handles
|
||||
@@ -135,47 +135,53 @@ public:
|
||||
|
||||
inline audioPort * getAudioPort( void )
|
||||
{
|
||||
return( &m_audioPort );
|
||||
return &m_audioPort;
|
||||
}
|
||||
|
||||
inline midiPort * getMidiPort( void )
|
||||
{
|
||||
return( &m_midiPort );
|
||||
return &m_midiPort;
|
||||
}
|
||||
|
||||
intModel * baseNoteModel( void )
|
||||
{
|
||||
return( &m_baseNoteModel );
|
||||
return &m_baseNoteModel;
|
||||
}
|
||||
|
||||
piano * getPiano( void )
|
||||
{
|
||||
return( &m_piano );
|
||||
return &m_piano;
|
||||
}
|
||||
|
||||
bool arpeggiatorEnabled( void ) const
|
||||
{
|
||||
return( m_arpeggiator.m_arpEnabledModel.value() );
|
||||
return m_arpeggiator.m_arpEnabledModel.value();
|
||||
}
|
||||
|
||||
// simple helper for removing midiport-XML-node when loading presets
|
||||
static void removeMidiPortNode( multimediaProject & _mmp );
|
||||
|
||||
floatModel & pitchModel()
|
||||
floatModel * pitchModel( void )
|
||||
{
|
||||
return m_pitchModel;
|
||||
return &m_pitchModel;
|
||||
}
|
||||
|
||||
floatModel & volumeModel()
|
||||
floatModel * volumeModel( void )
|
||||
{
|
||||
return m_volumeModel;
|
||||
return &m_volumeModel;
|
||||
}
|
||||
|
||||
floatModel & panningModel()
|
||||
floatModel * panningModel( void )
|
||||
{
|
||||
return m_panningModel;
|
||||
return &m_panningModel;
|
||||
}
|
||||
|
||||
intModel * effectChannelModel( void )
|
||||
{
|
||||
return &m_effectChannelModel;
|
||||
}
|
||||
|
||||
|
||||
signals:
|
||||
void instrumentChanged( void );
|
||||
void newNote( void );
|
||||
@@ -186,7 +192,7 @@ signals:
|
||||
protected:
|
||||
virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "instrumenttrack" );
|
||||
return "instrumenttrack";
|
||||
}
|
||||
// invalidates all note-play-handles linked to this instrument
|
||||
void invalidateAllMyNPH( void );
|
||||
@@ -245,18 +251,18 @@ public:
|
||||
|
||||
instrumentTrack * model( void )
|
||||
{
|
||||
return( castModel<instrumentTrack>() );
|
||||
return castModel<instrumentTrack>();
|
||||
}
|
||||
|
||||
const instrumentTrack * model( void ) const
|
||||
{
|
||||
return( castModel<instrumentTrack>() );
|
||||
return castModel<instrumentTrack>();
|
||||
}
|
||||
|
||||
|
||||
QMenu * midiMenu( void )
|
||||
{
|
||||
return( m_midiMenu );
|
||||
return m_midiMenu;
|
||||
}
|
||||
|
||||
void freeInstrumentTrackWindow( void );
|
||||
@@ -314,17 +320,17 @@ public:
|
||||
// parent for all internal tab-widgets
|
||||
tabWidget * tabWidgetParent( void )
|
||||
{
|
||||
return( m_tabWidget );
|
||||
return m_tabWidget;
|
||||
}
|
||||
|
||||
instrumentTrack * model( void )
|
||||
{
|
||||
return( castModel<instrumentTrack>() );
|
||||
return castModel<instrumentTrack>();
|
||||
}
|
||||
|
||||
const instrumentTrack * model( void ) const
|
||||
{
|
||||
return( castModel<instrumentTrack>() );
|
||||
return castModel<instrumentTrack>();
|
||||
}
|
||||
|
||||
void setInstrumentTrackView( instrumentTrackView * _tv )
|
||||
@@ -332,6 +338,8 @@ public:
|
||||
m_itv = _tv;
|
||||
}
|
||||
|
||||
static void dragEnterEventGeneric( QDragEnterEvent * _dee );
|
||||
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
#ifndef _MIDI_H
|
||||
#define _MIDI_H
|
||||
|
||||
|
||||
#include "lmms_basics.h"
|
||||
#include "panning_constants.h"
|
||||
#include <cstdlib>
|
||||
|
||||
|
||||
@@ -63,6 +63,7 @@ enum MidiEventTypes
|
||||
|
||||
enum MidiMetaEvents
|
||||
{
|
||||
MidiMetaInvalid = 0x00,
|
||||
MidiCopyright = 0x02,
|
||||
MidiTrackName = 0x03,
|
||||
MidiInstName = 0x04,
|
||||
@@ -75,7 +76,9 @@ enum MidiMetaEvents
|
||||
MidiSMPTEOffset = 0x54,
|
||||
MidiTimeSignature = 0x58,
|
||||
MidiKeySignature = 0x59,
|
||||
MidiSequencerEvent = 0x7f
|
||||
MidiSequencerEvent = 0x7f,
|
||||
MidiMetaCustom = 0x80,
|
||||
MidiNotePanning
|
||||
} ;
|
||||
|
||||
|
||||
@@ -84,6 +87,9 @@ const int MidiControllerCount = 128;
|
||||
const int MidiProgramCount = 128;
|
||||
const int MidiMaxVelocity = 127;
|
||||
|
||||
const int MidiMaxPanning = 127;
|
||||
const int MidiMinPanning = -128;
|
||||
|
||||
|
||||
struct midiEvent
|
||||
{
|
||||
@@ -92,6 +98,7 @@ struct midiEvent
|
||||
Sint16 _param1 = 0,
|
||||
Sint16 _param2 = 0 ) :
|
||||
m_type( _type ),
|
||||
m_metaEvent( MidiMetaInvalid ),
|
||||
m_channel( _channel ),
|
||||
m_sysExData( NULL )
|
||||
{
|
||||
@@ -101,6 +108,7 @@ struct midiEvent
|
||||
midiEvent( MidiEventTypes _type, const char * _sysex_data,
|
||||
int _data_len ) :
|
||||
m_type( _type ),
|
||||
m_metaEvent( MidiMetaInvalid ),
|
||||
m_channel( 0 ),
|
||||
m_sysExData( _sysex_data )
|
||||
{
|
||||
@@ -109,6 +117,7 @@ struct midiEvent
|
||||
|
||||
midiEvent( const midiEvent & _copy ) :
|
||||
m_type( _copy.m_type ),
|
||||
m_metaEvent( _copy.m_metaEvent ),
|
||||
m_channel( _copy.m_channel ),
|
||||
m_data( _copy.m_data ),
|
||||
m_sysExData( _copy.m_sysExData )
|
||||
@@ -139,14 +148,28 @@ struct midiEvent
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline Sint16 midiPanning( void ) const
|
||||
{
|
||||
return m_data.m_param[1];
|
||||
}
|
||||
|
||||
inline volume getVolume( void ) const
|
||||
{
|
||||
return (volume)( velocity() * 100 / MidiMaxVelocity );
|
||||
}
|
||||
|
||||
inline panning getPanning( void ) const
|
||||
{
|
||||
return (panning) ( PanningLeft +
|
||||
( (float)( midiPanning() - MidiMinPanning ) ) /
|
||||
( (float)( MidiMaxPanning - MidiMinPanning ) ) *
|
||||
( (float)( PanningRight - PanningLeft ) ) );
|
||||
}
|
||||
|
||||
|
||||
MidiEventTypes m_type; // MIDI event type
|
||||
MidiMetaEvents m_metaEvent; // Meta event (mostly unused)
|
||||
Sint8 m_channel; // MIDI channel
|
||||
union
|
||||
{
|
||||
|
||||
@@ -90,7 +90,21 @@ public:
|
||||
detuningHelper * _detuning = NULL );
|
||||
note( const note & _note );
|
||||
virtual ~note();
|
||||
|
||||
|
||||
// used by GUI
|
||||
inline void setSelected( const bool _selected ){ m_selected = _selected; }
|
||||
inline void setOldKey( const int _oldKey ){ m_oldKey = _oldKey; }
|
||||
inline void setOldPos( const midiTime & _oldPos ){ m_oldPos = _oldPos; }
|
||||
inline void setOldLength( const midiTime & _oldLength )
|
||||
{
|
||||
m_oldLength = _oldLength;
|
||||
}
|
||||
inline void setIsPlaying( const bool _isPlaying )
|
||||
{
|
||||
m_isPlaying = _isPlaying;
|
||||
}
|
||||
|
||||
|
||||
void setLength( const midiTime & _length );
|
||||
void setPos( const midiTime & _pos );
|
||||
void setKey( const int _key );
|
||||
@@ -99,6 +113,38 @@ public:
|
||||
void quantizeLength( const int _q_grid );
|
||||
void quantizePos( const int _q_grid );
|
||||
|
||||
static inline bool lessThan(note * &lhs, note * &rhs)
|
||||
{
|
||||
// function to compare two notes - must be called explictly when
|
||||
// using qSort
|
||||
return (bool) ((int) ( *lhs ).pos() < (int) ( *rhs ).pos());
|
||||
}
|
||||
|
||||
inline bool selected( void ) const
|
||||
{
|
||||
return m_selected;
|
||||
}
|
||||
|
||||
inline int oldKey( void ) const
|
||||
{
|
||||
return m_oldKey;
|
||||
}
|
||||
|
||||
inline midiTime oldPos( void ) const
|
||||
{
|
||||
return m_oldPos;
|
||||
}
|
||||
|
||||
inline midiTime oldLength( void ) const
|
||||
{
|
||||
return m_oldLength;
|
||||
}
|
||||
|
||||
inline bool isPlaying( void ) const
|
||||
{
|
||||
return m_isPlaying;
|
||||
}
|
||||
|
||||
inline midiTime endPos( void ) const
|
||||
{
|
||||
const int l = length();
|
||||
@@ -177,7 +223,14 @@ private:
|
||||
ChangePosition
|
||||
} ;*/
|
||||
|
||||
|
||||
|
||||
// for piano roll editing
|
||||
bool m_selected;
|
||||
int m_oldKey;
|
||||
midiTime m_oldPos;
|
||||
midiTime m_oldLength;
|
||||
bool m_isPlaying;
|
||||
|
||||
int m_key;
|
||||
volume m_volume;
|
||||
panning m_panning;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* panning.h - declaration of some constants and types, concerning the
|
||||
* panning.h - declaration of some types, concerning the
|
||||
* panning of a note
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
@@ -29,11 +29,8 @@
|
||||
#include "lmms_basics.h"
|
||||
#include "volume.h"
|
||||
#include "templates.h"
|
||||
|
||||
const panning PanningRight = ( 0 + 100 );
|
||||
const panning PanningLeft = - PanningRight;
|
||||
const panning PanningCenter = 0;
|
||||
const panning DefaultPanning = PanningCenter;
|
||||
#include "panning_constants.h"
|
||||
#include "midi.h"
|
||||
|
||||
inline stereoVolumeVector panningToVolumeVector( panning _p,
|
||||
float _scale = 1.0f )
|
||||
@@ -44,4 +41,12 @@ inline stereoVolumeVector panningToVolumeVector( panning _p,
|
||||
return v;
|
||||
}
|
||||
|
||||
inline Sint16 panningToMidi( panning _p )
|
||||
{
|
||||
return MidiMinPanning +
|
||||
( (float)( _p - PanningLeft ) ) /
|
||||
( (float)( PanningRight - PanningLeft ) ) *
|
||||
( (float)( MidiMaxPanning - MidiMinPanning ) );
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
34
include/panning_constants.h
Normal file
34
include/panning_constants.h
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* panning_constants.h - declaration of some constants, concerning the
|
||||
* panning of a note
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _PANNING_CONSTANTS_H
|
||||
#define _PANNING_CONSTANTS_H
|
||||
|
||||
const panning PanningRight = ( 0 + 100 );
|
||||
const panning PanningLeft = - PanningRight;
|
||||
const panning PanningCenter = 0;
|
||||
const panning DefaultPanning = PanningCenter;
|
||||
|
||||
#endif
|
||||
@@ -68,24 +68,27 @@ public:
|
||||
virtual midiTime length( void ) const;
|
||||
midiTime beatPatternLength( void ) const;
|
||||
|
||||
note * addNote( const note & _new_note, const bool _quant_pos = TRUE );
|
||||
// note management
|
||||
note * addNote( const note & _new_note, const bool _quant_pos = true );
|
||||
|
||||
void removeNote( const note * _note_to_del );
|
||||
|
||||
note * rearrangeNote( const note * _note_to_proc,
|
||||
const bool _quant_pos = TRUE );
|
||||
|
||||
const bool _quant_pos = true );
|
||||
void rearrangeAllNotes( void );
|
||||
void clearNotes( void );
|
||||
|
||||
inline const noteVector & notes( void )
|
||||
{
|
||||
return( m_notes );
|
||||
return m_notes;
|
||||
}
|
||||
|
||||
void setStep( int _step, bool _enabled );
|
||||
|
||||
// pattern-type stuff
|
||||
inline PatternTypes type( void ) const
|
||||
{
|
||||
return( m_patternType );
|
||||
return m_patternType;
|
||||
}
|
||||
void setType( PatternTypes _new_pattern_type );
|
||||
void checkType( void );
|
||||
@@ -94,17 +97,17 @@ public:
|
||||
// functions which are part of freezing-feature
|
||||
inline bool freezing( void ) const
|
||||
{
|
||||
return( m_freezing );
|
||||
return m_freezing;
|
||||
}
|
||||
|
||||
inline bool frozen( void ) const
|
||||
{
|
||||
return( m_frozenPattern != NULL );
|
||||
return m_frozenPattern != NULL;
|
||||
}
|
||||
|
||||
sampleBuffer * getFrozenPattern( void )
|
||||
{
|
||||
return( m_frozenPattern );
|
||||
return m_frozenPattern;
|
||||
}
|
||||
|
||||
// settings-management
|
||||
@@ -112,12 +115,12 @@ public:
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "pattern" );
|
||||
return "pattern";
|
||||
}
|
||||
|
||||
inline instrumentTrack * getInstrumentTrack( void )
|
||||
{
|
||||
return( m_instrumentTrack );
|
||||
return m_instrumentTrack;
|
||||
}
|
||||
|
||||
bool empty( void );
|
||||
@@ -130,6 +133,10 @@ public:
|
||||
|
||||
|
||||
using model::dataChanged;
|
||||
|
||||
|
||||
void printNotes( void ); // for debugging purposes
|
||||
|
||||
|
||||
|
||||
protected:
|
||||
@@ -197,7 +204,7 @@ protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re )
|
||||
{
|
||||
m_needsUpdate = TRUE;
|
||||
m_needsUpdate = true;
|
||||
trackContentObjectView::resizeEvent( _re );
|
||||
}
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* can set and edit notes in an easy way
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008 Andrew Kelley <superjoe30/at/gmail/dot/com>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -38,6 +39,9 @@
|
||||
class QPainter;
|
||||
class QPixmap;
|
||||
class QScrollBar;
|
||||
class QString;
|
||||
class QMenu;
|
||||
class QSignalMapper;
|
||||
|
||||
class comboBox;
|
||||
class notePlayHandle;
|
||||
@@ -54,17 +58,17 @@ public:
|
||||
|
||||
inline bool isRecording( void ) const
|
||||
{
|
||||
return( m_recording );
|
||||
return m_recording;
|
||||
}
|
||||
|
||||
inline const pattern * currentPattern( void ) const
|
||||
{
|
||||
return( m_pattern );
|
||||
return m_pattern;
|
||||
}
|
||||
|
||||
inline bool validPattern( void ) const
|
||||
{
|
||||
return( m_pattern != NULL );
|
||||
return m_pattern != NULL;
|
||||
}
|
||||
|
||||
int quantization( void ) const;
|
||||
@@ -75,7 +79,7 @@ public:
|
||||
|
||||
inline virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "pianoroll" );
|
||||
return "pianoroll";
|
||||
}
|
||||
|
||||
|
||||
@@ -85,20 +89,16 @@ protected:
|
||||
virtual void keyReleaseEvent( QKeyEvent * _ke );
|
||||
virtual void leaveEvent( QEvent * _e );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
#ifdef LMMS_BUILD_LINUX
|
||||
virtual bool x11Event( XEvent * _xe );
|
||||
#endif
|
||||
|
||||
int getKey( int _y ) const;
|
||||
static inline void drawNoteRect( QPainter & _p, int _x, int _y,
|
||||
int _width,
|
||||
const bool _is_selected,
|
||||
const bool _is_step_note );
|
||||
int _width, note * _n );
|
||||
void removeSelection( void );
|
||||
void selectAll( void );
|
||||
void getSelectedNotes( noteVector & _selected_notes );
|
||||
@@ -118,7 +118,7 @@ protected slots:
|
||||
void drawButtonToggled( void );
|
||||
void eraseButtonToggled( void );
|
||||
void selectButtonToggled( void );
|
||||
void moveButtonToggled( void );
|
||||
void detuneButtonToggled( void );
|
||||
|
||||
void copySelectedNotes( void );
|
||||
void cutSelectedNotes( void );
|
||||
@@ -129,6 +129,8 @@ protected slots:
|
||||
|
||||
void zoomingChanged( void );
|
||||
void quantizeChanged( void );
|
||||
|
||||
void changeNoteEditMode( int i );
|
||||
|
||||
|
||||
private:
|
||||
@@ -138,9 +140,8 @@ private:
|
||||
ModeDraw,
|
||||
ModeErase,
|
||||
ModeSelect,
|
||||
ModeMove,
|
||||
ModeOpen
|
||||
} ;
|
||||
};
|
||||
|
||||
enum actions
|
||||
{
|
||||
@@ -148,26 +149,54 @@ private:
|
||||
ActionMoveNote,
|
||||
ActionResizeNote,
|
||||
ActionSelectNotes,
|
||||
ActionMoveSelection,
|
||||
ActionChangeNoteVolume,
|
||||
ActionChangeNotePanning
|
||||
} ;
|
||||
ActionChangeNoteProperty,
|
||||
ActionResizeNoteEditArea
|
||||
};
|
||||
|
||||
enum noteEditMode
|
||||
{
|
||||
NoteEditVolume,
|
||||
NoteEditPanning,
|
||||
NoteEditCount // make sure this one is always last
|
||||
};
|
||||
|
||||
enum pianoRollKeyTypes
|
||||
{
|
||||
PR_WHITE_KEY_SMALL,
|
||||
PR_WHITE_KEY_BIG,
|
||||
PR_BLACK_KEY
|
||||
} ;
|
||||
};
|
||||
|
||||
QVector<QString> m_nemStr; // gui names of each edit mode
|
||||
QMenu * m_noteEditMenu; // when you right click below the key area
|
||||
QSignalMapper * m_signalMapper; // to keep track of edit mode events
|
||||
|
||||
pianoRoll( void );
|
||||
pianoRoll( const pianoRoll & );
|
||||
virtual ~pianoRoll();
|
||||
|
||||
midiTime newNoteLen( void ) const;
|
||||
|
||||
|
||||
|
||||
void shiftPos(int amount);
|
||||
void shiftSemiTone(int amount);
|
||||
bool isSelection() const;
|
||||
int selectionCount() const;
|
||||
void testPlayNote( note * n );
|
||||
void testPlayKey( int _key, int _vol, int _pan );
|
||||
void pauseTestNotes( bool _pause = true );
|
||||
|
||||
inline int noteEditTop() const;
|
||||
inline int keyAreaBottom() const;
|
||||
inline int noteEditBottom() const;
|
||||
inline int keyAreaTop() const;
|
||||
inline int noteEditRight() const;
|
||||
inline int noteEditLeft() const;
|
||||
|
||||
void dragNotes( int x, int y, bool alt );
|
||||
|
||||
static const int cm_scrollAmtHoriz = 10;
|
||||
static const int cm_scrollAmtVert = 1;
|
||||
|
||||
static QPixmap * s_whiteKeyBigPm;
|
||||
static QPixmap * s_whiteKeySmallPm;
|
||||
static QPixmap * s_blackKeyPm;
|
||||
@@ -190,8 +219,8 @@ private:
|
||||
toolButton * m_drawButton;
|
||||
toolButton * m_eraseButton;
|
||||
toolButton * m_selectButton;
|
||||
toolButton * m_moveButton;
|
||||
|
||||
toolButton * m_detuneButton;
|
||||
|
||||
toolButton * m_cutButton;
|
||||
toolButton * m_copyButton;
|
||||
toolButton * m_pasteButton;
|
||||
@@ -215,30 +244,51 @@ private:
|
||||
|
||||
note * m_currentNote;
|
||||
actions m_action;
|
||||
noteEditMode m_noteEditMode;
|
||||
|
||||
Uint32 m_selectStartTick;
|
||||
int m_selectedTick;
|
||||
int m_selectStartKey;
|
||||
int m_selectedKeys;
|
||||
|
||||
// boundary box around all selected notes when dragging
|
||||
int m_moveBoundaryLeft;
|
||||
int m_moveBoundaryTop;
|
||||
int m_moveBoundaryRight;
|
||||
int m_moveBoundaryBottom;
|
||||
|
||||
// remember where the scrolling started when dragging so that
|
||||
// we can handle dragging while scrolling with arrow keys
|
||||
int m_mouseDownKey;
|
||||
int m_mouseDownTick;
|
||||
|
||||
// remember the last x and y of a mouse movement
|
||||
int m_lastMouseX;
|
||||
int m_lastMouseY;
|
||||
|
||||
// x,y of when the user starts a drag
|
||||
int m_moveStartX;
|
||||
int m_moveStartY;
|
||||
|
||||
int m_moveStartKey;
|
||||
int m_moveStartTick;
|
||||
int m_moveXOffset;
|
||||
|
||||
int m_oldNotesEditHeight;
|
||||
int m_notesEditHeight;
|
||||
int m_ppt;
|
||||
int m_totalKeysToScroll;
|
||||
|
||||
// remember these values to use them
|
||||
// for the next note that is set
|
||||
midiTime m_lenOfNewNotes;
|
||||
volume m_lastNoteVolume;
|
||||
panning m_lastNotePanning;
|
||||
|
||||
int m_startKey; // first key when drawing
|
||||
int m_lastKey;
|
||||
|
||||
noteVector m_selNotesForMove;
|
||||
|
||||
|
||||
editModes m_editMode;
|
||||
|
||||
editModes m_ctrlMode; // mode they were in before they hit ctrl
|
||||
|
||||
bool m_mouseDownLeft; //true if left click is being held down
|
||||
bool m_mouseDownRight; //true if right click is being held down
|
||||
|
||||
timeLine * m_timeLine;
|
||||
bool m_scrollBack;
|
||||
@@ -249,8 +299,10 @@ private:
|
||||
bool mouseOverNote( void );
|
||||
note * noteUnderMouse( void );
|
||||
noteVector::const_iterator noteIteratorUnderMouse( void );
|
||||
|
||||
|
||||
|
||||
// turn a selection rectangle into selected notes
|
||||
void computeSelectedNotes( bool shift );
|
||||
void clearSelectedNotes( void );
|
||||
|
||||
friend class engine;
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
|
||||
inline bool operator<( const projectVersion & _v1, const char * _str )
|
||||
{
|
||||
return( projectVersion::compare( _v1, projectVersion( _str ) ) < 0 );
|
||||
return projectVersion::compare( _v1, projectVersion( _str ) ) < 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -483,6 +483,7 @@ enum RemoteMessageIDs
|
||||
IdLoadSettingsFromString,
|
||||
IdLoadSettingsFromFile,
|
||||
IdLoadPresetFromFile,
|
||||
IdDebugMessage,
|
||||
IdUserBase = 64
|
||||
} ;
|
||||
|
||||
@@ -818,6 +819,11 @@ public:
|
||||
return m_outputCount;
|
||||
}
|
||||
|
||||
void debugMessage( const std::string & _s )
|
||||
{
|
||||
sendMessage( message( IdDebugMessage ).addString( _s ) );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void setShmKey( key_t _key, int _size );
|
||||
|
||||
@@ -106,6 +106,8 @@ private:
|
||||
toolButton * m_stopButton;
|
||||
lcdSpinBox * m_tempoSpinBox;
|
||||
|
||||
timeLine * m_timeLine;
|
||||
|
||||
meterDialog * m_timeSigDisplay;
|
||||
automatableSlider * m_masterVolumeSlider;
|
||||
automatableSlider * m_masterPitchSlider;
|
||||
|
||||
@@ -284,6 +284,8 @@ private:
|
||||
|
||||
int m_pixelsPerTact;
|
||||
|
||||
QPixmap m_background;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public:
|
||||
|
||||
virtual automationPattern * tempoAutomationPattern( void )
|
||||
{
|
||||
return( NULL );
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int countTracks( track::TrackTypes _tt = track::NumTrackTypes ) const;
|
||||
@@ -69,14 +69,14 @@ public:
|
||||
|
||||
const trackList & tracks( void ) const
|
||||
{
|
||||
return( m_tracks );
|
||||
return m_tracks;
|
||||
}
|
||||
|
||||
bool isEmpty( void ) const;
|
||||
|
||||
static const QString classNodeName( void )
|
||||
{
|
||||
return( "trackcontainer" );
|
||||
return "trackcontainer";
|
||||
}
|
||||
|
||||
|
||||
@@ -107,12 +107,12 @@ public:
|
||||
|
||||
virtual QString nodeName( void ) const
|
||||
{
|
||||
return( "dummytrackcontainer" );
|
||||
return "dummytrackcontainer";
|
||||
}
|
||||
|
||||
instrumentTrack * dummyInstrumentTrack( void )
|
||||
{
|
||||
return( m_dummyInstrumentTrack );
|
||||
return m_dummyInstrumentTrack;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2,4 +2,4 @@ INCLUDE(BuildPlugin)
|
||||
|
||||
INCLUDE_DIRECTORIES(unrtf)
|
||||
|
||||
BUILD_PLUGIN(flpimport flp_import.cpp flp_import.h)
|
||||
BUILD_PLUGIN(flpimport flp_import.cpp unrtf.cpp flp_import.h)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -34,134 +34,9 @@
|
||||
#include "note.h"
|
||||
|
||||
|
||||
enum flpEvents
|
||||
{
|
||||
// BYTE EVENTS
|
||||
FLP_Byte = 0,
|
||||
FLP_Enabled = 0,
|
||||
FLP_NoteOn = 1, //+pos (byte)
|
||||
FLP_Vol = 2,
|
||||
FLP_Pan = 3,
|
||||
FLP_MIDIChan = 4,
|
||||
FLP_MIDINote = 5,
|
||||
FLP_MIDIPatch = 6,
|
||||
FLP_MIDIBank = 7,
|
||||
FLP_LoopActive = 9,
|
||||
FLP_ShowInfo = 10,
|
||||
FLP_Shuffle = 11,
|
||||
FLP_MainVol = 12,
|
||||
FLP_Stretch = 13, // old byte version
|
||||
FLP_Pitchable = 14,
|
||||
FLP_Zipped = 15,
|
||||
FLP_Delay_Flags = 16,
|
||||
FLP_PatLength = 17,
|
||||
FLP_BlockLength = 18,
|
||||
FLP_UseLoopPoints = 19,
|
||||
FLP_LoopType = 20,
|
||||
FLP_ChanType = 21,
|
||||
FLP_MixSliceNum = 22,
|
||||
|
||||
// WORD EVENTS
|
||||
FLP_Word = 64,
|
||||
FLP_NewChan = FLP_Word,
|
||||
FLP_NewPat = FLP_Word + 1, //+PatNum (word)
|
||||
FLP_Tempo = FLP_Word + 2,
|
||||
FLP_CurrentPatNum = FLP_Word + 3,
|
||||
FLP_PatData = FLP_Word + 4,
|
||||
FLP_FX = FLP_Word + 5,
|
||||
FLP_Fade_Stereo = FLP_Word + 6,
|
||||
FLP_CutOff = FLP_Word + 7,
|
||||
FLP_DotVol = FLP_Word + 8,
|
||||
FLP_DotPan = FLP_Word + 9,
|
||||
FLP_PreAmp = FLP_Word + 10,
|
||||
FLP_Decay = FLP_Word + 11,
|
||||
FLP_Attack = FLP_Word + 12,
|
||||
FLP_DotNote = FLP_Word + 13,
|
||||
FLP_DotPitch = FLP_Word + 14,
|
||||
FLP_DotMix = FLP_Word + 15,
|
||||
FLP_MainPitch = FLP_Word + 16,
|
||||
FLP_RandChan = FLP_Word + 17,
|
||||
FLP_MixChan = FLP_Word + 18,
|
||||
FLP_Resonance = FLP_Word + 19,
|
||||
FLP_LoopBar = FLP_Word + 20,
|
||||
FLP_StDel = FLP_Word + 21,
|
||||
FLP_FX3 = FLP_Word + 22,
|
||||
FLP_DotReso = FLP_Word + 23,
|
||||
FLP_DotCutOff = FLP_Word + 24,
|
||||
FLP_ShiftDelay = FLP_Word + 25,
|
||||
FLP_LoopEndBar = FLP_Word + 26,
|
||||
FLP_Dot = FLP_Word + 27,
|
||||
FLP_DotShift = FLP_Word + 28,
|
||||
|
||||
// DWORD EVENTS
|
||||
FLP_Int = 128,
|
||||
FLP_Color = FLP_Int,
|
||||
FLP_PlayListItem = FLP_Int + 1, //+Pos (word) +PatNum (word)
|
||||
FLP_Echo = FLP_Int + 2,
|
||||
FLP_FXSine = FLP_Int + 3,
|
||||
FLP_CutCutBy = FLP_Int + 4,
|
||||
FLP_WindowH = FLP_Int + 5,
|
||||
FLP_MiddleNote = FLP_Int + 7,
|
||||
FLP_Reserved = FLP_Int + 8, // may contain an invalid version info
|
||||
FLP_MainResoCutOff = FLP_Int + 9,
|
||||
FLP_DelayReso = FLP_Int + 10,
|
||||
FLP_Reverb = FLP_Int + 11,
|
||||
FLP_IntStretch = FLP_Int + 12,
|
||||
FLP_SSNote = FLP_Int + 13,
|
||||
FLP_FineTune = FLP_Int + 14,
|
||||
|
||||
// TEXT EVENTS
|
||||
FLP_Undef = 192, //+Size (var length)
|
||||
FLP_Text = FLP_Undef, //+Size (var length)+Text
|
||||
// (Null Term. String)
|
||||
FLP_Text_ChanName = FLP_Text, // name for the current channel
|
||||
FLP_Text_PatName = FLP_Text + 1, // name for the current pattern
|
||||
FLP_Text_Title = FLP_Text + 2, // title of the loop
|
||||
FLP_Text_Comment = FLP_Text + 3, // old comments in text format.
|
||||
// Not used anymore
|
||||
FLP_Text_SampleFileName = FLP_Text + 4, // filename for the sample in
|
||||
// the current channel, stored
|
||||
// as relative path
|
||||
FLP_Text_URL = FLP_Text + 5,
|
||||
FLP_Text_CommentRTF = FLP_Text + 6, // new comments in Rich Text
|
||||
// format
|
||||
FLP_Version = FLP_Text + 7,
|
||||
FLP_Text_PluginName = FLP_Text + 9, // plugin file name
|
||||
// (without path)
|
||||
|
||||
FLP_MIDICtrls = FLP_Text + 16,
|
||||
FLP_Delay = FLP_Text + 17,
|
||||
FLP_TS404Params = FLP_Text + 18,
|
||||
FLP_DelayLine = FLP_Text + 19,
|
||||
FLP_NewPlugin = FLP_Text + 20,
|
||||
FLP_PluginParams = FLP_Text + 21,
|
||||
FLP_ChanParams = FLP_Text + 23,// block of various channel
|
||||
// params (can grow)
|
||||
FLP_EnvLfoParams = FLP_Text + 26,
|
||||
FLP_FilterParams = FLP_Text + 27,
|
||||
FLP_PatternNotes = FLP_Text + 32,
|
||||
FLP_StepData = FLP_Text + 33,
|
||||
|
||||
FLP_CmdCount
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
enum flPlugins
|
||||
{
|
||||
FL_Plugin_3x_Osc,
|
||||
FL_Plugin_Sampler,
|
||||
FL_Plugin_Plucked,
|
||||
FL_Plugin_SimSynth,
|
||||
FL_Plugin_DX10,
|
||||
FL_Plugin_Sytrus,
|
||||
FL_Plugin_WASP,
|
||||
FL_Plugin_Undef
|
||||
} ;
|
||||
|
||||
|
||||
class instrument;
|
||||
|
||||
struct FL_Channel;
|
||||
|
||||
class flpImport : public importFilter
|
||||
{
|
||||
@@ -178,8 +53,7 @@ public:
|
||||
private:
|
||||
virtual bool tryImport( trackContainer * _tc );
|
||||
|
||||
bool processPluginParams( const flPlugins _plugin, const char * _data,
|
||||
const int _data_len, instrument * _i );
|
||||
void processPluginParams( FL_Channel * _ch );
|
||||
|
||||
inline int readInt( int _bytes )
|
||||
{
|
||||
@@ -226,15 +100,6 @@ private:
|
||||
}
|
||||
|
||||
|
||||
typedef QList<QPair<int, note> > patternNoteVector;
|
||||
patternNoteVector m_notes;
|
||||
|
||||
typedef QList<int> stepVector;
|
||||
stepVector m_steps;
|
||||
|
||||
typedef QList<Uint32> playListItems;
|
||||
playListItems m_plItems;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
69
plugins/flp_import/unrtf.cpp
Normal file
69
plugins/flp_import/unrtf.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
/*
|
||||
* unrtf.cpp - integration of UnRTF
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "lmmsconfig.h"
|
||||
|
||||
#include <QtCore/QString>
|
||||
#include <QtCore/QBuffer>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// unrtf-stuff
|
||||
#include "defs.h"
|
||||
#include "main.h"
|
||||
#include "html.h"
|
||||
#include "word.h"
|
||||
#include "hash.h"
|
||||
#include "convert.h"
|
||||
#include "attr.h"
|
||||
|
||||
|
||||
int lineno = 0;
|
||||
#define inline_mode 0
|
||||
#define debug_mode 0
|
||||
#define nopict_mode 1
|
||||
#define verbose_mode 0
|
||||
#define simple_mode 0
|
||||
#define no_remap_mode 0
|
||||
|
||||
QString outstring;
|
||||
short numchar_table;
|
||||
OutputPersonality * op = NULL;
|
||||
|
||||
|
||||
// include unrtf-source
|
||||
#include "attr.c"
|
||||
#include "convert.c"
|
||||
#include "error.c"
|
||||
#include "hash.c"
|
||||
#include "html.c"
|
||||
#include "malloc.c"
|
||||
#include "output.c"
|
||||
#include "parse.c"
|
||||
#include "util.c"
|
||||
#include "word.c"
|
||||
|
||||
}
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -33,6 +33,8 @@
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added comment blocks
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: fixed fore/background_begin error
|
||||
* and updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
@@ -106,10 +108,10 @@ attr_express_begin (int attr, const char* param) {
|
||||
switch(attr)
|
||||
{
|
||||
case ATTR_BOLD:
|
||||
outstring+=QString("%1").arg(op->bold_begin);
|
||||
outstring+=QString().sprintf(op->bold_begin);
|
||||
break;
|
||||
case ATTR_ITALIC:
|
||||
outstring+=QString("%1").arg(op->italic_begin);
|
||||
outstring+=QString().sprintf(op->italic_begin);
|
||||
break;
|
||||
|
||||
/* Various underlines, they all resolve to HTML's <u> */
|
||||
@@ -121,11 +123,11 @@ attr_express_begin (int attr, const char* param) {
|
||||
case ATTR_2DOT_DASH_UL:
|
||||
case ATTR_WORD_UL:
|
||||
case ATTR_UNDERLINE:
|
||||
outstring+=QString("%1").arg(op->underline_begin);
|
||||
outstring+=QString().sprintf(op->underline_begin);
|
||||
break;
|
||||
|
||||
case ATTR_DOUBLE_UL:
|
||||
outstring+=QString("%1").arg(op->dbl_underline_begin);
|
||||
outstring+=QString().sprintf(op->dbl_underline_begin);
|
||||
break;
|
||||
|
||||
case ATTR_FONTSIZE:
|
||||
@@ -133,48 +135,48 @@ attr_express_begin (int attr, const char* param) {
|
||||
break;
|
||||
|
||||
case ATTR_FONTFACE:
|
||||
outstring+=QString("%1").arg(op->font_begin,param);
|
||||
outstring+=QString().sprintf(op->font_begin,param);
|
||||
break;
|
||||
|
||||
case ATTR_FOREGROUND:
|
||||
outstring+=QString("%1").arg(op->foreground_begin, param);
|
||||
outstring+=QString().sprintf(op->foreground_begin, param);
|
||||
break;
|
||||
|
||||
case ATTR_BACKGROUND:
|
||||
if (!simple_mode)
|
||||
outstring+=QString("%1").arg(op->foreground_begin,param);
|
||||
outstring+=QString().sprintf(op->background_begin,param);
|
||||
break;
|
||||
|
||||
case ATTR_SUPER:
|
||||
outstring+=QString("%1").arg(op->superscript_begin);
|
||||
outstring+=QString().sprintf(op->superscript_begin);
|
||||
break;
|
||||
case ATTR_SUB:
|
||||
outstring+=QString("%1").arg(op->subscript_begin);
|
||||
outstring+=QString().sprintf(op->subscript_begin);
|
||||
break;
|
||||
|
||||
case ATTR_STRIKE:
|
||||
outstring+=QString("%1").arg(op->strikethru_begin);
|
||||
outstring+=QString().sprintf(op->strikethru_begin);
|
||||
break;
|
||||
|
||||
case ATTR_DBL_STRIKE:
|
||||
outstring+=QString("%1").arg(op->dbl_strikethru_begin);
|
||||
outstring+=QString().sprintf(op->dbl_strikethru_begin);
|
||||
break;
|
||||
|
||||
case ATTR_EXPAND:
|
||||
outstring+=QString("%1").arg(op->expand_begin, param);
|
||||
outstring+=QString().sprintf(op->expand_begin, param);
|
||||
break;
|
||||
|
||||
case ATTR_OUTLINE:
|
||||
outstring+=QString("%1").arg(op->outline_begin);
|
||||
outstring+=QString().sprintf(op->outline_begin);
|
||||
break;
|
||||
case ATTR_SHADOW:
|
||||
outstring+=QString("%1").arg(op->shadow_begin);
|
||||
outstring+=QString().sprintf(op->shadow_begin);
|
||||
break;
|
||||
case ATTR_EMBOSS:
|
||||
outstring+=QString("%1").arg(op->emboss_begin);
|
||||
outstring+=QString().sprintf(op->emboss_begin);
|
||||
break;
|
||||
case ATTR_ENGRAVE:
|
||||
outstring+=QString("%1").arg(op->engrave_begin);
|
||||
outstring+=QString().sprintf(op->engrave_begin);
|
||||
break;
|
||||
|
||||
case ATTR_CAPS:
|
||||
@@ -187,7 +189,7 @@ attr_express_begin (int attr, const char* param) {
|
||||
simulate_smallcaps = TRUE;
|
||||
else {
|
||||
if (op->small_caps_begin)
|
||||
outstring+=QString("%1").arg(op->small_caps_begin);
|
||||
outstring+=QString().sprintf(op->small_caps_begin);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -207,10 +209,10 @@ attr_express_end (int attr, char *param)
|
||||
switch(attr)
|
||||
{
|
||||
case ATTR_BOLD:
|
||||
outstring+=QString("%1").arg(op->bold_end);
|
||||
outstring+=QString().sprintf(op->bold_end);
|
||||
break;
|
||||
case ATTR_ITALIC:
|
||||
outstring+=QString("%1").arg(op->italic_end);
|
||||
outstring+=QString().sprintf(op->italic_end);
|
||||
break;
|
||||
|
||||
/* Various underlines, they all resolve to HTML's </u> */
|
||||
@@ -222,11 +224,11 @@ attr_express_end (int attr, char *param)
|
||||
case ATTR_2DOT_DASH_UL:
|
||||
case ATTR_WORD_UL:
|
||||
case ATTR_UNDERLINE:
|
||||
outstring+=QString("%1").arg(op->underline_end);
|
||||
outstring+=QString().sprintf(op->underline_end);
|
||||
break;
|
||||
|
||||
case ATTR_DOUBLE_UL:
|
||||
outstring+=QString("%1").arg(op->dbl_underline_end);
|
||||
outstring+=QString().sprintf(op->dbl_underline_end);
|
||||
break;
|
||||
|
||||
case ATTR_FONTSIZE:
|
||||
@@ -234,47 +236,47 @@ attr_express_end (int attr, char *param)
|
||||
break;
|
||||
|
||||
case ATTR_FONTFACE:
|
||||
outstring+=QString("%1").arg(op->font_end);
|
||||
outstring+=QString().sprintf(op->font_end);
|
||||
break;
|
||||
|
||||
case ATTR_FOREGROUND:
|
||||
outstring+=QString("%1").arg(op->foreground_end);
|
||||
outstring+=QString().sprintf(op->foreground_end);
|
||||
break;
|
||||
case ATTR_BACKGROUND:
|
||||
if (!simple_mode)
|
||||
outstring+=QString("%1").arg(op->background_end);
|
||||
outstring+=QString().sprintf(op->background_end);
|
||||
break;
|
||||
|
||||
case ATTR_SUPER:
|
||||
outstring+=QString("%1").arg(op->superscript_end);
|
||||
outstring+=QString().sprintf(op->superscript_end);
|
||||
break;
|
||||
case ATTR_SUB:
|
||||
outstring+=QString("%1").arg(op->subscript_end);
|
||||
outstring+=QString().sprintf(op->subscript_end);
|
||||
break;
|
||||
|
||||
case ATTR_STRIKE:
|
||||
outstring+=QString("%1").arg(op->strikethru_end);
|
||||
outstring+=QString().sprintf(op->strikethru_end);
|
||||
break;
|
||||
|
||||
case ATTR_DBL_STRIKE:
|
||||
outstring+=QString("%1").arg(op->dbl_strikethru_end);
|
||||
outstring+=QString().sprintf(op->dbl_strikethru_end);
|
||||
break;
|
||||
|
||||
case ATTR_OUTLINE:
|
||||
outstring+=QString("%1").arg(op->outline_end);
|
||||
outstring+=QString().sprintf(op->outline_end);
|
||||
break;
|
||||
case ATTR_SHADOW:
|
||||
outstring+=QString("%1").arg(op->shadow_end);
|
||||
outstring+=QString().sprintf(op->shadow_end);
|
||||
break;
|
||||
case ATTR_EMBOSS:
|
||||
outstring+=QString("%1").arg(op->emboss_end);
|
||||
outstring+=QString().sprintf(op->emboss_end);
|
||||
break;
|
||||
case ATTR_ENGRAVE:
|
||||
outstring+=QString("%1").arg(op->engrave_end);
|
||||
outstring+=QString().sprintf(op->engrave_end);
|
||||
break;
|
||||
|
||||
case ATTR_EXPAND:
|
||||
outstring+=QString("%1").arg(op->expand_end);
|
||||
outstring+=QString().sprintf(op->expand_end);
|
||||
break;
|
||||
|
||||
case ATTR_CAPS:
|
||||
@@ -287,7 +289,7 @@ attr_express_end (int attr, char *param)
|
||||
simulate_smallcaps = FALSE;
|
||||
else {
|
||||
if (op->small_caps_end)
|
||||
outstring+=QString("%1").arg(op->small_caps_end);
|
||||
outstring+=QString().sprintf(op->small_caps_end);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -331,6 +333,42 @@ attr_push(int attr, const char* param)
|
||||
attr_express_begin(attr, param);
|
||||
}
|
||||
|
||||
#if 1 /* daved 0.20.2 */
|
||||
|
||||
/*========================================================================
|
||||
* Name: attr_get_param
|
||||
* Purpose: Reads an attribute from the current attribute stack.
|
||||
* Args: Attribute number
|
||||
* Returns: string.
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
attr_get_param(int attr)
|
||||
{
|
||||
int i;
|
||||
AttrStack *stack = stack_of_stacks_top;
|
||||
if (!stack) {
|
||||
warning_handler("No stack to get attribute from");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
i=stack->tos;
|
||||
while (i>=0)
|
||||
{
|
||||
if(stack->attr_stack [i] == attr)
|
||||
{
|
||||
if(stack->attr_stack_params [i] != NULL)
|
||||
return stack->attr_stack_params [i];
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
i--;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: attrstack_copy_all
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -32,11 +32,13 @@
|
||||
* 18 Sep 01, tuorfa@yahoo.com: updates for AttrStack paradigm
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _ATTR
|
||||
#define _ATTR
|
||||
|
||||
|
||||
enum {
|
||||
ATTR_NONE=0,
|
||||
ATTR_BOLD, ATTR_ITALIC,
|
||||
@@ -90,6 +92,13 @@ extern void attr_pop_all();
|
||||
|
||||
extern void attr_pop_dump();
|
||||
|
||||
#if 1 /* daved 0.20.2 */
|
||||
|
||||
char * attr_get_param(int attr);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -28,7 +28,8 @@
|
||||
* Purpose: Definitions for the conversion module
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 31 March 2005 by daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Mar 05, by daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -38,7 +39,7 @@ enum {
|
||||
CHARSET_ANSI=1,
|
||||
CHARSET_MAC,
|
||||
CHARSET_CP437,
|
||||
CHARSET_CP850
|
||||
CHARSET_CP850,
|
||||
};
|
||||
|
||||
#ifndef _WORD
|
||||
@@ -48,9 +49,10 @@ enum {
|
||||
extern void word_print (Word*, QString & _s);
|
||||
|
||||
#if 1 /* daved 0.19.6 - support for multiple char number->output tables */
|
||||
short numchar_table;
|
||||
extern short numchar_table;
|
||||
#define FONTROMAN_TABLE 0
|
||||
#define FONTSYMBOL_TABLE 1
|
||||
#define FONTGREEK_TABLE 2
|
||||
#endif
|
||||
|
||||
#define _CONVERT
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -35,6 +35,9 @@
|
||||
* 09 Oct 03, daved@physiol.usyd.edu.au: changed to GNU website
|
||||
* 17 Feb 04, marcossamaral@terra.com.br: changed some information
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
* 17 Dec 07, daved@physiol.usyd.edu.au: added --noremap to usage - from
|
||||
* David Santinoli
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -61,7 +64,7 @@
|
||||
#endif
|
||||
|
||||
|
||||
#define USAGE "unrtf [--version] [--verbose] [--help] [--nopict|-n] [--html] [--text] [--vt] [--latex] [-t html|text|vt|latex] <filename>"
|
||||
#define USAGE "unrtf [--version] [--verbose] [--help] [--nopict|-n] [--noremap] [--html] [--text] [--vt] [--latex] [-t html|text|vt|latex] <filename>"
|
||||
|
||||
|
||||
/* Default names for RTF's default fonts */
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -37,6 +37,7 @@
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 22 Aug 05, ax2groin@arbornet.org: added lineno to error_handler
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -30,6 +30,7 @@
|
||||
* Changes
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -38,6 +38,7 @@
|
||||
* 08 Oct 03, daved@physiol.usyd.edu.au: some type fixes
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requsted by ZT Smith
|
||||
* 06 Jan 06, marcossamaral@terra.com.br: changes hash_stats function
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -29,6 +29,7 @@
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 06 Jan 06, marcossamaral@terra.com.br: changes hash_stats()
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -39,6 +39,8 @@
|
||||
* 19 Aug 05, ax2groin@arbornet.org: added more chars and changes to ANSI
|
||||
* 05 Jan 06, marcossamaral@terra.com.br: fixed bugs #14982 and #14983
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 13 Dec 07, daved@physiol.usyd.edu.au: fixed some missing entity ';'
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
@@ -644,8 +646,8 @@ static const char* cp437 [] = {
|
||||
/* 0x9b */ "¢",
|
||||
/* 0x9c */ "£",
|
||||
/* 0x9d */ "¥",
|
||||
/* 0x9e */ "₧", /* peseta */
|
||||
/* 0x9f */ "ƒ", /* small f with hook */
|
||||
/* 0x9e */ "₧", /* peseta */
|
||||
/* 0x9f */ "ƒ", /* small f with hook */
|
||||
/* 0xa0 */ "á",
|
||||
/* 0xa1 */ "í",
|
||||
/* 0xa2 */ "ó",
|
||||
@@ -655,7 +657,7 @@ static const char* cp437 [] = {
|
||||
/* 0xa6 */ "ª",
|
||||
/* 0xa7 */ "¼",
|
||||
/* 0xa8 */ "¿",
|
||||
/* 0xa9 */ "⌐", /* reversed not */
|
||||
/* 0xa9 */ "⌐", /* reversed not */
|
||||
/* 0xaa */ "¬",
|
||||
/* 0xab */ "½",
|
||||
/* 0xac */ "»",
|
||||
@@ -874,6 +876,159 @@ static const char* cp850 [] = {
|
||||
/* 0xfe */ "■", /* black square */
|
||||
/* 0xff */ " ",
|
||||
};
|
||||
#if 1 /* daved - 0.20.3 */
|
||||
static char * Greek[] =
|
||||
{
|
||||
/* 0x80 */ "ç",
|
||||
/* 0x81 */ "ü",
|
||||
/* 0x82 */ "é",
|
||||
/* 0x83 */ "â",
|
||||
/* 0x84 */ "ä",
|
||||
/* 0x85 */ "à",
|
||||
/* 0x86 */ "å",
|
||||
/* 0x87 */ "ç",
|
||||
/* 0x88 */ "ê",
|
||||
/* 0x89 */ "ë",
|
||||
/* 0x8a */ "è",
|
||||
/* 0x8b */ "ï",
|
||||
/* 0x8c */ "î",
|
||||
/* 0x8d */ "ì",
|
||||
/* 0x8e */ "ä",
|
||||
/* 0x8f */ "å",
|
||||
/* 0x90 */ "é",
|
||||
/* 0x91 */ "æ",
|
||||
/* 0x92 */ "æ",
|
||||
/* 0x93 */ "ô",
|
||||
/* 0x94 */ "ö",
|
||||
/* 0x95 */ "ò",
|
||||
/* 0x96 */ "û",
|
||||
/* 0x97 */ "ù",
|
||||
/* 0x98 */ "ÿ",
|
||||
/* 0x99 */ "ö",
|
||||
/* 0x9a */ "ü",
|
||||
/* 0x9b */ "ø",
|
||||
/* 0x9c */ "£",
|
||||
/* 0x9d */ "ø",
|
||||
/* 0x9e */ "×",
|
||||
/* 0x9f */ "ƒ", /* small f with hook */
|
||||
/* 0xa0 */ "á",
|
||||
/* 0xa1 */ "í",
|
||||
/* 0xa2 */ "ó",
|
||||
/* 0xa3 */ "ú",
|
||||
/* 0xa4 */ "ñ",
|
||||
/* 0xa5 */ "ñ",
|
||||
/* 0xa6 */ "ª",
|
||||
/* 0xa7 */ "¼",
|
||||
/* 0xa8 */ "¿",
|
||||
/* 0xa9 */ "®",
|
||||
/* 0xaa */ "¬",
|
||||
/* 0xab */ "½",
|
||||
/* 0xac */ "»",
|
||||
/* 0xad */ "¡",
|
||||
/* 0xae */ "«",
|
||||
/* 0xaf */ "º",
|
||||
/* 0xb0 */ "░", /* light shade */
|
||||
/* 0xb1 */ "▒", /* med. shade */
|
||||
/* 0xb2 */ "▓", /* dark shade */
|
||||
/* 0xb3 */ "│", /* box-draw light vert. */
|
||||
/* 0xb4 */ "┤", /* box-draw light vert. + lt. */
|
||||
/* 0xb5 */ "á",
|
||||
/* 0xb6 */ "â",
|
||||
/* 0xb7 */ "à",
|
||||
/* 0xb8 */ "©",
|
||||
/* 0xb9 */ "╣", /* box-draw dbl. vert. + lt. */
|
||||
/* 0xba */ "║", /* box-draw dbl. vert. */
|
||||
/* 0xbb */ "╗", /* box-draw dbl. dn. + lt. */
|
||||
/* 0xbc */ "╝", /* box-draw dbl. up + lt. */
|
||||
/* 0xbd */ "¢",
|
||||
/* 0xbe */ "¥",
|
||||
/* 0xbf */ "┐", /* box-draw light dn. + lt. */
|
||||
/* 0xc0 */ "└", /* box-draw light up + rt. */
|
||||
/* 0xc1 */ "┴", /* box-draw light up + horiz. */
|
||||
/* 0xc2 */ "┬", /* box-draw light dn. + horiz. */
|
||||
/* 0xc3 */ "├", /* box-draw light vert. + rt. */
|
||||
/* 0xc4 */ "─", /* box-draw light horiz. */
|
||||
/* 0xc5 */ "┼", /* box-draw light vert. + horiz. */
|
||||
/* 0xc6 */ "ã",
|
||||
/* 0xc7 */ "ã",
|
||||
/* 0xc8 */ "╚", /* box-draw dbl. up + rt. */
|
||||
/* 0xc9 */ "╔", /* box-draw dbl. dn. + rt. */
|
||||
/* 0xca */ "╩", /* box-draw dbl. up + horiz. */
|
||||
/* 0xcb */ "╦", /* box-draw dbl. dn. + horiz. */
|
||||
/* 0xcc */ "╠", /* box-draw dbl. vert. + rt. */
|
||||
/* 0xcd */ "═", /* box-draw dbl. horiz. */
|
||||
/* 0xce */ "╬", /* box-draw dbl. vert. + horiz. */
|
||||
/* 0xcf */ "¤",
|
||||
/* 0xd0 */ "ð",
|
||||
/* 0xd1 */ "ð",
|
||||
/* 0xd2 */ "ê",
|
||||
/* 0xd3 */ "ë",
|
||||
/* 0xd4 */ "è",
|
||||
/* 0xd5 */ "ı", /* small dotless i */
|
||||
/* 0xd6 */ "í",
|
||||
/* 0xd7 */ "î",
|
||||
/* 0xd8 */ "ï",
|
||||
/* 0xd9 */ "┘", /* box-draw light up + lt. */
|
||||
/* 0xda */ "┌", /* box-draw light dn. + rt. */
|
||||
/* 0xdb */ "█", /* full-block */
|
||||
/* 0xdc */ "▄", /* lower 1/2 block */
|
||||
/* 0xdd */ "¦",
|
||||
/* 0xde */ "ì",
|
||||
/* 0xdf */ "▀", /* upper 1/2 block */
|
||||
/* 0xe0 */ "ó",
|
||||
/* above here not done */
|
||||
/* 0xe1 */ "α",
|
||||
/* 0xe2 */ "β",
|
||||
/* 0xe3 */ "γ",
|
||||
/* 0xe4 */ "δ",
|
||||
/* 0xe5 */ "ε",
|
||||
/* 0xe6 */ "ζ",
|
||||
/* 0xe7 */ "η",
|
||||
/* 0xe8 */ "θ",
|
||||
/* 0xe9 */ "ι",
|
||||
/* 0xea */ "κ",
|
||||
/* 0xeb */ "λ",
|
||||
/* 0xec */ "μ",
|
||||
/* 0xed */ "ν",
|
||||
/* 0xee */ "ξ",
|
||||
/* 0xef */ "ο",
|
||||
/* 0xf0 */ "π",
|
||||
/* 0xf1 */ "ρ",
|
||||
/* 0xf2 */ "ς",
|
||||
/* 0xf3 */ "σ",
|
||||
/* 0xf4 */ "τ",
|
||||
/* 0xf5 */ "υ",
|
||||
/* 0xf6 */ "φ",
|
||||
/* 0xf7 */ "χ",
|
||||
/* 0xf8 */ "ψ",
|
||||
/* 0xf9 */ "&omiga;",
|
||||
/* 0xfa */ "&iotauml;",
|
||||
/* 0xfb */ "&nuuml;",
|
||||
/* 0xfc */ "&omicronacute;",
|
||||
/* 0xfd */ "&nuacute;",
|
||||
/* 0xfe */ "&omegaacute;", /* black square */
|
||||
/* 0xff */ " ",
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*========================================================================
|
||||
* Name: html_unisymbol_print
|
||||
* Purpose: Outputs arbitrary unicode symbol
|
||||
* Args: Unsigned Short.
|
||||
* Returns: String representing symbol.
|
||||
*=======================================================================*/
|
||||
|
||||
char *
|
||||
html_unisymbol_print (unsigned short c)
|
||||
{
|
||||
char r[12];
|
||||
snprintf(r, 9, "&#%04d;", c);
|
||||
return my_strdup(r);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1098,6 +1253,13 @@ html_init (void)
|
||||
op->symbol_last_char = 254;
|
||||
op->symbol_translation_table = symbol;
|
||||
#endif
|
||||
#if 1 /* daved - 0.20.3 - GREEK font support */
|
||||
op->greek_first_char = 0x80;
|
||||
op->greek_last_char = 0xff;
|
||||
op->greek_translation_table = Greek;
|
||||
#endif
|
||||
|
||||
op->unisymbol_print = html_unisymbol_print;
|
||||
|
||||
return op;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -28,6 +28,7 @@
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -30,6 +30,7 @@
|
||||
* 15 Oct 00, tuorfa@yahoo.com: removed echo_mode extern
|
||||
* 19 Sep 01, tuorfa@yahoo.com: added output personality
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -35,6 +35,7 @@
|
||||
* 08 Oct 03, daved@physiol.usyd.edu.au: added stdlib.h for linux
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -29,6 +29,7 @@
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
extern char * my_malloc (unsigned long);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -34,6 +34,9 @@
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 06 Jan 06, marcossamaral@terra.com.br: changes in STDOUT
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
* 17 Dec 07, daved@physiol.usyd.edu.au: added support for --noremap from
|
||||
* David Santinoli
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@@ -114,16 +117,27 @@ op_free (OutputPersonality *op)
|
||||
|
||||
const char *
|
||||
#if 1 /* daved - 0.19.6 */
|
||||
op_translate_char (OutputPersonality *op, int charset, int ch, int ntable)
|
||||
op_translate_char (OutputPersonality *op, int charset, CodepageInfo *codepage, int ch, int ntable)
|
||||
#else
|
||||
op_translate_char (OutputPersonality *op, int charset, int ch)
|
||||
op_translate_char (OutputPersonality *op, int charset, CodepageInfo *codepage, int ch)
|
||||
#endif
|
||||
{
|
||||
short start;
|
||||
const char *result=NULL;
|
||||
#if 1 /* daved - 0.20.5 */
|
||||
static char output_buffer[2]={ 0, 0 };
|
||||
#endif
|
||||
|
||||
CHECK_PARAM_NOT_NULL(op);
|
||||
|
||||
#if 1 /* daved - 0.20.5 */
|
||||
if (no_remap_mode == TRUE && ch < 256)
|
||||
{
|
||||
output_buffer[0]=ch;
|
||||
result=output_buffer;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#if 1 /* daved - 0.19.6 */
|
||||
/* if we are seeking a character from a symbol font we can
|
||||
be below 0x80
|
||||
@@ -134,8 +148,21 @@ op_translate_char (OutputPersonality *op, int charset, int ch)
|
||||
|
||||
if(ch >= start && ch <= op->symbol_last_char)
|
||||
result = op->symbol_translation_table[ch - start];
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
#if 1 /* daved - 0.20.3 */
|
||||
if(ntable == FONTGREEK_TABLE)
|
||||
{
|
||||
start = op->greek_first_char;
|
||||
|
||||
if(ch >= start && ch <= op->greek_last_char)
|
||||
result = op->greek_translation_table[ch - start];
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
if (ch >= 0x20 && ch < 0x80) {
|
||||
result = op->ascii_translation_table [ch - 0x20];
|
||||
@@ -149,10 +176,23 @@ op_translate_char (OutputPersonality *op, int charset, int ch)
|
||||
else
|
||||
switch (charset) {
|
||||
case CHARSET_ANSI:
|
||||
if (codepage != NULL && op->unisymbol_print != NULL && codepage->cp)
|
||||
{
|
||||
if(0)
|
||||
printf("<CODEPAGE CHAR %d>", codepage->chars[ch - 0x80]);
|
||||
if (codepage->chars[ch - 0x80]) {
|
||||
if(0)
|
||||
printf("<UNIPRINTING>");
|
||||
result = op->unisymbol_print(codepage->chars[ch - 0x80]);
|
||||
}
|
||||
}
|
||||
if(!result)
|
||||
{
|
||||
start = op->ansi_first_char;
|
||||
if (ch >= start &&
|
||||
ch <= op->ansi_last_char)
|
||||
result = op->ansi_translation_table [ch-start];
|
||||
if (ch >= start &&
|
||||
ch <= op->ansi_last_char)
|
||||
result = op->ansi_translation_table [ch-start];
|
||||
}
|
||||
break;
|
||||
case CHARSET_MAC:
|
||||
start = op->mac_first_char;
|
||||
@@ -198,49 +238,49 @@ op_begin_std_fontsize (OutputPersonality *op, int size)
|
||||
switch (size) {
|
||||
case 8:
|
||||
if (op->fontsize8_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize8_begin);
|
||||
outstring+=QString().sprintf(op->fontsize8_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (op->fontsize10_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize10_begin);
|
||||
outstring+=QString().sprintf(op->fontsize10_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (op->fontsize12_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize12_begin);
|
||||
outstring+=QString().sprintf(op->fontsize12_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (op->fontsize14_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize14_begin);
|
||||
outstring+=QString().sprintf(op->fontsize14_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
if (op->fontsize18_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize18_begin);
|
||||
outstring+=QString().sprintf(op->fontsize18_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
if (op->fontsize24_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize24_begin);
|
||||
outstring+=QString().sprintf(op->fontsize24_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 36:
|
||||
if (op->fontsize36_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize36_begin);
|
||||
outstring+=QString().sprintf(op->fontsize36_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 48:
|
||||
if (op->fontsize48_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize48_begin);
|
||||
outstring+=QString().sprintf(op->fontsize48_begin);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -253,53 +293,53 @@ op_begin_std_fontsize (OutputPersonality *op, int size)
|
||||
if (op->fontsize_begin) {
|
||||
char expr[16];
|
||||
sprintf (expr, "%d", size);
|
||||
outstring+=QString("%1").arg (op->fontsize_begin, expr);
|
||||
outstring+=QString().sprintf(op->fontsize_begin, expr);
|
||||
} else {
|
||||
/* If we cannot write out a change for the exact
|
||||
* point size, we must approximate to a standard
|
||||
* size.
|
||||
*/
|
||||
if (size<9 && op->fontsize8_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize8_begin);
|
||||
outstring+=QString().sprintf(op->fontsize8_begin);
|
||||
} else
|
||||
if (size<11 && op->fontsize10_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize10_begin);
|
||||
outstring+=QString().sprintf(op->fontsize10_begin);
|
||||
} else
|
||||
if (size<13 && op->fontsize12_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize12_begin);
|
||||
outstring+=QString().sprintf(op->fontsize12_begin);
|
||||
} else
|
||||
if (size<16 && op->fontsize14_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize14_begin);
|
||||
outstring+=QString().sprintf(op->fontsize14_begin);
|
||||
} else
|
||||
if (size<21 && op->fontsize18_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize18_begin);
|
||||
outstring+=QString().sprintf(op->fontsize18_begin);
|
||||
} else
|
||||
if (size<30 && op->fontsize24_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize24_begin);
|
||||
outstring+=QString().sprintf(op->fontsize24_begin);
|
||||
} else
|
||||
if (size<42 && op->fontsize36_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize36_begin);
|
||||
outstring+=QString().sprintf(op->fontsize36_begin);
|
||||
} else
|
||||
if (size>40 && op->fontsize48_begin) {
|
||||
outstring+=QString("%1").arg (op->fontsize48_begin);
|
||||
outstring+=QString().sprintf(op->fontsize48_begin);
|
||||
} else
|
||||
/* If we can't even produce a good approximation,
|
||||
* just try to get a font size near 12 point.
|
||||
*/
|
||||
if (op->fontsize12_begin)
|
||||
outstring+=QString("%1").arg (op->fontsize12_begin);
|
||||
outstring+=QString().sprintf(op->fontsize12_begin);
|
||||
else
|
||||
if (op->fontsize14_begin)
|
||||
outstring+=QString("%1").arg (op->fontsize14_begin);
|
||||
outstring+=QString().sprintf(op->fontsize14_begin);
|
||||
else
|
||||
if (op->fontsize10_begin)
|
||||
outstring+=QString("%1").arg (op->fontsize10_begin);
|
||||
outstring+=QString().sprintf(op->fontsize10_begin);
|
||||
else
|
||||
if (op->fontsize18_begin)
|
||||
outstring+=QString("%1").arg (op->fontsize18_begin);
|
||||
outstring+=QString().sprintf(op->fontsize18_begin);
|
||||
else
|
||||
if (op->fontsize8_begin)
|
||||
outstring+=QString("%1").arg (op->fontsize8_begin);
|
||||
outstring+=QString().sprintf(op->fontsize8_begin);
|
||||
else
|
||||
error_handler ("output personality lacks sufficient font size change capability");
|
||||
}
|
||||
@@ -327,49 +367,49 @@ op_end_std_fontsize (OutputPersonality *op, int size)
|
||||
switch (size) {
|
||||
case 8:
|
||||
if (op->fontsize8_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize8_end);
|
||||
outstring+=QString().sprintf(op->fontsize8_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 10:
|
||||
if (op->fontsize10_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize10_end);
|
||||
outstring+=QString().sprintf(op->fontsize10_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (op->fontsize12_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize12_end);
|
||||
outstring+=QString().sprintf(op->fontsize12_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
if (op->fontsize14_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize14_end);
|
||||
outstring+=QString().sprintf(op->fontsize14_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 18:
|
||||
if (op->fontsize18_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize18_end);
|
||||
outstring+=QString().sprintf(op->fontsize18_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 24:
|
||||
if (op->fontsize24_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize24_end);
|
||||
outstring+=QString().sprintf(op->fontsize24_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 36:
|
||||
if (op->fontsize36_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize36_end);
|
||||
outstring+=QString().sprintf(op->fontsize36_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
case 48:
|
||||
if (op->fontsize48_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize48_end);
|
||||
outstring+=QString().sprintf(op->fontsize48_end);
|
||||
found_std_expr = TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -382,53 +422,53 @@ op_end_std_fontsize (OutputPersonality *op, int size)
|
||||
if (op->fontsize_end) {
|
||||
char expr[16];
|
||||
sprintf (expr, "%d", size);
|
||||
outstring+=QString("%1").arg (op->fontsize_end, expr);
|
||||
outstring+=QString().sprintf(op->fontsize_end, expr);
|
||||
} else {
|
||||
/* If we cannot write out a change for the exact
|
||||
* point size, we must approximate to a standard
|
||||
* size.
|
||||
*/
|
||||
if (size<9 && op->fontsize8_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize8_end);
|
||||
outstring+=QString().sprintf(op->fontsize8_end);
|
||||
} else
|
||||
if (size<11 && op->fontsize10_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize10_end);
|
||||
outstring+=QString().sprintf(op->fontsize10_end);
|
||||
} else
|
||||
if (size<13 && op->fontsize12_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize12_end);
|
||||
outstring+=QString().sprintf(op->fontsize12_end);
|
||||
} else
|
||||
if (size<16 && op->fontsize14_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize14_end);
|
||||
outstring+=QString().sprintf(op->fontsize14_end);
|
||||
} else
|
||||
if (size<21 && op->fontsize18_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize18_end);
|
||||
outstring+=QString().sprintf(op->fontsize18_end);
|
||||
} else
|
||||
if (size<30 && op->fontsize24_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize24_end);
|
||||
outstring+=QString().sprintf(op->fontsize24_end);
|
||||
} else
|
||||
if (size<42 && op->fontsize36_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize36_end);
|
||||
outstring+=QString().sprintf(op->fontsize36_end);
|
||||
} else
|
||||
if (size>40 && op->fontsize48_end) {
|
||||
outstring+=QString("%1").arg (op->fontsize48_end);
|
||||
outstring+=QString().sprintf(op->fontsize48_end);
|
||||
} else
|
||||
/* If we can't even produce a good approximation,
|
||||
* just try to get a font size near 12 point.
|
||||
*/
|
||||
if (op->fontsize12_end)
|
||||
outstring+=QString("%1").arg (op->fontsize12_end);
|
||||
outstring+=QString().sprintf(op->fontsize12_end);
|
||||
else
|
||||
if (op->fontsize14_end)
|
||||
outstring+=QString("%1").arg (op->fontsize14_end);
|
||||
outstring+=QString().sprintf(op->fontsize14_end);
|
||||
else
|
||||
if (op->fontsize10_end)
|
||||
outstring+=QString("%1").arg (op->fontsize10_end);
|
||||
outstring+=QString().sprintf(op->fontsize10_end);
|
||||
else
|
||||
if (op->fontsize18_end)
|
||||
outstring+=QString("%1").arg (op->fontsize18_end);
|
||||
outstring+=QString().sprintf(op->fontsize18_end);
|
||||
else
|
||||
if (op->fontsize8_end)
|
||||
outstring+=QString("%1").arg (op->fontsize8_end);
|
||||
outstring+=QString().sprintf(op->fontsize8_end);
|
||||
else
|
||||
error_handler ("output personality lacks sufficient font size change capability");
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -28,12 +28,18 @@
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
* 31 Oct 07, jasp00@users.sourceforge.net: replaced deprecated conversions
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#ifndef _OUTPUT
|
||||
|
||||
typedef struct {
|
||||
int cp;
|
||||
unsigned short chars[128];
|
||||
} CodepageInfo;
|
||||
|
||||
|
||||
typedef struct {
|
||||
const char *comment_begin;
|
||||
@@ -276,6 +282,13 @@ typedef struct {
|
||||
short symbol_last_char;
|
||||
const char **symbol_translation_table;
|
||||
#endif
|
||||
#if 1 /* daved 0.20.3 GREEK font support */
|
||||
short greek_first_char;
|
||||
short greek_last_char;
|
||||
char **greek_translation_table;
|
||||
#endif
|
||||
|
||||
char *(*unisymbol_print) (unsigned short);
|
||||
|
||||
void (*write_set_foreground) (int,int,int);
|
||||
}
|
||||
@@ -285,9 +298,9 @@ OutputPersonality;
|
||||
extern OutputPersonality* op_create(void);
|
||||
extern void op_free (OutputPersonality*);
|
||||
#if 1 /* daved - 0.19.6 */
|
||||
extern const char* op_translate_char (OutputPersonality*,int,int, int);
|
||||
extern const char* op_translate_char (OutputPersonality*,int,CodepageInfo*,int, int);
|
||||
#else
|
||||
extern char* op_translate_char (OutputPersonality*,int,int);
|
||||
extern char* op_translate_char (OutputPersonality*,int,CodepageInfo*,int);
|
||||
#endif
|
||||
|
||||
extern void op_begin_std_fontsize (OutputPersonality*, int);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -36,6 +36,7 @@
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
|
||||
* 08 Sep 03, daved@physiol.usyd.edu.au: type fixes; ANSI C fixes
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -29,6 +29,7 @@
|
||||
* Changes:
|
||||
* 15 Oct 00, tuorfa@yahoo.com: parse.h created with functions taken from word.c
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -29,6 +29,7 @@
|
||||
* Changes:
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -28,6 +28,7 @@
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
extern int h2toi (char *);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -46,6 +46,7 @@
|
||||
* 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 11 Jan 07, jasp00@users.sourceforge.net: optimized unsafe loop
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifdef LMMS_HAVE_CONFIG_H
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
the Free Software Foundation; either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
@@ -28,6 +28,7 @@
|
||||
*----------------------------------------------------------------------
|
||||
* Changes:
|
||||
* 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
|
||||
* 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _WORD
|
||||
|
||||
7
plugins/ladspa_effect/cmt/README
Normal file
7
plugins/ladspa_effect/cmt/README
Normal file
@@ -0,0 +1,7 @@
|
||||
Computer Music Toolkit (CMT)
|
||||
----------------------------
|
||||
|
||||
This toolkit is a set of musical sound processing and synthesis tools
|
||||
presented as a LADSPA plugin library. See the doc/ directory for
|
||||
documentation and installation instructions. See http://www.ladspa.org
|
||||
for LADSPA information. See http://www.ladspa.org/cmt for CMT updates.
|
||||
@@ -292,20 +292,23 @@ bool midiImport::readSMF( trackContainer * _tc )
|
||||
|
||||
// Tempo stuff
|
||||
automationPattern * tap = _tc->tempoAutomationPattern();
|
||||
tap->clear();
|
||||
Alg_time_map * timeMap = seq->get_time_map();
|
||||
Alg_beats & beats = timeMap->beats;
|
||||
for( int i = 0; i < beats.len - 1; i++ )
|
||||
if( tap )
|
||||
{
|
||||
Alg_beat_ptr b = &(beats[i]);
|
||||
double tempo = ( beats[i + 1].beat - b->beat ) /
|
||||
( beats[i + 1].time - beats[i].time );
|
||||
tap->putValue( b->beat * ticksPerBeat, tempo * 60.0 );
|
||||
}
|
||||
if( timeMap->last_tempo_flag )
|
||||
{
|
||||
Alg_beat_ptr b = &( beats[beats.len - 1] );
|
||||
tap->putValue( b->beat * ticksPerBeat, timeMap->last_tempo * 60.0 );
|
||||
tap->clear();
|
||||
Alg_time_map * timeMap = seq->get_time_map();
|
||||
Alg_beats & beats = timeMap->beats;
|
||||
for( int i = 0; i < beats.len - 1; i++ )
|
||||
{
|
||||
Alg_beat_ptr b = &(beats[i]);
|
||||
double tempo = ( beats[i + 1].beat - b->beat ) /
|
||||
( beats[i + 1].time - beats[i].time );
|
||||
tap->putValue( b->beat * ticksPerBeat, tempo * 60.0 );
|
||||
}
|
||||
if( timeMap->last_tempo_flag )
|
||||
{
|
||||
Alg_beat_ptr b = &( beats[beats.len - 1] );
|
||||
tap->putValue( b->beat * ticksPerBeat, timeMap->last_tempo * 60.0 );
|
||||
}
|
||||
}
|
||||
|
||||
// Song events
|
||||
@@ -416,17 +419,17 @@ bool midiImport::readSMF( trackContainer * _tc )
|
||||
break;
|
||||
|
||||
case 7:
|
||||
objModel = &ch->it->volumeModel();
|
||||
objModel = ch->it->volumeModel();
|
||||
cc *= 100.0f;
|
||||
break;
|
||||
|
||||
case 10:
|
||||
objModel = &ch->it->panningModel();
|
||||
objModel = ch->it->panningModel();
|
||||
cc = cc * 200.f - 100.0f;
|
||||
break;
|
||||
|
||||
case 128:
|
||||
objModel = &ch->it->pitchModel();
|
||||
objModel = ch->it->pitchModel();
|
||||
cc = cc * 100.0f;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,7 @@ void sf2Instrument::freeFont( void )
|
||||
cout << "Really deleting " << m_filename << endl;
|
||||
|
||||
fluid_synth_sfunload( m_synth, m_fontId, TRUE );
|
||||
|
||||
s_fonts.remove( m_filename );
|
||||
delete m_font;
|
||||
}
|
||||
// Just remove our reference
|
||||
|
||||
@@ -72,7 +72,8 @@ oscillatorObject::oscillatorObject( model * _parent, int _idx ) :
|
||||
MaxVolume, 1.0f, this, tr( "Osc %1 volume" ).arg( _idx+1 ) ),
|
||||
m_panModel( DefaultPanning, PanningLeft, PanningRight, 1.0f, this,
|
||||
tr( "Osc %1 panning" ).arg( _idx+1 ) ),
|
||||
m_coarseModel( 0, -2 * KeysPerOctave, 2 * KeysPerOctave, 1.0f, this,
|
||||
m_coarseModel( -_idx*KeysPerOctave,
|
||||
-2 * KeysPerOctave, 2 * KeysPerOctave, 1.0f, this,
|
||||
tr( "Osc %1 coarse detuning" ).arg( _idx+1 ) ),
|
||||
m_fineLeftModel( 0.0f, -100.0f, 100.0f, 1.0f, this,
|
||||
tr( "Osc %1 fine detuning left" ).arg( _idx+1 ) ),
|
||||
|
||||
@@ -222,6 +222,10 @@ bool vestigeInstrument::handleMidiEvent( const midiEvent & _me,
|
||||
void vestigeInstrument::closePlugin( void )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin )
|
||||
{
|
||||
delete m_plugin->pluginWidget();
|
||||
}
|
||||
delete m_plugin;
|
||||
m_plugin = NULL;
|
||||
m_pluginMutex.unlock();
|
||||
|
||||
@@ -72,6 +72,7 @@ enum VstRemoteMessageIDs
|
||||
IdVstPluginVersion,
|
||||
IdVstPluginVendorString,
|
||||
IdVstPluginProductString,
|
||||
IdVstPluginUniqueID,
|
||||
IdVstParameterCount,
|
||||
IdVstParameterDump,
|
||||
IdVstParameterProperties
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -93,11 +93,11 @@ vstPlugin::vstPlugin( const QString & _plugin ) :
|
||||
lock();
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
QWidget * helper = new QWidget;
|
||||
QHBoxLayout * l = new QHBoxLayout( helper );
|
||||
QWidget * target = new QWidget( helper );
|
||||
QHBoxLayout * l = new QHBoxLayout;
|
||||
l->setSpacing( 0 );
|
||||
l->setMargin( 0 );
|
||||
l->addWidget( target );
|
||||
helper->setLayout( l );
|
||||
|
||||
static int k = 0;
|
||||
const QString t = QString( "vst%1%2" ).arg( GetCurrentProcessId()<<10 ).
|
||||
@@ -159,7 +159,6 @@ vstPlugin::vstPlugin( const QString & _plugin ) :
|
||||
|
||||
vstPlugin::~vstPlugin()
|
||||
{
|
||||
delete pluginWidget();
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +195,10 @@ void vstPlugin::showEditor( QWidget * _parent )
|
||||
xe->show();
|
||||
#endif
|
||||
|
||||
m_pluginWidget->show();
|
||||
if( m_pluginWidget )
|
||||
{
|
||||
m_pluginWidget->show();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -331,23 +333,9 @@ bool vstPlugin::processMessage( const message & _m )
|
||||
break;
|
||||
|
||||
case IdVstPluginEditorGeometry:
|
||||
{
|
||||
const int w = _m.getInt( 0 );
|
||||
const int h = _m.getInt( 1 );
|
||||
m_pluginGeometry = QSize( w, h );
|
||||
/* if( m_pluginWidget != NULL )
|
||||
{
|
||||
m_pluginWidget->setFixedSize(
|
||||
m_pluginGeometry );
|
||||
if( m_pluginWidget->childAt( 0, 0 ) != NULL )
|
||||
{
|
||||
m_pluginWidget->childAt( 0, 0
|
||||
)->setFixedSize(
|
||||
m_pluginGeometry );
|
||||
}
|
||||
}*/
|
||||
m_pluginGeometry = QSize( _m.getInt( 0 ),
|
||||
_m.getInt( 1 ) );
|
||||
break;
|
||||
}
|
||||
|
||||
case IdVstPluginName:
|
||||
m_name = _m.getQString();
|
||||
@@ -365,6 +353,11 @@ bool vstPlugin::processMessage( const message & _m )
|
||||
m_productString = _m.getQString();
|
||||
break;
|
||||
|
||||
case IdVstPluginUniqueID:
|
||||
// TODO: display graphically in case of failure
|
||||
printf("unique ID: %s\n", _m.getString().c_str() );
|
||||
break;
|
||||
|
||||
case IdVstParameterDump:
|
||||
{
|
||||
m_parameterDump.clear();
|
||||
|
||||
@@ -74,9 +74,9 @@ public:
|
||||
void setParameterDump( const QMap<QString, QString> & _pdump );
|
||||
|
||||
|
||||
inline QWidget * pluginWidget( void )
|
||||
inline QWidget * pluginWidget( bool _top_widget = true )
|
||||
{
|
||||
if( m_pluginWidget )
|
||||
if( _top_widget && m_pluginWidget )
|
||||
{
|
||||
if( m_pluginWidget->parentWidget() )
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ bool vstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames )
|
||||
{
|
||||
if( !isEnabled() || !isRunning () )
|
||||
{
|
||||
return( FALSE );
|
||||
return false;
|
||||
}
|
||||
|
||||
if( m_plugin )
|
||||
@@ -180,9 +180,9 @@ extern "C"
|
||||
// neccessary for getting instance out of shared lib
|
||||
plugin * lmms_plugin_main( model * _parent, void * _data )
|
||||
{
|
||||
return( new vstEffect( _parent,
|
||||
return new vstEffect( _parent,
|
||||
static_cast<const plugin::descriptor::subPluginFeatures::key *>(
|
||||
_data ) ) );
|
||||
_data ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -35,10 +35,14 @@ vstEffectControlDialog::vstEffectControlDialog( vstEffectControls * _ctl ) :
|
||||
effectControlDialog( _ctl )
|
||||
{
|
||||
QVBoxLayout * l = new QVBoxLayout( this );
|
||||
l->setMargin( 0 );
|
||||
l->setSpacing( 0 );
|
||||
|
||||
_ctl->m_effect->m_plugin->showEditor( this );
|
||||
QWidget * w = _ctl->m_effect->m_plugin->pluginWidget();
|
||||
QWidget * w = _ctl->m_effect->m_plugin->pluginWidget( false );
|
||||
if( w )
|
||||
{
|
||||
setWindowTitle( w->windowTitle() );
|
||||
l->addWidget( w );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,9 @@ automatableModel::automatableModel( DataType _type,
|
||||
m_maxValue( _max ),
|
||||
m_step( _step ),
|
||||
m_range( _max - _min ),
|
||||
m_journalEntryReady( FALSE ),
|
||||
m_journalEntryReady( false ),
|
||||
m_setValueDepth( 0 ),
|
||||
m_hasLinkedModels( false ),
|
||||
m_controllerConnection( NULL )
|
||||
{
|
||||
}
|
||||
@@ -62,7 +64,7 @@ automatableModel::automatableModel( DataType _type,
|
||||
|
||||
automatableModel::~automatableModel()
|
||||
{
|
||||
while( m_linkedModels.empty() == FALSE )
|
||||
while( m_linkedModels.empty() == false )
|
||||
{
|
||||
m_linkedModels.last()->unlinkModel( this );
|
||||
m_linkedModels.erase( m_linkedModels.end() - 1 );
|
||||
@@ -81,7 +83,7 @@ automatableModel::~automatableModel()
|
||||
|
||||
bool automatableModel::isAutomated( void ) const
|
||||
{
|
||||
return( automationPattern::isAutomated( this ) );
|
||||
return automationPattern::isAutomated( this );
|
||||
}
|
||||
|
||||
|
||||
@@ -176,6 +178,7 @@ void automatableModel::loadSettings( const QDomElement & _this,
|
||||
|
||||
void automatableModel::setValue( const float _value )
|
||||
{
|
||||
++m_setValueDepth;
|
||||
const float old_val = m_value;
|
||||
|
||||
m_value = fittedValue( _value );
|
||||
@@ -189,13 +192,13 @@ void automatableModel::setValue( const float _value )
|
||||
m_linkedModels.begin();
|
||||
it != m_linkedModels.end(); ++it )
|
||||
{
|
||||
if( value<float>() != (*it)->value<float>() &&
|
||||
(*it)->fittedValue( value<float>() )
|
||||
!= (*it)->value<float>() )
|
||||
if( (*it)->m_setValueDepth < 1 &&
|
||||
(*it)->fittedValue( _value ) !=
|
||||
(*it)->m_value )
|
||||
{
|
||||
bool journalling = (*it)->testAndSetJournalling(
|
||||
isJournalling() );
|
||||
(*it)->setValue( value<float>() );
|
||||
(*it)->setValue( _value );
|
||||
(*it)->setJournalling( journalling );
|
||||
}
|
||||
}
|
||||
@@ -205,6 +208,7 @@ void automatableModel::setValue( const float _value )
|
||||
{
|
||||
emit dataUnchanged();
|
||||
}
|
||||
--m_setValueDepth;
|
||||
}
|
||||
|
||||
|
||||
@@ -212,6 +216,7 @@ void automatableModel::setValue( const float _value )
|
||||
|
||||
void automatableModel::setAutomatedValue( const float _value )
|
||||
{
|
||||
++m_setValueDepth;
|
||||
const float old_val = m_value;
|
||||
|
||||
m_value = fittedValue( _value );
|
||||
@@ -222,15 +227,16 @@ void automatableModel::setAutomatedValue( const float _value )
|
||||
m_linkedModels.begin();
|
||||
it != m_linkedModels.end(); ++it )
|
||||
{
|
||||
if( value<float>() != (*it)->value<float>() &&
|
||||
(*it)->fittedValue( value<float>() )
|
||||
!= (*it)->value<float>() )
|
||||
if( (*it)->m_setValueDepth < 1 &&
|
||||
!(*it)->fittedValue( m_value ) !=
|
||||
(*it)->m_value )
|
||||
{
|
||||
(*it)->setAutomatedValue( value<float>() );
|
||||
(*it)->setAutomatedValue( m_value );
|
||||
}
|
||||
}
|
||||
emit dataChanged();
|
||||
}
|
||||
--m_setValueDepth;
|
||||
}
|
||||
|
||||
|
||||
@@ -308,7 +314,7 @@ float automatableModel::fittedValue( float _value ) const
|
||||
|
||||
void automatableModel::redoStep( journalEntry & _je )
|
||||
{
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
bool journalling = testAndSetJournalling( false );
|
||||
setValue( value<float>() + (float) _je.data().toDouble() );
|
||||
setJournalling( journalling );
|
||||
}
|
||||
@@ -328,8 +334,8 @@ void automatableModel::undoStep( journalEntry & _je )
|
||||
void automatableModel::prepareJournalEntryFromOldVal( void )
|
||||
{
|
||||
m_oldValue = value<float>();
|
||||
saveJournallingState( FALSE );
|
||||
m_journalEntryReady = TRUE;
|
||||
saveJournallingState( false );
|
||||
m_journalEntryReady = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -345,7 +351,7 @@ void automatableModel::addJournalEntryFromOldToCurVal( void )
|
||||
addJournalEntry( journalEntry( 0, value<float>() -
|
||||
m_oldValue ) );
|
||||
}
|
||||
m_journalEntryReady = FALSE;
|
||||
m_journalEntryReady = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -354,10 +360,15 @@ void automatableModel::addJournalEntryFromOldToCurVal( void )
|
||||
|
||||
void automatableModel::linkModel( automatableModel * _model )
|
||||
{
|
||||
if( qFind( m_linkedModels.begin(), m_linkedModels.end(), _model )
|
||||
== m_linkedModels.end() )
|
||||
if( !m_linkedModels.contains( _model ) )
|
||||
{
|
||||
m_linkedModels.push_back( _model );
|
||||
m_hasLinkedModels = true;
|
||||
if( !_model->m_hasLinkedModels )
|
||||
{
|
||||
QObject::connect( this, SIGNAL( dataChanged() ),
|
||||
_model, SIGNAL( dataChanged() ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -366,13 +377,13 @@ void automatableModel::linkModel( automatableModel * _model )
|
||||
|
||||
void automatableModel::unlinkModel( automatableModel * _model )
|
||||
{
|
||||
if( qFind( m_linkedModels.begin(), m_linkedModels.end(), _model )
|
||||
!= m_linkedModels.end() )
|
||||
autoModelVector::iterator it = qFind( m_linkedModels.begin(),
|
||||
m_linkedModels.end(), _model );
|
||||
if( it != m_linkedModels.end() )
|
||||
{
|
||||
m_linkedModels.erase( qFind( m_linkedModels.begin(),
|
||||
m_linkedModels.end(),
|
||||
_model ) );
|
||||
m_linkedModels.erase( it );
|
||||
}
|
||||
m_hasLinkedModels = !m_linkedModels.isEmpty();
|
||||
}
|
||||
|
||||
|
||||
@@ -410,7 +421,7 @@ void automatableModel::setControllerConnection( controllerConnection * _c )
|
||||
this, SIGNAL( dataChanged() ) );
|
||||
QObject::connect( m_controllerConnection,
|
||||
SIGNAL( destroyed() ),
|
||||
this, SLOT( unlinkControllerConnection() ) );
|
||||
this, SLOT( unlinkControllerConnection() ) );
|
||||
emit dataChanged();
|
||||
}
|
||||
}
|
||||
@@ -419,14 +430,23 @@ void automatableModel::setControllerConnection( controllerConnection * _c )
|
||||
|
||||
float automatableModel::controllerValue( int _frameOffset ) const
|
||||
{
|
||||
const float v = m_minValue +
|
||||
if( m_controllerConnection )
|
||||
{
|
||||
const float v = m_minValue +
|
||||
( m_range * m_controllerConnection->currentValue(
|
||||
_frameOffset ) );
|
||||
if( typeInfo<float>::isEqual( m_step, 1 ) )
|
||||
{
|
||||
return qRound( v );
|
||||
if( typeInfo<float>::isEqual( m_step, 1 ) )
|
||||
{
|
||||
return qRound( v );
|
||||
}
|
||||
return v;
|
||||
}
|
||||
return v;
|
||||
automatableModel * lm = m_linkedModels.first();
|
||||
if( lm->m_controllerConnection )
|
||||
{
|
||||
return lm->controllerValue( _frameOffset );
|
||||
}
|
||||
return lm->m_value;
|
||||
}
|
||||
|
||||
|
||||
@@ -448,7 +468,7 @@ void automatableModel::unlinkControllerConnection( void )
|
||||
void automatableModel::setInitValue( const float _value )
|
||||
{
|
||||
m_initValue = _value;
|
||||
bool journalling = testAndSetJournalling( FALSE );
|
||||
bool journalling = testAndSetJournalling( false );
|
||||
setValue( _value );
|
||||
setJournalling( journalling );
|
||||
emit initValueChanged( _value );
|
||||
|
||||
@@ -30,20 +30,12 @@
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
#include "automation_pattern.h"
|
||||
#include "automation_track.h"
|
||||
#include "automation_pattern_view.h"
|
||||
#include "automation_editor.h"
|
||||
#include "bb_track_container.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "note.h"
|
||||
#include "automation_track.h"
|
||||
#include "project_journal.h"
|
||||
#include "rename_dialog.h"
|
||||
#include "bb_track_container.h"
|
||||
#include "song.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "templates.h"
|
||||
#include "tooltip.h"
|
||||
#include "track_container.h"
|
||||
|
||||
|
||||
|
||||
@@ -161,20 +153,15 @@ midiTime automationPattern::putValue( const midiTime & _time,
|
||||
const float _value,
|
||||
const bool _quant_pos )
|
||||
{
|
||||
midiTime new_time = _quant_pos && engine::getAutomationEditor() ?
|
||||
midiTime newTime = _quant_pos && engine::getAutomationEditor() ?
|
||||
note::quantized( _time,
|
||||
engine::getAutomationEditor()->quantization() ) :
|
||||
_time;
|
||||
|
||||
m_timeMap[new_time] = _value;
|
||||
m_timeMap[newTime] = _value;
|
||||
|
||||
if( new_time != 0 )
|
||||
if( newTime == 0 )
|
||||
{
|
||||
m_hasAutomation = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_hasAutomation = false;
|
||||
for( objectVector::iterator it = m_objects.begin();
|
||||
it != m_objects.end(); )
|
||||
{
|
||||
@@ -190,6 +177,29 @@ midiTime automationPattern::putValue( const midiTime & _time,
|
||||
}
|
||||
}
|
||||
|
||||
// just one automation value?
|
||||
if( m_timeMap.size() == 1 )
|
||||
{
|
||||
m_hasAutomation = m_objects.isEmpty(); // usually false
|
||||
for( objectVector::iterator it = m_objects.begin();
|
||||
it != m_objects.end(); ++it )
|
||||
{
|
||||
// default value differs from current value?
|
||||
if( *it && _value != ( *it )->initValue<float>() )
|
||||
{
|
||||
// then enable automating this object
|
||||
m_hasAutomation = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// in all other cases assume we have automation
|
||||
m_hasAutomation = true;
|
||||
}
|
||||
|
||||
// we need to maximize our length in case we're part of a hidden
|
||||
// automation track as the user can't resize this pattern
|
||||
if( getTrack() && getTrack()->type() == track::HiddenAutomationTrack )
|
||||
{
|
||||
changeLength( length() );
|
||||
@@ -197,7 +207,7 @@ midiTime automationPattern::putValue( const midiTime & _time,
|
||||
|
||||
emit dataChanged();
|
||||
|
||||
return new_time;
|
||||
return newTime;
|
||||
}
|
||||
|
||||
|
||||
@@ -209,15 +219,20 @@ void automationPattern::removeValue( const midiTime & _time )
|
||||
{
|
||||
m_timeMap.remove( _time );
|
||||
|
||||
if( m_timeMap.size() <= 1 )
|
||||
if( m_timeMap.size() == 1 )
|
||||
{
|
||||
const float val = m_timeMap[0];
|
||||
m_hasAutomation = false;
|
||||
for( objectVector::iterator it = m_objects.begin();
|
||||
it != m_objects.end(); )
|
||||
{
|
||||
if( *it )
|
||||
{
|
||||
( *it )->setValue( m_timeMap[0] );
|
||||
( *it )->setValue( val );
|
||||
if( ( *it )->initValue<float>() != val )
|
||||
{
|
||||
m_hasAutomation = true;
|
||||
}
|
||||
++it;
|
||||
}
|
||||
else
|
||||
@@ -272,7 +287,7 @@ void automationPattern::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
for( objectVector::const_iterator it = m_objects.begin();
|
||||
it != m_objects.end(); ++it )
|
||||
{
|
||||
if( *it != NULL )
|
||||
if( *it )
|
||||
{
|
||||
QDomElement element = _doc.createElement( "object" );
|
||||
element.setAttribute( "id", ( *it )->id() );
|
||||
@@ -522,300 +537,5 @@ void automationPattern::objectDestroyed( jo_id_t _id )
|
||||
|
||||
|
||||
|
||||
|
||||
automationPatternView::automationPatternView( automationPattern * _pattern,
|
||||
trackView * _parent ) :
|
||||
trackContentObjectView( _pattern, _parent ),
|
||||
m_pat( _pattern ),
|
||||
m_paintPixmap(),
|
||||
m_needsUpdate( true )
|
||||
{
|
||||
connect( m_pat, SIGNAL( dataChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
|
||||
setFixedHeight( parentWidget()->height() - 2 );
|
||||
setAutoResizeEnabled( false );
|
||||
|
||||
toolTip::add( this, tr( "double-click to open this pattern in "
|
||||
"automation editor" ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
automationPatternView::~automationPatternView()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::update( void )
|
||||
{
|
||||
m_needsUpdate = true;
|
||||
if( fixedTCOs() )
|
||||
{
|
||||
m_pat->changeLength( m_pat->length() );
|
||||
}
|
||||
trackContentObjectView::update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::resetName( void )
|
||||
{
|
||||
m_pat->setName( QString::null );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::changeName( void )
|
||||
{
|
||||
QString s = m_pat->name();
|
||||
renameDialog rename_dlg( s );
|
||||
rename_dlg.exec();
|
||||
m_pat->setName( s );
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::disconnectObject( QAction * _a )
|
||||
{
|
||||
journallingObject * j = engine::getProjectJournal()->
|
||||
getJournallingObject( _a->data().toInt() );
|
||||
if( j && dynamic_cast<automatableModel *>( j ) )
|
||||
{
|
||||
m_pat->m_objects.erase( qFind( m_pat->m_objects.begin(),
|
||||
m_pat->m_objects.end(),
|
||||
dynamic_cast<automatableModel *>( j ) ) );
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::constructContextMenu( QMenu * _cm )
|
||||
{
|
||||
QAction * a = new QAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "Open in Automation editor" ), _cm );
|
||||
_cm->insertAction( _cm->actions()[0], a );
|
||||
connect( a, SIGNAL( triggered( bool ) ),
|
||||
m_pat, SLOT( openInAutomationEditor() ) );
|
||||
_cm->insertSeparator( _cm->actions()[1] );
|
||||
|
||||
_cm->addSeparator();
|
||||
|
||||
_cm->addAction( embed::getIconPixmap( "edit_erase" ),
|
||||
tr( "Clear" ), m_pat, SLOT( clear() ) );
|
||||
_cm->addSeparator();
|
||||
|
||||
_cm->addAction( embed::getIconPixmap( "reload" ), tr( "Reset name" ),
|
||||
this, SLOT( resetName() ) );
|
||||
_cm->addAction( embed::getIconPixmap( "edit_rename" ),
|
||||
tr( "Change name" ),
|
||||
this, SLOT( changeName() ) );
|
||||
if( !m_pat->m_objects.isEmpty() )
|
||||
{
|
||||
_cm->addSeparator();
|
||||
QMenu * m = new QMenu( tr( "%1 Connections" ).
|
||||
arg( m_pat->m_objects.count() ), _cm );
|
||||
for( automationPattern::objectVector::iterator it =
|
||||
m_pat->m_objects.begin();
|
||||
it != m_pat->m_objects.end(); ++it )
|
||||
{
|
||||
if( *it )
|
||||
{
|
||||
a = new QAction( tr( "Disconnect \"%1\"" ).
|
||||
arg( ( *it )->fullDisplayName() ), m );
|
||||
a->setData( ( *it )->id() );
|
||||
m->addAction( a );
|
||||
}
|
||||
}
|
||||
connect( m, SIGNAL( triggered( QAction * ) ),
|
||||
this, SLOT( disconnectObject( QAction * ) ) );
|
||||
_cm->addMenu( m );
|
||||
}
|
||||
|
||||
_cm->addSeparator();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() != Qt::LeftButton )
|
||||
{
|
||||
_me->ignore();
|
||||
return;
|
||||
}
|
||||
m_pat->openInAutomationEditor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::paintEvent( QPaintEvent * )
|
||||
{
|
||||
if( m_needsUpdate == false )
|
||||
{
|
||||
QPainter p( this );
|
||||
p.drawPixmap( 0, 0, m_paintPixmap );
|
||||
return;
|
||||
}
|
||||
|
||||
m_needsUpdate = false;
|
||||
|
||||
if( m_paintPixmap.isNull() == true || m_paintPixmap.size() != size() )
|
||||
{
|
||||
m_paintPixmap = QPixmap( size() );
|
||||
}
|
||||
|
||||
QPainter p( &m_paintPixmap );
|
||||
|
||||
QLinearGradient lingrad( 0, 0, 0, height() );
|
||||
const QColor c = isSelected() ? QColor( 0, 0, 224 ) :
|
||||
QColor( 96, 96, 96 );
|
||||
lingrad.setColorAt( 0, c );
|
||||
lingrad.setColorAt( 0.5, Qt::black );
|
||||
lingrad.setColorAt( 1, c );
|
||||
p.setBrush( lingrad );
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
p.drawRect( QRect( 0, 0, width() - 1, height() - 1 ) );
|
||||
|
||||
const float ppt = fixedTCOs() ?
|
||||
( parentWidget()->width() - 2 * TCO_BORDER_WIDTH )
|
||||
/ (float) m_pat->length().getTact() :
|
||||
pixelsPerTact();
|
||||
|
||||
const int x_base = TCO_BORDER_WIDTH;
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
|
||||
for( tact t = 1; t < m_pat->length().getTact(); ++t )
|
||||
{
|
||||
p.drawLine( x_base + static_cast<int>( ppt * t ) - 1,
|
||||
TCO_BORDER_WIDTH, x_base + static_cast<int>(
|
||||
ppt * t ) - 1, 5 );
|
||||
p.drawLine( x_base + static_cast<int>( ppt * t ) - 1,
|
||||
height() - ( 4 + 2 * TCO_BORDER_WIDTH ),
|
||||
x_base + static_cast<int>( ppt * t ) - 1,
|
||||
height() - 2 * TCO_BORDER_WIDTH );
|
||||
}
|
||||
|
||||
const float min = m_pat->firstObject()->minValue<float>();
|
||||
const float max = m_pat->firstObject()->maxValue<float>();
|
||||
|
||||
const float y_scale = max - min;
|
||||
const float h = ( height()-2*TCO_BORDER_WIDTH ) / y_scale;
|
||||
|
||||
p.translate( 0.0f, max * height() / y_scale-1 );
|
||||
p.scale( 1.0f, -h );
|
||||
|
||||
QLinearGradient lin2grad( 0, min, 0, max );
|
||||
const QColor cl = QColor( 255, 224, 0 );
|
||||
const QColor cd = QColor( 229, 158, 0 );
|
||||
|
||||
lin2grad.setColorAt( 1, cl );
|
||||
lin2grad.setColorAt( 0, cd );
|
||||
|
||||
for( automationPattern::timeMap::const_iterator it =
|
||||
m_pat->getTimeMap().begin();
|
||||
it != m_pat->getTimeMap().end(); ++it )
|
||||
{
|
||||
const float x1 = 2 * x_base + it.key() * ppt /
|
||||
midiTime::ticksPerTact();
|
||||
float x2;
|
||||
if( it+1 != m_pat->getTimeMap().end() )
|
||||
{
|
||||
x2 = (it+1).key() * ppt / midiTime::ticksPerTact() + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
x2 = (float)( width() - TCO_BORDER_WIDTH );
|
||||
}
|
||||
p.fillRect( QRectF( x1, 0.0f, x2-x1, it.value() ),
|
||||
lin2grad );
|
||||
}
|
||||
|
||||
p.resetMatrix();
|
||||
p.setFont( pointSize<7>( p.font() ) );
|
||||
if( m_pat->isMuted() || m_pat->getTrack()->isMuted() )
|
||||
{
|
||||
p.setPen( QColor( 192, 192, 192 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
p.setPen( QColor( 0, 64, 255 ) );
|
||||
}
|
||||
|
||||
p.drawText( 2, p.fontMetrics().height() - 1, m_pat->name() );
|
||||
|
||||
if( m_pat->isMuted() )
|
||||
{
|
||||
p.drawPixmap( 3, p.fontMetrics().height() + 1,
|
||||
embed::getIconPixmap( "muted", 16, 16 ) );
|
||||
}
|
||||
|
||||
p.end();
|
||||
|
||||
p.begin( this );
|
||||
p.drawPixmap( 0, 0, m_paintPixmap );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
{
|
||||
stringPairDrag::processDragEnterEvent( _dee, "automatable_model" );
|
||||
if( !_dee->isAccepted() )
|
||||
{
|
||||
trackContentObjectView::dragEnterEvent( _dee );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::dropEvent( QDropEvent * _de )
|
||||
{
|
||||
QString type = stringPairDrag::decodeKey( _de );
|
||||
QString val = stringPairDrag::decodeValue( _de );
|
||||
if( type == "automatable_model" )
|
||||
{
|
||||
automatableModel * mod = dynamic_cast<automatableModel *>(
|
||||
engine::getProjectJournal()->
|
||||
getJournallingObject( val.toInt() ) );
|
||||
if( mod != NULL )
|
||||
{
|
||||
m_pat->addObject( mod );
|
||||
}
|
||||
update();
|
||||
|
||||
if( engine::getAutomationEditor() &&
|
||||
engine::getAutomationEditor()->currentPattern() ==
|
||||
m_pat )
|
||||
{
|
||||
engine::getAutomationEditor()->setCurrentPattern(
|
||||
m_pat );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
trackContentObjectView::dropEvent( _de );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#include "moc_automation_pattern.cxx"
|
||||
|
||||
|
||||
@@ -314,9 +314,13 @@ void configManager::loadConfigFile( void )
|
||||
}
|
||||
|
||||
#ifdef LMMS_HAVE_STK
|
||||
if( m_stkDir == "" )
|
||||
if( m_stkDir == "" || m_stkDir == QDir::separator() )
|
||||
{
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
m_stkDir = m_dataDir + "stk/rawwaves/";
|
||||
#else
|
||||
m_stkDir = "/usr/share/stk/rawwaves/";
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -75,10 +75,10 @@ effect::~effect()
|
||||
|
||||
void effect::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "on", m_enabledModel.value() );
|
||||
_this.setAttribute( "wet", m_wetDryModel.value() );
|
||||
_this.setAttribute( "autoquit", m_autoQuitModel.value() );
|
||||
_this.setAttribute( "gate", m_gateModel.value() );
|
||||
m_enabledModel.saveSettings( _doc, _this, "on" );
|
||||
m_wetDryModel.saveSettings( _doc, _this, "wet" );
|
||||
m_autoQuitModel.saveSettings( _doc, _this, "autoquit" );
|
||||
m_gateModel.saveSettings( _doc, _this, "gate" );
|
||||
getControls()->saveState( _doc, _this );
|
||||
}
|
||||
|
||||
@@ -87,10 +87,10 @@ void effect::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
void effect::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
m_enabledModel.setValue( (float) _this.attribute( "on" ).toInt() );
|
||||
m_wetDryModel.setValue( _this.attribute( "wet" ).toFloat() );
|
||||
m_autoQuitModel.setValue( _this.attribute( "autoquit" ).toFloat() );
|
||||
m_gateModel.setValue( _this.attribute( "gate" ).toFloat() );
|
||||
m_enabledModel.loadSettings( _this, "on" );
|
||||
m_wetDryModel.loadSettings( _this, "wet" );
|
||||
m_autoQuitModel.loadSettings( _this, "autoquit" );
|
||||
m_gateModel.loadSettings( _this, "gate" );
|
||||
|
||||
QDomNode node = _this.firstChild();
|
||||
while( !node.isNull() )
|
||||
|
||||
@@ -113,43 +113,27 @@ chordCreator::chord chordCreator::s_chordTable[] =
|
||||
{ chordCreator::tr( "m-Maj13" ), { 0, 3, 7, 11, 14, 21, -1 } },
|
||||
|
||||
{ chordCreator::tr( "Major" ), { 0, 2, 4, 5, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Harmonic minor" ), { 0, 2, 3, 5, 7, 8,
|
||||
11, -1 } },
|
||||
{ chordCreator::tr( "Melodic minor" ), { 0, 2, 3, 5, 7, 9,
|
||||
11, -1 } },
|
||||
{ chordCreator::tr( "Whole tone" ), { 0, 2, 4, 6, 8, 10,
|
||||
-1 } },
|
||||
{ chordCreator::tr( "Diminished" ), { 0, 2, 3, 5, 6, 8, 9,
|
||||
11, -1 } },
|
||||
{ chordCreator::tr( "Major pentatonic" ), { 0, 2, 4, 7, 10,
|
||||
-1 } },
|
||||
{ chordCreator::tr( "Minor pentatonic" ), { 0, 3, 5, 7, 10,
|
||||
-1 } },
|
||||
{ chordCreator::tr( "Harmonic minor" ), { 0, 2, 3, 5, 7, 8, 11, -1 } },
|
||||
{ chordCreator::tr( "Melodic minor" ), { 0, 2, 3, 5, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Whole tone" ), { 0, 2, 4, 6, 8, 10, -1 } },
|
||||
{ chordCreator::tr( "Diminished" ), { 0, 2, 3, 5, 6, 8, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Major pentatonic" ), { 0, 2, 4, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "Minor pentatonic" ), { 0, 3, 5, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "Jap in sen" ), { 0, 1, 5, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "Major bebop" ), { 0, 2, 4, 5, 7, 8, 9,
|
||||
11, -1 } },
|
||||
{ chordCreator::tr( "Dominant bebop" ), { 0, 2, 4, 5, 7, 9,
|
||||
10, 11, -1 } },
|
||||
{ chordCreator::tr( "Major bebop" ), { 0, 2, 4, 5, 7, 8, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Dominant bebop" ), { 0, 2, 4, 5, 7, 9, 10, 11, -1 } },
|
||||
{ chordCreator::tr( "Blues" ), { 0, 3, 5, 6, 7, 10, -1 } },
|
||||
{ chordCreator::tr( "Arabic" ), { 0, 1, 4, 5, 7, 8, 11, -1 } },
|
||||
{ chordCreator::tr( "Enigmatic" ), { 0, 1, 4, 6, 8, 10, 11,
|
||||
-1 } },
|
||||
{ chordCreator::tr( "Neopolitan" ), { 0, 1, 3, 5, 7, 9, 11,
|
||||
-1 } },
|
||||
{ chordCreator::tr( "Neopolitan minor" ), { 0, 1, 3, 5, 7, 9,
|
||||
11, -1 } },
|
||||
{ chordCreator::tr( "Hungarian minor" ), { 0, 2, 3, 6, 7, 9,
|
||||
11, -1 } },
|
||||
{ chordCreator::tr( "Enigmatic" ), { 0, 1, 4, 6, 8, 10, 11, -1 } },
|
||||
{ chordCreator::tr( "Neopolitan" ), { 0, 1, 3, 5, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Neopolitan minor" ), { 0, 1, 3, 5, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Hungarian minor" ), { 0, 2, 3, 6, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Dorian" ), { 0, 2, 3, 5, 7, 9, 10, -1 } },
|
||||
{ chordCreator::tr( "Phrygolydian" ), { 0, 1, 3, 5, 7, 8, 10,
|
||||
-1 } },
|
||||
{ chordCreator::tr( "Phrygolydian" ), { 0, 1, 3, 5, 7, 8, 10, -1 } },
|
||||
{ chordCreator::tr( "Lydian" ), { 0, 2, 4, 6, 7, 9, 11, -1 } },
|
||||
{ chordCreator::tr( "Mixolydian" ), { 0, 2, 4, 5, 7, 9, 10,
|
||||
-1 } },
|
||||
{ chordCreator::tr( "Aeolian" ), { 0, 2, 3, 5, 7, 8, 10,
|
||||
-1 } },
|
||||
{ chordCreator::tr( "Locrian" ), { 0, 1, 3, 5, 6, 8, 10,
|
||||
-1 } },
|
||||
{ chordCreator::tr( "Mixolydian" ), { 0, 2, 4, 5, 7, 9, 10, -1 } },
|
||||
{ chordCreator::tr( "Aeolian" ), { 0, 2, 3, 5, 7, 8, 10, -1 } },
|
||||
{ chordCreator::tr( "Locrian" ), { 0, 1, 3, 5, 6, 8, 10, -1 } },
|
||||
|
||||
{ "", { -1, -1 } }
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@
|
||||
#include "config_mgr.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "import_filter.h"
|
||||
#include "lmms_style.h"
|
||||
#include "main_window.h"
|
||||
#include "project_renderer.h"
|
||||
@@ -84,7 +85,9 @@ int main( int argc, char * * argv )
|
||||
// intialize RNG
|
||||
srand( getpid() + time( 0 ) );
|
||||
|
||||
bool core_only = FALSE;
|
||||
bool core_only = false;
|
||||
bool exit_after_import = false;
|
||||
QString file_to_load, file_to_save, file_to_import, render_out;
|
||||
|
||||
for( int i = 1; i < argc; ++i )
|
||||
{
|
||||
@@ -93,7 +96,7 @@ int main( int argc, char * * argv )
|
||||
( QString( argv[i] ) == "--help" ||
|
||||
QString( argv[i] ) == "-h" ) ) )
|
||||
{
|
||||
core_only = TRUE;
|
||||
core_only = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -102,10 +105,9 @@ int main( int argc, char * * argv )
|
||||
new QCoreApplication( argc, argv ) :
|
||||
new QApplication( argc, argv ) ;
|
||||
|
||||
QString file_to_load, file_to_save, render_out;
|
||||
|
||||
mixer::qualitySettings qs( mixer::qualitySettings::Mode_HighQuality );
|
||||
projectRenderer::outputSettings os( 44100, FALSE, 160,
|
||||
projectRenderer::outputSettings os( 44100, false, 160,
|
||||
projectRenderer::Depth_16Bit );
|
||||
projectRenderer::ExportFileFormats eff = projectRenderer::WaveFile;
|
||||
|
||||
@@ -300,6 +302,17 @@ int main( int argc, char * * argv )
|
||||
}
|
||||
++i;
|
||||
}
|
||||
else if( argc > i &&
|
||||
( QString( argv[i] ) == "--import" ) )
|
||||
{
|
||||
file_to_import = argv[i+1];
|
||||
++i;
|
||||
// exit after import? (only for debugging)
|
||||
if( argc > i && QString( argv[i+1] ) == "-e" )
|
||||
{
|
||||
exit_after_import = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( argv[i][0] == '-' )
|
||||
@@ -390,11 +403,21 @@ int main( int argc, char * * argv )
|
||||
srand( getpid() + time( 0 ) );
|
||||
|
||||
// we try to load given file
|
||||
if( file_to_load != "" )
|
||||
if( !file_to_load.isEmpty() )
|
||||
{
|
||||
engine::getMainWindow()->showMaximized();
|
||||
engine::getSong()->loadProject( file_to_load );
|
||||
}
|
||||
else if( !file_to_import.isEmpty() )
|
||||
{
|
||||
importFilter::import( file_to_import,
|
||||
engine::getSong() );
|
||||
if( exit_after_import )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
engine::getMainWindow()->showMaximized();
|
||||
}
|
||||
else
|
||||
{
|
||||
engine::getSong()->createNewProject();
|
||||
@@ -404,7 +427,7 @@ int main( int argc, char * * argv )
|
||||
else
|
||||
{
|
||||
// we're going to render our song
|
||||
engine::init( FALSE );
|
||||
engine::init( false );
|
||||
printf( "loading project...\n" );
|
||||
engine::getSong()->loadProject( file_to_load );
|
||||
printf( "done\n" );
|
||||
|
||||
@@ -40,6 +40,11 @@
|
||||
note::note( const midiTime & _length, const midiTime & _pos,
|
||||
int _key, volume _volume, panning _panning,
|
||||
detuningHelper * _detuning ) :
|
||||
m_selected( false ),
|
||||
m_oldKey( tLimit( _key, 0, NumKeys ) ),
|
||||
m_oldPos( _pos ),
|
||||
m_oldLength( _length ),
|
||||
m_isPlaying( false ),
|
||||
m_key( tLimit( _key, 0, NumKeys ) ),
|
||||
m_volume( tLimit( _volume, MinVolume, MaxVolume ) ),
|
||||
m_panning( tLimit( _panning, PanningLeft, PanningRight ) ),
|
||||
@@ -48,7 +53,6 @@ note::note( const midiTime & _length, const midiTime & _pos,
|
||||
{
|
||||
//saveJournallingState( FALSE );
|
||||
// setJournalling( FALSE );
|
||||
|
||||
if( _detuning )
|
||||
{
|
||||
m_detuning = sharedObject::ref( _detuning );
|
||||
@@ -65,6 +69,11 @@ note::note( const midiTime & _length, const midiTime & _pos,
|
||||
|
||||
note::note( const note & _note ) :
|
||||
serializingObject( _note ),
|
||||
m_selected( _note.m_selected ),
|
||||
m_oldKey( _note.m_oldKey ),
|
||||
m_oldPos( _note.m_oldPos ),
|
||||
m_oldLength( _note.m_oldLength ),
|
||||
m_isPlaying( _note.m_isPlaying ),
|
||||
m_key( _note.m_key),
|
||||
m_volume( _note.m_volume ),
|
||||
m_panning( _note.m_panning ),
|
||||
|
||||
@@ -208,6 +208,7 @@ pianoView::pianoView( QWidget * _parent ) :
|
||||
"black_key_pressed" ) );
|
||||
}
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
|
||||
m_pianoScroll = new QScrollBar( Qt::Horizontal, this );
|
||||
@@ -505,7 +506,7 @@ void pianoView::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else
|
||||
{
|
||||
if( engine::getMainWindow()->isCtrlPressed() )
|
||||
if( _me->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
new stringPairDrag( "automatable_model",
|
||||
QString::number( m_piano->
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
* project_version.cpp - compare versions in import upgrades
|
||||
*
|
||||
* Copyright (c) 2007 Javier Serrano Polo <jasp00/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -42,7 +43,7 @@ int projectVersion::compare( const projectVersion & _v1,
|
||||
n2 = _v2.section( '.', 0, 0 ).toInt();
|
||||
if( n1 != n2 )
|
||||
{
|
||||
return( n1 - n2 );
|
||||
return n1 - n2;
|
||||
}
|
||||
|
||||
// Minor
|
||||
@@ -50,7 +51,7 @@ int projectVersion::compare( const projectVersion & _v1,
|
||||
n2 = _v2.section( '.', 1, 1 ).toInt();
|
||||
if( n1 != n2 )
|
||||
{
|
||||
return( n1 - n2 );
|
||||
return n1 - n2;
|
||||
}
|
||||
|
||||
// Release
|
||||
@@ -58,12 +59,24 @@ int projectVersion::compare( const projectVersion & _v1,
|
||||
n2 = _v2.section( '.', 2 ).section( '-', 0, 0 ).toInt();
|
||||
if( n1 != n2 )
|
||||
{
|
||||
return( n1 - n2 );
|
||||
return n1 - n2;
|
||||
}
|
||||
|
||||
// Build
|
||||
return( QString::compare( _v1.section( '.', 2 ).section( '-', 1 ),
|
||||
_v2.section( '.', 2 ).section( '-', 1 ) ) );
|
||||
const QString b1 = _v1.section( '.', 2 ).section( '-', 1 );
|
||||
const QString b2 = _v2.section( '.', 2 ).section( '-', 1 );
|
||||
|
||||
// make sure 0.x.y > 0.x.y-patch
|
||||
if( b1.isEmpty() )
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
if( b2.isEmpty() )
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
return QString::compare( b1, b2 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -355,6 +355,11 @@ bool remotePlugin::processMessage( const message & _m )
|
||||
resizeSharedProcessingMemory();
|
||||
break;
|
||||
|
||||
case IdDebugMessage:
|
||||
fprintf( stderr, "RemotePlugin::DebugMessage: %s",
|
||||
_m.getString( 0 ).c_str() );
|
||||
break;
|
||||
|
||||
case IdProcessingDone:
|
||||
case IdQuit:
|
||||
default:
|
||||
|
||||
@@ -85,6 +85,7 @@ timeLine::timeLine( const int _xoff, const int _yoff, const float _ppt,
|
||||
"loop_point" ) );
|
||||
}
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
move( 0, _yoff );
|
||||
setFixedHeight( s_timeLinePixmap->height() );
|
||||
|
||||
@@ -333,7 +334,7 @@ void timeLine::mouseMoveEvent( QMouseEvent * _me )
|
||||
case MoveLoopEnd:
|
||||
{
|
||||
const Uint8 i = m_action - MoveLoopBegin;
|
||||
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
|
||||
if( _me->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
// no ctrl-press-hint when having ctrl pressed
|
||||
delete m_hint;
|
||||
|
||||
@@ -112,16 +112,16 @@ trackContentObject::trackContentObject( track * _track ) :
|
||||
m_name( QString::null ),
|
||||
m_startPosition(),
|
||||
m_length(),
|
||||
m_mutedModel( FALSE, this, tr( "Muted" ) )
|
||||
m_mutedModel( false, this, tr( "Muted" ) )
|
||||
{
|
||||
if( getTrack() )
|
||||
{
|
||||
getTrack()->addTCO( this );
|
||||
}
|
||||
setJournalling( FALSE );
|
||||
setJournalling( false );
|
||||
movePosition( 0 );
|
||||
changeLength( 0 );
|
||||
setJournalling( TRUE );
|
||||
setJournalling( true );
|
||||
}
|
||||
|
||||
|
||||
@@ -197,7 +197,7 @@ void trackContentObject::changeLength( const midiTime & _length )
|
||||
*/
|
||||
void trackContentObject::undoStep( journalEntry & _je )
|
||||
{
|
||||
saveJournallingState( FALSE );
|
||||
saveJournallingState( false );
|
||||
switch( _je.actionID() )
|
||||
{
|
||||
case Move:
|
||||
@@ -295,7 +295,7 @@ trackContentObjectView::trackContentObjectView( trackContentObject * _tco,
|
||||
m_tco( _tco ),
|
||||
m_trackView( _tv ),
|
||||
m_action( NoAction ),
|
||||
m_autoResize( FALSE ),
|
||||
m_autoResize( false ),
|
||||
m_initialMouseX( 0 ),
|
||||
m_hint( NULL )
|
||||
{
|
||||
@@ -305,15 +305,16 @@ trackContentObjectView::trackContentObjectView( trackContentObject * _tco,
|
||||
s_textFloat->setPixmap( embed::getIconPixmap( "clock" ) );
|
||||
}
|
||||
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setAttribute( Qt::WA_DeleteOnClose, true );
|
||||
setFocusPolicy( Qt::StrongFocus );
|
||||
setCursor( QCursor( embed::getIconPixmap( "hand" ), 0, 0 ) );
|
||||
move( 0, 1 );
|
||||
show();
|
||||
|
||||
setFixedHeight( _tv->getTrackContentWidget()->height() - 2 );
|
||||
setAcceptDrops( TRUE );
|
||||
setMouseTracking( TRUE );
|
||||
setAcceptDrops( true );
|
||||
setMouseTracking( true );
|
||||
|
||||
connect( m_tco, SIGNAL( lengthChanged() ),
|
||||
this, SLOT( updateLength() ) );
|
||||
@@ -486,7 +487,7 @@ void trackContentObjectView::dropEvent( QDropEvent * _de )
|
||||
{
|
||||
// value contains our XML-data so simply create a
|
||||
// multimediaProject which does the rest for us...
|
||||
multimediaProject mmp( value, FALSE );
|
||||
multimediaProject mmp( value, false );
|
||||
// at least save position before getting to moved to somewhere
|
||||
// the user doesn't expect...
|
||||
midiTime pos = m_tco->startPosition();
|
||||
@@ -536,17 +537,17 @@ void trackContentObjectView::leaveEvent( QEvent * _e )
|
||||
*/
|
||||
void trackContentObjectView::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_trackView->getTrackContainerView()->allowRubberband() == TRUE &&
|
||||
if( m_trackView->getTrackContainerView()->allowRubberband() == true &&
|
||||
_me->button() == Qt::LeftButton )
|
||||
{
|
||||
// if rubberband is active, we can be selected
|
||||
if( !m_trackView->getTrackContainerView()->rubberBandActive() )
|
||||
{
|
||||
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
|
||||
if( _me->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
setSelected( !isSelected() );
|
||||
}
|
||||
else if( isSelected() == TRUE )
|
||||
else if( isSelected() == true )
|
||||
{
|
||||
m_action = MoveSelection;
|
||||
m_initialMouseX = _me->x();
|
||||
@@ -558,13 +559,13 @@ void trackContentObjectView::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
return;
|
||||
}
|
||||
else if( engine::getMainWindow()->isShiftPressed() == TRUE )
|
||||
else if( _me->modifiers() & Qt::ShiftModifier )
|
||||
{
|
||||
// add/remove object to/from selection
|
||||
selectableObject::mousePressEvent( _me );
|
||||
}
|
||||
else if( _me->button() == Qt::LeftButton &&
|
||||
engine::getMainWindow()->isCtrlPressed() == TRUE )
|
||||
_me->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
// start drag-action
|
||||
multimediaProject mmp( multimediaProject::DragNDropData );
|
||||
@@ -578,11 +579,11 @@ void trackContentObjectView::mousePressEvent( QMouseEvent * _me )
|
||||
mmp.toString(), thumbnail, this );
|
||||
}
|
||||
else if( _me->button() == Qt::LeftButton &&
|
||||
/* engine::getMainWindow()->isShiftPressed() == FALSE &&*/
|
||||
fixedTCOs() == FALSE )
|
||||
/* engine::getMainWindow()->isShiftPressed() == false &&*/
|
||||
fixedTCOs() == false )
|
||||
{
|
||||
// move or resize
|
||||
m_tco->setJournalling( FALSE );
|
||||
m_tco->setJournalling( false );
|
||||
|
||||
m_initialMouseX = _me->x();
|
||||
|
||||
@@ -599,7 +600,7 @@ void trackContentObjectView::mousePressEvent( QMouseEvent * _me )
|
||||
"a copy." ),
|
||||
embed::getIconPixmap( "hint" ), 0 );
|
||||
}
|
||||
else if( m_autoResize == FALSE )
|
||||
else if( m_autoResize == false )
|
||||
{
|
||||
m_action = Resize;
|
||||
m_oldTime = m_tco->length();
|
||||
@@ -619,11 +620,11 @@ void trackContentObjectView::mousePressEvent( QMouseEvent * _me )
|
||||
}
|
||||
else if( _me->button() == Qt::MidButton )
|
||||
{
|
||||
if( engine::getMainWindow()->isCtrlPressed() )
|
||||
if( _me->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
m_tco->toggleMute();
|
||||
}
|
||||
else if( fixedTCOs() == FALSE )
|
||||
else if( fixedTCOs() == false )
|
||||
{
|
||||
remove();
|
||||
}
|
||||
@@ -648,7 +649,7 @@ void trackContentObjectView::mousePressEvent( QMouseEvent * _me )
|
||||
*/
|
||||
void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
|
||||
if( _me->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
delete m_hint;
|
||||
m_hint = NULL;
|
||||
@@ -662,8 +663,8 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me )
|
||||
m_trackView->getTrackContainerView()->currentPosition()+
|
||||
static_cast<int>( x * midiTime::ticksPerTact() /
|
||||
ppt ) );
|
||||
if( engine::getMainWindow()->isCtrlPressed() ==
|
||||
FALSE && _me->button() == Qt::NoButton )
|
||||
if( ! ( _me->modifiers() & Qt::ControlModifier )
|
||||
&& _me->button() == Qt::NoButton )
|
||||
{
|
||||
t = t.toNearestTact();
|
||||
}
|
||||
@@ -715,8 +716,8 @@ void trackContentObjectView::mouseMoveEvent( QMouseEvent * _me )
|
||||
midiTime t = qMax( midiTime::ticksPerTact(),
|
||||
static_cast<int>( _me->x() *
|
||||
midiTime::ticksPerTact() / ppt ) );
|
||||
if( engine::getMainWindow()->isCtrlPressed() ==
|
||||
FALSE && _me->button() == Qt::NoButton )
|
||||
if( ! ( _me->modifiers() & Qt::ControlModifier )
|
||||
&& _me->button() == Qt::NoButton )
|
||||
{
|
||||
t = t.toNearestTact();
|
||||
}
|
||||
@@ -771,7 +772,7 @@ void trackContentObjectView::mouseReleaseEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_action == Move || m_action == Resize )
|
||||
{
|
||||
m_tco->setJournalling( TRUE );
|
||||
m_tco->setJournalling( true );
|
||||
m_tco->addJournalEntry( journalEntry( m_action, m_oldTime -
|
||||
( ( m_action == Move ) ?
|
||||
m_tco->startPosition() : m_tco->length() ) ) );
|
||||
@@ -797,7 +798,7 @@ void trackContentObjectView::mouseReleaseEvent( QMouseEvent * _me )
|
||||
void trackContentObjectView::contextMenuEvent( QContextMenuEvent * _cme )
|
||||
{
|
||||
QMenu contextMenu( this );
|
||||
if( fixedTCOs() == FALSE )
|
||||
if( fixedTCOs() == false )
|
||||
{
|
||||
contextMenu.addAction( embed::getIconPixmap( "cancel" ),
|
||||
tr( "Delete (middle mousebutton)" ),
|
||||
@@ -863,14 +864,14 @@ trackContentWidget::trackContentWidget( trackView * _parent ) :
|
||||
QWidget( _parent ),
|
||||
m_trackView( _parent )
|
||||
{
|
||||
setAcceptDrops( TRUE );
|
||||
setAcceptDrops( true );
|
||||
|
||||
connect( _parent->getTrackContainerView(),
|
||||
SIGNAL( positionChanged( const midiTime & ) ),
|
||||
this, SLOT( changePosition( const midiTime & ) ) );
|
||||
|
||||
setAutoFillBackground( false );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
}
|
||||
|
||||
|
||||
@@ -903,7 +904,7 @@ void trackContentWidget::addTCOView( trackContentObjectView * _tcov )
|
||||
|
||||
m_tcoViews.push_back( _tcov );
|
||||
|
||||
tco->saveJournallingState( FALSE );
|
||||
tco->saveJournallingState( false );
|
||||
changePosition();
|
||||
tco->restoreJournallingState();
|
||||
|
||||
@@ -1070,7 +1071,7 @@ void trackContentWidget::dropEvent( QDropEvent * _de )
|
||||
QString type = stringPairDrag::decodeKey( _de );
|
||||
QString value = stringPairDrag::decodeValue( _de );
|
||||
if( type == ( "tco_" + QString::number( getTrack()->type() ) ) &&
|
||||
m_trackView->getTrackContainerView()->fixedTCOs() == FALSE )
|
||||
m_trackView->getTrackContainerView()->fixedTCOs() == false )
|
||||
{
|
||||
const midiTime pos = getPosition( _de->pos().x()
|
||||
).toNearestTact();
|
||||
@@ -1078,7 +1079,7 @@ void trackContentWidget::dropEvent( QDropEvent * _de )
|
||||
|
||||
// value contains our XML-data so simply create a
|
||||
// multimediaProject which does the rest for us...
|
||||
multimediaProject mmp( value, FALSE );
|
||||
multimediaProject mmp( value, false );
|
||||
// at least save position before getting moved to somewhere
|
||||
// the user doesn't expect...
|
||||
tco->restoreState( mmp.content().firstChild().toElement() );
|
||||
@@ -1101,11 +1102,11 @@ void trackContentWidget::dropEvent( QDropEvent * _de )
|
||||
*/
|
||||
void trackContentWidget::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_trackView->getTrackContainerView()->allowRubberband() == TRUE )
|
||||
if( m_trackView->getTrackContainerView()->allowRubberband() == true )
|
||||
{
|
||||
QWidget::mousePressEvent( _me );
|
||||
}
|
||||
else if( engine::getMainWindow()->isShiftPressed() == TRUE )
|
||||
else if( _me->modifiers() & Qt::ShiftModifier )
|
||||
{
|
||||
QWidget::mousePressEvent( _me );
|
||||
}
|
||||
@@ -1116,7 +1117,7 @@ void trackContentWidget::mousePressEvent( QMouseEvent * _me )
|
||||
midiTime::ticksPerTact();
|
||||
trackContentObject * tco = getTrack()->createTCO( pos );
|
||||
|
||||
tco->saveJournallingState( FALSE );
|
||||
tco->saveJournallingState( false );
|
||||
tco->movePosition( pos );
|
||||
tco->restoreJournallingState();
|
||||
|
||||
@@ -1132,76 +1133,16 @@ void trackContentWidget::mousePressEvent( QMouseEvent * _me )
|
||||
*/
|
||||
void trackContentWidget::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
static QPixmap backgrnd;
|
||||
static int last_geometry = 0;
|
||||
|
||||
QPainter p( this );
|
||||
const int tactsPerBar = 4;
|
||||
const trackContainerView * tcv = m_trackView->getTrackContainerView();
|
||||
|
||||
// Assume even-pixels-per-tact. Makes sense, should be like this anyways
|
||||
const trackContainerView * tcv = m_trackView->getTrackContainerView();
|
||||
int ppt = static_cast<int>( tcv->pixelsPerTact() );
|
||||
|
||||
// Update background if needed
|
||||
if( ppt*height() != last_geometry )
|
||||
{
|
||||
int w = ppt * tactsPerBar;
|
||||
int h = height();
|
||||
backgrnd = QPixmap( w * 2, height() );
|
||||
QPainter pmp( &backgrnd );
|
||||
//pmp.setRenderHint( QPainter::Antialiasing );
|
||||
|
||||
QLinearGradient grad( 0, 1, 0, h-2 );
|
||||
pmp.fillRect( 0, 0, 1, h, QColor( 96, 96, 96 ) );
|
||||
pmp.fillRect( 1, 0, w+1, h, QColor( 128, 128, 128 ) );
|
||||
grad.setColorAt( 0.0, QColor( 64, 64, 64 ) );
|
||||
grad.setColorAt( 0.3, QColor( 128, 128, 128 ) );
|
||||
grad.setColorAt( 0.5, QColor( 128, 128, 128 ) );
|
||||
grad.setColorAt( 0.95, QColor( 160, 160, 160 ) );
|
||||
//grad.setColorAt( 1.0, QColor( 128, 128, 128 ) );
|
||||
//grad.setColorAt( 1.0, QColor( 64, 64, 64) );
|
||||
pmp.fillRect( 0, 1, w, h-2, grad );
|
||||
|
||||
QLinearGradient grad2( 0,1, 0, h-2 );
|
||||
pmp.fillRect( w+1, 0, w , h, QColor( 96, 96, 96 ) );
|
||||
grad2.setColorAt( 0.0, QColor( 48, 48, 48 ) );
|
||||
grad2.setColorAt( 0.3, QColor( 96, 96, 96 ) );
|
||||
grad2.setColorAt( 0.5, QColor( 96, 96, 96 ) );
|
||||
grad2.setColorAt( 0.95, QColor( 120, 120, 120 ) );
|
||||
//grad2.setColorAt( 1.0, QColor( 96, 96, 96 ) );
|
||||
//grad2.setColorAt( 1.0, QColor( 48, 48, 48 ) );
|
||||
pmp.fillRect( w, 1, w , h-2, grad2 );
|
||||
|
||||
// draw vertical lines
|
||||
//pmp.setPen( QPen( QBrush( QColor( 80, 84, 96, 192 ) ), 1 ) );
|
||||
pmp.setPen( QPen( QColor( 0, 0, 0, 112 ), 1 ) );
|
||||
for( float x = 0.5; x < w * 2; x += ppt )
|
||||
{
|
||||
pmp.drawLine( QLineF( x, 1.0, x, h-2.0 ) );
|
||||
}
|
||||
//pmp.setPen( QPen( QColor( 255,0,0, 128 ), 1 ) );
|
||||
pmp.drawLine( 0, 1, w*2, 1 );
|
||||
|
||||
pmp.setPen( QPen( QColor( 255, 255, 255, 32 ), 1 ) );
|
||||
for( float x = 1.5; x < w * 2; x += ppt )
|
||||
{
|
||||
pmp.drawLine( QLineF( x, 1.0, x, h-2.0 ) );
|
||||
}
|
||||
//pmp.setPen( QPen( QColor( 0,255,0, 128 ), 1 ) );
|
||||
pmp.drawLine( 0, h-2, w*2, h-2 );
|
||||
|
||||
pmp.end();
|
||||
|
||||
last_geometry = ppt*h;
|
||||
}
|
||||
|
||||
QPainter p( this );
|
||||
// Don't draw background on BB-Editor
|
||||
if( m_trackView->getTrackContainerView() != engine::getBBEditor() )
|
||||
{
|
||||
p.drawTiledPixmap( rect(), backgrnd, QPoint(
|
||||
p.drawTiledPixmap( rect(), m_background, QPoint(
|
||||
tcv->currentPosition().getTact() * ppt, 0 ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1213,6 +1154,53 @@ void trackContentWidget::paintEvent( QPaintEvent * _pe )
|
||||
*/
|
||||
void trackContentWidget::resizeEvent( QResizeEvent * _re )
|
||||
{
|
||||
// Update backgroud
|
||||
const int tactsPerBar = 4;
|
||||
const trackContainerView * tcv = m_trackView->getTrackContainerView();
|
||||
|
||||
// Assume even-pixels-per-tact. Makes sense, should be like this anyways
|
||||
int ppt = static_cast<int>( tcv->pixelsPerTact() );
|
||||
|
||||
int w = ppt * tactsPerBar;
|
||||
int h = height();
|
||||
m_background = QPixmap( w * 2, height() );
|
||||
QPainter pmp( &m_background );
|
||||
|
||||
QLinearGradient grad( 0, 1, 0, h-2 );
|
||||
pmp.fillRect( 0, 0, 1, h, QColor( 96, 96, 96 ) );
|
||||
pmp.fillRect( 1, 0, w+1, h, QColor( 128, 128, 128 ) );
|
||||
grad.setColorAt( 0.0, QColor( 64, 64, 64 ) );
|
||||
grad.setColorAt( 0.3, QColor( 128, 128, 128 ) );
|
||||
grad.setColorAt( 0.5, QColor( 128, 128, 128 ) );
|
||||
grad.setColorAt( 0.95, QColor( 160, 160, 160 ) );
|
||||
pmp.fillRect( 0, 1, w, h-2, grad );
|
||||
|
||||
QLinearGradient grad2( 0,1, 0, h-2 );
|
||||
pmp.fillRect( w+1, 0, w , h, QColor( 96, 96, 96 ) );
|
||||
grad2.setColorAt( 0.0, QColor( 48, 48, 48 ) );
|
||||
grad2.setColorAt( 0.3, QColor( 96, 96, 96 ) );
|
||||
grad2.setColorAt( 0.5, QColor( 96, 96, 96 ) );
|
||||
grad2.setColorAt( 0.95, QColor( 120, 120, 120 ) );
|
||||
pmp.fillRect( w, 1, w , h-2, grad2 );
|
||||
|
||||
// draw vertical lines
|
||||
pmp.setPen( QPen( QColor( 0, 0, 0, 112 ), 1 ) );
|
||||
for( float x = 0.5; x < w * 2; x += ppt )
|
||||
{
|
||||
pmp.drawLine( QLineF( x, 1.0, x, h-2.0 ) );
|
||||
}
|
||||
pmp.drawLine( 0, 1, w*2, 1 );
|
||||
|
||||
pmp.setPen( QPen( QColor( 255, 255, 255, 32 ), 1 ) );
|
||||
for( float x = 1.5; x < w * 2; x += ppt )
|
||||
{
|
||||
pmp.drawLine( QLineF( x, 1.0, x, h-2.0 ) );
|
||||
}
|
||||
pmp.drawLine( 0, h-2, w*2, h-2 );
|
||||
|
||||
pmp.end();
|
||||
|
||||
// Force redraw
|
||||
update();
|
||||
}
|
||||
|
||||
@@ -1225,7 +1213,7 @@ void trackContentWidget::resizeEvent( QResizeEvent * _re )
|
||||
*/
|
||||
void trackContentWidget::undoStep( journalEntry & _je )
|
||||
{
|
||||
saveJournallingState( FALSE );
|
||||
saveJournallingState( false );
|
||||
switch( _je.actionID() )
|
||||
{
|
||||
case AddTrackContentObject:
|
||||
@@ -1249,7 +1237,7 @@ void trackContentWidget::undoStep( journalEntry & _je )
|
||||
trackContentObject * tco = getTrack()->createTCO(
|
||||
midiTime( 0 ) );
|
||||
multimediaProject mmp(
|
||||
_je.data().toMap()["state"].toString(), FALSE );
|
||||
_je.data().toMap()["state"].toString(), false );
|
||||
tco->restoreState(
|
||||
mmp.content().firstChild().toElement() );
|
||||
break;
|
||||
@@ -1374,7 +1362,7 @@ trackOperationsWidget::trackOperationsWidget( trackView * _parent ) :
|
||||
m_muteBtn = new pixmapButton( this, tr( "Mute" ) );
|
||||
m_muteBtn->setActiveGraphic( embed::getIconPixmap( "led_off" ) );
|
||||
m_muteBtn->setInactiveGraphic( embed::getIconPixmap( "led_green" ) );
|
||||
m_muteBtn->setCheckable( TRUE );
|
||||
m_muteBtn->setCheckable( true );
|
||||
m_muteBtn->move( 46, 8 );
|
||||
m_muteBtn->show();
|
||||
toolTip::add( m_muteBtn, tr( "Mute this track" ) );
|
||||
@@ -1382,7 +1370,7 @@ trackOperationsWidget::trackOperationsWidget( trackView * _parent ) :
|
||||
m_soloBtn = new pixmapButton( this, tr( "Solo" ) );
|
||||
m_soloBtn->setActiveGraphic( embed::getIconPixmap( "led_red" ) );
|
||||
m_soloBtn->setInactiveGraphic( embed::getIconPixmap( "led_off" ) );
|
||||
m_soloBtn->setCheckable( TRUE );
|
||||
m_soloBtn->setCheckable( true );
|
||||
m_soloBtn->move( 62, 8 );
|
||||
toolTip::add( m_soloBtn, tr( "Solo" ) );
|
||||
|
||||
@@ -1391,6 +1379,7 @@ trackOperationsWidget::trackOperationsWidget( trackView * _parent ) :
|
||||
SLOT( deleteTrackView( trackView * ) ),
|
||||
Qt::QueuedConnection );
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
}
|
||||
|
||||
|
||||
@@ -1419,7 +1408,7 @@ trackOperationsWidget::~trackOperationsWidget()
|
||||
void trackOperationsWidget::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::LeftButton &&
|
||||
engine::getMainWindow()->isCtrlPressed() == TRUE &&
|
||||
_me->modifiers() & Qt::ControlModifier &&
|
||||
m_trackView->getTrack()->type() != track::BBTrack )
|
||||
{
|
||||
multimediaProject mmp( multimediaProject::DragNDropData );
|
||||
@@ -1455,9 +1444,9 @@ void trackOperationsWidget::mousePressEvent( QMouseEvent * _me )
|
||||
void trackOperationsWidget::paintEvent( QPaintEvent * _pe )
|
||||
{
|
||||
QPainter p( this );
|
||||
p.fillRect( rect(), QColor( 56, 60, 72 ) );
|
||||
p.fillRect( rect(), palette().brush(QPalette::Background) );
|
||||
|
||||
if( m_trackView->isMovingTrack() == FALSE )
|
||||
if( m_trackView->isMovingTrack() == false )
|
||||
{
|
||||
p.drawPixmap( 2, 2, *s_grip );
|
||||
m_trackOps->show();
|
||||
@@ -1545,11 +1534,11 @@ track::track( TrackTypes _type, trackContainer * _tc ) :
|
||||
m_trackContainer( _tc ), /*!< The track container object */
|
||||
m_type( _type ), /*!< The track type */
|
||||
m_name(), /*!< The track's name */
|
||||
m_mutedModel( FALSE, this, tr( "Muted" ) ),
|
||||
m_mutedModel( false, this, tr( "Muted" ) ),
|
||||
/*!< For controlling track muting */
|
||||
m_soloModel( FALSE, this, tr( "Solo" ) ),
|
||||
m_soloModel( false, this, tr( "Solo" ) ),
|
||||
/*!< For controlling track soloing */
|
||||
m_simpleSerializingMode( FALSE ),
|
||||
m_simpleSerializingMode( false ),
|
||||
m_trackContentObjects() /*!< The track content objects (segments) */
|
||||
{
|
||||
m_trackContainer->addTrack( this );
|
||||
@@ -1601,7 +1590,7 @@ track * track::create( TrackTypes _tt, trackContainer * _tc )
|
||||
// case VIDEO_TRACK:
|
||||
case AutomationTrack: t = new automationTrack( _tc ); break;
|
||||
case HiddenAutomationTrack:
|
||||
t = new automationTrack( _tc, TRUE ); break;
|
||||
t = new automationTrack( _tc, true ); break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
@@ -1680,7 +1669,7 @@ void track::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
|
||||
if( m_simpleSerializingMode )
|
||||
{
|
||||
m_simpleSerializingMode = FALSE;
|
||||
m_simpleSerializingMode = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1732,7 +1721,7 @@ void track::loadSettings( const QDomElement & _this )
|
||||
}
|
||||
node = node.nextSibling();
|
||||
}
|
||||
m_simpleSerializingMode = FALSE;
|
||||
m_simpleSerializingMode = false;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1757,7 +1746,7 @@ void track::loadSettings( const QDomElement & _this )
|
||||
trackContentObject * tco = createTCO(
|
||||
midiTime( 0 ) );
|
||||
tco->restoreState( node.toElement() );
|
||||
saveJournallingState( FALSE );
|
||||
saveJournallingState( false );
|
||||
restoreJournallingState();
|
||||
}
|
||||
}
|
||||
@@ -1903,18 +1892,18 @@ void track::getTCOsInRange( tcoVector & _tco_v, const midiTime & _start,
|
||||
// ok, TCO is posated within given range
|
||||
// now let's search according position for TCO in list
|
||||
// -> list is ordered by TCO's position afterwards
|
||||
bool inserted = FALSE;
|
||||
bool inserted = false;
|
||||
for( tcoVector::iterator it = _tco_v.begin();
|
||||
it != _tco_v.end(); ++it )
|
||||
{
|
||||
if( ( *it )->startPosition() >= s )
|
||||
{
|
||||
_tco_v.insert( it, tco );
|
||||
inserted = TRUE;
|
||||
inserted = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( inserted == FALSE )
|
||||
if( inserted == false )
|
||||
{
|
||||
// no TCOs found posated behind current TCO...
|
||||
_tco_v.push_back( tco );
|
||||
@@ -2031,7 +2020,7 @@ void track::toggleSolo( void )
|
||||
{
|
||||
const trackContainer::trackList & tl = m_trackContainer->tracks();
|
||||
|
||||
bool solo_before = FALSE;
|
||||
bool solo_before = false;
|
||||
for( trackContainer::trackList::const_iterator it = tl.begin();
|
||||
it != tl.end(); ++it )
|
||||
{
|
||||
@@ -2039,7 +2028,7 @@ void track::toggleSolo( void )
|
||||
{
|
||||
if( ( *it )->m_soloModel.value() )
|
||||
{
|
||||
solo_before = TRUE;
|
||||
solo_before = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2056,10 +2045,10 @@ void track::toggleSolo( void )
|
||||
{
|
||||
( *it )->m_mutedBeforeSolo = ( *it )->isMuted();
|
||||
}
|
||||
( *it )->setMuted( *it == this ? FALSE : TRUE );
|
||||
( *it )->setMuted( *it == this ? false : true );
|
||||
if( *it != this )
|
||||
{
|
||||
( *it )->m_soloModel.setValue( FALSE );
|
||||
( *it )->m_soloModel.setValue( false );
|
||||
}
|
||||
}
|
||||
else if( !solo_before )
|
||||
@@ -2097,16 +2086,12 @@ trackView::trackView( track * _track, trackContainerView * _tcv ) :
|
||||
m_trackContentWidget( this ), /*!< Our trackContentWidget */
|
||||
m_action( NoAction ) /*!< The action we're currently performing */
|
||||
{
|
||||
setAutoFillBackground( TRUE );
|
||||
setAutoFillBackground( true );
|
||||
QPalette pal;
|
||||
pal.setColor( backgroundRole(), QColor( 32, 36, 40 ) );
|
||||
setPalette( pal );
|
||||
|
||||
|
||||
m_trackSettingsWidget.setAutoFillBackground( TRUE );
|
||||
pal.setColor( m_trackSettingsWidget.backgroundRole(),
|
||||
QColor( 56, 60, 72 ) );
|
||||
m_trackSettingsWidget.setPalette( pal );
|
||||
m_trackSettingsWidget.setAutoFillBackground( true );
|
||||
|
||||
QHBoxLayout * layout = new QHBoxLayout( this );
|
||||
layout->setMargin( 0 );
|
||||
@@ -2117,8 +2102,9 @@ trackView::trackView( track * _track, trackContainerView * _tcv ) :
|
||||
|
||||
resizeEvent( NULL );
|
||||
|
||||
setAcceptDrops( TRUE );
|
||||
setAttribute( Qt::WA_DeleteOnClose );
|
||||
setAcceptDrops( true );
|
||||
setAttribute( Qt::WA_DeleteOnClose, true );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
|
||||
|
||||
connect( m_track, SIGNAL( destroyedTrack() ), this, SLOT( close() ) );
|
||||
@@ -2221,7 +2207,7 @@ void trackView::modelChanged( void )
|
||||
*/
|
||||
void trackView::undoStep( journalEntry & _je )
|
||||
{
|
||||
saveJournallingState( FALSE );
|
||||
saveJournallingState( false );
|
||||
switch( _je.actionID() )
|
||||
{
|
||||
case MoveTrack:
|
||||
@@ -2289,7 +2275,7 @@ void trackView::dropEvent( QDropEvent * _de )
|
||||
{
|
||||
// value contains our XML-data so simply create a
|
||||
// multimediaProject which does the rest for us...
|
||||
multimediaProject mmp( value, FALSE );
|
||||
multimediaProject mmp( value, false );
|
||||
engine::getMixer()->lock();
|
||||
m_track->restoreState( mmp.content().firstChild().toElement() );
|
||||
engine::getMixer()->unlock();
|
||||
@@ -2315,13 +2301,13 @@ void trackView::dropEvent( QDropEvent * _de )
|
||||
*/
|
||||
void trackView::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_trackContainerView->allowRubberband() == TRUE )
|
||||
if( m_trackContainerView->allowRubberband() == true )
|
||||
{
|
||||
QWidget::mousePressEvent( _me );
|
||||
}
|
||||
else if( _me->button() == Qt::LeftButton )
|
||||
{
|
||||
if( engine::getMainWindow()->isShiftPressed() == TRUE )
|
||||
if( _me->modifiers() & Qt::ShiftModifier )
|
||||
{
|
||||
m_action = ResizeTrack;
|
||||
QCursor::setPos( mapToGlobal( QPoint( _me->x(),
|
||||
@@ -2369,7 +2355,7 @@ void trackView::mousePressEvent( QMouseEvent * _me )
|
||||
*/
|
||||
void trackView::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( m_trackContainerView->allowRubberband() == TRUE )
|
||||
if( m_trackContainerView->allowRubberband() == true )
|
||||
{
|
||||
QWidget::mouseMoveEvent( _me );
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ void automatableModelView::setModel( model * _model, bool _old_model_valid )
|
||||
void automatableModelView::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::LeftButton &&
|
||||
engine::getMainWindow()->isCtrlPressed() == TRUE )
|
||||
_me->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
new stringPairDrag( "automatable_model",
|
||||
QString::number( modelUntyped()->id() ),
|
||||
|
||||
@@ -118,6 +118,8 @@ automationEditor::automationEditor( void ) :
|
||||
"edit_move" ) );
|
||||
}
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
|
||||
// add time-line
|
||||
m_timeLine = new timeLine( VALUES_WIDTH, 32, m_ppt,
|
||||
engine::getSong()->getPlayPos(
|
||||
@@ -743,7 +745,7 @@ void automationEditor::mousePressEvent( QMouseEvent * _me )
|
||||
m_editMode == DRAW )
|
||||
{
|
||||
// Connect the dots
|
||||
if( engine::getMainWindow()->isShiftPressed() )
|
||||
if( _me->modifiers() & Qt::ShiftModifier )
|
||||
{
|
||||
drawLine( m_drawLastTick,
|
||||
m_drawLastLevel,
|
||||
@@ -1610,7 +1612,7 @@ void automationEditor::resizeEvent( QResizeEvent * )
|
||||
void automationEditor::wheelEvent( QWheelEvent * _we )
|
||||
{
|
||||
_we->accept();
|
||||
if( engine::getMainWindow()->isCtrlPressed() == TRUE )
|
||||
if( _we->modifiers() & Qt::ControlModifier )
|
||||
{
|
||||
if( _we->delta() > 0 )
|
||||
{
|
||||
@@ -1630,7 +1632,8 @@ void automationEditor::wheelEvent( QWheelEvent * _we )
|
||||
m_timeLine->setPixelsPerTact( m_ppt );
|
||||
update();
|
||||
}
|
||||
else if( engine::getMainWindow()->isShiftPressed() )
|
||||
else if( _we->modifiers() & Qt::ShiftModifier
|
||||
|| _we->orientation() == Qt::Horizontal )
|
||||
{
|
||||
m_leftRightScroll->setValue( m_leftRightScroll->value() -
|
||||
_we->delta() * 2 / 15 );
|
||||
|
||||
338
src/gui/automation_pattern_view.cpp
Normal file
338
src/gui/automation_pattern_view.cpp
Normal file
@@ -0,0 +1,338 @@
|
||||
/*
|
||||
* automation_pattern_view.cpp - implementation of view for automationPattern
|
||||
*
|
||||
* Copyright (c) 2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public
|
||||
* License along with this program (see COPYING); if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QMenu>
|
||||
|
||||
#include "automation_pattern_view.h"
|
||||
#include "automation_editor.h"
|
||||
#include "automation_pattern.h"
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "project_journal.h"
|
||||
#include "rename_dialog.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
|
||||
|
||||
automationPatternView::automationPatternView( automationPattern * _pattern,
|
||||
trackView * _parent ) :
|
||||
trackContentObjectView( _pattern, _parent ),
|
||||
m_pat( _pattern ),
|
||||
m_paintPixmap(),
|
||||
m_needsUpdate( true )
|
||||
{
|
||||
connect( m_pat, SIGNAL( dataChanged() ),
|
||||
this, SLOT( update() ) );
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setFixedHeight( parentWidget()->height() - 2 );
|
||||
setAutoResizeEnabled( false );
|
||||
|
||||
toolTip::add( this, tr( "double-click to open this pattern in "
|
||||
"automation editor" ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
automationPatternView::~automationPatternView()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::update( void )
|
||||
{
|
||||
m_needsUpdate = true;
|
||||
if( fixedTCOs() )
|
||||
{
|
||||
m_pat->changeLength( m_pat->length() );
|
||||
}
|
||||
trackContentObjectView::update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::resetName( void )
|
||||
{
|
||||
m_pat->setName( QString::null );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::changeName( void )
|
||||
{
|
||||
QString s = m_pat->name();
|
||||
renameDialog rename_dlg( s );
|
||||
rename_dlg.exec();
|
||||
m_pat->setName( s );
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::disconnectObject( QAction * _a )
|
||||
{
|
||||
journallingObject * j = engine::getProjectJournal()->
|
||||
getJournallingObject( _a->data().toInt() );
|
||||
if( j && dynamic_cast<automatableModel *>( j ) )
|
||||
{
|
||||
m_pat->m_objects.erase( qFind( m_pat->m_objects.begin(),
|
||||
m_pat->m_objects.end(),
|
||||
dynamic_cast<automatableModel *>( j ) ) );
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::constructContextMenu( QMenu * _cm )
|
||||
{
|
||||
QAction * a = new QAction( embed::getIconPixmap( "automation" ),
|
||||
tr( "Open in Automation editor" ), _cm );
|
||||
_cm->insertAction( _cm->actions()[0], a );
|
||||
connect( a, SIGNAL( triggered( bool ) ),
|
||||
m_pat, SLOT( openInAutomationEditor() ) );
|
||||
_cm->insertSeparator( _cm->actions()[1] );
|
||||
|
||||
_cm->addSeparator();
|
||||
|
||||
_cm->addAction( embed::getIconPixmap( "edit_erase" ),
|
||||
tr( "Clear" ), m_pat, SLOT( clear() ) );
|
||||
_cm->addSeparator();
|
||||
|
||||
_cm->addAction( embed::getIconPixmap( "reload" ), tr( "Reset name" ),
|
||||
this, SLOT( resetName() ) );
|
||||
_cm->addAction( embed::getIconPixmap( "edit_rename" ),
|
||||
tr( "Change name" ),
|
||||
this, SLOT( changeName() ) );
|
||||
if( !m_pat->m_objects.isEmpty() )
|
||||
{
|
||||
_cm->addSeparator();
|
||||
QMenu * m = new QMenu( tr( "%1 Connections" ).
|
||||
arg( m_pat->m_objects.count() ), _cm );
|
||||
for( automationPattern::objectVector::iterator it =
|
||||
m_pat->m_objects.begin();
|
||||
it != m_pat->m_objects.end(); ++it )
|
||||
{
|
||||
if( *it )
|
||||
{
|
||||
a = new QAction( tr( "Disconnect \"%1\"" ).
|
||||
arg( ( *it )->fullDisplayName() ), m );
|
||||
a->setData( ( *it )->id() );
|
||||
m->addAction( a );
|
||||
}
|
||||
}
|
||||
connect( m, SIGNAL( triggered( QAction * ) ),
|
||||
this, SLOT( disconnectObject( QAction * ) ) );
|
||||
_cm->addMenu( m );
|
||||
}
|
||||
|
||||
_cm->addSeparator();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::mouseDoubleClickEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() != Qt::LeftButton )
|
||||
{
|
||||
_me->ignore();
|
||||
return;
|
||||
}
|
||||
m_pat->openInAutomationEditor();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::paintEvent( QPaintEvent * )
|
||||
{
|
||||
if( m_needsUpdate == false )
|
||||
{
|
||||
QPainter p( this );
|
||||
p.drawPixmap( 0, 0, m_paintPixmap );
|
||||
return;
|
||||
}
|
||||
|
||||
m_needsUpdate = false;
|
||||
|
||||
if( m_paintPixmap.isNull() == true || m_paintPixmap.size() != size() )
|
||||
{
|
||||
m_paintPixmap = QPixmap( size() );
|
||||
}
|
||||
|
||||
QPainter p( &m_paintPixmap );
|
||||
|
||||
QLinearGradient lingrad( 0, 0, 0, height() );
|
||||
const QColor c = isSelected() ? QColor( 0, 0, 224 ) :
|
||||
QColor( 96, 96, 96 );
|
||||
lingrad.setColorAt( 0, c );
|
||||
lingrad.setColorAt( 0.5, Qt::black );
|
||||
lingrad.setColorAt( 1, c );
|
||||
p.setBrush( lingrad );
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
p.drawRect( QRect( 0, 0, width() - 1, height() - 1 ) );
|
||||
|
||||
const float ppt = fixedTCOs() ?
|
||||
( parentWidget()->width() - 2 * TCO_BORDER_WIDTH )
|
||||
/ (float) m_pat->length().getTact() :
|
||||
pixelsPerTact();
|
||||
|
||||
const int x_base = TCO_BORDER_WIDTH;
|
||||
p.setPen( QColor( 0, 0, 0 ) );
|
||||
|
||||
for( tact t = 1; t < m_pat->length().getTact(); ++t )
|
||||
{
|
||||
p.drawLine( x_base + static_cast<int>( ppt * t ) - 1,
|
||||
TCO_BORDER_WIDTH, x_base + static_cast<int>(
|
||||
ppt * t ) - 1, 5 );
|
||||
p.drawLine( x_base + static_cast<int>( ppt * t ) - 1,
|
||||
height() - ( 4 + 2 * TCO_BORDER_WIDTH ),
|
||||
x_base + static_cast<int>( ppt * t ) - 1,
|
||||
height() - 2 * TCO_BORDER_WIDTH );
|
||||
}
|
||||
|
||||
const float min = m_pat->firstObject()->minValue<float>();
|
||||
const float max = m_pat->firstObject()->maxValue<float>();
|
||||
|
||||
const float y_scale = max - min;
|
||||
const float h = ( height()-2*TCO_BORDER_WIDTH ) / y_scale;
|
||||
|
||||
p.translate( 0.0f, max * height() / y_scale-1 );
|
||||
p.scale( 1.0f, -h );
|
||||
|
||||
QLinearGradient lin2grad( 0, min, 0, max );
|
||||
const QColor cl = QColor( 255, 224, 0 );
|
||||
const QColor cd = QColor( 229, 158, 0 );
|
||||
|
||||
lin2grad.setColorAt( 1, cl );
|
||||
lin2grad.setColorAt( 0, cd );
|
||||
|
||||
for( automationPattern::timeMap::const_iterator it =
|
||||
m_pat->getTimeMap().begin();
|
||||
it != m_pat->getTimeMap().end(); ++it )
|
||||
{
|
||||
const float x1 = 2 * x_base + it.key() * ppt /
|
||||
midiTime::ticksPerTact();
|
||||
float x2;
|
||||
if( it+1 != m_pat->getTimeMap().end() )
|
||||
{
|
||||
x2 = (it+1).key() * ppt / midiTime::ticksPerTact() + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
x2 = (float)( width() - TCO_BORDER_WIDTH );
|
||||
}
|
||||
p.fillRect( QRectF( x1, 0.0f, x2-x1, it.value() ),
|
||||
lin2grad );
|
||||
}
|
||||
|
||||
p.resetMatrix();
|
||||
p.setFont( pointSize<7>( p.font() ) );
|
||||
if( m_pat->isMuted() || m_pat->getTrack()->isMuted() )
|
||||
{
|
||||
p.setPen( QColor( 192, 192, 192 ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
p.setPen( QColor( 0, 64, 255 ) );
|
||||
}
|
||||
|
||||
p.drawText( 2, p.fontMetrics().height() - 1, m_pat->name() );
|
||||
|
||||
if( m_pat->isMuted() )
|
||||
{
|
||||
p.drawPixmap( 3, p.fontMetrics().height() + 1,
|
||||
embed::getIconPixmap( "muted", 16, 16 ) );
|
||||
}
|
||||
|
||||
p.end();
|
||||
|
||||
p.begin( this );
|
||||
p.drawPixmap( 0, 0, m_paintPixmap );
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
{
|
||||
stringPairDrag::processDragEnterEvent( _dee, "automatable_model" );
|
||||
if( !_dee->isAccepted() )
|
||||
{
|
||||
trackContentObjectView::dragEnterEvent( _dee );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void automationPatternView::dropEvent( QDropEvent * _de )
|
||||
{
|
||||
QString type = stringPairDrag::decodeKey( _de );
|
||||
QString val = stringPairDrag::decodeValue( _de );
|
||||
if( type == "automatable_model" )
|
||||
{
|
||||
automatableModel * mod = dynamic_cast<automatableModel *>(
|
||||
engine::getProjectJournal()->
|
||||
getJournallingObject( val.toInt() ) );
|
||||
if( mod != NULL )
|
||||
{
|
||||
m_pat->addObject( mod );
|
||||
}
|
||||
update();
|
||||
|
||||
if( engine::getAutomationEditor() &&
|
||||
engine::getAutomationEditor()->currentPattern() ==
|
||||
m_pat )
|
||||
{
|
||||
engine::getAutomationEditor()->setCurrentPattern(
|
||||
m_pat );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
trackContentObjectView::dropEvent( _de );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#include "moc_automation_pattern_view.cxx"
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "embed.h"
|
||||
#include "engine.h"
|
||||
#include "gui_templates.h"
|
||||
#include "import_filter.h"
|
||||
#include "instrument.h"
|
||||
#include "instrument_track.h"
|
||||
#include "main_window.h"
|
||||
@@ -488,7 +489,10 @@ void fileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * _me )
|
||||
break;
|
||||
|
||||
case fileItem::MidiFile:
|
||||
new stringPairDrag( "midifile",
|
||||
// don't allow dragging FLP-files as FLP import filter clears project
|
||||
// without asking
|
||||
// case fileItem::FlpFile:
|
||||
new stringPairDrag( "importedproject",
|
||||
f->fullName(),
|
||||
embed::getIconPixmap(
|
||||
"midi_file" ),
|
||||
@@ -571,11 +575,23 @@ void fileBrowserTreeWidget::handleFile( fileItem * f, instrumentTrack * _it )
|
||||
instrumentTrack::removeMidiPortNode( mmp );
|
||||
_it->setSimpleSerializing();
|
||||
_it->loadSettings( mmp.content().toElement() );
|
||||
break;
|
||||
}
|
||||
|
||||
case fileItem::ImportAsProject:
|
||||
if( f->type() == fileItem::FlpFile &&
|
||||
!engine::getMainWindow()->mayChangeProject() )
|
||||
{
|
||||
break;
|
||||
}
|
||||
importFilter::import( f->fullName(),
|
||||
engine::getSong() );
|
||||
break;
|
||||
|
||||
case fileItem::NotSupported:
|
||||
default:
|
||||
break;
|
||||
|
||||
}
|
||||
engine::getMixer()->unlock();
|
||||
}
|
||||
@@ -592,11 +608,12 @@ void fileBrowserTreeWidget::activateListItem( QTreeWidgetItem * _item,
|
||||
return;
|
||||
}
|
||||
|
||||
if( f->handling() == fileItem::LoadAsProject )
|
||||
if( f->handling() == fileItem::LoadAsProject ||
|
||||
f->handling() == fileItem::ImportAsProject )
|
||||
{
|
||||
handleFile( f, NULL );
|
||||
}
|
||||
else
|
||||
else if( f->handling() != fileItem::NotSupported )
|
||||
{
|
||||
engine::getMixer()->lock();
|
||||
instrumentTrack * it = dynamic_cast<instrumentTrack *>(
|
||||
@@ -947,11 +964,16 @@ void fileItem::determineFileType( void )
|
||||
m_type = ProjectFile;
|
||||
m_handling = LoadAsProject;
|
||||
}
|
||||
else if( ext == "xpf" || ext == "xml" || ext == "xiz" )
|
||||
else if( ext == "xpf" || ext == "xml" )
|
||||
{
|
||||
m_type = PresetFile;
|
||||
m_handling = LoadAsPreset;
|
||||
}
|
||||
else if( ext == "xiz" && engine::pluginFileHandling().contains( ext ) )
|
||||
{
|
||||
m_type = PresetFile;
|
||||
m_handling = LoadByPlugin;
|
||||
}
|
||||
else if( ext == "sf2" )
|
||||
{
|
||||
m_type = SoundFontFile;
|
||||
@@ -963,17 +985,20 @@ void fileItem::determineFileType( void )
|
||||
else if( ext == "mid" )
|
||||
{
|
||||
m_type = MidiFile;
|
||||
m_handling = ImportAsProject;
|
||||
}
|
||||
else if( ext == "flp" )
|
||||
{
|
||||
m_type = FlpFile;
|
||||
m_handling = ImportAsProject;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_type = UnknownFile;
|
||||
}
|
||||
|
||||
if( !ext.isEmpty() && engine::pluginFileHandling().contains( ext ) )
|
||||
if( m_handling == NotSupported &&
|
||||
!ext.isEmpty() && engine::pluginFileHandling().contains( ext ) )
|
||||
{
|
||||
m_handling = LoadByPlugin;
|
||||
// classify as sample if not classified by anything yet but can
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
m_name( _name )
|
||||
{
|
||||
setFixedSize( 32, 232 );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, TRUE );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setCursor( QCursor( embed::getIconPixmap( "hand" ), 0, 0 ) );
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ fxMixerView::fxMixerView() :
|
||||
QPalette pal = palette();
|
||||
pal.setColor( QPalette::Background, QColor( 72, 76, 88 ) );
|
||||
setPalette( pal );
|
||||
setAutoFillBackground( TRUE );
|
||||
setAutoFillBackground( true );
|
||||
setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Minimum );
|
||||
|
||||
setWindowTitle( tr( "FX-Mixer" ) );
|
||||
@@ -184,7 +184,7 @@ fxMixerView::fxMixerView() :
|
||||
embed::getIconPixmap( "led_off" ) );
|
||||
cv->m_muteBtn->setInactiveGraphic(
|
||||
embed::getIconPixmap( "led_green" ) );
|
||||
cv->m_muteBtn->setCheckable( TRUE );
|
||||
cv->m_muteBtn->setCheckable( true );
|
||||
cv->m_muteBtn->move( 9, cv->m_fader->y()-16);
|
||||
toolTip::add( cv->m_muteBtn, tr( "Mute this FX channel" ) );
|
||||
|
||||
@@ -197,12 +197,12 @@ fxMixerView::fxMixerView() :
|
||||
l->addSpacing( 10 );
|
||||
QButtonGroup * g = new QButtonGroup( this );
|
||||
m_bankButtons = g;
|
||||
g->setExclusive( TRUE );
|
||||
g->setExclusive( true );
|
||||
for( int j = 0; j < 4; ++j )
|
||||
{
|
||||
QToolButton * btn = new QToolButton;
|
||||
btn->setText( QString( 'A'+j ) );
|
||||
btn->setCheckable( TRUE );
|
||||
btn->setCheckable( true );
|
||||
btn->setSizePolicy( QSizePolicy::Preferred,
|
||||
QSizePolicy::Expanding );
|
||||
l->addWidget( btn );
|
||||
@@ -239,7 +239,7 @@ fxMixerView::fxMixerView() :
|
||||
subWin->setWindowFlags( flags );
|
||||
subWin->layout()->setSizeConstraint(QLayout::SetFixedSize);
|
||||
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, FALSE );
|
||||
parentWidget()->setAttribute( Qt::WA_DeleteOnClose, false );
|
||||
parentWidget()->move( 5, 310 );
|
||||
|
||||
// we want to receive dataChanged-signals in order to update
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -87,7 +87,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
setFocus();
|
||||
|
||||
// create time-line
|
||||
timeLine * tl = new timeLine( TRACK_OP_WIDTH +
|
||||
m_timeLine = new timeLine( TRACK_OP_WIDTH +
|
||||
DEFAULT_SETTINGS_WIDGET_WIDTH, 32,
|
||||
pixelsPerTact(),
|
||||
m_s->m_playPos[song::Mode_PlaySong],
|
||||
@@ -95,7 +95,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
connect( this, SIGNAL( positionChanged( const midiTime & ) ),
|
||||
m_s->m_playPos[song::Mode_PlaySong].m_timeLine,
|
||||
SLOT( updatePosition( const midiTime & ) ) );
|
||||
connect( tl, SIGNAL( positionChanged( const midiTime & ) ),
|
||||
connect( m_timeLine, SIGNAL( positionChanged( const midiTime & ) ),
|
||||
this, SLOT( updatePosition( const midiTime & ) ) );
|
||||
|
||||
m_positionLine = new positionLine( this );
|
||||
@@ -232,7 +232,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
m_toolBar->setPalette( pal );
|
||||
|
||||
static_cast<QVBoxLayout *>( layout() )->insertWidget( 0, m_toolBar );
|
||||
static_cast<QVBoxLayout *>( layout() )->insertWidget( 1, tl );
|
||||
static_cast<QVBoxLayout *>( layout() )->insertWidget( 1, m_timeLine );
|
||||
|
||||
QHBoxLayout * tb_layout = new QHBoxLayout( m_toolBar );
|
||||
tb_layout->setMargin( 0 );
|
||||
@@ -357,7 +357,7 @@ songEditor::songEditor( song * _song, songEditor * & _engine_ptr ) :
|
||||
tb_layout->addWidget( m_drawModeButton );
|
||||
tb_layout->addWidget( m_editModeButton );
|
||||
tb_layout->addSpacing( 10 );
|
||||
tl->addToolButtons( m_toolBar );
|
||||
m_timeLine->addToolButtons( m_toolBar );
|
||||
tb_layout->addSpacing( 15 );
|
||||
tb_layout->addWidget( zoom_lbl );
|
||||
tb_layout->addSpacing( 5 );
|
||||
@@ -645,7 +645,8 @@ void songEditor::masterPitchReleased( void )
|
||||
|
||||
void songEditor::updatePosition( const midiTime & _t )
|
||||
{
|
||||
if( ( m_s->isPlaying() && m_s->m_playMode == song::Mode_PlaySong ) ||
|
||||
if( ( m_s->isPlaying() && m_s->m_playMode == song::Mode_PlaySong
|
||||
&& m_timeLine->autoScroll() == timeLine::AutoScrollEnabled) ||
|
||||
m_scrollBack == TRUE )
|
||||
{
|
||||
const int w = width() - DEFAULT_SETTINGS_WIDGET_WIDTH
|
||||
|
||||
@@ -79,7 +79,7 @@ trackContainerView::trackContainerView( trackContainer * _tc ) :
|
||||
m_scrollArea->show();
|
||||
m_rubberBand->hide();
|
||||
|
||||
setAcceptDrops( TRUE );
|
||||
setAcceptDrops( true );
|
||||
|
||||
connect( engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ),
|
||||
this, SLOT( realignTracks() ) );
|
||||
@@ -273,7 +273,7 @@ const trackView * trackContainerView::trackViewAt( const int _y ) const
|
||||
|
||||
bool trackContainerView::allowRubberband( void ) const
|
||||
{
|
||||
return( FALSE );
|
||||
return( false );
|
||||
}
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ void trackContainerView::clearAllTracks( void )
|
||||
void trackContainerView::undoStep( journalEntry & _je )
|
||||
{
|
||||
#if 0
|
||||
saveJournallingState( FALSE );
|
||||
saveJournallingState( false );
|
||||
switch( _je.actionID() )
|
||||
{
|
||||
case AddTrack:
|
||||
@@ -326,7 +326,7 @@ void trackContainerView::undoStep( journalEntry & _je )
|
||||
case RemoveTrack:
|
||||
{
|
||||
multimediaProject mmp(
|
||||
_je.data().toMap()["state"].toString(), FALSE );
|
||||
_je.data().toMap()["state"].toString(), false );
|
||||
track::create( mmp.content().firstChild().toElement(),
|
||||
m_tc );
|
||||
break;
|
||||
@@ -362,8 +362,8 @@ void trackContainerView::redoStep( journalEntry & _je )
|
||||
void trackContainerView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
{
|
||||
stringPairDrag::processDragEnterEvent( _dee,
|
||||
QString( "presetfile,sampledata,samplefile,instrument,midifile,"
|
||||
"track_%1,track_%2" ).
|
||||
QString( "presetfile,sampledata,samplefile,instrument,"
|
||||
"importedproject,track_%1,track_%2" ).
|
||||
arg( track::InstrumentTrack ).
|
||||
arg( track::SampleTrack ) );
|
||||
}
|
||||
@@ -382,7 +382,7 @@ void trackContainerView::dropEvent( QDropEvent * _de )
|
||||
track::create( track::InstrumentTrack,
|
||||
m_tc ) );
|
||||
it->loadInstrument( value );
|
||||
//it->toggledInstrumentTrackButton( TRUE );
|
||||
//it->toggledInstrumentTrackButton( true );
|
||||
_de->accept();
|
||||
}
|
||||
else if( /*type == "sampledata" || */type == "samplefile" )
|
||||
@@ -396,7 +396,7 @@ void trackContainerView::dropEvent( QDropEvent * _de )
|
||||
value )];
|
||||
instrument * i = it->loadInstrument( iname );
|
||||
i->loadFile( value );
|
||||
//it->toggledInstrumentTrackButton( TRUE );
|
||||
//it->toggledInstrumentTrackButton( true );
|
||||
_de->accept();
|
||||
}
|
||||
else if( type == "presetfile" )
|
||||
@@ -407,17 +407,17 @@ void trackContainerView::dropEvent( QDropEvent * _de )
|
||||
m_tc ) );
|
||||
it->loadTrackSpecificSettings( mmp.content().firstChild().
|
||||
toElement() );
|
||||
//it->toggledInstrumentTrackButton( TRUE );
|
||||
//it->toggledInstrumentTrackButton( true );
|
||||
_de->accept();
|
||||
}
|
||||
else if( type == "midifile" )
|
||||
else if( type == "importedproject" )
|
||||
{
|
||||
importFilter::import( value, m_tc );
|
||||
_de->accept();
|
||||
}
|
||||
else if( type.left( 6 ) == "track_" )
|
||||
{
|
||||
multimediaProject mmp( value, FALSE );
|
||||
multimediaProject mmp( value, false );
|
||||
track::create( mmp.content().firstChild().toElement(), m_tc );
|
||||
_de->accept();
|
||||
}
|
||||
@@ -429,7 +429,7 @@ void trackContainerView::dropEvent( QDropEvent * _de )
|
||||
|
||||
void trackContainerView::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( allowRubberband() == TRUE )
|
||||
if( allowRubberband() == true )
|
||||
{
|
||||
m_origin = m_scrollArea->mapFromParent( _me->pos() );
|
||||
m_rubberBand->setGeometry( QRect( m_origin, QSize() ) );
|
||||
@@ -443,7 +443,7 @@ void trackContainerView::mousePressEvent( QMouseEvent * _me )
|
||||
|
||||
void trackContainerView::mouseMoveEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( rubberBandActive() == TRUE )
|
||||
if( rubberBandActive() == true )
|
||||
{
|
||||
m_rubberBand->setGeometry( QRect( m_origin,
|
||||
m_scrollArea->mapFromParent( _me->pos() ) ).
|
||||
|
||||
@@ -115,7 +115,7 @@ void automatableButton::contextMenuEvent( QContextMenuEvent * _me )
|
||||
void automatableButton::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::LeftButton &&
|
||||
engine::getMainWindow()->isCtrlPressed() == FALSE )
|
||||
! ( _me->modifiers() & Qt::ControlModifier ) )
|
||||
{
|
||||
if( isCheckable() )
|
||||
{
|
||||
|
||||
@@ -76,7 +76,7 @@ void automatableSlider::contextMenuEvent( QContextMenuEvent * _me )
|
||||
void automatableSlider::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::LeftButton &&
|
||||
engine::getMainWindow()->isCtrlPressed() == FALSE )
|
||||
! ( _me->modifiers() & Qt::ControlModifier ) )
|
||||
{
|
||||
m_showStatus = TRUE;
|
||||
QSlider::mousePressEvent( _me );
|
||||
|
||||
@@ -80,6 +80,7 @@ comboBox::comboBox( QWidget * _parent, const QString & _name ) :
|
||||
connect( &m_menu, SIGNAL( triggered( QAction * ) ),
|
||||
this, SLOT( setItem( QAction * ) ) );
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setAccessibleName( _name );
|
||||
doConnections();
|
||||
}
|
||||
@@ -113,7 +114,7 @@ void comboBox::contextMenuEvent( QContextMenuEvent * _me )
|
||||
void comboBox::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::LeftButton &&
|
||||
engine::getMainWindow()->isCtrlPressed() == FALSE )
|
||||
! ( _me->modifiers() & Qt::ControlModifier ) )
|
||||
{
|
||||
if( _me->x() > width() - CB_ARROW_BTN_WIDTH )
|
||||
{
|
||||
|
||||
@@ -43,6 +43,7 @@ cpuloadWidget::cpuloadWidget( QWidget * _parent ) :
|
||||
m_changed( TRUE ),
|
||||
m_updateTimer()
|
||||
{
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setFixedSize( m_background.width(), m_background.height() );
|
||||
|
||||
m_temp = QPixmap( width(), height() );
|
||||
|
||||
@@ -42,6 +42,7 @@ effectRackView::effectRackView( effectChain * _model, QWidget * _parent ) :
|
||||
QWidget( _parent ),
|
||||
modelView( NULL, this )
|
||||
{
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setFixedSize( 250, 250 );
|
||||
|
||||
m_effectsGroupBox = new groupBox( tr( "EFFECTS CHAIN" ), this );
|
||||
|
||||
@@ -51,11 +51,11 @@
|
||||
effectView::effectView( effect * _model, QWidget * _parent ) :
|
||||
pluginView( _model, _parent ),
|
||||
m_bg( embed::getIconPixmap( "effect_plugin" ) ),
|
||||
m_show( TRUE )
|
||||
m_show( true )
|
||||
{
|
||||
setFixedSize( 210, 60 );
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, TRUE );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
|
||||
m_bypass = new ledCheckBox( "", this );
|
||||
m_bypass->move( 3, 3 );
|
||||
@@ -165,12 +165,12 @@ void effectView::editControls( void )
|
||||
{
|
||||
m_subWindow->show();
|
||||
m_subWindow->raise();
|
||||
m_show = FALSE;
|
||||
m_show = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_subWindow->hide();
|
||||
m_show = TRUE;
|
||||
m_show = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ void effectView::displayHelp( void )
|
||||
void effectView::closeEffects( void )
|
||||
{
|
||||
m_subWindow->hide();
|
||||
m_show = TRUE;
|
||||
m_show = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ void effectView::paintEvent( QPaintEvent * )
|
||||
p.drawPixmap( 0, 0, m_bg );
|
||||
|
||||
QFont f = pointSizeF( font(), 7.5f );
|
||||
f.setBold( TRUE );
|
||||
f.setBold( true );
|
||||
p.setFont( f );
|
||||
|
||||
p.setPen( QColor( 64, 64, 64 ) );
|
||||
|
||||
@@ -103,6 +103,8 @@ envelopeAndLFOView::envelopeAndLFOView( QWidget * _parent ) :
|
||||
s_lfoGraph = new QPixmap( embed::getIconPixmap( "lfo_graph" ) );
|
||||
}
|
||||
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
|
||||
m_predelayKnob = new knob( knobBright_26, this );
|
||||
m_predelayKnob->setLabel( tr( "DEL" ) );
|
||||
m_predelayKnob->move( PREDELAY_KNOB_X, ENV_KNOBS_Y );
|
||||
|
||||
@@ -42,6 +42,7 @@ fadeButton::fadeButton( const QColor & _normal_color,
|
||||
m_normalColor( _normal_color ),
|
||||
m_activatedColor( _activated_color )
|
||||
{
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setCursor( QCursor( embed::getIconPixmap( "hand" ), 0, 0 ) );
|
||||
}
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ fader::fader( floatModel * _model, QWidget * _parent ) :
|
||||
m_leds( embed::getIconPixmap( "fader_leds" ) ),
|
||||
m_knob( embed::getIconPixmap( "fader_knob" ) )
|
||||
{
|
||||
setAttribute( Qt::WA_NoBackground );
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
setMinimumSize( 23, 116 );
|
||||
setMaximumSize( 23, 116);
|
||||
resize( 23, 116 );
|
||||
@@ -112,7 +112,7 @@ void fader::mouseMoveEvent( QMouseEvent *ev )
|
||||
void fader::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
if( _me->button() == Qt::LeftButton &&
|
||||
engine::getMainWindow()->isCtrlPressed() == FALSE )
|
||||
! ( _me->modifiers() & Qt::ControlModifier ) )
|
||||
{
|
||||
mouseMoveEvent( _me );
|
||||
_me->accept();
|
||||
|
||||
@@ -47,6 +47,7 @@ groupBox::groupBox( const QString & _caption, QWidget * _parent ) :
|
||||
boolModelView( NULL, this ),
|
||||
m_caption( _caption )
|
||||
{
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
updatePixmap();
|
||||
|
||||
m_led = new pixmapButton( this, _caption );
|
||||
|
||||
@@ -436,6 +436,7 @@ KMultiTabBarTab::KMultiTabBarTab(const QPixmap& pic, const QString& text,
|
||||
setIcon(pic);
|
||||
m_expandedSize=24;
|
||||
setCheckable(true);
|
||||
setAttribute( Qt::WA_OpaquePaintEvent, true );
|
||||
}
|
||||
|
||||
KMultiTabBarTab::~KMultiTabBarTab() {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user