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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
It's not a good idea to have a separate constant determining the number
of items in an enumeration because you can easily get inconsistencies.
Use the last element of enumeration as NumActions constant instead.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
MidiControlListener's toggleLoop action makes the song object emit a
loopPointsChanged signal, which timeLine connects to and enables or
disables the loop points accordingly.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
LMMS didn't compile successfully if individual paths to headers of
each Qt module were not added to the list of include directories to be
searched by the pre-processor. However it has to work this way,
therefore I changed lines like
#include <QGraphicsScene>
to
#include <QtGui/QGraphicsScene>
Please care in the future!
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
The MIDI device(s) where the MidiControlListener can receive events from
can now be configured in the setup dialog.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Moved the code to unsubscribe all readable and/or writeable ports to own
methods and thus made them publically available to avoid duplicate code.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Changed MidiControlListener to use the built-in API to save and restore
the midiPort configuration instead and removed the old iterator.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Introduces a new class, DummyMidiEventProcessor, that does nothing but
update the baseNoteModel upon keypress.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
Adds GUI elements to the global setup dialog to configure remote
controlling of LMMS via MIDI. The GUI is not yet fully functional,
though.
Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>