Compare commits

...

36 Commits

Author SHA1 Message Date
Tobias Doerffel
f049e70334 preparations for 0.1.2 release
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@43 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-22 13:08:04 +00:00
Tobias Doerffel
181f9b56f6 small bug-fixes
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@42 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-22 12:57:51 +00:00
Tobias Doerffel
f543cd8f4e update of libtool-related files and other small improvements (see ChangeLog)
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@41 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-21 17:15:35 +00:00
Tobias Doerffel
ffb654bc05 drag'n'drop for knobs
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@40 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-20 11:14:59 +00:00
Tobias Doerffel
156ad36850 load and save/load sample-data which doesn't come from sample in/from XML-node (base64-encoded)
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@39 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-19 13:01:36 +00:00
Tobias Doerffel
5e6a719b7c drag'n'drop-support everywhere
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@38 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-19 12:17:23 +00:00
Tobias Doerffel
f700c16c33 fixed critical bug in ALSA-driver
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@37 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-16 13:00:00 +00:00
Tobias Doerffel
bcef7b0b82 added missing pixmaps
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@36 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-15 10:06:48 +00:00
Tobias Doerffel
e1f5d4e13b bugfixes, GUI-improvements
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@35 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-15 10:04:24 +00:00
Tobias Doerffel
0e7cb9a0c8 small fixes for Qt4
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@34 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-14 16:51:07 +00:00
Tobias Doerffel
6ca71a2637 made LMMS working with Qt4 again
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@33 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-14 10:19:04 +00:00
Tobias Doerffel
746ec155a5 GUI-improvements
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@32 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-12 14:29:43 +00:00
Tobias Doerffel
d5a5f3abca bug fixes, GUI-improvements and more
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@31 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-12 14:25:32 +00:00
Tobias Doerffel
f67bf64acb some improvements on MIDI-tab-widget
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@30 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-09 08:36:24 +00:00
Tobias Doerffel
457c39ccdf added support for easy MIDI-port-subscription inside LMMS
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@29 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-08 10:31:29 +00:00
Tobias Doerffel
9c899fe33f MIDI-system-bugfixes/enhancements + small GUI improvements
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@28 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-07 13:04:34 +00:00
Tobias Doerffel
31b480b60f fixed bug in configure.in
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@27 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-05 12:48:20 +00:00
Tobias Doerffel
614b106752 heavy improvements on mixer-system and GUI
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@26 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-12-05 12:26:16 +00:00
Tobias Doerffel
ab719618f7 new audio-mixing system and new VST-support-framework
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@25 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-11-30 10:19:11 +00:00
Tobias Doerffel
7587d7c1f6 bugfixes in ALSA-sequencer-client
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@24 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-11-08 13:58:38 +00:00
Tobias Doerffel
22de18909a added ALSA-sequencer support
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@23 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-11-07 13:44:52 +00:00
Tobias Doerffel
4952f23917 made LMMS capable of managing its windows like GIMP (no MDI) and fixed some small bugs
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@22 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-10-28 15:58:35 +00:00
Tobias Doerffel
da6b2e1904 Small fixes for making current CVS-version compilable
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@21 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-10-26 11:06:36 +00:00
Tobias Doerffel
40d8b3c4f6 completely new MIDI-subsystem and other bugfixes, see ChangeLog for details
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@20 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-10-24 09:13:39 +00:00
Tobias Doerffel
d959938370 added missing pixmaps
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@19 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-10-20 13:33:37 +00:00
Tobias Doerffel
f55c124be6 fundamental changes in plugin-architecture, added plugin-browser, bug-fixes - see ChangeLog for further details
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@18 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-10-20 13:02:26 +00:00
Tobias Doerffel
58fe360793 added LADSPA-support and some fixed lockup-bugs
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@17 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-10-14 11:37:16 +00:00
Tobias Doerffel
2d0bcc7140 Fixed bug in LED-checkbox
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@16 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-10-13 12:29:20 +00:00
Tobias Doerffel
315839ff8e added missing icons
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@15 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-10-11 05:28:23 +00:00
Tobias Doerffel
5d9e7fe0ed - faster oscillator
- tempo-based arpeggiator and LFOs
- bug-fixes
- added another Moog-filter


git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@14 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-10-06 08:24:23 +00:00
Tobias Doerffel
6ba478ff6b made all sound-generator-plugins shared libraries which are loaded at runtime when needed; removed obsolete files and fixed bugs in tabWidget
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@13 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-09-30 10:31:55 +00:00
Tobias Doerffel
b3754454cd GUI-improvements, zooming-selectboxes in piano-roll and song-editor and more
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@12 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-09-29 07:18:55 +00:00
Tobias Doerffel
f64b25ba44 added missing files
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@11 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-09-28 07:42:40 +00:00
Tobias Doerffel
00e9f34b20 more compat hacks
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@10 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-09-28 07:40:40 +00:00
Tobias Doerffel
99dfdc3f46 bug-fixes, compatibility-patches, ... see ChangeLog for details
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@9 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-09-27 13:10:34 +00:00
Tobias Doerffel
3a2536e269 Added missing files because for some reason, they weren't imported at initial port...
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@7 0778d3d1-df1d-0410-868b-ea421aaaa00d
2005-09-27 12:58:19 +00:00
264 changed files with 31737 additions and 2373 deletions

14
AUTHORS
View File

@@ -1,12 +1,12 @@
Tobias Doerffel
<tobydox@users.sourceforge.net>
Maintainer, main-development, artwork etc.
<tobydox@users.sourceforge.net>
Maintainer, main-development, artwork etc.
Danny McRae
<khjklujn@yahoo.com>
development
Sebastian Tilsch
<djcompilation@gmx.de>
recording of many samples
...may be there're more here in the future...
<djcompilation@gmx.de>
recording of many samples

