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>
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>
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>
Always return name extension in lower case so we can easily match it
somewhere else or use it as key for hash tables.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
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>
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>
Adapted VeSTige plugin to new resource framework support in plugin
base class.
Furthermore some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Adapted Sf2Player plugin to new resource framework support in plugin
base class.
Furthermore some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Adapted MidiImport plugin to new resource framework support in plugin
base class. Files for PatMan or soundfonts for Sf2Player are now
relocated using resources framework.
Furthermore some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
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>
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>
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>
Adapted PatMan to new resource framework support in plugin
base class.
Furthermore some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
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>
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>
Replaced deprecated (duplicate) code for loading various kind of files
with ResourceAction-based code.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
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>
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>
Added new method ResourceItem::nameExtension() which returns the
extension of the name of an item (e.g. a filename extension such as
"wav" or similiar).
Added new type ResourceItemList, a QList of ResourceItem pointers.
Furthermore some coding style improvements.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
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>
Do not build the ZynAddSubFX plugin on OS X until a proper replacement
for unnamed semaphores (which for whatever reason are not supported on
OS X) has been implemented. Using the win32 code (QSystemSemaphore)
could be an option but needs testing.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
There were various (trivial) problems with settings of the build system
which prevented LMMS from being built on OS X.
Thanks to Daniel Klaffenbach for providing his Mac for development
purposes.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
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>
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>
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>
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>
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>
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>
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>
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>
Call QFile::flush() after writing the data that was fetched from the
item. This fixes files being empty in some situations.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
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>
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>
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>
Load non-local projects as templates so user has to save it under
a new name. Otherwise it would save to /tmp/qt_temp.XXXXX.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
We must not keep the iterator at the same position when erasing notes
from the m_notes array. This usually is not a problem when using QVector
but we might switch to QList somewhen later.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Commit 08ea133aa2 uncovered a flaw in
NotePlayHandle::play(...). When iterating over subnotes for each subnote
after playing it, we check whether it is finished. If this is true, the
according subnote gets erased from the m_subNotes array. However we have
to set the subnote iterator to what QList::erase(...) returns instead of
keeping it where it was before. This accidentally worked when using
QVector as type for NotePlayHandle arrays but caused a crash now that
we're using QList.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Reset window title when creating new project from template (after
actually loading template file). Furthermore do not reset window title
at the beginning of load process anymore.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Don't do anything in case a ResourceItem can't be previewed. Up to now
a default sine sound was played back even when just clicking a directory item.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Connect to QTreeView::doubleClicked() signal in order to trigger a
default action. For example projects now can be loaded via simple
double click.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Use QList instead of QVector when using a set of PlayHandle's. QList
has faster insert/remove operations and in most cases we iterate through
the array using iterators so there's no performance drop.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
* do not include instrument_track.h in note_play_handle.h by making
two functions non-inline
* renamed notePlayHandleVector / constNotePlayHandleVector to
NotePlayHandleList / ConstNotePlayHandleList and changed typedef
to QList (which has faster insert- and remove-operations).
* removed unused method willFinishThisPeriod()
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Project files can now be loaded via context menu. This also allows
transparent access to files uploaded to LSP.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Detect whether a given file is compressed by first trying to parse
its content as XML data. If it failed, try to uncompress and
parse again. This is more flexible than just looking whether the
filename extension is "mmpz".
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
After instantiation of InstrumentTrack save its settings so we can
restore it each time before previewing resources. Otherwise preview
of incomplete presets or just samples could be distorted by settings
of previosly loaded preset.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>