Commit Graph

1348 Commits

Author SHA1 Message Date
Andrew Kelley
2b660e3756 automationPattern - deleted glitchy code
<superjoe> why is that code even there?
<pgib> until the next mixer-period, then the model's value is reset
to the actual automation track
<pgib> I have no idea. I think it should be removed honestly. again,
there is no comment explainign the true intent
* superjoe experiments
<pgib> it was probably a poor attempt to make it so when you adjust
the only automation point for a track, that the value of the model
will change immediately'
<pgib> I think it is safe to move the newTime==0 chunk
<pgib> if we want to make the automationEditor immediately change the
value, there needs to be more logic
<pgib> and it would belong in automationEditor -- not automationPattern

<pgib> but this fixes the superAutomation why-in-the-hell bug
2009-07-16 10:07:56 -07:00
Andrew Kelley
e0e93a9730 Resource Browser - smoother gui
When you press down or up while browsing in the resource browser,
it plays the sample.
FIXED: When you click on the keyboard in the resource browser, and then
click on the treeview, it didn't transfer focus.
2009-07-16 08:14:17 -07:00
Andrew Kelley
73fdfb4ef1 exportPorjectDialog - default output file format
exportProjectDialog - select the output file format based on
what the user has already chosen in the export dialog. Prevents
the user from having to choose twice.
(also fixed whitespace and added modelines where applicable)
2009-07-16 05:19:26 -07:00
Andrew Kelley
9cb6c6ab6a mainWindow - remove extra song editor
Use a branch to work on the new song editor, not an extraneous
window in master. Also fixed spaces.
2009-07-16 04:42:21 -07:00
Andrew Kelley
2aae228af4 Refactor supportedFileExts from AudioFileProcessor
Refactor supported file extensions from AudioFileProcessor to
sampleBuffer, where the magic really happens. Change the hard-
coded MessageBox explaining supported formats to the real deal.
Also added modelines and switched spaces to tabs in the files
affected.
2009-07-16 04:34:11 -07:00
Andrew Kelley
c7205351c2 convert soft tabs to hard tabs and add a modeline 2009-07-16 03:30:31 -07:00
Andrew Kelley
a9a8e1c3a5 sampleBuffer::decodeSampleMp3 implemented
AudioFileProcessor can now open MP3 samples.
2009-07-15 14:43:56 -07:00
Andrew Kelley
0e2c6762f0 AudioFileMp3 - fixed clipping issue
AudioFileMp3::rescale was missing a clip boundary on -1 and thus
could have caused artifacts in exported MP3s. Fixed.
2009-07-15 11:42:26 -07:00
Andrew Kelley
2741eb217a LameLibrary - separated lame functionality
LameLibrary can now be easily used to access lame functionality.
This way we can use the same lame structure for SampleBuffer
2009-07-15 10:20:38 -07:00
Andrew Kelley
1eb7490185 AudioFileMp3 - handle clipping better
Fixed bug - when a sample clipped it was causing an overflow, making
random noise where clipping happened. Now it clips properly.
2009-07-15 08:53:10 -07:00
Andrew Kelley
0390d4aadb SampleBuffer - message box upon decode sample fail
When SampleBuffer can't decode an audio sample, it explains why
in a friendly message box, instead of silently failing.
2009-07-15 08:20:06 -07:00
Andrew Kelley
60a0bf9346 AudioFileMp3 - Use a configurable setting for lame
There is a new folder setting called Lame Library. AudioFileMp3
will look here for libmp3lame.so.0. If it can't find it it will
notify the user how to make it work and abort rendering gracefully.
2009-07-15 07:00:52 -07:00
Andrew Kelley
b99d79b4d2 Minor syntax cleanup for readability 2009-07-15 05:12:45 -07:00
Andrew Kelley
e53ea570b0 AudioFileMp3: provide support for mp3 export
Add MP3 as one of the options to export the project as. Currently
the lib path is hard-coded, need to add that to settings. It loads
lame dynamically.
2009-07-15 04:56:41 -07:00
Tobias Doerffel
a626763671 MainWindow: explicitely destroy ResourceBrowser instance
Explicitely destroy instance of ResourceBrowser in destructor of
MainWindow. This fixes crash at exit due to auto-deletion mechanisms
after the whole engine already has been shutdown.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-10 18:09:42 +02:00
Tobias Doerffel
cb72bf2260 MidiTime/Pattern: fixed divisions by zero with time sigs 1/16+
Setting time signatures 1/16+ lead to divisions by zero in two places.
Fixed this by adding according qMax() call (closes #2818125).

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-10 17:47:37 +02:00
Tobias Doerffel
4f249400ac MidiPort: added realOutputChannel() returning zero-based MIDI channel
MidiPort::outputChannelModel is ranged from 1 to 16 for displaying
user-friendly values. However internally MIDI channels are ranged from
0 to 15. Therefore added realOutputChannel() which returns zero-based
MIDI channel which should be used everywhere except for the GUI.

Fixes MIDI events being sent to VST plugins on channel 2 instead of
channel 1. Makes some more VST plugins actually usable.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-09 12:10:33 +02:00
Tobias Doerffel
1015868e1f TrackContentWidget: fix graphical glitches with Qt 4.5
Starting with Qt 4.5 there were minor graphical glitches in
TrackContentWidget. Fix this by not setting Qt::WA_OpaquePaintEvent
attribute.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-07 21:16:41 +02:00
Tobias Doerffel
cf7539caaf PianoRoll: switch back to draw note after pasting notes
When pasing notes via Ctrl+V somehow the edit-tool was left in an
undefined state. Therefore explicitely switch back to draw mode so
user can move pasted notes (closes #2808607).

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-07 10:43:09 +02:00
Tobias Doerffel
2ef5dffec0 RemotePlugin: refactored system feature configuration
Variuos features (native/Qt semaphores/shared memory) are now
configured by macros like USE_QT_SHMEM and USE_QT_SEMAPHORES. This
allows central and individual configuration of features according to
the platform to build for at the beginning of the file.

Finally makes RemotePlugin work on OS X by not using native semaphores
rather than QSystemSemaphore's.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-07 01:46:14 +02:00
Tobias Doerffel
fb58dc00ab InstrumentTrack: fixed muting of frozen patterns in BB tracks
In InstrumentTrack::play(...) the local variable "bb_track" always
was either undefined or NULL due to a lost call (probably during M/V
architecture switch) to bbTrack::findBBTrack(...). This could lead to
crashes and/or misbehaviour when playing frozen patterns in BB tracks.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-07 01:42:22 +02:00
Tobias Doerffel
33ce491caf RemotePlugin: added DEBUG_REMOTE_PLUGIN macro
Added new DEBUG_REMOTE_PLUGIN macro. If it is set, the process won't
be launched. Instead important information are printed allowing the
developer to run the process with according parameters in a debugger.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-07 01:01:00 +02:00
Tobias Doerffel
6a4297215d InstrumentTrack: fix crash in destructor with IPH-based instruments
Commit e3fa8762ef introduced a crash
in destructor of InstrumentTrack when using IPH based instruments.
Therefore explicitely remove all play handles after calling
silenceAllNotes().

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-05 16:53:50 +02:00
Tobias Doerffel
e3fa8762ef Mixer: selectively remove PlayHandles in removePlayHandles()
This commit allows finer control of which kind of PlayHandles get
removed in Mixer::removePlayHandles().

This is now used by InstrumentTrack which only removes NotePlayHandles
in InstrumentTrack::silenceAllNotes(). Fixes broken preview of resources
loaded by IPH-based instruments.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-05 16:38:58 +02:00
Tobias Doerffel
f4e94d4584 ResourceDB: added missing type name for PluginSpecificResource type
A type name for ResourceItem::PluginSpecificResource was missing in the
s_typeNames map. Therefore the type property of such resources was not
saved properly and had to be guessed each time at startup.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-05 16:33:43 +02:00
Tobias Doerffel
372ff79f96 Dropped ResourceItem type "TypeSoundFont"
Dropped separate ResourceItem type "TypeSoundFont" as theres no benefit
from distinguishing it from other plugin-specific files. Soundfonts now
are treated as TypePluginSpecificResource.

Furthermore some minor coding style cleanups.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-05 16:05:38 +02:00
Tobias Doerffel
bb933e7643 ResourceTreeModel: dynamic icons for plugin specific resources + caching
Added dynamic generation of icons for plugin specific resources by
drawing the logo of the according plugin onto an empty-sheet-icon.
After generation, cache the result so this expensive operation only
has to be done once.

Furthermore also cache pixmaps for individual ResourceItem types for
not having to load and scale pixmaps for each item.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-05 15:58:29 +02:00
Tobias Doerffel
f943df139e InstrumentView: added generic DnD support, renamed/splitted files
Added generic drag'n'drop support for all instrument views. All
resources supported by the according instrument now can be dropped
onto instrument view without any extra code in actual instrument.

Additionally renamed some files and classes related to InstrumentView
class to match new style.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-30 01:19:48 +02:00
Tobias Doerffel
65668f9489 ResourceBrowser: added management-buttons
Added two new buttons "Manage locations" and "Show piano". The first
one will open a resource location management dialog while the latter
one toggles visibility of the preview piano below.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-30 00:25:50 +02:00
Tobias Doerffel
ac4ef21ab7 ConfigManager/SetupDialog: preparations for resource framework migration
Some initial work on saving hash of default soundfont rather than a
filename. Doesn't work yet but will be improved with rewritten setup
dialog.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-29 23:24:10 +02:00
Tobias Doerffel
40e6d26dbb Handle plugin-specific resources in TrackContainerView/ResourcePreviewer
Up to now plugin-specific resources (e.g. ZynAddSubFX presets) were
not previewed or loaded into a track container. This now works by
adding TypePluginSpecificResource to the according switch-block.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-29 14:43:33 +02:00
Tobias Doerffel
77a7db5d2e ResourceItem: dynamically register plugin-processed file types
Dynamically extend the map of file types by plugin-processed file types.
Furthermore renamed type TypePluginSpecificPreset to
TypePluginSpecificResource.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-29 14:43:08 +02:00
Tobias Doerffel
81721b6524 PresetPreviewPlayHandle: removed
Removed unused class PresetPreviewPlayHandle with all its sub- and
helper-classes. Lots of dirty code this way gets cleaned up/removed.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-29 13:16:11 +02:00
Tobias Doerffel
3c5c5f9cb3 FileBrowser: remove from LMMS
Remove deprecated FileBrowser from LMMS as everything is now managed by
ResourceBrowser. This will allow further removal of deprecated
technologies.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-29 12:58:10 +02:00
Tobias Doerffel
a4a6c14af0 Make use of new ResourceAction class
Replaced deprecated (duplicate) code for loading various kind of files
with ResourceAction-based code.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-29 12:53:33 +02:00
Tobias Doerffel
7821dd210e ResourceAction: new class for centralized functionality
Added new class ResourceAction which centralizes functionality of all
actions related to ResourceItems. This includes loading projects,
samples, presets, plugin-specific presets etc.

Using this new class we can avoid duplicate functionality in
ResourcePreviewer, ResourceBrowser, TrackContainerView, InstrumentTrack
etc.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-29 12:48:45 +02:00
Tobias Doerffel
d3cf731dc9 Plugin: initial integration of resource framework
Replaced deprecated Plugin::loadFile(QString) method by
Plugin::loadResource(ResourceItem), a future interface to be adapted
by invididual plugins.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-29 12:41:53 +02:00
Tobias Doerffel
fb5c974365 ResourceDB: new method matchItems(), renamed ItemList to ItemHashMap
Added new method ResourceDB::matchItems() which returns a list of item
which somehow match the given list of keywords.

Furthermore renamed ItemList to ItemHashMap to better reflect actual
container type.

Additionally some coding style improvements.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-29 12:38:19 +02:00
Tobias Doerffel
891b46fd65 ResourceItem: added copy constructor
Added copy constructor for ResourceItem class so one can easily
duplicate a ResourceItem.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-23 16:38:04 +02:00
Tobias Doerffel
1f9a7a1c0e TrackContainerView: added support for dropping ResourceItems
Added support for dropping ResourceItems on a TrackContainerView. Now
it's possible to drag samples, presets and soundfonts from the new
ResourceBrowser into Song Editor or BB Editor (code needs to be ported
to new Song Editor later).

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-23 01:02:01 +02:00
Tobias Doerffel
30543d708c ResourceDB: added itemByHash() method
Added itemByHash() method to ResourceDB class allowing safe access to
an item identified with an according hash. If there's no item associated
with the hash, NULL is being returned.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-23 01:00:33 +02:00
Tobias Doerffel
75a45cca5f ResourceBrowser: stop preview when drag operation starts
Make sure preview is stopped as soon as a drag operation starts. This
is done by overloading QAbstractItemView::startDrag() and emit a signal
from there which is connected to an according slot in ResourceBrowser.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-23 00:13:40 +02:00
Tobias Doerffel
65b044c5c1 ResourceTreeView: enable dragging items
Actually enable dragging items. No further code is required here because
everything else is handled by the model and QTreeView base class.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-22 23:49:14 +02:00
Tobias Doerffel
dc90c899aa ResourcesTreeModel: support for dragging ResourceItems
Added initial support for dragging ResourceItems. This is achieved by
using drag'n'drop support offered by Qt's model/view technology.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-22 23:45:26 +02:00
Tobias Doerffel
0c73c5bb17 StringPairDrag: added static createMimeData() method
Added createMimeData() method to StringPairDrag which creates a proper
QMimeData object for StringPairDrag. External code can use it to create
a QMimeData object which can be received by users of StringPairDrag.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-22 23:42:15 +02:00
Tobias Doerffel
ddf3d3dc66 AutomationEditor: set pen for painter outside inner loop
Set pen for drawing automation pattern outside of inner loop. This
might save some CPU cycles.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-22 22:07:51 +02:00
Tobias Doerffel
0ae508d65f ResourceItem: removed support for deprecated filename extension
Do not support deprecated extension ".cs.xml" anymore. This way we do
not have to use QFileInfo::completeSuffix() which lead to unrecognized
file types if the filename contained dots in its regular name.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-22 11:49:19 +02:00
Tobias Doerffel
4bc010cea9 ResourceItem: added property "author"
Added new property "author" for retaining authorship information of
files. Furthermore this allows filtering for authors in ResourceBrowser.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-19 10:12:33 +02:00
Tobias Doerffel
9ca93040de PianoRoll: fixed crash with detune tool
When clicking at an invalid position with the detune tool, LMMS could
crash as an invalid iterator was referenced (closes #2808589).

Furthermore renamed PianoRoll::ModeOpen to PianoRoll::ModeEditDetuning.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-18 23:28:30 +02:00
Tobias Doerffel
e12476f79c Renamed type noteVector to NoteVector
Renamed type noteVector to NoteVector as well as ::iterator to
::Iterator and ::const_iterator to ::ConstIterator.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-18 23:24:56 +02:00