1064
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@@ -19,24 +19,23 @@ rpm: $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE).spec
endif
noinst_PROGRAMS= bin2res
bin2res_SOURCES = buildtools/bin2res.cpp
SUBDIRS = artwork buildtools locale midi-maps plugins presets projects samples
INCLUDES = -I$(srcdir)/include -I.
INCLUDES = -I$(srcdir)/include -I. -I/usr/include/wine -I/usr/include/wine/windows
bin_PROGRAMS = lmms
AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS)
%.moc: $(srcdir)/include/%.h
$(MOC) -o $@ $<
%.ts:
$(LUPDATE) $(lmms_SOURCES) -ts locale/$@
$(LUPDATE) $(lmms_SOURCES) `find plugins/ -type f -name *.cpp` -ts locale/$@
%.qm: %.ts
$(LRELEASE) $<
@@ -45,31 +44,33 @@ AM_CXXFLAGS := $(AM_CXXFLAGS) $(QT_CXXFLAGS)
lmms_MOC = \
./about_dialog.moc \
./arp_and_chords_tab_widget.moc \
./audio_file_processor.moc \
./bb_editor.moc \
./bb_track.moc \
./browser.moc \
./channel_track.moc \
./config_mgr.moc \
./crystal_button.moc \
./cpuload_widget.moc \
./envelope_and_lfo_widget.moc \
./envelope_tab_widget.moc \
./export_project_dialog.moc \
./kmultitabbar.moc \
./file_browser.moc \
./group_box.moc \
./kmultitabbar.moc \
./knob.moc \
./lcd_spinbox.moc \
./led_checkbox.moc \
./lmms_main_win.moc \
./midi_out.moc \
./mixer.moc \
./name_label.moc \
./nstate_button.moc \
./midi_alsa_seq.moc \
./midi_tab_widget.moc \
./pattern.moc \
./piano_roll.moc \
./piano_widget.moc \
./pixmap_button.moc \
./plucked_string_synth.moc \
./plugin_browser.moc \
./project_notes.moc \
./qxembed.moc \
./rename_dialog.moc \
./sample_buffer.moc \
./sample_track.moc \
@@ -77,26 +78,23 @@ lmms_MOC = \
./side_bar.moc \
./side_bar_widget.moc \
./song_editor.moc \
./sound_generator.moc \
./surround_area.moc \
./tab_bar.moc \
./tab_button.moc \
./tab_widget.moc \
./tab_widget.moc \
./tempo_sync_knob.moc \
./timeline.moc \
./track_container.moc \
./track.moc \
./triple_oscillator.moc \
./visualization_widget.moc
BUILT_SOURCES = $(lmms_MOC)
#lmms_TRANSLATIONS = $(wildcard $(srcdir)/locale/*.qm $(srcdir)/locale/*.ts)
lmms_EMBEDDED_RESOURCES = $(wildcard $(srcdir)/resources/*png AUTHORS COPYING)
./embedded_resources.h: $(lmms_EMBEDDED_RESOURCES) bin2res
$(top_builddir)/bin2res $(lmms_EMBEDDED_RESOURCES) > $@
./embedded_resources.h: $(lmms_EMBEDDED_RESOURCES)
$(top_builddir)/buildtools/bin2res $(lmms_EMBEDDED_RESOURCES) > $@
./embed.o: ./embedded_resources.h
@@ -109,30 +107,33 @@ lmms_SOURCES = \
$(srcdir)/src/audio/audio_file_wave.cpp \
$(srcdir)/src/audio/audio_jack.cpp \
$(srcdir)/src/audio/audio_oss.cpp \
$(srcdir)/src/audio/audio_port.cpp \
$(srcdir)/src/audio/audio_sample_recorder.cpp \
$(srcdir)/src/audio/audio_sdl.cpp \
$(srcdir)/src/core/about_dialog.cpp \
$(srcdir)/src/core/arp_and_chords_tab_widget.cpp \
$(srcdir)/src/core/bb_editor.cpp \
$(srcdir)/src/core/browser.cpp \
$(srcdir)/src/core/config_mgr.cpp \
$(srcdir)/src/core/envelope_and_lfo_widget.cpp \
$(srcdir)/src/core/envelope_tab_widget.cpp \
$(srcdir)/src/core/export_project_dialog.cpp \
$(srcdir)/src/core/file_browser.cpp \
$(srcdir)/src/core/instrument.cpp \
$(srcdir)/src/core/lmms_main_win.cpp \
$(srcdir)/src/core/main.cpp \
$(srcdir)/src/core/midi_tab_widget.cpp \
$(srcdir)/src/core/mixer.cpp \
$(srcdir)/src/core/name_label.cpp \
$(srcdir)/src/core/note.cpp \
$(srcdir)/src/core/note_play_handle.cpp \
$(srcdir)/src/core/piano_roll.cpp \
$(srcdir)/src/core/piano_widget.cpp \
$(srcdir)/src/core/plugin_management.cpp \
$(srcdir)/src/core/plugin.cpp \
$(srcdir)/src/core/plugin_browser.cpp \
$(srcdir)/src/core/preset_preview_play_handle.cpp \
$(srcdir)/src/core/sample_play_handle.cpp \
$(srcdir)/src/core/setup_dialog.cpp \
$(srcdir)/src/core/song_editor.cpp \
$(srcdir)/src/core/sound_generator.cpp \
$(srcdir)/src/core/track.cpp \
$(srcdir)/src/core/track_container.cpp \
$(srcdir)/src/core/surround_area.cpp \
@@ -140,23 +141,23 @@ lmms_SOURCES = \
$(srcdir)/src/lib/buffer_allocator.cpp \
$(srcdir)/src/lib/clipboard.cpp \
$(srcdir)/src/lib/embed.cpp \
$(srcdir)/src/lib/ladspa_manager.cpp \
$(srcdir)/src/lib/mmp.cpp \
$(srcdir)/src/lib/oscillator.cpp \
$(srcdir)/src/lib/sample_buffer.cpp \
$(srcdir)/src/lib/string_pair_drag.cpp \
$(srcdir)/src/midi/midi_alsa_raw.cpp \
$(srcdir)/src/midi/midi_device.cpp \
$(srcdir)/src/midi/midi_alsa_seq.cpp \
$(srcdir)/src/midi/midi_client.cpp \
$(srcdir)/src/midi/midi_file.cpp \
$(srcdir)/src/midi/midi_mapper.cpp \
$(srcdir)/src/midi/midi_oss.cpp \
$(srcdir)/src/soundgenerators/audio_file_processor.cpp \
$(srcdir)/src/soundgenerators/midi_out.cpp \
$(srcdir)/src/soundgenerators/plucked_string_synth.cpp \
$(srcdir)/src/soundgenerators/triple_oscillator.cpp \
$(srcdir)/src/midi/midi_port.cpp \
$(srcdir)/src/tracks/bb_track.cpp \
$(srcdir)/src/tracks/channel_track.cpp \
$(srcdir)/src/tracks/pattern.cpp \
$(srcdir)/src/tracks/sample_track.cpp \
$(srcdir)/src/widgets/crystal_button.cpp \
$(srcdir)/src/widgets/cpuload_widget.cpp \
$(srcdir)/src/widgets/group_box.cpp \
$(srcdir)/src/widgets/kmultitabbar.cpp \
$(srcdir)/src/widgets/knob.cpp \
@@ -165,11 +166,14 @@ lmms_SOURCES = \
$(srcdir)/src/widgets/nstate_button.cpp \
$(srcdir)/src/widgets/pixmap_button.cpp \
$(srcdir)/src/widgets/project_notes.cpp \
$(srcdir)/src/widgets/qxembed.cpp \
$(srcdir)/src/widgets/rename_dialog.cpp \
$(srcdir)/src/widgets/side_bar_widget.cpp \
$(srcdir)/src/widgets/tab_bar.cpp \
$(srcdir)/src/widgets/tab_widget.cpp \
$(srcdir)/src/widgets/text_float.cpp \
$(srcdir)/src/widgets/tempo_sync_knob.cpp \
$(srcdir)/src/widgets/tool_button.cpp \
$(srcdir)/src/widgets/tooltip.cpp \
$(srcdir)/src/widgets/visualization_widget.cpp \
$(srcdir)/include/pch.h \
@@ -193,16 +197,13 @@ lmms_SOURCES = \
$(srcdir)/include/volume.h \
$(srcdir)/include/panning.h \
$(srcdir)/include/song_editor.h \
$(srcdir)/include/sound_generator.h \
$(srcdir)/include/audio_file_processor.h \
$(srcdir)/include/midi_time.h \
$(srcdir)/include/plugin.h \
$(srcdir)/include/instrument.h \
$(srcdir)/include/bb_editor.h \
$(srcdir)/include/piano_widget.h \
$(srcdir)/include/effect_board.h \
$(srcdir)/include/pixmap_button.h \
$(srcdir)/include/triple_oscillator.h \
$(srcdir)/include/settings.h \
$(srcdir)/include/plucked_string_synth.h \
$(srcdir)/include/rename_dialog.h \
$(srcdir)/include/export_project_dialog.h \
$(srcdir)/include/note_play_handle.h \
@@ -212,14 +213,15 @@ lmms_SOURCES = \
$(srcdir)/include/envelope_and_lfo_widget.h \
$(srcdir)/include/about_dialog.h \
$(srcdir)/include/oscillator.h \
$(srcdir)/include/crystal_button.h \
$(srcdir)/include/arp_and_chords_tab_widget.h \
$(srcdir)/include/export.h \
$(srcdir)/include/group_box.h \
$(srcdir)/include/tab_widget.h \
$(srcdir)/include/knob.h \
$(srcdir)/include/browser.h \
$(srcdir)/include/file_browser.h \
$(srcdir)/include/plugin_browser.h \
$(srcdir)/include/templates.h \
$(srcdir)/include/gui_templates.h \
$(srcdir)/include/surround_area.h \
$(srcdir)/include/kmultitabbar.h \
$(srcdir)/include/side_bar.h \
@@ -232,10 +234,14 @@ lmms_SOURCES = \
$(srcdir)/include/name_label.h \
$(srcdir)/include/play_handle.h \
$(srcdir)/include/mmp.h \
$(srcdir)/include/midi_device.h \
$(srcdir)/include/midi_file.h \
$(srcdir)/include/midi.h \
$(srcdir)/include/midi_alsa_raw.h \
$(srcdir)/include/midi_client.h \
$(srcdir)/include/midi_event_processor.h \
$(srcdir)/include/midi_file.h \
$(srcdir)/include/midi_oss.h \
$(srcdir)/include/midi_port.h \
$(srcdir)/include/midi_time.h \
$(srcdir)/include/clipboard.h \
$(srcdir)/include/types.h \
$(srcdir)/include/qt3support.h \
@@ -250,8 +256,6 @@ lmms_SOURCES = \
$(srcdir)/include/endian_handling.h \
$(srcdir)/include/preset_preview_play_handle.h \
$(srcdir)/include/sample_play_handle.h \
$(srcdir)/include/midi.h \
$(srcdir)/include/midi_out.h \
$(srcdir)/include/nstate_button.h \
$(srcdir)/include/midi_dummy.h \
$(srcdir)/include/midi_mapper.h \
@@ -260,12 +264,23 @@ lmms_SOURCES = \
$(srcdir)/include/tooltip.h \
$(srcdir)/include/led_checkbox.h \
$(srcdir)/include/text_float.h \
$(srcdir)/include/setup_dialog.h
$(srcdir)/include/tempo_sync_knob.h \
$(srcdir)/include/setup_dialog.h \
$(srcdir)/include/dummy_plugin.h \
$(srcdir)/include/dummy_instrument.h \
$(srcdir)/include/instrument_play_handle.h \
$(srcdir)/include/string_pair_drag.h \
$(srcdir)/include/ladspa_manager.h \
$(srcdir)/include/midi_tab_widget.h \
$(srcdir)/include/audio_port.h \
$(srcdir)/include/tool_button.h \
$(srcdir)/include/cpuload_widget.h \
$(srcdir)/include/midi_alsa_seq.h \
$(srcdir)/include/qxembed.h
EXTRA_DIST = \
$(lmms_EMBEDDED_RESOURCES) \
$(srcdir)/include/sgs
EXTRA_DIST = $(lmms_EMBEDDED_RESOURCES) aeffectx_h_fix.patch
CLEANFILES = $(lmms_MOC) ./embedded_resources.h
@@ -298,7 +313,6 @@ if HAVE_LIBSF
LIB_SF_LDADD = -lsndfile
endif
lmms_LDADD = $(QT_LDADD) $(LIB_SDL_LDADD) $(LIB_ASOUND_LDADD) $(LIB_JACK_LDADD) $(LIB_SDL_SOUND_LDADD) $(LIB_VORBIS_LDADD) $(LIB_SRC_LDADD) $(LIB_SF_LDADD)
SUBDIRS = artwork locale midi-maps presets projects samples
lmms_LDADD = $(QT_LDADD) $(LIB_SDL_LDADD) $(LIB_ASOUND_LDADD) $(LIB_JACK_LDADD) $(LIB_SDL_SOUND_LDADD) $(LIB_VORBIS_LDADD) $(LIB_SRC_LDADD) $(LIB_SF_LDADD) $(LIB_FST_LDADD) -ldl
lmms_LDFLAGS = -rdynamic -rpath $(pkglibdir)

79
README
View File

@@ -1,10 +1,10 @@
Linux MultiMedia Studio 0.1.0
=============================
Linux MultiMedia Studio 0.1.2
==============================
Copyright (c) 2004-2005 by Tobias Doerffel
Copyright (c) 2004-2005 by Tobias Doerffel and others.
The whole program is free software; you can redistribute it and/or modify
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your option)
any later version.
@@ -26,9 +26,9 @@ What is LMMS??
LMMS aims to be a free alternative to popular (but commercial and closed-
source) programs like FruityLoops, Cubase and Logic giving you the ability of
producing music with your computer by creating/synthesizing sounds, arranging
samples, playing live with keyboard and much more...
samples, using effects, playing live with keyboard and much more...
LMMS combines the features of a tracker-/sequencer-program (pattern-/channel-/
LMMS combines the features of a sequencer-program (pattern-/channel-/
sample-/song-/effect-management) and those of powerful synthesizers and
samplers in a modern, user-friendly and easy to use graphical user-interface.
@@ -41,25 +41,29 @@ Requirements
------------
The most important requirement is for sure a fast computer, so don't try to get
LMMS working on a pentium one with 60 MHz... ;-) So you should have at least
500 MHz, but for really enjoying LMMS less than 1 GHz makes no sense...
(LMMS is currently developed on a PIII 450 MHz...!!)
LMMS working on a pentium I with 60 MHz... ;-) Therefore you should have at
least 500 MHz, but for really enjoying LMMS less than 1 GHz makes no sense...
Required libraries are:
- Qt 3.2 or higher (tested up to 4.0.0) with devel-files
- SDL_sound (tested with 0.1.5 & 1.0.1) with devel-files
- multithreaded version of Qt 3.0 (at least 3.2 recommended) or higher (tested
up to 4.1.0) with devel-files
Optional, but strongly recommended:
- JACK with devel-files
- libvorbis with devel-files
- libalsa with devel-files
- SDL_sound (tested with 0.1.5 & 1.0.1) with devel-files
- SDL with devel-files
- libsamplerate with devel-files
- libsndfile with devel-files
- WINE, WINE-devel-files + header-files from Steinberg SDK
For compiling you should have an up to date GCC with g++.
LMMS has been (successfully) tested under Debian Sarge 3.1, Fedora Core 2-4,
and SuSE Linux 9.0-9.3 with Qt 3.[23].x and Qt 4.0.0.
It was compiled using GCC 3.3.x, GCC 3.4.x and GCC 4.0.0.
LMMS has been (successfully) tested under Debian Sarge 3.1 / unstable,
Fedora Core 2-4, and SuSE Linux 9.0-9.3 with Qt 3.[23].x and Qt 4.0.0.
It was compiled using GCC 2.95, 3.3.x, GCC 3.4.x and GCC 4.0.x.
If you have problems with compiling or running LMMS, find any bug or have
suggestions and so on, please feel free to e-mail me (for mail-address see
@@ -67,31 +71,44 @@ below)!
Building
--------
Help developing LMMS
--------------------
See INSTALL for information on how to build LMMS.
Please also take a look at
./configure --help
There you'll see a lot of options which partly might be interesting for you.
For example if you want to build LMMS with VST-support, you have to run
configure with --with-vst switch. Otherwise LMMS support won't be built!
Join LMMS-development
----------------------
If you are interested in LMMS, it's programming, artwork, testing, writing
demo-songs, (and improving this f**** README...) or something like that,
you're welcome to participate on the development of LMMS!
Just e-mail me: tobydox@users.sourceforge.net
The project-homepage of LMMS, mailingslists and a list of things you can do
can be found at
The project-homepage of LMMS and mailingslists can be found at
http://lmms.sourceforge.net
Before coding a new big feature, please always post your idea and suggestions
Details on development can be found at
http://lmms.sourceforge.net/development.php
or in the Wiki:
http://wiki.mindrules.net
Before coding a new big feature, please ALWAYS post your idea and suggestions
about your feature and about the actual implementation to the
LMMS-devel-mailinglist (lmms-devel@lists.sourceforge.net) and wait for replies
or email me! Maybe there're different ideas, improvements, hints or maybe your
feature is not welcome/needed at the moment (but for sure this will be very
seldom).
If you coded your feature, make sure, that it is running properly with the
newest available version of LMMS and that it also runs with different
configurations (e.g. different latency, disabled surround-support, missing
package(s) etc.). Important is also, that you comment your
source so that other people can fix bugs or improve your feature!
LMMS-devel-mailinglist (lmms-devel@lists.sourceforge.net) and wait for replies!
Maybe there're different ideas, improvements, hints or maybe your feature is
not welcome/needed at the moment (but for sure this will be very seldom).

35
TODO
View File

@@ -1,16 +1,20 @@
- make usable with Qt4
- make LMMS an ALSA-sequencer-client
- adchannel-toolbutton -> popup-menu with available soundgenerator-plugins
- tempo-based arpeggio
to be done as soon as possible:
- do not skip samples because of rounding when resampling in src/lib/sample_buffer.cpp
- MIDI-program/MIDI-mapping/process program-/channel-change-events from MIDI-files
- do not allow to connect output-port of channel to own input-port!
- add note-len- and note-alignment-selectbox to piano-roll
- DSSI-support
- save/load parameters of VST-plugin
- somehow avoid hidden plugin-descriptor-widgets plugin-browser if height of window is too small -> add scrollbar
- use drawLineF() for drawing notes in pattern::paintEvent() in qt4-version
- only redraw region given by paint-event in pattern, bbTCO, sampleTCO etc.
- pre-listen when opening sample with QFileDialog
- level-meters in output-graph and channel-track
- panning-editing in piano-roll
- use midi-maps
- process program-/channel-change-events from MIDI-files
- setup MIDI-channel and -program in MIDI-Out
- speed up painting of sampleTCO
- save window-positions, -states and -sizes in files
- solve problems with different keyboard-layouts when playing channel-track with pc-keyboard
- solve problems with different keyboard-layouts when playing channel-track with pc-keyboard -> use tr()
- balance env+lfo
- autosave every 1 minute
- audioDummy: always wait until the stuff normally would have been written (=simulate blocking IO)
@@ -19,22 +23,21 @@
- rewrite export-project-dialog using layout-mechanism
- dynamic pitch-change
- make piano-roll use the global clipboard??
- add languages:
- Dutch
- add more localizations:
- Italian
- ...any other welcome
- Swedish
- Norwegian
- Greece
- ...
Things to be done anytime in the future
to be done somewhen in the future:
- effect-board -> live-fx from input
- event-system
- event/automation-system
- chord-editor?
- WAVE/OGG/MP3-Import -> FFT-analysis -> write notes
- FLP-Import
- classical note-edit-window -> also ability of printing and maybe later scanning & recognition of notes
- add FLAC as export-format?
- support of LADSPA for all plugins
- better commented source...
- optimize, optimize, optimize.....

View File

@@ -264,3 +264,4 @@ AC_SUBST(QT_GUILINK)
AC_SUBST(QASSISTANTCLIENT_LDADD)
])

5
buildtools/Makefile.am Normal file
View File

@@ -0,0 +1,5 @@
AUTOMAKE_OPTIONS = foreign 1.4
noinst_PROGRAMS= bin2res
bin2res_SOURCES = bin2res.cpp

View File

@@ -1,7 +1,7 @@
/*
* bin2res.cpp - generate embedded resources from binary data (based on qembed)
*
* Copyright (c) 2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -97,7 +97,7 @@ int main( int argc, char * * argv )
e->cname = convertFileNameToCIdentifier( e->name );
embedded_data.push_back( e );
std::string s;
std::cout << "static const unsigned char " << e->cname <<
std::cout << "const unsigned char " << e->cname <<
"_data[] = {";
embedData( data, fsize, std::cout );
std::cout << std::endl << "};" << std::endl << std::endl;
@@ -106,7 +106,7 @@ int main( int argc, char * * argv )
if( embedded_data.size() > 0 )
{
std::cout << "static const unsigned char dummy_data[] ="
std::cout << "const unsigned char dummy_data[] ="
"{ 0x00 };" << std::endl << std::endl;
embed * dummy = new embed;
dummy->size = 1;
@@ -114,14 +114,15 @@ int main( int argc, char * * argv )
dummy->cname = convertFileNameToCIdentifier( "dummy" );
embedded_data.push_back( dummy );
std::cout << "#include <string.h>" << std::endl;
std::cout << "static struct embedDesc" << std::endl
<< "{" << std::endl
std::cout << "#include <string.h>" << std::endl << std::endl;
std::cout << "#include \"embed.h\"" << std::endl << std::endl;
std::cout << "embed::descriptor embed_vec[] = {" << std::endl;
/* << "{" << std::endl
<< " int size;" << std::endl
<< " const unsigned char * data;" <<
std::endl
<< " const char * name;" << std::endl
<< "} embed_vec[] = {" << std::endl;
<< "} embed_vec[] = {" << std::endl;*/
while( embedded_data.size() > 0 )
{
embed * e = embedded_data[0];
@@ -133,9 +134,9 @@ int main( int argc, char * * argv )
}
std::cout << " { 0, 0, 0 }" << std::endl << "};" << std::endl
<< std::endl
<< "static const embedDesc & findEmbeddedData( "
"const char * _name )" << std::endl
<< "{" << std::endl
<< "const embed::descriptor & "
"findEmbeddedData( const char * _name )"
<< std::endl << "{" << std::endl
<< " for( int i = 0; embed_vec[i].data; "
"i++ )" << std::endl
<< " {" << std::endl

View File

@@ -2,9 +2,8 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.50)
AC_INIT(lmms, 0.1.1, tobydox@users.sourceforge.net)
#AC_INIT(acinclude.m4)
AM_INIT_AUTOMAKE(lmms, 0.1.1)
AC_INIT(lmms, 0.1.1-cvs20051221, tobydox/at/users.sourceforge.net)
AM_INIT_AUTOMAKE(lmms, 0.1.1-cvs20051221)
AM_CONFIG_HEADER(config.h)
@@ -12,6 +11,8 @@ AM_CONFIG_HEADER(config.h)
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_GCC_TRADITIONAL
AC_PROG_LIBTOOL
AC_PATH_XTRA
@@ -21,7 +22,7 @@ gw_CHECK_QT
# checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([fcntl.h memory.h string.h sys/ioctl.h unistd.h stdlib.h])
AC_CHECK_HEADERS([fcntl.h memory.h string.h sys/ioctl.h unistd.h stdlib.h pthread.h sys/ipc.h sys/shm.h sys/time.h sys/select.h sys/types.h stdarg.h])
# checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -31,15 +32,16 @@ AC_HEADER_TIME
AC_STRUCT_TM
AC_C_VOLATILE
AC_C_BIGENDIAN
AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t, long long])
# checks for library functions.
AC_FUNC_ALLOCA
AC_PROG_GCC_TRADITIONAL
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([usleep])
AC_CHECK_FUNCS([usleep pipe sprintf])
# search for include-path of SDL (just for supporting the FreeBSD-guys.... ;-)
@@ -54,7 +56,7 @@ done
AH_TEMPLATE(SDL_SDL_H, [Define to location of SDL.h])
AH_TEMPLATE(SDL_SDL_AUDIO_H, [Define to location of SD_audio.h])
AH_TEMPLATE(SDL_SDL_AUDIO_H, [Define to location of SDL_audio.h])
AH_TEMPLATE(SDL_SDL_SOUND_H, [Define to location of SDL_sound.h])
OLD_LIBS="$LIBS"
@@ -65,7 +67,7 @@ AC_ARG_WITH(sdl,
AS_HELP_STRING([--without-sdl],
[disable support for SDL-audio-output]), ,
[ with_sdlaudio=yes ])
AH_TEMPLATE(HAVE_SDL_SDL_AUDIO_H, [Define to 1 if you have the $SDL_INC_PATH/SDL_audio.h header file.])
AH_TEMPLATE(HAVE_SDL_SDL_AUDIO_H, [Define to 1 if you have the <$SDL_INC_PATH/SDL_audio.h> header file.])
if test "x$with_sdlaudio" = "xyes" -a ! -z "$SDL_INC_PATH"; then
AC_CHECK_HEADER($SDL_INC_PATH/SDL_audio.h, HAVE_SDL_SDL_AUDIO_H="true")
AC_CHECK_LIB([SDL], [SDL_OpenAudio], HAVE_LIBSDL="true", HAVE_SDL_SDL_AUDIO_H="")
@@ -83,7 +85,7 @@ AC_ARG_WITH(sdlsound,
AS_HELP_STRING([--without-sdlsound],
[disable support for reading samples via SDL_sound]), ,
[ with_sdlsound=yes ])
AH_TEMPLATE(HAVE_SDL_SDL_SOUND_H, [Define to 1 if you have the $SDL_INCL_PATH/SDL_sound.h header file.])
AH_TEMPLATE(HAVE_SDL_SDL_SOUND_H, [Define to 1 if you have the <$SDL_INCL_PATH/SDL_sound.h> header file.])
if test "x$with_sdlsound" = "xyes" -a ! -z "$SDL_INC_PATH"; then
AC_CHECK_HEADER($SDL_INC_PATH/SDL_sound.h, HAVE_SDL_SDL_SOUND_H="true")
AC_CHECK_LIB([SDL_sound], [Sound_Init], HAVE_LIBSDL_SOUND="true", HAVE_SDL_SDL_SOUND_H="")
@@ -103,7 +105,7 @@ AC_ARG_WITH(asound,
AS_HELP_STRING([--without-asound],
[disable support for ALSA-sound-output]), ,
[ with_asound=yes ])
AH_TEMPLATE(HAVE_ALSA_ASOUNDLIB_H, [Define to 1 if you have the alsa/asoundlib.h header file.])
AH_TEMPLATE(HAVE_ALSA_ASOUNDLIB_H, [Define to 1 if you have the <alsa/asoundlib.h> header file.])
if test "x$with_asound" = "xyes" ; then
AC_CHECK_HEADER(alsa/asoundlib.h, HAVE_ALSA_ASOUNDLIB_H="true")
AC_CHECK_LIB([asound], [snd_pcm_open], HAVE_LIBASOUND="true", HAVE_ALSA_ASOUNDLIB_H="")
@@ -114,12 +116,31 @@ fi
AM_CONDITIONAL(HAVE_LIBASOUND, test ! -z "$HAVE_ALSA_ASOUNDLIB_H")
# check for OSS
AC_ARG_WITH(oss,
AS_HELP_STRING([--without-oss],
[disable support for OSS-sound-output]), ,
[ with_oss=yes ])
AH_TEMPLATE(HAVE_SYS_SOUNDCARD_H, [Define to 1 if you have the <sys/soundcard.h> header file.])
AH_TEMPLATE(HAVE_SOUNDCARD_H, [Define to 1 if you have the <soundcard.h> header file.])
if test "x$with_oss" = "xyes" ; then
AC_CHECK_HEADER(sys/soundcard.h, HAVE_SYS_SOUNDCARD_H="true")
AC_CHECK_HEADER(soundcard.h, HAVE_SOUNDCARD_H="true")
fi
if test ! -z "$HAVE_SYS_SOUNDCARD_H" ; then
AC_DEFINE(HAVE_SYS_SOUNDCARD_H)
fi
if test ! -z "$HAVE_SOUNDCARD_H" ; then
AC_DEFINE(HAVE_SOUNDCARD_H)
fi
# check for JACK
AC_ARG_WITH(jack,
AS_HELP_STRING([--without-jack],
[disable support for JACK-transport]), ,
[ with_jack=yes ])
AH_TEMPLATE(HAVE_JACK_JACK_H, [Define to 1 if you have the jack/jack.h header file.])
AH_TEMPLATE(HAVE_JACK_JACK_H, [Define to 1 if you have the <jack/jack.h> header file.])
AH_TEMPLATE(OLD_JACK, [Define to 1 if your JACK-version doesnt know about jack_client_open() etc.])
if test "x$with_jack" = "xyes" ; then
AC_CHECK_HEADER(jack/jack.h, HAVE_JACK_JACK_H="true")
@@ -135,14 +156,49 @@ fi
AM_CONDITIONAL(HAVE_LIBJACK, test ! -z "$HAVE_JACK_JACK_H")
# check for proper WINE-installation and existing Steinberg headers
AC_ARG_WITH(vst,
AS_HELP_STRING([--with-vst],
[enable support for builtin VST-plugin-hosting]), [ with_vst=yes ], [ with_vst=no ])
AH_TEMPLATE(HAVE_VST_AEFFECTX_H, [Define to 1 if you have the <vst/aeffectx.h> header file.])
if test "x$with_vst" = "xyes" ; then
AC_CHECK_HEADER(vst/aeffectx.h, HAVE_VST_AEFFECTX_H="true")
AC_CHECK_PROG(WINEGCC, winegcc, /usr/bin/winegcc,,/usr/bin)
AC_CHECK_LIB([wine], [wine_init])
if test ! -z "$WINEGCC" ; then
if test ! -z "$HAVE_VST_AEFFECTX_H" ; then
WINE_OK_BUT_VST_INCOMPLETE=""
AC_DEFINE(HAVE_VST_AEFFECTX_H)
else
WINE_OK_BUT_VST_INCOMPLETE="true"
fi
fi
fi
AM_CONDITIONAL(VST_SUPPORT, test ! -z "$WINEGCC")
# check for LADSPA-SDK
AC_ARG_WITH(src,
AS_HELP_STRING([--without-ladspa],
[disable support for LADSPA-support]), ,
[ with_ladspa=yes ])
AH_TEMPLATE(HAVE_LADSPA_H, [Define to 1 if you have the <ladspa.h> header file.])
if test "x$with_ladspa" = "xyes" ; then
AC_CHECK_HEADER(ladspa.h, HAVE_LADSPA_H="true")
fi
if test ! -z "$HAVE_LADSPA_H" ; then
AC_DEFINE(HAVE_LADSPA_H)
fi
# check for vorbis-lib
AC_ARG_WITH(vorbis,
AS_HELP_STRING([--without-vorbis],
[disable support for exporting song to OGG-files]), ,
[ with_vorbis=yes ])
AH_TEMPLATE(HAVE_VORBIS_CODEC_H, [Define to 1 if you have the vorbis/codec.h header file.])
AH_TEMPLATE(HAVE_VORBIS_VORBISENC_H, [Define to 1 if you have the vorbis/vorbisenc.h header file.])
AH_TEMPLATE(HAVE_VORBIS_VORBISFILE_H, [Define to 1 if you have the vorbis/vorbisfile.h header file.])
AH_TEMPLATE(HAVE_VORBIS_CODEC_H, [Define to 1 if you have the <vorbis/codec.h> header file.])
AH_TEMPLATE(HAVE_VORBIS_VORBISENC_H, [Define to 1 if you have the <vorbis/vorbisenc.h> header file.])
AH_TEMPLATE(HAVE_VORBIS_VORBISFILE_H, [Define to 1 if you have the <vorbis/vorbisfile.h> header file.])
if test "x$with_vorbis" = "xyes" ; then
OGG_SUPPORT="true"
AC_CHECK_HEADER(vorbis/codec.h, HAVE_VORBIS_CODEC_H="true",OGG_SUPPORT="")
@@ -158,12 +214,31 @@ fi
AM_CONDITIONAL(HAVE_LIBVORBIS, test ! -z "$OGG_SUPPORT")
# check for libFLAC
AC_ARG_WITH(flac,
AS_HELP_STRING([--without-flac],
[disable support for internal encoding/decoding with FLAC]), ,
[ with_flac=yes ])
AH_TEMPLATE(HAVE_FLAC_STREAM_ENCODER_H, [Define to 1 if you have the <FLAC/stream_encoder.h> header file.])
AH_TEMPLATE(HAVE_FLAC_STREAM_DECODER_H, [Define to 1 if you have the <FLAC/stream_decoder.h> header file.])
if test "x$with_flac" = "xyes" ; then
AC_CHECK_HEADER(FLAC/stream_encoder.h, HAVE_FLAC_STREAM_ENCODER_H="true")
AC_CHECK_HEADER(FLAC/stream_decoder.h, HAVE_FLAC_STREAM_DECODER_H="true")
AC_CHECK_LIB([FLAC], [FLAC__stream_encoder_new], HAVE_LIBFLAC="true")
fi
if test ! -z "$HAVE_FLAC_STREAM_ENCODER_H" -a ! -z "$HAVE_FLAC_STREAM_DECODER_H" -a ! -z "$HAVE_LIBFLAC"; then
AC_DEFINE(HAVE_FLAC_STREAM_ENCODER_H)
AC_DEFINE(HAVE_FLAC_STREAM_DECODER_H)
fi
AM_CONDITIONAL(HAVE_LIBFLAC, test ! -z "$HAVE_LIBFLAC")
# check for libsamplerate
AC_ARG_WITH(src,
AC_ARG_WITH(libsrc,
AS_HELP_STRING([--without-libsrc],
[disable support for resampling via libsamplerate]), ,
[ with_libsrc=yes ])
AH_TEMPLATE(HAVE_SAMPLERATE_H, [Define to 1 if you have the samplerate.h header file.])
AH_TEMPLATE(HAVE_SAMPLERATE_H, [Define to 1 if you have the <samplerate.h> header file.])
if test "x$with_libsrc" = "xyes" ; then
AC_CHECK_HEADER(samplerate.h, HAVE_SAMPLERATE_H="true")
AC_CHECK_LIB([samplerate], [src_simple], HAVE_LIBSRC="true", HAVE_SAMPLERATE_H="")
@@ -175,11 +250,11 @@ AM_CONDITIONAL(HAVE_LIBSRC, test ! -z "$HAVE_SAMPLERATE_H")
# libsndfile-stuff
AC_ARG_WITH(src,
AC_ARG_WITH(sndfile,
AS_HELP_STRING([--without-libsf],
[disable support for importing files via libsndfile]), ,
[ with_libsf=yes ])
AH_TEMPLATE(HAVE_SNDFILE_H, [Define to 1 if you have the sndfile.h header file.])
AH_TEMPLATE(HAVE_SNDFILE_H, [Define to 1 if you have the <sndfile.h> header file.])
if test "x$with_libsf" = "xyes" ; then
AC_CHECK_HEADER(sndfile.h, HAVE_SNDFILE_H="true")
AC_CHECK_LIB([sndfile], [sf_command], HAVE_LIBSF="true", HAVE_SNDFILE_H="")
@@ -207,11 +282,11 @@ AM_CONDITIONAL(HAVE_LIBSF, test ! -z "$HAVE_SNDFILE_H")
AC_ARG_WITH(nosmpdecs,
AS_HELP_STRING([--without-sample-decoders],
[force compiling LMMS even if libraries for sample-decoding were found]),
[force compiling LMMS even if no usable libraries for sample-decoding were found]),
[ with_smpdecs=yes ])
if test -z "$HAVE_SND_FILE" -a -z "$HAVE_SDL_SDL_SOUND_H" -a -z "$OGG_SUPPORT" -a ! -z "$with_smpdecs"; then
AC_MSG_ERROR([*** neither libsndfile nor SDL_sound nor libvorbis (or according devel-files) were found which would make LMMS unable to load any samples, so please install at least one of the packages and try again! Use --without-sample-decoders to force compiling LMMS.])
AC_MSG_ERROR([*** neither libsndfile nor SDL_sound nor libvorbis (or according devel-files) were found which would make LMMS unable to load any samples so please install at least one of the packages and try again! Use --without-sample-decoders to force compiling without any sample-decoding-libraries.])
fi
@@ -283,6 +358,14 @@ AC_TRY_LINK([#include <math.h>], [ fabsf ],
AC_DEFINE(fabsf, fabs)
)
AC_MSG_CHECKING([whether logf is known by compiler])
AH_TEMPLATE(logf, [Define to lof if logf is not known])
AC_TRY_LINK([#include <math.h>], [ logf ],
AC_MSG_RESULT(yes),
AC_MSG_RESULT([no - will use log instead])
AC_DEFINE(logf, log)
)
# check whether to enable debugging-code
AC_MSG_CHECKING([whether to enable debugging-code])
@@ -314,7 +397,7 @@ lmmsdatadir="$datadir/$PACKAGE"
AC_SUBST(lmmsdatadir)
CXXFLAGS="$CXXFLAGS -g0"
# CXXFLAGS="$CXXFLAGS -g0"
if test $CXX == "g++" ; then
CXXFLAGS="$CXXFLAGS -ansi -Wall -fno-exceptions"
fi
@@ -322,13 +405,19 @@ fi
AC_CONFIG_FILES([Makefile
artwork/Makefile
buildtools/Makefile
locale/Makefile
midi-maps/Makefile
plugins/Makefile
plugins/audio_file_processor/Makefile
plugins/plucked_string_synth/Makefile
plugins/triple_oscillator/Makefile
plugins/vestige/Makefile
presets/Makefile
presets/AudioFileProcessor/Makefile
presets/MIDI-Out/Makefile
presets/PluckedStringSynth/Makefile
presets/TripleOscillator/Makefile
presets/VeSTige/Makefile
projects/Makefile
projects/cool_songs/Makefile
projects/covers/Makefile
@@ -356,21 +445,7 @@ with_warnings="false"
echo
echo
if test -z "$OGG_SUPPORT" ; then
echo " ========================"
echo " === LMMS - WARNING ======================================================="
echo " ========================"
echo " ="
echo " = You don't seem to have libvorbis installed and/or libvorbis-development-"
echo " = package is missing. This will disable support for exporting songs to"
echo " = OGG-files! If also SDL_sound is missing, you'll not be able to use the "
echo " = samples coming with LMMS since libsndfile currently has no OGG-support!"
echo " = Consider installing the missing packages for using the full power of LMMS."
echo " ="
with_warnings="true"
fi
PLUGINS_TO_BUILD=""
if test -z "$HAVE_ALSA_ASOUNDLIB_H" ; then
@@ -380,10 +455,11 @@ if test -z "$HAVE_ALSA_ASOUNDLIB_H" ; then
echo " ="
echo " = You don't seem to have ALSA-library installed and/or ALSA-lib-development-"
echo " = package is missing. This will disable support for sound-output via ALSA!"
echo " = If you use ALSA-driver for your soundcard there will be no sound-output!"
echo " = Consider installing the missing packages for using the full power of LMMS."
echo " ="
with_warnings="true"
else
PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* ALSA for audio- and MIDI-input/output"
fi
@@ -400,10 +476,32 @@ if test -z "$HAVE_JACK_JACK_H" ; then
echo " = Consider installing the missing packages for using the full power of LMMS."
echo " ="
with_warnings="true"
else
PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* JACK for audio-input/output"
fi
if test -z "$HAVE_SOUNDCARD_H" -a -z "$HAVE_SYS_SOUNDCARD_H" ; then
echo " ========================"
echo " === LMMS - WARNING ======================================================="
echo " ========================"
echo " ="
echo " = You don't seem to have soundcard.h which is neccessary for outputting "
echo " = sound via OSS under Linux/BSD/Solaris."
echo " = This will also disable support for MIDI using OSS."
echo " = If you're building for a different platform or do not need OSS-support, you"
echo " = can ignore this warning."
echo " ="
with_warnings="true"
else
PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* OSS for audio- and MIDI-input/output"
fi
if test -z "$HAVE_SDL_SDL_AUDIO_H" ; then
echo " ========================"
echo " === LMMS - WARNING ======================================================="
@@ -411,16 +509,35 @@ if test -z "$HAVE_SDL_SDL_AUDIO_H" ; then
echo " ="
echo " = You don't seem to have SDL-library installed and/or SDL-lib-development-"
echo " = package is missing. This will disable support for sound-output via SDL, "
echo " = which is important, if you're using sound-daemons (arts, ESD, JACK etc.)"
echo " = which is important, if you're using sound-daemons (arts, ESD etc.)"
echo " = When compiling without SDL, you'll always have to kill your sound-daemon"
echo " = before using LMMS...!"
echo " = Consider installing the missing packages for using the full power of LMMS."
echo " ="
with_warnings="true"
else
PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* SDL for audio-output"
fi
if test -z "$OGG_SUPPORT" ; then
echo " ========================"
echo " === LMMS - WARNING ======================================================="
echo " ========================"
echo " ="
echo " = You don't seem to have libvorbis installed and/or libvorbis-development-"
echo " = package is missing. This will disable support for exporting songs to"
echo " = OGG-files! If SDL_sound is missing too, you'll not be able to use the "
echo " = samples coming with LMMS since libsndfile currently has no OGG-support!"
echo " = Consider installing the missing packages for using the full power of LMMS."
echo " ="
with_warnings="true"
else
PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* libvorbis for encoding/decoding OGG-files"
fi
if test -z "$HAVE_SDL_SDL_SOUND_H" ; then
echo " ========================"
@@ -433,6 +550,8 @@ if test -z "$HAVE_SDL_SDL_SOUND_H" ; then
echo " = Consider installing the missing packages for using the full power of LMMS."
echo " ="
with_warnings="true"
else
PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* SDL_sound for sample-decoding"
fi
@@ -450,10 +569,30 @@ if test -z "$HAVE_SNDFILE_H" ; then
echo " = Consider installing the missing packages for using the full power of LMMS."
echo " ="
with_warnings="true"
else
PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* libsndfile for sample-decoding"
fi
# not yet...
#if test -z "$HAVE_LADSPA_H" ; then
# echo " ========================"
# echo " === LMMS - WARNING ======================================================="
# echo " ========================"
# echo " ="
# echo " = You don't seem to have installed LADSPA-SDK which is neccessary for"
# echo " = building LMMS with LADSPA support. LADSPA-support is very useful"
# echo " = as you're able to use a lot of LADSPA-effects inside LMMS."
# echo " = Consider installing the missing packages for using the full power of LMMS."
# echo " ="
# with_warnings="true"
#else
# PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* LADSPA-plugins"
#fi
if test -z "$HAVE_SAMPLERATE_H" ; then
echo " ========================"
@@ -467,11 +606,68 @@ if test -z "$HAVE_SAMPLERATE_H" ; then
echo " = Consider installing the missing packages for using the full power of LMMS."
echo " ="
with_warnings="true"
else
PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* libsamplerate for internal samplerate-conversion"
fi
if test "x$with_vst" = "xno" ; then
echo " ========================"
echo " === LMMS - INFORMATION ==================================================="
echo " ========================"
echo " ="
echo " = If you want VST-support within LMMS, please pass"
echo " ="
echo " = --with-vst"
echo " ="
echo " = to configure, since it is disabled per default!"
echo " ="
else
if test ! -z "$WINE_OK_BUT_VST_INCOMPLETE" ; then
echo " ========================"
echo " === LMMS - WARNING ======================================================="
echo " ========================"
echo " ="
echo " = You seem to have a proper WINE-installation, but the header-files"
echo " = (AEffect.h and aeffectx.h) from Steinberg-VST-SDK are missing or not present"
echo " = in /usr/include/vst. We cannot distribute them as they're licensed under"
echo " = a GPL-incompatible license, so you'll have to download them at"
echo " ="
echo " = ftp://ext2asio:sdk1ext@ftp.pinnaclesys.com/SDK"
echo " ="
echo " = and put the mentioned files into /usr/include/vst. Make sure, they're"
echo " = patched with file aeffectx_h_fix.patch!"
echo " = Otherwise (now!) configure will disable LMMS's support for built-in VST-"
echo " = plugin-usage. If you do not intend to use VST-plugins with LMMS you can "
echo " = ignore this warning."
echo " = Consider installing the missing packages for using the full power of LMMS."
echo " ="
with_warnings="true"
else
if test ! -z "$HAVE_VST_AEFFECTX_H" ; then
PLUGINS_TO_BUILD="$PLUGINS_TO_BUILD\n\t\* it's own VST-server for hosting VST-plugins"
else
echo " ========================"
echo " === LMMS - WARNING ======================================================="
echo " ========================"
echo " ="
echo " = You don't seem to have installed WINE or it's development-packages (headers,"
echo " = winegcc etc.) which are neccessary for building LMMS with built-in"
echo " = VST-support."
echo " = If you do not intend to use VST-plugins with LMMS you can ignore this "
echo " = warning."
echo " = Consider installing the missing packages for using the full power of LMMS."
echo " ="
with_warnings="true"
fi
fi
fi
echo
echo
echo "LMMS will be able to use $PLUGINS_TO_BUILD" | sed -e "s/\\\n/\n/g" | sed -e "s/\\\t/\t/g" | sed -e "s/\\\\\*/\*/g"
echo
echo
echo " ============================"
@@ -490,7 +686,7 @@ else
fi
echo " ="
echo " = If there're problems while compiling LMMS, please send a mail to "
echo " = tobydox@users.sourceforge.net!"
echo " = tobydox [at] users.sourceforge.net!"
echo " ="
echo

View File

@@ -1,8 +1,9 @@
/*
* about_dialog.h - declaration of class aboutDialog
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -52,8 +53,8 @@ public:
protected:
void keyPressEvent( QKeyEvent * _ke );
void resizeEvent( QResizeEvent * _re );
virtual void keyPressEvent( QKeyEvent * _ke );
virtual void resizeEvent( QResizeEvent * _re );
private:

View File

@@ -2,8 +2,9 @@
* arp_and_chords_tab_widget.h - declaration of class arpAndChordWidget which
* provides code for using arpeggio and chords
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -46,13 +47,15 @@
#include "types.h"
class QComboBox;
class QPixmap;
class channelTrack;
class groupBox;
class knob;
class pixmapButton;
class QComboBox;
class QPixmap;
class notePlayHandle;
class pixmapButton;
class tempoSyncKnob;
const int MAX_CHORD_POLYPHONY = 10;
@@ -62,9 +65,8 @@ class arpAndChordsTabWidget : public QWidget, public settings
{
Q_OBJECT
public:
arpAndChordsTabWidget( channelTrack * _channel_track,
QWidget * _parent );
~arpAndChordsTabWidget();
arpAndChordsTabWidget( channelTrack * _channel_track );
virtual ~arpAndChordsTabWidget();
static struct chord
{
@@ -95,7 +97,6 @@ public:
protected slots:
// void arpOffToggled( bool );
void arpUpToggled( bool );
void arpDownToggled( bool );
void arpUpAndDownToggled( bool );
@@ -113,8 +114,6 @@ private:
RANDOM
} m_arpDirection;
channelTrack * m_channelTrack;
// chord-stuff
groupBox * m_chordsGroupBox;
QComboBox * m_chordsComboBox;
@@ -124,10 +123,10 @@ private:
groupBox * m_arpGroupBox;
QComboBox * m_arpComboBox;
knob * m_arpRangeKnob;
knob * m_arpTimeKnob;
tempoSyncKnob * m_arpTimeKnob;
knob * m_arpGateKnob;
QLabel * m_arpDirectionLbl;
//pixmapButton * m_arpOffBtn;
pixmapButton * m_arpUpBtn;
pixmapButton * m_arpDownBtn;
pixmapButton * m_arpUpAndDownBtn;
@@ -135,4 +134,5 @@ private:
} ;
#endif

View File

@@ -1,8 +1,9 @@
/*
* audio_alsa.h - device-class that implements ALSA-PCM-output
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -35,6 +36,9 @@
#define ALSA_SUPPORT
#endif
// older ALSA-versions might require this
#define ALSA_PCM_NEW_HW_PARAMS_API
#include <alsa/asoundlib.h>
#include "audio_device.h"
@@ -44,7 +48,7 @@ class lcdSpinBox;
class QLineEdit;
class audioALSA : public audioDevice
class audioALSA : public audioDevice, public QThread
{
public:
audioALSA( Uint32 _sample_rate, bool & _success_ful );
@@ -75,9 +79,9 @@ public:
private:
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
Uint32 _frames,
float _master_output );
virtual void startProcessing( void );
virtual void stopProcessing( void );
virtual void run( void );
int FASTCALL setHWParams( Uint32 _sample_rate, Uint32 _channels,
snd_pcm_access_t _access );
@@ -94,6 +98,7 @@ private:
snd_pcm_sw_params_t * m_swParams;
bool m_littleEndian;
volatile bool m_quit;
} ;

View File

@@ -1,8 +1,9 @@
/*
* audio_device.h - base-class for audio-devices, used by LMMS-mixer
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -29,11 +30,15 @@
#ifdef QT4
#include <QPair>
#include <QMutex>
#include <QThread>
#else
#include <qpair.h>
#include <qmutex.h>
#include <qthread.h>
#endif
@@ -50,6 +55,11 @@
#include "tab_widget.h"
class audioPort;
class audioDevice
{
public:
@@ -66,9 +76,15 @@ public:
m_devMutex.unlock();
}
void FASTCALL writeBuffer( surroundSampleFrame * _ab, Uint32 _frames,
Uint32 _src_sample_rate,
float _master_output );
// if audio-driver supports ports, classes inherting audioPort
// (e.g. channel-tracks) can register themselves for making
// audio-driver able to collect their individual output and provide
// them at a specific port - currently only supported by JACK
virtual void registerPort( audioPort * _port );
virtual void unregisterPort( audioPort * _port );
virtual void renamePort( audioPort * _port );
inline Uint32 sampleRate( void ) const
{
@@ -80,6 +96,15 @@ public:
return( m_channels );
}
void processNextBuffer( void );
virtual void startProcessing( void )
{
}
virtual void stopProcessing( void )
{
}
class setupWidget : public tabWidget
@@ -102,14 +127,21 @@ public:
protected:
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
// subclasses can overload this for being used in conjunction with
// processNextBuffer()
virtual void FASTCALL writeBuffer( surroundSampleFrame * _ab,
Uint32 _frames,
float _master_output ) = 0;
float _master_gain )
{
}
// called by according driver for fetching new sound-data
Uint32 FASTCALL getNextBuffer( surroundSampleFrame * _ab );
// convert a given audio-buffer to a buffer in signed 16-bit samples
// returns num of bytes in outbuf
int FASTCALL convertToS16( surroundSampleFrame * _ab, Uint32 _frames,
float _master_output,
float _master_gain,
outputSampleType * _output_buffer,
bool _convert_endian = FALSE );
@@ -118,9 +150,11 @@ protected:
Uint32 _frames );
// resample given buffer from samplerate _src_src to samplerate _dst_src
void FASTCALL resample( surroundSampleFrame * _src, Uint32 _frames,
void FASTCALL resample( const surroundSampleFrame * _src,
Uint32 _frames,
surroundSampleFrame * _dst,
Uint32 _src_sr, Uint32 _dst_sr );
inline void setSampleRate( Uint32 _new_sr )
{
m_sampleRate = _new_sr;
@@ -137,6 +171,8 @@ private:
SRC_STATE * m_srcState;
#endif
surroundSampleFrame * m_buffer;
} ;

View File

@@ -1,8 +1,9 @@
/*
* audio_dummy.h - dummy-audio-device
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -67,13 +68,8 @@ public:
private:
virtual void FASTCALL writeBufferToDev( surroundSampleFrame *,
Uint32 /*_frames*/, float )
{
//usleep( (Uint32)( _frames * 1000.0f * 1000.0f /
// DEFAULT_SAMPLE_RATE ) );
}
// TODO: derive from QThread and call getNextBuffer() in an
// endless loop
} ;

View File

@@ -2,8 +2,9 @@
* audio_file_device.h - base-class for audio-device-classes which write
* their output into a file
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -53,6 +54,7 @@ public:
virtual ~audioFileDevice();
protected:
int FASTCALL writeData( const void * _data, int _len );
void seekToBegin( void );

View File

@@ -2,8 +2,9 @@
* audio_file_ogg.h - Audio-device which encodes wave-stream and writes it
* into an OGG-file. This is used for song-export.
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -47,7 +48,7 @@ public:
Uint16 _min_bitrate, Uint16 _max_bitrate );
~audioFileOgg();
static audioDevice * getInst( Uint32 _sample_rate, Uint32 _channels,
static audioFileDevice * getInst( Uint32 _sample_rate, Uint32 _channels,
bool & _success_ful,
const QString & _file,
bool _use_vbr,
@@ -62,9 +63,9 @@ public:
private:
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
virtual void FASTCALL writeBuffer( surroundSampleFrame * _ab,
Uint32 _frames,
float _master_output );
float _master_gain );
bool startEncoding( void );
void finishEncoding( void );

View File

@@ -2,8 +2,9 @@
* audio_file_wave.h - Audio-device which encodes wave-stream and writes it
* into an WAVE-file. This is used for song-export.
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -40,7 +41,7 @@ public:
Uint16 _min_bitrate, Uint16 _max_bitrate );
virtual ~audioFileWave();
static audioDevice * getInst( Uint32 _sample_rate, Uint32 _channels,
static audioFileDevice * getInst( Uint32 _sample_rate, Uint32 _channels,
bool & _success_ful,
const QString & _file, bool _use_vbr,
Uint16 _nom_bitrate,
@@ -55,9 +56,9 @@ public:
private:
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
virtual void FASTCALL writeBuffer( surroundSampleFrame * _ab,
Uint32 _frames,
float _master_output );
float _master_gain );
bool startEncoding( void );
void finishEncoding( void );
@@ -82,8 +83,6 @@ private:
Uint32 data_bytes; // total size of sample-data
} m_waveFileHeader;
//outputSampleType * m_outputBuffer;
} ;

View File

@@ -1,8 +1,9 @@
/*
* audio_jack.h - support for JACK-transport
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -43,12 +44,14 @@
#include <QMutex>
#include <QVector>
#include <QList>
#include <QMap>
#else
#include <qmutex.h>
#include <qvaluevector.h>
#include <qvaluelist.h>
#include <qmap.h>
#endif
@@ -89,31 +92,38 @@ public:
private:
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
Uint32 _frames,
float _master_output );
virtual void startProcessing( void );
virtual void stopProcessing( void );
void clearBuffer( void );
virtual void registerPort( audioPort * _port );
virtual void unregisterPort( audioPort * _port );
virtual void renamePort( audioPort * _port );
static int processCallback( jack_nframes_t _nframes, void * _udata );
static int bufSizeCallback( jack_nframes_t _nframes, void * _udata );
static void shutdownCallback( void * _udata );
jack_client_t * m_client;
bool m_stopped;
QMutex m_processCallbackMutex;
vvector<jack_port_t *> m_outputPorts;
struct bufset
surroundSampleFrame * m_outBuf;
Uint32 m_framesDoneInCurBuf;
Uint32 m_framesToDoInCurBuf;
struct stereoPort
{
sampleType * buf;
Uint32 frames;
jack_port_t * ports[2];
} ;
vlist<vvector<bufset> > m_bufferSets;
Uint32 m_framesDoneInCurBuf;
volatile Uint32 m_frameSync;
Uint32 m_jackBufSize;
QMutex m_bufMutex;
typedef QMap<audioPort *, stereoPort> jackPortMap;
jackPortMap m_portMap;
} ;

View File

@@ -1,8 +1,9 @@
/*
* audio_oss.h - device-class that implements OSS-PCM-output
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -25,17 +26,25 @@
#ifndef _AUDIO_OSS_H
#define _AUDIO_OSS_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#if defined HAVE_SYS_SOUNDCARD_H || defined HAVE_SOUNDCARD_H
#define OSS_SUPPORT
#include "audio_device.h"
#include "tab_widget.h"
#define OSS_SUPPORT
class lcdSpinBox;
class QLineEdit;
class audioOSS : public audioDevice
class audioOSS : public audioDevice, public QThread
{
public:
audioOSS( Uint32 _sample_rate, bool & _success_ful );
@@ -65,15 +74,18 @@ public:
private:
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
Uint32 _frames,
float _master_output );
virtual void startProcessing( void );
virtual void stopProcessing( void );
virtual void run( void );
int m_audioFD;
bool m_convertEndian;
volatile bool m_quit;
} ;
#endif
#endif

107
include/audio_port.h Normal file
View File

@@ -0,0 +1,107 @@
/*
* audio_port.h - base-class for objects providing sound at a port
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _AUDIO_PORT_H
#define _AUDIO_PORT_H
#include "qt3support.h"
#ifdef QT4
#include <QString>
#else
#include <qstring.h>
#endif
#include "mixer.h"
#include "effect_board.h"
class audioPort
{
public:
audioPort( const QString & _name );
~audioPort();
inline surroundSampleFrame * firstBuffer( void )
{
return( m_firstBuffer );
}
inline surroundSampleFrame * secondBuffer( void )
{
return( m_secondBuffer );
}
void nextPeriod( void );
// indicate whether JACK & Co should provide output-buffer at ext. port
inline bool extOutputEnabled( void ) const
{
return( m_extOutputEnabled );
}
void FASTCALL setExtOutputEnabled( bool _enabled );
// next effect-channel after this audio-port
// (-1 = none 0 = master)
inline fxChnl nextFxChannel( void ) const
{
return( m_nextFxChannel );
}
void setNextFxChannel( fxChnl _chnl )
{
m_nextFxChannel = _chnl;
}
const QString & name( void ) const
{
return( m_name );
}
void setName( const QString & _new_name );
enum bufferUsages
{
NONE, FIRST, BOTH
} m_bufferUsage;
private:
surroundSampleFrame * m_firstBuffer;
surroundSampleFrame * m_secondBuffer;
bool m_extOutputEnabled;
fxChnl m_nextFxChannel;
QString m_name;
} ;
#endif

View File

@@ -3,8 +3,9 @@
* surround-audio-buffers into RAM, maybe later
* also harddisk
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -61,9 +62,9 @@ public:
private:
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
virtual void FASTCALL writeBuffer( surroundSampleFrame * _ab,
Uint32 _frames,
float _master_output );
float _master_gain );
typedef vvector<QPair<sampleFrame *, Uint32> > bufferVector;
bufferVector m_buffers;

View File

@@ -1,8 +1,9 @@
/*
* audio_sdl.h - device-class that performs PCM-output via SDL
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -36,18 +37,6 @@
#endif
#include "qt3support.h"
#ifdef QT4
#include <QMutex>
#else
#include <qmutex.h>
#endif
#include SDL_SDL_H
#include SDL_SDL_AUDIO_H
@@ -86,20 +75,14 @@ public:
private:
virtual void FASTCALL writeBufferToDev( surroundSampleFrame * _ab,
Uint32 _frames,
float _master_output );
void clearBuffer( void );
virtual void startProcessing( void );
virtual void stopProcessing( void );
static void sdlAudioCallback( void * _udata, Uint8 * _buf, int _len );
SDL_AudioSpec m_audioHandle;
outputSampleType * m_buffer;
QMutex m_bufMutex;
QMutex m_callbackMutex;
surroundSampleFrame * m_outBuf;
bool m_convertEndian;

View File

@@ -4,8 +4,9 @@
* original file by ???
* modified and enhanced by Tobias Doerffel, 2004
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -38,6 +39,7 @@
#include "mixer.h"
#include "templates.h"
const int MOOG_VOLTAGE = 40000;
template<Uint8 CHANNELS = DEFAULT_CHANNELS>
class basicFilters
@@ -53,10 +55,21 @@ public:
NOTCH,
ALLPASS,
MOOG,
DOUBLE_LOWPASS,
DOUBLE_MOOG
SIMPLE_FLT_CNT,
DOUBLE_LOWPASS = 16+LOWPASS,
DOUBLE_MOOG = 16+MOOG
} ;
static inline filterTypes getFilterType( const int _idx )
{
if( _idx < SIMPLE_FLT_CNT )
{
return( static_cast<filterTypes>( _idx ) );
}
return( static_cast<filterTypes>( DOUBLE_LOWPASS + _idx -
SIMPLE_FLT_CNT ) );
}
inline basicFilters( const float _sampleRate ) :
m_b0a0( 0.0f ),
m_b1a0( 0.0f ),
@@ -87,40 +100,112 @@ public:
inline sampleType update( sampleType _in0, Uint8 _chnl )
{
sampleType out;
if( m_type != MOOG )
switch( m_type )
{
// filter
out = m_b0a0*_in0 + m_b1a0*m_in1[_chnl] +
m_b2a0*m_in2[_chnl] - m_a1a0*m_ou1[_chnl] -
m_a2a0*m_ou2[_chnl];
// push in/out buffers
m_in2[_chnl] = m_in1[_chnl];
m_in1[_chnl] = _in0;
m_ou2[_chnl] = m_ou1[_chnl];
m_ou1[_chnl] = out;
}
else
{
sampleType x = _in0 - m_r*m_y4[_chnl];
case MOOG:
case DOUBLE_MOOG:
{
sampleType x = _in0 - m_r*m_y4[_chnl];
// Four cascaded onepole filters (bilinear transform)
m_y1[_chnl] = x*m_p + m_oldx[_chnl]*m_p -
// four cascaded onepole filters
// (bilinear transform)
m_y1[_chnl] = x*m_p + m_oldx[_chnl]*m_p -
m_k*m_y1[_chnl];
m_y2[_chnl] = m_y1[_chnl]*m_p+m_oldy1[_chnl]*m_p -
m_k*m_y2[_chnl];
m_y3[_chnl] = m_y2[_chnl]*m_p+m_oldy2[_chnl]*m_p -
m_k*m_y3[_chnl];
m_y4[_chnl] = m_y3[_chnl]*m_p+m_oldy3[_chnl]*m_p -
m_k*m_y4[_chnl];
m_y2[_chnl] = m_y1[_chnl]*m_p+m_oldy1[_chnl]*
m_p - m_k*m_y2[_chnl];
m_y3[_chnl] = m_y2[_chnl]*m_p+m_oldy2[_chnl]*
m_p - m_k*m_y3[_chnl];
m_y4[_chnl] = m_y3[_chnl]*m_p+m_oldy3[_chnl]*
m_p - m_k*m_y4[_chnl];
m_oldx[_chnl] = x;
m_oldy1[_chnl] = m_y1[_chnl];
m_oldy2[_chnl] = m_y2[_chnl];
m_oldy3[_chnl] = m_y3[_chnl];
out = m_y4[_chnl] - m_y4[_chnl] * m_y4[_chnl] *
m_y4[_chnl] * ( 1.0f/6.0f );
m_oldx[_chnl] = x;
m_oldy1[_chnl] = m_y1[_chnl];
m_oldy2[_chnl] = m_y2[_chnl];
m_oldy3[_chnl] = m_y3[_chnl];
out = m_y4[_chnl] - m_y4[_chnl] * m_y4[_chnl] *
m_y4[_chnl] * ( 1.0f / 6.0f );
break;
}
/* case MOOG2:
case DOUBLE_MOOG2:
{
const float x1 = ( _in0 - m_r *
m_oldx[_chnl] ) / MOOG_VOLTAGE;
const float tanh1 = tanhf( x1 );
const float x2 = m_oldy1[_chnl] / MOOG_VOLTAGE;
const float tanh2 = tanhf( x2 );
m_y1[_chnl] = m_oldy1[_chnl] + m_p *
( tanh1 - tanh2 );
m_oldy1[_chnl] = m_y1[_chnl];
m_y2[_chnl] = m_oldy2[_chnl] + m_p *
( tanhf( m_y1[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_oldy2[_chnl] /
MOOG_VOLTAGE ) );
m_oldy2[_chnl] = m_y2[_chnl];
m_y3[_chnl] = m_oldy3[_chnl] + m_p *
( tanhf( m_y2[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_oldy3[_chnl] /
MOOG_VOLTAGE ) );
m_oldy3[_chnl] = m_y3[_chnl];
m_y4[_chnl] = m_ou1[_chnl] + m_p *
( tanhf( m_y3[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_ou1[_chnl] /
MOOG_VOLTAGE ) );
m_ou1[_chnl] = m_y4[_chnl];
m_oldx[_chnl] = ( m_y4[_chnl] +
m_ou2[_chnl] ) * 0.5f;
m_ou2[_chnl] = m_y4[_chnl];
// the same code again...
m_y1[_chnl] = m_oldy1[_chnl] + m_p *
( tanh1 - tanh2 );
m_oldy1[_chnl] = m_y1[_chnl];
m_y2[_chnl] = m_oldy2[_chnl] + m_p *
( tanhf( m_y1[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_oldy2[_chnl] /
MOOG_VOLTAGE ) );
m_oldy2[_chnl] = m_y2[_chnl];
m_y3[_chnl] = m_oldy3[_chnl] + m_p *
( tanhf( m_y2[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_oldy3[_chnl] /
MOOG_VOLTAGE ) );
m_oldy3[_chnl] = m_y3[_chnl];
m_y4[_chnl] = m_ou1[_chnl] + m_p *
( tanhf( m_y3[_chnl] /
MOOG_VOLTAGE ) -
tanhf( m_ou1[_chnl] /
MOOG_VOLTAGE ) );
m_ou1[_chnl] = m_y4[_chnl];
m_oldx[_chnl] = ( m_y4[_chnl] +
m_ou2[_chnl] ) * 0.5f;
m_ou2[_chnl] = m_y4[_chnl];
out = m_oldx[_chnl];
break;
}*/
default:
// filter
out = m_b0a0*_in0 +
m_b1a0*m_in1[_chnl] +
m_b2a0*m_in2[_chnl] -
m_a1a0*m_ou1[_chnl] -
m_a2a0*m_ou2[_chnl];
// push in/out buffers
m_in2[_chnl] = m_in1[_chnl];
m_in1[_chnl] = _in0;
m_ou2[_chnl] = m_ou1[_chnl];
m_ou1[_chnl] = out;
break;
}
if( m_subFilter != NULL )
{
@@ -140,13 +225,9 @@ public:
_freq = tMax( _freq, 0.01f );// limit freq for not getting
// bad noise out of the filter...
if( m_type == MOOG || m_type == DOUBLE_MOOG )
switch( m_type )
{
const float f = 2 * _freq / m_sampleRate; // [0 - 1]
m_k = 3.6f*f - 1.6f*f*f - 1; // (Empirical tunning)
m_p = (m_k+1)*0.5f;
m_r = _q*powf( M_E, ( ( 1-m_p ) * 1.386249f ) );
if( m_type == DOUBLE_MOOG )
case DOUBLE_MOOG:
{
if( m_subFilter == NULL )
{
@@ -157,78 +238,121 @@ public:
m_subFilter->calcFilterCoeffs( MOOG, _freq,
_q );
}
}
else
{
// other filters
const float omega = 2.0f * M_PI * _freq /
m_sampleRate;
const float tsin = sinf( omega );
const float tcos = cosf( omega );
//float alpha;
//if (q_is_bandwidth)
//alpha = tsin*sinhf(logf(2.0f)/2.0f*q*omega/tsin);
//else
const float alpha = tsin / ( 2.0f*_q );
const float a0 = 1.0f / ( 1.0f+alpha );
if( m_type == LOWPASS || m_type == DOUBLE_LOWPASS )
case MOOG:
{
m_b0a0 = ((1.0f-tcos)/2.0f)*a0;
m_b1a0 = (1.0f-tcos)*a0;
m_b2a0 = m_b0a0;//((1.0f-tcos)/2.0f)*a0;
m_a1a0 = (-2.0f*tcos)*a0;
if( m_type == DOUBLE_LOWPASS )
// [ 0 - 1 ]
const float f = 2 * _freq / m_sampleRate;
// (Empirical tunning)
m_k = 3.6f*f - 1.6f*f*f - 1;
m_p = (m_k+1)*0.5f;
m_r = _q*powf( M_E, ( ( 1-m_p ) * 1.386249f ) );
break;
}
/* case DOUBLE_MOOG2:
{
if( m_subFilter == NULL )
{
if( m_subFilter == NULL )
m_subFilter =
new basicFilters<CHANNELS>(
m_sampleRate );
}
m_subFilter->calcFilterCoeffs( MOOG2, _freq,
_q );
}
case MOOG2:
{
const float kfc = 2 * _freq / m_sampleRate;
const float kf = _freq / m_sampleRate;
const float kfcr = 1.8730 * ( kfc*kfc*kfc ) +
0.4955 * ( kfc*kfc ) +
0.6490 * kfc + 0.9988;
const float kacr = -3.9364 * ( kfc*kfc ) +
1.8409 * kfc + 0.9968;
m_p = MOOG_VOLTAGE * ( 1 - expf( -2.0 * M_PI *
kfcr * kf ) );
m_r = 4 * _q * kacr;
break;
}*/
default:
{
// other filters
const float omega = 2.0f * M_PI * _freq /
m_sampleRate;
const float tsin = sinf( omega );
const float tcos = cosf( omega );
//float alpha;
//if (q_is_bandwidth)
//alpha = tsin*sinhf(logf(2.0f)/2.0f*q*omega/
// tsin);
//else
const float alpha = tsin / ( 2.0f * _q );
const float a0 = 1.0f / ( 1.0f+alpha );
if( m_type == LOWPASS ||
m_type == DOUBLE_LOWPASS )
{
m_b0a0 = ((1.0f-tcos)/2.0f)*a0;
m_b1a0 = (1.0f-tcos)*a0;
m_b2a0 = m_b0a0;//((1.0f-tcos)/2.0f)*a0;
m_a1a0 = (-2.0f*tcos)*a0;
if( m_type == DOUBLE_LOWPASS )
{
m_subFilter =
if( m_subFilter == NULL )
{
m_subFilter =
new basicFilters<CHANNELS>( m_sampleRate );
}
m_subFilter->calcFilterCoeffs( LOWPASS,
}
m_subFilter->calcFilterCoeffs(
LOWPASS,
_freq,
_q );
}
}
else if( m_type == HIPASS )
{
m_b0a0 = ((1.0f+tcos)/2.0f)*a0;
m_b1a0 = (-1.0f-tcos)*a0;
m_b2a0 = m_b0a0;//((1.0f+tcos)/2.0f)*a0;
m_a1a0 = (-2.0f*tcos)*a0;
}
else if( m_type == BANDPASS_CSG )
{
m_b0a0 = (tsin/2.0f)*a0;
m_b1a0 = 0.0f;
m_b2a0 = (-tsin/2.0f)*a0;
m_a1a0 = (-2.0f*tcos)*a0;
}
else if( m_type == BANDPASS_CZPG )
{
m_b0a0 = alpha*a0;
m_b1a0 = 0.0f;
m_b2a0 = (-alpha)*a0;
m_a1a0 = (-2.0f*tcos)*a0;
}
else if( m_type == NOTCH )
{
m_b0a0 = a0;
m_b1a0 = (-2.0f*tcos)*a0;
m_b2a0 = a0;
m_a1a0 = m_b1a0;//(-2.0f*tcos)*a0;
}
else if( m_type == ALLPASS )
{
m_b0a0 = (1.0f-alpha)*a0;
m_b1a0 = (-2.0f*tcos)*a0;
m_b2a0 = 1.0;//(1.0f+alpha)*a0;
m_a1a0 = m_b1a0;//(-2.0f*tcos)*a0;
//m_a2a0 = m_b0a0;//(1.0f-alpha)*a0;
}
m_a2a0 = (1.0f-alpha)*a0;
break;
}
else if( m_type == HIPASS )
{
m_b0a0 = ((1.0f+tcos)/2.0f)*a0;
m_b1a0 = (-1.0f-tcos)*a0;
m_b2a0 = m_b0a0;//((1.0f+tcos)/2.0f)*a0;
m_a1a0 = (-2.0f*tcos)*a0;
}
else if( m_type == BANDPASS_CSG )
{
m_b0a0 = (tsin/2.0f)*a0;
m_b1a0 = 0.0f;
m_b2a0 = (-tsin/2.0f)*a0;
m_a1a0 = (-2.0f*tcos)*a0;
}
else if( m_type == BANDPASS_CZPG )
{
m_b0a0 = alpha*a0;
m_b1a0 = 0.0f;
m_b2a0 = (-alpha)*a0;
m_a1a0 = (-2.0f*tcos)*a0;
}
else if( m_type == NOTCH )
{
m_b0a0 = a0;
m_b1a0 = (-2.0f*tcos)*a0;
m_b2a0 = a0;
m_a1a0 = m_b1a0;//(-2.0f*tcos)*a0;
}
else if( m_type == ALLPASS )
{
m_b0a0 = (1.0f-alpha)*a0;
m_b1a0 = (-2.0f*tcos)*a0;
m_b2a0 = 1.0;//(1.0f+alpha)*a0;
m_a1a0 = m_b1a0;//(-2.0f*tcos)*a0;
//m_a2a0 = m_b0a0;//(1.0f-alpha)*a0;
}
m_a2a0 = (1.0f-alpha)*a0;
}
}

View File

@@ -1,8 +1,9 @@
/*
* bb_editor.h - declaration of class bbEditor, a basic-component of LMMS
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -32,7 +33,7 @@
#include "lmms_main_win.h"
class pixmapButton;
class toolButton;
class songEditor;
class QPixmap;
@@ -81,13 +82,13 @@ public:
void FASTCALL swapBB( csize _bb1, csize _bb2 );
void updateBBTrack( trackContentObject * _tco );
protected:
void closeEvent( QCloseEvent * _ce );
void keyPressEvent (QKeyEvent * _ke);
void wheelEvent( QWheelEvent * _we );
void resizeEvent( QResizeEvent * _re );
void updateBackground( void );
virtual void closeEvent( QCloseEvent * _ce );
virtual void keyPressEvent( QKeyEvent * _ke );
virtual void resizeEvent( QResizeEvent * _re );
protected slots:
@@ -104,10 +105,11 @@ private:
static bbEditor * s_instanceOfMe;
static QPixmap * s_titleArtwork;
pixmapButton * m_playButton;
pixmapButton * m_stopButton;
QWidget * m_toolBar;
toolButton * m_playButton;
toolButton * m_stopButton;
friend class songEditor;

View File

@@ -2,8 +2,9 @@
* bb_track.h - class bbTrack, a wrapper for using bbEditor
* (which is a singleton-class) as track
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -100,7 +101,7 @@ public:
bbTrack( trackContainer * _tc );
virtual ~bbTrack();
virtual trackTypes trackType( void ) const;
virtual trackTypes type( void ) const;
virtual bool FASTCALL play( const midiTime & _start,
Uint32 _start_frame, Uint32 _frames,
Uint32 _frame_base,

View File

@@ -2,8 +2,9 @@
* buffer_allocator.h - namespace bufferAllocator providing routines for own
* optimized memory-management for audio-buffers
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -1,8 +1,9 @@
/*
* clipboard.h - the clipboard for patterns, notes etc.
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -1,8 +1,9 @@
/*
* config_mgr.h - class configManager, a class for managing LMMS-configuration
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -105,6 +106,11 @@ public:
{
return( m_lmmsDataDir + LOCALE_PATH );
}
const QString & pluginDir( void ) const
{
return( m_lmmsPluginDir );
}
const QString & value( const QString & _class,
const QString & _attribute ) const;
@@ -148,6 +154,7 @@ private:
const QString m_lmmsRcFile;
QString m_lmmsWorkingDir;
QString m_lmmsDataDir;
QString m_lmmsPluginDir;
typedef vvector<QPair<QString, QString> > stringPairVector;
typedef QMap<QString, stringPairVector> settingsMap;

79
include/cpuload_widget.h Normal file
View File

@@ -0,0 +1,79 @@
/*
* cpuload_widget.h - widget for displaying CPU-load (partly based on
* Hydrogen's CPU-load-widget)
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _CPULOAD_WIDGET_H
#define _CPULOAD_WIDGET_H
#include "qt3support.h"
#ifdef QT4
#include <QWidget>
#include <QPixmap>
#include <QTimer>
#else
#include <qwidget.h>
#include <qpixmap.h>
#include <qtimer.h>
#endif
#include "types.h"
class cpuloadWidget : public QWidget
{
Q_OBJECT
public:
cpuloadWidget( QWidget * _parent );
~cpuloadWidget();
protected:
void paintEvent( QPaintEvent * _ev );
protected slots:
void updateCpuLoad();
private:
Uint8 m_currentLoad;
QPixmap m_temp;
QPixmap m_background;
QPixmap m_leds;
bool m_changed;
QTimer m_updateTimer;
} ;
#endif

View File

@@ -1,8 +1,9 @@
/*
* debug.h - header file to be included for debugging purposes
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -0,0 +1,62 @@
/*
* dummy_instrument.h - instrument used as fallback if an instrument couldn't
* be loaded
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _DUMMY_INSTRUMENT_H
#define _DUMMY_INSTRUMENT_H
#include "instrument.h"
class dummyInstrument : public instrument
{
public:
inline dummyInstrument( channelTrack * _channel_track ) :
instrument( _channel_track, "Dummy instrument" )
{
}
inline virtual ~dummyInstrument()
{
}
inline virtual void saveSettings( QDomDocument &, QDomElement & )
{
}
inline virtual void loadSettings( const QDomElement & )
{
}
inline virtual QString nodeName( void ) const
{
return( "dummyinstrument" );
}
} ;
#endif

62
include/dummy_plugin.h Normal file
View File

@@ -0,0 +1,62 @@
/*
* dummy_plugin.h - empty plugin which is used as fallback if a plugin wasn't
* found
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _DUMMY_PLUGIN_H
#define _DUMMY_PLUGIN_H
#include "plugin.h"
class dummyPlugin : public plugin
{
public:
inline dummyPlugin( void ) :
plugin( "Dummy plugin", plugin::UNDEFINED )
{
}
inline virtual ~dummyPlugin()
{
}
inline virtual void saveSettings( QDomDocument &, QDomElement & )
{
}
inline virtual void loadSettings( const QDomElement & )
{
}
inline virtual QString nodeName( void ) const
{
return( "dummyplugin" );
}
} ;
#endif

View File

@@ -1,8 +1,9 @@
/*
* effect_board.h - stuff for effect-board
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -24,8 +25,12 @@
#ifndef _EFFECT_BOARD_H
#define _EFFECT_BOARD_H
const int MIN_EFFECT_CHANNEL = 0;
const int MAX_EFFECT_CHANNEL = 63;
const int DEFAULT_EFFECT_CHANNEL = (MIN_EFFECT_CHANNEL);
const int DEFAULT_EFFECT_CHANNEL = MIN_EFFECT_CHANNEL;
typedef Sint8 fxChnl;
#endif

View File

@@ -1,8 +1,9 @@
/*
* embed.h - misc. stuff for using embedded data (resources linked into binary)
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -42,10 +43,31 @@
namespace embed
{
struct descriptor
{
int size;
const unsigned char * data;
const char * name;
} ;
QPixmap getIconPixmap( const char * _name, int _w = -1, int _h = -1 );
QString getText( const char * _name );
void loadTranslation( const QString & _tname );
}
#ifdef PLUGIN_NAME
namespace PLUGIN_NAME
{
QPixmap getIconPixmap( const char * _name, int _w = -1, int _h = -1 );
QString getText( const char * _name );
void loadTranslation( const QString & _tname );
}
#endif
#endif

View File

@@ -1,8 +1,9 @@
/*
* endian.h - handle endianess-problems
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -3,8 +3,9 @@
* is used by envelope/lfo/filter-tab of
* channel-window
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -47,14 +48,18 @@
#include "settings.h"
#include "types.h"
#include "spc_bg_hndl_widget.h"
#include "sample_buffer.h"
class envelopeTabWidget;
class pixmapButton;
class knob;
class QPaintEvent;
class QPixmap;
class envelopeTabWidget;
class knob;
class ledCheckBox;
class pixmapButton;
class tempoSyncKnob;
class envelopeAndLFOWidget : public QWidget, public settings,
@@ -95,8 +100,10 @@ public slots:
protected:
void paintEvent( QPaintEvent * _pe );
void mousePressEvent( QMouseEvent * _me );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
float FASTCALL lfoLevel( Uint32 _frame, Uint32 _frame_offset ) const;
@@ -107,10 +114,14 @@ protected slots:
void lfoTriangleWaveCh( bool );
void lfoSawWaveCh( bool );
void lfoSquareWaveCh( bool );
void lfoUserWaveCh( bool );
void x100Toggled( bool );
private:
static QPixmap * s_envGraph;
static QPixmap * s_lfoGraph;
static Uint32 s_lfoFrame;
bool m_used;
@@ -123,7 +134,6 @@ private:
knob * m_sustainKnob;
knob * m_releaseKnob;
knob * m_amountKnob;
static QPixmap * s_envGraph;
float m_sustainLevel;
float m_amount;
@@ -137,16 +147,16 @@ private:
// LFO-stuff
knob * m_lfoPredelayKnob;
knob * m_lfoAttackKnob;
knob * m_lfoSpeedKnob;
tempoSyncKnob * m_lfoSpeedKnob;
knob * m_lfoAmountKnob;
pixmapButton * m_sinLfoBtn;
pixmapButton * m_triangleLfoBtn;
pixmapButton * m_sawLfoBtn;
pixmapButton * m_sqrLfoBtn;
static QPixmap * s_lfoGraph;
pixmapButton * m_usrLfoBtn;
pixmapButton * m_x100Btn;
pixmapButton * m_controlEnvAmountBtn;
ledCheckBox * m_x100Cb;
ledCheckBox * m_controlEnvAmountCb;
Uint32 m_lfoPredelayFrames;
Uint32 m_lfoAttackFrames;
@@ -154,13 +164,15 @@ private:
float m_lfoAmount;
bool m_lfoAmountIsZero;
float * m_lfoShapeData;
sampleBuffer m_userWave;
enum lfoShapes
{
SIN,
TRIANGLE,
SAW,
SQUARE
SQUARE,
USER
} m_lfoShape;
volatile bool m_busy;

View File

@@ -3,8 +3,9 @@
* provides UI- and DSP-code for using envelopes, LFOs
* and a filter
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -59,8 +60,8 @@ class envelopeTabWidget : public QWidget, public settings
{
Q_OBJECT
public:
envelopeTabWidget( channelTrack * _channel_track, QWidget * parent );
~envelopeTabWidget();
envelopeTabWidget( channelTrack * _channel_track );
virtual ~envelopeTabWidget();
void FASTCALL processAudioBuffer( sampleFrame * _ab, Uint32 _frames,
notePlayHandle * _n );
@@ -91,8 +92,6 @@ public:
private:
channelTrack * m_channelTrack;
tabWidget * m_targetsTabWidget;
envelopeAndLFOWidget * m_envLFOWidgets[TARGET_COUNT];

View File

@@ -1,8 +1,9 @@
/*
* export.h - header which is needed for song-export
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -26,10 +27,11 @@
#include "types.h"
class audioDevice;
class audioFileDevice;
typedef audioDevice * ( * getDeviceInst)( Uint32 _sample_rate,
typedef audioFileDevice * ( * getDeviceInst)( Uint32 _sample_rate,
Uint32 _channels,
bool & _success_ful,
const QString & _file,
@@ -47,6 +49,7 @@ enum fileTypes
} ;
struct fileEncodeDevice
{
fileTypes m_fileType;
@@ -55,6 +58,7 @@ struct fileEncodeDevice
getDeviceInst m_getDevInst;
} ;
extern fileEncodeDevice fileEncodeDevices[];

View File

@@ -2,8 +2,9 @@
* export_project_dialog.h - declaration of class exportProjectDialog which is
* responsible for exporting project
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -61,7 +62,6 @@ class exportProjectDialog : public QDialog
public:
exportProjectDialog( const QString & _file_name, QWidget * _parent );
~exportProjectDialog();
void FASTCALL updateProgressBar( int _new_val );
public slots:
@@ -76,10 +76,16 @@ protected:
private slots:
void changedType( const QString & );
void cancelBtnClicked( void );
void redrawProgressBar( void );
private:
void finishProjectExport( void );
void abortProjectExport( void );
static fileTypes FASTCALL getFileTypeFromExtension( const QString &
_ext );
static Sint16 s_availableBitrates[];
QString m_fileName;
QLabel * m_typeLbl;
QComboBox * m_typeCombo;
@@ -91,20 +97,9 @@ private:
QPushButton * m_exportBtn;
QPushButton * m_cancelBtn;
QProgressBar * m_exportProgressBar;
fileTypes m_fileType;
bool m_deleteFile;
int m_oldProgressVal;
int m_progressVal;
QTimer * m_progressBarUpdateTimer;
static Sint16 s_availableBitrates[];
void finishProjectExport( void );
void abortProjectExport( void );
static fileTypes FASTCALL getFileTypeFromExtension( const QString &
_ext );
} ;

219
include/file_browser.h Normal file
View File

@@ -0,0 +1,219 @@
/*
* file_browser.h - include file for fileBrowser
*
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _FILE_BROWSER_H
#define _FILE_BROWSER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QDir>
#else
#include <qlistview.h>
#include <qdir.h>
#endif
#include "side_bar_widget.h"
class fileItem;
class listView;
class playHandle;
class QPixmap;
class trackContainer;
class fileBrowser : public sideBarWidget
{
Q_OBJECT
public:
fileBrowser( const QString & _path, const QString & _filter,
const QString & _title, const QPixmap & _pm,
QWidget * _parent );
virtual ~fileBrowser();
public slots:
void reloadTree( void );
protected slots:
#ifdef QT4
void contextMenuRequest( Q3ListViewItem * _i, const QPoint & _pos,
int _col );
#else
void contextMenuRequest( QListViewItem * _i, const QPoint & _pos,
int _col );
#endif
void sendToActiveChannel( void );
void openInNewChannelSE( void );
void openInNewChannelBBE( void );
private:
virtual void keyPressEvent( QKeyEvent * _ke );
void openInNewChannel( trackContainer * _tc );
listView * m_l;
fileItem * m_contextMenuItem;
QString m_path;
QString m_filter;
} ;
class listView : public Q3ListView
{
Q_OBJECT
public:
listView( QWidget * _parent );
~listView();
protected:
virtual void contentsMouseDoubleClickEvent( QMouseEvent * _me );
virtual void contentsMousePressEvent( QMouseEvent * _me );
virtual void contentsMouseMoveEvent( QMouseEvent * _me );
virtual void contentsMouseReleaseEvent( QMouseEvent * _me );
private:
bool m_mousePressed;
QPoint m_pressPos;
playHandle * m_previewPlayHandle;
} ;
class directory : public Q3ListViewItem
{
public:
directory( Q3ListView * _parent, const QString & _filename,
const QString & _path, const QString & _filter );
directory( directory * _parent, const QString & _filename,
const QString & _path, const QString & _filter );
void setOpen( bool );
void setup( void );
inline QString fullName( void )
{
#ifdef QT4
return( QDir::cleanPath( m_path + "/" + text( 0 ) + "/" ) );
#else
return( QDir::cleanDirPath( m_path + "/" + text( 0 ) + "/" ) );
#endif
}
inline const QPixmap * pixmap( int ) const
{
return( m_pix );
}
private:
void initPixmapStuff( void );
//using Q3ListViewItem::setPixmap;
void FASTCALL setPixmap( QPixmap * _px );
static QPixmap * s_folderPixmap;
static QPixmap * s_folderOpenedPixmap;
static QPixmap * s_folderLockedPixmap;
directory * m_p;
QPixmap * m_pix;
QString m_path;
QString m_filter;
} ;
class fileItem : public Q3ListViewItem
{
public:
fileItem( Q3ListView * _parent, const QString & _name,
const QString & _path );
fileItem( Q3ListViewItem * _parent, const QString & _name,
const QString & _path );
inline QString fullName( void ) const
{
return( m_path + "/" + text( 0 ) );
}
inline const QPixmap * pixmap( int ) const
{
return( m_pix );
}
enum fileTypes
{
PROJECT_FILE, PRESET_FILE, SAMPLE_FILE, MIDI_FILE, UNKNOWN
} ;
inline fileTypes type( void )
{
return( m_type );
}
private:
void initPixmapStuff( void );
void determineFileType( void );
static QPixmap * s_projectFilePixmap;
static QPixmap * s_presetFilePixmap;
static QPixmap * s_sampleFilePixmap;
static QPixmap * s_midiFilePixmap;
static QPixmap * s_unknownFilePixmap;
QPixmap * m_pix;
QString m_path;
fileTypes m_type;
} ;
#endif

View File

@@ -1,8 +1,9 @@
/*
* group_box.h - LMMS-groupbox
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

64
include/gui_templates.h Normal file
View File

@@ -0,0 +1,64 @@
/*
* gui_templates.h - GUI-specific templates
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _GUI_TEMPLATES_H
#define _GUI_TEMPLATES_H
#include "qt3support.h"
#ifdef QT4
#include <QApplication>
#include <QFont>
#include <QDesktopWidget>
#else
#include <qpaintdevicemetrics.h>
#include <qfont.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#endif
// return DPI-independent font-size - font with returned font-size has always
// the same size in pixels
template<int SIZE>
inline QFont pointSize( QFont _f )
{
static const int DPI = 96;
#ifdef QT4
_f.setPointSizeF( SIZE * DPI /
QApplication::desktop()->logicalDpiY() );
#else
_f.setPointSizeFloat( SIZE * DPI /
QPaintDeviceMetrics( qApp->desktop() ).logicalDpiY() );
#endif
return( _f );
}
#endif

123
include/instrument.h Normal file
View File

@@ -0,0 +1,123 @@
/*
* instrument.h - declaration of class instrument, which provides a
* standard interface for all instrument plugins
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _INSTRUMENT_H
#define _INSTRUMENT_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QWidget>
#include <QVector>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#endif
#include "plugin.h"
#include "mixer.h"
// forward-declarations
class channelTrack;
class notePlayHandle;
class instrument : public QWidget, public plugin
{
public:
instrument( channelTrack * _channel_track, const QString & _name );
virtual ~instrument();
// if the plugin doesn't play each note, it can create an instrument-
// play-handle and re-implement this method, so that it mixes it's
// output buffer only once per mixer-period
virtual void play( void );
// must be overloaded by actual plugin
virtual void FASTCALL playNote( notePlayHandle * note_to_play );
// needed for deleting plugin-specific-data of a note - plugin has to
// cast void-ptr so that the plugin-data is deleted properly
// (call of dtor if it's a class etc.)
virtual void FASTCALL deleteNotePluginData( notePlayHandle *
_note_to_play );
// Get number of sample-frames that should be used when playing beat
// (note with unspecified length)
// Per default this function returns 0. In this case, channel is using
// the length of the longest envelope (if one active).
virtual Uint32 FASTCALL beatLen( notePlayHandle * _n ) const;
// instrument-play-handles use this for checking whether they can mark
// themselves as done, so that mixer trashes them
inline virtual bool valid( void ) const
{
return( m_valid );
}
// instantiate instrument-plugin with given name or return NULL
// on failure
static instrument * FASTCALL instantiate( const QString & _plugin_name,
channelTrack * _channel_track );
protected:
inline channelTrack * getChannelTrack( void ) const
{
return( m_channelTrack );
}
// instruments can use this for invalidating themselves, which is for
// example neccessary when being destroyed and having instrument-play-
// handles running
inline void invalidate( void )
{
m_valid = FALSE;
mixer::inst()->checkValidityOfPlayHandles();
}
private:
channelTrack * m_channelTrack;
bool m_valid;
} ;
#endif

View File

@@ -0,0 +1,75 @@
/*
* instrument_play_handle.h - play-handle for playing an instrument
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _INSTRUMENT_PLAY_HANDLE_H
#define _INSTRUMENT_PLAY_HANDLE_H
#include "play_handle.h"
#include "instrument.h"
class instrumentPlayHandle : public playHandle
{
public:
inline instrumentPlayHandle( instrument * _instrument ) :
playHandle(),
m_instrument( _instrument )
{
}
inline virtual ~instrumentPlayHandle()
{
}
inline virtual void play( void )
{
if( m_instrument != NULL )
{
m_instrument->play();
}
}
inline virtual bool done( void ) const
{
return( m_instrument == NULL );
}
inline virtual void checkValidity( void )
{
if( m_instrument != NULL && !m_instrument->valid() )
{
m_instrument = NULL;
}
}
private:
instrument * m_instrument;
} ;
#endif

View File

@@ -1,8 +1,9 @@
/*
* interpolation.h - fast implementations of several interpolation-algorithms
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -34,7 +34,6 @@ class KMultiTabBarTab;
#include <QWidget>
#include <QMenu>
//#include <QVBoxWidget>
#include <QString>
#include <QBoxLayout>
#include <QList>

View File

@@ -1,10 +1,12 @@
/*
* knob.h - powerful knob-widget
*
* This file is based on the knob-widget of the Qwt Widget Library by Josef Wilgen
* This file is based on the knob-widget of the Qwt Widget Library by
* Josef Wilgen
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -42,9 +44,6 @@
#endif
#include "templates.h"
class QPixmap;
class textFloat;
@@ -63,16 +62,7 @@ public:
knob( int _knob_num, QWidget * _parent, const QString & _name );
virtual ~knob();
enum ScrollMode
{
ScrNone,
ScrMouse,
ScrTimer,
ScrDirect,
ScrPage
} ;
void setTracking( bool _enable );
void setHintText( const QString & _txt_before,
const QString & _txt_after );
void setLabel( const QString & _txt );
@@ -112,6 +102,7 @@ public slots:
void reset( void );
void copyValue( void );
void pasteValue( void );
void enterValue( void );
void connectToMidiDevice( void );
void displayHelp( void );
@@ -124,23 +115,27 @@ signals:
protected:
virtual void paintEvent( QPaintEvent * _me );
virtual void resizeEvent( QResizeEvent * _me );
virtual void contextMenuEvent( QContextMenuEvent * _me );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _me );
virtual void resizeEvent( QResizeEvent * _me );
virtual void wheelEvent( QWheelEvent * _me );
virtual void contextMenuEvent( QContextMenuEvent * _me );
void drawKnob( QPainter * _p );
void setPosition( const QPoint & _p );
private:
// TODO: Need to figure out what is really used by tempoSyncKnob
// to get the private/protected attributes sorted out. Right
// now, just make everything protected.
//private:
void layoutKnob( bool _update = TRUE );
float getValue( const QPoint & _p );
void getScrollMode( const QPoint & _p, int & _scroll_mode,
int & _direction );
void recalcAngle( void );
void valueChange( void );
@@ -149,25 +144,20 @@ private:
void buttonReleased( void );
void setNewValue( float x, int align = 0 );
void setNewValue( float _x, bool _align = FALSE );
static float s_copiedValue;
static textFloat * s_textFloat;
int m_knobWidth;
int m_scrollMode;
float m_mouseOffset;
int m_direction;
int m_tracking;
QPoint m_origMousePos;
bool m_buttonPressed;
float m_angle;
float m_oldAngle;
float m_totalAngle;
float m_nTurns;
QPixmap * m_knobPixmap;
int m_knobNum;

345
include/ladspa_manager.h Normal file
View File

@@ -0,0 +1,345 @@
/*
* ladspa_manager.h - declaration of class ladspaManager
* a class to manage loading and instantiation
* of ladspa plugins
*
* Copyright (c) 2005 Danny McRae <khjklujn@netscape.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _LADSPA_MANAGER_H
#define _LADSPA_MANAGER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_LADSPA_H
#define LADSPA_SUPPORT
#include <ladspa.h>
#include "qt3support.h"
#ifdef QT4
#include <QString>
#include <QStringList>
#include <QMap>
#include <QPair>
#else
#include <qstring.h>
#include <qstringlist.h>
#include <qmap.h>
#include <qpair.h>
#endif
#include "types.h"
typedef QPair<QString, QString> ladspaKey;
/* ladspaManager provides a database of LADSPA plug-ins. Upon instantiation,
it loads all of the plug-ins found in the LADSPA_PATH environmental variable
and stores their access descriptors according in a dictionary keyed on
the filename the plug-in was loaded from and the label of the plug-in.
The can be retrieved by using ladspaKey. For example, to get the
"Phase Modulated Voice" plug-in from the cmt library, you would perform the
calls using:
ladspaKey( "cmt.so", "phasemod" )
as the plug-in key. */
class ladspaManager
{
public:
/* Provides access to the single instance of the class. */
static inline ladspaManager * inst( void )
{
if( s_instanceOfMe == NULL )
{
s_instanceOfMe = new ladspaManager();
}
return( s_instanceOfMe );
}
/* This identifier can be used as a unique, case-sensitive
identifier for the plugin type within the plugin file. Plugin
types should be identified by file and label rather than by index
or plugin name, which may be changed in new plugin
versions. Labels must not contain white-space characters. */
QString FASTCALL getLabel( const ladspaKey & _plugin );
/* Indicates that the plugin has a real-time dependency
(e.g. listens to a MIDI device) and so its output must not
be cached or subject to significant latency. */
bool FASTCALL hasRealTimeDependency( const ladspaKey & _plugin );
/* Indicates that the plugin may cease to work correctly if the
host elects to use the same data location for both input and output
(see connectPort). */
bool FASTCALL isInplaceBroken( const ladspaKey & _plugin );
/* Indicates that the plugin is capable of running not only in a
conventional host but also in a 'hard real-time' environment. */
bool FASTCALL isRealTimeCapable( const ladspaKey & _plugin );
/* Returns the name of the plug-in */
QString FASTCALL getName( const ladspaKey & _plugin );
/* Returns the the plug-in's author */
QString FASTCALL getMaker( const ladspaKey & _plugin );
/* Returns the copyright for the plug-in */
QString FASTCALL getCopyright( const ladspaKey & _plugin );
/* This indicates the number of ports (input AND output) present on
the plugin. */
Uint32 FASTCALL getPortCount( const ladspaKey & _plugin );
/* Indicates that the port is an input. */
bool FASTCALL isPortInput( const ladspaKey & _plugin, Uint32 _port );
/* Indicates that the port is an output. */
bool FASTCALL isPortOutput( const ladspaKey & _plugin, Uint32 _port );
/* Indicates that the port is an audio. */
bool FASTCALL isPortAudio( const ladspaKey & _plugin, Uint32 _port );
/* Indicates that the port is an control. */
bool FASTCALL isPortControl( const ladspaKey & _plugin, Uint32 _port );
/* Indicates that any bounds specified should be interpreted as
multiples of the sample rate. For instance, a frequency range from
0Hz to the Nyquist frequency (half the sample rate) could be requested
by this hint in conjunction with LowerBound = 0 and UpperBound = 0.5.
Hosts that support bounds at all must support this hint to retain
meaning. */
bool FASTCALL areHintsSampleRateDependent( const ladspaKey & _plugin,
Uint32 _port );
/* Returns the lower boundary value for the given port. If
no lower bound is provided by the plug-in, returns -999e-99. When
areHintsSampleRateDependent() is also true then this value should be
multiplied by the relevant sample rate. */
float FASTCALL getLowerBound( const ladspaKey & _plugin, Uint32 _port );
/* Returns the upper boundary value for the given port. If
no upper bound is provided by the plug-in, returns -999e-99. When
areHintsSampleRateDependent() is also true then this value should be
multiplied by the relevant sample rate. */
float FASTCALL getUpperBound( const ladspaKey & _plugin, Uint32 _port );
/* Indicates whether the given port should be considered 0 or 1
boolean switch. */
bool FASTCALL isPortToggled( const ladspaKey & _plugin, Uint32 _port );
/* Retrieves any default setting hints offered by the plug-in for
the given port. */
float FASTCALL getDefaultSetting( const ladspaKey & _plugin,
Uint32 _port );
/* Indicates that it is likely that the user will find it more
intuitive to view values using a logarithmic scale. This is
particularly useful for frequencies and gains. */
bool FASTCALL isLogarithmic( const ladspaKey & _plugin, Uint32 _port );
/* Indicates that a user interface would probably wish to provide a
stepped control taking only integer values. Any bounds set should be
slightly wider than the actual integer range required to avoid floating
point rounding errors. For instance, the integer set {0,1,2,3} might
be described as [-0.1, 3.1]. */
bool FASTCALL isInteger( const ladspaKey & _plugin, Uint32 _port );
/* Returns the name of the port. */
QString FASTCALL getPortName( const ladspaKey & _plugin, Uint32 _port );
/* This may be used by the plugin developer to pass any custom
implementation data into an instantiate call. It must not be used
or interpreted by the host. It is expected that most plugin
writers will not use this facility as LADSPA_Handle should be
used to hold instance data. */
const void * FASTCALL getImplementationData(
const ladspaKey & _plugin );
/* Returns a pointer to the plug-in's descriptor from which control
of the plug-in is accessible */
const LADSPA_Descriptor * FASTCALL getDescriptor(
const ladspaKey & _plugin );
/* The following methods are convenience functions for use during
development. A real instrument should use the getDescriptor()
method and implement the plug-in manipulations internally to avoid
the overhead associated with QMap lookups. */
/* Returns a handle to an instantiation of the given plug-in. */
LADSPA_Handle FASTCALL instantiate( const ladspaKey & _plugin,
Uint32 _sample_rate );
/* This method calls a function pointer that connects a port on an
instantiated plugin to a memory location at which a block of data
for the port will be read/written. The data location is expected
to be an array of LADSPA_Data for audio ports or a single
LADSPA_Data value for control ports. Memory issues will be
managed by the host. The plugin must read/write the data at these
locations every time run() or runAdding() is called and the data
present at the time of this connection call should not be
considered meaningful.
connectPort() may be called more than once for a plugin instance
to allow the host to change the buffers that the plugin is
reading or writing. These calls may be made before or after
activate() or deactivate() calls.
connectPort() must be called at least once for each port before
run() or runAdding() is called. */
void FASTCALL connectPort( const ladspaKey & _plugin,
LADSPA_Handle _instance,
Uint32 _port,
LADSPA_Data * _data_location );
/* This method calls a function pointer that initialises a plugin
instance and activates it for use. This is separated from
instantiate() to aid real-time support and so that hosts can
reinitialise a plugin instance by calling deactivate() and then
activate(). In this case the plugin instance must reset all state
information dependent on the history of the plugin instance
except for any data locations provided by connectPort() and any
gain set by setRunAddingGain(). If there is nothing for
activate() to do then the plugin writer may provide a NULL rather
than an empty function.
When present, hosts must call this function once before run() (or
runAdding()) is called for the first time. This call should be
made as close to the run() call as possible and indicates to
real-time plugins that they are now live. Plugins should not rely
on a prompt call to run() after activate(). activate() may not be
called again unless deactivate() is called first. Note that
connectPort() may be called before or after a call to
activate(). */
void FASTCALL activate( const ladspaKey & _plugin,
LADSPA_Handle _instance );
/* This method calls a function pointer that runs an instance of a
plugin for a block. Two parameters are required: the first is a
handle to the particular instance to be run and the second
indicates the block size (in samples) for which the plugin
instance may run.
Note that if an activate() function exists then it must be called
before run() or run_adding(). If deactivate() is called for a
plugin instance then the plugin instance may not be reused until
activate() has been called again. */
void FASTCALL run( const ladspaKey & _plugin, LADSPA_Handle _instance,
Uint32 _sample_count );
/* This method calls a function pointer that runs an instance of a
plugin for a block. This has identical behaviour to run() except
in the way data is output from the plugin. When run() is used,
values are written directly to the memory areas associated with
the output ports. However when runAdding() is called, values
must be added to the values already present in the memory
areas. Furthermore, output values written must be scaled by the
current gain set by setRunAddingGain() (see below) before
addition.
runAdding() is optional. When it is not provided by a plugin,
this function pointer must be set to NULL. When it is provided,
the function setRunAddingGain() must be provided also. */
void FASTCALL runAdding( const ladspaKey & _plugin,
LADSPA_Handle _instance,
Uint32 _sample_count );
/* This method calls a function pointer that sets the output gain for
use when runAdding() is called (see above). If this function is
never called the gain is assumed to default to 1. Gain
information should be retained when activate() or deactivate()
are called.
This function should be provided by the plugin if and only if the
runAdding() function is provided. When it is absent this
function pointer must be set to NULL. */
void FASTCALL setRunAddingGain( const ladspaKey & _plugin,
LADSPA_Handle _instance,
LADSPA_Data _gain );
/* This is the counterpart to activate() (see above). If there is
nothing for deactivate() to do then the plugin writer may provide
a NULL rather than an empty function.
Hosts must deactivate all activated units after they have been
run() (or run_adding()) for the last time. This call should be
made as close to the last run() call as possible and indicates to
real-time plugins that they are no longer live. Plugins should
not rely on prompt deactivation. Note that connect_port() may be
called before or after a call to deactivate().
Deactivation is not similar to pausing as the plugin instance
will be reinitialised when activate() is called to reuse it. */
void FASTCALL deactivate( const ladspaKey & _plugin,
LADSPA_Handle _instance );
/* Once an instance of a plugin has been finished with it can be
deleted using the following function. The instance handle passed
ceases to be valid after this call.
If activate() was called for a plugin instance then a
corresponding call to deactivate() must be made before cleanup()
is called. */
void FASTCALL cleanup( const ladspaKey & _plugin,
LADSPA_Handle _instance );
private:
void FASTCALL addPlugins( LADSPA_Descriptor_Function _descriptor_func,
const QString & _file );
ladspaManager( void );
~ladspaManager();
static ladspaManager * s_instanceOfMe;
typedef struct ladspaManagerStorage
{
LADSPA_Descriptor_Function descriptorFunction;
Uint32 index;
} ladspaManagerDescription;
typedef QMap<ladspaKey, ladspaManagerDescription *> ladspaManagerMapType;
ladspaManagerMapType m_ladspaManagerMap;
} ;
#endif
#endif

View File

@@ -1,8 +1,9 @@
/*
* lcd_spinbox.h - class lcdSpinBox, an improved QLCDNumber
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -30,14 +31,18 @@
#ifdef QT4
#include <QLCDNumber>
#include <QMap>
#else
#include <qlcdnumber.h>
#include <qmap.h>
#endif
class QLabel;
class lcdSpinBox : public QWidget
{
@@ -56,6 +61,15 @@ public:
void setValue( int _value );
void setLabel( const QString & _txt );
inline void addTextForValue( int _val, const QString & _text )
{
m_textForValue[_val] = _text;
}
public slots:
virtual void setEnabled( bool _on );
protected:
virtual void mousePressEvent( QMouseEvent * _me );
@@ -65,6 +79,8 @@ protected:
private:
QMap<int, QString> m_textForValue;
int m_value;
int m_minValue;
int m_maxValue;

View File

@@ -1,8 +1,9 @@
/*
* led_checkbox.h - class ledCheckBox, an improved QCheckBox
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -29,11 +30,11 @@
#ifdef QT4
#include <QCheckBox>
#include <QWidget>
#else
#include <qcheckbox.h>
#include <qwidget.h>
#endif
@@ -41,8 +42,9 @@
class QPixmap;
class ledCheckBox : public QCheckBox
class ledCheckBox : public QWidget
{
Q_OBJECT
public:
enum ledColors
{
@@ -54,13 +56,36 @@ public:
virtual ~ledCheckBox();
inline bool isChecked( void ) const
{
return( m_checked );
}
inline const QString & text( void )
{
return( m_text );
}
public slots:
void toggle( void );
void setChecked( bool _on );
protected:
virtual void paintEvent( QPaintEvent * _pe );
virtual void mousePressEvent( QMouseEvent * _me );
private:
QPixmap * m_ledOnPixmap;
QPixmap * m_ledOffPixmap;
bool m_checked;
QString m_text;
signals:
void toggled( bool );
} ;

View File

@@ -1,8 +1,9 @@
/*
* midi.h - constants, structs etc. concerning MIDI
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -61,11 +62,13 @@ enum midiEventTypes
} ;
const Sint8 MIDI_CHANNEL_COUNT = 16;
struct midiEvent
{
midiEvent( midiEventTypes _type = MIDI_ACTIVE_SENSING,
Uint8 _channel = 0,
Sint8 _channel = 0,
Uint16 _param1 = 0,
Uint16 _param2 = 0 ) :
m_type( _type ),
@@ -75,7 +78,8 @@ struct midiEvent
m_data.m_param[0] = _param1;
m_data.m_param[1] = _param2;
}
midiEvent( midiEventTypes _type, char * _sysex_data, int _data_len ) :
midiEvent( midiEventTypes _type, const char * _sysex_data,
int _data_len ) :
m_type( _type ),
m_channel( 0 ),
m_sysExData( _sysex_data )
@@ -92,14 +96,14 @@ struct midiEvent
}
midiEventTypes m_type; // MIDI event type
Uint8 m_channel; // MIDI channel
Sint8 m_channel; // MIDI channel
union
{
Uint16 m_param[2]; // first/second parameter (key/velocity)
int m_sysExDataLen; // len of m_sysExData
Uint32 m_sysExDataLen; // len of m_sysExData
} m_data;
char * m_sysExData;
const char * m_sysExData;
} ;

View File

@@ -1,8 +1,9 @@
/*
* midi_alsa_raw.h - midi-device-driver for RawMIDI via ALSA
* midi_alsa_raw.h - midi-client for RawMIDI via ALSA
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -50,17 +51,17 @@
#endif
#include "midi_device.h"
#include "midi_client.h"
struct pollfd;
class QLineEdit;
class midiALSARaw : public midiDevice, public QThread
class midiALSARaw : public midiClientRaw, public QThread
{
public:
midiALSARaw( channelTrack * _ct = NULL );
midiALSARaw( void );
~midiALSARaw();
static QString probeDevice( void );
@@ -73,7 +74,7 @@ public:
}
class setupWidget : public midiDevice::setupWidget
class setupWidget : public midiClientRaw::setupWidget
{
public:
setupWidget( QWidget * _parent );
@@ -88,8 +89,8 @@ public:
protected:
virtual void FASTCALL sendByte( Uint8 _c );
virtual void FASTCALL run( void );
virtual void FASTCALL sendByte( const Uint8 _c );
virtual void run( void );
private:

180
include/midi_alsa_seq.h Normal file
View File

@@ -0,0 +1,180 @@
/*
* midi_alsa_seq.h - ALSA-sequencer-client
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _MIDI_ALSA_SEQ_H
#define _MIDI_ALSA_SEQ_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef HAVE_ALSA_ASOUNDLIB_H
#ifndef ALSA_SUPPORT
#define ALSA_SUPPORT
#endif
#include <alsa/asoundlib.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QThread>
#include <QTimer>
#else
#include <qobject.h>
#include <qthread.h>
#include <qtimer.h>
#endif
#include "midi_client.h"
struct pollfd;
class QLineEdit;
class midiALSASeq :
#ifndef QT4
public QObject,
#endif
public midiClient, public QThread
{
Q_OBJECT
public:
midiALSASeq( void );
~midiALSASeq();
static QString probeDevice( void );
inline static QString name( void )
{
return( setupWidget::tr( "ALSA-Sequencer (Advanced Linux Sound "
"Architecture)" ) );
}
virtual void FASTCALL processOutEvent( const midiEvent & _me,
const midiTime & _time,
const midiPort * _port );
virtual void FASTCALL applyPortMode( midiPort * _port );
virtual void FASTCALL applyPortName( midiPort * _port );
virtual void FASTCALL removePort( midiPort * _port );
// list seq-ports from ALSA
inline virtual const QStringList & readablePorts( void ) const
{
return( m_readablePorts );
}
virtual const QStringList & writeablePorts( void ) const
{
return( m_writeablePorts );
}
// (un)subscribe given midiPort to/from destination-port
virtual void subscribeReadablePort( midiPort * _port,
const QString & _dest,
bool _unsubscribe = FALSE );
virtual void subscribeWriteablePort( midiPort * _port,
const QString & _dest,
bool _unsubscribe = FALSE );
virtual void connectRPChanged( QObject * _receiver,
const char * _member )
{
connect( this, SIGNAL( readablePortsChanged() ),
_receiver, _member );
}
virtual void connectWPChanged( QObject * _receiver,
const char * _member )
{
connect( this, SIGNAL( writeablePortsChanged() ),
_receiver, _member );
}
class setupWidget : public midiClient::setupWidget
{
public:
setupWidget( QWidget * _parent );
virtual ~setupWidget();
virtual void saveSettings( void );
private:
QLineEdit * m_device;
} ;
private slots:
void changeQueueTempo( int _bpm );
void updatePortList( void );
private:
virtual void run( void );
#ifdef ALSA_SUPPORT
snd_seq_t * m_seqHandle;
struct ports
{
ports() { p[0] = -1; p[1] = -1; }
int & operator[]( const int _i ) { return( p[_i] ); }
private: int p[2];
} ;
QMap<midiPort *, ports> m_portIDs;
int m_queueID;
volatile bool m_quit;
#endif
QTimer m_portListUpdateTimer;
QStringList m_readablePorts;
QStringList m_writeablePorts;
signals:
void readablePortsChanged( void );
void writeablePortsChanged( void );
} ;
#endif

197
include/midi_client.h Normal file
View File

@@ -0,0 +1,197 @@
/*
* midi_client.h - base-class for MIDI-clients like ALSA-sequencer-client
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _MIDI_CLIENT_H
#define _MIDI_CLIENT_H
#include "qt3support.h"
#ifdef QT4
#include <QVector>
#include <QStringList>
#else
#include <qvaluevector.h>
#include <qstringlist.h>
#endif
#include "midi.h"
#include "midi_event_processor.h"
#include "tab_widget.h"
class midiPort;
// base-class for all MIDI-clients
class midiClient
{
public:
midiClient( void );
virtual ~midiClient();
// to be implemented by sub-classes
virtual void FASTCALL processOutEvent( const midiEvent & _me,
const midiTime & _time,
const midiPort * _port ) = 0;
// inheriting classes can re-implement this for being able to update
// their internal port-structures etc.
virtual void FASTCALL applyPortMode( midiPort * _port );
virtual void FASTCALL applyPortName( midiPort * _port );
// inheriting classes can re-implement this although it's actually not
// neccessary, because they can catch port-mode-changes and do their
// stuff as soon as port-mode changes from DUMMY to something else
// re-implemented methods HAVE to call addPort() of base-class!!
virtual midiPort * FASTCALL addPort( midiEventProcessor * _mep,
const QString & _name );
// re-implemented methods HAVE to call removePort() of base-class!!
virtual void FASTCALL removePort( midiPort * _port );
// returns whether client works with raw-MIDI, only needs to be
// re-implemented by midiClientRaw for returning TRUE
inline virtual bool isRaw( void ) const
{
return( FALSE );
}
// if not raw-client, return all readable/writeable ports
virtual const QStringList & readablePorts( void ) const;
virtual const QStringList & writeablePorts( void ) const;
// (un)subscribe given midiPort to/from destination-port
virtual void subscribeReadablePort( midiPort * _port,
const QString & _dest,
bool _unsubscribe = FALSE );
virtual void subscribeWriteablePort( midiPort * _port,
const QString & _dest,
bool _unsubscribe = FALSE );
// qobject-derived classes can use this for make a slot being
// connected to signal of non-raw-MIDI-client if port-lists change
virtual void connectRPChanged( QObject *, const char * )
{
}
virtual void connectWPChanged( QObject *, const char * )
{
}
// tries to open either MIDI-driver from config-file or (if it fails)
// any other working
static midiClient * openMidiClient( void );
class setupWidget : public tabWidget
{
public:
setupWidget( const QString & _caption, QWidget * _parent ) :
tabWidget( tabWidget::tr( "Settings for %1" ).arg(
_caption ), _parent )
{
}
virtual ~setupWidget()
{
}
virtual void saveSettings( void ) = 0;
} ;
protected:
vvector<midiPort *> m_midiPorts;
} ;
const Uint8 RAW_MIDI_PARSE_BUF_SIZE = 16;
class midiClientRaw : public midiClient
{
public:
midiClientRaw( void );
virtual ~midiClientRaw();
// we are raw-clients for sure!
inline virtual bool isRaw( void ) const
{
return( TRUE );
}
protected:
// generic raw-MIDI-parser which generates appropriate MIDI-events
void FASTCALL parseData( const Uint8 _c );
// to be implemented by actual client-implementation
virtual void FASTCALL sendByte( const Uint8 _c ) = 0;
private:
// this does MIDI-event-process
void processParsedEvent();
virtual void FASTCALL processOutEvent( const midiEvent & _me,
const midiTime & _time,
const midiPort * _port );
// small helper function returning length of a certain event - this
// is neccessary for parsing raw-MIDI-data
static Uint8 FASTCALL eventLength( const Uint8 _event );
// data being used for parsing
struct midiParserData
{
Uint8 m_status; // identifies the type of event, that
// is currently received ('Noteon',
// 'Pitch Bend' etc).
Uint8 m_channel; // The channel of the event that is
// received (in case of a channel event)
Uint32 m_bytes; // How many bytes have been read for
// the current event?
Uint32 m_bytesTotal; // How many bytes does the current
// event type include?
Uint32 m_buffer[RAW_MIDI_PARSE_BUF_SIZE];
// buffer for incoming data
midiEvent m_midiEvent; // midi-event
} m_midiParseData;
} ;
#endif

View File

@@ -1,8 +1,9 @@
/*
* midi_dummy.h - dummy MIDI-driver
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -26,15 +27,16 @@
#define _MIDI_DUMMY_H
#include "midi_device.h"
#include "midi_client.h"
#include "midi_port.h"
#include "tab_widget.h"
class midiDummy : public midiDevice
class midiDummy : public midiClientRaw
{
public:
midiDummy() :
midiDevice()
midiClientRaw()
{
}
~midiDummy()
@@ -47,11 +49,11 @@ public:
}
class setupWidget : public midiDevice::setupWidget
class setupWidget : public midiClient::setupWidget
{
public:
setupWidget( QWidget * _parent ) :
midiDevice::setupWidget( midiDummy::name(), _parent )
midiClientRaw::setupWidget( midiDummy::name(), _parent )
{
}
@@ -67,7 +69,7 @@ public:
protected:
virtual void FASTCALL sendByte( Uint8 )
virtual void FASTCALL sendByte( const Uint8 )
{
}

View File

@@ -0,0 +1,60 @@
/*
* midi_event_processor.h - base-class for midi-processing classes
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _MIDI_EVENT_PROCESSOR_H
#define _MIDI_EVENT_PROCESSOR_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "midi_time.h"
class midiEvent;
// all classes being able to process MIDI-events should inherit from this
class midiEventProcessor
{
public:
inline midiEventProcessor( void )
{
}
virtual inline ~midiEventProcessor()
{
}
// to be implemented by inheriting classes
virtual void FASTCALL processInEvent( const midiEvent & _me,
const midiTime & _time ) = 0;
virtual void FASTCALL processOutEvent( const midiEvent & _me,
const midiTime & _time ) = 0;
} ;
#endif

View File

@@ -1,8 +1,9 @@
/*
* midi_mapper.h - MIDI-mapper for any midiDevice
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -34,6 +35,7 @@
#else
#include <qmap.h>
#include <qpair.h>
#include <qfile.h>

View File

@@ -1,8 +1,9 @@
/*
* midi_oss.h - OSS-driver for MIDI-port
* midi_oss.h - OSS-raw-midi-client
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -25,19 +26,24 @@
#ifndef _MIDI_OSS_H
#define _MIDI_OSS_H
#include "audio_oss.h"
#ifdef OSS_SUPPORT
#include <qthread.h>
#include <qfile.h>
#include "midi_device.h"
#include "midi_client.h"
class QLineEdit;
class midiOSS : public midiDevice, public QThread
class midiOSS : public midiClientRaw, public QThread
{
public:
midiOSS( channelTrack * _ct = NULL );
midiOSS( void );
~midiOSS();
static QString probeDevice( void );
@@ -49,7 +55,7 @@ public:
}
class setupWidget : public midiDevice::setupWidget
class setupWidget : public midiClientRaw::setupWidget
{
public:
setupWidget( QWidget * _parent );
@@ -64,8 +70,8 @@ public:
protected:
virtual void FASTCALL sendByte( Uint8 _c );
virtual void FASTCALL run( void );
virtual void FASTCALL sendByte( const Uint8 _c );
virtual void run( void );
private:
@@ -75,5 +81,7 @@ private:
} ;
#endif
#endif

125
include/midi_port.h Normal file
View File

@@ -0,0 +1,125 @@
/*
* midi_port.h - abstraction of MIDI-ports which are part of LMMS's MIDI-
* sequencing system
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _MIDI_PORT_H
#define _MIDI_PORT_H
#include "qt3support.h"
#ifdef QT4
#include <QString>
#else
#include <qstring.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "types.h"
#include "midi.h"
#include "midi_time.h"
class midiClient;
class midiEventProcessor;
// class for abstraction of MIDI-port
class midiPort
{
public:
enum modes
{
DUMMY, // don't route any MIDI-events (default)
INPUT, // from MIDI-client to MIDI-event-processor
OUTPUT, // from MIDI-event-processor to MIDI-client
DUPLEX // both directions
} ;
midiPort( midiClient * _mc, midiEventProcessor * _mep,
const QString & _name, modes _mode = DUMMY );
~midiPort();
inline const QString & name( void ) const
{
return( m_name );
}
void FASTCALL setName( const QString & _name );
inline modes mode( void ) const
{
return( m_mode );
}
void setMode( modes _mode );
inline Sint8 inputChannel( void ) const
{
return( m_inputChannel );
}
inline void setInputChannel( Sint8 _chnl )
{
m_inputChannel = _chnl;
}
inline Sint8 outputChannel( void ) const
{
return( m_outputChannel );
}
inline void setOutputChannel( Sint8 _chnl )
{
m_outputChannel = _chnl;
}
void FASTCALL processInEvent( const midiEvent & _me,
const midiTime & _time );
void FASTCALL processOutEvent( const midiEvent & _me,
const midiTime & _time );
private:
midiClient * m_midiClient;
midiEventProcessor * m_midiEventProcessor;
QString m_name;
modes m_mode;
Sint8 m_inputChannel;
Sint8 m_outputChannel;
} ;
#endif

106
include/midi_tab_widget.h Normal file
View File

@@ -0,0 +1,106 @@
/*
* midi_tab_widget.h - tab-widget in channel-track-window for setting up
* MIDI-related stuff
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _MIDI_TAB_WIDGET_H
#define _MIDI_TAB_WIDGET_H
#include "qt3support.h"
#ifdef QT4
#include <QWidget>
#else
#include <qwidget.h>
#endif
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "settings.h"
class QMenu;
class QPixmap;
class QAction;
class channelTrack;
class tabWidget;
class ledCheckBox;
class lcdSpinBox;
class midiPort;
class midiTabWidget : public QWidget, public settings
{
Q_OBJECT
public:
midiTabWidget( channelTrack * _channel_track, midiPort * _port );
~midiTabWidget();
virtual void FASTCALL saveSettings( QDomDocument & _doc,
QDomElement & _parent );
virtual void FASTCALL loadSettings( const QDomElement & _this );
inline virtual QString nodeName( void ) const
{
return( "midi" );
}
protected slots:
void inputChannelChanged( int );
void outputChannelChanged( int );
void midiPortModeToggled( bool );
void readablePortsChanged( void );
void writeablePortsChanged( void );
void activatedReadablePort( QAction * _item );
void activatedWriteablePort( QAction * _item );
// Qt3-version
void activatedReadablePort( int _id );
void activatedWriteablePort( int _id );
private:
channelTrack * m_channelTrack;
midiPort * m_midiPort;
tabWidget * m_setupTabWidget;
lcdSpinBox * m_inputChannelSpinBox;
lcdSpinBox * m_outputChannelSpinBox;
ledCheckBox * m_receiveCheckBox;
ledCheckBox * m_sendCheckBox;
QMenu * m_readablePorts;
QMenu * m_writeablePorts;
} ;
#endif

View File

@@ -2,8 +2,9 @@
* midi_time.h - declaration of class midiTime which provides data-type for
* position- and length-variables
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -32,13 +33,13 @@
class midiTime
{
public:
inline midiTime( tact _tact, tact64th _tact_64th ) :
inline midiTime( const tact _tact, const tact64th _tact_64th ) :
m_tact( _tact ),
m_tact64th( _tact_64th )
{
}
inline midiTime( Sint32 _abs = 0 ) :
inline midiTime( const Sint32 _abs = 0 ) :
m_tact( _abs / 64 ),
m_tact64th( _abs % 64 )
{
@@ -97,7 +98,7 @@ public:
}
// calculate number of frame that are needed this time
inline Uint32 frames( float _frames_per_tact ) const
inline Uint32 frames( const float _frames_per_tact ) const
{
if( m_tact >= 0 )
{
@@ -110,6 +111,13 @@ public:
return( 0 );
}
static inline midiTime fromFrames( Uint32 _frames,
const float _frames_per_tact )
{
return( midiTime( static_cast<Sint32>( _frames * 64.0f /
_frames_per_tact ) ) );
}
private:
tact m_tact;

View File

@@ -1,8 +1,9 @@
/*
* mixer.h - audio-device-independent mixer for LMMS
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -33,14 +34,12 @@
#ifdef QT4
#include <QThread>
#include <QMutex>
#include <QVector>
#else
#include <qobject.h>
#include <qthread.h>
#include <qmutex.h>
#include <qvaluevector.h>
@@ -52,19 +51,18 @@
#include "panning.h"
#include "note.h"
#include "play_handle.h"
#include "effect_board.h"
class audioDevice;
class midiDevice;
class midiClient;
class lmmsMainWin;
class plugin;
class audioPort;
const int DEFAULT_BUFFER_SIZE = 512;
const Uint16 MAX_SAMPLE_PACKETS = 256; // how many parallel audio-samples-
// buffers shall be maximal exist and
// mixed together?
const Uint8 DEFAULT_CHANNELS = 2;
const Uint8 SURROUND_CHANNELS =
@@ -78,7 +76,7 @@ const Uint8 QUALITY_LEVELS = 2;
const Uint32 DEFAULT_QUALITY_LEVEL = 0;
const Uint32 HIGH_QUALITY_LEVEL = DEFAULT_QUALITY_LEVEL+1;
extern Uint32 SAMPLE_RATES[QUALITY_LEVELS];
const Uint32 DEFAULT_SAMPLE_RATE = 44100;//SAMPLE_RATES[DEFAULT_QUALITY_LEVEL];
const Uint32 DEFAULT_SAMPLE_RATE = 44100;
typedef sampleType sampleFrame[DEFAULT_CHANNELS];
@@ -104,11 +102,7 @@ const octaves BASE_OCTAVE = OCTAVE_4;
class mixer :
#ifndef QT4
public QObject,
#endif
public QThread
class mixer : public QObject
{
Q_OBJECT
public:
@@ -122,14 +116,19 @@ public:
}
void FASTCALL addBuffer( sampleFrame * _buf, Uint32 _frames,
void FASTCALL bufferToPort( sampleFrame * _buf, Uint32 _frames,
Uint32 _framesAhead,
volumeVector & _volumeVector );
volumeVector & _volumeVector,
audioPort * _port );
inline Uint32 framesPerAudioBuffer( void ) const
{
return( m_framesPerAudioBuffer );
}
inline Uint8 cpuLoad( void ) const
{
return( m_cpuLoad );
}
inline bool highQuality( void ) const
{
@@ -150,17 +149,40 @@ public:
void FASTCALL setAudioDevice( audioDevice * _dev, bool _hq );
void restoreAudioDevice( void );
// MIDI-device-stuff
inline const QString & midiDevName( void ) const
inline audioDevice * audioDev( void )
{
return( m_midiDevName );
return( m_audioDev );
}
inline midiDevice * getMIDIDevice( void )
// audio-port-stuff
inline void addAudioPort( audioPort * _port )
{
return( m_midiDev );
pause();
m_audioPorts.push_back( _port );
play();
}
inline void removeAudioPort( audioPort * _port )
{
vvector<audioPort *>::iterator it = qFind( m_audioPorts.begin(),
m_audioPorts.end(),
_port );
if( it != m_audioPorts.end() )
{
m_audioPorts.erase( it );
}
}
// MIDI-client-stuff
inline const QString & midiClientName( void ) const
{
return( m_midiClientName );
}
inline midiClient * getMIDIClient( void )
{
return( m_midiClient );
}
@@ -174,23 +196,24 @@ public:
m_playHandlesToRemove.push_back( _ph );
}
void FASTCALL checkValidityOfPlayHandles( void );
void checkValidityOfPlayHandles( void );
inline int sampleRate( void )
inline Uint32 sampleRate( void )
{
return( SAMPLE_RATES[m_qualityLevel] );
}
inline float masterOutput( void ) const
inline float masterGain( void ) const
{
return( m_masterOutput );
return( m_masterGain );
}
inline void setMasterOutput( float _mo )
inline void setMasterGain( float _mo )
{
m_masterOutput = _mo;
m_masterGain = _mo;
}
@@ -208,14 +231,14 @@ public:
}
inline void pause( void )
void pause( void )
{
m_safetySyncMutex.lock();
m_mixMutex.lock();
}
inline void play( void )
void play( void )
{
m_safetySyncMutex.unlock();
m_mixMutex.unlock();
}
@@ -234,6 +257,8 @@ public:
}
const surroundSampleFrame * renderNextBuffer( void );
public slots:
void setHighQuality( bool _hq_on = FALSE );
@@ -244,80 +269,43 @@ signals:
private:
struct samplePacket
{
surroundSampleFrame * m_buffer; // actual buffer for
// wave-data
Uint32 m_frames;
Uint32 m_framesDone;
Uint32 m_framesAhead; // number of frames, the buffer
// should be mixed ahead
volume m_vol;
panning m_pan;
enum samplePacketStates
{
READY, FILLING, UNUSED
} m_state;
} ;
static mixer * s_instanceOfMe;
mixer();
~mixer();
void quitThread( void );
void stopProcessing( void );
// we don't allow to create mixer by using copy-ctor
mixer( const mixer & ) :
#ifndef QT4
QObject(),
#endif
QThread(),
m_curBuf( m_buffer1 ),
m_nextBuf( m_buffer2 )
mixer( const mixer & )
{
}
virtual void run( void );
void FASTCALL mixSamplePacket( samplePacket * _sp );
audioDevice * tryAudioDevices( void );
midiDevice * tryMIDIDevices( void );
midiClient * tryMIDIClients( void );
void processBuffer( surroundSampleFrame * _buf, fxChnl _fx_chnl );
sampleFrame * m_silence;
#ifndef DISABLE_SURROUND
surroundSampleFrame * m_surroundSilence;// cool, silence in surround ;-)
#endif
samplePacket m_samplePackets[MAX_SAMPLE_PACKETS];
vvector<audioPort *> m_audioPorts;
Uint32 m_framesPerAudioBuffer;
surroundSampleFrame * m_buffer1;
surroundSampleFrame * m_buffer2;
surroundSampleFrame * m_curBuf;
surroundSampleFrame * m_nextBuf;
bool m_discardCurBuf;
Uint8 m_cpuLoad;
playHandleVector m_playHandles;
playHandleVector m_playHandlesToRemove;
Uint8 m_qualityLevel;
volatile float m_masterOutput;
volatile bool m_quit;
float m_masterGain;
audioDevice * m_audioDev;
@@ -325,12 +313,11 @@ private:
QString m_audioDevName;
midiDevice * m_midiDev;
QString m_midiDevName;
midiClient * m_midiClient;
QString m_midiClientName;
QMutex m_safetySyncMutex;
QMutex m_devMutex;
QMutex m_mixMutex;
friend class lmmsMainWin;

View File

@@ -1,8 +1,9 @@
/*
* mmp.h - class for reading and writing multimedia-project-files
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -48,7 +49,9 @@ public:
{
UNKNOWN,
SONG_PROJECT,
SONG_PROJECT_TEMPLATE,
CHANNEL_SETTINGS,
DRAG_N_DROP_DATA,
EFFECT_SETTINGS,
VIDEO_PROJECT, // will come later...
BURN_PROJECT, // will come later...
@@ -57,7 +60,8 @@ public:
} ;
multimediaProject( const QString & _in_file_name );
multimediaProject( const QString & _in_file_name,
bool _is_filename = TRUE );
multimediaProject( projectTypes _project_type );
~multimediaProject();

View File

@@ -2,8 +2,9 @@
* name_label.h - class nameLabel, a label which is renamable by
* double-clicking it
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -2,8 +2,9 @@
* note.h - declaration of class note which contains all informations about a
* note + definitions of several constants and enums
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -2,8 +2,9 @@
* note_play_handle.h - declaration of class notePlayHandle which is needed
* by LMMS-Play-Engine
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -1,8 +1,9 @@
/*
* nstate_button.h - declaration of class nStateButton
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -33,22 +34,22 @@
#ifdef QT4
#include <QWidget>
#include <QPixmap>
#include <QVector>
#include <QPair>
#else
#include <qwidget.h>
#include <qpixmap.h>
#include <qvaluevector.h>
#include <qpair.h>
#endif
#include "tool_button.h"
class nStateButton : public QWidget
class nStateButton : public toolButton
{
Q_OBJECT
public:
@@ -72,16 +73,15 @@ public slots:
signals:
void stateChanged( int _n );
void changedState( int _n );
protected:
virtual void paintEvent( QPaintEvent * _pe );
virtual void mousePressEvent( QMouseEvent * _me );
private:
vvector<QPair<QPixmap *, QString> > m_states;
vvector<QPair<QPixmap, QString> > m_states;
QString m_generalToolTip;
int m_curState;

View File

@@ -1,8 +1,9 @@
/*
* oscillator.h - header-file for oscillator.cpp, a powerful oscillator-class
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -44,6 +45,8 @@ typedef void ( oscillator:: * oscFuncPtr )
( sampleFrame * _ab, Uint32 _frames, Uint8 _chnl );
const sampleFrame ZERO_FRAME = { 0.0f, 0.0f } ;
class oscillator
{
@@ -74,8 +77,16 @@ public:
}
inline void setUserWave( const sampleFrame * _data, Uint32 _frames )
{
m_userWaveData = _data;
m_userWaveFrames = _frames;
if( m_userWaveFrames > 0 )
{
m_userWaveData = _data;
m_userWaveFrames = _frames;
}
else
{
m_userWaveData = &ZERO_FRAME;
m_userWaveFrames = 1;
}
}
inline void update( sampleFrame * _ab, Uint32 _frames, Uint8 _chnl )
{
@@ -87,14 +98,13 @@ public:
// phase (otherwise we'll get clicks in the audio-stream)
const float v = m_sample * m_oscCoeff;
m_freq = _new_freq;
recalcOscCoeff( phase( v ) );
recalcOscCoeff( fraction( v ) );
}
static oscillator * FASTCALL createNewOsc( waveShapes _wave_shape,
static oscillator * FASTCALL createOsc( waveShapes _wave_shape,
modulationAlgos _modulation_algo, float _freq,
Sint16 _phase_offset, float _volume_factor,
oscillator * _m_subOsc = NULL );
oscillator * _m_subOsc = NULL );
inline bool syncOk( void )
{
const float v1 = m_sample * m_oscCoeff;
@@ -102,13 +112,20 @@ public:
// check whether v2 is in next period
return( floorf( v2 ) > floorf( v1 ) );
}
static inline float phase( float _sample )
/*#define FLOAT_TO_INT(in,out) \
register const float round_const = -0.5f; \
__asm__ __volatile__ ("fadd %%st,%%st(0)\n" \
"fadd %2\n" \
"fistpl %0\n" \
"shrl $1,%0" : "=m" (out) : "t" (in),"m"(round_const) : "st") ;*/
static inline float fraction( const float _sample )
{
float t;
return( modff( _sample, &t ) );
//return( _sample - floorf( _sample ) );
return( _sample - static_cast<int>( _sample ) );
}
// now follow the wave-shape-routines...
static inline sampleType sinSample( float _sample )
{
return( sinf( _sample * static_cast<sampleType>( 2.0f * M_PI
@@ -117,7 +134,7 @@ public:
static inline sampleType triangleSample( float _sample )
{
const float ph = phase( _sample );
const float ph = fraction( _sample );
if( ph <= 0.25f )
{
return( ph * 4.0f );
@@ -131,17 +148,17 @@ public:
static inline sampleType sawSample( float _sample )
{
return( -1.0f + phase( _sample ) * 2.0f );
return( -1.0f + fraction( _sample ) * 2.0f );
}
static inline sampleType squareSample( float _sample )
{
return( ( phase( _sample ) > 0.5f ) ? -1.0f : 1.0f );
return( ( fraction( _sample ) > 0.5f ) ? -1.0f : 1.0f );
}
static inline sampleType moogSawSample( float _sample )
{
const float ph= phase( _sample );
const float ph = fraction( _sample );
if( ph < 0.5f )
{
return( -1.0f + ph * 4.0f );
@@ -151,7 +168,7 @@ public:
static inline sampleType expSample( float _sample )
{
float ph = phase( _sample );
float ph = fraction( _sample );
if( ph > 0.5f )
{
ph = 1.0f - ph;
@@ -164,14 +181,20 @@ public:
return( 1.0f - 2.0f * ( ( float )rand() * ( 1.0f /
RAND_MAX ) ) );
}
static inline sampleType userWaveSample( float _sample,
const sampleFrame * _user_wave, Uint32 _user_wave_frames )
{
const float frame = fraction( _sample ) * _user_wave_frames;
const Uint32 f1 = static_cast<Uint32>( frame );
const Uint32 f2 = ( f1 + 1 ) % _user_wave_frames;
return( linearInterpolate( _user_wave[f1][0],
_user_wave[f2][0],
fraction( frame ) ) );
}
inline sampleType userWaveSample( float _sample )
{
const float frame = phase( _sample ) * m_userWaveFrames;
const Uint32 f1 = static_cast<Uint32>( frame );
const Uint32 f2 = ( f1 + 1 ) % m_userWaveFrames;
return( linearInterpolate( m_userWaveData[f1][0],
m_userWaveData[f2][0],
frame - floorf( frame ) ) );
return( userWaveSample( _sample, m_userWaveData,
m_userWaveFrames ) );
}

View File

@@ -2,8 +2,9 @@
* panning.h - declaration of some constants and types, concerning the
* panning of a note
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -2,8 +2,9 @@
* pattern.h - declaration of class pattern, which contains all informations
* about a pattern
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -34,6 +35,7 @@
#include <QWidget>
#include <QMutex>
#include <QDialog>
#include <QThread>
#else
@@ -41,6 +43,7 @@
#include <qwidget.h>
#include <qmutex.h>
#include <qdialog.h>
#include <qthread.h>
#endif
@@ -50,19 +53,19 @@
#include "mixer.h"
class channelTrack;
class sampleBuffer;
class audioSampleRecorder;
class QTimer;
class QAction;
class QPixmap;
class QProgressBar;
class QPushButton;
class QPixmap;
class patternFreezeStatusDialog;
class channelTrack;
class patternFreezeThread;
class sampleBuffer;
const int DEFAULT_STEPS_PER_TACT = 16;
const int BEATS_PER_TACT = 4;
const int MAX_BEATS_PER_TACT = 16;
const int MAIN_BEATS_PER_TACT = 4;
class pattern : public trackContentObject
@@ -71,20 +74,27 @@ class pattern : public trackContentObject
public:
enum patternTypes
{
BEAT_PATTERN, MELODY_PATTERN/*, EVENT_PATTERN*/
BEAT_PATTERN, MELODY_PATTERN/*, AUTOMATION_PATTERN*/
} ;
pattern( channelTrack * _channel_track );
pattern( const pattern & _pat_to_copy ) FASTCALL;
virtual ~pattern();
void init( void );
virtual void FASTCALL movePosition( const midiTime & _pos );
virtual midiTime length( void ) const;
note * FASTCALL addNote( const note & _new_note );
void FASTCALL removeNote( const note * _note_to_del );
note * FASTCALL rearrangeNote( const note * _note_to_proc );
void clearNotes( void );
inline noteVector & notes( void )
@@ -92,43 +102,49 @@ public:
return( m_notes );
}
note * FASTCALL noteAt( int _note_num );
void FASTCALL setNoteAt( int _note_num, note _new_note );
// pattern-type stuff
inline patternTypes type( void ) const
{
return( m_patternType );
}
void FASTCALL setType( patternTypes _new_pattern_type );
void checkType( void );
// pattern-name functions
inline const QString & name( void ) const
{
return( m_name );
}
inline void setName( const QString & _name )
{
m_name = _name;
update();
}
inline channelTrack * getChannelTrack( void )
{
return( m_channelTrack );
}
// functions which are part of freezing-feature
inline bool freezing( void ) const
{
return( m_freezing );
}
inline bool frozen( void ) const
{
return( m_frozenPattern != NULL );
}
// if channel-track recognizes that this pattern is frozen, it calls
// this instead of playing all the notes
void FASTCALL playFrozenData( sampleFrame * _ab, Uint32 _start_frame,
Uint32 _frames );
inline bool isFreezing( void ) const
{
return( m_freezeRecorder != NULL );
}
void finishFreeze( void );
note * FASTCALL noteAt( int _note_num );
void FASTCALL setNoteAt( int _note_num, note _new_note );
void checkType( void );
// settings-management
virtual void FASTCALL saveSettings( QDomDocument & _doc,
QDomElement & _parent );
virtual void FASTCALL loadSettings( const QDomElement & _this );
@@ -137,48 +153,72 @@ public:
return( "pattern" );
}
inline channelTrack * getChannelTrack( void )
{
return( m_channelTrack );
}
protected slots:
void openInPianoRoll( bool _c );
void openInPianoRoll( void );
void clear( void );
void resetName( void );
void changeName( void );
void freeze( void );
void unfreeze( void );
void updateFreezeStatusDialog( void );
void abortFreeze( void );
void addSteps( QAction * _item );
void removeSteps( QAction * _item );
void addSteps( int _n );
void removeSteps( int _n );
protected:
void paintEvent( QPaintEvent * _pe );
void mousePressEvent( QMouseEvent * _me );
void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void constructContextMenu( QMenu * );
virtual void mouseDoubleClickEvent( QMouseEvent * _me );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void wheelEvent( QWheelEvent * _we );
virtual void paintEvent( QPaintEvent * _pe );
void ensureBeatNotes( void );
void updateBBTrack( void );
private:
static QPixmap * s_patternBg;
static QPixmap * s_stepBtnOn;
static QPixmap * s_stepBtnOverlay;
static QPixmap * s_stepBtnOff;
static QPixmap * s_stepBtnOffLight;
static QPixmap * s_frozen;
static void initPixmaps( void );
// general stuff
channelTrack * m_channelTrack;
patternTypes m_patternType;
QString m_name;
noteVector m_notes;
// data-stuff
noteVector m_notes;
int m_steps;
// pattern freezing
QMutex m_frozenPatternMutex;
sampleBuffer * m_frozenPattern;
audioSampleRecorder * m_freezeRecorder;
patternFreezeStatusDialog * m_freezeStatusDialog;
QTimer * m_freezeStatusUpdateTimer;
bool m_freezing;
volatile bool m_freezeAborted;
// as in Qt4 QThread is inherits from QObject and our base
// trackContentObject is a QWidget (=QObject), we cannot inherit from
// QThread. That's why we have to put pattern-freezing into separate
// thread-class -> patternFreezeThread
friend class patternFreezeThread;
} ;
@@ -188,7 +228,7 @@ class patternFreezeStatusDialog : public QDialog
{
Q_OBJECT
public:
patternFreezeStatusDialog();
patternFreezeStatusDialog( QThread * _thread );
~patternFreezeStatusDialog();
void FASTCALL setProgress( int _p );
@@ -200,12 +240,17 @@ protected:
protected slots:
void cancelBtnClicked( void );
void updateProgress( void );
private:
QProgressBar * m_progressBar;
QPushButton * m_cancelBtn;
QThread * m_freezeThread;
int m_progress;
signals:
void aborted( void );
@@ -213,4 +258,25 @@ signals:
} ;
class patternFreezeThread : public QThread
{
public:
patternFreezeThread( pattern * _pattern );
virtual ~patternFreezeThread();
protected:
virtual void run( void );
private:
pattern * m_pattern;
patternFreezeStatusDialog * m_statusDlg;
} ;
#endif

View File

@@ -2,8 +2,9 @@
* piano_roll.h - declaration of class pianoRoll which is a window where you
* can set and edit notes in an easy way
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -44,15 +45,16 @@
#include "note.h"
class QScrollBar;
class QComboBox;
class QPainter;
class QPixmap;
class QScrollBar;
class crystalButton;
class toolButton;
class pattern;
class notePlayHandle;
class pixmapButton;
class timeLine;
class lmmsMainWin;
@@ -88,7 +90,6 @@ protected:
void mouseReleaseEvent( QMouseEvent * _me );
void mouseMoveEvent( QMouseEvent * _me );
void keyPressEvent( QKeyEvent * _ke );
void keyReleaseEvent( QKeyEvent * _ke );
void wheelEvent( QWheelEvent * _we );
int FASTCALL getKey( int _y );
@@ -109,10 +110,10 @@ protected slots:
void horScrolled( int _new_pos );
void verScrolled( int _new_pos );
void drawButtonToggled( bool = FALSE );
void eraseButtonToggled( bool = FALSE );
void selectButtonToggled( bool = FALSE );
void moveButtonToggled( bool = FALSE );
void drawButtonToggled( void );
void eraseButtonToggled( void );
void selectButtonToggled( void );
void moveButtonToggled( void );
void copySelectedNotes( void );
void cutSelectedNotes( void );
@@ -121,6 +122,8 @@ protected slots:
void updatePosition( const midiTime & _t );
void zoomingChanged( const QString & _zfac );
private:
@@ -155,8 +158,6 @@ private:
static QPixmap * s_whiteKeyBigPm;
static QPixmap * s_whiteKeySmallPm;
static QPixmap * s_artwork1;
static QPixmap * s_artwork2;
static QPixmap * s_blackKeyPm;
static QPixmap * s_toolDraw;
static QPixmap * s_toolErase;
@@ -166,18 +167,23 @@ private:
static pianoRollKeyTypes prKeyOrder[];
pixmapButton * m_playButton;
pixmapButton * m_recordButton;
pixmapButton * m_stopButton;
QWidget * m_toolBar;
crystalButton * m_drawButton;
crystalButton * m_eraseButton;
crystalButton * m_selectButton;
crystalButton * m_moveButton;
toolButton * m_playButton;
toolButton * m_recordButton;
toolButton * m_stopButton;
toolButton * m_drawButton;
toolButton * m_eraseButton;
toolButton * m_selectButton;
toolButton * m_moveButton;
toolButton * m_cutButton;
toolButton * m_copyButton;
toolButton * m_pasteButton;
QComboBox * m_zoomingComboBox;
crystalButton * m_cutButton;
crystalButton * m_copyButton;
crystalButton * m_pasteButton;
pattern * m_pattern;
QScrollBar * m_leftRightScroll;
@@ -204,11 +210,8 @@ private:
midiTime m_lenOfNewNotes;
bool m_shiftPressed;
bool m_controlPressed;
int m_startKey; // first key when drawing
int m_keyMouseOver;
int m_lastKey;
noteVector m_notesToCopy;
@@ -227,6 +230,9 @@ private:
~pianoRoll();
friend class lmmsMainWin;
signals:
void positionChanged( const midiTime & );

View File

@@ -2,8 +2,9 @@
* piano_widget.h - declaration of class pianoWidget, a widget which provides
* an interactive piano/keyboard-widget
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -62,18 +63,17 @@ class pianoWidget : public QWidget
Q_OBJECT
public:
pianoWidget( channelTrack * _channel_track );
~pianoWidget();
virtual ~pianoWidget();
protected:
void paintEvent( QPaintEvent * );
void mousePressEvent( QMouseEvent * me );
void mouseReleaseEvent( QMouseEvent * me );
void mouseMoveEvent( QMouseEvent * me );
void keyPressEvent( QKeyEvent * ke );
void keyReleaseEvent( QKeyEvent * ke );
void focusInEvent( QFocusEvent * _fe );
void focusOutEvent( QFocusEvent * _fe );
virtual void paintEvent( QPaintEvent * );
virtual void mousePressEvent( QMouseEvent * me );
virtual void mouseReleaseEvent( QMouseEvent * me );
virtual void mouseMoveEvent( QMouseEvent * me );
virtual void keyPressEvent( QKeyEvent * ke );
virtual void keyReleaseEvent( QKeyEvent * ke );
virtual void focusOutEvent( QFocusEvent * _fe );
private:
@@ -86,6 +86,8 @@ private:
static QPixmap * s_whiteKeyPressedPm;
static QPixmap * s_blackKeyPressedPm;
bool m_pressedKeys[NOTES_PER_OCTAVE * OCTAVES];
QScrollBar * m_pianoScroll;
channelTrack * m_channelTrack;
tones m_startTone; // first key when drawing

View File

@@ -1,8 +1,9 @@
/*
* pixmap_button.h - declaration of class pixmapButton
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -51,10 +52,16 @@ class pixmapButton : public QPushButton
public:
pixmapButton( QWidget * _parent );
virtual ~pixmapButton();
virtual void FASTCALL setActiveGraphic( const QPixmap & _pm );
virtual void FASTCALL setInactiveGraphic( const QPixmap & _pm,
void FASTCALL setActiveGraphic( const QPixmap & _pm );
void FASTCALL setInactiveGraphic( const QPixmap & _pm,
bool _update = TRUE );
void FASTCALL setBgGraphic( const QPixmap & _pm );
#ifndef QT4
inline void setChecked( bool _on )
{
setOn( _on );
}
#endif
signals:

View File

@@ -1,9 +1,10 @@
/*
* play_handle.h - base-class playHandle which is needed by
* LMMS-Play-Engine
* LMMS-Player-Engine
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

134
include/plugin.h Normal file
View File

@@ -0,0 +1,134 @@
/*
* plugin.h - class plugin, the base-class and generic interface for all plugins
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _PLUGIN_H
#define _PLUGIN_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QString>
#include <QVector>
#else
#include <qstring.h>
#include <qvaluevector.h>
#endif
#include "types.h"
#include "settings.h"
#include "embed.h"
#define STRINGIFY_PLUGIN_NAME(s) STR(s)
#define STR(PN) #PN
class QPixmap;
class plugin : public settings
{
public:
enum pluginTypes
{
INSTRUMENT, // instrument being used in channel-track
EFFECT, // effect-plugin for effect-board
IMPORT_FILTER, // filter for importing a file
EXPORT_FILTER, // filter for exporting a file
UNDEFINED = 255
} ;
// descriptor holds information about a plugin - every external plugin
// has to instantiate such a descriptor in an extern "C"-section so that
// the plugin-loader is able to access information about the plugin
struct descriptor
{
const char * name;
const char * public_name;
const char * description;
const char * author;
int version;
pluginTypes type;
embed::descriptor logo;
} ;
// contructor of a plugin
// _name: public name of plugin
// _type: one of the plugin-types defined above
plugin( const QString & _public_name, pluginTypes _type );
virtual ~plugin();
// returns the name, the plugin passed to plugin-constructor
inline const QString & publicName( void ) const
{
return( m_publicName );
}
// return type
inline pluginTypes type( void ) const
{
return( m_type );
}
// plugins can overload this for making other classes able to change
// settings of the plugin without knowing the actual class
virtual void FASTCALL setParameter( const QString & _param,
const QString & _value );
// plugins can overload this for making other classes able to query
// settings of the plugin without knowing the actual class
virtual QString FASTCALL getParameter( const QString & _param );
// returns an instance of a plugin whose name matches to given one
// if specified plugin couldn't be loaded, it creates a dummy-plugin
static plugin * FASTCALL instantiate( const QString & _plugin_name,
void * _data );
// fills given vector with descriptors for all available plugins
static void FASTCALL getDescriptorsOfAvailPlugins(
vvector<descriptor> & _plugin_descs );
private:
const QString m_publicName;
const pluginTypes m_type;
// pointer to instantiation-function in plugin
typedef plugin * ( * instantiationHook )( void * );
} ;
#endif

97
include/plugin_browser.h Normal file
View File

@@ -0,0 +1,97 @@
/*
* plugin_browser.h - include file for pluginBrowser
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _PLUGIN_BROWSER_H
#define _PLUGIN_BROWSER_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QVector>
#include <QPixmap>
#else
#include <qvaluevector.h>
#include <qpixmap.h>
#endif
#include "side_bar_widget.h"
#include "plugin.h"
class trackContainer;
class pluginBrowser : public sideBarWidget
{
Q_OBJECT
public:
pluginBrowser( QWidget * _parent );
virtual ~pluginBrowser();
private:
vvector<plugin::descriptor> m_pluginDescriptors;
QWidget * m_view;
} ;
class pluginDescWidget : public QWidget
{
public:
pluginDescWidget( const plugin::descriptor & _pd, QWidget * _parent );
virtual ~pluginDescWidget();
protected:
virtual void paintEvent( QPaintEvent * _pe );
virtual void mousePressEvent( QMouseEvent * _me );
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void mouseReleaseEvent( QMouseEvent * _me );
private:
const plugin::descriptor & m_pluginDescriptor;
QPixmap m_logo;
bool m_mouseOver;
} ;
#endif

View File

@@ -2,8 +2,9 @@
* preset_preview_play_handle.h - play-handle for playing a short preview-sound
* of a preset
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -1,8 +1,9 @@
/*
* project_notes.h - header for project-notes-editor
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -1,8 +1,9 @@
/*
* qt3support.h - layer for supporting Qt3
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -30,7 +31,7 @@
//#include <qmap.h>
#include <qglobal.h>
//#include <qpair.h>
#include <qpair.h>
#if QT_VERSION >= 0x040000
#ifndef QT4
@@ -51,6 +52,14 @@ typedef int csize;
#define vvector QVector
#define vlist QList
#include <QFileInfo>
inline QString baseName( const QString & _file )
{
return( QFileInfo( _file ).absolutePath() + "/" +
QFileInfo( _file ).completeBaseName() );
}
#else
@@ -62,6 +71,14 @@ typedef int csize;
#define QAbstractButton QButton
#define QScrollArea QScrollView
#define Q3ListView QListView
#define Q3ListViewItem QListViewItem
#define Q3ScrollView QScrollView
#define QMatrix QWMatrix
#define QIcon QIconSet
// QWidget
#define setWindowTitle setCaption
#define setWindowIcon setIcon
@@ -72,7 +89,6 @@ typedef int csize;
// QMenu/QPopupMenu
#define addAction insertItem
//#define addSeparator insertSeparator
// QFile/QIODevice
@@ -100,6 +116,7 @@ typedef int csize;
// QAbstractButton/QButton
#define setCheckable setToggleButton
#define setShortcut setAccel
// QInputEvent/QKeyEvent
@@ -114,15 +131,8 @@ typedef int csize;
#define setTextVisible setPercentageVisible
// QFileInfo
//#define completeSuffix extension
//#define suffix() extension( FALSE )
// QComboBox
#define addItem insertItem
//#define currentIndex currentItem
//#define setCurrentIndex setCurrentItem
// QString
@@ -147,7 +157,10 @@ typedef int csize;
#define NoFilter DefaultFilter
#define homePath homeDirPath
#define rootPath rootDirPath
//#define absolutePath absPath
// QFileInfo
#define absoluteFilePath absFilePath
// QToolButton
@@ -158,18 +171,63 @@ typedef int csize;
#define transformed xForm
#define Q3ListView QListView
#define Q3ListViewItem QListViewItem
#define Q3ScrollView QScrollView
// QGridLayout
#define setColumnStretch setColStretch
#define columnCount numCols
#define setColumnMinimumWidth setColSpacing
#define QMatrix QWMatrix
#define QIcon QIconSet
// Qt-namespace
#define ShiftModifier ShiftButton
#define ControlModifier ControlButton
typedef unsigned int csize;
// some compat-stuff for older qt-versions...
#if QT_VERSION < 0x030200
#define wasCanceled wasCancelled
#endif
#include <qfileinfo.h>
inline QString baseName( const QString & _file )
{
return( QFileInfo( _file ).dirPath() + "/" +
QFileInfo( _file ).baseName( TRUE ) );
}
#if QT_VERSION < 0x030100
#include <qmutex.h>
// Qt 3.0.x doesn't have QMutexLocker, so we implement it on our own...
class QMutexLocker
{
public:
QMutexLocker( QMutex * _m ) :
m_mutex( _m )
{
m_mutex->lock();
}
~QMutexLocker()
{
m_mutex->unlock();
}
private:
QMutex * m_mutex;
} ;
#endif
#endif

239
include/qxembed.h Normal file
View File

@@ -0,0 +1,239 @@
/****************************************************************************
Definition of QXEmbed class
Copyright (C) 1999-2000 Troll Tech AS
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*****************************************************************************/
#ifndef QXEMBED_H
#define QXEMBED_H
#include "qt3support.h"
#ifndef QT4
#include <qwidget.h>
/*#include <kdelibs_export.h>*/
#ifdef Q_WS_X11
class QXEmbedData;
/**
* A QXEmbed widget serves as an embedder that can manage one single embedded
* X-window. These so-called client windows can be arbitrary Qt or non Qt
* applications.
*
* There are two different ways of using QXEmbed,
* from the client side or from the embedder's side.
*
* Embedding from the client's side requires that the client knows the
* window identifier of the respective embedder widget. Use either
* embedClientIntoWindow() or the high-level wrapper processClientCmdline().
* This is only possible when the client is a Qt application.
*
* When using it from the embedder's side, you must know the window
* identifier of the window that should be embedded. Simply call embed()
* with this identifier as parameter. If the client is a Qt application,
* make sure it has called QXEmbed::initialize(). Otherwise you should
* probably call setProtocol(XPLAIN) before embed().
*
* Reimplement the change handler windowChanged() to catch embedding or
* the destruction of embedded windows. In the latter case, the
* embedder also emits a signal embeddedWindowDestroyed() for
* convenience.
*
* @short The QXEmbed widget is a graphical socket that can embed an external X-Window.
*/
class QXEmbed : public QWidget
{
Q_OBJECT
public:
/**
*
* Constructs a xembed widget.
*
* The parent, name and f arguments are passed to the QFrame
* constructor.
*/
QXEmbed( QWidget *parent=0, const char *name=0, WFlags f = 0 );
/**
* Destructor. Cleans up the focus if necessary.
*/
~QXEmbed();
/**
* Embedded applications should call this function to make sure
* they support the XEMBED protocol. It is called automatically
* when you use embedClientIntoWindow() or
* processClientCmdline(). Clients might have to call it
* manually when you use embed().
*/
static void initialize();
enum Protocol { XEMBED, XPLAIN };
/**
* Sets the protocol used for embedding windows.
* This function must be called before embedding a window.
* Protocol XEMBED provides maximal functionality (focus, tabs, etc)
* but requires explicit cooperation from the embedded window.
* Protocol XPLAIN provides maximal compatibility with
* embedded applications that do not support the XEMBED protocol.
* The default is XEMBED.
*
* Non KDE applications should be embedded with protocol XPLAIN.
* This does not happen automatically yet.
* You must call setProtocol() explicitly.
*/
void setProtocol( Protocol proto );
/**
* Returns the protocol used for embedding the current window.
*
* @return the protocol used by QXEmbed.
*/
Protocol protocol();
/**
* Embeds the window with the identifier w into this xembed widget.
*
* This function is useful if the embedder knows about the client window
* that should be embedded. Often it is vice versa: the client knows
* about its target embedder. In that case, it is not necessary to call
* embed(). Instead, the client will call the static function
* embedClientIntoWindow().
*
* @param w the identifier of the window to embed
* @see embeddedWinId()
*/
void embed( WId w );
/**
* Returns the window identifier of the embedded window, or 0 if no
* window is embedded yet.
*
* @return the id of the embedded window (0 if no window is embedded)
*/
WId embeddedWinId() const;
/**
* A function for clients that embed themselves. The widget
* client will be embedded in the window window. The application has
* to ensure that window is the handle of the window identifier of
* an QXEmbed widget.
*
* @short #processClientCmdline()
*/
static void embedClientIntoWindow( QWidget* client, WId window );
/**
* A utility function for clients that embed theirselves. The widget
* client will be embedded in the window that is passed as
* -embed command line argument.
*
* The function returns true on success or false if no such command line
* parameter is specified.
*
* @see embedClientIntoWindow()
*/
static bool processClientCmdline( QWidget* client, int& argc, char ** argv );
/**
* Sends a WM_DELETE_WINDOW message to the embedded window. This is what
* typically happens when you click on the close button of a window
* manager decoration. This should cause the embedded application to
* cleanly close the window. Signal embeddedWindowDestroyed() can be used
* to monitor the status of the embedded window.
*/
void sendDelete( void );
/**
* Selects what shoud be done with the embedded window when the embedding
* window is destroyed. When the argument is true, the embedded window is
* kept alive, is hidden, and receives a WM_DELETE_WINDOW message using
* sendDelete(). This is the default. Otherwise, the destruction of the
* QXEmbed object simply destroys the embedded window.
*
* @see sendDelete()
*/
void setAutoDelete( bool );
/**
* Returns the value of flag indicating what shoud be done with the
* embedded window when the embedding window is destroyed.
*
* @see setAutoDelete()
*/
bool autoDelete() const;
/* Reimp */
QSize sizeHint() const;
QSize minimumSizeHint() const;
QSizePolicy sizePolicy() const;
bool eventFilter( QObject *, QEvent * );
bool customWhatsThis() const;
void enterWhatsThisMode(); // temporary, fix in Qt (Matthias, Mon Jul 17 15:20:55 CEST 2000 )
virtual void reparent( QWidget * parent, WFlags f, const QPoint & p, bool showIt = false );
signals:
/**
* This signal is emitted when the embedded window has been lost (destroyed or reparented away)
*
* @see embeddedWinId()
*/
// KDE4 rename to embeddedWindowLost()
void embeddedWindowDestroyed();
protected:
bool event( QEvent * );
void keyPressEvent( QKeyEvent * );
void keyReleaseEvent( QKeyEvent * );
void focusInEvent( QFocusEvent * );
void focusOutEvent( QFocusEvent * );
void resizeEvent(QResizeEvent *);
void showEvent( QShowEvent * );
bool x11Event( XEvent* );
/**
* A change handler that indicates that the embedded window has been
* changed. The window handle can also be retrieved with
* embeddedWinId().
*
* @param w the handle of the window that changed
*/
virtual void windowChanged( WId w );
bool focusNextPrevChild( bool next );
private:
WId window;
QXEmbedData* d;
void checkGrab();
void sendSyntheticConfigureNotifyEvent();
};
#endif
#endif
#endif

View File

@@ -2,8 +2,9 @@
* rename_dialog.h - declaration of class renameDialog, a simple dialog for
* changing the content of a string
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -1,8 +1,9 @@
/*
* sample_buffer.h - container-class sampleBuffer
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -66,7 +67,10 @@ public:
DOTS
} ;
sampleBuffer( const QString & _audio_file = "" );
// constructor which either loads sample _audio_file or decodes
// base64-data out of string
sampleBuffer( const QString & _audio_file = "",
bool _is_base64_data = FALSE );
sampleBuffer( const sampleFrame * _data, Uint32 _frames );
~sampleBuffer();
@@ -111,10 +115,12 @@ public:
QString openAudioFile( void ) const;
QString toBase64( void ) const;
public slots:
void setAudioFile( const QString & _audio_file );
void loadFromBase64( const QString & _data );
void setStartFrame( Uint32 _s );
void setEndFrame( Uint32 _e );
void setAmplification( float _a );

View File

@@ -1,8 +1,9 @@
/*
* sample_play_handle.h - play-handle for playing a sample
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -30,6 +31,7 @@
class sampleBuffer;
class audioPort;
class samplePlayHandle : public playHandle
@@ -60,6 +62,8 @@ private:
Uint32 m_frame;
audioPort * m_audioPort;
} ;

View File

@@ -2,8 +2,9 @@
* sample_track.h - class sampleTrack, a track which provides arrangement of
* samples
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -44,6 +45,7 @@
class nameLabel;
class audioPort;
class QLabel;
//class sampleTCOSettingsDialog;
@@ -75,8 +77,11 @@ public slots:
protected:
void paintEvent( QPaintEvent * );
void mouseDoubleClickEvent( QMouseEvent * );
virtual void dragEnterEvent( QDragEnterEvent * _dee );
virtual void dropEvent( QDropEvent * _de );
virtual void mouseDoubleClickEvent( QMouseEvent * );
virtual void paintEvent( QPaintEvent * );
midiTime getSampleLength( void ) const;
@@ -120,7 +125,7 @@ public:
sampleTrack( trackContainer * _tc );
virtual ~sampleTrack();
virtual trackTypes trackType( void ) const;
virtual trackTypes type( void ) const;
virtual bool FASTCALL play( const midiTime & _start,
Uint32 _start_frame, Uint32 _frames,
Uint32 _frame_base,
@@ -144,6 +149,7 @@ public slots:
private:
nameLabel * m_trackLabel;
audioPort * m_audioPort;
} ;

View File

@@ -1,8 +1,9 @@
/*
* setup_dialog.h - dialog for setting up LMMS
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -39,8 +40,9 @@
#endif
#include "audio_device.h"
#include "midi_device.h"
#include "midi_client.h"
class QComboBox;
@@ -84,6 +86,7 @@ private slots:
void toggleToolTips( bool _disabled );
void toggleKnobUsability( bool _classical );
void toggleGIMPLikeWindows( bool _enabled );
private:
@@ -95,10 +98,11 @@ private:
bool m_disableToolTips;
bool m_classicalKnobUsability;
bool m_gimpLikeWindows;
typedef QMap<QString, audioDevice::setupWidget *> aswMap;
typedef QMap<QString, midiDevice::setupWidget *> mswMap;
typedef QMap<QString, midiClient::setupWidget *> mswMap;
QComboBox * m_audioInterfaces;
aswMap m_audioIfaceSetupWidgets;

View File

@@ -1,8 +1,9 @@
/*
* side_bar.h - code for side-bar in LMMS
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -1,8 +1,9 @@
/*
* side_bar_widget.h - base-class for all side-bar-widgets
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -48,7 +49,7 @@ class sideBarWidget : public QWidget
public:
sideBarWidget( const QString & _title, const QPixmap & _icon,
QWidget * _parent );
~sideBarWidget();
virtual ~sideBarWidget();
inline const QPixmap & icon( void ) const
{
return( m_icon );
@@ -60,9 +61,9 @@ public:
protected:
void paintEvent( QPaintEvent * _pe );
void resizeEvent( QResizeEvent * _re );
inline void contextMenuEvent( QContextMenuEvent * )
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re );
inline virtual void contextMenuEvent( QContextMenuEvent * )
{
}

View File

@@ -2,8 +2,9 @@
* song_editor.h - declaration of class songEditor, a window where you can
* setup your songs
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -26,42 +27,27 @@
#ifndef _SONG_EDITOR_H
#define _SONG_EDITOR_H
#include "qt3support.h"
#ifdef QT4
#include <QMap>
#else
#include <qmap.h>
#endif
#include "lmms_main_win.h"
#include "track_container.h"
#include "types.h"
class QComboBox;
class QLabel;
class QPixmap;
class QPushButton;
class QScrollBar;
class QSlider;
class QToolButton;
class exportProjectDialog;
class lcdSpinBox;
class lmmsMainWin;
class pattern;
class projectNotes;
class textFloat;
class timeLine;
class visualizationWidget;
class toolButton;
const int MIN_BPM = 10;
const int DEFAULT_BPM = 140;
const int MAX_BPM = 1000;
const int MAX_BPM = 999;
const Uint16 MAX_SONG_LENGTH = 9999;
@@ -139,19 +125,22 @@ public:
return( m_exporting == TRUE &&
m_playPos[PLAY_SONG].getTact() >= lengthInTacts() + 1 );
}
inline void setExportProjectDialog( exportProjectDialog * _epd )
{
m_epd = _epd;
}
inline playModes playMode( void ) const
{
return( m_playMode );
}
inline playPos & getPlayPos( playModes _pm )
{
return( m_playPos[_pm] );
}
tact lengthInTacts( void ) const;
int getBPM( void );
// every function that replaces current file (e.g. creates new file,
// opens another file...) has to call this before and may only process
// if this function returns true
@@ -223,9 +212,8 @@ protected:
protected slots:
void insertTact( void );
void removeTact( void );
void addChannelTrack( void );
void insertBar( void );
void removeBar( void );
void addBBTrack( void );
void addSampleTrack( void );
void scrolled( int _new_pos );
@@ -239,10 +227,11 @@ protected slots:
void masterPitchPressed( void );
void masterPitchMoved( int _new_val );
void masterPitchReleased( void );
void toggleHQMode( void );
void updatePosition( const midiTime & _t );
void zoomingChanged( const QString & _zfac );
private:
songEditor();
@@ -258,7 +247,6 @@ private:
}
midiTime length( void ) const;
tact lengthInTacts( void ) const;
inline tact64th currentTact64th( void ) const
{
return( m_playPos[m_playMode].getTact64th() );
@@ -272,22 +260,23 @@ private:
QScrollBar * m_leftRightScroll;
QToolButton * m_playButton;
QToolButton * m_stopButton;
QWidget * m_toolBar;
toolButton * m_playButton;
toolButton * m_stopButton;
lcdSpinBox * m_bpmSpinBox;
QSlider * m_masterVolumeSlider;
QSlider * m_masterPitchSlider;
textFloat * m_mvsStatus;
textFloat * m_mpsStatus;
visualizationWidget * m_masterOutputGraph;
QToolButton * m_addChannelTrackButton;
QToolButton * m_addBBTrackButton;
QToolButton * m_addSampleTrackButton;
QToolButton * m_insertTactButton;
QToolButton * m_removeTactButton;
toolButton * m_addBBTrackButton;
toolButton * m_addSampleTrackButton;
toolButton * m_insertBarButton;
toolButton * m_removeBarButton;
QComboBox * m_zoomingComboBox;
QString m_fileName;
@@ -298,6 +287,8 @@ private:
volatile bool m_playing;
volatile bool m_paused;
bool m_loadingProject;
playModes m_playMode;
playPos m_playPos[PLAY_MODE_CNT];
@@ -307,8 +298,6 @@ private:
bool m_scrollBack;
exportProjectDialog * m_epd;
projectNotes * m_projectNotes;
@@ -324,12 +313,7 @@ private:
void doActions( void );
bool m_shiftPressed;
bool m_controlPressed;
friend lmmsMainWin::~lmmsMainWin();
friend class lmmsMainWin;

View File

@@ -1,8 +1,9 @@
/*
* spc_bg_hndl_widget.h - class specialBgHandlingWidget
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -0,0 +1,65 @@
/*
* string_pair_drag.h - class stringPairDrag which provides general support
* for drag'n'drop of string-pairs
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _STRING_PAIR_DRAG_H
#define _STRING_PAIR_DRAG_H
#include "qt3support.h"
#ifdef QT4
#include <QDrag>
#else
#include <qdragobject.h>
#endif
class QPixmap;
class stringPairDrag : public
#ifdef QT4
QDrag
#else
QStoredDrag
#endif
{
public:
stringPairDrag( const QString & _key, const QString & _value,
const QPixmap & _icon, QWidget * _w );
~stringPairDrag();
static bool processDragEnterEvent( QDragEnterEvent * _dee,
const QString & _allowed_keys );
static QString decodeKey( QDropEvent * _de );
static QString decodeValue( QDropEvent * _de );
} ;
#endif

View File

@@ -3,8 +3,9 @@
* position of a channel + calculation of volume for each
* speaker
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -1,8 +1,9 @@
/*
* tab_bar.h - class tabBar
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -1,8 +1,9 @@
/*
* tab_button.h - declaration of class tabButton
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public

View File

@@ -1,8 +1,9 @@
/*
* tab_widget.h - LMMS-tabwidget
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -25,35 +26,52 @@
#ifndef _TAB_WIDGET_H
#define _TAB_WIDGET_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "qt3support.h"
#ifdef QT4
#include <QWidget>
#include <QVector>
#include <QMap>
#else
#include <qwidget.h>
#include <qvaluevector.h>
#include <qmap.h>
#endif
class tabWidget : public QWidget
#include "spc_bg_hndl_widget.h"
class tabWidget : public QWidget, public specialBgHandlingWidget
{
Q_OBJECT
public:
tabWidget( const QString & _caption, QWidget * _parent );
~tabWidget();
void addTab( QWidget * _w, const QString & _name );
void FASTCALL addTab( QWidget * _w, const QString & _name,
int _idx = -1 );
void FASTCALL setActiveTab( int _idx );
inline int activeTab( void ) const
{
return( m_activeTab );
}
protected:
virtual void mousePressEvent( QMouseEvent * _me );
virtual void paintEvent( QPaintEvent * _pe );
virtual void resizeEvent( QResizeEvent * _re );
virtual void wheelEvent( QWheelEvent * _we );
private:
@@ -63,10 +81,10 @@ private:
QString name; // name for widget
int nwidth; // width of name when painting
} ;
typedef vvector<widgetDesc> widgetStack;
typedef QMap<int, widgetDesc> widgetStack;
widgetStack m_widgets;
int m_curWidget;
int m_activeTab;
QString m_caption;
} ;

View File

@@ -1,8 +1,9 @@
/*
* templates.h - miscellanous templates and algorithms
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -30,14 +31,10 @@
#ifdef QT4
#include <QtAlgorithms>
#include <QX11Info>
#include <QFont>
#else
#include <qtl.h>
#include <qpaintdevice.h>
#include <qfont.h>
#endif
@@ -86,17 +83,4 @@ inline T tLimit( const T & x, const T & x1, const T & x2 )
}
template<int SIZE>
inline QFont pointSize( QFont _f )
{
const int DPI = 96;
#ifdef QT4
_f.setPointSizeF( SIZE * DPI / QX11Info::appDpiX() );
#else
_f.setPointSizeFloat( SIZE * DPI / QPaintDevice::x11AppDpiX() );
#endif
return( _f );
}
#endif

112
include/tempo_sync_knob.h Normal file
View File

@@ -0,0 +1,112 @@
/*
* tempo_sync_knob.h - adds bpm to ms conversion for knob class
*
* Copyright (c) 2005 Danny McRae <khjklujn@yahoo.com>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _TEMPO_SYNC_KNOB_H
#define _TEMPO_SYNC_KNOB_H
#ifdef QT4
#include <QPixmap>
#else
#include <qpixmap.h>
#endif
#include "knob.h"
class QAction;
class tempoSyncKnob : public knob
{
Q_OBJECT
public:
enum tempoSyncMode
{
NO_SYNC,
DOUBLE_WHOLE_NOTE,
WHOLE_NOTE,
HALF_NOTE,
QUARTER_NOTE,
EIGHTH_NOTE,
SIXTEENTH_NOTE,
THIRTYSECOND_NOTE
} ;
tempoSyncKnob( int _knob_num, QWidget * _parent, const QString & _name,
float _scale = 1.0f );
virtual ~tempoSyncKnob();
tempoSyncMode getSyncMode( void );
void setSyncMode( tempoSyncMode _new_mode );
float getScale( void );
void setScale( float _new_scale );
const QString & getSyncDescription( void );
void setSyncDescription( const QString & _new_description );
const QPixmap & getSyncIcon( void );
void setSyncIcon( const QPixmap & _new_pix );
signals:
void syncModeChanged( tempoSyncMode _new_mode );
void scaleChanged( float _new_scale );
void syncDescriptionChanged( const QString & _new_description );
void syncIconChanged( void );
public slots:
void setTempoSync( int _note_type );
void setTempoSync( QAction * _item );
protected:
virtual void mouseMoveEvent( QMouseEvent * _me );
virtual void contextMenuEvent( QContextMenuEvent * _me );
virtual void wheelEvent( QWheelEvent * _me );
protected slots:
void calculateTempoSyncTime( int _bpm );
private:
tempoSyncMode m_tempoSyncMode;
float m_scale;
QPixmap m_tempoSyncIcon;
QString m_tempoSyncDescription;
tempoSyncMode m_tempoLastSyncMode;
} ;
#endif

View File

@@ -1,8 +1,9 @@
/*
* text_float.h - class textFloat, a floating text-label
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -30,10 +31,12 @@
#ifdef QT4
#include <QWidget>
#include <QPixmap>
#else
#include <qwidget.h>
#include <qpixmap.h>
#endif
@@ -46,19 +49,38 @@ public:
{
}
void setTitle( const QString & _title );
void setText( const QString & _text );
void setPixmap( const QPixmap & _pixmap );
void reparent( QWidget * _new_parent );
void setVisibilityTimeOut( int _msecs );
static textFloat * displayMessage( const QString & _msg,
int _timeout = 2000,
QWidget * _parent = NULL,
int _add_y_margin = 0 );
static textFloat * displayMessage( const QString & _title,
const QString & _msg,
const QPixmap & _pixmap =
QPixmap(),
int _timeout = 2000,
QWidget * _parent = NULL );
protected:
virtual void paintEvent( QPaintEvent * _me );
virtual void mousePressEvent( QMouseEvent * _me );
private:
void updateSize( void );
QString m_title;
QString m_text;
QPixmap m_pixmap;
} ;

View File

@@ -1,8 +1,9 @@
/*
* timeline.h - class timeLine, representing a time-line with position marker
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -43,12 +44,29 @@
class QPixmap;
class nStateButton;
class textFloat;
class timeLine : public QWidget
{
Q_OBJECT
public:
enum autoScrollStates
{
AUTOSCROLL_ENABLED, AUTOSCROLL_DISABLED
} ;
enum loopPointStates
{
LOOP_POINTS_DISABLED, LOOP_POINTS_ENABLED
} ;
enum behaviourAtStopStates
{
BACK_TO_ZERO, BACK_TO_START, KEEP_STOP_POSITION
} ;
timeLine( int _xoff, int _yoff, float _ppt, songEditor::playPos & _pos,
const midiTime & _begin, QWidget * _parent );
~timeLine();
@@ -58,20 +76,22 @@ public:
return( m_pos );
}
enum behaviourAtStopStates
behaviourAtStopStates behaviourAtStop( void ) const
{
BACK_TO_ZERO, BACK_TO_START, KEEP_STOP_POSITION
} ;
return( m_behaviourAtStop );
}
bool loopPointsEnabled( void ) const
{
return( m_loopPoints == LOOP_POINTS_ENABLED );
}
behaviourAtStopStates behaviourAtStop( void ) const;
bool loopPointsEnabled( void ) const;
inline const midiTime & loopBegin( void ) const
{
return( ( m_loopPos[0] < m_loopPos[1] ) ?
m_loopPos[0] : m_loopPos[1] );
}
inline const midiTime & loopEnd( void ) const
{
return( ( m_loopPos[0] > m_loopPos[1] ) ?
@@ -93,10 +113,15 @@ public:
update();
}
void addToolButtons( QWidget * _tool_bar );
public slots:
void updatePosition( const midiTime & = 0 );
void toggleAutoScroll( int _n );
void toggleLoopPoints( int _n );
void toggleBehaviourAtStop( int _n );
void checkForUpdatedPosition( void );
protected:
@@ -117,10 +142,13 @@ private:
static QPixmap * s_timeLinePixmap;
static QPixmap * s_posMarkerPixmap;
static QPixmap * s_loopPointPixmap;
static QPixmap * s_loopPointDisabledPixmap;
nStateButton * m_autoScroll;
nStateButton * m_loopPoints;
nStateButton * m_behaviourAtStop;
autoScrollStates m_autoScroll;
loopPointStates m_loopPoints;
behaviourAtStopStates m_behaviourAtStop;
bool m_changedPosition;
int m_xOffset;
int m_posMarkerX;
@@ -132,6 +160,9 @@ private:
midiTime m_savedPos;
textFloat * m_hint;
enum actions
{
NONE, MOVE_POS_MARKER, MOVE_LOOP_BEGIN, MOVE_LOOP_END
@@ -140,17 +171,6 @@ private:
int m_moveXOff;
enum autoScrollStates
{
AUTOSCROLL_ENABLED, AUTOSCROLL_DISABLED
} ;
enum loopPointStates
{
LOOP_POINTS_DISABLED, LOOP_POINTS_ENABLED
} ;
signals:
void positionChanged( const midiTime & _t );

95
include/tool_button.h Normal file
View File

@@ -0,0 +1,95 @@
/*
* tool_button.h - declaration of class toolButton
*
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _TOOL_BUTTON_H
#define _TOOL_BUTTON_H
#include "qt3support.h"
#ifdef QT4
#include <QToolButton>
#include <QColor>
#else
#include <qtoolbutton.h>
#include <qcolor.h>
#endif
class toolButton : public QToolButton
{
public:
toolButton( const QPixmap & _pixmap, const QString & _tooltip,
QObject * _receiver, const char * _slot,
QWidget * _parent );
inline toolButton( QWidget * _parent ) :
QToolButton( _parent ),
m_colorStandard( s_stdColor ),
m_colorHighlighted( s_hlColor )
{
// setup colors
leaveEvent( NULL );
}
~toolButton();
inline void setStandardColor( const QColor & _color )
{
m_colorStandard = _color;
}
inline void setHighlightedColor( const QColor & _color )
{
m_colorHighlighted = _color;
}
#ifndef QT4
inline void setIcon( const QPixmap & _icon )
{
setIconSet( _icon );
}
#endif
protected:
virtual void enterEvent( QEvent * _ev );
virtual void leaveEvent( QEvent * _ev );
private:
static const QColor s_stdColor;
static const QColor s_hlColor;
QColor m_colorStandard;
QColor m_colorHighlighted;
} ;
#endif

View File

@@ -1,8 +1,9 @@
/*
* tooltip.h - namespace toolTip, a tooltip-wrapper for LMMS
*
* Linux MultiMedia Studio
* Copyright (c) 2004-2005 Tobias Doerffel <tobydox@users.sourceforge.net>
* Copyright (c) 2005 Tobias Doerffel <tobydox/at/users.sourceforge.net>
*
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
@@ -34,7 +35,6 @@ namespace toolTip
{
void add( QWidget * _w, const QString & _txt );
//void remove( QWidget * _w );
} ;

Some files were not shown because too many files have changed in this diff Show More