Compare commits
32 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
af3d57b67f | ||
|
|
7df6381800 | ||
|
|
f0cfa20676 | ||
|
|
bce6158cb7 | ||
|
|
66d18659a4 | ||
|
|
422e4364e6 | ||
|
|
2542a66675 | ||
|
|
452b7a200f | ||
|
|
564a1e48ac | ||
|
|
55045b7017 | ||
|
|
8325ad2991 | ||
|
|
ae7034653e | ||
|
|
22d1915a4e | ||
|
|
b0d91d48e9 | ||
|
|
dce587c7af | ||
|
|
458304016e | ||
|
|
86b37628d5 | ||
|
|
28673e7a80 | ||
|
|
2f4059ed15 | ||
|
|
b762ad706f | ||
|
|
7e6538d9b3 | ||
|
|
a0b758887e | ||
|
|
1f275d562e | ||
|
|
3d8f7f6985 | ||
|
|
858449d9bd | ||
|
|
164a2f7a01 | ||
|
|
8a1d9788a9 | ||
|
|
eed996742f | ||
|
|
f1a0214cda | ||
|
|
36b6540f0b | ||
|
|
4804108a1d | ||
|
|
052224c8e2 |
13
AUTHORS
13
AUTHORS
@@ -1,12 +1,19 @@
|
||||
Tobias Doerffel
|
||||
<tobydox@users.sourceforge.net>
|
||||
<tobydox/at/users.sourceforge.net>
|
||||
Maintainer, main-development, artwork etc.
|
||||
|
||||
Danny McRae
|
||||
<khjklujn@yahoo.com>
|
||||
<khjklujn/at/yahoo.com>
|
||||
development
|
||||
|
||||
Sebastian Tilsch
|
||||
<djcompilation@gmx.de>
|
||||
<djcompilation/at/gmx.de>
|
||||
recording of many samples
|
||||
|
||||
gabriel
|
||||
<kryos1/at/shaw.ca>
|
||||
additional artwork
|
||||
|
||||
Andreas Brandmaier
|
||||
<andy/at/brandmaier.de>
|
||||
BitInvader plugin
|
||||
|
||||
922
ChangeLog
922
ChangeLog
@@ -1,3 +1,923 @@
|
||||
2006-02-02 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* configure.in:
|
||||
made 0.1.4 release
|
||||
|
||||
* Makefile.am:
|
||||
added -rdynamic-switch again to make LMMS able to load plugins
|
||||
|
||||
* include/track_container.h:
|
||||
fixed bug which caused LMMS not being compilable using GCC 3
|
||||
|
||||
2006-02-01 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* configure.in:
|
||||
made 0.1.3 release
|
||||
|
||||
* lmms.1:
|
||||
added manpage (taken from debian-package and updated)
|
||||
|
||||
* include/base64.h:
|
||||
* include/rubberband.h:
|
||||
* plugins/bit_invader/graph.cpp:
|
||||
* src/core/name_label.cpp:
|
||||
* src/widgets/combobox.cpp:
|
||||
* src/widgets/rubberband.cpp:
|
||||
Qt4-compat fixes
|
||||
|
||||
* locale/de.ts:
|
||||
updated German translation
|
||||
|
||||
* src/core/main.cpp:
|
||||
updated copyright-notice in help-text
|
||||
|
||||
2006-01-30 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/fstclient.h:
|
||||
* plugins/vestige/fstclient.cpp:
|
||||
- renamed to lvsl_client.*
|
||||
- when waiting for plugin to have finished process()ing, usleep() some
|
||||
micro-seconds for allowing better scheduling
|
||||
|
||||
* plugins/vestige/lvsl_server.c:
|
||||
- merged code from fstserver.cpp, fstserver.h and fstcore.c into one
|
||||
source-file and removed rests of the old FST-API which makes all
|
||||
the VST-code MUCH more cleaner and less redundant (LVSL = LMMS VST
|
||||
Support Layer)
|
||||
- VST SDK 2.4 compatibility (no need to fix headers with 2.4!)
|
||||
|
||||
2006-01-29 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/bit_invader/bit_invader.cpp:
|
||||
- call graph::setSamplePointer() after loading settings
|
||||
- memcpy() samples in bitInvader::smoothClicked() instead of copying
|
||||
them in a loop
|
||||
|
||||
* plugins/bit_invader/graph.cpp:
|
||||
- update after setting new sample
|
||||
|
||||
* src/tracks/pattern.cpp:
|
||||
- disable auto-cleanup during pattern-freeze
|
||||
- initialize member m_progress in patternFreezeStatusDialig-dtor - fixes
|
||||
bug which sometimes closed the window before actual freezing was
|
||||
started
|
||||
|
||||
* include/buffer_allocator.h:
|
||||
* src/lib/buffer_allocator.cpp:
|
||||
- added possibility to disable auto-cleanup at certain times e.g. when
|
||||
freezing a pattern
|
||||
- cleanup only every 10th free()-call for decreasing overhead
|
||||
- only start searching for free bufs if there're enough remaining
|
||||
|
||||
2006-01-24 Andreas Brandmaier <andy/at/brandmaier.de>
|
||||
|
||||
* plugins/bit_invader/bit_invader.cpp:
|
||||
* plugins/bit_invader/bit_invader.h:
|
||||
* presets/BitInvader:
|
||||
- changed sample buffer encoding in presets to base64
|
||||
- added BitInvader various presets
|
||||
|
||||
2006-01-23 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/sample_buffer.h:
|
||||
* src/lib/sample_buffer.cpp:
|
||||
* plugins/audio_file_processor/audio_file_processor.cpp:
|
||||
use new base64-code
|
||||
|
||||
* include/base64.h:
|
||||
* src/lib/base64.cpp:
|
||||
added methods for encoding/decoding binary data to/from base64-encoded
|
||||
data (wrapper-implementation for Qt4)
|
||||
|
||||
2006-01-23 Andreas Brandmaier <andy/at/brandmaier.de>
|
||||
|
||||
* plugins/bit_invader/bit_invader.cpp:
|
||||
* plugins/bit_invader/bit_invader.h:
|
||||
* plugins/bit_invader/graph.cpp:
|
||||
* plugins/bit_invader/graph.h:
|
||||
- improved mouse handling.
|
||||
- replaced waveform generation methods by those of toby's oscillator
|
||||
class
|
||||
- added user-loadable waveform
|
||||
- code cleanup
|
||||
|
||||
2006-01-22 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/timeline.h:
|
||||
* src/core/song_editor.cpp:
|
||||
* src/core/timeline.cpp:
|
||||
updates are now completely done by timeline/QTimer without being
|
||||
called from song-editor out of non-GUI-thread which caused segfaults
|
||||
etc. sometimes
|
||||
|
||||
* include/name_label.h:
|
||||
* src/core/name_label.cpp:
|
||||
* src/tracks/bb_track.cpp:
|
||||
* src/tracks/sample_track.cpp:
|
||||
added support for user-defined track-icons
|
||||
|
||||
* artwork/track_icons/*png:
|
||||
added several icons to be used as track-icons
|
||||
|
||||
* include/track.h:
|
||||
* src/core/track.cpp:
|
||||
* src/core/track_container.cpp:
|
||||
do not hide track for completely repainting it, use special method for
|
||||
it
|
||||
|
||||
* include/pattern.h:
|
||||
* src/tracks/pattern.cpp:
|
||||
only repaint if neccessary, otherwise just paint the pixmap we painted
|
||||
before
|
||||
|
||||
* include/bb_editor.h:
|
||||
* src/core/bb_editor.cpp:
|
||||
added combobox for selecting bb-track inside bb-editor
|
||||
|
||||
* include/combobox.h:
|
||||
* src/widgets/combobox.cpp:
|
||||
- added clear()-method
|
||||
- do not crash when having no items
|
||||
- scale pixmap to fit into combobox
|
||||
- place menu below combobox if possible
|
||||
|
||||
2006-01-21 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/track.h:
|
||||
* src/core/track.cpp:
|
||||
* src/tracks/pattern.cpp:
|
||||
* src/tracks/sample_track.cpp:
|
||||
added support for used-defined track-height by pressing <Shift> and
|
||||
move mouse (with pressed button)
|
||||
|
||||
* include/song_editor.h:
|
||||
* include/track.h:
|
||||
* include/track_container.h:
|
||||
* src/core/song_editor.cpp:
|
||||
* src/core/track.cpp:
|
||||
* src/core/track_container.cpp:
|
||||
take advantage of new rubberband:
|
||||
- selecting track-content-objects of any type either via rubberband or
|
||||
by clicking while pressing <Ctrl>
|
||||
- move selected track-content-objects
|
||||
- delete selected track-content-objects
|
||||
|
||||
* include/rubberband.h:
|
||||
* src/widgets/rubberband.cpp:
|
||||
added rubberband which either acts as wrapper for Qt4's QRubberBand or
|
||||
as a widget imitating a rubberband
|
||||
|
||||
* include/track.h:
|
||||
* src/core/track.cpp:
|
||||
draw vertical lines for each bar
|
||||
|
||||
* include/bb_editor.h:
|
||||
* include/song_editor.h:
|
||||
* include/track_container.h:
|
||||
* src/core/bb_editor.cpp:
|
||||
* src/core/song_editor.cpp:
|
||||
* src/core/track.cpp:
|
||||
* src/core/track_container.cpp:
|
||||
fixed all that stuff with annoying scrollbars which partly hid important
|
||||
widgets
|
||||
|
||||
2006-01-21 Andreas Brandmaier <andy/at/brandmaier.de>
|
||||
|
||||
* plugins/bit_invader/bit_invader.cpp
|
||||
* plugins/bit_invader/bit_invader.h
|
||||
added smooth button
|
||||
|
||||
2006-01-20 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/tracks/pattern.cpp:
|
||||
also update after clearing all notes
|
||||
|
||||
* include/piano_roll.h:
|
||||
* include/song_editor.h:
|
||||
* src/core/piano_roll.cpp:
|
||||
* src/core/song_editor.cpp:
|
||||
use new combobox for zooming-comboboxes
|
||||
|
||||
* include/export_project_dialog.h:
|
||||
* src/core/export_project_dialog.cpp:
|
||||
- reject() dialog when pressing cancel
|
||||
- use new combobox
|
||||
|
||||
* include/arp_and_chords_tab_widget.h:
|
||||
* src/core/arp_and_chords_tab_widget.cpp:
|
||||
use new combobox with according arpeggio-mode-icons
|
||||
|
||||
* include/envelope_tab_widget.h:
|
||||
* src/core/envelope_tab_widget.cpp:
|
||||
* resources/filter_2lp.png:
|
||||
* resources/filter_ap.png:
|
||||
* resources/filter_bp.png:
|
||||
* resources/filter_hp.png:
|
||||
* resources/filter_lp.png:
|
||||
use new combobox with according filter-icons
|
||||
|
||||
* include/combobox.h:
|
||||
* src/widgets/combobox.cpp:
|
||||
added own cool-looking combobox with menu-extension which basically
|
||||
has the same API as QComboBox
|
||||
|
||||
2006-01-19 Andreas M. Brandmaier <andy/at/brandmaier.de>
|
||||
|
||||
* plugins/bit_invader/bit_invader.h:
|
||||
* plugins/bit_invader/bit_invader.cpp:
|
||||
* plugins/bit_invader/graph.h:
|
||||
* plugins/bit_invader/graph.cpp:
|
||||
added "BitInvader"-plugin, an usereditable wavetable-synthesizer
|
||||
|
||||
2006-01-16 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/lib/mmp.cpp:
|
||||
do not add "mmp"-extensions if there's already "mpt" (multimedia-
|
||||
project-template) as extension
|
||||
|
||||
* include/arp_and_chords_tab_widget.h:
|
||||
* src/core/arp_and_chords_tab_widget.cpp:
|
||||
- added new sync-mode to arpeggiator
|
||||
- arpeggiator-modes are now selectable from combobox
|
||||
|
||||
2006-01-15 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/core/file_browser.cpp:
|
||||
use 7.5 instead of 8 as font-size
|
||||
|
||||
* src/widgets/led_checkbox.cpp:
|
||||
use 7.5 instead of 7 as font-size
|
||||
|
||||
* include/gui_templates.h:
|
||||
- added more precise pointSizeF()-method
|
||||
- more precise point-size-calculation for pointSize()-method which
|
||||
makes all fonts inside LMMS a bit bigger and everything more
|
||||
readable
|
||||
|
||||
* include/setup_dialog.h:
|
||||
* src/core/note_play_handle.cpp:
|
||||
* src/core/setup_dialog.cpp:
|
||||
* src/tracks/channel_track.cpp:
|
||||
added switches for disabling several UI-effects for a better
|
||||
performance even on older hardware
|
||||
|
||||
* include/preset_preview_play_handle.h:
|
||||
* src/core/preset_preview_play_handle.cpp:
|
||||
global-data-mutex is not a pointer anymore, instead it's a normal
|
||||
QMutex - fixes crashes with sort-arpeggio if no preset was previewed
|
||||
before
|
||||
|
||||
2006-01-14 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/widgets/kmultitabbar.cpp:
|
||||
made KMultiTabBar working with Qt4
|
||||
|
||||
* src/audio/audio_jack.cpp:
|
||||
return if connection to JACK-server failed with old JACK-API
|
||||
(jack_client_new(...)) - fixes crash when using old JACK-API with
|
||||
LMMS and JACK-server is not running
|
||||
|
||||
* include/preset_preview_play_handle.h:
|
||||
* src/core/arp_and_chords_tab_widget.cpp:
|
||||
* src/core/preset_preview_play_handle.cpp:
|
||||
as preset-note-play-handle is not registered at mixer, it cannot be
|
||||
returned in notePlayHandle::nphsOfChannelTrack() and therefore
|
||||
previewing presets with sort-mode arpeggios doesn't work - now the
|
||||
arpeggiator also checks preview-note for being the only note there
|
||||
|
||||
* src/core/arp_and_chords_tab_widget.cpp:
|
||||
fixed some bugs in arpeggiator
|
||||
|
||||
* src/core/piano_roll.cpp:
|
||||
lock qapp-thread in recordNote() - hopefully fixes some
|
||||
xlib-async-errors
|
||||
|
||||
* src/tracks/channel_track.cpp:
|
||||
- do not process note-on-out-events if according key is already pressed
|
||||
- when invalidating note-play-handles, also reset m_notes-array for not
|
||||
crashing when applying another preset while key is pressed and
|
||||
released afterwards
|
||||
|
||||
2006-01-10 Alexey Kouznetsov <alexey.kouznetsov/at/gmail.com>
|
||||
|
||||
* locale/ru.ts:
|
||||
updated Russian translation
|
||||
|
||||
2006-01-10 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/core/piano_roll.cpp:
|
||||
update pattern after changing volume of step-note
|
||||
|
||||
2006-01-09 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/setup_dialog.h:
|
||||
* src/core/config_mgr.cpp:
|
||||
* src/core/setup_dialog.cpp:
|
||||
made appearence of two dialogs switchable (question whether to re-run
|
||||
wizard after up-/downgrade and message after accepting setup-dialog)
|
||||
|
||||
2006-01-08 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/piano_roll.h:
|
||||
* src/core/piano_roll.cpp:
|
||||
* src/tracks/pattern.cpp:
|
||||
simple support for editing (existing) steps in piano-roll, e.g. for
|
||||
changing key of a step
|
||||
|
||||
* plugins/vestige/vestige.cpp:
|
||||
per default switch to users VST-plugin-directory when opening plugin
|
||||
|
||||
* include/config_mgr.h:
|
||||
* include/setup_dialog.h:
|
||||
* src/core/config_mgr.cpp:
|
||||
* src/core/setup_dialog.cpp:
|
||||
added possibility to setup working-directory and location of VST-plugins
|
||||
|
||||
* src/widgets/tempo_sync_knob.cpp:
|
||||
removed a lot of obsolete #include's
|
||||
|
||||
* include/piano_widget.h:
|
||||
* src/core/note_play_handle.cpp:
|
||||
* src/core/piano_widget.cpp:
|
||||
display played keys as if they were pressed
|
||||
|
||||
* include/arp_and_chords_tab_widget.h:
|
||||
* include/note_play_handle.h:
|
||||
* src/core/arp_and_chords_tab_widget.cpp:
|
||||
* src/core/note_play_handle.cpp:
|
||||
added sort-mode for more powerful arpeggios
|
||||
|
||||
* src/core/arp_and_chords_tab_widget.cpp:
|
||||
fixed bug which made the arpeggiator skipping notes sometimes at
|
||||
certain arpeggio-times
|
||||
|
||||
* src/core/lmms_main_win.cpp:
|
||||
commented out code for creating effect-board-window-button
|
||||
|
||||
* src/core/channel_track.cpp:
|
||||
removed inclusion of paths.h which isn't part of LMMS for quite a long
|
||||
while... - there were no problems because Linux has paths.h too
|
||||
|
||||
2006-01-06 dieEasy <dieeasy/at/cheapnet.it>
|
||||
|
||||
* locale/it.ts:
|
||||
added Italian translation
|
||||
|
||||
2006-01-02 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/vestige.cpp:
|
||||
set vestige-logo as window-icon of plugin-GUI-window
|
||||
|
||||
* src/core/instrument.cpp:
|
||||
set logo of plugin as window-icon of channel-track
|
||||
|
||||
* include/dummy_instrument.h:
|
||||
* include/dummy_plugin.h:
|
||||
* include/instrument.h:
|
||||
* include/plugin.h:
|
||||
* src/core/instrument.cpp:
|
||||
* src/core/plugin.cpp:
|
||||
small changes in plugin-API: plugin now always has to pass pointer to
|
||||
plugin-descriptor to plugin-dtor to make the latter one able to
|
||||
provide several information
|
||||
|
||||
* src/core/plugin.cpp:
|
||||
search for plugin-libs in configManager::pluginDir() which is
|
||||
$prefix/lib/lmms - hopefully solves problems with finding plugins on
|
||||
some systems
|
||||
|
||||
* include/channel_track.h:
|
||||
* include/midi_tab_widget.h:
|
||||
* src/core/midi_tab_widget.cpp:
|
||||
* src/tracks/channel_track.cpp:
|
||||
when using Raw-MIDI-client, make items "MIDI input/output" checkable
|
||||
and enable/disable MIDI-input/output accordingly if user
|
||||
checked/unchecked it and update check-state if user changed MIDI-mode
|
||||
in midi-tab-widget in channel-track
|
||||
|
||||
* src/core/midi_tab_widget.cpp:
|
||||
set MIDI-output-channel to 1 per default
|
||||
|
||||
* src/lib/sample_buffer.cpp:
|
||||
added flac-files to filter of file-selection-dialog
|
||||
|
||||
* include/note_play_handle.h:
|
||||
* src/core/note_play_handle.cpp:
|
||||
when invalidating note-play-handle, do some stuff which actually would
|
||||
be done by dtor if m_channelTrack wouldn't be NULL
|
||||
|
||||
2006-01-01 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/core/track.cpp:
|
||||
added tooltip to track-op-widget telling the user something about
|
||||
drag'n'drop-functionality...
|
||||
|
||||
* include/lmms_main_win.h:
|
||||
* src/core/lmms_main_win.cpp:
|
||||
* src/lib/string_pair_drag.cpp:
|
||||
if main-window looses focus or a drag is completed, clear
|
||||
key-modifiers of LMMS-main-window, because we might have lost
|
||||
key-release-events in these cases and therefore our modifier-state-map
|
||||
could be incorrect - fixes several bugs concerning drag'n'drop
|
||||
|
||||
* README:
|
||||
* src/core/about_dialog.cpp:
|
||||
extended copyright from 2005 to 2006 - Happy New Year!
|
||||
|
||||
2005-12-31 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/channel_track.h:
|
||||
* src/tracks/channel_track.cpp:
|
||||
removed surround-area in track-settings-widget and added button with
|
||||
MIDI-connection-menu instead
|
||||
|
||||
2005-12-30 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/track.h:
|
||||
* include/track_container.h:
|
||||
* src/core/track.cpp:
|
||||
* src/core/track_container.cpp:
|
||||
revised all the things around track-operations:
|
||||
- tracks are now directly movable via the grip at the beginning of a
|
||||
track - replaces "move up/down"-buttons and is much more usable
|
||||
- actions (clone/delete track) are now part of a popup-menu
|
||||
|
||||
* src/core/lmms_main_win.cpp:
|
||||
- corrected file-description at the beginning
|
||||
- add space at left side before adding tool-buttons
|
||||
|
||||
* src/core/midi_tab_widget.cpp:
|
||||
use smaller font for connection-selection-menu
|
||||
|
||||
2005-12-29 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/widgets/fade_button.cpp:
|
||||
do not update() directly in nextState(), use QTimer instead for avoiding
|
||||
xlib-threading-errors
|
||||
|
||||
2005-12-28 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/communication.h:
|
||||
* plugins/vestige/fstclient.cpp:
|
||||
* plugins/vestige/fstclient.h:
|
||||
* plugins/vestige/fstserver.cpp:
|
||||
* plugins/vestige/vestige.cpp:
|
||||
* plugins/vestige/vestige.h:
|
||||
- support for telling plugin current BPM, also catches BPM-changes
|
||||
- handle plugins without GUI correctly
|
||||
|
||||
* include/tool_button.h:
|
||||
* src/widgets/tool_button.cpp:
|
||||
catch toggle-signals to emit clicked()-signal which is neccessary if a
|
||||
button is checked using setChecked()-method and not by the user -
|
||||
fixes some bugs with piano-roll
|
||||
|
||||
* include/piano_roll.h:
|
||||
* src/core/piano_roll.cpp:
|
||||
- show text-float after user copied notes
|
||||
- do not play note when just moving selection
|
||||
- when update()ing paint everything in a pixmap which is painted in
|
||||
paintEvent() - saves all the repaints everytime mouse-cursor is moved
|
||||
and makes painting tool-cursor possible again
|
||||
|
||||
* src/tracks/channel_track.cpp:
|
||||
corrected calculation in channelTrack::masterKey()
|
||||
|
||||
2005-12-27 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/piano_roll.h:
|
||||
* src/core/piano_roll.cpp:
|
||||
always reset cursor when receiving leave-event
|
||||
|
||||
* include/channel_track.h:
|
||||
* src/tracks/channel_track.cpp:
|
||||
use new fade-button as MIDI-event-indicator as well as simple
|
||||
play-default-tone-button
|
||||
|
||||
* include/fade_button.h:
|
||||
* src/widgets/fade_button.cpp:
|
||||
added fade-button which can be activated and fades back to
|
||||
default-color afterwards
|
||||
|
||||
* src/core/arp_and_chords_tab_widget.cpp:
|
||||
* src/core/envelope_and_lfo_widget.cpp:
|
||||
* src/core/envelope_tab_widget.cpp:
|
||||
* src/core/midi_tab_widget.cpp:
|
||||
* src/core/note.cpp:
|
||||
* src/core/song_editor.cpp:
|
||||
* src/core/track.cpp:
|
||||
* src/tracks/bb_track.cpp:
|
||||
* src/tracks/channel_track.cpp:
|
||||
* src/tracks/sample_track.cpp:
|
||||
do not use QString::number() for saving scalar value with
|
||||
setAttribute() as it is obsolete
|
||||
|
||||
* src/audio/audio_alsa.cpp:
|
||||
* src/audio/audio_oss.cpp:
|
||||
start audio-thread with QThread::HightestPriority for having less xruns
|
||||
|
||||
* src/tracks/pattern.cpp:
|
||||
save m_steps-property, otherwise restoring it in loadSettings() makes
|
||||
no sense... - fixes bug which caused LMMS to always reset number of
|
||||
steps to 16 when loading files, even if the user created patterns
|
||||
containing more than 16 steps
|
||||
|
||||
* include/audio_dummy.h:
|
||||
- fixed missing implementation of thread running the whole time and
|
||||
calling audioDevice::processNextBuffer() -> fixes bugs & lockups when
|
||||
using audio-dummy-driver
|
||||
- thread now always waits the amount of time that is left for the
|
||||
current buffer, so if rendering of current buffer went faster than
|
||||
in realtime, the song doesn't play at a higher speed
|
||||
|
||||
2005-12-26 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/vestige.cpp:
|
||||
determine real key of note using channelTrack::masterKey
|
||||
|
||||
* include/micro_timer.h:
|
||||
moved micro-timer-class from mixer.cpp in separate header for being
|
||||
available to all modules of LMMS
|
||||
|
||||
* src/core/mixer.cpp:
|
||||
added metronome-sounds when recording in piano-roll
|
||||
|
||||
* src/lib/sample_buffer.cpp:
|
||||
- added resample()-method for resampling whole sample-buffer
|
||||
- after libsndfile try to load sample with libvorbis instead of
|
||||
SDL_sound as the latter one seems to be buggy on few systems and
|
||||
leads to unexpected crashes
|
||||
- if sample-decoder doesn't resample sample automatically, do it
|
||||
afterwards using resample()
|
||||
|
||||
* src/core/track_container.cpp:
|
||||
accept drops of type samplefile and sampledata too and create new
|
||||
channel-track with AudioFileProcessor
|
||||
|
||||
* plugins/audio_file_processor/audio_file_processor.cpp:
|
||||
save/load sample-data which was dragged on plugin in settings
|
||||
|
||||
* src/core/track.cpp:
|
||||
display correct length and now additionally start- and end-position of
|
||||
track-content-object
|
||||
|
||||
* include/bb_track.h:
|
||||
* src/tracks/bb_track.cpp:
|
||||
do not align position and length of bb-track-objects on tact-boundaries
|
||||
as it offers an interesting new feature (incomplete/start beats etc.!)
|
||||
|
||||
2005-12-25 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/widgets/visualization_widget.cpp:
|
||||
enable visualization-widget per default
|
||||
|
||||
* plugins/vestige/vestige.cpp:
|
||||
- do not crash when loading settings with empty plugin-attribute (e.g.
|
||||
older projects/presets)
|
||||
- set channel-name according to plugin-name
|
||||
- added note-off-button for being able to note off hanging notes
|
||||
(which sometimes occurs in combination with arpeggios)
|
||||
|
||||
2005-12-24 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/vestige.cpp:
|
||||
use new parameter-saving/loading-feature when saving/loading settings
|
||||
|
||||
* plugins/vestige/communication.h:
|
||||
* plugins/vestige/fstclient.cpp:
|
||||
* plugins/vestige/fstclient.h:
|
||||
* plugins/vestige/fstserver.cpp:
|
||||
* plugins/vestige/fstserver.h:
|
||||
* plugins/vestige/fstcore.c:
|
||||
- added support for saving/loading parameters which almost completes
|
||||
LMMS's rudimentary VST-support
|
||||
- support for querying parameter-properties
|
||||
- some changes in initialization of plugin
|
||||
|
||||
* src/tracks/pattern.cpp:
|
||||
pass unused wheel-events to trackContentObect for being able to scroll
|
||||
within song-editor
|
||||
|
||||
2005-12-23 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/fstcore.c:
|
||||
a lot of clean-ups and other bug-fixes making VeSTige almost usable
|
||||
and stable
|
||||
|
||||
* plugins/vestige/fstclient.h:
|
||||
* plugins/vestige/fstclient.cpp:
|
||||
save PID of children when fork()ing XFST-server which is used for
|
||||
sending SIGTERM when destroying everything
|
||||
|
||||
* plugins/vestige/communication.h:
|
||||
* plugins/vestige/fstclient.cpp:
|
||||
* plugins/vestige/fstserver.cpp:
|
||||
* plugins/vestige/fstcore.c:
|
||||
do not show editor until client created x11-embed-widget - solves
|
||||
problems with not-embedded plugins under KDE
|
||||
|
||||
* plugins/vestige/fstserver.cpp:
|
||||
rewrote MIDI-enqueueing-code as the old one was very buggy and
|
||||
unreliable
|
||||
|
||||
* plugins/vestige/vestige.h:
|
||||
* plugins/vestige/vestige.cpp:
|
||||
added mutex for plugin which solves some problems
|
||||
|
||||
* include/mixer.h:
|
||||
* src/core/mixer.cpp:
|
||||
per default clear all play-handles but instrument-play-handles in
|
||||
mixer::clear() as instrument-playhandles normally exist during the
|
||||
whole life-time of a certain plugin and must not be deleted when just
|
||||
stopping song etc.
|
||||
|
||||
* include/play_handle.h:
|
||||
added type-information, so every derived class has to pass a
|
||||
type-constant to playHandle-constructor
|
||||
|
||||
2005-12-22 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* configure.in:
|
||||
made 0.1.2 release
|
||||
|
||||
2006-01-02 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/vestige.cpp:
|
||||
set vestige-logo as window-icon of plugin-GUI-window
|
||||
|
||||
* src/core/instrument.cpp:
|
||||
set logo of plugin as window-icon of channel-track
|
||||
|
||||
* include/dummy_instrument.h:
|
||||
* include/dummy_plugin.h:
|
||||
* include/instrument.h:
|
||||
* include/plugin.h:
|
||||
* src/core/instrument.cpp:
|
||||
* src/core/plugin.cpp:
|
||||
small changes in plugin-API: plugin now always has to pass pointer to
|
||||
plugin-descriptor to plugin-dtor to make the latter one able to
|
||||
provide several information
|
||||
|
||||
* src/core/plugin.cpp:
|
||||
search for plugin-libs in configManager::pluginDir() which is
|
||||
$prefix/lib/lmms - hopefully solves problems with finding plugins on
|
||||
some systems
|
||||
|
||||
* include/channel_track.h:
|
||||
* include/midi_tab_widget.h:
|
||||
* src/core/midi_tab_widget.cpp:
|
||||
* src/tracks/channel_track.cpp:
|
||||
when using Raw-MIDI-client, make items "MIDI input/output" checkable
|
||||
and enable/disable MIDI-input/output accordingly if user
|
||||
checked/unchecked it and update check-state if user changed MIDI-mode
|
||||
in midi-tab-widget in channel-track
|
||||
|
||||
* src/core/midi_tab_widget.cpp:
|
||||
set MIDI-output-channel to 1 per default
|
||||
|
||||
* src/lib/sample_buffer.cpp:
|
||||
added flac-files to filter of file-selection-dialog
|
||||
|
||||
* include/note_play_handle.h:
|
||||
* src/core/note_play_handle.cpp:
|
||||
when invalidating note-play-handle, do some stuff which actually would
|
||||
be done by dtor if m_channelTrack wouldn't be NULL
|
||||
|
||||
2006-01-01 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/core/track.cpp:
|
||||
added tooltip to track-op-widget telling the user something about
|
||||
drag'n'drop-functionality...
|
||||
|
||||
* include/lmms_main_win.h:
|
||||
* src/core/lmms_main_win.cpp:
|
||||
* src/lib/string_pair_drag.cpp:
|
||||
if main-window looses focus or a drag is completed, clear
|
||||
key-modifiers of LMMS-main-window, because we might have lost
|
||||
key-release-events in these cases and therefore our modifier-state-map
|
||||
could be incorrect - fixes several bugs concerning drag'n'drop
|
||||
|
||||
* README:
|
||||
* src/core/about_dialog.cpp:
|
||||
extended copyright from 2005 to 2006 - Happy New Year!
|
||||
|
||||
2005-12-31 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/channel_track.h:
|
||||
* src/tracks/channel_track.cpp:
|
||||
removed surround-area in track-settings-widget and added button with
|
||||
MIDI-connection-menu instead
|
||||
|
||||
2005-12-30 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/track.h:
|
||||
* include/track_container.h:
|
||||
* src/core/track.cpp:
|
||||
* src/core/track_container.cpp:
|
||||
revised all the things around track-operations:
|
||||
- tracks are now directly movable via the grip at the beginning of a
|
||||
track - replaces "move up/down"-buttons and is much more usable
|
||||
- actions (clone/delete track) are now part of a popup-menu
|
||||
|
||||
* src/core/lmms_main_win.cpp:
|
||||
- corrected file-description at the beginning
|
||||
- add space at left side before adding tool-buttons
|
||||
|
||||
* src/core/midi_tab_widget.cpp:
|
||||
use smaller font for connection-selection-menu
|
||||
|
||||
2005-12-29 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/widgets/fade_button.cpp:
|
||||
do not update() directly in nextState(), use QTimer instead for avoiding
|
||||
xlib-threading-errors
|
||||
|
||||
2005-12-28 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/communication.h:
|
||||
* plugins/vestige/fstclient.cpp:
|
||||
* plugins/vestige/fstclient.h:
|
||||
* plugins/vestige/fstserver.cpp:
|
||||
* plugins/vestige/vestige.cpp:
|
||||
* plugins/vestige/vestige.h:
|
||||
- support for telling plugin current BPM, also catches BPM-changes
|
||||
- handle plugins without GUI correctly
|
||||
|
||||
* include/tool_button.h:
|
||||
* src/widgets/tool_button.cpp:
|
||||
catch toggle-signals to emit clicked()-signal which is neccessary if a
|
||||
button is checked using setChecked()-method and not by the user -
|
||||
fixes some bugs with piano-roll
|
||||
|
||||
* include/piano_roll.h:
|
||||
* src/core/piano_roll.cpp:
|
||||
- show text-float after user copied notes
|
||||
- do not play note when just moving selection
|
||||
- when update()ing paint everything in a pixmap which is painted in
|
||||
paintEvent() - saves all the repaints everytime mouse-cursor is moved
|
||||
and makes painting tool-cursor possible again
|
||||
|
||||
* src/tracks/channel_track.cpp:
|
||||
corrected calculation in channelTrack::masterKey()
|
||||
|
||||
2005-12-27 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* include/piano_roll.h:
|
||||
* src/core/piano_roll.cpp:
|
||||
always reset cursor when receiving leave-event
|
||||
|
||||
* include/channel_track.h:
|
||||
* src/tracks/channel_track.cpp:
|
||||
use new fade-button as MIDI-event-indicator as well as simple
|
||||
play-default-tone-button
|
||||
|
||||
* include/fade_button.h:
|
||||
* src/widgets/fade_button.cpp:
|
||||
added fade-button which can be activated and fades back to
|
||||
default-color afterwards
|
||||
|
||||
* src/core/arp_and_chords_tab_widget.cpp:
|
||||
* src/core/envelope_and_lfo_widget.cpp:
|
||||
* src/core/envelope_tab_widget.cpp:
|
||||
* src/core/midi_tab_widget.cpp:
|
||||
* src/core/note.cpp:
|
||||
* src/core/song_editor.cpp:
|
||||
* src/core/track.cpp:
|
||||
* src/tracks/bb_track.cpp:
|
||||
* src/tracks/channel_track.cpp:
|
||||
* src/tracks/sample_track.cpp:
|
||||
do not use QString::number() for saving scalar value with
|
||||
setAttribute() as it is obsolete
|
||||
|
||||
* src/audio/audio_alsa.cpp:
|
||||
* src/audio/audio_oss.cpp:
|
||||
start audio-thread with QThread::HightestPriority for having less xruns
|
||||
|
||||
* src/tracks/pattern.cpp:
|
||||
save m_steps-property, otherwise restoring it in loadSettings() makes
|
||||
no sense... - fixes bug which caused LMMS to always reset number of
|
||||
steps to 16 when loading files, even if the user created patterns
|
||||
containing more than 16 steps
|
||||
|
||||
* include/audio_dummy.h:
|
||||
- fixed missing implementation of thread running the whole time and
|
||||
calling audioDevice::processNextBuffer() -> fixes bugs & lockups when
|
||||
using audio-dummy-driver
|
||||
- thread now always waits the amount of time that is left for the
|
||||
current buffer, so if rendering of current buffer went faster than
|
||||
in realtime, the song doesn't play at a higher speed
|
||||
|
||||
2005-12-26 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/vestige.cpp:
|
||||
determine real key of note using channelTrack::masterKey
|
||||
|
||||
* include/micro_timer.h:
|
||||
moved micro-timer-class from mixer.cpp in separate header for being
|
||||
available to all modules of LMMS
|
||||
|
||||
* src/core/mixer.cpp:
|
||||
added metronome-sounds when recording in piano-roll
|
||||
|
||||
* src/lib/sample_buffer.cpp:
|
||||
- added resample()-method for resampling whole sample-buffer
|
||||
- after libsndfile try to load sample with libvorbis instead of
|
||||
SDL_sound as the latter one seems to be buggy on few systems and
|
||||
leads to unexpected crashes
|
||||
- if sample-decoder doesn't resample sample automatically, do it
|
||||
afterwards using resample()
|
||||
|
||||
* src/core/track_container.cpp:
|
||||
accept drops of type samplefile and sampledata too and create new
|
||||
channel-track with AudioFileProcessor
|
||||
|
||||
* plugins/audio_file_processor/audio_file_processor.cpp:
|
||||
save/load sample-data which was dragged on plugin in settings
|
||||
|
||||
* src/core/track.cpp:
|
||||
display correct length and now additionally start- and end-position of
|
||||
track-content-object
|
||||
|
||||
* include/bb_track.h:
|
||||
* src/tracks/bb_track.cpp:
|
||||
do not align position and length of bb-track-objects on tact-boundaries
|
||||
as it offers an interesting new feature (incomplete/start beats etc.!)
|
||||
|
||||
2005-12-25 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/widgets/visualization_widget.cpp:
|
||||
enable visualization-widget per default
|
||||
|
||||
* plugins/vestige/vestige.cpp:
|
||||
- do not crash when loading settings with empty plugin-attribute (e.g.
|
||||
older projects/presets)
|
||||
- set channel-name according to plugin-name
|
||||
- added note-off-button for being able to note off hanging notes
|
||||
(which sometimes occurs in combination with arpeggios)
|
||||
|
||||
2005-12-24 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/vestige.cpp:
|
||||
use new parameter-saving/loading-feature when saving/loading settings
|
||||
|
||||
* plugins/vestige/communication.h:
|
||||
* plugins/vestige/fstclient.cpp:
|
||||
* plugins/vestige/fstclient.h:
|
||||
* plugins/vestige/fstserver.cpp:
|
||||
* plugins/vestige/fstserver.h:
|
||||
* plugins/vestige/fstcore.c:
|
||||
- added support for saving/loading parameters which almost completes
|
||||
LMMS's rudimentary VST-support
|
||||
- support for querying parameter-properties
|
||||
- some changes in initialization of plugin
|
||||
|
||||
* src/tracks/pattern.cpp:
|
||||
pass unused wheel-events to trackContentObect for being able to scroll
|
||||
within song-editor
|
||||
|
||||
2005-12-23 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* plugins/vestige/fstcore.c:
|
||||
a lot of clean-ups and other bug-fixes making VeSTige almost usable
|
||||
and stable
|
||||
|
||||
* plugins/vestige/fstclient.h:
|
||||
* plugins/vestige/fstclient.cpp:
|
||||
save PID of children when fork()ing XFST-server which is used for
|
||||
sending SIGTERM when destroying everything
|
||||
|
||||
* plugins/vestige/communication.h:
|
||||
* plugins/vestige/fstclient.cpp:
|
||||
* plugins/vestige/fstserver.cpp:
|
||||
* plugins/vestige/fstcore.c:
|
||||
do not show editor until client created x11-embed-widget - solves
|
||||
problems with not-embedded plugins under KDE
|
||||
|
||||
* plugins/vestige/fstserver.cpp:
|
||||
rewrote MIDI-enqueueing-code as the old one was very buggy and
|
||||
unreliable
|
||||
|
||||
* plugins/vestige/vestige.h:
|
||||
* plugins/vestige/vestige.cpp:
|
||||
added mutex for plugin which solves some problems
|
||||
|
||||
* include/mixer.h:
|
||||
* src/core/mixer.cpp:
|
||||
per default clear all play-handles but instrument-play-handles in
|
||||
mixer::clear() as instrument-playhandles normally exist during the
|
||||
whole life-time of a certain plugin and must not be deleted when just
|
||||
stopping song etc.
|
||||
|
||||
* include/play_handle.h:
|
||||
added type-information, so every derived class has to pass a
|
||||
type-constant to playHandle-constructor
|
||||
|
||||
2005-12-22 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* configure.in:
|
||||
made 0.1.2 release
|
||||
|
||||
>>>>>>> 1.27
|
||||
2005-12-21 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
|
||||
* src/lib/sample_buffer.cpp:
|
||||
@@ -860,7 +1780,7 @@
|
||||
|
||||
* include/song_editor.h:
|
||||
* src/core/song_editor.cpp:
|
||||
added combo-box for selecting zooming-factor
|
||||
added combo-box for selectinf zooming-factor
|
||||
|
||||
* include/piano_roll.h:
|
||||
* src/core/piano_roll.cpp:
|
||||
|
||||
22
Makefile.am
22
Makefile.am
@@ -40,6 +40,8 @@ AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS)
|
||||
$(LRELEASE) $<
|
||||
|
||||
|
||||
man1_MANS = lmms.1
|
||||
|
||||
|
||||
lmms_MOC = \
|
||||
./about_dialog.moc \
|
||||
@@ -47,14 +49,17 @@ lmms_MOC = \
|
||||
./bb_editor.moc \
|
||||
./bb_track.moc \
|
||||
./channel_track.moc \
|
||||
./combobox.moc \
|
||||
./config_mgr.moc \
|
||||
./cpuload_widget.moc \
|
||||
./envelope_and_lfo_widget.moc \
|
||||
./envelope_tab_widget.moc \
|
||||
./export_project_dialog.moc \
|
||||
./fade_button.moc \
|
||||
./file_browser.moc \
|
||||
./group_box.moc \
|
||||
./kmultitabbar.moc \
|
||||
./kmultitabbar-qt3.moc \
|
||||
./knob.moc \
|
||||
./lcd_spinbox.moc \
|
||||
./led_checkbox.moc \
|
||||
@@ -70,6 +75,7 @@ lmms_MOC = \
|
||||
./pixmap_button.moc \
|
||||
./plugin_browser.moc \
|
||||
./project_notes.moc \
|
||||
./rubberband.moc \
|
||||
./qxembed.moc \
|
||||
./rename_dialog.moc \
|
||||
./sample_buffer.moc \
|
||||
@@ -84,6 +90,7 @@ lmms_MOC = \
|
||||
./tab_widget.moc \
|
||||
./tempo_sync_knob.moc \
|
||||
./timeline.moc \
|
||||
./tool_button.moc \
|
||||
./track_container.moc \
|
||||
./track.moc \
|
||||
./visualization_widget.moc
|
||||
@@ -138,6 +145,7 @@ lmms_SOURCES = \
|
||||
$(srcdir)/src/core/track_container.cpp \
|
||||
$(srcdir)/src/core/surround_area.cpp \
|
||||
$(srcdir)/src/core/timeline.cpp \
|
||||
$(srcdir)/src/lib/base64.cpp \
|
||||
$(srcdir)/src/lib/buffer_allocator.cpp \
|
||||
$(srcdir)/src/lib/clipboard.cpp \
|
||||
$(srcdir)/src/lib/embed.cpp \
|
||||
@@ -157,7 +165,9 @@ lmms_SOURCES = \
|
||||
$(srcdir)/src/tracks/channel_track.cpp \
|
||||
$(srcdir)/src/tracks/pattern.cpp \
|
||||
$(srcdir)/src/tracks/sample_track.cpp \
|
||||
$(srcdir)/src/widgets/combobox.cpp \
|
||||
$(srcdir)/src/widgets/cpuload_widget.cpp \
|
||||
$(srcdir)/src/widgets/fade_button.cpp \
|
||||
$(srcdir)/src/widgets/group_box.cpp \
|
||||
$(srcdir)/src/widgets/kmultitabbar.cpp \
|
||||
$(srcdir)/src/widgets/knob.cpp \
|
||||
@@ -166,6 +176,7 @@ lmms_SOURCES = \
|
||||
$(srcdir)/src/widgets/nstate_button.cpp \
|
||||
$(srcdir)/src/widgets/pixmap_button.cpp \
|
||||
$(srcdir)/src/widgets/project_notes.cpp \
|
||||
$(srcdir)/src/widgets/rubberband.cpp \
|
||||
$(srcdir)/src/widgets/qxembed.cpp \
|
||||
$(srcdir)/src/widgets/rename_dialog.cpp \
|
||||
$(srcdir)/src/widgets/side_bar_widget.cpp \
|
||||
@@ -224,6 +235,7 @@ lmms_SOURCES = \
|
||||
$(srcdir)/include/gui_templates.h \
|
||||
$(srcdir)/include/surround_area.h \
|
||||
$(srcdir)/include/kmultitabbar.h \
|
||||
$(srcdir)/include/kmultitabbar-qt3.h \
|
||||
$(srcdir)/include/side_bar.h \
|
||||
$(srcdir)/include/side_bar_widget.h \
|
||||
$(srcdir)/include/track.h \
|
||||
@@ -276,11 +288,16 @@ lmms_SOURCES = \
|
||||
$(srcdir)/include/tool_button.h \
|
||||
$(srcdir)/include/cpuload_widget.h \
|
||||
$(srcdir)/include/midi_alsa_seq.h \
|
||||
$(srcdir)/include/micro_timer.h \
|
||||
$(srcdir)/include/fade_button.h \
|
||||
$(srcdir)/include/combobox.h \
|
||||
$(srcdir)/include/rubberband.h \
|
||||
$(srcdir)/include/base64.h \
|
||||
$(srcdir)/include/qxembed.h
|
||||
|
||||
|
||||
|
||||
EXTRA_DIST = $(lmms_EMBEDDED_RESOURCES) aeffectx_h_fix.patch
|
||||
EXTRA_DIST = $(lmms_EMBEDDED_RESOURCES) vst_sdk23_headers.diff lmms.1
|
||||
|
||||
|
||||
CLEANFILES = $(lmms_MOC) ./embedded_resources.h
|
||||
@@ -314,5 +331,6 @@ LIB_SF_LDADD = -lsndfile
|
||||
endif
|
||||
|
||||
lmms_LDADD = $(QT_LDADD) $(LIB_SDL_LDADD) $(LIB_ASOUND_LDADD) $(LIB_JACK_LDADD) $(LIB_SDL_SOUND_LDADD) $(LIB_VORBIS_LDADD) $(LIB_SRC_LDADD) $(LIB_SF_LDADD) $(LIB_FST_LDADD) -ldl
|
||||
lmms_LDFLAGS = -rdynamic -rpath $(pkglibdir)
|
||||
lmms_LDFLAGS = -rdynamic
|
||||
#-rpath $(pkglibdir)
|
||||
|
||||
|
||||
4
README
4
README
@@ -1,7 +1,7 @@
|
||||
Linux MultiMedia Studio 0.1.2
|
||||
==============================
|
||||
|
||||
Copyright (c) 2004-2005 by Tobias Doerffel and others.
|
||||
Copyright (c) 2004-2006 by Tobias Doerffel and others.
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@@ -45,7 +45,7 @@ LMMS working on a pentium I with 60 MHz... ;-) Therefore you should have at
|
||||
least 500 MHz, but for really enjoying LMMS less than 1 GHz makes no sense...
|
||||
|
||||
|
||||
Required libraries are:
|
||||
Required libraries:
|
||||
|
||||
- multithreaded version of Qt 3.0 (at least 3.2 recommended) or higher (tested
|
||||
up to 4.1.0) with devel-files
|
||||
|
||||
13
TODO
13
TODO
@@ -1,30 +1,27 @@
|
||||
to be done as soon as possible:
|
||||
|
||||
- do not skip samples because of rounding when resampling in src/lib/sample_buffer.cpp
|
||||
- autosave every 30s (configurable!) and offer recovery at startup after crash
|
||||
- make piano-roll use rubberband instead of implementing a simple one on it's own
|
||||
- level-meters in output-graph and channel-track
|
||||
- do not skip samples because of rounding-errors when resampling in src/lib/sample_buffer.cpp
|
||||
- MIDI-program/MIDI-mapping/process program-/channel-change-events from MIDI-files
|
||||
- do not allow to connect output-port of channel to own input-port!
|
||||
- add note-len- and note-alignment-selectbox to piano-roll
|
||||
- DSSI-support
|
||||
- save/load parameters of VST-plugin
|
||||
- somehow avoid hidden plugin-descriptor-widgets plugin-browser if height of window is too small -> add scrollbar
|
||||
- use drawLineF() for drawing notes in pattern::paintEvent() in qt4-version
|
||||
- only redraw region given by paint-event in pattern, bbTCO, sampleTCO etc.
|
||||
- pre-listen when opening sample with QFileDialog
|
||||
- level-meters in output-graph and channel-track
|
||||
- panning-editing in piano-roll
|
||||
- speed up painting of sampleTCO
|
||||
- save window-positions, -states and -sizes in files
|
||||
- solve problems with different keyboard-layouts when playing channel-track with pc-keyboard -> use tr()
|
||||
- balance env+lfo
|
||||
- autosave every 1 minute
|
||||
- audioDummy: always wait until the stuff normally would have been written (=simulate blocking IO)
|
||||
- panning env+lfo
|
||||
- plucked-string-synth: knob for metallic -> use noise as wave-shape
|
||||
- finish qt4-port and make LMMS usable when compiling with Qt4
|
||||
- rewrite export-project-dialog using layout-mechanism
|
||||
- dynamic pitch-change
|
||||
- make piano-roll use the global clipboard??
|
||||
- add more localizations:
|
||||
- Italian
|
||||
- Swedish
|
||||
- Norwegian
|
||||
- Greece
|
||||
|
||||
@@ -9,7 +9,7 @@ AC_ARG_WITH([qtdir], [ --with-qtdir=DIR Qt installation directory [defau
|
||||
# Check that QTDIR is defined or that --with-qtdir given
|
||||
if test x"$QTDIR" = x ; then
|
||||
# some usual Qt-locations
|
||||
QT_SEARCH="/usr /usr/lib/qt /usr/lib/qt3 /usr/lib/qt31 /usr/lib/qt32 /usr/lib/qt33 /usr/lib/qt-3.0 /usr/lib/qt-3.1 /usr/lib/qt-3.2 /usr/lib/qt-3.3 usr/local/qt /usr/local/qt3 /usr/local/qt31/ /usr/local/qt32 /usr/local/qt33 /usr/X11R6 /usr/local/Trolltech/Qt-4.0.0"
|
||||
QT_SEARCH="/usr /usr/lib/qt /usr/lib/qt3 /usr/lib/qt31 /usr/lib/qt32 /usr/lib/qt33 /usr/lib/qt-3.0 /usr/lib/qt-3.1 /usr/lib/qt-3.2 /usr/lib/qt-3.3 usr/local/qt /usr/local/qt3 /usr/local/qt31/ /usr/local/qt32 /usr/local/qt33 /usr/share/qt3 /usr/X11R6 /usr/share/qt4 /usr/local/Trolltech/Qt-4.0.0 /usr/local/Trolltech/Qt-4.0.1 /usr/local/Trolltech/Qt-4.1.0"
|
||||
else
|
||||
QT_SEARCH=$QTDIR
|
||||
QTDIR=""
|
||||
@@ -141,6 +141,7 @@ case "${host}" in
|
||||
QT_IS_MT="yes"
|
||||
QT_LIB="-lQtCore -lQtGui -lQtXml -lQt3Support"
|
||||
else
|
||||
QT_CXXFLAGS="-DQT3 $QT_CXXFLAGS"
|
||||
if test "x`ls $QTDIR/lib/libqt-mt.* 2> /dev/null`" != x ; then
|
||||
QT_LIB="-lqt-mt"
|
||||
QT_IS_MT="yes"
|
||||
|
||||
30
configure.in
30
configure.in
@@ -2,8 +2,8 @@
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ(2.50)
|
||||
AC_INIT(lmms, 0.1.1-cvs20051221, tobydox/at/users.sourceforge.net)
|
||||
AM_INIT_AUTOMAKE(lmms, 0.1.1-cvs20051221)
|
||||
AC_INIT(lmms, 0.1.4, tobydox/at/users/dot/sourceforge/dot/net)
|
||||
AM_INIT_AUTOMAKE(lmms, 0.1.4)
|
||||
|
||||
AM_CONFIG_HEADER(config.h)
|
||||
|
||||
@@ -22,7 +22,7 @@ gw_CHECK_QT
|
||||
# checks for header files.
|
||||
AC_HEADER_STDC
|
||||
AC_HEADER_SYS_WAIT
|
||||
AC_CHECK_HEADERS([fcntl.h memory.h string.h sys/ioctl.h unistd.h stdlib.h pthread.h sys/ipc.h sys/shm.h sys/time.h sys/select.h sys/types.h stdarg.h])
|
||||
AC_CHECK_HEADERS([fcntl.h memory.h string.h sys/ioctl.h unistd.h stdlib.h pthread.h sys/ipc.h sys/shm.h sys/time.h sys/select.h sys/types.h stdarg.h signal.h])
|
||||
|
||||
# checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_CONST
|
||||
@@ -160,9 +160,17 @@ AM_CONDITIONAL(HAVE_LIBJACK, test ! -z "$HAVE_JACK_JACK_H")
|
||||
AC_ARG_WITH(vst,
|
||||
AS_HELP_STRING([--with-vst],
|
||||
[enable support for builtin VST-plugin-hosting]), [ with_vst=yes ], [ with_vst=no ])
|
||||
AH_TEMPLATE(HAVE_VST_AEFFECTX_H, [Define to 1 if you have the <vst/aeffectx.h> header file.])
|
||||
AH_TEMPLATE(HAVE_VST_AEFFECTX_H, [Define to 1 if you have the <aeffectx.h> header file.])
|
||||
if test "x$with_vst" = "xyes" ; then
|
||||
AC_CHECK_HEADER(vst/aeffectx.h, HAVE_VST_AEFFECTX_H="true")
|
||||
|
||||
ORIG_CFLAGS=$CFLAGS
|
||||
ORIG_CPPFLAGS=$CPPFLAGS
|
||||
CFLAGS="$CLFAGS -I./include"
|
||||
CPPFLAGS="$CPPFLAGS -I./include"
|
||||
AC_CHECK_HEADER(aeffectx.h, HAVE_VST_AEFFECTX_H="true")
|
||||
CFLAGS="$ORIG_CFLAGS"
|
||||
CPPFLAGS="$ORIG_CPPFLAGS"
|
||||
|
||||
AC_CHECK_PROG(WINEGCC, winegcc, /usr/bin/winegcc,,/usr/bin)
|
||||
AC_CHECK_LIB([wine], [wine_init])
|
||||
if test ! -z "$WINEGCC" ; then
|
||||
@@ -405,16 +413,19 @@ fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
artwork/Makefile
|
||||
artwork/track_icons/Makefile
|
||||
buildtools/Makefile
|
||||
locale/Makefile
|
||||
midi-maps/Makefile
|
||||
plugins/Makefile
|
||||
plugins/audio_file_processor/Makefile
|
||||
plugins/bit_invader/Makefile
|
||||
plugins/plucked_string_synth/Makefile
|
||||
plugins/triple_oscillator/Makefile
|
||||
plugins/vestige/Makefile
|
||||
presets/Makefile
|
||||
presets/AudioFileProcessor/Makefile
|
||||
presets/BitInvader/Makefile
|
||||
presets/PluckedStringSynth/Makefile
|
||||
presets/TripleOscillator/Makefile
|
||||
presets/VeSTige/Makefile
|
||||
@@ -631,13 +642,14 @@ else
|
||||
echo " ="
|
||||
echo " = You seem to have a proper WINE-installation, but the header-files"
|
||||
echo " = (AEffect.h and aeffectx.h) from Steinberg-VST-SDK are missing or not present"
|
||||
echo " = in /usr/include/vst. We cannot distribute them as they're licensed under"
|
||||
echo " = in /usr/include/ or ./include. We cannot distribute them as they're licensed under"
|
||||
echo " = a GPL-incompatible license, so you'll have to download them at"
|
||||
echo " ="
|
||||
echo " = ftp://ext2asio:sdk1ext@ftp.pinnaclesys.com/SDK"
|
||||
echo " = http://www.steinberg.de/Steinberg/ygrabit/vstsdk/OnlineDoc/source/common/AEffect.h"
|
||||
echo " = http://www.steinberg.de/Steinberg/ygrabit/vstsdk/OnlineDoc/source/common/aeffectx.h"
|
||||
echo " ="
|
||||
echo " = and put the mentioned files into /usr/include/vst. Make sure, they're"
|
||||
echo " = patched with file aeffectx_h_fix.patch!"
|
||||
echo " = and put the mentioned files into /usr/include/ or ./include. Make sure,"
|
||||
echo "= they're patched with file vst_sdk23_headers.diff!"
|
||||
echo " = Otherwise (now!) configure will disable LMMS's support for built-in VST-"
|
||||
echo " = plugin-usage. If you do not intend to use VST-plugins with LMMS you can "
|
||||
echo " = ignore this warning."
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* arp_and_chords_tab_widget.h - declaration of class arpAndChordWidget which
|
||||
* provides code for using arpeggio and chords
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -47,12 +47,13 @@
|
||||
#include "types.h"
|
||||
|
||||
|
||||
class QComboBox;
|
||||
class QPixmap;
|
||||
|
||||
class channelTrack;
|
||||
class comboBox;
|
||||
class groupBox;
|
||||
class knob;
|
||||
class ledCheckBox;
|
||||
class notePlayHandle;
|
||||
class pixmapButton;
|
||||
class tempoSyncKnob;
|
||||
@@ -114,14 +115,21 @@ private:
|
||||
RANDOM
|
||||
} m_arpDirection;
|
||||
|
||||
enum arpModes
|
||||
{
|
||||
FREE,
|
||||
SORT,
|
||||
SYNC
|
||||
} ;
|
||||
|
||||
// chord-stuff
|
||||
groupBox * m_chordsGroupBox;
|
||||
QComboBox * m_chordsComboBox;
|
||||
comboBox * m_chordsComboBox;
|
||||
knob * m_chordRangeKnob;
|
||||
|
||||
// arpeggio-stuff
|
||||
groupBox * m_arpGroupBox;
|
||||
QComboBox * m_arpComboBox;
|
||||
comboBox * m_arpComboBox;
|
||||
knob * m_arpRangeKnob;
|
||||
tempoSyncKnob * m_arpTimeKnob;
|
||||
knob * m_arpGateKnob;
|
||||
@@ -132,6 +140,8 @@ private:
|
||||
pixmapButton * m_arpUpAndDownBtn;
|
||||
pixmapButton * m_arpRandomBtn;
|
||||
|
||||
comboBox * m_arpModeComboBox;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* audio_device.h - base-class for audio-devices, used by LMMS-mixer
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
public:
|
||||
setupWidget( const QString & _caption, QWidget * _parent ) :
|
||||
tabWidget( tabWidget::tr( "Settings for %1" ).arg(
|
||||
_caption ), _parent )
|
||||
_caption ).toUpper(), _parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -27,19 +27,22 @@
|
||||
#define _AUDIO_DUMMY_H
|
||||
|
||||
#include "audio_device.h"
|
||||
#include "micro_timer.h"
|
||||
|
||||
|
||||
class audioDummy : public audioDevice
|
||||
class audioDummy : public audioDevice, public QThread
|
||||
{
|
||||
public:
|
||||
audioDummy( Uint32 _sample_rate, bool & _success_ful ) :
|
||||
audioDevice( _sample_rate, DEFAULT_CHANNELS )
|
||||
audioDevice( _sample_rate, DEFAULT_CHANNELS ),
|
||||
m_quit( FALSE )
|
||||
{
|
||||
_success_ful = TRUE;
|
||||
}
|
||||
|
||||
virtual ~audioDummy()
|
||||
{
|
||||
stopProcessing();
|
||||
}
|
||||
|
||||
inline static QString name( void )
|
||||
@@ -68,8 +71,43 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
// TODO: derive from QThread and call getNextBuffer() in an
|
||||
// endless loop
|
||||
virtual void startProcessing( void )
|
||||
{
|
||||
start();
|
||||
}
|
||||
|
||||
virtual void stopProcessing( void )
|
||||
{
|
||||
if( isRunning() )
|
||||
{
|
||||
m_quit = TRUE;
|
||||
wait( 1000 );
|
||||
terminate();
|
||||
}
|
||||
}
|
||||
|
||||
virtual void run( void )
|
||||
{
|
||||
microTimer timer;
|
||||
while( m_quit == FALSE )
|
||||
{
|
||||
timer.reset();
|
||||
processNextBuffer();
|
||||
const Sint32 microseconds = static_cast<Sint32>(
|
||||
mixer::inst()->framesPerAudioBuffer() *
|
||||
1000000.0f /
|
||||
mixer::inst()->sampleRate() -
|
||||
timer.elapsed() );
|
||||
if( microseconds > 0 )
|
||||
{
|
||||
usleep( microseconds );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
volatile bool m_quit;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
|
||||
inline static QString name( void )
|
||||
{
|
||||
return( setupWidget::tr( "JACK (Jack Audio Connection Kit)" ) );
|
||||
return( setupWidget::tr( "JACK (JACK Audio Connection Kit)" ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
60
include/base64.h
Normal file
60
include/base64.h
Normal file
@@ -0,0 +1,60 @@
|
||||
/*
|
||||
* base64.h - namespace base64 with methods for encoding/decoding binary data
|
||||
* to/from base64
|
||||
*
|
||||
* Copyright (c) 2006 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BASE64_H
|
||||
#define _BASE64_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include <QByteArray>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
namespace base64
|
||||
{
|
||||
#ifndef QT3
|
||||
inline void encode( const char * _data, const int _size, QString & _dst )
|
||||
{
|
||||
_dst = QByteArray( _data, _size ).toBase64();
|
||||
}
|
||||
|
||||
inline void decode( const QString & _b64, char * * _data, int * _size )
|
||||
{
|
||||
QByteArray data = QByteArray::fromBase64( _b64.toAscii() );
|
||||
*_size = data.size();
|
||||
*_data = new char[*_size];
|
||||
memcpy( _data, data.constData(), *_size );
|
||||
}
|
||||
#else
|
||||
void encode( const char * _data, const int _size, QString & _dst );
|
||||
void decode( const QString & _b64, char * * _data, int * _size );
|
||||
#endif
|
||||
} ;
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* bb_editor.h - declaration of class bbEditor, a basic-component of LMMS
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -33,10 +33,12 @@
|
||||
#include "lmms_main_win.h"
|
||||
|
||||
|
||||
class toolButton;
|
||||
class songEditor;
|
||||
class QPixmap;
|
||||
|
||||
class comboBox;
|
||||
class songEditor;
|
||||
class toolButton;
|
||||
|
||||
|
||||
class bbEditor : public trackContainer
|
||||
{
|
||||
@@ -71,7 +73,6 @@ public:
|
||||
}
|
||||
|
||||
csize currentBB( void ) const;
|
||||
void FASTCALL setCurrentBB( csize _bb );
|
||||
tact FASTCALL lengthOfBB( csize _bb );
|
||||
inline tact lengthOfCurrentBB( void )
|
||||
{
|
||||
@@ -85,11 +86,18 @@ public:
|
||||
void updateBBTrack( trackContentObject * _tco );
|
||||
|
||||
|
||||
public slots:
|
||||
void updateComboBox( void );
|
||||
void setCurrentBB( int _bb );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
|
||||
virtual QRect scrollAreaRect( void ) const;
|
||||
|
||||
|
||||
protected slots:
|
||||
void play( void );
|
||||
@@ -111,6 +119,8 @@ private:
|
||||
toolButton * m_playButton;
|
||||
toolButton * m_stopButton;
|
||||
|
||||
comboBox * m_bbComboBox;
|
||||
|
||||
|
||||
friend class songEditor;
|
||||
friend lmmsMainWin::~lmmsMainWin();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* bb_track.h - class bbTrack, a wrapper for using bbEditor
|
||||
* (which is a singleton-class) as track
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -55,9 +55,6 @@ public:
|
||||
bbTCO( track * _track, const QColor & _c = QColor() );
|
||||
virtual ~bbTCO();
|
||||
|
||||
virtual void FASTCALL movePosition( const midiTime & _pos );
|
||||
virtual void FASTCALL changeLength( const midiTime & _length );
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
@@ -138,12 +135,8 @@ protected:
|
||||
private:
|
||||
nameLabel * m_trackLabel;
|
||||
|
||||
struct bbInfoStruct
|
||||
{
|
||||
csize num;
|
||||
QString name;
|
||||
} ;
|
||||
static QMap<bbTrack *, bbInfoStruct> s_bbNums;
|
||||
typedef QMap<bbTrack *, csize> infoMap;
|
||||
static infoMap s_infoMap;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* buffer_allocator.h - namespace bufferAllocator providing routines for own
|
||||
* optimized memory-management for audio-buffers
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -46,10 +46,15 @@ namespace bufferAllocator
|
||||
return( (T *) allocBytes( sizeof( T ) * _n ) );
|
||||
}
|
||||
|
||||
// free given buffer
|
||||
void FASTCALL free( void * _buf );
|
||||
|
||||
// try to cleanup _level unused buffers
|
||||
void FASTCALL cleanUp( Uint16 _level );
|
||||
|
||||
// disable autocleanup-mechanisms
|
||||
void FASTCALL disableAutoCleanup( bool _disabled );
|
||||
|
||||
|
||||
// simple class for automatically freeing buffer in complex functions
|
||||
template<class T = void>
|
||||
|
||||
117
include/combobox.h
Normal file
117
include/combobox.h
Normal file
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* combobox.h - class comboBox, a very cool combo-box
|
||||
*
|
||||
* Copyright (c) 2006 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _COMBOBOX_H
|
||||
#define _COMBOBOX_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVector>
|
||||
#include <QMenu>
|
||||
#include <QPixmap>
|
||||
#include <QPair>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qvaluevector.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qpair.h>
|
||||
|
||||
#endif
|
||||
|
||||
class QAction;
|
||||
|
||||
|
||||
class comboBox : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
comboBox( QWidget * _parent );
|
||||
virtual ~comboBox();
|
||||
|
||||
void addItem( const QString & _item, const QPixmap & _pixmap =
|
||||
QPixmap() );
|
||||
|
||||
inline void clear( void )
|
||||
{
|
||||
m_currentIndex = 0;
|
||||
m_items.clear();
|
||||
update();
|
||||
}
|
||||
|
||||
int findText( const QString & _txt ) const;
|
||||
|
||||
int currentIndex( void ) const
|
||||
{
|
||||
return( m_currentIndex );
|
||||
}
|
||||
|
||||
QString currentText( void ) const
|
||||
{
|
||||
return( m_items[m_currentIndex].first );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void setCurrentIndex( int _idx );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
|
||||
|
||||
private:
|
||||
static QPixmap * s_background;
|
||||
static QPixmap * s_arrow;
|
||||
|
||||
QMenu m_menu;
|
||||
|
||||
typedef QPair<QString, QPixmap> item;
|
||||
|
||||
vvector<item> m_items;
|
||||
int m_currentIndex;
|
||||
|
||||
bool m_pressed;
|
||||
|
||||
|
||||
private slots:
|
||||
void setItem( QAction * _item );
|
||||
void setItem( int _item );
|
||||
|
||||
|
||||
signals:
|
||||
void activated( const QString & );
|
||||
void currentIndexChanged( int );
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* config_mgr.h - class configManager, a class for managing LMMS-configuration
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -66,6 +66,7 @@ const QString PROJECTS_PATH = "projects/";
|
||||
const QString PRESETS_PATH = "presets/";
|
||||
const QString SAMPLES_PATH = "samples/";
|
||||
const QString ARTWORK_PATH = "artwork/";
|
||||
const QString TRACK_ICON_PATH = "artwork/track_icons/";
|
||||
const QString LOCALE_PATH = "locale/";
|
||||
|
||||
|
||||
@@ -82,35 +83,50 @@ public:
|
||||
return( s_instanceOfMe );
|
||||
}
|
||||
|
||||
const QString & lmmsWorkingDir( void ) const
|
||||
const QString & workingDir( void ) const
|
||||
{
|
||||
return( m_lmmsWorkingDir );
|
||||
}
|
||||
QString projectsDir( void ) const
|
||||
{
|
||||
return( m_lmmsWorkingDir + PROJECTS_PATH );
|
||||
}
|
||||
QString presetsDir( void ) const
|
||||
{
|
||||
return( m_lmmsWorkingDir + PRESETS_PATH );
|
||||
}
|
||||
QString samplesDir( void ) const
|
||||
{
|
||||
return( m_lmmsWorkingDir + SAMPLES_PATH );
|
||||
}
|
||||
QString artworkDir( void ) const
|
||||
{
|
||||
return( m_lmmsDataDir + ARTWORK_PATH );
|
||||
}
|
||||
QString localeDir( void ) const
|
||||
{
|
||||
return( m_lmmsDataDir + LOCALE_PATH );
|
||||
}
|
||||
const QString & pluginDir( void ) const
|
||||
{
|
||||
return( m_lmmsPluginDir );
|
||||
return( m_workingDir );
|
||||
}
|
||||
|
||||
QString projectsDir( void ) const
|
||||
{
|
||||
return( m_workingDir + PROJECTS_PATH );
|
||||
}
|
||||
|
||||
QString presetsDir( void ) const
|
||||
{
|
||||
return( m_workingDir + PRESETS_PATH );
|
||||
}
|
||||
|
||||
QString samplesDir( void ) const
|
||||
{
|
||||
return( m_workingDir + SAMPLES_PATH );
|
||||
}
|
||||
|
||||
QString artworkDir( void ) const
|
||||
{
|
||||
return( m_dataDir + ARTWORK_PATH );
|
||||
}
|
||||
|
||||
QString trackIconsDir( void ) const
|
||||
{
|
||||
return( m_dataDir + TRACK_ICON_PATH );
|
||||
}
|
||||
|
||||
QString localeDir( void ) const
|
||||
{
|
||||
return( m_dataDir + LOCALE_PATH );
|
||||
}
|
||||
|
||||
const QString & pluginDir( void ) const
|
||||
{
|
||||
return( m_pluginDir );
|
||||
}
|
||||
|
||||
const QString & vstDir( void ) const
|
||||
{
|
||||
return( m_vstDir );
|
||||
}
|
||||
|
||||
const QString & value( const QString & _class,
|
||||
const QString & _attribute ) const;
|
||||
@@ -121,9 +137,13 @@ public:
|
||||
void saveConfigFile( void );
|
||||
|
||||
|
||||
public slots:
|
||||
void setWorkingDir( const QString & _wd );
|
||||
void setVSTDir( const QString & _wd );
|
||||
|
||||
|
||||
protected slots:
|
||||
void openWorkingDir( void );
|
||||
void setWorkingDir( const QString & _wd );
|
||||
|
||||
virtual void accept( void );
|
||||
|
||||
@@ -152,9 +172,10 @@ private:
|
||||
|
||||
|
||||
const QString m_lmmsRcFile;
|
||||
QString m_lmmsWorkingDir;
|
||||
QString m_lmmsDataDir;
|
||||
QString m_lmmsPluginDir;
|
||||
QString m_workingDir;
|
||||
QString m_dataDir;
|
||||
QString m_pluginDir;
|
||||
QString m_vstDir;
|
||||
|
||||
typedef vvector<QPair<QString, QString> > stringPairVector;
|
||||
typedef QMap<QString, stringPairVector> settingsMap;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* dummy_instrument.h - instrument used as fallback if an instrument couldn't
|
||||
* be loaded
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -34,7 +34,7 @@ class dummyInstrument : public instrument
|
||||
{
|
||||
public:
|
||||
inline dummyInstrument( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track, "Dummy instrument" )
|
||||
instrument( _channel_track, NULL )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/*
|
||||
* dummy_plugin.h - empty plugin which is used as fallback if a plugin wasn't
|
||||
* found
|
||||
* dummy_plugin.h - empty plugin which is used as fallback if a plugin couldn't
|
||||
* be found
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -34,7 +34,7 @@ class dummyPlugin : public plugin
|
||||
{
|
||||
public:
|
||||
inline dummyPlugin( void ) :
|
||||
plugin( "Dummy plugin", plugin::UNDEFINED )
|
||||
plugin( NULL )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* embed.h - misc. stuff for using embedded data (resources linked into binary)
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* provides UI- and DSP-code for using envelopes, LFOs
|
||||
* and a filter
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -46,14 +46,15 @@
|
||||
#include "envelope_and_lfo_widget.h"
|
||||
|
||||
|
||||
class QComboBox;
|
||||
class groupBox;
|
||||
class tabWidget;
|
||||
class QLabel;
|
||||
class knob;
|
||||
class pixmapButton;
|
||||
|
||||
class channelTrack;
|
||||
class comboBox;
|
||||
class groupBox;
|
||||
class knob;
|
||||
class notePlayHandle;
|
||||
class pixmapButton;
|
||||
class tabWidget;
|
||||
|
||||
|
||||
class envelopeTabWidget : public QWidget, public settings
|
||||
@@ -97,7 +98,7 @@ private:
|
||||
|
||||
// filter-stuff
|
||||
groupBox * m_filterGroupBox;
|
||||
QComboBox * m_filterComboBox;
|
||||
comboBox * m_filterComboBox;
|
||||
knob * m_filterCutKnob;
|
||||
knob * m_filterResKnob;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* export_project_dialog.h - declaration of class exportProjectDialog which is
|
||||
* responsible for exporting project
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
@@ -44,15 +43,15 @@
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "export.h"
|
||||
|
||||
|
||||
class QLabel;
|
||||
class QPushButton;
|
||||
class QComboBox;
|
||||
class QProgressBar;
|
||||
class QCheckBox;
|
||||
|
||||
class comboBox;
|
||||
class ledCheckBox;
|
||||
class pixmapButton;
|
||||
|
||||
|
||||
@@ -88,11 +87,11 @@ private:
|
||||
|
||||
QString m_fileName;
|
||||
QLabel * m_typeLbl;
|
||||
QComboBox * m_typeCombo;
|
||||
comboBox * m_typeCombo;
|
||||
QLabel * m_kbpsLbl;
|
||||
QComboBox * m_kbpsCombo;
|
||||
QCheckBox * m_vbrCb;
|
||||
QCheckBox * m_hqmCb;
|
||||
comboBox * m_kbpsCombo;
|
||||
ledCheckBox * m_vbrCb;
|
||||
ledCheckBox * m_hqmCb;
|
||||
QLabel * m_hourglassLbl;
|
||||
QPushButton * m_exportBtn;
|
||||
QPushButton * m_cancelBtn;
|
||||
|
||||
77
include/fade_button.h
Normal file
77
include/fade_button.h
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
* fade_button.h - declaration of class fadeButton
|
||||
*
|
||||
* Copyright (c) 2005 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _FADE_BUTTON_H
|
||||
#define _FADE_BUTTON_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QAbstractButton>
|
||||
#include <QColor>
|
||||
|
||||
#else
|
||||
|
||||
#include <qbutton.h>
|
||||
#include <qcolor.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
class fadeButton : public QAbstractButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
fadeButton( const QColor & _normal_color, const QColor &
|
||||
_activated_color, QWidget * _parent );
|
||||
|
||||
virtual ~fadeButton();
|
||||
|
||||
|
||||
public slots:
|
||||
void activate( void );
|
||||
void reset( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
|
||||
private slots:
|
||||
void nextState( void );
|
||||
|
||||
|
||||
private:
|
||||
float m_state;
|
||||
QColor m_normalColor;
|
||||
QColor m_activatedColor;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* gui_templates.h - GUI-specific templates
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -48,6 +48,20 @@
|
||||
// the same size in pixels
|
||||
template<int SIZE>
|
||||
inline QFont pointSize( QFont _f )
|
||||
{
|
||||
static const int DPI = 96;
|
||||
#ifdef QT4
|
||||
_f.setPointSizeF( (float) SIZE * DPI /
|
||||
QApplication::desktop()->logicalDpiY() );
|
||||
#else
|
||||
_f.setPointSizeFloat( (float) SIZE * DPI /
|
||||
QPaintDeviceMetrics( qApp->desktop() ).logicalDpiY() );
|
||||
#endif
|
||||
return( _f );
|
||||
}
|
||||
|
||||
|
||||
inline QFont pointSizeF( QFont _f, float SIZE )
|
||||
{
|
||||
static const int DPI = 96;
|
||||
#ifdef QT4
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* instrument.h - declaration of class instrument, which provides a
|
||||
* standard interface for all instrument plugins
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -60,7 +60,8 @@ class notePlayHandle;
|
||||
class instrument : public QWidget, public plugin
|
||||
{
|
||||
public:
|
||||
instrument( channelTrack * _channel_track, const QString & _name );
|
||||
instrument( channelTrack * _channel_track,
|
||||
const descriptor * _descriptor );
|
||||
virtual ~instrument();
|
||||
|
||||
// if the plugin doesn't play each note, it can create an instrument-
|
||||
@@ -68,7 +69,7 @@ public:
|
||||
// output buffer only once per mixer-period
|
||||
virtual void play( void );
|
||||
|
||||
// must be overloaded by actual plugin
|
||||
// to be overloaded by actual plugin
|
||||
virtual void FASTCALL playNote( notePlayHandle * note_to_play );
|
||||
|
||||
// needed for deleting plugin-specific-data of a note - plugin has to
|
||||
|
||||
@@ -34,7 +34,7 @@ class instrumentPlayHandle : public playHandle
|
||||
{
|
||||
public:
|
||||
inline instrumentPlayHandle( instrument * _instrument ) :
|
||||
playHandle(),
|
||||
playHandle( INSTRUMENT_PLAY_HANDLE ),
|
||||
m_instrument( _instrument )
|
||||
{
|
||||
}
|
||||
|
||||
296
include/kmultitabbar-qt3.h
Normal file
296
include/kmultitabbar-qt3.h
Normal file
@@ -0,0 +1,296 @@
|
||||
/***************************************************************************
|
||||
kmultitabbar.h - description
|
||||
-------------------
|
||||
begin : 2001
|
||||
copyright : (C) 2001,2002,2003 by Joseph Wenninger <jowenn@kde.org>
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _KMultitabbar_qt3_h_
|
||||
#define _KMultitabbar_qt3_h_
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#include <qscrollview.h>
|
||||
#include <qvbox.h>
|
||||
#include <qhbox.h>
|
||||
#include <qabstractlayout.h>
|
||||
#include <qstring.h>
|
||||
#include <qptrlist.h>
|
||||
#include <qpushbutton.h>
|
||||
|
||||
class KMultiTabBarButton;
|
||||
class KMultiTabBarTab;
|
||||
|
||||
typedef QPtrList<KMultiTabBarButton> buttonList;
|
||||
typedef QPtrList<KMultiTabBarTab> tabList;
|
||||
|
||||
|
||||
class QPixmap;
|
||||
class QPainter;
|
||||
class QFrame;
|
||||
|
||||
class KMultiTabBarPrivate;
|
||||
class KMultiTabBarTabPrivate;
|
||||
class KMultiTabBarButtonPrivate;
|
||||
class KMultiTabBarInternal;
|
||||
|
||||
/**
|
||||
* A Widget for horizontal and vertical tabs.
|
||||
* It is possible to add normal buttons to the top/left
|
||||
* The handling if only one tab at a time or multiple tabs
|
||||
* should be raisable is left to the "user".
|
||||
*@author Joseph Wenninger
|
||||
*/
|
||||
class KMultiTabBar: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum KMultiTabBarMode{ Horizontal, Vertical };
|
||||
enum KMultiTabBarPosition{Left, Right, Top, Bottom};
|
||||
|
||||
/**
|
||||
* VSNET == Visual Studio .Net like (only show the text of active tabs
|
||||
* KDEV3 == Kdevelop 3 like (always show the text)
|
||||
* KONQSBC == konqy's classic sidebar style (unthemed), this one is disabled
|
||||
* at the moment, but will be renabled soon too
|
||||
*/
|
||||
enum KMultiTabBarStyle{VSNET=0, KDEV3=1, KONQSBC=2, KDEV3ICON=3,STYLELAST=0xffff};
|
||||
|
||||
KMultiTabBar(KMultiTabBarMode m,QWidget *parent=0);
|
||||
virtual ~KMultiTabBar();
|
||||
|
||||
/**
|
||||
* append a new button to the button area. The button can later on be accessed with button(ID)
|
||||
* eg for connecting signals to it
|
||||
* @param pic a pixmap for the button
|
||||
* @param id an arbitraty ID value. It will be emitted in the clicked signal for identifying the button
|
||||
* if more than one button is connected to a signals.
|
||||
* @param popup A popup menu which should be displayed if the button is clicked
|
||||
* @param not_used_yet will be used for a popup text in the future
|
||||
*/
|
||||
int appendButton(const QPixmap &pic,int id=-1,QMenu* popup=0,const QString& not_used_yet=QString::null);
|
||||
/**
|
||||
* remove a button with the given ID
|
||||
*/
|
||||
void removeButton(int id);
|
||||
/**
|
||||
* append a new tab to the tab area. It can be accessed lateron with tabb(id);
|
||||
* @param pic a bitmap for the tab
|
||||
* @param id an arbitrary ID which can be used later on to identify the tab
|
||||
* @param text if a mode with text is used it will be the tab text, otherwise a mouse over hint
|
||||
*/
|
||||
int appendTab(const QPixmap &pic,int id=-1,const QString& text=QString::null);
|
||||
/**
|
||||
* remove a tab with a given ID
|
||||
*/
|
||||
void removeTab(int id);
|
||||
/**
|
||||
* set a tab to "raised"
|
||||
* @param id The ID of the tab to manipulate
|
||||
* @param state true == activated/raised, false == not active
|
||||
*/
|
||||
void setTab(int id ,bool state);
|
||||
/**
|
||||
* return the state of a tab, identified by it's ID
|
||||
*/
|
||||
bool isTabRaised(int id) const;
|
||||
/**
|
||||
* get a pointer to a button within the button area identified by its ID
|
||||
*/
|
||||
class KMultiTabBarButton *button(int id) const;
|
||||
|
||||
/**
|
||||
* get a pointer to a tab within the tab area, identiifed by its ID
|
||||
*/
|
||||
class KMultiTabBarTab *tab(int id) const;
|
||||
/**
|
||||
* set the real position of the widget.
|
||||
* @param pos if the mode is horizontal, only use top, bottom, if it is vertical use left or right
|
||||
*/
|
||||
void setPosition(KMultiTabBarPosition pos);
|
||||
/**
|
||||
* set the display style of the tabs
|
||||
*/
|
||||
void setStyle(KMultiTabBarStyle style);
|
||||
/**
|
||||
* be carefull, don't delete tabs yourself and don't delete the list itself
|
||||
*/
|
||||
tabList * tabs();
|
||||
/**
|
||||
* be carefull, don't delete buttons yourself and don't delete the list itself
|
||||
*/
|
||||
buttonList * buttons();
|
||||
|
||||
/**
|
||||
* might vanish, not sure yet
|
||||
*/
|
||||
void showActiveTabTexts(bool show=true);
|
||||
protected:
|
||||
friend class KMultiTabBarButton;
|
||||
virtual void fontChange( const QFont& );
|
||||
void updateSeparator();
|
||||
private:
|
||||
class KMultiTabBarInternal *m_internal;
|
||||
QBoxLayout *m_l;
|
||||
QFrame *m_btnTabSep;
|
||||
buttonList m_buttons;
|
||||
KMultiTabBarPosition m_position;
|
||||
KMultiTabBarPrivate *d;
|
||||
};
|
||||
|
||||
/**
|
||||
* This class should never be created except with the appendButton call of KMultiTabBar
|
||||
*/
|
||||
class KMultiTabBarButton: public QPushButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KMultiTabBarButton(const QPixmap& pic,const QString&, QMenu *popup,
|
||||
int id,QWidget *parent, KMultiTabBar::KMultiTabBarPosition pos, KMultiTabBar::KMultiTabBarStyle style);
|
||||
KMultiTabBarButton(const QString&, QMenu *popup,
|
||||
int id,QWidget *parent, KMultiTabBar::KMultiTabBarPosition pos, KMultiTabBar::KMultiTabBarStyle style);
|
||||
virtual ~KMultiTabBarButton();
|
||||
int id() const;
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* this is used internaly, but can be used by the user, if (s)he wants to
|
||||
* It the according call of KMultiTabBar is invoked though this modifications will be overwritten
|
||||
*/
|
||||
void setPosition(KMultiTabBar::KMultiTabBarPosition);
|
||||
/**
|
||||
* this is used internaly, but can be used by the user, if (s)he wants to
|
||||
* It the according call of KMultiTabBar is invoked though this modifications will be overwritten
|
||||
*/
|
||||
void setStyle(KMultiTabBar::KMultiTabBarStyle);
|
||||
|
||||
/**
|
||||
* modify the text of the button
|
||||
*/
|
||||
void setText(const QString &);
|
||||
|
||||
QSize sizeHint() const;
|
||||
|
||||
protected:
|
||||
KMultiTabBar::KMultiTabBarPosition m_position;
|
||||
KMultiTabBar::KMultiTabBarStyle m_style;
|
||||
QString m_text;
|
||||
virtual void hideEvent( class QHideEvent*);
|
||||
virtual void showEvent( class QShowEvent*);
|
||||
private:
|
||||
int m_id;
|
||||
KMultiTabBarButtonPrivate *d;
|
||||
signals:
|
||||
/**
|
||||
* this is emitted if the button is clicked
|
||||
* @param id the ID identifying the button
|
||||
*/
|
||||
void clicked(int id);
|
||||
protected slots:
|
||||
virtual void slotClicked();
|
||||
};
|
||||
|
||||
/**
|
||||
* This class should never be created except with the appendTab call of KMultiTabBar
|
||||
*/
|
||||
class KMultiTabBarTab: public KMultiTabBarButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KMultiTabBarTab(const QPixmap& pic,const QString&,int id,QWidget *parent,
|
||||
KMultiTabBar::KMultiTabBarPosition pos,KMultiTabBar::KMultiTabBarStyle style);
|
||||
virtual ~KMultiTabBarTab();
|
||||
/**
|
||||
* set the active state of the tab
|
||||
* @param state true==active false==not active
|
||||
*/
|
||||
void setState(bool state);
|
||||
/**
|
||||
* choose if the text should always be displayed
|
||||
* this is only used in classic mode if at all
|
||||
*/
|
||||
void showActiveTabText(bool show);
|
||||
void resize(){ setSize( neededSize() ); }
|
||||
virtual inline const QColorGroup & palette( void ) const
|
||||
{
|
||||
return( colorGroup() );
|
||||
}
|
||||
private:
|
||||
bool m_showActiveTabText;
|
||||
int m_expandedSize;
|
||||
KMultiTabBarTabPrivate *d;
|
||||
protected:
|
||||
friend class KMultiTabBarInternal;
|
||||
void setSize(int);
|
||||
int neededSize();
|
||||
void updateState();
|
||||
virtual void drawButton(QPainter *);
|
||||
virtual void drawButtonLabel(QPainter *);
|
||||
void drawButtonStyled(QPainter *);
|
||||
void drawButtonClassic(QPainter *);
|
||||
protected slots:
|
||||
virtual void slotClicked();
|
||||
void setTabsPosition(KMultiTabBar::KMultiTabBarPosition);
|
||||
|
||||
public slots:
|
||||
virtual void setIcon(const QString&);
|
||||
virtual void setIcon(const QPixmap&);
|
||||
};
|
||||
|
||||
|
||||
|
||||
class KMultiTabBarInternal: public Q3ScrollView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KMultiTabBarInternal(QWidget *parent, KMultiTabBar::KMultiTabBarMode m);
|
||||
int appendTab(const QPixmap &,int=-1,const QString& =QString::null);
|
||||
KMultiTabBarTab *tab(int) const;
|
||||
void removeTab(int);
|
||||
void setPosition(enum KMultiTabBar::KMultiTabBarPosition pos);
|
||||
void setStyle(enum KMultiTabBar::KMultiTabBarStyle style);
|
||||
void showActiveTabTexts(bool show);
|
||||
tabList * tabs(){return &m_tabs;}
|
||||
virtual inline const QColorGroup & palette( void ) const
|
||||
{
|
||||
return( colorGroup() );
|
||||
}
|
||||
private:
|
||||
friend class KMultiTabBar;
|
||||
QWidget *box;
|
||||
QBoxLayout *mainLayout;
|
||||
tabList m_tabs;
|
||||
enum KMultiTabBar::KMultiTabBarPosition m_position;
|
||||
bool m_showActiveTabTexts;
|
||||
enum KMultiTabBar::KMultiTabBarStyle m_style;
|
||||
int m_expandedTabSize;
|
||||
int m_lines;
|
||||
protected:
|
||||
/**
|
||||
* [contentsM|m]ousePressEvent are reimplemented from QScrollView
|
||||
* in order to ignore all mouseEvents on the viewport, so that the
|
||||
* parent can handle them.
|
||||
*/
|
||||
virtual void contentsMousePressEvent(QMouseEvent *);
|
||||
virtual void mousePressEvent(QMouseEvent *);
|
||||
virtual void resizeEvent(QResizeEvent *);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,8 +1,8 @@
|
||||
/***************************************************************************
|
||||
kmultitabbar.h - description
|
||||
-------------------
|
||||
begin : 2001
|
||||
copyright : (C) 2001,2002,2003 by Joseph Wenninger <jowenn@kde.org>
|
||||
begin : 2001
|
||||
copyright : (C) 2001,2002,2003 by Joseph Wenninger <jowenn@kde.org>
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
@@ -18,50 +18,24 @@
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _KMultitabbar_h_
|
||||
#define _KMultitabbar_h_
|
||||
|
||||
#include "qt3support.h"
|
||||
#ifndef QT3
|
||||
|
||||
class KMultiTabBarButton;
|
||||
class KMultiTabBarTab;
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QMenu>
|
||||
#include <QLayout>
|
||||
#include <QString>
|
||||
#include <QBoxLayout>
|
||||
#include <QList>
|
||||
#include <QScrollArea>
|
||||
#include <QPushButton>
|
||||
|
||||
typedef QList<KMultiTabBarButton *> buttonList;
|
||||
typedef QList<KMultiTabBarTab *> tabList;
|
||||
|
||||
#else
|
||||
|
||||
#include <qscrollview.h>
|
||||
#include <qvbox.h>
|
||||
#include <qhbox.h>
|
||||
#include <qabstractlayout.h>
|
||||
#include <qstring.h>
|
||||
#include <qptrlist.h>
|
||||
#include <qpushbutton.h>
|
||||
|
||||
typedef QPtrList<KMultiTabBarButton> buttonList;
|
||||
typedef QPtrList<KMultiTabBarTab> tabList;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class QPixmap;
|
||||
class QPainter;
|
||||
class QFrame;
|
||||
class QMenu;
|
||||
|
||||
class KMultiTabBarPrivate;
|
||||
class KMultiTabBarTabPrivate;
|
||||
@@ -79,18 +53,18 @@ class KMultiTabBar: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
//enum KMultiTabBarMode{ Horizontal, Vertical };
|
||||
enum KMultiTabBarPosition{DockLeft, DockRight, DockTop, DockBottom};
|
||||
enum KMultiTabBarMode{Horizontal, Vertical};
|
||||
enum KMultiTabBarPosition{Left, Right, Top, Bottom};
|
||||
|
||||
/**
|
||||
* VSNET == Visual Studio .Net like (only show the text of active tabs
|
||||
* KDEV3 == Kdevelop 3 like (always show the text)
|
||||
* KONQSBC == konqy's classic sidebar style (unthemed), this one is disabled
|
||||
* at the moment, but will be renabled soon too
|
||||
* The list of available styles for KMultiTabBar
|
||||
* - VSNET - Visual Studio .Net like (only show the text of active tabs
|
||||
* - KDEV3 - Kdevelop 3 like (always show the text)
|
||||
* - KONQSBC - konqy's classic sidebar style (unthemed) (currently disabled)
|
||||
*/
|
||||
enum KMultiTabBarStyle{VSNET=0, KDEV3=1, KONQSBC=2, KDEV3ICON=3,STYLELAST=0xffff};
|
||||
|
||||
KMultiTabBar(Qt::Orientation o,QWidget *parent=0);
|
||||
KMultiTabBar(KMultiTabBarMode bm,QWidget *parent=0 );
|
||||
virtual ~KMultiTabBar();
|
||||
|
||||
/**
|
||||
@@ -102,8 +76,8 @@ public:
|
||||
* @param popup A popup menu which should be displayed if the button is clicked
|
||||
* @param not_used_yet will be used for a popup text in the future
|
||||
*/
|
||||
int appendButton(const QPixmap &pic,int id=-1,QMenu* popup=0,const QString& not_used_yet=QString::null);
|
||||
/**
|
||||
int appendButton(const QPixmap &pic,int id=-1,QMenu* popup=0,const QString& not_used_yet=QString());
|
||||
/**
|
||||
* remove a button with the given ID
|
||||
*/
|
||||
void removeButton(int id);
|
||||
@@ -113,7 +87,7 @@ public:
|
||||
* @param id an arbitrary ID which can be used later on to identify the tab
|
||||
* @param text if a mode with text is used it will be the tab text, otherwise a mouse over hint
|
||||
*/
|
||||
int appendTab(const QPixmap &pic,int id=-1,const QString& text=QString::null);
|
||||
int appendTab(const QPixmap &pic,int id=-1,const QString& text=QString());
|
||||
/**
|
||||
* remove a tab with a given ID
|
||||
*/
|
||||
@@ -142,18 +116,28 @@ public:
|
||||
* @param pos if the mode is horizontal, only use top, bottom, if it is vertical use left or right
|
||||
*/
|
||||
void setPosition(KMultiTabBarPosition pos);
|
||||
/**
|
||||
* get the tabbar position.
|
||||
* @return position
|
||||
*/
|
||||
KMultiTabBarPosition position() const;
|
||||
/**
|
||||
* set the display style of the tabs
|
||||
*/
|
||||
void setStyle(KMultiTabBarStyle style);
|
||||
/**
|
||||
* get the display style of the tabs
|
||||
* @return display style
|
||||
*/
|
||||
KMultiTabBarStyle tabStyle() const;
|
||||
/**
|
||||
* be carefull, don't delete tabs yourself and don't delete the list itself
|
||||
*/
|
||||
tabList * tabs();
|
||||
QList<KMultiTabBarTab *>* tabs();
|
||||
/**
|
||||
* be carefull, don't delete buttons yourself and don't delete the list itself
|
||||
*/
|
||||
buttonList * buttons();
|
||||
QList<KMultiTabBarButton *>* buttons();
|
||||
|
||||
/**
|
||||
* might vanish, not sure yet
|
||||
@@ -167,7 +151,7 @@ private:
|
||||
class KMultiTabBarInternal *m_internal;
|
||||
QBoxLayout *m_l;
|
||||
QFrame *m_btnTabSep;
|
||||
buttonList m_buttons;
|
||||
QList<KMultiTabBarButton *> m_buttons;
|
||||
KMultiTabBarPosition m_position;
|
||||
KMultiTabBarPrivate *d;
|
||||
};
|
||||
@@ -245,12 +229,6 @@ public:
|
||||
*/
|
||||
void showActiveTabText(bool show);
|
||||
void resize(){ setSize( neededSize() ); }
|
||||
#ifndef QT4
|
||||
virtual inline const QColorGroup & palette( void ) const
|
||||
{
|
||||
return( colorGroup() );
|
||||
}
|
||||
#endif
|
||||
private:
|
||||
bool m_showActiveTabText;
|
||||
int m_expandedSize;
|
||||
@@ -260,6 +238,7 @@ protected:
|
||||
void setSize(int);
|
||||
int neededSize();
|
||||
void updateState();
|
||||
virtual void paintEvent(QPaintEvent *);
|
||||
virtual void drawButton(QPainter *);
|
||||
virtual void drawButtonLabel(QPainter *);
|
||||
void drawButtonStyled(QPainter *);
|
||||
@@ -272,48 +251,66 @@ public slots:
|
||||
virtual void setIcon(const QString&);
|
||||
virtual void setIcon(const QPixmap&);
|
||||
};
|
||||
/***************************************************************************
|
||||
kmultitabbar_p.h - description
|
||||
-------------------
|
||||
begin : 2003
|
||||
copyright : (C) 2003 by Joseph Wenninger <jowenn@kde.org>
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This library 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public License
|
||||
along with this library; see the file COPYING.LIB. If not, write to
|
||||
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
Boston, MA 02110-1301, USA.
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
|
||||
class KMultiTabBarInternal: public Q3ScrollView
|
||||
class KMultiTabBarInternal: public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
KMultiTabBarInternal(QWidget *parent,Qt::Orientation o);
|
||||
int appendTab(const QPixmap &,int=-1,const QString& =QString::null);
|
||||
KMultiTabBarInternal(QWidget *parent,KMultiTabBar::KMultiTabBarMode bm);
|
||||
int appendTab(const QPixmap &,int=-1,const QString& =QString());
|
||||
KMultiTabBarTab *tab(int) const;
|
||||
void removeTab(int);
|
||||
void setPosition(enum KMultiTabBar::KMultiTabBarPosition pos);
|
||||
void setStyle(enum KMultiTabBar::KMultiTabBarStyle style);
|
||||
void showActiveTabTexts(bool show);
|
||||
tabList * tabs(){return &m_tabs;}
|
||||
#ifndef QT4
|
||||
virtual inline const QColorGroup & palette( void ) const
|
||||
{
|
||||
return( colorGroup() );
|
||||
}
|
||||
#endif
|
||||
QList<KMultiTabBarTab *>* tabs(){return &m_tabs;}
|
||||
private:
|
||||
friend class KMultiTabBar;
|
||||
QWidget *box;
|
||||
QBoxLayout *mainLayout;
|
||||
tabList m_tabs;
|
||||
QList<KMultiTabBarTab *> m_tabs;
|
||||
enum KMultiTabBar::KMultiTabBarPosition m_position;
|
||||
bool m_showActiveTabTexts;
|
||||
enum KMultiTabBar::KMultiTabBarStyle m_style;
|
||||
int m_expandedTabSize;
|
||||
int m_lines;
|
||||
KMultiTabBar::KMultiTabBarMode m_barMode;
|
||||
protected:
|
||||
virtual void drawContents ( QPainter *, int, int, int, int);
|
||||
virtual bool eventFilter(QObject *,QEvent*);
|
||||
// virtual void paintEvent( QPaintEvent * );
|
||||
|
||||
/**
|
||||
* [contentsM|m]ousePressEvent are reimplemented from QScrollView
|
||||
* in order to ignore all mouseEvents on the viewport, so that the
|
||||
* parent can handle them.
|
||||
*/
|
||||
virtual void contentsMousePressEvent(QMouseEvent *);
|
||||
virtual void mousePressEvent(QMouseEvent *);
|
||||
virtual void resizeEvent(QResizeEvent *);
|
||||
};
|
||||
|
||||
|
||||
#else
|
||||
|
||||
#include "kmultitabbar-qt3.h"
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* lcd_spinbox.h - class lcdSpinBox, an improved QLCDNumber
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -58,7 +58,6 @@ public:
|
||||
return( m_number->intValue() );
|
||||
}
|
||||
|
||||
void setValue( int _value );
|
||||
void setLabel( const QString & _txt );
|
||||
|
||||
inline void addTextForValue( int _val, const QString & _text )
|
||||
@@ -68,6 +67,7 @@ public:
|
||||
|
||||
|
||||
public slots:
|
||||
void setValue( int _value );
|
||||
virtual void setEnabled( bool _on );
|
||||
|
||||
|
||||
|
||||
70
include/micro_timer.h
Normal file
70
include/micro_timer.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
* micro_timer.h - simple high-precision timer
|
||||
*
|
||||
* Copyright (c) 2005 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _MICRO_TIMER
|
||||
#define _MICRO_TIMER
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
|
||||
class microTimer
|
||||
{
|
||||
public:
|
||||
inline microTimer( void )
|
||||
{
|
||||
reset();
|
||||
}
|
||||
|
||||
inline ~microTimer()
|
||||
{
|
||||
}
|
||||
|
||||
inline void reset( void )
|
||||
{
|
||||
gettimeofday( &begin, NULL );
|
||||
}
|
||||
|
||||
inline Uint32 elapsed( void ) const
|
||||
{
|
||||
struct timeval now;
|
||||
gettimeofday( &now, NULL );
|
||||
return( ( now.tv_sec - begin.tv_sec ) * 1000 * 1000 +
|
||||
( now.tv_usec - begin.tv_usec ) );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
struct timeval begin;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* midi_client.h - base-class for MIDI-clients like ALSA-sequencer-client
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
public:
|
||||
setupWidget( const QString & _caption, QWidget * _parent ) :
|
||||
tabWidget( tabWidget::tr( "Settings for %1" ).arg(
|
||||
_caption ), _parent )
|
||||
_caption ).toUpper(), _parent )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
return( m_mode );
|
||||
}
|
||||
|
||||
void setMode( modes _mode );
|
||||
void FASTCALL setMode( modes _mode );
|
||||
|
||||
inline Sint8 inputChannel( void ) const
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* midi_tab_widget.h - tab-widget in channel-track-window for setting up
|
||||
* MIDI-related stuff
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -74,11 +74,13 @@ public:
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void midiPortModeToggled( bool = FALSE );
|
||||
|
||||
|
||||
protected slots:
|
||||
void inputChannelChanged( int );
|
||||
void outputChannelChanged( int );
|
||||
void midiPortModeToggled( bool );
|
||||
void readablePortsChanged( void );
|
||||
void writeablePortsChanged( void );
|
||||
void activatedReadablePort( QAction * _item );
|
||||
@@ -99,7 +101,9 @@ private:
|
||||
|
||||
QMenu * m_readablePorts;
|
||||
QMenu * m_writeablePorts;
|
||||
|
||||
|
||||
friend class channelTrack;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* mixer.h - audio-device-independent mixer for LMMS
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -196,6 +196,11 @@ public:
|
||||
m_playHandlesToRemove.push_back( _ph );
|
||||
}
|
||||
|
||||
inline const playHandleVector & playHandles( void ) const
|
||||
{
|
||||
return( m_playHandles );
|
||||
}
|
||||
|
||||
void checkValidityOfPlayHandles( void );
|
||||
|
||||
|
||||
@@ -242,7 +247,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
void clear( void );
|
||||
void FASTCALL clear( bool _everything = FALSE );
|
||||
|
||||
|
||||
void FASTCALL clearAudioBuffer( sampleFrame * _ab, Uint32 _frames );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* name_label.h - class nameLabel, a label which is renamable by
|
||||
* double-clicking it
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -46,20 +46,32 @@ class nameLabel : public QLabel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
nameLabel( const QString & _initial_name, QWidget * _parent,
|
||||
const QPixmap & _pm = QPixmap() );
|
||||
nameLabel( const QString & _initial_name, QWidget * _parent );
|
||||
~nameLabel();
|
||||
const QPixmap * pixmap( void ) const;
|
||||
|
||||
const QPixmap & pixmap( void ) const
|
||||
{
|
||||
return( m_pixmap );
|
||||
}
|
||||
|
||||
const QString & pixmapFile( void ) const
|
||||
{
|
||||
return( m_pixmapFile );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
void setPixmap( const QPixmap & _pm );
|
||||
void setPixmap( const QPixmap & _pixmap );
|
||||
void setPixmapFile( const QString & _file );
|
||||
void rename( void );
|
||||
void selectPixmap( void );
|
||||
|
||||
|
||||
signals:
|
||||
void nameChanged( const QString & _new_name );
|
||||
void clicked( void );
|
||||
void nameChanged( void );
|
||||
void nameChanged( const QString & _new_name );
|
||||
void pixmapChanged( void );
|
||||
|
||||
|
||||
protected:
|
||||
@@ -69,7 +81,8 @@ protected:
|
||||
|
||||
|
||||
private:
|
||||
QPixmap m_pm;
|
||||
QPixmap m_pixmap;
|
||||
QString m_pixmapFile;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* note.h - declaration of class note which contains all informations about a
|
||||
* note + definitions of several constants and enums
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -96,7 +96,9 @@ public:
|
||||
tones _tone = A, octaves _octave = DEFAULT_OCTAVE,
|
||||
volume _volume = DEFAULT_VOLUME,
|
||||
panning _panning = DEFAULT_PANNING ) FASTCALL;
|
||||
|
||||
~note();
|
||||
|
||||
void FASTCALL setLength( const midiTime & _length );
|
||||
void FASTCALL setPos( const midiTime & _pos );
|
||||
void FASTCALL setTone( tones _tone = C );
|
||||
@@ -104,38 +106,47 @@ public:
|
||||
void FASTCALL setKey( int _key );
|
||||
void FASTCALL setVolume( volume _volume = DEFAULT_VOLUME );
|
||||
void FASTCALL setPanning( panning _panning = DEFAULT_PANNING );
|
||||
|
||||
inline midiTime endPos( void ) const
|
||||
{
|
||||
return( m_pos + m_length);
|
||||
}
|
||||
|
||||
inline const midiTime & length( void ) const
|
||||
{
|
||||
return( m_length );
|
||||
}
|
||||
|
||||
inline const midiTime & pos( void ) const
|
||||
{
|
||||
return( m_pos );
|
||||
}
|
||||
|
||||
inline midiTime pos( midiTime _base_pos ) const
|
||||
{
|
||||
return( m_pos - _base_pos );
|
||||
}
|
||||
|
||||
inline tones tone( void ) const
|
||||
{
|
||||
return( m_tone );
|
||||
}
|
||||
|
||||
inline octaves octave( void ) const
|
||||
{
|
||||
return( m_octave );
|
||||
}
|
||||
|
||||
inline int key( void ) const
|
||||
{
|
||||
return( m_octave * NOTES_PER_OCTAVE + m_tone );
|
||||
}
|
||||
|
||||
inline volume getVolume( void ) const
|
||||
{
|
||||
return( m_volume );
|
||||
}
|
||||
|
||||
inline panning getPanning( void ) const
|
||||
{
|
||||
return( m_panning );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* note_play_handle.h - declaration of class notePlayHandle which is needed
|
||||
* by LMMS-Play-Engine
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -38,6 +38,7 @@ class channelTrack;
|
||||
class notePlayHandle;
|
||||
|
||||
typedef vvector<notePlayHandle *> notePlayHandleVector;
|
||||
typedef vvector<const notePlayHandle *> constNotePlayHandleVector;
|
||||
|
||||
|
||||
class notePlayHandle : public playHandle, public note
|
||||
@@ -46,9 +47,9 @@ public:
|
||||
void * m_pluginData;
|
||||
basicFilters<> * m_filter;
|
||||
|
||||
notePlayHandle( channelTrack * _chnl_trk, Uint32 _frames_ahead,
|
||||
Uint32 _frames, note * n,
|
||||
bool _arp_note = FALSE ) FASTCALL;
|
||||
notePlayHandle( channelTrack * _chnl_trk, const Uint32 _frames_ahead,
|
||||
const Uint32 _frames, note * _n,
|
||||
const bool _arp_note = FALSE ) FASTCALL;
|
||||
~notePlayHandle();
|
||||
|
||||
|
||||
@@ -138,6 +139,11 @@ public:
|
||||
return( m_arpNote );
|
||||
}
|
||||
|
||||
inline void setArpNote( bool _on )
|
||||
{
|
||||
m_arpNote = _on;
|
||||
}
|
||||
|
||||
// returns whether note is base-note for arpeggio
|
||||
inline bool arpBaseNote( void ) const
|
||||
{
|
||||
@@ -151,6 +157,17 @@ public:
|
||||
|
||||
void mute( void );
|
||||
|
||||
// returns index of note-play-handle in vector of note-play-handles
|
||||
// belonging to this channel
|
||||
int index( void ) const;
|
||||
|
||||
// note-play-handles belonging to given channel
|
||||
static constNotePlayHandleVector nphsOfChannelTrack(
|
||||
const channelTrack * _ct );
|
||||
|
||||
// return whether given note-play-handle is equal to *this
|
||||
bool operator==( const notePlayHandle & _nph ) const;
|
||||
|
||||
|
||||
private:
|
||||
channelTrack * m_channelTrack; // needed for calling
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
#include <QMutex>
|
||||
#include <QDialog>
|
||||
#include <QThread>
|
||||
#include <QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
@@ -44,6 +45,7 @@
|
||||
#include <qmutex.h>
|
||||
#include <qdialog.h>
|
||||
#include <qthread.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -54,7 +56,6 @@
|
||||
|
||||
|
||||
class QAction;
|
||||
class QPixmap;
|
||||
class QProgressBar;
|
||||
class QPushButton;
|
||||
|
||||
@@ -84,9 +85,6 @@ public:
|
||||
void init( void );
|
||||
|
||||
|
||||
virtual void FASTCALL movePosition( const midiTime & _pos );
|
||||
|
||||
|
||||
virtual midiTime length( void ) const;
|
||||
|
||||
note * FASTCALL addNote( const note & _new_note );
|
||||
@@ -159,6 +157,10 @@ public:
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
virtual void update( void );
|
||||
|
||||
|
||||
protected slots:
|
||||
void openInPianoRoll( bool _c );
|
||||
void openInPianoRoll( void );
|
||||
@@ -180,21 +182,27 @@ protected:
|
||||
virtual void constructContextMenu( QMenu * );
|
||||
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re )
|
||||
{
|
||||
m_needsUpdate = TRUE;
|
||||
trackContentObject::resizeEvent( _re );
|
||||
}
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
|
||||
void ensureBeatNotes( void );
|
||||
void updateBBTrack( void );
|
||||
|
||||
|
||||
private:
|
||||
static QPixmap * s_patternBg;
|
||||
static QPixmap * s_stepBtnOn;
|
||||
static QPixmap * s_stepBtnOverlay;
|
||||
static QPixmap * s_stepBtnOff;
|
||||
static QPixmap * s_stepBtnOffLight;
|
||||
static QPixmap * s_frozen;
|
||||
|
||||
QPixmap m_paintPixmap;
|
||||
bool m_needsUpdate;
|
||||
|
||||
// general stuff
|
||||
channelTrack * m_channelTrack;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* piano_roll.h - declaration of class pianoRoll which is a window where you
|
||||
* can set and edit notes in an easy way
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -33,11 +33,13 @@
|
||||
|
||||
#include <QWidget>
|
||||
#include <QVector>
|
||||
#include <QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qvaluevector.h>
|
||||
#include <qpixmap.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -45,17 +47,16 @@
|
||||
#include "note.h"
|
||||
|
||||
|
||||
class QComboBox;
|
||||
class QPainter;
|
||||
class QPixmap;
|
||||
class QScrollBar;
|
||||
|
||||
class toolButton;
|
||||
class pattern;
|
||||
class notePlayHandle;
|
||||
class timeLine;
|
||||
class comboBox;
|
||||
class lmmsMainWin;
|
||||
|
||||
class notePlayHandle;
|
||||
class pattern;
|
||||
class timeLine;
|
||||
class toolButton;
|
||||
|
||||
|
||||
class pianoRoll : public QWidget
|
||||
@@ -72,29 +73,44 @@ public:
|
||||
}
|
||||
|
||||
void FASTCALL setCurrentPattern( pattern * _new_pattern );
|
||||
|
||||
inline bool isRecording( void ) const
|
||||
{
|
||||
return( m_recording );
|
||||
}
|
||||
|
||||
inline const pattern * currentPattern( void ) const
|
||||
{
|
||||
return( m_pattern );
|
||||
}
|
||||
|
||||
inline bool validPattern( void ) const
|
||||
{
|
||||
return( m_pattern != NULL );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
virtual void update( void );
|
||||
|
||||
|
||||
protected:
|
||||
void closeEvent( QCloseEvent * _ce );
|
||||
void paintEvent( QPaintEvent * _pe );
|
||||
void resizeEvent( QResizeEvent * _re );
|
||||
void mousePressEvent( QMouseEvent * _me );
|
||||
void mouseReleaseEvent( QMouseEvent * _me );
|
||||
void mouseMoveEvent( QMouseEvent * _me );
|
||||
void keyPressEvent( QKeyEvent * _ke );
|
||||
void wheelEvent( QWheelEvent * _we );
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
virtual void enterEvent( QEvent * _e );
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
virtual void leaveEvent( QEvent * _e );
|
||||
virtual void mousePressEvent( 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 );
|
||||
|
||||
int FASTCALL getKey( int _y );
|
||||
inline void drawNoteRect( QPainter & _p, Uint16 _x, Uint16 _y,
|
||||
Sint16 _width, bool _is_selected );
|
||||
static inline void drawNoteRect( QPainter & _p, Uint16 _x, Uint16 _y,
|
||||
Sint16 _width,
|
||||
const bool _is_selected,
|
||||
const bool _is_step_note );
|
||||
void removeSelection( void );
|
||||
void selectAll( void );
|
||||
void FASTCALL getSelectedNotes( noteVector & _selected_notes );
|
||||
@@ -154,6 +170,12 @@ private:
|
||||
} ;
|
||||
|
||||
|
||||
pianoRoll( void );
|
||||
pianoRoll( const pianoRoll & );
|
||||
~pianoRoll();
|
||||
|
||||
|
||||
|
||||
static pianoRoll * s_instanceOfMe;
|
||||
|
||||
static QPixmap * s_whiteKeyBigPm;
|
||||
@@ -182,7 +204,10 @@ private:
|
||||
toolButton * m_copyButton;
|
||||
toolButton * m_pasteButton;
|
||||
|
||||
QComboBox * m_zoomingComboBox;
|
||||
comboBox * m_zoomingComboBox;
|
||||
|
||||
QPixmap m_paintPixmap;
|
||||
bool m_cursorInside;
|
||||
|
||||
|
||||
pattern * m_pattern;
|
||||
@@ -225,10 +250,6 @@ private:
|
||||
bool m_scrollBack;
|
||||
|
||||
|
||||
pianoRoll( void );
|
||||
pianoRoll( const pianoRoll & );
|
||||
~pianoRoll();
|
||||
|
||||
|
||||
friend class lmmsMainWin;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* piano_widget.h - declaration of class pianoWidget, a widget which provides
|
||||
* an interactive piano/keyboard-widget
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -45,6 +45,7 @@
|
||||
|
||||
|
||||
#include "note.h"
|
||||
#include "templates.h"
|
||||
|
||||
|
||||
class channelTrack;
|
||||
@@ -65,6 +66,13 @@ public:
|
||||
pianoWidget( channelTrack * _channel_track );
|
||||
virtual ~pianoWidget();
|
||||
|
||||
inline void setKeyState( int _key, bool _on = FALSE )
|
||||
{
|
||||
m_pressedKeys[tLimit( _key, 0, NOTES_PER_OCTAVE *
|
||||
OCTAVES -1 )] = _on;
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * );
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* pixmap_button.h - declaration of class pixmapButton
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -56,11 +56,17 @@ public:
|
||||
void FASTCALL setInactiveGraphic( const QPixmap & _pm,
|
||||
bool _update = TRUE );
|
||||
void FASTCALL setBgGraphic( const QPixmap & _pm );
|
||||
#ifndef QT4
|
||||
|
||||
#ifdef QT3
|
||||
inline void setChecked( bool _on )
|
||||
{
|
||||
setOn( _on );
|
||||
}
|
||||
|
||||
inline bool isChecked( void ) const
|
||||
{
|
||||
return( isOn() );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* play_handle.h - base-class playHandle which is needed by
|
||||
* LMMS-Player-Engine
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -47,12 +47,26 @@
|
||||
class playHandle
|
||||
{
|
||||
public:
|
||||
inline playHandle( void )
|
||||
enum types
|
||||
{
|
||||
NOTE_PLAY_HANDLE, INSTRUMENT_PLAY_HANDLE, SAMPLE_PLAY_HANDLE,
|
||||
PRESET_PREVIEW_PLAY_HANDLE
|
||||
} ;
|
||||
|
||||
inline playHandle( types _type ) :
|
||||
m_type( _type )
|
||||
{
|
||||
}
|
||||
|
||||
virtual inline ~playHandle()
|
||||
{
|
||||
}
|
||||
|
||||
inline types type( void ) const
|
||||
{
|
||||
return( m_type );
|
||||
}
|
||||
|
||||
virtual void play( void ) = 0;
|
||||
virtual bool done( void ) const = 0;
|
||||
|
||||
@@ -67,11 +81,13 @@ public:
|
||||
|
||||
|
||||
private:
|
||||
types m_type;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
typedef vvector<playHandle *> playHandleVector;
|
||||
typedef vvector<const playHandle *> constPlayHandleVector;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* plugin.h - class plugin, the base-class and generic interface for all plugins
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -85,21 +85,25 @@ public:
|
||||
} ;
|
||||
|
||||
// contructor of a plugin
|
||||
// _name: public name of plugin
|
||||
// _type: one of the plugin-types defined above
|
||||
plugin( const QString & _public_name, pluginTypes _type );
|
||||
plugin( const descriptor * _descriptor );
|
||||
virtual ~plugin();
|
||||
|
||||
// returns the name, the plugin passed to plugin-constructor
|
||||
inline const QString & publicName( void ) const
|
||||
// returns public-name out of descriptor
|
||||
inline QString publicName( void ) const
|
||||
{
|
||||
return( m_publicName );
|
||||
return( m_descriptor->public_name );
|
||||
}
|
||||
|
||||
// return type
|
||||
// return plugin-type
|
||||
inline pluginTypes type( void ) const
|
||||
{
|
||||
return( m_type );
|
||||
return( m_descriptor->type );
|
||||
}
|
||||
|
||||
// return plugin-descriptor for further information
|
||||
inline const descriptor * getDescriptor( void ) const
|
||||
{
|
||||
return( m_descriptor );
|
||||
}
|
||||
|
||||
// plugins can overload this for making other classes able to change
|
||||
@@ -122,8 +126,7 @@ public:
|
||||
vvector<descriptor> & _plugin_descs );
|
||||
|
||||
private:
|
||||
const QString m_publicName;
|
||||
const pluginTypes m_type;
|
||||
const descriptor * m_descriptor;
|
||||
|
||||
// pointer to instantiation-function in plugin
|
||||
typedef plugin * ( * instantiationHook )( void * );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* preset_preview_play_handle.h - play-handle for playing a short preview-sound
|
||||
* of a preset
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -27,11 +27,11 @@
|
||||
#ifndef _PRESET_PREVIEW_PLAY_HANDLE_H
|
||||
#define _PRESET_PREVIEW_PLAY_HANDLE_H
|
||||
|
||||
#include "play_handle.h"
|
||||
#include "note_play_handle.h"
|
||||
|
||||
#include <qmutex.h>
|
||||
|
||||
class channelTrack;
|
||||
class notePlayHandle;
|
||||
class QMutex;
|
||||
|
||||
|
||||
@@ -41,17 +41,17 @@ public:
|
||||
presetPreviewPlayHandle( const QString & _preset_file );
|
||||
virtual ~presetPreviewPlayHandle();
|
||||
|
||||
static void cleanUp( void );
|
||||
|
||||
|
||||
virtual void play( void );
|
||||
virtual bool done( void ) const;
|
||||
|
||||
static void cleanUp( void );
|
||||
static constNotePlayHandleVector nphsOfChannelTrack(
|
||||
const channelTrack * _ct );
|
||||
|
||||
private:
|
||||
static channelTrack * s_globalChannelTrack;
|
||||
static notePlayHandle * s_globalPreviewNote;
|
||||
static QMutex * s_globalDataMutex;
|
||||
static QMutex s_globalDataMutex;
|
||||
|
||||
notePlayHandle * m_previewNote;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* qt3support.h - layer for supporting Qt3
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -34,9 +34,17 @@
|
||||
#include <qpair.h>
|
||||
|
||||
#if QT_VERSION >= 0x040000
|
||||
|
||||
#ifndef QT4
|
||||
#define QT4
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifndef QT3
|
||||
#define QT3
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -61,7 +69,7 @@ inline QString baseName( const QString & _file )
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
#else /* QT3 */
|
||||
|
||||
|
||||
#define vvector QValueVector
|
||||
@@ -77,11 +85,13 @@ inline QString baseName( const QString & _file )
|
||||
|
||||
#define QMatrix QWMatrix
|
||||
#define QIcon QIconSet
|
||||
#define QAbstractButton QButton
|
||||
|
||||
|
||||
// QWidget
|
||||
#define setWindowTitle setCaption
|
||||
#define setWindowIcon setIcon
|
||||
#define windowIcon icon
|
||||
#define isExplicitlyHidden isHidden
|
||||
#define accessibleName name
|
||||
#define ensurePolished constPolish
|
||||
@@ -107,6 +117,7 @@ inline QString baseName( const QString & _file )
|
||||
|
||||
// QScrollView/QScrollArea
|
||||
#define setHorizontalScrollBarPolicy setHScrollBarMode
|
||||
#define setVerticalScrollBarPolicy setVScrollBarMode
|
||||
|
||||
|
||||
// QScrollBar
|
||||
@@ -116,6 +127,7 @@ inline QString baseName( const QString & _file )
|
||||
|
||||
// QAbstractButton/QButton
|
||||
#define setCheckable setToggleButton
|
||||
#define isCheckable isToggleButton
|
||||
#define setShortcut setAccel
|
||||
|
||||
|
||||
@@ -137,6 +149,7 @@ inline QString baseName( const QString & _file )
|
||||
|
||||
// QString
|
||||
#define toLower lower
|
||||
#define toUpper upper
|
||||
|
||||
|
||||
// QTextEdit
|
||||
@@ -177,6 +190,10 @@ inline QString baseName( const QString & _file )
|
||||
#define setColumnMinimumWidth setColSpacing
|
||||
|
||||
|
||||
// QRect
|
||||
#define normalized normalize
|
||||
|
||||
|
||||
// Qt-namespace
|
||||
#define ShiftModifier ShiftButton
|
||||
#define ControlModifier ControlButton
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
#ifndef QT4
|
||||
|
||||
#include <qwidget.h>
|
||||
/*#include <kdelibs_export.h>*/
|
||||
|
||||
|
||||
#ifdef Q_WS_X11
|
||||
|
||||
125
include/rubberband.h
Normal file
125
include/rubberband.h
Normal file
@@ -0,0 +1,125 @@
|
||||
/*
|
||||
* rubberband.h - rubberband - either own implementation for Qt3 or wrapper for
|
||||
* Qt4
|
||||
*
|
||||
* Copyright (c) 2006 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _RUBBERBAND_H
|
||||
#define _RUBBERBAND_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifndef QT3
|
||||
|
||||
#include <QRubberBand>
|
||||
#include <QVector>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
class selectableObject : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
selectableObject( QWidget * _parent
|
||||
#ifdef QT3
|
||||
, WFlags _f
|
||||
#endif
|
||||
) :
|
||||
QWidget( _parent
|
||||
#ifdef QT3
|
||||
, NULL, _f
|
||||
#endif
|
||||
),
|
||||
m_selected( FALSE )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~selectableObject()
|
||||
{
|
||||
}
|
||||
|
||||
inline void setSelected( bool _selected )
|
||||
{
|
||||
m_selected = _selected;
|
||||
update();
|
||||
}
|
||||
|
||||
inline bool isSelected( void ) const
|
||||
{
|
||||
return( m_selected );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
virtual void update( void )
|
||||
{
|
||||
QWidget::update();
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
bool m_selected;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
typedef
|
||||
#ifndef QT3
|
||||
QRubberBand
|
||||
#else
|
||||
QWidget
|
||||
#endif
|
||||
rubberBandBase;
|
||||
|
||||
|
||||
class rubberBand : public rubberBandBase
|
||||
{
|
||||
public:
|
||||
rubberBand( QWidget * _parent );
|
||||
virtual ~rubberBand();
|
||||
|
||||
vvector<selectableObject *> selectedObjects( void ) const;
|
||||
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
#ifdef QT3
|
||||
virtual bool event( QEvent * _e );
|
||||
void updateMask( void );
|
||||
#endif
|
||||
|
||||
private:
|
||||
vvector<selectableObject *> selectableObjects( void ) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* sample_buffer.h - container-class sampleBuffer
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -72,6 +72,7 @@ public:
|
||||
sampleBuffer( const QString & _audio_file = "",
|
||||
bool _is_base64_data = FALSE );
|
||||
sampleBuffer( const sampleFrame * _data, Uint32 _frames );
|
||||
sampleBuffer( Uint32 _frames );
|
||||
|
||||
~sampleBuffer();
|
||||
|
||||
@@ -80,32 +81,40 @@ public:
|
||||
mixer::inst()->framesPerAudioBuffer(),
|
||||
float _freq = BASE_FREQ, bool _looped = FALSE,
|
||||
void * * _resampling_data = NULL );
|
||||
|
||||
void FASTCALL drawWaves( QPainter & _p, QRect _dr,
|
||||
drawMethods _dm = LINE_CONNECT );
|
||||
|
||||
inline const QString & audioFile( void ) const
|
||||
{
|
||||
return( m_audioFile );
|
||||
}
|
||||
|
||||
inline Uint32 startFrame( void ) const
|
||||
{
|
||||
return( m_startFrame );
|
||||
}
|
||||
|
||||
inline Uint32 endFrame( void ) const
|
||||
{
|
||||
return( m_endFrame );
|
||||
}
|
||||
|
||||
inline Uint32 frames( void ) const
|
||||
{
|
||||
return( m_frames );
|
||||
}
|
||||
|
||||
inline float amplification( void ) const
|
||||
{
|
||||
return( m_amplification );
|
||||
}
|
||||
|
||||
inline bool reversed( void ) const
|
||||
{
|
||||
return( m_reversed );
|
||||
}
|
||||
|
||||
inline const sampleFrame * data( void ) const
|
||||
{
|
||||
return( m_data );
|
||||
@@ -115,7 +124,22 @@ public:
|
||||
|
||||
QString openAudioFile( void ) const;
|
||||
|
||||
QString toBase64( void ) const;
|
||||
QString & toBase64( QString & _dst ) const;
|
||||
|
||||
|
||||
static sampleBuffer * FASTCALL resample( sampleFrame * _data,
|
||||
const Uint32 _frames,
|
||||
const Uint32 _src_sr,
|
||||
const Uint32 _dst_sr );
|
||||
|
||||
static inline sampleBuffer * FASTCALL resample(
|
||||
sampleBuffer * _buf,
|
||||
const Uint32 _src_sr,
|
||||
const Uint32 _dst_sr )
|
||||
{
|
||||
return( resample( _buf->m_data, _buf->m_frames, _src_sr,
|
||||
_dst_sr ) );
|
||||
}
|
||||
|
||||
|
||||
public slots:
|
||||
@@ -132,15 +156,18 @@ private:
|
||||
|
||||
#ifdef SDL_SDL_SOUND_H
|
||||
Uint32 FASTCALL decodeSampleSDL( const char * _f, Sint16 * & _buf,
|
||||
Uint8 & _channels );
|
||||
Uint8 & _channels,
|
||||
Uint32 & _sample_rate );
|
||||
#endif
|
||||
#ifdef HAVE_SNDFILE_H
|
||||
Uint32 FASTCALL decodeSampleSF( const char * _f, Sint16 * & _buf,
|
||||
Uint8 & _channels );
|
||||
Uint8 & _channels,
|
||||
Uint32 & _sample_rate );
|
||||
#endif
|
||||
#ifdef HAVE_VORBIS_VORBISFILE_H
|
||||
Uint32 FASTCALL decodeSampleOGG( const char * _f, Sint16 * & _buf,
|
||||
Uint8 & _channels );
|
||||
Uint32 FASTCALL decodeSampleOGGVorbis( const char * _f, Sint16 * & _buf,
|
||||
Uint8 & _channels,
|
||||
Uint32 & _sample_rate );
|
||||
#endif
|
||||
|
||||
QString m_audioFile;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* setup_dialog.h - dialog for setting up LMMS
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -47,6 +47,7 @@
|
||||
|
||||
class QComboBox;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QSlider;
|
||||
|
||||
class tabBar;
|
||||
@@ -58,11 +59,12 @@ class setupDialog : public QDialog
|
||||
public:
|
||||
enum configTabs
|
||||
{
|
||||
GENERAL_SETTINGS, AUDIO_SETTINGS, MIDI_SETTINGS
|
||||
GENERAL_SETTINGS, DIRECTORY_SETTINGS, PERFORMANCE_SETTINGS,
|
||||
AUDIO_SETTINGS, MIDI_SETTINGS
|
||||
} ;
|
||||
|
||||
setupDialog( configTabs _tab_to_open = GENERAL_SETTINGS );
|
||||
~setupDialog();
|
||||
virtual ~setupDialog();
|
||||
|
||||
|
||||
protected slots:
|
||||
@@ -75,6 +77,10 @@ private slots:
|
||||
void resetBufSize( void );
|
||||
void displayBufSizeHelp( void );
|
||||
|
||||
// directory settings widget
|
||||
void setWorkingDir( const QString & _wd );
|
||||
void setVSTDir( const QString & _vd );
|
||||
|
||||
// audio settings widget
|
||||
void audioInterfaceChanged( const QString & _driver );
|
||||
void displayAudioHelp( void );
|
||||
@@ -87,6 +93,16 @@ private slots:
|
||||
void toggleToolTips( bool _disabled );
|
||||
void toggleKnobUsability( bool _classical );
|
||||
void toggleGIMPLikeWindows( bool _enabled );
|
||||
void toggleNoWizard( bool _enabled );
|
||||
void toggleNoMsgAfterSetup( bool _enabled );
|
||||
|
||||
|
||||
void openWorkingDir( void );
|
||||
void openVSTDir( void );
|
||||
|
||||
|
||||
void toggleDisableChActInd( bool _disabled );
|
||||
void toggleManualChPiano( bool _enabled );
|
||||
|
||||
|
||||
private:
|
||||
@@ -99,6 +115,19 @@ private:
|
||||
bool m_disableToolTips;
|
||||
bool m_classicalKnobUsability;
|
||||
bool m_gimpLikeWindows;
|
||||
bool m_noWizard;
|
||||
bool m_noMsgAfterSetup;
|
||||
|
||||
|
||||
QLineEdit * m_wdLineEdit;
|
||||
QLineEdit * m_vdLineEdit;
|
||||
|
||||
QString m_workingDir;
|
||||
QString m_vstDir;
|
||||
|
||||
|
||||
bool m_disableChActInd;
|
||||
bool m_manualChPiano;
|
||||
|
||||
|
||||
typedef QMap<QString, audioDevice::setupWidget *> aswMap;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* side_bar.h - code for side-bar in LMMS
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -47,10 +47,11 @@ class sideBar : public KMultiTabBar
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
sideBar( Qt::Orientation _o, QWidget * _parent ) :
|
||||
KMultiTabBar( _o, _parent )
|
||||
sideBar( KMultiTabBarMode _m, QWidget * _parent ) :
|
||||
KMultiTabBar( _m, _parent )
|
||||
{
|
||||
}
|
||||
|
||||
virtual ~sideBar()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* song_editor.h - declaration of class songEditor, a window where you can
|
||||
* setup your songs
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -29,20 +29,20 @@
|
||||
|
||||
#include "track_container.h"
|
||||
#include "types.h"
|
||||
#include "tool_button.h"
|
||||
|
||||
|
||||
class QComboBox;
|
||||
class QLabel;
|
||||
class QScrollBar;
|
||||
class QSlider;
|
||||
|
||||
class comboBox;
|
||||
class lcdSpinBox;
|
||||
class lmmsMainWin;
|
||||
class pattern;
|
||||
class projectNotes;
|
||||
class textFloat;
|
||||
class timeLine;
|
||||
class toolButton;
|
||||
|
||||
|
||||
const int MIN_BPM = 10;
|
||||
@@ -51,7 +51,6 @@ const int MAX_BPM = 999;
|
||||
const Uint16 MAX_SONG_LENGTH = 9999;
|
||||
|
||||
|
||||
|
||||
class songEditor : public trackContainer
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -204,11 +203,18 @@ public slots:
|
||||
|
||||
|
||||
protected:
|
||||
void closeEvent( QCloseEvent * _ce );
|
||||
void resizeEvent( QResizeEvent * _re );
|
||||
void keyPressEvent( QKeyEvent * _ke );
|
||||
void wheelEvent( QWheelEvent * _we );
|
||||
void paintEvent( QPaintEvent * _pe );
|
||||
virtual void closeEvent( QCloseEvent * _ce );
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
virtual void keyPressEvent( QKeyEvent * _ke );
|
||||
virtual void wheelEvent( QWheelEvent * _we );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
virtual QRect scrollAreaRect( void ) const;
|
||||
|
||||
virtual bool allowRubberband( void ) const
|
||||
{
|
||||
return( m_editModeButton->isChecked() );
|
||||
}
|
||||
|
||||
|
||||
protected slots:
|
||||
@@ -232,6 +238,8 @@ protected slots:
|
||||
|
||||
void zoomingChanged( const QString & _zfac );
|
||||
|
||||
void doActions( void );
|
||||
|
||||
|
||||
private:
|
||||
songEditor();
|
||||
@@ -273,10 +281,11 @@ private:
|
||||
|
||||
toolButton * m_addBBTrackButton;
|
||||
toolButton * m_addSampleTrackButton;
|
||||
toolButton * m_insertBarButton;
|
||||
toolButton * m_removeBarButton;
|
||||
|
||||
QComboBox * m_zoomingComboBox;
|
||||
toolButton * m_drawModeButton;
|
||||
toolButton * m_editModeButton;
|
||||
|
||||
comboBox * m_zoomingComboBox;
|
||||
|
||||
|
||||
QString m_fileName;
|
||||
@@ -310,8 +319,6 @@ private:
|
||||
} ;
|
||||
vvector<ACTIONS> m_actions;
|
||||
|
||||
void doActions( void );
|
||||
|
||||
|
||||
friend class lmmsMainWin;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* tab_button.h - declaration of class tabButton
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -52,10 +52,22 @@ public:
|
||||
connect( this, SIGNAL( clicked() ), this,
|
||||
SLOT( slotClicked() ) );
|
||||
}
|
||||
virtual ~tabButton()
|
||||
|
||||
~tabButton()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef QT3
|
||||
inline void setChecked( bool _on )
|
||||
{
|
||||
setOn( _on );
|
||||
}
|
||||
|
||||
inline bool isChecked( void ) const
|
||||
{
|
||||
return( isOn() );
|
||||
}
|
||||
#endif
|
||||
|
||||
signals:
|
||||
void clicked( int );
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* tempo_sync_knob.h - adds bpm to ms conversion for knob class
|
||||
*
|
||||
* Copyright (c) 2005 Danny McRae <khjklujn@yahoo.com>
|
||||
* Copyright (c) 2005 Danny McRae <khjklujn/at/yahoo.com>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
|
||||
timeLine( int _xoff, int _yoff, float _ppt, songEditor::playPos & _pos,
|
||||
const midiTime & _begin, QWidget * _parent );
|
||||
~timeLine();
|
||||
virtual ~timeLine();
|
||||
|
||||
inline songEditor::playPos & pos( void )
|
||||
{
|
||||
@@ -117,11 +117,14 @@ public:
|
||||
|
||||
|
||||
public slots:
|
||||
void updatePosition( const midiTime & = 0 );
|
||||
void updatePosition( const midiTime & );
|
||||
void updatePosition( void )
|
||||
{
|
||||
updatePosition( midiTime() );
|
||||
}
|
||||
void toggleAutoScroll( int _n );
|
||||
void toggleLoopPoints( int _n );
|
||||
void toggleBehaviourAtStop( int _n );
|
||||
void checkForUpdatedPosition( void );
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* tool_button.h - declaration of class toolButton
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
class toolButton : public QToolButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
toolButton( const QPixmap & _pixmap, const QString & _tooltip,
|
||||
QObject * _receiver, const char * _slot,
|
||||
@@ -57,7 +58,7 @@ public:
|
||||
leaveEvent( NULL );
|
||||
}
|
||||
|
||||
~toolButton();
|
||||
virtual ~toolButton();
|
||||
|
||||
inline void setStandardColor( const QColor & _color )
|
||||
{
|
||||
@@ -69,11 +70,21 @@ public:
|
||||
m_colorHighlighted = _color;
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
#ifdef QT3
|
||||
inline void setIcon( const QPixmap & _icon )
|
||||
{
|
||||
setIconSet( _icon );
|
||||
}
|
||||
|
||||
inline void setChecked( bool _on )
|
||||
{
|
||||
setOn( _on );
|
||||
}
|
||||
|
||||
inline bool isChecked( void ) const
|
||||
{
|
||||
return( isOn() );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -82,6 +93,10 @@ protected:
|
||||
virtual void leaveEvent( QEvent * _ev );
|
||||
|
||||
|
||||
private slots:
|
||||
void toggledBool( bool _on );
|
||||
|
||||
|
||||
private:
|
||||
static const QColor s_stdColor;
|
||||
static const QColor s_hlColor;
|
||||
|
||||
@@ -55,9 +55,11 @@
|
||||
#include "types.h"
|
||||
#include "midi_time.h"
|
||||
#include "settings.h"
|
||||
#include "rubberband.h"
|
||||
|
||||
|
||||
class QMenu;
|
||||
class QPushButton;
|
||||
|
||||
class pixmapButton;
|
||||
class textFloat;
|
||||
@@ -66,7 +68,7 @@ class trackContainer;
|
||||
class trackContentWidget;
|
||||
class trackWidget;
|
||||
|
||||
typedef QWidget trackOperationsWidget;
|
||||
typedef QWidget trackSettingsWidget;
|
||||
|
||||
|
||||
|
||||
@@ -75,7 +77,7 @@ const Uint16 TRACK_OP_WIDTH = 70;
|
||||
const Uint16 TCO_BORDER_WIDTH = 1;
|
||||
|
||||
|
||||
class trackContentObject : public QWidget, public settings
|
||||
class trackContentObject : public selectableObject, public settings
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -98,7 +100,9 @@ public:
|
||||
{
|
||||
return( m_length );
|
||||
}
|
||||
|
||||
bool fixedTCOs( void );
|
||||
|
||||
virtual void FASTCALL movePosition( const midiTime & _pos );
|
||||
virtual void FASTCALL changeLength( const midiTime & _length );
|
||||
|
||||
@@ -111,12 +115,13 @@ protected:
|
||||
virtual void constructContextMenu( QMenu * )
|
||||
{
|
||||
}
|
||||
|
||||
virtual void contextMenuEvent( QContextMenuEvent * _cme );
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void leaveEvent( QEvent * _e );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
|
||||
void setAutoResizeEnabled( bool _e = FALSE );
|
||||
@@ -130,13 +135,17 @@ protected slots:
|
||||
|
||||
|
||||
private:
|
||||
enum actions
|
||||
{
|
||||
NONE, MOVE, MOVE_SELECTION, RESIZE
|
||||
} ;
|
||||
|
||||
static textFloat * s_textFloat;
|
||||
|
||||
track * m_track;
|
||||
midiTime m_startPosition;
|
||||
midiTime m_length;
|
||||
bool m_moving;
|
||||
bool m_resizing;
|
||||
actions m_action;
|
||||
bool m_autoResize;
|
||||
Sint16 m_initialMouseX;
|
||||
|
||||
@@ -165,10 +174,12 @@ public:
|
||||
{
|
||||
return( m_pixelsPerTact );
|
||||
}
|
||||
|
||||
inline void setPixelsPerTact( Uint16 _ppt )
|
||||
{
|
||||
m_pixelsPerTact = _ppt;
|
||||
}
|
||||
|
||||
tact length( void ) const;
|
||||
|
||||
|
||||
@@ -182,8 +193,7 @@ protected:
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
|
||||
|
||||
@@ -203,20 +213,39 @@ private:
|
||||
|
||||
|
||||
|
||||
class trackSettingsWidget : public QWidget
|
||||
class trackOperationsWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
trackSettingsWidget( trackWidget * _parent );
|
||||
~trackSettingsWidget();
|
||||
trackOperationsWidget( trackWidget * _parent );
|
||||
~trackOperationsWidget();
|
||||
|
||||
bool muted( void ) const;
|
||||
|
||||
|
||||
public slots:
|
||||
void setMuted( bool _muted );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
|
||||
private slots:
|
||||
void cloneTrack( void );
|
||||
void removeTrack( void );
|
||||
void muteBtnRightClicked( void );
|
||||
|
||||
|
||||
private:
|
||||
static QPixmap * s_grip;
|
||||
|
||||
trackWidget * m_trackWidget;
|
||||
|
||||
QPushButton * m_trackOps;
|
||||
pixmapButton * m_muteBtn;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -242,6 +271,12 @@ public:
|
||||
return( m_track );
|
||||
}
|
||||
|
||||
inline const trackOperationsWidget & getTrackOperationsWidget( void )
|
||||
const
|
||||
{
|
||||
return( m_trackOperationsWidget );
|
||||
}
|
||||
|
||||
inline const trackSettingsWidget & getTrackSettingsWidget( void ) const
|
||||
{
|
||||
return( m_trackSettingsWidget );
|
||||
@@ -252,6 +287,11 @@ public:
|
||||
return( m_trackContentWidget );
|
||||
}
|
||||
|
||||
inline trackOperationsWidget & getTrackOperationsWidget( void )
|
||||
{
|
||||
return( m_trackOperationsWidget );
|
||||
}
|
||||
|
||||
inline trackSettingsWidget & getTrackSettingsWidget( void )
|
||||
{
|
||||
return( m_trackSettingsWidget );
|
||||
@@ -262,22 +302,24 @@ public:
|
||||
return( m_trackContentWidget );
|
||||
}
|
||||
|
||||
bool muted( void ) const;
|
||||
bool isMovingTrack( void ) const
|
||||
{
|
||||
return( m_action == MOVE_TRACK );
|
||||
}
|
||||
|
||||
virtual void repaint( void );
|
||||
|
||||
|
||||
public slots:
|
||||
void changePosition( const midiTime & _new_pos = -1 );
|
||||
void cloneTrack( void );
|
||||
void removeTrack( void );
|
||||
void moveTrackUp( void );
|
||||
void moveTrackDown( void );
|
||||
void setMuted( bool _muted );
|
||||
void muteBtnRightClicked( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void resizeEvent( QResizeEvent * _re );
|
||||
|
||||
@@ -285,13 +327,17 @@ protected:
|
||||
|
||||
|
||||
private:
|
||||
enum actions
|
||||
{
|
||||
NONE, MOVE_TRACK, RESIZE_TRACK
|
||||
} ;
|
||||
track * m_track;
|
||||
|
||||
trackOperationsWidget m_trackOperationsWidget;
|
||||
trackSettingsWidget m_trackSettingsWidget;
|
||||
trackContentWidget m_trackContentWidget;
|
||||
|
||||
pixmapButton * m_muteBtn;
|
||||
actions m_action;
|
||||
|
||||
} ;
|
||||
|
||||
@@ -324,9 +370,15 @@ public:
|
||||
|
||||
inline bool muted( void ) const
|
||||
{
|
||||
return( m_trackWidget->muted() );
|
||||
return( m_trackWidget->getTrackOperationsWidget().muted() );
|
||||
}
|
||||
|
||||
inline void setMuted( bool _muted )
|
||||
{
|
||||
m_trackWidget->getTrackOperationsWidget().setMuted( _muted );
|
||||
}
|
||||
|
||||
|
||||
// pure virtual functions
|
||||
virtual trackTypes type( void ) const = 0;
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* track_container.h - base-class for all track-containers like Song-Editor,
|
||||
* BB-Editor...
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -46,37 +46,47 @@
|
||||
|
||||
#include "track.h"
|
||||
#include "settings.h"
|
||||
#include "rubberband.h"
|
||||
|
||||
|
||||
const Uint16 DEFAULT_PIXELS_PER_TACT = 16;
|
||||
|
||||
const Uint16 DEFAULT_SCROLLBAR_SIZE = 16;
|
||||
|
||||
|
||||
class trackContainer : public QMainWindow, public settings
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
trackContainer();
|
||||
trackContainer( void );
|
||||
~trackContainer();
|
||||
|
||||
inline QWidget * containerWidget( void )
|
||||
{
|
||||
return( m_scrollArea );
|
||||
}
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
|
||||
|
||||
inline float pixelsPerTact( void ) const
|
||||
{
|
||||
return( m_ppt );
|
||||
}
|
||||
|
||||
inline const midiTime & currentPosition( void ) const
|
||||
{
|
||||
return( m_currentPosition );
|
||||
}
|
||||
|
||||
virtual bool fixedTCOs( void ) const
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
unsigned int FASTCALL countTracks( track::trackTypes _tt =
|
||||
track::TOTAL_TRACK_TYPES ) const;
|
||||
|
||||
@@ -92,15 +102,43 @@ public:
|
||||
void FASTCALL moveTrackDown( track * _track );
|
||||
void FASTCALL realignTracks( bool _complete_update = FALSE );
|
||||
|
||||
const trackWidget * trackWidgetAt( const int _y ) const;
|
||||
|
||||
|
||||
virtual bool allowRubberband( void ) const;
|
||||
|
||||
inline bool rubberBandActive( void ) const
|
||||
{
|
||||
return( m_rubberBand->isVisible() );
|
||||
}
|
||||
|
||||
inline vvector<selectableObject *> selectedObjects( void )
|
||||
{
|
||||
if( allowRubberband() == TRUE )
|
||||
{
|
||||
return( m_rubberBand->selectedObjects() );
|
||||
}
|
||||
//return( vvector<selectableObject *>() );
|
||||
vvector<selectableObject *> foo;
|
||||
return( foo );
|
||||
}
|
||||
|
||||
|
||||
protected:
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
virtual void resizeEvent( QResizeEvent * );
|
||||
|
||||
constTrackVector tracks( void ) const;
|
||||
trackVector tracks( void );
|
||||
|
||||
virtual QRect scrollAreaRect( void ) const
|
||||
{
|
||||
return( rect() );
|
||||
}
|
||||
|
||||
midiTime m_currentPosition;
|
||||
|
||||
@@ -132,6 +170,9 @@ private:
|
||||
trackWidgetVector m_trackWidgets;
|
||||
float m_ppt;
|
||||
|
||||
rubberBand * m_rubberBand;
|
||||
QPoint m_origin;
|
||||
|
||||
|
||||
friend class scrollArea;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
|
||||
49
lmms.1
Normal file
49
lmms.1
Normal file
@@ -0,0 +1,49 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.TH LMMS 1 "February 01, 2006"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
lmms \- software for easy music-production
|
||||
.SH SYNOPSIS
|
||||
.B lmms
|
||||
.RB "[ \-\fBr\fP \fIfile\fP ]"
|
||||
.RB "[ \-\fBo\fP \fIformat\fP ]"
|
||||
.br
|
||||
.B lmms
|
||||
.RI "[ file ]"
|
||||
.SH DESCRIPTION
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
|
||||
.\" respectively.
|
||||
.B LMMS
|
||||
aims to be a free alternative to popular (but commercial and closed- source) programs like FruityLoops, Cubase and Logic giving you the ability of producing music with your computer by creating cool loops, synthesizing and mixing sounds, arranging samples, having fun with your MIDI-keyboard and much more...
|
||||
|
||||
LMMS combines the features of a tracker-/sequencer-program (pattern-/channel-/ sample-/song-/effect-management) and those of powerful instrument-plugins and samplers in a modern, user-friendly and easy to use graphical user-interface.
|
||||
|
||||
.SH OPTIONS
|
||||
.IP "\fB\-r, --render\fP \fIfile\fP
|
||||
Render given file to either a wav\- or ogg\-file. See \fB\-o\fP for details
|
||||
.IP "\fB\-o, --output\fP \fIformat\fP
|
||||
Specify format of render-output where \fIformat\fP is either 'wav' or 'ogg'
|
||||
.SH SEE ALSO
|
||||
.BR http://lmms.sf.net/
|
||||
.SH AUTHOR
|
||||
lmms was written by Tobias Doerffel and others. See AUTHORS for details.
|
||||
.PP
|
||||
This manual page was written by Florian Ragwitz <rafl@debian.org> and
|
||||
Tobias Doerffel <tobydox@users.sf.net>, for the Debian project (but may be
|
||||
used by others).
|
||||
@@ -2,6 +2,5 @@ if VST_SUPPORT
|
||||
VESTIGE_SUBDIR=vestige
|
||||
endif
|
||||
|
||||
SUBDIRS = audio_file_processor plucked_string_synth triple_oscillator $(VESTIGE_SUBDIR)
|
||||
|
||||
SUBDIRS = audio_file_processor bit_invader plucked_string_synth triple_oscillator $(VESTIGE_SUBDIR)
|
||||
|
||||
|
||||
@@ -42,9 +42,6 @@
|
||||
#include <qdom.h>
|
||||
#include <qfileinfo.h>
|
||||
|
||||
#define isChecked isOn
|
||||
#define setChecked setOn
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -89,8 +86,7 @@ QPixmap * audioFileProcessor::s_artwork = NULL;
|
||||
|
||||
|
||||
audioFileProcessor::audioFileProcessor( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track,
|
||||
audiofileprocessor_plugin_descriptor.public_name ),
|
||||
instrument( _channel_track, &audiofileprocessor_plugin_descriptor ),
|
||||
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
|
||||
m_sampleBuffer( "" ),
|
||||
m_drawMethod( sampleBuffer::LINE_CONNECT )
|
||||
@@ -298,6 +294,11 @@ void audioFileProcessor::saveSettings( QDomDocument & _doc,
|
||||
{
|
||||
QDomElement afp_de = _doc.createElement( nodeName() );
|
||||
afp_de.setAttribute( "src", m_sampleBuffer.audioFile() );
|
||||
if( m_sampleBuffer.audioFile() == "" )
|
||||
{
|
||||
QString s;
|
||||
afp_de.setAttribute( "sampledata", m_sampleBuffer.toBase64( s ) );
|
||||
}
|
||||
afp_de.setAttribute( "sframe", QString::number(
|
||||
m_sampleBuffer.startFrame() /
|
||||
(float)m_sampleBuffer.frames() ) );
|
||||
@@ -317,7 +318,14 @@ void audioFileProcessor::saveSettings( QDomDocument & _doc,
|
||||
|
||||
void audioFileProcessor::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
setAudioFile( _this.attribute( "src" ) );
|
||||
if( _this.attribute( "src" ) != "" )
|
||||
{
|
||||
setAudioFile( _this.attribute( "src" ) );
|
||||
}
|
||||
else if( _this.attribute( "sampledata" ) != "" )
|
||||
{
|
||||
m_sampleBuffer.loadFromBase64( _this.attribute( "srcdata" ) );
|
||||
}
|
||||
setStartAndEndKnob( _this.attribute( "sframe" ).toFloat(),
|
||||
_this.attribute( "eframe" ).toFloat() );
|
||||
m_reverseButton->setChecked( _this.attribute( "reversed" ).toInt() );
|
||||
@@ -339,10 +347,14 @@ QString audioFileProcessor::nodeName( void ) const
|
||||
void audioFileProcessor::setParameter( const QString & _param,
|
||||
const QString & _value )
|
||||
{
|
||||
if( _param == "audiofile" )
|
||||
if( _param == "samplefile" )
|
||||
{
|
||||
setAudioFile( _value );
|
||||
}
|
||||
else if( _param == "sampledata" )
|
||||
{
|
||||
m_sampleBuffer.loadFromBase64( _value );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -668,9 +680,5 @@ plugin * lmms_plugin_main( void * _data )
|
||||
}
|
||||
|
||||
|
||||
|
||||
#undef isChecked
|
||||
#undef isOn
|
||||
|
||||
#include "audio_file_processor.moc"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* audio_file_processor.h - declaration of class audioFileProcessor
|
||||
* (instrument-plugin for using audio-files)
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
33
plugins/bit_invader/Makefile.am
Normal file
33
plugins/bit_invader/Makefile.am
Normal file
@@ -0,0 +1,33 @@
|
||||
AUTOMAKE_OPTIONS = foreign 1.4
|
||||
|
||||
|
||||
INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)/src/lib -I.
|
||||
|
||||
|
||||
AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS) -DPLUGIN_NAME="bitinvader"
|
||||
|
||||
|
||||
%.moc: ./%.h
|
||||
$(MOC) -o $@ $<
|
||||
|
||||
|
||||
MOC_FILES = ./bit_invader.moc ./graph.moc
|
||||
|
||||
BUILT_SOURCES = $(MOC_FILES) ./embedded_resources.h
|
||||
EMBEDDED_RESOURCES = $(wildcard *png)
|
||||
|
||||
./embedded_resources.h: $(EMBEDDED_RESOURCES)
|
||||
$(top_builddir)/buildtools/bin2res $(EMBEDDED_RESOURCES) > $@
|
||||
|
||||
EXTRA_DIST = $(EMBEDDED_RESOURCES)
|
||||
|
||||
|
||||
CLEANFILES = $(MOC_FILES) ./embedded_resources.h
|
||||
|
||||
|
||||
|
||||
pkglib_LTLIBRARIES= libbitinvader.la
|
||||
|
||||
libbitinvader_la_SOURCES = bit_invader.cpp bit_invader.h graph.cpp graph.h
|
||||
|
||||
$(libbitinvader_la_SOURCES): ./embedded_resources.h
|
||||
BIN
plugins/bit_invader/artwork.png
Normal file
BIN
plugins/bit_invader/artwork.png
Normal file
Binary file not shown.
813
plugins/bit_invader/bit_invader.cpp
Normal file
813
plugins/bit_invader/bit_invader.cpp
Normal file
@@ -0,0 +1,813 @@
|
||||
/*
|
||||
* bit_invader.cpp - instrument which uses a usereditable wavetable
|
||||
*
|
||||
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
*
|
||||
* 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QPainter>
|
||||
#include <QButtonGroup>
|
||||
#include <QBitmap>
|
||||
#include <Qt/QtXml>
|
||||
#include <QFileInfo>
|
||||
#include <QDropEvent>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qbuttongroup.h>
|
||||
#include <qbitmap.h>
|
||||
#include <qdom.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qdom.h>
|
||||
#include <qmap.h>
|
||||
#include <qcanvas.h>
|
||||
#include <qlabel.h>
|
||||
|
||||
#endif
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
#include "math.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
#include "bit_invader.h"
|
||||
#include "channel_track.h"
|
||||
#include "note_play_handle.h"
|
||||
#include "templates.h"
|
||||
#include "buffer_allocator.h"
|
||||
#include "knob.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "tooltip.h"
|
||||
#include "song_editor.h"
|
||||
#include "oscillator.h"
|
||||
#include "sample_buffer.h"
|
||||
#include "embed.cpp"
|
||||
#include "base64.h"
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
plugin::descriptor bitinvader_plugin_descriptor =
|
||||
{
|
||||
STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ),
|
||||
"BitInvader",
|
||||
QT_TRANSLATE_NOOP( "pluginBrowser",
|
||||
"Rough & Dirty Wavetable Synthesizer." ),
|
||||
"Andreas Brandmaier <andreas/at/brandmaier/dot/de>",
|
||||
0x0100,
|
||||
plugin::INSTRUMENT,
|
||||
PLUGIN_NAME::findEmbeddedData( "logo.png" )
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
QPixmap * bitInvader::s_artwork = NULL;
|
||||
|
||||
|
||||
bSynth::bSynth(float* shape, int length, float _pitch, bool _interpolation, float factor)
|
||||
{
|
||||
|
||||
interpolation = _interpolation;
|
||||
|
||||
// init variables
|
||||
|
||||
sample_length = length;
|
||||
sample_shape = new float[sample_length];
|
||||
for (int i=0; i < length; i++)
|
||||
{
|
||||
sample_shape[i] = shape[i] * factor;
|
||||
}
|
||||
|
||||
|
||||
sample_index = 0;
|
||||
sample_realindex = 0;
|
||||
|
||||
|
||||
sample_step = static_cast<float>( sample_length /
|
||||
((float)mixer::inst()->sampleRate() / _pitch) );
|
||||
|
||||
/* cout << "Sample length: " << sample_length << endl <<
|
||||
"Sample rate : " << mixer::inst()->sampleRate() << endl <<
|
||||
"Frequency : " << _pitch << endl <<
|
||||
"Sample step : " << sample_step << endl;
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
bSynth::~bSynth()
|
||||
{
|
||||
delete[] sample_shape;
|
||||
}
|
||||
|
||||
sampleType bSynth::nextStringSample( void )
|
||||
{
|
||||
|
||||
|
||||
// check overflow
|
||||
while (sample_realindex >= sample_length) {
|
||||
sample_realindex -= sample_length;
|
||||
}
|
||||
|
||||
sampleType sample;
|
||||
|
||||
if (interpolation) {
|
||||
|
||||
// find position in shape
|
||||
int a = static_cast<int>(sample_realindex);
|
||||
int b;
|
||||
if (a < (sample_length-1)) {
|
||||
b = static_cast<int>(sample_realindex+1);
|
||||
} else {
|
||||
b = 0;
|
||||
}
|
||||
|
||||
// Nachkommaanteil
|
||||
float frac = sample_realindex - static_cast<int>(sample_realindex);
|
||||
|
||||
sample = sample_shape[a]*(1-frac) + sample_shape[b]*(frac);
|
||||
|
||||
} else {
|
||||
// No interpolation
|
||||
sample_index = static_cast<int>(sample_realindex);
|
||||
sample = sample_shape[sample_index];
|
||||
}
|
||||
|
||||
// progress in shape
|
||||
sample_realindex += sample_step;
|
||||
|
||||
// cout << sample_index << "\t";
|
||||
|
||||
return sample;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
*
|
||||
* class BitInvader
|
||||
*
|
||||
* lmms - plugin
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
bitInvader::bitInvader( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track,
|
||||
&bitinvader_plugin_descriptor ),
|
||||
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) )
|
||||
{
|
||||
|
||||
|
||||
m_graph = NULL;
|
||||
normalize = false;
|
||||
interpolation = false;
|
||||
|
||||
if( s_artwork == NULL )
|
||||
{
|
||||
s_artwork = new QPixmap( PLUGIN_NAME::getIconPixmap(
|
||||
"artwork" ) );
|
||||
}
|
||||
|
||||
|
||||
m_pickKnob = new knob( knobDark_28, this, tr( "Samplelength" ) );
|
||||
m_pickKnob->setRange( 8, 128, 1 );
|
||||
m_pickKnob->setValue( 128, TRUE );
|
||||
m_pickKnob->move( 10, 120 );
|
||||
m_pickKnob->setHintText( tr( "Sample Length" ) + " ", "" );
|
||||
|
||||
connect( m_pickKnob, SIGNAL( valueChanged( float ) ),
|
||||
this, SLOT ( sampleSizeChanged( float ) )
|
||||
);
|
||||
|
||||
m_interpolationToggle = new ledCheckBox( "Interpolation", this );
|
||||
m_interpolationToggle->move( 55,80 );
|
||||
|
||||
connect( m_interpolationToggle, SIGNAL( toggled( bool ) ),
|
||||
this, SLOT ( interpolationToggle( bool ) ) );
|
||||
|
||||
m_normalizeToggle = new ledCheckBox( "Normalize", this );
|
||||
m_normalizeToggle->move( 55, 100 );
|
||||
|
||||
connect( m_normalizeToggle, SIGNAL( toggled( bool ) ),
|
||||
this, SLOT ( normalizeToggle( bool ) ) );
|
||||
|
||||
sample_length = 128;
|
||||
sample_shape = new float[128];
|
||||
emit( sinWaveClicked() );
|
||||
|
||||
m_graph = new graph( "", this );
|
||||
m_graph->move(53,118); // 55,120 - 2px border
|
||||
m_graph->setSamplePointer( sample_shape, sample_length );
|
||||
|
||||
QPixmap p = PLUGIN_NAME::getIconPixmap("wavegraph3") ;
|
||||
|
||||
m_graph->setBackground( p );
|
||||
|
||||
connect( m_graph, SIGNAL ( sampleSizeChanged( float ) ),
|
||||
this, SLOT (sampleSizeChanged( float ) ) );
|
||||
|
||||
connect( m_graph, SIGNAL ( sampleChanged( void ) ),
|
||||
this, SLOT ( sampleChanged( void ) ) );
|
||||
|
||||
sinWaveBtn = new pixmapButton( this );
|
||||
sinWaveBtn->move( 188, 120 );
|
||||
sinWaveBtn->setActiveGraphic( embed::getIconPixmap(
|
||||
"sin_wave_inactive" ) );
|
||||
sinWaveBtn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"sin_wave_inactive" ) );
|
||||
sinWaveBtn->setChecked( TRUE );
|
||||
toolTip::add( sinWaveBtn,
|
||||
tr( "Click here if you want a sine-wave for "
|
||||
"current oscillator." ) );
|
||||
|
||||
triangleWaveBtn = new pixmapButton( this );
|
||||
triangleWaveBtn->move( 188, 136 );
|
||||
triangleWaveBtn->setActiveGraphic(
|
||||
embed::getIconPixmap( "triangle_wave_inactive" ) );
|
||||
triangleWaveBtn->setInactiveGraphic(
|
||||
embed::getIconPixmap( "triangle_wave_inactive" ) );
|
||||
toolTip::add( triangleWaveBtn,
|
||||
tr( "Click here if you want a triangle-wave "
|
||||
"for current oscillator." ) );
|
||||
|
||||
sawWaveBtn = new pixmapButton( this );
|
||||
sawWaveBtn->move( 188, 152 );
|
||||
sawWaveBtn->setActiveGraphic( embed::getIconPixmap(
|
||||
"saw_wave_inactive" ) );
|
||||
sawWaveBtn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"saw_wave_inactive" ) );
|
||||
toolTip::add( sawWaveBtn,
|
||||
tr( "Click here if you want a saw-wave for "
|
||||
"current oscillator." ) );
|
||||
|
||||
sqrWaveBtn = new pixmapButton( this );
|
||||
sqrWaveBtn->move( 188, 168 );
|
||||
sqrWaveBtn->setActiveGraphic( embed::getIconPixmap(
|
||||
"square_wave_inactive" ) );
|
||||
sqrWaveBtn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"square_wave_inactive" ) );
|
||||
toolTip::add( sqrWaveBtn,
|
||||
tr( "Click here if you want a square-wave for "
|
||||
"current oscillator." ) );
|
||||
|
||||
whiteNoiseWaveBtn = new pixmapButton( this );
|
||||
whiteNoiseWaveBtn->move( 188, 184 );
|
||||
whiteNoiseWaveBtn->setActiveGraphic(
|
||||
embed::getIconPixmap( "white_noise_wave_inactive" ) );
|
||||
whiteNoiseWaveBtn->setInactiveGraphic(
|
||||
embed::getIconPixmap( "white_noise_wave_inactive" ) );
|
||||
toolTip::add( whiteNoiseWaveBtn,
|
||||
tr( "Click here if you want a white-noise for "
|
||||
"current oscillator." ) );
|
||||
|
||||
usrWaveBtn = new pixmapButton( this );
|
||||
usrWaveBtn->move( 188, 200 );
|
||||
usrWaveBtn->setActiveGraphic( embed::getIconPixmap(
|
||||
"usr_wave_active" ) );
|
||||
usrWaveBtn->setInactiveGraphic( embed::getIconPixmap(
|
||||
"usr_wave_inactive" ) );
|
||||
toolTip::add( usrWaveBtn,
|
||||
tr( "Click here if you want a user-defined "
|
||||
"wave-shape for current oscillator." ) );
|
||||
|
||||
|
||||
connect( sinWaveBtn, SIGNAL (clicked ( void ) ),
|
||||
this, SLOT ( sinWaveClicked( void ) ) );
|
||||
connect( triangleWaveBtn, SIGNAL ( clicked ( void ) ),
|
||||
this, SLOT ( triangleWaveClicked( void ) ) );
|
||||
connect( sawWaveBtn, SIGNAL (clicked ( void ) ),
|
||||
this, SLOT ( sawWaveClicked( void ) ) );
|
||||
connect( sqrWaveBtn, SIGNAL ( clicked ( void ) ),
|
||||
this, SLOT ( sqrWaveClicked( void ) ) );
|
||||
connect( whiteNoiseWaveBtn, SIGNAL ( clicked ( void ) ),
|
||||
this, SLOT ( noiseWaveClicked( void ) ) );
|
||||
connect( usrWaveBtn, SIGNAL ( clicked ( void ) ),
|
||||
this, SLOT ( usrWaveClicked( void ) ) );
|
||||
|
||||
|
||||
|
||||
smoothBtn = new pixmapButton( this );
|
||||
smoothBtn->move( 55, 225 );
|
||||
smoothBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"smooth" ) );
|
||||
smoothBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"smooth" ) );
|
||||
smoothBtn->setChecked( TRUE );
|
||||
toolTip::add( smoothBtn,
|
||||
tr( "Click here to "
|
||||
"smooth waveform." ) );
|
||||
|
||||
connect( smoothBtn, SIGNAL ( clicked ( void ) ),
|
||||
this, SLOT ( smoothClicked( void ) ) );
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap(
|
||||
"artwork" ) );
|
||||
setPalette( pal );
|
||||
#else
|
||||
setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void bitInvader::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap pm( rect().size() );
|
||||
pm.fill( this, rect().topLeft() );
|
||||
|
||||
QPainter p( &pm, this );
|
||||
#endif
|
||||
p.drawPixmap( 0, 0, *s_artwork );
|
||||
|
||||
p.setPen( QColor( 255, 255, 255 ) );
|
||||
// p.setPen( QColor( 0xFF, 0xAA, 0x00 ) );
|
||||
|
||||
// p.drawLine(0,0,200,200);
|
||||
|
||||
#ifndef QT4
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
void bitInvader::sinWaveClicked( void )
|
||||
{
|
||||
// generate a Sinus wave using static oscillator-method
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
sample_shape[i] = oscillator::sinSample( i/static_cast<float>(sample_length) );
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
}
|
||||
|
||||
void bitInvader::triangleWaveClicked( void )
|
||||
{
|
||||
// generate a Triangle wave using static oscillator-method
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
sample_shape[i] = oscillator::triangleSample( i/static_cast<float>(sample_length) );
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
|
||||
}
|
||||
|
||||
|
||||
void bitInvader::sawWaveClicked( void )
|
||||
{
|
||||
// generate a Saw wave using static oscillator-method
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
sample_shape[i] = oscillator::sawSample( i/static_cast<float>(sample_length) );
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
}
|
||||
|
||||
void bitInvader::sqrWaveClicked( void )
|
||||
{
|
||||
// generate a Sqr wave using static oscillator-method
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
sample_shape[i] = oscillator::squareSample( i/static_cast<float>(sample_length) );
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
|
||||
}
|
||||
|
||||
void bitInvader::noiseWaveClicked( void )
|
||||
{
|
||||
// generate a Noise wave using static oscillator-method
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
sample_shape[i] = oscillator::noiseSample( i/static_cast<float>(sample_length) );
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
|
||||
}
|
||||
|
||||
void bitInvader::usrWaveClicked( void )
|
||||
{
|
||||
// zero sample_shape
|
||||
for (int i = 0; i < sample_length; i++)
|
||||
{
|
||||
sample_shape[i] = 0;
|
||||
}
|
||||
|
||||
// load user shape
|
||||
sampleBuffer buffer;
|
||||
QString af = buffer.openAudioFile();
|
||||
if ( af != "" )
|
||||
{
|
||||
buffer.setAudioFile( af );
|
||||
|
||||
// copy buffer data
|
||||
sample_length = min( sample_length, static_cast<int>(buffer.frames()) );
|
||||
for ( int i = 0; i < sample_length; i++ )
|
||||
{
|
||||
// sample_shape = (float*)buffer.data();
|
||||
sample_shape[i] = (float)*buffer.data()[i];
|
||||
}
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
|
||||
deprecated code
|
||||
|
||||
was replaced by static oscillator methods
|
||||
|
||||
void bitInvader::sinWaveClicked( void )
|
||||
{
|
||||
// generate sample data
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
// sin(x)
|
||||
sample_shape[i] = sinf(i * 6.2831853 / sample_length);
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
}
|
||||
|
||||
void bitInvader::triangleWaveClicked( void )
|
||||
{
|
||||
int half_sample_length = sample_length / 2;
|
||||
|
||||
if ((sample_length % 2) == 0) {
|
||||
|
||||
for (int i=0; i < half_sample_length; i++)
|
||||
{
|
||||
// triangle
|
||||
sample_shape[i] = (((float)i) / half_sample_length * 2) - 1;
|
||||
}
|
||||
for (int i=half_sample_length; i < sample_length; i++)
|
||||
{
|
||||
// triangle
|
||||
sample_shape[i] = - (((float)(i-half_sample_length)) / half_sample_length * 2) + 1;
|
||||
}
|
||||
|
||||
} else {
|
||||
for (int i=0; i < half_sample_length; i++)
|
||||
{
|
||||
// triangle
|
||||
sample_shape[i] = (((float)i) / half_sample_length * 2) - 1;
|
||||
}
|
||||
sample_shape[half_sample_length] = 1;
|
||||
for (int i=half_sample_length+1; i < sample_length; i++)
|
||||
{
|
||||
// triangle
|
||||
sample_shape[i] = - (((float)(i-half_sample_length)) / half_sample_length * 2) + 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
}
|
||||
|
||||
void bitInvader::sawWaveClicked( void )
|
||||
{
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
// saw
|
||||
sample_shape[i] = (((float)i) / sample_length * 2) - 1;
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
}
|
||||
|
||||
void bitInvader::sqrWaveClicked( void )
|
||||
{
|
||||
int half_sample_length = sample_length / 2;
|
||||
|
||||
for (int i=0; i < half_sample_length; i++)
|
||||
{
|
||||
// triangle
|
||||
sample_shape[i] = 1;
|
||||
}
|
||||
for (int i=half_sample_length; i < sample_length; i++)
|
||||
{
|
||||
// triangle
|
||||
sample_shape[i] = -1;
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void bitInvader::noiseWaveClicked( void)
|
||||
{
|
||||
srand(time(NULL));
|
||||
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
sample_shape[i]= ((float)rand() / RAND_MAX * 2.0) - 1.0;
|
||||
}
|
||||
|
||||
sampleChanged();
|
||||
|
||||
}
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
bitInvader::~bitInvader()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bitInvader::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent )
|
||||
{
|
||||
|
||||
QDomElement to_de = _doc.createElement( nodeName() );
|
||||
|
||||
// Save plugin version
|
||||
to_de.setAttribute( "version", "0.1" );
|
||||
|
||||
// Save sample length
|
||||
to_de.setAttribute( "sampleLength", QString::number( sample_length ) );
|
||||
|
||||
// Save sample shape base64-encoded
|
||||
QString sampleString;
|
||||
base64::encode( (const char *)sample_shape,
|
||||
sample_length * sizeof(float), sampleString );
|
||||
to_de.setAttribute( "sampleShape", sampleString );
|
||||
|
||||
|
||||
// save LED normalize
|
||||
to_de.setAttribute( "interpolation",
|
||||
m_interpolationToggle->isChecked() );
|
||||
|
||||
// save LED
|
||||
to_de.setAttribute( "normalize", m_normalizeToggle->isChecked() );
|
||||
|
||||
_parent.appendChild( to_de );
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bitInvader::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
|
||||
|
||||
// Load sample length
|
||||
sample_length = _this.attribute( "sampleLength" ).toInt() ;
|
||||
|
||||
// Load knobs (fires change SIGNAL?)
|
||||
m_pickKnob->setValue( static_cast<float>(sample_length) );
|
||||
|
||||
// Load sample shape
|
||||
delete[] sample_shape;
|
||||
sample_shape = new float[sample_length];
|
||||
QString sampleString = _this.attribute( "sampleShape");
|
||||
int size = 0;
|
||||
char * dst = 0;
|
||||
base64::decode( sampleString, &dst, &size );
|
||||
memcpy( sample_shape, dst, size );
|
||||
|
||||
m_graph->setSamplePointer( sample_shape, sample_length );
|
||||
|
||||
// Load LED normalize
|
||||
m_interpolationToggle->setChecked( _this.attribute(
|
||||
"interpolation" ).toInt() );
|
||||
// Load LED
|
||||
m_normalizeToggle->setChecked( _this.attribute( "normalize" ).toInt() );
|
||||
update();
|
||||
|
||||
// songEditor::inst()->setModified();
|
||||
|
||||
}
|
||||
|
||||
void bitInvader::interpolationToggle( bool value )
|
||||
{
|
||||
interpolation = value;
|
||||
|
||||
songEditor::inst()->setModified();
|
||||
|
||||
}
|
||||
|
||||
void bitInvader::normalizeToggle( bool value )
|
||||
{
|
||||
normalize = value;
|
||||
|
||||
songEditor::inst()->setModified();
|
||||
|
||||
}
|
||||
|
||||
|
||||
QString bitInvader::nodeName( void ) const
|
||||
{
|
||||
return( bitinvader_plugin_descriptor.name );
|
||||
}
|
||||
|
||||
|
||||
void bitInvader::smoothClicked( void )
|
||||
{
|
||||
// store values in temporary array
|
||||
float* temp = new float[sample_length];
|
||||
memcpy( temp, sample_shape, sizeof( float ) * sample_length );
|
||||
|
||||
// Smoothing
|
||||
sample_shape[0] = ( temp[0]+temp[sample_length-1] ) * 0.5f;
|
||||
for ( int i=1; i < sample_length; i++)
|
||||
{
|
||||
sample_shape[i] = (temp[i-1] + temp[i]) * 0.5f;
|
||||
}
|
||||
|
||||
|
||||
// Clean up
|
||||
delete[] temp;
|
||||
|
||||
// paint
|
||||
update();
|
||||
m_graph->update();
|
||||
|
||||
songEditor::inst()->setModified();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bitInvader::playNote( notePlayHandle * _n )
|
||||
{
|
||||
if ( _n->totalFramesPlayed() == 0 )
|
||||
{
|
||||
|
||||
float freq = getChannelTrack()->frequency( _n );
|
||||
|
||||
float factor;
|
||||
if (!normalize) {
|
||||
factor = 1.0;
|
||||
} else {
|
||||
factor = normalizeFactor;
|
||||
}
|
||||
|
||||
_n->m_pluginData = new bSynth( sample_shape, sample_length,freq
|
||||
, interpolation, factor
|
||||
//, m_pickKnob->value()
|
||||
//m_pickupKnob->value()
|
||||
);
|
||||
}
|
||||
|
||||
const Uint32 frames = mixer::inst()->framesPerAudioBuffer();
|
||||
sampleFrame * buf = bufferAllocator::alloc<sampleFrame>( frames );
|
||||
|
||||
bSynth * ps = static_cast<bSynth *>( _n->m_pluginData );
|
||||
for( Uint32 frame = 0; frame < frames; ++frame )
|
||||
{
|
||||
const sampleType cur = ps->nextStringSample();
|
||||
for( Uint8 chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl )
|
||||
{
|
||||
buf[frame][chnl] = cur;
|
||||
}
|
||||
}
|
||||
|
||||
getChannelTrack()->processAudioBuffer( buf, frames, _n );
|
||||
|
||||
bufferAllocator::free( buf );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void bitInvader::deleteNotePluginData( notePlayHandle * _n )
|
||||
{
|
||||
delete static_cast<bSynth *>( _n->m_pluginData );
|
||||
}
|
||||
|
||||
|
||||
void bitInvader::sampleSizeChanged( float _new_sample_length )
|
||||
{
|
||||
int new_sample_length = static_cast<int>(_new_sample_length);
|
||||
|
||||
// ** grow array
|
||||
if (new_sample_length > sample_length) {
|
||||
|
||||
// store values in temporary array
|
||||
float* temp = new float[sample_length];
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
temp[i] = sample_shape[i];
|
||||
}
|
||||
|
||||
// reinitialize sample array
|
||||
delete[] sample_shape;
|
||||
sample_shape = new float[new_sample_length];
|
||||
for (int i=0; i < new_sample_length; i++)
|
||||
{
|
||||
sample_shape[i] = 0;
|
||||
}
|
||||
|
||||
// fill in old values
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
sample_shape[i] = temp[i];
|
||||
}
|
||||
|
||||
delete[] temp;
|
||||
sample_length = new_sample_length;
|
||||
|
||||
}
|
||||
|
||||
// ** shrink array
|
||||
if (new_sample_length < sample_length) {
|
||||
|
||||
sample_length = new_sample_length;
|
||||
|
||||
}
|
||||
|
||||
|
||||
// update sample graph
|
||||
m_graph->setSamplePointer( sample_shape, sample_length );
|
||||
|
||||
// set Song modified
|
||||
songEditor::inst()->setModified();
|
||||
|
||||
}
|
||||
|
||||
void bitInvader::sampleChanged()
|
||||
{
|
||||
|
||||
// analyze
|
||||
float max = 0;
|
||||
for (int i=0; i < sample_length; i++)
|
||||
{
|
||||
if (fabsf(sample_shape[i]) > max) { max = fabs(sample_shape[i]); }
|
||||
}
|
||||
normalizeFactor = 1.0 / max;
|
||||
|
||||
|
||||
// update
|
||||
if (m_graph != NULL) {
|
||||
m_graph->update();
|
||||
}
|
||||
|
||||
songEditor::inst()->setModified();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
// neccessary for getting instance out of shared lib
|
||||
plugin * lmms_plugin_main( void * _data )
|
||||
{
|
||||
return( new bitInvader( static_cast<channelTrack *>( _data ) ) );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
142
plugins/bit_invader/bit_invader.h
Normal file
142
plugins/bit_invader/bit_invader.h
Normal file
@@ -0,0 +1,142 @@
|
||||
/*
|
||||
* bit_invader.h - declaration of class bitInvader and bSynth which
|
||||
* are a wavetable synthesizer
|
||||
*
|
||||
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
*
|
||||
* 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _BIT_INVADER_H
|
||||
#define _BIT_INVADER_H
|
||||
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QPixmap>
|
||||
|
||||
#else
|
||||
|
||||
#include <qpixmap.h>
|
||||
#include <qwidget.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "instrument.h"
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
#include "graph.h"
|
||||
#include "led_checkbox.h"
|
||||
#include "oscillator.h"
|
||||
|
||||
class knob;
|
||||
class notePlayHandle;
|
||||
class pixmapButton;
|
||||
|
||||
class bSynth
|
||||
{
|
||||
public:
|
||||
bSynth(float* sample, int length, float _pitch, bool _interpolation, float factor);
|
||||
virtual ~bSynth();
|
||||
|
||||
sampleType nextStringSample();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
int sample_index;
|
||||
float sample_realindex;
|
||||
int sample_length;
|
||||
float* sample_shape;
|
||||
float sample_step;
|
||||
|
||||
bool interpolation;
|
||||
|
||||
} ;
|
||||
|
||||
class bitInvader : public instrument, public specialBgHandlingWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
bitInvader(channelTrack * _channel_track );
|
||||
virtual ~bitInvader();
|
||||
|
||||
virtual void FASTCALL playNote( notePlayHandle * _n );
|
||||
virtual void FASTCALL deleteNotePluginData( notePlayHandle * _n );
|
||||
|
||||
|
||||
virtual void FASTCALL saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent );
|
||||
virtual void FASTCALL loadSettings( const QDomElement & _this );
|
||||
|
||||
virtual QString nodeName( void ) const;
|
||||
|
||||
public slots:
|
||||
void sampleSizeChanged( float _new_sample_length );
|
||||
void sampleChanged( void );
|
||||
|
||||
void interpolationToggle( bool value );
|
||||
void normalizeToggle( bool value );
|
||||
void smoothClicked( void );
|
||||
|
||||
void sinWaveClicked( void );
|
||||
void triangleWaveClicked( void );
|
||||
void sqrWaveClicked( void );
|
||||
void sawWaveClicked( void );
|
||||
void noiseWaveClicked( void );
|
||||
void usrWaveClicked( void );
|
||||
/*
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * );
|
||||
*/
|
||||
|
||||
private:
|
||||
knob * m_pickKnob;
|
||||
knob * m_pickupKnob;
|
||||
|
||||
pixmapButton * sinWaveBtn;
|
||||
pixmapButton * triangleWaveBtn;
|
||||
pixmapButton * sqrWaveBtn;
|
||||
pixmapButton * sawWaveBtn;
|
||||
pixmapButton * whiteNoiseWaveBtn;
|
||||
pixmapButton * smoothBtn;
|
||||
pixmapButton * usrWaveBtn;
|
||||
|
||||
static QPixmap * s_artwork;
|
||||
|
||||
graph * m_graph;
|
||||
ledCheckBox * m_interpolationToggle;
|
||||
ledCheckBox * m_normalizeToggle;
|
||||
|
||||
int sample_length;
|
||||
float* sample_shape;
|
||||
|
||||
bool interpolation;
|
||||
bool normalize;
|
||||
float normalizeFactor;
|
||||
|
||||
oscillator * m_osc;
|
||||
} ;
|
||||
|
||||
|
||||
#include "bit_invader.moc"
|
||||
|
||||
|
||||
#endif
|
||||
223
plugins/bit_invader/graph.cpp
Normal file
223
plugins/bit_invader/graph.cpp
Normal file
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* graph.cpp - a QT widget for displaying and manipulating waveforms
|
||||
*
|
||||
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
*
|
||||
* 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QPaintEvent>
|
||||
#include <QFontMetrics>
|
||||
#include <QPainter>
|
||||
|
||||
#else
|
||||
|
||||
#include <qfontmetrics.h>
|
||||
#include <qpainter.h>
|
||||
#include <qcursor.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "graph.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <cstdlib>
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
|
||||
graph::graph( const QString & _text, QWidget * _parent) :
|
||||
QWidget( _parent )
|
||||
{
|
||||
|
||||
m_background = NULL;
|
||||
m_mouseDown = false;
|
||||
|
||||
setFixedSize( 132, 104 );
|
||||
|
||||
|
||||
#ifndef QT4
|
||||
setBackgroundMode( NoBackground );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
graph::~graph()
|
||||
{
|
||||
}
|
||||
|
||||
void graph::setBackground( const QPixmap &_pixmap )
|
||||
{
|
||||
m_background = _pixmap;
|
||||
// setErasePixmap ( m_background );
|
||||
|
||||
}
|
||||
|
||||
void graph::setSamplePointer( float * _pointer, int _length )
|
||||
{
|
||||
samplePointer = _pointer;
|
||||
sampleLength = _length;
|
||||
update();
|
||||
}
|
||||
|
||||
void graph::mouseMoveEvent ( QMouseEvent * _me )
|
||||
{
|
||||
|
||||
// get position
|
||||
int x = _me->x();
|
||||
int y = _me->y();
|
||||
|
||||
|
||||
// avoid mouse leaps
|
||||
int diff = x - m_lastCursorX;
|
||||
|
||||
if (diff >= 1) {
|
||||
x = m_lastCursorX + 1;
|
||||
} else if (diff <= 1) {
|
||||
x = m_lastCursorX - 1;
|
||||
} else {
|
||||
x = m_lastCursorX;
|
||||
}
|
||||
// QCursor::setPos( 1, 1 );
|
||||
|
||||
|
||||
|
||||
|
||||
changeSampleAt( x, y );
|
||||
|
||||
// update mouse
|
||||
m_lastCursorX = x;
|
||||
|
||||
}
|
||||
|
||||
void graph::mousePressEvent( QMouseEvent * _me )
|
||||
{
|
||||
// toggle mouse state
|
||||
m_mouseDown = true;
|
||||
|
||||
// get position
|
||||
int x = _me->x();
|
||||
int y = _me->y();
|
||||
|
||||
changeSampleAt( x,y );
|
||||
|
||||
// toggle mouse state
|
||||
m_mouseDown = true;
|
||||
#ifndef QT3
|
||||
setCursor( Qt::BlankCursor );
|
||||
#else
|
||||
setCursor( QCursor::BlankCursor );
|
||||
#endif
|
||||
m_lastCursorX = x;
|
||||
}
|
||||
|
||||
void graph::changeSampleAt(int _x, int _y)
|
||||
{
|
||||
// consider border of background image
|
||||
_x -= 2;
|
||||
_y -= 2;
|
||||
|
||||
// boundary check
|
||||
if (_x < 0) { return; }
|
||||
if (_x > sampleLength) { return; }
|
||||
if (_y < 0) { return; }
|
||||
if (_y >= 100) { return; }
|
||||
_y = 100 - _y;
|
||||
|
||||
// change sample shape
|
||||
samplePointer[_x] = (_y-50.0)/50.0;
|
||||
emit sampleChanged();
|
||||
|
||||
|
||||
}
|
||||
|
||||
void graph::mouseReleaseEvent( QMouseEvent * _me )
|
||||
{
|
||||
// toggle mouse state
|
||||
m_mouseDown = false;
|
||||
#ifndef QT3
|
||||
setCursor( Qt::ArrowCursor );
|
||||
#else
|
||||
setCursor( QCursor::ArrowCursor );
|
||||
#endif
|
||||
update();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void graph::paintEvent( QPaintEvent * )
|
||||
{
|
||||
|
||||
#ifdef QT4
|
||||
QPainter p( this );
|
||||
#else
|
||||
QPixmap draw_pm( rect().size() );
|
||||
// draw_pm.fill( this, rect().topLeft() );
|
||||
|
||||
QPainter p( &draw_pm, this );
|
||||
#endif
|
||||
|
||||
// if (m_background != NULL) {
|
||||
p.drawPixmap( 0, 0, m_background );
|
||||
// }
|
||||
|
||||
p.setPen( QColor( 0xFF, 0xAA, 0x00 ) );
|
||||
|
||||
p.drawLine( 1+sampleLength, 2, 1+sampleLength, 102);
|
||||
|
||||
// float xscale = 200.0 / sampleLength;
|
||||
float xscale = 1.0;
|
||||
|
||||
for (int i=0; i < sampleLength-1; i++)
|
||||
{
|
||||
p.drawLine(2+static_cast<int>(i*xscale),
|
||||
2+static_cast<int>(-samplePointer[i]*50) + 50,
|
||||
2+static_cast<int>((i+1)*xscale),
|
||||
2+static_cast<int>(-samplePointer[i+1]*50 + 50)
|
||||
);
|
||||
}
|
||||
|
||||
// draw Pointer
|
||||
if (m_mouseDown) {
|
||||
QPoint cursor = mapFromGlobal( QCursor::pos() );
|
||||
p.setPen( QColor( 0xAA, 0xFF, 0x00 ) );
|
||||
p.drawLine( 2, cursor.y(), 130, cursor.y() );
|
||||
p.drawLine( cursor.x(), 2, cursor.x(), 102 );
|
||||
}
|
||||
|
||||
#ifndef QT4
|
||||
// and blit all the drawn stuff on the screen...
|
||||
bitBlt( this, rect().topLeft(), &draw_pm );
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include "graph.moc"
|
||||
95
plugins/bit_invader/graph.h
Normal file
95
plugins/bit_invader/graph.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* graph.h - a QT widget for displaying and manipulating waveforms
|
||||
*
|
||||
* Copyright (c) 2006 Andreas Brandmaier <andy/at/brandmaier/dot/de>
|
||||
*
|
||||
* 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _GRAPH_H
|
||||
#define _GRAPH_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPixmap>
|
||||
#include <QCursor>
|
||||
|
||||
#else
|
||||
|
||||
#include <qwidget.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qcursor.h>
|
||||
#endif
|
||||
|
||||
|
||||
//class QPixmap;
|
||||
|
||||
|
||||
class graph : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
/* enum ledColors
|
||||
{
|
||||
YELLOW, GREEN, TOTAL_COLORS
|
||||
} ;
|
||||
*/
|
||||
graph( const QString & _txt, QWidget * _parent//,
|
||||
//ledColors _color = YELLOW
|
||||
);
|
||||
virtual ~graph();
|
||||
|
||||
|
||||
void setSamplePointer( float * pointer, int length );
|
||||
|
||||
void setBackground ( const QPixmap & _pixmap );
|
||||
|
||||
signals:
|
||||
void sampleSizeChanged( float f );
|
||||
void sampleChanged( void );
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
virtual void mousePressEvent( QMouseEvent * _me );
|
||||
virtual void mouseMoveEvent( QMouseEvent * _me );
|
||||
virtual void mouseReleaseEvent( QMouseEvent * _me );
|
||||
|
||||
private:
|
||||
|
||||
void changeSampleAt(int _x, int _y);
|
||||
|
||||
QPixmap m_background;
|
||||
|
||||
|
||||
float *samplePointer;
|
||||
int sampleLength;
|
||||
|
||||
bool m_mouseDown;
|
||||
int m_lastCursorX;
|
||||
|
||||
//signals:
|
||||
// void toggled( bool );
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
BIN
plugins/bit_invader/logo.png
Normal file
BIN
plugins/bit_invader/logo.png
Normal file
Binary file not shown.
BIN
plugins/bit_invader/smooth.png
Normal file
BIN
plugins/bit_invader/smooth.png
Normal file
Binary file not shown.
BIN
plugins/bit_invader/wavegraph.png
Normal file
BIN
plugins/bit_invader/wavegraph.png
Normal file
Binary file not shown.
BIN
plugins/bit_invader/wavegraph3.png
Normal file
BIN
plugins/bit_invader/wavegraph3.png
Normal file
Binary file not shown.
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* plucked_string_synth.cpp - instrument which uses the Karplus-Strong-algorithm
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -70,8 +70,7 @@ plugin::descriptor pluckedstringsynth_plugin_descriptor =
|
||||
// add distortion
|
||||
|
||||
pluckedStringSynth::pluckedStringSynth( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track,
|
||||
pluckedstringsynth_plugin_descriptor.public_name )
|
||||
instrument( _channel_track, &pluckedstringsynth_plugin_descriptor )
|
||||
{
|
||||
m_pickKnob = new knob( knobDark_28, this, tr( "Pick position" ) );
|
||||
m_pickKnob->setRange( 0.0f, 0.5f, 0.005f );
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* plucked_string_sytn.h - declaration of class pluckedStringSynth which
|
||||
* is a synth for plucked string-sounds
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* triple_oscillator.cpp - powerful instrument with three oscillators
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -77,14 +77,14 @@ plugin::descriptor tripleoscillator_plugin_descriptor =
|
||||
|
||||
|
||||
tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track,
|
||||
tripleoscillator_plugin_descriptor.public_name ),
|
||||
instrument( _channel_track, &tripleoscillator_plugin_descriptor ),
|
||||
m_modulationAlgo1( oscillator::MIX ),
|
||||
m_modulationAlgo2( oscillator::MIX )
|
||||
{
|
||||
#ifdef QT4
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
pal.setBrush( backgroundRole(),
|
||||
PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
setPalette( pal );
|
||||
#else
|
||||
setErasePixmap( PLUGIN_NAME::getIconPixmap( "artwork" ) );
|
||||
@@ -92,7 +92,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_fm1OscBtn = new pixmapButton( this );
|
||||
m_fm1OscBtn->move( 80, 50 );
|
||||
m_fm1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) );
|
||||
m_fm1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"fm_active" ) );
|
||||
m_fm1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"fm_inactive" ) );
|
||||
m_fm1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
@@ -105,7 +106,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_am1OscBtn = new pixmapButton( this );
|
||||
m_am1OscBtn->move( 120, 50 );
|
||||
m_am1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) );
|
||||
m_am1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"am_active" ) );
|
||||
m_am1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"am_inactive" ) );
|
||||
m_am1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
@@ -118,11 +120,12 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_mix1OscBtn = new pixmapButton( this );
|
||||
m_mix1OscBtn->move( 160, 50 );
|
||||
m_mix1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) );
|
||||
m_mix1OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"mix_active" ) );
|
||||
m_mix1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"mix_inactive" ) );
|
||||
m_mix1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
createHeuristicMask() ) );
|
||||
m_mix1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap(
|
||||
"btn_mask" ).createHeuristicMask() ) );
|
||||
connect( m_mix1OscBtn, SIGNAL( toggled( bool ) ), this,
|
||||
SLOT( mix1BtnToggled( bool ) ) );
|
||||
toolTip::add( m_mix1OscBtn, tr( "mix output of oscillator 1 & 2" ) );
|
||||
@@ -133,8 +136,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
"sync_active" ) );
|
||||
m_sync1OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"sync_inactive" ) );
|
||||
m_sync1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
createHeuristicMask() ) );
|
||||
m_sync1OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap(
|
||||
"btn_mask" ).createHeuristicMask() ) );
|
||||
connect( m_sync1OscBtn, SIGNAL( toggled( bool ) ), this, SLOT(
|
||||
sync1BtnToggled( bool ) ) );
|
||||
toolTip::add( m_sync1OscBtn, tr( "synchronize oscillator 1 with "
|
||||
@@ -169,7 +172,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_fm2OscBtn = new pixmapButton( this );
|
||||
m_fm2OscBtn->move( 80, 70 );
|
||||
m_fm2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) );
|
||||
m_fm2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"fm_active" ) );
|
||||
m_fm2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"fm_inactive" ) );
|
||||
m_fm2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
@@ -182,8 +186,10 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_am2OscBtn = new pixmapButton( this );
|
||||
m_am2OscBtn->move( 120, 70 );
|
||||
m_am2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) );
|
||||
m_am2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap("am_inactive" ) );
|
||||
m_am2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"am_active" ) );
|
||||
m_am2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"am_inactive" ) );
|
||||
m_am2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
createHeuristicMask() ) );
|
||||
connect( m_am2OscBtn, SIGNAL( toggled( bool ) ), this,
|
||||
@@ -194,11 +200,12 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
|
||||
m_mix2OscBtn = new pixmapButton( this );
|
||||
m_mix2OscBtn->move( 160, 70 );
|
||||
m_mix2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) );
|
||||
m_mix2OscBtn->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"mix_active" ) );
|
||||
m_mix2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"mix_inactive" ) );
|
||||
m_mix2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
createHeuristicMask() ) );
|
||||
m_mix2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap(
|
||||
"btn_mask" ).createHeuristicMask() ) );
|
||||
connect( m_mix2OscBtn, SIGNAL( toggled( bool ) ), this,
|
||||
SLOT( mix2BtnToggled( bool ) ) );
|
||||
toolTip::add( m_mix2OscBtn, tr("mix output of oscillator 2 & 3" ) );
|
||||
@@ -209,8 +216,8 @@ tripleOscillator::tripleOscillator( channelTrack * _channel_track ) :
|
||||
"sync_active" ) );
|
||||
m_sync2OscBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"sync_inactive" ) );
|
||||
m_sync2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap( "btn_mask" ).
|
||||
createHeuristicMask() ) );
|
||||
m_sync2OscBtn->setMask( QBitmap( PLUGIN_NAME::getIconPixmap(
|
||||
"btn_mask" ).createHeuristicMask() ) );
|
||||
connect( m_sync2OscBtn, SIGNAL( toggled( bool ) ), this,
|
||||
SLOT( sync2BtnToggled( bool ) ) );
|
||||
toolTip::add( m_sync2OscBtn, tr( "synchronize oscillator 2 with "
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* triple_oscillator.h - declaration of class tripleOscillator a powerful
|
||||
* instrument-plugin with 3 oscillators
|
||||
*
|
||||
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
|
||||
@@ -21,19 +21,26 @@ EMBEDDED_RESOURCES = $(wildcard *png)
|
||||
EXTRA_DIST = $(EMBEDDED_RESOURCES)
|
||||
|
||||
|
||||
CLEANFILES = $(MOC_FILES) ./embedded_resources.h xfst.exe.so
|
||||
|
||||
pkglib_LTLIBRARIES = libvestige.la
|
||||
|
||||
libvestige_la_SOURCES = vestige.cpp vestige.h fstclient.cpp fstclient.h
|
||||
libvestige_la_SOURCES = vestige.cpp vestige.h lvsl_client.cpp lvsl_client.h
|
||||
|
||||
$(libvestige_la_SOURCES): ./embedded_resources.h
|
||||
|
||||
|
||||
CC = winegcc
|
||||
pkglib_PROGRAMS = xfst_server
|
||||
xfst_server_SOURCES = fstserver.cpp fstcore.c fstserver.h communication.h
|
||||
xfst_server_LDFLAGS = -mwindows -L/usr/X11R6/lib -lX11 -lpthread -o $(pkglib_PROGRAMS)
|
||||
xfst_server_LINK = wineg++
|
||||
|
||||
CC = wineg++
|
||||
pkglib_PROGRAMS = lvsl_server
|
||||
lvsl_server_SOURCES = lvsl_server.c communication.h
|
||||
lvsl_server_LDFLAGS = -mwindows -L/usr/X11R6/lib -lX11 -lpthread -o $(pkglib_PROGRAMS)
|
||||
lvsl_server_LINK = wineg++
|
||||
nobase_pkglib_DATA = $(pkglib_PROGRAMS).exe.so
|
||||
|
||||
CLEANFILES = $(MOC_FILES) ./embedded_resources.h $(nobase_pkglib_DATA)
|
||||
|
||||
|
||||
install-exec-hook:
|
||||
cd $(DESTDIR)$(pkglibdir) ; \
|
||||
strip $(nobase_pkglib_DATA)
|
||||
|
||||
|
||||
@@ -1,8 +1,14 @@
|
||||
#ifndef _COMMUNICATION_H
|
||||
#define _COMMUNICATION_H
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
#endif
|
||||
|
||||
#include <string>
|
||||
|
||||
|
||||
@@ -16,6 +22,7 @@ inline T readValue( int _fd = 0 )
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline void writeValue( const T & _i, int _fd = 1 )
|
||||
{
|
||||
@@ -23,44 +30,6 @@ inline void writeValue( const T & _i, int _fd = 1 )
|
||||
}
|
||||
|
||||
|
||||
enum vstRemoteCommands
|
||||
{
|
||||
// client -> server
|
||||
LOAD_VST_PLUGIN = 0,
|
||||
CLOSE_VST_PLUGIN,
|
||||
PROCESS = 10,
|
||||
ENQUEUE_MIDI_EVENT = 11,
|
||||
SET_SAMPLE_RATE = 20,
|
||||
SET_BUFFER_SIZE,
|
||||
GET_SHM_KEY_AND_SIZE,
|
||||
GET_VST_VERSION = 30,
|
||||
GET_NAME,
|
||||
GET_VENDOR_STRING,
|
||||
GET_PRODUCT_STRING,
|
||||
|
||||
// server -> client
|
||||
SET_SHM_KEY_AND_SIZE = 100,
|
||||
SET_INPUT_COUNT,
|
||||
SET_OUTPUT_COUNT,
|
||||
SET_XID,
|
||||
INITIALIZATION_DONE,
|
||||
FAILED_LOADING_PLUGIN,
|
||||
QUIT_ACK,
|
||||
GET_SAMPLE_RATE = 110,
|
||||
GET_BUFFER_SIZE,
|
||||
GET_BPM,
|
||||
SET_VST_VERSION,
|
||||
SET_NAME,
|
||||
SET_VENDOR_STRING,
|
||||
SET_PRODUCT_STRING,
|
||||
PROCESS_DONE = 120,
|
||||
|
||||
DEBUG_MSG = 200,
|
||||
UNDEFINED_CMD
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
static inline std::string readString( int _fd = 0 )
|
||||
@@ -84,4 +53,73 @@ static inline void writeString( const char * _str, int _fd = 1 )
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
struct vstParameterDumpItem
|
||||
{
|
||||
Sint32 index;
|
||||
char shortLabel[8];
|
||||
float value;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
// summarized version of VstParameterProperties-struct - useful because client
|
||||
// doesn't have to know about the latter one
|
||||
struct vstParamProperties
|
||||
{
|
||||
char label[64];
|
||||
char shortLabel[8];
|
||||
char categoryLabel[24];
|
||||
float minValue;
|
||||
float maxValue;
|
||||
float step;
|
||||
Sint16 category;
|
||||
} ;
|
||||
|
||||
|
||||
enum vstRemoteCommands
|
||||
{
|
||||
// client -> server
|
||||
VST_LOAD_PLUGIN = 0,
|
||||
VST_CLOSE_PLUGIN,
|
||||
VST_SHOW_EDITOR,
|
||||
VST_PROCESS,
|
||||
VST_ENQUEUE_MIDI_EVENT,
|
||||
VST_SAMPLE_RATE,
|
||||
VST_BUFFER_SIZE,
|
||||
VST_BPM,
|
||||
VST_GET_PARAMETER_COUNT = 20,
|
||||
VST_GET_PARAMETER_DUMP,
|
||||
VST_SET_PARAMETER_DUMP,
|
||||
VST_GET_PARAMETER_PROPERTIES,
|
||||
|
||||
// server -> client
|
||||
VST_INITIALIZATION_DONE = 100,
|
||||
VST_FAILED_LOADING_PLUGIN,
|
||||
VST_QUIT_ACK,
|
||||
VST_SHM_KEY_AND_SIZE,
|
||||
VST_INPUT_COUNT,
|
||||
VST_OUTPUT_COUNT,
|
||||
VST_PLUGIN_XID,
|
||||
VST_PROCESS_DONE,
|
||||
VST_PLUGIN_NAME,
|
||||
VST_PLUGIN_VERSION,
|
||||
VST_PLUGIN_VENDOR_STRING,
|
||||
VST_PLUGIN_PRODUCT_STRING,
|
||||
VST_PARAMETER_COUNT,
|
||||
VST_PARAMETER_DUMP,
|
||||
VST_PARAMETER_PROPERTIES,
|
||||
VST_GET_SAMPLE_RATE = 120,
|
||||
VST_GET_BUFFER_SIZE,
|
||||
|
||||
VST_DEBUG_MSG = 200,
|
||||
VST_UNDEFINED_CMD
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
538
plugins/vestige/lvsl_client.cpp
Normal file
538
plugins/vestige/lvsl_client.cpp
Normal file
@@ -0,0 +1,538 @@
|
||||
/*
|
||||
* lvsl_client.cpp - client for LVSL Server
|
||||
*
|
||||
* Copyright (c) 2005-2006 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QApplication>
|
||||
#include <QX11EmbedWidget>
|
||||
#include <QX11Info>
|
||||
#include <QTime>
|
||||
|
||||
#else
|
||||
|
||||
#include <qapplication.h>
|
||||
#include "qxembed.h"
|
||||
|
||||
#define QX11EmbedWidget QXEmbed
|
||||
#define embedInto embed
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
#include <signal.h>
|
||||
#endif
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef HAVE_SYS_IPC_H
|
||||
#include <sys/ipc.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SHM_H
|
||||
#include <sys/shm.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_SELECT_H
|
||||
#include <sys/select.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
|
||||
#include "templates.h"
|
||||
#include "config_mgr.h"
|
||||
#include "lmms_main_win.h"
|
||||
#include "lvsl_client.h"
|
||||
|
||||
|
||||
|
||||
remoteVSTPlugin::remoteVSTPlugin( const QString & _plugin ) :
|
||||
m_failed( TRUE ),
|
||||
m_plugin( _plugin ),
|
||||
m_pluginWidget( NULL ),
|
||||
m_pluginWID( 0 ),
|
||||
m_pluginPID( -1 ),
|
||||
m_serverInFD( -1 ),
|
||||
m_serverOutFD( -1 ),
|
||||
m_serverMutex(),
|
||||
m_name( "" ),
|
||||
m_version( 0 ),
|
||||
m_vendorString( "" ),
|
||||
m_productString( "" ),
|
||||
m_inputCount( 0 ),
|
||||
m_outputCount( 0 ),
|
||||
m_shmID( -1 ),
|
||||
m_shm( NULL ),
|
||||
m_shmSize( 0 )
|
||||
{
|
||||
pipe( m_pipes[0] );
|
||||
pipe( m_pipes[1] );
|
||||
|
||||
if( ( m_pluginPID = fork() ) < 0 )
|
||||
{
|
||||
printf( "fork() failed!\n" );
|
||||
return;
|
||||
}
|
||||
else if( m_pluginPID == 0 )
|
||||
{
|
||||
dup2( m_pipes[0][0], 0 );
|
||||
dup2( m_pipes[1][1], 1 );
|
||||
QString lvsl_server_exec = configManager::inst()->pluginDir() +
|
||||
"lvsl_server";
|
||||
execlp( lvsl_server_exec.
|
||||
#ifdef QT4
|
||||
toAscii().constData(),
|
||||
#else
|
||||
ascii(),
|
||||
#endif
|
||||
lvsl_server_exec.
|
||||
#ifdef QT4
|
||||
toAscii().constData(),
|
||||
#else
|
||||
ascii(),
|
||||
#endif
|
||||
"", NULL );
|
||||
return;
|
||||
}
|
||||
m_serverInFD = m_pipes[1][0];
|
||||
m_serverOutFD = m_pipes[0][1];
|
||||
|
||||
lock();
|
||||
writeValueS<Sint16>( VST_LOAD_PLUGIN );
|
||||
writeStringS( m_plugin.
|
||||
#ifdef QT4
|
||||
toAscii().constData()
|
||||
#else
|
||||
ascii()
|
||||
#endif
|
||||
);
|
||||
unlock();
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
Sint16 cmd = VST_UNDEFINED_CMD;
|
||||
if( messagesLeft() == TRUE )
|
||||
{
|
||||
cmd = processNextMessage();
|
||||
}
|
||||
if( cmd == VST_INITIALIZATION_DONE )
|
||||
{
|
||||
m_failed = FALSE;
|
||||
break;
|
||||
}
|
||||
else if( cmd == VST_FAILED_LOADING_PLUGIN )
|
||||
{
|
||||
break;
|
||||
}
|
||||
#ifdef QT4
|
||||
QApplication::processEvents( QEventLoop::AllEvents, 50 );
|
||||
#else
|
||||
qApp->processEvents( 50 );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
remoteVSTPlugin::~remoteVSTPlugin()
|
||||
{
|
||||
if( m_failed == FALSE )
|
||||
{
|
||||
setShmKeyAndSize( 0, 0 );
|
||||
// tell server to quit and wait for acknowledge
|
||||
writeValueS<Sint16>( VST_CLOSE_PLUGIN );
|
||||
QTime t;
|
||||
t.start();
|
||||
while( t.elapsed() < 1000 )
|
||||
{
|
||||
if( messagesLeft() == TRUE &&
|
||||
processNextMessage() == VST_QUIT_ACK )
|
||||
{
|
||||
//m_pluginPID = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( m_pluginWidget != NULL )
|
||||
{
|
||||
m_pluginWidget->hide();
|
||||
delete m_pluginWidget;
|
||||
}
|
||||
// timeout?
|
||||
/* if( m_pluginPID != 0 )
|
||||
{*/
|
||||
kill( m_pluginPID, SIGTERM );
|
||||
//}
|
||||
|
||||
// close all sides of our pipes
|
||||
close( m_pipes[0][0] );
|
||||
close( m_pipes[0][1] );
|
||||
close( m_pipes[1][0] );
|
||||
close( m_pipes[1][1] );
|
||||
/* close( m_serverInFD );
|
||||
close( m_serverOutFD );*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
|
||||
void remoteVSTPlugin::showEditor( void )
|
||||
{
|
||||
if( m_pluginWidget != NULL )
|
||||
{
|
||||
m_pluginWidget->show();
|
||||
return;
|
||||
}
|
||||
if( m_pluginWID == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
XWindowAttributes attr;
|
||||
XGetWindowAttributes(
|
||||
#ifdef QT4
|
||||
QX11Info::display(),
|
||||
#else
|
||||
qt_xdisplay(),
|
||||
#endif
|
||||
m_pluginWID, &attr );
|
||||
|
||||
m_pluginWidget = new QWidget( lmmsMainWin::inst()->workspace() );
|
||||
m_pluginWidget->setFixedSize( attr.width, attr.height );
|
||||
m_pluginWidget->setWindowTitle( name() );
|
||||
|
||||
QX11EmbedWidget * xe = new QX11EmbedWidget( m_pluginWidget );
|
||||
xe->embedInto( m_pluginWID );
|
||||
xe->setFixedSize( attr.width, attr.height );
|
||||
//xe->setAutoDelete( FALSE );
|
||||
m_pluginWidget->show();
|
||||
xe->show();
|
||||
|
||||
lock();
|
||||
writeValueS<Sint16>( VST_SHOW_EDITOR );
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::hideEditor( void )
|
||||
{
|
||||
if( m_pluginWidget != NULL )
|
||||
{
|
||||
m_pluginWidget->hide();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::process( const sampleFrame * _in_buf,
|
||||
sampleFrame * _out_buf )
|
||||
{
|
||||
const Uint32 frames = mixer::inst()->framesPerAudioBuffer();
|
||||
|
||||
if( m_shm == NULL )
|
||||
{
|
||||
// m_shm being zero means we didn't initialize everything so
|
||||
// far so process one message each time (and hope we get
|
||||
// information like SHM-key etc.) until we process
|
||||
// messages in later stage of this procedure
|
||||
if( m_shmSize == 0 && messagesLeft() == TRUE )
|
||||
{
|
||||
(void) processNextMessage();
|
||||
}
|
||||
mixer::inst()->clearAudioBuffer( _out_buf, frames );
|
||||
return;
|
||||
}
|
||||
|
||||
memset( m_shm, 0, m_shmSize );
|
||||
|
||||
Uint8 inputs = tMax<Uint8>( m_inputCount, DEFAULT_CHANNELS );
|
||||
|
||||
if( _in_buf != NULL && inputs > 0 )
|
||||
{
|
||||
for( Uint8 ch = 0; ch < inputs; ++ch )
|
||||
{
|
||||
for( Uint32 frame = 0; frame < frames; ++frame )
|
||||
{
|
||||
m_shm[ch*frames+frame] = _in_buf[frame][ch];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lock();
|
||||
writeValueS<Sint16>( VST_PROCESS );
|
||||
unlock();
|
||||
|
||||
if( _out_buf != NULL && m_outputCount > 0 )
|
||||
{
|
||||
// wait until server signals that process()ing is done
|
||||
while( processNextMessage() != VST_PROCESS_DONE )
|
||||
{
|
||||
// allow better scheduling (we're just waiting)
|
||||
usleep( 10 );
|
||||
}
|
||||
|
||||
Uint8 outputs = tMax<Uint8>( m_outputCount, DEFAULT_CHANNELS );
|
||||
if( outputs != DEFAULT_CHANNELS )
|
||||
{
|
||||
// clear buffer, if plugin doesn't fill up both channels
|
||||
mixer::inst()->clearAudioBuffer( _out_buf, frames );
|
||||
}
|
||||
for( Uint8 ch = 0; ch < outputs; ++ch )
|
||||
{
|
||||
for( Uint32 frame = 0; frame < frames; ++frame )
|
||||
{
|
||||
_out_buf[frame][ch] = m_shm[(m_inputCount+ch)*
|
||||
frames+frame];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::enqueueMidiEvent( const midiEvent & _event,
|
||||
const Uint32 _frames_ahead )
|
||||
{
|
||||
lock();
|
||||
writeValueS<Sint16>( VST_ENQUEUE_MIDI_EVENT );
|
||||
writeValueS<midiEvent>( _event );
|
||||
writeValueS<Uint32>( _frames_ahead );
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::setBPM( Uint16 _bpm )
|
||||
{
|
||||
lock();
|
||||
writeValueS<Sint16>( VST_BPM );
|
||||
writeValueS<Uint16>( _bpm );
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const QMap<QString, QString> & remoteVSTPlugin::parameterDump( void )
|
||||
{
|
||||
writeValueS<Sint16>( VST_GET_PARAMETER_DUMP );
|
||||
|
||||
while( processNextMessage() != VST_PARAMETER_DUMP )
|
||||
{
|
||||
}
|
||||
|
||||
return( m_parameterDump );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::setParameterDump( const QMap<QString, QString> & _pdump )
|
||||
{
|
||||
writeValueS<Sint16>( VST_SET_PARAMETER_DUMP );
|
||||
writeValueS<Sint32>( _pdump.size() );
|
||||
for( QMap<QString, QString>::const_iterator it = _pdump.begin();
|
||||
it != _pdump.end(); ++it )
|
||||
{
|
||||
vstParameterDumpItem dump_item =
|
||||
{
|
||||
( *it ).section( ':', 0, 0 ).toInt(),
|
||||
"",
|
||||
( *it ).section( ':', 1, 1 ).toFloat()
|
||||
} ;
|
||||
writeValueS<vstParameterDumpItem>( dump_item );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::setShmKeyAndSize( Uint16 _key, size_t _size )
|
||||
{
|
||||
if( m_shm != NULL && m_shmSize > 0 )
|
||||
{
|
||||
shmdt( m_shm );
|
||||
m_shm = NULL;
|
||||
m_shmSize = 0;
|
||||
}
|
||||
// only called for detaching SHM?
|
||||
if( _size == 0 )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int shm_id = shmget( _key, _size, 0 );
|
||||
if( shm_id == -1 )
|
||||
{
|
||||
printf( "failed getting shared memory\n" );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_shm = (float *) shmat( shm_id, 0, 0 );
|
||||
// TODO: error-checking
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void remoteVSTPlugin::setPluginXID( const Sint32 _plugin_xid )
|
||||
{
|
||||
m_pluginWID = _plugin_xid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool remoteVSTPlugin::messagesLeft( void ) const
|
||||
{
|
||||
fd_set rfds;
|
||||
FD_ZERO( &rfds );
|
||||
FD_SET( m_serverInFD, &rfds );
|
||||
timeval tv;
|
||||
tv.tv_sec = 0;
|
||||
tv.tv_usec = 1; // can we use 0 here?
|
||||
return( select( m_serverInFD + 1, &rfds, NULL, NULL, &tv ) > 0 );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Sint16 remoteVSTPlugin::processNextMessage( void )
|
||||
{
|
||||
fd_set rfds;
|
||||
FD_ZERO( &rfds );
|
||||
FD_SET( m_serverInFD, &rfds );
|
||||
if( select( m_serverInFD + 1, &rfds, NULL, NULL, NULL ) <= 0 )
|
||||
{
|
||||
return( VST_UNDEFINED_CMD );
|
||||
}
|
||||
|
||||
lock();
|
||||
Sint16 cmd = readValueS<Sint16>();
|
||||
switch( cmd )
|
||||
{
|
||||
case VST_DEBUG_MSG:
|
||||
printf( "debug message from server: %s\n",
|
||||
readStringS().c_str() );
|
||||
break;
|
||||
|
||||
case VST_GET_SAMPLE_RATE:
|
||||
writeValueS<Sint16>( VST_SAMPLE_RATE );
|
||||
// handle is the same
|
||||
writeValueS<Sint32>( mixer::inst()->sampleRate() );
|
||||
break;
|
||||
|
||||
case VST_GET_BUFFER_SIZE:
|
||||
writeValueS<Sint16>( VST_BUFFER_SIZE );
|
||||
// handle is the same
|
||||
writeValueS<Uint32>(
|
||||
mixer::inst()->framesPerAudioBuffer() );
|
||||
break;
|
||||
|
||||
case VST_SHM_KEY_AND_SIZE:
|
||||
{
|
||||
Uint16 shm_key = readValueS<Uint16>();
|
||||
size_t shm_size = readValueS<size_t>();
|
||||
setShmKeyAndSize( shm_key, shm_size );
|
||||
break;
|
||||
}
|
||||
|
||||
case VST_INPUT_COUNT:
|
||||
m_inputCount = readValueS<Uint8>();
|
||||
break;
|
||||
|
||||
case VST_OUTPUT_COUNT:
|
||||
m_outputCount = readValueS<Uint8>();
|
||||
break;
|
||||
|
||||
case VST_PLUGIN_XID:
|
||||
setPluginXID( readValueS<Sint32>() );
|
||||
break;
|
||||
|
||||
case VST_PLUGIN_NAME:
|
||||
m_name = readStringS().c_str();
|
||||
break;
|
||||
|
||||
case VST_PLUGIN_VERSION:
|
||||
m_version = readValueS<Sint32>();
|
||||
break;
|
||||
|
||||
case VST_PLUGIN_VENDOR_STRING:
|
||||
m_vendorString = readStringS().c_str();
|
||||
break;
|
||||
|
||||
case VST_PLUGIN_PRODUCT_STRING:
|
||||
m_productString = readStringS().c_str();
|
||||
break;
|
||||
|
||||
case VST_PARAMETER_DUMP:
|
||||
{
|
||||
m_parameterDump.clear();
|
||||
const Sint32 num_params = readValueS<Sint32>();
|
||||
for( Sint32 i = 0; i < num_params; ++i )
|
||||
{
|
||||
vstParameterDumpItem dump_item =
|
||||
readValueS<vstParameterDumpItem>();
|
||||
m_parameterDump["param" + QString::number( dump_item.index )] =
|
||||
QString::number( dump_item.index ) + ":" +
|
||||
// QString( dump_item.shortLabel ) + ":" +
|
||||
QString::number( dump_item.value );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case VST_PROCESS_DONE:
|
||||
case VST_QUIT_ACK:
|
||||
case VST_UNDEFINED_CMD:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
unlock();
|
||||
|
||||
return( cmd );
|
||||
}
|
||||
|
||||
|
||||
180
plugins/vestige/lvsl_client.h
Normal file
180
plugins/vestige/lvsl_client.h
Normal file
@@ -0,0 +1,180 @@
|
||||
/*
|
||||
* lvsl_client.h - client for LVSL Server
|
||||
*
|
||||
* Copyright (c) 2005-2006 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., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _LVSL_CLIENT_H
|
||||
#define _LVSL_CLIENT_H
|
||||
|
||||
#include "qt3support.h"
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QString>
|
||||
#include <QMutex>
|
||||
|
||||
#else
|
||||
|
||||
#include <qstring.h>
|
||||
#include <qmutex.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "mixer.h"
|
||||
#include "communication.h"
|
||||
#include "midi.h"
|
||||
|
||||
|
||||
|
||||
class remoteVSTPlugin
|
||||
{
|
||||
public:
|
||||
remoteVSTPlugin( const QString & _plugin );
|
||||
~remoteVSTPlugin();
|
||||
|
||||
void showEditor( void );
|
||||
void hideEditor( void );
|
||||
|
||||
inline const QString & name( void ) const
|
||||
{
|
||||
return( m_name );
|
||||
}
|
||||
|
||||
inline Sint32 version( void ) const
|
||||
{
|
||||
return( m_version );
|
||||
}
|
||||
|
||||
inline const QString & vendorString( void ) const
|
||||
{
|
||||
return( m_vendorString );
|
||||
}
|
||||
|
||||
inline const QString & productString( void ) const
|
||||
{
|
||||
return( m_productString );
|
||||
}
|
||||
|
||||
void FASTCALL process( const sampleFrame * _in_buf,
|
||||
sampleFrame * _out_buf );
|
||||
void FASTCALL enqueueMidiEvent( const midiEvent & _event,
|
||||
const Uint32 _frames_ahead );
|
||||
void FASTCALL setBPM( const Uint16 _bpm );
|
||||
|
||||
const QMap<QString, QString> & parameterDump( void );
|
||||
void setParameterDump( const QMap<QString, QString> & _pdump );
|
||||
|
||||
|
||||
inline Uint8 inputCount( void ) const
|
||||
{
|
||||
return( m_inputCount );
|
||||
}
|
||||
|
||||
inline Uint8 outputCount( void ) const
|
||||
{
|
||||
return( m_outputCount );
|
||||
}
|
||||
|
||||
inline QWidget * pluginWidget( void )
|
||||
{
|
||||
return( m_pluginWidget );
|
||||
}
|
||||
|
||||
inline bool failed( void ) const
|
||||
{
|
||||
return( m_failed );
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
template<typename T>
|
||||
inline T readValueS( void ) const
|
||||
{
|
||||
return( ::readValue<T>( m_serverInFD ) );
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline void writeValueS( const T & _i ) const
|
||||
{
|
||||
::writeValue<T>( _i, m_serverOutFD );
|
||||
}
|
||||
|
||||
inline std::string readStringS( void ) const
|
||||
{
|
||||
return( ::readString( m_serverInFD ) );
|
||||
}
|
||||
|
||||
inline void writeStringS( const char * _str ) const
|
||||
{
|
||||
::writeString( _str, m_serverOutFD );
|
||||
}
|
||||
|
||||
inline void lock( void )
|
||||
{
|
||||
m_serverMutex.lock();
|
||||
}
|
||||
|
||||
inline void unlock( void )
|
||||
{
|
||||
m_serverMutex.unlock();
|
||||
}
|
||||
|
||||
bool messagesLeft( void ) const;
|
||||
Sint16 processNextMessage( void );
|
||||
|
||||
void FASTCALL setShmKeyAndSize( const Uint16 _key, const size_t _size );
|
||||
void FASTCALL setPluginXID( const Sint32 _plugin_xid );
|
||||
|
||||
|
||||
|
||||
bool m_failed;
|
||||
QString m_plugin;
|
||||
QWidget * m_pluginWidget;
|
||||
Sint32 m_pluginWID;
|
||||
|
||||
int m_pluginPID;
|
||||
int m_pipes[2][2];
|
||||
int m_serverInFD;
|
||||
int m_serverOutFD;
|
||||
|
||||
QMutex m_serverMutex;
|
||||
|
||||
QString m_name;
|
||||
Sint32 m_version;
|
||||
QString m_vendorString;
|
||||
QString m_productString;
|
||||
|
||||
QMap<QString, QString> m_parameterDump;
|
||||
|
||||
Uint8 m_inputCount;
|
||||
Uint8 m_outputCount;
|
||||
|
||||
int m_shmID;
|
||||
float * m_shm;
|
||||
size_t m_shmSize;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
#endif
|
||||
1164
plugins/vestige/lvsl_server.c
Normal file
1164
plugins/vestige/lvsl_server.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* vestige.cpp - instrument-plugin for hosting VST-plugins
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -59,6 +59,7 @@
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
#include "vestige.h"
|
||||
#include "text_float.h"
|
||||
#include "lvsl_client.h"
|
||||
|
||||
#include "embed.cpp"
|
||||
|
||||
@@ -71,8 +72,7 @@ plugin::descriptor vestige_plugin_descriptor =
|
||||
STRINGIFY_PLUGIN_NAME( PLUGIN_NAME ),
|
||||
"VeSTige",
|
||||
QT_TRANSLATE_NOOP( "pluginBrowser",
|
||||
"experimental VST-hoster for using VST-plugins "
|
||||
"within LMMS" ),
|
||||
"VST-host for using VST(i)-plugins within LMMS" ),
|
||||
"Tobias Doerffel <tobydox/at/users.sf.net>",
|
||||
0x0100,
|
||||
plugin::INSTRUMENT,
|
||||
@@ -86,15 +86,17 @@ QPixmap * vestigeInstrument::s_artwork = NULL;
|
||||
|
||||
|
||||
vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
|
||||
instrument( _channel_track, vestige_plugin_descriptor.public_name ),
|
||||
instrument( _channel_track, &vestige_plugin_descriptor ),
|
||||
specialBgHandlingWidget( PLUGIN_NAME::getIconPixmap( "artwork" ) ),
|
||||
m_plugin( NULL )
|
||||
m_plugin( NULL ),
|
||||
m_pluginMutex()
|
||||
{
|
||||
if( s_artwork == NULL )
|
||||
{
|
||||
s_artwork = new QPixmap( PLUGIN_NAME::getIconPixmap(
|
||||
"artwork" ) );
|
||||
}
|
||||
|
||||
#ifdef QT4
|
||||
QPalette pal;
|
||||
pal.setBrush( backgroundRole(), *s_artwork);
|
||||
@@ -103,6 +105,9 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
|
||||
setErasePixmap( *s_artwork );
|
||||
#endif
|
||||
|
||||
connect( songEditor::inst(), SIGNAL( bpmChanged( int ) ),
|
||||
this, SLOT( changeBPM( int ) ) );
|
||||
|
||||
m_openPluginButton = new pixmapButton( this );
|
||||
m_openPluginButton->setCheckable( FALSE );
|
||||
m_openPluginButton->setCursor( Qt::PointingHandCursor );
|
||||
@@ -127,7 +132,9 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
|
||||
"and you can select your file." ) );
|
||||
|
||||
m_toggleGUIButton = new QPushButton( tr( "Show/hide VST-GUI" ), this );
|
||||
m_toggleGUIButton->setGeometry( 20, 120, 128, 24 );
|
||||
m_toggleGUIButton->setGeometry( 20, 120, 160, 24 );
|
||||
m_toggleGUIButton->setIcon( embed::getIconPixmap( "zoom" ) );
|
||||
m_toggleGUIButton->setFont( pointSize<8>( m_toggleGUIButton->font() ) );
|
||||
connect( m_toggleGUIButton, SIGNAL( clicked() ), this,
|
||||
SLOT( toggleGUI() ) );
|
||||
#ifdef QT4
|
||||
@@ -138,6 +145,14 @@ vestigeInstrument::vestigeInstrument( channelTrack * _channel_track ) :
|
||||
tr( "Click here to show or hide the graphical user interface "
|
||||
"(GUI) of your VST-plugin." ) );
|
||||
|
||||
QPushButton * note_off_all_btn = new QPushButton( tr( "Turn off all "
|
||||
"notes" ), this );
|
||||
note_off_all_btn->setGeometry( 20, 150, 160, 24 );
|
||||
note_off_all_btn->setIcon( embed::getIconPixmap( "state_stop" ) );
|
||||
note_off_all_btn->setFont( pointSize<8>( note_off_all_btn->font() ) );
|
||||
connect( note_off_all_btn, SIGNAL( clicked() ), this,
|
||||
SLOT( noteOffAll() ) );
|
||||
|
||||
// now we need a play-handle which cares for calling play()
|
||||
instrumentPlayHandle * iph = new instrumentPlayHandle( this );
|
||||
mixer::inst()->addPlayHandle( iph );
|
||||
@@ -159,6 +174,36 @@ vestigeInstrument::~vestigeInstrument()
|
||||
|
||||
void vestigeInstrument::loadSettings( const QDomElement & _this )
|
||||
{
|
||||
setParameter( "plugin", _this.attribute( "plugin" ) );
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
if( m_plugin->pluginWidget() != NULL )
|
||||
{
|
||||
if( _this.attribute( "guivisible" ).toInt() )
|
||||
{
|
||||
m_plugin->pluginWidget()->show();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_plugin->pluginWidget()->hide();
|
||||
}
|
||||
}
|
||||
const Sint32 num_params = _this.attribute(
|
||||
"numparams" ).toInt();
|
||||
if( num_params > 0 )
|
||||
{
|
||||
QMap<QString, QString> dump;
|
||||
for( Sint32 i = 0; i < num_params; ++i )
|
||||
{
|
||||
const QString key = "param" +
|
||||
QString::number( i );
|
||||
dump[key] = _this.attribute( key );
|
||||
}
|
||||
m_plugin->setParameterDump( dump );
|
||||
}
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -168,6 +213,28 @@ void vestigeInstrument::saveSettings( QDomDocument & _doc,
|
||||
QDomElement & _parent )
|
||||
{
|
||||
QDomElement vst_de = _doc.createElement( nodeName() );
|
||||
vst_de.setAttribute( "plugin", m_pluginDLL );
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
if( m_plugin->pluginWidget() != NULL )
|
||||
{
|
||||
vst_de.setAttribute( "guivisible",
|
||||
m_plugin->pluginWidget()->isVisible() );
|
||||
}
|
||||
const QMap<QString, QString> & dump = m_plugin->parameterDump();
|
||||
vst_de.setAttribute( "numparams", dump.size() );
|
||||
for( QMap<QString, QString>::const_iterator it = dump.begin();
|
||||
it != dump.end(); ++it )
|
||||
{
|
||||
#ifdef QT4
|
||||
vst_de.setAttribute( it.key(), it.value() );
|
||||
#else
|
||||
vst_de.setAttribute( it.key(), it.data() );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
_parent.appendChild( vst_de );
|
||||
}
|
||||
|
||||
@@ -185,8 +252,15 @@ QString vestigeInstrument::nodeName( void ) const
|
||||
void vestigeInstrument::setParameter( const QString & _param,
|
||||
const QString & _value )
|
||||
{
|
||||
if( _param == "plugin" )
|
||||
if( _param == "plugin" && _value != "" )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
bool set_ch_name = ( m_plugin != NULL &&
|
||||
getChannelTrack()->name() == m_plugin->name() ) ||
|
||||
getChannelTrack()->name() ==
|
||||
channelTrack::tr( "Default" );
|
||||
m_pluginMutex.unlock();
|
||||
|
||||
closePlugin();
|
||||
|
||||
m_pluginDLL = _value;
|
||||
@@ -195,9 +269,12 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
tr( "Please wait while loading VST-plugin..." ),
|
||||
PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ),
|
||||
0 );
|
||||
m_pluginMutex.lock();
|
||||
m_plugin = new remoteVSTPlugin( m_pluginDLL );
|
||||
if( m_plugin->failed() )
|
||||
{
|
||||
m_pluginMutex.unlock();
|
||||
closePlugin();
|
||||
delete tf;
|
||||
QMessageBox::information( this,
|
||||
tr( "Failed loading VST-plugin" ),
|
||||
@@ -208,7 +285,6 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
"contact an LMMS-developer!"
|
||||
).arg( m_pluginDLL ),
|
||||
QMessageBox::Ok );
|
||||
closePlugin();
|
||||
return;
|
||||
}
|
||||
/* if( m_plugin->vstVersion() < 2000 )
|
||||
@@ -224,6 +300,22 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
return;
|
||||
}*/
|
||||
m_plugin->showEditor();
|
||||
m_plugin->setBPM( songEditor::inst()->getBPM() );
|
||||
if( set_ch_name == TRUE )
|
||||
{
|
||||
getChannelTrack()->setName( m_plugin->name() );
|
||||
}
|
||||
if( m_plugin->pluginWidget() != NULL )
|
||||
{
|
||||
#ifdef QT4
|
||||
m_plugin->pluginWidget()->setWindowIcon(
|
||||
getChannelTrack()->windowIcon() );
|
||||
#else
|
||||
m_plugin->pluginWidget()->setWindowIcon(
|
||||
*( getChannelTrack()->windowIcon() ) );
|
||||
#endif
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
update();
|
||||
delete tf;
|
||||
}
|
||||
@@ -234,6 +326,7 @@ void vestigeInstrument::setParameter( const QString & _param,
|
||||
|
||||
void vestigeInstrument::play( void )
|
||||
{
|
||||
QMutexLocker ml( &m_pluginMutex );
|
||||
if( m_plugin == NULL )
|
||||
{
|
||||
return;
|
||||
@@ -256,11 +349,14 @@ void vestigeInstrument::play( void )
|
||||
|
||||
void vestigeInstrument::playNote( notePlayHandle * _n )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( _n->totalFramesPlayed() == 0 && m_plugin != NULL )
|
||||
{
|
||||
m_plugin->enqueueMidiEvent( midiEvent( NOTE_ON, 0, _n->key(),
|
||||
m_plugin->enqueueMidiEvent( midiEvent( NOTE_ON, 0,
|
||||
getChannelTrack()->masterKey( _n ),
|
||||
_n->getVolume() ), _n->framesAhead() );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -268,11 +364,14 @@ void vestigeInstrument::playNote( notePlayHandle * _n )
|
||||
|
||||
void vestigeInstrument::deleteNotePluginData( notePlayHandle * _n )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0, _n->key(),
|
||||
m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0,
|
||||
getChannelTrack()->masterKey( _n ),
|
||||
0 ), 0 );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
@@ -298,7 +397,7 @@ void vestigeInstrument::openPlugin( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
dir = QDir::home().path();
|
||||
dir = configManager::inst()->vstDir();
|
||||
}
|
||||
// change dir to position of previously opened file
|
||||
ofd.setDirectory( dir );
|
||||
@@ -337,6 +436,7 @@ void vestigeInstrument::openPlugin( void )
|
||||
|
||||
void vestigeInstrument::toggleGUI( void )
|
||||
{
|
||||
QMutexLocker ml( &m_pluginMutex );
|
||||
if( m_plugin == NULL )
|
||||
{
|
||||
return;
|
||||
@@ -359,6 +459,36 @@ void vestigeInstrument::toggleGUI( void )
|
||||
|
||||
|
||||
|
||||
void vestigeInstrument::noteOffAll( void )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
for( int key = 0; key < OCTAVES * NOTES_PER_OCTAVE; ++key )
|
||||
{
|
||||
m_plugin->enqueueMidiEvent( midiEvent( NOTE_OFF, 0,
|
||||
key, 0 ), 0 );
|
||||
}
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void vestigeInstrument::changeBPM( int _new_val )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_plugin->setBPM( _new_val );
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void vestigeInstrument::paintEvent( QPaintEvent * )
|
||||
{
|
||||
#ifdef QT4
|
||||
@@ -372,8 +502,9 @@ void vestigeInstrument::paintEvent( QPaintEvent * )
|
||||
|
||||
p.drawPixmap( 0, 0, *s_artwork );
|
||||
|
||||
QString plugin_name = ( m_plugin ) ?
|
||||
QString( m_plugin->name() )
|
||||
QString plugin_name = ( m_plugin != NULL ) ?
|
||||
m_plugin->name()/* + QString::number(
|
||||
m_plugin->version() )*/
|
||||
:
|
||||
tr( "No VST-plugin loaded" );
|
||||
QFont f = p.font();
|
||||
@@ -383,6 +514,7 @@ void vestigeInstrument::paintEvent( QPaintEvent * )
|
||||
|
||||
p.drawText( 20, 80, plugin_name );
|
||||
|
||||
// m_pluginMutex.lock();
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
p.setPen( QColor( 64, 128, 64 ) );
|
||||
@@ -391,6 +523,8 @@ void vestigeInstrument::paintEvent( QPaintEvent * )
|
||||
p.drawText( 20, 94, tr( "by" ) + " " +
|
||||
m_plugin->vendorString() );
|
||||
}
|
||||
// m_pluginMutex.unlock();
|
||||
|
||||
#ifndef QT4
|
||||
bitBlt( this, rect().topLeft(), &pm );
|
||||
#endif
|
||||
@@ -401,8 +535,10 @@ void vestigeInstrument::paintEvent( QPaintEvent * )
|
||||
|
||||
void vestigeInstrument::closePlugin( void )
|
||||
{
|
||||
m_pluginMutex.lock();
|
||||
delete m_plugin;
|
||||
m_plugin = NULL;
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* vestige.h - instrument VeSTige for hosting VST-plugins
|
||||
*
|
||||
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2006 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -31,16 +31,15 @@
|
||||
|
||||
#ifdef QT4
|
||||
|
||||
#include <QVector>
|
||||
#include <QMutex>
|
||||
|
||||
#else
|
||||
|
||||
#include <qvaluevector.h>
|
||||
#include <qmutex.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#include "fstclient.h"
|
||||
#include "spc_bg_hndl_widget.h"
|
||||
|
||||
|
||||
@@ -76,6 +75,8 @@ public:
|
||||
protected slots:
|
||||
void openPlugin( void );
|
||||
void toggleGUI( void );
|
||||
void noteOffAll( void );
|
||||
void changeBPM( int _new_val );
|
||||
|
||||
|
||||
protected:
|
||||
@@ -89,6 +90,7 @@ private:
|
||||
|
||||
|
||||
remoteVSTPlugin * m_plugin;
|
||||
QMutex m_pluginMutex;
|
||||
|
||||
|
||||
pixmapButton * m_openPluginButton;
|
||||
|
||||
BIN
resources/arp_free.png
Normal file
BIN
resources/arp_free.png
Normal file
Binary file not shown.
BIN
resources/arp_sort.png
Normal file
BIN
resources/arp_sort.png
Normal file
Binary file not shown.
BIN
resources/arp_sync.png
Normal file
BIN
resources/arp_sync.png
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
resources/combobox_arrow.png
Normal file
BIN
resources/combobox_arrow.png
Normal file
Binary file not shown.
BIN
resources/combobox_bg.png
Normal file
BIN
resources/combobox_bg.png
Normal file
Binary file not shown.
Binary file not shown.
BIN
resources/edit_arrow.png
Normal file
BIN
resources/edit_arrow.png
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
resources/edit_draw.png
Normal file
BIN
resources/edit_draw.png
Normal file
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user