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>
Added a PianoView widget to ResourceBrowser so one can easily preview selected
preset, sample etc.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Use a vertical box layout for PianoView and and track resize events
in order to keep scrollbar range up to date. This way PianoView's size
is not fixed anymore and the PianoView widget can be placed inside
other layouts without any restrictions.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
So far only local samples and soundfonts could be previewed using
ResourcePreviewer class. By adding an additional abstraction through
ResourceFileMapper also non-local resources can be previewed.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added ResourceFileMapper which is an inline class allowing to access
all kind of ResourceItems locally by creating a QTemporaryFile object
and fetch data where neccessary (i.e. ResourceItem::isLocalResource()
returns false).
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Implemented previewing of samples and soundfonts. This requires further
work as the current implementation only works for local resources.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Use our ResourcePreviewer object to actually playback preview sounds
while holding down mouse button.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Make the internal InstrumentTrack play the default key in preview()
and stop playback in new method stopPreview().
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
The URL where to fetch actual resources still is /WebResources/...
instead of /WebResource/...
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added new method silenceAllNotes() which is a replacement for
invalidateAllMyNPH() and also resets m_runningMidiNotes array.
silenceAllNotes() is now used in destructor as well.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Minor optimization: do not query full name of ResourceItem when only
computing suffix via QFileInfo in ResourceItem::guessType().
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added initial version of ResourcePreviewer, a replacement for the old
PresetPreviewPlayHandle technology. It can take any ResourceItem and
preview it depending on its type.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
For a long time presetPreviewPlayHandle has been a friend class of
InstrumentTrack as it had to modify MidiPort settings. However the
InstrumentTrack's MidiPort is now accessible via getMidiPort() so
there's no need for keeping presetPreviewPlayHandle a friend class
anymore.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
The old constructor treated the string argument either as filename or
as raw XML data, depending on 2nd parameter. This is a mess and quickly
leads to confusion.
Now we have two constructors taking either a filename as string or a
QByteArray with XML data. Loading actual data has been separated into
MultimediaProject::loadData( const QByteArray & ).
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Commit ea2b165cbd was incomplete.
Fixed some #include statements. All compile errors should be gone now.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Naming classes like ResourcesItem or ResourcesDatabase is bad style,
therefore rename all classes and files to be Resource*.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Filter line-edit is now placed above actual tree view and has been
decorated with a small icon as well as a status label, displaying the
number of filtered and total number of items.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Make a direct signal-slot-connection between
ResourcesDatebase::itemsChanged() of merged databases and
UnifiedResourcesProvider::remergeItems() for instantly updating items
in unified database.
Also call remergeItems() before emitting global itemsChanged() signal.
Furthermore instantly call remergeItems() after adding a new database.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added addContentLayout(QLayout *) method to SideBarWidget in order to
allow subclasses to add whole layouts as well.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Implemented context menu for ResourcesBrowser with various actions
inside depending on selected item.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Encapsulate conversion from a QModelIndex to a ResourcesTreeItem
or a ResourcesItem into static methods.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added isLocalResource() method which returns whether it belongs to a
local ResourcesProvider or not.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added isLocal() method for returning whether according provider class
provides local resources or not (will allow a download option for
non-local resources later).
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Added a new class ResourcesBrowser which represents a complete view
for browsing all available resources. It only allows filtering at the
moment but more features will follow soon.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Proteus VX requires SplittedThreading model in order to run properly.
Issues with actually working UI interaction still need to be worked
out although it rather looks like a bug in WINE.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Automatically select either controller or key group box in
MidiControlListener new action dialog if the user changes something
inside the group.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>