Commit Graph

1373 Commits

Author SHA1 Message Date
Tobias Doerffel
9d811bf080 MidiAlsaSeq: improved MIDI event polling loop
Use poll() with a finite timeout so we can quit the thread properly
without manually writing stuff into the pipe.

Check for pending events at the beginning of the loop so we can't end up
in an endless loop.

Furthermore check return value of snd_seq_event_input() and get out of
loop if it indicates an error.
2009-08-14 15:12:56 +02:00
Tobias Doerffel
295b332650 MidiAlsaSeq: QString related fixups
Use QString::isEmpty() rather than comparing against an empty string.
Furthermore use QStrin::toUtf8() instead of QString::toAscii() for
retrieving name of a MidiPort.
2009-08-14 15:12:56 +02:00
Tobias Doerffel
55337ad2be Renamed MIDI and audio related classes/files to match new style
Renamed all MIDI and audio related classes/files to match new style.
Additionally various cleanups.
(cherry picked from commit b8ebfbd06a)
2009-08-13 01:46:49 +02:00
Andrew Kelley
fb733051bd added FLAC as an export format 2009-08-12 07:18:16 -07:00
Andrew Kelley
6cf2d83808 made CLI rendering smoother
Suppressed a message box that would pop up in command
line interface causing a crash and made lmms act properly
when a rendering plugin fails. Need to figure out how to
terminate program in project_renderer line 222.
2009-08-12 07:14:44 -07:00
Andrew Kelley
0ab12b4eb9 Merge branch 'master' of ssh://superjoe30@lmms.git.sourceforge.net/gitroot/lmms 2009-08-12 05:52:46 -07:00
Andrew Kelley
a55b134263 mp3 rendering: apply master gain to output
Apply master gain when rendering an mp3. Don't use hardcoded
number of channels.
Additionally replaced short int with Sint16 and printf with qWarning.
2009-08-12 05:44:20 -07:00
Andrew Kelley
1c118f1a46 sample_buffer: made MP3 decoder more robust
The mp3 decoder was using an uncomfortably large buffer,
laughably because of a negative overflow. Fixed this and
added a failsafe check to prevent buffer overflows.

Additionally changed printfs to qWarnings and fixed copyright
notice in audio_file_mp3.
2009-08-12 04:34:24 -07:00
Peter Nelson
1fe0c689b0 AudioJACK: removed incorret JACK transport code
The audio_jack driver currently treats the jack transport status as a
flag for whether or not to output audio. This is incorrect and
unintended usage of jack transport. The attached patch simply removes
all references to jack transport from the driver, so that LMMS will
always be able to produce audio.

Closes #2816029.
2009-08-12 11:47:35 +02:00
Tobias Doerffel
58023cf2cf MidiWinMM: added missing break directive after case-block
A break directive was missing in MidiWinMM::handleInputEvent(), leading
to inappropriate calls to qWarning() on pitch bend.
2009-08-10 13:51:09 +02:00
Paul Giblock
f1d60958f0 Rename all Controller-family classes to new style
Adjust capitialization on all Controller-related classes to new
standards and update all calling code
2009-08-08 13:05:22 -04:00
Paul Giblock
a9a3c796f7 Hotfix for resizable controller rack
Apparently I didn't compile the latest version of my changes and there
was a lurking error.  This has been fixed.
2009-08-08 12:04:15 -04:00
Paul Giblock
bb76ba5121 Make Controller-Rack resizable
Per request, make the Controller-rack vertically sizable.  This is also
part of our effort to slowly deprecate old fixed-positioning code in
favor of layouts.
2009-08-07 16:26:07 -04:00
Tobias Doerffel
d66c71ebf8 MainWindow: removed HQ mode button
Switching to HQ mode in standard workflow doesn't make much sense and
is likely to cause problems. Therefore remove the HQ mode button for
for time being. One can still export projects in high(er) quality.
2009-08-07 17:44:49 +02:00
Tobias Doerffel
94c5c5a46f MidiWinMM: use qWarning() rather than printf()
Using printf() is really old C-style, therefore changed all printf()s
to qWarning()s.
2009-08-06 13:16:22 +02:00
Tobias Doerffel
9cdb6cca3b SampleBuffer: display different message if file was not found
Instead of displaying a message about failed decoding of a file,
properly indicate the actual problem if the file itself does not exist.
2009-08-05 18:19:04 +02:00
Tobias Doerffel
4cdcd1a670 PianoRoll: removed duplicate function call in testPlayNote()
There's no need to send a MidiNotePanning event twice in
PianoRoll::testPlayNote(). Removed the duplicate function call.
2009-08-05 12:28:36 +02:00
Tobias Doerffel
0bb54199b0 Whole code base: various cleanups, removed SINGLE_SOURCE_COMPILE relicts
* cleaned up code and improved coding style
* removed old SINGLE_SOURCE_COMPILE macro relicts
* use QString::toUtf8() instead of QString::toAscii() wherever possible
2009-08-05 11:41:59 +02:00
Tobias Doerffel
afbaabed02 SampleBuffer: do not show messagebox if there's no GUI
Showing a messagebox if LMMS is running in console-mode only is bad and
makes it crash. Therefore check for engine::hasGUI() first.
2009-08-04 12:11:30 +02:00
Tobias Doerffel
bf8f823751 Mixer: fixed wrong macro logic leading to potential performance loss
The macro logic for defining the SPINLOCK_PAUSE macro tested against
LMMS_HOST_X86_64 twice instead of testing against LMMS_HOST_X86_64 and
LMMS_HOST_X86. This caused the SPINLOCK_PAUSE macro not being set on
x86.
2009-08-03 18:53:10 +02:00
Tobias Doerffel
60eba2e4c3 CpuX86: added support for memory prefetching
Added macros PREFETCH_READ() and PREFETCH_WRITE() which insert proper
prefetch instructions. At least on my Intel Atom CPU this improves
performany slightly. Probably needs some further tuning.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-08-03 17:14:58 +02:00
Tobias Doerffel
89fa5c99e9 CPU: new framework for optimized CPU-specific routines
The new CPU framework replaces the old BasicOps framework. It is more
flexible and the build process isn't such a mess anymore (pre-compiled
assembler files etc.). It will hopefully see some improvements and
extensions soon.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-08-03 17:14:16 +02:00
Tobias Doerffel
ab0160f9fc LameLibrary: fixed copyright notice
Removed myself from list of copyright holders as I didn't help out
with LAME support at all.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-28 23:18:20 +02:00
Tobias Doerffel
e115124075 WebResourcesProvider: support for HTTP forwardings + cleanups
Properly handle HTTP status code 302 which indicates a moved site,
i.e. try to fetch data from the new location. This finally makes
WebResources work again with LSP being moved to http://lmms.info.

Furthermore cleaned up code a bit. There's no need for a global
QHttp object or a global QBuffer object. Instead allocate them on
the stack in the according methods.

Furthermore removed unused/incomplete support for non-blocking download.
We should introduce support for a ProgressDialog solution (also allowing
to cancel operations) later.

Signed-off-by: Tobias Doerffel <tobias.doerffel@gmail.com>
2009-07-17 11:49:51 +02:00
Andrew Kelley
d85d8b73d0 ConfigManager - add #ifdef LMMS_HAVE_FLUIDSYNTH
Fixed compliation bug for those who don't have
fluidsynth installed
2009-07-16 11:21:00 -07:00
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