Commit Graph

2120 Commits

Author SHA1 Message Date
Tobias Doerffel
0d6ba6291b NotePlayHandle: fixed crash at playback of subnotes
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>
2009-06-18 23:05:03 +02:00
Tobias Doerffel
cf0a91637b Song: reset window title after creating new project from template
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>
2009-06-18 22:24:25 +02:00
Tobias Doerffel
fe152801f6 ResourcePreviewer: no preview for unhandled resource types
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>
2009-06-17 10:37:09 +02:00
Tobias Doerffel
5930b23040 ResourceBrowser: trigger default action on double click
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>
2009-06-17 10:27:37 +02:00
Janne Matti Sinisalo
27a125b73e New CPU load meter thing.
I think the CPU load meter thing looks better this way.
2009-06-16 17:39:37 +03:00
Tobias Doerffel
2cc49b8010 PlayHandle: use QList instead of QVector for PlayHandle array
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>
2009-06-15 15:04:55 +02:00
Tobias Doerffel
08ea133aa2 NotePlayHandle: cleanups, header dependency reductions etc.
* 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>
2009-06-15 14:41:55 +02:00
Tobias Doerffel
8fb10e3d4d ResourceBrowser: implemented loading projects via context menu
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>
2009-06-15 14:02:47 +02:00
Tobias Doerffel
c0794d0c41 MMP: detect compressed files rather than guessing by extension
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>
2009-06-15 13:58:40 +02:00
Tobias Doerffel
9804cb7db8 ResourcePreviewer: save and restore default settings of InstrumentTrack
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>
2009-06-11 15:17:25 +02:00
Tobias Doerffel
22716bccf1 ResourceBrowser: added a PianoView widget
Added a PianoView widget to ResourceBrowser so one can easily preview selected
preset, sample etc.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-11 15:15:43 +02:00
Tobias Doerffel
d866015dc9 PianoView: use layout for flexible widget size
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>
2009-06-11 14:39:25 +02:00
Tobias Doerffel
01a83deee7 InstrumentTrack: renamed getPiano() to pianoModel()
Renamed getPiano() to pianoModel() to better express what this
function does.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-11 13:58:45 +02:00
Tobias Doerffel
e76991ffea ResourcePreviewer: use ResourceFileMapper for previewing samples
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>
2009-06-11 12:20:44 +02:00
Tobias Doerffel
b8abfd24b6 ResourceFileMapper: new class for local access to resources
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>
2009-06-11 12:20:25 +02:00
Tobias Doerffel
599e920c3f ResourcePreviewer: support for previewing samples and soundfonts
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>
2009-06-11 00:50:07 +02:00
Tobias Doerffel
7d0facf78d ResourceBrowser: preview resource while holding down mouse button
Use our ResourcePreviewer object to actually playback preview sounds
while holding down mouse button.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-11 00:32:58 +02:00
Tobias Doerffel
d11bf48891 ResourcePreviewer: start/stop playback of preview sound
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>
2009-06-11 00:30:39 +02:00
Tobias Doerffel
fd417de7fd WebResourceProvider: fixed typo in fetchData(...)
The URL where to fetch actual resources still is /WebResources/...
instead of /WebResource/...

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-11 00:24:55 +02:00
Tobias Doerffel
3c9859da9f InstrumentTrack: new method silenceAllNotes()
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>
2009-06-10 23:49:06 +02:00
Tobias Doerffel
0861dd7e88 ResourcePreviewer: implemented destructor
No destructor has been implemented so far. Added one which deletes
preview track.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-10 23:49:06 +02:00
Tobias Doerffel
a1c4992a89 ResourcePreviewer: disable journalling when previewing
Globally disable journalling when previewing a ResourceItem (i.e. load
a preset, sample etc.).

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-10 23:49:06 +02:00
Tobias Doerffel
6fabe26620 ResourceItem: added TypePluginSpecificPreset
Added another type TypePluginSpecificPreset in Types enumeration. This
allows handling for example XIZ files (ZynAddSubFX presets) properly.
2009-06-07 16:28:54 +02:00
Tobias Doerffel
46bd9f51cf ResourceBrowser: initially update filter status label
Initially update filter status label for not showing a blank label
after startup.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-05 01:35:59 +02:00
Tobias Doerffel
0e31b47d3e ResourceItem: do not query full name when computing suffix
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>
2009-06-05 01:29:49 +02:00
Tobias Doerffel
264b50fcc6 ResourcePreviewer: initial version
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>
2009-06-05 01:15:11 +02:00
Tobias Doerffel
a6090ebe23 InstrumentTrack: presetPreviewPlayHandle no longer a friend class
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>
2009-06-05 01:09:07 +02:00
Tobias Doerffel
5a00ebd360 MultimediaProject: splitted constructor for loading either file or data
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>
2009-06-05 00:55:25 +02:00
Tobias Doerffel
eb77b99220 Completed commit ea2b165cbd
Commit ea2b165cbd was incomplete.
Fixed some #include statements. All compile errors should be gone now.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-04 23:41:09 +02:00
Tobias Doerffel
ea2b165cbd Renamed Resources* classes to Resource* and renamed files
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>
2009-06-04 22:53:05 +02:00
Tobias Doerffel
14fef9152c ResourcesBrowser: improved item filtering
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>
2009-06-04 11:58:48 +02:00
Tobias Doerffel
1ee8d38ca7 UnifiedResourcesProvider: fixed calls to remergeItems()
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>
2009-06-04 11:57:47 +02:00
Tobias Doerffel
74a4635ed3 SideBarWidget: new addContentLayout() method
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>
2009-06-04 11:50:08 +02:00
Tobias Doerffel
359b73c2a3 ResourcesBrowser: implemented item-sensitive context menu
Implemented context menu for ResourcesBrowser with various actions
inside depending on selected item.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-04 00:29:56 +02:00
Tobias Doerffel
c5bf76b98c ResourcesTreeModel: encapsulate conversion from index to items
Encapsulate conversion from a QModelIndex to a ResourcesTreeItem
or a ResourcesItem into static methods.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-03 15:32:45 +02:00
Tobias Doerffel
39b489d522 ResourcesItem: added isLocalResource() method
Added isLocalResource() method which returns whether it belongs to a
local ResourcesProvider or not.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-03 15:01:59 +02:00
Tobias Doerffel
3eb96c418e ResourcesProvider: added isLocal() method
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>
2009-06-03 15:00:26 +02:00
Tobias Doerffel
d2831399bd MainWindow: add a ResourcesBrowser to sidebar
Instantiate a ResourcesBrowser and add it to sidebar so it's easy
accessible.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-03 14:36:55 +02:00
Tobias Doerffel
f6fe2a16ad ResourcesBrowser: new class providing a view for browsing resources
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>
2009-06-03 14:36:28 +02:00
Tobias Doerffel
b3c5d498e2 RemoteVstPlugin: use SplittedThreading model for Proteus VX
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>
2009-06-02 00:45:04 +02:00
Achim Settelmeier
7e3931e384 Automatically select config box upon change
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>
2009-06-01 22:12:05 +02:00
Achim Settelmeier
00400dbfc0 Fixed compiler warning
Tobydox' enum change (7a65687746) introduced a compiler warning about
unhandled switch() case. Fixed now.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-01 22:12:05 +02:00
Achim Settelmeier
288756e30f Help text for MidiControlListener setup dialog
Added a "(?)" button and help text to the Midi Control Listener
setup dialog.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-01 22:12:05 +02:00
Tobias Doerffel
07267abca0 MidiControlListener: use QString::isEmpty() for testing string
Instead of doing a whole string comparison against "", use
QString::isEmpty() which is both faster and better style.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-01 11:12:26 +02:00
Tobias Doerffel
7a65687746 MidiControlListener: replaced static numActions by enum constant
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>
2009-06-01 11:12:17 +02:00
Achim Settelmeier
21c669e6b3 MCL setup: fine-tune layout of setup dialog
Sizing of the columns in the action table corrected in the
setup dialog for MidiControlListener.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-01 10:51:56 +02:00
Achim Settelmeier
599ae94bd3 Set up some nice default values for MidiControlListener.
This adds some nearly-standard keys and controllers to give new users
a hint how the MIDI remote control works.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-01 10:51:21 +02:00
Achim Settelmeier
e2b85f963f MidiControlListener can jump to begin/end of loop
Implements the MCL actions JumpToLoopStart and JumpToLoopEnd which
update the position in the via the timeLine object.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-06-01 10:51:21 +02:00
Achim Settelmeier
86b0056488 En-/disable loop points via MidiControlListener
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>
2009-06-01 10:51:21 +02:00
Tobias Doerffel
dc539d88de ZynAddSubFX: fixed compilation failure of FLTK if glibc >= 2.10
Fixed compilation failure of FLTK on systems with glibc newer than
version 2.9 where the signature of scandir(...) has changed.

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